@rexeus/typeweaver 0.3.2 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/chunk-AYKTAXMI.js +14954 -0
  2. package/dist/chunk-K3NQKI34.js +1 -3
  3. package/dist/cli-Q5T6SL57.js +14951 -0
  4. package/dist/cli.cjs +1045 -102301
  5. package/dist/cli.js +1 -2
  6. package/dist/entry.js +3 -3
  7. package/dist/index.cjs +1 -116227
  8. package/dist/index.js +1 -2
  9. package/dist/metafile-cjs.json +1 -0
  10. package/dist/metafile-esm.json +1 -0
  11. package/dist/tsx-loader-3QUDYASH.js +1 -3
  12. package/package.json +18 -8
  13. package/dist/acorn-TNAGPKCR.js +0 -3130
  14. package/dist/acorn-ZFAHQIG7.js +0 -3131
  15. package/dist/angular-3KXBV3WD.js +0 -3030
  16. package/dist/angular-WMVKTHFF.js +0 -3031
  17. package/dist/babel-5QZSVJOE.js +0 -7297
  18. package/dist/babel-V7SGJWS6.js +0 -7296
  19. package/dist/chunk-4ST7XK4F.js +0 -34641
  20. package/dist/chunk-MLKGABMK.js +0 -9
  21. package/dist/cli-GOSMI5D3.js +0 -34642
  22. package/dist/estree-QSPT5I7I.js +0 -4612
  23. package/dist/estree-Y36AM62I.js +0 -4613
  24. package/dist/flow-7LH7X5GA.js +0 -27547
  25. package/dist/flow-WHVBWPDR.js +0 -27546
  26. package/dist/glimmer-BHRIPYOK.js +0 -2894
  27. package/dist/glimmer-CBYXJR5M.js +0 -2895
  28. package/dist/graphql-7EJJJFHU.js +0 -1266
  29. package/dist/graphql-KKVSZXX7.js +0 -1267
  30. package/dist/html-M3WOAMIJ.js +0 -2927
  31. package/dist/html-YM5TKPVB.js +0 -2926
  32. package/dist/markdown-FIK6SNTF.js +0 -3551
  33. package/dist/markdown-X6DQGEVV.js +0 -3552
  34. package/dist/meriyah-FBUICA5T.js +0 -2684
  35. package/dist/meriyah-GWPOVAHY.js +0 -2685
  36. package/dist/postcss-N2W7KQ6Q.js +0 -5081
  37. package/dist/postcss-ODV7XV5T.js +0 -5080
  38. package/dist/typescript-BG63TNYD.js +0 -13203
  39. package/dist/typescript-IYJMK2NE.js +0 -13204
  40. package/dist/yaml-5FEMTYXO.js +0 -4225
  41. package/dist/yaml-DV3ZI4ZT.js +0 -4224
@@ -1,3131 +0,0 @@
1
- #!/usr/bin/env node
2
- import "./chunk-K3NQKI34.js";
3
-
4
- // ../../node_modules/.pnpm/prettier@3.7.4/node_modules/prettier/plugins/acorn.mjs
5
- var Ii = Object.create;
6
- var Be = Object.defineProperty;
7
- var Ni = Object.getOwnPropertyDescriptor;
8
- var Li = Object.getOwnPropertyNames;
9
- var Ri = Object.getPrototypeOf;
10
- var Vi = Object.prototype.hasOwnProperty;
11
- var ot = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports);
12
- var Oi = (e, t) => {
13
- for (var i in t) Be(e, i, { get: t[i], enumerable: true });
14
- };
15
- var Bi = (e, t, i, s) => {
16
- if (t && typeof t == "object" || typeof t == "function") for (let r of Li(t)) !Vi.call(e, r) && r !== i && Be(e, r, { get: () => t[r], enumerable: !(s = Ni(t, r)) || s.enumerable });
17
- return e;
18
- };
19
- var ut = (e, t, i) => (i = e != null ? Ii(Ri(e)) : {}, Bi(t || !e || !e.__esModule ? Be(i, "default", { value: e, enumerable: true }) : i, e));
20
- var Qt = ot((xr, zt) => {
21
- zt.exports = {};
22
- });
23
- var $e = ot((yr, Ye) => {
24
- "use strict";
25
- var _s = Qt(), Cs = /^[\da-fA-F]+$/, Ts = /^\d+$/, Yt = /* @__PURE__ */ new WeakMap();
26
- function $t(e) {
27
- e = e.Parser.acorn || e;
28
- let t = Yt.get(e);
29
- if (!t) {
30
- let i = e.tokTypes, s = e.TokContext, r = e.TokenType, o = new s("<tag", false), u = new s("</tag", false), p = new s("<tag>...</tag>", true, true), h = { tc_oTag: o, tc_cTag: u, tc_expr: p }, l = { jsxName: new r("jsxName"), jsxText: new r("jsxText", { beforeExpr: true }), jsxTagStart: new r("jsxTagStart", { startsExpr: true }), jsxTagEnd: new r("jsxTagEnd") };
31
- l.jsxTagStart.updateContext = function() {
32
- this.context.push(p), this.context.push(o), this.exprAllowed = false;
33
- }, l.jsxTagEnd.updateContext = function(m) {
34
- let S = this.context.pop();
35
- S === o && m === i.slash || S === u ? (this.context.pop(), this.exprAllowed = this.curContext() === p) : this.exprAllowed = true;
36
- }, t = { tokContexts: h, tokTypes: l }, Yt.set(e, t);
37
- }
38
- return t;
39
- }
40
- function pe(e) {
41
- if (!e) return e;
42
- if (e.type === "JSXIdentifier") return e.name;
43
- if (e.type === "JSXNamespacedName") return e.namespace.name + ":" + e.name.name;
44
- if (e.type === "JSXMemberExpression") return pe(e.object) + "." + pe(e.property);
45
- }
46
- Ye.exports = function(e) {
47
- return e = e || {}, function(t) {
48
- return Es({ allowNamespaces: e.allowNamespaces !== false, allowNamespacedObjects: !!e.allowNamespacedObjects }, t);
49
- };
50
- };
51
- Object.defineProperty(Ye.exports, "tokTypes", { get: function() {
52
- return $t(void 0).tokTypes;
53
- }, configurable: true, enumerable: true });
54
- function Es(e, t) {
55
- let i = t.acorn || void 0, s = $t(i), r = i.tokTypes, o = s.tokTypes, u = i.tokContexts, p = s.tokContexts.tc_oTag, h = s.tokContexts.tc_cTag, l = s.tokContexts.tc_expr, m = i.isNewLine, S = i.isIdentifierStart, E = i.isIdentifierChar;
56
- return class extends t {
57
- static get acornJsx() {
58
- return s;
59
- }
60
- jsx_readToken() {
61
- let c = "", x = this.pos;
62
- for (; ; ) {
63
- this.pos >= this.input.length && this.raise(this.start, "Unterminated JSX contents");
64
- let y = this.input.charCodeAt(this.pos);
65
- switch (y) {
66
- case 60:
67
- case 123:
68
- return this.pos === this.start ? y === 60 && this.exprAllowed ? (++this.pos, this.finishToken(o.jsxTagStart)) : this.getTokenFromCode(y) : (c += this.input.slice(x, this.pos), this.finishToken(o.jsxText, c));
69
- case 38:
70
- c += this.input.slice(x, this.pos), c += this.jsx_readEntity(), x = this.pos;
71
- break;
72
- case 62:
73
- case 125:
74
- this.raise(this.pos, "Unexpected token `" + this.input[this.pos] + "`. Did you mean `" + (y === 62 ? "&gt;" : "&rbrace;") + '` or `{"' + this.input[this.pos] + '"}`?');
75
- default:
76
- m(y) ? (c += this.input.slice(x, this.pos), c += this.jsx_readNewLine(true), x = this.pos) : ++this.pos;
77
- }
78
- }
79
- }
80
- jsx_readNewLine(c) {
81
- let x = this.input.charCodeAt(this.pos), y;
82
- return ++this.pos, x === 13 && this.input.charCodeAt(this.pos) === 10 ? (++this.pos, y = c ? `
83
- ` : `\r
84
- `) : y = String.fromCharCode(x), this.options.locations && (++this.curLine, this.lineStart = this.pos), y;
85
- }
86
- jsx_readString(c) {
87
- let x = "", y = ++this.pos;
88
- for (; ; ) {
89
- this.pos >= this.input.length && this.raise(this.start, "Unterminated string constant");
90
- let v = this.input.charCodeAt(this.pos);
91
- if (v === c) break;
92
- v === 38 ? (x += this.input.slice(y, this.pos), x += this.jsx_readEntity(), y = this.pos) : m(v) ? (x += this.input.slice(y, this.pos), x += this.jsx_readNewLine(false), y = this.pos) : ++this.pos;
93
- }
94
- return x += this.input.slice(y, this.pos++), this.finishToken(r.string, x);
95
- }
96
- jsx_readEntity() {
97
- let c = "", x = 0, y, v = this.input[this.pos];
98
- v !== "&" && this.raise(this.pos, "Entity must start with an ampersand");
99
- let I = ++this.pos;
100
- for (; this.pos < this.input.length && x++ < 10; ) {
101
- if (v = this.input[this.pos++], v === ";") {
102
- c[0] === "#" ? c[1] === "x" ? (c = c.substr(2), Cs.test(c) && (y = String.fromCharCode(parseInt(c, 16)))) : (c = c.substr(1), Ts.test(c) && (y = String.fromCharCode(parseInt(c, 10)))) : y = _s[c];
103
- break;
104
- }
105
- c += v;
106
- }
107
- return y || (this.pos = I, "&");
108
- }
109
- jsx_readWord() {
110
- let c, x = this.pos;
111
- do
112
- c = this.input.charCodeAt(++this.pos);
113
- while (E(c) || c === 45);
114
- return this.finishToken(o.jsxName, this.input.slice(x, this.pos));
115
- }
116
- jsx_parseIdentifier() {
117
- let c = this.startNode();
118
- return this.type === o.jsxName ? c.name = this.value : this.type.keyword ? c.name = this.type.keyword : this.unexpected(), this.next(), this.finishNode(c, "JSXIdentifier");
119
- }
120
- jsx_parseNamespacedName() {
121
- let c = this.start, x = this.startLoc, y = this.jsx_parseIdentifier();
122
- if (!e.allowNamespaces || !this.eat(r.colon)) return y;
123
- var v = this.startNodeAt(c, x);
124
- return v.namespace = y, v.name = this.jsx_parseIdentifier(), this.finishNode(v, "JSXNamespacedName");
125
- }
126
- jsx_parseElementName() {
127
- if (this.type === o.jsxTagEnd) return "";
128
- let c = this.start, x = this.startLoc, y = this.jsx_parseNamespacedName();
129
- for (this.type === r.dot && y.type === "JSXNamespacedName" && !e.allowNamespacedObjects && this.unexpected(); this.eat(r.dot); ) {
130
- let v = this.startNodeAt(c, x);
131
- v.object = y, v.property = this.jsx_parseIdentifier(), y = this.finishNode(v, "JSXMemberExpression");
132
- }
133
- return y;
134
- }
135
- jsx_parseAttributeValue() {
136
- switch (this.type) {
137
- case r.braceL:
138
- let c = this.jsx_parseExpressionContainer();
139
- return c.expression.type === "JSXEmptyExpression" && this.raise(c.start, "JSX attributes must only be assigned a non-empty expression"), c;
140
- case o.jsxTagStart:
141
- case r.string:
142
- return this.parseExprAtom();
143
- default:
144
- this.raise(this.start, "JSX value should be either an expression or a quoted JSX text");
145
- }
146
- }
147
- jsx_parseEmptyExpression() {
148
- let c = this.startNodeAt(this.lastTokEnd, this.lastTokEndLoc);
149
- return this.finishNodeAt(c, "JSXEmptyExpression", this.start, this.startLoc);
150
- }
151
- jsx_parseExpressionContainer() {
152
- let c = this.startNode();
153
- return this.next(), c.expression = this.type === r.braceR ? this.jsx_parseEmptyExpression() : this.parseExpression(), this.expect(r.braceR), this.finishNode(c, "JSXExpressionContainer");
154
- }
155
- jsx_parseAttribute() {
156
- let c = this.startNode();
157
- return this.eat(r.braceL) ? (this.expect(r.ellipsis), c.argument = this.parseMaybeAssign(), this.expect(r.braceR), this.finishNode(c, "JSXSpreadAttribute")) : (c.name = this.jsx_parseNamespacedName(), c.value = this.eat(r.eq) ? this.jsx_parseAttributeValue() : null, this.finishNode(c, "JSXAttribute"));
158
- }
159
- jsx_parseOpeningElementAt(c, x) {
160
- let y = this.startNodeAt(c, x);
161
- y.attributes = [];
162
- let v = this.jsx_parseElementName();
163
- for (v && (y.name = v); this.type !== r.slash && this.type !== o.jsxTagEnd; ) y.attributes.push(this.jsx_parseAttribute());
164
- return y.selfClosing = this.eat(r.slash), this.expect(o.jsxTagEnd), this.finishNode(y, v ? "JSXOpeningElement" : "JSXOpeningFragment");
165
- }
166
- jsx_parseClosingElementAt(c, x) {
167
- let y = this.startNodeAt(c, x), v = this.jsx_parseElementName();
168
- return v && (y.name = v), this.expect(o.jsxTagEnd), this.finishNode(y, v ? "JSXClosingElement" : "JSXClosingFragment");
169
- }
170
- jsx_parseElementAt(c, x) {
171
- let y = this.startNodeAt(c, x), v = [], I = this.jsx_parseOpeningElementAt(c, x), de = null;
172
- if (!I.selfClosing) {
173
- e: for (; ; ) switch (this.type) {
174
- case o.jsxTagStart:
175
- if (c = this.start, x = this.startLoc, this.next(), this.eat(r.slash)) {
176
- de = this.jsx_parseClosingElementAt(c, x);
177
- break e;
178
- }
179
- v.push(this.jsx_parseElementAt(c, x));
180
- break;
181
- case o.jsxText:
182
- v.push(this.parseExprAtom());
183
- break;
184
- case r.braceL:
185
- v.push(this.jsx_parseExpressionContainer());
186
- break;
187
- default:
188
- this.unexpected();
189
- }
190
- pe(de.name) !== pe(I.name) && this.raise(de.start, "Expected corresponding JSX closing tag for <" + pe(I.name) + ">");
191
- }
192
- let Oe = I.name ? "Element" : "Fragment";
193
- return y["opening" + Oe] = I, y["closing" + Oe] = de, y.children = v, this.type === r.relational && this.value === "<" && this.raise(this.start, "Adjacent JSX elements must be wrapped in an enclosing tag"), this.finishNode(y, "JSX" + Oe);
194
- }
195
- jsx_parseText() {
196
- let c = this.parseLiteral(this.value);
197
- return c.type = "JSXText", c;
198
- }
199
- jsx_parseElement() {
200
- let c = this.start, x = this.startLoc;
201
- return this.next(), this.jsx_parseElementAt(c, x);
202
- }
203
- parseExprAtom(c) {
204
- return this.type === o.jsxText ? this.jsx_parseText() : this.type === o.jsxTagStart ? this.jsx_parseElement() : super.parseExprAtom(c);
205
- }
206
- readToken(c) {
207
- let x = this.curContext();
208
- if (x === l) return this.jsx_readToken();
209
- if (x === p || x === h) {
210
- if (S(c)) return this.jsx_readWord();
211
- if (c == 62) return ++this.pos, this.finishToken(o.jsxTagEnd);
212
- if ((c === 34 || c === 39) && x == p) return this.jsx_readString(c);
213
- }
214
- return c === 60 && this.exprAllowed && this.input.charCodeAt(this.pos + 1) !== 33 ? (++this.pos, this.finishToken(o.jsxTagStart)) : super.readToken(c);
215
- }
216
- updateContext(c) {
217
- if (this.type == r.braceL) {
218
- var x = this.curContext();
219
- x == p ? this.context.push(u.b_expr) : x == l ? this.context.push(u.b_tmpl) : super.updateContext(c), this.exprAllowed = true;
220
- } else if (this.type === r.slash && c === o.jsxTagStart) this.context.length -= 2, this.context.push(h), this.exprAllowed = false;
221
- else return super.updateContext(c);
222
- }
223
- };
224
- }
225
- });
226
- var Pi = {};
227
- Oi(Pi, { parsers: () => dr });
228
- var Di = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 80, 3, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 343, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 726, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
229
- var dt = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 2, 60, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 42, 9, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 496, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191];
230
- var Mi = "\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65";
231
- var mt = "\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC";
232
- var De = { 3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile", 5: "class enum extends super const export import", 6: "enum", strict: "implements interface let package private protected public static yield", strictBind: "eval arguments" };
233
- var Me = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this";
234
- var Fi = { 5: Me, "5module": Me + " export import", 6: Me + " const class extends export import super" };
235
- var ji = /^in(stanceof)?$/;
236
- var Ui = new RegExp("[" + mt + "]");
237
- var Gi = new RegExp("[" + mt + Mi + "]");
238
- function je(e, t) {
239
- for (var i = 65536, s = 0; s < t.length; s += 2) {
240
- if (i += t[s], i > e) return false;
241
- if (i += t[s + 1], i >= e) return true;
242
- }
243
- return false;
244
- }
245
- function j(e, t) {
246
- return e < 65 ? e === 36 : e < 91 ? true : e < 97 ? e === 95 : e < 123 ? true : e <= 65535 ? e >= 170 && Ui.test(String.fromCharCode(e)) : t === false ? false : je(e, dt);
247
- }
248
- function X(e, t) {
249
- return e < 48 ? e === 36 : e < 58 ? true : e < 65 ? false : e < 91 ? true : e < 97 ? e === 95 : e < 123 ? true : e <= 65535 ? e >= 170 && Gi.test(String.fromCharCode(e)) : t === false ? false : je(e, dt) || je(e, Di);
250
- }
251
- var C = function(t, i) {
252
- i === void 0 && (i = {}), this.label = t, this.keyword = i.keyword, this.beforeExpr = !!i.beforeExpr, this.startsExpr = !!i.startsExpr, this.isLoop = !!i.isLoop, this.isAssign = !!i.isAssign, this.prefix = !!i.prefix, this.postfix = !!i.postfix, this.binop = i.binop || null, this.updateContext = null;
253
- };
254
- function V(e, t) {
255
- return new C(e, { beforeExpr: true, binop: t });
256
- }
257
- var O = { beforeExpr: true };
258
- var N = { startsExpr: true };
259
- var Je = {};
260
- function _(e, t) {
261
- return t === void 0 && (t = {}), t.keyword = e, Je[e] = new C(e, t);
262
- }
263
- var a = { num: new C("num", N), regexp: new C("regexp", N), string: new C("string", N), name: new C("name", N), privateId: new C("privateId", N), eof: new C("eof"), bracketL: new C("[", { beforeExpr: true, startsExpr: true }), bracketR: new C("]"), braceL: new C("{", { beforeExpr: true, startsExpr: true }), braceR: new C("}"), parenL: new C("(", { beforeExpr: true, startsExpr: true }), parenR: new C(")"), comma: new C(",", O), semi: new C(";", O), colon: new C(":", O), dot: new C("."), question: new C("?", O), questionDot: new C("?."), arrow: new C("=>", O), template: new C("template"), invalidTemplate: new C("invalidTemplate"), ellipsis: new C("...", O), backQuote: new C("`", N), dollarBraceL: new C("${", { beforeExpr: true, startsExpr: true }), eq: new C("=", { beforeExpr: true, isAssign: true }), assign: new C("_=", { beforeExpr: true, isAssign: true }), incDec: new C("++/--", { prefix: true, postfix: true, startsExpr: true }), prefix: new C("!/~", { beforeExpr: true, prefix: true, startsExpr: true }), logicalOR: V("||", 1), logicalAND: V("&&", 2), bitwiseOR: V("|", 3), bitwiseXOR: V("^", 4), bitwiseAND: V("&", 5), equality: V("==/!=/===/!==", 6), relational: V("</>/<=/>=", 7), bitShift: V("<</>>/>>>", 8), plusMin: new C("+/-", { beforeExpr: true, binop: 9, prefix: true, startsExpr: true }), modulo: V("%", 10), star: V("*", 10), slash: V("/", 10), starstar: new C("**", { beforeExpr: true }), coalesce: V("??", 1), _break: _("break"), _case: _("case", O), _catch: _("catch"), _continue: _("continue"), _debugger: _("debugger"), _default: _("default", O), _do: _("do", { isLoop: true, beforeExpr: true }), _else: _("else", O), _finally: _("finally"), _for: _("for", { isLoop: true }), _function: _("function", N), _if: _("if"), _return: _("return", O), _switch: _("switch"), _throw: _("throw", O), _try: _("try"), _var: _("var"), _const: _("const"), _while: _("while", { isLoop: true }), _with: _("with"), _new: _("new", { beforeExpr: true, startsExpr: true }), _this: _("this", N), _super: _("super", N), _class: _("class", N), _extends: _("extends", O), _export: _("export"), _import: _("import", N), _null: _("null", N), _true: _("true", N), _false: _("false", N), _in: _("in", { beforeExpr: true, binop: 7 }), _instanceof: _("instanceof", { beforeExpr: true, binop: 7 }), _typeof: _("typeof", { beforeExpr: true, prefix: true, startsExpr: true }), _void: _("void", { beforeExpr: true, prefix: true, startsExpr: true }), _delete: _("delete", { beforeExpr: true, prefix: true, startsExpr: true }) };
264
- var L = /\r\n?|\n|\u2028|\u2029/;
265
- var qi = new RegExp(L.source, "g");
266
- function Y(e) {
267
- return e === 10 || e === 13 || e === 8232 || e === 8233;
268
- }
269
- function xt(e, t, i) {
270
- i === void 0 && (i = e.length);
271
- for (var s = t; s < i; s++) {
272
- var r = e.charCodeAt(s);
273
- if (Y(r)) return s < i - 1 && r === 13 && e.charCodeAt(s + 1) === 10 ? s + 2 : s + 1;
274
- }
275
- return -1;
276
- }
277
- var yt = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/;
278
- var k = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
279
- var gt = Object.prototype;
280
- var Ji = gt.hasOwnProperty;
281
- var Ki = gt.toString;
282
- var $ = Object.hasOwn || (function(e, t) {
283
- return Ji.call(e, t);
284
- });
285
- var ht = Array.isArray || (function(e) {
286
- return Ki.call(e) === "[object Array]";
287
- });
288
- var pt = /* @__PURE__ */ Object.create(null);
289
- function H(e) {
290
- return pt[e] || (pt[e] = new RegExp("^(?:" + e.replace(/ /g, "|") + ")$"));
291
- }
292
- function q(e) {
293
- return e <= 65535 ? String.fromCharCode(e) : (e -= 65536, String.fromCharCode((e >> 10) + 55296, (e & 1023) + 56320));
294
- }
295
- var Hi = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/;
296
- var ne = function(t, i) {
297
- this.line = t, this.column = i;
298
- };
299
- ne.prototype.offset = function(t) {
300
- return new ne(this.line, this.column + t);
301
- };
302
- var be = function(t, i, s) {
303
- this.start = i, this.end = s, t.sourceFile !== null && (this.source = t.sourceFile);
304
- };
305
- function vt(e, t) {
306
- for (var i = 1, s = 0; ; ) {
307
- var r = xt(e, s, t);
308
- if (r < 0) return new ne(i, t - s);
309
- ++i, s = r;
310
- }
311
- }
312
- var Ue = { ecmaVersion: null, sourceType: "script", onInsertedSemicolon: null, onTrailingComma: null, allowReserved: null, allowReturnOutsideFunction: false, allowImportExportEverywhere: false, allowAwaitOutsideFunction: null, allowSuperOutsideMethod: null, allowHashBang: false, checkPrivateFields: true, locations: false, onToken: null, onComment: null, ranges: false, program: null, sourceFile: null, directSourceFile: null, preserveParens: false };
313
- var ct = false;
314
- function Xi(e) {
315
- var t = {};
316
- for (var i in Ue) t[i] = e && $(e, i) ? e[i] : Ue[i];
317
- if (t.ecmaVersion === "latest" ? t.ecmaVersion = 1e8 : t.ecmaVersion == null ? (!ct && typeof console == "object" && console.warn && (ct = true, console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
318
- Defaulting to 2020, but this will stop working in the future.`)), t.ecmaVersion = 11) : t.ecmaVersion >= 2015 && (t.ecmaVersion -= 2009), t.allowReserved == null && (t.allowReserved = t.ecmaVersion < 5), (!e || e.allowHashBang == null) && (t.allowHashBang = t.ecmaVersion >= 14), ht(t.onToken)) {
319
- var s = t.onToken;
320
- t.onToken = function(r) {
321
- return s.push(r);
322
- };
323
- }
324
- return ht(t.onComment) && (t.onComment = Wi(t, t.onComment)), t;
325
- }
326
- function Wi(e, t) {
327
- return function(i, s, r, o, u, p) {
328
- var h = { type: i ? "Block" : "Line", value: s, start: r, end: o };
329
- e.locations && (h.loc = new be(this, u, p)), e.ranges && (h.range = [r, o]), t.push(h);
330
- };
331
- }
332
- var oe = 1;
333
- var Z = 2;
334
- var Ke = 4;
335
- var bt = 8;
336
- var He = 16;
337
- var St = 32;
338
- var Se = 64;
339
- var _t = 128;
340
- var z = 256;
341
- var ue = 512;
342
- var _e = oe | Z | z;
343
- function Xe(e, t) {
344
- return Z | (e ? Ke : 0) | (t ? bt : 0);
345
- }
346
- var xe = 0;
347
- var We = 1;
348
- var K = 2;
349
- var Ct = 3;
350
- var Tt = 4;
351
- var Et = 5;
352
- var A = function(t, i, s) {
353
- this.options = t = Xi(t), this.sourceFile = t.sourceFile, this.keywords = H(Fi[t.ecmaVersion >= 6 ? 6 : t.sourceType === "module" ? "5module" : 5]);
354
- var r = "";
355
- t.allowReserved !== true && (r = De[t.ecmaVersion >= 6 ? 6 : t.ecmaVersion === 5 ? 5 : 3], t.sourceType === "module" && (r += " await")), this.reservedWords = H(r);
356
- var o = (r ? r + " " : "") + De.strict;
357
- this.reservedWordsStrict = H(o), this.reservedWordsStrictBind = H(o + " " + De.strictBind), this.input = String(i), this.containsEsc = false, s ? (this.pos = s, this.lineStart = this.input.lastIndexOf(`
358
- `, s - 1) + 1, this.curLine = this.input.slice(0, this.lineStart).split(L).length) : (this.pos = this.lineStart = 0, this.curLine = 1), this.type = a.eof, this.value = null, this.start = this.end = this.pos, this.startLoc = this.endLoc = this.curPosition(), this.lastTokEndLoc = this.lastTokStartLoc = null, this.lastTokStart = this.lastTokEnd = this.pos, this.context = this.initialContext(), this.exprAllowed = true, this.inModule = t.sourceType === "module", this.strict = this.inModule || this.strictDirective(this.pos), this.potentialArrowAt = -1, this.potentialArrowInForAwait = false, this.yieldPos = this.awaitPos = this.awaitIdentPos = 0, this.labels = [], this.undefinedExports = /* @__PURE__ */ Object.create(null), this.pos === 0 && t.allowHashBang && this.input.slice(0, 2) === "#!" && this.skipLineComment(2), this.scopeStack = [], this.enterScope(oe), this.regexpState = null, this.privateNameStack = [];
359
- };
360
- var U = { inFunction: { configurable: true }, inGenerator: { configurable: true }, inAsync: { configurable: true }, canAwait: { configurable: true }, allowSuper: { configurable: true }, allowDirectSuper: { configurable: true }, treatFunctionsAsVar: { configurable: true }, allowNewDotTarget: { configurable: true }, inClassStaticBlock: { configurable: true } };
361
- A.prototype.parse = function() {
362
- var t = this.options.program || this.startNode();
363
- return this.nextToken(), this.parseTopLevel(t);
364
- };
365
- U.inFunction.get = function() {
366
- return (this.currentVarScope().flags & Z) > 0;
367
- };
368
- U.inGenerator.get = function() {
369
- return (this.currentVarScope().flags & bt) > 0;
370
- };
371
- U.inAsync.get = function() {
372
- return (this.currentVarScope().flags & Ke) > 0;
373
- };
374
- U.canAwait.get = function() {
375
- for (var e = this.scopeStack.length - 1; e >= 0; e--) {
376
- var t = this.scopeStack[e], i = t.flags;
377
- if (i & (z | ue)) return false;
378
- if (i & Z) return (i & Ke) > 0;
379
- }
380
- return this.inModule && this.options.ecmaVersion >= 13 || this.options.allowAwaitOutsideFunction;
381
- };
382
- U.allowSuper.get = function() {
383
- var e = this.currentThisScope(), t = e.flags;
384
- return (t & Se) > 0 || this.options.allowSuperOutsideMethod;
385
- };
386
- U.allowDirectSuper.get = function() {
387
- return (this.currentThisScope().flags & _t) > 0;
388
- };
389
- U.treatFunctionsAsVar.get = function() {
390
- return this.treatFunctionsAsVarInScope(this.currentScope());
391
- };
392
- U.allowNewDotTarget.get = function() {
393
- for (var e = this.scopeStack.length - 1; e >= 0; e--) {
394
- var t = this.scopeStack[e], i = t.flags;
395
- if (i & (z | ue) || i & Z && !(i & He)) return true;
396
- }
397
- return false;
398
- };
399
- U.inClassStaticBlock.get = function() {
400
- return (this.currentVarScope().flags & z) > 0;
401
- };
402
- A.extend = function() {
403
- for (var t = [], i = arguments.length; i--; ) t[i] = arguments[i];
404
- for (var s = this, r = 0; r < t.length; r++) s = t[r](s);
405
- return s;
406
- };
407
- A.parse = function(t, i) {
408
- return new this(i, t).parse();
409
- };
410
- A.parseExpressionAt = function(t, i, s) {
411
- var r = new this(s, t, i);
412
- return r.nextToken(), r.parseExpression();
413
- };
414
- A.tokenizer = function(t, i) {
415
- return new this(i, t);
416
- };
417
- Object.defineProperties(A.prototype, U);
418
- var w = A.prototype;
419
- var zi = /^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;
420
- w.strictDirective = function(e) {
421
- if (this.options.ecmaVersion < 5) return false;
422
- for (; ; ) {
423
- k.lastIndex = e, e += k.exec(this.input)[0].length;
424
- var t = zi.exec(this.input.slice(e));
425
- if (!t) return false;
426
- if ((t[1] || t[2]) === "use strict") {
427
- k.lastIndex = e + t[0].length;
428
- var i = k.exec(this.input), s = i.index + i[0].length, r = this.input.charAt(s);
429
- return r === ";" || r === "}" || L.test(i[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(r) || r === "!" && this.input.charAt(s + 1) === "=");
430
- }
431
- e += t[0].length, k.lastIndex = e, e += k.exec(this.input)[0].length, this.input[e] === ";" && e++;
432
- }
433
- };
434
- w.eat = function(e) {
435
- return this.type === e ? (this.next(), true) : false;
436
- };
437
- w.isContextual = function(e) {
438
- return this.type === a.name && this.value === e && !this.containsEsc;
439
- };
440
- w.eatContextual = function(e) {
441
- return this.isContextual(e) ? (this.next(), true) : false;
442
- };
443
- w.expectContextual = function(e) {
444
- this.eatContextual(e) || this.unexpected();
445
- };
446
- w.canInsertSemicolon = function() {
447
- return this.type === a.eof || this.type === a.braceR || L.test(this.input.slice(this.lastTokEnd, this.start));
448
- };
449
- w.insertSemicolon = function() {
450
- if (this.canInsertSemicolon()) return this.options.onInsertedSemicolon && this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc), true;
451
- };
452
- w.semicolon = function() {
453
- !this.eat(a.semi) && !this.insertSemicolon() && this.unexpected();
454
- };
455
- w.afterTrailingComma = function(e, t) {
456
- if (this.type === e) return this.options.onTrailingComma && this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc), t || this.next(), true;
457
- };
458
- w.expect = function(e) {
459
- this.eat(e) || this.unexpected();
460
- };
461
- w.unexpected = function(e) {
462
- this.raise(e ?? this.start, "Unexpected token");
463
- };
464
- var Ce = function() {
465
- this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1;
466
- };
467
- w.checkPatternErrors = function(e, t) {
468
- if (e) {
469
- e.trailingComma > -1 && this.raiseRecoverable(e.trailingComma, "Comma is not permitted after the rest element");
470
- var i = t ? e.parenthesizedAssign : e.parenthesizedBind;
471
- i > -1 && this.raiseRecoverable(i, t ? "Assigning to rvalue" : "Parenthesized pattern");
472
- }
473
- };
474
- w.checkExpressionErrors = function(e, t) {
475
- if (!e) return false;
476
- var i = e.shorthandAssign, s = e.doubleProto;
477
- if (!t) return i >= 0 || s >= 0;
478
- i >= 0 && this.raise(i, "Shorthand property assignments are valid only in destructuring patterns"), s >= 0 && this.raiseRecoverable(s, "Redefinition of __proto__ property");
479
- };
480
- w.checkYieldAwaitInDefaultParams = function() {
481
- this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos) && this.raise(this.yieldPos, "Yield expression cannot be a default value"), this.awaitPos && this.raise(this.awaitPos, "Await expression cannot be a default value");
482
- };
483
- w.isSimpleAssignTarget = function(e) {
484
- return e.type === "ParenthesizedExpression" ? this.isSimpleAssignTarget(e.expression) : e.type === "Identifier" || e.type === "MemberExpression";
485
- };
486
- var d = A.prototype;
487
- d.parseTopLevel = function(e) {
488
- var t = /* @__PURE__ */ Object.create(null);
489
- for (e.body || (e.body = []); this.type !== a.eof; ) {
490
- var i = this.parseStatement(null, true, t);
491
- e.body.push(i);
492
- }
493
- if (this.inModule) for (var s = 0, r = Object.keys(this.undefinedExports); s < r.length; s += 1) {
494
- var o = r[s];
495
- this.raiseRecoverable(this.undefinedExports[o].start, "Export '" + o + "' is not defined");
496
- }
497
- return this.adaptDirectivePrologue(e.body), this.next(), e.sourceType = this.options.sourceType, this.finishNode(e, "Program");
498
- };
499
- var ze = { kind: "loop" };
500
- var Qi = { kind: "switch" };
501
- d.isLet = function(e) {
502
- if (this.options.ecmaVersion < 6 || !this.isContextual("let")) return false;
503
- k.lastIndex = this.pos;
504
- var t = k.exec(this.input), i = this.pos + t[0].length, s = this.input.charCodeAt(i);
505
- if (s === 91 || s === 92) return true;
506
- if (e) return false;
507
- if (s === 123 || s > 55295 && s < 56320) return true;
508
- if (j(s, true)) {
509
- for (var r = i + 1; X(s = this.input.charCodeAt(r), true); ) ++r;
510
- if (s === 92 || s > 55295 && s < 56320) return true;
511
- var o = this.input.slice(i, r);
512
- if (!ji.test(o)) return true;
513
- }
514
- return false;
515
- };
516
- d.isAsyncFunction = function() {
517
- if (this.options.ecmaVersion < 8 || !this.isContextual("async")) return false;
518
- k.lastIndex = this.pos;
519
- var e = k.exec(this.input), t = this.pos + e[0].length, i;
520
- return !L.test(this.input.slice(this.pos, t)) && this.input.slice(t, t + 8) === "function" && (t + 8 === this.input.length || !(X(i = this.input.charCodeAt(t + 8)) || i > 55295 && i < 56320));
521
- };
522
- d.isUsingKeyword = function(e, t) {
523
- if (this.options.ecmaVersion < 17 || !this.isContextual(e ? "await" : "using")) return false;
524
- k.lastIndex = this.pos;
525
- var i = k.exec(this.input), s = this.pos + i[0].length;
526
- if (L.test(this.input.slice(this.pos, s))) return false;
527
- if (e) {
528
- var r = s + 5, o;
529
- if (this.input.slice(s, r) !== "using" || r === this.input.length || X(o = this.input.charCodeAt(r)) || o > 55295 && o < 56320) return false;
530
- k.lastIndex = r;
531
- var u = k.exec(this.input);
532
- if (u && L.test(this.input.slice(r, r + u[0].length))) return false;
533
- }
534
- if (t) {
535
- var p = s + 2, h;
536
- if (this.input.slice(s, p) === "of" && (p === this.input.length || !X(h = this.input.charCodeAt(p)) && !(h > 55295 && h < 56320))) return false;
537
- }
538
- var l = this.input.charCodeAt(s);
539
- return j(l, true) || l === 92;
540
- };
541
- d.isAwaitUsing = function(e) {
542
- return this.isUsingKeyword(true, e);
543
- };
544
- d.isUsing = function(e) {
545
- return this.isUsingKeyword(false, e);
546
- };
547
- d.parseStatement = function(e, t, i) {
548
- var s = this.type, r = this.startNode(), o;
549
- switch (this.isLet(e) && (s = a._var, o = "let"), s) {
550
- case a._break:
551
- case a._continue:
552
- return this.parseBreakContinueStatement(r, s.keyword);
553
- case a._debugger:
554
- return this.parseDebuggerStatement(r);
555
- case a._do:
556
- return this.parseDoStatement(r);
557
- case a._for:
558
- return this.parseForStatement(r);
559
- case a._function:
560
- return e && (this.strict || e !== "if" && e !== "label") && this.options.ecmaVersion >= 6 && this.unexpected(), this.parseFunctionStatement(r, false, !e);
561
- case a._class:
562
- return e && this.unexpected(), this.parseClass(r, true);
563
- case a._if:
564
- return this.parseIfStatement(r);
565
- case a._return:
566
- return this.parseReturnStatement(r);
567
- case a._switch:
568
- return this.parseSwitchStatement(r);
569
- case a._throw:
570
- return this.parseThrowStatement(r);
571
- case a._try:
572
- return this.parseTryStatement(r);
573
- case a._const:
574
- case a._var:
575
- return o = o || this.value, e && o !== "var" && this.unexpected(), this.parseVarStatement(r, o);
576
- case a._while:
577
- return this.parseWhileStatement(r);
578
- case a._with:
579
- return this.parseWithStatement(r);
580
- case a.braceL:
581
- return this.parseBlock(true, r);
582
- case a.semi:
583
- return this.parseEmptyStatement(r);
584
- case a._export:
585
- case a._import:
586
- if (this.options.ecmaVersion > 10 && s === a._import) {
587
- k.lastIndex = this.pos;
588
- var u = k.exec(this.input), p = this.pos + u[0].length, h = this.input.charCodeAt(p);
589
- if (h === 40 || h === 46) return this.parseExpressionStatement(r, this.parseExpression());
590
- }
591
- return this.options.allowImportExportEverywhere || (t || this.raise(this.start, "'import' and 'export' may only appear at the top level"), this.inModule || this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'")), s === a._import ? this.parseImport(r) : this.parseExport(r, i);
592
- default:
593
- if (this.isAsyncFunction()) return e && this.unexpected(), this.next(), this.parseFunctionStatement(r, true, !e);
594
- var l = this.isAwaitUsing(false) ? "await using" : this.isUsing(false) ? "using" : null;
595
- if (l) return t && this.options.sourceType === "script" && this.raise(this.start, "Using declaration cannot appear in the top level when source type is `script`"), l === "await using" && (this.canAwait || this.raise(this.start, "Await using cannot appear outside of async function"), this.next()), this.next(), this.parseVar(r, false, l), this.semicolon(), this.finishNode(r, "VariableDeclaration");
596
- var m = this.value, S = this.parseExpression();
597
- return s === a.name && S.type === "Identifier" && this.eat(a.colon) ? this.parseLabeledStatement(r, m, S, e) : this.parseExpressionStatement(r, S);
598
- }
599
- };
600
- d.parseBreakContinueStatement = function(e, t) {
601
- var i = t === "break";
602
- this.next(), this.eat(a.semi) || this.insertSemicolon() ? e.label = null : this.type !== a.name ? this.unexpected() : (e.label = this.parseIdent(), this.semicolon());
603
- for (var s = 0; s < this.labels.length; ++s) {
604
- var r = this.labels[s];
605
- if ((e.label == null || r.name === e.label.name) && (r.kind != null && (i || r.kind === "loop") || e.label && i)) break;
606
- }
607
- return s === this.labels.length && this.raise(e.start, "Unsyntactic " + t), this.finishNode(e, i ? "BreakStatement" : "ContinueStatement");
608
- };
609
- d.parseDebuggerStatement = function(e) {
610
- return this.next(), this.semicolon(), this.finishNode(e, "DebuggerStatement");
611
- };
612
- d.parseDoStatement = function(e) {
613
- return this.next(), this.labels.push(ze), e.body = this.parseStatement("do"), this.labels.pop(), this.expect(a._while), e.test = this.parseParenExpression(), this.options.ecmaVersion >= 6 ? this.eat(a.semi) : this.semicolon(), this.finishNode(e, "DoWhileStatement");
614
- };
615
- d.parseForStatement = function(e) {
616
- this.next();
617
- var t = this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await") ? this.lastTokStart : -1;
618
- if (this.labels.push(ze), this.enterScope(0), this.expect(a.parenL), this.type === a.semi) return t > -1 && this.unexpected(t), this.parseFor(e, null);
619
- var i = this.isLet();
620
- if (this.type === a._var || this.type === a._const || i) {
621
- var s = this.startNode(), r = i ? "let" : this.value;
622
- return this.next(), this.parseVar(s, true, r), this.finishNode(s, "VariableDeclaration"), this.parseForAfterInit(e, s, t);
623
- }
624
- var o = this.isContextual("let"), u = false, p = this.isUsing(true) ? "using" : this.isAwaitUsing(true) ? "await using" : null;
625
- if (p) {
626
- var h = this.startNode();
627
- return this.next(), p === "await using" && this.next(), this.parseVar(h, true, p), this.finishNode(h, "VariableDeclaration"), this.parseForAfterInit(e, h, t);
628
- }
629
- var l = this.containsEsc, m = new Ce(), S = this.start, E = t > -1 ? this.parseExprSubscripts(m, "await") : this.parseExpression(true, m);
630
- return this.type === a._in || (u = this.options.ecmaVersion >= 6 && this.isContextual("of")) ? (t > -1 ? (this.type === a._in && this.unexpected(t), e.await = true) : u && this.options.ecmaVersion >= 8 && (E.start === S && !l && E.type === "Identifier" && E.name === "async" ? this.unexpected() : this.options.ecmaVersion >= 9 && (e.await = false)), o && u && this.raise(E.start, "The left-hand side of a for-of loop may not start with 'let'."), this.toAssignable(E, false, m), this.checkLValPattern(E), this.parseForIn(e, E)) : (this.checkExpressionErrors(m, true), t > -1 && this.unexpected(t), this.parseFor(e, E));
631
- };
632
- d.parseForAfterInit = function(e, t, i) {
633
- return (this.type === a._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && t.declarations.length === 1 ? (this.options.ecmaVersion >= 9 && (this.type === a._in ? i > -1 && this.unexpected(i) : e.await = i > -1), this.parseForIn(e, t)) : (i > -1 && this.unexpected(i), this.parseFor(e, t));
634
- };
635
- d.parseFunctionStatement = function(e, t, i) {
636
- return this.next(), this.parseFunction(e, ae | (i ? 0 : Ge), false, t);
637
- };
638
- d.parseIfStatement = function(e) {
639
- return this.next(), e.test = this.parseParenExpression(), e.consequent = this.parseStatement("if"), e.alternate = this.eat(a._else) ? this.parseStatement("if") : null, this.finishNode(e, "IfStatement");
640
- };
641
- d.parseReturnStatement = function(e) {
642
- return !this.inFunction && !this.options.allowReturnOutsideFunction && this.raise(this.start, "'return' outside of function"), this.next(), this.eat(a.semi) || this.insertSemicolon() ? e.argument = null : (e.argument = this.parseExpression(), this.semicolon()), this.finishNode(e, "ReturnStatement");
643
- };
644
- d.parseSwitchStatement = function(e) {
645
- this.next(), e.discriminant = this.parseParenExpression(), e.cases = [], this.expect(a.braceL), this.labels.push(Qi), this.enterScope(0);
646
- for (var t, i = false; this.type !== a.braceR; ) if (this.type === a._case || this.type === a._default) {
647
- var s = this.type === a._case;
648
- t && this.finishNode(t, "SwitchCase"), e.cases.push(t = this.startNode()), t.consequent = [], this.next(), s ? t.test = this.parseExpression() : (i && this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"), i = true, t.test = null), this.expect(a.colon);
649
- } else t || this.unexpected(), t.consequent.push(this.parseStatement(null));
650
- return this.exitScope(), t && this.finishNode(t, "SwitchCase"), this.next(), this.labels.pop(), this.finishNode(e, "SwitchStatement");
651
- };
652
- d.parseThrowStatement = function(e) {
653
- return this.next(), L.test(this.input.slice(this.lastTokEnd, this.start)) && this.raise(this.lastTokEnd, "Illegal newline after throw"), e.argument = this.parseExpression(), this.semicolon(), this.finishNode(e, "ThrowStatement");
654
- };
655
- var Yi = [];
656
- d.parseCatchClauseParam = function() {
657
- var e = this.parseBindingAtom(), t = e.type === "Identifier";
658
- return this.enterScope(t ? St : 0), this.checkLValPattern(e, t ? Tt : K), this.expect(a.parenR), e;
659
- };
660
- d.parseTryStatement = function(e) {
661
- if (this.next(), e.block = this.parseBlock(), e.handler = null, this.type === a._catch) {
662
- var t = this.startNode();
663
- this.next(), this.eat(a.parenL) ? t.param = this.parseCatchClauseParam() : (this.options.ecmaVersion < 10 && this.unexpected(), t.param = null, this.enterScope(0)), t.body = this.parseBlock(false), this.exitScope(), e.handler = this.finishNode(t, "CatchClause");
664
- }
665
- return e.finalizer = this.eat(a._finally) ? this.parseBlock() : null, !e.handler && !e.finalizer && this.raise(e.start, "Missing catch or finally clause"), this.finishNode(e, "TryStatement");
666
- };
667
- d.parseVarStatement = function(e, t, i) {
668
- return this.next(), this.parseVar(e, false, t, i), this.semicolon(), this.finishNode(e, "VariableDeclaration");
669
- };
670
- d.parseWhileStatement = function(e) {
671
- return this.next(), e.test = this.parseParenExpression(), this.labels.push(ze), e.body = this.parseStatement("while"), this.labels.pop(), this.finishNode(e, "WhileStatement");
672
- };
673
- d.parseWithStatement = function(e) {
674
- return this.strict && this.raise(this.start, "'with' in strict mode"), this.next(), e.object = this.parseParenExpression(), e.body = this.parseStatement("with"), this.finishNode(e, "WithStatement");
675
- };
676
- d.parseEmptyStatement = function(e) {
677
- return this.next(), this.finishNode(e, "EmptyStatement");
678
- };
679
- d.parseLabeledStatement = function(e, t, i, s) {
680
- for (var r = 0, o = this.labels; r < o.length; r += 1) {
681
- var u = o[r];
682
- u.name === t && this.raise(i.start, "Label '" + t + "' is already declared");
683
- }
684
- for (var p = this.type.isLoop ? "loop" : this.type === a._switch ? "switch" : null, h = this.labels.length - 1; h >= 0; h--) {
685
- var l = this.labels[h];
686
- if (l.statementStart === e.start) l.statementStart = this.start, l.kind = p;
687
- else break;
688
- }
689
- return this.labels.push({ name: t, kind: p, statementStart: this.start }), e.body = this.parseStatement(s ? s.indexOf("label") === -1 ? s + "label" : s : "label"), this.labels.pop(), e.label = i, this.finishNode(e, "LabeledStatement");
690
- };
691
- d.parseExpressionStatement = function(e, t) {
692
- return e.expression = t, this.semicolon(), this.finishNode(e, "ExpressionStatement");
693
- };
694
- d.parseBlock = function(e, t, i) {
695
- for (e === void 0 && (e = true), t === void 0 && (t = this.startNode()), t.body = [], this.expect(a.braceL), e && this.enterScope(0); this.type !== a.braceR; ) {
696
- var s = this.parseStatement(null);
697
- t.body.push(s);
698
- }
699
- return i && (this.strict = false), this.next(), e && this.exitScope(), this.finishNode(t, "BlockStatement");
700
- };
701
- d.parseFor = function(e, t) {
702
- return e.init = t, this.expect(a.semi), e.test = this.type === a.semi ? null : this.parseExpression(), this.expect(a.semi), e.update = this.type === a.parenR ? null : this.parseExpression(), this.expect(a.parenR), e.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(e, "ForStatement");
703
- };
704
- d.parseForIn = function(e, t) {
705
- var i = this.type === a._in;
706
- return this.next(), t.type === "VariableDeclaration" && t.declarations[0].init != null && (!i || this.options.ecmaVersion < 8 || this.strict || t.kind !== "var" || t.declarations[0].id.type !== "Identifier") && this.raise(t.start, (i ? "for-in" : "for-of") + " loop variable declaration may not have an initializer"), e.left = t, e.right = i ? this.parseExpression() : this.parseMaybeAssign(), this.expect(a.parenR), e.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(e, i ? "ForInStatement" : "ForOfStatement");
707
- };
708
- d.parseVar = function(e, t, i, s) {
709
- for (e.declarations = [], e.kind = i; ; ) {
710
- var r = this.startNode();
711
- if (this.parseVarId(r, i), this.eat(a.eq) ? r.init = this.parseMaybeAssign(t) : !s && i === "const" && !(this.type === a._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) ? this.unexpected() : !s && (i === "using" || i === "await using") && this.options.ecmaVersion >= 17 && this.type !== a._in && !this.isContextual("of") ? this.raise(this.lastTokEnd, "Missing initializer in " + i + " declaration") : !s && r.id.type !== "Identifier" && !(t && (this.type === a._in || this.isContextual("of"))) ? this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value") : r.init = null, e.declarations.push(this.finishNode(r, "VariableDeclarator")), !this.eat(a.comma)) break;
712
- }
713
- return e;
714
- };
715
- d.parseVarId = function(e, t) {
716
- e.id = t === "using" || t === "await using" ? this.parseIdent() : this.parseBindingAtom(), this.checkLValPattern(e.id, t === "var" ? We : K, false);
717
- };
718
- var ae = 1;
719
- var Ge = 2;
720
- var At = 4;
721
- d.parseFunction = function(e, t, i, s, r) {
722
- this.initFunction(e), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !s) && (this.type === a.star && t & Ge && this.unexpected(), e.generator = this.eat(a.star)), this.options.ecmaVersion >= 8 && (e.async = !!s), t & ae && (e.id = t & At && this.type !== a.name ? null : this.parseIdent(), e.id && !(t & Ge) && this.checkLValSimple(e.id, this.strict || e.generator || e.async ? this.treatFunctionsAsVar ? We : K : Ct));
723
- var o = this.yieldPos, u = this.awaitPos, p = this.awaitIdentPos;
724
- return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Xe(e.async, e.generator)), t & ae || (e.id = this.type === a.name ? this.parseIdent() : null), this.parseFunctionParams(e), this.parseFunctionBody(e, i, false, r), this.yieldPos = o, this.awaitPos = u, this.awaitIdentPos = p, this.finishNode(e, t & ae ? "FunctionDeclaration" : "FunctionExpression");
725
- };
726
- d.parseFunctionParams = function(e) {
727
- this.expect(a.parenL), e.params = this.parseBindingList(a.parenR, false, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams();
728
- };
729
- d.parseClass = function(e, t) {
730
- this.next();
731
- var i = this.strict;
732
- this.strict = true, this.parseClassId(e, t), this.parseClassSuper(e);
733
- var s = this.enterClassBody(), r = this.startNode(), o = false;
734
- for (r.body = [], this.expect(a.braceL); this.type !== a.braceR; ) {
735
- var u = this.parseClassElement(e.superClass !== null);
736
- u && (r.body.push(u), u.type === "MethodDefinition" && u.kind === "constructor" ? (o && this.raiseRecoverable(u.start, "Duplicate constructor in the same class"), o = true) : u.key && u.key.type === "PrivateIdentifier" && $i(s, u) && this.raiseRecoverable(u.key.start, "Identifier '#" + u.key.name + "' has already been declared"));
737
- }
738
- return this.strict = i, this.next(), e.body = this.finishNode(r, "ClassBody"), this.exitClassBody(), this.finishNode(e, t ? "ClassDeclaration" : "ClassExpression");
739
- };
740
- d.parseClassElement = function(e) {
741
- if (this.eat(a.semi)) return null;
742
- var t = this.options.ecmaVersion, i = this.startNode(), s = "", r = false, o = false, u = "method", p = false;
743
- if (this.eatContextual("static")) {
744
- if (t >= 13 && this.eat(a.braceL)) return this.parseClassStaticBlock(i), i;
745
- this.isClassElementNameStart() || this.type === a.star ? p = true : s = "static";
746
- }
747
- if (i.static = p, !s && t >= 8 && this.eatContextual("async") && ((this.isClassElementNameStart() || this.type === a.star) && !this.canInsertSemicolon() ? o = true : s = "async"), !s && (t >= 9 || !o) && this.eat(a.star) && (r = true), !s && !o && !r) {
748
- var h = this.value;
749
- (this.eatContextual("get") || this.eatContextual("set")) && (this.isClassElementNameStart() ? u = h : s = h);
750
- }
751
- if (s ? (i.computed = false, i.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc), i.key.name = s, this.finishNode(i.key, "Identifier")) : this.parseClassElementName(i), t < 13 || this.type === a.parenL || u !== "method" || r || o) {
752
- var l = !i.static && ye(i, "constructor"), m = l && e;
753
- l && u !== "method" && this.raise(i.key.start, "Constructor can't have get/set modifier"), i.kind = l ? "constructor" : u, this.parseClassMethod(i, r, o, m);
754
- } else this.parseClassField(i);
755
- return i;
756
- };
757
- d.isClassElementNameStart = function() {
758
- return this.type === a.name || this.type === a.privateId || this.type === a.num || this.type === a.string || this.type === a.bracketL || this.type.keyword;
759
- };
760
- d.parseClassElementName = function(e) {
761
- this.type === a.privateId ? (this.value === "constructor" && this.raise(this.start, "Classes can't have an element named '#constructor'"), e.computed = false, e.key = this.parsePrivateIdent()) : this.parsePropertyName(e);
762
- };
763
- d.parseClassMethod = function(e, t, i, s) {
764
- var r = e.key;
765
- e.kind === "constructor" ? (t && this.raise(r.start, "Constructor can't be a generator"), i && this.raise(r.start, "Constructor can't be an async method")) : e.static && ye(e, "prototype") && this.raise(r.start, "Classes may not have a static property named prototype");
766
- var o = e.value = this.parseMethod(t, i, s);
767
- return e.kind === "get" && o.params.length !== 0 && this.raiseRecoverable(o.start, "getter should have no params"), e.kind === "set" && o.params.length !== 1 && this.raiseRecoverable(o.start, "setter should have exactly one param"), e.kind === "set" && o.params[0].type === "RestElement" && this.raiseRecoverable(o.params[0].start, "Setter cannot use rest params"), this.finishNode(e, "MethodDefinition");
768
- };
769
- d.parseClassField = function(e) {
770
- return ye(e, "constructor") ? this.raise(e.key.start, "Classes can't have a field named 'constructor'") : e.static && ye(e, "prototype") && this.raise(e.key.start, "Classes can't have a static field named 'prototype'"), this.eat(a.eq) ? (this.enterScope(ue | Se), e.value = this.parseMaybeAssign(), this.exitScope()) : e.value = null, this.semicolon(), this.finishNode(e, "PropertyDefinition");
771
- };
772
- d.parseClassStaticBlock = function(e) {
773
- e.body = [];
774
- var t = this.labels;
775
- for (this.labels = [], this.enterScope(z | Se); this.type !== a.braceR; ) {
776
- var i = this.parseStatement(null);
777
- e.body.push(i);
778
- }
779
- return this.next(), this.exitScope(), this.labels = t, this.finishNode(e, "StaticBlock");
780
- };
781
- d.parseClassId = function(e, t) {
782
- this.type === a.name ? (e.id = this.parseIdent(), t && this.checkLValSimple(e.id, K, false)) : (t === true && this.unexpected(), e.id = null);
783
- };
784
- d.parseClassSuper = function(e) {
785
- e.superClass = this.eat(a._extends) ? this.parseExprSubscripts(null, false) : null;
786
- };
787
- d.enterClassBody = function() {
788
- var e = { declared: /* @__PURE__ */ Object.create(null), used: [] };
789
- return this.privateNameStack.push(e), e.declared;
790
- };
791
- d.exitClassBody = function() {
792
- var e = this.privateNameStack.pop(), t = e.declared, i = e.used;
793
- if (this.options.checkPrivateFields) for (var s = this.privateNameStack.length, r = s === 0 ? null : this.privateNameStack[s - 1], o = 0; o < i.length; ++o) {
794
- var u = i[o];
795
- $(t, u.name) || (r ? r.used.push(u) : this.raiseRecoverable(u.start, "Private field '#" + u.name + "' must be declared in an enclosing class"));
796
- }
797
- };
798
- function $i(e, t) {
799
- var i = t.key.name, s = e[i], r = "true";
800
- return t.type === "MethodDefinition" && (t.kind === "get" || t.kind === "set") && (r = (t.static ? "s" : "i") + t.kind), s === "iget" && r === "iset" || s === "iset" && r === "iget" || s === "sget" && r === "sset" || s === "sset" && r === "sget" ? (e[i] = "true", false) : s ? true : (e[i] = r, false);
801
- }
802
- function ye(e, t) {
803
- var i = e.computed, s = e.key;
804
- return !i && (s.type === "Identifier" && s.name === t || s.type === "Literal" && s.value === t);
805
- }
806
- d.parseExportAllDeclaration = function(e, t) {
807
- return this.options.ecmaVersion >= 11 && (this.eatContextual("as") ? (e.exported = this.parseModuleExportName(), this.checkExport(t, e.exported, this.lastTokStart)) : e.exported = null), this.expectContextual("from"), this.type !== a.string && this.unexpected(), e.source = this.parseExprAtom(), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause()), this.semicolon(), this.finishNode(e, "ExportAllDeclaration");
808
- };
809
- d.parseExport = function(e, t) {
810
- if (this.next(), this.eat(a.star)) return this.parseExportAllDeclaration(e, t);
811
- if (this.eat(a._default)) return this.checkExport(t, "default", this.lastTokStart), e.declaration = this.parseExportDefaultDeclaration(), this.finishNode(e, "ExportDefaultDeclaration");
812
- if (this.shouldParseExportStatement()) e.declaration = this.parseExportDeclaration(e), e.declaration.type === "VariableDeclaration" ? this.checkVariableExport(t, e.declaration.declarations) : this.checkExport(t, e.declaration.id, e.declaration.id.start), e.specifiers = [], e.source = null, this.options.ecmaVersion >= 16 && (e.attributes = []);
813
- else {
814
- if (e.declaration = null, e.specifiers = this.parseExportSpecifiers(t), this.eatContextual("from")) this.type !== a.string && this.unexpected(), e.source = this.parseExprAtom(), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause());
815
- else {
816
- for (var i = 0, s = e.specifiers; i < s.length; i += 1) {
817
- var r = s[i];
818
- this.checkUnreserved(r.local), this.checkLocalExport(r.local), r.local.type === "Literal" && this.raise(r.local.start, "A string literal cannot be used as an exported binding without `from`.");
819
- }
820
- e.source = null, this.options.ecmaVersion >= 16 && (e.attributes = []);
821
- }
822
- this.semicolon();
823
- }
824
- return this.finishNode(e, "ExportNamedDeclaration");
825
- };
826
- d.parseExportDeclaration = function(e) {
827
- return this.parseStatement(null);
828
- };
829
- d.parseExportDefaultDeclaration = function() {
830
- var e;
831
- if (this.type === a._function || (e = this.isAsyncFunction())) {
832
- var t = this.startNode();
833
- return this.next(), e && this.next(), this.parseFunction(t, ae | At, false, e);
834
- } else if (this.type === a._class) {
835
- var i = this.startNode();
836
- return this.parseClass(i, "nullableID");
837
- } else {
838
- var s = this.parseMaybeAssign();
839
- return this.semicolon(), s;
840
- }
841
- };
842
- d.checkExport = function(e, t, i) {
843
- e && (typeof t != "string" && (t = t.type === "Identifier" ? t.name : t.value), $(e, t) && this.raiseRecoverable(i, "Duplicate export '" + t + "'"), e[t] = true);
844
- };
845
- d.checkPatternExport = function(e, t) {
846
- var i = t.type;
847
- if (i === "Identifier") this.checkExport(e, t, t.start);
848
- else if (i === "ObjectPattern") for (var s = 0, r = t.properties; s < r.length; s += 1) {
849
- var o = r[s];
850
- this.checkPatternExport(e, o);
851
- }
852
- else if (i === "ArrayPattern") for (var u = 0, p = t.elements; u < p.length; u += 1) {
853
- var h = p[u];
854
- h && this.checkPatternExport(e, h);
855
- }
856
- else i === "Property" ? this.checkPatternExport(e, t.value) : i === "AssignmentPattern" ? this.checkPatternExport(e, t.left) : i === "RestElement" && this.checkPatternExport(e, t.argument);
857
- };
858
- d.checkVariableExport = function(e, t) {
859
- if (e) for (var i = 0, s = t; i < s.length; i += 1) {
860
- var r = s[i];
861
- this.checkPatternExport(e, r.id);
862
- }
863
- };
864
- d.shouldParseExportStatement = function() {
865
- return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || this.type.keyword === "function" || this.isLet() || this.isAsyncFunction();
866
- };
867
- d.parseExportSpecifier = function(e) {
868
- var t = this.startNode();
869
- return t.local = this.parseModuleExportName(), t.exported = this.eatContextual("as") ? this.parseModuleExportName() : t.local, this.checkExport(e, t.exported, t.exported.start), this.finishNode(t, "ExportSpecifier");
870
- };
871
- d.parseExportSpecifiers = function(e) {
872
- var t = [], i = true;
873
- for (this.expect(a.braceL); !this.eat(a.braceR); ) {
874
- if (i) i = false;
875
- else if (this.expect(a.comma), this.afterTrailingComma(a.braceR)) break;
876
- t.push(this.parseExportSpecifier(e));
877
- }
878
- return t;
879
- };
880
- d.parseImport = function(e) {
881
- return this.next(), this.type === a.string ? (e.specifiers = Yi, e.source = this.parseExprAtom()) : (e.specifiers = this.parseImportSpecifiers(), this.expectContextual("from"), e.source = this.type === a.string ? this.parseExprAtom() : this.unexpected()), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause()), this.semicolon(), this.finishNode(e, "ImportDeclaration");
882
- };
883
- d.parseImportSpecifier = function() {
884
- var e = this.startNode();
885
- return e.imported = this.parseModuleExportName(), this.eatContextual("as") ? e.local = this.parseIdent() : (this.checkUnreserved(e.imported), e.local = e.imported), this.checkLValSimple(e.local, K), this.finishNode(e, "ImportSpecifier");
886
- };
887
- d.parseImportDefaultSpecifier = function() {
888
- var e = this.startNode();
889
- return e.local = this.parseIdent(), this.checkLValSimple(e.local, K), this.finishNode(e, "ImportDefaultSpecifier");
890
- };
891
- d.parseImportNamespaceSpecifier = function() {
892
- var e = this.startNode();
893
- return this.next(), this.expectContextual("as"), e.local = this.parseIdent(), this.checkLValSimple(e.local, K), this.finishNode(e, "ImportNamespaceSpecifier");
894
- };
895
- d.parseImportSpecifiers = function() {
896
- var e = [], t = true;
897
- if (this.type === a.name && (e.push(this.parseImportDefaultSpecifier()), !this.eat(a.comma))) return e;
898
- if (this.type === a.star) return e.push(this.parseImportNamespaceSpecifier()), e;
899
- for (this.expect(a.braceL); !this.eat(a.braceR); ) {
900
- if (t) t = false;
901
- else if (this.expect(a.comma), this.afterTrailingComma(a.braceR)) break;
902
- e.push(this.parseImportSpecifier());
903
- }
904
- return e;
905
- };
906
- d.parseWithClause = function() {
907
- var e = [];
908
- if (!this.eat(a._with)) return e;
909
- this.expect(a.braceL);
910
- for (var t = {}, i = true; !this.eat(a.braceR); ) {
911
- if (i) i = false;
912
- else if (this.expect(a.comma), this.afterTrailingComma(a.braceR)) break;
913
- var s = this.parseImportAttribute(), r = s.key.type === "Identifier" ? s.key.name : s.key.value;
914
- $(t, r) && this.raiseRecoverable(s.key.start, "Duplicate attribute key '" + r + "'"), t[r] = true, e.push(s);
915
- }
916
- return e;
917
- };
918
- d.parseImportAttribute = function() {
919
- var e = this.startNode();
920
- return e.key = this.type === a.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never"), this.expect(a.colon), this.type !== a.string && this.unexpected(), e.value = this.parseExprAtom(), this.finishNode(e, "ImportAttribute");
921
- };
922
- d.parseModuleExportName = function() {
923
- if (this.options.ecmaVersion >= 13 && this.type === a.string) {
924
- var e = this.parseLiteral(this.value);
925
- return Hi.test(e.value) && this.raise(e.start, "An export name cannot include a lone surrogate."), e;
926
- }
927
- return this.parseIdent(true);
928
- };
929
- d.adaptDirectivePrologue = function(e) {
930
- for (var t = 0; t < e.length && this.isDirectiveCandidate(e[t]); ++t) e[t].directive = e[t].expression.raw.slice(1, -1);
931
- };
932
- d.isDirectiveCandidate = function(e) {
933
- return this.options.ecmaVersion >= 5 && e.type === "ExpressionStatement" && e.expression.type === "Literal" && typeof e.expression.value == "string" && (this.input[e.start] === '"' || this.input[e.start] === "'");
934
- };
935
- var D = A.prototype;
936
- D.toAssignable = function(e, t, i) {
937
- if (this.options.ecmaVersion >= 6 && e) switch (e.type) {
938
- case "Identifier":
939
- this.inAsync && e.name === "await" && this.raise(e.start, "Cannot use 'await' as identifier inside an async function");
940
- break;
941
- case "ObjectPattern":
942
- case "ArrayPattern":
943
- case "AssignmentPattern":
944
- case "RestElement":
945
- break;
946
- case "ObjectExpression":
947
- e.type = "ObjectPattern", i && this.checkPatternErrors(i, true);
948
- for (var s = 0, r = e.properties; s < r.length; s += 1) {
949
- var o = r[s];
950
- this.toAssignable(o, t), o.type === "RestElement" && (o.argument.type === "ArrayPattern" || o.argument.type === "ObjectPattern") && this.raise(o.argument.start, "Unexpected token");
951
- }
952
- break;
953
- case "Property":
954
- e.kind !== "init" && this.raise(e.key.start, "Object pattern can't contain getter or setter"), this.toAssignable(e.value, t);
955
- break;
956
- case "ArrayExpression":
957
- e.type = "ArrayPattern", i && this.checkPatternErrors(i, true), this.toAssignableList(e.elements, t);
958
- break;
959
- case "SpreadElement":
960
- e.type = "RestElement", this.toAssignable(e.argument, t), e.argument.type === "AssignmentPattern" && this.raise(e.argument.start, "Rest elements cannot have a default value");
961
- break;
962
- case "AssignmentExpression":
963
- e.operator !== "=" && this.raise(e.left.end, "Only '=' operator can be used for specifying default value."), e.type = "AssignmentPattern", delete e.operator, this.toAssignable(e.left, t);
964
- break;
965
- case "ParenthesizedExpression":
966
- this.toAssignable(e.expression, t, i);
967
- break;
968
- case "ChainExpression":
969
- this.raiseRecoverable(e.start, "Optional chaining cannot appear in left-hand side");
970
- break;
971
- case "MemberExpression":
972
- if (!t) break;
973
- default:
974
- this.raise(e.start, "Assigning to rvalue");
975
- }
976
- else i && this.checkPatternErrors(i, true);
977
- return e;
978
- };
979
- D.toAssignableList = function(e, t) {
980
- for (var i = e.length, s = 0; s < i; s++) {
981
- var r = e[s];
982
- r && this.toAssignable(r, t);
983
- }
984
- if (i) {
985
- var o = e[i - 1];
986
- this.options.ecmaVersion === 6 && t && o && o.type === "RestElement" && o.argument.type !== "Identifier" && this.unexpected(o.argument.start);
987
- }
988
- return e;
989
- };
990
- D.parseSpread = function(e) {
991
- var t = this.startNode();
992
- return this.next(), t.argument = this.parseMaybeAssign(false, e), this.finishNode(t, "SpreadElement");
993
- };
994
- D.parseRestBinding = function() {
995
- var e = this.startNode();
996
- return this.next(), this.options.ecmaVersion === 6 && this.type !== a.name && this.unexpected(), e.argument = this.parseBindingAtom(), this.finishNode(e, "RestElement");
997
- };
998
- D.parseBindingAtom = function() {
999
- if (this.options.ecmaVersion >= 6) switch (this.type) {
1000
- case a.bracketL:
1001
- var e = this.startNode();
1002
- return this.next(), e.elements = this.parseBindingList(a.bracketR, true, true), this.finishNode(e, "ArrayPattern");
1003
- case a.braceL:
1004
- return this.parseObj(true);
1005
- }
1006
- return this.parseIdent();
1007
- };
1008
- D.parseBindingList = function(e, t, i, s) {
1009
- for (var r = [], o = true; !this.eat(e); ) if (o ? o = false : this.expect(a.comma), t && this.type === a.comma) r.push(null);
1010
- else {
1011
- if (i && this.afterTrailingComma(e)) break;
1012
- if (this.type === a.ellipsis) {
1013
- var u = this.parseRestBinding();
1014
- this.parseBindingListItem(u), r.push(u), this.type === a.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"), this.expect(e);
1015
- break;
1016
- } else r.push(this.parseAssignableListItem(s));
1017
- }
1018
- return r;
1019
- };
1020
- D.parseAssignableListItem = function(e) {
1021
- var t = this.parseMaybeDefault(this.start, this.startLoc);
1022
- return this.parseBindingListItem(t), t;
1023
- };
1024
- D.parseBindingListItem = function(e) {
1025
- return e;
1026
- };
1027
- D.parseMaybeDefault = function(e, t, i) {
1028
- if (i = i || this.parseBindingAtom(), this.options.ecmaVersion < 6 || !this.eat(a.eq)) return i;
1029
- var s = this.startNodeAt(e, t);
1030
- return s.left = i, s.right = this.parseMaybeAssign(), this.finishNode(s, "AssignmentPattern");
1031
- };
1032
- D.checkLValSimple = function(e, t, i) {
1033
- t === void 0 && (t = xe);
1034
- var s = t !== xe;
1035
- switch (e.type) {
1036
- case "Identifier":
1037
- this.strict && this.reservedWordsStrictBind.test(e.name) && this.raiseRecoverable(e.start, (s ? "Binding " : "Assigning to ") + e.name + " in strict mode"), s && (t === K && e.name === "let" && this.raiseRecoverable(e.start, "let is disallowed as a lexically bound name"), i && ($(i, e.name) && this.raiseRecoverable(e.start, "Argument name clash"), i[e.name] = true), t !== Et && this.declareName(e.name, t, e.start));
1038
- break;
1039
- case "ChainExpression":
1040
- this.raiseRecoverable(e.start, "Optional chaining cannot appear in left-hand side");
1041
- break;
1042
- case "MemberExpression":
1043
- s && this.raiseRecoverable(e.start, "Binding member expression");
1044
- break;
1045
- case "ParenthesizedExpression":
1046
- return s && this.raiseRecoverable(e.start, "Binding parenthesized expression"), this.checkLValSimple(e.expression, t, i);
1047
- default:
1048
- this.raise(e.start, (s ? "Binding" : "Assigning to") + " rvalue");
1049
- }
1050
- };
1051
- D.checkLValPattern = function(e, t, i) {
1052
- switch (t === void 0 && (t = xe), e.type) {
1053
- case "ObjectPattern":
1054
- for (var s = 0, r = e.properties; s < r.length; s += 1) {
1055
- var o = r[s];
1056
- this.checkLValInnerPattern(o, t, i);
1057
- }
1058
- break;
1059
- case "ArrayPattern":
1060
- for (var u = 0, p = e.elements; u < p.length; u += 1) {
1061
- var h = p[u];
1062
- h && this.checkLValInnerPattern(h, t, i);
1063
- }
1064
- break;
1065
- default:
1066
- this.checkLValSimple(e, t, i);
1067
- }
1068
- };
1069
- D.checkLValInnerPattern = function(e, t, i) {
1070
- switch (t === void 0 && (t = xe), e.type) {
1071
- case "Property":
1072
- this.checkLValInnerPattern(e.value, t, i);
1073
- break;
1074
- case "AssignmentPattern":
1075
- this.checkLValPattern(e.left, t, i);
1076
- break;
1077
- case "RestElement":
1078
- this.checkLValPattern(e.argument, t, i);
1079
- break;
1080
- default:
1081
- this.checkLValPattern(e, t, i);
1082
- }
1083
- };
1084
- var F = function(t, i, s, r, o) {
1085
- this.token = t, this.isExpr = !!i, this.preserveSpace = !!s, this.override = r, this.generator = !!o;
1086
- };
1087
- var T = { b_stat: new F("{", false), b_expr: new F("{", true), b_tmpl: new F("${", false), p_stat: new F("(", false), p_expr: new F("(", true), q_tmpl: new F("`", true, true, function(e) {
1088
- return e.tryReadTemplateToken();
1089
- }), f_stat: new F("function", false), f_expr: new F("function", true), f_expr_gen: new F("function", true, false, null, true), f_gen: new F("function", false, false, null, true) };
1090
- var ee = A.prototype;
1091
- ee.initialContext = function() {
1092
- return [T.b_stat];
1093
- };
1094
- ee.curContext = function() {
1095
- return this.context[this.context.length - 1];
1096
- };
1097
- ee.braceIsBlock = function(e) {
1098
- var t = this.curContext();
1099
- return t === T.f_expr || t === T.f_stat ? true : e === a.colon && (t === T.b_stat || t === T.b_expr) ? !t.isExpr : e === a._return || e === a.name && this.exprAllowed ? L.test(this.input.slice(this.lastTokEnd, this.start)) : e === a._else || e === a.semi || e === a.eof || e === a.parenR || e === a.arrow ? true : e === a.braceL ? t === T.b_stat : e === a._var || e === a._const || e === a.name ? false : !this.exprAllowed;
1100
- };
1101
- ee.inGeneratorContext = function() {
1102
- for (var e = this.context.length - 1; e >= 1; e--) {
1103
- var t = this.context[e];
1104
- if (t.token === "function") return t.generator;
1105
- }
1106
- return false;
1107
- };
1108
- ee.updateContext = function(e) {
1109
- var t, i = this.type;
1110
- i.keyword && e === a.dot ? this.exprAllowed = false : (t = i.updateContext) ? t.call(this, e) : this.exprAllowed = i.beforeExpr;
1111
- };
1112
- ee.overrideContext = function(e) {
1113
- this.curContext() !== e && (this.context[this.context.length - 1] = e);
1114
- };
1115
- a.parenR.updateContext = a.braceR.updateContext = function() {
1116
- if (this.context.length === 1) {
1117
- this.exprAllowed = true;
1118
- return;
1119
- }
1120
- var e = this.context.pop();
1121
- e === T.b_stat && this.curContext().token === "function" && (e = this.context.pop()), this.exprAllowed = !e.isExpr;
1122
- };
1123
- a.braceL.updateContext = function(e) {
1124
- this.context.push(this.braceIsBlock(e) ? T.b_stat : T.b_expr), this.exprAllowed = true;
1125
- };
1126
- a.dollarBraceL.updateContext = function() {
1127
- this.context.push(T.b_tmpl), this.exprAllowed = true;
1128
- };
1129
- a.parenL.updateContext = function(e) {
1130
- var t = e === a._if || e === a._for || e === a._with || e === a._while;
1131
- this.context.push(t ? T.p_stat : T.p_expr), this.exprAllowed = true;
1132
- };
1133
- a.incDec.updateContext = function() {
1134
- };
1135
- a._function.updateContext = a._class.updateContext = function(e) {
1136
- e.beforeExpr && e !== a._else && !(e === a.semi && this.curContext() !== T.p_stat) && !(e === a._return && L.test(this.input.slice(this.lastTokEnd, this.start))) && !((e === a.colon || e === a.braceL) && this.curContext() === T.b_stat) ? this.context.push(T.f_expr) : this.context.push(T.f_stat), this.exprAllowed = false;
1137
- };
1138
- a.colon.updateContext = function() {
1139
- this.curContext().token === "function" && this.context.pop(), this.exprAllowed = true;
1140
- };
1141
- a.backQuote.updateContext = function() {
1142
- this.curContext() === T.q_tmpl ? this.context.pop() : this.context.push(T.q_tmpl), this.exprAllowed = false;
1143
- };
1144
- a.star.updateContext = function(e) {
1145
- if (e === a._function) {
1146
- var t = this.context.length - 1;
1147
- this.context[t] === T.f_expr ? this.context[t] = T.f_expr_gen : this.context[t] = T.f_gen;
1148
- }
1149
- this.exprAllowed = true;
1150
- };
1151
- a.name.updateContext = function(e) {
1152
- var t = false;
1153
- this.options.ecmaVersion >= 6 && e !== a.dot && (this.value === "of" && !this.exprAllowed || this.value === "yield" && this.inGeneratorContext()) && (t = true), this.exprAllowed = t;
1154
- };
1155
- var g = A.prototype;
1156
- g.checkPropClash = function(e, t, i) {
1157
- if (!(this.options.ecmaVersion >= 9 && e.type === "SpreadElement") && !(this.options.ecmaVersion >= 6 && (e.computed || e.method || e.shorthand))) {
1158
- var s = e.key, r;
1159
- switch (s.type) {
1160
- case "Identifier":
1161
- r = s.name;
1162
- break;
1163
- case "Literal":
1164
- r = String(s.value);
1165
- break;
1166
- default:
1167
- return;
1168
- }
1169
- var o = e.kind;
1170
- if (this.options.ecmaVersion >= 6) {
1171
- r === "__proto__" && o === "init" && (t.proto && (i ? i.doubleProto < 0 && (i.doubleProto = s.start) : this.raiseRecoverable(s.start, "Redefinition of __proto__ property")), t.proto = true);
1172
- return;
1173
- }
1174
- r = "$" + r;
1175
- var u = t[r];
1176
- if (u) {
1177
- var p;
1178
- o === "init" ? p = this.strict && u.init || u.get || u.set : p = u.init || u[o], p && this.raiseRecoverable(s.start, "Redefinition of property");
1179
- } else u = t[r] = { init: false, get: false, set: false };
1180
- u[o] = true;
1181
- }
1182
- };
1183
- g.parseExpression = function(e, t) {
1184
- var i = this.start, s = this.startLoc, r = this.parseMaybeAssign(e, t);
1185
- if (this.type === a.comma) {
1186
- var o = this.startNodeAt(i, s);
1187
- for (o.expressions = [r]; this.eat(a.comma); ) o.expressions.push(this.parseMaybeAssign(e, t));
1188
- return this.finishNode(o, "SequenceExpression");
1189
- }
1190
- return r;
1191
- };
1192
- g.parseMaybeAssign = function(e, t, i) {
1193
- if (this.isContextual("yield")) {
1194
- if (this.inGenerator) return this.parseYield(e);
1195
- this.exprAllowed = false;
1196
- }
1197
- var s = false, r = -1, o = -1, u = -1;
1198
- t ? (r = t.parenthesizedAssign, o = t.trailingComma, u = t.doubleProto, t.parenthesizedAssign = t.trailingComma = -1) : (t = new Ce(), s = true);
1199
- var p = this.start, h = this.startLoc;
1200
- (this.type === a.parenL || this.type === a.name) && (this.potentialArrowAt = this.start, this.potentialArrowInForAwait = e === "await");
1201
- var l = this.parseMaybeConditional(e, t);
1202
- if (i && (l = i.call(this, l, p, h)), this.type.isAssign) {
1203
- var m = this.startNodeAt(p, h);
1204
- return m.operator = this.value, this.type === a.eq && (l = this.toAssignable(l, false, t)), s || (t.parenthesizedAssign = t.trailingComma = t.doubleProto = -1), t.shorthandAssign >= l.start && (t.shorthandAssign = -1), this.type === a.eq ? this.checkLValPattern(l) : this.checkLValSimple(l), m.left = l, this.next(), m.right = this.parseMaybeAssign(e), u > -1 && (t.doubleProto = u), this.finishNode(m, "AssignmentExpression");
1205
- } else s && this.checkExpressionErrors(t, true);
1206
- return r > -1 && (t.parenthesizedAssign = r), o > -1 && (t.trailingComma = o), l;
1207
- };
1208
- g.parseMaybeConditional = function(e, t) {
1209
- var i = this.start, s = this.startLoc, r = this.parseExprOps(e, t);
1210
- if (this.checkExpressionErrors(t)) return r;
1211
- if (this.eat(a.question)) {
1212
- var o = this.startNodeAt(i, s);
1213
- return o.test = r, o.consequent = this.parseMaybeAssign(), this.expect(a.colon), o.alternate = this.parseMaybeAssign(e), this.finishNode(o, "ConditionalExpression");
1214
- }
1215
- return r;
1216
- };
1217
- g.parseExprOps = function(e, t) {
1218
- var i = this.start, s = this.startLoc, r = this.parseMaybeUnary(t, false, false, e);
1219
- return this.checkExpressionErrors(t) || r.start === i && r.type === "ArrowFunctionExpression" ? r : this.parseExprOp(r, i, s, -1, e);
1220
- };
1221
- g.parseExprOp = function(e, t, i, s, r) {
1222
- var o = this.type.binop;
1223
- if (o != null && (!r || this.type !== a._in) && o > s) {
1224
- var u = this.type === a.logicalOR || this.type === a.logicalAND, p = this.type === a.coalesce;
1225
- p && (o = a.logicalAND.binop);
1226
- var h = this.value;
1227
- this.next();
1228
- var l = this.start, m = this.startLoc, S = this.parseExprOp(this.parseMaybeUnary(null, false, false, r), l, m, o, r), E = this.buildBinary(t, i, e, S, h, u || p);
1229
- return (u && this.type === a.coalesce || p && (this.type === a.logicalOR || this.type === a.logicalAND)) && this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"), this.parseExprOp(E, t, i, s, r);
1230
- }
1231
- return e;
1232
- };
1233
- g.buildBinary = function(e, t, i, s, r, o) {
1234
- s.type === "PrivateIdentifier" && this.raise(s.start, "Private identifier can only be left side of binary expression");
1235
- var u = this.startNodeAt(e, t);
1236
- return u.left = i, u.operator = r, u.right = s, this.finishNode(u, o ? "LogicalExpression" : "BinaryExpression");
1237
- };
1238
- g.parseMaybeUnary = function(e, t, i, s) {
1239
- var r = this.start, o = this.startLoc, u;
1240
- if (this.isContextual("await") && this.canAwait) u = this.parseAwait(s), t = true;
1241
- else if (this.type.prefix) {
1242
- var p = this.startNode(), h = this.type === a.incDec;
1243
- p.operator = this.value, p.prefix = true, this.next(), p.argument = this.parseMaybeUnary(null, true, h, s), this.checkExpressionErrors(e, true), h ? this.checkLValSimple(p.argument) : this.strict && p.operator === "delete" && kt(p.argument) ? this.raiseRecoverable(p.start, "Deleting local variable in strict mode") : p.operator === "delete" && qe(p.argument) ? this.raiseRecoverable(p.start, "Private fields can not be deleted") : t = true, u = this.finishNode(p, h ? "UpdateExpression" : "UnaryExpression");
1244
- } else if (!t && this.type === a.privateId) (s || this.privateNameStack.length === 0) && this.options.checkPrivateFields && this.unexpected(), u = this.parsePrivateIdent(), this.type !== a._in && this.unexpected();
1245
- else {
1246
- if (u = this.parseExprSubscripts(e, s), this.checkExpressionErrors(e)) return u;
1247
- for (; this.type.postfix && !this.canInsertSemicolon(); ) {
1248
- var l = this.startNodeAt(r, o);
1249
- l.operator = this.value, l.prefix = false, l.argument = u, this.checkLValSimple(u), this.next(), u = this.finishNode(l, "UpdateExpression");
1250
- }
1251
- }
1252
- if (!i && this.eat(a.starstar)) if (t) this.unexpected(this.lastTokStart);
1253
- else return this.buildBinary(r, o, u, this.parseMaybeUnary(null, false, false, s), "**", false);
1254
- else return u;
1255
- };
1256
- function kt(e) {
1257
- return e.type === "Identifier" || e.type === "ParenthesizedExpression" && kt(e.expression);
1258
- }
1259
- function qe(e) {
1260
- return e.type === "MemberExpression" && e.property.type === "PrivateIdentifier" || e.type === "ChainExpression" && qe(e.expression) || e.type === "ParenthesizedExpression" && qe(e.expression);
1261
- }
1262
- g.parseExprSubscripts = function(e, t) {
1263
- var i = this.start, s = this.startLoc, r = this.parseExprAtom(e, t);
1264
- if (r.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")") return r;
1265
- var o = this.parseSubscripts(r, i, s, false, t);
1266
- return e && o.type === "MemberExpression" && (e.parenthesizedAssign >= o.start && (e.parenthesizedAssign = -1), e.parenthesizedBind >= o.start && (e.parenthesizedBind = -1), e.trailingComma >= o.start && (e.trailingComma = -1)), o;
1267
- };
1268
- g.parseSubscripts = function(e, t, i, s, r) {
1269
- for (var o = this.options.ecmaVersion >= 8 && e.type === "Identifier" && e.name === "async" && this.lastTokEnd === e.end && !this.canInsertSemicolon() && e.end - e.start === 5 && this.potentialArrowAt === e.start, u = false; ; ) {
1270
- var p = this.parseSubscript(e, t, i, s, o, u, r);
1271
- if (p.optional && (u = true), p === e || p.type === "ArrowFunctionExpression") {
1272
- if (u) {
1273
- var h = this.startNodeAt(t, i);
1274
- h.expression = p, p = this.finishNode(h, "ChainExpression");
1275
- }
1276
- return p;
1277
- }
1278
- e = p;
1279
- }
1280
- };
1281
- g.shouldParseAsyncArrow = function() {
1282
- return !this.canInsertSemicolon() && this.eat(a.arrow);
1283
- };
1284
- g.parseSubscriptAsyncArrow = function(e, t, i, s) {
1285
- return this.parseArrowExpression(this.startNodeAt(e, t), i, true, s);
1286
- };
1287
- g.parseSubscript = function(e, t, i, s, r, o, u) {
1288
- var p = this.options.ecmaVersion >= 11, h = p && this.eat(a.questionDot);
1289
- s && h && this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions");
1290
- var l = this.eat(a.bracketL);
1291
- if (l || h && this.type !== a.parenL && this.type !== a.backQuote || this.eat(a.dot)) {
1292
- var m = this.startNodeAt(t, i);
1293
- m.object = e, l ? (m.property = this.parseExpression(), this.expect(a.bracketR)) : this.type === a.privateId && e.type !== "Super" ? m.property = this.parsePrivateIdent() : m.property = this.parseIdent(this.options.allowReserved !== "never"), m.computed = !!l, p && (m.optional = h), e = this.finishNode(m, "MemberExpression");
1294
- } else if (!s && this.eat(a.parenL)) {
1295
- var S = new Ce(), E = this.yieldPos, c = this.awaitPos, x = this.awaitIdentPos;
1296
- this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0;
1297
- var y = this.parseExprList(a.parenR, this.options.ecmaVersion >= 8, false, S);
1298
- if (r && !h && this.shouldParseAsyncArrow()) return this.checkPatternErrors(S, false), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = E, this.awaitPos = c, this.awaitIdentPos = x, this.parseSubscriptAsyncArrow(t, i, y, u);
1299
- this.checkExpressionErrors(S, true), this.yieldPos = E || this.yieldPos, this.awaitPos = c || this.awaitPos, this.awaitIdentPos = x || this.awaitIdentPos;
1300
- var v = this.startNodeAt(t, i);
1301
- v.callee = e, v.arguments = y, p && (v.optional = h), e = this.finishNode(v, "CallExpression");
1302
- } else if (this.type === a.backQuote) {
1303
- (h || o) && this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
1304
- var I = this.startNodeAt(t, i);
1305
- I.tag = e, I.quasi = this.parseTemplate({ isTagged: true }), e = this.finishNode(I, "TaggedTemplateExpression");
1306
- }
1307
- return e;
1308
- };
1309
- g.parseExprAtom = function(e, t, i) {
1310
- this.type === a.slash && this.readRegexp();
1311
- var s, r = this.potentialArrowAt === this.start;
1312
- switch (this.type) {
1313
- case a._super:
1314
- return this.allowSuper || this.raise(this.start, "'super' keyword outside a method"), s = this.startNode(), this.next(), this.type === a.parenL && !this.allowDirectSuper && this.raise(s.start, "super() call outside constructor of a subclass"), this.type !== a.dot && this.type !== a.bracketL && this.type !== a.parenL && this.unexpected(), this.finishNode(s, "Super");
1315
- case a._this:
1316
- return s = this.startNode(), this.next(), this.finishNode(s, "ThisExpression");
1317
- case a.name:
1318
- var o = this.start, u = this.startLoc, p = this.containsEsc, h = this.parseIdent(false);
1319
- if (this.options.ecmaVersion >= 8 && !p && h.name === "async" && !this.canInsertSemicolon() && this.eat(a._function)) return this.overrideContext(T.f_expr), this.parseFunction(this.startNodeAt(o, u), 0, false, true, t);
1320
- if (r && !this.canInsertSemicolon()) {
1321
- if (this.eat(a.arrow)) return this.parseArrowExpression(this.startNodeAt(o, u), [h], false, t);
1322
- if (this.options.ecmaVersion >= 8 && h.name === "async" && this.type === a.name && !p && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) return h = this.parseIdent(false), (this.canInsertSemicolon() || !this.eat(a.arrow)) && this.unexpected(), this.parseArrowExpression(this.startNodeAt(o, u), [h], true, t);
1323
- }
1324
- return h;
1325
- case a.regexp:
1326
- var l = this.value;
1327
- return s = this.parseLiteral(l.value), s.regex = { pattern: l.pattern, flags: l.flags }, s;
1328
- case a.num:
1329
- case a.string:
1330
- return this.parseLiteral(this.value);
1331
- case a._null:
1332
- case a._true:
1333
- case a._false:
1334
- return s = this.startNode(), s.value = this.type === a._null ? null : this.type === a._true, s.raw = this.type.keyword, this.next(), this.finishNode(s, "Literal");
1335
- case a.parenL:
1336
- var m = this.start, S = this.parseParenAndDistinguishExpression(r, t);
1337
- return e && (e.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(S) && (e.parenthesizedAssign = m), e.parenthesizedBind < 0 && (e.parenthesizedBind = m)), S;
1338
- case a.bracketL:
1339
- return s = this.startNode(), this.next(), s.elements = this.parseExprList(a.bracketR, true, true, e), this.finishNode(s, "ArrayExpression");
1340
- case a.braceL:
1341
- return this.overrideContext(T.b_expr), this.parseObj(false, e);
1342
- case a._function:
1343
- return s = this.startNode(), this.next(), this.parseFunction(s, 0);
1344
- case a._class:
1345
- return this.parseClass(this.startNode(), false);
1346
- case a._new:
1347
- return this.parseNew();
1348
- case a.backQuote:
1349
- return this.parseTemplate();
1350
- case a._import:
1351
- return this.options.ecmaVersion >= 11 ? this.parseExprImport(i) : this.unexpected();
1352
- default:
1353
- return this.parseExprAtomDefault();
1354
- }
1355
- };
1356
- g.parseExprAtomDefault = function() {
1357
- this.unexpected();
1358
- };
1359
- g.parseExprImport = function(e) {
1360
- var t = this.startNode();
1361
- if (this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword import"), this.next(), this.type === a.parenL && !e) return this.parseDynamicImport(t);
1362
- if (this.type === a.dot) {
1363
- var i = this.startNodeAt(t.start, t.loc && t.loc.start);
1364
- return i.name = "import", t.meta = this.finishNode(i, "Identifier"), this.parseImportMeta(t);
1365
- } else this.unexpected();
1366
- };
1367
- g.parseDynamicImport = function(e) {
1368
- if (this.next(), e.source = this.parseMaybeAssign(), this.options.ecmaVersion >= 16) this.eat(a.parenR) ? e.options = null : (this.expect(a.comma), this.afterTrailingComma(a.parenR) ? e.options = null : (e.options = this.parseMaybeAssign(), this.eat(a.parenR) || (this.expect(a.comma), this.afterTrailingComma(a.parenR) || this.unexpected())));
1369
- else if (!this.eat(a.parenR)) {
1370
- var t = this.start;
1371
- this.eat(a.comma) && this.eat(a.parenR) ? this.raiseRecoverable(t, "Trailing comma is not allowed in import()") : this.unexpected(t);
1372
- }
1373
- return this.finishNode(e, "ImportExpression");
1374
- };
1375
- g.parseImportMeta = function(e) {
1376
- this.next();
1377
- var t = this.containsEsc;
1378
- return e.property = this.parseIdent(true), e.property.name !== "meta" && this.raiseRecoverable(e.property.start, "The only valid meta property for import is 'import.meta'"), t && this.raiseRecoverable(e.start, "'import.meta' must not contain escaped characters"), this.options.sourceType !== "module" && !this.options.allowImportExportEverywhere && this.raiseRecoverable(e.start, "Cannot use 'import.meta' outside a module"), this.finishNode(e, "MetaProperty");
1379
- };
1380
- g.parseLiteral = function(e) {
1381
- var t = this.startNode();
1382
- return t.value = e, t.raw = this.input.slice(this.start, this.end), t.raw.charCodeAt(t.raw.length - 1) === 110 && (t.bigint = t.value != null ? t.value.toString() : t.raw.slice(0, -1).replace(/_/g, "")), this.next(), this.finishNode(t, "Literal");
1383
- };
1384
- g.parseParenExpression = function() {
1385
- this.expect(a.parenL);
1386
- var e = this.parseExpression();
1387
- return this.expect(a.parenR), e;
1388
- };
1389
- g.shouldParseArrow = function(e) {
1390
- return !this.canInsertSemicolon();
1391
- };
1392
- g.parseParenAndDistinguishExpression = function(e, t) {
1393
- var i = this.start, s = this.startLoc, r, o = this.options.ecmaVersion >= 8;
1394
- if (this.options.ecmaVersion >= 6) {
1395
- this.next();
1396
- var u = this.start, p = this.startLoc, h = [], l = true, m = false, S = new Ce(), E = this.yieldPos, c = this.awaitPos, x;
1397
- for (this.yieldPos = 0, this.awaitPos = 0; this.type !== a.parenR; ) if (l ? l = false : this.expect(a.comma), o && this.afterTrailingComma(a.parenR, true)) {
1398
- m = true;
1399
- break;
1400
- } else if (this.type === a.ellipsis) {
1401
- x = this.start, h.push(this.parseParenItem(this.parseRestBinding())), this.type === a.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element");
1402
- break;
1403
- } else h.push(this.parseMaybeAssign(false, S, this.parseParenItem));
1404
- var y = this.lastTokEnd, v = this.lastTokEndLoc;
1405
- if (this.expect(a.parenR), e && this.shouldParseArrow(h) && this.eat(a.arrow)) return this.checkPatternErrors(S, false), this.checkYieldAwaitInDefaultParams(), this.yieldPos = E, this.awaitPos = c, this.parseParenArrowList(i, s, h, t);
1406
- (!h.length || m) && this.unexpected(this.lastTokStart), x && this.unexpected(x), this.checkExpressionErrors(S, true), this.yieldPos = E || this.yieldPos, this.awaitPos = c || this.awaitPos, h.length > 1 ? (r = this.startNodeAt(u, p), r.expressions = h, this.finishNodeAt(r, "SequenceExpression", y, v)) : r = h[0];
1407
- } else r = this.parseParenExpression();
1408
- if (this.options.preserveParens) {
1409
- var I = this.startNodeAt(i, s);
1410
- return I.expression = r, this.finishNode(I, "ParenthesizedExpression");
1411
- } else return r;
1412
- };
1413
- g.parseParenItem = function(e) {
1414
- return e;
1415
- };
1416
- g.parseParenArrowList = function(e, t, i, s) {
1417
- return this.parseArrowExpression(this.startNodeAt(e, t), i, false, s);
1418
- };
1419
- var Zi = [];
1420
- g.parseNew = function() {
1421
- this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword new");
1422
- var e = this.startNode();
1423
- if (this.next(), this.options.ecmaVersion >= 6 && this.type === a.dot) {
1424
- var t = this.startNodeAt(e.start, e.loc && e.loc.start);
1425
- t.name = "new", e.meta = this.finishNode(t, "Identifier"), this.next();
1426
- var i = this.containsEsc;
1427
- return e.property = this.parseIdent(true), e.property.name !== "target" && this.raiseRecoverable(e.property.start, "The only valid meta property for new is 'new.target'"), i && this.raiseRecoverable(e.start, "'new.target' must not contain escaped characters"), this.allowNewDotTarget || this.raiseRecoverable(e.start, "'new.target' can only be used in functions and class static block"), this.finishNode(e, "MetaProperty");
1428
- }
1429
- var s = this.start, r = this.startLoc;
1430
- return e.callee = this.parseSubscripts(this.parseExprAtom(null, false, true), s, r, true, false), this.eat(a.parenL) ? e.arguments = this.parseExprList(a.parenR, this.options.ecmaVersion >= 8, false) : e.arguments = Zi, this.finishNode(e, "NewExpression");
1431
- };
1432
- g.parseTemplateElement = function(e) {
1433
- var t = e.isTagged, i = this.startNode();
1434
- return this.type === a.invalidTemplate ? (t || this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"), i.value = { raw: this.value.replace(/\r\n?/g, `
1435
- `), cooked: null }) : i.value = { raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, `
1436
- `), cooked: this.value }, this.next(), i.tail = this.type === a.backQuote, this.finishNode(i, "TemplateElement");
1437
- };
1438
- g.parseTemplate = function(e) {
1439
- e === void 0 && (e = {});
1440
- var t = e.isTagged;
1441
- t === void 0 && (t = false);
1442
- var i = this.startNode();
1443
- this.next(), i.expressions = [];
1444
- var s = this.parseTemplateElement({ isTagged: t });
1445
- for (i.quasis = [s]; !s.tail; ) this.type === a.eof && this.raise(this.pos, "Unterminated template literal"), this.expect(a.dollarBraceL), i.expressions.push(this.parseExpression()), this.expect(a.braceR), i.quasis.push(s = this.parseTemplateElement({ isTagged: t }));
1446
- return this.next(), this.finishNode(i, "TemplateLiteral");
1447
- };
1448
- g.isAsyncProp = function(e) {
1449
- return !e.computed && e.key.type === "Identifier" && e.key.name === "async" && (this.type === a.name || this.type === a.num || this.type === a.string || this.type === a.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === a.star) && !L.test(this.input.slice(this.lastTokEnd, this.start));
1450
- };
1451
- g.parseObj = function(e, t) {
1452
- var i = this.startNode(), s = true, r = {};
1453
- for (i.properties = [], this.next(); !this.eat(a.braceR); ) {
1454
- if (s) s = false;
1455
- else if (this.expect(a.comma), this.options.ecmaVersion >= 5 && this.afterTrailingComma(a.braceR)) break;
1456
- var o = this.parseProperty(e, t);
1457
- e || this.checkPropClash(o, r, t), i.properties.push(o);
1458
- }
1459
- return this.finishNode(i, e ? "ObjectPattern" : "ObjectExpression");
1460
- };
1461
- g.parseProperty = function(e, t) {
1462
- var i = this.startNode(), s, r, o, u;
1463
- if (this.options.ecmaVersion >= 9 && this.eat(a.ellipsis)) return e ? (i.argument = this.parseIdent(false), this.type === a.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"), this.finishNode(i, "RestElement")) : (i.argument = this.parseMaybeAssign(false, t), this.type === a.comma && t && t.trailingComma < 0 && (t.trailingComma = this.start), this.finishNode(i, "SpreadElement"));
1464
- this.options.ecmaVersion >= 6 && (i.method = false, i.shorthand = false, (e || t) && (o = this.start, u = this.startLoc), e || (s = this.eat(a.star)));
1465
- var p = this.containsEsc;
1466
- return this.parsePropertyName(i), !e && !p && this.options.ecmaVersion >= 8 && !s && this.isAsyncProp(i) ? (r = true, s = this.options.ecmaVersion >= 9 && this.eat(a.star), this.parsePropertyName(i)) : r = false, this.parsePropertyValue(i, e, s, r, o, u, t, p), this.finishNode(i, "Property");
1467
- };
1468
- g.parseGetterSetter = function(e) {
1469
- var t = e.key.name;
1470
- this.parsePropertyName(e), e.value = this.parseMethod(false), e.kind = t;
1471
- var i = e.kind === "get" ? 0 : 1;
1472
- if (e.value.params.length !== i) {
1473
- var s = e.value.start;
1474
- e.kind === "get" ? this.raiseRecoverable(s, "getter should have no params") : this.raiseRecoverable(s, "setter should have exactly one param");
1475
- } else e.kind === "set" && e.value.params[0].type === "RestElement" && this.raiseRecoverable(e.value.params[0].start, "Setter cannot use rest params");
1476
- };
1477
- g.parsePropertyValue = function(e, t, i, s, r, o, u, p) {
1478
- (i || s) && this.type === a.colon && this.unexpected(), this.eat(a.colon) ? (e.value = t ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, u), e.kind = "init") : this.options.ecmaVersion >= 6 && this.type === a.parenL ? (t && this.unexpected(), e.method = true, e.value = this.parseMethod(i, s), e.kind = "init") : !t && !p && this.options.ecmaVersion >= 5 && !e.computed && e.key.type === "Identifier" && (e.key.name === "get" || e.key.name === "set") && this.type !== a.comma && this.type !== a.braceR && this.type !== a.eq ? ((i || s) && this.unexpected(), this.parseGetterSetter(e)) : this.options.ecmaVersion >= 6 && !e.computed && e.key.type === "Identifier" ? ((i || s) && this.unexpected(), this.checkUnreserved(e.key), e.key.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = r), t ? e.value = this.parseMaybeDefault(r, o, this.copyNode(e.key)) : this.type === a.eq && u ? (u.shorthandAssign < 0 && (u.shorthandAssign = this.start), e.value = this.parseMaybeDefault(r, o, this.copyNode(e.key))) : e.value = this.copyNode(e.key), e.kind = "init", e.shorthand = true) : this.unexpected();
1479
- };
1480
- g.parsePropertyName = function(e) {
1481
- if (this.options.ecmaVersion >= 6) {
1482
- if (this.eat(a.bracketL)) return e.computed = true, e.key = this.parseMaybeAssign(), this.expect(a.bracketR), e.key;
1483
- e.computed = false;
1484
- }
1485
- return e.key = this.type === a.num || this.type === a.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never");
1486
- };
1487
- g.initFunction = function(e) {
1488
- e.id = null, this.options.ecmaVersion >= 6 && (e.generator = e.expression = false), this.options.ecmaVersion >= 8 && (e.async = false);
1489
- };
1490
- g.parseMethod = function(e, t, i) {
1491
- var s = this.startNode(), r = this.yieldPos, o = this.awaitPos, u = this.awaitIdentPos;
1492
- return this.initFunction(s), this.options.ecmaVersion >= 6 && (s.generator = e), this.options.ecmaVersion >= 8 && (s.async = !!t), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Xe(t, s.generator) | Se | (i ? _t : 0)), this.expect(a.parenL), s.params = this.parseBindingList(a.parenR, false, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(s, false, true, false), this.yieldPos = r, this.awaitPos = o, this.awaitIdentPos = u, this.finishNode(s, "FunctionExpression");
1493
- };
1494
- g.parseArrowExpression = function(e, t, i, s) {
1495
- var r = this.yieldPos, o = this.awaitPos, u = this.awaitIdentPos;
1496
- return this.enterScope(Xe(i, false) | He), this.initFunction(e), this.options.ecmaVersion >= 8 && (e.async = !!i), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, e.params = this.toAssignableList(t, true), this.parseFunctionBody(e, true, false, s), this.yieldPos = r, this.awaitPos = o, this.awaitIdentPos = u, this.finishNode(e, "ArrowFunctionExpression");
1497
- };
1498
- g.parseFunctionBody = function(e, t, i, s) {
1499
- var r = t && this.type !== a.braceL, o = this.strict, u = false;
1500
- if (r) e.body = this.parseMaybeAssign(s), e.expression = true, this.checkParams(e, false);
1501
- else {
1502
- var p = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(e.params);
1503
- (!o || p) && (u = this.strictDirective(this.end), u && p && this.raiseRecoverable(e.start, "Illegal 'use strict' directive in function with non-simple parameter list"));
1504
- var h = this.labels;
1505
- this.labels = [], u && (this.strict = true), this.checkParams(e, !o && !u && !t && !i && this.isSimpleParamList(e.params)), this.strict && e.id && this.checkLValSimple(e.id, Et), e.body = this.parseBlock(false, void 0, u && !o), e.expression = false, this.adaptDirectivePrologue(e.body.body), this.labels = h;
1506
- }
1507
- this.exitScope();
1508
- };
1509
- g.isSimpleParamList = function(e) {
1510
- for (var t = 0, i = e; t < i.length; t += 1) {
1511
- var s = i[t];
1512
- if (s.type !== "Identifier") return false;
1513
- }
1514
- return true;
1515
- };
1516
- g.checkParams = function(e, t) {
1517
- for (var i = /* @__PURE__ */ Object.create(null), s = 0, r = e.params; s < r.length; s += 1) {
1518
- var o = r[s];
1519
- this.checkLValInnerPattern(o, We, t ? null : i);
1520
- }
1521
- };
1522
- g.parseExprList = function(e, t, i, s) {
1523
- for (var r = [], o = true; !this.eat(e); ) {
1524
- if (o) o = false;
1525
- else if (this.expect(a.comma), t && this.afterTrailingComma(e)) break;
1526
- var u = void 0;
1527
- i && this.type === a.comma ? u = null : this.type === a.ellipsis ? (u = this.parseSpread(s), s && this.type === a.comma && s.trailingComma < 0 && (s.trailingComma = this.start)) : u = this.parseMaybeAssign(false, s), r.push(u);
1528
- }
1529
- return r;
1530
- };
1531
- g.checkUnreserved = function(e) {
1532
- var t = e.start, i = e.end, s = e.name;
1533
- if (this.inGenerator && s === "yield" && this.raiseRecoverable(t, "Cannot use 'yield' as identifier inside a generator"), this.inAsync && s === "await" && this.raiseRecoverable(t, "Cannot use 'await' as identifier inside an async function"), !(this.currentThisScope().flags & _e) && s === "arguments" && this.raiseRecoverable(t, "Cannot use 'arguments' in class field initializer"), this.inClassStaticBlock && (s === "arguments" || s === "await") && this.raise(t, "Cannot use " + s + " in class static initialization block"), this.keywords.test(s) && this.raise(t, "Unexpected keyword '" + s + "'"), !(this.options.ecmaVersion < 6 && this.input.slice(t, i).indexOf("\\") !== -1)) {
1534
- var r = this.strict ? this.reservedWordsStrict : this.reservedWords;
1535
- r.test(s) && (!this.inAsync && s === "await" && this.raiseRecoverable(t, "Cannot use keyword 'await' outside an async function"), this.raiseRecoverable(t, "The keyword '" + s + "' is reserved"));
1536
- }
1537
- };
1538
- g.parseIdent = function(e) {
1539
- var t = this.parseIdentNode();
1540
- return this.next(!!e), this.finishNode(t, "Identifier"), e || (this.checkUnreserved(t), t.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = t.start)), t;
1541
- };
1542
- g.parseIdentNode = function() {
1543
- var e = this.startNode();
1544
- return this.type === a.name ? e.name = this.value : this.type.keyword ? (e.name = this.type.keyword, (e.name === "class" || e.name === "function") && (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46) && this.context.pop(), this.type = a.name) : this.unexpected(), e;
1545
- };
1546
- g.parsePrivateIdent = function() {
1547
- var e = this.startNode();
1548
- return this.type === a.privateId ? e.name = this.value : this.unexpected(), this.next(), this.finishNode(e, "PrivateIdentifier"), this.options.checkPrivateFields && (this.privateNameStack.length === 0 ? this.raise(e.start, "Private field '#" + e.name + "' must be declared in an enclosing class") : this.privateNameStack[this.privateNameStack.length - 1].used.push(e)), e;
1549
- };
1550
- g.parseYield = function(e) {
1551
- this.yieldPos || (this.yieldPos = this.start);
1552
- var t = this.startNode();
1553
- return this.next(), this.type === a.semi || this.canInsertSemicolon() || this.type !== a.star && !this.type.startsExpr ? (t.delegate = false, t.argument = null) : (t.delegate = this.eat(a.star), t.argument = this.parseMaybeAssign(e)), this.finishNode(t, "YieldExpression");
1554
- };
1555
- g.parseAwait = function(e) {
1556
- this.awaitPos || (this.awaitPos = this.start);
1557
- var t = this.startNode();
1558
- return this.next(), t.argument = this.parseMaybeUnary(null, true, false, e), this.finishNode(t, "AwaitExpression");
1559
- };
1560
- var ge = A.prototype;
1561
- ge.raise = function(e, t) {
1562
- var i = vt(this.input, e);
1563
- t += " (" + i.line + ":" + i.column + ")", this.sourceFile && (t += " in " + this.sourceFile);
1564
- var s = new SyntaxError(t);
1565
- throw s.pos = e, s.loc = i, s.raisedAt = this.pos, s;
1566
- };
1567
- ge.raiseRecoverable = ge.raise;
1568
- ge.curPosition = function() {
1569
- if (this.options.locations) return new ne(this.curLine, this.pos - this.lineStart);
1570
- };
1571
- var W = A.prototype;
1572
- var es = function(t) {
1573
- this.flags = t, this.var = [], this.lexical = [], this.functions = [];
1574
- };
1575
- W.enterScope = function(e) {
1576
- this.scopeStack.push(new es(e));
1577
- };
1578
- W.exitScope = function() {
1579
- this.scopeStack.pop();
1580
- };
1581
- W.treatFunctionsAsVarInScope = function(e) {
1582
- return e.flags & Z || !this.inModule && e.flags & oe;
1583
- };
1584
- W.declareName = function(e, t, i) {
1585
- var s = false;
1586
- if (t === K) {
1587
- var r = this.currentScope();
1588
- s = r.lexical.indexOf(e) > -1 || r.functions.indexOf(e) > -1 || r.var.indexOf(e) > -1, r.lexical.push(e), this.inModule && r.flags & oe && delete this.undefinedExports[e];
1589
- } else if (t === Tt) {
1590
- var o = this.currentScope();
1591
- o.lexical.push(e);
1592
- } else if (t === Ct) {
1593
- var u = this.currentScope();
1594
- this.treatFunctionsAsVar ? s = u.lexical.indexOf(e) > -1 : s = u.lexical.indexOf(e) > -1 || u.var.indexOf(e) > -1, u.functions.push(e);
1595
- } else for (var p = this.scopeStack.length - 1; p >= 0; --p) {
1596
- var h = this.scopeStack[p];
1597
- if (h.lexical.indexOf(e) > -1 && !(h.flags & St && h.lexical[0] === e) || !this.treatFunctionsAsVarInScope(h) && h.functions.indexOf(e) > -1) {
1598
- s = true;
1599
- break;
1600
- }
1601
- if (h.var.push(e), this.inModule && h.flags & oe && delete this.undefinedExports[e], h.flags & _e) break;
1602
- }
1603
- s && this.raiseRecoverable(i, "Identifier '" + e + "' has already been declared");
1604
- };
1605
- W.checkLocalExport = function(e) {
1606
- this.scopeStack[0].lexical.indexOf(e.name) === -1 && this.scopeStack[0].var.indexOf(e.name) === -1 && (this.undefinedExports[e.name] = e);
1607
- };
1608
- W.currentScope = function() {
1609
- return this.scopeStack[this.scopeStack.length - 1];
1610
- };
1611
- W.currentVarScope = function() {
1612
- for (var e = this.scopeStack.length - 1; ; e--) {
1613
- var t = this.scopeStack[e];
1614
- if (t.flags & (_e | ue | z)) return t;
1615
- }
1616
- };
1617
- W.currentThisScope = function() {
1618
- for (var e = this.scopeStack.length - 1; ; e--) {
1619
- var t = this.scopeStack[e];
1620
- if (t.flags & (_e | ue | z) && !(t.flags & He)) return t;
1621
- }
1622
- };
1623
- var Te = function(t, i, s) {
1624
- this.type = "", this.start = i, this.end = 0, t.options.locations && (this.loc = new be(t, s)), t.options.directSourceFile && (this.sourceFile = t.options.directSourceFile), t.options.ranges && (this.range = [i, 0]);
1625
- };
1626
- var he = A.prototype;
1627
- he.startNode = function() {
1628
- return new Te(this, this.start, this.startLoc);
1629
- };
1630
- he.startNodeAt = function(e, t) {
1631
- return new Te(this, e, t);
1632
- };
1633
- function wt(e, t, i, s) {
1634
- return e.type = t, e.end = i, this.options.locations && (e.loc.end = s), this.options.ranges && (e.range[1] = i), e;
1635
- }
1636
- he.finishNode = function(e, t) {
1637
- return wt.call(this, e, t, this.lastTokEnd, this.lastTokEndLoc);
1638
- };
1639
- he.finishNodeAt = function(e, t, i, s) {
1640
- return wt.call(this, e, t, i, s);
1641
- };
1642
- he.copyNode = function(e) {
1643
- var t = new Te(this, e.start, this.startLoc);
1644
- for (var i in e) t[i] = e[i];
1645
- return t;
1646
- };
1647
- var ts = "Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz";
1648
- var Pt = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS";
1649
- var It = Pt + " Extended_Pictographic";
1650
- var Nt = It;
1651
- var Lt = Nt + " EBase EComp EMod EPres ExtPict";
1652
- var Rt = Lt;
1653
- var is = Rt;
1654
- var ss = { 9: Pt, 10: It, 11: Nt, 12: Lt, 13: Rt, 14: is };
1655
- var rs = "Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji";
1656
- var as = { 9: "", 10: "", 11: "", 12: "", 13: "", 14: rs };
1657
- var lt = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu";
1658
- var Vt = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb";
1659
- var Ot = Vt + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd";
1660
- var Bt = Ot + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho";
1661
- var Dt = Bt + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi";
1662
- var Mt = Dt + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith";
1663
- var ns = Mt + " " + ts;
1664
- var os = { 9: Vt, 10: Ot, 11: Bt, 12: Dt, 13: Mt, 14: ns };
1665
- var Ft = {};
1666
- function us(e) {
1667
- var t = Ft[e] = { binary: H(ss[e] + " " + lt), binaryOfStrings: H(as[e]), nonBinary: { General_Category: H(lt), Script: H(os[e]) } };
1668
- t.nonBinary.Script_Extensions = t.nonBinary.Script, t.nonBinary.gc = t.nonBinary.General_Category, t.nonBinary.sc = t.nonBinary.Script, t.nonBinary.scx = t.nonBinary.Script_Extensions;
1669
- }
1670
- for (me = 0, Fe = [9, 10, 11, 12, 13, 14]; me < Fe.length; me += 1) ft = Fe[me], us(ft);
1671
- var ft;
1672
- var me;
1673
- var Fe;
1674
- var f = A.prototype;
1675
- var ve = function(t, i) {
1676
- this.parent = t, this.base = i || this;
1677
- };
1678
- ve.prototype.separatedFrom = function(t) {
1679
- for (var i = this; i; i = i.parent) for (var s = t; s; s = s.parent) if (i.base === s.base && i !== s) return true;
1680
- return false;
1681
- };
1682
- ve.prototype.sibling = function() {
1683
- return new ve(this.parent, this.base);
1684
- };
1685
- var G = function(t) {
1686
- this.parser = t, this.validFlags = "gim" + (t.options.ecmaVersion >= 6 ? "uy" : "") + (t.options.ecmaVersion >= 9 ? "s" : "") + (t.options.ecmaVersion >= 13 ? "d" : "") + (t.options.ecmaVersion >= 15 ? "v" : ""), this.unicodeProperties = Ft[t.options.ecmaVersion >= 14 ? 14 : t.options.ecmaVersion], this.source = "", this.flags = "", this.start = 0, this.switchU = false, this.switchV = false, this.switchN = false, this.pos = 0, this.lastIntValue = 0, this.lastStringValue = "", this.lastAssertionIsQuantifiable = false, this.numCapturingParens = 0, this.maxBackReference = 0, this.groupNames = /* @__PURE__ */ Object.create(null), this.backReferenceNames = [], this.branchID = null;
1687
- };
1688
- G.prototype.reset = function(t, i, s) {
1689
- var r = s.indexOf("v") !== -1, o = s.indexOf("u") !== -1;
1690
- this.start = t | 0, this.source = i + "", this.flags = s, r && this.parser.options.ecmaVersion >= 15 ? (this.switchU = true, this.switchV = true, this.switchN = true) : (this.switchU = o && this.parser.options.ecmaVersion >= 6, this.switchV = false, this.switchN = o && this.parser.options.ecmaVersion >= 9);
1691
- };
1692
- G.prototype.raise = function(t) {
1693
- this.parser.raiseRecoverable(this.start, "Invalid regular expression: /" + this.source + "/: " + t);
1694
- };
1695
- G.prototype.at = function(t, i) {
1696
- i === void 0 && (i = false);
1697
- var s = this.source, r = s.length;
1698
- if (t >= r) return -1;
1699
- var o = s.charCodeAt(t);
1700
- if (!(i || this.switchU) || o <= 55295 || o >= 57344 || t + 1 >= r) return o;
1701
- var u = s.charCodeAt(t + 1);
1702
- return u >= 56320 && u <= 57343 ? (o << 10) + u - 56613888 : o;
1703
- };
1704
- G.prototype.nextIndex = function(t, i) {
1705
- i === void 0 && (i = false);
1706
- var s = this.source, r = s.length;
1707
- if (t >= r) return r;
1708
- var o = s.charCodeAt(t), u;
1709
- return !(i || this.switchU) || o <= 55295 || o >= 57344 || t + 1 >= r || (u = s.charCodeAt(t + 1)) < 56320 || u > 57343 ? t + 1 : t + 2;
1710
- };
1711
- G.prototype.current = function(t) {
1712
- return t === void 0 && (t = false), this.at(this.pos, t);
1713
- };
1714
- G.prototype.lookahead = function(t) {
1715
- return t === void 0 && (t = false), this.at(this.nextIndex(this.pos, t), t);
1716
- };
1717
- G.prototype.advance = function(t) {
1718
- t === void 0 && (t = false), this.pos = this.nextIndex(this.pos, t);
1719
- };
1720
- G.prototype.eat = function(t, i) {
1721
- return i === void 0 && (i = false), this.current(i) === t ? (this.advance(i), true) : false;
1722
- };
1723
- G.prototype.eatChars = function(t, i) {
1724
- i === void 0 && (i = false);
1725
- for (var s = this.pos, r = 0, o = t; r < o.length; r += 1) {
1726
- var u = o[r], p = this.at(s, i);
1727
- if (p === -1 || p !== u) return false;
1728
- s = this.nextIndex(s, i);
1729
- }
1730
- return this.pos = s, true;
1731
- };
1732
- f.validateRegExpFlags = function(e) {
1733
- for (var t = e.validFlags, i = e.flags, s = false, r = false, o = 0; o < i.length; o++) {
1734
- var u = i.charAt(o);
1735
- t.indexOf(u) === -1 && this.raise(e.start, "Invalid regular expression flag"), i.indexOf(u, o + 1) > -1 && this.raise(e.start, "Duplicate regular expression flag"), u === "u" && (s = true), u === "v" && (r = true);
1736
- }
1737
- this.options.ecmaVersion >= 15 && s && r && this.raise(e.start, "Invalid regular expression flag");
1738
- };
1739
- function hs(e) {
1740
- for (var t in e) return true;
1741
- return false;
1742
- }
1743
- f.validateRegExpPattern = function(e) {
1744
- this.regexp_pattern(e), !e.switchN && this.options.ecmaVersion >= 9 && hs(e.groupNames) && (e.switchN = true, this.regexp_pattern(e));
1745
- };
1746
- f.regexp_pattern = function(e) {
1747
- e.pos = 0, e.lastIntValue = 0, e.lastStringValue = "", e.lastAssertionIsQuantifiable = false, e.numCapturingParens = 0, e.maxBackReference = 0, e.groupNames = /* @__PURE__ */ Object.create(null), e.backReferenceNames.length = 0, e.branchID = null, this.regexp_disjunction(e), e.pos !== e.source.length && (e.eat(41) && e.raise("Unmatched ')'"), (e.eat(93) || e.eat(125)) && e.raise("Lone quantifier brackets")), e.maxBackReference > e.numCapturingParens && e.raise("Invalid escape");
1748
- for (var t = 0, i = e.backReferenceNames; t < i.length; t += 1) {
1749
- var s = i[t];
1750
- e.groupNames[s] || e.raise("Invalid named capture referenced");
1751
- }
1752
- };
1753
- f.regexp_disjunction = function(e) {
1754
- var t = this.options.ecmaVersion >= 16;
1755
- for (t && (e.branchID = new ve(e.branchID, null)), this.regexp_alternative(e); e.eat(124); ) t && (e.branchID = e.branchID.sibling()), this.regexp_alternative(e);
1756
- t && (e.branchID = e.branchID.parent), this.regexp_eatQuantifier(e, true) && e.raise("Nothing to repeat"), e.eat(123) && e.raise("Lone quantifier brackets");
1757
- };
1758
- f.regexp_alternative = function(e) {
1759
- for (; e.pos < e.source.length && this.regexp_eatTerm(e); ) ;
1760
- };
1761
- f.regexp_eatTerm = function(e) {
1762
- return this.regexp_eatAssertion(e) ? (e.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(e) && e.switchU && e.raise("Invalid quantifier"), true) : (e.switchU ? this.regexp_eatAtom(e) : this.regexp_eatExtendedAtom(e)) ? (this.regexp_eatQuantifier(e), true) : false;
1763
- };
1764
- f.regexp_eatAssertion = function(e) {
1765
- var t = e.pos;
1766
- if (e.lastAssertionIsQuantifiable = false, e.eat(94) || e.eat(36)) return true;
1767
- if (e.eat(92)) {
1768
- if (e.eat(66) || e.eat(98)) return true;
1769
- e.pos = t;
1770
- }
1771
- if (e.eat(40) && e.eat(63)) {
1772
- var i = false;
1773
- if (this.options.ecmaVersion >= 9 && (i = e.eat(60)), e.eat(61) || e.eat(33)) return this.regexp_disjunction(e), e.eat(41) || e.raise("Unterminated group"), e.lastAssertionIsQuantifiable = !i, true;
1774
- }
1775
- return e.pos = t, false;
1776
- };
1777
- f.regexp_eatQuantifier = function(e, t) {
1778
- return t === void 0 && (t = false), this.regexp_eatQuantifierPrefix(e, t) ? (e.eat(63), true) : false;
1779
- };
1780
- f.regexp_eatQuantifierPrefix = function(e, t) {
1781
- return e.eat(42) || e.eat(43) || e.eat(63) || this.regexp_eatBracedQuantifier(e, t);
1782
- };
1783
- f.regexp_eatBracedQuantifier = function(e, t) {
1784
- var i = e.pos;
1785
- if (e.eat(123)) {
1786
- var s = 0, r = -1;
1787
- if (this.regexp_eatDecimalDigits(e) && (s = e.lastIntValue, e.eat(44) && this.regexp_eatDecimalDigits(e) && (r = e.lastIntValue), e.eat(125))) return r !== -1 && r < s && !t && e.raise("numbers out of order in {} quantifier"), true;
1788
- e.switchU && !t && e.raise("Incomplete quantifier"), e.pos = i;
1789
- }
1790
- return false;
1791
- };
1792
- f.regexp_eatAtom = function(e) {
1793
- return this.regexp_eatPatternCharacters(e) || e.eat(46) || this.regexp_eatReverseSolidusAtomEscape(e) || this.regexp_eatCharacterClass(e) || this.regexp_eatUncapturingGroup(e) || this.regexp_eatCapturingGroup(e);
1794
- };
1795
- f.regexp_eatReverseSolidusAtomEscape = function(e) {
1796
- var t = e.pos;
1797
- if (e.eat(92)) {
1798
- if (this.regexp_eatAtomEscape(e)) return true;
1799
- e.pos = t;
1800
- }
1801
- return false;
1802
- };
1803
- f.regexp_eatUncapturingGroup = function(e) {
1804
- var t = e.pos;
1805
- if (e.eat(40)) {
1806
- if (e.eat(63)) {
1807
- if (this.options.ecmaVersion >= 16) {
1808
- var i = this.regexp_eatModifiers(e), s = e.eat(45);
1809
- if (i || s) {
1810
- for (var r = 0; r < i.length; r++) {
1811
- var o = i.charAt(r);
1812
- i.indexOf(o, r + 1) > -1 && e.raise("Duplicate regular expression modifiers");
1813
- }
1814
- if (s) {
1815
- var u = this.regexp_eatModifiers(e);
1816
- !i && !u && e.current() === 58 && e.raise("Invalid regular expression modifiers");
1817
- for (var p = 0; p < u.length; p++) {
1818
- var h = u.charAt(p);
1819
- (u.indexOf(h, p + 1) > -1 || i.indexOf(h) > -1) && e.raise("Duplicate regular expression modifiers");
1820
- }
1821
- }
1822
- }
1823
- }
1824
- if (e.eat(58)) {
1825
- if (this.regexp_disjunction(e), e.eat(41)) return true;
1826
- e.raise("Unterminated group");
1827
- }
1828
- }
1829
- e.pos = t;
1830
- }
1831
- return false;
1832
- };
1833
- f.regexp_eatCapturingGroup = function(e) {
1834
- if (e.eat(40)) {
1835
- if (this.options.ecmaVersion >= 9 ? this.regexp_groupSpecifier(e) : e.current() === 63 && e.raise("Invalid group"), this.regexp_disjunction(e), e.eat(41)) return e.numCapturingParens += 1, true;
1836
- e.raise("Unterminated group");
1837
- }
1838
- return false;
1839
- };
1840
- f.regexp_eatModifiers = function(e) {
1841
- for (var t = "", i = 0; (i = e.current()) !== -1 && ps(i); ) t += q(i), e.advance();
1842
- return t;
1843
- };
1844
- function ps(e) {
1845
- return e === 105 || e === 109 || e === 115;
1846
- }
1847
- f.regexp_eatExtendedAtom = function(e) {
1848
- return e.eat(46) || this.regexp_eatReverseSolidusAtomEscape(e) || this.regexp_eatCharacterClass(e) || this.regexp_eatUncapturingGroup(e) || this.regexp_eatCapturingGroup(e) || this.regexp_eatInvalidBracedQuantifier(e) || this.regexp_eatExtendedPatternCharacter(e);
1849
- };
1850
- f.regexp_eatInvalidBracedQuantifier = function(e) {
1851
- return this.regexp_eatBracedQuantifier(e, true) && e.raise("Nothing to repeat"), false;
1852
- };
1853
- f.regexp_eatSyntaxCharacter = function(e) {
1854
- var t = e.current();
1855
- return jt(t) ? (e.lastIntValue = t, e.advance(), true) : false;
1856
- };
1857
- function jt(e) {
1858
- return e === 36 || e >= 40 && e <= 43 || e === 46 || e === 63 || e >= 91 && e <= 94 || e >= 123 && e <= 125;
1859
- }
1860
- f.regexp_eatPatternCharacters = function(e) {
1861
- for (var t = e.pos, i = 0; (i = e.current()) !== -1 && !jt(i); ) e.advance();
1862
- return e.pos !== t;
1863
- };
1864
- f.regexp_eatExtendedPatternCharacter = function(e) {
1865
- var t = e.current();
1866
- return t !== -1 && t !== 36 && !(t >= 40 && t <= 43) && t !== 46 && t !== 63 && t !== 91 && t !== 94 && t !== 124 ? (e.advance(), true) : false;
1867
- };
1868
- f.regexp_groupSpecifier = function(e) {
1869
- if (e.eat(63)) {
1870
- this.regexp_eatGroupName(e) || e.raise("Invalid group");
1871
- var t = this.options.ecmaVersion >= 16, i = e.groupNames[e.lastStringValue];
1872
- if (i) if (t) for (var s = 0, r = i; s < r.length; s += 1) {
1873
- var o = r[s];
1874
- o.separatedFrom(e.branchID) || e.raise("Duplicate capture group name");
1875
- }
1876
- else e.raise("Duplicate capture group name");
1877
- t ? (i || (e.groupNames[e.lastStringValue] = [])).push(e.branchID) : e.groupNames[e.lastStringValue] = true;
1878
- }
1879
- };
1880
- f.regexp_eatGroupName = function(e) {
1881
- if (e.lastStringValue = "", e.eat(60)) {
1882
- if (this.regexp_eatRegExpIdentifierName(e) && e.eat(62)) return true;
1883
- e.raise("Invalid capture group name");
1884
- }
1885
- return false;
1886
- };
1887
- f.regexp_eatRegExpIdentifierName = function(e) {
1888
- if (e.lastStringValue = "", this.regexp_eatRegExpIdentifierStart(e)) {
1889
- for (e.lastStringValue += q(e.lastIntValue); this.regexp_eatRegExpIdentifierPart(e); ) e.lastStringValue += q(e.lastIntValue);
1890
- return true;
1891
- }
1892
- return false;
1893
- };
1894
- f.regexp_eatRegExpIdentifierStart = function(e) {
1895
- var t = e.pos, i = this.options.ecmaVersion >= 11, s = e.current(i);
1896
- return e.advance(i), s === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, i) && (s = e.lastIntValue), cs(s) ? (e.lastIntValue = s, true) : (e.pos = t, false);
1897
- };
1898
- function cs(e) {
1899
- return j(e, true) || e === 36 || e === 95;
1900
- }
1901
- f.regexp_eatRegExpIdentifierPart = function(e) {
1902
- var t = e.pos, i = this.options.ecmaVersion >= 11, s = e.current(i);
1903
- return e.advance(i), s === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, i) && (s = e.lastIntValue), ls(s) ? (e.lastIntValue = s, true) : (e.pos = t, false);
1904
- };
1905
- function ls(e) {
1906
- return X(e, true) || e === 36 || e === 95 || e === 8204 || e === 8205;
1907
- }
1908
- f.regexp_eatAtomEscape = function(e) {
1909
- return this.regexp_eatBackReference(e) || this.regexp_eatCharacterClassEscape(e) || this.regexp_eatCharacterEscape(e) || e.switchN && this.regexp_eatKGroupName(e) ? true : (e.switchU && (e.current() === 99 && e.raise("Invalid unicode escape"), e.raise("Invalid escape")), false);
1910
- };
1911
- f.regexp_eatBackReference = function(e) {
1912
- var t = e.pos;
1913
- if (this.regexp_eatDecimalEscape(e)) {
1914
- var i = e.lastIntValue;
1915
- if (e.switchU) return i > e.maxBackReference && (e.maxBackReference = i), true;
1916
- if (i <= e.numCapturingParens) return true;
1917
- e.pos = t;
1918
- }
1919
- return false;
1920
- };
1921
- f.regexp_eatKGroupName = function(e) {
1922
- if (e.eat(107)) {
1923
- if (this.regexp_eatGroupName(e)) return e.backReferenceNames.push(e.lastStringValue), true;
1924
- e.raise("Invalid named reference");
1925
- }
1926
- return false;
1927
- };
1928
- f.regexp_eatCharacterEscape = function(e) {
1929
- return this.regexp_eatControlEscape(e) || this.regexp_eatCControlLetter(e) || this.regexp_eatZero(e) || this.regexp_eatHexEscapeSequence(e) || this.regexp_eatRegExpUnicodeEscapeSequence(e, false) || !e.switchU && this.regexp_eatLegacyOctalEscapeSequence(e) || this.regexp_eatIdentityEscape(e);
1930
- };
1931
- f.regexp_eatCControlLetter = function(e) {
1932
- var t = e.pos;
1933
- if (e.eat(99)) {
1934
- if (this.regexp_eatControlLetter(e)) return true;
1935
- e.pos = t;
1936
- }
1937
- return false;
1938
- };
1939
- f.regexp_eatZero = function(e) {
1940
- return e.current() === 48 && !Ee(e.lookahead()) ? (e.lastIntValue = 0, e.advance(), true) : false;
1941
- };
1942
- f.regexp_eatControlEscape = function(e) {
1943
- var t = e.current();
1944
- return t === 116 ? (e.lastIntValue = 9, e.advance(), true) : t === 110 ? (e.lastIntValue = 10, e.advance(), true) : t === 118 ? (e.lastIntValue = 11, e.advance(), true) : t === 102 ? (e.lastIntValue = 12, e.advance(), true) : t === 114 ? (e.lastIntValue = 13, e.advance(), true) : false;
1945
- };
1946
- f.regexp_eatControlLetter = function(e) {
1947
- var t = e.current();
1948
- return Ut(t) ? (e.lastIntValue = t % 32, e.advance(), true) : false;
1949
- };
1950
- function Ut(e) {
1951
- return e >= 65 && e <= 90 || e >= 97 && e <= 122;
1952
- }
1953
- f.regexp_eatRegExpUnicodeEscapeSequence = function(e, t) {
1954
- t === void 0 && (t = false);
1955
- var i = e.pos, s = t || e.switchU;
1956
- if (e.eat(117)) {
1957
- if (this.regexp_eatFixedHexDigits(e, 4)) {
1958
- var r = e.lastIntValue;
1959
- if (s && r >= 55296 && r <= 56319) {
1960
- var o = e.pos;
1961
- if (e.eat(92) && e.eat(117) && this.regexp_eatFixedHexDigits(e, 4)) {
1962
- var u = e.lastIntValue;
1963
- if (u >= 56320 && u <= 57343) return e.lastIntValue = (r - 55296) * 1024 + (u - 56320) + 65536, true;
1964
- }
1965
- e.pos = o, e.lastIntValue = r;
1966
- }
1967
- return true;
1968
- }
1969
- if (s && e.eat(123) && this.regexp_eatHexDigits(e) && e.eat(125) && fs(e.lastIntValue)) return true;
1970
- s && e.raise("Invalid unicode escape"), e.pos = i;
1971
- }
1972
- return false;
1973
- };
1974
- function fs(e) {
1975
- return e >= 0 && e <= 1114111;
1976
- }
1977
- f.regexp_eatIdentityEscape = function(e) {
1978
- if (e.switchU) return this.regexp_eatSyntaxCharacter(e) ? true : e.eat(47) ? (e.lastIntValue = 47, true) : false;
1979
- var t = e.current();
1980
- return t !== 99 && (!e.switchN || t !== 107) ? (e.lastIntValue = t, e.advance(), true) : false;
1981
- };
1982
- f.regexp_eatDecimalEscape = function(e) {
1983
- e.lastIntValue = 0;
1984
- var t = e.current();
1985
- if (t >= 49 && t <= 57) {
1986
- do
1987
- e.lastIntValue = 10 * e.lastIntValue + (t - 48), e.advance();
1988
- while ((t = e.current()) >= 48 && t <= 57);
1989
- return true;
1990
- }
1991
- return false;
1992
- };
1993
- var Gt = 0;
1994
- var J = 1;
1995
- var B = 2;
1996
- f.regexp_eatCharacterClassEscape = function(e) {
1997
- var t = e.current();
1998
- if (ds(t)) return e.lastIntValue = -1, e.advance(), J;
1999
- var i = false;
2000
- if (e.switchU && this.options.ecmaVersion >= 9 && ((i = t === 80) || t === 112)) {
2001
- e.lastIntValue = -1, e.advance();
2002
- var s;
2003
- if (e.eat(123) && (s = this.regexp_eatUnicodePropertyValueExpression(e)) && e.eat(125)) return i && s === B && e.raise("Invalid property name"), s;
2004
- e.raise("Invalid property name");
2005
- }
2006
- return Gt;
2007
- };
2008
- function ds(e) {
2009
- return e === 100 || e === 68 || e === 115 || e === 83 || e === 119 || e === 87;
2010
- }
2011
- f.regexp_eatUnicodePropertyValueExpression = function(e) {
2012
- var t = e.pos;
2013
- if (this.regexp_eatUnicodePropertyName(e) && e.eat(61)) {
2014
- var i = e.lastStringValue;
2015
- if (this.regexp_eatUnicodePropertyValue(e)) {
2016
- var s = e.lastStringValue;
2017
- return this.regexp_validateUnicodePropertyNameAndValue(e, i, s), J;
2018
- }
2019
- }
2020
- if (e.pos = t, this.regexp_eatLoneUnicodePropertyNameOrValue(e)) {
2021
- var r = e.lastStringValue;
2022
- return this.regexp_validateUnicodePropertyNameOrValue(e, r);
2023
- }
2024
- return Gt;
2025
- };
2026
- f.regexp_validateUnicodePropertyNameAndValue = function(e, t, i) {
2027
- $(e.unicodeProperties.nonBinary, t) || e.raise("Invalid property name"), e.unicodeProperties.nonBinary[t].test(i) || e.raise("Invalid property value");
2028
- };
2029
- f.regexp_validateUnicodePropertyNameOrValue = function(e, t) {
2030
- if (e.unicodeProperties.binary.test(t)) return J;
2031
- if (e.switchV && e.unicodeProperties.binaryOfStrings.test(t)) return B;
2032
- e.raise("Invalid property name");
2033
- };
2034
- f.regexp_eatUnicodePropertyName = function(e) {
2035
- var t = 0;
2036
- for (e.lastStringValue = ""; qt(t = e.current()); ) e.lastStringValue += q(t), e.advance();
2037
- return e.lastStringValue !== "";
2038
- };
2039
- function qt(e) {
2040
- return Ut(e) || e === 95;
2041
- }
2042
- f.regexp_eatUnicodePropertyValue = function(e) {
2043
- var t = 0;
2044
- for (e.lastStringValue = ""; ms(t = e.current()); ) e.lastStringValue += q(t), e.advance();
2045
- return e.lastStringValue !== "";
2046
- };
2047
- function ms(e) {
2048
- return qt(e) || Ee(e);
2049
- }
2050
- f.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
2051
- return this.regexp_eatUnicodePropertyValue(e);
2052
- };
2053
- f.regexp_eatCharacterClass = function(e) {
2054
- if (e.eat(91)) {
2055
- var t = e.eat(94), i = this.regexp_classContents(e);
2056
- return e.eat(93) || e.raise("Unterminated character class"), t && i === B && e.raise("Negated character class may contain strings"), true;
2057
- }
2058
- return false;
2059
- };
2060
- f.regexp_classContents = function(e) {
2061
- return e.current() === 93 ? J : e.switchV ? this.regexp_classSetExpression(e) : (this.regexp_nonEmptyClassRanges(e), J);
2062
- };
2063
- f.regexp_nonEmptyClassRanges = function(e) {
2064
- for (; this.regexp_eatClassAtom(e); ) {
2065
- var t = e.lastIntValue;
2066
- if (e.eat(45) && this.regexp_eatClassAtom(e)) {
2067
- var i = e.lastIntValue;
2068
- e.switchU && (t === -1 || i === -1) && e.raise("Invalid character class"), t !== -1 && i !== -1 && t > i && e.raise("Range out of order in character class");
2069
- }
2070
- }
2071
- };
2072
- f.regexp_eatClassAtom = function(e) {
2073
- var t = e.pos;
2074
- if (e.eat(92)) {
2075
- if (this.regexp_eatClassEscape(e)) return true;
2076
- if (e.switchU) {
2077
- var i = e.current();
2078
- (i === 99 || Ht(i)) && e.raise("Invalid class escape"), e.raise("Invalid escape");
2079
- }
2080
- e.pos = t;
2081
- }
2082
- var s = e.current();
2083
- return s !== 93 ? (e.lastIntValue = s, e.advance(), true) : false;
2084
- };
2085
- f.regexp_eatClassEscape = function(e) {
2086
- var t = e.pos;
2087
- if (e.eat(98)) return e.lastIntValue = 8, true;
2088
- if (e.switchU && e.eat(45)) return e.lastIntValue = 45, true;
2089
- if (!e.switchU && e.eat(99)) {
2090
- if (this.regexp_eatClassControlLetter(e)) return true;
2091
- e.pos = t;
2092
- }
2093
- return this.regexp_eatCharacterClassEscape(e) || this.regexp_eatCharacterEscape(e);
2094
- };
2095
- f.regexp_classSetExpression = function(e) {
2096
- var t = J, i;
2097
- if (!this.regexp_eatClassSetRange(e)) if (i = this.regexp_eatClassSetOperand(e)) {
2098
- i === B && (t = B);
2099
- for (var s = e.pos; e.eatChars([38, 38]); ) {
2100
- if (e.current() !== 38 && (i = this.regexp_eatClassSetOperand(e))) {
2101
- i !== B && (t = J);
2102
- continue;
2103
- }
2104
- e.raise("Invalid character in character class");
2105
- }
2106
- if (s !== e.pos) return t;
2107
- for (; e.eatChars([45, 45]); ) this.regexp_eatClassSetOperand(e) || e.raise("Invalid character in character class");
2108
- if (s !== e.pos) return t;
2109
- } else e.raise("Invalid character in character class");
2110
- for (; ; ) if (!this.regexp_eatClassSetRange(e)) {
2111
- if (i = this.regexp_eatClassSetOperand(e), !i) return t;
2112
- i === B && (t = B);
2113
- }
2114
- };
2115
- f.regexp_eatClassSetRange = function(e) {
2116
- var t = e.pos;
2117
- if (this.regexp_eatClassSetCharacter(e)) {
2118
- var i = e.lastIntValue;
2119
- if (e.eat(45) && this.regexp_eatClassSetCharacter(e)) {
2120
- var s = e.lastIntValue;
2121
- return i !== -1 && s !== -1 && i > s && e.raise("Range out of order in character class"), true;
2122
- }
2123
- e.pos = t;
2124
- }
2125
- return false;
2126
- };
2127
- f.regexp_eatClassSetOperand = function(e) {
2128
- return this.regexp_eatClassSetCharacter(e) ? J : this.regexp_eatClassStringDisjunction(e) || this.regexp_eatNestedClass(e);
2129
- };
2130
- f.regexp_eatNestedClass = function(e) {
2131
- var t = e.pos;
2132
- if (e.eat(91)) {
2133
- var i = e.eat(94), s = this.regexp_classContents(e);
2134
- if (e.eat(93)) return i && s === B && e.raise("Negated character class may contain strings"), s;
2135
- e.pos = t;
2136
- }
2137
- if (e.eat(92)) {
2138
- var r = this.regexp_eatCharacterClassEscape(e);
2139
- if (r) return r;
2140
- e.pos = t;
2141
- }
2142
- return null;
2143
- };
2144
- f.regexp_eatClassStringDisjunction = function(e) {
2145
- var t = e.pos;
2146
- if (e.eatChars([92, 113])) {
2147
- if (e.eat(123)) {
2148
- var i = this.regexp_classStringDisjunctionContents(e);
2149
- if (e.eat(125)) return i;
2150
- } else e.raise("Invalid escape");
2151
- e.pos = t;
2152
- }
2153
- return null;
2154
- };
2155
- f.regexp_classStringDisjunctionContents = function(e) {
2156
- for (var t = this.regexp_classString(e); e.eat(124); ) this.regexp_classString(e) === B && (t = B);
2157
- return t;
2158
- };
2159
- f.regexp_classString = function(e) {
2160
- for (var t = 0; this.regexp_eatClassSetCharacter(e); ) t++;
2161
- return t === 1 ? J : B;
2162
- };
2163
- f.regexp_eatClassSetCharacter = function(e) {
2164
- var t = e.pos;
2165
- if (e.eat(92)) return this.regexp_eatCharacterEscape(e) || this.regexp_eatClassSetReservedPunctuator(e) ? true : e.eat(98) ? (e.lastIntValue = 8, true) : (e.pos = t, false);
2166
- var i = e.current();
2167
- return i < 0 || i === e.lookahead() && xs(i) || ys(i) ? false : (e.advance(), e.lastIntValue = i, true);
2168
- };
2169
- function xs(e) {
2170
- return e === 33 || e >= 35 && e <= 38 || e >= 42 && e <= 44 || e === 46 || e >= 58 && e <= 64 || e === 94 || e === 96 || e === 126;
2171
- }
2172
- function ys(e) {
2173
- return e === 40 || e === 41 || e === 45 || e === 47 || e >= 91 && e <= 93 || e >= 123 && e <= 125;
2174
- }
2175
- f.regexp_eatClassSetReservedPunctuator = function(e) {
2176
- var t = e.current();
2177
- return gs(t) ? (e.lastIntValue = t, e.advance(), true) : false;
2178
- };
2179
- function gs(e) {
2180
- return e === 33 || e === 35 || e === 37 || e === 38 || e === 44 || e === 45 || e >= 58 && e <= 62 || e === 64 || e === 96 || e === 126;
2181
- }
2182
- f.regexp_eatClassControlLetter = function(e) {
2183
- var t = e.current();
2184
- return Ee(t) || t === 95 ? (e.lastIntValue = t % 32, e.advance(), true) : false;
2185
- };
2186
- f.regexp_eatHexEscapeSequence = function(e) {
2187
- var t = e.pos;
2188
- if (e.eat(120)) {
2189
- if (this.regexp_eatFixedHexDigits(e, 2)) return true;
2190
- e.switchU && e.raise("Invalid escape"), e.pos = t;
2191
- }
2192
- return false;
2193
- };
2194
- f.regexp_eatDecimalDigits = function(e) {
2195
- var t = e.pos, i = 0;
2196
- for (e.lastIntValue = 0; Ee(i = e.current()); ) e.lastIntValue = 10 * e.lastIntValue + (i - 48), e.advance();
2197
- return e.pos !== t;
2198
- };
2199
- function Ee(e) {
2200
- return e >= 48 && e <= 57;
2201
- }
2202
- f.regexp_eatHexDigits = function(e) {
2203
- var t = e.pos, i = 0;
2204
- for (e.lastIntValue = 0; Jt(i = e.current()); ) e.lastIntValue = 16 * e.lastIntValue + Kt(i), e.advance();
2205
- return e.pos !== t;
2206
- };
2207
- function Jt(e) {
2208
- return e >= 48 && e <= 57 || e >= 65 && e <= 70 || e >= 97 && e <= 102;
2209
- }
2210
- function Kt(e) {
2211
- return e >= 65 && e <= 70 ? 10 + (e - 65) : e >= 97 && e <= 102 ? 10 + (e - 97) : e - 48;
2212
- }
2213
- f.regexp_eatLegacyOctalEscapeSequence = function(e) {
2214
- if (this.regexp_eatOctalDigit(e)) {
2215
- var t = e.lastIntValue;
2216
- if (this.regexp_eatOctalDigit(e)) {
2217
- var i = e.lastIntValue;
2218
- t <= 3 && this.regexp_eatOctalDigit(e) ? e.lastIntValue = t * 64 + i * 8 + e.lastIntValue : e.lastIntValue = t * 8 + i;
2219
- } else e.lastIntValue = t;
2220
- return true;
2221
- }
2222
- return false;
2223
- };
2224
- f.regexp_eatOctalDigit = function(e) {
2225
- var t = e.current();
2226
- return Ht(t) ? (e.lastIntValue = t - 48, e.advance(), true) : (e.lastIntValue = 0, false);
2227
- };
2228
- function Ht(e) {
2229
- return e >= 48 && e <= 55;
2230
- }
2231
- f.regexp_eatFixedHexDigits = function(e, t) {
2232
- var i = e.pos;
2233
- e.lastIntValue = 0;
2234
- for (var s = 0; s < t; ++s) {
2235
- var r = e.current();
2236
- if (!Jt(r)) return e.pos = i, false;
2237
- e.lastIntValue = 16 * e.lastIntValue + Kt(r), e.advance();
2238
- }
2239
- return true;
2240
- };
2241
- var Qe = function(t) {
2242
- this.type = t.type, this.value = t.value, this.start = t.start, this.end = t.end, t.options.locations && (this.loc = new be(t, t.startLoc, t.endLoc)), t.options.ranges && (this.range = [t.start, t.end]);
2243
- };
2244
- var b = A.prototype;
2245
- b.next = function(e) {
2246
- !e && this.type.keyword && this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword), this.options.onToken && this.options.onToken(new Qe(this)), this.lastTokEnd = this.end, this.lastTokStart = this.start, this.lastTokEndLoc = this.endLoc, this.lastTokStartLoc = this.startLoc, this.nextToken();
2247
- };
2248
- b.getToken = function() {
2249
- return this.next(), new Qe(this);
2250
- };
2251
- typeof Symbol < "u" && (b[Symbol.iterator] = function() {
2252
- var e = this;
2253
- return { next: function() {
2254
- var t = e.getToken();
2255
- return { done: t.type === a.eof, value: t };
2256
- } };
2257
- });
2258
- b.nextToken = function() {
2259
- var e = this.curContext();
2260
- if ((!e || !e.preserveSpace) && this.skipSpace(), this.start = this.pos, this.options.locations && (this.startLoc = this.curPosition()), this.pos >= this.input.length) return this.finishToken(a.eof);
2261
- if (e.override) return e.override(this);
2262
- this.readToken(this.fullCharCodeAtPos());
2263
- };
2264
- b.readToken = function(e) {
2265
- return j(e, this.options.ecmaVersion >= 6) || e === 92 ? this.readWord() : this.getTokenFromCode(e);
2266
- };
2267
- b.fullCharCodeAtPos = function() {
2268
- var e = this.input.charCodeAt(this.pos);
2269
- if (e <= 55295 || e >= 56320) return e;
2270
- var t = this.input.charCodeAt(this.pos + 1);
2271
- return t <= 56319 || t >= 57344 ? e : (e << 10) + t - 56613888;
2272
- };
2273
- b.skipBlockComment = function() {
2274
- var e = this.options.onComment && this.curPosition(), t = this.pos, i = this.input.indexOf("*/", this.pos += 2);
2275
- if (i === -1 && this.raise(this.pos - 2, "Unterminated comment"), this.pos = i + 2, this.options.locations) for (var s = void 0, r = t; (s = xt(this.input, r, this.pos)) > -1; ) ++this.curLine, r = this.lineStart = s;
2276
- this.options.onComment && this.options.onComment(true, this.input.slice(t + 2, i), t, this.pos, e, this.curPosition());
2277
- };
2278
- b.skipLineComment = function(e) {
2279
- for (var t = this.pos, i = this.options.onComment && this.curPosition(), s = this.input.charCodeAt(this.pos += e); this.pos < this.input.length && !Y(s); ) s = this.input.charCodeAt(++this.pos);
2280
- this.options.onComment && this.options.onComment(false, this.input.slice(t + e, this.pos), t, this.pos, i, this.curPosition());
2281
- };
2282
- b.skipSpace = function() {
2283
- e: for (; this.pos < this.input.length; ) {
2284
- var e = this.input.charCodeAt(this.pos);
2285
- switch (e) {
2286
- case 32:
2287
- case 160:
2288
- ++this.pos;
2289
- break;
2290
- case 13:
2291
- this.input.charCodeAt(this.pos + 1) === 10 && ++this.pos;
2292
- case 10:
2293
- case 8232:
2294
- case 8233:
2295
- ++this.pos, this.options.locations && (++this.curLine, this.lineStart = this.pos);
2296
- break;
2297
- case 47:
2298
- switch (this.input.charCodeAt(this.pos + 1)) {
2299
- case 42:
2300
- this.skipBlockComment();
2301
- break;
2302
- case 47:
2303
- this.skipLineComment(2);
2304
- break;
2305
- default:
2306
- break e;
2307
- }
2308
- break;
2309
- default:
2310
- if (e > 8 && e < 14 || e >= 5760 && yt.test(String.fromCharCode(e))) ++this.pos;
2311
- else break e;
2312
- }
2313
- }
2314
- };
2315
- b.finishToken = function(e, t) {
2316
- this.end = this.pos, this.options.locations && (this.endLoc = this.curPosition());
2317
- var i = this.type;
2318
- this.type = e, this.value = t, this.updateContext(i);
2319
- };
2320
- b.readToken_dot = function() {
2321
- var e = this.input.charCodeAt(this.pos + 1);
2322
- if (e >= 48 && e <= 57) return this.readNumber(true);
2323
- var t = this.input.charCodeAt(this.pos + 2);
2324
- return this.options.ecmaVersion >= 6 && e === 46 && t === 46 ? (this.pos += 3, this.finishToken(a.ellipsis)) : (++this.pos, this.finishToken(a.dot));
2325
- };
2326
- b.readToken_slash = function() {
2327
- var e = this.input.charCodeAt(this.pos + 1);
2328
- return this.exprAllowed ? (++this.pos, this.readRegexp()) : e === 61 ? this.finishOp(a.assign, 2) : this.finishOp(a.slash, 1);
2329
- };
2330
- b.readToken_mult_modulo_exp = function(e) {
2331
- var t = this.input.charCodeAt(this.pos + 1), i = 1, s = e === 42 ? a.star : a.modulo;
2332
- return this.options.ecmaVersion >= 7 && e === 42 && t === 42 && (++i, s = a.starstar, t = this.input.charCodeAt(this.pos + 2)), t === 61 ? this.finishOp(a.assign, i + 1) : this.finishOp(s, i);
2333
- };
2334
- b.readToken_pipe_amp = function(e) {
2335
- var t = this.input.charCodeAt(this.pos + 1);
2336
- if (t === e) {
2337
- if (this.options.ecmaVersion >= 12) {
2338
- var i = this.input.charCodeAt(this.pos + 2);
2339
- if (i === 61) return this.finishOp(a.assign, 3);
2340
- }
2341
- return this.finishOp(e === 124 ? a.logicalOR : a.logicalAND, 2);
2342
- }
2343
- return t === 61 ? this.finishOp(a.assign, 2) : this.finishOp(e === 124 ? a.bitwiseOR : a.bitwiseAND, 1);
2344
- };
2345
- b.readToken_caret = function() {
2346
- var e = this.input.charCodeAt(this.pos + 1);
2347
- return e === 61 ? this.finishOp(a.assign, 2) : this.finishOp(a.bitwiseXOR, 1);
2348
- };
2349
- b.readToken_plus_min = function(e) {
2350
- var t = this.input.charCodeAt(this.pos + 1);
2351
- return t === e ? t === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 || L.test(this.input.slice(this.lastTokEnd, this.pos))) ? (this.skipLineComment(3), this.skipSpace(), this.nextToken()) : this.finishOp(a.incDec, 2) : t === 61 ? this.finishOp(a.assign, 2) : this.finishOp(a.plusMin, 1);
2352
- };
2353
- b.readToken_lt_gt = function(e) {
2354
- var t = this.input.charCodeAt(this.pos + 1), i = 1;
2355
- return t === e ? (i = e === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2, this.input.charCodeAt(this.pos + i) === 61 ? this.finishOp(a.assign, i + 1) : this.finishOp(a.bitShift, i)) : t === 33 && e === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && this.input.charCodeAt(this.pos + 3) === 45 ? (this.skipLineComment(4), this.skipSpace(), this.nextToken()) : (t === 61 && (i = 2), this.finishOp(a.relational, i));
2356
- };
2357
- b.readToken_eq_excl = function(e) {
2358
- var t = this.input.charCodeAt(this.pos + 1);
2359
- return t === 61 ? this.finishOp(a.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) : e === 61 && t === 62 && this.options.ecmaVersion >= 6 ? (this.pos += 2, this.finishToken(a.arrow)) : this.finishOp(e === 61 ? a.eq : a.prefix, 1);
2360
- };
2361
- b.readToken_question = function() {
2362
- var e = this.options.ecmaVersion;
2363
- if (e >= 11) {
2364
- var t = this.input.charCodeAt(this.pos + 1);
2365
- if (t === 46) {
2366
- var i = this.input.charCodeAt(this.pos + 2);
2367
- if (i < 48 || i > 57) return this.finishOp(a.questionDot, 2);
2368
- }
2369
- if (t === 63) {
2370
- if (e >= 12) {
2371
- var s = this.input.charCodeAt(this.pos + 2);
2372
- if (s === 61) return this.finishOp(a.assign, 3);
2373
- }
2374
- return this.finishOp(a.coalesce, 2);
2375
- }
2376
- }
2377
- return this.finishOp(a.question, 1);
2378
- };
2379
- b.readToken_numberSign = function() {
2380
- var e = this.options.ecmaVersion, t = 35;
2381
- if (e >= 13 && (++this.pos, t = this.fullCharCodeAtPos(), j(t, true) || t === 92)) return this.finishToken(a.privateId, this.readWord1());
2382
- this.raise(this.pos, "Unexpected character '" + q(t) + "'");
2383
- };
2384
- b.getTokenFromCode = function(e) {
2385
- switch (e) {
2386
- case 46:
2387
- return this.readToken_dot();
2388
- case 40:
2389
- return ++this.pos, this.finishToken(a.parenL);
2390
- case 41:
2391
- return ++this.pos, this.finishToken(a.parenR);
2392
- case 59:
2393
- return ++this.pos, this.finishToken(a.semi);
2394
- case 44:
2395
- return ++this.pos, this.finishToken(a.comma);
2396
- case 91:
2397
- return ++this.pos, this.finishToken(a.bracketL);
2398
- case 93:
2399
- return ++this.pos, this.finishToken(a.bracketR);
2400
- case 123:
2401
- return ++this.pos, this.finishToken(a.braceL);
2402
- case 125:
2403
- return ++this.pos, this.finishToken(a.braceR);
2404
- case 58:
2405
- return ++this.pos, this.finishToken(a.colon);
2406
- case 96:
2407
- if (this.options.ecmaVersion < 6) break;
2408
- return ++this.pos, this.finishToken(a.backQuote);
2409
- case 48:
2410
- var t = this.input.charCodeAt(this.pos + 1);
2411
- if (t === 120 || t === 88) return this.readRadixNumber(16);
2412
- if (this.options.ecmaVersion >= 6) {
2413
- if (t === 111 || t === 79) return this.readRadixNumber(8);
2414
- if (t === 98 || t === 66) return this.readRadixNumber(2);
2415
- }
2416
- case 49:
2417
- case 50:
2418
- case 51:
2419
- case 52:
2420
- case 53:
2421
- case 54:
2422
- case 55:
2423
- case 56:
2424
- case 57:
2425
- return this.readNumber(false);
2426
- case 34:
2427
- case 39:
2428
- return this.readString(e);
2429
- case 47:
2430
- return this.readToken_slash();
2431
- case 37:
2432
- case 42:
2433
- return this.readToken_mult_modulo_exp(e);
2434
- case 124:
2435
- case 38:
2436
- return this.readToken_pipe_amp(e);
2437
- case 94:
2438
- return this.readToken_caret();
2439
- case 43:
2440
- case 45:
2441
- return this.readToken_plus_min(e);
2442
- case 60:
2443
- case 62:
2444
- return this.readToken_lt_gt(e);
2445
- case 61:
2446
- case 33:
2447
- return this.readToken_eq_excl(e);
2448
- case 63:
2449
- return this.readToken_question();
2450
- case 126:
2451
- return this.finishOp(a.prefix, 1);
2452
- case 35:
2453
- return this.readToken_numberSign();
2454
- }
2455
- this.raise(this.pos, "Unexpected character '" + q(e) + "'");
2456
- };
2457
- b.finishOp = function(e, t) {
2458
- var i = this.input.slice(this.pos, this.pos + t);
2459
- return this.pos += t, this.finishToken(e, i);
2460
- };
2461
- b.readRegexp = function() {
2462
- for (var e, t, i = this.pos; ; ) {
2463
- this.pos >= this.input.length && this.raise(i, "Unterminated regular expression");
2464
- var s = this.input.charAt(this.pos);
2465
- if (L.test(s) && this.raise(i, "Unterminated regular expression"), e) e = false;
2466
- else {
2467
- if (s === "[") t = true;
2468
- else if (s === "]" && t) t = false;
2469
- else if (s === "/" && !t) break;
2470
- e = s === "\\";
2471
- }
2472
- ++this.pos;
2473
- }
2474
- var r = this.input.slice(i, this.pos);
2475
- ++this.pos;
2476
- var o = this.pos, u = this.readWord1();
2477
- this.containsEsc && this.unexpected(o);
2478
- var p = this.regexpState || (this.regexpState = new G(this));
2479
- p.reset(i, r, u), this.validateRegExpFlags(p), this.validateRegExpPattern(p);
2480
- var h = null;
2481
- try {
2482
- h = new RegExp(r, u);
2483
- } catch {
2484
- }
2485
- return this.finishToken(a.regexp, { pattern: r, flags: u, value: h });
2486
- };
2487
- b.readInt = function(e, t, i) {
2488
- for (var s = this.options.ecmaVersion >= 12 && t === void 0, r = i && this.input.charCodeAt(this.pos) === 48, o = this.pos, u = 0, p = 0, h = 0, l = t ?? 1 / 0; h < l; ++h, ++this.pos) {
2489
- var m = this.input.charCodeAt(this.pos), S = void 0;
2490
- if (s && m === 95) {
2491
- r && this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals"), p === 95 && this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore"), h === 0 && this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits"), p = m;
2492
- continue;
2493
- }
2494
- if (m >= 97 ? S = m - 97 + 10 : m >= 65 ? S = m - 65 + 10 : m >= 48 && m <= 57 ? S = m - 48 : S = 1 / 0, S >= e) break;
2495
- p = m, u = u * e + S;
2496
- }
2497
- return s && p === 95 && this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"), this.pos === o || t != null && this.pos - o !== t ? null : u;
2498
- };
2499
- function vs(e, t) {
2500
- return t ? parseInt(e, 8) : parseFloat(e.replace(/_/g, ""));
2501
- }
2502
- function Xt(e) {
2503
- return typeof BigInt != "function" ? null : BigInt(e.replace(/_/g, ""));
2504
- }
2505
- b.readRadixNumber = function(e) {
2506
- var t = this.pos;
2507
- this.pos += 2;
2508
- var i = this.readInt(e);
2509
- return i == null && this.raise(this.start + 2, "Expected number in radix " + e), this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110 ? (i = Xt(this.input.slice(t, this.pos)), ++this.pos) : j(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(a.num, i);
2510
- };
2511
- b.readNumber = function(e) {
2512
- var t = this.pos;
2513
- !e && this.readInt(10, void 0, true) === null && this.raise(t, "Invalid number");
2514
- var i = this.pos - t >= 2 && this.input.charCodeAt(t) === 48;
2515
- i && this.strict && this.raise(t, "Invalid number");
2516
- var s = this.input.charCodeAt(this.pos);
2517
- if (!i && !e && this.options.ecmaVersion >= 11 && s === 110) {
2518
- var r = Xt(this.input.slice(t, this.pos));
2519
- return ++this.pos, j(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(a.num, r);
2520
- }
2521
- i && /[89]/.test(this.input.slice(t, this.pos)) && (i = false), s === 46 && !i && (++this.pos, this.readInt(10), s = this.input.charCodeAt(this.pos)), (s === 69 || s === 101) && !i && (s = this.input.charCodeAt(++this.pos), (s === 43 || s === 45) && ++this.pos, this.readInt(10) === null && this.raise(t, "Invalid number")), j(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number");
2522
- var o = vs(this.input.slice(t, this.pos), i);
2523
- return this.finishToken(a.num, o);
2524
- };
2525
- b.readCodePoint = function() {
2526
- var e = this.input.charCodeAt(this.pos), t;
2527
- if (e === 123) {
2528
- this.options.ecmaVersion < 6 && this.unexpected();
2529
- var i = ++this.pos;
2530
- t = this.readHexChar(this.input.indexOf("}", this.pos) - this.pos), ++this.pos, t > 1114111 && this.invalidStringToken(i, "Code point out of bounds");
2531
- } else t = this.readHexChar(4);
2532
- return t;
2533
- };
2534
- b.readString = function(e) {
2535
- for (var t = "", i = ++this.pos; ; ) {
2536
- this.pos >= this.input.length && this.raise(this.start, "Unterminated string constant");
2537
- var s = this.input.charCodeAt(this.pos);
2538
- if (s === e) break;
2539
- s === 92 ? (t += this.input.slice(i, this.pos), t += this.readEscapedChar(false), i = this.pos) : s === 8232 || s === 8233 ? (this.options.ecmaVersion < 10 && this.raise(this.start, "Unterminated string constant"), ++this.pos, this.options.locations && (this.curLine++, this.lineStart = this.pos)) : (Y(s) && this.raise(this.start, "Unterminated string constant"), ++this.pos);
2540
- }
2541
- return t += this.input.slice(i, this.pos++), this.finishToken(a.string, t);
2542
- };
2543
- var Wt = {};
2544
- b.tryReadTemplateToken = function() {
2545
- this.inTemplateElement = true;
2546
- try {
2547
- this.readTmplToken();
2548
- } catch (e) {
2549
- if (e === Wt) this.readInvalidTemplateToken();
2550
- else throw e;
2551
- }
2552
- this.inTemplateElement = false;
2553
- };
2554
- b.invalidStringToken = function(e, t) {
2555
- if (this.inTemplateElement && this.options.ecmaVersion >= 9) throw Wt;
2556
- this.raise(e, t);
2557
- };
2558
- b.readTmplToken = function() {
2559
- for (var e = "", t = this.pos; ; ) {
2560
- this.pos >= this.input.length && this.raise(this.start, "Unterminated template");
2561
- var i = this.input.charCodeAt(this.pos);
2562
- if (i === 96 || i === 36 && this.input.charCodeAt(this.pos + 1) === 123) return this.pos === this.start && (this.type === a.template || this.type === a.invalidTemplate) ? i === 36 ? (this.pos += 2, this.finishToken(a.dollarBraceL)) : (++this.pos, this.finishToken(a.backQuote)) : (e += this.input.slice(t, this.pos), this.finishToken(a.template, e));
2563
- if (i === 92) e += this.input.slice(t, this.pos), e += this.readEscapedChar(true), t = this.pos;
2564
- else if (Y(i)) {
2565
- switch (e += this.input.slice(t, this.pos), ++this.pos, i) {
2566
- case 13:
2567
- this.input.charCodeAt(this.pos) === 10 && ++this.pos;
2568
- case 10:
2569
- e += `
2570
- `;
2571
- break;
2572
- default:
2573
- e += String.fromCharCode(i);
2574
- break;
2575
- }
2576
- this.options.locations && (++this.curLine, this.lineStart = this.pos), t = this.pos;
2577
- } else ++this.pos;
2578
- }
2579
- };
2580
- b.readInvalidTemplateToken = function() {
2581
- for (; this.pos < this.input.length; this.pos++) switch (this.input[this.pos]) {
2582
- case "\\":
2583
- ++this.pos;
2584
- break;
2585
- case "$":
2586
- if (this.input[this.pos + 1] !== "{") break;
2587
- case "`":
2588
- return this.finishToken(a.invalidTemplate, this.input.slice(this.start, this.pos));
2589
- case "\r":
2590
- this.input[this.pos + 1] === `
2591
- ` && ++this.pos;
2592
- case `
2593
- `:
2594
- case "\u2028":
2595
- case "\u2029":
2596
- ++this.curLine, this.lineStart = this.pos + 1;
2597
- break;
2598
- }
2599
- this.raise(this.start, "Unterminated template");
2600
- };
2601
- b.readEscapedChar = function(e) {
2602
- var t = this.input.charCodeAt(++this.pos);
2603
- switch (++this.pos, t) {
2604
- case 110:
2605
- return `
2606
- `;
2607
- case 114:
2608
- return "\r";
2609
- case 120:
2610
- return String.fromCharCode(this.readHexChar(2));
2611
- case 117:
2612
- return q(this.readCodePoint());
2613
- case 116:
2614
- return " ";
2615
- case 98:
2616
- return "\b";
2617
- case 118:
2618
- return "\v";
2619
- case 102:
2620
- return "\f";
2621
- case 13:
2622
- this.input.charCodeAt(this.pos) === 10 && ++this.pos;
2623
- case 10:
2624
- return this.options.locations && (this.lineStart = this.pos, ++this.curLine), "";
2625
- case 56:
2626
- case 57:
2627
- if (this.strict && this.invalidStringToken(this.pos - 1, "Invalid escape sequence"), e) {
2628
- var i = this.pos - 1;
2629
- this.invalidStringToken(i, "Invalid escape sequence in template string");
2630
- }
2631
- default:
2632
- if (t >= 48 && t <= 55) {
2633
- var s = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0], r = parseInt(s, 8);
2634
- return r > 255 && (s = s.slice(0, -1), r = parseInt(s, 8)), this.pos += s.length - 1, t = this.input.charCodeAt(this.pos), (s !== "0" || t === 56 || t === 57) && (this.strict || e) && this.invalidStringToken(this.pos - 1 - s.length, e ? "Octal literal in template string" : "Octal literal in strict mode"), String.fromCharCode(r);
2635
- }
2636
- return Y(t) ? (this.options.locations && (this.lineStart = this.pos, ++this.curLine), "") : String.fromCharCode(t);
2637
- }
2638
- };
2639
- b.readHexChar = function(e) {
2640
- var t = this.pos, i = this.readInt(16, e);
2641
- return i === null && this.invalidStringToken(t, "Bad character escape sequence"), i;
2642
- };
2643
- b.readWord1 = function() {
2644
- this.containsEsc = false;
2645
- for (var e = "", t = true, i = this.pos, s = this.options.ecmaVersion >= 6; this.pos < this.input.length; ) {
2646
- var r = this.fullCharCodeAtPos();
2647
- if (X(r, s)) this.pos += r <= 65535 ? 1 : 2;
2648
- else if (r === 92) {
2649
- this.containsEsc = true, e += this.input.slice(i, this.pos);
2650
- var o = this.pos;
2651
- this.input.charCodeAt(++this.pos) !== 117 && this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"), ++this.pos;
2652
- var u = this.readCodePoint();
2653
- (t ? j : X)(u, s) || this.invalidStringToken(o, "Invalid Unicode escape"), e += q(u), i = this.pos;
2654
- } else break;
2655
- t = false;
2656
- }
2657
- return e + this.input.slice(i, this.pos);
2658
- };
2659
- b.readWord = function() {
2660
- var e = this.readWord1(), t = a.name;
2661
- return this.keywords.test(e) && (t = Je[e]), this.finishToken(t, e);
2662
- };
2663
- var bs = "8.15.0";
2664
- A.acorn = { Parser: A, version: bs, defaultOptions: Ue, Position: ne, SourceLocation: be, getLineInfo: vt, Node: Te, TokenType: C, tokTypes: a, keywordTypes: Je, TokContext: F, tokContexts: T, isIdentifierChar: X, isIdentifierStart: j, Token: Qe, isNewLine: Y, lineBreak: L, lineBreakG: qi, nonASCIIwhitespace: yt };
2665
- var Si = ut($e(), 1);
2666
- function As(e, t) {
2667
- let i = new SyntaxError(e + " (" + t.loc.start.line + ":" + t.loc.start.column + ")");
2668
- return Object.assign(i, t);
2669
- }
2670
- var Ae = As;
2671
- function ke(e) {
2672
- let t = [];
2673
- for (let i of e) try {
2674
- return i();
2675
- } catch (s) {
2676
- t.push(s);
2677
- }
2678
- throw Object.assign(new Error("All combinations failed"), { errors: t });
2679
- }
2680
- var te = (e, t) => (i, s, ...r) => i | 1 && s == null ? void 0 : (t.call(s) ?? s[e]).apply(s, r);
2681
- var ks = Array.prototype.findLast ?? function(e) {
2682
- for (let t = this.length - 1; t >= 0; t--) {
2683
- let i = this[t];
2684
- if (e(i, t, this)) return i;
2685
- }
2686
- };
2687
- var ws = te("findLast", function() {
2688
- if (Array.isArray(this)) return ks;
2689
- });
2690
- var Zt = ws;
2691
- function Ps(e) {
2692
- return this[e < 0 ? this.length + e : e];
2693
- }
2694
- var Is = te("at", function() {
2695
- if (Array.isArray(this) || typeof this == "string") return Ps;
2696
- });
2697
- var ie = Is;
2698
- function M(e) {
2699
- let t = e.range?.[0] ?? e.start, i = (e.declaration?.decorators ?? e.decorators)?.[0];
2700
- return i ? Math.min(M(i), t) : t;
2701
- }
2702
- function R(e) {
2703
- return e.range?.[1] ?? e.end;
2704
- }
2705
- function Ns(e) {
2706
- let t = new Set(e);
2707
- return (i) => t.has(i?.type);
2708
- }
2709
- var se = Ns;
2710
- var Ls = se(["Block", "CommentBlock", "MultiLine"]);
2711
- var re = Ls;
2712
- var Rs = se(["Line", "CommentLine", "SingleLine", "HashbangComment", "HTMLOpen", "HTMLClose", "Hashbang", "InterpreterDirective"]);
2713
- var ei = Rs;
2714
- var Ze = /* @__PURE__ */ new WeakMap();
2715
- function Vs(e) {
2716
- return Ze.has(e) || Ze.set(e, re(e) && e.value[0] === "*" && /@(?:type|satisfies)\b/u.test(e.value)), Ze.get(e);
2717
- }
2718
- var ti = Vs;
2719
- function Os(e) {
2720
- if (!re(e)) return false;
2721
- let t = `*${e.value}*`.split(`
2722
- `);
2723
- return t.length > 1 && t.every((i) => i.trimStart()[0] === "*");
2724
- }
2725
- var et = /* @__PURE__ */ new WeakMap();
2726
- function Bs(e) {
2727
- return et.has(e) || et.set(e, Os(e)), et.get(e);
2728
- }
2729
- var tt = Bs;
2730
- function Ds(e) {
2731
- if (e.length < 2) return;
2732
- let t;
2733
- for (let i = e.length - 1; i >= 0; i--) {
2734
- let s = e[i];
2735
- if (t && R(s) === M(t) && tt(s) && tt(t) && (e.splice(i + 1, 1), s.value += "*//*" + t.value, s.range = [M(s), R(t)]), !ei(s) && !re(s)) throw new TypeError(`Unknown comment type: "${s.type}".`);
2736
- t = s;
2737
- }
2738
- }
2739
- var ii = Ds;
2740
- function Ms(e) {
2741
- return e !== null && typeof e == "object";
2742
- }
2743
- var si = Ms;
2744
- var ce = null;
2745
- function le(e) {
2746
- if (ce !== null && typeof ce.property) {
2747
- let t = ce;
2748
- return ce = le.prototype = null, t;
2749
- }
2750
- return ce = le.prototype = e ?? /* @__PURE__ */ Object.create(null), new le();
2751
- }
2752
- var Fs = 10;
2753
- for (let e = 0; e <= Fs; e++) le();
2754
- function it(e) {
2755
- return le(e);
2756
- }
2757
- function js(e, t = "type") {
2758
- it(e);
2759
- function i(s) {
2760
- let r = s[t], o = e[r];
2761
- if (!Array.isArray(o)) throw Object.assign(new Error(`Missing visitor keys for '${r}'.`), { node: s });
2762
- return o;
2763
- }
2764
- return i;
2765
- }
2766
- var ri = js;
2767
- var n = [["decorators", "key", "typeAnnotation", "value"], [], ["elementType"], ["expression"], ["expression", "typeAnnotation"], ["left", "right"], ["argument"], ["directives", "body"], ["label"], ["callee", "typeArguments", "arguments"], ["body"], ["decorators", "id", "typeParameters", "superClass", "superTypeArguments", "mixins", "implements", "body", "superTypeParameters"], ["id", "typeParameters"], ["decorators", "key", "typeParameters", "params", "returnType", "body"], ["decorators", "variance", "key", "typeAnnotation", "value"], ["name", "typeAnnotation"], ["test", "consequent", "alternate"], ["checkType", "extendsType", "trueType", "falseType"], ["value"], ["id", "body"], ["declaration", "specifiers", "source", "attributes"], ["id"], ["id", "typeParameters", "extends", "body"], ["typeAnnotation"], ["id", "typeParameters", "right"], ["body", "test"], ["members"], ["id", "init"], ["exported"], ["left", "right", "body"], ["id", "typeParameters", "params", "predicate", "returnType", "body"], ["id", "params", "body", "typeParameters", "returnType"], ["key", "value"], ["local"], ["objectType", "indexType"], ["typeParameter"], ["types"], ["node"], ["object", "property"], ["argument", "cases"], ["pattern", "body", "guard"], ["literal"], ["decorators", "key", "value"], ["expressions"], ["qualification", "id"], ["decorators", "key", "typeAnnotation"], ["typeParameters", "params", "returnType"], ["expression", "typeArguments"], ["params"], ["parameterName", "typeAnnotation"]];
2768
- var ai = { AccessorProperty: n[0], AnyTypeAnnotation: n[1], ArgumentPlaceholder: n[1], ArrayExpression: ["elements"], ArrayPattern: ["elements", "typeAnnotation", "decorators"], ArrayTypeAnnotation: n[2], ArrowFunctionExpression: ["typeParameters", "params", "predicate", "returnType", "body"], AsConstExpression: n[3], AsExpression: n[4], AssignmentExpression: n[5], AssignmentPattern: ["left", "right", "decorators", "typeAnnotation"], AwaitExpression: n[6], BigIntLiteral: n[1], BigIntLiteralTypeAnnotation: n[1], BigIntTypeAnnotation: n[1], BinaryExpression: n[5], BindExpression: ["object", "callee"], BlockStatement: n[7], BooleanLiteral: n[1], BooleanLiteralTypeAnnotation: n[1], BooleanTypeAnnotation: n[1], BreakStatement: n[8], CallExpression: n[9], CatchClause: ["param", "body"], ChainExpression: n[3], ClassAccessorProperty: n[0], ClassBody: n[10], ClassDeclaration: n[11], ClassExpression: n[11], ClassImplements: n[12], ClassMethod: n[13], ClassPrivateMethod: n[13], ClassPrivateProperty: n[14], ClassProperty: n[14], ComponentDeclaration: ["id", "params", "body", "typeParameters", "rendersType"], ComponentParameter: ["name", "local"], ComponentTypeAnnotation: ["params", "rest", "typeParameters", "rendersType"], ComponentTypeParameter: n[15], ConditionalExpression: n[16], ConditionalTypeAnnotation: n[17], ContinueStatement: n[8], DebuggerStatement: n[1], DeclareClass: ["id", "typeParameters", "extends", "mixins", "implements", "body"], DeclareComponent: ["id", "params", "rest", "typeParameters", "rendersType"], DeclaredPredicate: n[18], DeclareEnum: n[19], DeclareExportAllDeclaration: ["source", "attributes"], DeclareExportDeclaration: n[20], DeclareFunction: ["id", "predicate"], DeclareHook: n[21], DeclareInterface: n[22], DeclareModule: n[19], DeclareModuleExports: n[23], DeclareNamespace: n[19], DeclareOpaqueType: ["id", "typeParameters", "supertype", "lowerBound", "upperBound"], DeclareTypeAlias: n[24], DeclareVariable: n[21], Decorator: n[3], Directive: n[18], DirectiveLiteral: n[1], DoExpression: n[10], DoWhileStatement: n[25], EmptyStatement: n[1], EmptyTypeAnnotation: n[1], EnumBigIntBody: n[26], EnumBigIntMember: n[27], EnumBooleanBody: n[26], EnumBooleanMember: n[27], EnumDeclaration: n[19], EnumDefaultedMember: n[21], EnumNumberBody: n[26], EnumNumberMember: n[27], EnumStringBody: n[26], EnumStringMember: n[27], EnumSymbolBody: n[26], ExistsTypeAnnotation: n[1], ExperimentalRestProperty: n[6], ExperimentalSpreadProperty: n[6], ExportAllDeclaration: ["source", "attributes", "exported"], ExportDefaultDeclaration: ["declaration"], ExportDefaultSpecifier: n[28], ExportNamedDeclaration: n[20], ExportNamespaceSpecifier: n[28], ExportSpecifier: ["local", "exported"], ExpressionStatement: n[3], File: ["program"], ForInStatement: n[29], ForOfStatement: n[29], ForStatement: ["init", "test", "update", "body"], FunctionDeclaration: n[30], FunctionExpression: n[30], FunctionTypeAnnotation: ["typeParameters", "this", "params", "rest", "returnType"], FunctionTypeParam: n[15], GenericTypeAnnotation: n[12], HookDeclaration: n[31], HookTypeAnnotation: ["params", "returnType", "rest", "typeParameters"], Identifier: ["typeAnnotation", "decorators"], IfStatement: n[16], ImportAttribute: n[32], ImportDeclaration: ["specifiers", "source", "attributes"], ImportDefaultSpecifier: n[33], ImportExpression: ["source", "options"], ImportNamespaceSpecifier: n[33], ImportSpecifier: ["imported", "local"], IndexedAccessType: n[34], InferredPredicate: n[1], InferTypeAnnotation: n[35], InterfaceDeclaration: n[22], InterfaceExtends: n[12], InterfaceTypeAnnotation: ["extends", "body"], InterpreterDirective: n[1], IntersectionTypeAnnotation: n[36], JsExpressionRoot: n[37], JsonRoot: n[37], JSXAttribute: ["name", "value"], JSXClosingElement: ["name"], JSXClosingFragment: n[1], JSXElement: ["openingElement", "children", "closingElement"], JSXEmptyExpression: n[1], JSXExpressionContainer: n[3], JSXFragment: ["openingFragment", "children", "closingFragment"], JSXIdentifier: n[1], JSXMemberExpression: n[38], JSXNamespacedName: ["namespace", "name"], JSXOpeningElement: ["name", "typeArguments", "attributes"], JSXOpeningFragment: n[1], JSXSpreadAttribute: n[6], JSXSpreadChild: n[3], JSXText: n[1], KeyofTypeAnnotation: n[6], LabeledStatement: ["label", "body"], Literal: n[1], LogicalExpression: n[5], MatchArrayPattern: ["elements", "rest"], MatchAsPattern: ["pattern", "target"], MatchBindingPattern: n[21], MatchExpression: n[39], MatchExpressionCase: n[40], MatchIdentifierPattern: n[21], MatchLiteralPattern: n[41], MatchMemberPattern: ["base", "property"], MatchObjectPattern: ["properties", "rest"], MatchObjectPatternProperty: ["key", "pattern"], MatchOrPattern: ["patterns"], MatchRestPattern: n[6], MatchStatement: n[39], MatchStatementCase: n[40], MatchUnaryPattern: n[6], MatchWildcardPattern: n[1], MemberExpression: n[38], MetaProperty: ["meta", "property"], MethodDefinition: n[42], MixedTypeAnnotation: n[1], ModuleExpression: n[10], NeverTypeAnnotation: n[1], NewExpression: n[9], NGChainedExpression: n[43], NGEmptyExpression: n[1], NGMicrosyntax: n[10], NGMicrosyntaxAs: ["key", "alias"], NGMicrosyntaxExpression: ["expression", "alias"], NGMicrosyntaxKey: n[1], NGMicrosyntaxKeyedExpression: ["key", "expression"], NGMicrosyntaxLet: n[32], NGPipeExpression: ["left", "right", "arguments"], NGRoot: n[37], NullableTypeAnnotation: n[23], NullLiteral: n[1], NullLiteralTypeAnnotation: n[1], NumberLiteralTypeAnnotation: n[1], NumberTypeAnnotation: n[1], NumericLiteral: n[1], ObjectExpression: ["properties"], ObjectMethod: n[13], ObjectPattern: ["decorators", "properties", "typeAnnotation"], ObjectProperty: n[42], ObjectTypeAnnotation: ["properties", "indexers", "callProperties", "internalSlots"], ObjectTypeCallProperty: n[18], ObjectTypeIndexer: ["variance", "id", "key", "value"], ObjectTypeInternalSlot: ["id", "value"], ObjectTypeMappedTypeProperty: ["keyTparam", "propType", "sourceType", "variance"], ObjectTypeProperty: ["key", "value", "variance"], ObjectTypeSpreadProperty: n[6], OpaqueType: ["id", "typeParameters", "supertype", "impltype", "lowerBound", "upperBound"], OptionalCallExpression: n[9], OptionalIndexedAccessType: n[34], OptionalMemberExpression: n[38], ParenthesizedExpression: n[3], PipelineBareFunction: ["callee"], PipelinePrimaryTopicReference: n[1], PipelineTopicExpression: n[3], Placeholder: n[1], PrivateIdentifier: n[1], PrivateName: n[21], Program: n[7], Property: n[32], PropertyDefinition: n[14], QualifiedTypeIdentifier: n[44], QualifiedTypeofIdentifier: n[44], RegExpLiteral: n[1], RestElement: ["argument", "typeAnnotation", "decorators"], ReturnStatement: n[6], SatisfiesExpression: n[4], SequenceExpression: n[43], SpreadElement: n[6], StaticBlock: n[10], StringLiteral: n[1], StringLiteralTypeAnnotation: n[1], StringTypeAnnotation: n[1], Super: n[1], SwitchCase: ["test", "consequent"], SwitchStatement: ["discriminant", "cases"], SymbolTypeAnnotation: n[1], TaggedTemplateExpression: ["tag", "typeArguments", "quasi"], TemplateElement: n[1], TemplateLiteral: ["quasis", "expressions"], ThisExpression: n[1], ThisTypeAnnotation: n[1], ThrowStatement: n[6], TopicReference: n[1], TryStatement: ["block", "handler", "finalizer"], TSAbstractAccessorProperty: n[45], TSAbstractKeyword: n[1], TSAbstractMethodDefinition: n[32], TSAbstractPropertyDefinition: n[45], TSAnyKeyword: n[1], TSArrayType: n[2], TSAsExpression: n[4], TSAsyncKeyword: n[1], TSBigIntKeyword: n[1], TSBooleanKeyword: n[1], TSCallSignatureDeclaration: n[46], TSClassImplements: n[47], TSConditionalType: n[17], TSConstructorType: n[46], TSConstructSignatureDeclaration: n[46], TSDeclareFunction: n[31], TSDeclareKeyword: n[1], TSDeclareMethod: ["decorators", "key", "typeParameters", "params", "returnType"], TSEmptyBodyFunctionExpression: ["id", "typeParameters", "params", "returnType"], TSEnumBody: n[26], TSEnumDeclaration: n[19], TSEnumMember: ["id", "initializer"], TSExportAssignment: n[3], TSExportKeyword: n[1], TSExternalModuleReference: n[3], TSFunctionType: n[46], TSImportEqualsDeclaration: ["id", "moduleReference"], TSImportType: ["options", "qualifier", "typeArguments", "source"], TSIndexedAccessType: n[34], TSIndexSignature: ["parameters", "typeAnnotation"], TSInferType: n[35], TSInstantiationExpression: n[47], TSInterfaceBody: n[10], TSInterfaceDeclaration: n[22], TSInterfaceHeritage: n[47], TSIntersectionType: n[36], TSIntrinsicKeyword: n[1], TSJSDocAllType: n[1], TSJSDocNonNullableType: n[23], TSJSDocNullableType: n[23], TSJSDocUnknownType: n[1], TSLiteralType: n[41], TSMappedType: ["key", "constraint", "nameType", "typeAnnotation"], TSMethodSignature: ["key", "typeParameters", "params", "returnType"], TSModuleBlock: n[10], TSModuleDeclaration: n[19], TSNamedTupleMember: ["label", "elementType"], TSNamespaceExportDeclaration: n[21], TSNeverKeyword: n[1], TSNonNullExpression: n[3], TSNullKeyword: n[1], TSNumberKeyword: n[1], TSObjectKeyword: n[1], TSOptionalType: n[23], TSParameterProperty: ["parameter", "decorators"], TSParenthesizedType: n[23], TSPrivateKeyword: n[1], TSPropertySignature: ["key", "typeAnnotation"], TSProtectedKeyword: n[1], TSPublicKeyword: n[1], TSQualifiedName: n[5], TSReadonlyKeyword: n[1], TSRestType: n[23], TSSatisfiesExpression: n[4], TSStaticKeyword: n[1], TSStringKeyword: n[1], TSSymbolKeyword: n[1], TSTemplateLiteralType: ["quasis", "types"], TSThisType: n[1], TSTupleType: ["elementTypes"], TSTypeAliasDeclaration: ["id", "typeParameters", "typeAnnotation"], TSTypeAnnotation: n[23], TSTypeAssertion: n[4], TSTypeLiteral: n[26], TSTypeOperator: n[23], TSTypeParameter: ["name", "constraint", "default"], TSTypeParameterDeclaration: n[48], TSTypeParameterInstantiation: n[48], TSTypePredicate: n[49], TSTypeQuery: ["exprName", "typeArguments"], TSTypeReference: ["typeName", "typeArguments"], TSUndefinedKeyword: n[1], TSUnionType: n[36], TSUnknownKeyword: n[1], TSVoidKeyword: n[1], TupleTypeAnnotation: ["types", "elementTypes"], TupleTypeLabeledElement: ["label", "elementType", "variance"], TupleTypeSpreadElement: ["label", "typeAnnotation"], TypeAlias: n[24], TypeAnnotation: n[23], TypeCastExpression: n[4], TypeofTypeAnnotation: ["argument", "typeArguments"], TypeOperator: n[23], TypeParameter: ["bound", "default", "variance"], TypeParameterDeclaration: n[48], TypeParameterInstantiation: n[48], TypePredicate: n[49], UnaryExpression: n[6], UndefinedTypeAnnotation: n[1], UnionTypeAnnotation: n[36], UnknownTypeAnnotation: n[1], UpdateExpression: n[6], V8IntrinsicIdentifier: n[1], VariableDeclaration: ["declarations"], VariableDeclarator: n[27], Variance: n[1], VoidPattern: n[1], VoidTypeAnnotation: n[1], WhileStatement: n[25], WithStatement: ["object", "body"], YieldExpression: n[6] };
2769
- var Us = ri(ai);
2770
- var ni = Us;
2771
- function we(e, t) {
2772
- if (!si(e)) return e;
2773
- if (Array.isArray(e)) {
2774
- for (let s = 0; s < e.length; s++) e[s] = we(e[s], t);
2775
- return e;
2776
- }
2777
- if (t.onEnter) {
2778
- let s = t.onEnter(e) ?? e;
2779
- if (s !== e) return we(s, t);
2780
- e = s;
2781
- }
2782
- let i = ni(e);
2783
- for (let s = 0; s < i.length; s++) e[i[s]] = we(e[i[s]], t);
2784
- return t.onLeave && (e = t.onLeave(e) || e), e;
2785
- }
2786
- var oi = we;
2787
- var aa = se(["RegExpLiteral", "BigIntLiteral", "NumericLiteral", "StringLiteral", "DirectiveLiteral", "Literal", "JSXText", "TemplateElement", "StringLiteralTypeAnnotation", "NumberLiteralTypeAnnotation", "BigIntLiteralTypeAnnotation"]);
2788
- function Gs(e, t) {
2789
- let { parser: i, text: s } = t, { comments: r } = e, o = i === "oxc" && t.oxcAstType === "ts";
2790
- ii(r);
2791
- let u = e.type === "File" ? e.program : e;
2792
- u.interpreter && (r.unshift(u.interpreter), delete u.interpreter), o && e.hashbang && (r.unshift(e.hashbang), delete e.hashbang), e.type === "Program" && (e.range = [0, s.length]);
2793
- let p;
2794
- return e = oi(e, { onEnter(h) {
2795
- switch (h.type) {
2796
- case "ParenthesizedExpression": {
2797
- let { expression: l } = h, m = M(h);
2798
- if (l.type === "TypeCastExpression") return l.range = [m, R(h)], l;
2799
- let S = false;
2800
- if (!o) {
2801
- if (!p) {
2802
- p = [];
2803
- for (let c of r) ti(c) && p.push(R(c));
2804
- }
2805
- let E = Zt(0, p, (c) => c <= m);
2806
- S = E && s.slice(E, m).trim().length === 0;
2807
- }
2808
- return S ? void 0 : (l.extra = { ...l.extra, parenthesized: true }, l);
2809
- }
2810
- case "TemplateLiteral":
2811
- if (h.expressions.length !== h.quasis.length - 1) throw new Error("Malformed template literal.");
2812
- break;
2813
- case "TemplateElement":
2814
- if (i === "flow" || i === "hermes" || i === "espree" || i === "typescript" || o) {
2815
- let l = M(h) + 1, m = R(h) - (h.tail ? 1 : 2);
2816
- h.range = [l, m];
2817
- }
2818
- break;
2819
- case "VariableDeclaration": {
2820
- let l = ie(0, h.declarations, -1);
2821
- l?.init && s[R(l)] !== ";" && (h.range = [M(h), R(l)]);
2822
- break;
2823
- }
2824
- case "TSParenthesizedType":
2825
- return h.typeAnnotation;
2826
- case "TopicReference":
2827
- e.extra = { ...e.extra, __isUsingHackPipeline: true };
2828
- break;
2829
- case "TSUnionType":
2830
- case "TSIntersectionType":
2831
- if (h.types.length === 1) return h.types[0];
2832
- break;
2833
- case "ImportExpression":
2834
- i === "hermes" && h.attributes && !h.options && (h.options = h.attributes);
2835
- break;
2836
- }
2837
- }, onLeave(h) {
2838
- switch (h.type) {
2839
- case "LogicalExpression":
2840
- if (ui(h)) return st(h);
2841
- break;
2842
- case "TSImportType":
2843
- !h.source && h.argument.type === "TSLiteralType" && (h.source = h.argument.literal, delete h.argument);
2844
- break;
2845
- }
2846
- } }), e;
2847
- }
2848
- function ui(e) {
2849
- return e.type === "LogicalExpression" && e.right.type === "LogicalExpression" && e.operator === e.right.operator;
2850
- }
2851
- function st(e) {
2852
- return ui(e) ? st({ type: "LogicalExpression", operator: e.operator, left: st({ type: "LogicalExpression", operator: e.operator, left: e.left, right: e.right.left, range: [M(e.left), R(e.right.left)] }), right: e.right.right, range: [M(e), R(e)] }) : e;
2853
- }
2854
- var Pe = Gs;
2855
- var qs = String.prototype.replaceAll ?? function(e, t) {
2856
- return e.global ? this.replace(e, t) : this.split(e).join(t);
2857
- };
2858
- var Js = te("replaceAll", function() {
2859
- if (typeof this == "string") return qs;
2860
- });
2861
- var fe = Js;
2862
- var Ks = /\*\/$/;
2863
- var Hs = /^\/\*\*?/;
2864
- var Xs = /^\s*(\/\*\*?(.|\r?\n)*?\*\/)/;
2865
- var Ws = /(^|\s+)\/\/([^\n\r]*)/g;
2866
- var hi = /^(\r?\n)+/;
2867
- var zs = /(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g;
2868
- var pi = /(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g;
2869
- var Qs = /(\r?\n|^) *\* ?/g;
2870
- var Ys = [];
2871
- function ci(e) {
2872
- let t = e.match(Xs);
2873
- return t ? t[0].trimStart() : "";
2874
- }
2875
- function li(e) {
2876
- e = fe(0, e.replace(Hs, "").replace(Ks, ""), Qs, "$1");
2877
- let i = "";
2878
- for (; i !== e; ) i = e, e = fe(0, e, zs, `
2879
- $1 $2
2880
- `);
2881
- e = e.replace(hi, "").trimEnd();
2882
- let s = /* @__PURE__ */ Object.create(null), r = fe(0, e, pi, "").replace(hi, "").trimEnd(), o;
2883
- for (; o = pi.exec(e); ) {
2884
- let u = fe(0, o[2], Ws, "");
2885
- if (typeof s[o[1]] == "string" || Array.isArray(s[o[1]])) {
2886
- let p = s[o[1]];
2887
- s[o[1]] = [...Ys, ...Array.isArray(p) ? p : [p], u];
2888
- } else s[o[1]] = u;
2889
- }
2890
- return { comments: r, pragmas: s };
2891
- }
2892
- var fi = ["noformat", "noprettier"];
2893
- var di = ["format", "prettier"];
2894
- function $s(e) {
2895
- if (!e.startsWith("#!")) return "";
2896
- let t = e.indexOf(`
2897
- `);
2898
- return t === -1 ? e : e.slice(0, t);
2899
- }
2900
- var mi = $s;
2901
- function xi(e) {
2902
- let t = mi(e);
2903
- t && (e = e.slice(t.length + 1));
2904
- let i = ci(e), { pragmas: s, comments: r } = li(i);
2905
- return { shebang: t, text: e, pragmas: s, comments: r };
2906
- }
2907
- function yi(e) {
2908
- let { pragmas: t } = xi(e);
2909
- return di.some((i) => Object.prototype.hasOwnProperty.call(t, i));
2910
- }
2911
- function gi(e) {
2912
- let { pragmas: t } = xi(e);
2913
- return fi.some((i) => Object.prototype.hasOwnProperty.call(t, i));
2914
- }
2915
- function Zs(e) {
2916
- return e = typeof e == "function" ? { parse: e } : e, { astFormat: "estree", hasPragma: yi, hasIgnorePragma: gi, locStart: M, locEnd: R, ...e };
2917
- }
2918
- var Ie = Zs;
2919
- var Ne = "module";
2920
- var vi = "script";
2921
- var Le = "commonjs";
2922
- var Re = [Ne, Le];
2923
- function Ve(e) {
2924
- if (typeof e == "string") {
2925
- if (e = e.toLowerCase(), /\.(?:mjs|mts)$/iu.test(e)) return Ne;
2926
- if (/\.(?:cjs|cts)$/iu.test(e)) return Le;
2927
- }
2928
- }
2929
- var er = { ecmaVersion: "latest", allowReserved: true, allowReturnOutsideFunction: true, allowSuperOutsideMethod: true, checkPrivateFields: false, locations: false, ranges: true, preserveParens: true };
2930
- function tr(e) {
2931
- let { message: t, loc: i } = e;
2932
- if (!i) return e;
2933
- let { line: s, column: r } = i;
2934
- return Ae(t.replace(/ \(\d+:\d+\)$/u, ""), { loc: { start: { line: s, column: r + 1 } }, cause: e });
2935
- }
2936
- var bi;
2937
- var ir = () => (bi ?? (bi = A.extend((0, Si.default)())), bi);
2938
- function sr(e, t) {
2939
- let i = ir(), s = [], r = i.parse(e, { ...er, sourceType: t === Le ? vi : t, allowImportExportEverywhere: t === Ne, onComment: s });
2940
- return r.comments = s, r;
2941
- }
2942
- function rr(e, t) {
2943
- let i = Ve(t?.filepath), s = (i ? [i] : Re).map((o) => () => sr(e, o)), r;
2944
- try {
2945
- r = ke(s);
2946
- } catch ({ errors: [o] }) {
2947
- throw tr(o);
2948
- }
2949
- return Pe(r, { text: e });
2950
- }
2951
- var _i = Ie(rr);
2952
- var Ai = ut($e(), 1);
2953
- var P = { Boolean: "Boolean", EOF: "<end>", Identifier: "Identifier", PrivateIdentifier: "PrivateIdentifier", Keyword: "Keyword", Null: "Null", Numeric: "Numeric", Punctuator: "Punctuator", String: "String", RegularExpression: "RegularExpression", Template: "Template", JSXIdentifier: "JSXIdentifier", JSXText: "JSXText" };
2954
- function ar(e, t) {
2955
- let i = e[0], s = ie(0, e, -1), r = { type: P.Template, value: t.slice(i.start, s.end) };
2956
- return i.loc && (r.loc = { start: i.loc.start, end: s.loc.end }), i.range && (r.start = i.range[0], r.end = s.range[1], r.range = [r.start, r.end]), r;
2957
- }
2958
- function rt(e, t) {
2959
- this._acornTokTypes = e, this._tokens = [], this._curlyBrace = null, this._code = t;
2960
- }
2961
- rt.prototype = { constructor: rt, translate(e, t) {
2962
- let i = e.type, s = this._acornTokTypes;
2963
- if (i === s.name) e.type = P.Identifier, e.value === "static" && (e.type = P.Keyword), t.ecmaVersion > 5 && (e.value === "yield" || e.value === "let") && (e.type = P.Keyword);
2964
- else if (i === s.privateId) e.type = P.PrivateIdentifier;
2965
- else if (i === s.semi || i === s.comma || i === s.parenL || i === s.parenR || i === s.braceL || i === s.braceR || i === s.dot || i === s.bracketL || i === s.colon || i === s.question || i === s.bracketR || i === s.ellipsis || i === s.arrow || i === s.jsxTagStart || i === s.incDec || i === s.starstar || i === s.jsxTagEnd || i === s.prefix || i === s.questionDot || i.binop && !i.keyword || i.isAssign) e.type = P.Punctuator, e.value = this._code.slice(e.start, e.end);
2966
- else if (i === s.jsxName) e.type = P.JSXIdentifier;
2967
- else if (i.label === "jsxText" || i === s.jsxAttrValueToken) e.type = P.JSXText;
2968
- else if (i.keyword) i.keyword === "true" || i.keyword === "false" ? e.type = P.Boolean : i.keyword === "null" ? e.type = P.Null : e.type = P.Keyword;
2969
- else if (i === s.num) e.type = P.Numeric, e.value = this._code.slice(e.start, e.end);
2970
- else if (i === s.string) t.jsxAttrValueToken ? (t.jsxAttrValueToken = false, e.type = P.JSXText) : e.type = P.String, e.value = this._code.slice(e.start, e.end);
2971
- else if (i === s.regexp) {
2972
- e.type = P.RegularExpression;
2973
- let r = e.value;
2974
- e.regex = { flags: r.flags, pattern: r.pattern }, e.value = `/${r.pattern}/${r.flags}`;
2975
- }
2976
- return e;
2977
- }, onToken(e, t) {
2978
- let i = this._acornTokTypes, s = t.tokens, r = this._tokens, o = () => {
2979
- s.push(ar(this._tokens, this._code)), this._tokens = [];
2980
- };
2981
- if (e.type === i.eof) {
2982
- this._curlyBrace && s.push(this.translate(this._curlyBrace, t));
2983
- return;
2984
- }
2985
- if (e.type === i.backQuote) {
2986
- this._curlyBrace && (s.push(this.translate(this._curlyBrace, t)), this._curlyBrace = null), r.push(e), r.length > 1 && o();
2987
- return;
2988
- }
2989
- if (e.type === i.dollarBraceL) {
2990
- r.push(e), o();
2991
- return;
2992
- }
2993
- if (e.type === i.braceR) {
2994
- this._curlyBrace && s.push(this.translate(this._curlyBrace, t)), this._curlyBrace = e;
2995
- return;
2996
- }
2997
- if (e.type === i.template || e.type === i.invalidTemplate) {
2998
- this._curlyBrace && (r.push(this._curlyBrace), this._curlyBrace = null), r.push(e);
2999
- return;
3000
- }
3001
- this._curlyBrace && (s.push(this.translate(this._curlyBrace, t)), this._curlyBrace = null), s.push(this.translate(e, t));
3002
- } };
3003
- var Ci = rt;
3004
- var Ti = [3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17];
3005
- function nr() {
3006
- return ie(0, Ti, -1);
3007
- }
3008
- function or(e = 5) {
3009
- let t = e === "latest" ? nr() : e;
3010
- if (typeof t != "number") throw new Error(`ecmaVersion must be a number or "latest". Received value of type ${typeof e} instead.`);
3011
- if (t >= 2015 && (t -= 2009), !Ti.includes(t)) throw new Error("Invalid ecmaVersion.");
3012
- return t;
3013
- }
3014
- function ur(e = "script") {
3015
- if (e === "script" || e === "module") return e;
3016
- if (e === "commonjs") return "script";
3017
- throw new Error("Invalid sourceType.");
3018
- }
3019
- function Ei(e) {
3020
- let t = or(e.ecmaVersion), i = ur(e.sourceType), s = e.range === true, r = e.loc === true;
3021
- if (t !== 3 && e.allowReserved) throw new Error("`allowReserved` is only supported when ecmaVersion is 3");
3022
- if (typeof e.allowReserved < "u" && typeof e.allowReserved != "boolean") throw new Error("`allowReserved`, when present, must be `true` or `false`");
3023
- let o = t === 3 ? e.allowReserved || "never" : false, u = e.ecmaFeatures || {}, p = e.sourceType === "commonjs" || !!u.globalReturn;
3024
- if (i === "module" && t < 6) throw new Error("sourceType 'module' is not supported when ecmaVersion < 2015. Consider adding `{ ecmaVersion: 2015 }` to the parser options.");
3025
- return Object.assign({}, e, { ecmaVersion: t, sourceType: i, ranges: s, locations: r, allowReserved: o, allowReturnOutsideFunction: p });
3026
- }
3027
- var Q = /* @__PURE__ */ Symbol("espree's internal state");
3028
- var at = /* @__PURE__ */ Symbol("espree's esprimaFinishNode");
3029
- function hr(e, t, i, s, r, o, u) {
3030
- let p;
3031
- e ? p = "Block" : u.slice(i, i + 2) === "#!" ? p = "Hashbang" : p = "Line";
3032
- let h = { type: p, value: t };
3033
- return typeof i == "number" && (h.start = i, h.end = s, h.range = [i, s]), typeof r == "object" && (h.loc = { start: r, end: o }), h;
3034
- }
3035
- var nt = () => (e) => {
3036
- let t = Object.assign({}, e.acorn.tokTypes);
3037
- return e.acornJsx && Object.assign(t, e.acornJsx.tokTypes), class extends e {
3038
- constructor(s, r) {
3039
- (typeof s != "object" || s === null) && (s = {}), typeof r != "string" && !(r instanceof String) && (r = String(r));
3040
- let o = s.sourceType, u = Ei(s), p = u.ecmaFeatures || {}, h = u.tokens === true ? new Ci(t, r) : null, l = { originalSourceType: o || u.sourceType, tokens: h ? [] : null, comments: u.comment === true ? [] : null, impliedStrict: p.impliedStrict === true && u.ecmaVersion >= 5, ecmaVersion: u.ecmaVersion, jsxAttrValueToken: false, lastToken: null, templateElements: [] };
3041
- super({ ecmaVersion: u.ecmaVersion, sourceType: u.sourceType, ranges: u.ranges, locations: u.locations, allowReserved: u.allowReserved, allowReturnOutsideFunction: u.allowReturnOutsideFunction, onToken(m) {
3042
- h && h.onToken(m, l), m.type !== t.eof && (l.lastToken = m);
3043
- }, onComment(m, S, E, c, x, y) {
3044
- if (l.comments) {
3045
- let v = hr(m, S, E, c, x, y, r);
3046
- l.comments.push(v);
3047
- }
3048
- } }, r), this[Q] = l;
3049
- }
3050
- tokenize() {
3051
- do
3052
- this.next();
3053
- while (this.type !== t.eof);
3054
- this.next();
3055
- let s = this[Q], r = s.tokens;
3056
- return s.comments && (r.comments = s.comments), r;
3057
- }
3058
- finishNode(...s) {
3059
- let r = super.finishNode(...s);
3060
- return this[at](r);
3061
- }
3062
- finishNodeAt(...s) {
3063
- let r = super.finishNodeAt(...s);
3064
- return this[at](r);
3065
- }
3066
- parse() {
3067
- let s = this[Q], r = super.parse();
3068
- return r.sourceType = s.originalSourceType, s.comments && (r.comments = s.comments), s.tokens && (r.tokens = s.tokens), this[Q].templateElements.forEach((o) => {
3069
- let p = o.tail ? 1 : 2;
3070
- o.start += -1, o.end += p, o.range && (o.range[0] += -1, o.range[1] += p), o.loc && (o.loc.start.column += -1, o.loc.end.column += p);
3071
- }), r;
3072
- }
3073
- parseTopLevel(s) {
3074
- return this[Q].impliedStrict && (this.strict = true), super.parseTopLevel(s);
3075
- }
3076
- raise(s, r) {
3077
- let o = e.acorn.getLineInfo(this.input, s), u = new SyntaxError(r);
3078
- throw u.index = s, u.lineNumber = o.line, u.column = o.column + 1, u;
3079
- }
3080
- raiseRecoverable(s, r) {
3081
- this.raise(s, r);
3082
- }
3083
- unexpected(s) {
3084
- let r = "Unexpected token";
3085
- if (s != null) {
3086
- if (this.pos = s, this.options.locations) for (; this.pos < this.lineStart; ) this.lineStart = this.input.lastIndexOf(`
3087
- `, this.lineStart - 2) + 1, --this.curLine;
3088
- this.nextToken();
3089
- }
3090
- this.end > this.start && (r += ` ${this.input.slice(this.start, this.end)}`), this.raise(this.start, r);
3091
- }
3092
- jsx_readString(s) {
3093
- let r = super.jsx_readString(s);
3094
- return this.type === t.string && (this[Q].jsxAttrValueToken = true), r;
3095
- }
3096
- [at](s) {
3097
- return s.type === "TemplateElement" && this[Q].templateElements.push(s), s.type.includes("Function") && !s.generator && (s.generator = false), s;
3098
- }
3099
- };
3100
- };
3101
- var pr = { _regular: null, _jsx: null, get regular() {
3102
- return this._regular === null && (this._regular = A.extend(nt())), this._regular;
3103
- }, get jsx() {
3104
- return this._jsx === null && (this._jsx = A.extend((0, Ai.default)(), nt())), this._jsx;
3105
- }, get(e) {
3106
- return !!(e && e.ecmaFeatures && e.ecmaFeatures.jsx) ? this.jsx : this.regular;
3107
- } };
3108
- function ki(e, t) {
3109
- let i = pr.get(t);
3110
- return new i(t, e).parse();
3111
- }
3112
- var cr = { ecmaVersion: "latest", range: true, loc: false, comment: true, tokens: false, ecmaFeatures: { jsx: true, impliedStrict: false } };
3113
- function lr(e) {
3114
- let { message: t, lineNumber: i, column: s } = e;
3115
- return typeof i != "number" ? e : Ae(t, { loc: { start: { line: i, column: s } }, cause: e });
3116
- }
3117
- function fr(e, t) {
3118
- let i = Ve(t?.filepath), s = (i ? [i] : Re).map((o) => () => ki(e, { ...cr, sourceType: o })), r;
3119
- try {
3120
- r = ke(s);
3121
- } catch ({ errors: [o] }) {
3122
- throw lr(o);
3123
- }
3124
- return Pe(r, { parser: "espree", text: e });
3125
- }
3126
- var wi = Ie(fr);
3127
- var dr = { acorn: _i, espree: wi };
3128
- export {
3129
- Pi as default,
3130
- dr as parsers
3131
- };