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