@rexeus/typeweaver 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +30 -10
  2. package/dist/{acorn-CJ4HNU11.js → acorn-TNAGPKCR.js} +1076 -998
  3. package/dist/angular-3KXBV3WD.js +3030 -0
  4. package/dist/babel-V7SGJWS6.js +7296 -0
  5. package/dist/chunk-MLKGABMK.js +9 -0
  6. package/dist/chunk-Q6MQC6UP.js +34641 -0
  7. package/dist/cli.cjs +116222 -0
  8. package/dist/cli.d.cts +2 -0
  9. package/dist/cli.d.ts +2 -0
  10. package/dist/cli.js +2 -0
  11. package/dist/entry.cjs +116942 -0
  12. package/dist/entry.d.cts +2 -0
  13. package/dist/entry.d.ts +2 -0
  14. package/dist/entry.js +30 -0
  15. package/dist/estree-QSPT5I7I.js +4612 -0
  16. package/dist/flow-WHVBWPDR.js +27546 -0
  17. package/dist/{glimmer-DiXjs4DB.js → glimmer-BHRIPYOK.js} +1317 -1051
  18. package/dist/{graphql-DLJHmbDb.js → graphql-7EJJJFHU.js} +343 -307
  19. package/dist/html-YM5TKPVB.js +2926 -0
  20. package/dist/index.cjs +116228 -0
  21. package/dist/index.d.cts +2 -0
  22. package/dist/index.d.ts +1 -1
  23. package/dist/index.js +2 -16
  24. package/dist/markdown-FIK6SNTF.js +3551 -0
  25. package/dist/meriyah-FBUICA5T.js +2684 -0
  26. package/dist/{postcss-DUOVol6C.js → postcss-ODV7XV5T.js} +1779 -1641
  27. package/dist/tsx-loader-H3LYLQCE.js +2 -0
  28. package/dist/typescript-BG63TNYD.js +13203 -0
  29. package/dist/{yaml-Bd8DkW_K.js → yaml-DV3ZI4ZT.js} +1140 -1058
  30. package/package.json +33 -33
  31. package/dist/angular-wXs0C_R2.js +0 -2626
  32. package/dist/babel-DNmSIBHM.js +0 -7201
  33. package/dist/cli-D5DHO8r6.js +0 -20691
  34. package/dist/estree-BfVT8G2n.js +0 -4301
  35. package/dist/flow-DgzFy9Js.js +0 -27138
  36. package/dist/html-BwjSBi_v.js +0 -2677
  37. package/dist/markdown-DWIPYE8e.js +0 -3363
  38. package/dist/meriyah-CbAY3E55.js +0 -2603
  39. package/dist/run-cli-with-tsx.js +0 -18
  40. package/dist/typescript-DDNbhgng.js +0 -12972
@@ -1,4301 +0,0 @@
1
- var za = Object.defineProperty;
2
- var Us = (e) => {
3
- throw TypeError(e);
4
- };
5
- var xr = (e, t) => {
6
- for (var r in t) za(e, r, { get: t[r], enumerable: true });
7
- };
8
- var Xs = (e, t, r) => t.has(e) || Us("Cannot " + r);
9
- var mt = (e, t, r) => (Xs(e, t, "read from private field"), t.get(e)), Ys = (e, t, r) => t.has(e) ? Us("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), Hs = (e, t, r, n) => (Xs(e, t, "write to private field"), t.set(e, r), r);
10
- var Rs = {};
11
- xr(Rs, { languages: () => Tm, options: () => Ha, printers: () => dm });
12
- var Vs = [{ name: "JavaScript", type: "programming", extensions: [".js", "._js", ".bones", ".cjs", ".es", ".es6", ".gs", ".jake", ".javascript", ".jsb", ".jscad", ".jsfl", ".jslib", ".jsm", ".jspre", ".jss", ".mjs", ".njs", ".pac", ".sjs", ".ssjs", ".xsjs", ".xsjslib", ".start.frag", ".end.frag", ".wxs"], tmScope: "source.js", aceMode: "javascript", aliases: ["js", "node"], codemirrorMode: "javascript", codemirrorMimeType: "text/javascript", interpreters: ["chakra", "d8", "gjs", "js", "node", "nodejs", "qjs", "rhino", "v8", "v8-shell", "zx"], filenames: ["Jakefile", "start.frag", "end.frag"], parsers: ["babel", "acorn", "espree", "meriyah", "babel-flow", "babel-ts", "flow", "typescript"], vscodeLanguageIds: ["javascript", "mongo"], linguistLanguageId: 183 }, { name: "Flow", type: "programming", extensions: [".js.flow"], tmScope: "source.js", aceMode: "javascript", aliases: [], codemirrorMode: "javascript", codemirrorMimeType: "text/javascript", interpreters: ["chakra", "d8", "gjs", "js", "node", "nodejs", "qjs", "rhino", "v8", "v8-shell"], filenames: [], parsers: ["flow", "babel-flow"], vscodeLanguageIds: ["javascript"], linguistLanguageId: 183 }, { name: "JSX", type: "programming", extensions: [".jsx"], tmScope: "source.js.jsx", aceMode: "javascript", aliases: void 0, codemirrorMode: "jsx", codemirrorMimeType: "text/jsx", interpreters: void 0, filenames: void 0, parsers: ["babel", "babel-flow", "babel-ts", "flow", "typescript", "espree", "meriyah"], vscodeLanguageIds: ["javascriptreact"], group: "JavaScript", linguistLanguageId: 183 }, { name: "TypeScript", type: "programming", extensions: [".ts", ".cts", ".mts"], tmScope: "source.ts", aceMode: "typescript", aliases: ["ts"], codemirrorMode: "javascript", codemirrorMimeType: "application/typescript", interpreters: ["bun", "deno", "ts-node", "tsx"], parsers: ["typescript", "babel-ts"], vscodeLanguageIds: ["typescript"], linguistLanguageId: 378 }, { name: "TSX", type: "programming", extensions: [".tsx"], tmScope: "source.tsx", aceMode: "javascript", codemirrorMode: "jsx", codemirrorMimeType: "text/jsx", group: "TypeScript", parsers: ["typescript", "babel-ts"], vscodeLanguageIds: ["typescriptreact"], linguistLanguageId: 94901924 }];
13
- var vs = {};
14
- xr(vs, { canAttachComment: () => kp, embed: () => oi, experimentalFeatures: () => fm, getCommentChildNodes: () => Ip, getVisitorKeys: () => br, handleComments: () => ts, insertPragma: () => di, isBlockComment: () => te, isGap: () => Lp, massageAstNode: () => Bu, print: () => Ga, printComment: () => ju, willPrintOwnComments: () => rs });
15
- var Za = (e, t, r, n) => {
16
- if (!(e && t == null)) return t.replaceAll ? t.replaceAll(r, n) : r.global ? t.replace(r, n) : t.split(r).join(n);
17
- }, X = Za;
18
- var eo = (e, t, r) => {
19
- if (!(e && t == null)) return Array.isArray(t) || typeof t == "string" ? t[r < 0 ? t.length + r : r] : t.at(r);
20
- }, v = eo;
21
- function to(e) {
22
- return e !== null && typeof e == "object";
23
- }
24
- var $s = to;
25
- function* ro(e, t) {
26
- let { getVisitorKeys: r, filter: n = () => true } = t, s = (u) => $s(u) && n(u);
27
- for (let u of r(e)) {
28
- let i = e[u];
29
- if (Array.isArray(i)) for (let a of i) s(a) && (yield a);
30
- else s(i) && (yield i);
31
- }
32
- }
33
- function* no(e, t) {
34
- let r = [e];
35
- for (let n = 0; n < r.length; n++) {
36
- let s = r[n];
37
- for (let u of ro(s, t)) yield u, r.push(u);
38
- }
39
- }
40
- function Ks(e, { getVisitorKeys: t, predicate: r }) {
41
- for (let n of no(e, { getVisitorKeys: t })) if (r(n)) return true;
42
- return false;
43
- }
44
- var Qs = () => /[#*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;
45
- function zs(e) {
46
- return e === 12288 || e >= 65281 && e <= 65376 || e >= 65504 && e <= 65510;
47
- }
48
- function Zs(e) {
49
- 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;
50
- }
51
- var eu = (e) => !(zs(e) || Zs(e));
52
- var so = /[^\x20-\x7F]/u;
53
- function uo(e) {
54
- if (!e) return 0;
55
- if (!so.test(e)) return e.length;
56
- e = e.replace(Qs(), " ");
57
- let t = 0;
58
- for (let r of e) {
59
- let n = r.codePointAt(0);
60
- n <= 31 || n >= 127 && n <= 159 || n >= 768 && n <= 879 || (t += eu(n) ? 1 : 2);
61
- }
62
- return t;
63
- }
64
- var st = uo;
65
- function hr(e) {
66
- return (t, r, n) => {
67
- let s = !!(n != null && n.backwards);
68
- if (r === false) return false;
69
- let { length: u } = t, i = r;
70
- for (; i >= 0 && i < u; ) {
71
- let a = t.charAt(i);
72
- if (e instanceof RegExp) {
73
- if (!e.test(a)) return i;
74
- } else if (!e.includes(a)) return i;
75
- s ? i-- : i++;
76
- }
77
- return i === -1 || i === u ? i : false;
78
- };
79
- }
80
- var Ye = hr(" "), tu = hr(",; "), ru = hr(/[^\n\r]/u);
81
- function io(e, t, r) {
82
- let n = !!(r != null && r.backwards);
83
- if (t === false) return false;
84
- let s = e.charAt(t);
85
- if (n) {
86
- if (e.charAt(t - 1) === "\r" && s === `
87
- `) return t - 2;
88
- if (s === `
89
- ` || s === "\r" || s === "\u2028" || s === "\u2029") return t - 1;
90
- } else {
91
- if (s === "\r" && e.charAt(t + 1) === `
92
- `) return t + 2;
93
- if (s === `
94
- ` || s === "\r" || s === "\u2028" || s === "\u2029") return t + 1;
95
- }
96
- return t;
97
- }
98
- var He = io;
99
- function ao(e, t, r = {}) {
100
- let n = Ye(e, r.backwards ? t - 1 : t, r), s = He(e, n, r);
101
- return n !== s;
102
- }
103
- var ee = ao;
104
- function oo(e, t) {
105
- if (t === false) return false;
106
- if (e.charAt(t) === "/" && e.charAt(t + 1) === "*") {
107
- for (let r = t + 2; r < e.length; ++r) if (e.charAt(r) === "*" && e.charAt(r + 1) === "/") return r + 2;
108
- }
109
- return t;
110
- }
111
- var _t = oo;
112
- function po(e, t) {
113
- return t === false ? false : e.charAt(t) === "/" && e.charAt(t + 1) === "/" ? ru(e, t) : t;
114
- }
115
- var Mt = po;
116
- function co(e, t) {
117
- let r = null, n = t;
118
- for (; n !== r; ) r = n, n = tu(e, n), n = _t(e, n), n = Ye(e, n);
119
- return n = Mt(e, n), n = He(e, n), n !== false && ee(e, n);
120
- }
121
- var vt = co;
122
- function lo(e) {
123
- return Array.isArray(e) && e.length > 0;
124
- }
125
- var O = lo;
126
- var nu = new Proxy(() => {
127
- }, { get: () => nu }), jt = nu;
128
- var gr = "'", su = '"';
129
- function mo(e, t) {
130
- let r = t === true || t === gr ? gr : su, n = r === gr ? su : gr, s = 0, u = 0;
131
- for (let i of e) i === r ? s++ : i === n && u++;
132
- return s > u ? n : r;
133
- }
134
- var Sr = mo;
135
- function yo(e, t, r) {
136
- let n = t === '"' ? "'" : '"', u = X(false, e, /\\(.)|(["'])/gsu, (i, a, o) => a === n ? a : o === t ? "\\" + o : o || (r && /^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(a) ? a : "\\" + a));
137
- return t + u + t;
138
- }
139
- var uu = yo;
140
- function fo(e, t) {
141
- jt.ok(/^(?<quote>["']).*\k<quote>$/su.test(e));
142
- let r = e.slice(1, -1), n = t.parser === "json" || t.parser === "jsonc" || t.parser === "json5" && t.quoteProps === "preserve" && !t.singleQuote ? '"' : t.__isInHtmlAttribute ? "'" : Sr(r, t.singleQuote);
143
- return e.charAt(0) === n ? e : uu(r, n, false);
144
- }
145
- var ut = fo;
146
- var iu = (e) => Number.isInteger(e) && e >= 0;
147
- function j(e) {
148
- var n, s, u;
149
- 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];
150
- return r ? Math.min(j(r), t) : t;
151
- }
152
- function P(e) {
153
- var r;
154
- return ((r = e.range) == null ? void 0 : r[1]) ?? e.end;
155
- }
156
- function Bt(e, t) {
157
- let r = j(e);
158
- return iu(r) && r === j(t);
159
- }
160
- function Do(e, t) {
161
- let r = P(e);
162
- return iu(r) && r === P(t);
163
- }
164
- function au(e, t) {
165
- return Bt(e, t) && Do(e, t);
166
- }
167
- var rr = null;
168
- function nr(e) {
169
- if (rr !== null && typeof rr.property) {
170
- let t = rr;
171
- return rr = nr.prototype = null, t;
172
- }
173
- return rr = nr.prototype = e ?? /* @__PURE__ */ Object.create(null), new nr();
174
- }
175
- var Eo = 10;
176
- for (let e = 0; e <= Eo; e++) nr();
177
- function On(e) {
178
- return nr(e);
179
- }
180
- function Fo(e, t = "type") {
181
- On(e);
182
- function r(n) {
183
- let s = n[t], u = e[s];
184
- if (!Array.isArray(u)) throw Object.assign(new Error(`Missing visitor keys for '${s}'.`), { node: n });
185
- return u;
186
- }
187
- return r;
188
- }
189
- var Br = Fo;
190
- var ou = { ArrayExpression: ["elements"], AssignmentExpression: ["left", "right"], BinaryExpression: ["left", "right"], InterpreterDirective: [], Directive: ["value"], DirectiveLiteral: [], BlockStatement: ["directives", "body"], BreakStatement: ["label"], CallExpression: ["callee", "typeParameters", "typeArguments", "arguments"], 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", "predicate", "returnType", "body"], 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", "typeParameters", "typeArguments", "arguments"], Program: ["directives", "body"], ObjectExpression: ["properties"], ObjectMethod: ["decorators", "key", "typeParameters", "params", "returnType", "body"], ObjectProperty: ["decorators", "key", "value"], 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", "predicate", "returnType", "body"], 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: ["decorators", "properties", "typeAnnotation"], SpreadElement: ["argument"], Super: [], TaggedTemplateExpression: ["tag", "typeParameters", "quasi", "typeArguments"], TemplateElement: [], TemplateLiteral: ["quasis", "expressions"], YieldExpression: ["argument"], AwaitExpression: ["argument"], BigIntLiteral: [], ExportNamespaceSpecifier: ["exported"], OptionalMemberExpression: ["object", "property"], OptionalCallExpression: ["callee", "typeParameters", "typeArguments", "arguments"], ClassProperty: ["decorators", "variance", "key", "typeAnnotation", "value"], ClassAccessorProperty: ["decorators", "key", "typeAnnotation", "value"], ClassPrivateProperty: ["decorators", "variance", "key", "typeAnnotation", "value"], ClassPrivateMethod: ["decorators", "key", "typeParameters", "params", "returnType", "body"], PrivateName: ["id"], StaticBlock: ["body"], ImportAttribute: ["key", "value"], 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", "this", "params", "rest", "returnType"], 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", "typeParameters", "typeArguments", "attributes"], JSXSpreadAttribute: ["argument"], JSXText: [], JSXFragment: ["openingFragment", "children", "closingFragment"], JSXOpeningFragment: [], JSXClosingFragment: [], Noop: [], Placeholder: [], V8IntrinsicIdentifier: [], ArgumentPlaceholder: [], BindExpression: ["object", "callee"], Decorator: ["expression"], DoExpression: ["body"], ExportDefaultSpecifier: ["exported"], 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: ["nameType", "typeAnnotation", "key", "constraint"], TSTemplateLiteralType: ["quasis", "types"], 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"], TSEnumBody: ["members"], TSEnumDeclaration: ["id", "body"], TSEnumMember: ["id", "initializer"], TSModuleDeclaration: ["id", "body"], TSModuleBlock: ["body"], TSImportType: ["argument", "options", "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"], TSExportKeyword: [], TSInterfaceHeritage: ["expression", "typeArguments", "typeParameters"], TSPrivateKeyword: [], TSProtectedKeyword: [], TSPublicKeyword: [], TSReadonlyKeyword: [], TSStaticKeyword: [], 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"], NGChainedExpression: ["expressions"], NGEmptyExpression: [], NGPipeExpression: ["left", "right", "arguments"], NGMicrosyntax: ["body"], NGMicrosyntaxAs: ["key", "alias"], NGMicrosyntaxExpression: ["expression", "alias"], NGMicrosyntaxKey: [], NGMicrosyntaxKeyedExpression: ["key", "expression"], NGMicrosyntaxLet: ["key", "value"], NGRoot: ["node"], JsExpressionRoot: ["node"], JsonRoot: ["node"], TSJSDocAllType: [], TSJSDocUnknownType: [], TSJSDocNullableType: ["typeAnnotation"], TSJSDocNonNullableType: ["typeAnnotation"], NeverTypeAnnotation: [], SatisfiesExpression: ["expression", "typeAnnotation"], UndefinedTypeAnnotation: [], UnknownTypeAnnotation: [] };
191
- var Co = Br(ou), br = Co;
192
- function Ao(e) {
193
- let t = new Set(e);
194
- return (r) => t.has(r == null ? void 0 : r.type);
195
- }
196
- var R = Ao;
197
- function To(e) {
198
- var t;
199
- return ((t = e.extra) == null ? void 0 : t.raw) ?? e.raw;
200
- }
201
- var ae = To;
202
- var xo = R(["Block", "CommentBlock", "MultiLine"]), te = xo;
203
- var ho = R(["AnyTypeAnnotation", "ThisTypeAnnotation", "NumberTypeAnnotation", "VoidTypeAnnotation", "BooleanTypeAnnotation", "BigIntTypeAnnotation", "SymbolTypeAnnotation", "StringTypeAnnotation", "NeverTypeAnnotation", "UndefinedTypeAnnotation", "UnknownTypeAnnotation", "EmptyTypeAnnotation", "MixedTypeAnnotation"]), Pr = ho;
204
- var go = R(["Line", "CommentLine", "SingleLine", "HashbangComment", "HTMLOpen", "HTMLClose", "Hashbang", "InterpreterDirective"]), At = go;
205
- function So(e, t) {
206
- let r = t.split(".");
207
- for (let n = r.length - 1; n >= 0; n--) {
208
- let s = r[n];
209
- if (n === 0) return e.type === "Identifier" && e.name === s;
210
- if (e.type !== "MemberExpression" || e.optional || e.computed || e.property.type !== "Identifier" || e.property.name !== s) return false;
211
- e = e.object;
212
- }
213
- }
214
- function Bo(e, t) {
215
- return t.some((r) => So(e, r));
216
- }
217
- var pu = Bo;
218
- function bo({ type: e }) {
219
- return e.startsWith("TS") && e.endsWith("Keyword");
220
- }
221
- var kr = bo;
222
- function ur(e, t) {
223
- return t(e) || Ks(e, { getVisitorKeys: br, predicate: t });
224
- }
225
- function Jt(e) {
226
- return e.type === "AssignmentExpression" || e.type === "BinaryExpression" || e.type === "LogicalExpression" || e.type === "NGPipeExpression" || e.type === "ConditionalExpression" || w(e) || G(e) || e.type === "SequenceExpression" || e.type === "TaggedTemplateExpression" || e.type === "BindExpression" || e.type === "UpdateExpression" && !e.prefix || xe(e) || e.type === "TSNonNullExpression" || e.type === "ChainExpression";
227
- }
228
- function mu(e) {
229
- return e.expressions ? e.expressions[0] : e.left ?? e.test ?? e.callee ?? e.object ?? e.tag ?? e.argument ?? e.expression;
230
- }
231
- function Lr(e) {
232
- if (e.expressions) return ["expressions", 0];
233
- if (e.left) return ["left"];
234
- if (e.test) return ["test"];
235
- if (e.object) return ["object"];
236
- if (e.callee) return ["callee"];
237
- if (e.tag) return ["tag"];
238
- if (e.argument) return ["argument"];
239
- if (e.expression) return ["expression"];
240
- throw new Error("Unexpected node has no left side.");
241
- }
242
- var yu = R(["ExportDefaultDeclaration", "DeclareExportDeclaration", "ExportNamedDeclaration", "ExportAllDeclaration", "DeclareExportAllDeclaration"]), U = R(["ArrayExpression"]), ue = R(["ObjectExpression"]);
243
- function fu(e) {
244
- return e.type === "LogicalExpression" && e.operator === "??";
245
- }
246
- function ye(e) {
247
- return e.type === "NumericLiteral" || e.type === "Literal" && typeof e.value == "number";
248
- }
249
- function Du(e) {
250
- return e.type === "BooleanLiteral" || e.type === "Literal" && typeof e.value == "boolean";
251
- }
252
- function Rn(e) {
253
- return e.type === "UnaryExpression" && (e.operator === "+" || e.operator === "-") && ye(e.argument);
254
- }
255
- function K(e) {
256
- return !!(e && (e.type === "StringLiteral" || e.type === "Literal" && typeof e.value == "string"));
257
- }
258
- function Jn(e) {
259
- return e.type === "RegExpLiteral" || e.type === "Literal" && !!e.regex;
260
- }
261
- var wr = R(["Literal", "BooleanLiteral", "BigIntLiteral", "DirectiveLiteral", "NullLiteral", "NumericLiteral", "RegExpLiteral", "StringLiteral"]), Po = R(["Identifier", "ThisExpression", "Super", "PrivateName", "PrivateIdentifier"]), Re = R(["ObjectTypeAnnotation", "TSTypeLiteral", "TSMappedType"]), Rt = R(["FunctionExpression", "ArrowFunctionExpression"]);
262
- function ko(e) {
263
- return e.type === "FunctionExpression" || e.type === "ArrowFunctionExpression" && e.body.type === "BlockStatement";
264
- }
265
- function _n(e) {
266
- return w(e) && e.callee.type === "Identifier" && ["async", "inject", "fakeAsync", "waitForAsync"].includes(e.callee.name);
267
- }
268
- var Y = R(["JSXElement", "JSXFragment"]);
269
- function bt(e) {
270
- return e.method && e.kind === "init" || e.kind === "get" || e.kind === "set";
271
- }
272
- function Or(e) {
273
- return (e.type === "ObjectTypeProperty" || e.type === "ObjectTypeInternalSlot") && !e.static && !e.method && e.kind !== "get" && e.kind !== "set" && e.value.type === "FunctionTypeAnnotation";
274
- }
275
- function Eu(e) {
276
- return (e.type === "TypeAnnotation" || e.type === "TSTypeAnnotation") && e.typeAnnotation.type === "FunctionTypeAnnotation" && !e.static && !Bt(e, e.typeAnnotation);
277
- }
278
- var Fe = R(["BinaryExpression", "LogicalExpression", "NGPipeExpression"]);
279
- function dt(e) {
280
- return G(e) || e.type === "BindExpression" && !!e.object;
281
- }
282
- var Io = R(["TSThisType", "NullLiteralTypeAnnotation", "BooleanLiteralTypeAnnotation", "StringLiteralTypeAnnotation", "BigIntLiteralTypeAnnotation", "NumberLiteralTypeAnnotation", "TSLiteralType", "TSTemplateLiteralType"]);
283
- function Nt(e) {
284
- return kr(e) || Pr(e) || Io(e) || (e.type === "GenericTypeAnnotation" || e.type === "TSTypeReference") && !e.typeParameters && !e.typeArguments;
285
- }
286
- function Lo(e) {
287
- return e.type === "Identifier" && (e.name === "beforeEach" || e.name === "beforeAll" || e.name === "afterEach" || e.name === "afterAll");
288
- }
289
- var wo = ["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"];
290
- function Oo(e) {
291
- return pu(e, wo);
292
- }
293
- function Pt(e, t) {
294
- if ((e == null ? void 0 : e.type) !== "CallExpression" || e.optional) return false;
295
- let r = le(e);
296
- if (r.length === 1) {
297
- if (_n(e) && Pt(t)) return Rt(r[0]);
298
- if (Lo(e.callee)) return _n(r[0]);
299
- } else if ((r.length === 2 || r.length === 3) && (r[0].type === "TemplateLiteral" || K(r[0])) && Oo(e.callee)) return r[2] && !ye(r[2]) ? false : (r.length === 2 ? Rt(r[1]) : ko(r[1]) && Q(r[1]).length <= 1) || _n(r[1]);
300
- return false;
301
- }
302
- var Fu = (e) => (t) => ((t == null ? void 0 : t.type) === "ChainExpression" && (t = t.expression), e(t)), w = Fu(R(["CallExpression", "OptionalCallExpression"])), G = Fu(R(["MemberExpression", "OptionalMemberExpression"]));
303
- function Nn(e, t = 5) {
304
- return Cu(e, t) <= t;
305
- }
306
- function Cu(e, t) {
307
- let r = 0;
308
- for (let n in e) {
309
- let s = e[n];
310
- if (s && typeof s == "object" && typeof s.type == "string" && (r++, r += Cu(s, t - r)), r > t) return r;
311
- }
312
- return r;
313
- }
314
- var _o = 0.25;
315
- function ir(e, t) {
316
- let { printWidth: r } = t;
317
- if (d(e)) return false;
318
- let n = r * _o;
319
- if (e.type === "ThisExpression" || e.type === "Identifier" && e.name.length <= n || Rn(e) && !d(e.argument)) return true;
320
- let s = e.type === "Literal" && "regex" in e && e.regex.pattern || e.type === "RegExpLiteral" && e.pattern;
321
- return s ? s.length <= n : K(e) ? ut(ae(e), t).length <= n : e.type === "TemplateLiteral" ? e.expressions.length === 0 && e.quasis[0].value.raw.length <= n && !e.quasis[0].value.raw.includes(`
322
- `) : e.type === "UnaryExpression" ? ir(e.argument, { printWidth: r }) : e.type === "CallExpression" && e.arguments.length === 0 && e.callee.type === "Identifier" ? e.callee.name.length <= n - 2 : wr(e);
323
- }
324
- function de(e, t) {
325
- return Y(t) ? kt(t) : d(t, h.Leading, (r) => ee(e, P(r)));
326
- }
327
- function cu(e) {
328
- return e.quasis.some((t) => t.value.raw.includes(`
329
- `));
330
- }
331
- function _r(e, t) {
332
- return (e.type === "TemplateLiteral" && cu(e) || e.type === "TaggedTemplateExpression" && cu(e.quasi)) && !ee(t, j(e), { backwards: true });
333
- }
334
- function Mr(e) {
335
- if (!d(e)) return false;
336
- let t = v(false, Ve(e, h.Dangling), -1);
337
- return t && !te(t);
338
- }
339
- function Au(e) {
340
- if (e.length <= 1) return false;
341
- let t = 0;
342
- for (let r of e) if (Rt(r)) {
343
- if (t += 1, t > 1) return true;
344
- } else if (w(r)) {
345
- for (let n of le(r)) if (Rt(n)) return true;
346
- }
347
- return false;
348
- }
349
- function vr(e) {
350
- let { node: t, parent: r, key: n } = e;
351
- return n === "callee" && w(t) && w(r) && r.arguments.length > 0 && t.arguments.length > r.arguments.length;
352
- }
353
- var Mo = /* @__PURE__ */ new Set(["!", "-", "+", "~"]);
354
- function we(e, t = 2) {
355
- if (t <= 0) return false;
356
- if (e.type === "ChainExpression" || e.type === "TSNonNullExpression") return we(e.expression, t);
357
- let r = (n) => we(n, t - 1);
358
- if (Jn(e)) return st(e.pattern ?? e.regex.pattern) <= 5;
359
- if (wr(e) || Po(e) || e.type === "ArgumentPlaceholder") return true;
360
- if (e.type === "TemplateLiteral") return e.quasis.every((n) => !n.value.raw.includes(`
361
- `)) && e.expressions.every(r);
362
- if (ue(e)) return e.properties.every((n) => !n.computed && (n.shorthand || n.value && r(n.value)));
363
- if (U(e)) return e.elements.every((n) => n === null || r(n));
364
- if (yt(e)) {
365
- if (e.type === "ImportExpression" || we(e.callee, t)) {
366
- let n = le(e);
367
- return n.length <= t && n.every(r);
368
- }
369
- return false;
370
- }
371
- return G(e) ? we(e.object, t) && we(e.property, t) : e.type === "UnaryExpression" && Mo.has(e.operator) || e.type === "UpdateExpression" ? we(e.argument, t) : false;
372
- }
373
- function du(e) {
374
- return e;
375
- }
376
- function ce(e, t = "es5") {
377
- return e.trailingComma === "es5" && t === "es5" || e.trailingComma === "all" && (t === "all" || t === "es5");
378
- }
379
- function pe(e, t) {
380
- switch (e.type) {
381
- case "BinaryExpression":
382
- case "LogicalExpression":
383
- case "AssignmentExpression":
384
- case "NGPipeExpression":
385
- return pe(e.left, t);
386
- case "MemberExpression":
387
- case "OptionalMemberExpression":
388
- return pe(e.object, t);
389
- case "TaggedTemplateExpression":
390
- return e.tag.type === "FunctionExpression" ? false : pe(e.tag, t);
391
- case "CallExpression":
392
- case "OptionalCallExpression":
393
- return e.callee.type === "FunctionExpression" ? false : pe(e.callee, t);
394
- case "ConditionalExpression":
395
- return pe(e.test, t);
396
- case "UpdateExpression":
397
- return !e.prefix && pe(e.argument, t);
398
- case "BindExpression":
399
- return e.object && pe(e.object, t);
400
- case "SequenceExpression":
401
- return pe(e.expressions[0], t);
402
- case "ChainExpression":
403
- case "TSSatisfiesExpression":
404
- case "TSAsExpression":
405
- case "TSNonNullExpression":
406
- case "AsExpression":
407
- case "AsConstExpression":
408
- case "SatisfiesExpression":
409
- return pe(e.expression, t);
410
- default:
411
- return t(e);
412
- }
413
- }
414
- var lu = { "==": true, "!=": true, "===": true, "!==": true }, Ir = { "*": true, "/": true, "%": true }, jn = { ">>": true, ">>>": true, "<<": true };
415
- function ar(e, t) {
416
- return !(sr(t) !== sr(e) || e === "**" || lu[e] && lu[t] || t === "%" && Ir[e] || e === "%" && Ir[t] || t !== e && Ir[t] && Ir[e] || jn[e] && jn[t]);
417
- }
418
- var vo = new Map([["|>"], ["??"], ["||"], ["&&"], ["|"], ["^"], ["&"], ["==", "===", "!=", "!=="], ["<", ">", "<=", ">=", "in", "instanceof"], [">>", "<<", ">>>"], ["+", "-"], ["*", "/", "%"], ["**"]].flatMap((e, t) => e.map((r) => [r, t])));
419
- function sr(e) {
420
- return vo.get(e);
421
- }
422
- function Tu(e) {
423
- return !!jn[e] || e === "|" || e === "^" || e === "&";
424
- }
425
- function xu(e) {
426
- var r;
427
- if (e.rest) return true;
428
- let t = Q(e);
429
- return ((r = v(false, t, -1)) == null ? void 0 : r.type) === "RestElement";
430
- }
431
- var Mn = /* @__PURE__ */ new WeakMap();
432
- function Q(e) {
433
- if (Mn.has(e)) return Mn.get(e);
434
- let t = [];
435
- 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), Mn.set(e, t), t;
436
- }
437
- function hu(e, t) {
438
- let { node: r } = e, n = 0, s = (u) => t(u, n++);
439
- 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");
440
- }
441
- var vn = /* @__PURE__ */ new WeakMap();
442
- function le(e) {
443
- if (vn.has(e)) return vn.get(e);
444
- if (e.type === "ChainExpression") return le(e.expression);
445
- let t = e.arguments;
446
- return (e.type === "ImportExpression" || e.type === "TSImportType") && (t = [e.type === "ImportExpression" ? e.source : e.argument], e.options && t.push(e.options)), vn.set(e, t), t;
447
- }
448
- function Gt(e, t) {
449
- let { node: r } = e;
450
- if (r.type === "ChainExpression") return e.call(() => Gt(e, t), "expression");
451
- r.type === "ImportExpression" || r.type === "TSImportType" ? (e.call((n) => t(n, 0), r.type === "ImportExpression" ? "source" : "argument"), r.options && e.call((n) => t(n, 1), "options")) : e.each(t, "arguments");
452
- }
453
- function Gn(e, t) {
454
- let r = [];
455
- if (e.type === "ChainExpression" && (e = e.expression, r.push("expression")), e.type === "ImportExpression" || e.type === "TSImportType") {
456
- if (t === 0 || t === (e.options ? -2 : -1)) return [...r, e.type === "ImportExpression" ? "source" : "argument"];
457
- if (e.options && (t === 1 || t === -1)) return [...r, "options"];
458
- throw new RangeError("Invalid argument index");
459
- }
460
- if (t < 0 && (t = e.arguments.length + t), t < 0 || t >= e.arguments.length) throw new RangeError("Invalid argument index");
461
- return [...r, "arguments", t];
462
- }
463
- function or(e) {
464
- return e.value.trim() === "prettier-ignore" && !e.unignore;
465
- }
466
- function kt(e) {
467
- return (e == null ? void 0 : e.prettierIgnore) || d(e, h.PrettierIgnore);
468
- }
469
- var h = { Leading: 2, Trailing: 4, Dangling: 8, Block: 16, Line: 32, PrettierIgnore: 64, First: 128, Last: 256 }, gu = (e, t) => {
470
- 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 && !te(r) || e & h.Line && !At(r) || e & h.First && n !== 0 || e & h.Last && n !== s.length - 1 || e & h.PrettierIgnore && !or(r) || t && !t(r));
471
- };
472
- function d(e, t, r) {
473
- if (!O(e == null ? void 0 : e.comments)) return false;
474
- let n = gu(t, r);
475
- return n ? e.comments.some(n) : true;
476
- }
477
- function Ve(e, t, r) {
478
- if (!Array.isArray(e == null ? void 0 : e.comments)) return [];
479
- let n = gu(t, r);
480
- return n ? e.comments.filter(n) : e.comments;
481
- }
482
- var me = (e, { originalText: t }) => vt(t, P(e));
483
- function yt(e) {
484
- return w(e) || e.type === "NewExpression" || e.type === "ImportExpression";
485
- }
486
- function Te(e) {
487
- return e && (e.type === "ObjectProperty" || e.type === "Property" && !bt(e));
488
- }
489
- var xe = R(["TSAsExpression", "TSSatisfiesExpression", "AsExpression", "AsConstExpression", "SatisfiesExpression"]), Oe = R(["TSUnionType", "UnionTypeAnnotation"]), qt = R(["TSIntersectionType", "IntersectionTypeAnnotation"]), Je = R(["TSConditionalType", "ConditionalTypeAnnotation"]);
490
- var jo = /* @__PURE__ */ new Set(["range", "raw", "comments", "leadingComments", "trailingComments", "innerComments", "extra", "start", "end", "loc", "flags", "errors", "tokens"]), Wt = (e) => {
491
- for (let t of e.quasis) delete t.value;
492
- };
493
- function Su(e, t) {
494
- var n;
495
- 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;
496
- 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) {
497
- let { key: s } = e;
498
- K(s) || ye(s) ? t.key = String(s.value) : s.type === "Identifier" && (t.key = s.name);
499
- }
500
- if (e.type === "JSXElement" && e.openingElement.name.name === "style" && e.openingElement.attributes.some((s) => s.type === "JSXAttribute" && s.name.name === "jsx")) for (let { type: s, expression: u } of t.children) s === "JSXExpressionContainer" && u.type === "TemplateLiteral" && Wt(u);
501
- e.type === "JSXAttribute" && e.name.name === "css" && e.value.type === "JSXExpressionContainer" && e.value.expression.type === "TemplateLiteral" && Wt(t.value.expression), e.type === "JSXAttribute" && ((n = e.value) == null ? void 0 : n.type) === "Literal" && /["']|&quot;|&apos;/u.test(e.value.value) && (t.value.value = X(false, e.value.value, /["']|&quot;|&apos;/gu, '"'));
502
- let r = e.expression || e.callee;
503
- if (e.type === "Decorator" && r.type === "CallExpression" && r.callee.name === "Component" && r.arguments.length === 1) {
504
- let s = e.expression.arguments[0].properties;
505
- for (let [u, i] of t.expression.arguments[0].properties.entries()) switch (s[u].key.name) {
506
- case "styles":
507
- U(i.value) && Wt(i.value.elements[0]);
508
- break;
509
- case "template":
510
- i.value.type === "TemplateLiteral" && Wt(i.value);
511
- break;
512
- }
513
- }
514
- 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" && Wt(t), e.type === "ChainExpression" && e.expression.type === "TSNonNullExpression" && (t.type = "TSNonNullExpression", t.expression.type = "ChainExpression");
515
- }
516
- Su.ignoredProperties = jo;
517
- var Bu = Su;
518
- var Ne = "string", ge = "array", it = "cursor", $e = "indent", Ke = "align", Qe = "trim", fe = "group", _e = "fill", he = "if-break", ze = "indent-if-break", Ze = "line-suffix", Ge = "line-suffix-boundary", oe = "line", Se = "label", Me = "break-parent", jr = /* @__PURE__ */ new Set([it, $e, Ke, Qe, fe, _e, he, ze, Ze, Ge, oe, Se, Me]);
519
- function Ro(e) {
520
- if (typeof e == "string") return Ne;
521
- if (Array.isArray(e)) return ge;
522
- if (!e) return;
523
- let { type: t } = e;
524
- if (jr.has(t)) return t;
525
- }
526
- var Be = Ro;
527
- var Jo = (e) => new Intl.ListFormat("en-US", { type: "disjunction" }).format(e);
528
- function No(e) {
529
- let t = e === null ? "null" : typeof e;
530
- if (t !== "string" && t !== "object") return `Unexpected doc '${t}',
531
- Expected it to be 'string' or 'object'.`;
532
- if (Be(e)) throw new Error("doc is valid.");
533
- let r = Object.prototype.toString.call(e);
534
- if (r !== "[object Object]") return `Unexpected doc '${r}'.`;
535
- let n = Jo([...jr].map((s) => `'${s}'`));
536
- return `Unexpected doc.type '${e.type}'.
537
- Expected it to be ${n}.`;
538
- }
539
- var qn = class extends Error {
540
- name = "InvalidDocError";
541
- constructor(t) {
542
- super(No(t)), this.doc = t;
543
- }
544
- }, Tt = qn;
545
- var bu = {};
546
- function Go(e, t, r, n) {
547
- let s = [e];
548
- for (; s.length > 0; ) {
549
- let u = s.pop();
550
- if (u === bu) {
551
- r(s.pop());
552
- continue;
553
- }
554
- r && s.push(u, bu);
555
- let i = Be(u);
556
- if (!i) throw new Tt(u);
557
- if ((t == null ? void 0 : t(u)) !== false) switch (i) {
558
- case ge:
559
- case _e: {
560
- let a = i === ge ? u : u.parts;
561
- for (let o = a.length, p = o - 1; p >= 0; --p) s.push(a[p]);
562
- break;
563
- }
564
- case he:
565
- s.push(u.flatContents, u.breakContents);
566
- break;
567
- case fe:
568
- if (n && u.expandedStates) for (let a = u.expandedStates.length, o = a - 1; o >= 0; --o) s.push(u.expandedStates[o]);
569
- else s.push(u.contents);
570
- break;
571
- case Ke:
572
- case $e:
573
- case ze:
574
- case Se:
575
- case Ze:
576
- s.push(u.contents);
577
- break;
578
- case Ne:
579
- case it:
580
- case Qe:
581
- case Ge:
582
- case oe:
583
- case Me:
584
- break;
585
- default:
586
- throw new Tt(u);
587
- }
588
- }
589
- }
590
- var pr = Go;
591
- function ft(e, t) {
592
- if (typeof e == "string") return t(e);
593
- let r = /* @__PURE__ */ new Map();
594
- return n(e);
595
- function n(u) {
596
- if (r.has(u)) return r.get(u);
597
- let i = s(u);
598
- return r.set(u, i), i;
599
- }
600
- function s(u) {
601
- switch (Be(u)) {
602
- case ge:
603
- return t(u.map(n));
604
- case _e:
605
- return t({ ...u, parts: u.parts.map(n) });
606
- case he:
607
- return t({ ...u, breakContents: n(u.breakContents), flatContents: n(u.flatContents) });
608
- case fe: {
609
- let { expandedStates: i, contents: a } = u;
610
- return i ? (i = i.map(n), a = i[0]) : a = n(a), t({ ...u, contents: a, expandedStates: i });
611
- }
612
- case Ke:
613
- case $e:
614
- case ze:
615
- case Se:
616
- case Ze:
617
- return t({ ...u, contents: n(u.contents) });
618
- case Ne:
619
- case it:
620
- case Qe:
621
- case Ge:
622
- case oe:
623
- case Me:
624
- return t(u);
625
- default:
626
- throw new Tt(u);
627
- }
628
- }
629
- }
630
- function ku(e, t, r) {
631
- let n = r, s = false;
632
- function u(i) {
633
- if (s) return false;
634
- let a = t(i);
635
- a !== void 0 && (s = true, n = a);
636
- }
637
- return pr(e, u), n;
638
- }
639
- function qo(e) {
640
- if (e.type === fe && e.break || e.type === oe && e.hard || e.type === Me) return true;
641
- }
642
- function re(e) {
643
- return ku(e, qo, false);
644
- }
645
- function Pu(e) {
646
- if (e.length > 0) {
647
- let t = v(false, e, -1);
648
- !t.expandedStates && !t.break && (t.break = "propagated");
649
- }
650
- return null;
651
- }
652
- function Iu(e) {
653
- let t = /* @__PURE__ */ new Set(), r = [];
654
- function n(u) {
655
- if (u.type === Me && Pu(r), u.type === fe) {
656
- if (r.push(u), t.has(u)) return false;
657
- t.add(u);
658
- }
659
- }
660
- function s(u) {
661
- u.type === fe && r.pop().break && Pu(r);
662
- }
663
- pr(e, n, s, true);
664
- }
665
- function Wo(e) {
666
- return e.type === oe && !e.hard ? e.soft ? "" : " " : e.type === he ? e.flatContents : e;
667
- }
668
- function cr(e) {
669
- return ft(e, Wo);
670
- }
671
- function Uo(e) {
672
- switch (Be(e)) {
673
- case _e:
674
- if (e.parts.every((t) => t === "")) return "";
675
- break;
676
- case fe:
677
- if (!e.contents && !e.id && !e.break && !e.expandedStates) return "";
678
- if (e.contents.type === fe && e.contents.id === e.id && e.contents.break === e.break && e.contents.expandedStates === e.expandedStates) return e.contents;
679
- break;
680
- case Ke:
681
- case $e:
682
- case ze:
683
- case Ze:
684
- if (!e.contents) return "";
685
- break;
686
- case he:
687
- if (!e.flatContents && !e.breakContents) return "";
688
- break;
689
- case ge: {
690
- let t = [];
691
- for (let r of e) {
692
- if (!r) continue;
693
- let [n, ...s] = Array.isArray(r) ? r : [r];
694
- typeof n == "string" && typeof v(false, t, -1) == "string" ? t[t.length - 1] += n : t.push(n), t.push(...s);
695
- }
696
- return t.length === 0 ? "" : t.length === 1 ? t[0] : t;
697
- }
698
- case Ne:
699
- case it:
700
- case Qe:
701
- case Ge:
702
- case oe:
703
- case Se:
704
- case Me:
705
- break;
706
- default:
707
- throw new Tt(e);
708
- }
709
- return e;
710
- }
711
- function Ut(e) {
712
- return ft(e, (t) => Uo(t));
713
- }
714
- function ve(e, t = Rr) {
715
- return ft(e, (r) => typeof r == "string" ? b(t, r.split(`
716
- `)) : r);
717
- }
718
- function Xo(e) {
719
- if (e.type === oe) return true;
720
- }
721
- function Lu(e) {
722
- return ku(e, Xo, false);
723
- }
724
- function lr(e, t) {
725
- return e.type === Se ? { ...e, contents: t(e.contents) } : t(e);
726
- }
727
- function wu(e) {
728
- let t = true;
729
- return pr(e, (r) => {
730
- switch (Be(r)) {
731
- case Ne:
732
- if (r === "") break;
733
- case Qe:
734
- case Ge:
735
- case oe:
736
- case Me:
737
- return t = false, false;
738
- }
739
- }), t;
740
- }
741
- var Wn = () => {
742
- }, Un = Wn;
743
- function D(e) {
744
- return { type: $e, contents: e };
745
- }
746
- function be(e, t) {
747
- return { type: Ke, contents: t, n: e };
748
- }
749
- function l(e, t = {}) {
750
- return Un(t.expandedStates), { type: fe, id: t.id, contents: e, break: !!t.shouldBreak, expandedStates: t.expandedStates };
751
- }
752
- function _u(e) {
753
- return be(Number.NEGATIVE_INFINITY, e);
754
- }
755
- function Jr(e) {
756
- return be(-1, e);
757
- }
758
- function tt(e, t) {
759
- return l(e[0], { ...t, expandedStates: e });
760
- }
761
- function Nr(e) {
762
- return { type: _e, parts: e };
763
- }
764
- function S(e, t = "", r = {}) {
765
- return { type: he, breakContents: e, flatContents: t, groupId: r.groupId };
766
- }
767
- function xt(e, t) {
768
- return { type: ze, contents: e, groupId: t.groupId, negate: t.negate };
769
- }
770
- function Xn(e) {
771
- return { type: Ze, contents: e };
772
- }
773
- var je = { type: Ge }, Ce = { type: Me };
774
- var Yn = { type: oe, hard: true }, Yo = { type: oe, hard: true, literal: true }, x = { type: oe }, E = { type: oe, soft: true }, F = [Yn, Ce], Rr = [Yo, Ce], mr = { type: it };
775
- function b(e, t) {
776
- let r = [];
777
- for (let n = 0; n < t.length; n++) n !== 0 && r.push(e), r.push(t[n]);
778
- return r;
779
- }
780
- function Mu(e, t, r) {
781
- let n = e;
782
- if (t > 0) {
783
- for (let s = 0; s < Math.floor(t / r); ++s) n = D(n);
784
- n = be(t % r, n), n = be(Number.NEGATIVE_INFINITY, n);
785
- }
786
- return n;
787
- }
788
- function at(e, t) {
789
- return e ? { type: Se, label: e, contents: t } : t;
790
- }
791
- function Ho(e) {
792
- if (!te(e)) return false;
793
- let t = `*${e.value}*`.split(`
794
- `);
795
- return t.length > 1 && t.every((r) => r.trimStart()[0] === "*");
796
- }
797
- var Hn = /* @__PURE__ */ new WeakMap();
798
- function Vo(e) {
799
- return Hn.has(e) || Hn.set(e, Ho(e)), Hn.get(e);
800
- }
801
- var vu = Vo;
802
- function ju(e, t) {
803
- let r = e.node;
804
- if (At(r)) return t.originalText.slice(j(r), P(r)).trimEnd();
805
- if (vu(r)) return $o(r);
806
- if (te(r)) return ["/*", ve(r.value), "*/"];
807
- throw new Error("Not a comment: " + JSON.stringify(r));
808
- }
809
- function $o(e) {
810
- let t = e.value.split(`
811
- `);
812
- return ["/*", b(F, t.map((r, n) => n === 0 ? r.trimEnd() : " " + (n < t.length - 1 ? r.trim() : r.trimStart()))), "*/"];
813
- }
814
- var ts = {};
815
- xr(ts, { endOfLine: () => rp, ownLine: () => tp, remaining: () => np });
816
- function Ko(e) {
817
- 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 || "");
818
- return r.length > 20 && (r = r.slice(0, 19) + "\u2026"), t + (r ? " " + r : "");
819
- }
820
- function Vn(e, t) {
821
- (e.comments ?? (e.comments = [])).push(t), t.printed = false, t.nodeDescription = Ko(e);
822
- }
823
- function De(e, t) {
824
- t.leading = true, t.trailing = false, Vn(e, t);
825
- }
826
- function Pe(e, t, r) {
827
- t.leading = false, t.trailing = false, r && (t.marker = r), Vn(e, t);
828
- }
829
- function z(e, t) {
830
- t.leading = false, t.trailing = true, Vn(e, t);
831
- }
832
- function Qo(e, t) {
833
- let r = null, n = t;
834
- for (; n !== r; ) r = n, n = Ye(e, n), n = _t(e, n), n = Mt(e, n), n = He(e, n);
835
- return n;
836
- }
837
- var ot = Qo;
838
- function zo(e, t) {
839
- let r = ot(e, t);
840
- return r === false ? "" : e.charAt(r);
841
- }
842
- var ke = zo;
843
- function Zo(e, t, r) {
844
- for (let n = t; n < r; ++n) if (e.charAt(n) === `
845
- `) return true;
846
- return false;
847
- }
848
- var ie = Zo;
849
- var $n = /* @__PURE__ */ new WeakMap();
850
- function ep(e) {
851
- return $n.has(e) || $n.set(e, te(e) && e.value[0] === "*" && /@(?:type|satisfies)\b/u.test(e.value)), $n.get(e);
852
- }
853
- var Gr = ep;
854
- var Ru = (e, t) => At(e) || !ie(t, j(e), P(e));
855
- function tp(e) {
856
- return [Yu, Nu, Wu, fp, up, Qn, zn, Ju, Gu, Cp, Ep, es, Xu, Ap, qu, Uu, Zn, ip, Bp, Hu].some((t) => t(e));
857
- }
858
- function rp(e) {
859
- return [sp, Wu, Nu, Xu, Qn, zn, Ju, Gu, Uu, Dp, Fp, es, xp, Zn, gp, Sp, bp, Hu].some((t) => t(e));
860
- }
861
- function np(e) {
862
- return [Yu, Qn, zn, ap, yp, qu, es, mp, lp, Zn, hp].some((t) => t(e));
863
- }
864
- function It(e, t) {
865
- let r = (e.body || e.properties).find(({ type: n }) => n !== "EmptyStatement");
866
- r ? De(r, t) : Pe(e, t);
867
- }
868
- function Kn(e, t) {
869
- e.type === "BlockStatement" ? It(e, t) : De(e, t);
870
- }
871
- function sp({ comment: e, followingNode: t }) {
872
- return t && Gr(e) ? (De(t, e), true) : false;
873
- }
874
- function Qn({ comment: e, precedingNode: t, enclosingNode: r, followingNode: n, text: s }) {
875
- if ((r == null ? void 0 : r.type) !== "IfStatement" || !n) return false;
876
- if (ke(s, P(e)) === ")") return z(t, e), true;
877
- if (t === r.consequent && n === r.alternate) {
878
- let i = ot(s, P(r.consequent));
879
- if (j(e) < i || r.alternate.type === "BlockStatement") return t.type === "BlockStatement" ? (z(t, e), true) : Ru(e, s) && !ie(s, j(t), j(e)) ? (z(t, e), true) : (Pe(r, e), true);
880
- }
881
- return n.type === "BlockStatement" ? (It(n, e), true) : n.type === "IfStatement" ? (Kn(n.consequent, e), true) : r.consequent === n ? (De(n, e), true) : false;
882
- }
883
- function zn({ comment: e, precedingNode: t, enclosingNode: r, followingNode: n, text: s }) {
884
- return (r == null ? void 0 : r.type) !== "WhileStatement" || !n ? false : ke(s, P(e)) === ")" ? (z(t, e), true) : n.type === "BlockStatement" ? (It(n, e), true) : r.body === n ? (De(n, e), true) : false;
885
- }
886
- function Ju({ comment: e, precedingNode: t, enclosingNode: r, followingNode: n }) {
887
- return (r == null ? void 0 : r.type) !== "TryStatement" && (r == null ? void 0 : r.type) !== "CatchClause" || !n ? false : r.type === "CatchClause" && t ? (z(t, e), true) : n.type === "BlockStatement" ? (It(n, e), true) : n.type === "TryStatement" ? (Kn(n.finalizer, e), true) : n.type === "CatchClause" ? (Kn(n.body, e), true) : false;
888
- }
889
- function up({ comment: e, enclosingNode: t, followingNode: r }) {
890
- return G(t) && (r == null ? void 0 : r.type) === "Identifier" ? (De(t, e), true) : false;
891
- }
892
- function ip({ comment: e, enclosingNode: t, followingNode: r, options: n }) {
893
- return !n.experimentalTernaries || !((t == null ? void 0 : t.type) === "ConditionalExpression" || Je(t)) ? false : (r == null ? void 0 : r.type) === "ConditionalExpression" || Je(r) ? (Pe(t, e), true) : false;
894
- }
895
- function Nu({ comment: e, precedingNode: t, enclosingNode: r, followingNode: n, text: s, options: u }) {
896
- let i = t && !ie(s, P(t), j(e));
897
- return (!t || !i) && ((r == null ? void 0 : r.type) === "ConditionalExpression" || Je(r)) && n ? u.experimentalTernaries && r.alternate === n && !(te(e) && !ie(u.originalText, j(e), P(e))) ? (Pe(r, e), true) : (De(n, e), true) : false;
898
- }
899
- function ap({ comment: e, precedingNode: t, enclosingNode: r }) {
900
- return Te(r) && r.shorthand && r.key === t && r.value.type === "AssignmentPattern" ? (z(r.value.left, e), true) : false;
901
- }
902
- var op = /* @__PURE__ */ new Set(["ClassDeclaration", "ClassExpression", "DeclareClass", "DeclareInterface", "InterfaceDeclaration", "TSInterfaceDeclaration"]);
903
- function Gu({ comment: e, precedingNode: t, enclosingNode: r, followingNode: n }) {
904
- if (op.has(r == null ? void 0 : r.type)) {
905
- if (O(r.decorators) && (n == null ? void 0 : n.type) !== "Decorator") return z(v(false, r.decorators, -1), e), true;
906
- if (r.body && n === r.body) return It(r.body, e), true;
907
- if (n) {
908
- if (r.superClass && n === r.superClass && t && (t === r.id || t === r.typeParameters)) return z(t, e), true;
909
- 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) ? z(t, e) : Pe(r, e, s), true;
910
- }
911
- }
912
- return false;
913
- }
914
- var pp = /* @__PURE__ */ new Set(["ClassMethod", "ClassProperty", "PropertyDefinition", "TSAbstractPropertyDefinition", "TSAbstractMethodDefinition", "TSDeclareMethod", "MethodDefinition", "ClassAccessorProperty", "AccessorProperty", "TSAbstractAccessorProperty", "TSParameterProperty"]);
915
- function qu({ comment: e, precedingNode: t, enclosingNode: r, text: n }) {
916
- return r && t && ke(n, P(e)) === "(" && (r.type === "Property" || r.type === "TSDeclareMethod" || r.type === "TSAbstractMethodDefinition") && t.type === "Identifier" && r.key === t && ke(n, P(t)) !== ":" ? (z(t, e), true) : (t == null ? void 0 : t.type) === "Decorator" && pp.has(r == null ? void 0 : r.type) && (At(e) || e.placement === "ownLine") ? (z(t, e), true) : false;
917
- }
918
- var cp = /* @__PURE__ */ new Set(["FunctionDeclaration", "FunctionExpression", "ClassMethod", "MethodDefinition", "ObjectMethod"]);
919
- function lp({ comment: e, precedingNode: t, enclosingNode: r, text: n }) {
920
- return ke(n, P(e)) !== "(" ? false : t && cp.has(r == null ? void 0 : r.type) ? (z(t, e), true) : false;
921
- }
922
- function mp({ comment: e, enclosingNode: t, text: r }) {
923
- if ((t == null ? void 0 : t.type) !== "ArrowFunctionExpression") return false;
924
- let n = ot(r, P(e));
925
- return n !== false && r.slice(n, n + 2) === "=>" ? (Pe(t, e), true) : false;
926
- }
927
- function yp({ comment: e, enclosingNode: t, text: r }) {
928
- return ke(r, P(e)) !== ")" ? false : t && (Vu(t) && Q(t).length === 0 || yt(t) && le(t).length === 0) ? (Pe(t, e), true) : ((t == null ? void 0 : t.type) === "MethodDefinition" || (t == null ? void 0 : t.type) === "TSAbstractMethodDefinition") && Q(t.value).length === 0 ? (Pe(t.value, e), true) : false;
929
- }
930
- function fp({ comment: e, precedingNode: t, enclosingNode: r, followingNode: n, text: s }) {
931
- 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" ? (z(t, e), true) : ((t == null ? void 0 : t.type) === "ComponentParameter" || (t == null ? void 0 : t.type) === "RestElement") && (r == null ? void 0 : r.type) === "ComponentDeclaration" && ke(s, P(e)) === ")" ? (z(t, e), true) : false;
932
- }
933
- function Wu({ comment: e, precedingNode: t, enclosingNode: r, followingNode: n, text: s }) {
934
- return (t == null ? void 0 : t.type) === "FunctionTypeParam" && (r == null ? void 0 : r.type) === "FunctionTypeAnnotation" && (n == null ? void 0 : n.type) !== "FunctionTypeParam" ? (z(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") && Vu(r) && ke(s, P(e)) === ")" ? (z(t, e), true) : !te(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 && ot(s, P(e)) === j(n) ? (It(n, e), true) : false;
935
- }
936
- function Uu({ comment: e, enclosingNode: t }) {
937
- return (t == null ? void 0 : t.type) === "LabeledStatement" ? (De(t, e), true) : false;
938
- }
939
- function Zn({ comment: e, enclosingNode: t }) {
940
- return ((t == null ? void 0 : t.type) === "ContinueStatement" || (t == null ? void 0 : t.type) === "BreakStatement") && !t.label ? (z(t, e), true) : false;
941
- }
942
- function Dp({ comment: e, precedingNode: t, enclosingNode: r }) {
943
- return w(r) && t && r.callee === t && r.arguments.length > 0 ? (De(r.arguments[0], e), true) : false;
944
- }
945
- function Ep({ comment: e, precedingNode: t, enclosingNode: r, followingNode: n }) {
946
- return Oe(r) ? (or(e) && (n.prettierIgnore = true, e.unignore = true), t ? (z(t, e), true) : false) : (Oe(n) && or(e) && (n.types[0].prettierIgnore = true, e.unignore = true), false);
947
- }
948
- function Fp({ comment: e, enclosingNode: t }) {
949
- return Te(t) ? (De(t, e), true) : false;
950
- }
951
- function es({ comment: e, enclosingNode: t, ast: r, isLastComment: n }) {
952
- var s;
953
- return ((s = r == null ? void 0 : r.body) == null ? void 0 : s.length) === 0 ? (n ? Pe(r, e) : De(r, e), true) : (t == null ? void 0 : t.type) === "Program" && t.body.length === 0 && !O(t.directives) ? (n ? Pe(t, e) : De(t, e), true) : false;
954
- }
955
- function Cp({ comment: e, enclosingNode: t }) {
956
- return (t == null ? void 0 : t.type) === "ForInStatement" || (t == null ? void 0 : t.type) === "ForOfStatement" ? (De(t, e), true) : false;
957
- }
958
- function Xu({ comment: e, precedingNode: t, enclosingNode: r, text: n }) {
959
- if ((r == null ? void 0 : r.type) === "ImportSpecifier" || (r == null ? void 0 : r.type) === "ExportSpecifier") return De(r, e), true;
960
- 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";
961
- return (s || u) && ee(n, P(e)) ? (z(t, e), true) : false;
962
- }
963
- function Ap({ comment: e, enclosingNode: t }) {
964
- return (t == null ? void 0 : t.type) === "AssignmentPattern" ? (De(t, e), true) : false;
965
- }
966
- var dp = /* @__PURE__ */ new Set(["VariableDeclarator", "AssignmentExpression", "TypeAlias", "TSTypeAliasDeclaration"]), Tp = /* @__PURE__ */ new Set(["ObjectExpression", "ArrayExpression", "TemplateLiteral", "TaggedTemplateExpression", "ObjectTypeAnnotation", "TSTypeLiteral"]);
967
- function xp({ comment: e, enclosingNode: t, followingNode: r }) {
968
- return dp.has(t == null ? void 0 : t.type) && r && (Tp.has(r.type) || te(e)) ? (De(r, e), true) : false;
969
- }
970
- function hp({ comment: e, enclosingNode: t, followingNode: r, text: n }) {
971
- return !r && ((t == null ? void 0 : t.type) === "TSMethodSignature" || (t == null ? void 0 : t.type) === "TSDeclareFunction" || (t == null ? void 0 : t.type) === "TSAbstractMethodDefinition") && ke(n, P(e)) === ";" ? (z(t, e), true) : false;
972
- }
973
- function Yu({ comment: e, enclosingNode: t, followingNode: r }) {
974
- if (or(e) && (t == null ? void 0 : t.type) === "TSMappedType" && r === t.key) return t.prettierIgnore = true, e.unignore = true, true;
975
- }
976
- function Hu({ comment: e, precedingNode: t, enclosingNode: r }) {
977
- if ((r == null ? void 0 : r.type) === "TSMappedType" && !t) return Pe(r, e), true;
978
- }
979
- function gp({ comment: e, enclosingNode: t, followingNode: r }) {
980
- return !t || t.type !== "SwitchCase" || t.test || !r || r !== t.consequent[0] ? false : (r.type === "BlockStatement" && At(e) ? It(r, e) : Pe(t, e), true);
981
- }
982
- function Sp({ comment: e, precedingNode: t, enclosingNode: r, followingNode: n }) {
983
- return Oe(t) && ((r.type === "TSArrayType" || r.type === "ArrayTypeAnnotation") && !n || qt(r)) ? (z(v(false, t.types, -1), e), true) : false;
984
- }
985
- function Bp({ comment: e, enclosingNode: t, precedingNode: r, followingNode: n }) {
986
- if (((t == null ? void 0 : t.type) === "ObjectPattern" || (t == null ? void 0 : t.type) === "ArrayPattern") && (n == null ? void 0 : n.type) === "TSTypeAnnotation") return r ? z(r, e) : Pe(t, e), true;
987
- }
988
- function bp({ comment: e, precedingNode: t, enclosingNode: r, followingNode: n, text: s }) {
989
- return !n && (r == null ? void 0 : r.type) === "UnaryExpression" && ((t == null ? void 0 : t.type) === "LogicalExpression" || (t == null ? void 0 : t.type) === "BinaryExpression") && ie(s, j(r.argument), j(t.right)) && Ru(e, s) && !ie(s, j(t.right), j(e)) ? (z(t.right, e), true) : false;
990
- }
991
- var Vu = R(["ArrowFunctionExpression", "FunctionExpression", "FunctionDeclaration", "ObjectMethod", "ClassMethod", "TSDeclareFunction", "TSCallSignatureDeclaration", "TSConstructSignatureDeclaration", "TSMethodSignature", "TSConstructorType", "TSFunctionType", "TSDeclareMethod"]);
992
- var Pp = /* @__PURE__ */ new Set(["EmptyStatement", "TemplateElement", "TSEmptyBodyFunctionExpression", "ChainExpression"]);
993
- function kp(e) {
994
- return !Pp.has(e.type);
995
- }
996
- function Ip(e, t) {
997
- var r;
998
- if ((t.parser === "typescript" || t.parser === "flow" || t.parser === "hermes" || t.parser === "acorn" || t.parser === "oxc" || t.parser === "oxc-ts" || t.parser === "espree" || t.parser === "meriyah" || t.parser === "__babel_estree") && e.type === "MethodDefinition" && ((r = e.value) == null ? void 0 : r.type) === "FunctionExpression" && Q(e.value).length === 0 && !e.value.returnType && !O(e.value.typeParameters) && e.value.body) return [...e.decorators || [], e.key, e.value.body];
999
- }
1000
- function rs(e) {
1001
- let { node: t, parent: r } = e;
1002
- return (Y(t) || r && (r.type === "JSXSpreadAttribute" || r.type === "JSXSpreadChild" || Oe(r) || (r.type === "ClassDeclaration" || r.type === "ClassExpression") && r.superClass === t)) && (!kt(t) || Oe(r));
1003
- }
1004
- function Lp(e, { parser: t }) {
1005
- if (t === "flow" || t === "hermes" || t === "babel-flow") return e = X(false, e, /[\s(]/gu, ""), e === "" || e === "/*" || e === "/*::";
1006
- }
1007
- function $u(e) {
1008
- switch (e) {
1009
- case "cr":
1010
- return "\r";
1011
- case "crlf":
1012
- return `\r
1013
- `;
1014
- default:
1015
- return `
1016
- `;
1017
- }
1018
- }
1019
- var Ie = Symbol("MODE_BREAK"), pt = Symbol("MODE_FLAT"), Xt = Symbol("cursor"), ns = Symbol("DOC_FILL_PRINTED_LENGTH");
1020
- function Ku() {
1021
- return { value: "", length: 0, queue: [] };
1022
- }
1023
- function wp(e, t) {
1024
- return ss(e, { type: "indent" }, t);
1025
- }
1026
- function Op(e, t, r) {
1027
- return t === Number.NEGATIVE_INFINITY ? e.root || Ku() : t < 0 ? ss(e, { type: "dedent" }, r) : t ? t.type === "root" ? { ...e, root: e } : ss(e, { type: typeof t == "string" ? "stringAlign" : "numberAlign", n: t }, r) : e;
1028
- }
1029
- function ss(e, t, r) {
1030
- let n = t.type === "dedent" ? e.queue.slice(0, -1) : [...e.queue, t], s = "", u = 0, i = 0, a = 0;
1031
- for (let c of n) switch (c.type) {
1032
- case "indent":
1033
- m(), r.useTabs ? o(1) : p(r.tabWidth);
1034
- break;
1035
- case "stringAlign":
1036
- m(), s += c.n, u += c.n.length;
1037
- break;
1038
- case "numberAlign":
1039
- i += 1, a += c.n;
1040
- break;
1041
- default:
1042
- throw new Error(`Unexpected type '${c.type}'`);
1043
- }
1044
- return y(), { ...e, value: s, length: u, queue: n };
1045
- function o(c) {
1046
- s += " ".repeat(c), u += r.tabWidth * c;
1047
- }
1048
- function p(c) {
1049
- s += " ".repeat(c), u += c;
1050
- }
1051
- function m() {
1052
- r.useTabs ? f() : y();
1053
- }
1054
- function f() {
1055
- i > 0 && o(i), C();
1056
- }
1057
- function y() {
1058
- a > 0 && p(a), C();
1059
- }
1060
- function C() {
1061
- i = 0, a = 0;
1062
- }
1063
- }
1064
- function us(e) {
1065
- let t = 0, r = 0, n = e.length;
1066
- e: for (; n--; ) {
1067
- let s = e[n];
1068
- if (s === Xt) {
1069
- r++;
1070
- continue;
1071
- }
1072
- for (let u = s.length - 1; u >= 0; u--) {
1073
- let i = s[u];
1074
- if (i === " " || i === " ") t++;
1075
- else {
1076
- e[n] = s.slice(0, u + 1);
1077
- break e;
1078
- }
1079
- }
1080
- }
1081
- if (t > 0 || r > 0) for (e.length = n + 1; r-- > 0; ) e.push(Xt);
1082
- return t;
1083
- }
1084
- function qr(e, t, r, n, s, u) {
1085
- if (r === Number.POSITIVE_INFINITY) return true;
1086
- let i = t.length, a = [e], o = [];
1087
- for (; r >= 0; ) {
1088
- if (a.length === 0) {
1089
- if (i === 0) return true;
1090
- a.push(t[--i]);
1091
- continue;
1092
- }
1093
- let { mode: p, doc: m } = a.pop(), f = Be(m);
1094
- switch (f) {
1095
- case Ne:
1096
- o.push(m), r -= st(m);
1097
- break;
1098
- case ge:
1099
- case _e: {
1100
- let y = f === ge ? m : m.parts, C = m[ns] ?? 0;
1101
- for (let c = y.length - 1; c >= C; c--) a.push({ mode: p, doc: y[c] });
1102
- break;
1103
- }
1104
- case $e:
1105
- case Ke:
1106
- case ze:
1107
- case Se:
1108
- a.push({ mode: p, doc: m.contents });
1109
- break;
1110
- case Qe:
1111
- r += us(o);
1112
- break;
1113
- case fe: {
1114
- if (u && m.break) return false;
1115
- let y = m.break ? Ie : p, C = m.expandedStates && y === Ie ? v(false, m.expandedStates, -1) : m.contents;
1116
- a.push({ mode: y, doc: C });
1117
- break;
1118
- }
1119
- case he: {
1120
- let C = (m.groupId ? s[m.groupId] || pt : p) === Ie ? m.breakContents : m.flatContents;
1121
- C && a.push({ mode: p, doc: C });
1122
- break;
1123
- }
1124
- case oe:
1125
- if (p === Ie || m.hard) return true;
1126
- m.soft || (o.push(" "), r--);
1127
- break;
1128
- case Ze:
1129
- n = true;
1130
- break;
1131
- case Ge:
1132
- if (n) return false;
1133
- break;
1134
- }
1135
- }
1136
- return false;
1137
- }
1138
- function is(e, t) {
1139
- let r = {}, n = t.printWidth, s = $u(t.endOfLine), u = 0, i = [{ ind: Ku(), mode: Ie, doc: e }], a = [], o = false, p = [], m = 0;
1140
- for (Iu(e); i.length > 0; ) {
1141
- let { ind: y, mode: C, doc: c } = i.pop();
1142
- switch (Be(c)) {
1143
- case Ne: {
1144
- let A = s !== `
1145
- ` ? X(false, c, `
1146
- `, s) : c;
1147
- a.push(A), i.length > 0 && (u += st(A));
1148
- break;
1149
- }
1150
- case ge:
1151
- for (let A = c.length - 1; A >= 0; A--) i.push({ ind: y, mode: C, doc: c[A] });
1152
- break;
1153
- case it:
1154
- if (m >= 2) throw new Error("There are too many 'cursor' in doc.");
1155
- a.push(Xt), m++;
1156
- break;
1157
- case $e:
1158
- i.push({ ind: wp(y, t), mode: C, doc: c.contents });
1159
- break;
1160
- case Ke:
1161
- i.push({ ind: Op(y, c.n, t), mode: C, doc: c.contents });
1162
- break;
1163
- case Qe:
1164
- u -= us(a);
1165
- break;
1166
- case fe:
1167
- switch (C) {
1168
- case pt:
1169
- if (!o) {
1170
- i.push({ ind: y, mode: c.break ? Ie : pt, doc: c.contents });
1171
- break;
1172
- }
1173
- case Ie: {
1174
- o = false;
1175
- let A = { ind: y, mode: pt, doc: c.contents }, T = n - u, B = p.length > 0;
1176
- if (!c.break && qr(A, i, T, B, r)) i.push(A);
1177
- else if (c.expandedStates) {
1178
- let g = v(false, c.expandedStates, -1);
1179
- if (c.break) {
1180
- i.push({ ind: y, mode: Ie, doc: g });
1181
- break;
1182
- } else for (let _ = 1; _ < c.expandedStates.length + 1; _++) if (_ >= c.expandedStates.length) {
1183
- i.push({ ind: y, mode: Ie, doc: g });
1184
- break;
1185
- } else {
1186
- let M = c.expandedStates[_], J = { ind: y, mode: pt, doc: M };
1187
- if (qr(J, i, T, B, r)) {
1188
- i.push(J);
1189
- break;
1190
- }
1191
- }
1192
- } else i.push({ ind: y, mode: Ie, doc: c.contents });
1193
- break;
1194
- }
1195
- }
1196
- c.id && (r[c.id] = v(false, i, -1).mode);
1197
- break;
1198
- case _e: {
1199
- let A = n - u, T = c[ns] ?? 0, { parts: B } = c, g = B.length - T;
1200
- if (g === 0) break;
1201
- let _ = B[T + 0], M = B[T + 1], J = { ind: y, mode: pt, doc: _ }, I = { ind: y, mode: Ie, doc: _ }, q = qr(J, [], A, p.length > 0, r, true);
1202
- if (g === 1) {
1203
- q ? i.push(J) : i.push(I);
1204
- break;
1205
- }
1206
- let k = { ind: y, mode: pt, doc: M }, W = { ind: y, mode: Ie, doc: M };
1207
- if (g === 2) {
1208
- q ? i.push(k, J) : i.push(W, I);
1209
- break;
1210
- }
1211
- let ne = B[T + 2], Z = { ind: y, mode: C, doc: { ...c, [ns]: T + 2 } };
1212
- qr({ ind: y, mode: pt, doc: [_, M, ne] }, [], A, p.length > 0, r, true) ? i.push(Z, k, J) : q ? i.push(Z, W, J) : i.push(Z, W, I);
1213
- break;
1214
- }
1215
- case he:
1216
- case ze: {
1217
- let A = c.groupId ? r[c.groupId] : C;
1218
- if (A === Ie) {
1219
- let T = c.type === he ? c.breakContents : c.negate ? c.contents : D(c.contents);
1220
- T && i.push({ ind: y, mode: C, doc: T });
1221
- }
1222
- if (A === pt) {
1223
- let T = c.type === he ? c.flatContents : c.negate ? D(c.contents) : c.contents;
1224
- T && i.push({ ind: y, mode: C, doc: T });
1225
- }
1226
- break;
1227
- }
1228
- case Ze:
1229
- p.push({ ind: y, mode: C, doc: c.contents });
1230
- break;
1231
- case Ge:
1232
- p.length > 0 && i.push({ ind: y, mode: C, doc: Yn });
1233
- break;
1234
- case oe:
1235
- switch (C) {
1236
- case pt:
1237
- if (c.hard) o = true;
1238
- else {
1239
- c.soft || (a.push(" "), u += 1);
1240
- break;
1241
- }
1242
- case Ie:
1243
- if (p.length > 0) {
1244
- i.push({ ind: y, mode: C, doc: c }, ...p.reverse()), p.length = 0;
1245
- break;
1246
- }
1247
- c.literal ? y.root ? (a.push(s, y.root.value), u = y.root.length) : (a.push(s), u = 0) : (u -= us(a), a.push(s + y.value), u = y.length);
1248
- break;
1249
- }
1250
- break;
1251
- case Se:
1252
- i.push({ ind: y, mode: C, doc: c.contents });
1253
- break;
1254
- case Me:
1255
- break;
1256
- default:
1257
- throw new Tt(c);
1258
- }
1259
- i.length === 0 && p.length > 0 && (i.push(...p.reverse()), p.length = 0);
1260
- }
1261
- let f = a.indexOf(Xt);
1262
- if (f !== -1) {
1263
- let y = a.indexOf(Xt, f + 1);
1264
- if (y === -1) return { formatted: a.filter((T) => T !== Xt).join("") };
1265
- let C = a.slice(0, f).join(""), c = a.slice(f + 1, y).join(""), A = a.slice(y + 1).join("");
1266
- return { formatted: C + c + A, cursorNodeStart: C.length, cursorNodeText: c };
1267
- }
1268
- return { formatted: a.join("") };
1269
- }
1270
- function _p(e, t, r = 0) {
1271
- let n = 0;
1272
- for (let s = r; s < e.length; ++s) e[s] === " " ? n = n + t - n % t : n++;
1273
- return n;
1274
- }
1275
- var Qu = _p;
1276
- function Mp(e, t) {
1277
- let r = e.lastIndexOf(`
1278
- `);
1279
- return r === -1 ? 0 : Qu(e.slice(r + 1).match(/^[\t ]*/u)[0], t);
1280
- }
1281
- var zu = Mp;
1282
- function Wr(e, t, r) {
1283
- let { node: n } = e;
1284
- if (n.type === "TemplateLiteral" && Rp(e)) {
1285
- let p = vp(e, t, r);
1286
- if (p) return p;
1287
- }
1288
- let u = "expressions";
1289
- n.type === "TSTemplateLiteralType" && (u = "types");
1290
- let i = [], a = e.map(r, u);
1291
- i.push(je, "`");
1292
- let o = 0;
1293
- return e.each(({ index: p, node: m }) => {
1294
- if (i.push(r()), m.tail) return;
1295
- let { tabWidth: f } = t, y = m.value.raw, C = y.includes(`
1296
- `) ? zu(y, f) : o;
1297
- o = C;
1298
- let c = a[p], A = n[u][p], T = ie(t.originalText, P(m), j(n.quasis[p + 1]));
1299
- if (!T) {
1300
- let g = is(c, { ...t, printWidth: Number.POSITIVE_INFINITY }).formatted;
1301
- g.includes(`
1302
- `) ? T = true : c = g;
1303
- }
1304
- T && (d(A) || A.type === "Identifier" || G(A) || A.type === "ConditionalExpression" || A.type === "SequenceExpression" || xe(A) || Fe(A)) && (c = [D([E, c]), E]);
1305
- let B = C === 0 && y.endsWith(`
1306
- `) ? be(Number.NEGATIVE_INFINITY, c) : Mu(c, C, f);
1307
- i.push(l(["${", B, je, "}"]));
1308
- }, "quasis"), i.push("`"), i;
1309
- }
1310
- function Zu(e, t, r) {
1311
- let n = r("quasi"), { node: s } = e, u = "", i = Ve(s.quasi, h.Leading)[0];
1312
- return i && (ie(t.originalText, P(s.typeArguments ?? s.typeParameters ?? s.tag), j(i)) ? u = E : u = " "), at(n.label && { tagged: true, ...n.label }, [r("tag"), r(s.typeArguments ? "typeArguments" : "typeParameters"), u, je, n]);
1313
- }
1314
- function vp(e, t, r) {
1315
- let { node: n } = e, s = n.quasis[0].value.raw.trim().split(/\s*\|\s*/u);
1316
- if (s.length > 1 || s.some((u) => u.length > 0)) {
1317
- t.__inJestEach = true;
1318
- let u = e.map(r, "expressions");
1319
- t.__inJestEach = false;
1320
- let i = [], a = u.map((y) => "${" + is(y, { ...t, printWidth: Number.POSITIVE_INFINITY, endOfLine: "lf" }).formatted + "}"), o = [{ hasLineBreak: false, cells: [] }];
1321
- for (let y = 1; y < n.quasis.length; y++) {
1322
- let C = v(false, o, -1), c = a[y - 1];
1323
- C.cells.push(c), c.includes(`
1324
- `) && (C.hasLineBreak = true), n.quasis[y].value.raw.includes(`
1325
- `) && o.push({ hasLineBreak: false, cells: [] });
1326
- }
1327
- let p = Math.max(s.length, ...o.map((y) => y.cells.length)), m = Array.from({ length: p }).fill(0), f = [{ cells: s }, ...o.filter((y) => y.cells.length > 0)];
1328
- for (let { cells: y } of f.filter((C) => !C.hasLineBreak)) for (let [C, c] of y.entries()) m[C] = Math.max(m[C], st(c));
1329
- return i.push(je, "`", D([F, b(F, f.map((y) => b(" | ", y.cells.map((C, c) => y.hasLineBreak ? C : C + " ".repeat(m[c] - st(C))))))]), F, "`"), i;
1330
- }
1331
- }
1332
- function jp(e, t) {
1333
- let { node: r } = e, n = t();
1334
- return d(r) && (n = l([D([E, n]), E])), ["${", n, je, "}"];
1335
- }
1336
- function Yt(e, t) {
1337
- return e.map((r) => jp(r, t), "expressions");
1338
- }
1339
- function Ur(e, t) {
1340
- return ft(e, (r) => typeof r == "string" ? t ? X(false, r, /(\\*)`/gu, "$1$1\\`") : as(r) : r);
1341
- }
1342
- function as(e) {
1343
- return X(false, e, /([\\`]|\$\{)/gu, String.raw`\$1`);
1344
- }
1345
- function Rp({ node: e, parent: t }) {
1346
- let r = /^[fx]?(?:describe|it|test)$/u;
1347
- 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));
1348
- }
1349
- var ps = [(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"];
1350
- function ei(e) {
1351
- let t = (n) => n.type === "TemplateLiteral", r = (n, s) => Te(n) && !n.computed && n.key.type === "Identifier" && n.key.name === "styles" && s === "value";
1352
- return e.match(t, (n, s) => U(n) && s === "elements", r, ...ps) || e.match(t, r, ...ps);
1353
- }
1354
- function ti(e) {
1355
- return e.match((t) => t.type === "TemplateLiteral", (t, r) => Te(t) && !t.computed && t.key.type === "Identifier" && t.key.name === "template" && r === "value", ...ps);
1356
- }
1357
- function os(e, t) {
1358
- return d(e, h.Block | h.Leading, ({ value: r }) => r === ` ${t} `);
1359
- }
1360
- function Xr({ node: e, parent: t }, r) {
1361
- return os(e, r) || Jp(t) && os(t, r) || t.type === "ExpressionStatement" && os(t, r);
1362
- }
1363
- function Jp(e) {
1364
- return e.type === "AsConstExpression" || e.type === "TSAsExpression" && e.typeAnnotation.type === "TSTypeReference" && e.typeAnnotation.typeName.type === "Identifier" && e.typeAnnotation.typeName.name === "const";
1365
- }
1366
- async function Np(e, t, r) {
1367
- let { node: n } = r, s = n.quasis.map((m) => m.value.raw), u = 0, i = s.reduce((m, f, y) => y === 0 ? f : m + "@prettier-placeholder-" + u++ + "-id" + f, ""), a = await e(i, { parser: "scss" }), o = Yt(r, t), p = Gp(a, o);
1368
- if (!p) throw new Error("Couldn't insert all the expressions");
1369
- return ["`", D([F, p]), E, "`"];
1370
- }
1371
- function Gp(e, t) {
1372
- if (!O(t)) return e;
1373
- let r = 0, n = ft(Ut(e), (s) => typeof s != "string" || !s.includes("@prettier-placeholder") ? s : s.split(/@prettier-placeholder-(\d+)-id/u).map((u, i) => i % 2 === 0 ? ve(u) : (r++, t[u])));
1374
- return t.length === r ? n : null;
1375
- }
1376
- function qp({ node: e, parent: t, grandparent: r }) {
1377
- 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");
1378
- }
1379
- function Yr(e) {
1380
- return e.type === "Identifier" && e.name === "styled";
1381
- }
1382
- function ri(e) {
1383
- return /^[A-Z]/u.test(e.object.name) && e.property.name === "extend";
1384
- }
1385
- function Wp({ parent: e }) {
1386
- if (!e || e.type !== "TaggedTemplateExpression") return false;
1387
- let t = e.tag.type === "ParenthesizedExpression" ? e.tag.expression : e.tag;
1388
- switch (t.type) {
1389
- case "MemberExpression":
1390
- return Yr(t.object) || ri(t);
1391
- case "CallExpression":
1392
- return Yr(t.callee) || t.callee.type === "MemberExpression" && (t.callee.object.type === "MemberExpression" && (Yr(t.callee.object.object) || ri(t.callee.object)) || t.callee.object.type === "CallExpression" && Yr(t.callee.object.callee));
1393
- case "Identifier":
1394
- return t.name === "css";
1395
- default:
1396
- return false;
1397
- }
1398
- }
1399
- function Up({ parent: e, grandparent: t }) {
1400
- return (t == null ? void 0 : t.type) === "JSXAttribute" && e.type === "JSXExpressionContainer" && t.name.type === "JSXIdentifier" && t.name.name === "css";
1401
- }
1402
- function Xp(e) {
1403
- if (qp(e) || Wp(e) || Up(e) || ei(e)) return Np;
1404
- }
1405
- var ni = Xp;
1406
- async function Yp(e, t, r) {
1407
- let { node: n } = r, s = n.quasis.length, u = Yt(r, t), i = [];
1408
- for (let a = 0; a < s; a++) {
1409
- let o = n.quasis[a], p = a === 0, m = a === s - 1, f = o.value.cooked, y = f.split(`
1410
- `), C = y.length, c = u[a], A = C > 2 && y[0].trim() === "" && y[1].trim() === "", T = C > 2 && y[C - 1].trim() === "" && y[C - 2].trim() === "", B = y.every((_) => /^\s*(?:#[^\n\r]*)?$/u.test(_));
1411
- if (!m && /#[^\n\r]*$/u.test(y[C - 1])) return null;
1412
- let g = null;
1413
- B ? g = Hp(y) : g = await e(f, { parser: "graphql" }), g ? (g = Ur(g, false), !p && A && i.push(""), i.push(g), !m && T && i.push("")) : !p && !m && A && i.push(""), c && i.push(c);
1414
- }
1415
- return ["`", D([F, b(F, i)]), F, "`"];
1416
- }
1417
- function Hp(e) {
1418
- let t = [], r = false, n = e.map((s) => s.trim());
1419
- for (let [s, u] of n.entries()) u !== "" && (n[s - 1] === "" && r ? t.push([F, u]) : t.push(u), r = true);
1420
- return t.length === 0 ? null : b(F, t);
1421
- }
1422
- function Vp({ node: e, parent: t }) {
1423
- return Xr({ 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");
1424
- }
1425
- function $p(e) {
1426
- if (Vp(e)) return Yp;
1427
- }
1428
- var si = $p;
1429
- var cs = 0;
1430
- async function ui(e, t, r, n, s) {
1431
- let { node: u } = n, i = cs;
1432
- cs = cs + 1 >>> 0;
1433
- let a = (B) => `PRETTIER_HTML_PLACEHOLDER_${B}_${i}_IN_JS`, o = u.quasis.map((B, g, _) => g === _.length - 1 ? B.value.cooked : B.value.cooked + a(g)).join(""), p = Yt(n, r), m = new RegExp(a(String.raw`(\d+)`), "gu"), f = 0, y = await t(o, { parser: e, __onHtmlRoot(B) {
1434
- f = B.children.length;
1435
- } }), C = ft(y, (B) => {
1436
- if (typeof B != "string") return B;
1437
- let g = [], _ = B.split(m);
1438
- for (let M = 0; M < _.length; M++) {
1439
- let J = _[M];
1440
- if (M % 2 === 0) {
1441
- J && (J = as(J), s.__embeddedInHtml && (J = X(false, J, /<\/(?=script\b)/giu, String.raw`<\/`)), g.push(J));
1442
- continue;
1443
- }
1444
- let I = Number(J);
1445
- g.push(p[I]);
1446
- }
1447
- return g;
1448
- }), c = /^\s/u.test(o) ? " " : "", A = /\s$/u.test(o) ? " " : "", T = s.htmlWhitespaceSensitivity === "ignore" ? F : c && A ? x : null;
1449
- return T ? l(["`", D([T, l(C)]), T, "`"]) : at({ hug: false }, l(["`", c, f > 1 ? D(l(C)) : l(C), A, "`"]));
1450
- }
1451
- function Kp(e) {
1452
- return Xr(e, "HTML") || e.match((t) => t.type === "TemplateLiteral", (t, r) => t.type === "TaggedTemplateExpression" && t.tag.type === "Identifier" && t.tag.name === "html" && r === "quasi");
1453
- }
1454
- var Qp = ui.bind(void 0, "html"), zp = ui.bind(void 0, "angular");
1455
- function Zp(e) {
1456
- if (Kp(e)) return Qp;
1457
- if (ti(e)) return zp;
1458
- }
1459
- var ii = Zp;
1460
- async function ec(e, t, r) {
1461
- let { node: n } = r, s = X(false, n.quasis[0].value.raw, /((?:\\\\)*)\\`/gu, (o, p) => "\\".repeat(p.length / 2) + "`"), u = tc(s), i = u !== "";
1462
- i && (s = X(false, s, new RegExp(`^${u}`, "gmu"), ""));
1463
- let a = Ur(await e(s, { parser: "markdown", __inJsTemplate: true }), true);
1464
- return ["`", i ? D([E, a]) : [Rr, _u(a)], E, "`"];
1465
- }
1466
- function tc(e) {
1467
- let t = e.match(/^([^\S\n]*)\S/mu);
1468
- return t === null ? "" : t[1];
1469
- }
1470
- function rc(e) {
1471
- if (nc(e)) return ec;
1472
- }
1473
- function nc({ node: e, parent: t }) {
1474
- return (t == null ? void 0 : t.type) === "TaggedTemplateExpression" && e.quasis.length === 1 && t.tag.type === "Identifier" && (t.tag.name === "md" || t.tag.name === "markdown");
1475
- }
1476
- var ai = rc;
1477
- function sc(e) {
1478
- let { node: t } = e;
1479
- if (t.type !== "TemplateLiteral" || uc(t)) return;
1480
- let r;
1481
- for (let n of [ni, si, ii, ai]) if (r = n(e), !!r) return t.quasis.length === 1 && t.quasis[0].value.raw.trim() === "" ? "``" : async (...s) => {
1482
- let u = await r(...s);
1483
- return u && at({ embed: true, ...u.label }, u);
1484
- };
1485
- }
1486
- function uc({ quasis: e }) {
1487
- return e.some(({ value: { cooked: t } }) => t === null);
1488
- }
1489
- var oi = sc;
1490
- var ic = /\*\/$/, ac = /^\/\*\*?/, mi = /^\s*(\/\*\*?(.|\r?\n)*?\*\/)/, oc = /(^|\s+)\/\/([^\n\r]*)/g, pi = /^(\r?\n)+/, pc = /(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g, ci = /(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g, cc = /(\r?\n|^) *\* ?/g, yi = [];
1491
- function fi(e) {
1492
- let t = e.match(mi);
1493
- return t ? t[0].trimStart() : "";
1494
- }
1495
- function Di(e) {
1496
- let t = e.match(mi), r = t == null ? void 0 : t[0];
1497
- return r == null ? e : e.slice(r.length);
1498
- }
1499
- function Ei(e) {
1500
- let t = `
1501
- `;
1502
- e = X(false, e.replace(ac, "").replace(ic, ""), cc, "$1");
1503
- let r = "";
1504
- for (; r !== e; ) r = e, e = X(false, e, pc, `${t}$1 $2${t}`);
1505
- e = e.replace(pi, "").trimEnd();
1506
- let n = /* @__PURE__ */ Object.create(null), s = X(false, e, ci, "").replace(pi, "").trimEnd(), u;
1507
- for (; u = ci.exec(e); ) {
1508
- let i = X(false, u[2], oc, "");
1509
- if (typeof n[u[1]] == "string" || Array.isArray(n[u[1]])) {
1510
- let a = n[u[1]];
1511
- n[u[1]] = [...yi, ...Array.isArray(a) ? a : [a], i];
1512
- } else n[u[1]] = i;
1513
- }
1514
- return { comments: s, pragmas: n };
1515
- }
1516
- function Fi({ comments: e = "", pragmas: t = {} }) {
1517
- let r = `
1518
- `, n = "/**", s = " *", u = " */", i = Object.keys(t), a = i.flatMap((p) => li(p, t[p])).map((p) => `${s} ${p}${r}`).join("");
1519
- if (!e) {
1520
- if (i.length === 0) return "";
1521
- if (i.length === 1 && !Array.isArray(t[i[0]])) {
1522
- let p = t[i[0]];
1523
- return `${n} ${li(i[0], p)[0]}${u}`;
1524
- }
1525
- }
1526
- let o = e.split(r).map((p) => `${s} ${p}`).join(r) + r;
1527
- return n + r + (e ? o : "") + (e && i.length > 0 ? s + r : "") + a + u;
1528
- }
1529
- function li(e, t) {
1530
- return [...yi, ...Array.isArray(t) ? t : [t]].map((r) => `@${e} ${r}`.trim());
1531
- }
1532
- var Ci = "format";
1533
- function lc(e) {
1534
- if (!e.startsWith("#!")) return "";
1535
- let t = e.indexOf(`
1536
- `);
1537
- return t === -1 ? e : e.slice(0, t);
1538
- }
1539
- var Ai = lc;
1540
- function mc(e) {
1541
- let t = Ai(e);
1542
- t && (e = e.slice(t.length + 1));
1543
- let r = fi(e), { pragmas: n, comments: s } = Ei(r);
1544
- return { shebang: t, text: e, pragmas: n, comments: s };
1545
- }
1546
- function di(e) {
1547
- let { shebang: t, text: r, pragmas: n, comments: s } = mc(e), u = Di(r), i = Fi({ pragmas: { [Ci]: "", ...n }, comments: s.trimStart() });
1548
- return (t ? `${t}
1549
- ` : "") + i + (u.startsWith(`
1550
- `) ? `
1551
- ` : `
1552
-
1553
- `) + u;
1554
- }
1555
- function yc(e, t) {
1556
- let { originalText: r, [Symbol.for("comments")]: n, locStart: s, locEnd: u, [Symbol.for("printedComments")]: i } = t, { node: a } = e, o = s(a), p = u(a);
1557
- for (let m of n) s(m) >= o && u(m) <= p && i.add(m);
1558
- return r.slice(o, p);
1559
- }
1560
- var Ti = yc;
1561
- function ls(e, t) {
1562
- var u, i, a, o, p, m, f, y, C;
1563
- if (e.isRoot) return false;
1564
- let { node: r, key: n, parent: s } = e;
1565
- if (t.__isInHtmlInterpolation && !t.bracketSpacing && Fc(r) && yr(e)) return true;
1566
- if (fc(r)) return false;
1567
- if (r.type === "Identifier") {
1568
- 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;
1569
- if (r.name === "let") {
1570
- let c = (i = e.findAncestor((A) => A.type === "ForOfStatement")) == null ? void 0 : i.left;
1571
- if (c && pe(c, (A) => A === r)) return true;
1572
- }
1573
- if (n === "object" && r.name === "let" && s.type === "MemberExpression" && s.computed && !s.optional) {
1574
- 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;
1575
- if (A && pe(A, (T) => T === r)) return true;
1576
- }
1577
- if (n === "expression") switch (r.name) {
1578
- case "await":
1579
- case "interface":
1580
- case "module":
1581
- case "using":
1582
- case "yield":
1583
- case "let":
1584
- case "component":
1585
- case "hook":
1586
- case "type": {
1587
- let c = e.findAncestor((A) => !xe(A));
1588
- if (c !== s && c.type === "ExpressionStatement") return true;
1589
- }
1590
- }
1591
- return false;
1592
- }
1593
- if (r.type === "ObjectExpression" || r.type === "FunctionExpression" || r.type === "ClassExpression" || r.type === "DoExpression") {
1594
- let c = (a = e.findAncestor((A) => A.type === "ExpressionStatement")) == null ? void 0 : a.expression;
1595
- if (c && pe(c, (A) => A === r)) return true;
1596
- }
1597
- if (r.type === "ObjectExpression") {
1598
- let c = (o = e.findAncestor((A) => A.type === "ArrowFunctionExpression")) == null ? void 0 : o.body;
1599
- if (c && c.type !== "SequenceExpression" && c.type !== "AssignmentExpression" && pe(c, (A) => A === r)) return true;
1600
- }
1601
- switch (s.type) {
1602
- case "ParenthesizedExpression":
1603
- return false;
1604
- case "ClassDeclaration":
1605
- case "ClassExpression":
1606
- 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;
1607
- break;
1608
- case "ExportDefaultDeclaration":
1609
- return xi(e, t) || r.type === "SequenceExpression";
1610
- case "Decorator":
1611
- if (n === "expression" && !Ac(r)) return true;
1612
- break;
1613
- case "TypeAnnotation":
1614
- if (e.match(void 0, void 0, (c, A) => A === "returnType" && c.type === "ArrowFunctionExpression") && Ec(r)) return true;
1615
- break;
1616
- case "BinaryExpression":
1617
- if (n === "left" && (s.operator === "in" || s.operator === "instanceof") && r.type === "UnaryExpression") return true;
1618
- break;
1619
- case "VariableDeclarator":
1620
- 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;
1621
- break;
1622
- }
1623
- switch (r.type) {
1624
- case "UpdateExpression":
1625
- if (s.type === "UnaryExpression") return r.prefix && (r.operator === "++" && s.operator === "+" || r.operator === "--" && s.operator === "-");
1626
- case "UnaryExpression":
1627
- switch (s.type) {
1628
- case "UnaryExpression":
1629
- return r.operator === s.operator && (r.operator === "+" || r.operator === "-");
1630
- case "BindExpression":
1631
- return true;
1632
- case "MemberExpression":
1633
- case "OptionalMemberExpression":
1634
- return n === "object";
1635
- case "TaggedTemplateExpression":
1636
- return true;
1637
- case "NewExpression":
1638
- case "CallExpression":
1639
- case "OptionalCallExpression":
1640
- return n === "callee";
1641
- case "BinaryExpression":
1642
- return n === "left" && s.operator === "**";
1643
- case "TSNonNullExpression":
1644
- return true;
1645
- default:
1646
- return false;
1647
- }
1648
- case "BinaryExpression":
1649
- if (s.type === "UpdateExpression" || r.operator === "in" && Dc(e)) return true;
1650
- if (r.operator === "|>" && ((p = r.extra) != null && p.parenthesized)) {
1651
- let c = e.grandparent;
1652
- if (c.type === "BinaryExpression" && c.operator === "|>") return true;
1653
- }
1654
- case "TSTypeAssertion":
1655
- case "TSAsExpression":
1656
- case "TSSatisfiesExpression":
1657
- case "AsExpression":
1658
- case "AsConstExpression":
1659
- case "SatisfiesExpression":
1660
- case "LogicalExpression":
1661
- switch (s.type) {
1662
- case "TSAsExpression":
1663
- case "TSSatisfiesExpression":
1664
- case "AsExpression":
1665
- case "AsConstExpression":
1666
- case "SatisfiesExpression":
1667
- return !xe(r);
1668
- case "ConditionalExpression":
1669
- return xe(r) || fu(r);
1670
- case "CallExpression":
1671
- case "NewExpression":
1672
- case "OptionalCallExpression":
1673
- return n === "callee";
1674
- case "ClassExpression":
1675
- case "ClassDeclaration":
1676
- return n === "superClass";
1677
- case "TSTypeAssertion":
1678
- case "TaggedTemplateExpression":
1679
- case "UnaryExpression":
1680
- case "JSXSpreadAttribute":
1681
- case "SpreadElement":
1682
- case "BindExpression":
1683
- case "AwaitExpression":
1684
- case "TSNonNullExpression":
1685
- case "UpdateExpression":
1686
- return true;
1687
- case "MemberExpression":
1688
- case "OptionalMemberExpression":
1689
- return n === "object";
1690
- case "AssignmentExpression":
1691
- case "AssignmentPattern":
1692
- return n === "left" && (r.type === "TSTypeAssertion" || xe(r));
1693
- case "LogicalExpression":
1694
- if (r.type === "LogicalExpression") return s.operator !== r.operator;
1695
- case "BinaryExpression": {
1696
- let { operator: c, type: A } = r;
1697
- if (!c && A !== "TSTypeAssertion") return true;
1698
- let T = sr(c), B = s.operator, g = sr(B);
1699
- return g > T || n === "right" && g === T || g === T && !ar(B, c) ? true : g < T && c === "%" ? B === "+" || B === "-" : !!Tu(B);
1700
- }
1701
- default:
1702
- return false;
1703
- }
1704
- case "SequenceExpression":
1705
- return s.type !== "ForStatement";
1706
- case "YieldExpression":
1707
- if (s.type === "AwaitExpression" || s.type === "TSTypeAssertion") return true;
1708
- case "AwaitExpression":
1709
- switch (s.type) {
1710
- case "TaggedTemplateExpression":
1711
- case "UnaryExpression":
1712
- case "LogicalExpression":
1713
- case "SpreadElement":
1714
- case "TSAsExpression":
1715
- case "TSSatisfiesExpression":
1716
- case "TSNonNullExpression":
1717
- case "AsExpression":
1718
- case "AsConstExpression":
1719
- case "SatisfiesExpression":
1720
- case "BindExpression":
1721
- return true;
1722
- case "MemberExpression":
1723
- case "OptionalMemberExpression":
1724
- return n === "object";
1725
- case "NewExpression":
1726
- case "CallExpression":
1727
- case "OptionalCallExpression":
1728
- return n === "callee";
1729
- case "ConditionalExpression":
1730
- return n === "test";
1731
- case "BinaryExpression":
1732
- return !(!r.argument && s.operator === "|>");
1733
- default:
1734
- return false;
1735
- }
1736
- case "TSFunctionType":
1737
- if (e.match((c) => c.type === "TSFunctionType", (c, A) => A === "typeAnnotation" && c.type === "TSTypeAnnotation", (c, A) => A === "returnType" && c.type === "ArrowFunctionExpression")) return true;
1738
- case "TSConditionalType":
1739
- case "TSConstructorType":
1740
- case "ConditionalTypeAnnotation":
1741
- if (n === "extendsType" && Je(r) && s.type === r.type || n === "checkType" && Je(s)) return true;
1742
- if (n === "extendsType" && s.type === "TSConditionalType") {
1743
- let { typeAnnotation: c } = r.returnType || r.typeAnnotation;
1744
- if (c.type === "TSTypePredicate" && c.typeAnnotation && (c = c.typeAnnotation.typeAnnotation), c.type === "TSInferType" && c.typeParameter.constraint) return true;
1745
- }
1746
- case "TSUnionType":
1747
- case "TSIntersectionType":
1748
- if ((Oe(s) || qt(s)) && s.types.length > 1 && (!r.types || r.types.length > 1)) return true;
1749
- case "TSInferType":
1750
- if (r.type === "TSInferType") {
1751
- if (s.type === "TSRestType") return false;
1752
- if (n === "types" && (s.type === "TSUnionType" || s.type === "TSIntersectionType") && r.typeParameter.type === "TSTypeParameter" && r.typeParameter.constraint) return true;
1753
- }
1754
- case "TSTypeOperator":
1755
- 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");
1756
- case "TSTypeQuery":
1757
- return n === "objectType" && s.type === "TSIndexedAccessType" || n === "elementType" && s.type === "TSArrayType";
1758
- case "TypeOperator":
1759
- return s.type === "ArrayTypeAnnotation" || s.type === "NullableTypeAnnotation" || n === "objectType" && (s.type === "IndexedAccessType" || s.type === "OptionalIndexedAccessType") || s.type === "TypeOperator";
1760
- case "TypeofTypeAnnotation":
1761
- return n === "objectType" && (s.type === "IndexedAccessType" || s.type === "OptionalIndexedAccessType") || n === "elementType" && s.type === "ArrayTypeAnnotation";
1762
- case "ArrayTypeAnnotation":
1763
- return s.type === "NullableTypeAnnotation";
1764
- case "IntersectionTypeAnnotation":
1765
- case "UnionTypeAnnotation":
1766
- return s.type === "TypeOperator" || s.type === "ArrayTypeAnnotation" || s.type === "NullableTypeAnnotation" || s.type === "IntersectionTypeAnnotation" || s.type === "UnionTypeAnnotation" || n === "objectType" && (s.type === "IndexedAccessType" || s.type === "OptionalIndexedAccessType");
1767
- case "InferTypeAnnotation":
1768
- case "NullableTypeAnnotation":
1769
- return s.type === "ArrayTypeAnnotation" || n === "objectType" && (s.type === "IndexedAccessType" || s.type === "OptionalIndexedAccessType");
1770
- case "ComponentTypeAnnotation":
1771
- case "FunctionTypeAnnotation": {
1772
- if (r.type === "ComponentTypeAnnotation" && (r.rendersType === null || r.rendersType === void 0)) return false;
1773
- 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;
1774
- let c = s.type === "NullableTypeAnnotation" ? e.grandparent : s;
1775
- 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" && ((f = r.returnType) == null ? void 0 : f.typeParameter.bound) || c.type === "NullableTypeAnnotation" || s.type === "FunctionTypeParam" && s.name === null && Q(r).some((A) => {
1776
- var T;
1777
- return ((T = A.typeAnnotation) == null ? void 0 : T.type) === "NullableTypeAnnotation";
1778
- });
1779
- }
1780
- case "OptionalIndexedAccessType":
1781
- return n === "objectType" && s.type === "IndexedAccessType";
1782
- case "StringLiteral":
1783
- case "NumericLiteral":
1784
- case "Literal":
1785
- if (typeof r.value == "string" && s.type === "ExpressionStatement" && typeof s.directive != "string") {
1786
- let c = e.grandparent;
1787
- return c.type === "Program" || c.type === "BlockStatement";
1788
- }
1789
- return n === "object" && G(s) && ye(r);
1790
- case "AssignmentExpression":
1791
- return !((n === "init" || n === "update") && s.type === "ForStatement" || n === "expression" && r.left.type !== "ObjectPattern" && s.type === "ExpressionStatement" || n === "key" && s.type === "TSPropertySignature" || s.type === "AssignmentExpression" || n === "expressions" && s.type === "SequenceExpression" && e.match(void 0, void 0, (c, A) => (A === "init" || A === "update") && c.type === "ForStatement") || n === "value" && s.type === "Property" && e.match(void 0, void 0, (c, A) => A === "properties" && c.type === "ObjectPattern") || s.type === "NGChainedExpression" || n === "node" && s.type === "JsExpressionRoot");
1792
- case "ConditionalExpression":
1793
- switch (s.type) {
1794
- case "TaggedTemplateExpression":
1795
- case "UnaryExpression":
1796
- case "SpreadElement":
1797
- case "BinaryExpression":
1798
- case "LogicalExpression":
1799
- case "NGPipeExpression":
1800
- case "ExportDefaultDeclaration":
1801
- case "AwaitExpression":
1802
- case "JSXSpreadAttribute":
1803
- case "TSTypeAssertion":
1804
- case "TypeCastExpression":
1805
- case "TSAsExpression":
1806
- case "TSSatisfiesExpression":
1807
- case "AsExpression":
1808
- case "AsConstExpression":
1809
- case "SatisfiesExpression":
1810
- case "TSNonNullExpression":
1811
- return true;
1812
- case "NewExpression":
1813
- case "CallExpression":
1814
- case "OptionalCallExpression":
1815
- return n === "callee";
1816
- case "ConditionalExpression":
1817
- return t.experimentalTernaries ? false : n === "test";
1818
- case "MemberExpression":
1819
- case "OptionalMemberExpression":
1820
- return n === "object";
1821
- default:
1822
- return false;
1823
- }
1824
- case "FunctionExpression":
1825
- switch (s.type) {
1826
- case "NewExpression":
1827
- case "CallExpression":
1828
- case "OptionalCallExpression":
1829
- return n === "callee";
1830
- case "TaggedTemplateExpression":
1831
- return true;
1832
- default:
1833
- return false;
1834
- }
1835
- case "ArrowFunctionExpression":
1836
- switch (s.type) {
1837
- case "BinaryExpression":
1838
- return s.operator !== "|>" || ((y = r.extra) == null ? void 0 : y.parenthesized);
1839
- case "NewExpression":
1840
- case "CallExpression":
1841
- case "OptionalCallExpression":
1842
- return n === "callee";
1843
- case "MemberExpression":
1844
- case "OptionalMemberExpression":
1845
- return n === "object";
1846
- case "TSAsExpression":
1847
- case "TSSatisfiesExpression":
1848
- case "AsExpression":
1849
- case "AsConstExpression":
1850
- case "SatisfiesExpression":
1851
- case "TSNonNullExpression":
1852
- case "BindExpression":
1853
- case "TaggedTemplateExpression":
1854
- case "UnaryExpression":
1855
- case "LogicalExpression":
1856
- case "AwaitExpression":
1857
- case "TSTypeAssertion":
1858
- return true;
1859
- case "ConditionalExpression":
1860
- return n === "test";
1861
- default:
1862
- return false;
1863
- }
1864
- case "ClassExpression":
1865
- switch (s.type) {
1866
- case "NewExpression":
1867
- return n === "callee";
1868
- default:
1869
- return false;
1870
- }
1871
- case "OptionalMemberExpression":
1872
- case "OptionalCallExpression":
1873
- case "CallExpression":
1874
- case "MemberExpression":
1875
- if (Cc(e)) return true;
1876
- case "TaggedTemplateExpression":
1877
- case "TSNonNullExpression":
1878
- if (n === "callee" && (s.type === "BindExpression" || s.type === "NewExpression")) {
1879
- let c = r;
1880
- for (; c; ) switch (c.type) {
1881
- case "CallExpression":
1882
- case "OptionalCallExpression":
1883
- return true;
1884
- case "MemberExpression":
1885
- case "OptionalMemberExpression":
1886
- case "BindExpression":
1887
- c = c.object;
1888
- break;
1889
- case "TaggedTemplateExpression":
1890
- c = c.tag;
1891
- break;
1892
- case "TSNonNullExpression":
1893
- c = c.expression;
1894
- break;
1895
- default:
1896
- return false;
1897
- }
1898
- }
1899
- return false;
1900
- case "BindExpression":
1901
- return n === "callee" && (s.type === "BindExpression" || s.type === "NewExpression") || n === "object" && G(s);
1902
- case "NGPipeExpression":
1903
- return !(s.type === "NGRoot" || s.type === "NGMicrosyntaxExpression" || s.type === "ObjectProperty" && !((C = r.extra) != null && C.parenthesized) || U(s) || n === "arguments" && w(s) || n === "right" && s.type === "NGPipeExpression" || n === "property" && s.type === "MemberExpression" || s.type === "AssignmentExpression");
1904
- case "JSXFragment":
1905
- case "JSXElement":
1906
- return n === "callee" || n === "left" && s.type === "BinaryExpression" && s.operator === "<" || !U(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" && !w(s) && !Te(s) && s.type !== "ReturnStatement" && s.type !== "ThrowStatement" && s.type !== "TypeCastExpression" && s.type !== "VariableDeclarator" && s.type !== "YieldExpression";
1907
- case "TSInstantiationExpression":
1908
- return n === "object" && G(s);
1909
- }
1910
- return false;
1911
- }
1912
- var fc = R(["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"]);
1913
- function Dc(e) {
1914
- let t = 0, { node: r } = e;
1915
- for (; r; ) {
1916
- let n = e.getParentNode(t++);
1917
- if ((n == null ? void 0 : n.type) === "ForStatement" && n.init === r) return true;
1918
- r = n;
1919
- }
1920
- return false;
1921
- }
1922
- function Ec(e) {
1923
- return ur(e, (t) => t.type === "ObjectTypeAnnotation" && ur(t, (r) => r.type === "FunctionTypeAnnotation"));
1924
- }
1925
- function Fc(e) {
1926
- return ue(e);
1927
- }
1928
- function yr(e) {
1929
- let { parent: t, key: r } = e;
1930
- switch (t.type) {
1931
- case "NGPipeExpression":
1932
- if (r === "arguments" && e.isLast) return e.callParent(yr);
1933
- break;
1934
- case "ObjectProperty":
1935
- if (r === "value") return e.callParent(() => e.key === "properties" && e.isLast);
1936
- break;
1937
- case "BinaryExpression":
1938
- case "LogicalExpression":
1939
- if (r === "right") return e.callParent(yr);
1940
- break;
1941
- case "ConditionalExpression":
1942
- if (r === "alternate") return e.callParent(yr);
1943
- break;
1944
- case "UnaryExpression":
1945
- if (t.prefix) return e.callParent(yr);
1946
- break;
1947
- }
1948
- return false;
1949
- }
1950
- function xi(e, t) {
1951
- let { node: r, parent: n } = e;
1952
- return r.type === "FunctionExpression" || r.type === "ClassExpression" ? n.type === "ExportDefaultDeclaration" || !ls(e, t) : !Jt(r) || n.type !== "ExportDefaultDeclaration" && ls(e, t) ? false : e.call(() => xi(e, t), ...Lr(r));
1953
- }
1954
- function Cc(e) {
1955
- 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"));
1956
- }
1957
- function ms(e) {
1958
- return e.type === "Identifier" ? true : G(e) ? !e.computed && !e.optional && e.property.type === "Identifier" && ms(e.object) : false;
1959
- }
1960
- function Ac(e) {
1961
- return e.type === "ChainExpression" && (e = e.expression), ms(e) || w(e) && !e.optional && ms(e.callee);
1962
- }
1963
- var Le = ls;
1964
- function dc(e, t) {
1965
- let r = t - 1;
1966
- r = Ye(e, r, { backwards: true }), r = He(e, r, { backwards: true }), r = Ye(e, r, { backwards: true });
1967
- let n = He(e, r, { backwards: true });
1968
- return r !== n;
1969
- }
1970
- var hi = dc;
1971
- var Tc = () => true;
1972
- function ys(e, t) {
1973
- let r = e.node;
1974
- return r.printed = true, t.printer.printComment(e, t);
1975
- }
1976
- function xc(e, t) {
1977
- var m;
1978
- let r = e.node, n = [ys(e, t)], { printer: s, originalText: u, locStart: i, locEnd: a } = t;
1979
- if ((m = s.isBlockComment) == null ? void 0 : m.call(s, r)) {
1980
- let f = ee(u, a(r)) ? ee(u, i(r), { backwards: true }) ? F : x : " ";
1981
- n.push(f);
1982
- } else n.push(F);
1983
- let p = He(u, Ye(u, a(r)));
1984
- return p !== false && ee(u, p) && n.push(F), n;
1985
- }
1986
- function hc(e, t, r) {
1987
- var p;
1988
- let n = e.node, s = ys(e, t), { printer: u, originalText: i, locStart: a } = t, o = (p = u.isBlockComment) == null ? void 0 : p.call(u, n);
1989
- if (r != null && r.hasLineSuffix && !(r != null && r.isBlock) || ee(i, a(n), { backwards: true })) {
1990
- let m = hi(i, a(n));
1991
- return { doc: Xn([F, m ? F : "", s]), isBlock: o, hasLineSuffix: true };
1992
- }
1993
- return !o || r != null && r.hasLineSuffix ? { doc: [Xn([" ", s]), Ce], isBlock: o, hasLineSuffix: true } : { doc: [" ", s], isBlock: o, hasLineSuffix: false };
1994
- }
1995
- function N(e, t, r = {}) {
1996
- let { node: n } = e;
1997
- if (!O(n == null ? void 0 : n.comments)) return "";
1998
- let { indent: s = false, marker: u, filter: i = Tc } = r, a = [];
1999
- if (e.each(({ node: p }) => {
2000
- p.leading || p.trailing || p.marker !== u || !i(p) || a.push(ys(e, t));
2001
- }, "comments"), a.length === 0) return "";
2002
- let o = b(F, a);
2003
- return s ? D([F, o]) : o;
2004
- }
2005
- function fs(e, t) {
2006
- let r = e.node;
2007
- if (!r) return {};
2008
- let n = t[Symbol.for("printedComments")];
2009
- if ((r.comments || []).filter((o) => !n.has(o)).length === 0) return { leading: "", trailing: "" };
2010
- let u = [], i = [], a;
2011
- return e.each(() => {
2012
- let o = e.node;
2013
- if (n != null && n.has(o)) return;
2014
- let { leading: p, trailing: m } = o;
2015
- p ? u.push(xc(e, t)) : m && (a = hc(e, t, a), i.push(a.doc));
2016
- }, "comments"), { leading: u, trailing: i };
2017
- }
2018
- function Ee(e, t, r) {
2019
- let { leading: n, trailing: s } = fs(e, r);
2020
- return !n && !s ? t : lr(t, (u) => [n, u, s]);
2021
- }
2022
- var Ds = class extends Error {
2023
- name = "UnexpectedNodeError";
2024
- constructor(t, r, n = "type") {
2025
- super(`Unexpected ${r} node ${n}: ${JSON.stringify(t[n])}.`), this.node = t;
2026
- }
2027
- }, qe = Ds;
2028
- function Es(e) {
2029
- if (typeof e != "string") throw new TypeError("Expected a string");
2030
- return e.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
2031
- }
2032
- var We, Fs = class {
2033
- constructor(t) {
2034
- Ys(this, We);
2035
- Hs(this, We, new Set(t));
2036
- }
2037
- getLeadingWhitespaceCount(t) {
2038
- let r = mt(this, We), n = 0;
2039
- for (let s = 0; s < t.length && r.has(t.charAt(s)); s++) n++;
2040
- return n;
2041
- }
2042
- getTrailingWhitespaceCount(t) {
2043
- let r = mt(this, We), n = 0;
2044
- for (let s = t.length - 1; s >= 0 && r.has(t.charAt(s)); s--) n++;
2045
- return n;
2046
- }
2047
- getLeadingWhitespace(t) {
2048
- let r = this.getLeadingWhitespaceCount(t);
2049
- return t.slice(0, r);
2050
- }
2051
- getTrailingWhitespace(t) {
2052
- let r = this.getTrailingWhitespaceCount(t);
2053
- return t.slice(t.length - r);
2054
- }
2055
- hasLeadingWhitespace(t) {
2056
- return mt(this, We).has(t.charAt(0));
2057
- }
2058
- hasTrailingWhitespace(t) {
2059
- return mt(this, We).has(v(false, t, -1));
2060
- }
2061
- trimStart(t) {
2062
- let r = this.getLeadingWhitespaceCount(t);
2063
- return t.slice(r);
2064
- }
2065
- trimEnd(t) {
2066
- let r = this.getTrailingWhitespaceCount(t);
2067
- return t.slice(0, t.length - r);
2068
- }
2069
- trim(t) {
2070
- return this.trimEnd(this.trimStart(t));
2071
- }
2072
- split(t, r = false) {
2073
- let n = `[${Es([...mt(this, We)].join(""))}]+`, s = new RegExp(r ? `(${n})` : n, "u");
2074
- return t.split(s);
2075
- }
2076
- hasWhitespaceCharacter(t) {
2077
- let r = mt(this, We);
2078
- return Array.prototype.some.call(t, (n) => r.has(n));
2079
- }
2080
- hasNonWhitespaceCharacter(t) {
2081
- let r = mt(this, We);
2082
- return Array.prototype.some.call(t, (n) => !r.has(n));
2083
- }
2084
- isWhitespaceOnly(t) {
2085
- let r = mt(this, We);
2086
- return Array.prototype.every.call(t, (n) => r.has(n));
2087
- }
2088
- };
2089
- We = /* @__PURE__ */ new WeakMap();
2090
- var gi = Fs;
2091
- var Hr = new gi(`
2092
- \r `), Cs = (e) => e === "" || e === x || e === F || e === E;
2093
- function gc(e, t, r) {
2094
- var _, M, J, I, q;
2095
- let { node: n } = e;
2096
- if (n.type === "JSXElement" && Jc(n)) return [r("openingElement"), r("closingElement")];
2097
- let s = n.type === "JSXElement" ? r("openingElement") : r("openingFragment"), u = n.type === "JSXElement" ? r("closingElement") : r("closingFragment");
2098
- 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];
2099
- n.children = n.children.map((k) => Nc(k) ? { type: "JSXText", value: " ", raw: " " } : k);
2100
- let i = n.children.some(Y), a = n.children.filter((k) => k.type === "JSXExpressionContainer").length > 1, o = n.type === "JSXElement" && n.openingElement.attributes.length > 1, p = re(s) || i || o || a, m = e.parent.rootMarker === "mdx", f = t.singleQuote ? "{' '}" : '{" "}', y = m ? x : S([f, E], " "), C = ((M = (_ = n.openingElement) == null ? void 0 : _.name) == null ? void 0 : M.name) === "fbt", c = Sc(e, t, r, y, C), A = n.children.some((k) => fr(k));
2101
- for (let k = c.length - 2; k >= 0; k--) {
2102
- let W = c[k] === "" && c[k + 1] === "", ne = c[k] === F && c[k + 1] === "" && c[k + 2] === F, Z = (c[k] === E || c[k] === F) && c[k + 1] === "" && c[k + 2] === y, lt = c[k] === y && c[k + 1] === "" && (c[k + 2] === E || c[k + 2] === F), L = c[k] === y && c[k + 1] === "" && c[k + 2] === y, se = c[k] === E && c[k + 1] === "" && c[k + 2] === F || c[k] === F && c[k + 1] === "" && c[k + 2] === E;
2103
- ne && A || W || Z || L || se ? c.splice(k, 2) : lt && c.splice(k + 1, 2);
2104
- }
2105
- for (; c.length > 0 && Cs(v(false, c, -1)); ) c.pop();
2106
- for (; c.length > 1 && Cs(c[0]) && Cs(c[1]); ) c.shift(), c.shift();
2107
- let T = [""];
2108
- for (let [k, W] of c.entries()) {
2109
- if (W === y) {
2110
- if (k === 1 && wu(c[k - 1])) {
2111
- if (c.length === 2) {
2112
- T.push([T.pop(), f]);
2113
- continue;
2114
- }
2115
- T.push([f, F], "");
2116
- continue;
2117
- } else if (k === c.length - 1) {
2118
- T.push([T.pop(), f]);
2119
- continue;
2120
- } else if (c[k - 1] === "" && c[k - 2] === F) {
2121
- T.push([T.pop(), f]);
2122
- continue;
2123
- }
2124
- }
2125
- k % 2 === 0 ? T.push([T.pop(), W]) : T.push(W, ""), re(W) && (p = true);
2126
- }
2127
- let B = A ? Nr(T) : l(T, { shouldBreak: true });
2128
- if (((J = t.cursorNode) == null ? void 0 : J.type) === "JSXText" && n.children.includes(t.cursorNode) ? B = [mr, B, mr] : ((I = t.nodeBeforeCursor) == null ? void 0 : I.type) === "JSXText" && n.children.includes(t.nodeBeforeCursor) ? B = [mr, B] : ((q = t.nodeAfterCursor) == null ? void 0 : q.type) === "JSXText" && n.children.includes(t.nodeAfterCursor) && (B = [B, mr]), m) return B;
2129
- let g = l([s, D([F, B]), F, u]);
2130
- return p ? g : tt([l([s, ...c, u]), g]);
2131
- }
2132
- function Sc(e, t, r, n, s) {
2133
- let u = "", i = [u];
2134
- function a(p) {
2135
- u = p, i.push([i.pop(), p]);
2136
- }
2137
- function o(p) {
2138
- p !== "" && (u = p, i.push(p, ""));
2139
- }
2140
- return e.each(({ node: p, next: m }) => {
2141
- if (p.type === "JSXText") {
2142
- let f = ae(p);
2143
- if (fr(p)) {
2144
- let y = Hr.split(f, true);
2145
- y[0] === "" && (y.shift(), /\n/u.test(y[0]) ? o(Bi(s, y[1], p, m)) : o(n), y.shift());
2146
- let C;
2147
- if (v(false, y, -1) === "" && (y.pop(), C = y.pop()), y.length === 0) return;
2148
- for (let [c, A] of y.entries()) c % 2 === 1 ? o(x) : a(A);
2149
- C !== void 0 ? /\n/u.test(C) ? o(Bi(s, u, p, m)) : o(n) : o(Si(s, u, p, m));
2150
- } else /\n/u.test(f) ? f.match(/\n/gu).length > 1 && o(F) : o(n);
2151
- } else {
2152
- let f = r();
2153
- if (a(f), m && fr(m)) {
2154
- let C = Hr.trim(ae(m)), [c] = Hr.split(C);
2155
- o(Si(s, c, p, m));
2156
- } else o(F);
2157
- }
2158
- }, "children"), i;
2159
- }
2160
- function Si(e, t, r, n) {
2161
- return e ? "" : r.type === "JSXElement" && !r.closingElement || (n == null ? void 0 : n.type) === "JSXElement" && !n.closingElement ? t.length === 1 ? E : F : E;
2162
- }
2163
- function Bi(e, t, r, n) {
2164
- return e ? F : t.length === 1 ? r.type === "JSXElement" && !r.closingElement || (n == null ? void 0 : n.type) === "JSXElement" && !n.closingElement ? F : E : F;
2165
- }
2166
- var Bc = /* @__PURE__ */ new Set(["ArrayExpression", "JSXAttribute", "JSXElement", "JSXExpressionContainer", "JSXFragment", "ExpressionStatement", "CallExpression", "OptionalCallExpression", "ConditionalExpression", "JsExpressionRoot"]);
2167
- function bc(e, t, r) {
2168
- let { parent: n } = e;
2169
- if (Bc.has(n.type)) return t;
2170
- let s = Pc(e), u = Le(e, r);
2171
- return l([u ? "" : S("("), D([E, t]), E, u ? "" : S(")")], { shouldBreak: s });
2172
- }
2173
- function Pc(e) {
2174
- return e.match(void 0, (t) => t.type === "ArrowFunctionExpression", w) && (e.match(void 0, void 0, void 0, (t) => t.type === "JSXExpressionContainer") || e.match(void 0, void 0, void 0, (t) => t.type === "ChainExpression", (t) => t.type === "JSXExpressionContainer"));
2175
- }
2176
- function kc(e, t, r) {
2177
- let { node: n } = e, s = [];
2178
- if (s.push(r("name")), n.value) {
2179
- let u;
2180
- if (K(n.value)) {
2181
- let i = ae(n.value), a = X(false, X(false, i.slice(1, -1), "&apos;", "'"), "&quot;", '"'), o = Sr(a, t.jsxSingleQuote);
2182
- a = o === '"' ? X(false, a, '"', "&quot;") : X(false, a, "'", "&apos;"), u = e.call(() => Ee(e, ve(o + a + o), t), "value");
2183
- } else u = r("value");
2184
- s.push("=", u);
2185
- }
2186
- return s;
2187
- }
2188
- function Ic(e, t, r) {
2189
- let { node: n } = e, s = (u, i) => u.type === "JSXEmptyExpression" || !d(u) && (U(u) || ue(u) || u.type === "ArrowFunctionExpression" || u.type === "AwaitExpression" && (s(u.argument, u) || u.argument.type === "JSXElement") || w(u) || u.type === "ChainExpression" && w(u.expression) || u.type === "FunctionExpression" || u.type === "TemplateLiteral" || u.type === "TaggedTemplateExpression" || u.type === "DoExpression" || Y(i) && (u.type === "ConditionalExpression" || Fe(u)));
2190
- return s(n.expression, e.parent) ? l(["{", r("expression"), je, "}"]) : l(["{", D([E, r("expression")]), E, je, "}"]);
2191
- }
2192
- function Lc(e, t, r) {
2193
- var a, o;
2194
- let { node: n } = e, s = d(n.name) || d(n.typeParameters) || d(n.typeArguments);
2195
- if (n.selfClosing && n.attributes.length === 0 && !s) return ["<", r("name"), n.typeArguments ? r("typeArguments") : r("typeParameters"), " />"];
2196
- if (((a = n.attributes) == null ? void 0 : a.length) === 1 && K(n.attributes[0].value) && !n.attributes[0].value.value.includes(`
2197
- `) && !s && !d(n.attributes[0])) return l(["<", r("name"), n.typeArguments ? r("typeArguments") : r("typeParameters"), " ", ...e.map(r, "attributes"), n.selfClosing ? " />" : ">"]);
2198
- let u = (o = n.attributes) == null ? void 0 : o.some((p) => K(p.value) && p.value.value.includes(`
2199
- `)), i = t.singleAttributePerLine && n.attributes.length > 1 ? F : x;
2200
- return l(["<", r("name"), n.typeArguments ? r("typeArguments") : r("typeParameters"), D(e.map(() => [i, r()], "attributes")), ...wc(n, t, s)], { shouldBreak: u });
2201
- }
2202
- function wc(e, t, r) {
2203
- return e.selfClosing ? [x, "/>"] : Oc(e, t, r) ? [">"] : [E, ">"];
2204
- }
2205
- function Oc(e, t, r) {
2206
- let n = e.attributes.length > 0 && d(v(false, e.attributes, -1), h.Trailing);
2207
- return e.attributes.length === 0 && !r || (t.bracketSameLine || t.jsxBracketSameLine) && (!r || e.attributes.length > 0) && !n;
2208
- }
2209
- function _c(e, t, r) {
2210
- let { node: n } = e, s = [];
2211
- s.push("</");
2212
- let u = r("name");
2213
- return d(n.name, h.Leading | h.Line) ? s.push(D([F, u]), F) : d(n.name, h.Leading | h.Block) ? s.push(" ", u) : s.push(u), s.push(">"), s;
2214
- }
2215
- function Mc(e, t) {
2216
- let { node: r } = e, n = d(r), s = d(r, h.Line), u = r.type === "JSXOpeningFragment";
2217
- return [u ? "<" : "</", D([s ? F : n && !u ? " " : "", N(e, t)]), s ? F : "", ">"];
2218
- }
2219
- function vc(e, t, r) {
2220
- let n = Ee(e, gc(e, t, r), t);
2221
- return bc(e, n, t);
2222
- }
2223
- function jc(e, t) {
2224
- let { node: r } = e, n = d(r, h.Line);
2225
- return [N(e, t, { indent: n }), n ? F : ""];
2226
- }
2227
- function Rc(e, t, r) {
2228
- let { node: n } = e;
2229
- return ["{", e.call(({ node: s }) => {
2230
- let u = ["...", r()];
2231
- return !d(s) || !rs(e) ? u : [D([E, Ee(e, u, t)]), E];
2232
- }, n.type === "JSXSpreadAttribute" ? "argument" : "expression"), "}"];
2233
- }
2234
- function bi(e, t, r) {
2235
- let { node: n } = e;
2236
- if (n.type.startsWith("JSX")) switch (n.type) {
2237
- case "JSXAttribute":
2238
- return kc(e, t, r);
2239
- case "JSXIdentifier":
2240
- return n.name;
2241
- case "JSXNamespacedName":
2242
- return b(":", [r("namespace"), r("name")]);
2243
- case "JSXMemberExpression":
2244
- return b(".", [r("object"), r("property")]);
2245
- case "JSXSpreadAttribute":
2246
- case "JSXSpreadChild":
2247
- return Rc(e, t, r);
2248
- case "JSXExpressionContainer":
2249
- return Ic(e, t, r);
2250
- case "JSXFragment":
2251
- case "JSXElement":
2252
- return vc(e, t, r);
2253
- case "JSXOpeningElement":
2254
- return Lc(e, t, r);
2255
- case "JSXClosingElement":
2256
- return _c(e, t, r);
2257
- case "JSXOpeningFragment":
2258
- case "JSXClosingFragment":
2259
- return Mc(e, t);
2260
- case "JSXEmptyExpression":
2261
- return jc(e, t);
2262
- case "JSXText":
2263
- throw new Error("JSXText should be handled by JSXElement");
2264
- default:
2265
- throw new qe(n, "JSX");
2266
- }
2267
- }
2268
- function Jc(e) {
2269
- if (e.children.length === 0) return true;
2270
- if (e.children.length > 1) return false;
2271
- let t = e.children[0];
2272
- return t.type === "JSXText" && !fr(t);
2273
- }
2274
- function fr(e) {
2275
- return e.type === "JSXText" && (Hr.hasNonWhitespaceCharacter(ae(e)) || !/\n/u.test(ae(e)));
2276
- }
2277
- function Nc(e) {
2278
- return e.type === "JSXExpressionContainer" && K(e.expression) && e.expression.value === " " && !d(e.expression);
2279
- }
2280
- function Pi(e) {
2281
- let { node: t, parent: r } = e;
2282
- if (!Y(t) || !Y(r)) return false;
2283
- let { index: n, siblings: s } = e, u;
2284
- for (let i = n; i > 0; i--) {
2285
- let a = s[i - 1];
2286
- if (!(a.type === "JSXText" && !fr(a))) {
2287
- u = a;
2288
- break;
2289
- }
2290
- }
2291
- return (u == null ? void 0 : u.type) === "JSXExpressionContainer" && u.expression.type === "JSXEmptyExpression" && kt(u.expression);
2292
- }
2293
- function Gc(e) {
2294
- return kt(e.node) || Pi(e);
2295
- }
2296
- var Vr = Gc;
2297
- var qc = 0;
2298
- function $r(e, t, r) {
2299
- var M;
2300
- 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"), o = n.operator === "|>" && ((M = e.root.extra) == null ? void 0 : M.__isUsingHackPipeline), p = As(e, t, r, false, a);
2301
- if (a) return p;
2302
- if (o) return l(p);
2303
- if (w(s) && s.callee === n || s.type === "UnaryExpression" || G(s) && !s.computed) return l([D([E, ...p]), E]);
2304
- 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" && !w(u) || s.type === "TemplateLiteral", f = s.type === "AssignmentExpression" || s.type === "VariableDeclarator" || s.type === "ClassProperty" || s.type === "PropertyDefinition" || s.type === "TSAbstractPropertyDefinition" || s.type === "ClassPrivateProperty" || Te(s), y = Fe(n.left) && ar(n.operator, n.left.operator);
2305
- if (m || Ht(n) && !y || !Ht(n) && f) return l(p);
2306
- if (p.length === 0) return "";
2307
- let C = Y(n.right), c = p.findIndex((J) => typeof J != "string" && !Array.isArray(J) && J.type === fe), A = p.slice(0, c === -1 ? 1 : c + 1), T = p.slice(A.length, C ? -1 : void 0), B = Symbol("logicalChain-" + ++qc), g = l([...A, D(T)], { id: B });
2308
- if (!C) return g;
2309
- let _ = v(false, p, -1);
2310
- return l([g, xt(_, { groupId: B })]);
2311
- }
2312
- function As(e, t, r, n, s) {
2313
- var B;
2314
- let { node: u } = e;
2315
- if (!Fe(u)) return [l(r())];
2316
- let i = [];
2317
- ar(u.operator, u.left.operator) ? i = e.call((g) => As(g, t, r, true, s), "left") : i.push(l(r("left")));
2318
- let a = Ht(u), o = (u.operator === "|>" || u.type === "NGPipeExpression" || Wc(e, t)) && !de(t.originalText, u.right), m = !d(u.right, h.Leading, Gr) && de(t.originalText, u.right), f = u.type === "NGPipeExpression" ? "|" : u.operator, y = u.type === "NGPipeExpression" && u.arguments.length > 0 ? l(D([E, ": ", b([x, ": "], e.map(() => be(2, l(r())), "arguments"))])) : "", C;
2319
- if (a) C = [f, de(t.originalText, u.right) ? D([x, r("right"), y]) : [" ", r("right"), y]];
2320
- else {
2321
- let _ = f === "|>" && ((B = e.root.extra) == null ? void 0 : B.__isUsingHackPipeline) ? e.call((M) => As(M, t, r, true, s), "right") : r("right");
2322
- if (t.experimentalOperatorPosition === "start") {
2323
- let M = "";
2324
- if (m) switch (Be(_)) {
2325
- case ge:
2326
- M = _.splice(0, 1)[0];
2327
- break;
2328
- case Se:
2329
- M = _.contents.splice(0, 1)[0];
2330
- break;
2331
- }
2332
- C = [x, M, f, " ", _, y];
2333
- } else C = [o ? x : "", f, o ? " " : x, _, y];
2334
- }
2335
- let { parent: c } = e, A = d(u.left, h.Trailing | h.Line);
2336
- if ((A || !(s && u.type === "LogicalExpression") && c.type !== u.type && u.left.type !== u.type && u.right.type !== u.type) && (C = l(C, { shouldBreak: A })), t.experimentalOperatorPosition === "start" ? i.push(a || m ? " " : "", C) : i.push(o ? "" : " ", C), n && d(u)) {
2337
- let g = Ut(Ee(e, i, t));
2338
- return g.type === _e ? g.parts : Array.isArray(g) ? g : [g];
2339
- }
2340
- return i;
2341
- }
2342
- function Ht(e) {
2343
- return e.type !== "LogicalExpression" ? false : !!(ue(e.right) && e.right.properties.length > 0 || U(e.right) && e.right.elements.length > 0 || Y(e.right));
2344
- }
2345
- var ki = (e) => e.type === "BinaryExpression" && e.operator === "|";
2346
- function Wc(e, t) {
2347
- return (t.parser === "__vue_expression" || t.parser === "__vue_ts_expression") && ki(e.node) && !e.hasAncestor((r) => !ki(r) && r.type !== "JsExpressionRoot");
2348
- }
2349
- function Li(e, t, r) {
2350
- let { node: n } = e;
2351
- if (n.type.startsWith("NG")) switch (n.type) {
2352
- case "NGRoot":
2353
- return [r("node"), d(n.node) ? " //" + Ve(n.node)[0].value.trimEnd() : ""];
2354
- case "NGPipeExpression":
2355
- return $r(e, t, r);
2356
- case "NGChainedExpression":
2357
- return l(b([";", x], e.map(() => Yc(e) ? r() : ["(", r(), ")"], "expressions")));
2358
- case "NGEmptyExpression":
2359
- return "";
2360
- case "NGMicrosyntax":
2361
- return e.map(() => [e.isFirst ? "" : Ii(e) ? " " : [";", x], r()], "body");
2362
- case "NGMicrosyntaxKey":
2363
- return /^[$_a-z][\w$]*(?:-[$_a-z][\w$])*$/iu.test(n.name) ? n.name : JSON.stringify(n.name);
2364
- case "NGMicrosyntaxExpression":
2365
- return [r("expression"), n.alias === null ? "" : [" as ", r("alias")]];
2366
- case "NGMicrosyntaxKeyedExpression": {
2367
- let { index: s, parent: u } = e, i = Ii(e) || Uc(e) || (s === 1 && (n.key.name === "then" || n.key.name === "else" || n.key.name === "as") || s === 2 && (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";
2368
- return [r("key"), i ? " " : ": ", r("expression")];
2369
- }
2370
- case "NGMicrosyntaxLet":
2371
- return ["let ", r("key"), n.value === null ? "" : [" = ", r("value")]];
2372
- case "NGMicrosyntaxAs":
2373
- return [r("key"), " as ", r("alias")];
2374
- default:
2375
- throw new qe(n, "Angular");
2376
- }
2377
- }
2378
- function Ii({ node: e, index: t }) {
2379
- return e.type === "NGMicrosyntaxKeyedExpression" && e.key.name === "of" && t === 1;
2380
- }
2381
- function Uc(e) {
2382
- let { node: t } = e;
2383
- return e.parent.body[1].key.name === "of" && t.type === "NGMicrosyntaxKeyedExpression" && t.key.name === "track" && t.key.type === "NGMicrosyntaxKey";
2384
- }
2385
- var Xc = R(["CallExpression", "OptionalCallExpression", "AssignmentExpression"]);
2386
- function Yc({ node: e }) {
2387
- return ur(e, Xc);
2388
- }
2389
- function ds(e, t, r) {
2390
- let { node: n } = e;
2391
- return l([b(x, e.map(r, "decorators")), _i(n, t) ? F : x]);
2392
- }
2393
- function wi(e, t, r) {
2394
- return Mi(e.node) ? [b(F, e.map(r, "declaration", "decorators")), F] : "";
2395
- }
2396
- function Oi(e, t, r) {
2397
- let { node: n, parent: s } = e, { decorators: u } = n;
2398
- if (!O(u) || Mi(s) || Vr(e)) return "";
2399
- let i = n.type === "ClassExpression" || n.type === "ClassDeclaration" || _i(n, t);
2400
- return [e.key === "declaration" && yu(s) ? F : i ? Ce : "", b(x, e.map(r, "decorators")), x];
2401
- }
2402
- function _i(e, t) {
2403
- return e.decorators.some((r) => ee(t.originalText, P(r)));
2404
- }
2405
- function Mi(e) {
2406
- var r;
2407
- if (e.type !== "ExportDefaultDeclaration" && e.type !== "ExportNamedDeclaration" && e.type !== "DeclareExportDeclaration") return false;
2408
- let t = (r = e.declaration) == null ? void 0 : r.decorators;
2409
- return O(t) && Bt(e, t[0]);
2410
- }
2411
- var Dt = class extends Error {
2412
- name = "ArgExpansionBailout";
2413
- };
2414
- function Hc(e, t, r) {
2415
- let { node: n } = e, s = le(n);
2416
- if (s.length === 0) return ["(", N(e, t), ")"];
2417
- let u = s.length - 1;
2418
- if (Kc(s)) {
2419
- let f = ["("];
2420
- return Gt(e, (y, C) => {
2421
- f.push(r()), C !== u && f.push(", ");
2422
- }), f.push(")"), f;
2423
- }
2424
- let i = false, a = [];
2425
- Gt(e, ({ node: f }, y) => {
2426
- let C = r();
2427
- y === u || (me(f, t) ? (i = true, C = [C, ",", F, F]) : C = [C, ",", x]), a.push(C);
2428
- });
2429
- let o = !t.parser.startsWith("__ng_") && n.type !== "ImportExpression" && n.type !== "TSImportType" && ce(t, "all") ? "," : "";
2430
- if (n.type === "TSImportType" && s.length === 1 && (s[0].type === "TSLiteralType" && K(s[0].literal) || K(s[0])) && !d(s[0])) return l(["(", ...a, S(o), ")"]);
2431
- function p() {
2432
- return l(["(", D([x, ...a]), o, x, ")"], { shouldBreak: true });
2433
- }
2434
- if (i || e.parent.type !== "Decorator" && Au(s)) return p();
2435
- if ($c(s)) {
2436
- let f = a.slice(1);
2437
- if (f.some(re)) return p();
2438
- let y;
2439
- try {
2440
- y = r(Gn(n, 0), { expandFirstArg: true });
2441
- } catch (C) {
2442
- if (C instanceof Dt) return p();
2443
- throw C;
2444
- }
2445
- return re(y) ? [Ce, tt([["(", l(y, { shouldBreak: true }), ", ", ...f, ")"], p()])] : tt([["(", y, ", ", ...f, ")"], ["(", l(y, { shouldBreak: true }), ", ", ...f, ")"], p()]);
2446
- }
2447
- if (Vc(s, a, t)) {
2448
- let f = a.slice(0, -1);
2449
- if (f.some(re)) return p();
2450
- let y;
2451
- try {
2452
- y = r(Gn(n, -1), { expandLastArg: true });
2453
- } catch (C) {
2454
- if (C instanceof Dt) return p();
2455
- throw C;
2456
- }
2457
- return re(y) ? [Ce, tt([["(", ...f, l(y, { shouldBreak: true }), ")"], p()])] : tt([["(", ...f, y, ")"], ["(", ...f, l(y, { shouldBreak: true }), ")"], p()]);
2458
- }
2459
- let m = ["(", D([E, ...a]), S(o), E, ")"];
2460
- return vr(e) ? m : l(m, { shouldBreak: a.some(re) || i });
2461
- }
2462
- function Dr(e, t = false) {
2463
- return ue(e) && (e.properties.length > 0 || d(e)) || U(e) && (e.elements.length > 0 || d(e)) || e.type === "TSTypeAssertion" && Dr(e.expression) || xe(e) && Dr(e.expression) || e.type === "FunctionExpression" || e.type === "ArrowFunctionExpression" && (!e.returnType || !e.returnType.typeAnnotation || e.returnType.typeAnnotation.type !== "TSTypeReference" || Qc(e.body)) && (e.body.type === "BlockStatement" || e.body.type === "ArrowFunctionExpression" && Dr(e.body, true) || ue(e.body) || U(e.body) || !t && (w(e.body) || e.body.type === "ConditionalExpression") || Y(e.body)) || e.type === "DoExpression" || e.type === "ModuleExpression";
2464
- }
2465
- function Vc(e, t, r) {
2466
- var u, i;
2467
- let n = v(false, e, -1);
2468
- if (e.length === 1) {
2469
- let a = v(false, t, -1);
2470
- if ((u = a.label) != null && u.embed && ((i = a.label) == null ? void 0 : i.hug) !== false) return true;
2471
- }
2472
- let s = v(false, e, -2);
2473
- return !d(n, h.Leading) && !d(n, h.Trailing) && Dr(n) && (!s || s.type !== n.type) && (e.length !== 2 || s.type !== "ArrowFunctionExpression" || !U(n)) && !(e.length > 1 && Ts(n, r));
2474
- }
2475
- function $c(e) {
2476
- if (e.length !== 2) return false;
2477
- let [t, r] = e;
2478
- return t.type === "ModuleExpression" && zc(r) ? true : !d(t) && (t.type === "FunctionExpression" || t.type === "ArrowFunctionExpression" && t.body.type === "BlockStatement") && r.type !== "FunctionExpression" && r.type !== "ArrowFunctionExpression" && r.type !== "ConditionalExpression" && ji(r) && !Dr(r);
2479
- }
2480
- function ji(e) {
2481
- if (e.type === "ParenthesizedExpression") return ji(e.expression);
2482
- if (xe(e) || e.type === "TypeCastExpression") {
2483
- let { typeAnnotation: t } = e;
2484
- 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") {
2485
- let r = t.typeArguments ?? t.typeParameters;
2486
- (r == null ? void 0 : r.params.length) === 1 && (t = r.params[0]);
2487
- }
2488
- return Nt(t) && we(e.expression, 1);
2489
- }
2490
- return yt(e) && le(e).length > 1 ? false : Fe(e) ? we(e.left, 1) && we(e.right, 1) : Jn(e) || we(e);
2491
- }
2492
- function Kc(e) {
2493
- return e.length === 2 ? vi(e, 0) : e.length === 3 ? e[0].type === "Identifier" && vi(e, 1) : false;
2494
- }
2495
- function vi(e, t) {
2496
- let r = e[t], n = e[t + 1];
2497
- return r.type === "ArrowFunctionExpression" && Q(r).length === 0 && r.body.type === "BlockStatement" && n.type === "ArrayExpression" && !e.some((s) => d(s));
2498
- }
2499
- function Qc(e) {
2500
- return e.type === "BlockStatement" && (e.body.some((t) => t.type !== "EmptyStatement") || d(e, h.Dangling));
2501
- }
2502
- function zc(e) {
2503
- if (!(e.type === "ObjectExpression" && e.properties.length === 1)) return false;
2504
- let [t] = e.properties;
2505
- return Te(t) ? !t.computed && (t.key.type === "Identifier" && t.key.name === "type" || K(t.key) && t.key.value === "type") && K(t.value) && t.value.value === "module" : false;
2506
- }
2507
- var Lt = Hc;
2508
- var Zc = (e) => ((e.type === "ChainExpression" || e.type === "TSNonNullExpression") && (e = e.expression), w(e) && le(e).length > 0);
2509
- function Ri(e, t, r) {
2510
- var p;
2511
- let n = r("object"), s = xs(e, t, r), { node: u } = e, i = e.findAncestor((m) => !(G(m) || m.type === "TSNonNullExpression")), a = e.findAncestor((m) => !(m.type === "ChainExpression" || m.type === "TSNonNullExpression")), o = i && (i.type === "NewExpression" || i.type === "BindExpression" || i.type === "AssignmentExpression" && i.left.type !== "Identifier") || u.computed || u.object.type === "Identifier" && u.property.type === "Identifier" && !G(a) || (a.type === "AssignmentExpression" || a.type === "VariableDeclarator") && (Zc(u.object) || ((p = n.label) == null ? void 0 : p.memberChain));
2512
- return at(n.label, [n, o ? s : l(D([E, s]))]);
2513
- }
2514
- function xs(e, t, r) {
2515
- let n = r("property"), { node: s } = e, u = V(e);
2516
- return s.computed ? !s.property || ye(s.property) ? [u, "[", n, "]"] : l([u, "[", D([E, n]), E, "]"]) : [u, ".", n];
2517
- }
2518
- function Ji(e, t, r) {
2519
- if (e.node.type === "ChainExpression") return e.call(() => Ji(e, t, r), "expression");
2520
- let n = (e.parent.type === "ChainExpression" ? e.grandparent : e.parent).type === "ExpressionStatement", s = [];
2521
- function u(L) {
2522
- let { originalText: se } = t, Ae = ot(se, P(L));
2523
- return se.charAt(Ae) === ")" ? Ae !== false && vt(se, Ae + 1) : me(L, t);
2524
- }
2525
- function i() {
2526
- let { node: L } = e;
2527
- if (L.type === "ChainExpression") return e.call(i, "expression");
2528
- if (w(L) && (dt(L.callee) || w(L.callee))) {
2529
- let se = u(L);
2530
- s.unshift({ node: L, hasTrailingEmptyLine: se, printed: [Ee(e, [V(e), rt(e, t, r), Lt(e, t, r)], t), se ? F : ""] }), e.call(i, "callee");
2531
- } else dt(L) ? (s.unshift({ node: L, needsParens: Le(e, t), printed: Ee(e, G(L) ? xs(e, t, r) : Kr(e, t, r), t) }), e.call(i, "object")) : L.type === "TSNonNullExpression" ? (s.unshift({ node: L, printed: Ee(e, "!", t) }), e.call(i, "expression")) : s.unshift({ node: L, printed: r() });
2532
- }
2533
- let { node: a } = e;
2534
- s.unshift({ node: a, printed: [V(e), rt(e, t, r), Lt(e, t, r)] }), a.callee && e.call(i, "callee");
2535
- let o = [], p = [s[0]], m = 1;
2536
- for (; m < s.length && (s[m].node.type === "TSNonNullExpression" || w(s[m].node) || G(s[m].node) && s[m].node.computed && ye(s[m].node.property)); ++m) p.push(s[m]);
2537
- if (!w(s[0].node)) for (; m + 1 < s.length && (dt(s[m].node) && dt(s[m + 1].node)); ++m) p.push(s[m]);
2538
- o.push(p), p = [];
2539
- let f = false;
2540
- for (; m < s.length; ++m) {
2541
- if (f && dt(s[m].node)) {
2542
- if (s[m].node.computed && ye(s[m].node.property)) {
2543
- p.push(s[m]);
2544
- continue;
2545
- }
2546
- o.push(p), p = [], f = false;
2547
- }
2548
- (w(s[m].node) || s[m].node.type === "ImportExpression") && (f = true), p.push(s[m]), d(s[m].node, h.Trailing) && (o.push(p), p = [], f = false);
2549
- }
2550
- p.length > 0 && o.push(p);
2551
- function y(L) {
2552
- return /^[A-Z]|^[$_]+$/u.test(L);
2553
- }
2554
- function C(L) {
2555
- return L.length <= t.tabWidth;
2556
- }
2557
- function c(L) {
2558
- var Ot;
2559
- let se = (Ot = L[1][0]) == null ? void 0 : Ot.node.computed;
2560
- if (L[0].length === 1) {
2561
- let nt = L[0][0].node;
2562
- return nt.type === "ThisExpression" || nt.type === "Identifier" && (y(nt.name) || n && C(nt.name) || se);
2563
- }
2564
- let Ae = v(false, L[0], -1).node;
2565
- return G(Ae) && Ae.property.type === "Identifier" && (y(Ae.property.name) || se);
2566
- }
2567
- let A = o.length >= 2 && !d(o[1][0].node) && c(o);
2568
- function T(L) {
2569
- let se = L.map((Ae) => Ae.printed);
2570
- return L.length > 0 && v(false, L, -1).needsParens ? ["(", ...se, ")"] : se;
2571
- }
2572
- function B(L) {
2573
- return L.length === 0 ? "" : D([F, b(F, L.map(T))]);
2574
- }
2575
- let g = o.map(T), _ = g, M = A ? 3 : 2, J = o.flat(), I = J.slice(1, -1).some((L) => d(L.node, h.Leading)) || J.slice(0, -1).some((L) => d(L.node, h.Trailing)) || o[M] && d(o[M][0].node, h.Leading);
2576
- if (o.length <= M && !I && !o.some((L) => v(false, L, -1).hasTrailingEmptyLine)) return vr(e) ? _ : l(_);
2577
- let q = v(false, o[A ? 1 : 0], -1).node, k = !w(q) && u(q), W = [T(o[0]), A ? o.slice(1, 2).map(T) : "", k ? F : "", B(o.slice(A ? 2 : 1))], ne = s.map(({ node: L }) => L).filter(w);
2578
- function Z() {
2579
- let L = v(false, v(false, o, -1), -1).node, se = v(false, g, -1);
2580
- return w(L) && re(se) && ne.slice(0, -1).some((Ae) => Ae.arguments.some(Rt));
2581
- }
2582
- let lt;
2583
- return I || ne.length > 2 && ne.some((L) => !L.arguments.every((se) => we(se))) || g.slice(0, -1).some(re) || Z() ? lt = l(W) : lt = [re(_) || k ? Ce : "", tt([_, W])], at({ memberChain: true }, lt);
2584
- }
2585
- var Ni = Ji;
2586
- function Qr(e, t, r) {
2587
- var m;
2588
- let { node: n } = e, s = n.type === "NewExpression", u = n.type === "ImportExpression", i = V(e), a = le(n), o = a.length === 1 && _r(a[0], t.originalText);
2589
- if (o || el(e) || Pt(n, e.parent)) {
2590
- let f = [];
2591
- if (Gt(e, () => {
2592
- f.push(r());
2593
- }), !(o && ((m = f[0].label) != null && m.embed))) return [s ? "new " : "", Gi(e, r), i, rt(e, t, r), "(", b(", ", f), ")"];
2594
- }
2595
- if (!u && !s && dt(n.callee) && !e.call((f) => Le(f, t), "callee", ...n.callee.type === "ChainExpression" ? ["expression"] : [])) return Ni(e, t, r);
2596
- let p = [s ? "new " : "", Gi(e, r), i, rt(e, t, r), Lt(e, t, r)];
2597
- return u || w(n.callee) ? l(p) : p;
2598
- }
2599
- function Gi(e, t) {
2600
- let { node: r } = e;
2601
- return r.type === "ImportExpression" ? `import${r.phase ? `.${r.phase}` : ""}` : t("callee");
2602
- }
2603
- function el(e) {
2604
- let { node: t } = e;
2605
- if (t.type !== "CallExpression" || t.optional || t.callee.type !== "Identifier") return false;
2606
- let r = le(t);
2607
- return t.callee.name === "require" ? r.length === 1 && K(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 && K(r[0]) && r[1].type === "ArrayExpression" : false;
2608
- }
2609
- function ht(e, t, r, n, s, u) {
2610
- let i = tl(e, t, r, n, u), a = u ? r(u, { assignmentLayout: i }) : "";
2611
- switch (i) {
2612
- case "break-after-operator":
2613
- return l([l(n), s, l(D([x, a]))]);
2614
- case "never-break-after-operator":
2615
- return l([l(n), s, " ", a]);
2616
- case "fluid": {
2617
- let o = Symbol("assignment");
2618
- return l([l(n), s, l(D(x), { id: o }), je, xt(a, { groupId: o })]);
2619
- }
2620
- case "break-lhs":
2621
- return l([n, s, " ", l(a)]);
2622
- case "chain":
2623
- return [l(n), s, x, a];
2624
- case "chain-tail":
2625
- return [l(n), s, D([x, a])];
2626
- case "chain-tail-arrow-chain":
2627
- return [l(n), s, a];
2628
- case "only-left":
2629
- return n;
2630
- }
2631
- }
2632
- function Wi(e, t, r) {
2633
- let { node: n } = e;
2634
- return ht(e, t, r, r("left"), [" ", n.operator], "right");
2635
- }
2636
- function Ui(e, t, r) {
2637
- return ht(e, t, r, r("id"), " =", "init");
2638
- }
2639
- function tl(e, t, r, n, s) {
2640
- let { node: u } = e, i = u[s];
2641
- if (!i) return "only-left";
2642
- let a = !zr(i);
2643
- if (e.match(zr, Xi, (y) => !a || y.type !== "ExpressionStatement" && y.type !== "VariableDeclaration")) return a ? i.type === "ArrowFunctionExpression" && i.body.type === "ArrowFunctionExpression" ? "chain-tail-arrow-chain" : "chain-tail" : "chain";
2644
- if (!a && zr(i.right) || de(t.originalText, i)) return "break-after-operator";
2645
- 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";
2646
- let m = Lu(n);
2647
- if (nl(u) || al(u) || hs(u) && m) return "break-lhs";
2648
- let f = pl(u, n, t);
2649
- return e.call(() => rl(e, t, r, f), s) ? "break-after-operator" : sl(u) ? "break-lhs" : !m && (f || i.type === "TemplateLiteral" || i.type === "TaggedTemplateExpression" || Du(i) || ye(i) || i.type === "ClassExpression") ? "never-break-after-operator" : "fluid";
2650
- }
2651
- function rl(e, t, r, n) {
2652
- let s = e.node;
2653
- if (Fe(s) && !Ht(s)) return true;
2654
- switch (s.type) {
2655
- case "StringLiteralTypeAnnotation":
2656
- case "SequenceExpression":
2657
- return true;
2658
- case "TSConditionalType":
2659
- case "ConditionalTypeAnnotation":
2660
- if (!t.experimentalTernaries && !ml(s)) break;
2661
- return true;
2662
- case "ConditionalExpression": {
2663
- if (!t.experimentalTernaries) {
2664
- let { test: p } = s;
2665
- return Fe(p) && !Ht(p);
2666
- }
2667
- let { consequent: a, alternate: o } = s;
2668
- return a.type === "ConditionalExpression" || o.type === "ConditionalExpression";
2669
- }
2670
- case "ClassExpression":
2671
- return O(s.decorators);
2672
- }
2673
- if (n) return false;
2674
- let u = s, i = [];
2675
- for (; ; ) if (u.type === "UnaryExpression" || u.type === "AwaitExpression" || u.type === "YieldExpression" && u.argument !== null) u = u.argument, i.push("argument");
2676
- else if (u.type === "TSNonNullExpression") u = u.expression, i.push("expression");
2677
- else break;
2678
- return !!(K(u) || e.call(() => Yi(e, t, r), ...i));
2679
- }
2680
- function nl(e) {
2681
- if (Xi(e)) {
2682
- let t = e.left || e.id;
2683
- return t.type === "ObjectPattern" && t.properties.length > 2 && t.properties.some((r) => {
2684
- var n;
2685
- return Te(r) && (!r.shorthand || ((n = r.value) == null ? void 0 : n.type) === "AssignmentPattern");
2686
- });
2687
- }
2688
- return false;
2689
- }
2690
- function zr(e) {
2691
- return e.type === "AssignmentExpression";
2692
- }
2693
- function Xi(e) {
2694
- return zr(e) || e.type === "VariableDeclarator";
2695
- }
2696
- function sl(e) {
2697
- let t = il(e);
2698
- if (O(t)) {
2699
- let r = e.type === "TSTypeAliasDeclaration" ? "constraint" : "bound";
2700
- if (t.length > 1 && t.some((n) => n[r] || n.default)) return true;
2701
- }
2702
- return false;
2703
- }
2704
- var ul = R(["TSTypeAliasDeclaration", "TypeAlias"]);
2705
- function il(e) {
2706
- var t;
2707
- if (ul(e)) return (t = e.typeParameters) == null ? void 0 : t.params;
2708
- }
2709
- function al(e) {
2710
- if (e.type !== "VariableDeclarator") return false;
2711
- let { typeAnnotation: t } = e.id;
2712
- if (!t || !t.typeAnnotation) return false;
2713
- let r = qi(t.typeAnnotation);
2714
- return O(r) && r.length > 1 && r.some((n) => O(qi(n)) || n.type === "TSConditionalType");
2715
- }
2716
- function hs(e) {
2717
- var t;
2718
- return e.type === "VariableDeclarator" && ((t = e.init) == null ? void 0 : t.type) === "ArrowFunctionExpression";
2719
- }
2720
- var ol = R(["TSTypeReference", "GenericTypeAnnotation"]);
2721
- function qi(e) {
2722
- var t;
2723
- if (ol(e)) return (t = e.typeArguments ?? e.typeParameters) == null ? void 0 : t.params;
2724
- }
2725
- function Yi(e, t, r, n = false) {
2726
- var i;
2727
- let { node: s } = e, u = () => Yi(e, t, r, true);
2728
- if (s.type === "ChainExpression" || s.type === "TSNonNullExpression") return e.call(u, "expression");
2729
- if (w(s)) {
2730
- if ((i = Qr(e, t, r).label) != null && i.memberChain) return false;
2731
- let o = le(s);
2732
- return !(o.length === 0 || o.length === 1 && ir(o[0], t)) || cl(s, r) ? false : e.call(u, "callee");
2733
- }
2734
- return G(s) ? e.call(u, "object") : n && (s.type === "Identifier" || s.type === "ThisExpression");
2735
- }
2736
- function pl(e, t, r) {
2737
- return Te(e) ? (t = Ut(t), typeof t == "string" && st(t) < r.tabWidth + 3) : false;
2738
- }
2739
- function cl(e, t) {
2740
- let r = ll(e);
2741
- if (O(r)) {
2742
- if (r.length > 1) return true;
2743
- if (r.length === 1) {
2744
- let s = r[0];
2745
- if (Oe(s) || qt(s) || s.type === "TSTypeLiteral" || s.type === "ObjectTypeAnnotation") return true;
2746
- }
2747
- let n = e.typeParameters ? "typeParameters" : "typeArguments";
2748
- if (re(t(n))) return true;
2749
- }
2750
- return false;
2751
- }
2752
- function ll(e) {
2753
- var t;
2754
- return (t = e.typeParameters ?? e.typeArguments) == null ? void 0 : t.params;
2755
- }
2756
- function ml(e) {
2757
- function t(r) {
2758
- switch (r.type) {
2759
- case "FunctionTypeAnnotation":
2760
- case "GenericTypeAnnotation":
2761
- case "TSFunctionType":
2762
- return !!r.typeParameters;
2763
- case "TSTypeReference":
2764
- return !!(r.typeArguments ?? r.typeParameters);
2765
- default:
2766
- return false;
2767
- }
2768
- }
2769
- return t(e.checkType) || t(e.extendsType);
2770
- }
2771
- function Ue(e, t, r, n, s) {
2772
- let u = e.node, i = Q(u), a = s ? rt(e, t, r) : "";
2773
- if (i.length === 0) return [a, "(", N(e, t, { filter: (c) => ke(t.originalText, P(c)) === ")" }), ")"];
2774
- let { parent: o } = e, p = Pt(o), m = gs(u), f = [];
2775
- if (hu(e, (c, A) => {
2776
- let T = A === i.length - 1;
2777
- T && u.rest && f.push("..."), f.push(r()), !T && (f.push(","), p || m ? f.push(" ") : me(i[A], t) ? f.push(F, F) : f.push(x));
2778
- }), n && !fl(e)) {
2779
- if (re(a) || re(f)) throw new Dt();
2780
- return l([cr(a), "(", cr(f), ")"]);
2781
- }
2782
- let y = i.every((c) => !O(c.decorators));
2783
- return m && y ? [a, "(", ...f, ")"] : p ? [a, "(", ...f, ")"] : (Or(o) || Eu(o) || o.type === "TypeAlias" || o.type === "UnionTypeAnnotation" || o.type === "IntersectionTypeAnnotation" || o.type === "FunctionTypeAnnotation" && o.returnType === u) && i.length === 1 && i[0].name === null && u.this !== i[0] && i[0].typeAnnotation && u.typeParameters === null && Nt(i[0].typeAnnotation) && !u.rest ? t.arrowParens === "always" || u.type === "HookTypeAnnotation" ? ["(", ...f, ")"] : f : [a, "(", D([E, ...f]), S(!xu(u) && ce(t, "all") ? "," : ""), E, ")"];
2784
- }
2785
- function gs(e) {
2786
- if (!e) return false;
2787
- let t = Q(e);
2788
- if (t.length !== 1) return false;
2789
- let [r] = t;
2790
- return !d(r) && (r.type === "ObjectPattern" || r.type === "ArrayPattern" || r.type === "Identifier" && r.typeAnnotation && (r.typeAnnotation.type === "TypeAnnotation" || r.typeAnnotation.type === "TSTypeAnnotation") && Re(r.typeAnnotation.typeAnnotation) || r.type === "FunctionTypeParam" && Re(r.typeAnnotation) && r !== e.rest || r.type === "AssignmentPattern" && (r.left.type === "ObjectPattern" || r.left.type === "ArrayPattern") && (r.right.type === "Identifier" || ue(r.right) && r.right.properties.length === 0 || U(r.right) && r.right.elements.length === 0));
2791
- }
2792
- function yl(e) {
2793
- let t;
2794
- return e.returnType ? (t = e.returnType, t.typeAnnotation && (t = t.typeAnnotation)) : e.typeAnnotation && (t = e.typeAnnotation), t;
2795
- }
2796
- function ct(e, t) {
2797
- var s;
2798
- let r = yl(e);
2799
- if (!r) return false;
2800
- let n = (s = e.typeParameters) == null ? void 0 : s.params;
2801
- if (n) {
2802
- if (n.length > 1) return false;
2803
- if (n.length === 1) {
2804
- let u = n[0];
2805
- if (u.constraint || u.default) return false;
2806
- }
2807
- }
2808
- return Q(e).length === 1 && (Re(r) || re(t));
2809
- }
2810
- function fl(e) {
2811
- return e.match((t) => t.type === "ArrowFunctionExpression" && t.body.type === "BlockStatement", (t, r) => {
2812
- if (t.type === "CallExpression" && r === "arguments" && t.arguments.length === 1 && t.callee.type === "CallExpression") {
2813
- let n = t.callee.callee;
2814
- return n.type === "Identifier" || n.type === "MemberExpression" && !n.computed && n.object.type === "Identifier" && n.property.type === "Identifier";
2815
- }
2816
- return false;
2817
- }, (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);
2818
- }
2819
- function Hi(e) {
2820
- let t = Q(e);
2821
- return t.length > 1 && t.some((r) => r.type === "TSParameterProperty");
2822
- }
2823
- var Dl = R(["VoidTypeAnnotation", "TSVoidKeyword", "NullLiteralTypeAnnotation", "TSNullKeyword"]), El = R(["ObjectTypeAnnotation", "TSTypeLiteral", "GenericTypeAnnotation", "TSTypeReference"]);
2824
- function Fl(e) {
2825
- let { types: t } = e;
2826
- if (t.some((n) => d(n))) return false;
2827
- let r = t.find((n) => El(n));
2828
- return r ? t.every((n) => n === r || Dl(n)) : false;
2829
- }
2830
- function Ss(e) {
2831
- return Nt(e) || Re(e) ? true : Oe(e) ? Fl(e) : false;
2832
- }
2833
- function Vi(e, t, r) {
2834
- let n = t.semi ? ";" : "", { node: s } = e, u = [$(e), "opaque type ", r("id"), r("typeParameters")];
2835
- return s.supertype && u.push(": ", r("supertype")), s.impltype && u.push(" = ", r("impltype")), u.push(n), u;
2836
- }
2837
- function Zr(e, t, r) {
2838
- let n = t.semi ? ";" : "", { node: s } = e, u = [$(e)];
2839
- u.push("type ", r("id"), r("typeParameters"));
2840
- let i = s.type === "TSTypeAliasDeclaration" ? "typeAnnotation" : "right";
2841
- return [ht(e, t, r, u, " =", i), n];
2842
- }
2843
- function en(e, t, r) {
2844
- let n = false;
2845
- return l(e.map(({ isFirst: s, previous: u, node: i, index: a }) => {
2846
- let o = r();
2847
- if (s) return o;
2848
- let p = Re(i), m = Re(u);
2849
- return m && p ? [" & ", n ? D(o) : o] : !m && !p || de(t.originalText, i) ? t.experimentalOperatorPosition === "start" ? D([x, "& ", o]) : D([" &", x, o]) : (a > 1 && (n = true), [" & ", a > 1 ? D(o) : o]);
2850
- }, "types"));
2851
- }
2852
- function tn(e, t, r) {
2853
- let { node: n } = e, { parent: s } = e, u = s.type !== "TypeParameterInstantiation" && (!Je(s) || !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") && de(t.originalText, n)), i = Ss(n), a = e.map((m) => {
2854
- let f = r();
2855
- return i || (f = be(2, f)), Ee(m, f, t);
2856
- }, "types");
2857
- if (i) return b(" | ", a);
2858
- let o = u && !de(t.originalText, n), p = [S([o ? x : "", "| "]), b([x, "| "], a)];
2859
- return Le(e, t) ? l([D(p), E]) : (s.type === "TupleTypeAnnotation" || s.type === "TSTupleType") && s[s.type === "TupleTypeAnnotation" && s.types ? "types" : "elementTypes"].length > 1 ? l([D([S(["(", E]), p]), E, S(")")]) : l(u ? D(p) : p);
2860
- }
2861
- function Cl(e) {
2862
- var n;
2863
- let { node: t, parent: r } = e;
2864
- return t.type === "FunctionTypeAnnotation" && (Or(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"));
2865
- }
2866
- function rn(e, t, r) {
2867
- let { node: n } = e, s = [Vt(e)];
2868
- (n.type === "TSConstructorType" || n.type === "TSConstructSignatureDeclaration") && s.push("new ");
2869
- let u = Ue(e, t, r, false, true), i = [];
2870
- return n.type === "FunctionTypeAnnotation" ? i.push(Cl(e) ? " => " : ": ", r("returnType")) : i.push(H(e, r, n.returnType ? "returnType" : "typeAnnotation")), ct(n, i) && (u = l(u)), s.push(u, i), l(s);
2871
- }
2872
- function nn(e, t, r) {
2873
- return [r("objectType"), V(e), "[", r("indexType"), "]"];
2874
- }
2875
- function sn(e, t, r) {
2876
- return ["infer ", r("typeParameter")];
2877
- }
2878
- function Bs(e, t, r) {
2879
- let { node: n } = e;
2880
- return [n.postfix ? "" : r, H(e, t), n.postfix ? r : ""];
2881
- }
2882
- function un(e, t, r) {
2883
- let { node: n } = e;
2884
- return ["...", ...n.type === "TupleTypeSpreadElement" && n.label ? [r("label"), ": "] : [], r("typeAnnotation")];
2885
- }
2886
- function an(e, t, r) {
2887
- let { node: n } = e;
2888
- return [n.variance ? r("variance") : "", r("label"), n.optional ? "?" : "", ": ", r("elementType")];
2889
- }
2890
- var Al = /* @__PURE__ */ new WeakSet();
2891
- function H(e, t, r = "typeAnnotation") {
2892
- let { node: { [r]: n } } = e;
2893
- if (!n) return "";
2894
- let s = false;
2895
- if (n.type === "TSTypeAnnotation" || n.type === "TypeAnnotation") {
2896
- let u = e.call($i, r);
2897
- (u === "=>" || u === ":" && d(n, h.Leading)) && (s = true), Al.add(n);
2898
- }
2899
- return s ? [" ", t(r)] : t(r);
2900
- }
2901
- var $i = (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) ? "" : ":";
2902
- function on(e, t, r) {
2903
- let n = $i(e);
2904
- return n ? [n, " ", r("typeAnnotation")] : r("typeAnnotation");
2905
- }
2906
- function pn(e) {
2907
- return [e("elementType"), "[]"];
2908
- }
2909
- function cn({ node: e }, t) {
2910
- let r = e.type === "TSTypeQuery" ? "exprName" : "argument", n = e.type === "TypeofTypeAnnotation" || e.typeArguments ? "typeArguments" : "typeParameters";
2911
- return ["typeof ", t(r), t(n)];
2912
- }
2913
- function ln(e, t) {
2914
- let { node: r } = e;
2915
- return [r.type === "TSTypePredicate" && r.asserts ? "asserts " : r.type === "TypePredicate" && r.kind ? `${r.kind} ` : "", t("parameterName"), r.typeAnnotation ? [" is ", H(e, t)] : ""];
2916
- }
2917
- function V(e) {
2918
- let { node: t } = e;
2919
- return !t.optional || t.type === "Identifier" && t === e.parent.key ? "" : w(t) || G(t) && t.computed || t.type === "OptionalIndexedAccessType" ? "?." : "?";
2920
- }
2921
- function mn(e) {
2922
- return e.node.definite || e.match(void 0, (t, r) => r === "id" && t.type === "VariableDeclarator" && t.definite) ? "!" : "";
2923
- }
2924
- var dl = /* @__PURE__ */ new Set(["DeclareClass", "DeclareComponent", "DeclareFunction", "DeclareHook", "DeclareVariable", "DeclareExportDeclaration", "DeclareExportAllDeclaration", "DeclareOpaqueType", "DeclareTypeAlias", "DeclareEnum", "DeclareInterface"]);
2925
- function $(e) {
2926
- let { node: t } = e;
2927
- return t.declare || dl.has(t.type) && e.parent.type !== "DeclareExportDeclaration" ? "declare " : "";
2928
- }
2929
- var Tl = /* @__PURE__ */ new Set(["TSAbstractMethodDefinition", "TSAbstractPropertyDefinition", "TSAbstractAccessorProperty"]);
2930
- function Vt({ node: e }) {
2931
- return e.abstract || Tl.has(e.type) ? "abstract " : "";
2932
- }
2933
- function rt(e, t, r) {
2934
- let n = e.node;
2935
- return n.typeArguments ? r("typeArguments") : n.typeParameters ? r("typeParameters") : "";
2936
- }
2937
- function Kr(e, t, r) {
2938
- return ["::", r("callee")];
2939
- }
2940
- function Et(e, t, r) {
2941
- return e.type === "EmptyStatement" ? ";" : e.type === "BlockStatement" || r ? [" ", t] : D([x, t]);
2942
- }
2943
- function yn(e, t) {
2944
- return ["...", t("argument"), H(e, t)];
2945
- }
2946
- function $t(e) {
2947
- return e.accessibility ? e.accessibility + " " : "";
2948
- }
2949
- function xl(e, t, r, n) {
2950
- let { node: s } = e, u = s.inexact ? "..." : "";
2951
- return d(s, h.Dangling) ? l([r, u, N(e, t, { indent: true }), E, n]) : [r, u, n];
2952
- }
2953
- function Kt(e, t, r) {
2954
- let { node: n } = e, s = [], u = "[", i = "]", a = n.type === "TupleTypeAnnotation" && n.types ? "types" : n.type === "TSTupleType" || n.type === "TupleTypeAnnotation" ? "elementTypes" : "elements", o = n[a];
2955
- if (o.length === 0) s.push(xl(e, t, u, i));
2956
- else {
2957
- let p = v(false, o, -1), m = (p == null ? void 0 : p.type) !== "RestElement" && !n.inexact, f = p === null, y = Symbol("array"), C = !t.__inJestEach && o.length > 1 && o.every((T, B, g) => {
2958
- let _ = T == null ? void 0 : T.type;
2959
- if (!U(T) && !ue(T)) return false;
2960
- let M = g[B + 1];
2961
- if (M && _ !== M.type) return false;
2962
- let J = U(T) ? "elements" : "properties";
2963
- return T[J] && T[J].length > 1;
2964
- }), c = Ts(n, t), A = m ? f ? "," : ce(t) ? c ? S(",", "", { groupId: y }) : S(",") : "" : "";
2965
- s.push(l([u, D([E, c ? gl(e, t, r, A) : [hl(e, t, r, a, n.inexact), A], N(e, t)]), E, i], { shouldBreak: C, id: y }));
2966
- }
2967
- return s.push(V(e), H(e, r)), s;
2968
- }
2969
- function Ts(e, t) {
2970
- return U(e) && e.elements.length > 1 && e.elements.every((r) => r && (ye(r) || Rn(r) && !d(r.argument)) && !d(r, h.Trailing | h.Line, (n) => !ee(t.originalText, j(n), { backwards: true })));
2971
- }
2972
- function Ki({ node: e }, { originalText: t }) {
2973
- let r = (s) => _t(t, Mt(t, s)), n = (s) => t[s] === "," ? s : n(r(s + 1));
2974
- return vt(t, n(P(e)));
2975
- }
2976
- function hl(e, t, r, n, s) {
2977
- let u = [];
2978
- return e.each(({ node: i, isLast: a }) => {
2979
- u.push(i ? l(r()) : ""), (!a || s) && u.push([",", x, i && Ki(e, t) ? E : ""]);
2980
- }, n), s && u.push("..."), u;
2981
- }
2982
- function gl(e, t, r, n) {
2983
- let s = [];
2984
- return e.each(({ isLast: u, next: i }) => {
2985
- s.push([r(), u ? n : ","]), u || s.push(Ki(e, t) ? [F, F] : d(i, h.Leading | h.Line) ? F : x);
2986
- }, "elements"), Nr(s);
2987
- }
2988
- var Sl = /^[\$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]*$/, Bl = (e) => Sl.test(e), Qi = Bl;
2989
- function bl(e) {
2990
- 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, "");
2991
- }
2992
- var Ft = bl;
2993
- var fn = /* @__PURE__ */ new WeakMap();
2994
- function Zi(e) {
2995
- return /^(?:\d+|\d+\.\d+)$/u.test(e);
2996
- }
2997
- function zi(e, t) {
2998
- return t.parser === "json" || t.parser === "jsonc" || !K(e.key) || ut(ae(e.key), t).slice(1, -1) !== e.key.value ? false : !!(Qi(e.key.value) && !(t.parser === "babel-ts" && e.type === "ClassProperty" || (t.parser === "typescript" || t.parser === "oxc-ts") && e.type === "PropertyDefinition") || Zi(e.key.value) && String(Number(e.key.value)) === e.key.value && e.type !== "ImportAttribute" && (t.parser === "babel" || t.parser === "acorn" || t.parser === "oxc" || t.parser === "espree" || t.parser === "meriyah" || t.parser === "__babel_estree"));
2999
- }
3000
- function Pl(e, t) {
3001
- let { key: r } = e.node;
3002
- return (r.type === "Identifier" || ye(r) && Zi(Ft(ae(r))) && String(r.value) === Ft(ae(r)) && !(t.parser === "typescript" || t.parser === "babel-ts" || t.parser === "oxc-ts")) && (t.parser === "json" || t.parser === "jsonc" || t.quoteProps === "consistent" && fn.get(e.parent));
3003
- }
3004
- function Ct(e, t, r) {
3005
- let { node: n } = e;
3006
- if (n.computed) return ["[", r("key"), "]"];
3007
- let { parent: s } = e, { key: u } = n;
3008
- if (t.quoteProps === "consistent" && !fn.has(s)) {
3009
- let i = e.siblings.some((a) => !a.computed && K(a.key) && !zi(a, t));
3010
- fn.set(s, i);
3011
- }
3012
- if (Pl(e, t)) {
3013
- let i = ut(JSON.stringify(u.type === "Identifier" ? u.name : u.value.toString()), t);
3014
- return e.call((a) => Ee(a, i, t), "key");
3015
- }
3016
- return zi(n, t) && (t.quoteProps === "as-needed" || t.quoteProps === "consistent" && !fn.get(s)) ? e.call((i) => Ee(i, /^\d/u.test(u.value) ? Ft(u.value) : u.value, t), "key") : r("key");
3017
- }
3018
- function Dn(e, t, r) {
3019
- let { node: n } = e;
3020
- return n.shorthand ? r("value") : ht(e, t, r, Ct(e, t, r), ":", "value");
3021
- }
3022
- var kl = ({ 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));
3023
- function En(e, t, r, n) {
3024
- if (kl(e)) return Fn(e, t, r);
3025
- let { node: s } = e, u = false;
3026
- if ((s.type === "FunctionDeclaration" || s.type === "FunctionExpression") && (n != null && n.expandLastArg)) {
3027
- let { parent: m } = e;
3028
- w(m) && (le(m).length > 1 || Q(s).every((f) => f.type === "Identifier" && !f.typeAnnotation)) && (u = true);
3029
- }
3030
- let i = [$(e), s.async ? "async " : "", `function${s.generator ? "*" : ""} `, s.id ? r("id") : ""], a = Ue(e, t, r, u), o = Qt(e, r), p = ct(s, o);
3031
- return i.push(rt(e, t, r), l([p ? l(a) : a, o]), s.body ? " " : "", r("body")), t.semi && (s.declare || !s.body) && i.push(";"), i;
3032
- }
3033
- function Er(e, t, r) {
3034
- let { node: n } = e, { kind: s } = n, u = n.value || n, i = [];
3035
- return !s || s === "init" || s === "method" || s === "constructor" ? u.async && i.push("async ") : (jt.ok(s === "get" || s === "set"), i.push(s, " ")), u.generator && i.push("*"), i.push(Ct(e, t, r), n.optional ? "?" : "", n === u ? Fn(e, t, r) : r("value")), i;
3036
- }
3037
- function Fn(e, t, r) {
3038
- let { node: n } = e, s = Ue(e, t, r), u = Qt(e, r), i = Hi(n), a = ct(n, u), o = [rt(e, t, r), l([i ? l(s, { shouldBreak: true }) : a ? l(s) : s, u])];
3039
- return n.body ? o.push(" ", r("body")) : o.push(t.semi ? ";" : ""), o;
3040
- }
3041
- function Il(e) {
3042
- let t = Q(e);
3043
- 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;
3044
- }
3045
- function Cn(e, t) {
3046
- if (t.arrowParens === "always") return false;
3047
- if (t.arrowParens === "avoid") {
3048
- let { node: r } = e;
3049
- return Il(r);
3050
- }
3051
- return false;
3052
- }
3053
- function Qt(e, t) {
3054
- let { node: r } = e, s = [H(e, t, "returnType")];
3055
- return r.predicate && s.push(t("predicate")), s;
3056
- }
3057
- function ea(e, t, r) {
3058
- let { node: n } = e, s = t.semi ? ";" : "", u = [];
3059
- if (n.argument) {
3060
- let o = r("argument");
3061
- Ll(t, n.argument) ? o = ["(", D([F, o]), F, ")"] : (Fe(n.argument) || t.experimentalTernaries && n.argument.type === "ConditionalExpression" && (n.argument.consequent.type === "ConditionalExpression" || n.argument.alternate.type === "ConditionalExpression")) && (o = l([S("("), D([E, o]), E, S(")")])), u.push(" ", o);
3062
- }
3063
- let i = d(n, h.Dangling), a = s && i && d(n, h.Last | h.Line);
3064
- return a && u.push(s), i && u.push(" ", N(e, t)), a || u.push(s), u;
3065
- }
3066
- function ta(e, t, r) {
3067
- return ["return", ea(e, t, r)];
3068
- }
3069
- function ra(e, t, r) {
3070
- return ["throw", ea(e, t, r)];
3071
- }
3072
- function Ll(e, t) {
3073
- if (de(e.originalText, t) || d(t, h.Leading, (r) => ie(e.originalText, j(r), P(r))) && !Y(t)) return true;
3074
- if (Jt(t)) {
3075
- let r = t, n;
3076
- for (; n = mu(r); ) if (r = n, de(e.originalText, r)) return true;
3077
- }
3078
- return false;
3079
- }
3080
- var bs = /* @__PURE__ */ new WeakMap();
3081
- function na(e) {
3082
- return bs.has(e) || bs.set(e, e.type === "ConditionalExpression" && !pe(e, (t) => t.type === "ObjectExpression")), bs.get(e);
3083
- }
3084
- var wl = (e) => e.type === "SequenceExpression";
3085
- function sa(e, t, r, n = {}) {
3086
- let s = [], u, i = [], a = false, o = !n.expandLastArg && e.node.body.type === "ArrowFunctionExpression", p;
3087
- (function B() {
3088
- let { node: g } = e, _ = Ol(e, t, r, n);
3089
- if (s.length === 0) s.push(_);
3090
- else {
3091
- let { leading: M, trailing: J } = fs(e, t);
3092
- s.push([M, _]), i.unshift(J);
3093
- }
3094
- o && (a || (a = g.returnType && Q(g).length > 0 || g.typeParameters || Q(g).some((M) => M.type !== "Identifier"))), !o || g.body.type !== "ArrowFunctionExpression" ? (u = r("body", n), p = g.body) : e.call(B, "body");
3095
- })();
3096
- let m = !de(t.originalText, p) && (wl(p) || _l(p, u, t) || !a && na(p)), f = e.key === "callee" && yt(e.parent), y = Symbol("arrow-chain"), C = Ml(e, n, { signatureDocs: s, shouldBreak: a }), c = false, A = false, T = false;
3097
- return o && (f || n.assignmentLayout) && (A = true, T = !d(e.node, h.Leading & h.Line), c = n.assignmentLayout === "chain-tail-arrow-chain" || f && !m), u = vl(e, t, n, { bodyDoc: u, bodyComments: i, functionBody: p, shouldPutBodyOnSameLine: m }), l([l(A ? D([T ? E : "", C]) : C, { shouldBreak: c, id: y }), " =>", o ? xt(u, { groupId: y }) : l(u), o && f ? S(E, "", { groupId: y }) : ""]);
3098
- }
3099
- function Ol(e, t, r, n) {
3100
- let { node: s } = e, u = [];
3101
- if (s.async && u.push("async "), Cn(e, t)) u.push(r(["params", 0]));
3102
- else {
3103
- let a = n.expandLastArg || n.expandFirstArg, o = Qt(e, r);
3104
- if (a) {
3105
- if (re(o)) throw new Dt();
3106
- o = l(cr(o));
3107
- }
3108
- u.push(l([Ue(e, t, r, a, true), o]));
3109
- }
3110
- let i = N(e, t, { filter(a) {
3111
- let o = ot(t.originalText, P(a));
3112
- return o !== false && t.originalText.slice(o, o + 2) === "=>";
3113
- } });
3114
- return i && u.push(" ", i), u;
3115
- }
3116
- function _l(e, t, r) {
3117
- var n, s;
3118
- return U(e) || ue(e) || e.type === "ArrowFunctionExpression" || e.type === "DoExpression" || e.type === "BlockStatement" || Y(e) || ((n = t.label) == null ? void 0 : n.hug) !== false && (((s = t.label) == null ? void 0 : s.embed) || _r(e, r.originalText));
3119
- }
3120
- function Ml(e, t, { signatureDocs: r, shouldBreak: n }) {
3121
- if (r.length === 1) return r[0];
3122
- let { parent: s, key: u } = e;
3123
- return u !== "callee" && yt(s) || Fe(s) ? l([r[0], " =>", D([x, b([" =>", x], r.slice(1))])], { shouldBreak: n }) : u === "callee" && yt(s) || t.assignmentLayout ? l(b([" =>", x], r), { shouldBreak: n }) : l(D(b([" =>", x], r)), { shouldBreak: n });
3124
- }
3125
- function vl(e, t, r, { bodyDoc: n, bodyComments: s, functionBody: u, shouldPutBodyOnSameLine: i }) {
3126
- let { node: a, parent: o } = e, p = r.expandLastArg && ce(t, "all") ? S(",") : "", m = (r.expandLastArg || o.type === "JSXExpressionContainer") && !d(a) ? E : "";
3127
- return i && na(u) ? [" ", l([S("", "("), D([E, n]), S("", ")"), p, m]), s] : i ? [" ", n, s] : [D([x, n, s]), p, m];
3128
- }
3129
- var jl = (e, t, r) => {
3130
- if (!(e && t == null)) {
3131
- if (t.findLast) return t.findLast(r);
3132
- for (let n = t.length - 1; n >= 0; n--) {
3133
- let s = t[n];
3134
- if (r(s, n, t)) return s;
3135
- }
3136
- }
3137
- }, ua = jl;
3138
- function Fr(e, t, r, n) {
3139
- let { node: s } = e, u = [], i = ua(false, s[n], (a) => a.type !== "EmptyStatement");
3140
- return e.each(({ node: a }) => {
3141
- a.type !== "EmptyStatement" && (u.push(r()), a !== i && (u.push(F), me(a, t) && u.push(F)));
3142
- }, n), u;
3143
- }
3144
- function An(e, t, r) {
3145
- let n = Rl(e, t, r), { node: s, parent: u } = e;
3146
- if (s.type === "Program" && (u == null ? void 0 : u.type) !== "ModuleExpression") return n ? [n, F] : "";
3147
- let i = [];
3148
- if (s.type === "StaticBlock" && i.push("static "), i.push("{"), n) i.push(D([F, n]), F);
3149
- else {
3150
- let a = e.grandparent;
3151
- 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);
3152
- }
3153
- return i.push("}"), i;
3154
- }
3155
- function Rl(e, t, r) {
3156
- let { node: n } = e, s = O(n.directives), u = n.body.some((o) => o.type !== "EmptyStatement"), i = d(n, h.Dangling);
3157
- if (!s && !u && !i) return "";
3158
- let a = [];
3159
- return s && (a.push(Fr(e, t, r, "directives")), (u || i) && (a.push(F), me(v(false, n.directives, -1), t) && a.push(F))), u && a.push(Fr(e, t, r, "body")), i && a.push(N(e, t)), a;
3160
- }
3161
- function Jl(e) {
3162
- let t = /* @__PURE__ */ new WeakMap();
3163
- return function(r) {
3164
- return t.has(r) || t.set(r, Symbol(e)), t.get(r);
3165
- };
3166
- }
3167
- var dn = Jl;
3168
- var Cr = dn("typeParameters");
3169
- function Nl(e, t, r) {
3170
- let { node: n } = e;
3171
- return Q(n).length === 1 && n.type.startsWith("TS") && !n[r][0].constraint && e.parent.type === "ArrowFunctionExpression" && !(t.filepath && /\.ts$/u.test(t.filepath));
3172
- }
3173
- function wt(e, t, r, n) {
3174
- let { node: s } = e;
3175
- if (!s[n]) return "";
3176
- if (!Array.isArray(s[n])) return r(n);
3177
- let u = Pt(e.grandparent), i = e.match((p) => !(p[n].length === 1 && Re(p[n][0])), void 0, (p, m) => m === "typeAnnotation", (p) => p.type === "Identifier", hs);
3178
- if (s[n].length === 0 || !i && (u || s[n].length === 1 && (s[n][0].type === "NullableTypeAnnotation" || Ss(s[n][0])))) return ["<", b(", ", e.map(r, n)), Gl(e, t), ">"];
3179
- let o = s.type === "TSTypeParameterInstantiation" ? "" : Nl(e, t, n) ? "," : ce(t) ? S(",") : "";
3180
- return l(["<", D([E, b([",", x], e.map(r, n))]), o, E, ">"], { id: Cr(s) });
3181
- }
3182
- function Gl(e, t) {
3183
- let { node: r } = e;
3184
- if (!d(r, h.Dangling)) return "";
3185
- let n = !d(r, h.Line), s = N(e, t, { indent: !n });
3186
- return n ? s : [s, F];
3187
- }
3188
- function Tn(e, t, r) {
3189
- let { node: n } = e, s = [n.const ? "const " : ""], u = n.type === "TSTypeParameter" ? r("name") : n.name;
3190
- if (n.variance && s.push(r("variance")), n.in && s.push("in "), n.out && s.push("out "), s.push(u), n.bound && (n.usesExtendsBound && s.push(" extends "), s.push(H(e, r, "bound"))), n.constraint) {
3191
- let i = Symbol("constraint");
3192
- s.push(" extends", l(D(x), { id: i }), je, xt(r("constraint"), { groupId: i }));
3193
- }
3194
- return n.default && s.push(" = ", r("default")), l(s);
3195
- }
3196
- var ia = R(["ClassProperty", "PropertyDefinition", "ClassPrivateProperty", "ClassAccessorProperty", "AccessorProperty", "TSAbstractPropertyDefinition", "TSAbstractAccessorProperty"]);
3197
- function xn(e, t, r) {
3198
- let { node: n } = e, s = [$(e), Vt(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 = [];
3199
- if (n.id && i.push(" ", r("id")), i.push(r("typeParameters")), n.superClass) {
3200
- let m = [Wl(e, t, r), r(n.superTypeArguments ? "superTypeArguments" : "superTypeParameters")], f = e.call((y) => ["extends ", Ee(y, m, t)], "superClass");
3201
- u ? a.push(x, l(f)) : a.push(" ", f);
3202
- } else a.push(Ps(e, t, r, "extends"));
3203
- a.push(Ps(e, t, r, "mixins"), Ps(e, t, r, "implements"));
3204
- let o;
3205
- if (u) {
3206
- let m;
3207
- pa(n) ? m = [...i, D(a)] : m = D([...i, a]), o = aa(n), s.push(l(m, { id: o }));
3208
- } else s.push(...i, ...a);
3209
- let p = n.body;
3210
- return u && O(p.body) ? s.push(S(F, " ", { groupId: o })) : s.push(" "), s.push(r("body")), s;
3211
- }
3212
- var aa = dn("heritageGroup");
3213
- function oa(e) {
3214
- return S(F, "", { groupId: aa(e) });
3215
- }
3216
- function ql(e) {
3217
- return ["extends", "mixins", "implements"].reduce((t, r) => t + (Array.isArray(e[r]) ? e[r].length : 0), e.superClass ? 1 : 0) > 1;
3218
- }
3219
- function pa(e) {
3220
- return e.typeParameters && !d(e.typeParameters, h.Trailing | h.Line) && !ql(e);
3221
- }
3222
- function Ps(e, t, r, n) {
3223
- let { node: s } = e;
3224
- if (!O(s[n])) return "";
3225
- let u = N(e, t, { marker: n });
3226
- return [pa(s) ? S(" ", x, { groupId: Cr(s.typeParameters) }) : x, u, u && F, n, l(D([x, b([",", x], e.map(r, n))]))];
3227
- }
3228
- function Wl(e, t, r) {
3229
- let n = r("superClass"), { parent: s } = e;
3230
- return s.type === "AssignmentExpression" ? l(S(["(", D([E, n]), E, ")"], n)) : n;
3231
- }
3232
- function hn(e, t, r) {
3233
- let { node: n } = e, s = [];
3234
- return O(n.decorators) && s.push(ds(e, t, r)), s.push($t(n)), n.static && s.push("static "), s.push(Vt(e)), n.override && s.push("override "), s.push(Er(e, t, r)), s;
3235
- }
3236
- function gn(e, t, r) {
3237
- let { node: n } = e, s = [], u = t.semi ? ";" : "";
3238
- O(n.decorators) && s.push(ds(e, t, r)), s.push($(e), $t(n)), n.static && s.push("static "), s.push(Vt(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(Ct(e, t, r), V(e), mn(e), H(e, r));
3239
- let i = n.type === "TSAbstractPropertyDefinition" || n.type === "TSAbstractAccessorProperty";
3240
- return [ht(e, t, r, s, " =", i ? void 0 : "value"), u];
3241
- }
3242
- function ca(e, t, r) {
3243
- let { node: n } = e, s = [];
3244
- return e.each(({ node: u, next: i, isLast: a }) => {
3245
- s.push(r()), !t.semi && ia(u) && Ul(u, i) && s.push(";"), a || (s.push(F), me(u, t) && s.push(F));
3246
- }, "body"), d(n, h.Dangling) && s.push(N(e, t)), ["{", s.length > 0 ? [D([F, s]), F] : "", "}"];
3247
- }
3248
- function Ul(e, t) {
3249
- var s;
3250
- let { type: r, name: n } = e.key;
3251
- if (!e.computed && r === "Identifier" && (n === "static" || n === "get" || n === "set") && !e.value && !e.typeAnnotation) return true;
3252
- if (!t || t.static || t.accessibility || t.readonly) return false;
3253
- if (!t.computed) {
3254
- let u = (s = t.key) == null ? void 0 : s.name;
3255
- if (u === "in" || u === "instanceof") return true;
3256
- }
3257
- if (ia(t) && t.variance && !t.static && !t.declare) return true;
3258
- switch (t.type) {
3259
- case "ClassProperty":
3260
- case "PropertyDefinition":
3261
- case "TSAbstractPropertyDefinition":
3262
- return t.computed;
3263
- case "MethodDefinition":
3264
- case "TSAbstractMethodDefinition":
3265
- case "ClassMethod":
3266
- case "ClassPrivateMethod": {
3267
- if ((t.value ? t.value.async : t.async) || t.kind === "get" || t.kind === "set") return false;
3268
- let i = t.value ? t.value.generator : t.generator;
3269
- return !!(t.computed || i);
3270
- }
3271
- case "TSIndexSignature":
3272
- return true;
3273
- }
3274
- return false;
3275
- }
3276
- var Xl = R(["TSAsExpression", "TSTypeAssertion", "TSNonNullExpression", "TSInstantiationExpression", "TSSatisfiesExpression"]);
3277
- function ks(e) {
3278
- return Xl(e) ? ks(e.expression) : e;
3279
- }
3280
- var la = R(["FunctionExpression", "ArrowFunctionExpression"]);
3281
- function ma(e) {
3282
- return e.type === "MemberExpression" || e.type === "OptionalMemberExpression" || e.type === "Identifier" && e.name !== "undefined";
3283
- }
3284
- function ya(e, t) {
3285
- if (t.semi || Is(e, t) || Ls(e, t)) return false;
3286
- let { node: r, key: n, parent: s } = e;
3287
- 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(() => fa(e, t), "expression"));
3288
- }
3289
- function fa(e, t) {
3290
- let { node: r } = e;
3291
- switch (r.type) {
3292
- case "ParenthesizedExpression":
3293
- case "TypeCastExpression":
3294
- case "ArrayExpression":
3295
- case "ArrayPattern":
3296
- case "TemplateLiteral":
3297
- case "TemplateElement":
3298
- case "RegExpLiteral":
3299
- return true;
3300
- case "ArrowFunctionExpression":
3301
- if (!Cn(e, t)) return true;
3302
- break;
3303
- case "UnaryExpression": {
3304
- let { prefix: n, operator: s } = r;
3305
- if (n && (s === "+" || s === "-")) return true;
3306
- break;
3307
- }
3308
- case "BindExpression":
3309
- if (!r.object) return true;
3310
- break;
3311
- case "Literal":
3312
- if (r.regex) return true;
3313
- break;
3314
- default:
3315
- if (Y(r)) return true;
3316
- }
3317
- return Le(e, t) ? true : Jt(r) ? e.call(() => fa(e, t), ...Lr(r)) : false;
3318
- }
3319
- function Is({ node: e, parent: t }, r) {
3320
- return (r.parentParser === "markdown" || r.parentParser === "mdx") && e.type === "ExpressionStatement" && Y(e.expression) && t.type === "Program" && t.body.length === 1;
3321
- }
3322
- function Ls({ node: e, parent: t }, r) {
3323
- return (r.parser === "__vue_event_binding" || r.parser === "__vue_ts_event_binding") && e.type === "ExpressionStatement" && t.type === "Program" && t.body.length === 1;
3324
- }
3325
- function Da(e, t, r) {
3326
- let n = [r("expression")];
3327
- if (Ls(e, t)) {
3328
- let s = ks(e.node.expression);
3329
- (la(s) || ma(s)) && n.push(";");
3330
- } else Is(e, t) || t.semi && n.push(";");
3331
- return n;
3332
- }
3333
- function Ea(e, t, r) {
3334
- if (t.__isVueBindings || t.__isVueForBindingLeft) {
3335
- let n = e.map(r, "program", "body", 0, "params");
3336
- if (n.length === 1) return n[0];
3337
- let s = b([",", x], n);
3338
- return t.__isVueForBindingLeft ? ["(", D([E, l(s)]), E, ")"] : s;
3339
- }
3340
- if (t.__isEmbeddedTypescriptGenericParameters) {
3341
- let n = e.map(r, "program", "body", 0, "typeParameters", "params");
3342
- return b([",", x], n);
3343
- }
3344
- }
3345
- function Aa(e, t) {
3346
- let { node: r } = e;
3347
- switch (r.type) {
3348
- case "RegExpLiteral":
3349
- return Fa(r);
3350
- case "BigIntLiteral":
3351
- return Sn(r.extra.raw);
3352
- case "NumericLiteral":
3353
- return Ft(r.extra.raw);
3354
- case "StringLiteral":
3355
- return ve(ut(r.extra.raw, t));
3356
- case "NullLiteral":
3357
- return "null";
3358
- case "BooleanLiteral":
3359
- return String(r.value);
3360
- case "DirectiveLiteral":
3361
- return Ca(r.extra.raw, t);
3362
- case "Literal": {
3363
- if (r.regex) return Fa(r.regex);
3364
- if (r.bigint) return Sn(r.raw);
3365
- let { value: n } = r;
3366
- return typeof n == "number" ? Ft(r.raw) : typeof n == "string" ? Yl(e) ? Ca(r.raw, t) : ve(ut(r.raw, t)) : String(n);
3367
- }
3368
- }
3369
- }
3370
- function Yl(e) {
3371
- if (e.key !== "expression") return;
3372
- let { parent: t } = e;
3373
- return t.type === "ExpressionStatement" && typeof t.directive == "string";
3374
- }
3375
- function Sn(e) {
3376
- return e.toLowerCase();
3377
- }
3378
- function Fa({ pattern: e, flags: t }) {
3379
- return t = [...t].sort().join(""), `/${e}/${t}`;
3380
- }
3381
- function Ca(e, t) {
3382
- let r = e.slice(1, -1);
3383
- if (r.includes('"') || r.includes("'")) return e;
3384
- let n = t.singleQuote ? "'" : '"';
3385
- return n + r + n;
3386
- }
3387
- function Hl(e, t, r) {
3388
- let n = e.originalText.slice(t, r);
3389
- for (let s of e[Symbol.for("comments")]) {
3390
- let u = j(s);
3391
- if (u > r) break;
3392
- let i = P(s);
3393
- if (i < t) continue;
3394
- let a = i - u;
3395
- n = n.slice(0, u - t) + " ".repeat(a) + n.slice(i - t);
3396
- }
3397
- return n;
3398
- }
3399
- var Ar = Hl;
3400
- function da(e, t, r) {
3401
- let { node: n } = e;
3402
- return ["import", n.phase ? ` ${n.phase}` : "", Os(n), ha(e, t, r), xa(e, t, r), Sa(e, t, r), t.semi ? ";" : ""];
3403
- }
3404
- var Ta = (e) => e.type === "ExportDefaultDeclaration" || e.type === "DeclareExportDeclaration" && e.default;
3405
- function Bn(e, t, r) {
3406
- let { node: n } = e, s = [wi(e, t, r), $(e), "export", Ta(n) ? " default" : ""], { declaration: u, exported: i } = n;
3407
- return d(n, h.Dangling) && (s.push(" ", N(e, t)), Mr(n) && s.push(F)), u ? s.push(" ", r("declaration")) : (s.push(Kl(n)), n.type === "ExportAllDeclaration" || n.type === "DeclareExportAllDeclaration" ? (s.push(" *"), i && s.push(" as ", r("exported"))) : s.push(ha(e, t, r)), s.push(xa(e, t, r), Sa(e, t, r))), s.push($l(n, t)), s;
3408
- }
3409
- var Vl = R(["ClassDeclaration", "ComponentDeclaration", "FunctionDeclaration", "TSInterfaceDeclaration", "DeclareClass", "DeclareComponent", "DeclareFunction", "DeclareHook", "HookDeclaration", "TSDeclareFunction", "EnumDeclaration"]);
3410
- function $l(e, t) {
3411
- return t.semi && (!e.declaration || Ta(e) && !Vl(e.declaration)) ? ";" : "";
3412
- }
3413
- function ws(e, t = true) {
3414
- return e && e !== "value" ? `${t ? " " : ""}${e}${t ? "" : " "}` : "";
3415
- }
3416
- function Os(e, t) {
3417
- return ws(e.importKind, t);
3418
- }
3419
- function Kl(e) {
3420
- return ws(e.exportKind);
3421
- }
3422
- function xa(e, t, r) {
3423
- let { node: n } = e;
3424
- if (!n.source) return "";
3425
- let s = [];
3426
- return ga(n, t) && s.push(" from"), s.push(" ", r("source")), s;
3427
- }
3428
- function ha(e, t, r) {
3429
- let { node: n } = e;
3430
- if (!ga(n, t)) return "";
3431
- let s = [" "];
3432
- if (O(n.specifiers)) {
3433
- let u = [], i = [];
3434
- e.each(() => {
3435
- let a = e.node.type;
3436
- if (a === "ExportNamespaceSpecifier" || a === "ExportDefaultSpecifier" || a === "ImportNamespaceSpecifier" || a === "ImportDefaultSpecifier") u.push(r());
3437
- else if (a === "ExportSpecifier" || a === "ImportSpecifier") i.push(r());
3438
- else throw new qe(n, "specifier");
3439
- }, "specifiers"), s.push(b(", ", u)), i.length > 0 && (u.length > 0 && s.push(", "), i.length > 1 || u.length > 0 || n.specifiers.some((o) => d(o)) ? s.push(l(["{", D([t.bracketSpacing ? x : E, b([",", x], i)]), S(ce(t) ? "," : ""), t.bracketSpacing ? x : E, "}"])) : s.push(["{", t.bracketSpacing ? " " : "", ...i, t.bracketSpacing ? " " : "", "}"]));
3440
- } else s.push("{}");
3441
- return s;
3442
- }
3443
- function ga(e, t) {
3444
- return e.type !== "ImportDeclaration" || O(e.specifiers) || e.importKind === "type" ? true : Ar(t, j(e), j(e.source)).trimEnd().endsWith("from");
3445
- }
3446
- function Ql(e, t) {
3447
- var n, s;
3448
- if ((n = e.extra) != null && n.deprecatedAssertSyntax) return "assert";
3449
- let r = Ar(t, P(e.source), (s = e.attributes) != null && s[0] ? j(e.attributes[0]) : P(e)).trimStart();
3450
- return r.startsWith("assert") ? "assert" : r.startsWith("with") || O(e.attributes) ? "with" : void 0;
3451
- }
3452
- function Sa(e, t, r) {
3453
- let { node: n } = e;
3454
- if (!n.source) return "";
3455
- let s = Ql(n, t);
3456
- if (!s) return "";
3457
- let u = [` ${s} {`];
3458
- return O(n.attributes) && (t.bracketSpacing && u.push(" "), u.push(b(", ", e.map(r, "attributes"))), t.bracketSpacing && u.push(" ")), u.push("}"), u;
3459
- }
3460
- function Ba(e, t, r) {
3461
- let { node: n } = e, { type: s } = n, u = s.startsWith("Import"), i = u ? "imported" : "local", a = u ? "local" : "exported", o = n[i], p = n[a], m = "", f = "";
3462
- return s === "ExportNamespaceSpecifier" || s === "ImportNamespaceSpecifier" ? m = "*" : o && (m = r(i)), p && !zl(n) && (f = r(a)), [ws(s === "ImportSpecifier" ? n.importKind : n.exportKind, false), m, m && f ? " as " : "", f];
3463
- }
3464
- function zl(e) {
3465
- if (e.type !== "ImportSpecifier" && e.type !== "ExportSpecifier") return false;
3466
- let { local: t, [e.type === "ImportSpecifier" ? "imported" : "exported"]: r } = e;
3467
- if (t.type !== r.type || !au(t, r)) return false;
3468
- if (K(t)) return t.value === r.value && ae(t) === ae(r);
3469
- switch (t.type) {
3470
- case "Identifier":
3471
- return t.name === r.name;
3472
- default:
3473
- return false;
3474
- }
3475
- }
3476
- function gt(e, t, r) {
3477
- var J;
3478
- let n = t.semi ? ";" : "", { node: s } = e, u = s.type === "ObjectTypeAnnotation", i = s.type === "TSEnumBody" || 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"];
3479
- u && a.push("indexers", "callProperties", "internalSlots");
3480
- let o = a.flatMap((I) => e.map(({ node: q }) => ({ node: q, printed: r(), loc: j(q) }), I));
3481
- a.length > 1 && o.sort((I, q) => I.loc - q.loc);
3482
- let { parent: p, key: m } = e, f = u && m === "body" && (p.type === "InterfaceDeclaration" || p.type === "DeclareInterface" || p.type === "DeclareClass"), y = s.type === "TSInterfaceBody" || i || f || s.type === "ObjectPattern" && p.type !== "FunctionDeclaration" && p.type !== "FunctionExpression" && p.type !== "ArrowFunctionExpression" && p.type !== "ObjectMethod" && p.type !== "ClassMethod" && p.type !== "ClassPrivateMethod" && p.type !== "AssignmentPattern" && p.type !== "CatchClause" && s.properties.some((I) => I.value && (I.value.type === "ObjectPattern" || I.value.type === "ArrayPattern")) || s.type !== "ObjectPattern" && t.objectWrap === "preserve" && o.length > 0 && ie(t.originalText, j(s), o[0].loc), C = f ? ";" : s.type === "TSInterfaceBody" || s.type === "TSTypeLiteral" ? S(n, ";") : ",", c = s.exact ? "{|" : "{", A = s.exact ? "|}" : "}", T = [], B = o.map((I) => {
3483
- let q = [...T, l(I.printed)];
3484
- 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(), me(I.node, t) && T.push(F), q;
3485
- });
3486
- if (s.inexact || s.hasUnknownMembers) {
3487
- let I;
3488
- if (d(s, h.Dangling)) {
3489
- let q = d(s, h.Line);
3490
- I = [N(e, t), q || ee(t.originalText, P(v(false, Ve(s), -1))) ? F : x, "..."];
3491
- } else I = ["..."];
3492
- B.push([...T, ...I]);
3493
- }
3494
- let g = (J = v(false, o, -1)) == null ? void 0 : J.node, _ = !(s.inexact || s.hasUnknownMembers || g && (g.type === "RestElement" || (g.type === "TSPropertySignature" || g.type === "TSCallSignatureDeclaration" || g.type === "TSMethodSignature" || g.type === "TSConstructSignatureDeclaration" || g.type === "TSIndexSignature") && d(g, h.PrettierIgnore)) || e.match(void 0, (I, q) => I.type === "TSImportType" && q === "options")), M;
3495
- if (B.length === 0) {
3496
- if (!d(s, h.Dangling)) return [c, A, H(e, r)];
3497
- M = l([c, N(e, t, { indent: true }), E, A, V(e), H(e, r)]);
3498
- } else M = [f && O(s.properties) ? oa(p) : "", c, D([t.bracketSpacing ? x : E, ...B]), S(_ && (C !== "," || ce(t)) ? C : ""), t.bracketSpacing ? x : E, A, V(e), H(e, r)];
3499
- return e.match((I) => I.type === "ObjectPattern" && !O(I.decorators), _s) || Re(s) && (e.match(void 0, (I, q) => q === "typeAnnotation", (I, q) => q === "typeAnnotation", _s) || e.match(void 0, (I, q) => I.type === "FunctionTypeParam" && q === "typeAnnotation", _s)) || !y && e.match((I) => I.type === "ObjectPattern", (I) => I.type === "AssignmentExpression" || I.type === "VariableDeclarator") ? M : l(M, { shouldBreak: y });
3500
- }
3501
- function _s(e, t) {
3502
- return (t === "params" || t === "parameters" || t === "this" || t === "rest") && gs(e);
3503
- }
3504
- function Zl(e) {
3505
- let t = [e];
3506
- for (let r = 0; r < t.length; r++) {
3507
- let n = t[r];
3508
- for (let s of ["test", "consequent", "alternate"]) {
3509
- let u = n[s];
3510
- if (Y(u)) return true;
3511
- u.type === "ConditionalExpression" && t.push(u);
3512
- }
3513
- }
3514
- return false;
3515
- }
3516
- function em(e, t, r) {
3517
- let { node: n } = e, s = n.type === "ConditionalExpression", u = s ? "alternate" : "falseType", { parent: i } = e, a = s ? r("test") : [r("checkType"), " ", "extends", " ", r("extendsType")];
3518
- return i.type === n.type && i[u] === n ? be(2, a) : a;
3519
- }
3520
- var tm = /* @__PURE__ */ new Map([["AssignmentExpression", "right"], ["VariableDeclarator", "init"], ["ReturnStatement", "argument"], ["ThrowStatement", "argument"], ["UnaryExpression", "argument"], ["YieldExpression", "argument"], ["AwaitExpression", "argument"]]);
3521
- function rm(e) {
3522
- let { node: t } = e;
3523
- if (t.type !== "ConditionalExpression") return false;
3524
- let r, n = t;
3525
- for (let s = 0; !r; s++) {
3526
- let u = e.getParentNode(s);
3527
- if (u.type === "ChainExpression" && u.expression === n || w(u) && u.callee === n || G(u) && u.object === n || u.type === "TSNonNullExpression" && u.expression === n) {
3528
- n = u;
3529
- continue;
3530
- }
3531
- u.type === "NewExpression" && u.callee === n || xe(u) && u.expression === n ? (r = e.getParentNode(s + 1), n = u) : r = u;
3532
- }
3533
- return n === t ? false : r[tm.get(r.type)] === n;
3534
- }
3535
- function ba(e, t, r) {
3536
- let { node: n } = e, s = n.type === "ConditionalExpression", u = s ? "consequent" : "trueType", i = s ? "alternate" : "falseType", a = s ? ["test"] : ["checkType", "extendsType"], o = n[u], p = n[i], m = [], f = false, { parent: y } = e, C = y.type === n.type && a.some((W) => y[W] === n), c = y.type === n.type && !C, A, T, B = 0;
3537
- do
3538
- T = A || n, A = e.getParentNode(B), B++;
3539
- while (A && A.type === n.type && a.every((W) => A[W] !== T));
3540
- let g = A || y, _ = T;
3541
- if (s && (Y(n[a[0]]) || Y(o) || Y(p) || Zl(_))) {
3542
- f = true, c = true;
3543
- let W = (Z) => [S("("), D([E, Z]), E, S(")")], ne = (Z) => Z.type === "NullLiteral" || Z.type === "Literal" && Z.value === null || Z.type === "Identifier" && Z.name === "undefined";
3544
- m.push(" ? ", ne(o) ? r(u) : W(r(u)), " : ", p.type === n.type || ne(p) ? r(i) : W(r(i)));
3545
- } else {
3546
- let W = (Z) => t.useTabs ? D(r(Z)) : be(2, r(Z)), ne = [x, "? ", o.type === n.type ? S("", "(") : "", W(u), o.type === n.type ? S("", ")") : "", x, ": ", W(i)];
3547
- m.push(y.type !== n.type || y[i] === n || C ? ne : t.useTabs ? Jr(D(ne)) : be(Math.max(0, t.tabWidth - 2), ne));
3548
- }
3549
- let M = [u, i, ...a].some((W) => d(n[W], (ne) => te(ne) && ie(t.originalText, j(ne), P(ne)))), J = (W) => y === g ? l(W, { shouldBreak: M }) : M ? [W, Ce] : W, I = !f && (G(y) || y.type === "NGPipeExpression" && y.left === n) && !y.computed, q = rm(e), k = J([em(e, t, r), c ? m : D(m), s && I && !q ? E : ""]);
3550
- return C || q ? l([D([E, k]), E]) : k;
3551
- }
3552
- function nm(e, t) {
3553
- return (G(t) || t.type === "NGPipeExpression" && t.left === e) && !t.computed;
3554
- }
3555
- function sm(e, t, r, n) {
3556
- return [...e.map((u) => Ve(u)), Ve(t), Ve(r)].flat().some((u) => te(u) && ie(n.originalText, j(u), P(u)));
3557
- }
3558
- var um = /* @__PURE__ */ new Map([["AssignmentExpression", "right"], ["VariableDeclarator", "init"], ["ReturnStatement", "argument"], ["ThrowStatement", "argument"], ["UnaryExpression", "argument"], ["YieldExpression", "argument"], ["AwaitExpression", "argument"]]);
3559
- function im(e) {
3560
- let { node: t } = e;
3561
- if (t.type !== "ConditionalExpression") return false;
3562
- let r, n = t;
3563
- for (let s = 0; !r; s++) {
3564
- let u = e.getParentNode(s);
3565
- if (u.type === "ChainExpression" && u.expression === n || w(u) && u.callee === n || G(u) && u.object === n || u.type === "TSNonNullExpression" && u.expression === n) {
3566
- n = u;
3567
- continue;
3568
- }
3569
- u.type === "NewExpression" && u.callee === n || xe(u) && u.expression === n ? (r = e.getParentNode(s + 1), n = u) : r = u;
3570
- }
3571
- return n === t ? false : r[um.get(r.type)] === n;
3572
- }
3573
- var Ms = (e) => [S("("), D([E, e]), E, S(")")];
3574
- function zt(e, t, r, n) {
3575
- if (!t.experimentalTernaries) return ba(e, t, r);
3576
- let { node: s } = e, u = s.type === "ConditionalExpression", i = Je(s), a = u ? "consequent" : "trueType", o = u ? "alternate" : "falseType", p = u ? ["test"] : ["checkType", "extendsType"], m = s[a], f = s[o], y = p.map((Xe) => s[Xe]), { parent: C } = e, c = C.type === s.type, A = c && p.some((Xe) => C[Xe] === s), T = c && C[o] === s, B = m.type === s.type, g = f.type === s.type, _ = g || T, M = t.tabWidth > 2 || t.useTabs, J, I, q = 0;
3577
- do
3578
- I = J || s, J = e.getParentNode(q), q++;
3579
- while (J && J.type === s.type && p.every((Xe) => J[Xe] !== I));
3580
- let k = J || C, W = 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"), ne = (C.type === "ReturnStatement" || C.type === "ThrowStatement") && !(B || g), Z = u && k.type === "JSXExpressionContainer" && e.grandparent.type !== "JSXAttribute", lt = im(e), L = nm(s, C), se = i && Le(e, t), Ae = M ? t.useTabs ? " " : " ".repeat(t.tabWidth - 1) : "", Ot = sm(y, m, f, t) || B || g, nt = !_ && !c && !i && (Z ? m.type === "NullLiteral" || m.type === "Literal" && m.value === null : ir(m, t) && Nn(s.test, 3)), Js = _ || T || i && !c || c && u && Nn(s.test, 1) || nt, Ns = [];
3581
- !B && d(m, h.Dangling) && e.call((Xe) => {
3582
- Ns.push(N(Xe, t), F);
3583
- }, "consequent");
3584
- let er = [];
3585
- d(s.test, h.Dangling) && e.call((Xe) => {
3586
- er.push(N(Xe, t));
3587
- }, "test"), !g && d(f, h.Dangling) && e.call((Xe) => {
3588
- er.push(N(Xe, t));
3589
- }, "alternate"), d(s, h.Dangling) && er.push(N(e, t));
3590
- let Gs = Symbol("test"), Va = Symbol("consequent"), dr = Symbol("test-and-consequent"), $a = u ? [Ms(r("test")), s.test.type === "ConditionalExpression" ? Ce : ""] : [r("checkType"), " ", "extends", " ", Je(s.extendsType) || s.extendsType.type === "TSMappedType" ? r("extendsType") : l(Ms(r("extendsType")))], qs = l([$a, " ?"], { id: Gs }), Ka = r(a), Tr = D([B || Z && (Y(m) || c || _) ? F : x, Ns, Ka]), Qa = Js ? l([qs, _ ? Tr : S(Tr, l(Tr, { id: Va }), { groupId: Gs })], { id: dr }) : [qs, Tr], wn = r(o), Ws = nt ? S(wn, Jr(Ms(wn)), { groupId: dr }) : wn, tr = [Qa, er.length > 0 ? [D([F, er]), F] : g ? F : nt ? S(x, " ", { groupId: dr }) : x, ":", g ? " " : M ? Js ? S(Ae, S(_ || nt ? " " : Ae, " "), { groupId: dr }) : S(Ae, " ") : " ", g ? Ws : l([D(Ws), Z && !nt ? E : ""]), L && !lt ? E : "", Ot ? Ce : ""];
3591
- return W && !Ot ? l(D([E, l(tr)])) : W || ne ? l(D(tr)) : lt || i && A ? l([D([E, tr]), se ? E : ""]) : C === k ? l(tr) : tr;
3592
- }
3593
- function Pa(e, t, r, n) {
3594
- let { node: s } = e;
3595
- if (wr(s)) return Aa(e, t);
3596
- let u = t.semi ? ";" : "", i = [];
3597
- switch (s.type) {
3598
- case "JsExpressionRoot":
3599
- return r("node");
3600
- case "JsonRoot":
3601
- return [N(e, t), r("node"), F];
3602
- case "File":
3603
- return Ea(e, t, r) ?? r("program");
3604
- case "EmptyStatement":
3605
- return "";
3606
- case "ExpressionStatement":
3607
- return Da(e, t, r);
3608
- case "ChainExpression":
3609
- return r("expression");
3610
- case "ParenthesizedExpression":
3611
- return !d(s.expression) && (ue(s.expression) || U(s.expression)) ? ["(", r("expression"), ")"] : l(["(", D([E, r("expression")]), E, ")"]);
3612
- case "AssignmentExpression":
3613
- return Wi(e, t, r);
3614
- case "VariableDeclarator":
3615
- return Ui(e, t, r);
3616
- case "BinaryExpression":
3617
- case "LogicalExpression":
3618
- return $r(e, t, r);
3619
- case "AssignmentPattern":
3620
- return [r("left"), " = ", r("right")];
3621
- case "OptionalMemberExpression":
3622
- case "MemberExpression":
3623
- return Ri(e, t, r);
3624
- case "MetaProperty":
3625
- return [r("meta"), ".", r("property")];
3626
- case "BindExpression":
3627
- return s.object && i.push(r("object")), i.push(l(D([E, Kr(e, t, r)]))), i;
3628
- case "Identifier":
3629
- return [s.name, V(e), mn(e), H(e, r)];
3630
- case "V8IntrinsicIdentifier":
3631
- return ["%", s.name];
3632
- case "SpreadElement":
3633
- case "SpreadElementPattern":
3634
- case "SpreadPropertyPattern":
3635
- case "RestElement":
3636
- return yn(e, r);
3637
- case "FunctionDeclaration":
3638
- case "FunctionExpression":
3639
- return En(e, t, r, n);
3640
- case "ArrowFunctionExpression":
3641
- return sa(e, t, r, n);
3642
- case "YieldExpression":
3643
- return i.push("yield"), s.delegate && i.push("*"), s.argument && i.push(" ", r("argument")), i;
3644
- case "AwaitExpression":
3645
- if (i.push("await"), s.argument) {
3646
- i.push(" ", r("argument"));
3647
- let { parent: a } = e;
3648
- if (w(a) && a.callee === s || G(a) && a.object === s) {
3649
- i = [D([E, ...i]), E];
3650
- let o = e.findAncestor((p) => p.type === "AwaitExpression" || p.type === "BlockStatement");
3651
- if ((o == null ? void 0 : o.type) !== "AwaitExpression" || !pe(o.argument, (p) => p === s)) return l(i);
3652
- }
3653
- }
3654
- return i;
3655
- case "ExportDefaultDeclaration":
3656
- case "ExportNamedDeclaration":
3657
- case "ExportAllDeclaration":
3658
- return Bn(e, t, r);
3659
- case "ImportDeclaration":
3660
- return da(e, t, r);
3661
- case "ImportSpecifier":
3662
- case "ExportSpecifier":
3663
- case "ImportNamespaceSpecifier":
3664
- case "ExportNamespaceSpecifier":
3665
- case "ImportDefaultSpecifier":
3666
- case "ExportDefaultSpecifier":
3667
- return Ba(e, t, r);
3668
- case "ImportAttribute":
3669
- return Dn(e, t, r);
3670
- case "Program":
3671
- case "BlockStatement":
3672
- case "StaticBlock":
3673
- return An(e, t, r);
3674
- case "ClassBody":
3675
- return ca(e, t, r);
3676
- case "ThrowStatement":
3677
- return ra(e, t, r);
3678
- case "ReturnStatement":
3679
- return ta(e, t, r);
3680
- case "NewExpression":
3681
- case "ImportExpression":
3682
- case "OptionalCallExpression":
3683
- case "CallExpression":
3684
- return Qr(e, t, r);
3685
- case "ObjectExpression":
3686
- case "ObjectPattern":
3687
- return gt(e, t, r);
3688
- case "Property":
3689
- return bt(s) ? Er(e, t, r) : Dn(e, t, r);
3690
- case "ObjectProperty":
3691
- return Dn(e, t, r);
3692
- case "ObjectMethod":
3693
- return Er(e, t, r);
3694
- case "Decorator":
3695
- return ["@", r("expression")];
3696
- case "ArrayExpression":
3697
- case "ArrayPattern":
3698
- return Kt(e, t, r);
3699
- case "SequenceExpression": {
3700
- let { parent: a } = e;
3701
- if (a.type === "ExpressionStatement" || a.type === "ForStatement") {
3702
- let p = [];
3703
- return e.each(({ isFirst: m }) => {
3704
- m ? p.push(r()) : p.push(",", D([x, r()]));
3705
- }, "expressions"), l(p);
3706
- }
3707
- let o = b([",", x], e.map(r, "expressions"));
3708
- return (a.type === "ReturnStatement" || a.type === "ThrowStatement") && e.key === "argument" || a.type === "ArrowFunctionExpression" && e.key === "body" ? l(S([D([E, o]), E], o)) : l(o);
3709
- }
3710
- case "ThisExpression":
3711
- return "this";
3712
- case "Super":
3713
- return "super";
3714
- case "Directive":
3715
- return [r("value"), u];
3716
- case "UnaryExpression":
3717
- return i.push(s.operator), /[a-z]$/u.test(s.operator) && i.push(" "), d(s.argument) ? i.push(l(["(", D([E, r("argument")]), E, ")"])) : i.push(r("argument")), i;
3718
- case "UpdateExpression":
3719
- return [s.prefix ? s.operator : "", r("argument"), s.prefix ? "" : s.operator];
3720
- case "ConditionalExpression":
3721
- return zt(e, t, r, n);
3722
- case "VariableDeclaration": {
3723
- let a = e.map(r, "declarations"), o = e.parent, p = o.type === "ForStatement" || o.type === "ForInStatement" || o.type === "ForOfStatement", m = s.declarations.some((y) => y.init), f;
3724
- return a.length === 1 && !d(s.declarations[0]) ? f = a[0] : a.length > 0 && (f = D(a[0])), i = [$(e), s.kind, f ? [" ", f] : "", D(a.slice(1).map((y) => [",", m && !p ? F : x, y]))], p && o.body !== s || i.push(u), l(i);
3725
- }
3726
- case "WithStatement":
3727
- return l(["with (", r("object"), ")", Et(s.body, r("body"))]);
3728
- case "IfStatement": {
3729
- let a = Et(s.consequent, r("consequent")), o = l(["if (", l([D([E, r("test")]), E]), ")", a]);
3730
- if (i.push(o), s.alternate) {
3731
- let p = d(s.consequent, h.Trailing | h.Line) || Mr(s), m = s.consequent.type === "BlockStatement" && !p;
3732
- i.push(m ? " " : F), d(s, h.Dangling) && i.push(N(e, t), p ? F : " "), i.push("else", l(Et(s.alternate, r("alternate"), s.alternate.type === "IfStatement")));
3733
- }
3734
- return i;
3735
- }
3736
- case "ForStatement": {
3737
- let a = Et(s.body, r("body")), o = N(e, t), p = o ? [o, E] : "";
3738
- return !s.init && !s.test && !s.update ? [p, l(["for (;;)", a])] : [p, l(["for (", l([D([E, r("init"), ";", x, r("test"), ";", x, r("update")]), E]), ")", a])];
3739
- }
3740
- case "WhileStatement":
3741
- return l(["while (", l([D([E, r("test")]), E]), ")", Et(s.body, r("body"))]);
3742
- case "ForInStatement":
3743
- return l(["for (", r("left"), " in ", r("right"), ")", Et(s.body, r("body"))]);
3744
- case "ForOfStatement":
3745
- return l(["for", s.await ? " await" : "", " (", r("left"), " of ", r("right"), ")", Et(s.body, r("body"))]);
3746
- case "DoWhileStatement": {
3747
- let a = Et(s.body, r("body"));
3748
- return i = [l(["do", a])], s.body.type === "BlockStatement" ? i.push(" ") : i.push(F), i.push("while (", l([D([E, r("test")]), E]), ")", u), i;
3749
- }
3750
- case "DoExpression":
3751
- return [s.async ? "async " : "", "do ", r("body")];
3752
- case "BreakStatement":
3753
- case "ContinueStatement":
3754
- return i.push(s.type === "BreakStatement" ? "break" : "continue"), s.label && i.push(" ", r("label")), i.push(u), i;
3755
- case "LabeledStatement":
3756
- return s.body.type === "EmptyStatement" ? [r("label"), ":;"] : [r("label"), ": ", r("body")];
3757
- case "TryStatement":
3758
- return ["try ", r("block"), s.handler ? [" ", r("handler")] : "", s.finalizer ? [" finally ", r("finalizer")] : ""];
3759
- case "CatchClause":
3760
- if (s.param) {
3761
- let a = d(s.param, (p) => !te(p) || p.leading && ee(t.originalText, P(p)) || p.trailing && ee(t.originalText, j(p), { backwards: true })), o = r("param");
3762
- return ["catch ", a ? ["(", D([E, o]), E, ") "] : ["(", o, ") "], r("body")];
3763
- }
3764
- return ["catch ", r("body")];
3765
- case "SwitchStatement":
3766
- return [l(["switch (", D([E, r("discriminant")]), E, ")"]), " {", s.cases.length > 0 ? D([F, b(F, e.map(({ node: a, isLast: o }) => [r(), !o && me(a, t) ? F : ""], "cases"))]) : "", F, "}"];
3767
- case "SwitchCase": {
3768
- s.test ? i.push("case ", r("test"), ":") : i.push("default:"), d(s, h.Dangling) && i.push(" ", N(e, t));
3769
- let a = s.consequent.filter((o) => o.type !== "EmptyStatement");
3770
- if (a.length > 0) {
3771
- let o = Fr(e, t, r, "consequent");
3772
- i.push(a.length === 1 && a[0].type === "BlockStatement" ? [" ", o] : D([F, o]));
3773
- }
3774
- return i;
3775
- }
3776
- case "DebuggerStatement":
3777
- return ["debugger", u];
3778
- case "ClassDeclaration":
3779
- case "ClassExpression":
3780
- return xn(e, t, r);
3781
- case "ClassMethod":
3782
- case "ClassPrivateMethod":
3783
- case "MethodDefinition":
3784
- return hn(e, t, r);
3785
- case "ClassProperty":
3786
- case "PropertyDefinition":
3787
- case "ClassPrivateProperty":
3788
- case "ClassAccessorProperty":
3789
- case "AccessorProperty":
3790
- return gn(e, t, r);
3791
- case "TemplateElement":
3792
- return ve(s.value.raw);
3793
- case "TemplateLiteral":
3794
- return Wr(e, t, r);
3795
- case "TaggedTemplateExpression":
3796
- return Zu(e, t, r);
3797
- case "PrivateIdentifier":
3798
- return ["#", s.name];
3799
- case "PrivateName":
3800
- return ["#", r("id")];
3801
- case "TopicReference":
3802
- return "%";
3803
- case "ArgumentPlaceholder":
3804
- return "?";
3805
- case "ModuleExpression":
3806
- return ["module ", r("body")];
3807
- case "InterpreterDirective":
3808
- default:
3809
- throw new qe(s, "ESTree");
3810
- }
3811
- }
3812
- function bn(e, t, r) {
3813
- let { parent: n, node: s, key: u } = e, i = [r("expression")];
3814
- switch (s.type) {
3815
- case "AsConstExpression":
3816
- i.push(" as const");
3817
- break;
3818
- case "AsExpression":
3819
- case "TSAsExpression":
3820
- i.push(" as ", r("typeAnnotation"));
3821
- break;
3822
- case "SatisfiesExpression":
3823
- case "TSSatisfiesExpression":
3824
- i.push(" satisfies ", r("typeAnnotation"));
3825
- break;
3826
- }
3827
- return u === "callee" && w(n) || u === "object" && G(n) ? l([D([E, ...i]), E]) : i;
3828
- }
3829
- function ka(e, t, r) {
3830
- let { node: n } = e, s = [$(e), "component"];
3831
- n.id && s.push(" ", r("id")), s.push(r("typeParameters"));
3832
- let u = am(e, t, r);
3833
- 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;
3834
- }
3835
- function am(e, t, r) {
3836
- let { node: n } = e, s = n.params;
3837
- if (n.rest && (s = [...s, n.rest]), s.length === 0) return ["(", N(e, t, { filter: (i) => ke(t.originalText, P(i)) === ")" }), ")"];
3838
- let u = [];
3839
- return pm(e, (i, a) => {
3840
- let o = a === s.length - 1;
3841
- o && n.rest && u.push("..."), u.push(r()), !o && (u.push(","), me(s[a], t) ? u.push(F, F) : u.push(x));
3842
- }), ["(", D([E, ...u]), S(ce(t, "all") && !om(n, s) ? "," : ""), E, ")"];
3843
- }
3844
- function om(e, t) {
3845
- var r;
3846
- return e.rest || ((r = v(false, t, -1)) == null ? void 0 : r.type) === "RestElement";
3847
- }
3848
- function pm(e, t) {
3849
- let { node: r } = e, n = 0, s = (u) => t(u, n++);
3850
- e.each(s, "params"), r.rest && e.call(s, "rest");
3851
- }
3852
- function Ia(e, t, r) {
3853
- let { node: n } = e;
3854
- return n.shorthand ? r("local") : [r("name"), " as ", r("local")];
3855
- }
3856
- function La(e, t, r) {
3857
- let { node: n } = e, s = [];
3858
- return n.name && s.push(r("name"), n.optional ? "?: " : ": "), s.push(r("typeAnnotation")), s;
3859
- }
3860
- function Pn(e, t, r) {
3861
- return gt(e, t, r);
3862
- }
3863
- function kn(e, t) {
3864
- let { node: r } = e, n = t("id");
3865
- r.computed && (n = ["[", n, "]"]);
3866
- let s = "";
3867
- return r.initializer && (s = t("initializer")), r.init && (s = t("init")), s ? [n, " = ", s] : n;
3868
- }
3869
- function In(e, t) {
3870
- let { node: r } = e;
3871
- return [$(e), r.const ? "const " : "", "enum ", t("id"), " ", t("body")];
3872
- }
3873
- function Oa(e, t, r) {
3874
- let { node: n } = e, s = ["hook"];
3875
- n.id && s.push(" ", r("id"));
3876
- let u = Ue(e, t, r, false, true), i = Qt(e, r), a = ct(n, i);
3877
- return s.push(l([a ? l(u) : u, i]), n.body ? " " : "", r("body")), s;
3878
- }
3879
- function _a(e, t, r) {
3880
- let { node: n } = e, s = [$(e), "hook"];
3881
- return n.id && s.push(" ", r("id")), t.semi && s.push(";"), s;
3882
- }
3883
- function wa(e) {
3884
- var r;
3885
- let { node: t } = e;
3886
- return t.type === "HookTypeAnnotation" && ((r = e.getParentNode(2)) == null ? void 0 : r.type) === "DeclareHook";
3887
- }
3888
- function Ma(e, t, r) {
3889
- let { node: n } = e, s = [];
3890
- s.push(wa(e) ? "" : "hook ");
3891
- let u = Ue(e, t, r, false, true), i = [];
3892
- return i.push(wa(e) ? ": " : " => ", r("returnType")), ct(n, i) && (u = l(u)), s.push(u, i), l(s);
3893
- }
3894
- function Ln(e, t, r) {
3895
- let { node: n } = e, s = [$(e), "interface"], u = [], i = [];
3896
- n.type !== "InterfaceTypeAnnotation" && u.push(" ", r("id"), r("typeParameters"));
3897
- let a = n.typeParameters && !d(n.typeParameters, h.Trailing | h.Line);
3898
- return O(n.extends) && i.push(a ? S(" ", x, { groupId: Cr(n.typeParameters) }) : x, "extends ", (n.extends.length === 1 ? du : D)(b([",", x], e.map(r, "extends")))), d(n.id, h.Trailing) || O(n.extends) ? a ? s.push(l([...u, D(i)])) : s.push(l(D([...u, ...i]))) : s.push(...u, ...i), s.push(" ", r("body")), l(s);
3899
- }
3900
- function cm(e) {
3901
- switch (e) {
3902
- case null:
3903
- return "";
3904
- case "PlusOptional":
3905
- return "+?";
3906
- case "MinusOptional":
3907
- return "-?";
3908
- case "Optional":
3909
- return "?";
3910
- }
3911
- }
3912
- function ja(e, t, r) {
3913
- let { node: n } = e;
3914
- return l([n.variance ? r("variance") : "", "[", D([r("keyTparam"), " in ", r("sourceType")]), "]", cm(n.optional), ": ", r("propType")]);
3915
- }
3916
- function va(e, t) {
3917
- return e === "+" || e === "-" ? e + t : t;
3918
- }
3919
- function Ra(e, t, r) {
3920
- let { node: n } = e, s = false;
3921
- if (t.objectWrap === "preserve") {
3922
- let u = j(n), i = Ar(t, u + 1, j(n.key)), a = u + 1 + i.search(/\S/u);
3923
- ie(t.originalText, u, a) && (s = true);
3924
- }
3925
- return l(["{", D([t.bracketSpacing ? x : E, d(n, h.Dangling) ? l([N(e, t), F]) : "", l([n.readonly ? [va(n.readonly, "readonly"), " "] : "", "[", r("key"), " in ", r("constraint"), n.nameType ? [" as ", r("nameType")] : "", "]", n.optional ? va(n.optional, "?") : "", n.typeAnnotation ? ": " : "", r("typeAnnotation")]), t.semi ? S(";") : ""]), t.bracketSpacing ? x : E, "}"], { shouldBreak: s });
3926
- }
3927
- function Ja(e, t, r) {
3928
- let { node: n } = e;
3929
- if (Pr(n)) return n.type.slice(0, -14).toLowerCase();
3930
- let s = t.semi ? ";" : "";
3931
- switch (n.type) {
3932
- case "ComponentDeclaration":
3933
- case "DeclareComponent":
3934
- case "ComponentTypeAnnotation":
3935
- return ka(e, t, r);
3936
- case "ComponentParameter":
3937
- return Ia(e, t, r);
3938
- case "ComponentTypeParameter":
3939
- return La(e, t, r);
3940
- case "HookDeclaration":
3941
- return Oa(e, t, r);
3942
- case "DeclareHook":
3943
- return _a(e, t, r);
3944
- case "HookTypeAnnotation":
3945
- return Ma(e, t, r);
3946
- case "DeclareClass":
3947
- return xn(e, t, r);
3948
- case "DeclareFunction":
3949
- return [$(e), "function ", r("id"), r("predicate"), s];
3950
- case "DeclareModule":
3951
- return ["declare module ", r("id"), " ", r("body")];
3952
- case "DeclareModuleExports":
3953
- return ["declare module.exports", H(e, r), s];
3954
- case "DeclareNamespace":
3955
- return ["declare namespace ", r("id"), " ", r("body")];
3956
- case "DeclareVariable":
3957
- return [$(e), n.kind ?? "var", " ", r("id"), s];
3958
- case "DeclareExportDeclaration":
3959
- case "DeclareExportAllDeclaration":
3960
- return Bn(e, t, r);
3961
- case "DeclareOpaqueType":
3962
- case "OpaqueType":
3963
- return Vi(e, t, r);
3964
- case "DeclareTypeAlias":
3965
- case "TypeAlias":
3966
- return Zr(e, t, r);
3967
- case "IntersectionTypeAnnotation":
3968
- return en(e, t, r);
3969
- case "UnionTypeAnnotation":
3970
- return tn(e, t, r);
3971
- case "ConditionalTypeAnnotation":
3972
- return zt(e, t, r);
3973
- case "InferTypeAnnotation":
3974
- return sn(e, t, r);
3975
- case "FunctionTypeAnnotation":
3976
- return rn(e, t, r);
3977
- case "TupleTypeAnnotation":
3978
- return Kt(e, t, r);
3979
- case "TupleTypeLabeledElement":
3980
- return an(e, t, r);
3981
- case "TupleTypeSpreadElement":
3982
- return un(e, t, r);
3983
- case "GenericTypeAnnotation":
3984
- return [r("id"), wt(e, t, r, "typeParameters")];
3985
- case "IndexedAccessType":
3986
- case "OptionalIndexedAccessType":
3987
- return nn(e, t, r);
3988
- case "TypeAnnotation":
3989
- return on(e, t, r);
3990
- case "TypeParameter":
3991
- return Tn(e, t, r);
3992
- case "TypeofTypeAnnotation":
3993
- return cn(e, r);
3994
- case "ExistsTypeAnnotation":
3995
- return "*";
3996
- case "ArrayTypeAnnotation":
3997
- return pn(r);
3998
- case "DeclareEnum":
3999
- case "EnumDeclaration":
4000
- return In(e, r);
4001
- case "EnumBooleanBody":
4002
- case "EnumNumberBody":
4003
- case "EnumBigIntBody":
4004
- case "EnumStringBody":
4005
- case "EnumSymbolBody":
4006
- return [n.type === "EnumSymbolBody" || n.explicitType ? `of ${n.type.slice(4, -4).toLowerCase()} ` : "", Pn(e, t, r)];
4007
- case "EnumBooleanMember":
4008
- case "EnumNumberMember":
4009
- case "EnumBigIntMember":
4010
- case "EnumStringMember":
4011
- case "EnumDefaultedMember":
4012
- return kn(e, r);
4013
- case "FunctionTypeParam": {
4014
- let u = n.name ? r("name") : e.parent.this === n ? "this" : "";
4015
- return [u, V(e), u ? ": " : "", r("typeAnnotation")];
4016
- }
4017
- case "DeclareInterface":
4018
- case "InterfaceDeclaration":
4019
- case "InterfaceTypeAnnotation":
4020
- return Ln(e, t, r);
4021
- case "ClassImplements":
4022
- case "InterfaceExtends":
4023
- return [r("id"), r("typeParameters")];
4024
- case "NullableTypeAnnotation":
4025
- return ["?", r("typeAnnotation")];
4026
- case "Variance": {
4027
- let { kind: u } = n;
4028
- return jt.ok(u === "plus" || u === "minus"), u === "plus" ? "+" : "-";
4029
- }
4030
- case "KeyofTypeAnnotation":
4031
- return ["keyof ", r("argument")];
4032
- case "ObjectTypeCallProperty":
4033
- return [n.static ? "static " : "", r("value")];
4034
- case "ObjectTypeMappedTypeProperty":
4035
- return ja(e, t, r);
4036
- case "ObjectTypeIndexer":
4037
- return [n.static ? "static " : "", n.variance ? r("variance") : "", "[", r("id"), n.id ? ": " : "", r("key"), "]: ", r("value")];
4038
- case "ObjectTypeProperty": {
4039
- let u = "";
4040
- return n.proto ? u = "proto " : n.static && (u = "static "), [u, n.kind !== "init" ? n.kind + " " : "", n.variance ? r("variance") : "", Ct(e, t, r), V(e), bt(n) ? "" : ": ", r("value")];
4041
- }
4042
- case "ObjectTypeAnnotation":
4043
- return gt(e, t, r);
4044
- case "ObjectTypeInternalSlot":
4045
- return [n.static ? "static " : "", "[[", r("id"), "]]", V(e), n.method ? "" : ": ", r("value")];
4046
- case "ObjectTypeSpreadProperty":
4047
- return yn(e, r);
4048
- case "QualifiedTypeofIdentifier":
4049
- case "QualifiedTypeIdentifier":
4050
- return [r("qualification"), ".", r("id")];
4051
- case "NullLiteralTypeAnnotation":
4052
- return "null";
4053
- case "BooleanLiteralTypeAnnotation":
4054
- return String(n.value);
4055
- case "StringLiteralTypeAnnotation":
4056
- return ve(ut(ae(n), t));
4057
- case "NumberLiteralTypeAnnotation":
4058
- return Ft(ae(n));
4059
- case "BigIntLiteralTypeAnnotation":
4060
- return Sn(ae(n));
4061
- case "TypeCastExpression":
4062
- return ["(", r("expression"), H(e, r), ")"];
4063
- case "TypePredicate":
4064
- return ln(e, r);
4065
- case "TypeOperator":
4066
- return [n.operator, " ", r("typeAnnotation")];
4067
- case "TypeParameterDeclaration":
4068
- case "TypeParameterInstantiation":
4069
- return wt(e, t, r, "params");
4070
- case "InferredPredicate":
4071
- case "DeclaredPredicate":
4072
- return [e.key === "predicate" && e.parent.type !== "DeclareFunction" && !e.parent.returnType ? ": " : " ", "%checks", ...n.type === "DeclaredPredicate" ? ["(", r("value"), ")"] : []];
4073
- case "AsExpression":
4074
- case "AsConstExpression":
4075
- case "SatisfiesExpression":
4076
- return bn(e, t, r);
4077
- }
4078
- }
4079
- function Na(e, t, r) {
4080
- var i;
4081
- let { node: n } = e;
4082
- if (!n.type.startsWith("TS")) return;
4083
- if (kr(n)) return n.type.slice(2, -7).toLowerCase();
4084
- let s = t.semi ? ";" : "", u = [];
4085
- switch (n.type) {
4086
- case "TSThisType":
4087
- return "this";
4088
- case "TSTypeAssertion": {
4089
- let a = !(U(n.expression) || ue(n.expression)), o = l(["<", D([E, r("typeAnnotation")]), E, ">"]), p = [S("("), D([E, r("expression")]), E, S(")")];
4090
- return a ? tt([[o, r("expression")], [o, l(p, { shouldBreak: true })], [o, r("expression")]]) : l([o, r("expression")]);
4091
- }
4092
- case "TSDeclareFunction":
4093
- return En(e, t, r);
4094
- case "TSExportAssignment":
4095
- return ["export = ", r("expression"), s];
4096
- case "TSModuleBlock":
4097
- return An(e, t, r);
4098
- case "TSInterfaceBody":
4099
- case "TSTypeLiteral":
4100
- return gt(e, t, r);
4101
- case "TSTypeAliasDeclaration":
4102
- return Zr(e, t, r);
4103
- case "TSQualifiedName":
4104
- return [r("left"), ".", r("right")];
4105
- case "TSAbstractMethodDefinition":
4106
- case "TSDeclareMethod":
4107
- return hn(e, t, r);
4108
- case "TSAbstractAccessorProperty":
4109
- case "TSAbstractPropertyDefinition":
4110
- return gn(e, t, r);
4111
- case "TSInterfaceHeritage":
4112
- case "TSClassImplements":
4113
- case "TSExpressionWithTypeArguments":
4114
- case "TSInstantiationExpression":
4115
- return [r("expression"), r(n.typeArguments ? "typeArguments" : "typeParameters")];
4116
- case "TSTemplateLiteralType":
4117
- return Wr(e, t, r);
4118
- case "TSNamedTupleMember":
4119
- return an(e, t, r);
4120
- case "TSRestType":
4121
- return un(e, t, r);
4122
- case "TSOptionalType":
4123
- return [r("typeAnnotation"), "?"];
4124
- case "TSInterfaceDeclaration":
4125
- return Ln(e, t, r);
4126
- case "TSTypeParameterDeclaration":
4127
- case "TSTypeParameterInstantiation":
4128
- return wt(e, t, r, "params");
4129
- case "TSTypeParameter":
4130
- return Tn(e, t, r);
4131
- case "TSAsExpression":
4132
- case "TSSatisfiesExpression":
4133
- return bn(e, t, r);
4134
- case "TSArrayType":
4135
- return pn(r);
4136
- case "TSPropertySignature":
4137
- return [n.readonly ? "readonly " : "", Ct(e, t, r), V(e), H(e, r)];
4138
- case "TSParameterProperty":
4139
- return [$t(n), n.static ? "static " : "", n.override ? "override " : "", n.readonly ? "readonly " : "", r("parameter")];
4140
- case "TSTypeQuery":
4141
- return cn(e, r);
4142
- case "TSIndexSignature": {
4143
- let a = n.parameters.length > 1 ? S(ce(t) ? "," : "") : "", o = l([D([E, b([", ", E], e.map(r, "parameters"))]), a, E]), p = e.parent.type === "ClassBody" && e.key === "body";
4144
- return [p && n.static ? "static " : "", n.readonly ? "readonly " : "", "[", n.parameters ? o : "", "]", H(e, r), p ? s : ""];
4145
- }
4146
- case "TSTypePredicate":
4147
- return ln(e, r);
4148
- case "TSNonNullExpression":
4149
- return [r("expression"), "!"];
4150
- case "TSImportType":
4151
- return ["import", Lt(e, t, r), n.qualifier ? [".", r("qualifier")] : "", wt(e, t, r, n.typeArguments ? "typeArguments" : "typeParameters")];
4152
- case "TSLiteralType":
4153
- return r("literal");
4154
- case "TSIndexedAccessType":
4155
- return nn(e, t, r);
4156
- case "TSTypeOperator":
4157
- return [n.operator, " ", r("typeAnnotation")];
4158
- case "TSMappedType":
4159
- return Ra(e, t, r);
4160
- case "TSMethodSignature": {
4161
- let a = n.kind && n.kind !== "method" ? `${n.kind} ` : "";
4162
- u.push($t(n), a, n.computed ? "[" : "", r("key"), n.computed ? "]" : "", V(e));
4163
- let o = Ue(e, t, r, false, true), p = n.returnType ? "returnType" : "typeAnnotation", m = n[p], f = m ? H(e, r, p) : "", y = ct(n, f);
4164
- return u.push(y ? l(o) : o), m && u.push(l(f)), l(u);
4165
- }
4166
- case "TSNamespaceExportDeclaration":
4167
- return ["export as namespace ", r("id"), t.semi ? ";" : ""];
4168
- case "TSEnumDeclaration":
4169
- return In(e, r);
4170
- case "TSEnumBody":
4171
- return Pn(e, t, r);
4172
- case "TSEnumMember":
4173
- return kn(e, r);
4174
- case "TSImportEqualsDeclaration":
4175
- return [n.isExport ? "export " : "", "import ", Os(n, false), r("id"), " = ", r("moduleReference"), t.semi ? ";" : ""];
4176
- case "TSExternalModuleReference":
4177
- return ["require(", r("expression"), ")"];
4178
- case "TSModuleDeclaration": {
4179
- let { parent: a } = e, o = a.type === "TSModuleDeclaration", p = ((i = n.body) == null ? void 0 : i.type) === "TSModuleDeclaration";
4180
- return o ? u.push(".") : (u.push($(e)), n.kind !== "global" && u.push(n.kind, " ")), u.push(r("id")), p ? u.push(r("body")) : n.body ? u.push(" ", l(r("body"))) : u.push(s), u;
4181
- }
4182
- case "TSConditionalType":
4183
- return zt(e, t, r);
4184
- case "TSInferType":
4185
- return sn(e, t, r);
4186
- case "TSIntersectionType":
4187
- return en(e, t, r);
4188
- case "TSUnionType":
4189
- return tn(e, t, r);
4190
- case "TSFunctionType":
4191
- case "TSCallSignatureDeclaration":
4192
- case "TSConstructorType":
4193
- case "TSConstructSignatureDeclaration":
4194
- return rn(e, t, r);
4195
- case "TSTupleType":
4196
- return Kt(e, t, r);
4197
- case "TSTypeReference":
4198
- return [r("typeName"), wt(e, t, r, n.typeArguments ? "typeArguments" : "typeParameters")];
4199
- case "TSTypeAnnotation":
4200
- return on(e, t, r);
4201
- case "TSEmptyBodyFunctionExpression":
4202
- return Fn(e, t, r);
4203
- case "TSJSDocAllType":
4204
- return "*";
4205
- case "TSJSDocUnknownType":
4206
- return "?";
4207
- case "TSJSDocNullableType":
4208
- return Bs(e, r, "?");
4209
- case "TSJSDocNonNullableType":
4210
- return Bs(e, r, "!");
4211
- case "TSParenthesizedType":
4212
- default:
4213
- throw new qe(n, "TypeScript");
4214
- }
4215
- }
4216
- function lm(e, t, r, n) {
4217
- if (Vr(e)) return Ti(e, t);
4218
- for (let s of [Li, bi, Ja, Na, Pa]) {
4219
- let u = s(e, t, r, n);
4220
- if (u !== void 0) return u;
4221
- }
4222
- }
4223
- var mm = R(["ClassMethod", "ClassPrivateMethod", "ClassProperty", "ClassAccessorProperty", "AccessorProperty", "TSAbstractAccessorProperty", "PropertyDefinition", "TSAbstractPropertyDefinition", "ClassPrivateProperty", "MethodDefinition", "TSAbstractMethodDefinition", "TSDeclareMethod"]);
4224
- function ym(e, t, r, n) {
4225
- var f;
4226
- e.isRoot && ((f = t.__onHtmlBindingRoot) == null || f.call(t, e.node, t));
4227
- let s = lm(e, t, r, n);
4228
- if (!s) return "";
4229
- let { node: u } = e;
4230
- if (mm(u)) return s;
4231
- let i = O(u.decorators), a = Oi(e, t, r), o = u.type === "ClassExpression";
4232
- if (i && !o) return lr(s, (y) => l([a, y]));
4233
- let p = Le(e, t), m = ya(e, t);
4234
- return !a && !p && !m ? s : lr(s, (y) => [m ? ";" : "", p ? "(" : "", p && o && i ? [D([x, a, y]), x] : [a, y], p ? ")" : ""]);
4235
- }
4236
- var Ga = ym;
4237
- var fm = { avoidAstMutation: true };
4238
- var qa = [{ name: "JSON.stringify", type: "data", extensions: [".importmap"], tmScope: "source.json", aceMode: "json", aliases: ["geojson", "jsonl", "sarif", "topojson"], codemirrorMode: "javascript", codemirrorMimeType: "application/json", filenames: ["package.json", "package-lock.json", "composer.json"], parsers: ["json-stringify"], vscodeLanguageIds: ["json"], linguistLanguageId: 174 }, { name: "JSON", type: "data", extensions: [".json", ".4DForm", ".4DProject", ".avsc", ".geojson", ".gltf", ".har", ".ice", ".JSON-tmLanguage", ".json.example", ".mcmeta", ".sarif", ".tact", ".tfstate", ".tfstate.backup", ".topojson", ".webapp", ".webmanifest", ".yy", ".yyp"], tmScope: "source.json", aceMode: "json", aliases: ["geojson", "jsonl", "sarif", "topojson"], codemirrorMode: "javascript", codemirrorMimeType: "application/json", filenames: [".all-contributorsrc", ".arcconfig", ".auto-changelog", ".c8rc", ".htmlhintrc", ".imgbotconfig", ".nycrc", ".tern-config", ".tern-project", ".watchmanconfig", ".babelrc", ".jscsrc", ".jshintrc", ".jslintrc", ".swcrc"], parsers: ["json"], vscodeLanguageIds: ["json"], linguistLanguageId: 174 }, { name: "JSON with Comments", type: "data", extensions: [".jsonc", ".code-snippets", ".code-workspace", ".sublime-build", ".sublime-color-scheme", ".sublime-commands", ".sublime-completions", ".sublime-keymap", ".sublime-macro", ".sublime-menu", ".sublime-mousemap", ".sublime-project", ".sublime-settings", ".sublime-theme", ".sublime-workspace", ".sublime_metrics", ".sublime_session"], tmScope: "source.json.comments", aceMode: "javascript", aliases: ["jsonc"], codemirrorMode: "javascript", codemirrorMimeType: "text/javascript", group: "JSON", filenames: [], parsers: ["jsonc"], vscodeLanguageIds: ["jsonc"], linguistLanguageId: 423 }, { name: "JSON5", type: "data", extensions: [".json5"], tmScope: "source.js", aceMode: "javascript", codemirrorMode: "javascript", codemirrorMimeType: "application/json", parsers: ["json5"], vscodeLanguageIds: ["json5"], linguistLanguageId: 175 }];
4239
- var js = {};
4240
- xr(js, { getVisitorKeys: () => Ua, massageAstNode: () => Ya, print: () => Fm });
4241
- var Dm = { JsonRoot: ["node"], ArrayExpression: ["elements"], ObjectExpression: ["properties"], ObjectProperty: ["key", "value"], UnaryExpression: ["argument"], NullLiteral: [], BooleanLiteral: [], StringLiteral: [], NumericLiteral: [], Identifier: [], TemplateLiteral: ["quasis"], TemplateElement: [] }, Wa = Dm;
4242
- var Em = Br(Wa), Ua = Em;
4243
- function Fm(e, t, r) {
4244
- let { node: n } = e;
4245
- switch (n.type) {
4246
- case "JsonRoot":
4247
- return [r("node"), F];
4248
- case "ArrayExpression": {
4249
- if (n.elements.length === 0) return "[]";
4250
- let s = e.map(() => e.node === null ? "null" : r(), "elements");
4251
- return ["[", D([F, b([",", F], s)]), F, "]"];
4252
- }
4253
- case "ObjectExpression":
4254
- return n.properties.length === 0 ? "{}" : ["{", D([F, b([",", F], e.map(r, "properties"))]), F, "}"];
4255
- case "ObjectProperty":
4256
- return [r("key"), ": ", r("value")];
4257
- case "UnaryExpression":
4258
- return [n.operator === "+" ? "" : n.operator, r("argument")];
4259
- case "NullLiteral":
4260
- return "null";
4261
- case "BooleanLiteral":
4262
- return n.value ? "true" : "false";
4263
- case "StringLiteral":
4264
- return JSON.stringify(n.value);
4265
- case "NumericLiteral":
4266
- return Xa(e) ? JSON.stringify(String(n.value)) : JSON.stringify(n.value);
4267
- case "Identifier":
4268
- return Xa(e) ? JSON.stringify(n.name) : n.name;
4269
- case "TemplateLiteral":
4270
- return r(["quasis", 0]);
4271
- case "TemplateElement":
4272
- return JSON.stringify(n.value.cooked);
4273
- default:
4274
- throw new qe(n, "JSON");
4275
- }
4276
- }
4277
- function Xa(e) {
4278
- return e.key === "key" && e.parent.type === "ObjectProperty";
4279
- }
4280
- var Cm = /* @__PURE__ */ new Set(["start", "end", "extra", "loc", "comments", "leadingComments", "trailingComments", "innerComments", "errors", "range", "tokens"]);
4281
- function Ya(e, t) {
4282
- let { type: r } = e;
4283
- if (r === "ObjectProperty") {
4284
- let { key: n } = e;
4285
- n.type === "Identifier" ? t.key = { type: "StringLiteral", value: n.name } : n.type === "NumericLiteral" && (t.key = { type: "StringLiteral", value: String(n.value) });
4286
- return;
4287
- }
4288
- if (r === "UnaryExpression" && e.operator === "+") return t.argument;
4289
- if (r === "ArrayExpression") {
4290
- for (let [n, s] of e.elements.entries()) s === null && t.elements.splice(n, 0, { type: "NullLiteral" });
4291
- return;
4292
- }
4293
- if (r === "TemplateLiteral") return { type: "StringLiteral", value: e.quasis[0].value.cooked };
4294
- }
4295
- Ya.ignoredProperties = Cm;
4296
- var Zt = { bracketSpacing: { category: "Common", type: "boolean", default: true, description: "Print spaces between brackets.", oppositeDescription: "Do not print spaces between brackets." }, objectWrap: { category: "Common", type: "choice", default: "preserve", description: "How to wrap object literals.", choices: [{ value: "preserve", description: "Keep as multi-line, if there is a newline between the opening brace and first property." }, { value: "collapse", description: "Fit to a single line when possible." }] }, singleQuote: { category: "Common", type: "boolean", default: false, description: "Use single quotes instead of double quotes." }, 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." } };
4297
- var St = "JavaScript", Am = { arrowParens: { category: St, 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: Zt.bracketSameLine, objectWrap: Zt.objectWrap, bracketSpacing: Zt.bracketSpacing, jsxBracketSameLine: { category: St, type: "boolean", description: "Put > on the last line instead of at a new line.", deprecated: "2.4.0" }, semi: { category: St, type: "boolean", default: true, description: "Print semicolons.", oppositeDescription: "Do not print semicolons, except at the beginning of lines which may need them." }, experimentalOperatorPosition: { category: St, type: "choice", default: "end", description: "Where to print operators when binary expressions wrap lines.", choices: [{ value: "start", description: "Print operators at the start of new lines." }, { value: "end", description: "Print operators at the end of previous lines." }] }, experimentalTernaries: { category: St, 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: Zt.singleQuote, jsxSingleQuote: { category: St, type: "boolean", default: false, description: "Use single quotes in JSX." }, quoteProps: { category: St, 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: St, 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: Zt.singleAttributePerLine }, Ha = Am;
4298
- var dm = { estree: vs, "estree-json": js }, Tm = [...Vs, ...qa];
4299
- var Nx = Rs;
4300
-
4301
- export { Nx as default, Tm as languages, Ha as options, dm as printers };