api-farmer 0.0.19 → 0.0.21

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.
@@ -1,4374 +0,0 @@
1
- import "./chunk-6OIOYGN7.js";
2
-
3
- // node_modules/.pnpm/prettier@3.4.2/node_modules/prettier/plugins/estree.mjs
4
- var Xa = Object.defineProperty;
5
- var Js = (e) => {
6
- throw TypeError(e);
7
- };
8
- var Ar = (e, t) => {
9
- for (var r in t) Xa(e, r, { get: t[r], enumerable: true });
10
- };
11
- var qs = (e, t, r) => t.has(e) || Js("Cannot " + r);
12
- var pt = (e, t, r) => (qs(e, t, "read from private field"), r ? r.call(e) : t.get(e));
13
- var Ws = (e, t, r) => t.has(e) ? Js("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r);
14
- var Gs = (e, t, r, n) => (qs(e, t, "write to private field"), n ? n.call(e, r) : t.set(e, r), r);
15
- var _s = {};
16
- Ar(_s, { languages: () => om, options: () => Ja, printers: () => am });
17
- var Us = [{ linguistLanguageId: 183, name: "JavaScript", type: "programming", tmScope: "source.js", aceMode: "javascript", codemirrorMode: "javascript", codemirrorMimeType: "text/javascript", color: "#f1e05a", aliases: ["js", "node"], extensions: [".js", "._js", ".bones", ".cjs", ".es", ".es6", ".frag", ".gs", ".jake", ".javascript", ".jsb", ".jscad", ".jsfl", ".jslib", ".jsm", ".jspre", ".jss", ".mjs", ".njs", ".pac", ".sjs", ".ssjs", ".xsjs", ".xsjslib", ".wxs"], filenames: ["Jakefile"], interpreters: ["chakra", "d8", "gjs", "js", "node", "nodejs", "qjs", "rhino", "v8", "v8-shell", "zx"], parsers: ["babel", "acorn", "espree", "meriyah", "babel-flow", "babel-ts", "flow", "typescript"], vscodeLanguageIds: ["javascript", "mongo"] }, { linguistLanguageId: 183, name: "Flow", type: "programming", tmScope: "source.js", aceMode: "javascript", codemirrorMode: "javascript", codemirrorMimeType: "text/javascript", color: "#f1e05a", aliases: [], extensions: [".js.flow"], filenames: [], interpreters: ["chakra", "d8", "gjs", "js", "node", "nodejs", "qjs", "rhino", "v8", "v8-shell"], parsers: ["flow", "babel-flow"], vscodeLanguageIds: ["javascript"] }, { linguistLanguageId: 183, name: "JSX", type: "programming", tmScope: "source.js.jsx", aceMode: "javascript", codemirrorMode: "jsx", codemirrorMimeType: "text/jsx", color: void 0, aliases: void 0, extensions: [".jsx"], filenames: void 0, interpreters: void 0, parsers: ["babel", "babel-flow", "babel-ts", "flow", "typescript", "espree", "meriyah"], vscodeLanguageIds: ["javascriptreact"], group: "JavaScript" }, { linguistLanguageId: 378, name: "TypeScript", type: "programming", color: "#3178c6", aliases: ["ts"], interpreters: ["deno", "ts-node"], extensions: [".ts", ".cts", ".mts"], tmScope: "source.ts", aceMode: "typescript", codemirrorMode: "javascript", codemirrorMimeType: "application/typescript", parsers: ["typescript", "babel-ts"], vscodeLanguageIds: ["typescript"] }, { linguistLanguageId: 94901924, name: "TSX", type: "programming", color: "#3178c6", group: "TypeScript", extensions: [".tsx"], tmScope: "source.tsx", aceMode: "javascript", codemirrorMode: "jsx", codemirrorMimeType: "text/jsx", parsers: ["typescript", "babel-ts"], vscodeLanguageIds: ["typescriptreact"] }];
18
- var ws = {};
19
- Ar(ws, { canAttachComment: () => Ap, embed: () => Zu, experimentalFeatures: () => tm, getCommentChildNodes: () => Tp, getVisitorKeys: () => gr, handleComments: () => $n, insertPragma: () => ci, isBlockComment: () => ee, isGap: () => dp, massageAstNode: () => Au, print: () => Oa, printComment: () => ku, willPrintOwnComments: () => Kn });
20
- var Ya = (e, t, r, n) => {
21
- if (!(e && t == null)) return t.replaceAll ? t.replaceAll(r, n) : r.global ? t.replace(r, n) : t.split(r).join(n);
22
- };
23
- var Y = Ya;
24
- var Ha = (e, t, r) => {
25
- if (!(e && t == null)) return Array.isArray(t) || typeof t == "string" ? t[r < 0 ? t.length + r : r] : t.at(r);
26
- };
27
- var _ = Ha;
28
- function Na(e) {
29
- return e !== null && typeof e == "object";
30
- }
31
- var Xs = Na;
32
- function* Va(e, t) {
33
- let { getVisitorKeys: r, filter: n = () => true } = t, s = (u) => Xs(u) && n(u);
34
- for (let u of r(e)) {
35
- let i = e[u];
36
- if (Array.isArray(i)) for (let a of i) s(a) && (yield a);
37
- else s(i) && (yield i);
38
- }
39
- }
40
- function* $a(e, t) {
41
- let r = [e];
42
- for (let n = 0; n < r.length; n++) {
43
- let s = r[n];
44
- for (let u of Va(s, t)) yield u, r.push(u);
45
- }
46
- }
47
- function Ys(e, { getVisitorKeys: t, predicate: r }) {
48
- for (let n of $a(e, { getVisitorKeys: t })) if (r(n)) return true;
49
- return false;
50
- }
51
- var Hs = () => /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
52
- function Ns(e) {
53
- return e === 12288 || e >= 65281 && e <= 65376 || e >= 65504 && e <= 65510;
54
- }
55
- function Vs(e) {
56
- return e >= 4352 && e <= 4447 || e === 8986 || e === 8987 || e === 9001 || e === 9002 || e >= 9193 && e <= 9196 || e === 9200 || e === 9203 || e === 9725 || e === 9726 || e === 9748 || e === 9749 || e >= 9776 && e <= 9783 || e >= 9800 && e <= 9811 || e === 9855 || e >= 9866 && e <= 9871 || e === 9875 || e === 9889 || e === 9898 || e === 9899 || e === 9917 || e === 9918 || e === 9924 || e === 9925 || e === 9934 || e === 9940 || e === 9962 || e === 9970 || e === 9971 || e === 9973 || e === 9978 || e === 9981 || e === 9989 || e === 9994 || e === 9995 || e === 10024 || e === 10060 || e === 10062 || e >= 10067 && e <= 10069 || e === 10071 || e >= 10133 && e <= 10135 || e === 10160 || e === 10175 || e === 11035 || e === 11036 || e === 11088 || e === 11093 || e >= 11904 && e <= 11929 || e >= 11931 && e <= 12019 || e >= 12032 && e <= 12245 || e >= 12272 && e <= 12287 || e >= 12289 && e <= 12350 || e >= 12353 && e <= 12438 || e >= 12441 && e <= 12543 || e >= 12549 && e <= 12591 || e >= 12593 && e <= 12686 || e >= 12688 && e <= 12773 || e >= 12783 && e <= 12830 || e >= 12832 && e <= 12871 || e >= 12880 && e <= 42124 || e >= 42128 && e <= 42182 || e >= 43360 && e <= 43388 || e >= 44032 && e <= 55203 || e >= 63744 && e <= 64255 || e >= 65040 && e <= 65049 || e >= 65072 && e <= 65106 || e >= 65108 && e <= 65126 || e >= 65128 && e <= 65131 || e >= 94176 && e <= 94180 || e === 94192 || e === 94193 || e >= 94208 && e <= 100343 || e >= 100352 && e <= 101589 || e >= 101631 && e <= 101640 || e >= 110576 && e <= 110579 || e >= 110581 && e <= 110587 || e === 110589 || e === 110590 || e >= 110592 && e <= 110882 || e === 110898 || e >= 110928 && e <= 110930 || e === 110933 || e >= 110948 && e <= 110951 || e >= 110960 && e <= 111355 || e >= 119552 && e <= 119638 || e >= 119648 && e <= 119670 || e === 126980 || e === 127183 || e === 127374 || e >= 127377 && e <= 127386 || e >= 127488 && e <= 127490 || e >= 127504 && e <= 127547 || e >= 127552 && e <= 127560 || e === 127568 || e === 127569 || e >= 127584 && e <= 127589 || e >= 127744 && e <= 127776 || e >= 127789 && e <= 127797 || e >= 127799 && e <= 127868 || e >= 127870 && e <= 127891 || e >= 127904 && e <= 127946 || e >= 127951 && e <= 127955 || e >= 127968 && e <= 127984 || e === 127988 || e >= 127992 && e <= 128062 || e === 128064 || e >= 128066 && e <= 128252 || e >= 128255 && e <= 128317 || e >= 128331 && e <= 128334 || e >= 128336 && e <= 128359 || e === 128378 || e === 128405 || e === 128406 || e === 128420 || e >= 128507 && e <= 128591 || e >= 128640 && e <= 128709 || e === 128716 || e >= 128720 && e <= 128722 || e >= 128725 && e <= 128727 || e >= 128732 && e <= 128735 || e === 128747 || e === 128748 || e >= 128756 && e <= 128764 || e >= 128992 && e <= 129003 || e === 129008 || e >= 129292 && e <= 129338 || e >= 129340 && e <= 129349 || e >= 129351 && e <= 129535 || e >= 129648 && e <= 129660 || e >= 129664 && e <= 129673 || e >= 129679 && e <= 129734 || e >= 129742 && e <= 129756 || e >= 129759 && e <= 129769 || e >= 129776 && e <= 129784 || e >= 131072 && e <= 196605 || e >= 196608 && e <= 262141;
57
- }
58
- var $s = (e) => !(Ns(e) || Vs(e));
59
- var Ka = /[^\x20-\x7F]/u;
60
- function Qa(e) {
61
- if (!e) return 0;
62
- if (!Ka.test(e)) return e.length;
63
- e = e.replace(Hs(), " ");
64
- let t = 0;
65
- for (let r of e) {
66
- let n = r.codePointAt(0);
67
- n <= 31 || n >= 127 && n <= 159 || n >= 768 && n <= 879 || (t += $s(n) ? 1 : 2);
68
- }
69
- return t;
70
- }
71
- var ze = Qa;
72
- function Tr(e) {
73
- return (t, r, n) => {
74
- let s = !!(n != null && n.backwards);
75
- if (r === false) return false;
76
- let { length: u } = t, i = r;
77
- for (; i >= 0 && i < u; ) {
78
- let a = t.charAt(i);
79
- if (e instanceof RegExp) {
80
- if (!e.test(a)) return i;
81
- } else if (!e.includes(a)) return i;
82
- s ? i-- : i++;
83
- }
84
- return i === -1 || i === u ? i : false;
85
- };
86
- }
87
- var Bm = Tr(/\s/u);
88
- var We = Tr(" ");
89
- var Ks = Tr(",; ");
90
- var Qs = Tr(/[^\n\r]/u);
91
- function za(e, t, r) {
92
- let n = !!(r != null && r.backwards);
93
- if (t === false) return false;
94
- let s = e.charAt(t);
95
- if (n) {
96
- if (e.charAt(t - 1) === "\r" && s === `
97
- `) return t - 2;
98
- if (s === `
99
- ` || s === "\r" || s === "\u2028" || s === "\u2029") return t - 1;
100
- } else {
101
- if (s === "\r" && e.charAt(t + 1) === `
102
- `) return t + 2;
103
- if (s === `
104
- ` || s === "\r" || s === "\u2028" || s === "\u2029") return t + 1;
105
- }
106
- return t;
107
- }
108
- var Ge = za;
109
- function Za(e, t, r = {}) {
110
- let n = We(e, r.backwards ? t - 1 : t, r), s = Ge(e, n, r);
111
- return n !== s;
112
- }
113
- var Z = Za;
114
- function eo(e, t) {
115
- if (t === false) return false;
116
- if (e.charAt(t) === "/" && e.charAt(t + 1) === "*") {
117
- for (let r = t + 2; r < e.length; ++r) if (e.charAt(r) === "*" && e.charAt(r + 1) === "/") return r + 2;
118
- }
119
- return t;
120
- }
121
- var Ot = eo;
122
- function to(e, t) {
123
- return t === false ? false : e.charAt(t) === "/" && e.charAt(t + 1) === "/" ? Qs(e, t) : t;
124
- }
125
- var _t = to;
126
- function ro(e, t) {
127
- let r = null, n = t;
128
- for (; n !== r; ) r = n, n = Ks(e, n), n = Ot(e, n), n = We(e, n);
129
- return n = _t(e, n), n = Ge(e, n), n !== false && Z(e, n);
130
- }
131
- var jt = ro;
132
- function no(e) {
133
- return Array.isArray(e) && e.length > 0;
134
- }
135
- var O = no;
136
- var zs = new Proxy(() => {
137
- }, { get: () => zs });
138
- var vt = zs;
139
- var dr = "'";
140
- var Zs = '"';
141
- function so(e, t) {
142
- let r = t === true || t === dr ? dr : Zs, n = r === dr ? Zs : dr, s = 0, u = 0;
143
- for (let i of e) i === r ? s++ : i === n && u++;
144
- return s > u ? n : r;
145
- }
146
- var xr = so;
147
- function uo(e, t, r) {
148
- let n = t === '"' ? "'" : '"', u = Y(false, e, /\\(.)|(["'])/gsu, (i, a, p) => a === n ? a : p === t ? "\\" + p : p || (r && /^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(a) ? a : "\\" + a));
149
- return t + u + t;
150
- }
151
- var eu = uo;
152
- function io(e, t) {
153
- vt(/^(?<quote>["']).*\k<quote>$/su.test(e));
154
- let r = e.slice(1, -1), n = t.parser === "json" || t.parser === "jsonc" || t.parser === "json5" && t.quoteProps === "preserve" && !t.singleQuote ? '"' : t.__isInHtmlAttribute ? "'" : xr(r, t.singleQuote);
155
- return e.charAt(0) === n ? e : eu(r, n, false);
156
- }
157
- var Ze = io;
158
- function q(e) {
159
- var n, s, u;
160
- let t = ((n = e.range) == null ? void 0 : n[0]) ?? e.start, r = (u = ((s = e.declaration) == null ? void 0 : s.decorators) ?? e.decorators) == null ? void 0 : u[0];
161
- return r ? Math.min(q(r), t) : t;
162
- }
163
- function k(e) {
164
- var t;
165
- return ((t = e.range) == null ? void 0 : t[1]) ?? e.end;
166
- }
167
- function Bt(e, t) {
168
- let r = q(e);
169
- return Number.isInteger(r) && r === q(t);
170
- }
171
- function ao(e, t) {
172
- let r = k(e);
173
- return Number.isInteger(r) && r === k(t);
174
- }
175
- function tu(e, t) {
176
- return Bt(e, t) && ao(e, t);
177
- }
178
- var Zt = null;
179
- function er(e) {
180
- if (Zt !== null && typeof Zt.property) {
181
- let t = Zt;
182
- return Zt = er.prototype = null, t;
183
- }
184
- return Zt = er.prototype = e ?? /* @__PURE__ */ Object.create(null), new er();
185
- }
186
- var oo = 10;
187
- for (let e = 0; e <= oo; e++) er();
188
- function In(e) {
189
- return er(e);
190
- }
191
- function po(e, t = "type") {
192
- In(e);
193
- function r(n) {
194
- let s = n[t], u = e[s];
195
- if (!Array.isArray(u)) throw Object.assign(new Error(`Missing visitor keys for '${s}'.`), { node: n });
196
- return u;
197
- }
198
- return r;
199
- }
200
- var hr = po;
201
- var ru = { ArrayExpression: ["elements"], AssignmentExpression: ["left", "right"], BinaryExpression: ["left", "right"], InterpreterDirective: [], Directive: ["value"], DirectiveLiteral: [], BlockStatement: ["directives", "body"], BreakStatement: ["label"], CallExpression: ["callee", "arguments", "typeParameters", "typeArguments"], CatchClause: ["param", "body"], ConditionalExpression: ["test", "consequent", "alternate"], ContinueStatement: ["label"], DebuggerStatement: [], DoWhileStatement: ["body", "test"], EmptyStatement: [], ExpressionStatement: ["expression"], File: ["program"], ForInStatement: ["left", "right", "body"], ForStatement: ["init", "test", "update", "body"], FunctionDeclaration: ["id", "typeParameters", "params", "returnType", "body", "predicate"], FunctionExpression: ["id", "typeParameters", "params", "returnType", "body"], Identifier: ["typeAnnotation", "decorators"], IfStatement: ["test", "consequent", "alternate"], LabeledStatement: ["label", "body"], StringLiteral: [], NumericLiteral: [], NullLiteral: [], BooleanLiteral: [], RegExpLiteral: [], LogicalExpression: ["left", "right"], MemberExpression: ["object", "property"], NewExpression: ["callee", "arguments", "typeParameters", "typeArguments"], Program: ["directives", "body"], ObjectExpression: ["properties"], ObjectMethod: ["decorators", "key", "typeParameters", "params", "returnType", "body"], ObjectProperty: ["key", "value", "decorators"], RestElement: ["argument", "typeAnnotation", "decorators"], ReturnStatement: ["argument"], SequenceExpression: ["expressions"], ParenthesizedExpression: ["expression"], SwitchCase: ["test", "consequent"], SwitchStatement: ["discriminant", "cases"], ThisExpression: [], ThrowStatement: ["argument"], TryStatement: ["block", "handler", "finalizer"], UnaryExpression: ["argument"], UpdateExpression: ["argument"], VariableDeclaration: ["declarations"], VariableDeclarator: ["id", "init"], WhileStatement: ["test", "body"], WithStatement: ["object", "body"], AssignmentPattern: ["left", "right", "decorators", "typeAnnotation"], ArrayPattern: ["elements", "typeAnnotation", "decorators"], ArrowFunctionExpression: ["typeParameters", "params", "returnType", "body", "predicate"], ClassBody: ["body"], ClassExpression: ["decorators", "id", "typeParameters", "superClass", "superTypeParameters", "mixins", "implements", "body", "superTypeArguments"], ClassDeclaration: ["decorators", "id", "typeParameters", "superClass", "superTypeParameters", "mixins", "implements", "body", "superTypeArguments"], ExportAllDeclaration: ["source", "attributes", "exported"], ExportDefaultDeclaration: ["declaration"], ExportNamedDeclaration: ["declaration", "specifiers", "source", "attributes"], ExportSpecifier: ["local", "exported"], ForOfStatement: ["left", "right", "body"], ImportDeclaration: ["specifiers", "source", "attributes"], ImportDefaultSpecifier: ["local"], ImportNamespaceSpecifier: ["local"], ImportSpecifier: ["imported", "local"], ImportExpression: ["source", "options"], MetaProperty: ["meta", "property"], ClassMethod: ["decorators", "key", "typeParameters", "params", "returnType", "body"], ObjectPattern: ["properties", "typeAnnotation", "decorators"], SpreadElement: ["argument"], Super: [], TaggedTemplateExpression: ["tag", "typeParameters", "quasi", "typeArguments"], TemplateElement: [], TemplateLiteral: ["quasis", "expressions"], YieldExpression: ["argument"], AwaitExpression: ["argument"], BigIntLiteral: [], ExportNamespaceSpecifier: ["exported"], OptionalMemberExpression: ["object", "property"], OptionalCallExpression: ["callee", "arguments", "typeParameters", "typeArguments"], ClassProperty: ["decorators", "key", "typeAnnotation", "value", "variance"], ClassAccessorProperty: ["decorators", "key", "typeAnnotation", "value"], ClassPrivateProperty: ["decorators", "key", "typeAnnotation", "value", "variance"], ClassPrivateMethod: ["decorators", "key", "typeParameters", "params", "returnType", "body"], PrivateName: ["id"], StaticBlock: ["body"], AnyTypeAnnotation: [], ArrayTypeAnnotation: ["elementType"], BooleanTypeAnnotation: [], BooleanLiteralTypeAnnotation: [], NullLiteralTypeAnnotation: [], ClassImplements: ["id", "typeParameters"], DeclareClass: ["id", "typeParameters", "extends", "mixins", "implements", "body"], DeclareFunction: ["id", "predicate"], DeclareInterface: ["id", "typeParameters", "extends", "body"], DeclareModule: ["id", "body"], DeclareModuleExports: ["typeAnnotation"], DeclareTypeAlias: ["id", "typeParameters", "right"], DeclareOpaqueType: ["id", "typeParameters", "supertype"], DeclareVariable: ["id"], DeclareExportDeclaration: ["declaration", "specifiers", "source", "attributes"], DeclareExportAllDeclaration: ["source", "attributes"], DeclaredPredicate: ["value"], ExistsTypeAnnotation: [], FunctionTypeAnnotation: ["typeParameters", "params", "rest", "returnType", "this"], FunctionTypeParam: ["name", "typeAnnotation"], GenericTypeAnnotation: ["id", "typeParameters"], InferredPredicate: [], InterfaceExtends: ["id", "typeParameters"], InterfaceDeclaration: ["id", "typeParameters", "extends", "body"], InterfaceTypeAnnotation: ["extends", "body"], IntersectionTypeAnnotation: ["types"], MixedTypeAnnotation: [], EmptyTypeAnnotation: [], NullableTypeAnnotation: ["typeAnnotation"], NumberLiteralTypeAnnotation: [], NumberTypeAnnotation: [], ObjectTypeAnnotation: ["properties", "indexers", "callProperties", "internalSlots"], ObjectTypeInternalSlot: ["id", "value"], ObjectTypeCallProperty: ["value"], ObjectTypeIndexer: ["variance", "id", "key", "value"], ObjectTypeProperty: ["key", "value", "variance"], ObjectTypeSpreadProperty: ["argument"], OpaqueType: ["id", "typeParameters", "supertype", "impltype"], QualifiedTypeIdentifier: ["qualification", "id"], StringLiteralTypeAnnotation: [], StringTypeAnnotation: [], SymbolTypeAnnotation: [], ThisTypeAnnotation: [], TupleTypeAnnotation: ["types", "elementTypes"], TypeofTypeAnnotation: ["argument", "typeArguments"], TypeAlias: ["id", "typeParameters", "right"], TypeAnnotation: ["typeAnnotation"], TypeCastExpression: ["expression", "typeAnnotation"], TypeParameter: ["bound", "default", "variance"], TypeParameterDeclaration: ["params"], TypeParameterInstantiation: ["params"], UnionTypeAnnotation: ["types"], Variance: [], VoidTypeAnnotation: [], EnumDeclaration: ["id", "body"], EnumBooleanBody: ["members"], EnumNumberBody: ["members"], EnumStringBody: ["members"], EnumSymbolBody: ["members"], EnumBooleanMember: ["id", "init"], EnumNumberMember: ["id", "init"], EnumStringMember: ["id", "init"], EnumDefaultedMember: ["id"], IndexedAccessType: ["objectType", "indexType"], OptionalIndexedAccessType: ["objectType", "indexType"], JSXAttribute: ["name", "value"], JSXClosingElement: ["name"], JSXElement: ["openingElement", "children", "closingElement"], JSXEmptyExpression: [], JSXExpressionContainer: ["expression"], JSXSpreadChild: ["expression"], JSXIdentifier: [], JSXMemberExpression: ["object", "property"], JSXNamespacedName: ["namespace", "name"], JSXOpeningElement: ["name", "attributes", "typeArguments", "typeParameters"], JSXSpreadAttribute: ["argument"], JSXText: [], JSXFragment: ["openingFragment", "children", "closingFragment"], JSXOpeningFragment: [], JSXClosingFragment: [], Noop: [], Placeholder: [], V8IntrinsicIdentifier: [], ArgumentPlaceholder: [], BindExpression: ["object", "callee"], ImportAttribute: ["key", "value"], Decorator: ["expression"], DoExpression: ["body"], ExportDefaultSpecifier: ["exported"], RecordExpression: ["properties"], TupleExpression: ["elements"], ModuleExpression: ["body"], TopicReference: [], PipelineTopicExpression: ["expression"], PipelineBareFunction: ["callee"], PipelinePrimaryTopicReference: [], TSParameterProperty: ["parameter", "decorators"], TSDeclareFunction: ["id", "typeParameters", "params", "returnType", "body"], TSDeclareMethod: ["decorators", "key", "typeParameters", "params", "returnType"], TSQualifiedName: ["left", "right"], TSCallSignatureDeclaration: ["typeParameters", "parameters", "typeAnnotation", "params", "returnType"], TSConstructSignatureDeclaration: ["typeParameters", "parameters", "typeAnnotation", "params", "returnType"], TSPropertySignature: ["key", "typeAnnotation"], TSMethodSignature: ["key", "typeParameters", "parameters", "typeAnnotation", "params", "returnType"], TSIndexSignature: ["parameters", "typeAnnotation"], TSAnyKeyword: [], TSBooleanKeyword: [], TSBigIntKeyword: [], TSIntrinsicKeyword: [], TSNeverKeyword: [], TSNullKeyword: [], TSNumberKeyword: [], TSObjectKeyword: [], TSStringKeyword: [], TSSymbolKeyword: [], TSUndefinedKeyword: [], TSUnknownKeyword: [], TSVoidKeyword: [], TSThisType: [], TSFunctionType: ["typeParameters", "parameters", "typeAnnotation", "params", "returnType"], TSConstructorType: ["typeParameters", "parameters", "typeAnnotation", "params", "returnType"], TSTypeReference: ["typeName", "typeParameters", "typeArguments"], TSTypePredicate: ["parameterName", "typeAnnotation"], TSTypeQuery: ["exprName", "typeParameters", "typeArguments"], TSTypeLiteral: ["members"], TSArrayType: ["elementType"], TSTupleType: ["elementTypes"], TSOptionalType: ["typeAnnotation"], TSRestType: ["typeAnnotation"], TSNamedTupleMember: ["label", "elementType"], TSUnionType: ["types"], TSIntersectionType: ["types"], TSConditionalType: ["checkType", "extendsType", "trueType", "falseType"], TSInferType: ["typeParameter"], TSParenthesizedType: ["typeAnnotation"], TSTypeOperator: ["typeAnnotation"], TSIndexedAccessType: ["objectType", "indexType"], TSMappedType: ["typeParameter", "nameType", "typeAnnotation"], TSLiteralType: ["literal"], TSExpressionWithTypeArguments: ["expression", "typeParameters"], TSInterfaceDeclaration: ["id", "typeParameters", "extends", "body"], TSInterfaceBody: ["body"], TSTypeAliasDeclaration: ["id", "typeParameters", "typeAnnotation"], TSInstantiationExpression: ["expression", "typeParameters", "typeArguments"], TSAsExpression: ["expression", "typeAnnotation"], TSSatisfiesExpression: ["expression", "typeAnnotation"], TSTypeAssertion: ["typeAnnotation", "expression"], TSEnumDeclaration: ["id", "members"], TSEnumMember: ["id", "initializer"], TSModuleDeclaration: ["id", "body"], TSModuleBlock: ["body"], TSImportType: ["argument", "qualifier", "typeParameters", "typeArguments"], TSImportEqualsDeclaration: ["id", "moduleReference"], TSExternalModuleReference: ["expression"], TSNonNullExpression: ["expression"], TSExportAssignment: ["expression"], TSNamespaceExportDeclaration: ["id"], TSTypeAnnotation: ["typeAnnotation"], TSTypeParameterInstantiation: ["params"], TSTypeParameterDeclaration: ["params"], TSTypeParameter: ["constraint", "default", "name"], ChainExpression: ["expression"], ExperimentalRestProperty: ["argument"], ExperimentalSpreadProperty: ["argument"], Literal: [], MethodDefinition: ["decorators", "key", "value"], PrivateIdentifier: [], Property: ["key", "value"], PropertyDefinition: ["decorators", "key", "typeAnnotation", "value", "variance"], AccessorProperty: ["decorators", "key", "typeAnnotation", "value"], TSAbstractAccessorProperty: ["decorators", "key", "typeAnnotation"], TSAbstractKeyword: [], TSAbstractMethodDefinition: ["key", "value"], TSAbstractPropertyDefinition: ["decorators", "key", "typeAnnotation"], TSAsyncKeyword: [], TSClassImplements: ["expression", "typeArguments", "typeParameters"], TSDeclareKeyword: [], TSEmptyBodyFunctionExpression: ["id", "typeParameters", "params", "returnType"], TSEnumBody: ["members"], TSExportKeyword: [], TSInterfaceHeritage: ["expression", "typeArguments", "typeParameters"], TSPrivateKeyword: [], TSProtectedKeyword: [], TSPublicKeyword: [], TSReadonlyKeyword: [], TSStaticKeyword: [], TSTemplateLiteralType: ["quasis", "types"], AsConstExpression: ["expression"], AsExpression: ["expression", "typeAnnotation"], BigIntLiteralTypeAnnotation: [], BigIntTypeAnnotation: [], ComponentDeclaration: ["id", "params", "body", "typeParameters", "rendersType"], ComponentParameter: ["name", "local"], ComponentTypeAnnotation: ["params", "rest", "typeParameters", "rendersType"], ComponentTypeParameter: ["name", "typeAnnotation"], ConditionalTypeAnnotation: ["checkType", "extendsType", "trueType", "falseType"], DeclareComponent: ["id", "params", "rest", "typeParameters", "rendersType"], DeclareEnum: ["id", "body"], DeclareHook: ["id"], DeclareNamespace: ["id", "body"], EnumBigIntBody: ["members"], EnumBigIntMember: ["id", "init"], HookDeclaration: ["id", "params", "body", "typeParameters", "returnType"], HookTypeAnnotation: ["params", "returnType", "rest", "typeParameters"], InferTypeAnnotation: ["typeParameter"], KeyofTypeAnnotation: ["argument"], ObjectTypeMappedTypeProperty: ["keyTparam", "propType", "sourceType", "variance"], QualifiedTypeofIdentifier: ["qualification", "id"], TupleTypeLabeledElement: ["label", "elementType", "variance"], TupleTypeSpreadElement: ["label", "typeAnnotation"], TypeOperator: ["typeAnnotation"], TypePredicate: ["parameterName", "typeAnnotation", "asserts"], NGRoot: ["node"], NGPipeExpression: ["left", "right", "arguments"], NGChainedExpression: ["expressions"], NGEmptyExpression: [], NGMicrosyntax: ["body"], NGMicrosyntaxKey: [], NGMicrosyntaxExpression: ["expression", "alias"], NGMicrosyntaxKeyedExpression: ["key", "expression"], NGMicrosyntaxLet: ["key", "value"], NGMicrosyntaxAs: ["key", "alias"], JsExpressionRoot: ["node"], JsonRoot: ["node"], TSJSDocAllType: [], TSJSDocUnknownType: [], TSJSDocNullableType: ["typeAnnotation"], TSJSDocNonNullableType: ["typeAnnotation"], NeverTypeAnnotation: [], UndefinedTypeAnnotation: [], UnknownTypeAnnotation: [], SatisfiesExpression: ["expression", "typeAnnotation"] };
202
- var co = hr(ru);
203
- var gr = co;
204
- function lo(e) {
205
- let t = new Set(e);
206
- return (r) => t.has(r == null ? void 0 : r.type);
207
- }
208
- var v = lo;
209
- var mo = v(["Block", "CommentBlock", "MultiLine"]);
210
- var ee = mo;
211
- var yo = v(["AnyTypeAnnotation", "ThisTypeAnnotation", "NumberTypeAnnotation", "VoidTypeAnnotation", "BooleanTypeAnnotation", "BigIntTypeAnnotation", "SymbolTypeAnnotation", "StringTypeAnnotation", "NeverTypeAnnotation", "UndefinedTypeAnnotation", "UnknownTypeAnnotation", "EmptyTypeAnnotation", "MixedTypeAnnotation"]);
212
- var Sr = yo;
213
- function Do(e, t) {
214
- let r = t.split(".");
215
- for (let n = r.length - 1; n >= 0; n--) {
216
- let s = r[n];
217
- if (n === 0) return e.type === "Identifier" && e.name === s;
218
- if (e.type !== "MemberExpression" || e.optional || e.computed || e.property.type !== "Identifier" || e.property.name !== s) return false;
219
- e = e.object;
220
- }
221
- }
222
- function fo(e, t) {
223
- return t.some((r) => Do(e, r));
224
- }
225
- var nu = fo;
226
- function Eo({ type: e }) {
227
- return e.startsWith("TS") && e.endsWith("Keyword");
228
- }
229
- var Br = Eo;
230
- function rr(e, t) {
231
- return t(e) || Ys(e, { getVisitorKeys: gr, predicate: t });
232
- }
233
- function Rt(e) {
234
- return e.type === "AssignmentExpression" || e.type === "BinaryExpression" || e.type === "LogicalExpression" || e.type === "NGPipeExpression" || e.type === "ConditionalExpression" || L(e) || W(e) || e.type === "SequenceExpression" || e.type === "TaggedTemplateExpression" || e.type === "BindExpression" || e.type === "UpdateExpression" && !e.prefix || Ae(e) || e.type === "TSNonNullExpression" || e.type === "ChainExpression";
235
- }
236
- function iu(e) {
237
- return e.expressions ? e.expressions[0] : e.left ?? e.test ?? e.callee ?? e.object ?? e.tag ?? e.argument ?? e.expression;
238
- }
239
- function Pr(e) {
240
- if (e.expressions) return ["expressions", 0];
241
- if (e.left) return ["left"];
242
- if (e.test) return ["test"];
243
- if (e.object) return ["object"];
244
- if (e.callee) return ["callee"];
245
- if (e.tag) return ["tag"];
246
- if (e.argument) return ["argument"];
247
- if (e.expression) return ["expression"];
248
- throw new Error("Unexpected node has no left side.");
249
- }
250
- var Ct = v(["Line", "CommentLine", "SingleLine", "HashbangComment", "HTMLOpen", "HTMLClose", "Hashbang", "InterpreterDirective"]);
251
- var au = v(["ExportDefaultDeclaration", "DeclareExportDeclaration", "ExportNamedDeclaration", "ExportAllDeclaration", "DeclareExportAllDeclaration"]);
252
- var X = v(["ArrayExpression", "TupleExpression"]);
253
- var se = v(["ObjectExpression", "RecordExpression"]);
254
- function ou(e) {
255
- return e.type === "LogicalExpression" && e.operator === "??";
256
- }
257
- function Fe(e) {
258
- return e.type === "NumericLiteral" || e.type === "Literal" && typeof e.value == "number";
259
- }
260
- function jn(e) {
261
- return e.type === "UnaryExpression" && (e.operator === "+" || e.operator === "-") && Fe(e.argument);
262
- }
263
- function te(e) {
264
- return !!(e && (e.type === "StringLiteral" || e.type === "Literal" && typeof e.value == "string"));
265
- }
266
- function vn(e) {
267
- return e.type === "RegExpLiteral" || e.type === "Literal" && !!e.regex;
268
- }
269
- var kr = v(["Literal", "BooleanLiteral", "BigIntLiteral", "DirectiveLiteral", "NullLiteral", "NumericLiteral", "RegExpLiteral", "StringLiteral"]);
270
- var Fo = v(["Identifier", "ThisExpression", "Super", "PrivateName", "PrivateIdentifier"]);
271
- var we = v(["ObjectTypeAnnotation", "TSTypeLiteral", "TSMappedType"]);
272
- var Mt = v(["FunctionExpression", "ArrowFunctionExpression"]);
273
- function Co(e) {
274
- return e.type === "FunctionExpression" || e.type === "ArrowFunctionExpression" && e.body.type === "BlockStatement";
275
- }
276
- function Ln(e) {
277
- return L(e) && e.callee.type === "Identifier" && ["async", "inject", "fakeAsync", "waitForAsync"].includes(e.callee.name);
278
- }
279
- var H = v(["JSXElement", "JSXFragment"]);
280
- function bt(e) {
281
- return e.method && e.kind === "init" || e.kind === "get" || e.kind === "set";
282
- }
283
- function Ir(e) {
284
- return (e.type === "ObjectTypeProperty" || e.type === "ObjectTypeInternalSlot") && !e.static && !e.method && e.kind !== "get" && e.kind !== "set" && e.value.type === "FunctionTypeAnnotation";
285
- }
286
- function pu(e) {
287
- return (e.type === "TypeAnnotation" || e.type === "TSTypeAnnotation") && e.typeAnnotation.type === "FunctionTypeAnnotation" && !e.static && !Bt(e, e.typeAnnotation);
288
- }
289
- var De = v(["BinaryExpression", "LogicalExpression", "NGPipeExpression"]);
290
- function At(e) {
291
- return W(e) || e.type === "BindExpression" && !!e.object;
292
- }
293
- var Ao = v(["TSThisType", "NullLiteralTypeAnnotation", "BooleanLiteralTypeAnnotation", "StringLiteralTypeAnnotation", "BigIntLiteralTypeAnnotation", "NumberLiteralTypeAnnotation", "TSLiteralType", "TSTemplateLiteralType"]);
294
- function Jt(e) {
295
- return Br(e) || Sr(e) || Ao(e) || (e.type === "GenericTypeAnnotation" || e.type === "TSTypeReference") && !e.typeParameters && !e.typeArguments;
296
- }
297
- function To(e) {
298
- return e.type === "Identifier" && (e.name === "beforeEach" || e.name === "beforeAll" || e.name === "afterEach" || e.name === "afterAll");
299
- }
300
- var xo = ["it", "it.only", "it.skip", "describe", "describe.only", "describe.skip", "test", "test.only", "test.skip", "test.step", "test.describe", "test.describe.only", "test.describe.parallel", "test.describe.parallel.only", "test.describe.serial", "test.describe.serial.only", "skip", "xit", "xdescribe", "xtest", "fit", "fdescribe", "ftest"];
301
- function ho(e) {
302
- return nu(e, xo);
303
- }
304
- function Pt(e, t) {
305
- if ((e == null ? void 0 : e.type) !== "CallExpression" || e.optional) return false;
306
- let r = oe(e);
307
- if (r.length === 1) {
308
- if (Ln(e) && Pt(t)) return Mt(r[0]);
309
- if (To(e.callee)) return Ln(r[0]);
310
- } else if ((r.length === 2 || r.length === 3) && (r[0].type === "TemplateLiteral" || te(r[0])) && ho(e.callee)) return r[2] && !Fe(r[2]) ? false : (r.length === 2 ? Mt(r[1]) : Co(r[1]) && z(r[1]).length <= 1) || Ln(r[1]);
311
- return false;
312
- }
313
- var cu = (e) => (t) => ((t == null ? void 0 : t.type) === "ChainExpression" && (t = t.expression), e(t));
314
- var L = cu(v(["CallExpression", "OptionalCallExpression"]));
315
- var W = cu(v(["MemberExpression", "OptionalMemberExpression"]));
316
- function Mn(e, t = 5) {
317
- return lu(e, t) <= t;
318
- }
319
- function lu(e, t) {
320
- let r = 0;
321
- for (let n in e) {
322
- let s = e[n];
323
- if (s && typeof s == "object" && typeof s.type == "string" && (r++, r += lu(s, t - r)), r > t) return r;
324
- }
325
- return r;
326
- }
327
- var go = 0.25;
328
- function nr(e, t) {
329
- let { printWidth: r } = t;
330
- if (d(e)) return false;
331
- let n = r * go;
332
- if (e.type === "ThisExpression" || e.type === "Identifier" && e.name.length <= n || jn(e) && !d(e.argument)) return true;
333
- let s = e.type === "Literal" && "regex" in e && e.regex.pattern || e.type === "RegExpLiteral" && e.pattern;
334
- return s ? s.length <= n : te(e) ? Ze(fe(e), t).length <= n : e.type === "TemplateLiteral" ? e.expressions.length === 0 && e.quasis[0].value.raw.length <= n && !e.quasis[0].value.raw.includes(`
335
- `) : e.type === "UnaryExpression" ? nr(e.argument, { printWidth: r }) : e.type === "CallExpression" && e.arguments.length === 0 && e.callee.type === "Identifier" ? e.callee.name.length <= n - 2 : kr(e);
336
- }
337
- function Oe(e, t) {
338
- return H(t) ? kt(t) : d(t, h.Leading, (r) => Z(e, k(r)));
339
- }
340
- function su(e) {
341
- return e.quasis.some((t) => t.value.raw.includes(`
342
- `));
343
- }
344
- function Lr(e, t) {
345
- return (e.type === "TemplateLiteral" && su(e) || e.type === "TaggedTemplateExpression" && su(e.quasi)) && !Z(t, q(e), { backwards: true });
346
- }
347
- function wr(e) {
348
- if (!d(e)) return false;
349
- let t = _(false, ct(e, h.Dangling), -1);
350
- return t && !ee(t);
351
- }
352
- function mu(e) {
353
- if (e.length <= 1) return false;
354
- let t = 0;
355
- for (let r of e) if (Mt(r)) {
356
- if (t += 1, t > 1) return true;
357
- } else if (L(r)) {
358
- for (let n of oe(r)) if (Mt(n)) return true;
359
- }
360
- return false;
361
- }
362
- function Or(e) {
363
- let { node: t, parent: r, key: n } = e;
364
- return n === "callee" && L(t) && L(r) && r.arguments.length > 0 && t.arguments.length > r.arguments.length;
365
- }
366
- var So = /* @__PURE__ */ new Set(["!", "-", "+", "~"]);
367
- function be(e, t = 2) {
368
- if (t <= 0) return false;
369
- if (e.type === "ChainExpression" || e.type === "TSNonNullExpression") return be(e.expression, t);
370
- let r = (n) => be(n, t - 1);
371
- if (vn(e)) return ze(e.pattern ?? e.regex.pattern) <= 5;
372
- if (kr(e) || Fo(e) || e.type === "ArgumentPlaceholder") return true;
373
- if (e.type === "TemplateLiteral") return e.quasis.every((n) => !n.value.raw.includes(`
374
- `)) && e.expressions.every(r);
375
- if (se(e)) return e.properties.every((n) => !n.computed && (n.shorthand || n.value && r(n.value)));
376
- if (X(e)) return e.elements.every((n) => n === null || r(n));
377
- if (lt(e)) {
378
- if (e.type === "ImportExpression" || be(e.callee, t)) {
379
- let n = oe(e);
380
- return n.length <= t && n.every(r);
381
- }
382
- return false;
383
- }
384
- return W(e) ? be(e.object, t) && be(e.property, t) : e.type === "UnaryExpression" && So.has(e.operator) || e.type === "UpdateExpression" ? be(e.argument, t) : false;
385
- }
386
- function fe(e) {
387
- var t;
388
- return ((t = e.extra) == null ? void 0 : t.raw) ?? e.raw;
389
- }
390
- function yu(e) {
391
- return e;
392
- }
393
- function ae(e, t = "es5") {
394
- return e.trailingComma === "es5" && t === "es5" || e.trailingComma === "all" && (t === "all" || t === "es5");
395
- }
396
- function ie(e, t) {
397
- switch (e.type) {
398
- case "BinaryExpression":
399
- case "LogicalExpression":
400
- case "AssignmentExpression":
401
- case "NGPipeExpression":
402
- return ie(e.left, t);
403
- case "MemberExpression":
404
- case "OptionalMemberExpression":
405
- return ie(e.object, t);
406
- case "TaggedTemplateExpression":
407
- return e.tag.type === "FunctionExpression" ? false : ie(e.tag, t);
408
- case "CallExpression":
409
- case "OptionalCallExpression":
410
- return e.callee.type === "FunctionExpression" ? false : ie(e.callee, t);
411
- case "ConditionalExpression":
412
- return ie(e.test, t);
413
- case "UpdateExpression":
414
- return !e.prefix && ie(e.argument, t);
415
- case "BindExpression":
416
- return e.object && ie(e.object, t);
417
- case "SequenceExpression":
418
- return ie(e.expressions[0], t);
419
- case "ChainExpression":
420
- case "TSSatisfiesExpression":
421
- case "TSAsExpression":
422
- case "TSNonNullExpression":
423
- case "AsExpression":
424
- case "AsConstExpression":
425
- case "SatisfiesExpression":
426
- return ie(e.expression, t);
427
- default:
428
- return t(e);
429
- }
430
- }
431
- var uu = { "==": true, "!=": true, "===": true, "!==": true };
432
- var br = { "*": true, "/": true, "%": true };
433
- var _n = { ">>": true, ">>>": true, "<<": true };
434
- function sr(e, t) {
435
- return !(tr(t) !== tr(e) || e === "**" || uu[e] && uu[t] || t === "%" && br[e] || e === "%" && br[t] || t !== e && br[t] && br[e] || _n[e] && _n[t]);
436
- }
437
- var Bo = new Map([["|>"], ["??"], ["||"], ["&&"], ["|"], ["^"], ["&"], ["==", "===", "!=", "!=="], ["<", ">", "<=", ">=", "in", "instanceof"], [">>", "<<", ">>>"], ["+", "-"], ["*", "/", "%"], ["**"]].flatMap((e, t) => e.map((r) => [r, t])));
438
- function tr(e) {
439
- return Bo.get(e);
440
- }
441
- function Du(e) {
442
- return !!_n[e] || e === "|" || e === "^" || e === "&";
443
- }
444
- function fu(e) {
445
- var r;
446
- if (e.rest) return true;
447
- let t = z(e);
448
- return ((r = _(false, t, -1)) == null ? void 0 : r.type) === "RestElement";
449
- }
450
- var wn = /* @__PURE__ */ new WeakMap();
451
- function z(e) {
452
- if (wn.has(e)) return wn.get(e);
453
- let t = [];
454
- return e.this && t.push(e.this), Array.isArray(e.parameters) ? t.push(...e.parameters) : Array.isArray(e.params) && t.push(...e.params), e.rest && t.push(e.rest), wn.set(e, t), t;
455
- }
456
- function Eu(e, t) {
457
- let { node: r } = e, n = 0, s = (u) => t(u, n++);
458
- r.this && e.call(s, "this"), Array.isArray(r.parameters) ? e.each(s, "parameters") : Array.isArray(r.params) && e.each(s, "params"), r.rest && e.call(s, "rest");
459
- }
460
- var On = /* @__PURE__ */ new WeakMap();
461
- function oe(e) {
462
- if (On.has(e)) return On.get(e);
463
- if (e.type === "ChainExpression") return oe(e.expression);
464
- let t = e.arguments;
465
- return e.type === "ImportExpression" && (t = [e.source], e.options && t.push(e.options)), On.set(e, t), t;
466
- }
467
- function qt(e, t) {
468
- let { node: r } = e;
469
- if (r.type === "ChainExpression") return e.call(() => qt(e, t), "expression");
470
- r.type === "ImportExpression" ? (e.call((n) => t(n, 0), "source"), r.options && e.call((n) => t(n, 1), "options")) : e.each(t, "arguments");
471
- }
472
- function Rn(e, t) {
473
- let r = [];
474
- if (e.type === "ChainExpression" && (e = e.expression, r.push("expression")), e.type === "ImportExpression") {
475
- if (t === 0 || t === (e.options ? -2 : -1)) return [...r, "source"];
476
- if (e.options && (t === 1 || t === -1)) return [...r, "options"];
477
- throw new RangeError("Invalid argument index");
478
- }
479
- if (t < 0 && (t = e.arguments.length + t), t < 0 || t >= e.arguments.length) throw new RangeError("Invalid argument index");
480
- return [...r, "arguments", t];
481
- }
482
- function ur(e) {
483
- return e.value.trim() === "prettier-ignore" && !e.unignore;
484
- }
485
- function kt(e) {
486
- return (e == null ? void 0 : e.prettierIgnore) || d(e, h.PrettierIgnore);
487
- }
488
- var h = { Leading: 2, Trailing: 4, Dangling: 8, Block: 16, Line: 32, PrettierIgnore: 64, First: 128, Last: 256 };
489
- var Fu = (e, t) => {
490
- if (typeof e == "function" && (t = e, e = 0), e || t) return (r, n, s) => !(e & h.Leading && !r.leading || e & h.Trailing && !r.trailing || e & h.Dangling && (r.leading || r.trailing) || e & h.Block && !ee(r) || e & h.Line && !Ct(r) || e & h.First && n !== 0 || e & h.Last && n !== s.length - 1 || e & h.PrettierIgnore && !ur(r) || t && !t(r));
491
- };
492
- function d(e, t, r) {
493
- if (!O(e == null ? void 0 : e.comments)) return false;
494
- let n = Fu(t, r);
495
- return n ? e.comments.some(n) : true;
496
- }
497
- function ct(e, t, r) {
498
- if (!Array.isArray(e == null ? void 0 : e.comments)) return [];
499
- let n = Fu(t, r);
500
- return n ? e.comments.filter(n) : e.comments;
501
- }
502
- var pe = (e, { originalText: t }) => jt(t, k(e));
503
- function lt(e) {
504
- return L(e) || e.type === "NewExpression" || e.type === "ImportExpression";
505
- }
506
- function Ce(e) {
507
- return e && (e.type === "ObjectProperty" || e.type === "Property" && !bt(e));
508
- }
509
- var Ae = v(["TSAsExpression", "TSSatisfiesExpression", "AsExpression", "AsConstExpression", "SatisfiesExpression"]);
510
- var Ue = v(["UnionTypeAnnotation", "TSUnionType"]);
511
- var _r = v(["IntersectionTypeAnnotation", "TSIntersectionType"]);
512
- var bo = /* @__PURE__ */ new Set(["range", "raw", "comments", "leadingComments", "trailingComments", "innerComments", "extra", "start", "end", "loc", "flags", "errors", "tokens"]);
513
- var Wt = (e) => {
514
- for (let t of e.quasis) delete t.value;
515
- };
516
- function Cu(e, t, r) {
517
- var s, u;
518
- if (e.type === "Program" && delete t.sourceType, (e.type === "BigIntLiteral" || e.type === "BigIntLiteralTypeAnnotation") && e.value && (t.value = e.value.toLowerCase()), (e.type === "BigIntLiteral" || e.type === "Literal") && e.bigint && (t.bigint = e.bigint.toLowerCase()), e.type === "EmptyStatement" || e.type === "JSXText" || e.type === "JSXExpressionContainer" && (e.expression.type === "Literal" || e.expression.type === "StringLiteral") && e.expression.value === " ") return null;
519
- if ((e.type === "Property" || e.type === "ObjectProperty" || e.type === "MethodDefinition" || e.type === "ClassProperty" || e.type === "ClassMethod" || e.type === "PropertyDefinition" || e.type === "TSDeclareMethod" || e.type === "TSPropertySignature" || e.type === "ObjectTypeProperty" || e.type === "ImportAttribute") && e.key && !e.computed) {
520
- let { key: i } = e;
521
- te(i) || Fe(i) ? t.key = String(i.value) : i.type === "Identifier" && (t.key = i.name);
522
- }
523
- if (e.type === "JSXElement" && e.openingElement.name.name === "style" && e.openingElement.attributes.some((i) => i.type === "JSXAttribute" && i.name.name === "jsx")) for (let { type: i, expression: a } of t.children) i === "JSXExpressionContainer" && a.type === "TemplateLiteral" && Wt(a);
524
- e.type === "JSXAttribute" && e.name.name === "css" && e.value.type === "JSXExpressionContainer" && e.value.expression.type === "TemplateLiteral" && Wt(t.value.expression), e.type === "JSXAttribute" && ((s = e.value) == null ? void 0 : s.type) === "Literal" && /["']|&quot;|&apos;/u.test(e.value.value) && (t.value.value = Y(false, e.value.value, /["']|&quot;|&apos;/gu, '"'));
525
- let n = e.expression || e.callee;
526
- if (e.type === "Decorator" && n.type === "CallExpression" && n.callee.name === "Component" && n.arguments.length === 1) {
527
- let i = e.expression.arguments[0].properties;
528
- for (let [a, p] of t.expression.arguments[0].properties.entries()) switch (i[a].key.name) {
529
- case "styles":
530
- X(p.value) && Wt(p.value.elements[0]);
531
- break;
532
- case "template":
533
- p.value.type === "TemplateLiteral" && Wt(p.value);
534
- break;
535
- }
536
- }
537
- e.type === "TaggedTemplateExpression" && (e.tag.type === "MemberExpression" || e.tag.type === "Identifier" && (e.tag.name === "gql" || e.tag.name === "graphql" || e.tag.name === "css" || e.tag.name === "md" || e.tag.name === "markdown" || e.tag.name === "html") || e.tag.type === "CallExpression") && Wt(t.quasi), e.type === "TemplateLiteral" && ((u = e.leadingComments) != null && u.some((a) => ee(a) && ["GraphQL", "HTML"].some((p) => a.value === ` ${p} `)) || r.type === "CallExpression" && r.callee.name === "graphql" || !e.leadingComments) && Wt(t), e.type === "ChainExpression" && e.expression.type === "TSNonNullExpression" && (t.type = "TSNonNullExpression", t.expression.type = "ChainExpression"), e.type === "TSMappedType" && (delete t.key, delete t.constraint), e.type === "TSEnumDeclaration" && delete t.body;
538
- }
539
- Cu.ignoredProperties = bo;
540
- var Au = Cu;
541
- var et = "string";
542
- var _e = "array";
543
- var tt = "cursor";
544
- var Xe = "indent";
545
- var Ye = "align";
546
- var rt = "trim";
547
- var le = "group";
548
- var Pe = "fill";
549
- var xe = "if-break";
550
- var He = "indent-if-break";
551
- var Ne = "line-suffix";
552
- var Ve = "line-suffix-boundary";
553
- var me = "line";
554
- var je = "label";
555
- var ve = "break-parent";
556
- var jr = /* @__PURE__ */ new Set([tt, Xe, Ye, rt, le, Pe, xe, He, Ne, Ve, me, je, ve]);
557
- function Po(e) {
558
- if (typeof e == "string") return et;
559
- if (Array.isArray(e)) return _e;
560
- if (!e) return;
561
- let { type: t } = e;
562
- if (jr.has(t)) return t;
563
- }
564
- var nt = Po;
565
- var ko = (e) => new Intl.ListFormat("en-US", { type: "disjunction" }).format(e);
566
- function Io(e) {
567
- let t = e === null ? "null" : typeof e;
568
- if (t !== "string" && t !== "object") return `Unexpected doc '${t}',
569
- Expected it to be 'string' or 'object'.`;
570
- if (nt(e)) throw new Error("doc is valid.");
571
- let r = Object.prototype.toString.call(e);
572
- if (r !== "[object Object]") return `Unexpected doc '${r}'.`;
573
- let n = ko([...jr].map((s) => `'${s}'`));
574
- return `Unexpected doc.type '${e.type}'.
575
- Expected it to be ${n}.`;
576
- }
577
- var Jn = class extends Error {
578
- name = "InvalidDocError";
579
- constructor(t) {
580
- super(Io(t)), this.doc = t;
581
- }
582
- };
583
- var Tt = Jn;
584
- var Tu = {};
585
- function Lo(e, t, r, n) {
586
- let s = [e];
587
- for (; s.length > 0; ) {
588
- let u = s.pop();
589
- if (u === Tu) {
590
- r(s.pop());
591
- continue;
592
- }
593
- r && s.push(u, Tu);
594
- let i = nt(u);
595
- if (!i) throw new Tt(u);
596
- if ((t == null ? void 0 : t(u)) !== false) switch (i) {
597
- case _e:
598
- case Pe: {
599
- let a = i === _e ? u : u.parts;
600
- for (let p = a.length, o = p - 1; o >= 0; --o) s.push(a[o]);
601
- break;
602
- }
603
- case xe:
604
- s.push(u.flatContents, u.breakContents);
605
- break;
606
- case le:
607
- if (n && u.expandedStates) for (let a = u.expandedStates.length, p = a - 1; p >= 0; --p) s.push(u.expandedStates[p]);
608
- else s.push(u.contents);
609
- break;
610
- case Ye:
611
- case Xe:
612
- case He:
613
- case je:
614
- case Ne:
615
- s.push(u.contents);
616
- break;
617
- case et:
618
- case tt:
619
- case rt:
620
- case Ve:
621
- case me:
622
- case ve:
623
- break;
624
- default:
625
- throw new Tt(u);
626
- }
627
- }
628
- }
629
- var qn = Lo;
630
- var du = () => {
631
- };
632
- var $e = du;
633
- var vr = du;
634
- function f(e) {
635
- return $e(e), { type: Xe, contents: e };
636
- }
637
- function he(e, t) {
638
- return $e(t), { type: Ye, contents: t, n: e };
639
- }
640
- function l(e, t = {}) {
641
- return $e(e), vr(t.expandedStates, true), { type: le, id: t.id, contents: e, break: !!t.shouldBreak, expandedStates: t.expandedStates };
642
- }
643
- function xu(e) {
644
- return he(Number.NEGATIVE_INFINITY, e);
645
- }
646
- function Mr(e) {
647
- return he(-1, e);
648
- }
649
- function Ke(e, t) {
650
- return l(e[0], { ...t, expandedStates: e });
651
- }
652
- function Rr(e) {
653
- return vr(e), { type: Pe, parts: e };
654
- }
655
- function B(e, t = "", r = {}) {
656
- return $e(e), t !== "" && $e(t), { type: xe, breakContents: e, flatContents: t, groupId: r.groupId };
657
- }
658
- function dt(e, t) {
659
- return $e(e), { type: He, contents: e, groupId: t.groupId, negate: t.negate };
660
- }
661
- function Wn(e) {
662
- return $e(e), { type: Ne, contents: e };
663
- }
664
- var ke = { type: Ve };
665
- var Ee = { type: ve };
666
- var Gn = { type: me, hard: true };
667
- var wo = { type: me, hard: true, literal: true };
668
- var x = { type: me };
669
- var E = { type: me, soft: true };
670
- var F = [Gn, Ee];
671
- var Jr = [wo, Ee];
672
- var ir = { type: tt };
673
- function b(e, t) {
674
- $e(e), vr(t);
675
- let r = [];
676
- for (let n = 0; n < t.length; n++) n !== 0 && r.push(e), r.push(t[n]);
677
- return r;
678
- }
679
- function hu(e, t, r) {
680
- $e(e);
681
- let n = e;
682
- if (t > 0) {
683
- for (let s = 0; s < Math.floor(t / r); ++s) n = f(n);
684
- n = he(t % r, n), n = he(Number.NEGATIVE_INFINITY, n);
685
- }
686
- return n;
687
- }
688
- function st(e, t) {
689
- return $e(t), e ? { type: je, label: e, contents: t } : t;
690
- }
691
- function mt(e, t) {
692
- if (typeof e == "string") return t(e);
693
- let r = /* @__PURE__ */ new Map();
694
- return n(e);
695
- function n(u) {
696
- if (r.has(u)) return r.get(u);
697
- let i = s(u);
698
- return r.set(u, i), i;
699
- }
700
- function s(u) {
701
- switch (nt(u)) {
702
- case _e:
703
- return t(u.map(n));
704
- case Pe:
705
- return t({ ...u, parts: u.parts.map(n) });
706
- case xe:
707
- return t({ ...u, breakContents: n(u.breakContents), flatContents: n(u.flatContents) });
708
- case le: {
709
- let { expandedStates: i, contents: a } = u;
710
- return i ? (i = i.map(n), a = i[0]) : a = n(a), t({ ...u, contents: a, expandedStates: i });
711
- }
712
- case Ye:
713
- case Xe:
714
- case He:
715
- case je:
716
- case Ne:
717
- return t({ ...u, contents: n(u.contents) });
718
- case et:
719
- case tt:
720
- case rt:
721
- case Ve:
722
- case me:
723
- case ve:
724
- return t(u);
725
- default:
726
- throw new Tt(u);
727
- }
728
- }
729
- }
730
- function Su(e, t, r) {
731
- let n = r, s = false;
732
- function u(i) {
733
- if (s) return false;
734
- let a = t(i);
735
- a !== void 0 && (s = true, n = a);
736
- }
737
- return qn(e, u), n;
738
- }
739
- function Oo(e) {
740
- if (e.type === le && e.break || e.type === me && e.hard || e.type === ve) return true;
741
- }
742
- function re(e) {
743
- return Su(e, Oo, false);
744
- }
745
- function gu(e) {
746
- if (e.length > 0) {
747
- let t = _(false, e, -1);
748
- !t.expandedStates && !t.break && (t.break = "propagated");
749
- }
750
- return null;
751
- }
752
- function Bu(e) {
753
- let t = /* @__PURE__ */ new Set(), r = [];
754
- function n(u) {
755
- if (u.type === ve && gu(r), u.type === le) {
756
- if (r.push(u), t.has(u)) return false;
757
- t.add(u);
758
- }
759
- }
760
- function s(u) {
761
- u.type === le && r.pop().break && gu(r);
762
- }
763
- qn(e, n, s, true);
764
- }
765
- function _o(e) {
766
- return e.type === me && !e.hard ? e.soft ? "" : " " : e.type === xe ? e.flatContents : e;
767
- }
768
- function ar(e) {
769
- return mt(e, _o);
770
- }
771
- function jo(e) {
772
- switch (nt(e)) {
773
- case Pe:
774
- if (e.parts.every((t) => t === "")) return "";
775
- break;
776
- case le:
777
- if (!e.contents && !e.id && !e.break && !e.expandedStates) return "";
778
- if (e.contents.type === le && e.contents.id === e.id && e.contents.break === e.break && e.contents.expandedStates === e.expandedStates) return e.contents;
779
- break;
780
- case Ye:
781
- case Xe:
782
- case He:
783
- case Ne:
784
- if (!e.contents) return "";
785
- break;
786
- case xe:
787
- if (!e.flatContents && !e.breakContents) return "";
788
- break;
789
- case _e: {
790
- let t = [];
791
- for (let r of e) {
792
- if (!r) continue;
793
- let [n, ...s] = Array.isArray(r) ? r : [r];
794
- typeof n == "string" && typeof _(false, t, -1) == "string" ? t[t.length - 1] += n : t.push(n), t.push(...s);
795
- }
796
- return t.length === 0 ? "" : t.length === 1 ? t[0] : t;
797
- }
798
- case et:
799
- case tt:
800
- case rt:
801
- case Ve:
802
- case me:
803
- case je:
804
- case ve:
805
- break;
806
- default:
807
- throw new Tt(e);
808
- }
809
- return e;
810
- }
811
- function Gt(e) {
812
- return mt(e, (t) => jo(t));
813
- }
814
- function Ie(e, t = Jr) {
815
- return mt(e, (r) => typeof r == "string" ? b(t, r.split(`
816
- `)) : r);
817
- }
818
- function vo(e) {
819
- if (e.type === me) return true;
820
- }
821
- function bu(e) {
822
- return Su(e, vo, false);
823
- }
824
- function or(e, t) {
825
- return e.type === je ? { ...e, contents: t(e.contents) } : t(e);
826
- }
827
- function Mo(e) {
828
- let t = `*${e.value}*`.split(`
829
- `);
830
- return t.length > 1 && t.every((r) => r.trimStart()[0] === "*");
831
- }
832
- var Pu = Mo;
833
- function ku(e, t) {
834
- let r = e.node;
835
- if (Ct(r)) return t.originalText.slice(q(r), k(r)).trimEnd();
836
- if (ee(r)) return Pu(r) ? Ro(r) : ["/*", Ie(r.value), "*/"];
837
- throw new Error("Not a comment: " + JSON.stringify(r));
838
- }
839
- function Ro(e) {
840
- let t = e.value.split(`
841
- `);
842
- return ["/*", b(F, t.map((r, n) => n === 0 ? r.trimEnd() : " " + (n < t.length - 1 ? r.trim() : r.trimStart()))), "*/"];
843
- }
844
- var $n = {};
845
- Ar($n, { endOfLine: () => Yo, ownLine: () => Xo, remaining: () => Ho });
846
- function Jo(e) {
847
- let t = e.type || e.kind || "(unknown type)", r = String(e.name || e.id && (typeof e.id == "object" ? e.id.name : e.id) || e.key && (typeof e.key == "object" ? e.key.name : e.key) || e.value && (typeof e.value == "object" ? "" : String(e.value)) || e.operator || "");
848
- return r.length > 20 && (r = r.slice(0, 19) + "\u2026"), t + (r ? " " + r : "");
849
- }
850
- function Un(e, t) {
851
- (e.comments ?? (e.comments = [])).push(t), t.printed = false, t.nodeDescription = Jo(e);
852
- }
853
- function ce(e, t) {
854
- t.leading = true, t.trailing = false, Un(e, t);
855
- }
856
- function Le(e, t, r) {
857
- t.leading = false, t.trailing = false, r && (t.marker = r), Un(e, t);
858
- }
859
- function V(e, t) {
860
- t.leading = false, t.trailing = true, Un(e, t);
861
- }
862
- function qo(e, t) {
863
- let r = null, n = t;
864
- for (; n !== r; ) r = n, n = We(e, n), n = Ot(e, n), n = _t(e, n), n = Ge(e, n);
865
- return n;
866
- }
867
- var ut = qo;
868
- function Wo(e, t) {
869
- let r = ut(e, t);
870
- return r === false ? "" : e.charAt(r);
871
- }
872
- var ge = Wo;
873
- function Go(e, t, r) {
874
- for (let n = t; n < r; ++n) if (e.charAt(n) === `
875
- `) return true;
876
- return false;
877
- }
878
- var Te = Go;
879
- function Uo(e) {
880
- return ee(e) && e.value[0] === "*" && /@(?:type|satisfies)\b/u.test(e.value);
881
- }
882
- var Iu = Uo;
883
- function Xo(e) {
884
- return [Ru, wu, ju, np, Vo, Yn, Hn, Lu, Ou, ap, up, Vn, Mu, op, _u, vu, Nn, $o, Ep].some((t) => t(e));
885
- }
886
- function Yo(e) {
887
- return [No, ju, wu, Mu, Yn, Hn, Lu, Ou, vu, sp, ip, Vn, lp, Nn, Dp, fp, Fp].some((t) => t(e));
888
- }
889
- function Ho(e) {
890
- return [Ru, Yn, Hn, Ko, rp, _u, Vn, tp, ep, yp, Nn, mp].some((t) => t(e));
891
- }
892
- function It(e, t) {
893
- let r = (e.body || e.properties).find(({ type: n }) => n !== "EmptyStatement");
894
- r ? ce(r, t) : Le(e, t);
895
- }
896
- function Xn(e, t) {
897
- e.type === "BlockStatement" ? It(e, t) : ce(e, t);
898
- }
899
- function No({ comment: e, followingNode: t }) {
900
- return t && Iu(e) ? (ce(t, e), true) : false;
901
- }
902
- function Yn({ comment: e, precedingNode: t, enclosingNode: r, followingNode: n, text: s }) {
903
- if ((r == null ? void 0 : r.type) !== "IfStatement" || !n) return false;
904
- if (ge(s, k(e)) === ")") return V(t, e), true;
905
- if (t === r.consequent && n === r.alternate) {
906
- let i = ut(s, k(r.consequent));
907
- if (q(e) < i || r.alternate.type === "BlockStatement") {
908
- if (t.type === "BlockStatement") V(t, e);
909
- else {
910
- let a = Ct(e) || e.loc.start.line === e.loc.end.line, p = e.loc.start.line === t.loc.start.line;
911
- a && p ? V(t, e) : Le(r, e);
912
- }
913
- return true;
914
- }
915
- }
916
- return n.type === "BlockStatement" ? (It(n, e), true) : n.type === "IfStatement" ? (Xn(n.consequent, e), true) : r.consequent === n ? (ce(n, e), true) : false;
917
- }
918
- function Hn({ comment: e, precedingNode: t, enclosingNode: r, followingNode: n, text: s }) {
919
- return (r == null ? void 0 : r.type) !== "WhileStatement" || !n ? false : ge(s, k(e)) === ")" ? (V(t, e), true) : n.type === "BlockStatement" ? (It(n, e), true) : r.body === n ? (ce(n, e), true) : false;
920
- }
921
- function Lu({ comment: e, precedingNode: t, enclosingNode: r, followingNode: n }) {
922
- return (r == null ? void 0 : r.type) !== "TryStatement" && (r == null ? void 0 : r.type) !== "CatchClause" || !n ? false : r.type === "CatchClause" && t ? (V(t, e), true) : n.type === "BlockStatement" ? (It(n, e), true) : n.type === "TryStatement" ? (Xn(n.finalizer, e), true) : n.type === "CatchClause" ? (Xn(n.body, e), true) : false;
923
- }
924
- function Vo({ comment: e, enclosingNode: t, followingNode: r }) {
925
- return W(t) && (r == null ? void 0 : r.type) === "Identifier" ? (ce(t, e), true) : false;
926
- }
927
- function $o({ comment: e, enclosingNode: t, followingNode: r, options: n }) {
928
- return !n.experimentalTernaries || !((t == null ? void 0 : t.type) === "ConditionalExpression" || (t == null ? void 0 : t.type) === "ConditionalTypeAnnotation" || (t == null ? void 0 : t.type) === "TSConditionalType") ? false : (r == null ? void 0 : r.type) === "ConditionalExpression" || (r == null ? void 0 : r.type) === "ConditionalTypeAnnotation" || (r == null ? void 0 : r.type) === "TSConditionalType" ? (Le(t, e), true) : false;
929
- }
930
- function wu({ comment: e, precedingNode: t, enclosingNode: r, followingNode: n, text: s, options: u }) {
931
- let i = t && !Te(s, k(t), q(e));
932
- return (!t || !i) && ((r == null ? void 0 : r.type) === "ConditionalExpression" || (r == null ? void 0 : r.type) === "ConditionalTypeAnnotation" || (r == null ? void 0 : r.type) === "TSConditionalType") && n ? u.experimentalTernaries && r.alternate === n && !(ee(e) && !Te(u.originalText, q(e), k(e))) ? (Le(r, e), true) : (ce(n, e), true) : false;
933
- }
934
- function Ko({ comment: e, precedingNode: t, enclosingNode: r }) {
935
- return Ce(r) && r.shorthand && r.key === t && r.value.type === "AssignmentPattern" ? (V(r.value.left, e), true) : false;
936
- }
937
- var Qo = /* @__PURE__ */ new Set(["ClassDeclaration", "ClassExpression", "DeclareClass", "DeclareInterface", "InterfaceDeclaration", "TSInterfaceDeclaration"]);
938
- function Ou({ comment: e, precedingNode: t, enclosingNode: r, followingNode: n }) {
939
- if (Qo.has(r == null ? void 0 : r.type)) {
940
- if (O(r.decorators) && (n == null ? void 0 : n.type) !== "Decorator") return V(_(false, r.decorators, -1), e), true;
941
- if (r.body && n === r.body) return It(r.body, e), true;
942
- if (n) {
943
- if (r.superClass && n === r.superClass && t && (t === r.id || t === r.typeParameters)) return V(t, e), true;
944
- for (let s of ["implements", "extends", "mixins"]) if (r[s] && n === r[s][0]) return t && (t === r.id || t === r.typeParameters || t === r.superClass) ? V(t, e) : Le(r, e, s), true;
945
- }
946
- }
947
- return false;
948
- }
949
- var zo = /* @__PURE__ */ new Set(["ClassMethod", "ClassProperty", "PropertyDefinition", "TSAbstractPropertyDefinition", "TSAbstractMethodDefinition", "TSDeclareMethod", "MethodDefinition", "ClassAccessorProperty", "AccessorProperty", "TSAbstractAccessorProperty", "TSParameterProperty"]);
950
- function _u({ comment: e, precedingNode: t, enclosingNode: r, text: n }) {
951
- return r && t && ge(n, k(e)) === "(" && (r.type === "Property" || r.type === "TSDeclareMethod" || r.type === "TSAbstractMethodDefinition") && t.type === "Identifier" && r.key === t && ge(n, k(t)) !== ":" ? (V(t, e), true) : (t == null ? void 0 : t.type) === "Decorator" && zo.has(r == null ? void 0 : r.type) && (Ct(e) || e.placement === "ownLine") ? (V(t, e), true) : false;
952
- }
953
- var Zo = /* @__PURE__ */ new Set(["FunctionDeclaration", "FunctionExpression", "ClassMethod", "MethodDefinition", "ObjectMethod"]);
954
- function ep({ comment: e, precedingNode: t, enclosingNode: r, text: n }) {
955
- return ge(n, k(e)) !== "(" ? false : t && Zo.has(r == null ? void 0 : r.type) ? (V(t, e), true) : false;
956
- }
957
- function tp({ comment: e, enclosingNode: t, text: r }) {
958
- if ((t == null ? void 0 : t.type) !== "ArrowFunctionExpression") return false;
959
- let n = ut(r, k(e));
960
- return n !== false && r.slice(n, n + 2) === "=>" ? (Le(t, e), true) : false;
961
- }
962
- function rp({ comment: e, enclosingNode: t, text: r }) {
963
- return ge(r, k(e)) !== ")" ? false : t && (Ju(t) && z(t).length === 0 || lt(t) && oe(t).length === 0) ? (Le(t, e), true) : ((t == null ? void 0 : t.type) === "MethodDefinition" || (t == null ? void 0 : t.type) === "TSAbstractMethodDefinition") && z(t.value).length === 0 ? (Le(t.value, e), true) : false;
964
- }
965
- function np({ comment: e, precedingNode: t, enclosingNode: r, followingNode: n, text: s }) {
966
- return (t == null ? void 0 : t.type) === "ComponentTypeParameter" && ((r == null ? void 0 : r.type) === "DeclareComponent" || (r == null ? void 0 : r.type) === "ComponentTypeAnnotation") && (n == null ? void 0 : n.type) !== "ComponentTypeParameter" ? (V(t, e), true) : ((t == null ? void 0 : t.type) === "ComponentParameter" || (t == null ? void 0 : t.type) === "RestElement") && (r == null ? void 0 : r.type) === "ComponentDeclaration" && ge(s, k(e)) === ")" ? (V(t, e), true) : false;
967
- }
968
- function ju({ comment: e, precedingNode: t, enclosingNode: r, followingNode: n, text: s }) {
969
- return (t == null ? void 0 : t.type) === "FunctionTypeParam" && (r == null ? void 0 : r.type) === "FunctionTypeAnnotation" && (n == null ? void 0 : n.type) !== "FunctionTypeParam" ? (V(t, e), true) : ((t == null ? void 0 : t.type) === "Identifier" || (t == null ? void 0 : t.type) === "AssignmentPattern" || (t == null ? void 0 : t.type) === "ObjectPattern" || (t == null ? void 0 : t.type) === "ArrayPattern" || (t == null ? void 0 : t.type) === "RestElement" || (t == null ? void 0 : t.type) === "TSParameterProperty") && Ju(r) && ge(s, k(e)) === ")" ? (V(t, e), true) : !ee(e) && ((r == null ? void 0 : r.type) === "FunctionDeclaration" || (r == null ? void 0 : r.type) === "FunctionExpression" || (r == null ? void 0 : r.type) === "ObjectMethod") && (n == null ? void 0 : n.type) === "BlockStatement" && r.body === n && ut(s, k(e)) === q(n) ? (It(n, e), true) : false;
970
- }
971
- function vu({ comment: e, enclosingNode: t }) {
972
- return (t == null ? void 0 : t.type) === "LabeledStatement" ? (ce(t, e), true) : false;
973
- }
974
- function Nn({ comment: e, enclosingNode: t }) {
975
- return ((t == null ? void 0 : t.type) === "ContinueStatement" || (t == null ? void 0 : t.type) === "BreakStatement") && !t.label ? (V(t, e), true) : false;
976
- }
977
- function sp({ comment: e, precedingNode: t, enclosingNode: r }) {
978
- return L(r) && t && r.callee === t && r.arguments.length > 0 ? (ce(r.arguments[0], e), true) : false;
979
- }
980
- function up({ comment: e, precedingNode: t, enclosingNode: r, followingNode: n }) {
981
- return Ue(r) ? (ur(e) && (n.prettierIgnore = true, e.unignore = true), t ? (V(t, e), true) : false) : (Ue(n) && ur(e) && (n.types[0].prettierIgnore = true, e.unignore = true), false);
982
- }
983
- function ip({ comment: e, enclosingNode: t }) {
984
- return Ce(t) ? (ce(t, e), true) : false;
985
- }
986
- function Vn({ comment: e, enclosingNode: t, ast: r, isLastComment: n }) {
987
- var s;
988
- return ((s = r == null ? void 0 : r.body) == null ? void 0 : s.length) === 0 ? (n ? Le(r, e) : ce(r, e), true) : (t == null ? void 0 : t.type) === "Program" && t.body.length === 0 && !O(t.directives) ? (n ? Le(t, e) : ce(t, e), true) : false;
989
- }
990
- function ap({ comment: e, enclosingNode: t }) {
991
- return (t == null ? void 0 : t.type) === "ForInStatement" || (t == null ? void 0 : t.type) === "ForOfStatement" ? (ce(t, e), true) : false;
992
- }
993
- function Mu({ comment: e, precedingNode: t, enclosingNode: r, text: n }) {
994
- if ((r == null ? void 0 : r.type) === "ImportSpecifier" || (r == null ? void 0 : r.type) === "ExportSpecifier") return ce(r, e), true;
995
- let s = (t == null ? void 0 : t.type) === "ImportSpecifier" && (r == null ? void 0 : r.type) === "ImportDeclaration", u = (t == null ? void 0 : t.type) === "ExportSpecifier" && (r == null ? void 0 : r.type) === "ExportNamedDeclaration";
996
- return (s || u) && Z(n, k(e)) ? (V(t, e), true) : false;
997
- }
998
- function op({ comment: e, enclosingNode: t }) {
999
- return (t == null ? void 0 : t.type) === "AssignmentPattern" ? (ce(t, e), true) : false;
1000
- }
1001
- var pp = /* @__PURE__ */ new Set(["VariableDeclarator", "AssignmentExpression", "TypeAlias", "TSTypeAliasDeclaration"]);
1002
- var cp = /* @__PURE__ */ new Set(["ObjectExpression", "RecordExpression", "ArrayExpression", "TupleExpression", "TemplateLiteral", "TaggedTemplateExpression", "ObjectTypeAnnotation", "TSTypeLiteral"]);
1003
- function lp({ comment: e, enclosingNode: t, followingNode: r }) {
1004
- return pp.has(t == null ? void 0 : t.type) && r && (cp.has(r.type) || ee(e)) ? (ce(r, e), true) : false;
1005
- }
1006
- function mp({ comment: e, enclosingNode: t, followingNode: r, text: n }) {
1007
- return !r && ((t == null ? void 0 : t.type) === "TSMethodSignature" || (t == null ? void 0 : t.type) === "TSDeclareFunction" || (t == null ? void 0 : t.type) === "TSAbstractMethodDefinition") && ge(n, k(e)) === ";" ? (V(t, e), true) : false;
1008
- }
1009
- function Ru({ comment: e, enclosingNode: t, followingNode: r }) {
1010
- if (ur(e) && (t == null ? void 0 : t.type) === "TSMappedType" && (r == null ? void 0 : r.type) === "TSTypeParameter" && r.constraint) return t.prettierIgnore = true, e.unignore = true, true;
1011
- }
1012
- function yp({ comment: e, precedingNode: t, enclosingNode: r, followingNode: n }) {
1013
- return (r == null ? void 0 : r.type) !== "TSMappedType" ? false : (n == null ? void 0 : n.type) === "TSTypeParameter" && n.name ? (ce(n.name, e), true) : (t == null ? void 0 : t.type) === "TSTypeParameter" && t.constraint ? (V(t.constraint, e), true) : false;
1014
- }
1015
- function Dp({ comment: e, enclosingNode: t, followingNode: r }) {
1016
- return !t || t.type !== "SwitchCase" || t.test || !r || r !== t.consequent[0] ? false : (r.type === "BlockStatement" && Ct(e) ? It(r, e) : Le(t, e), true);
1017
- }
1018
- function fp({ comment: e, precedingNode: t, enclosingNode: r, followingNode: n }) {
1019
- return Ue(t) && ((r.type === "TSArrayType" || r.type === "ArrayTypeAnnotation") && !n || _r(r)) ? (V(_(false, t.types, -1), e), true) : false;
1020
- }
1021
- function Ep({ comment: e, enclosingNode: t, precedingNode: r, followingNode: n }) {
1022
- if (((t == null ? void 0 : t.type) === "ObjectPattern" || (t == null ? void 0 : t.type) === "ArrayPattern") && (n == null ? void 0 : n.type) === "TSTypeAnnotation") return r ? V(r, e) : Le(t, e), true;
1023
- }
1024
- function Fp({ comment: e, precedingNode: t, enclosingNode: r, followingNode: n }) {
1025
- var s;
1026
- if (!n && (r == null ? void 0 : r.type) === "UnaryExpression" && ((t == null ? void 0 : t.type) === "LogicalExpression" || (t == null ? void 0 : t.type) === "BinaryExpression")) {
1027
- let u = ((s = r.argument.loc) == null ? void 0 : s.start.line) !== t.right.loc.start.line, i = Ct(e) || e.loc.start.line === e.loc.end.line, a = e.loc.start.line === t.right.loc.start.line;
1028
- if (u && i && a) return V(t.right, e), true;
1029
- }
1030
- return false;
1031
- }
1032
- var Ju = v(["ArrowFunctionExpression", "FunctionExpression", "FunctionDeclaration", "ObjectMethod", "ClassMethod", "TSDeclareFunction", "TSCallSignatureDeclaration", "TSConstructSignatureDeclaration", "TSMethodSignature", "TSConstructorType", "TSFunctionType", "TSDeclareMethod"]);
1033
- var Cp = /* @__PURE__ */ new Set(["EmptyStatement", "TemplateElement", "TSEmptyBodyFunctionExpression", "ChainExpression"]);
1034
- function Ap(e) {
1035
- return !Cp.has(e.type);
1036
- }
1037
- function Tp(e, t) {
1038
- var r;
1039
- if ((t.parser === "typescript" || t.parser === "flow" || t.parser === "acorn" || t.parser === "espree" || t.parser === "meriyah" || t.parser === "__babel_estree") && e.type === "MethodDefinition" && ((r = e.value) == null ? void 0 : r.type) === "FunctionExpression" && z(e.value).length === 0 && !e.value.returnType && !O(e.value.typeParameters) && e.value.body) return [...e.decorators || [], e.key, e.value.body];
1040
- }
1041
- function Kn(e) {
1042
- let { node: t, parent: r } = e;
1043
- return (H(t) || r && (r.type === "JSXSpreadAttribute" || r.type === "JSXSpreadChild" || Ue(r) || (r.type === "ClassDeclaration" || r.type === "ClassExpression") && r.superClass === t)) && (!kt(t) || Ue(r));
1044
- }
1045
- function dp(e, { parser: t }) {
1046
- if (t === "flow" || t === "babel-flow") return e = Y(false, e, /[\s(]/gu, ""), e === "" || e === "/*" || e === "/*::";
1047
- }
1048
- function qu(e) {
1049
- switch (e) {
1050
- case "cr":
1051
- return "\r";
1052
- case "crlf":
1053
- return `\r
1054
- `;
1055
- default:
1056
- return `
1057
- `;
1058
- }
1059
- }
1060
- var Se = Symbol("MODE_BREAK");
1061
- var it = Symbol("MODE_FLAT");
1062
- var Ut = Symbol("cursor");
1063
- var Qn = Symbol("DOC_FILL_PRINTED_LENGTH");
1064
- function Wu() {
1065
- return { value: "", length: 0, queue: [] };
1066
- }
1067
- function xp(e, t) {
1068
- return zn(e, { type: "indent" }, t);
1069
- }
1070
- function hp(e, t, r) {
1071
- return t === Number.NEGATIVE_INFINITY ? e.root || Wu() : t < 0 ? zn(e, { type: "dedent" }, r) : t ? t.type === "root" ? { ...e, root: e } : zn(e, { type: typeof t == "string" ? "stringAlign" : "numberAlign", n: t }, r) : e;
1072
- }
1073
- function zn(e, t, r) {
1074
- let n = t.type === "dedent" ? e.queue.slice(0, -1) : [...e.queue, t], s = "", u = 0, i = 0, a = 0;
1075
- for (let c of n) switch (c.type) {
1076
- case "indent":
1077
- m(), r.useTabs ? p(1) : o(r.tabWidth);
1078
- break;
1079
- case "stringAlign":
1080
- m(), s += c.n, u += c.n.length;
1081
- break;
1082
- case "numberAlign":
1083
- i += 1, a += c.n;
1084
- break;
1085
- default:
1086
- throw new Error(`Unexpected type '${c.type}'`);
1087
- }
1088
- return D(), { ...e, value: s, length: u, queue: n };
1089
- function p(c) {
1090
- s += " ".repeat(c), u += r.tabWidth * c;
1091
- }
1092
- function o(c) {
1093
- s += " ".repeat(c), u += c;
1094
- }
1095
- function m() {
1096
- r.useTabs ? y() : D();
1097
- }
1098
- function y() {
1099
- i > 0 && p(i), C();
1100
- }
1101
- function D() {
1102
- a > 0 && o(a), C();
1103
- }
1104
- function C() {
1105
- i = 0, a = 0;
1106
- }
1107
- }
1108
- function Zn(e) {
1109
- let t = 0, r = 0, n = e.length;
1110
- e: for (; n--; ) {
1111
- let s = e[n];
1112
- if (s === Ut) {
1113
- r++;
1114
- continue;
1115
- }
1116
- for (let u = s.length - 1; u >= 0; u--) {
1117
- let i = s[u];
1118
- if (i === " " || i === " ") t++;
1119
- else {
1120
- e[n] = s.slice(0, u + 1);
1121
- break e;
1122
- }
1123
- }
1124
- }
1125
- if (t > 0 || r > 0) for (e.length = n + 1; r-- > 0; ) e.push(Ut);
1126
- return t;
1127
- }
1128
- function qr(e, t, r, n, s, u) {
1129
- if (r === Number.POSITIVE_INFINITY) return true;
1130
- let i = t.length, a = [e], p = [];
1131
- for (; r >= 0; ) {
1132
- if (a.length === 0) {
1133
- if (i === 0) return true;
1134
- a.push(t[--i]);
1135
- continue;
1136
- }
1137
- let { mode: o, doc: m } = a.pop(), y = nt(m);
1138
- switch (y) {
1139
- case et:
1140
- p.push(m), r -= ze(m);
1141
- break;
1142
- case _e:
1143
- case Pe: {
1144
- let D = y === _e ? m : m.parts, C = m[Qn] ?? 0;
1145
- for (let c = D.length - 1; c >= C; c--) a.push({ mode: o, doc: D[c] });
1146
- break;
1147
- }
1148
- case Xe:
1149
- case Ye:
1150
- case He:
1151
- case je:
1152
- a.push({ mode: o, doc: m.contents });
1153
- break;
1154
- case rt:
1155
- r += Zn(p);
1156
- break;
1157
- case le: {
1158
- if (u && m.break) return false;
1159
- let D = m.break ? Se : o, C = m.expandedStates && D === Se ? _(false, m.expandedStates, -1) : m.contents;
1160
- a.push({ mode: D, doc: C });
1161
- break;
1162
- }
1163
- case xe: {
1164
- let C = (m.groupId ? s[m.groupId] || it : o) === Se ? m.breakContents : m.flatContents;
1165
- C && a.push({ mode: o, doc: C });
1166
- break;
1167
- }
1168
- case me:
1169
- if (o === Se || m.hard) return true;
1170
- m.soft || (p.push(" "), r--);
1171
- break;
1172
- case Ne:
1173
- n = true;
1174
- break;
1175
- case Ve:
1176
- if (n) return false;
1177
- break;
1178
- }
1179
- }
1180
- return false;
1181
- }
1182
- function es(e, t) {
1183
- let r = {}, n = t.printWidth, s = qu(t.endOfLine), u = 0, i = [{ ind: Wu(), mode: Se, doc: e }], a = [], p = false, o = [], m = 0;
1184
- for (Bu(e); i.length > 0; ) {
1185
- let { ind: D, mode: C, doc: c } = i.pop();
1186
- switch (nt(c)) {
1187
- case et: {
1188
- let A = s !== `
1189
- ` ? Y(false, c, `
1190
- `, s) : c;
1191
- a.push(A), i.length > 0 && (u += ze(A));
1192
- break;
1193
- }
1194
- case _e:
1195
- for (let A = c.length - 1; A >= 0; A--) i.push({ ind: D, mode: C, doc: c[A] });
1196
- break;
1197
- case tt:
1198
- if (m >= 2) throw new Error("There are too many 'cursor' in doc.");
1199
- a.push(Ut), m++;
1200
- break;
1201
- case Xe:
1202
- i.push({ ind: xp(D, t), mode: C, doc: c.contents });
1203
- break;
1204
- case Ye:
1205
- i.push({ ind: hp(D, c.n, t), mode: C, doc: c.contents });
1206
- break;
1207
- case rt:
1208
- u -= Zn(a);
1209
- break;
1210
- case le:
1211
- switch (C) {
1212
- case it:
1213
- if (!p) {
1214
- i.push({ ind: D, mode: c.break ? Se : it, doc: c.contents });
1215
- break;
1216
- }
1217
- case Se: {
1218
- p = false;
1219
- let A = { ind: D, mode: it, doc: c.contents }, T = n - u, S = o.length > 0;
1220
- if (!c.break && qr(A, i, T, S, r)) i.push(A);
1221
- else if (c.expandedStates) {
1222
- let g = _(false, c.expandedStates, -1);
1223
- if (c.break) {
1224
- i.push({ ind: D, mode: Se, doc: g });
1225
- break;
1226
- } else for (let M = 1; M < c.expandedStates.length + 1; M++) if (M >= c.expandedStates.length) {
1227
- i.push({ ind: D, mode: Se, doc: g });
1228
- break;
1229
- } else {
1230
- let R = c.expandedStates[M], j = { ind: D, mode: it, doc: R };
1231
- if (qr(j, i, T, S, r)) {
1232
- i.push(j);
1233
- break;
1234
- }
1235
- }
1236
- } else i.push({ ind: D, mode: Se, doc: c.contents });
1237
- break;
1238
- }
1239
- }
1240
- c.id && (r[c.id] = _(false, i, -1).mode);
1241
- break;
1242
- case Pe: {
1243
- let A = n - u, T = c[Qn] ?? 0, { parts: S } = c, g = S.length - T;
1244
- if (g === 0) break;
1245
- let M = S[T + 0], R = S[T + 1], j = { ind: D, mode: it, doc: M }, I = { ind: D, mode: Se, doc: M }, U = qr(j, [], A, o.length > 0, r, true);
1246
- if (g === 1) {
1247
- U ? i.push(j) : i.push(I);
1248
- break;
1249
- }
1250
- let P = { ind: D, mode: it, doc: R }, G = { ind: D, mode: Se, doc: R };
1251
- if (g === 2) {
1252
- U ? i.push(P, j) : i.push(G, I);
1253
- break;
1254
- }
1255
- let ue = S[T + 2], Q = { ind: D, mode: C, doc: { ...c, [Qn]: T + 2 } };
1256
- qr({ ind: D, mode: it, doc: [M, R, ue] }, [], A, o.length > 0, r, true) ? i.push(Q, P, j) : U ? i.push(Q, G, j) : i.push(Q, G, I);
1257
- break;
1258
- }
1259
- case xe:
1260
- case He: {
1261
- let A = c.groupId ? r[c.groupId] : C;
1262
- if (A === Se) {
1263
- let T = c.type === xe ? c.breakContents : c.negate ? c.contents : f(c.contents);
1264
- T && i.push({ ind: D, mode: C, doc: T });
1265
- }
1266
- if (A === it) {
1267
- let T = c.type === xe ? c.flatContents : c.negate ? f(c.contents) : c.contents;
1268
- T && i.push({ ind: D, mode: C, doc: T });
1269
- }
1270
- break;
1271
- }
1272
- case Ne:
1273
- o.push({ ind: D, mode: C, doc: c.contents });
1274
- break;
1275
- case Ve:
1276
- o.length > 0 && i.push({ ind: D, mode: C, doc: Gn });
1277
- break;
1278
- case me:
1279
- switch (C) {
1280
- case it:
1281
- if (c.hard) p = true;
1282
- else {
1283
- c.soft || (a.push(" "), u += 1);
1284
- break;
1285
- }
1286
- case Se:
1287
- if (o.length > 0) {
1288
- i.push({ ind: D, mode: C, doc: c }, ...o.reverse()), o.length = 0;
1289
- break;
1290
- }
1291
- c.literal ? D.root ? (a.push(s, D.root.value), u = D.root.length) : (a.push(s), u = 0) : (u -= Zn(a), a.push(s + D.value), u = D.length);
1292
- break;
1293
- }
1294
- break;
1295
- case je:
1296
- i.push({ ind: D, mode: C, doc: c.contents });
1297
- break;
1298
- case ve:
1299
- break;
1300
- default:
1301
- throw new Tt(c);
1302
- }
1303
- i.length === 0 && o.length > 0 && (i.push(...o.reverse()), o.length = 0);
1304
- }
1305
- let y = a.indexOf(Ut);
1306
- if (y !== -1) {
1307
- let D = a.indexOf(Ut, y + 1);
1308
- if (D === -1) return { formatted: a.filter((T) => T !== Ut).join("") };
1309
- let C = a.slice(0, y).join(""), c = a.slice(y + 1, D).join(""), A = a.slice(D + 1).join("");
1310
- return { formatted: C + c + A, cursorNodeStart: C.length, cursorNodeText: c };
1311
- }
1312
- return { formatted: a.join("") };
1313
- }
1314
- function gp(e, t, r = 0) {
1315
- let n = 0;
1316
- for (let s = r; s < e.length; ++s) e[s] === " " ? n = n + t - n % t : n++;
1317
- return n;
1318
- }
1319
- var Gu = gp;
1320
- function Sp(e, t) {
1321
- let r = e.lastIndexOf(`
1322
- `);
1323
- return r === -1 ? 0 : Gu(e.slice(r + 1).match(/^[\t ]*/u)[0], t);
1324
- }
1325
- var Uu = Sp;
1326
- function Wr(e, t, r) {
1327
- let { node: n } = e;
1328
- if (n.type === "TemplateLiteral" && Pp(e)) {
1329
- let o = Bp(e, r, t);
1330
- if (o) return o;
1331
- }
1332
- let u = "expressions";
1333
- n.type === "TSTemplateLiteralType" && (u = "types");
1334
- let i = [], a = e.map(t, u);
1335
- i.push(ke, "`");
1336
- let p = 0;
1337
- return e.each(({ index: o, node: m }) => {
1338
- if (i.push(t()), m.tail) return;
1339
- let { tabWidth: y } = r, D = m.value.raw, C = D.includes(`
1340
- `) ? Uu(D, y) : p;
1341
- p = C;
1342
- let c = a[o], A = n[u][o], T = Te(r.originalText, k(m), q(n.quasis[o + 1]));
1343
- if (!T) {
1344
- let g = es(c, { ...r, printWidth: Number.POSITIVE_INFINITY }).formatted;
1345
- g.includes(`
1346
- `) ? T = true : c = g;
1347
- }
1348
- T && (d(A) || A.type === "Identifier" || W(A) || A.type === "ConditionalExpression" || A.type === "SequenceExpression" || Ae(A) || De(A)) && (c = [f([E, c]), E]);
1349
- let S = C === 0 && D.endsWith(`
1350
- `) ? he(Number.NEGATIVE_INFINITY, c) : hu(c, C, y);
1351
- i.push(l(["${", S, ke, "}"]));
1352
- }, "quasis"), i.push("`"), i;
1353
- }
1354
- function Xu(e, t) {
1355
- let r = t("quasi");
1356
- return st(r.label && { tagged: true, ...r.label }, [t("tag"), t(e.node.typeArguments ? "typeArguments" : "typeParameters"), ke, r]);
1357
- }
1358
- function Bp(e, t, r) {
1359
- let { node: n } = e, s = n.quasis[0].value.raw.trim().split(/\s*\|\s*/u);
1360
- if (s.length > 1 || s.some((u) => u.length > 0)) {
1361
- t.__inJestEach = true;
1362
- let u = e.map(r, "expressions");
1363
- t.__inJestEach = false;
1364
- let i = [], a = u.map((D) => "${" + es(D, { ...t, printWidth: Number.POSITIVE_INFINITY, endOfLine: "lf" }).formatted + "}"), p = [{ hasLineBreak: false, cells: [] }];
1365
- for (let D = 1; D < n.quasis.length; D++) {
1366
- let C = _(false, p, -1), c = a[D - 1];
1367
- C.cells.push(c), c.includes(`
1368
- `) && (C.hasLineBreak = true), n.quasis[D].value.raw.includes(`
1369
- `) && p.push({ hasLineBreak: false, cells: [] });
1370
- }
1371
- let o = Math.max(s.length, ...p.map((D) => D.cells.length)), m = Array.from({ length: o }).fill(0), y = [{ cells: s }, ...p.filter((D) => D.cells.length > 0)];
1372
- for (let { cells: D } of y.filter((C) => !C.hasLineBreak)) for (let [C, c] of D.entries()) m[C] = Math.max(m[C], ze(c));
1373
- return i.push(ke, "`", f([F, b(F, y.map((D) => b(" | ", D.cells.map((C, c) => D.hasLineBreak ? C : C + " ".repeat(m[c] - ze(C))))))]), F, "`"), i;
1374
- }
1375
- }
1376
- function bp(e, t) {
1377
- let { node: r } = e, n = t();
1378
- return d(r) && (n = l([f([E, n]), E])), ["${", n, ke, "}"];
1379
- }
1380
- function Xt(e, t) {
1381
- return e.map((r) => bp(r, t), "expressions");
1382
- }
1383
- function Gr(e, t) {
1384
- return mt(e, (r) => typeof r == "string" ? t ? Y(false, r, /(\\*)`/gu, "$1$1\\`") : ts(r) : r);
1385
- }
1386
- function ts(e) {
1387
- return Y(false, e, /([\\`]|\$\{)/gu, String.raw`\$1`);
1388
- }
1389
- function Pp({ node: e, parent: t }) {
1390
- let r = /^[fx]?(?:describe|it|test)$/u;
1391
- return t.type === "TaggedTemplateExpression" && t.quasi === e && t.tag.type === "MemberExpression" && t.tag.property.type === "Identifier" && t.tag.property.name === "each" && (t.tag.object.type === "Identifier" && r.test(t.tag.object.name) || t.tag.object.type === "MemberExpression" && t.tag.object.property.type === "Identifier" && (t.tag.object.property.name === "only" || t.tag.object.property.name === "skip") && t.tag.object.object.type === "Identifier" && r.test(t.tag.object.object.name));
1392
- }
1393
- var ns = [(e, t) => e.type === "ObjectExpression" && t === "properties", (e, t) => e.type === "CallExpression" && e.callee.type === "Identifier" && e.callee.name === "Component" && t === "arguments", (e, t) => e.type === "Decorator" && t === "expression"];
1394
- function Yu(e) {
1395
- let t = (n) => n.type === "TemplateLiteral", r = (n, s) => Ce(n) && !n.computed && n.key.type === "Identifier" && n.key.name === "styles" && s === "value";
1396
- return e.match(t, (n, s) => X(n) && s === "elements", r, ...ns) || e.match(t, r, ...ns);
1397
- }
1398
- function Hu(e) {
1399
- return e.match((t) => t.type === "TemplateLiteral", (t, r) => Ce(t) && !t.computed && t.key.type === "Identifier" && t.key.name === "template" && r === "value", ...ns);
1400
- }
1401
- function rs(e, t) {
1402
- return d(e, h.Block | h.Leading, ({ value: r }) => r === ` ${t} `);
1403
- }
1404
- function Ur({ node: e, parent: t }, r) {
1405
- return rs(e, r) || kp(t) && rs(t, r) || t.type === "ExpressionStatement" && rs(t, r);
1406
- }
1407
- function kp(e) {
1408
- return e.type === "AsConstExpression" || e.type === "TSAsExpression" && e.typeAnnotation.type === "TSTypeReference" && e.typeAnnotation.typeName.type === "Identifier" && e.typeAnnotation.typeName.name === "const";
1409
- }
1410
- async function Ip(e, t, r) {
1411
- let { node: n } = r, s = n.quasis.map((m) => m.value.raw), u = 0, i = s.reduce((m, y, D) => D === 0 ? y : m + "@prettier-placeholder-" + u++ + "-id" + y, ""), a = await e(i, { parser: "scss" }), p = Xt(r, t), o = Lp(a, p);
1412
- if (!o) throw new Error("Couldn't insert all the expressions");
1413
- return ["`", f([F, o]), E, "`"];
1414
- }
1415
- function Lp(e, t) {
1416
- if (!O(t)) return e;
1417
- let r = 0, n = mt(Gt(e), (s) => typeof s != "string" || !s.includes("@prettier-placeholder") ? s : s.split(/@prettier-placeholder-(\d+)-id/u).map((u, i) => i % 2 === 0 ? Ie(u) : (r++, t[u])));
1418
- return t.length === r ? n : null;
1419
- }
1420
- function wp({ node: e, parent: t, grandparent: r }) {
1421
- return r && e.quasis && t.type === "JSXExpressionContainer" && r.type === "JSXElement" && r.openingElement.name.name === "style" && r.openingElement.attributes.some((n) => n.type === "JSXAttribute" && n.name.name === "jsx") || (t == null ? void 0 : t.type) === "TaggedTemplateExpression" && t.tag.type === "Identifier" && t.tag.name === "css" || (t == null ? void 0 : t.type) === "TaggedTemplateExpression" && t.tag.type === "MemberExpression" && t.tag.object.name === "css" && (t.tag.property.name === "global" || t.tag.property.name === "resolve");
1422
- }
1423
- function Xr(e) {
1424
- return e.type === "Identifier" && e.name === "styled";
1425
- }
1426
- function Nu(e) {
1427
- return /^[A-Z]/u.test(e.object.name) && e.property.name === "extend";
1428
- }
1429
- function Op({ parent: e }) {
1430
- if (!e || e.type !== "TaggedTemplateExpression") return false;
1431
- let t = e.tag.type === "ParenthesizedExpression" ? e.tag.expression : e.tag;
1432
- switch (t.type) {
1433
- case "MemberExpression":
1434
- return Xr(t.object) || Nu(t);
1435
- case "CallExpression":
1436
- return Xr(t.callee) || t.callee.type === "MemberExpression" && (t.callee.object.type === "MemberExpression" && (Xr(t.callee.object.object) || Nu(t.callee.object)) || t.callee.object.type === "CallExpression" && Xr(t.callee.object.callee));
1437
- case "Identifier":
1438
- return t.name === "css";
1439
- default:
1440
- return false;
1441
- }
1442
- }
1443
- function _p({ parent: e, grandparent: t }) {
1444
- return (t == null ? void 0 : t.type) === "JSXAttribute" && e.type === "JSXExpressionContainer" && t.name.type === "JSXIdentifier" && t.name.name === "css";
1445
- }
1446
- function jp(e) {
1447
- if (wp(e) || Op(e) || _p(e) || Yu(e)) return Ip;
1448
- }
1449
- var Vu = jp;
1450
- async function vp(e, t, r) {
1451
- let { node: n } = r, s = n.quasis.length, u = Xt(r, t), i = [];
1452
- for (let a = 0; a < s; a++) {
1453
- let p = n.quasis[a], o = a === 0, m = a === s - 1, y = p.value.cooked, D = y.split(`
1454
- `), C = D.length, c = u[a], A = C > 2 && D[0].trim() === "" && D[1].trim() === "", T = C > 2 && D[C - 1].trim() === "" && D[C - 2].trim() === "", S = D.every((M) => /^\s*(?:#[^\n\r]*)?$/u.test(M));
1455
- if (!m && /#[^\n\r]*$/u.test(D[C - 1])) return null;
1456
- let g = null;
1457
- S ? g = Mp(D) : g = await e(y, { parser: "graphql" }), g ? (g = Gr(g, false), !o && A && i.push(""), i.push(g), !m && T && i.push("")) : !o && !m && A && i.push(""), c && i.push(c);
1458
- }
1459
- return ["`", f([F, b(F, i)]), F, "`"];
1460
- }
1461
- function Mp(e) {
1462
- let t = [], r = false, n = e.map((s) => s.trim());
1463
- for (let [s, u] of n.entries()) u !== "" && (n[s - 1] === "" && r ? t.push([F, u]) : t.push(u), r = true);
1464
- return t.length === 0 ? null : b(F, t);
1465
- }
1466
- function Rp({ node: e, parent: t }) {
1467
- return Ur({ node: e, parent: t }, "GraphQL") || t && (t.type === "TaggedTemplateExpression" && (t.tag.type === "MemberExpression" && t.tag.object.name === "graphql" && t.tag.property.name === "experimental" || t.tag.type === "Identifier" && (t.tag.name === "gql" || t.tag.name === "graphql")) || t.type === "CallExpression" && t.callee.type === "Identifier" && t.callee.name === "graphql");
1468
- }
1469
- function Jp(e) {
1470
- if (Rp(e)) return vp;
1471
- }
1472
- var $u = Jp;
1473
- var ss = 0;
1474
- async function Ku(e, t, r, n, s) {
1475
- let { node: u } = n, i = ss;
1476
- ss = ss + 1 >>> 0;
1477
- let a = (S) => `PRETTIER_HTML_PLACEHOLDER_${S}_${i}_IN_JS`, p = u.quasis.map((S, g, M) => g === M.length - 1 ? S.value.cooked : S.value.cooked + a(g)).join(""), o = Xt(n, r), m = new RegExp(a(String.raw`(\d+)`), "gu"), y = 0, D = await t(p, { parser: e, __onHtmlRoot(S) {
1478
- y = S.children.length;
1479
- } }), C = mt(D, (S) => {
1480
- if (typeof S != "string") return S;
1481
- let g = [], M = S.split(m);
1482
- for (let R = 0; R < M.length; R++) {
1483
- let j = M[R];
1484
- if (R % 2 === 0) {
1485
- j && (j = ts(j), s.__embeddedInHtml && (j = Y(false, j, /<\/(?=script\b)/giu, String.raw`<\/`)), g.push(j));
1486
- continue;
1487
- }
1488
- let I = Number(j);
1489
- g.push(o[I]);
1490
- }
1491
- return g;
1492
- }), c = /^\s/u.test(p) ? " " : "", A = /\s$/u.test(p) ? " " : "", T = s.htmlWhitespaceSensitivity === "ignore" ? F : c && A ? x : null;
1493
- return T ? l(["`", f([T, l(C)]), T, "`"]) : st({ hug: false }, l(["`", c, y > 1 ? f(l(C)) : l(C), A, "`"]));
1494
- }
1495
- function qp(e) {
1496
- return Ur(e, "HTML") || e.match((t) => t.type === "TemplateLiteral", (t, r) => t.type === "TaggedTemplateExpression" && t.tag.type === "Identifier" && t.tag.name === "html" && r === "quasi");
1497
- }
1498
- var Wp = Ku.bind(void 0, "html");
1499
- var Gp = Ku.bind(void 0, "angular");
1500
- function Up(e) {
1501
- if (qp(e)) return Wp;
1502
- if (Hu(e)) return Gp;
1503
- }
1504
- var Qu = Up;
1505
- async function Xp(e, t, r) {
1506
- let { node: n } = r, s = Y(false, n.quasis[0].value.raw, /((?:\\\\)*)\\`/gu, (p, o) => "\\".repeat(o.length / 2) + "`"), u = Yp(s), i = u !== "";
1507
- i && (s = Y(false, s, new RegExp(`^${u}`, "gmu"), ""));
1508
- let a = Gr(await e(s, { parser: "markdown", __inJsTemplate: true }), true);
1509
- return ["`", i ? f([E, a]) : [Jr, xu(a)], E, "`"];
1510
- }
1511
- function Yp(e) {
1512
- let t = e.match(/^([^\S\n]*)\S/mu);
1513
- return t === null ? "" : t[1];
1514
- }
1515
- function Hp(e) {
1516
- if (Np(e)) return Xp;
1517
- }
1518
- function Np({ node: e, parent: t }) {
1519
- return (t == null ? void 0 : t.type) === "TaggedTemplateExpression" && e.quasis.length === 1 && t.tag.type === "Identifier" && (t.tag.name === "md" || t.tag.name === "markdown");
1520
- }
1521
- var zu = Hp;
1522
- function Vp(e) {
1523
- let { node: t } = e;
1524
- if (t.type !== "TemplateLiteral" || $p(t)) return;
1525
- let r;
1526
- for (let n of [Vu, $u, Qu, zu]) if (r = n(e), !!r) return t.quasis.length === 1 && t.quasis[0].value.raw.trim() === "" ? "``" : async (...s) => {
1527
- let u = await r(...s);
1528
- return u && st({ embed: true, ...u.label }, u);
1529
- };
1530
- }
1531
- function $p({ quasis: e }) {
1532
- return e.some(({ value: { cooked: t } }) => t === null);
1533
- }
1534
- var Zu = Vp;
1535
- var Kp = /\*\/$/;
1536
- var Qp = /^\/\*\*?/;
1537
- var ni = /^\s*(\/\*\*?(.|\r?\n)*?\*\/)/;
1538
- var zp = /(^|\s+)\/\/([^\n\r]*)/g;
1539
- var ei = /^(\r?\n)+/;
1540
- var Zp = /(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g;
1541
- var ti = /(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g;
1542
- var ec = /(\r?\n|^) *\* ?/g;
1543
- var si = [];
1544
- function ui(e) {
1545
- let t = e.match(ni);
1546
- return t ? t[0].trimStart() : "";
1547
- }
1548
- function ii(e) {
1549
- let t = e.match(ni), r = t == null ? void 0 : t[0];
1550
- return r == null ? e : e.slice(r.length);
1551
- }
1552
- function ai(e) {
1553
- let t = `
1554
- `;
1555
- e = Y(false, e.replace(Qp, "").replace(Kp, ""), ec, "$1");
1556
- let r = "";
1557
- for (; r !== e; ) r = e, e = Y(false, e, Zp, `${t}$1 $2${t}`);
1558
- e = e.replace(ei, "").trimEnd();
1559
- let n = /* @__PURE__ */ Object.create(null), s = Y(false, e, ti, "").replace(ei, "").trimEnd(), u;
1560
- for (; u = ti.exec(e); ) {
1561
- let i = Y(false, u[2], zp, "");
1562
- if (typeof n[u[1]] == "string" || Array.isArray(n[u[1]])) {
1563
- let a = n[u[1]];
1564
- n[u[1]] = [...si, ...Array.isArray(a) ? a : [a], i];
1565
- } else n[u[1]] = i;
1566
- }
1567
- return { comments: s, pragmas: n };
1568
- }
1569
- function oi({ comments: e = "", pragmas: t = {} }) {
1570
- let r = `
1571
- `, n = "/**", s = " *", u = " */", i = Object.keys(t), a = i.flatMap((o) => ri(o, t[o])).map((o) => `${s} ${o}${r}`).join("");
1572
- if (!e) {
1573
- if (i.length === 0) return "";
1574
- if (i.length === 1 && !Array.isArray(t[i[0]])) {
1575
- let o = t[i[0]];
1576
- return `${n} ${ri(i[0], o)[0]}${u}`;
1577
- }
1578
- }
1579
- let p = e.split(r).map((o) => `${s} ${o}`).join(r) + r;
1580
- return n + r + (e ? p : "") + (e && i.length > 0 ? s + r : "") + a + u;
1581
- }
1582
- function ri(e, t) {
1583
- return [...si, ...Array.isArray(t) ? t : [t]].map((r) => `@${e} ${r}`.trim());
1584
- }
1585
- function tc(e) {
1586
- if (!e.startsWith("#!")) return "";
1587
- let t = e.indexOf(`
1588
- `);
1589
- return t === -1 ? e : e.slice(0, t);
1590
- }
1591
- var pi = tc;
1592
- function rc(e) {
1593
- let t = pi(e);
1594
- t && (e = e.slice(t.length + 1));
1595
- let r = ui(e), { pragmas: n, comments: s } = ai(r);
1596
- return { shebang: t, text: e, pragmas: n, comments: s };
1597
- }
1598
- function ci(e) {
1599
- let { shebang: t, text: r, pragmas: n, comments: s } = rc(e), u = ii(r), i = oi({ pragmas: { format: "", ...n }, comments: s.trimStart() });
1600
- return (t ? `${t}
1601
- ` : "") + i + (u.startsWith(`
1602
- `) ? `
1603
- ` : `
1604
-
1605
- `) + u;
1606
- }
1607
- function nc(e, t) {
1608
- let { originalText: r, [Symbol.for("comments")]: n, locStart: s, locEnd: u, [Symbol.for("printedComments")]: i } = t, { node: a } = e, p = s(a), o = u(a);
1609
- for (let m of n) s(m) >= p && u(m) <= o && i.add(m);
1610
- return r.slice(p, o);
1611
- }
1612
- var li = nc;
1613
- function us(e, t) {
1614
- var u, i, a, p, o, m, y, D, C;
1615
- if (e.isRoot) return false;
1616
- let { node: r, key: n, parent: s } = e;
1617
- if (t.__isInHtmlInterpolation && !t.bracketSpacing && ac(r) && pr(e)) return true;
1618
- if (sc(r)) return false;
1619
- if (r.type === "Identifier") {
1620
- if ((u = r.extra) != null && u.parenthesized && /^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/u.test(r.name) || n === "left" && (r.name === "async" && !s.await || r.name === "let") && s.type === "ForOfStatement") return true;
1621
- if (r.name === "let") {
1622
- let c = (i = e.findAncestor((A) => A.type === "ForOfStatement")) == null ? void 0 : i.left;
1623
- if (c && ie(c, (A) => A === r)) return true;
1624
- }
1625
- if (n === "object" && r.name === "let" && s.type === "MemberExpression" && s.computed && !s.optional) {
1626
- let c = e.findAncestor((T) => T.type === "ExpressionStatement" || T.type === "ForStatement" || T.type === "ForInStatement"), A = c ? c.type === "ExpressionStatement" ? c.expression : c.type === "ForStatement" ? c.init : c.left : void 0;
1627
- if (A && ie(A, (T) => T === r)) return true;
1628
- }
1629
- if (n === "expression") switch (r.name) {
1630
- case "await":
1631
- case "interface":
1632
- case "module":
1633
- case "using":
1634
- case "yield":
1635
- case "let":
1636
- case "component":
1637
- case "hook":
1638
- case "type": {
1639
- let c = e.findAncestor((A) => !Ae(A));
1640
- if (c !== s && c.type === "ExpressionStatement") return true;
1641
- }
1642
- }
1643
- return false;
1644
- }
1645
- if (r.type === "ObjectExpression" || r.type === "FunctionExpression" || r.type === "ClassExpression" || r.type === "DoExpression") {
1646
- let c = (a = e.findAncestor((A) => A.type === "ExpressionStatement")) == null ? void 0 : a.expression;
1647
- if (c && ie(c, (A) => A === r)) return true;
1648
- }
1649
- if (r.type === "ObjectExpression") {
1650
- let c = (p = e.findAncestor((A) => A.type === "ArrowFunctionExpression")) == null ? void 0 : p.body;
1651
- if (c && c.type !== "SequenceExpression" && c.type !== "AssignmentExpression" && ie(c, (A) => A === r)) return true;
1652
- }
1653
- switch (s.type) {
1654
- case "ParenthesizedExpression":
1655
- return false;
1656
- case "ClassDeclaration":
1657
- case "ClassExpression":
1658
- if (n === "superClass" && (r.type === "ArrowFunctionExpression" || r.type === "AssignmentExpression" || r.type === "AwaitExpression" || r.type === "BinaryExpression" || r.type === "ConditionalExpression" || r.type === "LogicalExpression" || r.type === "NewExpression" || r.type === "ObjectExpression" || r.type === "SequenceExpression" || r.type === "TaggedTemplateExpression" || r.type === "UnaryExpression" || r.type === "UpdateExpression" || r.type === "YieldExpression" || r.type === "TSNonNullExpression" || r.type === "ClassExpression" && O(r.decorators))) return true;
1659
- break;
1660
- case "ExportDefaultDeclaration":
1661
- return mi(e, t) || r.type === "SequenceExpression";
1662
- case "Decorator":
1663
- if (n === "expression" && !pc(r)) return true;
1664
- break;
1665
- case "TypeAnnotation":
1666
- if (e.match(void 0, void 0, (c, A) => A === "returnType" && c.type === "ArrowFunctionExpression") && ic(r)) return true;
1667
- break;
1668
- case "BinaryExpression":
1669
- if (n === "left" && (s.operator === "in" || s.operator === "instanceof") && r.type === "UnaryExpression") return true;
1670
- break;
1671
- case "VariableDeclarator":
1672
- if (n === "init" && e.match(void 0, void 0, (c, A) => A === "declarations" && c.type === "VariableDeclaration", (c, A) => A === "left" && c.type === "ForInStatement")) return true;
1673
- break;
1674
- }
1675
- switch (r.type) {
1676
- case "UpdateExpression":
1677
- if (s.type === "UnaryExpression") return r.prefix && (r.operator === "++" && s.operator === "+" || r.operator === "--" && s.operator === "-");
1678
- case "UnaryExpression":
1679
- switch (s.type) {
1680
- case "UnaryExpression":
1681
- return r.operator === s.operator && (r.operator === "+" || r.operator === "-");
1682
- case "BindExpression":
1683
- return true;
1684
- case "MemberExpression":
1685
- case "OptionalMemberExpression":
1686
- return n === "object";
1687
- case "TaggedTemplateExpression":
1688
- return true;
1689
- case "NewExpression":
1690
- case "CallExpression":
1691
- case "OptionalCallExpression":
1692
- return n === "callee";
1693
- case "BinaryExpression":
1694
- return n === "left" && s.operator === "**";
1695
- case "TSNonNullExpression":
1696
- return true;
1697
- default:
1698
- return false;
1699
- }
1700
- case "BinaryExpression":
1701
- if (s.type === "UpdateExpression" || r.operator === "in" && uc(e)) return true;
1702
- if (r.operator === "|>" && ((o = r.extra) != null && o.parenthesized)) {
1703
- let c = e.grandparent;
1704
- if (c.type === "BinaryExpression" && c.operator === "|>") return true;
1705
- }
1706
- case "TSTypeAssertion":
1707
- case "TSAsExpression":
1708
- case "TSSatisfiesExpression":
1709
- case "AsExpression":
1710
- case "AsConstExpression":
1711
- case "SatisfiesExpression":
1712
- case "LogicalExpression":
1713
- switch (s.type) {
1714
- case "TSAsExpression":
1715
- case "TSSatisfiesExpression":
1716
- case "AsExpression":
1717
- case "AsConstExpression":
1718
- case "SatisfiesExpression":
1719
- return !Ae(r);
1720
- case "ConditionalExpression":
1721
- return Ae(r) || ou(r);
1722
- case "CallExpression":
1723
- case "NewExpression":
1724
- case "OptionalCallExpression":
1725
- return n === "callee";
1726
- case "ClassExpression":
1727
- case "ClassDeclaration":
1728
- return n === "superClass";
1729
- case "TSTypeAssertion":
1730
- case "TaggedTemplateExpression":
1731
- case "UnaryExpression":
1732
- case "JSXSpreadAttribute":
1733
- case "SpreadElement":
1734
- case "BindExpression":
1735
- case "AwaitExpression":
1736
- case "TSNonNullExpression":
1737
- case "UpdateExpression":
1738
- return true;
1739
- case "MemberExpression":
1740
- case "OptionalMemberExpression":
1741
- return n === "object";
1742
- case "AssignmentExpression":
1743
- case "AssignmentPattern":
1744
- return n === "left" && (r.type === "TSTypeAssertion" || Ae(r));
1745
- case "LogicalExpression":
1746
- if (r.type === "LogicalExpression") return s.operator !== r.operator;
1747
- case "BinaryExpression": {
1748
- let { operator: c, type: A } = r;
1749
- if (!c && A !== "TSTypeAssertion") return true;
1750
- let T = tr(c), S = s.operator, g = tr(S);
1751
- return g > T || n === "right" && g === T || g === T && !sr(S, c) ? true : g < T && c === "%" ? S === "+" || S === "-" : !!Du(S);
1752
- }
1753
- default:
1754
- return false;
1755
- }
1756
- case "SequenceExpression":
1757
- switch (s.type) {
1758
- case "ReturnStatement":
1759
- return false;
1760
- case "ForStatement":
1761
- return false;
1762
- case "ExpressionStatement":
1763
- return n !== "expression";
1764
- case "ArrowFunctionExpression":
1765
- return n !== "body";
1766
- default:
1767
- return true;
1768
- }
1769
- case "YieldExpression":
1770
- if (s.type === "AwaitExpression" || s.type === "TSTypeAssertion") return true;
1771
- case "AwaitExpression":
1772
- switch (s.type) {
1773
- case "TaggedTemplateExpression":
1774
- case "UnaryExpression":
1775
- case "LogicalExpression":
1776
- case "SpreadElement":
1777
- case "TSAsExpression":
1778
- case "TSSatisfiesExpression":
1779
- case "TSNonNullExpression":
1780
- case "AsExpression":
1781
- case "AsConstExpression":
1782
- case "SatisfiesExpression":
1783
- case "BindExpression":
1784
- return true;
1785
- case "MemberExpression":
1786
- case "OptionalMemberExpression":
1787
- return n === "object";
1788
- case "NewExpression":
1789
- case "CallExpression":
1790
- case "OptionalCallExpression":
1791
- return n === "callee";
1792
- case "ConditionalExpression":
1793
- return n === "test";
1794
- case "BinaryExpression":
1795
- return !(!r.argument && s.operator === "|>");
1796
- default:
1797
- return false;
1798
- }
1799
- case "TSFunctionType":
1800
- if (e.match((c) => c.type === "TSFunctionType", (c, A) => A === "typeAnnotation" && c.type === "TSTypeAnnotation", (c, A) => A === "returnType" && c.type === "ArrowFunctionExpression")) return true;
1801
- case "TSConditionalType":
1802
- case "TSConstructorType":
1803
- if (n === "extendsType" && s.type === "TSConditionalType") {
1804
- if (r.type === "TSConditionalType") return true;
1805
- let { typeAnnotation: c } = r.returnType || r.typeAnnotation;
1806
- if (c.type === "TSTypePredicate" && c.typeAnnotation && (c = c.typeAnnotation.typeAnnotation), c.type === "TSInferType" && c.typeParameter.constraint) return true;
1807
- }
1808
- if (n === "checkType" && s.type === "TSConditionalType") return true;
1809
- case "TSUnionType":
1810
- case "TSIntersectionType":
1811
- if ((s.type === "TSUnionType" || s.type === "TSIntersectionType") && s.types.length > 1 && (!r.types || r.types.length > 1)) return true;
1812
- case "TSInferType":
1813
- if (r.type === "TSInferType") {
1814
- if (s.type === "TSRestType") return false;
1815
- if (n === "types" && (s.type === "TSUnionType" || s.type === "TSIntersectionType") && r.typeParameter.type === "TSTypeParameter" && r.typeParameter.constraint) return true;
1816
- }
1817
- case "TSTypeOperator":
1818
- return s.type === "TSArrayType" || s.type === "TSOptionalType" || s.type === "TSRestType" || n === "objectType" && s.type === "TSIndexedAccessType" || s.type === "TSTypeOperator" || s.type === "TSTypeAnnotation" && e.grandparent.type.startsWith("TSJSDoc");
1819
- case "TSTypeQuery":
1820
- return n === "objectType" && s.type === "TSIndexedAccessType" || n === "elementType" && s.type === "TSArrayType";
1821
- case "TypeOperator":
1822
- return s.type === "ArrayTypeAnnotation" || s.type === "NullableTypeAnnotation" || n === "objectType" && (s.type === "IndexedAccessType" || s.type === "OptionalIndexedAccessType") || s.type === "TypeOperator";
1823
- case "TypeofTypeAnnotation":
1824
- return n === "objectType" && (s.type === "IndexedAccessType" || s.type === "OptionalIndexedAccessType") || n === "elementType" && s.type === "ArrayTypeAnnotation";
1825
- case "ArrayTypeAnnotation":
1826
- return s.type === "NullableTypeAnnotation";
1827
- case "IntersectionTypeAnnotation":
1828
- case "UnionTypeAnnotation":
1829
- return s.type === "TypeOperator" || s.type === "ArrayTypeAnnotation" || s.type === "NullableTypeAnnotation" || s.type === "IntersectionTypeAnnotation" || s.type === "UnionTypeAnnotation" || n === "objectType" && (s.type === "IndexedAccessType" || s.type === "OptionalIndexedAccessType");
1830
- case "InferTypeAnnotation":
1831
- case "NullableTypeAnnotation":
1832
- return s.type === "ArrayTypeAnnotation" || n === "objectType" && (s.type === "IndexedAccessType" || s.type === "OptionalIndexedAccessType");
1833
- case "ComponentTypeAnnotation":
1834
- case "FunctionTypeAnnotation": {
1835
- if (r.type === "ComponentTypeAnnotation" && (r.rendersType === null || r.rendersType === void 0)) return false;
1836
- if (e.match(void 0, (A, T) => T === "typeAnnotation" && A.type === "TypeAnnotation", (A, T) => T === "returnType" && A.type === "ArrowFunctionExpression") || e.match(void 0, (A, T) => T === "typeAnnotation" && A.type === "TypePredicate", (A, T) => T === "typeAnnotation" && A.type === "TypeAnnotation", (A, T) => T === "returnType" && A.type === "ArrowFunctionExpression")) return true;
1837
- let c = s.type === "NullableTypeAnnotation" ? e.grandparent : s;
1838
- return c.type === "UnionTypeAnnotation" || c.type === "IntersectionTypeAnnotation" || c.type === "ArrayTypeAnnotation" || n === "objectType" && (c.type === "IndexedAccessType" || c.type === "OptionalIndexedAccessType") || n === "checkType" && s.type === "ConditionalTypeAnnotation" || n === "extendsType" && s.type === "ConditionalTypeAnnotation" && ((m = r.returnType) == null ? void 0 : m.type) === "InferTypeAnnotation" && ((y = r.returnType) == null ? void 0 : y.typeParameter.bound) || c.type === "NullableTypeAnnotation" || s.type === "FunctionTypeParam" && s.name === null && z(r).some((A) => {
1839
- var T;
1840
- return ((T = A.typeAnnotation) == null ? void 0 : T.type) === "NullableTypeAnnotation";
1841
- });
1842
- }
1843
- case "ConditionalTypeAnnotation":
1844
- if (n === "extendsType" && s.type === "ConditionalTypeAnnotation" && r.type === "ConditionalTypeAnnotation" || n === "checkType" && s.type === "ConditionalTypeAnnotation") return true;
1845
- case "OptionalIndexedAccessType":
1846
- return n === "objectType" && s.type === "IndexedAccessType";
1847
- case "StringLiteral":
1848
- case "NumericLiteral":
1849
- case "Literal":
1850
- if (typeof r.value == "string" && s.type === "ExpressionStatement" && !s.directive) {
1851
- let c = e.grandparent;
1852
- return c.type === "Program" || c.type === "BlockStatement";
1853
- }
1854
- return n === "object" && s.type === "MemberExpression" && typeof r.value == "number";
1855
- case "AssignmentExpression": {
1856
- let c = e.grandparent;
1857
- return n === "body" && s.type === "ArrowFunctionExpression" ? true : n === "key" && (s.type === "ClassProperty" || s.type === "PropertyDefinition") && s.computed || (n === "init" || n === "update") && s.type === "ForStatement" ? false : s.type === "ExpressionStatement" ? r.left.type === "ObjectPattern" : !(n === "key" && s.type === "TSPropertySignature" || s.type === "AssignmentExpression" || s.type === "SequenceExpression" && c.type === "ForStatement" && (c.init === s || c.update === s) || n === "value" && s.type === "Property" && c.type === "ObjectPattern" && c.properties.includes(s) || s.type === "NGChainedExpression" || n === "node" && s.type === "JsExpressionRoot");
1858
- }
1859
- case "ConditionalExpression":
1860
- switch (s.type) {
1861
- case "TaggedTemplateExpression":
1862
- case "UnaryExpression":
1863
- case "SpreadElement":
1864
- case "BinaryExpression":
1865
- case "LogicalExpression":
1866
- case "NGPipeExpression":
1867
- case "ExportDefaultDeclaration":
1868
- case "AwaitExpression":
1869
- case "JSXSpreadAttribute":
1870
- case "TSTypeAssertion":
1871
- case "TypeCastExpression":
1872
- case "TSAsExpression":
1873
- case "TSSatisfiesExpression":
1874
- case "AsExpression":
1875
- case "AsConstExpression":
1876
- case "SatisfiesExpression":
1877
- case "TSNonNullExpression":
1878
- return true;
1879
- case "NewExpression":
1880
- case "CallExpression":
1881
- case "OptionalCallExpression":
1882
- return n === "callee";
1883
- case "ConditionalExpression":
1884
- return t.experimentalTernaries ? false : n === "test";
1885
- case "MemberExpression":
1886
- case "OptionalMemberExpression":
1887
- return n === "object";
1888
- default:
1889
- return false;
1890
- }
1891
- case "FunctionExpression":
1892
- switch (s.type) {
1893
- case "NewExpression":
1894
- case "CallExpression":
1895
- case "OptionalCallExpression":
1896
- return n === "callee";
1897
- case "TaggedTemplateExpression":
1898
- return true;
1899
- default:
1900
- return false;
1901
- }
1902
- case "ArrowFunctionExpression":
1903
- switch (s.type) {
1904
- case "BinaryExpression":
1905
- return s.operator !== "|>" || ((D = r.extra) == null ? void 0 : D.parenthesized);
1906
- case "NewExpression":
1907
- case "CallExpression":
1908
- case "OptionalCallExpression":
1909
- return n === "callee";
1910
- case "MemberExpression":
1911
- case "OptionalMemberExpression":
1912
- return n === "object";
1913
- case "TSAsExpression":
1914
- case "TSSatisfiesExpression":
1915
- case "AsExpression":
1916
- case "AsConstExpression":
1917
- case "SatisfiesExpression":
1918
- case "TSNonNullExpression":
1919
- case "BindExpression":
1920
- case "TaggedTemplateExpression":
1921
- case "UnaryExpression":
1922
- case "LogicalExpression":
1923
- case "AwaitExpression":
1924
- case "TSTypeAssertion":
1925
- return true;
1926
- case "ConditionalExpression":
1927
- return n === "test";
1928
- default:
1929
- return false;
1930
- }
1931
- case "ClassExpression":
1932
- switch (s.type) {
1933
- case "NewExpression":
1934
- return n === "callee";
1935
- default:
1936
- return false;
1937
- }
1938
- case "OptionalMemberExpression":
1939
- case "OptionalCallExpression":
1940
- case "CallExpression":
1941
- case "MemberExpression":
1942
- if (oc(e)) return true;
1943
- case "TaggedTemplateExpression":
1944
- case "TSNonNullExpression":
1945
- if (n === "callee" && (s.type === "BindExpression" || s.type === "NewExpression")) {
1946
- let c = r;
1947
- for (; c; ) switch (c.type) {
1948
- case "CallExpression":
1949
- case "OptionalCallExpression":
1950
- return true;
1951
- case "MemberExpression":
1952
- case "OptionalMemberExpression":
1953
- case "BindExpression":
1954
- c = c.object;
1955
- break;
1956
- case "TaggedTemplateExpression":
1957
- c = c.tag;
1958
- break;
1959
- case "TSNonNullExpression":
1960
- c = c.expression;
1961
- break;
1962
- default:
1963
- return false;
1964
- }
1965
- }
1966
- return false;
1967
- case "BindExpression":
1968
- return n === "callee" && (s.type === "BindExpression" || s.type === "NewExpression") || n === "object" && W(s);
1969
- case "NGPipeExpression":
1970
- return !(s.type === "NGRoot" || s.type === "NGMicrosyntaxExpression" || s.type === "ObjectProperty" && !((C = r.extra) != null && C.parenthesized) || X(s) || n === "arguments" && L(s) || n === "right" && s.type === "NGPipeExpression" || n === "property" && s.type === "MemberExpression" || s.type === "AssignmentExpression");
1971
- case "JSXFragment":
1972
- case "JSXElement":
1973
- return n === "callee" || n === "left" && s.type === "BinaryExpression" && s.operator === "<" || !X(s) && s.type !== "ArrowFunctionExpression" && s.type !== "AssignmentExpression" && s.type !== "AssignmentPattern" && s.type !== "BinaryExpression" && s.type !== "NewExpression" && s.type !== "ConditionalExpression" && s.type !== "ExpressionStatement" && s.type !== "JsExpressionRoot" && s.type !== "JSXAttribute" && s.type !== "JSXElement" && s.type !== "JSXExpressionContainer" && s.type !== "JSXFragment" && s.type !== "LogicalExpression" && !L(s) && !Ce(s) && s.type !== "ReturnStatement" && s.type !== "ThrowStatement" && s.type !== "TypeCastExpression" && s.type !== "VariableDeclarator" && s.type !== "YieldExpression";
1974
- case "TSInstantiationExpression":
1975
- return n === "object" && W(s);
1976
- }
1977
- return false;
1978
- }
1979
- var sc = v(["BlockStatement", "BreakStatement", "ComponentDeclaration", "ClassBody", "ClassDeclaration", "ClassMethod", "ClassProperty", "PropertyDefinition", "ClassPrivateProperty", "ContinueStatement", "DebuggerStatement", "DeclareComponent", "DeclareClass", "DeclareExportAllDeclaration", "DeclareExportDeclaration", "DeclareFunction", "DeclareHook", "DeclareInterface", "DeclareModule", "DeclareModuleExports", "DeclareNamespace", "DeclareVariable", "DeclareEnum", "DoWhileStatement", "EnumDeclaration", "ExportAllDeclaration", "ExportDefaultDeclaration", "ExportNamedDeclaration", "ExpressionStatement", "ForInStatement", "ForOfStatement", "ForStatement", "FunctionDeclaration", "HookDeclaration", "IfStatement", "ImportDeclaration", "InterfaceDeclaration", "LabeledStatement", "MethodDefinition", "ReturnStatement", "SwitchStatement", "ThrowStatement", "TryStatement", "TSDeclareFunction", "TSEnumDeclaration", "TSImportEqualsDeclaration", "TSInterfaceDeclaration", "TSModuleDeclaration", "TSNamespaceExportDeclaration", "TypeAlias", "VariableDeclaration", "WhileStatement", "WithStatement"]);
1980
- function uc(e) {
1981
- let t = 0, { node: r } = e;
1982
- for (; r; ) {
1983
- let n = e.getParentNode(t++);
1984
- if ((n == null ? void 0 : n.type) === "ForStatement" && n.init === r) return true;
1985
- r = n;
1986
- }
1987
- return false;
1988
- }
1989
- function ic(e) {
1990
- return rr(e, (t) => t.type === "ObjectTypeAnnotation" && rr(t, (r) => r.type === "FunctionTypeAnnotation"));
1991
- }
1992
- function ac(e) {
1993
- return se(e);
1994
- }
1995
- function pr(e) {
1996
- let { parent: t, key: r } = e;
1997
- switch (t.type) {
1998
- case "NGPipeExpression":
1999
- if (r === "arguments" && e.isLast) return e.callParent(pr);
2000
- break;
2001
- case "ObjectProperty":
2002
- if (r === "value") return e.callParent(() => e.key === "properties" && e.isLast);
2003
- break;
2004
- case "BinaryExpression":
2005
- case "LogicalExpression":
2006
- if (r === "right") return e.callParent(pr);
2007
- break;
2008
- case "ConditionalExpression":
2009
- if (r === "alternate") return e.callParent(pr);
2010
- break;
2011
- case "UnaryExpression":
2012
- if (t.prefix) return e.callParent(pr);
2013
- break;
2014
- }
2015
- return false;
2016
- }
2017
- function mi(e, t) {
2018
- let { node: r, parent: n } = e;
2019
- return r.type === "FunctionExpression" || r.type === "ClassExpression" ? n.type === "ExportDefaultDeclaration" || !us(e, t) : !Rt(r) || n.type !== "ExportDefaultDeclaration" && us(e, t) ? false : e.call(() => mi(e, t), ...Pr(r));
2020
- }
2021
- function oc(e) {
2022
- return !!(e.match(void 0, (t, r) => r === "expression" && t.type === "ChainExpression", (t, r) => r === "tag" && t.type === "TaggedTemplateExpression") || e.match((t) => t.type === "OptionalCallExpression" || t.type === "OptionalMemberExpression", (t, r) => r === "tag" && t.type === "TaggedTemplateExpression") || e.match((t) => t.type === "OptionalCallExpression" || t.type === "OptionalMemberExpression", (t, r) => r === "expression" && t.type === "TSNonNullExpression", (t, r) => r === "tag" && t.type === "TaggedTemplateExpression") || e.match(void 0, (t, r) => r === "expression" && t.type === "ChainExpression", (t, r) => r === "expression" && t.type === "TSNonNullExpression", (t, r) => r === "tag" && t.type === "TaggedTemplateExpression") || e.match(void 0, (t, r) => r === "expression" && t.type === "TSNonNullExpression", (t, r) => r === "expression" && t.type === "ChainExpression", (t, r) => r === "tag" && t.type === "TaggedTemplateExpression") || e.match((t) => t.type === "OptionalMemberExpression" || t.type === "OptionalCallExpression", (t, r) => r === "object" && t.type === "MemberExpression" || r === "callee" && (t.type === "CallExpression" || t.type === "NewExpression")) || e.match((t) => t.type === "OptionalMemberExpression" || t.type === "OptionalCallExpression", (t, r) => r === "expression" && t.type === "TSNonNullExpression", (t, r) => r === "object" && t.type === "MemberExpression" || r === "callee" && t.type === "CallExpression") || e.match((t) => t.type === "CallExpression" || t.type === "MemberExpression", (t, r) => r === "expression" && t.type === "ChainExpression") && (e.match(void 0, void 0, (t, r) => r === "callee" && (t.type === "CallExpression" && !t.optional || t.type === "NewExpression") || r === "object" && t.type === "MemberExpression" && !t.optional) || e.match(void 0, void 0, (t, r) => r === "expression" && t.type === "TSNonNullExpression", (t, r) => r === "object" && t.type === "MemberExpression" || r === "callee" && t.type === "CallExpression")) || e.match((t) => t.type === "CallExpression" || t.type === "MemberExpression", (t, r) => r === "expression" && t.type === "TSNonNullExpression", (t, r) => r === "expression" && t.type === "ChainExpression", (t, r) => r === "object" && t.type === "MemberExpression" || r === "callee" && t.type === "CallExpression"));
2023
- }
2024
- function is(e) {
2025
- return e.type === "Identifier" ? true : W(e) ? !e.computed && !e.optional && e.property.type === "Identifier" && is(e.object) : false;
2026
- }
2027
- function pc(e) {
2028
- return e.type === "ChainExpression" && (e = e.expression), is(e) || L(e) && !e.optional && is(e.callee);
2029
- }
2030
- var Be = us;
2031
- function cc(e, t) {
2032
- let r = t - 1;
2033
- r = We(e, r, { backwards: true }), r = Ge(e, r, { backwards: true }), r = We(e, r, { backwards: true });
2034
- let n = Ge(e, r, { backwards: true });
2035
- return r !== n;
2036
- }
2037
- var yi = cc;
2038
- var lc = () => true;
2039
- function as(e, t) {
2040
- let r = e.node;
2041
- return r.printed = true, t.printer.printComment(e, t);
2042
- }
2043
- function mc(e, t) {
2044
- var m;
2045
- let r = e.node, n = [as(e, t)], { printer: s, originalText: u, locStart: i, locEnd: a } = t;
2046
- if ((m = s.isBlockComment) == null ? void 0 : m.call(s, r)) {
2047
- let y = Z(u, a(r)) ? Z(u, i(r), { backwards: true }) ? F : x : " ";
2048
- n.push(y);
2049
- } else n.push(F);
2050
- let o = Ge(u, We(u, a(r)));
2051
- return o !== false && Z(u, o) && n.push(F), n;
2052
- }
2053
- function yc(e, t, r) {
2054
- var o;
2055
- let n = e.node, s = as(e, t), { printer: u, originalText: i, locStart: a } = t, p = (o = u.isBlockComment) == null ? void 0 : o.call(u, n);
2056
- if (r != null && r.hasLineSuffix && !(r != null && r.isBlock) || Z(i, a(n), { backwards: true })) {
2057
- let m = yi(i, a(n));
2058
- return { doc: Wn([F, m ? F : "", s]), isBlock: p, hasLineSuffix: true };
2059
- }
2060
- return !p || r != null && r.hasLineSuffix ? { doc: [Wn([" ", s]), Ee], isBlock: p, hasLineSuffix: true } : { doc: [" ", s], isBlock: p, hasLineSuffix: false };
2061
- }
2062
- function J(e, t, r = {}) {
2063
- let { node: n } = e;
2064
- if (!O(n == null ? void 0 : n.comments)) return "";
2065
- let { indent: s = false, marker: u, filter: i = lc } = r, a = [];
2066
- if (e.each(({ node: o }) => {
2067
- o.leading || o.trailing || o.marker !== u || !i(o) || a.push(as(e, t));
2068
- }, "comments"), a.length === 0) return "";
2069
- let p = b(F, a);
2070
- return s ? f([F, p]) : p;
2071
- }
2072
- function os(e, t) {
2073
- let r = e.node;
2074
- if (!r) return {};
2075
- let n = t[Symbol.for("printedComments")];
2076
- if ((r.comments || []).filter((p) => !n.has(p)).length === 0) return { leading: "", trailing: "" };
2077
- let u = [], i = [], a;
2078
- return e.each(() => {
2079
- let p = e.node;
2080
- if (n != null && n.has(p)) return;
2081
- let { leading: o, trailing: m } = p;
2082
- o ? u.push(mc(e, t)) : m && (a = yc(e, t, a), i.push(a.doc));
2083
- }, "comments"), { leading: u, trailing: i };
2084
- }
2085
- function ye(e, t, r) {
2086
- let { leading: n, trailing: s } = os(e, r);
2087
- return !n && !s ? t : or(t, (u) => [n, u, s]);
2088
- }
2089
- var ps = class extends Error {
2090
- name = "UnexpectedNodeError";
2091
- constructor(t, r, n = "type") {
2092
- super(`Unexpected ${r} node ${n}: ${JSON.stringify(t[n])}.`), this.node = t;
2093
- }
2094
- };
2095
- var Me = ps;
2096
- function cs(e) {
2097
- if (typeof e != "string") throw new TypeError("Expected a string");
2098
- return e.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
2099
- }
2100
- var Re;
2101
- var ls = class {
2102
- constructor(t) {
2103
- Ws(this, Re);
2104
- Gs(this, Re, new Set(t));
2105
- }
2106
- getLeadingWhitespaceCount(t) {
2107
- let r = pt(this, Re), n = 0;
2108
- for (let s = 0; s < t.length && r.has(t.charAt(s)); s++) n++;
2109
- return n;
2110
- }
2111
- getTrailingWhitespaceCount(t) {
2112
- let r = pt(this, Re), n = 0;
2113
- for (let s = t.length - 1; s >= 0 && r.has(t.charAt(s)); s--) n++;
2114
- return n;
2115
- }
2116
- getLeadingWhitespace(t) {
2117
- let r = this.getLeadingWhitespaceCount(t);
2118
- return t.slice(0, r);
2119
- }
2120
- getTrailingWhitespace(t) {
2121
- let r = this.getTrailingWhitespaceCount(t);
2122
- return t.slice(t.length - r);
2123
- }
2124
- hasLeadingWhitespace(t) {
2125
- return pt(this, Re).has(t.charAt(0));
2126
- }
2127
- hasTrailingWhitespace(t) {
2128
- return pt(this, Re).has(_(false, t, -1));
2129
- }
2130
- trimStart(t) {
2131
- let r = this.getLeadingWhitespaceCount(t);
2132
- return t.slice(r);
2133
- }
2134
- trimEnd(t) {
2135
- let r = this.getTrailingWhitespaceCount(t);
2136
- return t.slice(0, t.length - r);
2137
- }
2138
- trim(t) {
2139
- return this.trimEnd(this.trimStart(t));
2140
- }
2141
- split(t, r = false) {
2142
- let n = `[${cs([...pt(this, Re)].join(""))}]+`, s = new RegExp(r ? `(${n})` : n, "u");
2143
- return t.split(s);
2144
- }
2145
- hasWhitespaceCharacter(t) {
2146
- let r = pt(this, Re);
2147
- return Array.prototype.some.call(t, (n) => r.has(n));
2148
- }
2149
- hasNonWhitespaceCharacter(t) {
2150
- let r = pt(this, Re);
2151
- return Array.prototype.some.call(t, (n) => !r.has(n));
2152
- }
2153
- isWhitespaceOnly(t) {
2154
- let r = pt(this, Re);
2155
- return Array.prototype.every.call(t, (n) => r.has(n));
2156
- }
2157
- };
2158
- Re = /* @__PURE__ */ new WeakMap();
2159
- var Di = ls;
2160
- var Yr = new Di(`
2161
- \r `);
2162
- var ms = (e) => e === "" || e === x || e === F || e === E;
2163
- function Dc(e, t, r) {
2164
- var M, R, j, I, U;
2165
- let { node: n } = e;
2166
- if (n.type === "JSXElement" && Pc(n)) return [r("openingElement"), r("closingElement")];
2167
- let s = n.type === "JSXElement" ? r("openingElement") : r("openingFragment"), u = n.type === "JSXElement" ? r("closingElement") : r("closingFragment");
2168
- if (n.children.length === 1 && n.children[0].type === "JSXExpressionContainer" && (n.children[0].expression.type === "TemplateLiteral" || n.children[0].expression.type === "TaggedTemplateExpression")) return [s, ...e.map(r, "children"), u];
2169
- n.children = n.children.map((P) => kc(P) ? { type: "JSXText", value: " ", raw: " " } : P);
2170
- let i = n.children.some(H), a = n.children.filter((P) => P.type === "JSXExpressionContainer").length > 1, p = n.type === "JSXElement" && n.openingElement.attributes.length > 1, o = re(s) || i || p || a, m = e.parent.rootMarker === "mdx", y = t.singleQuote ? "{' '}" : '{" "}', D = m ? " " : B([y, E], " "), C = ((R = (M = n.openingElement) == null ? void 0 : M.name) == null ? void 0 : R.name) === "fbt", c = fc(e, t, r, D, C), A = n.children.some((P) => cr(P));
2171
- for (let P = c.length - 2; P >= 0; P--) {
2172
- let G = c[P] === "" && c[P + 1] === "", ue = c[P] === F && c[P + 1] === "" && c[P + 2] === F, Q = (c[P] === E || c[P] === F) && c[P + 1] === "" && c[P + 2] === D, gt = c[P] === D && c[P + 1] === "" && (c[P + 2] === E || c[P + 2] === F), Ft = c[P] === D && c[P + 1] === "" && c[P + 2] === D, w = c[P] === E && c[P + 1] === "" && c[P + 2] === F || c[P] === F && c[P + 1] === "" && c[P + 2] === E;
2173
- ue && A || G || Q || Ft || w ? c.splice(P, 2) : gt && c.splice(P + 1, 2);
2174
- }
2175
- for (; c.length > 0 && ms(_(false, c, -1)); ) c.pop();
2176
- for (; c.length > 1 && ms(c[0]) && ms(c[1]); ) c.shift(), c.shift();
2177
- let T = [];
2178
- for (let [P, G] of c.entries()) {
2179
- if (G === D) {
2180
- if (P === 1 && c[P - 1] === "") {
2181
- if (c.length === 2) {
2182
- T.push(y);
2183
- continue;
2184
- }
2185
- T.push([y, F]);
2186
- continue;
2187
- } else if (P === c.length - 1) {
2188
- T.push(y);
2189
- continue;
2190
- } else if (c[P - 1] === "" && c[P - 2] === F) {
2191
- T.push(y);
2192
- continue;
2193
- }
2194
- }
2195
- T.push(G), re(G) && (o = true);
2196
- }
2197
- let S = A ? Rr(T) : l(T, { shouldBreak: true });
2198
- if (((j = t.cursorNode) == null ? void 0 : j.type) === "JSXText" && n.children.includes(t.cursorNode) ? S = [ir, S, ir] : ((I = t.nodeBeforeCursor) == null ? void 0 : I.type) === "JSXText" && n.children.includes(t.nodeBeforeCursor) ? S = [ir, S] : ((U = t.nodeAfterCursor) == null ? void 0 : U.type) === "JSXText" && n.children.includes(t.nodeAfterCursor) && (S = [S, ir]), m) return S;
2199
- let g = l([s, f([F, S]), F, u]);
2200
- return o ? g : Ke([l([s, ...c, u]), g]);
2201
- }
2202
- function fc(e, t, r, n, s) {
2203
- let u = [];
2204
- return e.each(({ node: i, next: a }) => {
2205
- if (i.type === "JSXText") {
2206
- let p = fe(i);
2207
- if (cr(i)) {
2208
- let o = Yr.split(p, true);
2209
- o[0] === "" && (u.push(""), o.shift(), /\n/u.test(o[0]) ? u.push(Ei(s, o[1], i, a)) : u.push(n), o.shift());
2210
- let m;
2211
- if (_(false, o, -1) === "" && (o.pop(), m = o.pop()), o.length === 0) return;
2212
- for (let [y, D] of o.entries()) y % 2 === 1 ? u.push(x) : u.push(D);
2213
- m !== void 0 ? /\n/u.test(m) ? u.push(Ei(s, _(false, u, -1), i, a)) : u.push(n) : u.push(fi(s, _(false, u, -1), i, a));
2214
- } else /\n/u.test(p) ? p.match(/\n/gu).length > 1 && u.push("", F) : u.push("", n);
2215
- } else {
2216
- let p = r();
2217
- if (u.push(p), a && cr(a)) {
2218
- let m = Yr.trim(fe(a)), [y] = Yr.split(m);
2219
- u.push(fi(s, y, i, a));
2220
- } else u.push(F);
2221
- }
2222
- }, "children"), u;
2223
- }
2224
- function fi(e, t, r, n) {
2225
- return e ? "" : r.type === "JSXElement" && !r.closingElement || (n == null ? void 0 : n.type) === "JSXElement" && !n.closingElement ? t.length === 1 ? E : F : E;
2226
- }
2227
- function Ei(e, t, r, n) {
2228
- return e ? F : t.length === 1 ? r.type === "JSXElement" && !r.closingElement || (n == null ? void 0 : n.type) === "JSXElement" && !n.closingElement ? F : E : F;
2229
- }
2230
- var Ec = /* @__PURE__ */ new Set(["ArrayExpression", "TupleExpression", "JSXAttribute", "JSXElement", "JSXExpressionContainer", "JSXFragment", "ExpressionStatement", "CallExpression", "OptionalCallExpression", "ConditionalExpression", "JsExpressionRoot"]);
2231
- function Fc(e, t, r) {
2232
- let { parent: n } = e;
2233
- if (Ec.has(n.type)) return t;
2234
- let s = e.match(void 0, (i) => i.type === "ArrowFunctionExpression", L, (i) => i.type === "JSXExpressionContainer"), u = Be(e, r);
2235
- return l([u ? "" : B("("), f([E, t]), E, u ? "" : B(")")], { shouldBreak: s });
2236
- }
2237
- function Cc(e, t, r) {
2238
- let { node: n } = e, s = [];
2239
- if (s.push(r("name")), n.value) {
2240
- let u;
2241
- if (te(n.value)) {
2242
- let i = fe(n.value), a = Y(false, Y(false, i.slice(1, -1), "&apos;", "'"), "&quot;", '"'), p = xr(a, t.jsxSingleQuote);
2243
- a = p === '"' ? Y(false, a, '"', "&quot;") : Y(false, a, "'", "&apos;"), u = e.call(() => ye(e, Ie(p + a + p), t), "value");
2244
- } else u = r("value");
2245
- s.push("=", u);
2246
- }
2247
- return s;
2248
- }
2249
- function Ac(e, t, r) {
2250
- let { node: n } = e, s = (u, i) => u.type === "JSXEmptyExpression" || !d(u) && (X(u) || se(u) || u.type === "ArrowFunctionExpression" || u.type === "AwaitExpression" && (s(u.argument, u) || u.argument.type === "JSXElement") || L(u) || u.type === "ChainExpression" && L(u.expression) || u.type === "FunctionExpression" || u.type === "TemplateLiteral" || u.type === "TaggedTemplateExpression" || u.type === "DoExpression" || H(i) && (u.type === "ConditionalExpression" || De(u)));
2251
- return s(n.expression, e.parent) ? l(["{", r("expression"), ke, "}"]) : l(["{", f([E, r("expression")]), E, ke, "}"]);
2252
- }
2253
- function Tc(e, t, r) {
2254
- var a, p;
2255
- let { node: n } = e, s = d(n.name) || d(n.typeParameters) || d(n.typeArguments);
2256
- if (n.selfClosing && n.attributes.length === 0 && !s) return ["<", r("name"), n.typeArguments ? r("typeArguments") : r("typeParameters"), " />"];
2257
- if (((a = n.attributes) == null ? void 0 : a.length) === 1 && te(n.attributes[0].value) && !n.attributes[0].value.value.includes(`
2258
- `) && !s && !d(n.attributes[0])) return l(["<", r("name"), n.typeArguments ? r("typeArguments") : r("typeParameters"), " ", ...e.map(r, "attributes"), n.selfClosing ? " />" : ">"]);
2259
- let u = (p = n.attributes) == null ? void 0 : p.some((o) => te(o.value) && o.value.value.includes(`
2260
- `)), i = t.singleAttributePerLine && n.attributes.length > 1 ? F : x;
2261
- return l(["<", r("name"), n.typeArguments ? r("typeArguments") : r("typeParameters"), f(e.map(() => [i, r()], "attributes")), ...dc(n, t, s)], { shouldBreak: u });
2262
- }
2263
- function dc(e, t, r) {
2264
- return e.selfClosing ? [x, "/>"] : xc(e, t, r) ? [">"] : [E, ">"];
2265
- }
2266
- function xc(e, t, r) {
2267
- let n = e.attributes.length > 0 && d(_(false, e.attributes, -1), h.Trailing);
2268
- return e.attributes.length === 0 && !r || (t.bracketSameLine || t.jsxBracketSameLine) && (!r || e.attributes.length > 0) && !n;
2269
- }
2270
- function hc(e, t, r) {
2271
- let { node: n } = e, s = [];
2272
- s.push("</");
2273
- let u = r("name");
2274
- return d(n.name, h.Leading | h.Line) ? s.push(f([F, u]), F) : d(n.name, h.Leading | h.Block) ? s.push(" ", u) : s.push(u), s.push(">"), s;
2275
- }
2276
- function gc(e, t) {
2277
- let { node: r } = e, n = d(r), s = d(r, h.Line), u = r.type === "JSXOpeningFragment";
2278
- return [u ? "<" : "</", f([s ? F : n && !u ? " " : "", J(e, t)]), s ? F : "", ">"];
2279
- }
2280
- function Sc(e, t, r) {
2281
- let n = ye(e, Dc(e, t, r), t);
2282
- return Fc(e, n, t);
2283
- }
2284
- function Bc(e, t) {
2285
- let { node: r } = e, n = d(r, h.Line);
2286
- return [J(e, t, { indent: n }), n ? F : ""];
2287
- }
2288
- function bc(e, t, r) {
2289
- let { node: n } = e;
2290
- return ["{", e.call(({ node: s }) => {
2291
- let u = ["...", r()];
2292
- return !d(s) || !Kn(e) ? u : [f([E, ye(e, u, t)]), E];
2293
- }, n.type === "JSXSpreadAttribute" ? "argument" : "expression"), "}"];
2294
- }
2295
- function Fi(e, t, r) {
2296
- let { node: n } = e;
2297
- if (n.type.startsWith("JSX")) switch (n.type) {
2298
- case "JSXAttribute":
2299
- return Cc(e, t, r);
2300
- case "JSXIdentifier":
2301
- return n.name;
2302
- case "JSXNamespacedName":
2303
- return b(":", [r("namespace"), r("name")]);
2304
- case "JSXMemberExpression":
2305
- return b(".", [r("object"), r("property")]);
2306
- case "JSXSpreadAttribute":
2307
- case "JSXSpreadChild":
2308
- return bc(e, t, r);
2309
- case "JSXExpressionContainer":
2310
- return Ac(e, t, r);
2311
- case "JSXFragment":
2312
- case "JSXElement":
2313
- return Sc(e, t, r);
2314
- case "JSXOpeningElement":
2315
- return Tc(e, t, r);
2316
- case "JSXClosingElement":
2317
- return hc(e, t, r);
2318
- case "JSXOpeningFragment":
2319
- case "JSXClosingFragment":
2320
- return gc(e, t);
2321
- case "JSXEmptyExpression":
2322
- return Bc(e, t);
2323
- case "JSXText":
2324
- throw new Error("JSXText should be handled by JSXElement");
2325
- default:
2326
- throw new Me(n, "JSX");
2327
- }
2328
- }
2329
- function Pc(e) {
2330
- if (e.children.length === 0) return true;
2331
- if (e.children.length > 1) return false;
2332
- let t = e.children[0];
2333
- return t.type === "JSXText" && !cr(t);
2334
- }
2335
- function cr(e) {
2336
- return e.type === "JSXText" && (Yr.hasNonWhitespaceCharacter(fe(e)) || !/\n/u.test(fe(e)));
2337
- }
2338
- function kc(e) {
2339
- return e.type === "JSXExpressionContainer" && te(e.expression) && e.expression.value === " " && !d(e.expression);
2340
- }
2341
- function Ci(e) {
2342
- let { node: t, parent: r } = e;
2343
- if (!H(t) || !H(r)) return false;
2344
- let { index: n, siblings: s } = e, u;
2345
- for (let i = n; i > 0; i--) {
2346
- let a = s[i - 1];
2347
- if (!(a.type === "JSXText" && !cr(a))) {
2348
- u = a;
2349
- break;
2350
- }
2351
- }
2352
- return (u == null ? void 0 : u.type) === "JSXExpressionContainer" && u.expression.type === "JSXEmptyExpression" && kt(u.expression);
2353
- }
2354
- function Ic(e) {
2355
- return kt(e.node) || Ci(e);
2356
- }
2357
- var Hr = Ic;
2358
- var Lc = 0;
2359
- function Nr(e, t, r) {
2360
- var R;
2361
- let { node: n, parent: s, grandparent: u, key: i } = e, a = i !== "body" && (s.type === "IfStatement" || s.type === "WhileStatement" || s.type === "SwitchStatement" || s.type === "DoWhileStatement"), p = n.operator === "|>" && ((R = e.root.extra) == null ? void 0 : R.__isUsingHackPipeline), o = ys(e, r, t, false, a);
2362
- if (a) return o;
2363
- if (p) return l(o);
2364
- if (L(s) && s.callee === n || s.type === "UnaryExpression" || W(s) && !s.computed) return l([f([E, ...o]), E]);
2365
- let m = s.type === "ReturnStatement" || s.type === "ThrowStatement" || s.type === "JSXExpressionContainer" && u.type === "JSXAttribute" || n.operator !== "|" && s.type === "JsExpressionRoot" || n.type !== "NGPipeExpression" && (s.type === "NGRoot" && t.parser === "__ng_binding" || s.type === "NGMicrosyntaxExpression" && u.type === "NGMicrosyntax" && u.body.length === 1) || n === s.body && s.type === "ArrowFunctionExpression" || n !== s.body && s.type === "ForStatement" || s.type === "ConditionalExpression" && u.type !== "ReturnStatement" && u.type !== "ThrowStatement" && !L(u) || s.type === "TemplateLiteral", y = s.type === "AssignmentExpression" || s.type === "VariableDeclarator" || s.type === "ClassProperty" || s.type === "PropertyDefinition" || s.type === "TSAbstractPropertyDefinition" || s.type === "ClassPrivateProperty" || Ce(s), D = De(n.left) && sr(n.operator, n.left.operator);
2366
- if (m || Yt(n) && !D || !Yt(n) && y) return l(o);
2367
- if (o.length === 0) return "";
2368
- let C = H(n.right), c = o.findIndex((j) => typeof j != "string" && !Array.isArray(j) && j.type === le), A = o.slice(0, c === -1 ? 1 : c + 1), T = o.slice(A.length, C ? -1 : void 0), S = Symbol("logicalChain-" + ++Lc), g = l([...A, f(T)], { id: S });
2369
- if (!C) return g;
2370
- let M = _(false, o, -1);
2371
- return l([g, dt(M, { groupId: S })]);
2372
- }
2373
- function ys(e, t, r, n, s) {
2374
- var A;
2375
- let { node: u } = e;
2376
- if (!De(u)) return [l(t())];
2377
- let i = [];
2378
- sr(u.operator, u.left.operator) ? i = e.call((T) => ys(T, t, r, true, s), "left") : i.push(l(t("left")));
2379
- let a = Yt(u), p = (u.operator === "|>" || u.type === "NGPipeExpression" || wc(e, r)) && !Oe(r.originalText, u.right), o = u.type === "NGPipeExpression" ? "|" : u.operator, m = u.type === "NGPipeExpression" && u.arguments.length > 0 ? l(f([E, ": ", b([x, ": "], e.map(() => he(2, l(t())), "arguments"))])) : "", y;
2380
- if (a) y = [o, " ", t("right"), m];
2381
- else {
2382
- let S = o === "|>" && ((A = e.root.extra) == null ? void 0 : A.__isUsingHackPipeline) ? e.call((g) => ys(g, t, r, true, s), "right") : t("right");
2383
- y = [p ? x : "", o, p ? " " : x, S, m];
2384
- }
2385
- let { parent: D } = e, C = d(u.left, h.Trailing | h.Line), c = C || !(s && u.type === "LogicalExpression") && D.type !== u.type && u.left.type !== u.type && u.right.type !== u.type;
2386
- if (i.push(p ? "" : " ", c ? l(y, { shouldBreak: C }) : y), n && d(u)) {
2387
- let T = Gt(ye(e, i, r));
2388
- return T.type === Pe ? T.parts : Array.isArray(T) ? T : [T];
2389
- }
2390
- return i;
2391
- }
2392
- function Yt(e) {
2393
- return e.type !== "LogicalExpression" ? false : !!(se(e.right) && e.right.properties.length > 0 || X(e.right) && e.right.elements.length > 0 || H(e.right));
2394
- }
2395
- var Ai = (e) => e.type === "BinaryExpression" && e.operator === "|";
2396
- function wc(e, t) {
2397
- return (t.parser === "__vue_expression" || t.parser === "__vue_ts_expression") && Ai(e.node) && !e.hasAncestor((r) => !Ai(r) && r.type !== "JsExpressionRoot");
2398
- }
2399
- function di(e, t, r) {
2400
- let { node: n } = e;
2401
- if (n.type.startsWith("NG")) switch (n.type) {
2402
- case "NGRoot":
2403
- return [r("node"), d(n.node) ? " //" + ct(n.node)[0].value.trimEnd() : ""];
2404
- case "NGPipeExpression":
2405
- return Nr(e, t, r);
2406
- case "NGChainedExpression":
2407
- return l(b([";", x], e.map(() => _c(e) ? r() : ["(", r(), ")"], "expressions")));
2408
- case "NGEmptyExpression":
2409
- return "";
2410
- case "NGMicrosyntax":
2411
- return e.map(() => [e.isFirst ? "" : Ti(e) ? " " : [";", x], r()], "body");
2412
- case "NGMicrosyntaxKey":
2413
- return /^[$_a-z][\w$]*(?:-[$_a-z][\w$])*$/iu.test(n.name) ? n.name : JSON.stringify(n.name);
2414
- case "NGMicrosyntaxExpression":
2415
- return [r("expression"), n.alias === null ? "" : [" as ", r("alias")]];
2416
- case "NGMicrosyntaxKeyedExpression": {
2417
- let { index: s, parent: u } = e, i = Ti(e) || (s === 1 && (n.key.name === "then" || n.key.name === "else" || n.key.name === "as") || (s === 2 || s === 3) && (n.key.name === "else" && u.body[s - 1].type === "NGMicrosyntaxKeyedExpression" && u.body[s - 1].key.name === "then" || n.key.name === "track")) && u.body[0].type === "NGMicrosyntaxExpression";
2418
- return [r("key"), i ? " " : ": ", r("expression")];
2419
- }
2420
- case "NGMicrosyntaxLet":
2421
- return ["let ", r("key"), n.value === null ? "" : [" = ", r("value")]];
2422
- case "NGMicrosyntaxAs":
2423
- return [r("key"), " as ", r("alias")];
2424
- default:
2425
- throw new Me(n, "Angular");
2426
- }
2427
- }
2428
- function Ti({ node: e, index: t }) {
2429
- return e.type === "NGMicrosyntaxKeyedExpression" && e.key.name === "of" && t === 1;
2430
- }
2431
- var Oc = v(["CallExpression", "OptionalCallExpression", "AssignmentExpression"]);
2432
- function _c({ node: e }) {
2433
- return rr(e, Oc);
2434
- }
2435
- function Ds(e, t, r) {
2436
- let { node: n } = e;
2437
- return l([b(x, e.map(r, "decorators")), gi(n, t) ? F : x]);
2438
- }
2439
- function xi(e, t, r) {
2440
- return Si(e.node) ? [b(F, e.map(r, "declaration", "decorators")), F] : "";
2441
- }
2442
- function hi(e, t, r) {
2443
- let { node: n, parent: s } = e, { decorators: u } = n;
2444
- if (!O(u) || Si(s) || Hr(e)) return "";
2445
- let i = n.type === "ClassExpression" || n.type === "ClassDeclaration" || gi(n, t);
2446
- return [e.key === "declaration" && au(s) ? F : i ? Ee : "", b(x, e.map(r, "decorators")), x];
2447
- }
2448
- function gi(e, t) {
2449
- return e.decorators.some((r) => Z(t.originalText, k(r)));
2450
- }
2451
- function Si(e) {
2452
- var r;
2453
- if (e.type !== "ExportDefaultDeclaration" && e.type !== "ExportNamedDeclaration" && e.type !== "DeclareExportDeclaration") return false;
2454
- let t = (r = e.declaration) == null ? void 0 : r.decorators;
2455
- return O(t) && Bt(e, t[0]);
2456
- }
2457
- var yt = class extends Error {
2458
- name = "ArgExpansionBailout";
2459
- };
2460
- function jc(e, t, r) {
2461
- let { node: n } = e, s = oe(n);
2462
- if (s.length === 0) return ["(", J(e, t), ")"];
2463
- let u = s.length - 1;
2464
- if (Rc(s)) {
2465
- let y = ["("];
2466
- return qt(e, (D, C) => {
2467
- y.push(r()), C !== u && y.push(", ");
2468
- }), y.push(")"), y;
2469
- }
2470
- let i = false, a = [];
2471
- qt(e, ({ node: y }, D) => {
2472
- let C = r();
2473
- D === u || (pe(y, t) ? (i = true, C = [C, ",", F, F]) : C = [C, ",", x]), a.push(C);
2474
- });
2475
- let p = !t.parser.startsWith("__ng_") && n.type !== "ImportExpression" && ae(t, "all") ? "," : "";
2476
- function o() {
2477
- return l(["(", f([x, ...a]), p, x, ")"], { shouldBreak: true });
2478
- }
2479
- if (i || e.parent.type !== "Decorator" && mu(s)) return o();
2480
- if (Mc(s)) {
2481
- let y = a.slice(1);
2482
- if (y.some(re)) return o();
2483
- let D;
2484
- try {
2485
- D = r(Rn(n, 0), { expandFirstArg: true });
2486
- } catch (C) {
2487
- if (C instanceof yt) return o();
2488
- throw C;
2489
- }
2490
- return re(D) ? [Ee, Ke([["(", l(D, { shouldBreak: true }), ", ", ...y, ")"], o()])] : Ke([["(", D, ", ", ...y, ")"], ["(", l(D, { shouldBreak: true }), ", ", ...y, ")"], o()]);
2491
- }
2492
- if (vc(s, a, t)) {
2493
- let y = a.slice(0, -1);
2494
- if (y.some(re)) return o();
2495
- let D;
2496
- try {
2497
- D = r(Rn(n, -1), { expandLastArg: true });
2498
- } catch (C) {
2499
- if (C instanceof yt) return o();
2500
- throw C;
2501
- }
2502
- return re(D) ? [Ee, Ke([["(", ...y, l(D, { shouldBreak: true }), ")"], o()])] : Ke([["(", ...y, D, ")"], ["(", ...y, l(D, { shouldBreak: true }), ")"], o()]);
2503
- }
2504
- let m = ["(", f([E, ...a]), B(p), E, ")"];
2505
- return Or(e) ? m : l(m, { shouldBreak: a.some(re) || i });
2506
- }
2507
- function lr(e, t = false) {
2508
- return se(e) && (e.properties.length > 0 || d(e)) || X(e) && (e.elements.length > 0 || d(e)) || e.type === "TSTypeAssertion" && lr(e.expression) || Ae(e) && lr(e.expression) || e.type === "FunctionExpression" || e.type === "ArrowFunctionExpression" && (!e.returnType || !e.returnType.typeAnnotation || e.returnType.typeAnnotation.type !== "TSTypeReference" || Jc(e.body)) && (e.body.type === "BlockStatement" || e.body.type === "ArrowFunctionExpression" && lr(e.body, true) || se(e.body) || X(e.body) || !t && (L(e.body) || e.body.type === "ConditionalExpression") || H(e.body)) || e.type === "DoExpression" || e.type === "ModuleExpression";
2509
- }
2510
- function vc(e, t, r) {
2511
- var u, i;
2512
- let n = _(false, e, -1);
2513
- if (e.length === 1) {
2514
- let a = _(false, t, -1);
2515
- if ((u = a.label) != null && u.embed && ((i = a.label) == null ? void 0 : i.hug) !== false) return true;
2516
- }
2517
- let s = _(false, e, -2);
2518
- return !d(n, h.Leading) && !d(n, h.Trailing) && lr(n) && (!s || s.type !== n.type) && (e.length !== 2 || s.type !== "ArrowFunctionExpression" || !X(n)) && !(e.length > 1 && fs(n, r));
2519
- }
2520
- function Mc(e) {
2521
- if (e.length !== 2) return false;
2522
- let [t, r] = e;
2523
- return t.type === "ModuleExpression" && qc(r) ? true : !d(t) && (t.type === "FunctionExpression" || t.type === "ArrowFunctionExpression" && t.body.type === "BlockStatement") && r.type !== "FunctionExpression" && r.type !== "ArrowFunctionExpression" && r.type !== "ConditionalExpression" && bi(r) && !lr(r);
2524
- }
2525
- function bi(e) {
2526
- if (e.type === "ParenthesizedExpression") return bi(e.expression);
2527
- if (Ae(e) || e.type === "TypeCastExpression") {
2528
- let { typeAnnotation: t } = e;
2529
- if (t.type === "TypeAnnotation" && (t = t.typeAnnotation), t.type === "TSArrayType" && (t = t.elementType, t.type === "TSArrayType" && (t = t.elementType)), t.type === "GenericTypeAnnotation" || t.type === "TSTypeReference") {
2530
- let r = t.typeArguments ?? t.typeParameters;
2531
- (r == null ? void 0 : r.params.length) === 1 && (t = r.params[0]);
2532
- }
2533
- return Jt(t) && be(e.expression, 1);
2534
- }
2535
- return lt(e) && oe(e).length > 1 ? false : De(e) ? be(e.left, 1) && be(e.right, 1) : vn(e) || be(e);
2536
- }
2537
- function Rc(e) {
2538
- return e.length === 2 ? Bi(e, 0) : e.length === 3 ? e[0].type === "Identifier" && Bi(e, 1) : false;
2539
- }
2540
- function Bi(e, t) {
2541
- let r = e[t], n = e[t + 1];
2542
- return r.type === "ArrowFunctionExpression" && z(r).length === 0 && r.body.type === "BlockStatement" && n.type === "ArrayExpression" && !e.some((s) => d(s));
2543
- }
2544
- function Jc(e) {
2545
- return e.type === "BlockStatement" && (e.body.some((t) => t.type !== "EmptyStatement") || d(e, h.Dangling));
2546
- }
2547
- function qc(e) {
2548
- return e.type === "ObjectExpression" && e.properties.length === 1 && Ce(e.properties[0]) && e.properties[0].key.type === "Identifier" && e.properties[0].key.name === "type" && te(e.properties[0].value) && e.properties[0].value.value === "module";
2549
- }
2550
- var mr = jc;
2551
- var Wc = (e) => ((e.type === "ChainExpression" || e.type === "TSNonNullExpression") && (e = e.expression), L(e) && oe(e).length > 0);
2552
- function Pi(e, t, r) {
2553
- var o;
2554
- let n = r("object"), s = Es(e, t, r), { node: u } = e, i = e.findAncestor((m) => !(W(m) || m.type === "TSNonNullExpression")), a = e.findAncestor((m) => !(m.type === "ChainExpression" || m.type === "TSNonNullExpression")), p = i && (i.type === "NewExpression" || i.type === "BindExpression" || i.type === "AssignmentExpression" && i.left.type !== "Identifier") || u.computed || u.object.type === "Identifier" && u.property.type === "Identifier" && !W(a) || (a.type === "AssignmentExpression" || a.type === "VariableDeclarator") && (Wc(u.object) || ((o = n.label) == null ? void 0 : o.memberChain));
2555
- return st(n.label, [n, p ? s : l(f([E, s]))]);
2556
- }
2557
- function Es(e, t, r) {
2558
- let n = r("property"), { node: s } = e, u = $(e);
2559
- return s.computed ? !s.property || Fe(s.property) ? [u, "[", n, "]"] : l([u, "[", f([E, n]), E, "]"]) : [u, ".", n];
2560
- }
2561
- function ki(e, t, r) {
2562
- if (e.node.type === "ChainExpression") return e.call(() => ki(e, t, r), "expression");
2563
- let { parent: n } = e, s = !n || n.type === "ExpressionStatement", u = [];
2564
- function i(w) {
2565
- let { originalText: ne } = t, de = ut(ne, k(w));
2566
- return ne.charAt(de) === ")" ? de !== false && jt(ne, de + 1) : pe(w, t);
2567
- }
2568
- function a() {
2569
- let { node: w } = e;
2570
- if (w.type === "ChainExpression") return e.call(a, "expression");
2571
- if (L(w) && (At(w.callee) || L(w.callee))) {
2572
- let ne = i(w);
2573
- u.unshift({ node: w, hasTrailingEmptyLine: ne, printed: [ye(e, [$(e), Qe(e, t, r), mr(e, t, r)], t), ne ? F : ""] }), e.call(a, "callee");
2574
- } else At(w) ? (u.unshift({ node: w, needsParens: Be(e, t), printed: ye(e, W(w) ? Es(e, t, r) : Vr(e, t, r), t) }), e.call(a, "object")) : w.type === "TSNonNullExpression" ? (u.unshift({ node: w, printed: ye(e, "!", t) }), e.call(a, "expression")) : u.unshift({ node: w, printed: r() });
2575
- }
2576
- let { node: p } = e;
2577
- u.unshift({ node: p, printed: [$(e), Qe(e, t, r), mr(e, t, r)] }), p.callee && e.call(a, "callee");
2578
- let o = [], m = [u[0]], y = 1;
2579
- for (; y < u.length && (u[y].node.type === "TSNonNullExpression" || L(u[y].node) || W(u[y].node) && u[y].node.computed && Fe(u[y].node.property)); ++y) m.push(u[y]);
2580
- if (!L(u[0].node)) for (; y + 1 < u.length && (At(u[y].node) && At(u[y + 1].node)); ++y) m.push(u[y]);
2581
- o.push(m), m = [];
2582
- let D = false;
2583
- for (; y < u.length; ++y) {
2584
- if (D && At(u[y].node)) {
2585
- if (u[y].node.computed && Fe(u[y].node.property)) {
2586
- m.push(u[y]);
2587
- continue;
2588
- }
2589
- o.push(m), m = [], D = false;
2590
- }
2591
- (L(u[y].node) || u[y].node.type === "ImportExpression") && (D = true), m.push(u[y]), d(u[y].node, h.Trailing) && (o.push(m), m = [], D = false);
2592
- }
2593
- m.length > 0 && o.push(m);
2594
- function C(w) {
2595
- return /^[A-Z]|^[$_]+$/u.test(w);
2596
- }
2597
- function c(w) {
2598
- return w.length <= t.tabWidth;
2599
- }
2600
- function A(w) {
2601
- var ot;
2602
- let ne = (ot = w[1][0]) == null ? void 0 : ot.node.computed;
2603
- if (w[0].length === 1) {
2604
- let St = w[0][0].node;
2605
- return St.type === "ThisExpression" || St.type === "Identifier" && (C(St.name) || s && c(St.name) || ne);
2606
- }
2607
- let de = _(false, w[0], -1).node;
2608
- return W(de) && de.property.type === "Identifier" && (C(de.property.name) || ne);
2609
- }
2610
- let T = o.length >= 2 && !d(o[1][0].node) && A(o);
2611
- function S(w) {
2612
- let ne = w.map((de) => de.printed);
2613
- return w.length > 0 && _(false, w, -1).needsParens ? ["(", ...ne, ")"] : ne;
2614
- }
2615
- function g(w) {
2616
- return w.length === 0 ? "" : f([F, b(F, w.map(S))]);
2617
- }
2618
- let M = o.map(S), R = M, j = T ? 3 : 2, I = o.flat(), U = I.slice(1, -1).some((w) => d(w.node, h.Leading)) || I.slice(0, -1).some((w) => d(w.node, h.Trailing)) || o[j] && d(o[j][0].node, h.Leading);
2619
- if (o.length <= j && !U && !o.some((w) => _(false, w, -1).hasTrailingEmptyLine)) return Or(e) ? R : l(R);
2620
- let P = _(false, o[T ? 1 : 0], -1).node, G = !L(P) && i(P), ue = [S(o[0]), T ? o.slice(1, 2).map(S) : "", G ? F : "", g(o.slice(T ? 2 : 1))], Q = u.map(({ node: w }) => w).filter(L);
2621
- function gt() {
2622
- let w = _(false, _(false, o, -1), -1).node, ne = _(false, M, -1);
2623
- return L(w) && re(ne) && Q.slice(0, -1).some((de) => de.arguments.some(Mt));
2624
- }
2625
- let Ft;
2626
- return U || Q.length > 2 && Q.some((w) => !w.arguments.every((ne) => be(ne))) || M.slice(0, -1).some(re) || gt() ? Ft = l(ue) : Ft = [re(R) || G ? Ee : "", Ke([R, ue])], st({ memberChain: true }, Ft);
2627
- }
2628
- var Ii = ki;
2629
- function $r(e, t, r) {
2630
- var m;
2631
- let { node: n } = e, s = n.type === "NewExpression", u = n.type === "ImportExpression", i = $(e), a = oe(n), p = a.length === 1 && Lr(a[0], t.originalText);
2632
- if (p || Gc(e) || Pt(n, e.parent)) {
2633
- let y = [];
2634
- if (qt(e, () => {
2635
- y.push(r());
2636
- }), !(p && ((m = y[0].label) != null && m.embed))) return [s ? "new " : "", Li(e, r), i, Qe(e, t, r), "(", b(", ", y), ")"];
2637
- }
2638
- if (!u && !s && At(n.callee) && !e.call((y) => Be(y, t), "callee", ...n.callee.type === "ChainExpression" ? ["expression"] : [])) return Ii(e, t, r);
2639
- let o = [s ? "new " : "", Li(e, r), i, Qe(e, t, r), mr(e, t, r)];
2640
- return u || L(n.callee) ? l(o) : o;
2641
- }
2642
- function Li(e, t) {
2643
- let { node: r } = e;
2644
- return r.type === "ImportExpression" ? `import${r.phase ? `.${r.phase}` : ""}` : t("callee");
2645
- }
2646
- function Gc(e) {
2647
- let { node: t } = e;
2648
- if (t.type !== "CallExpression" || t.optional || t.callee.type !== "Identifier") return false;
2649
- let r = oe(t);
2650
- return t.callee.name === "require" ? r.length === 1 && te(r[0]) || r.length > 1 : t.callee.name === "define" && e.parent.type === "ExpressionStatement" ? r.length === 1 || r.length === 2 && r[0].type === "ArrayExpression" || r.length === 3 && te(r[0]) && r[1].type === "ArrayExpression" : false;
2651
- }
2652
- function xt(e, t, r, n, s, u) {
2653
- let i = Uc(e, t, r, n, u), a = u ? r(u, { assignmentLayout: i }) : "";
2654
- switch (i) {
2655
- case "break-after-operator":
2656
- return l([l(n), s, l(f([x, a]))]);
2657
- case "never-break-after-operator":
2658
- return l([l(n), s, " ", a]);
2659
- case "fluid": {
2660
- let p = Symbol("assignment");
2661
- return l([l(n), s, l(f(x), { id: p }), ke, dt(a, { groupId: p })]);
2662
- }
2663
- case "break-lhs":
2664
- return l([n, s, " ", l(a)]);
2665
- case "chain":
2666
- return [l(n), s, x, a];
2667
- case "chain-tail":
2668
- return [l(n), s, f([x, a])];
2669
- case "chain-tail-arrow-chain":
2670
- return [l(n), s, a];
2671
- case "only-left":
2672
- return n;
2673
- }
2674
- }
2675
- function Oi(e, t, r) {
2676
- let { node: n } = e;
2677
- return xt(e, t, r, r("left"), [" ", n.operator], "right");
2678
- }
2679
- function _i(e, t, r) {
2680
- return xt(e, t, r, r("id"), " =", "init");
2681
- }
2682
- function Uc(e, t, r, n, s) {
2683
- let { node: u } = e, i = u[s];
2684
- if (!i) return "only-left";
2685
- let a = !Kr(i);
2686
- if (e.match(Kr, ji, (D) => !a || D.type !== "ExpressionStatement" && D.type !== "VariableDeclaration")) return a ? i.type === "ArrowFunctionExpression" && i.body.type === "ArrowFunctionExpression" ? "chain-tail-arrow-chain" : "chain-tail" : "chain";
2687
- if (!a && Kr(i.right) || Oe(t.originalText, i)) return "break-after-operator";
2688
- if (u.type === "ImportAttribute" || i.type === "CallExpression" && i.callee.name === "require" || t.parser === "json5" || t.parser === "jsonc" || t.parser === "json") return "never-break-after-operator";
2689
- let m = bu(n);
2690
- if (Yc(u) || $c(u) || Fs(u) && m) return "break-lhs";
2691
- let y = Qc(u, n, t);
2692
- return e.call(() => Xc(e, t, r, y), s) ? "break-after-operator" : Hc(u) ? "break-lhs" : !m && (y || i.type === "TemplateLiteral" || i.type === "TaggedTemplateExpression" || i.type === "BooleanLiteral" || Fe(i) || i.type === "ClassExpression") ? "never-break-after-operator" : "fluid";
2693
- }
2694
- function Xc(e, t, r, n) {
2695
- let s = e.node;
2696
- if (De(s) && !Yt(s)) return true;
2697
- switch (s.type) {
2698
- case "StringLiteralTypeAnnotation":
2699
- case "SequenceExpression":
2700
- return true;
2701
- case "TSConditionalType":
2702
- case "ConditionalTypeAnnotation":
2703
- if (!t.experimentalTernaries && !el(s)) break;
2704
- return true;
2705
- case "ConditionalExpression": {
2706
- if (!t.experimentalTernaries) {
2707
- let { test: o } = s;
2708
- return De(o) && !Yt(o);
2709
- }
2710
- let { consequent: a, alternate: p } = s;
2711
- return a.type === "ConditionalExpression" || p.type === "ConditionalExpression";
2712
- }
2713
- case "ClassExpression":
2714
- return O(s.decorators);
2715
- }
2716
- if (n) return false;
2717
- let u = s, i = [];
2718
- for (; ; ) if (u.type === "UnaryExpression" || u.type === "AwaitExpression" || u.type === "YieldExpression" && u.argument !== null) u = u.argument, i.push("argument");
2719
- else if (u.type === "TSNonNullExpression") u = u.expression, i.push("expression");
2720
- else break;
2721
- return !!(te(u) || e.call(() => vi(e, t, r), ...i));
2722
- }
2723
- function Yc(e) {
2724
- if (ji(e)) {
2725
- let t = e.left || e.id;
2726
- return t.type === "ObjectPattern" && t.properties.length > 2 && t.properties.some((r) => {
2727
- var n;
2728
- return Ce(r) && (!r.shorthand || ((n = r.value) == null ? void 0 : n.type) === "AssignmentPattern");
2729
- });
2730
- }
2731
- return false;
2732
- }
2733
- function Kr(e) {
2734
- return e.type === "AssignmentExpression";
2735
- }
2736
- function ji(e) {
2737
- return Kr(e) || e.type === "VariableDeclarator";
2738
- }
2739
- function Hc(e) {
2740
- let t = Vc(e);
2741
- if (O(t)) {
2742
- let r = e.type === "TSTypeAliasDeclaration" ? "constraint" : "bound";
2743
- if (t.length > 1 && t.some((n) => n[r] || n.default)) return true;
2744
- }
2745
- return false;
2746
- }
2747
- var Nc = v(["TSTypeAliasDeclaration", "TypeAlias"]);
2748
- function Vc(e) {
2749
- var t;
2750
- if (Nc(e)) return (t = e.typeParameters) == null ? void 0 : t.params;
2751
- }
2752
- function $c(e) {
2753
- if (e.type !== "VariableDeclarator") return false;
2754
- let { typeAnnotation: t } = e.id;
2755
- if (!t || !t.typeAnnotation) return false;
2756
- let r = wi(t.typeAnnotation);
2757
- return O(r) && r.length > 1 && r.some((n) => O(wi(n)) || n.type === "TSConditionalType");
2758
- }
2759
- function Fs(e) {
2760
- var t;
2761
- return e.type === "VariableDeclarator" && ((t = e.init) == null ? void 0 : t.type) === "ArrowFunctionExpression";
2762
- }
2763
- var Kc = v(["TSTypeReference", "GenericTypeAnnotation"]);
2764
- function wi(e) {
2765
- var t;
2766
- if (Kc(e)) return (t = e.typeArguments ?? e.typeParameters) == null ? void 0 : t.params;
2767
- }
2768
- function vi(e, t, r, n = false) {
2769
- var i;
2770
- let { node: s } = e, u = () => vi(e, t, r, true);
2771
- if (s.type === "ChainExpression" || s.type === "TSNonNullExpression") return e.call(u, "expression");
2772
- if (L(s)) {
2773
- if ((i = $r(e, t, r).label) != null && i.memberChain) return false;
2774
- let p = oe(s);
2775
- return !(p.length === 0 || p.length === 1 && nr(p[0], t)) || zc(s, r) ? false : e.call(u, "callee");
2776
- }
2777
- return W(s) ? e.call(u, "object") : n && (s.type === "Identifier" || s.type === "ThisExpression");
2778
- }
2779
- function Qc(e, t, r) {
2780
- return Ce(e) ? (t = Gt(t), typeof t == "string" && ze(t) < r.tabWidth + 3) : false;
2781
- }
2782
- function zc(e, t) {
2783
- let r = Zc(e);
2784
- if (O(r)) {
2785
- if (r.length > 1) return true;
2786
- if (r.length === 1) {
2787
- let s = r[0];
2788
- if (Ue(s) || _r(s) || s.type === "TSTypeLiteral" || s.type === "ObjectTypeAnnotation") return true;
2789
- }
2790
- let n = e.typeParameters ? "typeParameters" : "typeArguments";
2791
- if (re(t(n))) return true;
2792
- }
2793
- return false;
2794
- }
2795
- function Zc(e) {
2796
- var t;
2797
- return (t = e.typeParameters ?? e.typeArguments) == null ? void 0 : t.params;
2798
- }
2799
- function el(e) {
2800
- function t(r) {
2801
- switch (r.type) {
2802
- case "FunctionTypeAnnotation":
2803
- case "GenericTypeAnnotation":
2804
- case "TSFunctionType":
2805
- return !!r.typeParameters;
2806
- case "TSTypeReference":
2807
- return !!(r.typeArguments ?? r.typeParameters);
2808
- default:
2809
- return false;
2810
- }
2811
- }
2812
- return t(e.checkType) || t(e.extendsType);
2813
- }
2814
- function Je(e, t, r, n, s) {
2815
- let u = e.node, i = z(u), a = s ? Qe(e, r, t) : "";
2816
- if (i.length === 0) return [a, "(", J(e, r, { filter: (c) => ge(r.originalText, k(c)) === ")" }), ")"];
2817
- let { parent: p } = e, o = Pt(p), m = Cs(u), y = [];
2818
- if (Eu(e, (c, A) => {
2819
- let T = A === i.length - 1;
2820
- T && u.rest && y.push("..."), y.push(t()), !T && (y.push(","), o || m ? y.push(" ") : pe(i[A], r) ? y.push(F, F) : y.push(x));
2821
- }), n && !rl(e)) {
2822
- if (re(a) || re(y)) throw new yt();
2823
- return l([ar(a), "(", ar(y), ")"]);
2824
- }
2825
- let D = i.every((c) => !O(c.decorators));
2826
- return m && D ? [a, "(", ...y, ")"] : o ? [a, "(", ...y, ")"] : (Ir(p) || pu(p) || p.type === "TypeAlias" || p.type === "UnionTypeAnnotation" || p.type === "IntersectionTypeAnnotation" || p.type === "FunctionTypeAnnotation" && p.returnType === u) && i.length === 1 && i[0].name === null && u.this !== i[0] && i[0].typeAnnotation && u.typeParameters === null && Jt(i[0].typeAnnotation) && !u.rest ? r.arrowParens === "always" || u.type === "HookTypeAnnotation" ? ["(", ...y, ")"] : y : [a, "(", f([E, ...y]), B(!fu(u) && ae(r, "all") ? "," : ""), E, ")"];
2827
- }
2828
- function Cs(e) {
2829
- if (!e) return false;
2830
- let t = z(e);
2831
- if (t.length !== 1) return false;
2832
- let [r] = t;
2833
- return !d(r) && (r.type === "ObjectPattern" || r.type === "ArrayPattern" || r.type === "Identifier" && r.typeAnnotation && (r.typeAnnotation.type === "TypeAnnotation" || r.typeAnnotation.type === "TSTypeAnnotation") && we(r.typeAnnotation.typeAnnotation) || r.type === "FunctionTypeParam" && we(r.typeAnnotation) && r !== e.rest || r.type === "AssignmentPattern" && (r.left.type === "ObjectPattern" || r.left.type === "ArrayPattern") && (r.right.type === "Identifier" || se(r.right) && r.right.properties.length === 0 || X(r.right) && r.right.elements.length === 0));
2834
- }
2835
- function tl(e) {
2836
- let t;
2837
- return e.returnType ? (t = e.returnType, t.typeAnnotation && (t = t.typeAnnotation)) : e.typeAnnotation && (t = e.typeAnnotation), t;
2838
- }
2839
- function at(e, t) {
2840
- var s;
2841
- let r = tl(e);
2842
- if (!r) return false;
2843
- let n = (s = e.typeParameters) == null ? void 0 : s.params;
2844
- if (n) {
2845
- if (n.length > 1) return false;
2846
- if (n.length === 1) {
2847
- let u = n[0];
2848
- if (u.constraint || u.default) return false;
2849
- }
2850
- }
2851
- return z(e).length === 1 && (we(r) || re(t));
2852
- }
2853
- function rl(e) {
2854
- return e.match((t) => t.type === "ArrowFunctionExpression" && t.body.type === "BlockStatement", (t, r) => {
2855
- if (t.type === "CallExpression" && r === "arguments" && t.arguments.length === 1 && t.callee.type === "CallExpression") {
2856
- let n = t.callee.callee;
2857
- return n.type === "Identifier" || n.type === "MemberExpression" && !n.computed && n.object.type === "Identifier" && n.property.type === "Identifier";
2858
- }
2859
- return false;
2860
- }, (t, r) => t.type === "VariableDeclarator" && r === "init" || t.type === "ExportDefaultDeclaration" && r === "declaration" || t.type === "TSExportAssignment" && r === "expression" || t.type === "AssignmentExpression" && r === "right" && t.left.type === "MemberExpression" && t.left.object.type === "Identifier" && t.left.object.name === "module" && t.left.property.type === "Identifier" && t.left.property.name === "exports", (t) => t.type !== "VariableDeclaration" || t.kind === "const" && t.declarations.length === 1);
2861
- }
2862
- function Mi(e) {
2863
- let t = z(e);
2864
- return t.length > 1 && t.some((r) => r.type === "TSParameterProperty");
2865
- }
2866
- var nl = v(["VoidTypeAnnotation", "TSVoidKeyword", "NullLiteralTypeAnnotation", "TSNullKeyword"]);
2867
- var sl = v(["ObjectTypeAnnotation", "TSTypeLiteral", "GenericTypeAnnotation", "TSTypeReference"]);
2868
- function ul(e) {
2869
- let { types: t } = e;
2870
- if (t.some((n) => d(n))) return false;
2871
- let r = t.find((n) => sl(n));
2872
- return r ? t.every((n) => n === r || nl(n)) : false;
2873
- }
2874
- function As(e) {
2875
- return Jt(e) || we(e) ? true : Ue(e) ? ul(e) : false;
2876
- }
2877
- function Ri(e, t, r) {
2878
- let n = t.semi ? ";" : "", { node: s } = e, u = [K(e), "opaque type ", r("id"), r("typeParameters")];
2879
- return s.supertype && u.push(": ", r("supertype")), s.impltype && u.push(" = ", r("impltype")), u.push(n), u;
2880
- }
2881
- function Qr(e, t, r) {
2882
- let n = t.semi ? ";" : "", { node: s } = e, u = [K(e)];
2883
- u.push("type ", r("id"), r("typeParameters"));
2884
- let i = s.type === "TSTypeAliasDeclaration" ? "typeAnnotation" : "right";
2885
- return [xt(e, t, r, u, " =", i), n];
2886
- }
2887
- function zr(e, t, r) {
2888
- let n = false;
2889
- return l(e.map(({ isFirst: s, previous: u, node: i, index: a }) => {
2890
- let p = r();
2891
- if (s) return p;
2892
- let o = we(i), m = we(u);
2893
- return m && o ? [" & ", n ? f(p) : p] : !m && !o ? f([" &", x, p]) : (a > 1 && (n = true), [" & ", a > 1 ? f(p) : p]);
2894
- }, "types"));
2895
- }
2896
- function Zr(e, t, r) {
2897
- let { node: n } = e, { parent: s } = e, u = s.type !== "TypeParameterInstantiation" && (s.type !== "TSConditionalType" || !t.experimentalTernaries) && (s.type !== "ConditionalTypeAnnotation" || !t.experimentalTernaries) && s.type !== "TSTypeParameterInstantiation" && s.type !== "GenericTypeAnnotation" && s.type !== "TSTypeReference" && s.type !== "TSTypeAssertion" && s.type !== "TupleTypeAnnotation" && s.type !== "TSTupleType" && !(s.type === "FunctionTypeParam" && !s.name && e.grandparent.this !== s) && !((s.type === "TypeAlias" || s.type === "VariableDeclarator" || s.type === "TSTypeAliasDeclaration") && Oe(t.originalText, n)), i = As(n), a = e.map((m) => {
2898
- let y = r();
2899
- return i || (y = he(2, y)), ye(m, y, t);
2900
- }, "types");
2901
- if (i) return b(" | ", a);
2902
- let p = u && !Oe(t.originalText, n), o = [B([p ? x : "", "| "]), b([x, "| "], a)];
2903
- return Be(e, t) ? l([f(o), E]) : (s.type === "TupleTypeAnnotation" || s.type === "TSTupleType") && s[s.type === "TupleTypeAnnotation" && s.types ? "types" : "elementTypes"].length > 1 ? l([f([B(["(", E]), o]), E, B(")")]) : l(u ? f(o) : o);
2904
- }
2905
- function il(e) {
2906
- var n;
2907
- let { node: t, parent: r } = e;
2908
- return t.type === "FunctionTypeAnnotation" && (Ir(r) || !((r.type === "ObjectTypeProperty" || r.type === "ObjectTypeInternalSlot") && !r.variance && !r.optional && Bt(r, t) || r.type === "ObjectTypeCallProperty" || ((n = e.getParentNode(2)) == null ? void 0 : n.type) === "DeclareFunction"));
2909
- }
2910
- function en(e, t, r) {
2911
- let { node: n } = e, s = [Ht(e)];
2912
- (n.type === "TSConstructorType" || n.type === "TSConstructSignatureDeclaration") && s.push("new ");
2913
- let u = Je(e, r, t, false, true), i = [];
2914
- return n.type === "FunctionTypeAnnotation" ? i.push(il(e) ? " => " : ": ", r("returnType")) : i.push(N(e, r, n.returnType ? "returnType" : "typeAnnotation")), at(n, i) && (u = l(u)), s.push(u, i), l(s);
2915
- }
2916
- function tn(e, t, r) {
2917
- return [r("objectType"), $(e), "[", r("indexType"), "]"];
2918
- }
2919
- function rn(e, t, r) {
2920
- return ["infer ", r("typeParameter")];
2921
- }
2922
- function Ts(e, t, r) {
2923
- let { node: n } = e;
2924
- return [n.postfix ? "" : r, N(e, t), n.postfix ? r : ""];
2925
- }
2926
- function nn(e, t, r) {
2927
- let { node: n } = e;
2928
- return ["...", ...n.type === "TupleTypeSpreadElement" && n.label ? [r("label"), ": "] : [], r("typeAnnotation")];
2929
- }
2930
- function sn(e, t, r) {
2931
- let { node: n } = e;
2932
- return [n.variance ? r("variance") : "", r("label"), n.optional ? "?" : "", ": ", r("elementType")];
2933
- }
2934
- var al = /* @__PURE__ */ new WeakSet();
2935
- function N(e, t, r = "typeAnnotation") {
2936
- let { node: { [r]: n } } = e;
2937
- if (!n) return "";
2938
- let s = false;
2939
- if (n.type === "TSTypeAnnotation" || n.type === "TypeAnnotation") {
2940
- let u = e.call(Ji, r);
2941
- (u === "=>" || u === ":" && d(n, h.Leading)) && (s = true), al.add(n);
2942
- }
2943
- return s ? [" ", t(r)] : t(r);
2944
- }
2945
- var Ji = (e) => e.match((t) => t.type === "TSTypeAnnotation", (t, r) => (r === "returnType" || r === "typeAnnotation") && (t.type === "TSFunctionType" || t.type === "TSConstructorType")) ? "=>" : e.match((t) => t.type === "TSTypeAnnotation", (t, r) => r === "typeAnnotation" && (t.type === "TSJSDocNullableType" || t.type === "TSJSDocNonNullableType" || t.type === "TSTypePredicate")) || e.match((t) => t.type === "TypeAnnotation", (t, r) => r === "typeAnnotation" && t.type === "Identifier", (t, r) => r === "id" && t.type === "DeclareFunction") || e.match((t) => t.type === "TypeAnnotation", (t, r) => r === "typeAnnotation" && t.type === "Identifier", (t, r) => r === "id" && t.type === "DeclareHook") || e.match((t) => t.type === "TypeAnnotation", (t, r) => r === "bound" && t.type === "TypeParameter" && t.usesExtendsBound) ? "" : ":";
2946
- function un(e, t, r) {
2947
- let n = Ji(e);
2948
- return n ? [n, " ", r("typeAnnotation")] : r("typeAnnotation");
2949
- }
2950
- function an(e) {
2951
- return [e("elementType"), "[]"];
2952
- }
2953
- function on({ node: e }, t) {
2954
- let r = e.type === "TSTypeQuery" ? "exprName" : "argument", n = e.type === "TypeofTypeAnnotation" || e.typeArguments ? "typeArguments" : "typeParameters";
2955
- return ["typeof ", t(r), t(n)];
2956
- }
2957
- function pn(e, t) {
2958
- let { node: r } = e;
2959
- return [r.type === "TSTypePredicate" && r.asserts ? "asserts " : r.type === "TypePredicate" && r.kind ? `${r.kind} ` : "", t("parameterName"), r.typeAnnotation ? [" is ", N(e, t)] : ""];
2960
- }
2961
- function $(e) {
2962
- let { node: t } = e;
2963
- return !t.optional || t.type === "Identifier" && t === e.parent.key ? "" : L(t) || W(t) && t.computed || t.type === "OptionalIndexedAccessType" ? "?." : "?";
2964
- }
2965
- function cn(e) {
2966
- return e.node.definite || e.match(void 0, (t, r) => r === "id" && t.type === "VariableDeclarator" && t.definite) ? "!" : "";
2967
- }
2968
- var ol = /* @__PURE__ */ new Set(["DeclareClass", "DeclareComponent", "DeclareFunction", "DeclareHook", "DeclareVariable", "DeclareExportDeclaration", "DeclareExportAllDeclaration", "DeclareOpaqueType", "DeclareTypeAlias", "DeclareEnum", "DeclareInterface"]);
2969
- function K(e) {
2970
- let { node: t } = e;
2971
- return t.declare || ol.has(t.type) && e.parent.type !== "DeclareExportDeclaration" ? "declare " : "";
2972
- }
2973
- var pl = /* @__PURE__ */ new Set(["TSAbstractMethodDefinition", "TSAbstractPropertyDefinition", "TSAbstractAccessorProperty"]);
2974
- function Ht({ node: e }) {
2975
- return e.abstract || pl.has(e.type) ? "abstract " : "";
2976
- }
2977
- function Qe(e, t, r) {
2978
- let n = e.node;
2979
- return n.typeArguments ? r("typeArguments") : n.typeParameters ? r("typeParameters") : "";
2980
- }
2981
- function Vr(e, t, r) {
2982
- return ["::", r("callee")];
2983
- }
2984
- function Dt(e, t, r) {
2985
- return e.type === "EmptyStatement" ? ";" : e.type === "BlockStatement" || r ? [" ", t] : f([x, t]);
2986
- }
2987
- function ln(e, t) {
2988
- return ["...", t("argument"), N(e, t)];
2989
- }
2990
- function Nt(e) {
2991
- return e.accessibility ? e.accessibility + " " : "";
2992
- }
2993
- function cl(e, t, r, n) {
2994
- let { node: s } = e, u = s.inexact ? "..." : "";
2995
- return d(s, h.Dangling) ? l([r, u, J(e, t, { indent: true }), E, n]) : [r, u, n];
2996
- }
2997
- function Vt(e, t, r) {
2998
- let { node: n } = e, s = [], u = n.type === "TupleExpression" ? "#[" : "[", i = "]", a = n.type === "TupleTypeAnnotation" && n.types ? "types" : n.type === "TSTupleType" || n.type === "TupleTypeAnnotation" ? "elementTypes" : "elements", p = n[a];
2999
- if (p.length === 0) s.push(cl(e, t, u, i));
3000
- else {
3001
- let o = _(false, p, -1), m = (o == null ? void 0 : o.type) !== "RestElement" && !n.inexact, y = o === null, D = Symbol("array"), C = !t.__inJestEach && p.length > 1 && p.every((T, S, g) => {
3002
- let M = T == null ? void 0 : T.type;
3003
- if (!X(T) && !se(T)) return false;
3004
- let R = g[S + 1];
3005
- if (R && M !== R.type) return false;
3006
- let j = X(T) ? "elements" : "properties";
3007
- return T[j] && T[j].length > 1;
3008
- }), c = fs(n, t), A = m ? y ? "," : ae(t) ? c ? B(",", "", { groupId: D }) : B(",") : "" : "";
3009
- s.push(l([u, f([E, c ? ml(e, t, r, A) : [ll(e, t, a, n.inexact, r), A], J(e, t)]), E, i], { shouldBreak: C, id: D }));
3010
- }
3011
- return s.push($(e), N(e, r)), s;
3012
- }
3013
- function fs(e, t) {
3014
- return X(e) && e.elements.length > 1 && e.elements.every((r) => r && (Fe(r) || jn(r) && !d(r.argument)) && !d(r, h.Trailing | h.Line, (n) => !Z(t.originalText, q(n), { backwards: true })));
3015
- }
3016
- function qi({ node: e }, { originalText: t }) {
3017
- let r = (s) => Ot(t, _t(t, s)), n = (s) => t[s] === "," ? s : n(r(s + 1));
3018
- return jt(t, n(k(e)));
3019
- }
3020
- function ll(e, t, r, n, s) {
3021
- let u = [];
3022
- return e.each(({ node: i, isLast: a }) => {
3023
- u.push(i ? l(s()) : ""), (!a || n) && u.push([",", x, i && qi(e, t) ? E : ""]);
3024
- }, r), n && u.push("..."), u;
3025
- }
3026
- function ml(e, t, r, n) {
3027
- let s = [];
3028
- return e.each(({ isLast: u, next: i }) => {
3029
- s.push([r(), u ? n : ","]), u || s.push(qi(e, t) ? [F, F] : d(i, h.Leading | h.Line) ? F : x);
3030
- }, "elements"), Rr(s);
3031
- }
3032
- var yl = /^[\$A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC][\$0-9A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]*$/;
3033
- var Dl = (e) => yl.test(e);
3034
- var Wi = Dl;
3035
- function fl(e) {
3036
- return e.length === 1 ? e : e.toLowerCase().replace(/^([+-]?[\d.]+e)(?:\+|(-))?0*(?=\d)/u, "$1$2").replace(/^([+-]?[\d.]+)e[+-]?0+$/u, "$1").replace(/^([+-])?\./u, "$10.").replace(/(\.\d+?)0+(?=e|$)/u, "$1").replace(/\.(?=e|$)/u, "");
3037
- }
3038
- var ft = fl;
3039
- var mn = /* @__PURE__ */ new WeakMap();
3040
- function Ui(e) {
3041
- return /^(?:\d+|\d+\.\d+)$/u.test(e);
3042
- }
3043
- function Gi(e, t) {
3044
- return t.parser === "json" || t.parser === "jsonc" || !te(e.key) || Ze(fe(e.key), t).slice(1, -1) !== e.key.value ? false : !!(Wi(e.key.value) && !(t.parser === "babel-ts" && e.type === "ClassProperty" || t.parser === "typescript" && e.type === "PropertyDefinition") || Ui(e.key.value) && String(Number(e.key.value)) === e.key.value && e.type !== "ImportAttribute" && (t.parser === "babel" || t.parser === "acorn" || t.parser === "espree" || t.parser === "meriyah" || t.parser === "__babel_estree"));
3045
- }
3046
- function El(e, t) {
3047
- let { key: r } = e.node;
3048
- return (r.type === "Identifier" || Fe(r) && Ui(ft(fe(r))) && String(r.value) === ft(fe(r)) && !(t.parser === "typescript" || t.parser === "babel-ts")) && (t.parser === "json" || t.parser === "jsonc" || t.quoteProps === "consistent" && mn.get(e.parent));
3049
- }
3050
- function Et(e, t, r) {
3051
- let { node: n } = e;
3052
- if (n.computed) return ["[", r("key"), "]"];
3053
- let { parent: s } = e, { key: u } = n;
3054
- if (t.quoteProps === "consistent" && !mn.has(s)) {
3055
- let i = e.siblings.some((a) => !a.computed && te(a.key) && !Gi(a, t));
3056
- mn.set(s, i);
3057
- }
3058
- if (El(e, t)) {
3059
- let i = Ze(JSON.stringify(u.type === "Identifier" ? u.name : u.value.toString()), t);
3060
- return e.call((a) => ye(a, i, t), "key");
3061
- }
3062
- return Gi(n, t) && (t.quoteProps === "as-needed" || t.quoteProps === "consistent" && !mn.get(s)) ? e.call((i) => ye(i, /^\d/u.test(u.value) ? ft(u.value) : u.value, t), "key") : r("key");
3063
- }
3064
- function yn(e, t, r) {
3065
- let { node: n } = e;
3066
- return n.shorthand ? r("value") : xt(e, t, r, Et(e, t, r), ":", "value");
3067
- }
3068
- var Fl = ({ node: e, key: t, parent: r }) => t === "value" && e.type === "FunctionExpression" && (r.type === "ObjectMethod" || r.type === "ClassMethod" || r.type === "ClassPrivateMethod" || r.type === "MethodDefinition" || r.type === "TSAbstractMethodDefinition" || r.type === "TSDeclareMethod" || r.type === "Property" && bt(r));
3069
- function Dn(e, t, r, n) {
3070
- if (Fl(e)) return fn(e, r, t);
3071
- let { node: s } = e, u = false;
3072
- if ((s.type === "FunctionDeclaration" || s.type === "FunctionExpression") && (n != null && n.expandLastArg)) {
3073
- let { parent: m } = e;
3074
- L(m) && (oe(m).length > 1 || z(s).every((y) => y.type === "Identifier" && !y.typeAnnotation)) && (u = true);
3075
- }
3076
- let i = [K(e), s.async ? "async " : "", `function${s.generator ? "*" : ""} `, s.id ? t("id") : ""], a = Je(e, t, r, u), p = $t(e, t), o = at(s, p);
3077
- return i.push(Qe(e, r, t), l([o ? l(a) : a, p]), s.body ? " " : "", t("body")), r.semi && (s.declare || !s.body) && i.push(";"), i;
3078
- }
3079
- function yr(e, t, r) {
3080
- let { node: n } = e, { kind: s } = n, u = n.value || n, i = [];
3081
- return !s || s === "init" || s === "method" || s === "constructor" ? u.async && i.push("async ") : (vt.ok(s === "get" || s === "set"), i.push(s, " ")), u.generator && i.push("*"), i.push(Et(e, t, r), n.optional || n.key.optional ? "?" : "", n === u ? fn(e, t, r) : r("value")), i;
3082
- }
3083
- function fn(e, t, r) {
3084
- let { node: n } = e, s = Je(e, r, t), u = $t(e, r), i = Mi(n), a = at(n, u), p = [Qe(e, t, r), l([i ? l(s, { shouldBreak: true }) : a ? l(s) : s, u])];
3085
- return n.body ? p.push(" ", r("body")) : p.push(t.semi ? ";" : ""), p;
3086
- }
3087
- function Cl(e) {
3088
- let t = z(e);
3089
- return t.length === 1 && !e.typeParameters && !d(e, h.Dangling) && t[0].type === "Identifier" && !t[0].typeAnnotation && !d(t[0]) && !t[0].optional && !e.predicate && !e.returnType;
3090
- }
3091
- function En(e, t) {
3092
- if (t.arrowParens === "always") return false;
3093
- if (t.arrowParens === "avoid") {
3094
- let { node: r } = e;
3095
- return Cl(r);
3096
- }
3097
- return false;
3098
- }
3099
- function $t(e, t) {
3100
- let { node: r } = e, s = [N(e, t, "returnType")];
3101
- return r.predicate && s.push(t("predicate")), s;
3102
- }
3103
- function Xi(e, t, r) {
3104
- let { node: n } = e, s = t.semi ? ";" : "", u = [];
3105
- if (n.argument) {
3106
- let p = r("argument");
3107
- Al(t, n.argument) ? p = ["(", f([F, p]), F, ")"] : (De(n.argument) || n.argument.type === "SequenceExpression" || t.experimentalTernaries && n.argument.type === "ConditionalExpression" && (n.argument.consequent.type === "ConditionalExpression" || n.argument.alternate.type === "ConditionalExpression")) && (p = l([B("("), f([E, p]), E, B(")")])), u.push(" ", p);
3108
- }
3109
- let i = d(n, h.Dangling), a = s && i && d(n, h.Last | h.Line);
3110
- return a && u.push(s), i && u.push(" ", J(e, t)), a || u.push(s), u;
3111
- }
3112
- function Yi(e, t, r) {
3113
- return ["return", Xi(e, t, r)];
3114
- }
3115
- function Hi(e, t, r) {
3116
- return ["throw", Xi(e, t, r)];
3117
- }
3118
- function Al(e, t) {
3119
- if (Oe(e.originalText, t) || d(t, h.Leading, (r) => Te(e.originalText, q(r), k(r))) && !H(t)) return true;
3120
- if (Rt(t)) {
3121
- let r = t, n;
3122
- for (; n = iu(r); ) if (r = n, Oe(e.originalText, r)) return true;
3123
- }
3124
- return false;
3125
- }
3126
- var ds = /* @__PURE__ */ new WeakMap();
3127
- function Ni(e) {
3128
- return ds.has(e) || ds.set(e, e.type === "ConditionalExpression" && !ie(e, (t) => t.type === "ObjectExpression")), ds.get(e);
3129
- }
3130
- var Vi = (e) => e.type === "SequenceExpression";
3131
- function $i(e, t, r, n = {}) {
3132
- let s = [], u, i = [], a = false, p = !n.expandLastArg && e.node.body.type === "ArrowFunctionExpression", o;
3133
- (function S() {
3134
- let { node: g } = e, M = Tl(e, t, r, n);
3135
- if (s.length === 0) s.push(M);
3136
- else {
3137
- let { leading: R, trailing: j } = os(e, t);
3138
- s.push([R, M]), i.unshift(j);
3139
- }
3140
- p && (a || (a = g.returnType && z(g).length > 0 || g.typeParameters || z(g).some((R) => R.type !== "Identifier"))), !p || g.body.type !== "ArrowFunctionExpression" ? (u = r("body", n), o = g.body) : e.call(S, "body");
3141
- })();
3142
- let m = !Oe(t.originalText, o) && (Vi(o) || dl(o, u, t) || !a && Ni(o)), y = e.key === "callee" && lt(e.parent), D = Symbol("arrow-chain"), C = xl(e, n, { signatureDocs: s, shouldBreak: a }), c = false, A = false, T = false;
3143
- return p && (y || n.assignmentLayout) && (A = true, T = !d(e.node, h.Leading & h.Line), c = n.assignmentLayout === "chain-tail-arrow-chain" || y && !m), u = hl(e, t, n, { bodyDoc: u, bodyComments: i, functionBody: o, shouldPutBodyOnSameLine: m }), l([l(A ? f([T ? E : "", C]) : C, { shouldBreak: c, id: D }), " =>", p ? dt(u, { groupId: D }) : l(u), p && y ? B(E, "", { groupId: D }) : ""]);
3144
- }
3145
- function Tl(e, t, r, n) {
3146
- let { node: s } = e, u = [];
3147
- if (s.async && u.push("async "), En(e, t)) u.push(r(["params", 0]));
3148
- else {
3149
- let a = n.expandLastArg || n.expandFirstArg, p = $t(e, r);
3150
- if (a) {
3151
- if (re(p)) throw new yt();
3152
- p = l(ar(p));
3153
- }
3154
- u.push(l([Je(e, r, t, a, true), p]));
3155
- }
3156
- let i = J(e, t, { filter(a) {
3157
- let p = ut(t.originalText, k(a));
3158
- return p !== false && t.originalText.slice(p, p + 2) === "=>";
3159
- } });
3160
- return i && u.push(" ", i), u;
3161
- }
3162
- function dl(e, t, r) {
3163
- var n, s;
3164
- return X(e) || se(e) || e.type === "ArrowFunctionExpression" || e.type === "DoExpression" || e.type === "BlockStatement" || H(e) || ((n = t.label) == null ? void 0 : n.hug) !== false && (((s = t.label) == null ? void 0 : s.embed) || Lr(e, r.originalText));
3165
- }
3166
- function xl(e, t, { signatureDocs: r, shouldBreak: n }) {
3167
- if (r.length === 1) return r[0];
3168
- let { parent: s, key: u } = e;
3169
- return u !== "callee" && lt(s) || De(s) ? l([r[0], " =>", f([x, b([" =>", x], r.slice(1))])], { shouldBreak: n }) : u === "callee" && lt(s) || t.assignmentLayout ? l(b([" =>", x], r), { shouldBreak: n }) : l(f(b([" =>", x], r)), { shouldBreak: n });
3170
- }
3171
- function hl(e, t, r, { bodyDoc: n, bodyComments: s, functionBody: u, shouldPutBodyOnSameLine: i }) {
3172
- let { node: a, parent: p } = e, o = r.expandLastArg && ae(t, "all") ? B(",") : "", m = (r.expandLastArg || p.type === "JSXExpressionContainer") && !d(a) ? E : "";
3173
- return i && Ni(u) ? [" ", l([B("", "("), f([E, n]), B("", ")"), o, m]), s] : (Vi(u) && (n = l(["(", f([E, n]), E, ")"])), i ? [" ", n, s] : [f([x, n, s]), o, m]);
3174
- }
3175
- var gl = (e, t, r) => {
3176
- if (!(e && t == null)) {
3177
- if (t.findLast) return t.findLast(r);
3178
- for (let n = t.length - 1; n >= 0; n--) {
3179
- let s = t[n];
3180
- if (r(s, n, t)) return s;
3181
- }
3182
- }
3183
- };
3184
- var Ki = gl;
3185
- function Dr(e, t, r, n) {
3186
- let { node: s } = e, u = [], i = Ki(false, s[n], (a) => a.type !== "EmptyStatement");
3187
- return e.each(({ node: a }) => {
3188
- a.type !== "EmptyStatement" && (u.push(r()), a !== i && (u.push(F), pe(a, t) && u.push(F)));
3189
- }, n), u;
3190
- }
3191
- function Fn(e, t, r) {
3192
- let n = Sl(e, t, r), { node: s, parent: u } = e;
3193
- if (s.type === "Program" && (u == null ? void 0 : u.type) !== "ModuleExpression") return n ? [n, F] : "";
3194
- let i = [];
3195
- if (s.type === "StaticBlock" && i.push("static "), i.push("{"), n) i.push(f([F, n]), F);
3196
- else {
3197
- let a = e.grandparent;
3198
- u.type === "ArrowFunctionExpression" || u.type === "FunctionExpression" || u.type === "FunctionDeclaration" || u.type === "ComponentDeclaration" || u.type === "HookDeclaration" || u.type === "ObjectMethod" || u.type === "ClassMethod" || u.type === "ClassPrivateMethod" || u.type === "ForStatement" || u.type === "WhileStatement" || u.type === "DoWhileStatement" || u.type === "DoExpression" || u.type === "ModuleExpression" || u.type === "CatchClause" && !a.finalizer || u.type === "TSModuleDeclaration" || s.type === "StaticBlock" || i.push(F);
3199
- }
3200
- return i.push("}"), i;
3201
- }
3202
- function Sl(e, t, r) {
3203
- let { node: n } = e, s = O(n.directives), u = n.body.some((p) => p.type !== "EmptyStatement"), i = d(n, h.Dangling);
3204
- if (!s && !u && !i) return "";
3205
- let a = [];
3206
- return s && (a.push(Dr(e, t, r, "directives")), (u || i) && (a.push(F), pe(_(false, n.directives, -1), t) && a.push(F))), u && a.push(Dr(e, t, r, "body")), i && a.push(J(e, t)), a;
3207
- }
3208
- function Bl(e) {
3209
- let t = /* @__PURE__ */ new WeakMap();
3210
- return function(r) {
3211
- return t.has(r) || t.set(r, Symbol(e)), t.get(r);
3212
- };
3213
- }
3214
- var Cn = Bl;
3215
- function bl(e) {
3216
- switch (e) {
3217
- case null:
3218
- return "";
3219
- case "PlusOptional":
3220
- return "+?";
3221
- case "MinusOptional":
3222
- return "-?";
3223
- case "Optional":
3224
- return "?";
3225
- }
3226
- }
3227
- function Qi(e, t, r) {
3228
- let { node: n } = e;
3229
- return l([n.variance ? r("variance") : "", "[", f([r("keyTparam"), " in ", r("sourceType")]), "]", bl(n.optional), ": ", r("propType")]);
3230
- }
3231
- function xs(e, t) {
3232
- return e === "+" || e === "-" ? e + t : t;
3233
- }
3234
- function zi(e, t, r) {
3235
- let { node: n } = e, s = Te(t.originalText, q(n), q(n.typeParameter));
3236
- return l(["{", f([t.bracketSpacing ? x : E, l([r("typeParameter"), n.optional ? xs(n.optional, "?") : "", n.typeAnnotation ? ": " : "", r("typeAnnotation")]), t.semi ? B(";") : ""]), J(e, t), t.bracketSpacing ? x : E, "}"], { shouldBreak: s });
3237
- }
3238
- var fr = Cn("typeParameters");
3239
- function Pl(e, t, r) {
3240
- let { node: n } = e;
3241
- return z(n).length === 1 && n.type.startsWith("TS") && !n[r][0].constraint && e.parent.type === "ArrowFunctionExpression" && !(t.filepath && /\.ts$/u.test(t.filepath));
3242
- }
3243
- function Lt(e, t, r, n) {
3244
- let { node: s } = e;
3245
- if (!s[n]) return "";
3246
- if (!Array.isArray(s[n])) return r(n);
3247
- let u = Pt(e.grandparent), i = e.match((o) => !(o[n].length === 1 && we(o[n][0])), void 0, (o, m) => m === "typeAnnotation", (o) => o.type === "Identifier", Fs);
3248
- if (s[n].length === 0 || !i && (u || s[n].length === 1 && (s[n][0].type === "NullableTypeAnnotation" || As(s[n][0])))) return ["<", b(", ", e.map(r, n)), kl(e, t), ">"];
3249
- let p = s.type === "TSTypeParameterInstantiation" ? "" : Pl(e, t, n) ? "," : ae(t) ? B(",") : "";
3250
- return l(["<", f([E, b([",", x], e.map(r, n))]), p, E, ">"], { id: fr(s) });
3251
- }
3252
- function kl(e, t) {
3253
- let { node: r } = e;
3254
- if (!d(r, h.Dangling)) return "";
3255
- let n = !d(r, h.Line), s = J(e, t, { indent: !n });
3256
- return n ? s : [s, F];
3257
- }
3258
- function An(e, t, r) {
3259
- let { node: n, parent: s } = e, u = [n.type === "TSTypeParameter" && n.const ? "const " : ""], i = n.type === "TSTypeParameter" ? r("name") : n.name;
3260
- if (s.type === "TSMappedType") return s.readonly && u.push(xs(s.readonly, "readonly"), " "), u.push("[", i), n.constraint && u.push(" in ", r("constraint")), s.nameType && u.push(" as ", e.callParent(() => r("nameType"))), u.push("]"), u;
3261
- if (n.variance && u.push(r("variance")), n.in && u.push("in "), n.out && u.push("out "), u.push(i), n.bound && (n.usesExtendsBound && u.push(" extends "), u.push(N(e, r, "bound"))), n.constraint) {
3262
- let a = Symbol("constraint");
3263
- u.push(" extends", l(f(x), { id: a }), ke, dt(r("constraint"), { groupId: a }));
3264
- }
3265
- return n.default && u.push(" = ", r("default")), l(u);
3266
- }
3267
- var Zi = v(["ClassProperty", "PropertyDefinition", "ClassPrivateProperty", "ClassAccessorProperty", "AccessorProperty", "TSAbstractPropertyDefinition", "TSAbstractAccessorProperty"]);
3268
- function Tn(e, t, r) {
3269
- let { node: n } = e, s = [K(e), Ht(e), "class"], u = d(n.id, h.Trailing) || d(n.typeParameters, h.Trailing) || d(n.superClass) || O(n.extends) || O(n.mixins) || O(n.implements), i = [], a = [];
3270
- if (n.id && i.push(" ", r("id")), i.push(r("typeParameters")), n.superClass) {
3271
- let m = [Ll(e, t, r), r(n.superTypeArguments ? "superTypeArguments" : "superTypeParameters")], y = e.call((D) => ["extends ", ye(D, m, t)], "superClass");
3272
- u ? a.push(x, l(y)) : a.push(" ", y);
3273
- } else a.push(hs(e, t, r, "extends"));
3274
- a.push(hs(e, t, r, "mixins"), hs(e, t, r, "implements"));
3275
- let p;
3276
- if (u) {
3277
- let m;
3278
- ra(n) ? m = [...i, f(a)] : m = f([...i, a]), p = ea(n), s.push(l(m, { id: p }));
3279
- } else s.push(...i, ...a);
3280
- let o = n.body;
3281
- return u && O(o.body) ? s.push(B(F, " ", { groupId: p })) : s.push(" "), s.push(r("body")), s;
3282
- }
3283
- var ea = Cn("heritageGroup");
3284
- function ta(e) {
3285
- return B(F, "", { groupId: ea(e) });
3286
- }
3287
- function Il(e) {
3288
- return ["extends", "mixins", "implements"].reduce((t, r) => t + (Array.isArray(e[r]) ? e[r].length : 0), e.superClass ? 1 : 0) > 1;
3289
- }
3290
- function ra(e) {
3291
- return e.typeParameters && !d(e.typeParameters, h.Trailing | h.Line) && !Il(e);
3292
- }
3293
- function hs(e, t, r, n) {
3294
- let { node: s } = e;
3295
- if (!O(s[n])) return "";
3296
- let u = J(e, t, { marker: n });
3297
- return [ra(s) ? B(" ", x, { groupId: fr(s.typeParameters) }) : x, u, u && F, n, l(f([x, b([",", x], e.map(r, n))]))];
3298
- }
3299
- function Ll(e, t, r) {
3300
- let n = r("superClass"), { parent: s } = e;
3301
- return s.type === "AssignmentExpression" ? l(B(["(", f([E, n]), E, ")"], n)) : n;
3302
- }
3303
- function dn(e, t, r) {
3304
- let { node: n } = e, s = [];
3305
- return O(n.decorators) && s.push(Ds(e, t, r)), s.push(Nt(n)), n.static && s.push("static "), s.push(Ht(e)), n.override && s.push("override "), s.push(yr(e, t, r)), s;
3306
- }
3307
- function xn(e, t, r) {
3308
- let { node: n } = e, s = [], u = t.semi ? ";" : "";
3309
- O(n.decorators) && s.push(Ds(e, t, r)), s.push(K(e), Nt(n)), n.static && s.push("static "), s.push(Ht(e)), n.override && s.push("override "), n.readonly && s.push("readonly "), n.variance && s.push(r("variance")), (n.type === "ClassAccessorProperty" || n.type === "AccessorProperty" || n.type === "TSAbstractAccessorProperty") && s.push("accessor "), s.push(Et(e, t, r), $(e), cn(e), N(e, r));
3310
- let i = n.type === "TSAbstractPropertyDefinition" || n.type === "TSAbstractAccessorProperty";
3311
- return [xt(e, t, r, s, " =", i ? void 0 : "value"), u];
3312
- }
3313
- function na(e, t, r) {
3314
- let { node: n } = e, s = [];
3315
- return e.each(({ node: u, next: i, isLast: a }) => {
3316
- s.push(r()), !t.semi && Zi(u) && wl(u, i) && s.push(";"), a || (s.push(F), pe(u, t) && s.push(F));
3317
- }, "body"), d(n, h.Dangling) && s.push(J(e, t)), ["{", s.length > 0 ? [f([F, s]), F] : "", "}"];
3318
- }
3319
- function wl(e, t) {
3320
- var s;
3321
- let { type: r, name: n } = e.key;
3322
- if (!e.computed && r === "Identifier" && (n === "static" || n === "get" || n === "set") && !e.value && !e.typeAnnotation) return true;
3323
- if (!t || t.static || t.accessibility || t.readonly) return false;
3324
- if (!t.computed) {
3325
- let u = (s = t.key) == null ? void 0 : s.name;
3326
- if (u === "in" || u === "instanceof") return true;
3327
- }
3328
- if (Zi(t) && t.variance && !t.static && !t.declare) return true;
3329
- switch (t.type) {
3330
- case "ClassProperty":
3331
- case "PropertyDefinition":
3332
- case "TSAbstractPropertyDefinition":
3333
- return t.computed;
3334
- case "MethodDefinition":
3335
- case "TSAbstractMethodDefinition":
3336
- case "ClassMethod":
3337
- case "ClassPrivateMethod": {
3338
- if ((t.value ? t.value.async : t.async) || t.kind === "get" || t.kind === "set") return false;
3339
- let i = t.value ? t.value.generator : t.generator;
3340
- return !!(t.computed || i);
3341
- }
3342
- case "TSIndexSignature":
3343
- return true;
3344
- }
3345
- return false;
3346
- }
3347
- var Ol = v(["TSAsExpression", "TSTypeAssertion", "TSNonNullExpression", "TSInstantiationExpression", "TSSatisfiesExpression"]);
3348
- function gs(e) {
3349
- return Ol(e) ? gs(e.expression) : e;
3350
- }
3351
- var sa = v(["FunctionExpression", "ArrowFunctionExpression"]);
3352
- function ua(e) {
3353
- return e.type === "MemberExpression" || e.type === "OptionalMemberExpression" || e.type === "Identifier" && e.name !== "undefined";
3354
- }
3355
- function ia(e, t) {
3356
- if (t.semi || Ss(e, t) || Bs(e, t)) return false;
3357
- let { node: r, key: n, parent: s } = e;
3358
- return !!(r.type === "ExpressionStatement" && (n === "body" && (s.type === "Program" || s.type === "BlockStatement" || s.type === "StaticBlock" || s.type === "TSModuleBlock") || n === "consequent" && s.type === "SwitchCase") && e.call(() => aa(e, t), "expression"));
3359
- }
3360
- function aa(e, t) {
3361
- let { node: r } = e;
3362
- switch (r.type) {
3363
- case "ParenthesizedExpression":
3364
- case "TypeCastExpression":
3365
- case "ArrayExpression":
3366
- case "ArrayPattern":
3367
- case "TemplateLiteral":
3368
- case "TemplateElement":
3369
- case "RegExpLiteral":
3370
- return true;
3371
- case "ArrowFunctionExpression":
3372
- if (!En(e, t)) return true;
3373
- break;
3374
- case "UnaryExpression": {
3375
- let { prefix: n, operator: s } = r;
3376
- if (n && (s === "+" || s === "-")) return true;
3377
- break;
3378
- }
3379
- case "BindExpression":
3380
- if (!r.object) return true;
3381
- break;
3382
- case "Literal":
3383
- if (r.regex) return true;
3384
- break;
3385
- default:
3386
- if (H(r)) return true;
3387
- }
3388
- return Be(e, t) ? true : Rt(r) ? e.call(() => aa(e, t), ...Pr(r)) : false;
3389
- }
3390
- function Ss({ node: e, parent: t }, r) {
3391
- return (r.parentParser === "markdown" || r.parentParser === "mdx") && e.type === "ExpressionStatement" && H(e.expression) && t.type === "Program" && t.body.length === 1;
3392
- }
3393
- function Bs({ node: e, parent: t }, r) {
3394
- return (r.parser === "__vue_event_binding" || r.parser === "__vue_ts_event_binding") && e.type === "ExpressionStatement" && t.type === "Program" && t.body.length === 1;
3395
- }
3396
- function oa(e, t, r) {
3397
- let n = [r("expression")];
3398
- if (Bs(e, t)) {
3399
- let s = gs(e.node.expression);
3400
- (sa(s) || ua(s)) && n.push(";");
3401
- } else Ss(e, t) || t.semi && n.push(";");
3402
- return n;
3403
- }
3404
- function pa(e, t, r) {
3405
- if (t.__isVueBindings || t.__isVueForBindingLeft) {
3406
- let n = e.map(r, "program", "body", 0, "params");
3407
- if (n.length === 1) return n[0];
3408
- let s = b([",", x], n);
3409
- return t.__isVueForBindingLeft ? ["(", f([E, l(s)]), E, ")"] : s;
3410
- }
3411
- if (t.__isEmbeddedTypescriptGenericParameters) {
3412
- let n = e.map(r, "program", "body", 0, "typeParameters", "params");
3413
- return b([",", x], n);
3414
- }
3415
- }
3416
- function ma(e, t) {
3417
- let { node: r } = e;
3418
- switch (r.type) {
3419
- case "RegExpLiteral":
3420
- return ca(r);
3421
- case "BigIntLiteral":
3422
- return hn(r.extra.raw);
3423
- case "NumericLiteral":
3424
- return ft(r.extra.raw);
3425
- case "StringLiteral":
3426
- return Ie(Ze(r.extra.raw, t));
3427
- case "NullLiteral":
3428
- return "null";
3429
- case "BooleanLiteral":
3430
- return String(r.value);
3431
- case "DirectiveLiteral":
3432
- return la(r.extra.raw, t);
3433
- case "Literal": {
3434
- if (r.regex) return ca(r.regex);
3435
- if (r.bigint) return hn(r.raw);
3436
- let { value: n } = r;
3437
- return typeof n == "number" ? ft(r.raw) : typeof n == "string" ? _l(e) ? la(r.raw, t) : Ie(Ze(r.raw, t)) : String(n);
3438
- }
3439
- }
3440
- }
3441
- function _l(e) {
3442
- if (e.key !== "expression") return;
3443
- let { parent: t } = e;
3444
- return t.type === "ExpressionStatement" && t.directive;
3445
- }
3446
- function hn(e) {
3447
- return e.toLowerCase();
3448
- }
3449
- function ca({ pattern: e, flags: t }) {
3450
- return t = [...t].sort().join(""), `/${e}/${t}`;
3451
- }
3452
- function la(e, t) {
3453
- let r = e.slice(1, -1);
3454
- if (r.includes('"') || r.includes("'")) return e;
3455
- let n = t.singleQuote ? "'" : '"';
3456
- return n + r + n;
3457
- }
3458
- function jl(e, t, r) {
3459
- let n = e.originalText.slice(t, r);
3460
- for (let s of e[Symbol.for("comments")]) {
3461
- let u = q(s);
3462
- if (u > r) break;
3463
- let i = k(s);
3464
- if (i < t) continue;
3465
- let a = i - u;
3466
- n = n.slice(0, u - t) + " ".repeat(a) + n.slice(i - t);
3467
- }
3468
- return n;
3469
- }
3470
- var bs = jl;
3471
- function ya(e, t, r) {
3472
- let { node: n } = e;
3473
- return ["import", n.phase ? ` ${n.phase}` : "", ks(n), Ea(e, t, r), fa(e, t, r), Ca(e, t, r), t.semi ? ";" : ""];
3474
- }
3475
- var Da = (e) => e.type === "ExportDefaultDeclaration" || e.type === "DeclareExportDeclaration" && e.default;
3476
- function gn(e, t, r) {
3477
- let { node: n } = e, s = [xi(e, t, r), K(e), "export", Da(n) ? " default" : ""], { declaration: u, exported: i } = n;
3478
- return d(n, h.Dangling) && (s.push(" ", J(e, t)), wr(n) && s.push(F)), u ? s.push(" ", r("declaration")) : (s.push(Rl(n)), n.type === "ExportAllDeclaration" || n.type === "DeclareExportAllDeclaration" ? (s.push(" *"), i && s.push(" as ", r("exported"))) : s.push(Ea(e, t, r)), s.push(fa(e, t, r), Ca(e, t, r))), s.push(Ml(n, t)), s;
3479
- }
3480
- var vl = v(["ClassDeclaration", "ComponentDeclaration", "FunctionDeclaration", "TSInterfaceDeclaration", "DeclareClass", "DeclareComponent", "DeclareFunction", "DeclareHook", "HookDeclaration", "TSDeclareFunction", "EnumDeclaration"]);
3481
- function Ml(e, t) {
3482
- return t.semi && (!e.declaration || Da(e) && !vl(e.declaration)) ? ";" : "";
3483
- }
3484
- function Ps(e, t = true) {
3485
- return e && e !== "value" ? `${t ? " " : ""}${e}${t ? "" : " "}` : "";
3486
- }
3487
- function ks(e, t) {
3488
- return Ps(e.importKind, t);
3489
- }
3490
- function Rl(e) {
3491
- return Ps(e.exportKind);
3492
- }
3493
- function fa(e, t, r) {
3494
- let { node: n } = e;
3495
- if (!n.source) return "";
3496
- let s = [];
3497
- return Fa(n, t) && s.push(" from"), s.push(" ", r("source")), s;
3498
- }
3499
- function Ea(e, t, r) {
3500
- let { node: n } = e;
3501
- if (!Fa(n, t)) return "";
3502
- let s = [" "];
3503
- if (O(n.specifiers)) {
3504
- let u = [], i = [];
3505
- e.each(() => {
3506
- let a = e.node.type;
3507
- if (a === "ExportNamespaceSpecifier" || a === "ExportDefaultSpecifier" || a === "ImportNamespaceSpecifier" || a === "ImportDefaultSpecifier") u.push(r());
3508
- else if (a === "ExportSpecifier" || a === "ImportSpecifier") i.push(r());
3509
- else throw new Me(n, "specifier");
3510
- }, "specifiers"), s.push(b(", ", u)), i.length > 0 && (u.length > 0 && s.push(", "), i.length > 1 || u.length > 0 || n.specifiers.some((p) => d(p)) ? s.push(l(["{", f([t.bracketSpacing ? x : E, b([",", x], i)]), B(ae(t) ? "," : ""), t.bracketSpacing ? x : E, "}"])) : s.push(["{", t.bracketSpacing ? " " : "", ...i, t.bracketSpacing ? " " : "", "}"]));
3511
- } else s.push("{}");
3512
- return s;
3513
- }
3514
- function Fa(e, t) {
3515
- return e.type !== "ImportDeclaration" || O(e.specifiers) || e.importKind === "type" ? true : bs(t, q(e), q(e.source)).trimEnd().endsWith("from");
3516
- }
3517
- function Jl(e, t) {
3518
- var n, s;
3519
- if ((n = e.extra) != null && n.deprecatedAssertSyntax) return "assert";
3520
- let r = bs(t, k(e.source), (s = e.attributes) != null && s[0] ? q(e.attributes[0]) : k(e)).trimStart();
3521
- return r.startsWith("assert") ? "assert" : r.startsWith("with") || O(e.attributes) ? "with" : void 0;
3522
- }
3523
- function Ca(e, t, r) {
3524
- let { node: n } = e;
3525
- if (!n.source) return "";
3526
- let s = Jl(n, t);
3527
- if (!s) return "";
3528
- let u = [` ${s} {`];
3529
- return O(n.attributes) && (t.bracketSpacing && u.push(" "), u.push(b(", ", e.map(r, "attributes"))), t.bracketSpacing && u.push(" ")), u.push("}"), u;
3530
- }
3531
- function Aa(e, t, r) {
3532
- let { node: n } = e, { type: s } = n, u = s.startsWith("Import"), i = u ? "imported" : "local", a = u ? "local" : "exported", p = n[i], o = n[a], m = "", y = "";
3533
- return s === "ExportNamespaceSpecifier" || s === "ImportNamespaceSpecifier" ? m = "*" : p && (m = r(i)), o && !ql(n) && (y = r(a)), [Ps(s === "ImportSpecifier" ? n.importKind : n.exportKind, false), m, m && y ? " as " : "", y];
3534
- }
3535
- function ql(e) {
3536
- if (e.type !== "ImportSpecifier" && e.type !== "ExportSpecifier") return false;
3537
- let { local: t, [e.type === "ImportSpecifier" ? "imported" : "exported"]: r } = e;
3538
- if (t.type !== r.type || !tu(t, r)) return false;
3539
- if (te(t)) return t.value === r.value && fe(t) === fe(r);
3540
- switch (t.type) {
3541
- case "Identifier":
3542
- return t.name === r.name;
3543
- default:
3544
- return false;
3545
- }
3546
- }
3547
- function ht(e, t, r) {
3548
- var j;
3549
- let n = t.semi ? ";" : "", { node: s } = e, u = s.type === "ObjectTypeAnnotation", i = s.type === "TSEnumDeclaration" || s.type === "EnumBooleanBody" || s.type === "EnumNumberBody" || s.type === "EnumBigIntBody" || s.type === "EnumStringBody" || s.type === "EnumSymbolBody", a = [s.type === "TSTypeLiteral" || i ? "members" : s.type === "TSInterfaceBody" ? "body" : "properties"];
3550
- u && a.push("indexers", "callProperties", "internalSlots");
3551
- let p = a.flatMap((I) => e.map(({ node: U }) => ({ node: U, printed: r(), loc: q(U) }), I));
3552
- a.length > 1 && p.sort((I, U) => I.loc - U.loc);
3553
- let { parent: o, key: m } = e, y = u && m === "body" && (o.type === "InterfaceDeclaration" || o.type === "DeclareInterface" || o.type === "DeclareClass"), D = s.type === "TSInterfaceBody" || i || y || s.type === "ObjectPattern" && o.type !== "FunctionDeclaration" && o.type !== "FunctionExpression" && o.type !== "ArrowFunctionExpression" && o.type !== "ObjectMethod" && o.type !== "ClassMethod" && o.type !== "ClassPrivateMethod" && o.type !== "AssignmentPattern" && o.type !== "CatchClause" && s.properties.some((I) => I.value && (I.value.type === "ObjectPattern" || I.value.type === "ArrayPattern")) || s.type !== "ObjectPattern" && p.length > 0 && Te(t.originalText, q(s), p[0].loc), C = y ? ";" : s.type === "TSInterfaceBody" || s.type === "TSTypeLiteral" ? B(n, ";") : ",", c = s.type === "RecordExpression" ? "#{" : s.exact ? "{|" : "{", A = s.exact ? "|}" : "}", T = [], S = p.map((I) => {
3554
- let U = [...T, l(I.printed)];
3555
- return T = [C, x], (I.node.type === "TSPropertySignature" || I.node.type === "TSMethodSignature" || I.node.type === "TSConstructSignatureDeclaration" || I.node.type === "TSCallSignatureDeclaration") && d(I.node, h.PrettierIgnore) && T.shift(), pe(I.node, t) && T.push(F), U;
3556
- });
3557
- if (s.inexact || s.hasUnknownMembers) {
3558
- let I;
3559
- if (d(s, h.Dangling)) {
3560
- let U = d(s, h.Line);
3561
- I = [J(e, t), U || Z(t.originalText, k(_(false, ct(s), -1))) ? F : x, "..."];
3562
- } else I = ["..."];
3563
- S.push([...T, ...I]);
3564
- }
3565
- let g = (j = _(false, p, -1)) == null ? void 0 : j.node, M = !(s.inexact || s.hasUnknownMembers || g && (g.type === "RestElement" || (g.type === "TSPropertySignature" || g.type === "TSCallSignatureDeclaration" || g.type === "TSMethodSignature" || g.type === "TSConstructSignatureDeclaration") && d(g, h.PrettierIgnore))), R;
3566
- if (S.length === 0) {
3567
- if (!d(s, h.Dangling)) return [c, A, N(e, r)];
3568
- R = l([c, J(e, t, { indent: true }), E, A, $(e), N(e, r)]);
3569
- } else R = [y && O(s.properties) ? ta(o) : "", c, f([t.bracketSpacing ? x : E, ...S]), B(M && (C !== "," || ae(t)) ? C : ""), t.bracketSpacing ? x : E, A, $(e), N(e, r)];
3570
- return e.match((I) => I.type === "ObjectPattern" && !O(I.decorators), Is) || we(s) && (e.match(void 0, (I, U) => U === "typeAnnotation", (I, U) => U === "typeAnnotation", Is) || e.match(void 0, (I, U) => I.type === "FunctionTypeParam" && U === "typeAnnotation", Is)) || !D && e.match((I) => I.type === "ObjectPattern", (I) => I.type === "AssignmentExpression" || I.type === "VariableDeclarator") ? R : l(R, { shouldBreak: D });
3571
- }
3572
- function Is(e, t) {
3573
- return (t === "params" || t === "parameters" || t === "this" || t === "rest") && Cs(e);
3574
- }
3575
- function Wl(e) {
3576
- let t = [e];
3577
- for (let r = 0; r < t.length; r++) {
3578
- let n = t[r];
3579
- for (let s of ["test", "consequent", "alternate"]) {
3580
- let u = n[s];
3581
- if (H(u)) return true;
3582
- u.type === "ConditionalExpression" && t.push(u);
3583
- }
3584
- }
3585
- return false;
3586
- }
3587
- function Gl(e, t, r) {
3588
- let { node: n } = e, s = n.type === "ConditionalExpression", u = s ? "alternate" : "falseType", { parent: i } = e, a = s ? r("test") : [r("checkType"), " ", "extends", " ", r("extendsType")];
3589
- return i.type === n.type && i[u] === n ? he(2, a) : a;
3590
- }
3591
- var Ul = /* @__PURE__ */ new Map([["AssignmentExpression", "right"], ["VariableDeclarator", "init"], ["ReturnStatement", "argument"], ["ThrowStatement", "argument"], ["UnaryExpression", "argument"], ["YieldExpression", "argument"], ["AwaitExpression", "argument"]]);
3592
- function Xl(e) {
3593
- let { node: t } = e;
3594
- if (t.type !== "ConditionalExpression") return false;
3595
- let r, n = t;
3596
- for (let s = 0; !r; s++) {
3597
- let u = e.getParentNode(s);
3598
- if (u.type === "ChainExpression" && u.expression === n || L(u) && u.callee === n || W(u) && u.object === n || u.type === "TSNonNullExpression" && u.expression === n) {
3599
- n = u;
3600
- continue;
3601
- }
3602
- u.type === "NewExpression" && u.callee === n || Ae(u) && u.expression === n ? (r = e.getParentNode(s + 1), n = u) : r = u;
3603
- }
3604
- return n === t ? false : r[Ul.get(r.type)] === n;
3605
- }
3606
- function Ta(e, t, r) {
3607
- let { node: n } = e, s = n.type === "ConditionalExpression", u = s ? "consequent" : "trueType", i = s ? "alternate" : "falseType", a = s ? ["test"] : ["checkType", "extendsType"], p = n[u], o = n[i], m = [], y = false, { parent: D } = e, C = D.type === n.type && a.some((G) => D[G] === n), c = D.type === n.type && !C, A, T, S = 0;
3608
- do
3609
- T = A || n, A = e.getParentNode(S), S++;
3610
- while (A && A.type === n.type && a.every((G) => A[G] !== T));
3611
- let g = A || D, M = T;
3612
- if (s && (H(n[a[0]]) || H(p) || H(o) || Wl(M))) {
3613
- y = true, c = true;
3614
- let G = (Q) => [B("("), f([E, Q]), E, B(")")], ue = (Q) => Q.type === "NullLiteral" || Q.type === "Literal" && Q.value === null || Q.type === "Identifier" && Q.name === "undefined";
3615
- m.push(" ? ", ue(p) ? r(u) : G(r(u)), " : ", o.type === n.type || ue(o) ? r(i) : G(r(i)));
3616
- } else {
3617
- let G = (Q) => t.useTabs ? f(r(Q)) : he(2, r(Q)), ue = [x, "? ", p.type === n.type ? B("", "(") : "", G(u), p.type === n.type ? B("", ")") : "", x, ": ", G(i)];
3618
- m.push(D.type !== n.type || D[i] === n || C ? ue : t.useTabs ? Mr(f(ue)) : he(Math.max(0, t.tabWidth - 2), ue));
3619
- }
3620
- let R = [u, i, ...a].some((G) => d(n[G], (ue) => ee(ue) && Te(t.originalText, q(ue), k(ue)))), j = (G) => D === g ? l(G, { shouldBreak: R }) : R ? [G, Ee] : G, I = !y && (W(D) || D.type === "NGPipeExpression" && D.left === n) && !D.computed, U = Xl(e), P = j([Gl(e, t, r), c ? m : f(m), s && I && !U ? E : ""]);
3621
- return C || U ? l([f([E, P]), E]) : P;
3622
- }
3623
- function Yl(e, t) {
3624
- return (W(t) || t.type === "NGPipeExpression" && t.left === e) && !t.computed;
3625
- }
3626
- function Hl(e, t, r, n) {
3627
- return [...e.map((u) => ct(u)), ct(t), ct(r)].flat().some((u) => ee(u) && Te(n.originalText, q(u), k(u)));
3628
- }
3629
- var Nl = /* @__PURE__ */ new Map([["AssignmentExpression", "right"], ["VariableDeclarator", "init"], ["ReturnStatement", "argument"], ["ThrowStatement", "argument"], ["UnaryExpression", "argument"], ["YieldExpression", "argument"], ["AwaitExpression", "argument"]]);
3630
- function Vl(e) {
3631
- let { node: t } = e;
3632
- if (t.type !== "ConditionalExpression") return false;
3633
- let r, n = t;
3634
- for (let s = 0; !r; s++) {
3635
- let u = e.getParentNode(s);
3636
- if (u.type === "ChainExpression" && u.expression === n || L(u) && u.callee === n || W(u) && u.object === n || u.type === "TSNonNullExpression" && u.expression === n) {
3637
- n = u;
3638
- continue;
3639
- }
3640
- u.type === "NewExpression" && u.callee === n || Ae(u) && u.expression === n ? (r = e.getParentNode(s + 1), n = u) : r = u;
3641
- }
3642
- return n === t ? false : r[Nl.get(r.type)] === n;
3643
- }
3644
- var Ls = (e) => [B("("), f([E, e]), E, B(")")];
3645
- function Kt(e, t, r, n) {
3646
- if (!t.experimentalTernaries) return Ta(e, t, r);
3647
- let { node: s } = e, u = s.type === "ConditionalExpression", i = s.type === "TSConditionalType" || s.type === "ConditionalTypeAnnotation", a = u ? "consequent" : "trueType", p = u ? "alternate" : "falseType", o = u ? ["test"] : ["checkType", "extendsType"], m = s[a], y = s[p], D = o.map((qe) => s[qe]), { parent: C } = e, c = C.type === s.type, A = c && o.some((qe) => C[qe] === s), T = c && C[p] === s, S = m.type === s.type, g = y.type === s.type, M = g || T, R = t.tabWidth > 2 || t.useTabs, j, I, U = 0;
3648
- do
3649
- I = j || s, j = e.getParentNode(U), U++;
3650
- while (j && j.type === s.type && o.every((qe) => j[qe] !== I));
3651
- let P = j || C, G = n && n.assignmentLayout && n.assignmentLayout !== "break-after-operator" && (C.type === "AssignmentExpression" || C.type === "VariableDeclarator" || C.type === "ClassProperty" || C.type === "PropertyDefinition" || C.type === "ClassPrivateProperty" || C.type === "ObjectProperty" || C.type === "Property"), ue = (C.type === "ReturnStatement" || C.type === "ThrowStatement") && !(S || g), Q = u && P.type === "JSXExpressionContainer" && e.grandparent.type !== "JSXAttribute", gt = Vl(e), Ft = Yl(s, C), w = i && Be(e, t), ne = R ? t.useTabs ? " " : " ".repeat(t.tabWidth - 1) : "", de = Hl(D, m, y, t) || S || g, ot = !M && !c && !i && (Q ? m.type === "NullLiteral" || m.type === "Literal" && m.value === null : nr(m, t) && Mn(s.test, 3)), St = M || T || i && !c || c && u && Mn(s.test, 1) || ot, js = [];
3652
- !S && d(m, h.Dangling) && e.call((qe) => {
3653
- js.push(J(qe, t), F);
3654
- }, "consequent");
3655
- let Qt = [];
3656
- d(s.test, h.Dangling) && e.call((qe) => {
3657
- Qt.push(J(qe, t));
3658
- }, "test"), !g && d(y, h.Dangling) && e.call((qe) => {
3659
- Qt.push(J(qe, t));
3660
- }, "alternate"), d(s, h.Dangling) && Qt.push(J(e, t));
3661
- let vs = Symbol("test"), qa = Symbol("consequent"), Fr = Symbol("test-and-consequent"), Wa = u ? [Ls(r("test")), s.test.type === "ConditionalExpression" ? Ee : ""] : [r("checkType"), " ", "extends", " ", s.extendsType.type === "TSConditionalType" || s.extendsType.type === "ConditionalTypeAnnotation" || s.extendsType.type === "TSMappedType" ? r("extendsType") : l(Ls(r("extendsType")))], Ms = l([Wa, " ?"], { id: vs }), Ga = r(a), Cr = f([S || Q && (H(m) || c || M) ? F : x, js, Ga]), Ua = St ? l([Ms, M ? Cr : B(Cr, l(Cr, { id: qa }), { groupId: vs })], { id: Fr }) : [Ms, Cr], kn = r(p), Rs = ot ? B(kn, Mr(Ls(kn)), { groupId: Fr }) : kn, zt = [Ua, Qt.length > 0 ? [f([F, Qt]), F] : g ? F : ot ? B(x, " ", { groupId: Fr }) : x, ":", g ? " " : R ? St ? B(ne, B(M || ot ? " " : ne, " "), { groupId: Fr }) : B(ne, " ") : " ", g ? Rs : l([f(Rs), Q && !ot ? E : ""]), Ft && !gt ? E : "", de ? Ee : ""];
3662
- return G && !de ? l(f([E, l(zt)])) : G || ue ? l(f(zt)) : gt || i && A ? l([f([E, zt]), w ? E : ""]) : C === P ? l(zt) : zt;
3663
- }
3664
- function da(e, t, r, n) {
3665
- let { node: s } = e;
3666
- if (kr(s)) return ma(e, t);
3667
- let u = t.semi ? ";" : "", i = [];
3668
- switch (s.type) {
3669
- case "JsExpressionRoot":
3670
- return r("node");
3671
- case "JsonRoot":
3672
- return [r("node"), F];
3673
- case "File":
3674
- return pa(e, t, r) ?? r("program");
3675
- case "EmptyStatement":
3676
- return "";
3677
- case "ExpressionStatement":
3678
- return oa(e, t, r);
3679
- case "ChainExpression":
3680
- return r("expression");
3681
- case "ParenthesizedExpression":
3682
- return !d(s.expression) && (se(s.expression) || X(s.expression)) ? ["(", r("expression"), ")"] : l(["(", f([E, r("expression")]), E, ")"]);
3683
- case "AssignmentExpression":
3684
- return Oi(e, t, r);
3685
- case "VariableDeclarator":
3686
- return _i(e, t, r);
3687
- case "BinaryExpression":
3688
- case "LogicalExpression":
3689
- return Nr(e, t, r);
3690
- case "AssignmentPattern":
3691
- return [r("left"), " = ", r("right")];
3692
- case "OptionalMemberExpression":
3693
- case "MemberExpression":
3694
- return Pi(e, t, r);
3695
- case "MetaProperty":
3696
- return [r("meta"), ".", r("property")];
3697
- case "BindExpression":
3698
- return s.object && i.push(r("object")), i.push(l(f([E, Vr(e, t, r)]))), i;
3699
- case "Identifier":
3700
- return [s.name, $(e), cn(e), N(e, r)];
3701
- case "V8IntrinsicIdentifier":
3702
- return ["%", s.name];
3703
- case "SpreadElement":
3704
- case "SpreadElementPattern":
3705
- case "SpreadPropertyPattern":
3706
- case "RestElement":
3707
- return ln(e, r);
3708
- case "FunctionDeclaration":
3709
- case "FunctionExpression":
3710
- return Dn(e, r, t, n);
3711
- case "ArrowFunctionExpression":
3712
- return $i(e, t, r, n);
3713
- case "YieldExpression":
3714
- return i.push("yield"), s.delegate && i.push("*"), s.argument && i.push(" ", r("argument")), i;
3715
- case "AwaitExpression":
3716
- if (i.push("await"), s.argument) {
3717
- i.push(" ", r("argument"));
3718
- let { parent: a } = e;
3719
- if (L(a) && a.callee === s || W(a) && a.object === s) {
3720
- i = [f([E, ...i]), E];
3721
- let p = e.findAncestor((o) => o.type === "AwaitExpression" || o.type === "BlockStatement");
3722
- if ((p == null ? void 0 : p.type) !== "AwaitExpression" || !ie(p.argument, (o) => o === s)) return l(i);
3723
- }
3724
- }
3725
- return i;
3726
- case "ExportDefaultDeclaration":
3727
- case "ExportNamedDeclaration":
3728
- case "ExportAllDeclaration":
3729
- return gn(e, t, r);
3730
- case "ImportDeclaration":
3731
- return ya(e, t, r);
3732
- case "ImportSpecifier":
3733
- case "ExportSpecifier":
3734
- case "ImportNamespaceSpecifier":
3735
- case "ExportNamespaceSpecifier":
3736
- case "ImportDefaultSpecifier":
3737
- case "ExportDefaultSpecifier":
3738
- return Aa(e, t, r);
3739
- case "ImportAttribute":
3740
- return yn(e, t, r);
3741
- case "Program":
3742
- case "BlockStatement":
3743
- case "StaticBlock":
3744
- return Fn(e, t, r);
3745
- case "ClassBody":
3746
- return na(e, t, r);
3747
- case "ThrowStatement":
3748
- return Hi(e, t, r);
3749
- case "ReturnStatement":
3750
- return Yi(e, t, r);
3751
- case "NewExpression":
3752
- case "ImportExpression":
3753
- case "OptionalCallExpression":
3754
- case "CallExpression":
3755
- return $r(e, t, r);
3756
- case "ObjectExpression":
3757
- case "ObjectPattern":
3758
- case "RecordExpression":
3759
- return ht(e, t, r);
3760
- case "Property":
3761
- return bt(s) ? yr(e, t, r) : yn(e, t, r);
3762
- case "ObjectProperty":
3763
- return yn(e, t, r);
3764
- case "ObjectMethod":
3765
- return yr(e, t, r);
3766
- case "Decorator":
3767
- return ["@", r("expression")];
3768
- case "ArrayExpression":
3769
- case "ArrayPattern":
3770
- case "TupleExpression":
3771
- return Vt(e, t, r);
3772
- case "SequenceExpression": {
3773
- let { parent: a } = e;
3774
- if (a.type === "ExpressionStatement" || a.type === "ForStatement") {
3775
- let p = [];
3776
- return e.each(({ isFirst: o }) => {
3777
- o ? p.push(r()) : p.push(",", f([x, r()]));
3778
- }, "expressions"), l(p);
3779
- }
3780
- return l(b([",", x], e.map(r, "expressions")));
3781
- }
3782
- case "ThisExpression":
3783
- return "this";
3784
- case "Super":
3785
- return "super";
3786
- case "Directive":
3787
- return [r("value"), u];
3788
- case "UnaryExpression":
3789
- return i.push(s.operator), /[a-z]$/u.test(s.operator) && i.push(" "), d(s.argument) ? i.push(l(["(", f([E, r("argument")]), E, ")"])) : i.push(r("argument")), i;
3790
- case "UpdateExpression":
3791
- return [s.prefix ? s.operator : "", r("argument"), s.prefix ? "" : s.operator];
3792
- case "ConditionalExpression":
3793
- return Kt(e, t, r, n);
3794
- case "VariableDeclaration": {
3795
- let a = e.map(r, "declarations"), p = e.parent, o = p.type === "ForStatement" || p.type === "ForInStatement" || p.type === "ForOfStatement", m = s.declarations.some((D) => D.init), y;
3796
- return a.length === 1 && !d(s.declarations[0]) ? y = a[0] : a.length > 0 && (y = f(a[0])), i = [K(e), s.kind, y ? [" ", y] : "", f(a.slice(1).map((D) => [",", m && !o ? F : x, D]))], o && p.body !== s || i.push(u), l(i);
3797
- }
3798
- case "WithStatement":
3799
- return l(["with (", r("object"), ")", Dt(s.body, r("body"))]);
3800
- case "IfStatement": {
3801
- let a = Dt(s.consequent, r("consequent")), p = l(["if (", l([f([E, r("test")]), E]), ")", a]);
3802
- if (i.push(p), s.alternate) {
3803
- let o = d(s.consequent, h.Trailing | h.Line) || wr(s), m = s.consequent.type === "BlockStatement" && !o;
3804
- i.push(m ? " " : F), d(s, h.Dangling) && i.push(J(e, t), o ? F : " "), i.push("else", l(Dt(s.alternate, r("alternate"), s.alternate.type === "IfStatement")));
3805
- }
3806
- return i;
3807
- }
3808
- case "ForStatement": {
3809
- let a = Dt(s.body, r("body")), p = J(e, t), o = p ? [p, E] : "";
3810
- return !s.init && !s.test && !s.update ? [o, l(["for (;;)", a])] : [o, l(["for (", l([f([E, r("init"), ";", x, r("test"), ";", x, r("update")]), E]), ")", a])];
3811
- }
3812
- case "WhileStatement":
3813
- return l(["while (", l([f([E, r("test")]), E]), ")", Dt(s.body, r("body"))]);
3814
- case "ForInStatement":
3815
- return l(["for (", r("left"), " in ", r("right"), ")", Dt(s.body, r("body"))]);
3816
- case "ForOfStatement":
3817
- return l(["for", s.await ? " await" : "", " (", r("left"), " of ", r("right"), ")", Dt(s.body, r("body"))]);
3818
- case "DoWhileStatement": {
3819
- let a = Dt(s.body, r("body"));
3820
- return i = [l(["do", a])], s.body.type === "BlockStatement" ? i.push(" ") : i.push(F), i.push("while (", l([f([E, r("test")]), E]), ")", u), i;
3821
- }
3822
- case "DoExpression":
3823
- return [s.async ? "async " : "", "do ", r("body")];
3824
- case "BreakStatement":
3825
- case "ContinueStatement":
3826
- return i.push(s.type === "BreakStatement" ? "break" : "continue"), s.label && i.push(" ", r("label")), i.push(u), i;
3827
- case "LabeledStatement":
3828
- return s.body.type === "EmptyStatement" ? [r("label"), ":;"] : [r("label"), ": ", r("body")];
3829
- case "TryStatement":
3830
- return ["try ", r("block"), s.handler ? [" ", r("handler")] : "", s.finalizer ? [" finally ", r("finalizer")] : ""];
3831
- case "CatchClause":
3832
- if (s.param) {
3833
- let a = d(s.param, (o) => !ee(o) || o.leading && Z(t.originalText, k(o)) || o.trailing && Z(t.originalText, q(o), { backwards: true })), p = r("param");
3834
- return ["catch ", a ? ["(", f([E, p]), E, ") "] : ["(", p, ") "], r("body")];
3835
- }
3836
- return ["catch ", r("body")];
3837
- case "SwitchStatement":
3838
- return [l(["switch (", f([E, r("discriminant")]), E, ")"]), " {", s.cases.length > 0 ? f([F, b(F, e.map(({ node: a, isLast: p }) => [r(), !p && pe(a, t) ? F : ""], "cases"))]) : "", F, "}"];
3839
- case "SwitchCase": {
3840
- s.test ? i.push("case ", r("test"), ":") : i.push("default:"), d(s, h.Dangling) && i.push(" ", J(e, t));
3841
- let a = s.consequent.filter((p) => p.type !== "EmptyStatement");
3842
- if (a.length > 0) {
3843
- let p = Dr(e, t, r, "consequent");
3844
- i.push(a.length === 1 && a[0].type === "BlockStatement" ? [" ", p] : f([F, p]));
3845
- }
3846
- return i;
3847
- }
3848
- case "DebuggerStatement":
3849
- return ["debugger", u];
3850
- case "ClassDeclaration":
3851
- case "ClassExpression":
3852
- return Tn(e, t, r);
3853
- case "ClassMethod":
3854
- case "ClassPrivateMethod":
3855
- case "MethodDefinition":
3856
- return dn(e, t, r);
3857
- case "ClassProperty":
3858
- case "PropertyDefinition":
3859
- case "ClassPrivateProperty":
3860
- case "ClassAccessorProperty":
3861
- case "AccessorProperty":
3862
- return xn(e, t, r);
3863
- case "TemplateElement":
3864
- return Ie(s.value.raw);
3865
- case "TemplateLiteral":
3866
- return Wr(e, r, t);
3867
- case "TaggedTemplateExpression":
3868
- return Xu(e, r);
3869
- case "PrivateIdentifier":
3870
- return ["#", s.name];
3871
- case "PrivateName":
3872
- return ["#", r("id")];
3873
- case "TopicReference":
3874
- return "%";
3875
- case "ArgumentPlaceholder":
3876
- return "?";
3877
- case "ModuleExpression":
3878
- return ["module ", r("body")];
3879
- case "InterpreterDirective":
3880
- default:
3881
- throw new Me(s, "ESTree");
3882
- }
3883
- }
3884
- function Sn(e, t, r) {
3885
- let { parent: n, node: s, key: u } = e, i = [r("expression")];
3886
- switch (s.type) {
3887
- case "AsConstExpression":
3888
- i.push(" as const");
3889
- break;
3890
- case "AsExpression":
3891
- case "TSAsExpression":
3892
- i.push(" as ", r("typeAnnotation"));
3893
- break;
3894
- case "SatisfiesExpression":
3895
- case "TSSatisfiesExpression":
3896
- i.push(" satisfies ", r("typeAnnotation"));
3897
- break;
3898
- }
3899
- return u === "callee" && L(n) || u === "object" && W(n) ? l([f([E, ...i]), E]) : i;
3900
- }
3901
- function xa(e, t, r) {
3902
- let { node: n } = e, s = [K(e), "component"];
3903
- n.id && s.push(" ", r("id")), s.push(r("typeParameters"));
3904
- let u = $l(e, r, t);
3905
- return n.rendersType ? s.push(l([u, " ", r("rendersType")])) : s.push(l([u])), n.body && s.push(" ", r("body")), t.semi && n.type === "DeclareComponent" && s.push(";"), s;
3906
- }
3907
- function $l(e, t, r) {
3908
- let { node: n } = e, s = n.params;
3909
- if (n.rest && (s = [...s, n.rest]), s.length === 0) return ["(", J(e, r, { filter: (i) => ge(r.originalText, k(i)) === ")" }), ")"];
3910
- let u = [];
3911
- return Ql(e, (i, a) => {
3912
- let p = a === s.length - 1;
3913
- p && n.rest && u.push("..."), u.push(t()), !p && (u.push(","), pe(s[a], r) ? u.push(F, F) : u.push(x));
3914
- }), ["(", f([E, ...u]), B(ae(r, "all") && !Kl(n, s) ? "," : ""), E, ")"];
3915
- }
3916
- function Kl(e, t) {
3917
- var r;
3918
- return e.rest || ((r = _(false, t, -1)) == null ? void 0 : r.type) === "RestElement";
3919
- }
3920
- function Ql(e, t) {
3921
- let { node: r } = e, n = 0, s = (u) => t(u, n++);
3922
- e.each(s, "params"), r.rest && e.call(s, "rest");
3923
- }
3924
- function ha(e, t, r) {
3925
- let { node: n } = e;
3926
- return n.shorthand ? r("local") : [r("name"), " as ", r("local")];
3927
- }
3928
- function ga(e, t, r) {
3929
- let { node: n } = e, s = [];
3930
- return n.name && s.push(r("name"), n.optional ? "?: " : ": "), s.push(r("typeAnnotation")), s;
3931
- }
3932
- function Sa(e, t, r) {
3933
- return ht(e, r, t);
3934
- }
3935
- function Bn(e, t) {
3936
- let { node: r } = e, n = t("id");
3937
- r.computed && (n = ["[", n, "]"]);
3938
- let s = "";
3939
- return r.initializer && (s = t("initializer")), r.init && (s = t("init")), s ? [n, " = ", s] : n;
3940
- }
3941
- function Ba(e, t, r) {
3942
- let { node: n } = e, s;
3943
- if (n.type === "EnumSymbolBody" || n.explicitType) switch (n.type) {
3944
- case "EnumBooleanBody":
3945
- s = "boolean";
3946
- break;
3947
- case "EnumNumberBody":
3948
- s = "number";
3949
- break;
3950
- case "EnumBigIntBody":
3951
- s = "bigint";
3952
- break;
3953
- case "EnumStringBody":
3954
- s = "string";
3955
- break;
3956
- case "EnumSymbolBody":
3957
- s = "symbol";
3958
- break;
3959
- }
3960
- return [s ? `of ${s} ` : "", Sa(e, t, r)];
3961
- }
3962
- function bn(e, t, r) {
3963
- let { node: n } = e;
3964
- return [K(e), n.const ? "const " : "", "enum ", t("id"), " ", n.type === "TSEnumDeclaration" ? Sa(e, t, r) : t("body")];
3965
- }
3966
- function Pa(e, t, r) {
3967
- let { node: n } = e, s = ["hook"];
3968
- n.id && s.push(" ", r("id"));
3969
- let u = Je(e, r, t, false, true), i = $t(e, r), a = at(n, i);
3970
- return s.push(l([a ? l(u) : u, i]), n.body ? " " : "", r("body")), s;
3971
- }
3972
- function ka(e, t, r) {
3973
- let { node: n } = e, s = [K(e), "hook"];
3974
- return n.id && s.push(" ", r("id")), t.semi && s.push(";"), s;
3975
- }
3976
- function ba(e) {
3977
- var r;
3978
- let { node: t } = e;
3979
- return t.type === "HookTypeAnnotation" && ((r = e.getParentNode(2)) == null ? void 0 : r.type) === "DeclareHook";
3980
- }
3981
- function Ia(e, t, r) {
3982
- let { node: n } = e, s = [];
3983
- s.push(ba(e) ? "" : "hook ");
3984
- let u = Je(e, r, t, false, true), i = [];
3985
- return i.push(ba(e) ? ": " : " => ", r("returnType")), at(n, i) && (u = l(u)), s.push(u, i), l(s);
3986
- }
3987
- function Pn(e, t, r) {
3988
- let { node: n } = e, s = [K(e), "interface"], u = [], i = [];
3989
- n.type !== "InterfaceTypeAnnotation" && u.push(" ", r("id"), r("typeParameters"));
3990
- let a = n.typeParameters && !d(n.typeParameters, h.Trailing | h.Line);
3991
- return O(n.extends) && i.push(a ? B(" ", x, { groupId: fr(n.typeParameters) }) : x, "extends ", (n.extends.length === 1 ? yu : f)(b([",", x], e.map(r, "extends")))), d(n.id, h.Trailing) || O(n.extends) ? a ? s.push(l([...u, f(i)])) : s.push(l(f([...u, ...i]))) : s.push(...u, ...i), s.push(" ", r("body")), l(s);
3992
- }
3993
- function La(e, t, r) {
3994
- let { node: n } = e;
3995
- if (Sr(n)) return n.type.slice(0, -14).toLowerCase();
3996
- let s = t.semi ? ";" : "";
3997
- switch (n.type) {
3998
- case "ComponentDeclaration":
3999
- case "DeclareComponent":
4000
- case "ComponentTypeAnnotation":
4001
- return xa(e, t, r);
4002
- case "ComponentParameter":
4003
- return ha(e, t, r);
4004
- case "ComponentTypeParameter":
4005
- return ga(e, t, r);
4006
- case "HookDeclaration":
4007
- return Pa(e, t, r);
4008
- case "DeclareHook":
4009
- return ka(e, t, r);
4010
- case "HookTypeAnnotation":
4011
- return Ia(e, t, r);
4012
- case "DeclareClass":
4013
- return Tn(e, t, r);
4014
- case "DeclareFunction":
4015
- return [K(e), "function ", r("id"), r("predicate"), s];
4016
- case "DeclareModule":
4017
- return ["declare module ", r("id"), " ", r("body")];
4018
- case "DeclareModuleExports":
4019
- return ["declare module.exports", N(e, r), s];
4020
- case "DeclareNamespace":
4021
- return ["declare namespace ", r("id"), " ", r("body")];
4022
- case "DeclareVariable":
4023
- return [K(e), n.kind ?? "var", " ", r("id"), s];
4024
- case "DeclareExportDeclaration":
4025
- case "DeclareExportAllDeclaration":
4026
- return gn(e, t, r);
4027
- case "DeclareOpaqueType":
4028
- case "OpaqueType":
4029
- return Ri(e, t, r);
4030
- case "DeclareTypeAlias":
4031
- case "TypeAlias":
4032
- return Qr(e, t, r);
4033
- case "IntersectionTypeAnnotation":
4034
- return zr(e, t, r);
4035
- case "UnionTypeAnnotation":
4036
- return Zr(e, t, r);
4037
- case "ConditionalTypeAnnotation":
4038
- return Kt(e, t, r);
4039
- case "InferTypeAnnotation":
4040
- return rn(e, t, r);
4041
- case "FunctionTypeAnnotation":
4042
- return en(e, t, r);
4043
- case "TupleTypeAnnotation":
4044
- return Vt(e, t, r);
4045
- case "TupleTypeLabeledElement":
4046
- return sn(e, t, r);
4047
- case "TupleTypeSpreadElement":
4048
- return nn(e, t, r);
4049
- case "GenericTypeAnnotation":
4050
- return [r("id"), Lt(e, t, r, "typeParameters")];
4051
- case "IndexedAccessType":
4052
- case "OptionalIndexedAccessType":
4053
- return tn(e, t, r);
4054
- case "TypeAnnotation":
4055
- return un(e, t, r);
4056
- case "TypeParameter":
4057
- return An(e, t, r);
4058
- case "TypeofTypeAnnotation":
4059
- return on(e, r);
4060
- case "ExistsTypeAnnotation":
4061
- return "*";
4062
- case "ArrayTypeAnnotation":
4063
- return an(r);
4064
- case "DeclareEnum":
4065
- case "EnumDeclaration":
4066
- return bn(e, r, t);
4067
- case "EnumBooleanBody":
4068
- case "EnumNumberBody":
4069
- case "EnumBigIntBody":
4070
- case "EnumStringBody":
4071
- case "EnumSymbolBody":
4072
- return Ba(e, r, t);
4073
- case "EnumBooleanMember":
4074
- case "EnumNumberMember":
4075
- case "EnumBigIntMember":
4076
- case "EnumStringMember":
4077
- case "EnumDefaultedMember":
4078
- return Bn(e, r);
4079
- case "FunctionTypeParam": {
4080
- let u = n.name ? r("name") : e.parent.this === n ? "this" : "";
4081
- return [u, $(e), u ? ": " : "", r("typeAnnotation")];
4082
- }
4083
- case "DeclareInterface":
4084
- case "InterfaceDeclaration":
4085
- case "InterfaceTypeAnnotation":
4086
- return Pn(e, t, r);
4087
- case "ClassImplements":
4088
- case "InterfaceExtends":
4089
- return [r("id"), r("typeParameters")];
4090
- case "NullableTypeAnnotation":
4091
- return ["?", r("typeAnnotation")];
4092
- case "Variance": {
4093
- let { kind: u } = n;
4094
- return vt.ok(u === "plus" || u === "minus"), u === "plus" ? "+" : "-";
4095
- }
4096
- case "KeyofTypeAnnotation":
4097
- return ["keyof ", r("argument")];
4098
- case "ObjectTypeCallProperty":
4099
- return [n.static ? "static " : "", r("value")];
4100
- case "ObjectTypeMappedTypeProperty":
4101
- return Qi(e, t, r);
4102
- case "ObjectTypeIndexer":
4103
- return [n.static ? "static " : "", n.variance ? r("variance") : "", "[", r("id"), n.id ? ": " : "", r("key"), "]: ", r("value")];
4104
- case "ObjectTypeProperty": {
4105
- let u = "";
4106
- return n.proto ? u = "proto " : n.static && (u = "static "), [u, n.kind !== "init" ? n.kind + " " : "", n.variance ? r("variance") : "", Et(e, t, r), $(e), bt(n) ? "" : ": ", r("value")];
4107
- }
4108
- case "ObjectTypeAnnotation":
4109
- return ht(e, t, r);
4110
- case "ObjectTypeInternalSlot":
4111
- return [n.static ? "static " : "", "[[", r("id"), "]]", $(e), n.method ? "" : ": ", r("value")];
4112
- case "ObjectTypeSpreadProperty":
4113
- return ln(e, r);
4114
- case "QualifiedTypeofIdentifier":
4115
- case "QualifiedTypeIdentifier":
4116
- return [r("qualification"), ".", r("id")];
4117
- case "NullLiteralTypeAnnotation":
4118
- return "null";
4119
- case "BooleanLiteralTypeAnnotation":
4120
- return String(n.value);
4121
- case "StringLiteralTypeAnnotation":
4122
- return Ie(Ze(fe(n), t));
4123
- case "NumberLiteralTypeAnnotation":
4124
- return ft(n.raw ?? n.extra.raw);
4125
- case "BigIntLiteralTypeAnnotation":
4126
- return hn(n.raw ?? n.extra.raw);
4127
- case "TypeCastExpression":
4128
- return ["(", r("expression"), N(e, r), ")"];
4129
- case "TypePredicate":
4130
- return pn(e, r);
4131
- case "TypeOperator":
4132
- return [n.operator, " ", r("typeAnnotation")];
4133
- case "TypeParameterDeclaration":
4134
- case "TypeParameterInstantiation":
4135
- return Lt(e, t, r, "params");
4136
- case "InferredPredicate":
4137
- case "DeclaredPredicate":
4138
- return [e.key === "predicate" && e.parent.type !== "DeclareFunction" && !e.parent.returnType ? ": " : " ", "%checks", ...n.type === "DeclaredPredicate" ? ["(", r("value"), ")"] : []];
4139
- case "AsExpression":
4140
- case "AsConstExpression":
4141
- case "SatisfiesExpression":
4142
- return Sn(e, t, r);
4143
- }
4144
- }
4145
- function wa(e, t, r) {
4146
- var i;
4147
- let { node: n } = e;
4148
- if (!n.type.startsWith("TS")) return;
4149
- if (Br(n)) return n.type.slice(2, -7).toLowerCase();
4150
- let s = t.semi ? ";" : "", u = [];
4151
- switch (n.type) {
4152
- case "TSThisType":
4153
- return "this";
4154
- case "TSTypeAssertion": {
4155
- let a = !(X(n.expression) || se(n.expression)), p = l(["<", f([E, r("typeAnnotation")]), E, ">"]), o = [B("("), f([E, r("expression")]), E, B(")")];
4156
- return a ? Ke([[p, r("expression")], [p, l(o, { shouldBreak: true })], [p, r("expression")]]) : l([p, r("expression")]);
4157
- }
4158
- case "TSDeclareFunction":
4159
- return Dn(e, r, t);
4160
- case "TSExportAssignment":
4161
- return ["export = ", r("expression"), s];
4162
- case "TSModuleBlock":
4163
- return Fn(e, t, r);
4164
- case "TSInterfaceBody":
4165
- case "TSTypeLiteral":
4166
- return ht(e, t, r);
4167
- case "TSTypeAliasDeclaration":
4168
- return Qr(e, t, r);
4169
- case "TSQualifiedName":
4170
- return [r("left"), ".", r("right")];
4171
- case "TSAbstractMethodDefinition":
4172
- case "TSDeclareMethod":
4173
- return dn(e, t, r);
4174
- case "TSAbstractAccessorProperty":
4175
- case "TSAbstractPropertyDefinition":
4176
- return xn(e, t, r);
4177
- case "TSInterfaceHeritage":
4178
- case "TSClassImplements":
4179
- case "TSExpressionWithTypeArguments":
4180
- case "TSInstantiationExpression":
4181
- return [r("expression"), r(n.typeArguments ? "typeArguments" : "typeParameters")];
4182
- case "TSTemplateLiteralType":
4183
- return Wr(e, r, t);
4184
- case "TSNamedTupleMember":
4185
- return sn(e, t, r);
4186
- case "TSRestType":
4187
- return nn(e, t, r);
4188
- case "TSOptionalType":
4189
- return [r("typeAnnotation"), "?"];
4190
- case "TSInterfaceDeclaration":
4191
- return Pn(e, t, r);
4192
- case "TSTypeParameterDeclaration":
4193
- case "TSTypeParameterInstantiation":
4194
- return Lt(e, t, r, "params");
4195
- case "TSTypeParameter":
4196
- return An(e, t, r);
4197
- case "TSAsExpression":
4198
- case "TSSatisfiesExpression":
4199
- return Sn(e, t, r);
4200
- case "TSArrayType":
4201
- return an(r);
4202
- case "TSPropertySignature":
4203
- return [n.readonly ? "readonly " : "", Et(e, t, r), $(e), N(e, r)];
4204
- case "TSParameterProperty":
4205
- return [Nt(n), n.static ? "static " : "", n.override ? "override " : "", n.readonly ? "readonly " : "", r("parameter")];
4206
- case "TSTypeQuery":
4207
- return on(e, r);
4208
- case "TSIndexSignature": {
4209
- let a = n.parameters.length > 1 ? B(ae(t) ? "," : "") : "", p = l([f([E, b([", ", E], e.map(r, "parameters"))]), a, E]), o = e.parent.type === "ClassBody" && e.key === "body";
4210
- return [o && n.static ? "static " : "", n.readonly ? "readonly " : "", "[", n.parameters ? p : "", "]", N(e, r), o ? s : ""];
4211
- }
4212
- case "TSTypePredicate":
4213
- return pn(e, r);
4214
- case "TSNonNullExpression":
4215
- return [r("expression"), "!"];
4216
- case "TSImportType":
4217
- return ["import(", r("argument"), ")", n.qualifier ? [".", r("qualifier")] : "", Lt(e, t, r, n.typeArguments ? "typeArguments" : "typeParameters")];
4218
- case "TSLiteralType":
4219
- return r("literal");
4220
- case "TSIndexedAccessType":
4221
- return tn(e, t, r);
4222
- case "TSTypeOperator":
4223
- return [n.operator, " ", r("typeAnnotation")];
4224
- case "TSMappedType":
4225
- return zi(e, t, r);
4226
- case "TSMethodSignature": {
4227
- let a = n.kind && n.kind !== "method" ? `${n.kind} ` : "";
4228
- u.push(Nt(n), a, n.computed ? "[" : "", r("key"), n.computed ? "]" : "", $(e));
4229
- let p = Je(e, r, t, false, true), o = n.returnType ? "returnType" : "typeAnnotation", m = n[o], y = m ? N(e, r, o) : "", D = at(n, y);
4230
- return u.push(D ? l(p) : p), m && u.push(l(y)), l(u);
4231
- }
4232
- case "TSNamespaceExportDeclaration":
4233
- return ["export as namespace ", r("id"), t.semi ? ";" : ""];
4234
- case "TSEnumDeclaration":
4235
- return bn(e, r, t);
4236
- case "TSEnumMember":
4237
- return Bn(e, r);
4238
- case "TSImportEqualsDeclaration":
4239
- return [n.isExport ? "export " : "", "import ", ks(n, false), r("id"), " = ", r("moduleReference"), t.semi ? ";" : ""];
4240
- case "TSExternalModuleReference":
4241
- return ["require(", r("expression"), ")"];
4242
- case "TSModuleDeclaration": {
4243
- let { parent: a } = e, p = a.type === "TSModuleDeclaration", o = ((i = n.body) == null ? void 0 : i.type) === "TSModuleDeclaration";
4244
- return p ? u.push(".") : (u.push(K(e)), n.kind !== "global" && u.push(n.kind, " ")), u.push(r("id")), o ? u.push(r("body")) : n.body ? u.push(" ", l(r("body"))) : u.push(s), u;
4245
- }
4246
- case "TSConditionalType":
4247
- return Kt(e, t, r);
4248
- case "TSInferType":
4249
- return rn(e, t, r);
4250
- case "TSIntersectionType":
4251
- return zr(e, t, r);
4252
- case "TSUnionType":
4253
- return Zr(e, t, r);
4254
- case "TSFunctionType":
4255
- case "TSCallSignatureDeclaration":
4256
- case "TSConstructorType":
4257
- case "TSConstructSignatureDeclaration":
4258
- return en(e, t, r);
4259
- case "TSTupleType":
4260
- return Vt(e, t, r);
4261
- case "TSTypeReference":
4262
- return [r("typeName"), Lt(e, t, r, n.typeArguments ? "typeArguments" : "typeParameters")];
4263
- case "TSTypeAnnotation":
4264
- return un(e, t, r);
4265
- case "TSEmptyBodyFunctionExpression":
4266
- return fn(e, t, r);
4267
- case "TSJSDocAllType":
4268
- return "*";
4269
- case "TSJSDocUnknownType":
4270
- return "?";
4271
- case "TSJSDocNullableType":
4272
- return Ts(e, r, "?");
4273
- case "TSJSDocNonNullableType":
4274
- return Ts(e, r, "!");
4275
- case "TSParenthesizedType":
4276
- default:
4277
- throw new Me(n, "TypeScript");
4278
- }
4279
- }
4280
- function zl(e, t, r, n) {
4281
- if (Hr(e)) return li(e, t);
4282
- for (let s of [di, Fi, La, wa, da]) {
4283
- let u = s(e, t, r, n);
4284
- if (u !== void 0) return u;
4285
- }
4286
- }
4287
- var Zl = v(["ClassMethod", "ClassPrivateMethod", "ClassProperty", "ClassAccessorProperty", "AccessorProperty", "TSAbstractAccessorProperty", "PropertyDefinition", "TSAbstractPropertyDefinition", "ClassPrivateProperty", "MethodDefinition", "TSAbstractMethodDefinition", "TSDeclareMethod"]);
4288
- function em(e, t, r, n) {
4289
- var y;
4290
- e.isRoot && ((y = t.__onHtmlBindingRoot) == null || y.call(t, e.node, t));
4291
- let s = zl(e, t, r, n);
4292
- if (!s) return "";
4293
- let { node: u } = e;
4294
- if (Zl(u)) return s;
4295
- let i = O(u.decorators), a = hi(e, t, r), p = u.type === "ClassExpression";
4296
- if (i && !p) return or(s, (D) => l([a, D]));
4297
- let o = Be(e, t), m = ia(e, t);
4298
- return !a && !o && !m ? s : or(s, (D) => [m ? ";" : "", o ? "(" : "", o && p && i ? [f([x, a, D]), x] : [a, D], o ? ")" : ""]);
4299
- }
4300
- var Oa = em;
4301
- var tm = { avoidAstMutation: true };
4302
- var _a = [{ linguistLanguageId: 174, name: "JSON.stringify", type: "data", color: "#292929", tmScope: "source.json", aceMode: "json", codemirrorMode: "javascript", codemirrorMimeType: "application/json", aliases: ["geojson", "jsonl", "topojson"], extensions: [".importmap"], filenames: ["package.json", "package-lock.json", "composer.json"], parsers: ["json-stringify"], vscodeLanguageIds: ["json"] }, { linguistLanguageId: 174, name: "JSON", type: "data", color: "#292929", tmScope: "source.json", aceMode: "json", codemirrorMode: "javascript", codemirrorMimeType: "application/json", aliases: ["geojson", "jsonl", "topojson"], extensions: [".json", ".4DForm", ".4DProject", ".avsc", ".geojson", ".gltf", ".har", ".ice", ".JSON-tmLanguage", ".mcmeta", ".tfstate", ".tfstate.backup", ".topojson", ".webapp", ".webmanifest", ".yy", ".yyp"], filenames: [".all-contributorsrc", ".arcconfig", ".auto-changelog", ".c8rc", ".htmlhintrc", ".imgbotconfig", ".nycrc", ".tern-config", ".tern-project", ".watchmanconfig", "Pipfile.lock", "composer.lock", "flake.lock", "mcmod.info", ".babelrc", ".jscsrc", ".jshintrc", ".jslintrc", ".swcrc"], parsers: ["json"], vscodeLanguageIds: ["json"] }, { linguistLanguageId: 423, name: "JSON with Comments", type: "data", color: "#292929", group: "JSON", tmScope: "source.js", aceMode: "javascript", codemirrorMode: "javascript", codemirrorMimeType: "text/javascript", aliases: ["jsonc"], extensions: [".jsonc", ".code-snippets", ".code-workspace", ".sublime-build", ".sublime-commands", ".sublime-completions", ".sublime-keymap", ".sublime-macro", ".sublime-menu", ".sublime-mousemap", ".sublime-project", ".sublime-settings", ".sublime-theme", ".sublime-workspace", ".sublime_metrics", ".sublime_session"], filenames: [], parsers: ["jsonc"], vscodeLanguageIds: ["jsonc"] }, { linguistLanguageId: 175, name: "JSON5", type: "data", color: "#267CB9", extensions: [".json5"], tmScope: "source.js", aceMode: "javascript", codemirrorMode: "javascript", codemirrorMimeType: "application/json", parsers: ["json5"], vscodeLanguageIds: ["json5"] }];
4303
- var Os = {};
4304
- Ar(Os, { getVisitorKeys: () => va, massageAstNode: () => Ra, print: () => sm });
4305
- var rm = { JsonRoot: ["node"], ArrayExpression: ["elements"], ObjectExpression: ["properties"], ObjectProperty: ["key", "value"], UnaryExpression: ["argument"], NullLiteral: [], BooleanLiteral: [], StringLiteral: [], NumericLiteral: [], Identifier: [], TemplateLiteral: ["quasis"], TemplateElement: [] };
4306
- var ja = rm;
4307
- var nm = hr(ja);
4308
- var va = nm;
4309
- function sm(e, t, r) {
4310
- let { node: n } = e;
4311
- switch (n.type) {
4312
- case "JsonRoot":
4313
- return [r("node"), F];
4314
- case "ArrayExpression": {
4315
- if (n.elements.length === 0) return "[]";
4316
- let s = e.map(() => e.node === null ? "null" : r(), "elements");
4317
- return ["[", f([F, b([",", F], s)]), F, "]"];
4318
- }
4319
- case "ObjectExpression":
4320
- return n.properties.length === 0 ? "{}" : ["{", f([F, b([",", F], e.map(r, "properties"))]), F, "}"];
4321
- case "ObjectProperty":
4322
- return [r("key"), ": ", r("value")];
4323
- case "UnaryExpression":
4324
- return [n.operator === "+" ? "" : n.operator, r("argument")];
4325
- case "NullLiteral":
4326
- return "null";
4327
- case "BooleanLiteral":
4328
- return n.value ? "true" : "false";
4329
- case "StringLiteral":
4330
- return JSON.stringify(n.value);
4331
- case "NumericLiteral":
4332
- return Ma(e) ? JSON.stringify(String(n.value)) : JSON.stringify(n.value);
4333
- case "Identifier":
4334
- return Ma(e) ? JSON.stringify(n.name) : n.name;
4335
- case "TemplateLiteral":
4336
- return r(["quasis", 0]);
4337
- case "TemplateElement":
4338
- return JSON.stringify(n.value.cooked);
4339
- default:
4340
- throw new Me(n, "JSON");
4341
- }
4342
- }
4343
- function Ma(e) {
4344
- return e.key === "key" && e.parent.type === "ObjectProperty";
4345
- }
4346
- var um = /* @__PURE__ */ new Set(["start", "end", "extra", "loc", "comments", "leadingComments", "trailingComments", "innerComments", "errors", "range", "tokens"]);
4347
- function Ra(e, t) {
4348
- let { type: r } = e;
4349
- if (r === "ObjectProperty") {
4350
- let { key: n } = e;
4351
- n.type === "Identifier" ? t.key = { type: "StringLiteral", value: n.name } : n.type === "NumericLiteral" && (t.key = { type: "StringLiteral", value: String(n.value) });
4352
- return;
4353
- }
4354
- if (r === "UnaryExpression" && e.operator === "+") return t.argument;
4355
- if (r === "ArrayExpression") {
4356
- for (let [n, s] of e.elements.entries()) s === null && t.elements.splice(n, 0, { type: "NullLiteral" });
4357
- return;
4358
- }
4359
- if (r === "TemplateLiteral") return { type: "StringLiteral", value: e.quasis[0].value.cooked };
4360
- }
4361
- Ra.ignoredProperties = um;
4362
- var Er = { bracketSpacing: { category: "Common", type: "boolean", default: true, description: "Print spaces between brackets.", oppositeDescription: "Do not print spaces between brackets." }, singleQuote: { category: "Common", type: "boolean", default: false, description: "Use single quotes instead of double quotes." }, proseWrap: { category: "Common", type: "choice", default: "preserve", description: "How to wrap prose.", choices: [{ value: "always", description: "Wrap prose if it exceeds the print width." }, { value: "never", description: "Do not wrap prose." }, { value: "preserve", description: "Wrap prose as-is." }] }, bracketSameLine: { category: "Common", type: "boolean", default: false, description: "Put > of opening tags on the last line instead of on a new line." }, singleAttributePerLine: { category: "Common", type: "boolean", default: false, description: "Enforce single attribute per line in HTML, Vue and JSX." } };
4363
- var wt = "JavaScript";
4364
- var im = { arrowParens: { category: wt, type: "choice", default: "always", description: "Include parentheses around a sole arrow function parameter.", choices: [{ value: "always", description: "Always include parens. Example: `(x) => x`" }, { value: "avoid", description: "Omit parens when possible. Example: `x => x`" }] }, bracketSameLine: Er.bracketSameLine, bracketSpacing: Er.bracketSpacing, jsxBracketSameLine: { category: wt, type: "boolean", description: "Put > on the last line instead of at a new line.", deprecated: "2.4.0" }, semi: { category: wt, type: "boolean", default: true, description: "Print semicolons.", oppositeDescription: "Do not print semicolons, except at the beginning of lines which may need them." }, experimentalTernaries: { category: wt, type: "boolean", default: false, description: "Use curious ternaries, with the question mark after the condition.", oppositeDescription: "Default behavior of ternaries; keep question marks on the same line as the consequent." }, singleQuote: Er.singleQuote, jsxSingleQuote: { category: wt, type: "boolean", default: false, description: "Use single quotes in JSX." }, quoteProps: { category: wt, type: "choice", default: "as-needed", description: "Change when properties in objects are quoted.", choices: [{ value: "as-needed", description: "Only add quotes around object properties where required." }, { value: "consistent", description: "If at least one property in an object requires quotes, quote all properties." }, { value: "preserve", description: "Respect the input use of quotes in object properties." }] }, trailingComma: { category: wt, type: "choice", default: "all", description: "Print trailing commas wherever possible when multi-line.", choices: [{ value: "all", description: "Trailing commas wherever possible (including function arguments)." }, { value: "es5", description: "Trailing commas where valid in ES5 (objects, arrays, etc.)" }, { value: "none", description: "No trailing commas." }] }, singleAttributePerLine: Er.singleAttributePerLine };
4365
- var Ja = im;
4366
- var am = { estree: ws, "estree-json": Os };
4367
- var om = [...Us, ..._a];
4368
- var rx = _s;
4369
- export {
4370
- rx as default,
4371
- om as languages,
4372
- Ja as options,
4373
- am as printers
4374
- };