eddyter 1.3.64 → 1.3.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +24 -24
- package/README.md +493 -493
- package/dist/Provider/EditorProvider.d.ts +1 -0
- package/dist/api/auth.d.ts +9 -0
- package/dist/assets/style.css +1 -1
- package/dist/{babel-CCPWkrf4.js → babel-B9hn44Wo.js} +726 -1302
- package/dist/components/LockedFeature/LockedFeature.d.ts +8 -2
- package/dist/{estree-CxUPh9wa.js → estree-CocPn_Md.js} +529 -917
- package/dist/{html-CmniStvG.js → html-CxCicOef.js} +350 -589
- package/dist/{html2pdf.bundle-C1B1lr_T.js → html2pdf.bundle-9PCiy6C2.js} +2778 -3797
- package/dist/{html2pdf.bundle.min-kPviTsNx.js → html2pdf.bundle.min-D_g_u6ug.js} +3405 -5221
- package/dist/{index-BpsoOKOs.js → index-B9Gjsq91.js} +1 -1
- package/dist/{index-BL8HWCRw.js → index-CI28isEa.js} +9 -12
- package/dist/{index-FZVNbwSO.js → index-DWw_26Wr.js} +8155 -8463
- package/dist/{index-DHKx5grA.js → index-dZIrqvsF.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/{markdown-B0mEGGfQ.js → markdown-BUjgWFLu.js} +578 -1015
- package/dist/{postcss-B0bxXf7u.js → postcss-CGIcwj_g.js} +615 -1065
- package/dist/{standalone-DmuJV5rn.js → standalone-C0qguT38.js} +350 -596
- package/dist/{typescript-DZlC_9M8.js → typescript-BM7wk6k-.js} +1114 -1806
- package/package.json +151 -151
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
var es = Object.defineProperty, Xr = (e) => {
|
|
2
2
|
throw TypeError(e);
|
|
3
3
|
}, Zt = (e, t) => {
|
|
4
|
-
for (var n in t)
|
|
5
|
-
es(e, n, { get: t[n], enumerable: !0 });
|
|
4
|
+
for (var n in t) es(e, n, { get: t[n], enumerable: !0 });
|
|
6
5
|
}, $r = (e, t, n) => t.has(e) || Xr("Cannot " + n), Je = (e, t, n) => ($r(e, t, "read from private field"), t.get(e)), ts = (e, t, n) => t.has(e) ? Xr("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), ns = (e, t, n, r) => ($r(e, t, "write to private field"), t.set(e, n), n), Rr = {};
|
|
7
6
|
Zt(Rr, { languages: () => AD, options: () => ED, printers: () => FD });
|
|
8
7
|
var rs = [{ 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 }], Wr = {};
|
|
9
8
|
Zt(Wr, { canAttachComment: () => di, embed: () => tp, experimentalFeatures: () => iD, getCommentChildNodes: () => mi, getVisitorKeys: () => Hr, handleComments: () => mu, insertPragma: () => mp, isBlockComment: () => ye, isGap: () => fi, massageAstNode: () => co, print: () => oD, printComment: () => No, willPrintOwnComments: () => vu });
|
|
10
9
|
var us = (e, t, n, r) => {
|
|
11
|
-
if (!(e && t == null))
|
|
12
|
-
return t.replaceAll ? t.replaceAll(n, r) : n.global ? t.replace(n, r) : t.split(n).join(r);
|
|
10
|
+
if (!(e && t == null)) return t.replaceAll ? t.replaceAll(n, r) : n.global ? t.replace(n, r) : t.split(n).join(r);
|
|
13
11
|
}, H = us, as = (e, t, n) => {
|
|
14
|
-
if (!(e && t == null))
|
|
15
|
-
return Array.isArray(t) || typeof t == "string" ? t[n < 0 ? t.length + n : n] : t.at(n);
|
|
12
|
+
if (!(e && t == null)) return Array.isArray(t) || typeof t == "string" ? t[n < 0 ? t.length + n : n] : t.at(n);
|
|
16
13
|
}, X = as;
|
|
17
14
|
function ss(e) {
|
|
18
15
|
return e !== null && typeof e == "object";
|
|
@@ -22,25 +19,19 @@ function* is(e, t) {
|
|
|
22
19
|
let { getVisitorKeys: n, filter: r = () => !0 } = t, u = (a) => os(a) && r(a);
|
|
23
20
|
for (let a of n(e)) {
|
|
24
21
|
let s = e[a];
|
|
25
|
-
if (Array.isArray(s))
|
|
26
|
-
|
|
27
|
-
u(o) && (yield o);
|
|
28
|
-
else
|
|
29
|
-
u(s) && (yield s);
|
|
22
|
+
if (Array.isArray(s)) for (let o of s) u(o) && (yield o);
|
|
23
|
+
else u(s) && (yield s);
|
|
30
24
|
}
|
|
31
25
|
}
|
|
32
26
|
function* ps(e, t) {
|
|
33
27
|
let n = [e];
|
|
34
28
|
for (let r = 0; r < n.length; r++) {
|
|
35
29
|
let u = n[r];
|
|
36
|
-
for (let a of is(u, t))
|
|
37
|
-
yield a, n.push(a);
|
|
30
|
+
for (let a of is(u, t)) yield a, n.push(a);
|
|
38
31
|
}
|
|
39
32
|
}
|
|
40
33
|
function ls(e, { getVisitorKeys: t, predicate: n }) {
|
|
41
|
-
for (let r of ps(e, { getVisitorKeys: t }))
|
|
42
|
-
if (n(r))
|
|
43
|
-
return !0;
|
|
34
|
+
for (let r of ps(e, { getVisitorKeys: t })) if (n(r)) return !0;
|
|
44
35
|
return !1;
|
|
45
36
|
}
|
|
46
37
|
var cs = () => /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
|
|
@@ -52,10 +43,8 @@ function ys(e) {
|
|
|
52
43
|
}
|
|
53
44
|
var ds = (e) => !(Ds(e) || ys(e)), ms = /[^\x20-\x7F]/u;
|
|
54
45
|
function fs(e) {
|
|
55
|
-
if (!e)
|
|
56
|
-
|
|
57
|
-
if (!ms.test(e))
|
|
58
|
-
return e.length;
|
|
46
|
+
if (!e) return 0;
|
|
47
|
+
if (!ms.test(e)) return e.length;
|
|
59
48
|
e = e.replace(cs(), " ");
|
|
60
49
|
let t = 0;
|
|
61
50
|
for (let n of e) {
|
|
@@ -68,16 +57,13 @@ var lt = fs;
|
|
|
68
57
|
function Jn(e) {
|
|
69
58
|
return (t, n, r) => {
|
|
70
59
|
let u = !!(r != null && r.backwards);
|
|
71
|
-
if (n === !1)
|
|
72
|
-
return !1;
|
|
60
|
+
if (n === !1) return !1;
|
|
73
61
|
let { length: a } = t, s = n;
|
|
74
62
|
for (; s >= 0 && s < a; ) {
|
|
75
63
|
let o = t.charAt(s);
|
|
76
64
|
if (e instanceof RegExp) {
|
|
77
|
-
if (!e.test(o))
|
|
78
|
-
|
|
79
|
-
} else if (!e.includes(o))
|
|
80
|
-
return s;
|
|
65
|
+
if (!e.test(o)) return s;
|
|
66
|
+
} else if (!e.includes(o)) return s;
|
|
81
67
|
u ? s-- : s++;
|
|
82
68
|
}
|
|
83
69
|
return s === -1 || s === a ? s : !1;
|
|
@@ -86,23 +72,18 @@ function Jn(e) {
|
|
|
86
72
|
var ct = Jn(" "), Es = Jn(",; "), Fs = Jn(/[^\n\r]/u);
|
|
87
73
|
function As(e, t, n) {
|
|
88
74
|
let r = !!(n != null && n.backwards);
|
|
89
|
-
if (t === !1)
|
|
90
|
-
return !1;
|
|
75
|
+
if (t === !1) return !1;
|
|
91
76
|
let u = e.charAt(t);
|
|
92
77
|
if (r) {
|
|
93
78
|
if (e.charAt(t - 1) === "\r" && u === `
|
|
94
|
-
`)
|
|
95
|
-
return t - 2;
|
|
79
|
+
`) return t - 2;
|
|
96
80
|
if (u === `
|
|
97
|
-
` || u === "\r" || u === "\u2028" || u === "\u2029")
|
|
98
|
-
return t - 1;
|
|
81
|
+
` || u === "\r" || u === "\u2028" || u === "\u2029") return t - 1;
|
|
99
82
|
} else {
|
|
100
83
|
if (u === "\r" && e.charAt(t + 1) === `
|
|
101
|
-
`)
|
|
102
|
-
return t + 2;
|
|
84
|
+
`) return t + 2;
|
|
103
85
|
if (u === `
|
|
104
|
-
` || u === "\r" || u === "\u2028" || u === "\u2029")
|
|
105
|
-
return t + 1;
|
|
86
|
+
` || u === "\r" || u === "\u2028" || u === "\u2029") return t + 1;
|
|
106
87
|
}
|
|
107
88
|
return t;
|
|
108
89
|
}
|
|
@@ -113,12 +94,9 @@ function gs(e, t, n = {}) {
|
|
|
113
94
|
}
|
|
114
95
|
var pe = gs;
|
|
115
96
|
function xs(e, t) {
|
|
116
|
-
if (t === !1)
|
|
117
|
-
return !1;
|
|
97
|
+
if (t === !1) return !1;
|
|
118
98
|
if (e.charAt(t) === "/" && e.charAt(t + 1) === "*") {
|
|
119
|
-
for (let n = t + 2; n < e.length; ++n)
|
|
120
|
-
if (e.charAt(n) === "*" && e.charAt(n + 1) === "/")
|
|
121
|
-
return n + 2;
|
|
99
|
+
for (let n = t + 2; n < e.length; ++n) if (e.charAt(n) === "*" && e.charAt(n + 1) === "/") return n + 2;
|
|
122
100
|
}
|
|
123
101
|
return t;
|
|
124
102
|
}
|
|
@@ -129,8 +107,7 @@ function hs(e, t) {
|
|
|
129
107
|
var _n = hs;
|
|
130
108
|
function Cs(e, t) {
|
|
131
109
|
let n = null, r = t;
|
|
132
|
-
for (; r !== n; )
|
|
133
|
-
n = r, r = Es(e, r), r = qn(e, r), r = ct(e, r);
|
|
110
|
+
for (; r !== n; ) n = r, r = Es(e, r), r = qn(e, r), r = ct(e, r);
|
|
134
111
|
return r = _n(e, r), r = Dt(e, r), r !== !1 && pe(e, r);
|
|
135
112
|
}
|
|
136
113
|
var Xn = Cs;
|
|
@@ -141,8 +118,7 @@ var J = Ts, Ur = new Proxy(() => {
|
|
|
141
118
|
}, { get: () => Ur }), $n = Ur, qt = "'", mr = '"';
|
|
142
119
|
function Ss(e, t) {
|
|
143
120
|
let n = t === !0 || t === qt ? qt : mr, r = n === qt ? mr : qt, u = 0, a = 0;
|
|
144
|
-
for (let s of e)
|
|
145
|
-
s === n ? u++ : s === r && a++;
|
|
121
|
+
for (let s of e) s === n ? u++ : s === r && a++;
|
|
146
122
|
return u > a ? r : n;
|
|
147
123
|
}
|
|
148
124
|
var Gr = Ss;
|
|
@@ -186,8 +162,7 @@ function bt(e) {
|
|
|
186
162
|
return Ct = bt.prototype = e ?? /* @__PURE__ */ Object.create(null), new bt();
|
|
187
163
|
}
|
|
188
164
|
var ws = 10;
|
|
189
|
-
for (let e = 0; e <= ws; e++)
|
|
190
|
-
bt();
|
|
165
|
+
for (let e = 0; e <= ws; e++) bt();
|
|
191
166
|
function Is(e) {
|
|
192
167
|
return bt(e);
|
|
193
168
|
}
|
|
@@ -195,8 +170,7 @@ function Ns(e, t = "type") {
|
|
|
195
170
|
Is(e);
|
|
196
171
|
function n(r) {
|
|
197
172
|
let u = r[t], a = e[u];
|
|
198
|
-
if (!Array.isArray(a))
|
|
199
|
-
throw Object.assign(new Error(`Missing visitor keys for '${u}'.`), { node: r });
|
|
173
|
+
if (!Array.isArray(a)) throw Object.assign(new Error(`Missing visitor keys for '${u}'.`), { node: r });
|
|
200
174
|
return a;
|
|
201
175
|
}
|
|
202
176
|
return n;
|
|
@@ -216,10 +190,8 @@ function Xs(e, t) {
|
|
|
216
190
|
let n = t.split(".");
|
|
217
191
|
for (let r = n.length - 1; r >= 0; r--) {
|
|
218
192
|
let u = n[r];
|
|
219
|
-
if (r === 0)
|
|
220
|
-
|
|
221
|
-
if (e.type !== "MemberExpression" || e.optional || e.computed || e.property.type !== "Identifier" || e.property.name !== u)
|
|
222
|
-
return !1;
|
|
193
|
+
if (r === 0) return e.type === "Identifier" && e.name === u;
|
|
194
|
+
if (e.type !== "MemberExpression" || e.optional || e.computed || e.property.type !== "Identifier" || e.property.name !== u) return !1;
|
|
223
195
|
e = e.object;
|
|
224
196
|
}
|
|
225
197
|
}
|
|
@@ -241,22 +213,14 @@ function Us(e) {
|
|
|
241
213
|
return e.expressions ? e.expressions[0] : e.left ?? e.test ?? e.callee ?? e.object ?? e.tag ?? e.argument ?? e.expression;
|
|
242
214
|
}
|
|
243
215
|
function Yr(e) {
|
|
244
|
-
if (e.expressions)
|
|
245
|
-
|
|
246
|
-
if (e.
|
|
247
|
-
|
|
248
|
-
if (e.
|
|
249
|
-
|
|
250
|
-
if (e.
|
|
251
|
-
|
|
252
|
-
if (e.callee)
|
|
253
|
-
return ["callee"];
|
|
254
|
-
if (e.tag)
|
|
255
|
-
return ["tag"];
|
|
256
|
-
if (e.argument)
|
|
257
|
-
return ["argument"];
|
|
258
|
-
if (e.expression)
|
|
259
|
-
return ["expression"];
|
|
216
|
+
if (e.expressions) return ["expressions", 0];
|
|
217
|
+
if (e.left) return ["left"];
|
|
218
|
+
if (e.test) return ["test"];
|
|
219
|
+
if (e.object) return ["object"];
|
|
220
|
+
if (e.callee) return ["callee"];
|
|
221
|
+
if (e.tag) return ["tag"];
|
|
222
|
+
if (e.argument) return ["argument"];
|
|
223
|
+
if (e.expression) return ["expression"];
|
|
260
224
|
throw new Error("Unexpected node has no left side.");
|
|
261
225
|
}
|
|
262
226
|
var Gs = _(["ExportDefaultDeclaration", "DeclareExportDeclaration", "ExportNamedDeclaration", "ExportAllDeclaration", "DeclareExportAllDeclaration"]), Q = _(["ArrayExpression"]), Ae = _(["ObjectExpression"]);
|
|
@@ -311,16 +275,12 @@ function to(e) {
|
|
|
311
275
|
return Rs(e, eo);
|
|
312
276
|
}
|
|
313
277
|
function nn(e, t) {
|
|
314
|
-
if (e?.type !== "CallExpression" || e.optional)
|
|
315
|
-
return !1;
|
|
278
|
+
if (e?.type !== "CallExpression" || e.optional) return !1;
|
|
316
279
|
let n = de(e);
|
|
317
280
|
if (n.length === 1) {
|
|
318
|
-
if (ln(e) && nn(t))
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
return ln(n[0]);
|
|
322
|
-
} else if ((n.length === 2 || n.length === 3) && (n[0].type === "TemplateLiteral" || Y(n[0])) && to(e.callee))
|
|
323
|
-
return n[2] && !be(n[2]) ? !1 : (n.length === 2 ? kt(n[1]) : zs(n[1]) && Z(n[1]).length <= 1) || ln(n[1]);
|
|
281
|
+
if (ln(e) && nn(t)) return kt(n[0]);
|
|
282
|
+
if (Zs(e.callee)) return ln(n[0]);
|
|
283
|
+
} else if ((n.length === 2 || n.length === 3) && (n[0].type === "TemplateLiteral" || Y(n[0])) && to(e.callee)) return n[2] && !be(n[2]) ? !1 : (n.length === 2 ? kt(n[1]) : zs(n[1]) && Z(n[1]).length <= 1) || ln(n[1]);
|
|
324
284
|
return !1;
|
|
325
285
|
}
|
|
326
286
|
var nu = (e) => (t) => (t?.type === "ChainExpression" && (t = t.expression), e(t)), L = nu(_(["CallExpression", "OptionalCallExpression"])), R = nu(_(["MemberExpression", "OptionalMemberExpression"]));
|
|
@@ -331,19 +291,16 @@ function ru(e, t) {
|
|
|
331
291
|
let n = 0;
|
|
332
292
|
for (let r in e) {
|
|
333
293
|
let u = e[r];
|
|
334
|
-
if (u && typeof u == "object" && typeof u.type == "string" && (n++, n += ru(u, t - n)), n > t)
|
|
335
|
-
return n;
|
|
294
|
+
if (u && typeof u == "object" && typeof u.type == "string" && (n++, n += ru(u, t - n)), n > t) return n;
|
|
336
295
|
}
|
|
337
296
|
return n;
|
|
338
297
|
}
|
|
339
298
|
var no = 0.25;
|
|
340
299
|
function Gn(e, t) {
|
|
341
300
|
let { printWidth: n } = t;
|
|
342
|
-
if (h(e))
|
|
343
|
-
return !1;
|
|
301
|
+
if (h(e)) return !1;
|
|
344
302
|
let r = n * no;
|
|
345
|
-
if (e.type === "ThisExpression" || e.type === "Identifier" && e.name.length <= r || Zr(e) && !h(e.argument))
|
|
346
|
-
return !0;
|
|
303
|
+
if (e.type === "ThisExpression" || e.type === "Identifier" && e.name.length <= r || Zr(e) && !h(e.argument)) return !0;
|
|
347
304
|
let u = e.type === "Literal" && "regex" in e && e.regex.pattern || e.type === "RegExpLiteral" && e.pattern;
|
|
348
305
|
return u ? u.length <= r : Y(e) ? yt(se(e), t).length <= r : e.type === "TemplateLiteral" ? e.expressions.length === 0 && e.quasis[0].value.raw.length <= r && !e.quasis[0].value.raw.includes(`
|
|
349
306
|
`) : e.type === "UnaryExpression" ? Gn(e.argument, { printWidth: n }) : e.type === "CallExpression" && e.arguments.length === 0 && e.callee.type === "Identifier" ? e.callee.name.length <= r - 2 : Wn(e);
|
|
@@ -359,24 +316,18 @@ function uu(e, t) {
|
|
|
359
316
|
return (e.type === "TemplateLiteral" && Er(e) || e.type === "TaggedTemplateExpression" && Er(e.quasi)) && !pe(t, q(e), { backwards: !0 });
|
|
360
317
|
}
|
|
361
318
|
function au(e) {
|
|
362
|
-
if (!h(e))
|
|
363
|
-
return !1;
|
|
319
|
+
if (!h(e)) return !1;
|
|
364
320
|
let t = X(!1, Ke(e, T.Dangling), -1);
|
|
365
321
|
return t && !ye(t);
|
|
366
322
|
}
|
|
367
323
|
function ro(e) {
|
|
368
|
-
if (e.length <= 1)
|
|
369
|
-
return !1;
|
|
324
|
+
if (e.length <= 1) return !1;
|
|
370
325
|
let t = 0;
|
|
371
|
-
for (let n of e)
|
|
372
|
-
if (
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
for (let r of de(n))
|
|
377
|
-
if (kt(r))
|
|
378
|
-
return !0;
|
|
379
|
-
}
|
|
326
|
+
for (let n of e) if (kt(n)) {
|
|
327
|
+
if (t += 1, t > 1) return !0;
|
|
328
|
+
} else if (L(n)) {
|
|
329
|
+
for (let r of de(n)) if (kt(r)) return !0;
|
|
330
|
+
}
|
|
380
331
|
return !1;
|
|
381
332
|
}
|
|
382
333
|
function su(e) {
|
|
@@ -385,22 +336,15 @@ function su(e) {
|
|
|
385
336
|
}
|
|
386
337
|
var uo = /* @__PURE__ */ new Set(["!", "-", "+", "~"]);
|
|
387
338
|
function Ee(e, t = 2) {
|
|
388
|
-
if (t <= 0)
|
|
389
|
-
|
|
390
|
-
if (e.type === "ChainExpression" || e.type === "TSNonNullExpression")
|
|
391
|
-
return Ee(e.expression, t);
|
|
339
|
+
if (t <= 0) return !1;
|
|
340
|
+
if (e.type === "ChainExpression" || e.type === "TSNonNullExpression") return Ee(e.expression, t);
|
|
392
341
|
let n = (r) => Ee(r, t - 1);
|
|
393
|
-
if (eu(e))
|
|
394
|
-
|
|
395
|
-
if (
|
|
396
|
-
return !0;
|
|
397
|
-
if (e.type === "TemplateLiteral")
|
|
398
|
-
return e.quasis.every((r) => !r.value.raw.includes(`
|
|
342
|
+
if (eu(e)) return lt(e.pattern ?? e.regex.pattern) <= 5;
|
|
343
|
+
if (Wn(e) || Hs(e) || e.type === "ArgumentPlaceholder") return !0;
|
|
344
|
+
if (e.type === "TemplateLiteral") return e.quasis.every((r) => !r.value.raw.includes(`
|
|
399
345
|
`)) && e.expressions.every(n);
|
|
400
|
-
if (Ae(e))
|
|
401
|
-
|
|
402
|
-
if (Q(e))
|
|
403
|
-
return e.elements.every((r) => r === null || n(r));
|
|
346
|
+
if (Ae(e)) return e.properties.every((r) => !r.computed && (r.shorthand || r.value && n(r.value)));
|
|
347
|
+
if (Q(e)) return e.elements.every((r) => r === null || n(r));
|
|
404
348
|
if (dt(e)) {
|
|
405
349
|
if (e.type === "ImportExpression" || Ee(e.callee, t)) {
|
|
406
350
|
let r = de(e);
|
|
@@ -464,15 +408,13 @@ function oo(e) {
|
|
|
464
408
|
}
|
|
465
409
|
function io(e) {
|
|
466
410
|
var t;
|
|
467
|
-
if (e.rest)
|
|
468
|
-
return !0;
|
|
411
|
+
if (e.rest) return !0;
|
|
469
412
|
let n = Z(e);
|
|
470
413
|
return ((t = X(!1, n, -1)) == null ? void 0 : t.type) === "RestElement";
|
|
471
414
|
}
|
|
472
415
|
var cn = /* @__PURE__ */ new WeakMap();
|
|
473
416
|
function Z(e) {
|
|
474
|
-
if (cn.has(e))
|
|
475
|
-
return cn.get(e);
|
|
417
|
+
if (cn.has(e)) return cn.get(e);
|
|
476
418
|
let t = [];
|
|
477
419
|
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), cn.set(e, t), t;
|
|
478
420
|
}
|
|
@@ -482,30 +424,24 @@ function po(e, t) {
|
|
|
482
424
|
}
|
|
483
425
|
var Dn = /* @__PURE__ */ new WeakMap();
|
|
484
426
|
function de(e) {
|
|
485
|
-
if (Dn.has(e))
|
|
486
|
-
|
|
487
|
-
if (e.type === "ChainExpression")
|
|
488
|
-
return de(e.expression);
|
|
427
|
+
if (Dn.has(e)) return Dn.get(e);
|
|
428
|
+
if (e.type === "ChainExpression") return de(e.expression);
|
|
489
429
|
let t = e.arguments;
|
|
490
430
|
return (e.type === "ImportExpression" || e.type === "TSImportType") && (t = [e.type === "ImportExpression" ? e.source : e.argument], e.options && t.push(e.options)), Dn.set(e, t), t;
|
|
491
431
|
}
|
|
492
432
|
function Kt(e, t) {
|
|
493
433
|
let { node: n } = e;
|
|
494
|
-
if (n.type === "ChainExpression")
|
|
495
|
-
return e.call(() => Kt(e, t), "expression");
|
|
434
|
+
if (n.type === "ChainExpression") return e.call(() => Kt(e, t), "expression");
|
|
496
435
|
n.type === "ImportExpression" || n.type === "TSImportType" ? (e.call((r) => t(r, 0), n.type === "ImportExpression" ? "source" : "argument"), n.options && e.call((r) => t(r, 1), "options")) : e.each(t, "arguments");
|
|
497
436
|
}
|
|
498
437
|
function Ar(e, t) {
|
|
499
438
|
let n = [];
|
|
500
439
|
if (e.type === "ChainExpression" && (e = e.expression, n.push("expression")), e.type === "ImportExpression" || e.type === "TSImportType") {
|
|
501
|
-
if (t === 0 || t === (e.options ? -2 : -1))
|
|
502
|
-
|
|
503
|
-
if (e.options && (t === 1 || t === -1))
|
|
504
|
-
return [...n, "options"];
|
|
440
|
+
if (t === 0 || t === (e.options ? -2 : -1)) return [...n, e.type === "ImportExpression" ? "source" : "argument"];
|
|
441
|
+
if (e.options && (t === 1 || t === -1)) return [...n, "options"];
|
|
505
442
|
throw new RangeError("Invalid argument index");
|
|
506
443
|
}
|
|
507
|
-
if (t < 0 && (t = e.arguments.length + t), t < 0 || t >= e.arguments.length)
|
|
508
|
-
throw new RangeError("Invalid argument index");
|
|
444
|
+
if (t < 0 && (t = e.arguments.length + t), t < 0 || t >= e.arguments.length) throw new RangeError("Invalid argument index");
|
|
509
445
|
return [...n, "arguments", t];
|
|
510
446
|
}
|
|
511
447
|
function Ht(e) {
|
|
@@ -515,18 +451,15 @@ function rn(e) {
|
|
|
515
451
|
return e?.prettierIgnore || h(e, T.PrettierIgnore);
|
|
516
452
|
}
|
|
517
453
|
var T = { Leading: 2, Trailing: 4, Dangling: 8, Block: 16, Line: 32, PrettierIgnore: 64, First: 128, Last: 256 }, ou = (e, t) => {
|
|
518
|
-
if (typeof e == "function" && (t = e, e = 0), e || t)
|
|
519
|
-
return (n, r, u) => !(e & T.Leading && !n.leading || e & T.Trailing && !n.trailing || e & T.Dangling && (n.leading || n.trailing) || e & T.Block && !ye(n) || e & T.Line && !Nt(n) || e & T.First && r !== 0 || e & T.Last && r !== u.length - 1 || e & T.PrettierIgnore && !Ht(n) || t && !t(n));
|
|
454
|
+
if (typeof e == "function" && (t = e, e = 0), e || t) return (n, r, u) => !(e & T.Leading && !n.leading || e & T.Trailing && !n.trailing || e & T.Dangling && (n.leading || n.trailing) || e & T.Block && !ye(n) || e & T.Line && !Nt(n) || e & T.First && r !== 0 || e & T.Last && r !== u.length - 1 || e & T.PrettierIgnore && !Ht(n) || t && !t(n));
|
|
520
455
|
};
|
|
521
456
|
function h(e, t, n) {
|
|
522
|
-
if (!J(e?.comments))
|
|
523
|
-
return !1;
|
|
457
|
+
if (!J(e?.comments)) return !1;
|
|
524
458
|
let r = ou(t, n);
|
|
525
459
|
return r ? e.comments.some(r) : !0;
|
|
526
460
|
}
|
|
527
461
|
function Ke(e, t, n) {
|
|
528
|
-
if (!Array.isArray(e?.comments))
|
|
529
|
-
return [];
|
|
462
|
+
if (!Array.isArray(e?.comments)) return [];
|
|
530
463
|
let r = ou(t, n);
|
|
531
464
|
return r ? e.comments.filter(r) : e.comments;
|
|
532
465
|
}
|
|
@@ -538,60 +471,48 @@ function je(e) {
|
|
|
538
471
|
return e && (e.type === "ObjectProperty" || e.type === "Property" && !tn(e));
|
|
539
472
|
}
|
|
540
473
|
var Ce = _(["TSAsExpression", "TSSatisfiesExpression", "AsExpression", "AsConstExpression", "SatisfiesExpression"]), $e = _(["TSUnionType", "UnionTypeAnnotation"]), Kn = _(["TSIntersectionType", "IntersectionTypeAnnotation"]), Re = _(["TSConditionalType", "ConditionalTypeAnnotation"]), lo = /* @__PURE__ */ new Set(["range", "raw", "comments", "leadingComments", "trailingComments", "innerComments", "extra", "start", "end", "loc", "flags", "errors", "tokens"]), ot = (e) => {
|
|
541
|
-
for (let t of e.quasis)
|
|
542
|
-
delete t.value;
|
|
474
|
+
for (let t of e.quasis) delete t.value;
|
|
543
475
|
};
|
|
544
476
|
function iu(e, t) {
|
|
545
477
|
var n;
|
|
546
|
-
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 === " ")
|
|
547
|
-
return null;
|
|
478
|
+
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;
|
|
548
479
|
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) {
|
|
549
480
|
let { key: u } = e;
|
|
550
481
|
Y(u) || be(u) ? t.key = String(u.value) : u.type === "Identifier" && (t.key = u.name);
|
|
551
482
|
}
|
|
552
|
-
if (e.type === "JSXElement" && e.openingElement.name.name === "style" && e.openingElement.attributes.some((u) => u.type === "JSXAttribute" && u.name.name === "jsx"))
|
|
553
|
-
for (let { type: u, expression: a } of t.children)
|
|
554
|
-
u === "JSXExpressionContainer" && a.type === "TemplateLiteral" && ot(a);
|
|
483
|
+
if (e.type === "JSXElement" && e.openingElement.name.name === "style" && e.openingElement.attributes.some((u) => u.type === "JSXAttribute" && u.name.name === "jsx")) for (let { type: u, expression: a } of t.children) u === "JSXExpressionContainer" && a.type === "TemplateLiteral" && ot(a);
|
|
555
484
|
e.type === "JSXAttribute" && e.name.name === "css" && e.value.type === "JSXExpressionContainer" && e.value.expression.type === "TemplateLiteral" && ot(t.value.expression), e.type === "JSXAttribute" && ((n = e.value) == null ? void 0 : n.type) === "Literal" && /["']|"|'/u.test(e.value.value) && (t.value.value = H(!1, e.value.value, /["']|"|'/gu, '"'));
|
|
556
485
|
let r = e.expression || e.callee;
|
|
557
486
|
if (e.type === "Decorator" && r.type === "CallExpression" && r.callee.name === "Component" && r.arguments.length === 1) {
|
|
558
487
|
let u = e.expression.arguments[0].properties;
|
|
559
|
-
for (let [a, s] of t.expression.arguments[0].properties.entries())
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
}
|
|
488
|
+
for (let [a, s] of t.expression.arguments[0].properties.entries()) switch (u[a].key.name) {
|
|
489
|
+
case "styles":
|
|
490
|
+
Q(s.value) && ot(s.value.elements[0]);
|
|
491
|
+
break;
|
|
492
|
+
case "template":
|
|
493
|
+
s.value.type === "TemplateLiteral" && ot(s.value);
|
|
494
|
+
break;
|
|
495
|
+
}
|
|
568
496
|
}
|
|
569
497
|
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") && ot(t.quasi), e.type === "TemplateLiteral" && ot(t), e.type === "ChainExpression" && e.expression.type === "TSNonNullExpression" && (t.type = "TSNonNullExpression", t.expression.type = "ChainExpression");
|
|
570
498
|
}
|
|
571
499
|
iu.ignoredProperties = lo;
|
|
572
500
|
var co = iu, Qe = "string", Pe = "array", ft = "cursor", Ye = "indent", Ze = "align", et = "trim", De = "group", We = "fill", Se = "if-break", tt = "indent-if-break", nt = "line-suffix", Ue = "line-suffix-boundary", ie = "line", Le = "label", Me = "break-parent", pu = /* @__PURE__ */ new Set([ft, Ye, Ze, et, De, We, Se, tt, nt, Ue, ie, Le, Me]);
|
|
573
501
|
function Do(e) {
|
|
574
|
-
if (typeof e == "string")
|
|
575
|
-
|
|
576
|
-
if (
|
|
577
|
-
return Pe;
|
|
578
|
-
if (!e)
|
|
579
|
-
return;
|
|
502
|
+
if (typeof e == "string") return Qe;
|
|
503
|
+
if (Array.isArray(e)) return Pe;
|
|
504
|
+
if (!e) return;
|
|
580
505
|
let { type: t } = e;
|
|
581
|
-
if (pu.has(t))
|
|
582
|
-
return t;
|
|
506
|
+
if (pu.has(t)) return t;
|
|
583
507
|
}
|
|
584
508
|
var Ge = Do, yo = (e) => new Intl.ListFormat("en-US", { type: "disjunction" }).format(e);
|
|
585
509
|
function mo(e) {
|
|
586
510
|
let t = e === null ? "null" : typeof e;
|
|
587
|
-
if (t !== "string" && t !== "object")
|
|
588
|
-
return `Unexpected doc '${t}',
|
|
511
|
+
if (t !== "string" && t !== "object") return `Unexpected doc '${t}',
|
|
589
512
|
Expected it to be 'string' or 'object'.`;
|
|
590
|
-
if (Ge(e))
|
|
591
|
-
throw new Error("doc is valid.");
|
|
513
|
+
if (Ge(e)) throw new Error("doc is valid.");
|
|
592
514
|
let n = Object.prototype.toString.call(e);
|
|
593
|
-
if (n !== "[object Object]")
|
|
594
|
-
return `Unexpected doc '${n}'.`;
|
|
515
|
+
if (n !== "[object Object]") return `Unexpected doc '${n}'.`;
|
|
595
516
|
let r = yo([...pu].map((u) => `'${u}'`));
|
|
596
517
|
return `Unexpected doc.type '${e.type}'.
|
|
597
518
|
Expected it to be ${r}.`;
|
|
@@ -612,55 +533,47 @@ function Eo(e, t, n, r) {
|
|
|
612
533
|
}
|
|
613
534
|
n && u.push(a, gr);
|
|
614
535
|
let s = Ge(a);
|
|
615
|
-
if (!s)
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
for (let i = o.length, l = i - 1; l >= 0; --l)
|
|
623
|
-
u.push(o[l]);
|
|
624
|
-
break;
|
|
625
|
-
}
|
|
626
|
-
case Se:
|
|
627
|
-
u.push(a.flatContents, a.breakContents);
|
|
628
|
-
break;
|
|
629
|
-
case De:
|
|
630
|
-
if (r && a.expandedStates)
|
|
631
|
-
for (let o = a.expandedStates.length, i = o - 1; i >= 0; --i)
|
|
632
|
-
u.push(a.expandedStates[i]);
|
|
633
|
-
else
|
|
634
|
-
u.push(a.contents);
|
|
635
|
-
break;
|
|
636
|
-
case Ze:
|
|
637
|
-
case Ye:
|
|
638
|
-
case tt:
|
|
639
|
-
case Le:
|
|
640
|
-
case nt:
|
|
641
|
-
u.push(a.contents);
|
|
642
|
-
break;
|
|
643
|
-
case Qe:
|
|
644
|
-
case ft:
|
|
645
|
-
case et:
|
|
646
|
-
case Ue:
|
|
647
|
-
case ie:
|
|
648
|
-
case Me:
|
|
649
|
-
break;
|
|
650
|
-
default:
|
|
651
|
-
throw new Pt(a);
|
|
536
|
+
if (!s) throw new Pt(a);
|
|
537
|
+
if (t?.(a) !== !1) switch (s) {
|
|
538
|
+
case Pe:
|
|
539
|
+
case We: {
|
|
540
|
+
let o = s === Pe ? a : a.parts;
|
|
541
|
+
for (let i = o.length, l = i - 1; l >= 0; --l) u.push(o[l]);
|
|
542
|
+
break;
|
|
652
543
|
}
|
|
544
|
+
case Se:
|
|
545
|
+
u.push(a.flatContents, a.breakContents);
|
|
546
|
+
break;
|
|
547
|
+
case De:
|
|
548
|
+
if (r && a.expandedStates) for (let o = a.expandedStates.length, i = o - 1; i >= 0; --i) u.push(a.expandedStates[i]);
|
|
549
|
+
else u.push(a.contents);
|
|
550
|
+
break;
|
|
551
|
+
case Ze:
|
|
552
|
+
case Ye:
|
|
553
|
+
case tt:
|
|
554
|
+
case Le:
|
|
555
|
+
case nt:
|
|
556
|
+
u.push(a.contents);
|
|
557
|
+
break;
|
|
558
|
+
case Qe:
|
|
559
|
+
case ft:
|
|
560
|
+
case et:
|
|
561
|
+
case Ue:
|
|
562
|
+
case ie:
|
|
563
|
+
case Me:
|
|
564
|
+
break;
|
|
565
|
+
default:
|
|
566
|
+
throw new Pt(a);
|
|
567
|
+
}
|
|
653
568
|
}
|
|
654
569
|
}
|
|
655
570
|
var Hn = Eo;
|
|
656
571
|
function Et(e, t) {
|
|
657
|
-
if (typeof e == "string")
|
|
658
|
-
return t(e);
|
|
572
|
+
if (typeof e == "string") return t(e);
|
|
659
573
|
let n = /* @__PURE__ */ new Map();
|
|
660
574
|
return r(e);
|
|
661
575
|
function r(a) {
|
|
662
|
-
if (n.has(a))
|
|
663
|
-
return n.get(a);
|
|
576
|
+
if (n.has(a)) return n.get(a);
|
|
664
577
|
let s = u(a);
|
|
665
578
|
return n.set(a, s), s;
|
|
666
579
|
}
|
|
@@ -697,16 +610,14 @@ function Et(e, t) {
|
|
|
697
610
|
function lu(e, t, n) {
|
|
698
611
|
let r = n, u = !1;
|
|
699
612
|
function a(s) {
|
|
700
|
-
if (u)
|
|
701
|
-
return !1;
|
|
613
|
+
if (u) return !1;
|
|
702
614
|
let o = t(s);
|
|
703
615
|
o !== void 0 && (u = !0, r = o);
|
|
704
616
|
}
|
|
705
617
|
return Hn(e, a), r;
|
|
706
618
|
}
|
|
707
619
|
function Fo(e) {
|
|
708
|
-
if (e.type === De && e.break || e.type === ie && e.hard || e.type === Me)
|
|
709
|
-
return !0;
|
|
620
|
+
if (e.type === De && e.break || e.type === ie && e.hard || e.type === Me) return !0;
|
|
710
621
|
}
|
|
711
622
|
function ne(e) {
|
|
712
623
|
return lu(e, Fo, !1);
|
|
@@ -722,8 +633,7 @@ function Ao(e) {
|
|
|
722
633
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
723
634
|
function r(a) {
|
|
724
635
|
if (a.type === Me && xr(n), a.type === De) {
|
|
725
|
-
if (n.push(a), t.has(a))
|
|
726
|
-
return !1;
|
|
636
|
+
if (n.push(a), t.has(a)) return !1;
|
|
727
637
|
t.add(a);
|
|
728
638
|
}
|
|
729
639
|
}
|
|
@@ -741,31 +651,25 @@ function Sn(e) {
|
|
|
741
651
|
function xo(e) {
|
|
742
652
|
switch (Ge(e)) {
|
|
743
653
|
case We:
|
|
744
|
-
if (e.parts.every((t) => t === ""))
|
|
745
|
-
return "";
|
|
654
|
+
if (e.parts.every((t) => t === "")) return "";
|
|
746
655
|
break;
|
|
747
656
|
case De:
|
|
748
|
-
if (!e.contents && !e.id && !e.break && !e.expandedStates)
|
|
749
|
-
|
|
750
|
-
if (e.contents.type === De && e.contents.id === e.id && e.contents.break === e.break && e.contents.expandedStates === e.expandedStates)
|
|
751
|
-
return e.contents;
|
|
657
|
+
if (!e.contents && !e.id && !e.break && !e.expandedStates) return "";
|
|
658
|
+
if (e.contents.type === De && e.contents.id === e.id && e.contents.break === e.break && e.contents.expandedStates === e.expandedStates) return e.contents;
|
|
752
659
|
break;
|
|
753
660
|
case Ze:
|
|
754
661
|
case Ye:
|
|
755
662
|
case tt:
|
|
756
663
|
case nt:
|
|
757
|
-
if (!e.contents)
|
|
758
|
-
return "";
|
|
664
|
+
if (!e.contents) return "";
|
|
759
665
|
break;
|
|
760
666
|
case Se:
|
|
761
|
-
if (!e.flatContents && !e.breakContents)
|
|
762
|
-
return "";
|
|
667
|
+
if (!e.flatContents && !e.breakContents) return "";
|
|
763
668
|
break;
|
|
764
669
|
case Pe: {
|
|
765
670
|
let t = [];
|
|
766
671
|
for (let n of e) {
|
|
767
|
-
if (!n)
|
|
768
|
-
continue;
|
|
672
|
+
if (!n) continue;
|
|
769
673
|
let [r, ...u] = Array.isArray(n) ? n : [n];
|
|
770
674
|
typeof r == "string" && typeof X(!1, t, -1) == "string" ? t[t.length - 1] += r : t.push(r), t.push(...u);
|
|
771
675
|
}
|
|
@@ -792,8 +696,7 @@ function He(e, t = du) {
|
|
|
792
696
|
`)) : n);
|
|
793
697
|
}
|
|
794
698
|
function ho(e) {
|
|
795
|
-
if (e.type === ie)
|
|
796
|
-
return !0;
|
|
699
|
+
if (e.type === ie) return !0;
|
|
797
700
|
}
|
|
798
701
|
function Co(e) {
|
|
799
702
|
return lu(e, ho, !1);
|
|
@@ -806,8 +709,7 @@ function To(e) {
|
|
|
806
709
|
return Hn(e, (n) => {
|
|
807
710
|
switch (Ge(n)) {
|
|
808
711
|
case Qe:
|
|
809
|
-
if (n === "")
|
|
810
|
-
break;
|
|
712
|
+
if (n === "") break;
|
|
811
713
|
case et:
|
|
812
714
|
case Ue:
|
|
813
715
|
case ie:
|
|
@@ -851,15 +753,13 @@ function hr(e) {
|
|
|
851
753
|
var we = { type: Ue }, ve = { type: Me }, yu = { type: ie, hard: !0 }, vo = { type: ie, hard: !0, literal: !0 }, C = { type: ie }, E = { type: ie, soft: !0 }, F = [yu, ve], du = [vo, ve], Xt = { type: ft };
|
|
852
754
|
function N(e, t) {
|
|
853
755
|
let n = [];
|
|
854
|
-
for (let r = 0; r < t.length; r++)
|
|
855
|
-
r !== 0 && n.push(e), n.push(t[r]);
|
|
756
|
+
for (let r = 0; r < t.length; r++) r !== 0 && n.push(e), n.push(t[r]);
|
|
856
757
|
return n;
|
|
857
758
|
}
|
|
858
759
|
function ko(e, t, n) {
|
|
859
760
|
let r = e;
|
|
860
761
|
if (t > 0) {
|
|
861
|
-
for (let u = 0; u < Math.floor(t / n); ++u)
|
|
862
|
-
r = A(r);
|
|
762
|
+
for (let u = 0; u < Math.floor(t / n); ++u) r = A(r);
|
|
863
763
|
r = Be(t % n, r), r = Be(Number.NEGATIVE_INFINITY, r);
|
|
864
764
|
}
|
|
865
765
|
return r;
|
|
@@ -868,8 +768,7 @@ function jt(e, t) {
|
|
|
868
768
|
return e ? { type: Le, label: e, contents: t } : t;
|
|
869
769
|
}
|
|
870
770
|
function Po(e) {
|
|
871
|
-
if (!ye(e))
|
|
872
|
-
return !1;
|
|
771
|
+
if (!ye(e)) return !1;
|
|
873
772
|
let t = `*${e.value}*`.split(`
|
|
874
773
|
`);
|
|
875
774
|
return t.length > 1 && t.every((n) => n.trimStart()[0] === "*");
|
|
@@ -881,12 +780,9 @@ function wo(e) {
|
|
|
881
780
|
var Io = wo;
|
|
882
781
|
function No(e, t) {
|
|
883
782
|
let n = e.node;
|
|
884
|
-
if (Nt(n))
|
|
885
|
-
|
|
886
|
-
if (
|
|
887
|
-
return jo(n);
|
|
888
|
-
if (ye(n))
|
|
889
|
-
return ["/*", He(n.value), "*/"];
|
|
783
|
+
if (Nt(n)) return t.originalText.slice(q(n), I(n)).trimEnd();
|
|
784
|
+
if (Io(n)) return jo(n);
|
|
785
|
+
if (ye(n)) return ["/*", He(n.value), "*/"];
|
|
890
786
|
throw new Error("Not a comment: " + JSON.stringify(n));
|
|
891
787
|
}
|
|
892
788
|
function jo(e) {
|
|
@@ -914,8 +810,7 @@ function W(e, t) {
|
|
|
914
810
|
}
|
|
915
811
|
function Mo(e, t) {
|
|
916
812
|
let n = null, r = t;
|
|
917
|
-
for (; r !== n; )
|
|
918
|
-
n = r, r = ct(e, r), r = qn(e, r), r = _n(e, r), r = Dt(e, r);
|
|
813
|
+
for (; r !== n; ) n = r, r = ct(e, r), r = qn(e, r), r = _n(e, r), r = Dt(e, r);
|
|
919
814
|
return r;
|
|
920
815
|
}
|
|
921
816
|
var Ft = Mo;
|
|
@@ -925,10 +820,8 @@ function Oo(e, t) {
|
|
|
925
820
|
}
|
|
926
821
|
var ge = Oo;
|
|
927
822
|
function Jo(e, t, n) {
|
|
928
|
-
for (let r = t; r < n; ++r)
|
|
929
|
-
|
|
930
|
-
`)
|
|
931
|
-
return !0;
|
|
823
|
+
for (let r = t; r < n; ++r) if (e.charAt(r) === `
|
|
824
|
+
`) return !0;
|
|
932
825
|
return !1;
|
|
933
826
|
}
|
|
934
827
|
var ce = Jo, dn = /* @__PURE__ */ new WeakMap();
|
|
@@ -956,14 +849,11 @@ function Ro({ comment: e, followingNode: t }) {
|
|
|
956
849
|
return t && fu(e) ? (ee(t, e), !0) : !1;
|
|
957
850
|
}
|
|
958
851
|
function Yn({ comment: e, precedingNode: t, enclosingNode: n, followingNode: r, text: u }) {
|
|
959
|
-
if (n?.type !== "IfStatement" || !r)
|
|
960
|
-
|
|
961
|
-
if (ge(u, I(e)) === ")")
|
|
962
|
-
return W(t, e), !0;
|
|
852
|
+
if (n?.type !== "IfStatement" || !r) return !1;
|
|
853
|
+
if (ge(u, I(e)) === ")") return W(t, e), !0;
|
|
963
854
|
if (t === n.consequent && r === n.alternate) {
|
|
964
855
|
let a = Ft(u, I(n.consequent));
|
|
965
|
-
if (q(e) < a || n.alternate.type === "BlockStatement")
|
|
966
|
-
return t.type === "BlockStatement" || Eu(e, u) && !ce(u, q(t), q(e)) ? (W(t, e), !0) : (le(n, e), !0);
|
|
856
|
+
if (q(e) < a || n.alternate.type === "BlockStatement") return t.type === "BlockStatement" || Eu(e, u) && !ce(u, q(t), q(e)) ? (W(t, e), !0) : (le(n, e), !0);
|
|
967
857
|
}
|
|
968
858
|
return r.type === "BlockStatement" ? (rt(r, e), !0) : r.type === "IfStatement" ? (Bn(r.consequent, e), !0) : n.consequent === r ? (ee(r, e), !0) : !1;
|
|
969
859
|
}
|
|
@@ -989,16 +879,11 @@ function Go({ comment: e, precedingNode: t, enclosingNode: n }) {
|
|
|
989
879
|
var Vo = /* @__PURE__ */ new Set(["ClassDeclaration", "ClassExpression", "DeclareClass", "DeclareInterface", "InterfaceDeclaration", "TSInterfaceDeclaration"]);
|
|
990
880
|
function gu({ comment: e, precedingNode: t, enclosingNode: n, followingNode: r }) {
|
|
991
881
|
if (Vo.has(n?.type)) {
|
|
992
|
-
if (J(n.decorators) && r?.type !== "Decorator")
|
|
993
|
-
|
|
994
|
-
if (n.body && r === n.body)
|
|
995
|
-
return rt(n.body, e), !0;
|
|
882
|
+
if (J(n.decorators) && r?.type !== "Decorator") return W(X(!1, n.decorators, -1), e), !0;
|
|
883
|
+
if (n.body && r === n.body) return rt(n.body, e), !0;
|
|
996
884
|
if (r) {
|
|
997
|
-
if (n.superClass && r === n.superClass && t && (t === n.id || t === n.typeParameters))
|
|
998
|
-
|
|
999
|
-
for (let u of ["implements", "extends", "mixins"])
|
|
1000
|
-
if (n[u] && r === n[u][0])
|
|
1001
|
-
return t && (t === n.id || t === n.typeParameters || t === n.superClass) ? W(t, e) : le(n, e, u), !0;
|
|
885
|
+
if (n.superClass && r === n.superClass && t && (t === n.id || t === n.typeParameters)) return W(t, e), !0;
|
|
886
|
+
for (let u of ["implements", "extends", "mixins"]) if (n[u] && r === n[u][0]) return t && (t === n.id || t === n.typeParameters || t === n.superClass) ? W(t, e) : le(n, e, u), !0;
|
|
1002
887
|
}
|
|
1003
888
|
}
|
|
1004
889
|
return !1;
|
|
@@ -1012,8 +897,7 @@ function zo({ comment: e, precedingNode: t, enclosingNode: n, text: r }) {
|
|
|
1012
897
|
return ge(r, I(e)) !== "(" ? !1 : t && Ho.has(n?.type) ? (W(t, e), !0) : !1;
|
|
1013
898
|
}
|
|
1014
899
|
function Qo({ comment: e, enclosingNode: t, text: n }) {
|
|
1015
|
-
if (t?.type !== "ArrowFunctionExpression")
|
|
1016
|
-
return !1;
|
|
900
|
+
if (t?.type !== "ArrowFunctionExpression") return !1;
|
|
1017
901
|
let r = Ft(n, I(e));
|
|
1018
902
|
return r !== !1 && n.slice(r, r + 2) === "=>" ? (le(t, e), !0) : !1;
|
|
1019
903
|
}
|
|
@@ -1049,8 +933,7 @@ function ri({ comment: e, enclosingNode: t }) {
|
|
|
1049
933
|
return t?.type === "ForInStatement" || t?.type === "ForOfStatement" ? (ee(t, e), !0) : !1;
|
|
1050
934
|
}
|
|
1051
935
|
function Tu({ comment: e, precedingNode: t, enclosingNode: n, text: r }) {
|
|
1052
|
-
if (n?.type === "ImportSpecifier" || n?.type === "ExportSpecifier")
|
|
1053
|
-
return ee(n, e), !0;
|
|
936
|
+
if (n?.type === "ImportSpecifier" || n?.type === "ExportSpecifier") return ee(n, e), !0;
|
|
1054
937
|
let u = t?.type === "ImportSpecifier" && n?.type === "ImportDeclaration", a = t?.type === "ExportSpecifier" && n?.type === "ExportNamedDeclaration";
|
|
1055
938
|
return (u || a) && pe(r, I(e)) ? (W(t, e), !0) : !1;
|
|
1056
939
|
}
|
|
@@ -1065,12 +948,10 @@ function ii({ comment: e, enclosingNode: t, followingNode: n, text: r }) {
|
|
|
1065
948
|
return !n && (t?.type === "TSMethodSignature" || t?.type === "TSDeclareFunction" || t?.type === "TSAbstractMethodDefinition") && ge(r, I(e)) === ";" ? (W(t, e), !0) : !1;
|
|
1066
949
|
}
|
|
1067
950
|
function Su({ comment: e, enclosingNode: t, followingNode: n }) {
|
|
1068
|
-
if (Ht(e) && t?.type === "TSMappedType" && n === t.key)
|
|
1069
|
-
return t.prettierIgnore = !0, e.unignore = !0, !0;
|
|
951
|
+
if (Ht(e) && t?.type === "TSMappedType" && n === t.key) return t.prettierIgnore = !0, e.unignore = !0, !0;
|
|
1070
952
|
}
|
|
1071
953
|
function bu({ comment: e, precedingNode: t, enclosingNode: n }) {
|
|
1072
|
-
if (n?.type === "TSMappedType" && !t)
|
|
1073
|
-
return le(n, e), !0;
|
|
954
|
+
if (n?.type === "TSMappedType" && !t) return le(n, e), !0;
|
|
1074
955
|
}
|
|
1075
956
|
function pi({ comment: e, enclosingNode: t, followingNode: n }) {
|
|
1076
957
|
return !t || t.type !== "SwitchCase" || t.test || !n || n !== t.consequent[0] ? !1 : (n.type === "BlockStatement" && Nt(e) ? rt(n, e) : le(t, e), !0);
|
|
@@ -1079,8 +960,7 @@ function li({ comment: e, precedingNode: t, enclosingNode: n, followingNode: r }
|
|
|
1079
960
|
return $e(t) && ((n.type === "TSArrayType" || n.type === "ArrayTypeAnnotation") && !r || Kn(n)) ? (W(X(!1, t.types, -1), e), !0) : !1;
|
|
1080
961
|
}
|
|
1081
962
|
function ci({ comment: e, enclosingNode: t, precedingNode: n, followingNode: r }) {
|
|
1082
|
-
if ((t?.type === "ObjectPattern" || t?.type === "ArrayPattern") && r?.type === "TSTypeAnnotation")
|
|
1083
|
-
return n ? W(n, e) : le(t, e), !0;
|
|
963
|
+
if ((t?.type === "ObjectPattern" || t?.type === "ArrayPattern") && r?.type === "TSTypeAnnotation") return n ? W(n, e) : le(t, e), !0;
|
|
1084
964
|
}
|
|
1085
965
|
function Di({ comment: e, precedingNode: t, enclosingNode: n, followingNode: r, text: u }) {
|
|
1086
966
|
return !r && n?.type === "UnaryExpression" && (t?.type === "LogicalExpression" || t?.type === "BinaryExpression") && ce(u, q(n.argument), q(t.right)) && Eu(e, u) && !ce(u, q(t.right), q(e)) ? (W(t.right, e), !0) : !1;
|
|
@@ -1091,16 +971,14 @@ function di(e) {
|
|
|
1091
971
|
}
|
|
1092
972
|
function mi(e, t) {
|
|
1093
973
|
var n;
|
|
1094
|
-
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" && ((n = e.value) == null ? void 0 : n.type) === "FunctionExpression" && Z(e.value).length === 0 && !e.value.returnType && !J(e.value.typeParameters) && e.value.body)
|
|
1095
|
-
return [...e.decorators || [], e.key, e.value.body];
|
|
974
|
+
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" && ((n = e.value) == null ? void 0 : n.type) === "FunctionExpression" && Z(e.value).length === 0 && !e.value.returnType && !J(e.value.typeParameters) && e.value.body) return [...e.decorators || [], e.key, e.value.body];
|
|
1096
975
|
}
|
|
1097
976
|
function vu(e) {
|
|
1098
977
|
let { node: t, parent: n } = e;
|
|
1099
978
|
return (K(t) || n && (n.type === "JSXSpreadAttribute" || n.type === "JSXSpreadChild" || $e(n) || (n.type === "ClassDeclaration" || n.type === "ClassExpression") && n.superClass === t)) && (!rn(t) || $e(n));
|
|
1100
979
|
}
|
|
1101
980
|
function fi(e, { parser: t }) {
|
|
1102
|
-
if (t === "flow" || t === "hermes" || t === "babel-flow")
|
|
1103
|
-
return e = H(!1, e, /[\s(]/gu, ""), e === "" || e === "/*" || e === "/*::";
|
|
981
|
+
if (t === "flow" || t === "hermes" || t === "babel-flow") return e = H(!1, e, /[\s(]/gu, ""), e === "" || e === "/*" || e === "/*::";
|
|
1104
982
|
}
|
|
1105
983
|
function Ei(e) {
|
|
1106
984
|
switch (e) {
|
|
@@ -1114,7 +992,7 @@ function Ei(e) {
|
|
|
1114
992
|
`;
|
|
1115
993
|
}
|
|
1116
994
|
}
|
|
1117
|
-
var ae = Symbol("MODE_BREAK"), he = Symbol("MODE_FLAT"), pt = Symbol("cursor"), vn = Symbol("DOC_FILL_PRINTED_LENGTH");
|
|
995
|
+
var ae = /* @__PURE__ */ Symbol("MODE_BREAK"), he = /* @__PURE__ */ Symbol("MODE_FLAT"), pt = /* @__PURE__ */ Symbol("cursor"), vn = /* @__PURE__ */ Symbol("DOC_FILL_PRINTED_LENGTH");
|
|
1118
996
|
function ku() {
|
|
1119
997
|
return { value: "", length: 0, queue: [] };
|
|
1120
998
|
}
|
|
@@ -1126,20 +1004,19 @@ function Ai(e, t, n) {
|
|
|
1126
1004
|
}
|
|
1127
1005
|
function kn(e, t, n) {
|
|
1128
1006
|
let r = t.type === "dedent" ? e.queue.slice(0, -1) : [...e.queue, t], u = "", a = 0, s = 0, o = 0;
|
|
1129
|
-
for (let y of r)
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
}
|
|
1007
|
+
for (let y of r) switch (y.type) {
|
|
1008
|
+
case "indent":
|
|
1009
|
+
d(), n.useTabs ? i(1) : l(n.tabWidth);
|
|
1010
|
+
break;
|
|
1011
|
+
case "stringAlign":
|
|
1012
|
+
d(), u += y.n, a += y.n.length;
|
|
1013
|
+
break;
|
|
1014
|
+
case "numberAlign":
|
|
1015
|
+
s += 1, o += y.n;
|
|
1016
|
+
break;
|
|
1017
|
+
default:
|
|
1018
|
+
throw new Error(`Unexpected type '${y.type}'`);
|
|
1019
|
+
}
|
|
1143
1020
|
return c(), { ...e, value: u, length: a, queue: r };
|
|
1144
1021
|
function i(y) {
|
|
1145
1022
|
u += " ".repeat(y), a += n.tabWidth * y;
|
|
@@ -1162,36 +1039,30 @@ function kn(e, t, n) {
|
|
|
1162
1039
|
}
|
|
1163
1040
|
function Pn(e) {
|
|
1164
1041
|
let t = 0, n = 0, r = e.length;
|
|
1165
|
-
e:
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
e[r] = u.slice(0, a + 1);
|
|
1178
|
-
break e;
|
|
1179
|
-
}
|
|
1042
|
+
e: for (; r--; ) {
|
|
1043
|
+
let u = e[r];
|
|
1044
|
+
if (u === pt) {
|
|
1045
|
+
n++;
|
|
1046
|
+
continue;
|
|
1047
|
+
}
|
|
1048
|
+
for (let a = u.length - 1; a >= 0; a--) {
|
|
1049
|
+
let s = u[a];
|
|
1050
|
+
if (s === " " || s === " ") t++;
|
|
1051
|
+
else {
|
|
1052
|
+
e[r] = u.slice(0, a + 1);
|
|
1053
|
+
break e;
|
|
1180
1054
|
}
|
|
1181
1055
|
}
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
e.push(pt);
|
|
1056
|
+
}
|
|
1057
|
+
if (t > 0 || n > 0) for (e.length = r + 1; n-- > 0; ) e.push(pt);
|
|
1185
1058
|
return t;
|
|
1186
1059
|
}
|
|
1187
1060
|
function $t(e, t, n, r, u, a) {
|
|
1188
|
-
if (n === Number.POSITIVE_INFINITY)
|
|
1189
|
-
return !0;
|
|
1061
|
+
if (n === Number.POSITIVE_INFINITY) return !0;
|
|
1190
1062
|
let s = t.length, o = [e], i = [];
|
|
1191
1063
|
for (; n >= 0; ) {
|
|
1192
1064
|
if (o.length === 0) {
|
|
1193
|
-
if (s === 0)
|
|
1194
|
-
return !0;
|
|
1065
|
+
if (s === 0) return !0;
|
|
1195
1066
|
o.push(t[--s]);
|
|
1196
1067
|
continue;
|
|
1197
1068
|
}
|
|
@@ -1203,8 +1074,7 @@ function $t(e, t, n, r, u, a) {
|
|
|
1203
1074
|
case Pe:
|
|
1204
1075
|
case We: {
|
|
1205
1076
|
let c = D === Pe ? d : d.parts, p = d[vn] ?? 0;
|
|
1206
|
-
for (let y = c.length - 1; y >= p; y--)
|
|
1207
|
-
o.push({ mode: l, doc: c[y] });
|
|
1077
|
+
for (let y = c.length - 1; y >= p; y--) o.push({ mode: l, doc: c[y] });
|
|
1208
1078
|
break;
|
|
1209
1079
|
}
|
|
1210
1080
|
case Ye:
|
|
@@ -1217,8 +1087,7 @@ function $t(e, t, n, r, u, a) {
|
|
|
1217
1087
|
n += Pn(i);
|
|
1218
1088
|
break;
|
|
1219
1089
|
case De: {
|
|
1220
|
-
if (a && d.break)
|
|
1221
|
-
return !1;
|
|
1090
|
+
if (a && d.break) return !1;
|
|
1222
1091
|
let c = d.break ? ae : l, p = d.expandedStates && c === ae ? X(!1, d.expandedStates, -1) : d.contents;
|
|
1223
1092
|
o.push({ mode: c, doc: p });
|
|
1224
1093
|
break;
|
|
@@ -1229,16 +1098,14 @@ function $t(e, t, n, r, u, a) {
|
|
|
1229
1098
|
break;
|
|
1230
1099
|
}
|
|
1231
1100
|
case ie:
|
|
1232
|
-
if (l === ae || d.hard)
|
|
1233
|
-
return !0;
|
|
1101
|
+
if (l === ae || d.hard) return !0;
|
|
1234
1102
|
d.soft || (i.push(" "), n--);
|
|
1235
1103
|
break;
|
|
1236
1104
|
case nt:
|
|
1237
1105
|
r = !0;
|
|
1238
1106
|
break;
|
|
1239
1107
|
case Ue:
|
|
1240
|
-
if (r)
|
|
1241
|
-
return !1;
|
|
1108
|
+
if (r) return !1;
|
|
1242
1109
|
break;
|
|
1243
1110
|
}
|
|
1244
1111
|
}
|
|
@@ -1257,12 +1124,10 @@ function Pu(e, t) {
|
|
|
1257
1124
|
break;
|
|
1258
1125
|
}
|
|
1259
1126
|
case Pe:
|
|
1260
|
-
for (let f = y.length - 1; f >= 0; f--)
|
|
1261
|
-
s.push({ ind: c, mode: p, doc: y[f] });
|
|
1127
|
+
for (let f = y.length - 1; f >= 0; f--) s.push({ ind: c, mode: p, doc: y[f] });
|
|
1262
1128
|
break;
|
|
1263
1129
|
case ft:
|
|
1264
|
-
if (d >= 2)
|
|
1265
|
-
throw new Error("There are too many 'cursor' in doc.");
|
|
1130
|
+
if (d >= 2) throw new Error("There are too many 'cursor' in doc.");
|
|
1266
1131
|
o.push(pt), d++;
|
|
1267
1132
|
break;
|
|
1268
1133
|
case Ye:
|
|
@@ -1284,27 +1149,23 @@ function Pu(e, t) {
|
|
|
1284
1149
|
case ae: {
|
|
1285
1150
|
i = !1;
|
|
1286
1151
|
let f = { ind: c, mode: he, doc: y.contents }, g = r - a, S = l.length > 0;
|
|
1287
|
-
if (!y.break && $t(f, s, g, S, n))
|
|
1288
|
-
s.push(f);
|
|
1152
|
+
if (!y.break && $t(f, s, g, S, n)) s.push(f);
|
|
1289
1153
|
else if (y.expandedStates) {
|
|
1290
1154
|
let b = X(!1, y.expandedStates, -1);
|
|
1291
1155
|
if (y.break) {
|
|
1292
1156
|
s.push({ ind: c, mode: ae, doc: b });
|
|
1293
1157
|
break;
|
|
1294
|
-
} else
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
}
|
|
1306
|
-
} else
|
|
1307
|
-
s.push({ ind: c, mode: ae, doc: y.contents });
|
|
1158
|
+
} else for (let x = 1; x < y.expandedStates.length + 1; x++) if (x >= y.expandedStates.length) {
|
|
1159
|
+
s.push({ ind: c, mode: ae, doc: b });
|
|
1160
|
+
break;
|
|
1161
|
+
} else {
|
|
1162
|
+
let j = y.expandedStates[x], v = { ind: c, mode: he, doc: j };
|
|
1163
|
+
if ($t(v, s, g, S, n)) {
|
|
1164
|
+
s.push(v);
|
|
1165
|
+
break;
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
} else s.push({ ind: c, mode: ae, doc: y.contents });
|
|
1308
1169
|
break;
|
|
1309
1170
|
}
|
|
1310
1171
|
}
|
|
@@ -1312,8 +1173,7 @@ function Pu(e, t) {
|
|
|
1312
1173
|
break;
|
|
1313
1174
|
case We: {
|
|
1314
1175
|
let f = r - a, g = y[vn] ?? 0, { parts: S } = y, b = S.length - g;
|
|
1315
|
-
if (b === 0)
|
|
1316
|
-
break;
|
|
1176
|
+
if (b === 0) break;
|
|
1317
1177
|
let x = S[g + 0], j = S[g + 1], v = { ind: c, mode: he, doc: x }, B = { ind: c, mode: ae, doc: x }, M = $t(v, [], f, l.length > 0, n, !0);
|
|
1318
1178
|
if (b === 1) {
|
|
1319
1179
|
M ? s.push(v) : s.push(B);
|
|
@@ -1350,8 +1210,7 @@ function Pu(e, t) {
|
|
|
1350
1210
|
case ie:
|
|
1351
1211
|
switch (p) {
|
|
1352
1212
|
case he:
|
|
1353
|
-
if (y.hard)
|
|
1354
|
-
i = !0;
|
|
1213
|
+
if (y.hard) i = !0;
|
|
1355
1214
|
else {
|
|
1356
1215
|
y.soft || (o.push(" "), a += 1);
|
|
1357
1216
|
break;
|
|
@@ -1378,8 +1237,7 @@ function Pu(e, t) {
|
|
|
1378
1237
|
let D = o.indexOf(pt);
|
|
1379
1238
|
if (D !== -1) {
|
|
1380
1239
|
let c = o.indexOf(pt, D + 1);
|
|
1381
|
-
if (c === -1)
|
|
1382
|
-
return { formatted: o.filter((g) => g !== pt).join("") };
|
|
1240
|
+
if (c === -1) return { formatted: o.filter((g) => g !== pt).join("") };
|
|
1383
1241
|
let p = o.slice(0, D).join(""), y = o.slice(D + 1, c).join(""), f = o.slice(c + 1).join("");
|
|
1384
1242
|
return { formatted: p + y + f, cursorNodeStart: p.length, cursorNodeText: y };
|
|
1385
1243
|
}
|
|
@@ -1387,8 +1245,7 @@ function Pu(e, t) {
|
|
|
1387
1245
|
}
|
|
1388
1246
|
function gi(e, t, n = 0) {
|
|
1389
1247
|
let r = 0;
|
|
1390
|
-
for (let u = n; u < e.length; ++u)
|
|
1391
|
-
e[u] === " " ? r = r + t - r % t : r++;
|
|
1248
|
+
for (let u = n; u < e.length; ++u) e[u] === " " ? r = r + t - r % t : r++;
|
|
1392
1249
|
return r;
|
|
1393
1250
|
}
|
|
1394
1251
|
var xi = gi;
|
|
@@ -1402,8 +1259,7 @@ function wu(e, t, n) {
|
|
|
1402
1259
|
let { node: r } = e;
|
|
1403
1260
|
if (r.type === "TemplateLiteral" && Bi(e)) {
|
|
1404
1261
|
let i = Si(e, t, n);
|
|
1405
|
-
if (i)
|
|
1406
|
-
return i;
|
|
1262
|
+
if (i) return i;
|
|
1407
1263
|
}
|
|
1408
1264
|
let u = "expressions";
|
|
1409
1265
|
r.type === "TSTemplateLiteralType" && (u = "types");
|
|
@@ -1411,8 +1267,7 @@ function wu(e, t, n) {
|
|
|
1411
1267
|
a.push(we, "`");
|
|
1412
1268
|
let o = 0;
|
|
1413
1269
|
return e.each(({ index: i, node: l }) => {
|
|
1414
|
-
if (a.push(n()), l.tail)
|
|
1415
|
-
return;
|
|
1270
|
+
if (a.push(n()), l.tail) return;
|
|
1416
1271
|
let { tabWidth: d } = t, D = l.value.raw, c = D.includes(`
|
|
1417
1272
|
`) ? Ci(D, d) : o;
|
|
1418
1273
|
o = c;
|
|
@@ -1446,9 +1301,7 @@ function Si(e, t, n) {
|
|
|
1446
1301
|
`) && i.push({ hasLineBreak: !1, cells: [] });
|
|
1447
1302
|
}
|
|
1448
1303
|
let l = Math.max(u.length, ...i.map((c) => c.cells.length)), d = Array.from({ length: l }).fill(0), D = [{ cells: u }, ...i.filter((c) => c.cells.length > 0)];
|
|
1449
|
-
for (let { cells: c } of D.filter((p) => !p.hasLineBreak))
|
|
1450
|
-
for (let [p, y] of c.entries())
|
|
1451
|
-
d[p] = Math.max(d[p], lt(y));
|
|
1304
|
+
for (let { cells: c } of D.filter((p) => !p.hasLineBreak)) for (let [p, y] of c.entries()) d[p] = Math.max(d[p], lt(y));
|
|
1452
1305
|
return s.push(we, "`", A([F, N(F, D.map((c) => N(" | ", c.cells.map((p, y) => c.hasLineBreak ? p : p + " ".repeat(d[y] - lt(p))))))]), F, "`"), s;
|
|
1453
1306
|
}
|
|
1454
1307
|
}
|
|
@@ -1488,13 +1341,11 @@ function Pi(e) {
|
|
|
1488
1341
|
}
|
|
1489
1342
|
async function wi(e, t, n) {
|
|
1490
1343
|
let { node: r } = n, u = r.quasis.map((d) => d.value.raw), a = 0, s = u.reduce((d, D, c) => c === 0 ? D : d + "@prettier-placeholder-" + a++ + "-id" + D, ""), o = await e(s, { parser: "scss" }), i = nr(n, t), l = Ii(o, i);
|
|
1491
|
-
if (!l)
|
|
1492
|
-
throw new Error("Couldn't insert all the expressions");
|
|
1344
|
+
if (!l) throw new Error("Couldn't insert all the expressions");
|
|
1493
1345
|
return ["`", A([F, l]), E, "`"];
|
|
1494
1346
|
}
|
|
1495
1347
|
function Ii(e, t) {
|
|
1496
|
-
if (!J(t))
|
|
1497
|
-
return e;
|
|
1348
|
+
if (!J(t)) return e;
|
|
1498
1349
|
let n = 0, r = Et(zn(e), (u) => typeof u != "string" || !u.includes("@prettier-placeholder") ? u : u.split(/@prettier-placeholder-(\d+)-id/u).map((a, s) => s % 2 === 0 ? He(a) : (n++, t[a])));
|
|
1499
1350
|
return t.length === n ? r : null;
|
|
1500
1351
|
}
|
|
@@ -1508,8 +1359,7 @@ function Cr(e) {
|
|
|
1508
1359
|
return /^[A-Z]/u.test(e.object.name) && e.property.name === "extend";
|
|
1509
1360
|
}
|
|
1510
1361
|
function ji({ parent: e }) {
|
|
1511
|
-
if (!e || e.type !== "TaggedTemplateExpression")
|
|
1512
|
-
return !1;
|
|
1362
|
+
if (!e || e.type !== "TaggedTemplateExpression") return !1;
|
|
1513
1363
|
let t = e.tag.type === "ParenthesizedExpression" ? e.tag.expression : e.tag;
|
|
1514
1364
|
switch (t.type) {
|
|
1515
1365
|
case "MemberExpression":
|
|
@@ -1526,8 +1376,7 @@ function Li({ parent: e, grandparent: t }) {
|
|
|
1526
1376
|
return t?.type === "JSXAttribute" && e.type === "JSXExpressionContainer" && t.name.type === "JSXIdentifier" && t.name.name === "css";
|
|
1527
1377
|
}
|
|
1528
1378
|
function Mi(e) {
|
|
1529
|
-
if (Ni(e) || ji(e) || Li(e) || vi(e))
|
|
1530
|
-
return wi;
|
|
1379
|
+
if (Ni(e) || ji(e) || Li(e) || vi(e)) return wi;
|
|
1531
1380
|
}
|
|
1532
1381
|
var Oi = Mi;
|
|
1533
1382
|
async function Ji(e, t, n) {
|
|
@@ -1535,8 +1384,7 @@ async function Ji(e, t, n) {
|
|
|
1535
1384
|
for (let o = 0; o < u; o++) {
|
|
1536
1385
|
let i = r.quasis[o], l = o === 0, d = o === u - 1, D = i.value.cooked, c = D.split(`
|
|
1537
1386
|
`), p = c.length, y = a[o], f = p > 2 && c[0].trim() === "" && c[1].trim() === "", g = p > 2 && c[p - 1].trim() === "" && c[p - 2].trim() === "", S = c.every((x) => /^\s*(?:#[^\n\r]*)?$/u.test(x));
|
|
1538
|
-
if (!d && /#[^\n\r]*$/u.test(c[p - 1]))
|
|
1539
|
-
return null;
|
|
1387
|
+
if (!d && /#[^\n\r]*$/u.test(c[p - 1])) return null;
|
|
1540
1388
|
let b = null;
|
|
1541
1389
|
S ? b = qi(c) : b = await e(D, { parser: "graphql" }), b ? (b = Iu(b, !1), !l && f && s.push(""), s.push(b), !d && g && s.push("")) : !l && !d && f && s.push(""), y && s.push(y);
|
|
1542
1390
|
}
|
|
@@ -1544,16 +1392,14 @@ async function Ji(e, t, n) {
|
|
|
1544
1392
|
}
|
|
1545
1393
|
function qi(e) {
|
|
1546
1394
|
let t = [], n = !1, r = e.map((u) => u.trim());
|
|
1547
|
-
for (let [u, a] of r.entries())
|
|
1548
|
-
a !== "" && (r[u - 1] === "" && n ? t.push([F, a]) : t.push(a), n = !0);
|
|
1395
|
+
for (let [u, a] of r.entries()) a !== "" && (r[u - 1] === "" && n ? t.push([F, a]) : t.push(a), n = !0);
|
|
1549
1396
|
return t.length === 0 ? null : N(F, t);
|
|
1550
1397
|
}
|
|
1551
1398
|
function _i({ node: e, parent: t }) {
|
|
1552
1399
|
return ju({ 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");
|
|
1553
1400
|
}
|
|
1554
1401
|
function Xi(e) {
|
|
1555
|
-
if (_i(e))
|
|
1556
|
-
return Ji;
|
|
1402
|
+
if (_i(e)) return Ji;
|
|
1557
1403
|
}
|
|
1558
1404
|
var $i = Xi, fn = 0;
|
|
1559
1405
|
async function Lu(e, t, n, r, u) {
|
|
@@ -1562,8 +1408,7 @@ async function Lu(e, t, n, r, u) {
|
|
|
1562
1408
|
let o = (S) => `PRETTIER_HTML_PLACEHOLDER_${S}_${s}_IN_JS`, i = a.quasis.map((S, b, x) => b === x.length - 1 ? S.value.cooked : S.value.cooked + o(b)).join(""), l = nr(r, n), d = new RegExp(o(String.raw`(\d+)`), "gu"), D = 0, c = await t(i, { parser: e, __onHtmlRoot(S) {
|
|
1563
1409
|
D = S.children.length;
|
|
1564
1410
|
} }), p = Et(c, (S) => {
|
|
1565
|
-
if (typeof S != "string")
|
|
1566
|
-
return S;
|
|
1411
|
+
if (typeof S != "string") return S;
|
|
1567
1412
|
let b = [], x = S.split(d);
|
|
1568
1413
|
for (let j = 0; j < x.length; j++) {
|
|
1569
1414
|
let v = x[j];
|
|
@@ -1583,10 +1428,8 @@ function Ri(e) {
|
|
|
1583
1428
|
}
|
|
1584
1429
|
var Wi = Lu.bind(void 0, "html"), Ui = Lu.bind(void 0, "angular");
|
|
1585
1430
|
function Gi(e) {
|
|
1586
|
-
if (Ri(e))
|
|
1587
|
-
|
|
1588
|
-
if (ki(e))
|
|
1589
|
-
return Ui;
|
|
1431
|
+
if (Ri(e)) return Wi;
|
|
1432
|
+
if (ki(e)) return Ui;
|
|
1590
1433
|
}
|
|
1591
1434
|
var Vi = Gi;
|
|
1592
1435
|
async function Ki(e, t, n) {
|
|
@@ -1600,8 +1443,7 @@ function Hi(e) {
|
|
|
1600
1443
|
return t === null ? "" : t[1];
|
|
1601
1444
|
}
|
|
1602
1445
|
function zi(e) {
|
|
1603
|
-
if (Qi(e))
|
|
1604
|
-
return Ki;
|
|
1446
|
+
if (Qi(e)) return Ki;
|
|
1605
1447
|
}
|
|
1606
1448
|
function Qi({ node: e, parent: t }) {
|
|
1607
1449
|
return t?.type === "TaggedTemplateExpression" && e.quasis.length === 1 && t.tag.type === "Identifier" && (t.tag.name === "md" || t.tag.name === "markdown");
|
|
@@ -1609,15 +1451,12 @@ function Qi({ node: e, parent: t }) {
|
|
|
1609
1451
|
var Yi = zi;
|
|
1610
1452
|
function Zi(e) {
|
|
1611
1453
|
let { node: t } = e;
|
|
1612
|
-
if (t.type !== "TemplateLiteral" || ep(t))
|
|
1613
|
-
return;
|
|
1454
|
+
if (t.type !== "TemplateLiteral" || ep(t)) return;
|
|
1614
1455
|
let n;
|
|
1615
|
-
for (let r of [Oi, $i, Vi, Yi])
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
return a && jt({ embed: !0, ...a.label }, a);
|
|
1620
|
-
};
|
|
1456
|
+
for (let r of [Oi, $i, Vi, Yi]) if (n = r(e), !!n) return t.quasis.length === 1 && t.quasis[0].value.raw.trim() === "" ? "``" : async (...u) => {
|
|
1457
|
+
let a = await n(...u);
|
|
1458
|
+
return a && jt({ embed: !0, ...a.label }, a);
|
|
1459
|
+
};
|
|
1621
1460
|
}
|
|
1622
1461
|
function ep({ quasis: e }) {
|
|
1623
1462
|
return e.some(({ value: { cooked: t } }) => t === null);
|
|
@@ -1636,8 +1475,7 @@ function pp(e) {
|
|
|
1636
1475
|
`;
|
|
1637
1476
|
e = H(!1, e.replace(rp, "").replace(np, ""), sp, "$1");
|
|
1638
1477
|
let n = "";
|
|
1639
|
-
for (; n !== e; )
|
|
1640
|
-
n = e, e = H(!1, e, ap, `${t}$1 $2${t}`);
|
|
1478
|
+
for (; n !== e; ) n = e, e = H(!1, e, ap, `${t}$1 $2${t}`);
|
|
1641
1479
|
e = e.replace(Tr, "").trimEnd();
|
|
1642
1480
|
let r = /* @__PURE__ */ Object.create(null), u = H(!1, e, Sr, "").replace(Tr, "").trimEnd(), a;
|
|
1643
1481
|
for (; a = Sr.exec(e); ) {
|
|
@@ -1645,8 +1483,7 @@ function pp(e) {
|
|
|
1645
1483
|
if (typeof r[a[1]] == "string" || Array.isArray(r[a[1]])) {
|
|
1646
1484
|
let o = r[a[1]];
|
|
1647
1485
|
r[a[1]] = [...Ou, ...Array.isArray(o) ? o : [o], s];
|
|
1648
|
-
} else
|
|
1649
|
-
r[a[1]] = s;
|
|
1486
|
+
} else r[a[1]] = s;
|
|
1650
1487
|
}
|
|
1651
1488
|
return { comments: u, pragmas: r };
|
|
1652
1489
|
}
|
|
@@ -1654,8 +1491,7 @@ function lp({ comments: e = "", pragmas: t = {} }) {
|
|
|
1654
1491
|
let n = `
|
|
1655
1492
|
`, r = "/**", u = " *", a = " */", s = Object.keys(t), o = s.flatMap((l) => br(l, t[l])).map((l) => `${u} ${l}${n}`).join("");
|
|
1656
1493
|
if (!e) {
|
|
1657
|
-
if (s.length === 0)
|
|
1658
|
-
return "";
|
|
1494
|
+
if (s.length === 0) return "";
|
|
1659
1495
|
if (s.length === 1 && !Array.isArray(t[s[0]])) {
|
|
1660
1496
|
let l = t[s[0]];
|
|
1661
1497
|
return `${r} ${br(s[0], l)[0]}${a}`;
|
|
@@ -1669,8 +1505,7 @@ function br(e, t) {
|
|
|
1669
1505
|
}
|
|
1670
1506
|
var cp = "format";
|
|
1671
1507
|
function Dp(e) {
|
|
1672
|
-
if (!e.startsWith("#!"))
|
|
1673
|
-
return "";
|
|
1508
|
+
if (!e.startsWith("#!")) return "";
|
|
1674
1509
|
let t = e.indexOf(`
|
|
1675
1510
|
`);
|
|
1676
1511
|
return t === -1 ? e : e.slice(0, t);
|
|
@@ -1692,93 +1527,76 @@ function mp(e) {
|
|
|
1692
1527
|
`) + a;
|
|
1693
1528
|
}
|
|
1694
1529
|
function fp(e, t) {
|
|
1695
|
-
let { originalText: n, [Symbol.for("comments")]: r, locStart: u, locEnd: a, [Symbol.for("printedComments")]: s } = t, { node: o } = e, i = u(o), l = a(o);
|
|
1696
|
-
for (let d of r)
|
|
1697
|
-
u(d) >= i && a(d) <= l && s.add(d);
|
|
1530
|
+
let { originalText: n, [/* @__PURE__ */ Symbol.for("comments")]: r, locStart: u, locEnd: a, [/* @__PURE__ */ Symbol.for("printedComments")]: s } = t, { node: o } = e, i = u(o), l = a(o);
|
|
1531
|
+
for (let d of r) u(d) >= i && a(d) <= l && s.add(d);
|
|
1698
1532
|
return n.slice(i, l);
|
|
1699
1533
|
}
|
|
1700
1534
|
var Ep = fp;
|
|
1701
1535
|
function In(e, t) {
|
|
1702
1536
|
var n, r, u, a, s, o, i, l, d;
|
|
1703
|
-
if (e.isRoot)
|
|
1704
|
-
return !1;
|
|
1537
|
+
if (e.isRoot) return !1;
|
|
1705
1538
|
let { node: D, key: c, parent: p } = e;
|
|
1706
|
-
if (t.__isInHtmlInterpolation && !t.bracketSpacing && xp(D) && St(e))
|
|
1707
|
-
|
|
1708
|
-
if (Fp(D))
|
|
1709
|
-
return !1;
|
|
1539
|
+
if (t.__isInHtmlInterpolation && !t.bracketSpacing && xp(D) && St(e)) return !0;
|
|
1540
|
+
if (Fp(D)) return !1;
|
|
1710
1541
|
if (D.type === "Identifier") {
|
|
1711
|
-
if ((n = D.extra) != null && n.parenthesized && /^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/u.test(D.name) || c === "left" && (D.name === "async" && !p.await || D.name === "let") && p.type === "ForOfStatement")
|
|
1712
|
-
return !0;
|
|
1542
|
+
if ((n = D.extra) != null && n.parenthesized && /^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/u.test(D.name) || c === "left" && (D.name === "async" && !p.await || D.name === "let") && p.type === "ForOfStatement") return !0;
|
|
1713
1543
|
if (D.name === "let") {
|
|
1714
1544
|
let y = (r = e.findAncestor((f) => f.type === "ForOfStatement")) == null ? void 0 : r.left;
|
|
1715
|
-
if (y && te(y, (f) => f === D))
|
|
1716
|
-
return !0;
|
|
1545
|
+
if (y && te(y, (f) => f === D)) return !0;
|
|
1717
1546
|
}
|
|
1718
1547
|
if (c === "object" && D.name === "let" && p.type === "MemberExpression" && p.computed && !p.optional) {
|
|
1719
1548
|
let y = e.findAncestor((g) => g.type === "ExpressionStatement" || g.type === "ForStatement" || g.type === "ForInStatement"), f = y ? y.type === "ExpressionStatement" ? y.expression : y.type === "ForStatement" ? y.init : y.left : void 0;
|
|
1720
|
-
if (f && te(f, (g) => g === D))
|
|
1721
|
-
return !0;
|
|
1549
|
+
if (f && te(f, (g) => g === D)) return !0;
|
|
1722
1550
|
}
|
|
1723
|
-
if (c === "expression")
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
if (y !== p && y.type === "ExpressionStatement")
|
|
1736
|
-
return !0;
|
|
1737
|
-
}
|
|
1551
|
+
if (c === "expression") switch (D.name) {
|
|
1552
|
+
case "await":
|
|
1553
|
+
case "interface":
|
|
1554
|
+
case "module":
|
|
1555
|
+
case "using":
|
|
1556
|
+
case "yield":
|
|
1557
|
+
case "let":
|
|
1558
|
+
case "component":
|
|
1559
|
+
case "hook":
|
|
1560
|
+
case "type": {
|
|
1561
|
+
let y = e.findAncestor((f) => !Ce(f));
|
|
1562
|
+
if (y !== p && y.type === "ExpressionStatement") return !0;
|
|
1738
1563
|
}
|
|
1564
|
+
}
|
|
1739
1565
|
return !1;
|
|
1740
1566
|
}
|
|
1741
1567
|
if (D.type === "ObjectExpression" || D.type === "FunctionExpression" || D.type === "ClassExpression" || D.type === "DoExpression") {
|
|
1742
1568
|
let y = (u = e.findAncestor((f) => f.type === "ExpressionStatement")) == null ? void 0 : u.expression;
|
|
1743
|
-
if (y && te(y, (f) => f === D))
|
|
1744
|
-
return !0;
|
|
1569
|
+
if (y && te(y, (f) => f === D)) return !0;
|
|
1745
1570
|
}
|
|
1746
1571
|
if (D.type === "ObjectExpression") {
|
|
1747
1572
|
let y = (a = e.findAncestor((f) => f.type === "ArrowFunctionExpression")) == null ? void 0 : a.body;
|
|
1748
|
-
if (y && y.type !== "SequenceExpression" && y.type !== "AssignmentExpression" && te(y, (f) => f === D))
|
|
1749
|
-
return !0;
|
|
1573
|
+
if (y && y.type !== "SequenceExpression" && y.type !== "AssignmentExpression" && te(y, (f) => f === D)) return !0;
|
|
1750
1574
|
}
|
|
1751
1575
|
switch (p.type) {
|
|
1752
1576
|
case "ParenthesizedExpression":
|
|
1753
1577
|
return !1;
|
|
1754
1578
|
case "ClassDeclaration":
|
|
1755
1579
|
case "ClassExpression":
|
|
1756
|
-
if (c === "superClass" && (D.type === "ArrowFunctionExpression" || D.type === "AssignmentExpression" || D.type === "AwaitExpression" || D.type === "BinaryExpression" || D.type === "ConditionalExpression" || D.type === "LogicalExpression" || D.type === "NewExpression" || D.type === "ObjectExpression" || D.type === "SequenceExpression" || D.type === "TaggedTemplateExpression" || D.type === "UnaryExpression" || D.type === "UpdateExpression" || D.type === "YieldExpression" || D.type === "TSNonNullExpression" || D.type === "ClassExpression" && J(D.decorators)))
|
|
1757
|
-
return !0;
|
|
1580
|
+
if (c === "superClass" && (D.type === "ArrowFunctionExpression" || D.type === "AssignmentExpression" || D.type === "AwaitExpression" || D.type === "BinaryExpression" || D.type === "ConditionalExpression" || D.type === "LogicalExpression" || D.type === "NewExpression" || D.type === "ObjectExpression" || D.type === "SequenceExpression" || D.type === "TaggedTemplateExpression" || D.type === "UnaryExpression" || D.type === "UpdateExpression" || D.type === "YieldExpression" || D.type === "TSNonNullExpression" || D.type === "ClassExpression" && J(D.decorators))) return !0;
|
|
1758
1581
|
break;
|
|
1759
1582
|
case "ExportDefaultDeclaration":
|
|
1760
1583
|
return Ju(e, t) || D.type === "SequenceExpression";
|
|
1761
1584
|
case "Decorator":
|
|
1762
|
-
if (c === "expression" && !Cp(D))
|
|
1763
|
-
return !0;
|
|
1585
|
+
if (c === "expression" && !Cp(D)) return !0;
|
|
1764
1586
|
break;
|
|
1765
1587
|
case "TypeAnnotation":
|
|
1766
|
-
if (e.match(void 0, void 0, (y, f) => f === "returnType" && y.type === "ArrowFunctionExpression") && gp(D))
|
|
1767
|
-
return !0;
|
|
1588
|
+
if (e.match(void 0, void 0, (y, f) => f === "returnType" && y.type === "ArrowFunctionExpression") && gp(D)) return !0;
|
|
1768
1589
|
break;
|
|
1769
1590
|
case "BinaryExpression":
|
|
1770
|
-
if (c === "left" && (p.operator === "in" || p.operator === "instanceof") && D.type === "UnaryExpression")
|
|
1771
|
-
return !0;
|
|
1591
|
+
if (c === "left" && (p.operator === "in" || p.operator === "instanceof") && D.type === "UnaryExpression") return !0;
|
|
1772
1592
|
break;
|
|
1773
1593
|
case "VariableDeclarator":
|
|
1774
|
-
if (c === "init" && e.match(void 0, void 0, (y, f) => f === "declarations" && y.type === "VariableDeclaration", (y, f) => f === "left" && y.type === "ForInStatement"))
|
|
1775
|
-
return !0;
|
|
1594
|
+
if (c === "init" && e.match(void 0, void 0, (y, f) => f === "declarations" && y.type === "VariableDeclaration", (y, f) => f === "left" && y.type === "ForInStatement")) return !0;
|
|
1776
1595
|
break;
|
|
1777
1596
|
}
|
|
1778
1597
|
switch (D.type) {
|
|
1779
1598
|
case "UpdateExpression":
|
|
1780
|
-
if (p.type === "UnaryExpression")
|
|
1781
|
-
return D.prefix && (D.operator === "++" && p.operator === "+" || D.operator === "--" && p.operator === "-");
|
|
1599
|
+
if (p.type === "UnaryExpression") return D.prefix && (D.operator === "++" && p.operator === "+" || D.operator === "--" && p.operator === "-");
|
|
1782
1600
|
case "UnaryExpression":
|
|
1783
1601
|
switch (p.type) {
|
|
1784
1602
|
case "UnaryExpression":
|
|
@@ -1802,12 +1620,10 @@ function In(e, t) {
|
|
|
1802
1620
|
return !1;
|
|
1803
1621
|
}
|
|
1804
1622
|
case "BinaryExpression":
|
|
1805
|
-
if (p.type === "UpdateExpression" || D.operator === "in" && Ap(e))
|
|
1806
|
-
return !0;
|
|
1623
|
+
if (p.type === "UpdateExpression" || D.operator === "in" && Ap(e)) return !0;
|
|
1807
1624
|
if (D.operator === "|>" && (s = D.extra) != null && s.parenthesized) {
|
|
1808
1625
|
let y = e.grandparent;
|
|
1809
|
-
if (y.type === "BinaryExpression" && y.operator === "|>")
|
|
1810
|
-
return !0;
|
|
1626
|
+
if (y.type === "BinaryExpression" && y.operator === "|>") return !0;
|
|
1811
1627
|
}
|
|
1812
1628
|
case "TSTypeAssertion":
|
|
1813
1629
|
case "TSAsExpression":
|
|
@@ -1849,12 +1665,10 @@ function In(e, t) {
|
|
|
1849
1665
|
case "AssignmentPattern":
|
|
1850
1666
|
return c === "left" && (D.type === "TSTypeAssertion" || Ce(D));
|
|
1851
1667
|
case "LogicalExpression":
|
|
1852
|
-
if (D.type === "LogicalExpression")
|
|
1853
|
-
return p.operator !== D.operator;
|
|
1668
|
+
if (D.type === "LogicalExpression") return p.operator !== D.operator;
|
|
1854
1669
|
case "BinaryExpression": {
|
|
1855
1670
|
let { operator: y, type: f } = D;
|
|
1856
|
-
if (!y && f !== "TSTypeAssertion")
|
|
1857
|
-
return !0;
|
|
1671
|
+
if (!y && f !== "TSTypeAssertion") return !0;
|
|
1858
1672
|
let g = Vt(y), S = p.operator, b = Vt(S);
|
|
1859
1673
|
return b > g || c === "right" && b === g || b === g && !Vn(S, y) ? !0 : b < g && y === "%" ? S === "+" || S === "-" : !!oo(S);
|
|
1860
1674
|
}
|
|
@@ -1864,8 +1678,7 @@ function In(e, t) {
|
|
|
1864
1678
|
case "SequenceExpression":
|
|
1865
1679
|
return p.type !== "ForStatement";
|
|
1866
1680
|
case "YieldExpression":
|
|
1867
|
-
if (p.type === "AwaitExpression" || p.type === "TSTypeAssertion")
|
|
1868
|
-
return !0;
|
|
1681
|
+
if (p.type === "AwaitExpression" || p.type === "TSTypeAssertion") return !0;
|
|
1869
1682
|
case "AwaitExpression":
|
|
1870
1683
|
switch (p.type) {
|
|
1871
1684
|
case "TaggedTemplateExpression":
|
|
@@ -1895,28 +1708,22 @@ function In(e, t) {
|
|
|
1895
1708
|
return !1;
|
|
1896
1709
|
}
|
|
1897
1710
|
case "TSFunctionType":
|
|
1898
|
-
if (e.match((y) => y.type === "TSFunctionType", (y, f) => f === "typeAnnotation" && y.type === "TSTypeAnnotation", (y, f) => f === "returnType" && y.type === "ArrowFunctionExpression"))
|
|
1899
|
-
return !0;
|
|
1711
|
+
if (e.match((y) => y.type === "TSFunctionType", (y, f) => f === "typeAnnotation" && y.type === "TSTypeAnnotation", (y, f) => f === "returnType" && y.type === "ArrowFunctionExpression")) return !0;
|
|
1900
1712
|
case "TSConditionalType":
|
|
1901
1713
|
case "TSConstructorType":
|
|
1902
1714
|
case "ConditionalTypeAnnotation":
|
|
1903
|
-
if (c === "extendsType" && Re(D) && p.type === D.type || c === "checkType" && Re(p))
|
|
1904
|
-
return !0;
|
|
1715
|
+
if (c === "extendsType" && Re(D) && p.type === D.type || c === "checkType" && Re(p)) return !0;
|
|
1905
1716
|
if (c === "extendsType" && p.type === "TSConditionalType") {
|
|
1906
1717
|
let { typeAnnotation: y } = D.returnType || D.typeAnnotation;
|
|
1907
|
-
if (y.type === "TSTypePredicate" && y.typeAnnotation && (y = y.typeAnnotation.typeAnnotation), y.type === "TSInferType" && y.typeParameter.constraint)
|
|
1908
|
-
return !0;
|
|
1718
|
+
if (y.type === "TSTypePredicate" && y.typeAnnotation && (y = y.typeAnnotation.typeAnnotation), y.type === "TSInferType" && y.typeParameter.constraint) return !0;
|
|
1909
1719
|
}
|
|
1910
1720
|
case "TSUnionType":
|
|
1911
1721
|
case "TSIntersectionType":
|
|
1912
|
-
if (($e(p) || Kn(p)) && p.types.length > 1 && (!D.types || D.types.length > 1))
|
|
1913
|
-
return !0;
|
|
1722
|
+
if (($e(p) || Kn(p)) && p.types.length > 1 && (!D.types || D.types.length > 1)) return !0;
|
|
1914
1723
|
case "TSInferType":
|
|
1915
1724
|
if (D.type === "TSInferType") {
|
|
1916
|
-
if (p.type === "TSRestType")
|
|
1917
|
-
|
|
1918
|
-
if (c === "types" && (p.type === "TSUnionType" || p.type === "TSIntersectionType") && D.typeParameter.type === "TSTypeParameter" && D.typeParameter.constraint)
|
|
1919
|
-
return !0;
|
|
1725
|
+
if (p.type === "TSRestType") return !1;
|
|
1726
|
+
if (c === "types" && (p.type === "TSUnionType" || p.type === "TSIntersectionType") && D.typeParameter.type === "TSTypeParameter" && D.typeParameter.constraint) return !0;
|
|
1920
1727
|
}
|
|
1921
1728
|
case "TSTypeOperator":
|
|
1922
1729
|
return p.type === "TSArrayType" || p.type === "TSOptionalType" || p.type === "TSRestType" || c === "objectType" && p.type === "TSIndexedAccessType" || p.type === "TSTypeOperator" || p.type === "TSTypeAnnotation" && e.grandparent.type.startsWith("TSJSDoc");
|
|
@@ -1936,10 +1743,8 @@ function In(e, t) {
|
|
|
1936
1743
|
return p.type === "ArrayTypeAnnotation" || c === "objectType" && (p.type === "IndexedAccessType" || p.type === "OptionalIndexedAccessType");
|
|
1937
1744
|
case "ComponentTypeAnnotation":
|
|
1938
1745
|
case "FunctionTypeAnnotation": {
|
|
1939
|
-
if (D.type === "ComponentTypeAnnotation" && (D.rendersType === null || D.rendersType === void 0))
|
|
1940
|
-
|
|
1941
|
-
if (e.match(void 0, (f, g) => g === "typeAnnotation" && f.type === "TypeAnnotation", (f, g) => g === "returnType" && f.type === "ArrowFunctionExpression") || e.match(void 0, (f, g) => g === "typeAnnotation" && f.type === "TypePredicate", (f, g) => g === "typeAnnotation" && f.type === "TypeAnnotation", (f, g) => g === "returnType" && f.type === "ArrowFunctionExpression"))
|
|
1942
|
-
return !0;
|
|
1746
|
+
if (D.type === "ComponentTypeAnnotation" && (D.rendersType === null || D.rendersType === void 0)) return !1;
|
|
1747
|
+
if (e.match(void 0, (f, g) => g === "typeAnnotation" && f.type === "TypeAnnotation", (f, g) => g === "returnType" && f.type === "ArrowFunctionExpression") || e.match(void 0, (f, g) => g === "typeAnnotation" && f.type === "TypePredicate", (f, g) => g === "typeAnnotation" && f.type === "TypeAnnotation", (f, g) => g === "returnType" && f.type === "ArrowFunctionExpression")) return !0;
|
|
1943
1748
|
let y = p.type === "NullableTypeAnnotation" ? e.grandparent : p;
|
|
1944
1749
|
return y.type === "UnionTypeAnnotation" || y.type === "IntersectionTypeAnnotation" || y.type === "ArrayTypeAnnotation" || c === "objectType" && (y.type === "IndexedAccessType" || y.type === "OptionalIndexedAccessType") || c === "checkType" && p.type === "ConditionalTypeAnnotation" || c === "extendsType" && p.type === "ConditionalTypeAnnotation" && ((o = D.returnType) == null ? void 0 : o.type) === "InferTypeAnnotation" && ((i = D.returnType) == null ? void 0 : i.typeParameter.bound) || y.type === "NullableTypeAnnotation" || p.type === "FunctionTypeParam" && p.name === null && Z(D).some((f) => {
|
|
1945
1750
|
var g;
|
|
@@ -2031,41 +1836,34 @@ function In(e, t) {
|
|
|
2031
1836
|
return !1;
|
|
2032
1837
|
}
|
|
2033
1838
|
case "ClassExpression":
|
|
2034
|
-
|
|
2035
|
-
case "NewExpression":
|
|
2036
|
-
return c === "callee";
|
|
2037
|
-
default:
|
|
2038
|
-
return !1;
|
|
2039
|
-
}
|
|
1839
|
+
return p.type === "NewExpression" ? c === "callee" : !1;
|
|
2040
1840
|
case "OptionalMemberExpression":
|
|
2041
1841
|
case "OptionalCallExpression":
|
|
2042
1842
|
case "CallExpression":
|
|
2043
1843
|
case "MemberExpression":
|
|
2044
|
-
if (hp(e))
|
|
2045
|
-
return !0;
|
|
1844
|
+
if (hp(e)) return !0;
|
|
2046
1845
|
case "TaggedTemplateExpression":
|
|
2047
1846
|
case "TSNonNullExpression":
|
|
2048
1847
|
if (c === "callee" && (p.type === "BindExpression" || p.type === "NewExpression")) {
|
|
2049
1848
|
let y = D;
|
|
2050
|
-
for (; y; )
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
}
|
|
1849
|
+
for (; y; ) switch (y.type) {
|
|
1850
|
+
case "CallExpression":
|
|
1851
|
+
case "OptionalCallExpression":
|
|
1852
|
+
return !0;
|
|
1853
|
+
case "MemberExpression":
|
|
1854
|
+
case "OptionalMemberExpression":
|
|
1855
|
+
case "BindExpression":
|
|
1856
|
+
y = y.object;
|
|
1857
|
+
break;
|
|
1858
|
+
case "TaggedTemplateExpression":
|
|
1859
|
+
y = y.tag;
|
|
1860
|
+
break;
|
|
1861
|
+
case "TSNonNullExpression":
|
|
1862
|
+
y = y.expression;
|
|
1863
|
+
break;
|
|
1864
|
+
default:
|
|
1865
|
+
return !1;
|
|
1866
|
+
}
|
|
2069
1867
|
}
|
|
2070
1868
|
return !1;
|
|
2071
1869
|
case "BindExpression":
|
|
@@ -2085,8 +1883,7 @@ function Ap(e) {
|
|
|
2085
1883
|
let t = 0, { node: n } = e;
|
|
2086
1884
|
for (; n; ) {
|
|
2087
1885
|
let r = e.getParentNode(t++);
|
|
2088
|
-
if (r?.type === "ForStatement" && r.init === n)
|
|
2089
|
-
return !0;
|
|
1886
|
+
if (r?.type === "ForStatement" && r.init === n) return !0;
|
|
2090
1887
|
n = r;
|
|
2091
1888
|
}
|
|
2092
1889
|
return !1;
|
|
@@ -2101,25 +1898,20 @@ function St(e) {
|
|
|
2101
1898
|
let { parent: t, key: n } = e;
|
|
2102
1899
|
switch (t.type) {
|
|
2103
1900
|
case "NGPipeExpression":
|
|
2104
|
-
if (n === "arguments" && e.isLast)
|
|
2105
|
-
return e.callParent(St);
|
|
1901
|
+
if (n === "arguments" && e.isLast) return e.callParent(St);
|
|
2106
1902
|
break;
|
|
2107
1903
|
case "ObjectProperty":
|
|
2108
|
-
if (n === "value")
|
|
2109
|
-
return e.callParent(() => e.key === "properties" && e.isLast);
|
|
1904
|
+
if (n === "value") return e.callParent(() => e.key === "properties" && e.isLast);
|
|
2110
1905
|
break;
|
|
2111
1906
|
case "BinaryExpression":
|
|
2112
1907
|
case "LogicalExpression":
|
|
2113
|
-
if (n === "right")
|
|
2114
|
-
return e.callParent(St);
|
|
1908
|
+
if (n === "right") return e.callParent(St);
|
|
2115
1909
|
break;
|
|
2116
1910
|
case "ConditionalExpression":
|
|
2117
|
-
if (n === "alternate")
|
|
2118
|
-
return e.callParent(St);
|
|
1911
|
+
if (n === "alternate") return e.callParent(St);
|
|
2119
1912
|
break;
|
|
2120
1913
|
case "UnaryExpression":
|
|
2121
|
-
if (t.prefix)
|
|
2122
|
-
return e.callParent(St);
|
|
1914
|
+
if (t.prefix) return e.callParent(St);
|
|
2123
1915
|
break;
|
|
2124
1916
|
}
|
|
2125
1917
|
return !1;
|
|
@@ -2155,8 +1947,7 @@ function Bp(e, t) {
|
|
|
2155
1947
|
if ((n = a.isBlockComment) != null && n.call(a, r)) {
|
|
2156
1948
|
let d = pe(s, i(r)) ? pe(s, o(r), { backwards: !0 }) ? F : C : " ";
|
|
2157
1949
|
u.push(d);
|
|
2158
|
-
} else
|
|
2159
|
-
u.push(F);
|
|
1950
|
+
} else u.push(F);
|
|
2160
1951
|
let l = Dt(s, ct(s, i(r)));
|
|
2161
1952
|
return l !== !1 && pe(s, l) && u.push(F), u;
|
|
2162
1953
|
}
|
|
@@ -2171,28 +1962,23 @@ function vp(e, t, n) {
|
|
|
2171
1962
|
}
|
|
2172
1963
|
function $(e, t, n = {}) {
|
|
2173
1964
|
let { node: r } = e;
|
|
2174
|
-
if (!J(r?.comments))
|
|
2175
|
-
return "";
|
|
1965
|
+
if (!J(r?.comments)) return "";
|
|
2176
1966
|
let { indent: u = !1, marker: a, filter: s = bp } = n, o = [];
|
|
2177
1967
|
if (e.each(({ node: l }) => {
|
|
2178
1968
|
l.leading || l.trailing || l.marker !== a || !s(l) || o.push(rr(e, t));
|
|
2179
|
-
}, "comments"), o.length === 0)
|
|
2180
|
-
return "";
|
|
1969
|
+
}, "comments"), o.length === 0) return "";
|
|
2181
1970
|
let i = N(F, o);
|
|
2182
1971
|
return u ? A([F, i]) : i;
|
|
2183
1972
|
}
|
|
2184
1973
|
function qu(e, t) {
|
|
2185
1974
|
let n = e.node;
|
|
2186
|
-
if (!n)
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
if ((n.comments || []).filter((o) => !r.has(o)).length === 0)
|
|
2190
|
-
return { leading: "", trailing: "" };
|
|
1975
|
+
if (!n) return {};
|
|
1976
|
+
let r = t[/* @__PURE__ */ Symbol.for("printedComments")];
|
|
1977
|
+
if ((n.comments || []).filter((o) => !r.has(o)).length === 0) return { leading: "", trailing: "" };
|
|
2191
1978
|
let u = [], a = [], s;
|
|
2192
1979
|
return e.each(() => {
|
|
2193
1980
|
let o = e.node;
|
|
2194
|
-
if (r != null && r.has(o))
|
|
2195
|
-
return;
|
|
1981
|
+
if (r != null && r.has(o)) return;
|
|
2196
1982
|
let { leading: i, trailing: l } = o;
|
|
2197
1983
|
i ? u.push(Bp(e, t)) : l && (s = vp(e, t, s), a.push(s.doc));
|
|
2198
1984
|
}, "comments"), { leading: u, trailing: a };
|
|
@@ -2208,8 +1994,7 @@ var kp = class extends Error {
|
|
|
2208
1994
|
}
|
|
2209
1995
|
}, At = kp;
|
|
2210
1996
|
function Pp(e) {
|
|
2211
|
-
if (typeof e != "string")
|
|
2212
|
-
throw new TypeError("Expected a string");
|
|
1997
|
+
if (typeof e != "string") throw new TypeError("Expected a string");
|
|
2213
1998
|
return e.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
|
|
2214
1999
|
}
|
|
2215
2000
|
var fe, wp = class {
|
|
@@ -2218,14 +2003,12 @@ var fe, wp = class {
|
|
|
2218
2003
|
}
|
|
2219
2004
|
getLeadingWhitespaceCount(e) {
|
|
2220
2005
|
let t = Je(this, fe), n = 0;
|
|
2221
|
-
for (let r = 0; r < e.length && t.has(e.charAt(r)); r++)
|
|
2222
|
-
n++;
|
|
2006
|
+
for (let r = 0; r < e.length && t.has(e.charAt(r)); r++) n++;
|
|
2223
2007
|
return n;
|
|
2224
2008
|
}
|
|
2225
2009
|
getTrailingWhitespaceCount(e) {
|
|
2226
2010
|
let t = Je(this, fe), n = 0;
|
|
2227
|
-
for (let r = e.length - 1; r >= 0 && t.has(e.charAt(r)); r--)
|
|
2228
|
-
n++;
|
|
2011
|
+
for (let r = e.length - 1; r >= 0 && t.has(e.charAt(r)); r--) n++;
|
|
2229
2012
|
return n;
|
|
2230
2013
|
}
|
|
2231
2014
|
getLeadingWhitespace(e) {
|
|
@@ -2276,21 +2059,17 @@ var Ip = wp, Wt = new Ip(`
|
|
|
2276
2059
|
function Np(e, t, n) {
|
|
2277
2060
|
var r, u, a, s, o;
|
|
2278
2061
|
let { node: i } = e;
|
|
2279
|
-
if (i.type === "JSXElement" && Hp(i))
|
|
2280
|
-
return [n("openingElement"), n("closingElement")];
|
|
2062
|
+
if (i.type === "JSXElement" && Hp(i)) return [n("openingElement"), n("closingElement")];
|
|
2281
2063
|
let l = i.type === "JSXElement" ? n("openingElement") : n("openingFragment"), d = i.type === "JSXElement" ? n("closingElement") : n("closingFragment");
|
|
2282
|
-
if (i.children.length === 1 && i.children[0].type === "JSXExpressionContainer" && (i.children[0].expression.type === "TemplateLiteral" || i.children[0].expression.type === "TaggedTemplateExpression"))
|
|
2283
|
-
return [l, ...e.map(n, "children"), d];
|
|
2064
|
+
if (i.children.length === 1 && i.children[0].type === "JSXExpressionContainer" && (i.children[0].expression.type === "TemplateLiteral" || i.children[0].expression.type === "TaggedTemplateExpression")) return [l, ...e.map(n, "children"), d];
|
|
2284
2065
|
i.children = i.children.map((k) => zp(k) ? { type: "JSXText", value: " ", raw: " " } : k);
|
|
2285
2066
|
let D = i.children.some(K), c = i.children.filter((k) => k.type === "JSXExpressionContainer").length > 1, p = i.type === "JSXElement" && i.openingElement.attributes.length > 1, y = ne(l) || D || p || c, f = e.parent.rootMarker === "mdx", g = t.singleQuote ? "{' '}" : '{" "}', S = f ? C : w([g, E], " "), b = ((u = (r = i.openingElement) == null ? void 0 : r.name) == null ? void 0 : u.name) === "fbt", x = jp(e, t, n, S, b), j = i.children.some((k) => wt(k));
|
|
2286
2067
|
for (let k = x.length - 2; k >= 0; k--) {
|
|
2287
2068
|
let O = x[k] === "" && x[k + 1] === "", G = x[k] === F && x[k + 1] === "" && x[k + 2] === F, U = (x[k] === E || x[k] === F) && x[k + 1] === "" && x[k + 2] === S, Oe = x[k] === S && x[k + 1] === "" && (x[k + 2] === E || x[k + 2] === F), P = x[k] === S && x[k + 1] === "" && x[k + 2] === S, V = x[k] === E && x[k + 1] === "" && x[k + 2] === F || x[k] === F && x[k + 1] === "" && x[k + 2] === E;
|
|
2288
2069
|
G && j || O || U || P || V ? x.splice(k, 2) : Oe && x.splice(k + 1, 2);
|
|
2289
2070
|
}
|
|
2290
|
-
for (; x.length > 0 && En(X(!1, x, -1)); )
|
|
2291
|
-
|
|
2292
|
-
for (; x.length > 1 && En(x[0]) && En(x[1]); )
|
|
2293
|
-
x.shift(), x.shift();
|
|
2071
|
+
for (; x.length > 0 && En(X(!1, x, -1)); ) x.pop();
|
|
2072
|
+
for (; x.length > 1 && En(x[0]) && En(x[1]); ) x.shift(), x.shift();
|
|
2294
2073
|
let v = [""];
|
|
2295
2074
|
for (let [k, O] of x.entries()) {
|
|
2296
2075
|
if (O === S) {
|
|
@@ -2312,8 +2091,7 @@ function Np(e, t, n) {
|
|
|
2312
2091
|
k % 2 === 0 ? v.push([v.pop(), O]) : v.push(O, ""), ne(O) && (y = !0);
|
|
2313
2092
|
}
|
|
2314
2093
|
let B = j ? Du(v) : m(v, { shouldBreak: !0 });
|
|
2315
|
-
if (((a = t.cursorNode) == null ? void 0 : a.type) === "JSXText" && i.children.includes(t.cursorNode) ? B = [Xt, B, Xt] : ((s = t.nodeBeforeCursor) == null ? void 0 : s.type) === "JSXText" && i.children.includes(t.nodeBeforeCursor) ? B = [Xt, B] : ((o = t.nodeAfterCursor) == null ? void 0 : o.type) === "JSXText" && i.children.includes(t.nodeAfterCursor) && (B = [B, Xt]), f)
|
|
2316
|
-
return B;
|
|
2094
|
+
if (((a = t.cursorNode) == null ? void 0 : a.type) === "JSXText" && i.children.includes(t.cursorNode) ? B = [Xt, B, Xt] : ((s = t.nodeBeforeCursor) == null ? void 0 : s.type) === "JSXText" && i.children.includes(t.nodeBeforeCursor) ? B = [Xt, B] : ((o = t.nodeAfterCursor) == null ? void 0 : o.type) === "JSXText" && i.children.includes(t.nodeAfterCursor) && (B = [B, Xt]), f) return B;
|
|
2317
2095
|
let M = m([l, A([F, B]), F, d]);
|
|
2318
2096
|
return y ? M : Ve([m([l, ...x, d]), M]);
|
|
2319
2097
|
}
|
|
@@ -2332,20 +2110,16 @@ function jp(e, t, n, r, u) {
|
|
|
2332
2110
|
let c = Wt.split(D, !0);
|
|
2333
2111
|
c[0] === "" && (c.shift(), /\n/u.test(c[0]) ? i(vr(u, c[1], l, d)) : i(r), c.shift());
|
|
2334
2112
|
let p;
|
|
2335
|
-
if (X(!1, c, -1) === "" && (c.pop(), p = c.pop()), c.length === 0)
|
|
2336
|
-
|
|
2337
|
-
for (let [y, f] of c.entries())
|
|
2338
|
-
y % 2 === 1 ? i(C) : o(f);
|
|
2113
|
+
if (X(!1, c, -1) === "" && (c.pop(), p = c.pop()), c.length === 0) return;
|
|
2114
|
+
for (let [y, f] of c.entries()) y % 2 === 1 ? i(C) : o(f);
|
|
2339
2115
|
p !== void 0 ? /\n/u.test(p) ? i(vr(u, a, l, d)) : i(r) : i(Br(u, a, l, d));
|
|
2340
|
-
} else
|
|
2341
|
-
/\n/u.test(D) ? D.match(/\n/gu).length > 1 && i(F) : i(r);
|
|
2116
|
+
} else /\n/u.test(D) ? D.match(/\n/gu).length > 1 && i(F) : i(r);
|
|
2342
2117
|
} else {
|
|
2343
2118
|
let D = n();
|
|
2344
2119
|
if (o(D), d && wt(d)) {
|
|
2345
2120
|
let c = Wt.trim(se(d)), [p] = Wt.split(c);
|
|
2346
2121
|
i(Br(u, p, l, d));
|
|
2347
|
-
} else
|
|
2348
|
-
i(F);
|
|
2122
|
+
} else i(F);
|
|
2349
2123
|
}
|
|
2350
2124
|
}, "children"), s;
|
|
2351
2125
|
}
|
|
@@ -2358,8 +2132,7 @@ function vr(e, t, n, r) {
|
|
|
2358
2132
|
var Lp = /* @__PURE__ */ new Set(["ArrayExpression", "JSXAttribute", "JSXElement", "JSXExpressionContainer", "JSXFragment", "ExpressionStatement", "CallExpression", "OptionalCallExpression", "ConditionalExpression", "JsExpressionRoot"]);
|
|
2359
2133
|
function Mp(e, t, n) {
|
|
2360
2134
|
let { parent: r } = e;
|
|
2361
|
-
if (Lp.has(r.type))
|
|
2362
|
-
return t;
|
|
2135
|
+
if (Lp.has(r.type)) return t;
|
|
2363
2136
|
let u = Op(e), a = ut(e, n);
|
|
2364
2137
|
return m([a ? "" : w("("), A([E, t]), E, a ? "" : w(")")], { shouldBreak: u });
|
|
2365
2138
|
}
|
|
@@ -2373,8 +2146,7 @@ function Jp(e, t, n) {
|
|
|
2373
2146
|
if (Y(r.value)) {
|
|
2374
2147
|
let s = se(r.value), o = H(!1, H(!1, s.slice(1, -1), "'", "'"), """, '"'), i = Gr(o, t.jsxSingleQuote);
|
|
2375
2148
|
o = i === '"' ? H(!1, o, '"', """) : H(!1, o, "'", "'"), a = e.call(() => Fe(e, He(i + o + i), t), "value");
|
|
2376
|
-
} else
|
|
2377
|
-
a = n("value");
|
|
2149
|
+
} else a = n("value");
|
|
2378
2150
|
u.push("=", a);
|
|
2379
2151
|
}
|
|
2380
2152
|
return u;
|
|
@@ -2386,11 +2158,9 @@ function qp(e, t, n) {
|
|
|
2386
2158
|
function _p(e, t, n) {
|
|
2387
2159
|
var r, u;
|
|
2388
2160
|
let { node: a } = e, s = h(a.name) || h(a.typeParameters) || h(a.typeArguments);
|
|
2389
|
-
if (a.selfClosing && a.attributes.length === 0 && !s)
|
|
2390
|
-
return ["<", n("name"), a.typeArguments ? n("typeArguments") : n("typeParameters"), " />"];
|
|
2161
|
+
if (a.selfClosing && a.attributes.length === 0 && !s) return ["<", n("name"), a.typeArguments ? n("typeArguments") : n("typeParameters"), " />"];
|
|
2391
2162
|
if (((r = a.attributes) == null ? void 0 : r.length) === 1 && Y(a.attributes[0].value) && !a.attributes[0].value.value.includes(`
|
|
2392
|
-
`) && !s && !h(a.attributes[0]))
|
|
2393
|
-
return m(["<", n("name"), a.typeArguments ? n("typeArguments") : n("typeParameters"), " ", ...e.map(n, "attributes"), a.selfClosing ? " />" : ">"]);
|
|
2163
|
+
`) && !s && !h(a.attributes[0])) return m(["<", n("name"), a.typeArguments ? n("typeArguments") : n("typeParameters"), " ", ...e.map(n, "attributes"), a.selfClosing ? " />" : ">"]);
|
|
2394
2164
|
let o = (u = a.attributes) == null ? void 0 : u.some((l) => Y(l.value) && l.value.value.includes(`
|
|
2395
2165
|
`)), i = t.singleAttributePerLine && a.attributes.length > 1 ? F : C;
|
|
2396
2166
|
return m(["<", n("name"), a.typeArguments ? n("typeArguments") : n("typeParameters"), A(e.map(() => [i, n()], "attributes")), ...Xp(a, t, s)], { shouldBreak: o });
|
|
@@ -2429,44 +2199,41 @@ function Vp(e, t, n) {
|
|
|
2429
2199
|
}
|
|
2430
2200
|
function Kp(e, t, n) {
|
|
2431
2201
|
let { node: r } = e;
|
|
2432
|
-
if (r.type.startsWith("JSX"))
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
}
|
|
2202
|
+
if (r.type.startsWith("JSX")) switch (r.type) {
|
|
2203
|
+
case "JSXAttribute":
|
|
2204
|
+
return Jp(e, t, n);
|
|
2205
|
+
case "JSXIdentifier":
|
|
2206
|
+
return r.name;
|
|
2207
|
+
case "JSXNamespacedName":
|
|
2208
|
+
return N(":", [n("namespace"), n("name")]);
|
|
2209
|
+
case "JSXMemberExpression":
|
|
2210
|
+
return N(".", [n("object"), n("property")]);
|
|
2211
|
+
case "JSXSpreadAttribute":
|
|
2212
|
+
case "JSXSpreadChild":
|
|
2213
|
+
return Vp(e, t, n);
|
|
2214
|
+
case "JSXExpressionContainer":
|
|
2215
|
+
return qp(e, t, n);
|
|
2216
|
+
case "JSXFragment":
|
|
2217
|
+
case "JSXElement":
|
|
2218
|
+
return Up(e, t, n);
|
|
2219
|
+
case "JSXOpeningElement":
|
|
2220
|
+
return _p(e, t, n);
|
|
2221
|
+
case "JSXClosingElement":
|
|
2222
|
+
return Rp(e, t, n);
|
|
2223
|
+
case "JSXOpeningFragment":
|
|
2224
|
+
case "JSXClosingFragment":
|
|
2225
|
+
return Wp(e, t);
|
|
2226
|
+
case "JSXEmptyExpression":
|
|
2227
|
+
return Gp(e, t);
|
|
2228
|
+
case "JSXText":
|
|
2229
|
+
throw new Error("JSXText should be handled by JSXElement");
|
|
2230
|
+
default:
|
|
2231
|
+
throw new At(r, "JSX");
|
|
2232
|
+
}
|
|
2464
2233
|
}
|
|
2465
2234
|
function Hp(e) {
|
|
2466
|
-
if (e.children.length === 0)
|
|
2467
|
-
|
|
2468
|
-
if (e.children.length > 1)
|
|
2469
|
-
return !1;
|
|
2235
|
+
if (e.children.length === 0) return !0;
|
|
2236
|
+
if (e.children.length > 1) return !1;
|
|
2470
2237
|
let t = e.children[0];
|
|
2471
2238
|
return t.type === "JSXText" && !wt(t);
|
|
2472
2239
|
}
|
|
@@ -2478,8 +2245,7 @@ function zp(e) {
|
|
|
2478
2245
|
}
|
|
2479
2246
|
function Qp(e) {
|
|
2480
2247
|
let { node: t, parent: n } = e;
|
|
2481
|
-
if (!K(t) || !K(n))
|
|
2482
|
-
return !1;
|
|
2248
|
+
if (!K(t) || !K(n)) return !1;
|
|
2483
2249
|
let { index: r, siblings: u } = e, a;
|
|
2484
2250
|
for (let s = r; s > 0; s--) {
|
|
2485
2251
|
let o = u[s - 1];
|
|
@@ -2497,49 +2263,39 @@ var _u = Yp, Zp = 0;
|
|
|
2497
2263
|
function Xu(e, t, n) {
|
|
2498
2264
|
var r;
|
|
2499
2265
|
let { node: u, parent: a, grandparent: s, key: o } = e, i = o !== "body" && (a.type === "IfStatement" || a.type === "WhileStatement" || a.type === "SwitchStatement" || a.type === "DoWhileStatement"), l = u.operator === "|>" && ((r = e.root.extra) == null ? void 0 : r.__isUsingHackPipeline), d = jn(e, t, n, !1, i);
|
|
2500
|
-
if (i)
|
|
2501
|
-
|
|
2502
|
-
if (
|
|
2503
|
-
return m(d);
|
|
2504
|
-
if (L(a) && a.callee === u || a.type === "UnaryExpression" || R(a) && !a.computed)
|
|
2505
|
-
return m([A([E, ...d]), E]);
|
|
2266
|
+
if (i) return d;
|
|
2267
|
+
if (l) return m(d);
|
|
2268
|
+
if (L(a) && a.callee === u || a.type === "UnaryExpression" || R(a) && !a.computed) return m([A([E, ...d]), E]);
|
|
2506
2269
|
let D = a.type === "ReturnStatement" || a.type === "ThrowStatement" || a.type === "JSXExpressionContainer" && s.type === "JSXAttribute" || u.operator !== "|" && a.type === "JsExpressionRoot" || u.type !== "NGPipeExpression" && (a.type === "NGRoot" && t.parser === "__ng_binding" || a.type === "NGMicrosyntaxExpression" && s.type === "NGMicrosyntax" && s.body.length === 1) || u === a.body && a.type === "ArrowFunctionExpression" || u !== a.body && a.type === "ForStatement" || a.type === "ConditionalExpression" && s.type !== "ReturnStatement" && s.type !== "ThrowStatement" && !L(s) || a.type === "TemplateLiteral", c = a.type === "AssignmentExpression" || a.type === "VariableDeclarator" || a.type === "ClassProperty" || a.type === "PropertyDefinition" || a.type === "TSAbstractPropertyDefinition" || a.type === "ClassPrivateProperty" || je(a), p = ke(u.left) && Vn(u.operator, u.left.operator);
|
|
2507
|
-
if (D || It(u) && !p || !It(u) && c)
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
let y = K(u.right), f = d.findIndex((v) => typeof v != "string" && !Array.isArray(v) && v.type === De), g = d.slice(0, f === -1 ? 1 : f + 1), S = d.slice(g.length, y ? -1 : void 0), b = Symbol("logicalChain-" + ++Zp), x = m([...g, A(S)], { id: b });
|
|
2512
|
-
if (!y)
|
|
2513
|
-
return x;
|
|
2270
|
+
if (D || It(u) && !p || !It(u) && c) return m(d);
|
|
2271
|
+
if (d.length === 0) return "";
|
|
2272
|
+
let y = K(u.right), f = d.findIndex((v) => typeof v != "string" && !Array.isArray(v) && v.type === De), g = d.slice(0, f === -1 ? 1 : f + 1), S = d.slice(g.length, y ? -1 : void 0), b = /* @__PURE__ */ Symbol("logicalChain-" + ++Zp), x = m([...g, A(S)], { id: b });
|
|
2273
|
+
if (!y) return x;
|
|
2514
2274
|
let j = X(!1, d, -1);
|
|
2515
2275
|
return m([x, un(j, { groupId: b })]);
|
|
2516
2276
|
}
|
|
2517
2277
|
function jn(e, t, n, r, u) {
|
|
2518
2278
|
var a;
|
|
2519
2279
|
let { node: s } = e;
|
|
2520
|
-
if (!ke(s))
|
|
2521
|
-
return [m(n())];
|
|
2280
|
+
if (!ke(s)) return [m(n())];
|
|
2522
2281
|
let o = [];
|
|
2523
2282
|
Vn(s.operator, s.left.operator) ? o = e.call((g) => jn(g, t, n, !0, u), "left") : o.push(m(n("left")));
|
|
2524
2283
|
let i = It(s), l = (s.operator === "|>" || s.type === "NGPipeExpression" || el(e, t)) && !Te(t.originalText, s.right), d = !h(s.right, T.Leading, fu) && Te(t.originalText, s.right), D = s.type === "NGPipeExpression" ? "|" : s.operator, c = s.type === "NGPipeExpression" && s.arguments.length > 0 ? m(A([E, ": ", N([C, ": "], e.map(() => Be(2, m(n())), "arguments"))])) : "", p;
|
|
2525
|
-
if (i)
|
|
2526
|
-
p = [D, Te(t.originalText, s.right) ? A([C, n("right"), c]) : [" ", n("right"), c]];
|
|
2284
|
+
if (i) p = [D, Te(t.originalText, s.right) ? A([C, n("right"), c]) : [" ", n("right"), c]];
|
|
2527
2285
|
else {
|
|
2528
2286
|
let g = D === "|>" && ((a = e.root.extra) != null && a.__isUsingHackPipeline) ? e.call((S) => jn(S, t, n, !0, u), "right") : n("right");
|
|
2529
2287
|
if (t.experimentalOperatorPosition === "start") {
|
|
2530
2288
|
let S = "";
|
|
2531
|
-
if (d)
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
}
|
|
2289
|
+
if (d) switch (Ge(g)) {
|
|
2290
|
+
case Pe:
|
|
2291
|
+
S = g.splice(0, 1)[0];
|
|
2292
|
+
break;
|
|
2293
|
+
case Le:
|
|
2294
|
+
S = g.contents.splice(0, 1)[0];
|
|
2295
|
+
break;
|
|
2296
|
+
}
|
|
2540
2297
|
p = [C, S, D, " ", g, c];
|
|
2541
|
-
} else
|
|
2542
|
-
p = [l ? C : "", D, l ? " " : C, g, c];
|
|
2298
|
+
} else p = [l ? C : "", D, l ? " " : C, g, c];
|
|
2543
2299
|
}
|
|
2544
2300
|
let { parent: y } = e, f = h(s.left, T.Trailing | T.Line);
|
|
2545
2301
|
if ((f || !(u && s.type === "LogicalExpression") && y.type !== s.type && s.left.type !== s.type && s.right.type !== s.type) && (p = m(p, { shouldBreak: f })), t.experimentalOperatorPosition === "start" ? o.push(i || d ? " " : "", p) : o.push(l ? "" : " ", p), r && h(s)) {
|
|
@@ -2557,33 +2313,32 @@ function el(e, t) {
|
|
|
2557
2313
|
}
|
|
2558
2314
|
function tl(e, t, n) {
|
|
2559
2315
|
let { node: r } = e;
|
|
2560
|
-
if (r.type.startsWith("NG"))
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
return [n("key"), s ? " " : ": ", n("expression")];
|
|
2579
|
-
}
|
|
2580
|
-
case "NGMicrosyntaxLet":
|
|
2581
|
-
return ["let ", n("key"), r.value === null ? "" : [" = ", n("value")]];
|
|
2582
|
-
case "NGMicrosyntaxAs":
|
|
2583
|
-
return [n("key"), " as ", n("alias")];
|
|
2584
|
-
default:
|
|
2585
|
-
throw new At(r, "Angular");
|
|
2316
|
+
if (r.type.startsWith("NG")) switch (r.type) {
|
|
2317
|
+
case "NGRoot":
|
|
2318
|
+
return [n("node"), h(r.node) ? " //" + Ke(r.node)[0].value.trimEnd() : ""];
|
|
2319
|
+
case "NGPipeExpression":
|
|
2320
|
+
return Xu(e, t, n);
|
|
2321
|
+
case "NGChainedExpression":
|
|
2322
|
+
return m(N([";", C], e.map(() => ul(e) ? n() : ["(", n(), ")"], "expressions")));
|
|
2323
|
+
case "NGEmptyExpression":
|
|
2324
|
+
return "";
|
|
2325
|
+
case "NGMicrosyntax":
|
|
2326
|
+
return e.map(() => [e.isFirst ? "" : Pr(e) ? " " : [";", C], n()], "body");
|
|
2327
|
+
case "NGMicrosyntaxKey":
|
|
2328
|
+
return /^[$_a-z][\w$]*(?:-[$_a-z][\w$])*$/iu.test(r.name) ? r.name : JSON.stringify(r.name);
|
|
2329
|
+
case "NGMicrosyntaxExpression":
|
|
2330
|
+
return [n("expression"), r.alias === null ? "" : [" as ", n("alias")]];
|
|
2331
|
+
case "NGMicrosyntaxKeyedExpression": {
|
|
2332
|
+
let { index: u, parent: a } = e, s = Pr(e) || nl(e) || (u === 1 && (r.key.name === "then" || r.key.name === "else" || r.key.name === "as") || u === 2 && (r.key.name === "else" && a.body[u - 1].type === "NGMicrosyntaxKeyedExpression" && a.body[u - 1].key.name === "then" || r.key.name === "track")) && a.body[0].type === "NGMicrosyntaxExpression";
|
|
2333
|
+
return [n("key"), s ? " " : ": ", n("expression")];
|
|
2586
2334
|
}
|
|
2335
|
+
case "NGMicrosyntaxLet":
|
|
2336
|
+
return ["let ", n("key"), r.value === null ? "" : [" = ", n("value")]];
|
|
2337
|
+
case "NGMicrosyntaxAs":
|
|
2338
|
+
return [n("key"), " as ", n("alias")];
|
|
2339
|
+
default:
|
|
2340
|
+
throw new At(r, "Angular");
|
|
2341
|
+
}
|
|
2587
2342
|
}
|
|
2588
2343
|
function Pr({ node: e, index: t }) {
|
|
2589
2344
|
return e.type === "NGMicrosyntaxKeyedExpression" && e.key.name === "of" && t === 1;
|
|
@@ -2605,8 +2360,7 @@ function al(e, t, n) {
|
|
|
2605
2360
|
}
|
|
2606
2361
|
function sl(e, t, n) {
|
|
2607
2362
|
let { node: r, parent: u } = e, { decorators: a } = r;
|
|
2608
|
-
if (!J(a) || Wu(u) || _u(e))
|
|
2609
|
-
return "";
|
|
2363
|
+
if (!J(a) || Wu(u) || _u(e)) return "";
|
|
2610
2364
|
let s = r.type === "ClassExpression" || r.type === "ClassDeclaration" || Ru(r, t);
|
|
2611
2365
|
return [e.key === "declaration" && Gs(u) ? F : s ? ve : "", N(C, e.map(n, "decorators")), C];
|
|
2612
2366
|
}
|
|
@@ -2615,8 +2369,7 @@ function Ru(e, t) {
|
|
|
2615
2369
|
}
|
|
2616
2370
|
function Wu(e) {
|
|
2617
2371
|
var t;
|
|
2618
|
-
if (e.type !== "ExportDefaultDeclaration" && e.type !== "ExportNamedDeclaration" && e.type !== "DeclareExportDeclaration")
|
|
2619
|
-
return !1;
|
|
2372
|
+
if (e.type !== "ExportDefaultDeclaration" && e.type !== "ExportNamedDeclaration" && e.type !== "DeclareExportDeclaration") return !1;
|
|
2620
2373
|
let n = (t = e.declaration) == null ? void 0 : t.decorators;
|
|
2621
2374
|
return J(n) && en(e, n[0]);
|
|
2622
2375
|
}
|
|
@@ -2625,8 +2378,7 @@ var zt = class extends Error {
|
|
|
2625
2378
|
};
|
|
2626
2379
|
function ol(e, t, n) {
|
|
2627
2380
|
let { node: r } = e, u = de(r);
|
|
2628
|
-
if (u.length === 0)
|
|
2629
|
-
return ["(", $(e, t), ")"];
|
|
2381
|
+
if (u.length === 0) return ["(", $(e, t), ")"];
|
|
2630
2382
|
let a = u.length - 1;
|
|
2631
2383
|
if (ll(u)) {
|
|
2632
2384
|
let D = ["("];
|
|
@@ -2640,37 +2392,31 @@ function ol(e, t, n) {
|
|
|
2640
2392
|
c === a || (Ne(D, t) ? (s = !0, p = [p, ",", F, F]) : p = [p, ",", C]), o.push(p);
|
|
2641
2393
|
});
|
|
2642
2394
|
let i = !t.parser.startsWith("__ng_") && r.type !== "ImportExpression" && r.type !== "TSImportType" && Ie(t, "all") ? "," : "";
|
|
2643
|
-
if (r.type === "TSImportType" && u.length === 1 && (u[0].type === "TSLiteralType" && Y(u[0].literal) || Y(u[0])) && !h(u[0]))
|
|
2644
|
-
return m(["(", ...o, w(i), ")"]);
|
|
2395
|
+
if (r.type === "TSImportType" && u.length === 1 && (u[0].type === "TSLiteralType" && Y(u[0].literal) || Y(u[0])) && !h(u[0])) return m(["(", ...o, w(i), ")"]);
|
|
2645
2396
|
function l() {
|
|
2646
2397
|
return m(["(", A([C, ...o]), i, C, ")"], { shouldBreak: !0 });
|
|
2647
2398
|
}
|
|
2648
|
-
if (s || e.parent.type !== "Decorator" && ro(u))
|
|
2649
|
-
return l();
|
|
2399
|
+
if (s || e.parent.type !== "Decorator" && ro(u)) return l();
|
|
2650
2400
|
if (pl(u)) {
|
|
2651
2401
|
let D = o.slice(1);
|
|
2652
|
-
if (D.some(ne))
|
|
2653
|
-
return l();
|
|
2402
|
+
if (D.some(ne)) return l();
|
|
2654
2403
|
let c;
|
|
2655
2404
|
try {
|
|
2656
2405
|
c = n(Ar(r, 0), { expandFirstArg: !0 });
|
|
2657
2406
|
} catch (p) {
|
|
2658
|
-
if (p instanceof zt)
|
|
2659
|
-
return l();
|
|
2407
|
+
if (p instanceof zt) return l();
|
|
2660
2408
|
throw p;
|
|
2661
2409
|
}
|
|
2662
2410
|
return ne(c) ? [ve, Ve([["(", m(c, { shouldBreak: !0 }), ", ", ...D, ")"], l()])] : Ve([["(", c, ", ", ...D, ")"], ["(", m(c, { shouldBreak: !0 }), ", ", ...D, ")"], l()]);
|
|
2663
2411
|
}
|
|
2664
2412
|
if (il(u, o, t)) {
|
|
2665
2413
|
let D = o.slice(0, -1);
|
|
2666
|
-
if (D.some(ne))
|
|
2667
|
-
return l();
|
|
2414
|
+
if (D.some(ne)) return l();
|
|
2668
2415
|
let c;
|
|
2669
2416
|
try {
|
|
2670
2417
|
c = n(Ar(r, -1), { expandLastArg: !0 });
|
|
2671
2418
|
} catch (p) {
|
|
2672
|
-
if (p instanceof zt)
|
|
2673
|
-
return l();
|
|
2419
|
+
if (p instanceof zt) return l();
|
|
2674
2420
|
throw p;
|
|
2675
2421
|
}
|
|
2676
2422
|
return ne(c) ? [ve, Ve([["(", ...D, m(c, { shouldBreak: !0 }), ")"], l()])] : Ve([["(", ...D, c, ")"], ["(", ...D, m(c, { shouldBreak: !0 }), ")"], l()]);
|
|
@@ -2686,21 +2432,18 @@ function il(e, t, n) {
|
|
|
2686
2432
|
let a = X(!1, e, -1);
|
|
2687
2433
|
if (e.length === 1) {
|
|
2688
2434
|
let o = X(!1, t, -1);
|
|
2689
|
-
if ((r = o.label) != null && r.embed && ((u = o.label) == null ? void 0 : u.hug) !== !1)
|
|
2690
|
-
return !0;
|
|
2435
|
+
if ((r = o.label) != null && r.embed && ((u = o.label) == null ? void 0 : u.hug) !== !1) return !0;
|
|
2691
2436
|
}
|
|
2692
2437
|
let s = X(!1, e, -2);
|
|
2693
2438
|
return !h(a, T.Leading) && !h(a, T.Trailing) && Bt(a) && (!s || s.type !== a.type) && (e.length !== 2 || s.type !== "ArrowFunctionExpression" || !Q(a)) && !(e.length > 1 && fa(a, n));
|
|
2694
2439
|
}
|
|
2695
2440
|
function pl(e) {
|
|
2696
|
-
if (e.length !== 2)
|
|
2697
|
-
return !1;
|
|
2441
|
+
if (e.length !== 2) return !1;
|
|
2698
2442
|
let [t, n] = e;
|
|
2699
2443
|
return t.type === "ModuleExpression" && Dl(n) ? !0 : !h(t) && (t.type === "FunctionExpression" || t.type === "ArrowFunctionExpression" && t.body.type === "BlockStatement") && n.type !== "FunctionExpression" && n.type !== "ArrowFunctionExpression" && n.type !== "ConditionalExpression" && Uu(n) && !Bt(n);
|
|
2700
2444
|
}
|
|
2701
2445
|
function Uu(e) {
|
|
2702
|
-
if (e.type === "ParenthesizedExpression")
|
|
2703
|
-
return Uu(e.expression);
|
|
2446
|
+
if (e.type === "ParenthesizedExpression") return Uu(e.expression);
|
|
2704
2447
|
if (Ce(e) || e.type === "TypeCastExpression") {
|
|
2705
2448
|
let { typeAnnotation: t } = e;
|
|
2706
2449
|
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") {
|
|
@@ -2722,8 +2465,7 @@ function cl(e) {
|
|
|
2722
2465
|
return e.type === "BlockStatement" && (e.body.some((t) => t.type !== "EmptyStatement") || h(e, T.Dangling));
|
|
2723
2466
|
}
|
|
2724
2467
|
function Dl(e) {
|
|
2725
|
-
if (!(e.type === "ObjectExpression" && e.properties.length === 1))
|
|
2726
|
-
return !1;
|
|
2468
|
+
if (!(e.type === "ObjectExpression" && e.properties.length === 1)) return !1;
|
|
2727
2469
|
let [t] = e.properties;
|
|
2728
2470
|
return je(t) ? !t.computed && (t.key.type === "Identifier" && t.key.name === "type" || Y(t.key) && t.key.value === "type") && Y(t.value) && t.value.value === "module" : !1;
|
|
2729
2471
|
}
|
|
@@ -2738,8 +2480,7 @@ function Gu(e, t, n) {
|
|
|
2738
2480
|
return u.computed ? !u.property || be(u.property) ? [a, "[", r, "]"] : m([a, "[", A([E, r]), E, "]"]) : [a, ".", r];
|
|
2739
2481
|
}
|
|
2740
2482
|
function Vu(e, t, n) {
|
|
2741
|
-
if (e.node.type === "ChainExpression")
|
|
2742
|
-
return e.call(() => Vu(e, t, n), "expression");
|
|
2483
|
+
if (e.node.type === "ChainExpression") return e.call(() => Vu(e, t, n), "expression");
|
|
2743
2484
|
let r = (e.parent.type === "ChainExpression" ? e.grandparent : e.parent).type === "ExpressionStatement", u = [];
|
|
2744
2485
|
function a(P) {
|
|
2745
2486
|
let { originalText: V } = t, ue = Ft(V, I(P));
|
|
@@ -2747,22 +2488,17 @@ function Vu(e, t, n) {
|
|
|
2747
2488
|
}
|
|
2748
2489
|
function s() {
|
|
2749
2490
|
let { node: P } = e;
|
|
2750
|
-
if (P.type === "ChainExpression")
|
|
2751
|
-
return e.call(s, "expression");
|
|
2491
|
+
if (P.type === "ChainExpression") return e.call(s, "expression");
|
|
2752
2492
|
if (L(P) && (it(P.callee) || L(P.callee))) {
|
|
2753
2493
|
let V = a(P);
|
|
2754
2494
|
u.unshift({ node: P, hasTrailingEmptyLine: V, printed: [Fe(e, [re(e), ze(e, t, n), Qt(e, t, n)], t), V ? F : ""] }), e.call(s, "callee");
|
|
2755
|
-
} else
|
|
2756
|
-
it(P) ? (u.unshift({ node: P, needsParens: ut(e, t), printed: Fe(e, R(P) ? Gu(e, t, n) : da(e, t, n), t) }), e.call(s, "object")) : P.type === "TSNonNullExpression" ? (u.unshift({ node: P, printed: Fe(e, "!", t) }), e.call(s, "expression")) : u.unshift({ node: P, printed: n() });
|
|
2495
|
+
} else it(P) ? (u.unshift({ node: P, needsParens: ut(e, t), printed: Fe(e, R(P) ? Gu(e, t, n) : da(e, t, n), t) }), e.call(s, "object")) : P.type === "TSNonNullExpression" ? (u.unshift({ node: P, printed: Fe(e, "!", t) }), e.call(s, "expression")) : u.unshift({ node: P, printed: n() });
|
|
2757
2496
|
}
|
|
2758
2497
|
let { node: o } = e;
|
|
2759
2498
|
u.unshift({ node: o, printed: [re(e), ze(e, t, n), Qt(e, t, n)] }), o.callee && e.call(s, "callee");
|
|
2760
2499
|
let i = [], l = [u[0]], d = 1;
|
|
2761
|
-
for (; d < u.length && (u[d].node.type === "TSNonNullExpression" || L(u[d].node) || R(u[d].node) && u[d].node.computed && be(u[d].node.property)); ++d)
|
|
2762
|
-
|
|
2763
|
-
if (!L(u[0].node))
|
|
2764
|
-
for (; d + 1 < u.length && it(u[d].node) && it(u[d + 1].node); ++d)
|
|
2765
|
-
l.push(u[d]);
|
|
2500
|
+
for (; d < u.length && (u[d].node.type === "TSNonNullExpression" || L(u[d].node) || R(u[d].node) && u[d].node.computed && be(u[d].node.property)); ++d) l.push(u[d]);
|
|
2501
|
+
if (!L(u[0].node)) for (; d + 1 < u.length && it(u[d].node) && it(u[d + 1].node); ++d) l.push(u[d]);
|
|
2766
2502
|
i.push(l), l = [];
|
|
2767
2503
|
let D = !1;
|
|
2768
2504
|
for (; d < u.length; ++d) {
|
|
@@ -2801,8 +2537,7 @@ function Vu(e, t, n) {
|
|
|
2801
2537
|
return P.length === 0 ? "" : A([F, N(F, P.map(g))]);
|
|
2802
2538
|
}
|
|
2803
2539
|
let b = i.map(g), x = b, j = f ? 3 : 2, v = i.flat(), B = v.slice(1, -1).some((P) => h(P.node, T.Leading)) || v.slice(0, -1).some((P) => h(P.node, T.Trailing)) || i[j] && h(i[j][0].node, T.Leading);
|
|
2804
|
-
if (i.length <= j && !B && !i.some((P) => X(!1, P, -1).hasTrailingEmptyLine))
|
|
2805
|
-
return su(e) ? x : m(x);
|
|
2540
|
+
if (i.length <= j && !B && !i.some((P) => X(!1, P, -1).hasTrailingEmptyLine)) return su(e) ? x : m(x);
|
|
2806
2541
|
let M = X(!1, i[f ? 1 : 0], -1).node, k = !L(M) && a(M), O = [g(i[0]), f ? i.slice(1, 2).map(g) : "", k ? F : "", S(i.slice(f ? 2 : 1))], G = u.map(({ node: P }) => P).filter(L);
|
|
2807
2542
|
function U() {
|
|
2808
2543
|
let P = X(!1, X(!1, i, -1), -1).node, V = X(!1, b, -1);
|
|
@@ -2819,11 +2554,9 @@ function Ku(e, t, n) {
|
|
|
2819
2554
|
let D = [];
|
|
2820
2555
|
if (Kt(e, () => {
|
|
2821
2556
|
D.push(n());
|
|
2822
|
-
}), !(l && (r = D[0].label) != null && r.embed))
|
|
2823
|
-
return [a ? "new " : "", Ir(e, n), o, ze(e, t, n), "(", N(", ", D), ")"];
|
|
2557
|
+
}), !(l && (r = D[0].label) != null && r.embed)) return [a ? "new " : "", Ir(e, n), o, ze(e, t, n), "(", N(", ", D), ")"];
|
|
2824
2558
|
}
|
|
2825
|
-
if (!s && !a && it(u.callee) && !e.call((D) => ut(D, t), "callee", ...u.callee.type === "ChainExpression" ? ["expression"] : []))
|
|
2826
|
-
return ml(e, t, n);
|
|
2559
|
+
if (!s && !a && it(u.callee) && !e.call((D) => ut(D, t), "callee", ...u.callee.type === "ChainExpression" ? ["expression"] : [])) return ml(e, t, n);
|
|
2827
2560
|
let d = [a ? "new " : "", Ir(e, n), o, ze(e, t, n), Qt(e, t, n)];
|
|
2828
2561
|
return s || L(u.callee) ? m(d) : d;
|
|
2829
2562
|
}
|
|
@@ -2833,8 +2566,7 @@ function Ir(e, t) {
|
|
|
2833
2566
|
}
|
|
2834
2567
|
function fl(e) {
|
|
2835
2568
|
let { node: t } = e;
|
|
2836
|
-
if (t.type !== "CallExpression" || t.optional || t.callee.type !== "Identifier")
|
|
2837
|
-
return !1;
|
|
2569
|
+
if (t.type !== "CallExpression" || t.optional || t.callee.type !== "Identifier") return !1;
|
|
2838
2570
|
let n = de(t);
|
|
2839
2571
|
return t.callee.name === "require" ? n.length === 1 && Y(n[0]) || n.length > 1 : t.callee.name === "define" && e.parent.type === "ExpressionStatement" ? n.length === 1 || n.length === 2 && n[0].type === "ArrayExpression" || n.length === 3 && Y(n[0]) && n[1].type === "ArrayExpression" : !1;
|
|
2840
2572
|
}
|
|
@@ -2846,7 +2578,7 @@ function Lt(e, t, n, r, u, a) {
|
|
|
2846
2578
|
case "never-break-after-operator":
|
|
2847
2579
|
return m([m(r), u, " ", o]);
|
|
2848
2580
|
case "fluid": {
|
|
2849
|
-
let i = Symbol("assignment");
|
|
2581
|
+
let i = /* @__PURE__ */ Symbol("assignment");
|
|
2850
2582
|
return m([m(r), u, m(A(C), { id: i }), we, un(o, { groupId: i })]);
|
|
2851
2583
|
}
|
|
2852
2584
|
case "break-lhs":
|
|
@@ -2870,33 +2602,26 @@ function Fl(e, t, n) {
|
|
|
2870
2602
|
}
|
|
2871
2603
|
function Al(e, t, n, r, u) {
|
|
2872
2604
|
let { node: a } = e, s = a[u];
|
|
2873
|
-
if (!s)
|
|
2874
|
-
return "only-left";
|
|
2605
|
+
if (!s) return "only-left";
|
|
2875
2606
|
let o = !Ut(s);
|
|
2876
|
-
if (e.match(Ut, Hu, (d) => !o || d.type !== "ExpressionStatement" && d.type !== "VariableDeclaration"))
|
|
2877
|
-
|
|
2878
|
-
if (
|
|
2879
|
-
return "break-after-operator";
|
|
2880
|
-
if (a.type === "ImportAttribute" || s.type === "CallExpression" && s.callee.name === "require" || t.parser === "json5" || t.parser === "jsonc" || t.parser === "json")
|
|
2881
|
-
return "never-break-after-operator";
|
|
2607
|
+
if (e.match(Ut, Hu, (d) => !o || d.type !== "ExpressionStatement" && d.type !== "VariableDeclaration")) return o ? s.type === "ArrowFunctionExpression" && s.body.type === "ArrowFunctionExpression" ? "chain-tail-arrow-chain" : "chain-tail" : "chain";
|
|
2608
|
+
if (!o && Ut(s.right) || Te(t.originalText, s)) return "break-after-operator";
|
|
2609
|
+
if (a.type === "ImportAttribute" || s.type === "CallExpression" && s.callee.name === "require" || t.parser === "json5" || t.parser === "jsonc" || t.parser === "json") return "never-break-after-operator";
|
|
2882
2610
|
let i = Co(r);
|
|
2883
|
-
if (xl(a) || Sl(a) || zu(a) && i)
|
|
2884
|
-
return "break-lhs";
|
|
2611
|
+
if (xl(a) || Sl(a) || zu(a) && i) return "break-lhs";
|
|
2885
2612
|
let l = Bl(a, r, t);
|
|
2886
2613
|
return e.call(() => gl(e, t, n, l), u) ? "break-after-operator" : hl(a) ? "break-lhs" : !i && (l || s.type === "TemplateLiteral" || s.type === "TaggedTemplateExpression" || Ks(s) || be(s) || s.type === "ClassExpression") ? "never-break-after-operator" : "fluid";
|
|
2887
2614
|
}
|
|
2888
2615
|
function gl(e, t, n, r) {
|
|
2889
2616
|
let u = e.node;
|
|
2890
|
-
if (ke(u) && !It(u))
|
|
2891
|
-
return !0;
|
|
2617
|
+
if (ke(u) && !It(u)) return !0;
|
|
2892
2618
|
switch (u.type) {
|
|
2893
2619
|
case "StringLiteralTypeAnnotation":
|
|
2894
2620
|
case "SequenceExpression":
|
|
2895
2621
|
return !0;
|
|
2896
2622
|
case "TSConditionalType":
|
|
2897
2623
|
case "ConditionalTypeAnnotation":
|
|
2898
|
-
if (!t.experimentalTernaries && !Pl(u))
|
|
2899
|
-
break;
|
|
2624
|
+
if (!t.experimentalTernaries && !Pl(u)) break;
|
|
2900
2625
|
return !0;
|
|
2901
2626
|
case "ConditionalExpression": {
|
|
2902
2627
|
if (!t.experimentalTernaries) {
|
|
@@ -2909,16 +2634,11 @@ function gl(e, t, n, r) {
|
|
|
2909
2634
|
case "ClassExpression":
|
|
2910
2635
|
return J(u.decorators);
|
|
2911
2636
|
}
|
|
2912
|
-
if (r)
|
|
2913
|
-
return !1;
|
|
2637
|
+
if (r) return !1;
|
|
2914
2638
|
let a = u, s = [];
|
|
2915
|
-
for (; ; )
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
else if (a.type === "TSNonNullExpression")
|
|
2919
|
-
a = a.expression, s.push("expression");
|
|
2920
|
-
else
|
|
2921
|
-
break;
|
|
2639
|
+
for (; ; ) if (a.type === "UnaryExpression" || a.type === "AwaitExpression" || a.type === "YieldExpression" && a.argument !== null) a = a.argument, s.push("argument");
|
|
2640
|
+
else if (a.type === "TSNonNullExpression") a = a.expression, s.push("expression");
|
|
2641
|
+
else break;
|
|
2922
2642
|
return !!(Y(a) || e.call(() => Qu(e, t, n), ...s));
|
|
2923
2643
|
}
|
|
2924
2644
|
function xl(e) {
|
|
@@ -2941,23 +2661,19 @@ function hl(e) {
|
|
|
2941
2661
|
let t = Tl(e);
|
|
2942
2662
|
if (J(t)) {
|
|
2943
2663
|
let n = e.type === "TSTypeAliasDeclaration" ? "constraint" : "bound";
|
|
2944
|
-
if (t.length > 1 && t.some((r) => r[n] || r.default))
|
|
2945
|
-
return !0;
|
|
2664
|
+
if (t.length > 1 && t.some((r) => r[n] || r.default)) return !0;
|
|
2946
2665
|
}
|
|
2947
2666
|
return !1;
|
|
2948
2667
|
}
|
|
2949
2668
|
var Cl = _(["TSTypeAliasDeclaration", "TypeAlias"]);
|
|
2950
2669
|
function Tl(e) {
|
|
2951
2670
|
var t;
|
|
2952
|
-
if (Cl(e))
|
|
2953
|
-
return (t = e.typeParameters) == null ? void 0 : t.params;
|
|
2671
|
+
if (Cl(e)) return (t = e.typeParameters) == null ? void 0 : t.params;
|
|
2954
2672
|
}
|
|
2955
2673
|
function Sl(e) {
|
|
2956
|
-
if (e.type !== "VariableDeclarator")
|
|
2957
|
-
return !1;
|
|
2674
|
+
if (e.type !== "VariableDeclarator") return !1;
|
|
2958
2675
|
let { typeAnnotation: t } = e.id;
|
|
2959
|
-
if (!t || !t.typeAnnotation)
|
|
2960
|
-
return !1;
|
|
2676
|
+
if (!t || !t.typeAnnotation) return !1;
|
|
2961
2677
|
let n = Nr(t.typeAnnotation);
|
|
2962
2678
|
return J(n) && n.length > 1 && n.some((r) => J(Nr(r)) || r.type === "TSConditionalType");
|
|
2963
2679
|
}
|
|
@@ -2968,17 +2684,14 @@ function zu(e) {
|
|
|
2968
2684
|
var bl = _(["TSTypeReference", "GenericTypeAnnotation"]);
|
|
2969
2685
|
function Nr(e) {
|
|
2970
2686
|
var t;
|
|
2971
|
-
if (bl(e))
|
|
2972
|
-
return (t = e.typeArguments ?? e.typeParameters) == null ? void 0 : t.params;
|
|
2687
|
+
if (bl(e)) return (t = e.typeArguments ?? e.typeParameters) == null ? void 0 : t.params;
|
|
2973
2688
|
}
|
|
2974
2689
|
function Qu(e, t, n, r = !1) {
|
|
2975
2690
|
var u;
|
|
2976
2691
|
let { node: a } = e, s = () => Qu(e, t, n, !0);
|
|
2977
|
-
if (a.type === "ChainExpression" || a.type === "TSNonNullExpression")
|
|
2978
|
-
return e.call(s, "expression");
|
|
2692
|
+
if (a.type === "ChainExpression" || a.type === "TSNonNullExpression") return e.call(s, "expression");
|
|
2979
2693
|
if (L(a)) {
|
|
2980
|
-
if ((u = Ku(e, t, n).label) != null && u.memberChain)
|
|
2981
|
-
return !1;
|
|
2694
|
+
if ((u = Ku(e, t, n).label) != null && u.memberChain) return !1;
|
|
2982
2695
|
let o = de(a);
|
|
2983
2696
|
return !(o.length === 0 || o.length === 1 && Gn(o[0], t)) || vl(a, n) ? !1 : e.call(s, "callee");
|
|
2984
2697
|
}
|
|
@@ -2990,16 +2703,13 @@ function Bl(e, t, n) {
|
|
|
2990
2703
|
function vl(e, t) {
|
|
2991
2704
|
let n = kl(e);
|
|
2992
2705
|
if (J(n)) {
|
|
2993
|
-
if (n.length > 1)
|
|
2994
|
-
return !0;
|
|
2706
|
+
if (n.length > 1) return !0;
|
|
2995
2707
|
if (n.length === 1) {
|
|
2996
2708
|
let u = n[0];
|
|
2997
|
-
if ($e(u) || Kn(u) || u.type === "TSTypeLiteral" || u.type === "ObjectTypeAnnotation")
|
|
2998
|
-
return !0;
|
|
2709
|
+
if ($e(u) || Kn(u) || u.type === "TSTypeLiteral" || u.type === "ObjectTypeAnnotation") return !0;
|
|
2999
2710
|
}
|
|
3000
2711
|
let r = e.typeParameters ? "typeParameters" : "typeArguments";
|
|
3001
|
-
if (ne(t(r)))
|
|
3002
|
-
return !0;
|
|
2712
|
+
if (ne(t(r))) return !0;
|
|
3003
2713
|
}
|
|
3004
2714
|
return !1;
|
|
3005
2715
|
}
|
|
@@ -3024,26 +2734,22 @@ function Pl(e) {
|
|
|
3024
2734
|
}
|
|
3025
2735
|
function at(e, t, n, r, u) {
|
|
3026
2736
|
let a = e.node, s = Z(a), o = u ? ze(e, t, n) : "";
|
|
3027
|
-
if (s.length === 0)
|
|
3028
|
-
return [o, "(", $(e, t, { filter: (p) => ge(t.originalText, I(p)) === ")" }), ")"];
|
|
2737
|
+
if (s.length === 0) return [o, "(", $(e, t, { filter: (p) => ge(t.originalText, I(p)) === ")" }), ")"];
|
|
3029
2738
|
let { parent: i } = e, l = nn(i), d = Yu(a), D = [];
|
|
3030
2739
|
if (po(e, (p, y) => {
|
|
3031
2740
|
let f = y === s.length - 1;
|
|
3032
2741
|
f && a.rest && D.push("..."), D.push(n()), !f && (D.push(","), l || d ? D.push(" ") : Ne(s[y], t) ? D.push(F, F) : D.push(C));
|
|
3033
2742
|
}), r && !Il(e)) {
|
|
3034
|
-
if (ne(o) || ne(D))
|
|
3035
|
-
throw new zt();
|
|
2743
|
+
if (ne(o) || ne(D)) throw new zt();
|
|
3036
2744
|
return m([Sn(o), "(", Sn(D), ")"]);
|
|
3037
2745
|
}
|
|
3038
2746
|
let c = s.every((p) => !J(p.decorators));
|
|
3039
2747
|
return d && c ? [o, "(", ...D, ")"] : l ? [o, "(", ...D, ")"] : (tu(i) || Qs(i) || i.type === "TypeAlias" || i.type === "UnionTypeAnnotation" || i.type === "IntersectionTypeAnnotation" || i.type === "FunctionTypeAnnotation" && i.returnType === a) && s.length === 1 && s[0].name === null && a.this !== s[0] && s[0].typeAnnotation && a.typeParameters === null && Un(s[0].typeAnnotation) && !a.rest ? t.arrowParens === "always" || a.type === "HookTypeAnnotation" ? ["(", ...D, ")"] : D : [o, "(", A([E, ...D]), w(!io(a) && Ie(t, "all") ? "," : ""), E, ")"];
|
|
3040
2748
|
}
|
|
3041
2749
|
function Yu(e) {
|
|
3042
|
-
if (!e)
|
|
3043
|
-
return !1;
|
|
2750
|
+
if (!e) return !1;
|
|
3044
2751
|
let t = Z(e);
|
|
3045
|
-
if (t.length !== 1)
|
|
3046
|
-
return !1;
|
|
2752
|
+
if (t.length !== 1) return !1;
|
|
3047
2753
|
let [n] = t;
|
|
3048
2754
|
return !h(n) && (n.type === "ObjectPattern" || n.type === "ArrayPattern" || n.type === "Identifier" && n.typeAnnotation && (n.typeAnnotation.type === "TypeAnnotation" || n.typeAnnotation.type === "TSTypeAnnotation") && Xe(n.typeAnnotation.typeAnnotation) || n.type === "FunctionTypeParam" && Xe(n.typeAnnotation) && n !== e.rest || n.type === "AssignmentPattern" && (n.left.type === "ObjectPattern" || n.left.type === "ArrayPattern") && (n.right.type === "Identifier" || Ae(n.right) && n.right.properties.length === 0 || Q(n.right) && n.right.elements.length === 0));
|
|
3049
2755
|
}
|
|
@@ -3054,16 +2760,13 @@ function wl(e) {
|
|
|
3054
2760
|
function gt(e, t) {
|
|
3055
2761
|
var n;
|
|
3056
2762
|
let r = wl(e);
|
|
3057
|
-
if (!r)
|
|
3058
|
-
return !1;
|
|
2763
|
+
if (!r) return !1;
|
|
3059
2764
|
let u = (n = e.typeParameters) == null ? void 0 : n.params;
|
|
3060
2765
|
if (u) {
|
|
3061
|
-
if (u.length > 1)
|
|
3062
|
-
return !1;
|
|
2766
|
+
if (u.length > 1) return !1;
|
|
3063
2767
|
if (u.length === 1) {
|
|
3064
2768
|
let a = u[0];
|
|
3065
|
-
if (a.constraint || a.default)
|
|
3066
|
-
return !1;
|
|
2769
|
+
if (a.constraint || a.default) return !1;
|
|
3067
2770
|
}
|
|
3068
2771
|
}
|
|
3069
2772
|
return Z(e).length === 1 && (Xe(r) || ne(t));
|
|
@@ -3084,8 +2787,7 @@ function Nl(e) {
|
|
|
3084
2787
|
var jl = _(["VoidTypeAnnotation", "TSVoidKeyword", "NullLiteralTypeAnnotation", "TSNullKeyword"]), Ll = _(["ObjectTypeAnnotation", "TSTypeLiteral", "GenericTypeAnnotation", "TSTypeReference"]);
|
|
3085
2788
|
function Ml(e) {
|
|
3086
2789
|
let { types: t } = e;
|
|
3087
|
-
if (t.some((r) => h(r)))
|
|
3088
|
-
return !1;
|
|
2790
|
+
if (t.some((r) => h(r))) return !1;
|
|
3089
2791
|
let n = t.find((r) => Ll(r));
|
|
3090
2792
|
return n ? t.every((r) => r === n || jl(r)) : !1;
|
|
3091
2793
|
}
|
|
@@ -3106,8 +2808,7 @@ function ta(e, t, n) {
|
|
|
3106
2808
|
let r = !1;
|
|
3107
2809
|
return m(e.map(({ isFirst: u, previous: a, node: s, index: o }) => {
|
|
3108
2810
|
let i = n();
|
|
3109
|
-
if (u)
|
|
3110
|
-
return i;
|
|
2811
|
+
if (u) return i;
|
|
3111
2812
|
let l = Xe(s), d = Xe(a);
|
|
3112
2813
|
return d && l ? [" & ", r ? A(i) : i] : !d && !l || Te(t.originalText, s) ? t.experimentalOperatorPosition === "start" ? A([C, "& ", i]) : A([" &", C, i]) : (o > 1 && (r = !0), [" & ", o > 1 ? A(i) : i]);
|
|
3113
2814
|
}, "types"));
|
|
@@ -3117,8 +2818,7 @@ function na(e, t, n) {
|
|
|
3117
2818
|
let D = n();
|
|
3118
2819
|
return s || (D = Be(2, D)), Fe(d, D, t);
|
|
3119
2820
|
}, "types");
|
|
3120
|
-
if (s)
|
|
3121
|
-
return N(" | ", o);
|
|
2821
|
+
if (s) return N(" | ", o);
|
|
3122
2822
|
let i = a && !Te(t.originalText, r), l = [w([i ? C : "", "| "]), N([C, "| "], o)];
|
|
3123
2823
|
return ut(e, t) ? m([A(l), E]) : (u.type === "TupleTypeAnnotation" || u.type === "TSTupleType") && u[u.type === "TupleTypeAnnotation" && u.types ? "types" : "elementTypes"].length > 1 ? m([A([w(["(", E]), l]), E, w(")")]) : m(a ? A(l) : l);
|
|
3124
2824
|
}
|
|
@@ -3154,8 +2854,7 @@ function oa(e, t, n) {
|
|
|
3154
2854
|
var ql = /* @__PURE__ */ new WeakSet();
|
|
3155
2855
|
function z(e, t, n = "typeAnnotation") {
|
|
3156
2856
|
let { node: { [n]: r } } = e;
|
|
3157
|
-
if (!r)
|
|
3158
|
-
return "";
|
|
2857
|
+
if (!r) return "";
|
|
3159
2858
|
let u = !1;
|
|
3160
2859
|
if (r.type === "TSTypeAnnotation" || r.type === "TypeAnnotation") {
|
|
3161
2860
|
let a = e.call(ia, n);
|
|
@@ -3217,16 +2916,13 @@ function $l(e, t, n, r) {
|
|
|
3217
2916
|
}
|
|
3218
2917
|
function ur(e, t, n) {
|
|
3219
2918
|
let { node: r } = e, u = [], a = "[", s = "]", o = r.type === "TupleTypeAnnotation" && r.types ? "types" : r.type === "TSTupleType" || r.type === "TupleTypeAnnotation" ? "elementTypes" : "elements", i = r[o];
|
|
3220
|
-
if (i.length === 0)
|
|
3221
|
-
u.push($l(e, t, a, s));
|
|
2919
|
+
if (i.length === 0) u.push($l(e, t, a, s));
|
|
3222
2920
|
else {
|
|
3223
|
-
let l = X(!1, i, -1), d = l?.type !== "RestElement" && !r.inexact, D = l === null, c = Symbol("array"), p = !t.__inJestEach && i.length > 1 && i.every((g, S, b) => {
|
|
2921
|
+
let l = X(!1, i, -1), d = l?.type !== "RestElement" && !r.inexact, D = l === null, c = /* @__PURE__ */ Symbol("array"), p = !t.__inJestEach && i.length > 1 && i.every((g, S, b) => {
|
|
3224
2922
|
let x = g?.type;
|
|
3225
|
-
if (!Q(g) && !Ae(g))
|
|
3226
|
-
return !1;
|
|
2923
|
+
if (!Q(g) && !Ae(g)) return !1;
|
|
3227
2924
|
let j = b[S + 1];
|
|
3228
|
-
if (j && x !== j.type)
|
|
3229
|
-
return !1;
|
|
2925
|
+
if (j && x !== j.type) return !1;
|
|
3230
2926
|
let v = Q(g) ? "elements" : "properties";
|
|
3231
2927
|
return g[v] && g[v].length > 1;
|
|
3232
2928
|
}), y = fa(r, t), f = d ? D ? "," : Ie(t) ? y ? w(",", "", { groupId: c }) : w(",") : "" : "";
|
|
@@ -3270,8 +2966,7 @@ function Hl(e, t) {
|
|
|
3270
2966
|
}
|
|
3271
2967
|
function Mt(e, t, n) {
|
|
3272
2968
|
let { node: r } = e;
|
|
3273
|
-
if (r.computed)
|
|
3274
|
-
return ["[", n("key"), "]"];
|
|
2969
|
+
if (r.computed) return ["[", n("key"), "]"];
|
|
3275
2970
|
let { parent: u } = e, { key: a } = r;
|
|
3276
2971
|
if (t.quoteProps === "consistent" && !Gt.has(u)) {
|
|
3277
2972
|
let s = e.siblings.some((o) => !o.computed && Y(o.key) && !Lr(o, t));
|
|
@@ -3289,8 +2984,7 @@ function Fn(e, t, n) {
|
|
|
3289
2984
|
}
|
|
3290
2985
|
var zl = ({ node: e, key: t, parent: n }) => t === "value" && e.type === "FunctionExpression" && (n.type === "ObjectMethod" || n.type === "ClassMethod" || n.type === "ClassPrivateMethod" || n.type === "MethodDefinition" || n.type === "TSAbstractMethodDefinition" || n.type === "TSDeclareMethod" || n.type === "Property" && tn(n));
|
|
3291
2986
|
function Aa(e, t, n, r) {
|
|
3292
|
-
if (zl(e))
|
|
3293
|
-
return ar(e, t, n);
|
|
2987
|
+
if (zl(e)) return ar(e, t, n);
|
|
3294
2988
|
let { node: u } = e, a = !1;
|
|
3295
2989
|
if ((u.type === "FunctionDeclaration" || u.type === "FunctionExpression") && r != null && r.expandLastArg) {
|
|
3296
2990
|
let { parent: d } = e;
|
|
@@ -3312,8 +3006,7 @@ function Ql(e) {
|
|
|
3312
3006
|
return t.length === 1 && !e.typeParameters && !h(e, T.Dangling) && t[0].type === "Identifier" && !t[0].typeAnnotation && !h(t[0]) && !t[0].optional && !e.predicate && !e.returnType;
|
|
3313
3007
|
}
|
|
3314
3008
|
function ga(e, t) {
|
|
3315
|
-
if (t.arrowParens === "always")
|
|
3316
|
-
return !1;
|
|
3009
|
+
if (t.arrowParens === "always") return !1;
|
|
3317
3010
|
if (t.arrowParens === "avoid") {
|
|
3318
3011
|
let { node: n } = e;
|
|
3319
3012
|
return Ql(n);
|
|
@@ -3340,13 +3033,10 @@ function Zl(e, t, n) {
|
|
|
3340
3033
|
return ["throw", xa(e, t, n)];
|
|
3341
3034
|
}
|
|
3342
3035
|
function ec(e, t) {
|
|
3343
|
-
if (Te(e.originalText, t) || h(t, T.Leading, (n) => ce(e.originalText, q(n), I(n))) && !K(t))
|
|
3344
|
-
return !0;
|
|
3036
|
+
if (Te(e.originalText, t) || h(t, T.Leading, (n) => ce(e.originalText, q(n), I(n))) && !K(t)) return !0;
|
|
3345
3037
|
if (Rn(t)) {
|
|
3346
3038
|
let n = t, r;
|
|
3347
|
-
for (; r = Us(n); )
|
|
3348
|
-
if (n = r, Te(e.originalText, n))
|
|
3349
|
-
return !0;
|
|
3039
|
+
for (; r = Us(n); ) if (n = r, Te(e.originalText, n)) return !0;
|
|
3350
3040
|
}
|
|
3351
3041
|
return !1;
|
|
3352
3042
|
}
|
|
@@ -3359,26 +3049,23 @@ function nc(e, t, n, r = {}) {
|
|
|
3359
3049
|
let u = [], a, s = [], o = !1, i = !r.expandLastArg && e.node.body.type === "ArrowFunctionExpression", l;
|
|
3360
3050
|
(function S() {
|
|
3361
3051
|
let { node: b } = e, x = rc(e, t, n, r);
|
|
3362
|
-
if (u.length === 0)
|
|
3363
|
-
u.push(x);
|
|
3052
|
+
if (u.length === 0) u.push(x);
|
|
3364
3053
|
else {
|
|
3365
3054
|
let { leading: j, trailing: v } = qu(e, t);
|
|
3366
3055
|
u.push([j, x]), s.unshift(v);
|
|
3367
3056
|
}
|
|
3368
3057
|
i && (o || (o = b.returnType && Z(b).length > 0 || b.typeParameters || Z(b).some((j) => j.type !== "Identifier"))), !i || b.body.type !== "ArrowFunctionExpression" ? (a = n("body", r), l = b.body) : e.call(S, "body");
|
|
3369
3058
|
})();
|
|
3370
|
-
let d = !Te(t.originalText, l) && (tc(l) || uc(l, a, t) || !o && ha(l)), D = e.key === "callee" && dt(e.parent), c = Symbol("arrow-chain"), p = ac(e, r, { signatureDocs: u, shouldBreak: o }), y = !1, f = !1, g = !1;
|
|
3059
|
+
let d = !Te(t.originalText, l) && (tc(l) || uc(l, a, t) || !o && ha(l)), D = e.key === "callee" && dt(e.parent), c = /* @__PURE__ */ Symbol("arrow-chain"), p = ac(e, r, { signatureDocs: u, shouldBreak: o }), y = !1, f = !1, g = !1;
|
|
3371
3060
|
return i && (D || r.assignmentLayout) && (f = !0, g = !h(e.node, T.Leading & T.Line), y = r.assignmentLayout === "chain-tail-arrow-chain" || D && !d), a = sc(e, t, r, { bodyDoc: a, bodyComments: s, functionBody: l, shouldPutBodyOnSameLine: d }), m([m(f ? A([g ? E : "", p]) : p, { shouldBreak: y, id: c }), " =>", i ? un(a, { groupId: c }) : m(a), i && D ? w(E, "", { groupId: c }) : ""]);
|
|
3372
3061
|
}
|
|
3373
3062
|
function rc(e, t, n, r) {
|
|
3374
3063
|
let { node: u } = e, a = [];
|
|
3375
|
-
if (u.async && a.push("async "), ga(e, t))
|
|
3376
|
-
a.push(n(["params", 0]));
|
|
3064
|
+
if (u.async && a.push("async "), ga(e, t)) a.push(n(["params", 0]));
|
|
3377
3065
|
else {
|
|
3378
3066
|
let o = r.expandLastArg || r.expandFirstArg, i = sn(e, n);
|
|
3379
3067
|
if (o) {
|
|
3380
|
-
if (ne(i))
|
|
3381
|
-
throw new zt();
|
|
3068
|
+
if (ne(i)) throw new zt();
|
|
3382
3069
|
i = m(Sn(i));
|
|
3383
3070
|
}
|
|
3384
3071
|
a.push(m([at(e, t, n, o, !0), i]));
|
|
@@ -3394,8 +3081,7 @@ function uc(e, t, n) {
|
|
|
3394
3081
|
return Q(e) || Ae(e) || e.type === "ArrowFunctionExpression" || e.type === "DoExpression" || e.type === "BlockStatement" || K(e) || ((r = t.label) == null ? void 0 : r.hug) !== !1 && (((u = t.label) == null ? void 0 : u.embed) || uu(e, n.originalText));
|
|
3395
3082
|
}
|
|
3396
3083
|
function ac(e, t, { signatureDocs: n, shouldBreak: r }) {
|
|
3397
|
-
if (n.length === 1)
|
|
3398
|
-
return n[0];
|
|
3084
|
+
if (n.length === 1) return n[0];
|
|
3399
3085
|
let { parent: u, key: a } = e;
|
|
3400
3086
|
return a !== "callee" && dt(u) || ke(u) ? m([n[0], " =>", A([C, N([" =>", C], n.slice(1))])], { shouldBreak: r }) : a === "callee" && dt(u) || t.assignmentLayout ? m(N([" =>", C], n), { shouldBreak: r }) : m(A(N([" =>", C], n)), { shouldBreak: r });
|
|
3401
3087
|
}
|
|
@@ -3405,12 +3091,10 @@ function sc(e, t, n, { bodyDoc: r, bodyComments: u, functionBody: a, shouldPutBo
|
|
|
3405
3091
|
}
|
|
3406
3092
|
var oc = (e, t, n) => {
|
|
3407
3093
|
if (!(e && t == null)) {
|
|
3408
|
-
if (t.findLast)
|
|
3409
|
-
return t.findLast(n);
|
|
3094
|
+
if (t.findLast) return t.findLast(n);
|
|
3410
3095
|
for (let r = t.length - 1; r >= 0; r--) {
|
|
3411
3096
|
let u = t[r];
|
|
3412
|
-
if (n(u, r, t))
|
|
3413
|
-
return u;
|
|
3097
|
+
if (n(u, r, t)) return u;
|
|
3414
3098
|
}
|
|
3415
3099
|
}
|
|
3416
3100
|
}, ic = oc;
|
|
@@ -3422,11 +3106,9 @@ function Mn(e, t, n, r) {
|
|
|
3422
3106
|
}
|
|
3423
3107
|
function Ca(e, t, n) {
|
|
3424
3108
|
let r = pc(e, t, n), { node: u, parent: a } = e;
|
|
3425
|
-
if (u.type === "Program" && a?.type !== "ModuleExpression")
|
|
3426
|
-
return r ? [r, F] : "";
|
|
3109
|
+
if (u.type === "Program" && a?.type !== "ModuleExpression") return r ? [r, F] : "";
|
|
3427
3110
|
let s = [];
|
|
3428
|
-
if (u.type === "StaticBlock" && s.push("static "), s.push("{"), r)
|
|
3429
|
-
s.push(A([F, r]), F);
|
|
3111
|
+
if (u.type === "StaticBlock" && s.push("static "), s.push("{"), r) s.push(A([F, r]), F);
|
|
3430
3112
|
else {
|
|
3431
3113
|
let o = e.grandparent;
|
|
3432
3114
|
a.type === "ArrowFunctionExpression" || a.type === "FunctionExpression" || a.type === "FunctionDeclaration" || a.type === "ComponentDeclaration" || a.type === "HookDeclaration" || a.type === "ObjectMethod" || a.type === "ClassMethod" || a.type === "ClassPrivateMethod" || a.type === "ForStatement" || a.type === "WhileStatement" || a.type === "DoWhileStatement" || a.type === "DoExpression" || a.type === "ModuleExpression" || a.type === "CatchClause" && !o.finalizer || a.type === "TSModuleDeclaration" || u.type === "StaticBlock" || s.push(F);
|
|
@@ -3435,8 +3117,7 @@ function Ca(e, t, n) {
|
|
|
3435
3117
|
}
|
|
3436
3118
|
function pc(e, t, n) {
|
|
3437
3119
|
let { node: r } = e, u = J(r.directives), a = r.body.some((i) => i.type !== "EmptyStatement"), s = h(r, T.Dangling);
|
|
3438
|
-
if (!u && !a && !s)
|
|
3439
|
-
return "";
|
|
3120
|
+
if (!u && !a && !s) return "";
|
|
3440
3121
|
let o = [];
|
|
3441
3122
|
return u && (o.push(Mn(e, t, n, "directives")), (a || s) && (o.push(F), Ne(X(!1, r.directives, -1), t) && o.push(F))), a && o.push(Mn(e, t, n, "body")), s && o.push($(e, t)), o;
|
|
3442
3123
|
}
|
|
@@ -3453,27 +3134,23 @@ function cc(e, t, n) {
|
|
|
3453
3134
|
}
|
|
3454
3135
|
function vt(e, t, n, r) {
|
|
3455
3136
|
let { node: u } = e;
|
|
3456
|
-
if (!u[r])
|
|
3457
|
-
|
|
3458
|
-
if (!Array.isArray(u[r]))
|
|
3459
|
-
return n(r);
|
|
3137
|
+
if (!u[r]) return "";
|
|
3138
|
+
if (!Array.isArray(u[r])) return n(r);
|
|
3460
3139
|
let a = nn(e.grandparent), s = e.match((i) => !(i[r].length === 1 && Xe(i[r][0])), void 0, (i, l) => l === "typeAnnotation", (i) => i.type === "Identifier", zu);
|
|
3461
|
-
if (u[r].length === 0 || !s && (a || u[r].length === 1 && (u[r][0].type === "NullableTypeAnnotation" || Zu(u[r][0]))))
|
|
3462
|
-
return ["<", N(", ", e.map(n, r)), Dc(e, t), ">"];
|
|
3140
|
+
if (u[r].length === 0 || !s && (a || u[r].length === 1 && (u[r][0].type === "NullableTypeAnnotation" || Zu(u[r][0])))) return ["<", N(", ", e.map(n, r)), Dc(e, t), ">"];
|
|
3463
3141
|
let o = u.type === "TSTypeParameterInstantiation" ? "" : cc(e, t, r) ? "," : Ie(t) ? w(",") : "";
|
|
3464
3142
|
return m(["<", A([E, N([",", C], e.map(n, r))]), o, E, ">"], { id: sr(u) });
|
|
3465
3143
|
}
|
|
3466
3144
|
function Dc(e, t) {
|
|
3467
3145
|
let { node: n } = e;
|
|
3468
|
-
if (!h(n, T.Dangling))
|
|
3469
|
-
return "";
|
|
3146
|
+
if (!h(n, T.Dangling)) return "";
|
|
3470
3147
|
let r = !h(n, T.Line), u = $(e, t, { indent: !r });
|
|
3471
3148
|
return r ? u : [u, F];
|
|
3472
3149
|
}
|
|
3473
3150
|
function Sa(e, t, n) {
|
|
3474
3151
|
let { node: r } = e, u = [r.const ? "const " : ""], a = r.type === "TSTypeParameter" ? n("name") : r.name;
|
|
3475
3152
|
if (r.variance && u.push(n("variance")), r.in && u.push("in "), r.out && u.push("out "), u.push(a), r.bound && (r.usesExtendsBound && u.push(" extends "), u.push(z(e, n, "bound"))), r.constraint) {
|
|
3476
|
-
let s = Symbol("constraint");
|
|
3153
|
+
let s = /* @__PURE__ */ Symbol("constraint");
|
|
3477
3154
|
u.push(" extends", m(A(C), { id: s }), we, un(n("constraint"), { groupId: s }));
|
|
3478
3155
|
}
|
|
3479
3156
|
return r.default && u.push(" = ", n("default")), m(u);
|
|
@@ -3484,15 +3161,13 @@ function Ba(e, t, n) {
|
|
|
3484
3161
|
if (r.id && s.push(" ", n("id")), s.push(n("typeParameters")), r.superClass) {
|
|
3485
3162
|
let d = [mc(e, t, n), n(r.superTypeArguments ? "superTypeArguments" : "superTypeParameters")], D = e.call((c) => ["extends ", Fe(c, d, t)], "superClass");
|
|
3486
3163
|
a ? o.push(C, m(D)) : o.push(" ", D);
|
|
3487
|
-
} else
|
|
3488
|
-
o.push(gn(e, t, n, "extends"));
|
|
3164
|
+
} else o.push(gn(e, t, n, "extends"));
|
|
3489
3165
|
o.push(gn(e, t, n, "mixins"), gn(e, t, n, "implements"));
|
|
3490
3166
|
let i;
|
|
3491
3167
|
if (a) {
|
|
3492
3168
|
let d;
|
|
3493
3169
|
ka(r) ? d = [...s, A(o)] : d = A([...s, o]), i = va(r), u.push(m(d, { id: i }));
|
|
3494
|
-
} else
|
|
3495
|
-
u.push(...s, ...o);
|
|
3170
|
+
} else u.push(...s, ...o);
|
|
3496
3171
|
let l = r.body;
|
|
3497
3172
|
return a && J(l.body) ? u.push(w(F, " ", { groupId: i })) : u.push(" "), u.push(n("body")), u;
|
|
3498
3173
|
}
|
|
@@ -3508,8 +3183,7 @@ function ka(e) {
|
|
|
3508
3183
|
}
|
|
3509
3184
|
function gn(e, t, n, r) {
|
|
3510
3185
|
let { node: u } = e;
|
|
3511
|
-
if (!J(u[r]))
|
|
3512
|
-
return "";
|
|
3186
|
+
if (!J(u[r])) return "";
|
|
3513
3187
|
let a = $(e, t, { marker: r });
|
|
3514
3188
|
return [ka(u) ? w(" ", C, { groupId: sr(u.typeParameters) }) : C, a, a && F, r, m(A([C, N([",", C], e.map(n, r))]))];
|
|
3515
3189
|
}
|
|
@@ -3536,17 +3210,13 @@ function fc(e, t, n) {
|
|
|
3536
3210
|
function Ec(e, t) {
|
|
3537
3211
|
var n;
|
|
3538
3212
|
let { type: r, name: u } = e.key;
|
|
3539
|
-
if (!e.computed && r === "Identifier" && (u === "static" || u === "get" || u === "set") && !e.value && !e.typeAnnotation)
|
|
3540
|
-
|
|
3541
|
-
if (!t || t.static || t.accessibility || t.readonly)
|
|
3542
|
-
return !1;
|
|
3213
|
+
if (!e.computed && r === "Identifier" && (u === "static" || u === "get" || u === "set") && !e.value && !e.typeAnnotation) return !0;
|
|
3214
|
+
if (!t || t.static || t.accessibility || t.readonly) return !1;
|
|
3543
3215
|
if (!t.computed) {
|
|
3544
3216
|
let a = (n = t.key) == null ? void 0 : n.name;
|
|
3545
|
-
if (a === "in" || a === "instanceof")
|
|
3546
|
-
return !0;
|
|
3217
|
+
if (a === "in" || a === "instanceof") return !0;
|
|
3547
3218
|
}
|
|
3548
|
-
if (ba(t) && t.variance && !t.static && !t.declare)
|
|
3549
|
-
return !0;
|
|
3219
|
+
if (ba(t) && t.variance && !t.static && !t.declare) return !0;
|
|
3550
3220
|
switch (t.type) {
|
|
3551
3221
|
case "ClassProperty":
|
|
3552
3222
|
case "PropertyDefinition":
|
|
@@ -3556,8 +3226,7 @@ function Ec(e, t) {
|
|
|
3556
3226
|
case "TSAbstractMethodDefinition":
|
|
3557
3227
|
case "ClassMethod":
|
|
3558
3228
|
case "ClassPrivateMethod": {
|
|
3559
|
-
if ((t.value ? t.value.async : t.async) || t.kind === "get" || t.kind === "set")
|
|
3560
|
-
return !1;
|
|
3229
|
+
if ((t.value ? t.value.async : t.async) || t.kind === "get" || t.kind === "set") return !1;
|
|
3561
3230
|
let a = t.value ? t.value.generator : t.generator;
|
|
3562
3231
|
return !!(t.computed || a);
|
|
3563
3232
|
}
|
|
@@ -3575,8 +3244,7 @@ function gc(e) {
|
|
|
3575
3244
|
return e.type === "MemberExpression" || e.type === "OptionalMemberExpression" || e.type === "Identifier" && e.name !== "undefined";
|
|
3576
3245
|
}
|
|
3577
3246
|
function xc(e, t) {
|
|
3578
|
-
if (t.semi || ja(e, t) || La(e, t))
|
|
3579
|
-
return !1;
|
|
3247
|
+
if (t.semi || ja(e, t) || La(e, t)) return !1;
|
|
3580
3248
|
let { node: n, key: r, parent: u } = e;
|
|
3581
3249
|
return !!(n.type === "ExpressionStatement" && (r === "body" && (u.type === "Program" || u.type === "BlockStatement" || u.type === "StaticBlock" || u.type === "TSModuleBlock") || r === "consequent" && u.type === "SwitchCase") && e.call(() => Na(e, t), "expression"));
|
|
3582
3250
|
}
|
|
@@ -3592,26 +3260,21 @@ function Na(e, t) {
|
|
|
3592
3260
|
case "RegExpLiteral":
|
|
3593
3261
|
return !0;
|
|
3594
3262
|
case "ArrowFunctionExpression":
|
|
3595
|
-
if (!ga(e, t))
|
|
3596
|
-
return !0;
|
|
3263
|
+
if (!ga(e, t)) return !0;
|
|
3597
3264
|
break;
|
|
3598
3265
|
case "UnaryExpression": {
|
|
3599
3266
|
let { prefix: r, operator: u } = n;
|
|
3600
|
-
if (r && (u === "+" || u === "-"))
|
|
3601
|
-
return !0;
|
|
3267
|
+
if (r && (u === "+" || u === "-")) return !0;
|
|
3602
3268
|
break;
|
|
3603
3269
|
}
|
|
3604
3270
|
case "BindExpression":
|
|
3605
|
-
if (!n.object)
|
|
3606
|
-
return !0;
|
|
3271
|
+
if (!n.object) return !0;
|
|
3607
3272
|
break;
|
|
3608
3273
|
case "Literal":
|
|
3609
|
-
if (n.regex)
|
|
3610
|
-
return !0;
|
|
3274
|
+
if (n.regex) return !0;
|
|
3611
3275
|
break;
|
|
3612
3276
|
default:
|
|
3613
|
-
if (K(n))
|
|
3614
|
-
return !0;
|
|
3277
|
+
if (K(n)) return !0;
|
|
3615
3278
|
}
|
|
3616
3279
|
return ut(e, t) ? !0 : Rn(n) ? e.call(() => Na(e, t), ...Yr(n)) : !1;
|
|
3617
3280
|
}
|
|
@@ -3626,15 +3289,13 @@ function hc(e, t, n) {
|
|
|
3626
3289
|
if (La(e, t)) {
|
|
3627
3290
|
let u = Ia(e.node.expression);
|
|
3628
3291
|
(Ac(u) || gc(u)) && r.push(";");
|
|
3629
|
-
} else
|
|
3630
|
-
ja(e, t) || t.semi && r.push(";");
|
|
3292
|
+
} else ja(e, t) || t.semi && r.push(";");
|
|
3631
3293
|
return r;
|
|
3632
3294
|
}
|
|
3633
3295
|
function Cc(e, t, n) {
|
|
3634
3296
|
if (t.__isVueBindings || t.__isVueForBindingLeft) {
|
|
3635
3297
|
let r = e.map(n, "program", "body", 0, "params");
|
|
3636
|
-
if (r.length === 1)
|
|
3637
|
-
return r[0];
|
|
3298
|
+
if (r.length === 1) return r[0];
|
|
3638
3299
|
let u = N([",", C], r);
|
|
3639
3300
|
return t.__isVueForBindingLeft ? ["(", A([E, m(u)]), E, ")"] : u;
|
|
3640
3301
|
}
|
|
@@ -3661,18 +3322,15 @@ function Tc(e, t) {
|
|
|
3661
3322
|
case "DirectiveLiteral":
|
|
3662
3323
|
return Or(n.extra.raw, t);
|
|
3663
3324
|
case "Literal": {
|
|
3664
|
-
if (n.regex)
|
|
3665
|
-
|
|
3666
|
-
if (n.bigint)
|
|
3667
|
-
return On(n.raw);
|
|
3325
|
+
if (n.regex) return Mr(n.regex);
|
|
3326
|
+
if (n.bigint) return On(n.raw);
|
|
3668
3327
|
let { value: r } = n;
|
|
3669
3328
|
return typeof r == "number" ? mt(n.raw) : typeof r == "string" ? Sc(e) ? Or(n.raw, t) : He(yt(n.raw, t)) : String(r);
|
|
3670
3329
|
}
|
|
3671
3330
|
}
|
|
3672
3331
|
}
|
|
3673
3332
|
function Sc(e) {
|
|
3674
|
-
if (e.key !== "expression")
|
|
3675
|
-
return;
|
|
3333
|
+
if (e.key !== "expression") return;
|
|
3676
3334
|
let { parent: t } = e;
|
|
3677
3335
|
return t.type === "ExpressionStatement" && typeof t.directive == "string";
|
|
3678
3336
|
}
|
|
@@ -3684,20 +3342,17 @@ function Mr({ pattern: e, flags: t }) {
|
|
|
3684
3342
|
}
|
|
3685
3343
|
function Or(e, t) {
|
|
3686
3344
|
let n = e.slice(1, -1);
|
|
3687
|
-
if (n.includes('"') || n.includes("'"))
|
|
3688
|
-
return e;
|
|
3345
|
+
if (n.includes('"') || n.includes("'")) return e;
|
|
3689
3346
|
let r = t.singleQuote ? "'" : '"';
|
|
3690
3347
|
return r + n + r;
|
|
3691
3348
|
}
|
|
3692
3349
|
function bc(e, t, n) {
|
|
3693
3350
|
let r = e.originalText.slice(t, n);
|
|
3694
|
-
for (let u of e[Symbol.for("comments")]) {
|
|
3351
|
+
for (let u of e[/* @__PURE__ */ Symbol.for("comments")]) {
|
|
3695
3352
|
let a = q(u);
|
|
3696
|
-
if (a > n)
|
|
3697
|
-
break;
|
|
3353
|
+
if (a > n) break;
|
|
3698
3354
|
let s = I(u);
|
|
3699
|
-
if (s < t)
|
|
3700
|
-
continue;
|
|
3355
|
+
if (s < t) continue;
|
|
3701
3356
|
let o = s - a;
|
|
3702
3357
|
r = r.slice(0, a - t) + " ".repeat(o) + r.slice(s - t);
|
|
3703
3358
|
}
|
|
@@ -3728,29 +3383,23 @@ function Pc(e) {
|
|
|
3728
3383
|
}
|
|
3729
3384
|
function qa(e, t, n) {
|
|
3730
3385
|
let { node: r } = e;
|
|
3731
|
-
if (!r.source)
|
|
3732
|
-
return "";
|
|
3386
|
+
if (!r.source) return "";
|
|
3733
3387
|
let u = [];
|
|
3734
3388
|
return Xa(r, t) && u.push(" from"), u.push(" ", n("source")), u;
|
|
3735
3389
|
}
|
|
3736
3390
|
function _a(e, t, n) {
|
|
3737
3391
|
let { node: r } = e;
|
|
3738
|
-
if (!Xa(r, t))
|
|
3739
|
-
return "";
|
|
3392
|
+
if (!Xa(r, t)) return "";
|
|
3740
3393
|
let u = [" "];
|
|
3741
3394
|
if (J(r.specifiers)) {
|
|
3742
3395
|
let a = [], s = [];
|
|
3743
3396
|
e.each(() => {
|
|
3744
3397
|
let o = e.node.type;
|
|
3745
|
-
if (o === "ExportNamespaceSpecifier" || o === "ExportDefaultSpecifier" || o === "ImportNamespaceSpecifier" || o === "ImportDefaultSpecifier")
|
|
3746
|
-
|
|
3747
|
-
else
|
|
3748
|
-
s.push(n());
|
|
3749
|
-
else
|
|
3750
|
-
throw new At(r, "specifier");
|
|
3398
|
+
if (o === "ExportNamespaceSpecifier" || o === "ExportDefaultSpecifier" || o === "ImportNamespaceSpecifier" || o === "ImportDefaultSpecifier") a.push(n());
|
|
3399
|
+
else if (o === "ExportSpecifier" || o === "ImportSpecifier") s.push(n());
|
|
3400
|
+
else throw new At(r, "specifier");
|
|
3751
3401
|
}, "specifiers"), u.push(N(", ", a)), s.length > 0 && (a.length > 0 && u.push(", "), s.length > 1 || a.length > 0 || r.specifiers.some((o) => h(o)) ? u.push(m(["{", A([t.bracketSpacing ? C : E, N([",", C], s)]), w(Ie(t) ? "," : ""), t.bracketSpacing ? C : E, "}"])) : u.push(["{", t.bracketSpacing ? " " : "", ...s, t.bracketSpacing ? " " : "", "}"]));
|
|
3752
|
-
} else
|
|
3753
|
-
u.push("{}");
|
|
3402
|
+
} else u.push("{}");
|
|
3754
3403
|
return u;
|
|
3755
3404
|
}
|
|
3756
3405
|
function Xa(e, t) {
|
|
@@ -3758,18 +3407,15 @@ function Xa(e, t) {
|
|
|
3758
3407
|
}
|
|
3759
3408
|
function wc(e, t) {
|
|
3760
3409
|
var n, r;
|
|
3761
|
-
if ((n = e.extra) != null && n.deprecatedAssertSyntax)
|
|
3762
|
-
return "assert";
|
|
3410
|
+
if ((n = e.extra) != null && n.deprecatedAssertSyntax) return "assert";
|
|
3763
3411
|
let u = or(t, I(e.source), (r = e.attributes) != null && r[0] ? q(e.attributes[0]) : I(e)).trimStart();
|
|
3764
3412
|
return u.startsWith("assert") ? "assert" : u.startsWith("with") || J(e.attributes) ? "with" : void 0;
|
|
3765
3413
|
}
|
|
3766
3414
|
function $a(e, t, n) {
|
|
3767
3415
|
let { node: r } = e;
|
|
3768
|
-
if (!r.source)
|
|
3769
|
-
return "";
|
|
3416
|
+
if (!r.source) return "";
|
|
3770
3417
|
let u = wc(r, t);
|
|
3771
|
-
if (!u)
|
|
3772
|
-
return "";
|
|
3418
|
+
if (!u) return "";
|
|
3773
3419
|
let a = [` ${u} {`];
|
|
3774
3420
|
return J(r.attributes) && (t.bracketSpacing && a.push(" "), a.push(N(", ", e.map(n, "attributes"))), t.bracketSpacing && a.push(" ")), a.push("}"), a;
|
|
3775
3421
|
}
|
|
@@ -3778,19 +3424,9 @@ function Ic(e, t, n) {
|
|
|
3778
3424
|
return u === "ExportNamespaceSpecifier" || u === "ImportNamespaceSpecifier" ? d = "*" : i && (d = n(s)), l && !Nc(r) && (D = n(o)), [ir(u === "ImportSpecifier" ? r.importKind : r.exportKind, !1), d, d && D ? " as " : "", D];
|
|
3779
3425
|
}
|
|
3780
3426
|
function Nc(e) {
|
|
3781
|
-
if (e.type !== "ImportSpecifier" && e.type !== "ExportSpecifier")
|
|
3782
|
-
return !1;
|
|
3427
|
+
if (e.type !== "ImportSpecifier" && e.type !== "ExportSpecifier") return !1;
|
|
3783
3428
|
let { local: t, [e.type === "ImportSpecifier" ? "imported" : "exported"]: n } = e;
|
|
3784
|
-
|
|
3785
|
-
return !1;
|
|
3786
|
-
if (Y(t))
|
|
3787
|
-
return t.value === n.value && se(t) === se(n);
|
|
3788
|
-
switch (t.type) {
|
|
3789
|
-
case "Identifier":
|
|
3790
|
-
return t.name === n.name;
|
|
3791
|
-
default:
|
|
3792
|
-
return !1;
|
|
3793
|
-
}
|
|
3429
|
+
return t.type !== n.type || !Ps(t, n) ? !1 : Y(t) ? t.value === n.value && se(t) === se(n) : t.type === "Identifier" ? t.name === n.name : !1;
|
|
3794
3430
|
}
|
|
3795
3431
|
function on(e, t, n) {
|
|
3796
3432
|
var r;
|
|
@@ -3807,17 +3443,14 @@ function on(e, t, n) {
|
|
|
3807
3443
|
if (h(a, T.Dangling)) {
|
|
3808
3444
|
let M = h(a, T.Line);
|
|
3809
3445
|
B = [$(e, t), M || pe(t.originalText, I(X(!1, Ke(a), -1))) ? F : C, "..."];
|
|
3810
|
-
} else
|
|
3811
|
-
B = ["..."];
|
|
3446
|
+
} else B = ["..."];
|
|
3812
3447
|
b.push([...S, ...B]);
|
|
3813
3448
|
}
|
|
3814
3449
|
let x = (r = X(!1, l, -1)) == null ? void 0 : r.node, j = !(a.inexact || a.hasUnknownMembers || x && (x.type === "RestElement" || (x.type === "TSPropertySignature" || x.type === "TSCallSignatureDeclaration" || x.type === "TSMethodSignature" || x.type === "TSConstructSignatureDeclaration" || x.type === "TSIndexSignature") && h(x, T.PrettierIgnore)) || e.match(void 0, (B, M) => B.type === "TSImportType" && M === "options")), v;
|
|
3815
3450
|
if (b.length === 0) {
|
|
3816
|
-
if (!h(a, T.Dangling))
|
|
3817
|
-
return [f, g, z(e, n)];
|
|
3451
|
+
if (!h(a, T.Dangling)) return [f, g, z(e, n)];
|
|
3818
3452
|
v = m([f, $(e, t, { indent: !0 }), E, g, re(e), z(e, n)]);
|
|
3819
|
-
} else
|
|
3820
|
-
v = [c && J(a.properties) ? yc(d) : "", f, A([t.bracketSpacing ? C : E, ...b]), w(j && (y !== "," || Ie(t)) ? y : ""), t.bracketSpacing ? C : E, g, re(e), z(e, n)];
|
|
3453
|
+
} else v = [c && J(a.properties) ? yc(d) : "", f, A([t.bracketSpacing ? C : E, ...b]), w(j && (y !== "," || Ie(t)) ? y : ""), t.bracketSpacing ? C : E, g, re(e), z(e, n)];
|
|
3821
3454
|
return e.match((B) => B.type === "ObjectPattern" && !J(B.decorators), xn) || Xe(a) && (e.match(void 0, (B, M) => M === "typeAnnotation", (B, M) => M === "typeAnnotation", xn) || e.match(void 0, (B, M) => B.type === "FunctionTypeParam" && M === "typeAnnotation", xn)) || !p && e.match((B) => B.type === "ObjectPattern", (B) => B.type === "AssignmentExpression" || B.type === "VariableDeclarator") ? v : m(v, { shouldBreak: p });
|
|
3822
3455
|
}
|
|
3823
3456
|
function xn(e, t) {
|
|
@@ -3829,8 +3462,7 @@ function jc(e) {
|
|
|
3829
3462
|
let r = t[n];
|
|
3830
3463
|
for (let u of ["test", "consequent", "alternate"]) {
|
|
3831
3464
|
let a = r[u];
|
|
3832
|
-
if (K(a))
|
|
3833
|
-
return !0;
|
|
3465
|
+
if (K(a)) return !0;
|
|
3834
3466
|
a.type === "ConditionalExpression" && t.push(a);
|
|
3835
3467
|
}
|
|
3836
3468
|
}
|
|
@@ -3843,8 +3475,7 @@ function Lc(e, t, n) {
|
|
|
3843
3475
|
var Mc = /* @__PURE__ */ new Map([["AssignmentExpression", "right"], ["VariableDeclarator", "init"], ["ReturnStatement", "argument"], ["ThrowStatement", "argument"], ["UnaryExpression", "argument"], ["YieldExpression", "argument"], ["AwaitExpression", "argument"]]);
|
|
3844
3476
|
function Oc(e) {
|
|
3845
3477
|
let { node: t } = e;
|
|
3846
|
-
if (t.type !== "ConditionalExpression")
|
|
3847
|
-
return !1;
|
|
3478
|
+
if (t.type !== "ConditionalExpression") return !1;
|
|
3848
3479
|
let n, r = t;
|
|
3849
3480
|
for (let u = 0; !n; u++) {
|
|
3850
3481
|
let a = e.getParentNode(u);
|
|
@@ -3882,8 +3513,7 @@ function _c(e, t, n, r) {
|
|
|
3882
3513
|
var Xc = /* @__PURE__ */ new Map([["AssignmentExpression", "right"], ["VariableDeclarator", "init"], ["ReturnStatement", "argument"], ["ThrowStatement", "argument"], ["UnaryExpression", "argument"], ["YieldExpression", "argument"], ["AwaitExpression", "argument"]]);
|
|
3883
3514
|
function $c(e) {
|
|
3884
3515
|
let { node: t } = e;
|
|
3885
|
-
if (t.type !== "ConditionalExpression")
|
|
3886
|
-
return !1;
|
|
3516
|
+
if (t.type !== "ConditionalExpression") return !1;
|
|
3887
3517
|
let n, r = t;
|
|
3888
3518
|
for (let u = 0; !n; u++) {
|
|
3889
3519
|
let a = e.getParentNode(u);
|
|
@@ -3897,8 +3527,7 @@ function $c(e) {
|
|
|
3897
3527
|
}
|
|
3898
3528
|
var hn = (e) => [w("("), A([E, e]), E, w(")")];
|
|
3899
3529
|
function pr(e, t, n, r) {
|
|
3900
|
-
if (!t.experimentalTernaries)
|
|
3901
|
-
return Jc(e, t, n);
|
|
3530
|
+
if (!t.experimentalTernaries) return Jc(e, t, n);
|
|
3902
3531
|
let { node: u } = e, a = u.type === "ConditionalExpression", s = Re(u), o = a ? "consequent" : "trueType", i = a ? "alternate" : "falseType", l = a ? ["test"] : ["checkType", "extendsType"], d = u[o], D = u[i], c = l.map((me) => u[me]), { parent: p } = e, y = p.type === u.type, f = y && l.some((me) => p[me] === u), g = y && p[i] === u, S = d.type === u.type, b = D.type === u.type, x = b || g, j = t.tabWidth > 2 || t.useTabs, v, B, M = 0;
|
|
3903
3532
|
do
|
|
3904
3533
|
B = v || u, v = e.getParentNode(M), M++;
|
|
@@ -3913,13 +3542,12 @@ function pr(e, t, n, r) {
|
|
|
3913
3542
|
}, "test"), !b && h(D, T.Dangling) && e.call((me) => {
|
|
3914
3543
|
xt.push($(me, t));
|
|
3915
3544
|
}, "alternate"), h(u, T.Dangling) && xt.push($(e, t));
|
|
3916
|
-
let Dr = Symbol("test"), za = Symbol("consequent"), Ot = Symbol("test-and-consequent"), Qa = a ? [hn(n("test")), u.test.type === "ConditionalExpression" ? ve : ""] : [n("checkType"), " ", "extends", " ", Re(u.extendsType) || u.extendsType.type === "TSMappedType" ? n("extendsType") : m(hn(n("extendsType")))], yr = m([Qa, " ?"], { id: Dr }), Ya = n(o), Jt = A([S || U && (K(d) || y || x) ? F : C, cr, Ya]), Za = lr ? m([yr, x ? Jt : w(Jt, m(Jt, { id: za }), { groupId: Dr })], { id: Ot }) : [yr, Jt], pn = n(i), dr = xe ? w(pn, cu(hn(pn)), { groupId: Ot }) : pn, ht = [Za, xt.length > 0 ? [A([F, xt]), F] : b ? F : xe ? w(C, " ", { groupId: Ot }) : C, ":", b ? " " : j ? lr ? w(ue, w(x || xe ? " " : ue, " "), { groupId: Ot }) : w(ue, " ") : " ", b ? dr : m([A(dr), U && !xe ? E : ""]), P && !Oe ? E : "", st ? ve : ""];
|
|
3545
|
+
let Dr = /* @__PURE__ */ Symbol("test"), za = /* @__PURE__ */ Symbol("consequent"), Ot = /* @__PURE__ */ Symbol("test-and-consequent"), Qa = a ? [hn(n("test")), u.test.type === "ConditionalExpression" ? ve : ""] : [n("checkType"), " ", "extends", " ", Re(u.extendsType) || u.extendsType.type === "TSMappedType" ? n("extendsType") : m(hn(n("extendsType")))], yr = m([Qa, " ?"], { id: Dr }), Ya = n(o), Jt = A([S || U && (K(d) || y || x) ? F : C, cr, Ya]), Za = lr ? m([yr, x ? Jt : w(Jt, m(Jt, { id: za }), { groupId: Dr })], { id: Ot }) : [yr, Jt], pn = n(i), dr = xe ? w(pn, cu(hn(pn)), { groupId: Ot }) : pn, ht = [Za, xt.length > 0 ? [A([F, xt]), F] : b ? F : xe ? w(C, " ", { groupId: Ot }) : C, ":", b ? " " : j ? lr ? w(ue, w(x || xe ? " " : ue, " "), { groupId: Ot }) : w(ue, " ") : " ", b ? dr : m([A(dr), U && !xe ? E : ""]), P && !Oe ? E : "", st ? ve : ""];
|
|
3917
3546
|
return O && !st ? m(A([E, m(ht)])) : O || G ? m(A(ht)) : Oe || s && f ? m([A([E, ht]), V ? E : ""]) : p === k ? m(ht) : ht;
|
|
3918
3547
|
}
|
|
3919
3548
|
function Rc(e, t, n, r) {
|
|
3920
3549
|
let { node: u } = e;
|
|
3921
|
-
if (Wn(u))
|
|
3922
|
-
return Tc(e, t);
|
|
3550
|
+
if (Wn(u)) return Tc(e, t);
|
|
3923
3551
|
let a = t.semi ? ";" : "", s = [];
|
|
3924
3552
|
switch (u.type) {
|
|
3925
3553
|
case "JsExpressionRoot":
|
|
@@ -3975,8 +3603,7 @@ function Rc(e, t, n, r) {
|
|
|
3975
3603
|
if (L(o) && o.callee === u || R(o) && o.object === u) {
|
|
3976
3604
|
s = [A([E, ...s]), E];
|
|
3977
3605
|
let i = e.findAncestor((l) => l.type === "AwaitExpression" || l.type === "BlockStatement");
|
|
3978
|
-
if (i?.type !== "AwaitExpression" || !te(i.argument, (l) => l === u))
|
|
3979
|
-
return m(s);
|
|
3606
|
+
if (i?.type !== "AwaitExpression" || !te(i.argument, (l) => l === u)) return m(s);
|
|
3980
3607
|
}
|
|
3981
3608
|
}
|
|
3982
3609
|
return s;
|
|
@@ -4132,7 +3759,6 @@ function Rc(e, t, n, r) {
|
|
|
4132
3759
|
return "?";
|
|
4133
3760
|
case "ModuleExpression":
|
|
4134
3761
|
return ["module ", n("body")];
|
|
4135
|
-
case "InterpreterDirective":
|
|
4136
3762
|
default:
|
|
4137
3763
|
throw new At(u, "ESTree");
|
|
4138
3764
|
}
|
|
@@ -4162,8 +3788,7 @@ function Wc(e, t, n) {
|
|
|
4162
3788
|
}
|
|
4163
3789
|
function Uc(e, t, n) {
|
|
4164
3790
|
let { node: r } = e, u = r.params;
|
|
4165
|
-
if (r.rest && (u = [...u, r.rest]), u.length === 0)
|
|
4166
|
-
return ["(", $(e, t, { filter: (s) => ge(t.originalText, I(s)) === ")" }), ")"];
|
|
3791
|
+
if (r.rest && (u = [...u, r.rest]), u.length === 0) return ["(", $(e, t, { filter: (s) => ge(t.originalText, I(s)) === ")" }), ")"];
|
|
4167
3792
|
let a = [];
|
|
4168
3793
|
return Vc(e, (s, o) => {
|
|
4169
3794
|
let i = o === u.length - 1;
|
|
@@ -4255,8 +3880,7 @@ function tD(e, t, n) {
|
|
|
4255
3880
|
}
|
|
4256
3881
|
function nD(e, t, n) {
|
|
4257
3882
|
let { node: r } = e;
|
|
4258
|
-
if (zr(r))
|
|
4259
|
-
return r.type.slice(0, -14).toLowerCase();
|
|
3883
|
+
if (zr(r)) return r.type.slice(0, -14).toLowerCase();
|
|
4260
3884
|
let u = t.semi ? ";" : "";
|
|
4261
3885
|
switch (r.type) {
|
|
4262
3886
|
case "ComponentDeclaration":
|
|
@@ -4409,10 +4033,8 @@ function nD(e, t, n) {
|
|
|
4409
4033
|
function rD(e, t, n) {
|
|
4410
4034
|
var r;
|
|
4411
4035
|
let { node: u } = e;
|
|
4412
|
-
if (!u.type.startsWith("TS"))
|
|
4413
|
-
|
|
4414
|
-
if (Qr(u))
|
|
4415
|
-
return u.type.slice(2, -7).toLowerCase();
|
|
4036
|
+
if (!u.type.startsWith("TS")) return;
|
|
4037
|
+
if (Qr(u)) return u.type.slice(2, -7).toLowerCase();
|
|
4416
4038
|
let a = t.semi ? ";" : "", s = [];
|
|
4417
4039
|
switch (u.type) {
|
|
4418
4040
|
case "TSThisType":
|
|
@@ -4540,18 +4162,15 @@ function rD(e, t, n) {
|
|
|
4540
4162
|
return jr(e, n, "?");
|
|
4541
4163
|
case "TSJSDocNonNullableType":
|
|
4542
4164
|
return jr(e, n, "!");
|
|
4543
|
-
case "TSParenthesizedType":
|
|
4544
4165
|
default:
|
|
4545
4166
|
throw new At(u, "TypeScript");
|
|
4546
4167
|
}
|
|
4547
4168
|
}
|
|
4548
4169
|
function uD(e, t, n, r) {
|
|
4549
|
-
if (_u(e))
|
|
4550
|
-
return Ep(e, t);
|
|
4170
|
+
if (_u(e)) return Ep(e, t);
|
|
4551
4171
|
for (let u of [tl, Kp, nD, rD, Rc]) {
|
|
4552
4172
|
let a = u(e, t, n, r);
|
|
4553
|
-
if (a !== void 0)
|
|
4554
|
-
return a;
|
|
4173
|
+
if (a !== void 0) return a;
|
|
4555
4174
|
}
|
|
4556
4175
|
}
|
|
4557
4176
|
var aD = _(["ClassMethod", "ClassPrivateMethod", "ClassProperty", "ClassAccessorProperty", "AccessorProperty", "TSAbstractAccessorProperty", "PropertyDefinition", "TSAbstractPropertyDefinition", "ClassPrivateProperty", "MethodDefinition", "TSAbstractMethodDefinition", "TSDeclareMethod"]);
|
|
@@ -4559,14 +4178,11 @@ function sD(e, t, n, r) {
|
|
|
4559
4178
|
var u;
|
|
4560
4179
|
e.isRoot && ((u = t.__onHtmlBindingRoot) == null || u.call(t, e.node, t));
|
|
4561
4180
|
let a = uD(e, t, n, r);
|
|
4562
|
-
if (!a)
|
|
4563
|
-
return "";
|
|
4181
|
+
if (!a) return "";
|
|
4564
4182
|
let { node: s } = e;
|
|
4565
|
-
if (aD(s))
|
|
4566
|
-
return a;
|
|
4183
|
+
if (aD(s)) return a;
|
|
4567
4184
|
let o = J(s.decorators), i = sl(e, t, n), l = s.type === "ClassExpression";
|
|
4568
|
-
if (o && !l)
|
|
4569
|
-
return bn(a, (c) => m([i, c]));
|
|
4185
|
+
if (o && !l) return bn(a, (c) => m([i, c]));
|
|
4570
4186
|
let d = ut(e, t), D = xc(e, t);
|
|
4571
4187
|
return !i && !d && !D ? a : bn(a, (c) => [D ? ";" : "", d ? "(" : "", d && l && o ? [A([C, i, c]), C] : [i, c], d ? ")" : ""]);
|
|
4572
4188
|
}
|
|
@@ -4579,8 +4195,7 @@ function dD(e, t, n) {
|
|
|
4579
4195
|
case "JsonRoot":
|
|
4580
4196
|
return [n("node"), F];
|
|
4581
4197
|
case "ArrayExpression": {
|
|
4582
|
-
if (r.elements.length === 0)
|
|
4583
|
-
return "[]";
|
|
4198
|
+
if (r.elements.length === 0) return "[]";
|
|
4584
4199
|
let u = e.map(() => e.node === null ? "null" : n(), "elements");
|
|
4585
4200
|
return ["[", A([F, N([",", F], u)]), F, "]"];
|
|
4586
4201
|
}
|
|
@@ -4619,15 +4234,12 @@ function Ha(e, t) {
|
|
|
4619
4234
|
r.type === "Identifier" ? t.key = { type: "StringLiteral", value: r.name } : r.type === "NumericLiteral" && (t.key = { type: "StringLiteral", value: String(r.value) });
|
|
4620
4235
|
return;
|
|
4621
4236
|
}
|
|
4622
|
-
if (n === "UnaryExpression" && e.operator === "+")
|
|
4623
|
-
return t.argument;
|
|
4237
|
+
if (n === "UnaryExpression" && e.operator === "+") return t.argument;
|
|
4624
4238
|
if (n === "ArrayExpression") {
|
|
4625
|
-
for (let [r, u] of e.elements.entries())
|
|
4626
|
-
u === null && t.elements.splice(r, 0, { type: "NullLiteral" });
|
|
4239
|
+
for (let [r, u] of e.elements.entries()) u === null && t.elements.splice(r, 0, { type: "NullLiteral" });
|
|
4627
4240
|
return;
|
|
4628
4241
|
}
|
|
4629
|
-
if (n === "TemplateLiteral")
|
|
4630
|
-
return { type: "StringLiteral", value: e.quasis[0].value.cooked };
|
|
4242
|
+
if (n === "TemplateLiteral") return { type: "StringLiteral", value: e.quasis[0].value.cooked };
|
|
4631
4243
|
}
|
|
4632
4244
|
Ha.ignoredProperties = mD;
|
|
4633
4245
|
var Tt = { bracketSpacing: { category: "Common", type: "boolean", default: !0, 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: !1, description: "Use single quotes instead of double quotes." }, bracketSameLine: { category: "Common", type: "boolean", default: !1, description: "Put > of opening tags on the last line instead of on a new line." }, singleAttributePerLine: { category: "Common", type: "boolean", default: !1, description: "Enforce single attribute per line in HTML, Vue and JSX." } }, _e = "JavaScript", fD = { arrowParens: { category: _e, 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: Tt.bracketSameLine, objectWrap: Tt.objectWrap, bracketSpacing: Tt.bracketSpacing, jsxBracketSameLine: { category: _e, type: "boolean", description: "Put > on the last line instead of at a new line.", deprecated: "2.4.0" }, semi: { category: _e, type: "boolean", default: !0, description: "Print semicolons.", oppositeDescription: "Do not print semicolons, except at the beginning of lines which may need them." }, experimentalOperatorPosition: { category: _e, 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: _e, type: "boolean", default: !1, 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: Tt.singleQuote, jsxSingleQuote: { category: _e, type: "boolean", default: !1, description: "Use single quotes in JSX." }, quoteProps: { category: _e, 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: _e, 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: Tt.singleAttributePerLine }, ED = fD, FD = { estree: Wr, "estree-json": Ka }, AD = [...rs, ...pD], gD = Rr;
|