soonjs 0.0.27 → 0.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/vite-plugin-soon-client.cjs +2 -2
- package/dist/vite-plugin-soon-client.js +14 -14
- package/dist/vite-plugin-soon-server.cjs +1 -1
- package/dist/vite-plugin-soon-server.js +1 -1
- package/package.json +1 -1
- package/dist/deps/acorn-4wexbyzuw.js +0 -2895
- package/dist/deps/angular-xfi4e19sg.js +0 -1448
- package/dist/deps/babel-wotymuimo.js +0 -6844
- package/dist/deps/estree-w8aqfmnru.js +0 -4265
- package/dist/deps/flow-5zpe1wzhk.js +0 -26221
- package/dist/deps/glimmer-pnwlsj9ka.js +0 -2756
- package/dist/deps/graphql-rd46v28zh.js +0 -1212
- package/dist/deps/html-xp09o8rqi.js +0 -2623
- package/dist/deps/markdown-bnfknn2ni.js +0 -3058
- package/dist/deps/meriyah-s7tpf27fe.js +0 -2320
- package/dist/deps/postcss-bc3q8dofl.js +0 -4664
- package/dist/deps/soon-id-jwjk4327p.js +0 -30
- package/dist/deps/typescript-icql3mp9b.js +0 -12794
- package/dist/deps/yaml-sx1aya8o8.js +0 -4088
- /package/dist/deps/{acorn-4t935rp91.js → acorn-Ff8MVRmodX.js} +0 -0
- /package/dist/deps/{angular-q6i1sy3lp.js → angular-LqdjJ4Yaq2.js} +0 -0
- /package/dist/deps/{babel-282anq5m4.js → babel-32vqD9oEys.js} +0 -0
- /package/dist/deps/{estree-35km1xdcr.js → estree-IMJs86TDC0.js} +0 -0
- /package/dist/deps/{flow-nsownrvze.js → flow-zRn8VfVm5J.js} +0 -0
- /package/dist/deps/{glimmer-lr7v7jyip.js → glimmer-_ODPKtzJ7S.js} +0 -0
- /package/dist/deps/{graphql-yeio05lym.js → graphql-q8vjor01qx.js} +0 -0
- /package/dist/deps/{html-ru6d9i9yp.js → html-TSaii5iYiA.js} +0 -0
- /package/dist/deps/{markdown-lx93e2vjh.js → markdown-M6N0BeoGFG.js} +0 -0
- /package/dist/deps/{meriyah-t4wz91nre.js → meriyah-XGfSapNsj5.js} +0 -0
- /package/dist/deps/{postcss-6t5bq84rl.js → postcss-Urbkvv7NC7.js} +0 -0
- /package/dist/deps/{soon-id-yegik52z1.js → soon-id-LxpwEdKJEZ.js} +0 -0
- /package/dist/deps/{typescript-xwuz67p85.js → typescript-rVkPWM4hUZ.js} +0 -0
- /package/dist/deps/{yaml-oo2p8lgav.js → yaml-ySEu0nw36-.js} +0 -0
|
@@ -1,1448 +0,0 @@
|
|
|
1
|
-
var re = Object.defineProperty;
|
|
2
|
-
var ne = (t, e, s) => e in t ? re(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
|
|
3
|
-
var xt = (t, e, s) => ne(t, typeof e != "symbol" ? e + "" : e, s);
|
|
4
|
-
var ae = Object.defineProperty, Kt = (t) => {
|
|
5
|
-
throw TypeError(t);
|
|
6
|
-
}, Tt = (t, e) => {
|
|
7
|
-
for (var s in e) ae(t, s, { get: e[s], enumerable: !0 });
|
|
8
|
-
}, pt = (t, e, s) => e.has(t) || Kt("Cannot " + s), I = (t, e, s) => (pt(t, e, "read from private field"), s ? s.call(t) : e.get(t)), B = (t, e, s) => e.has(t) ? Kt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), q = (t, e, s, i) => (pt(t, e, "write to private field"), e.set(t, s), s), h = (t, e, s) => (pt(t, e, "access private method"), s), Lt = {};
|
|
9
|
-
Tt(Lt, { parsers: () => _t });
|
|
10
|
-
var _t = {};
|
|
11
|
-
Tt(_t, { __ng_action: () => ts, __ng_binding: () => es, __ng_directive: () => is, __ng_interpolation: () => ss });
|
|
12
|
-
var et = class {
|
|
13
|
-
constructor(t, e, s, i) {
|
|
14
|
-
this.input = e, this.errLocation = s, this.ctxLocation = i, this.message = `Parser Error: ${t} ${s} [${e}] in ${i}`;
|
|
15
|
-
}
|
|
16
|
-
}, V = class {
|
|
17
|
-
constructor(t, e) {
|
|
18
|
-
this.start = t, this.end = e;
|
|
19
|
-
}
|
|
20
|
-
toAbsolute(t) {
|
|
21
|
-
return new T(t + this.start, t + this.end);
|
|
22
|
-
}
|
|
23
|
-
}, g = class {
|
|
24
|
-
constructor(t, e) {
|
|
25
|
-
this.span = t, this.sourceSpan = e;
|
|
26
|
-
}
|
|
27
|
-
toString() {
|
|
28
|
-
return "AST";
|
|
29
|
-
}
|
|
30
|
-
}, D = class extends g {
|
|
31
|
-
constructor(t, e, s) {
|
|
32
|
-
super(t, e), this.nameSpan = s;
|
|
33
|
-
}
|
|
34
|
-
}, P = class extends g {
|
|
35
|
-
visit(t, e = null) {
|
|
36
|
-
}
|
|
37
|
-
}, z = class extends g {
|
|
38
|
-
visit(t, e = null) {
|
|
39
|
-
return t.visitImplicitReceiver(this, e);
|
|
40
|
-
}
|
|
41
|
-
}, he = class extends z {
|
|
42
|
-
visit(t, e = null) {
|
|
43
|
-
var s;
|
|
44
|
-
return (s = t.visitThisReceiver) == null ? void 0 : s.call(t, this, e);
|
|
45
|
-
}
|
|
46
|
-
}, $t = class extends g {
|
|
47
|
-
constructor(t, e, s) {
|
|
48
|
-
super(t, e), this.expressions = s;
|
|
49
|
-
}
|
|
50
|
-
visit(t, e = null) {
|
|
51
|
-
return t.visitChain(this, e);
|
|
52
|
-
}
|
|
53
|
-
}, Mt = class extends g {
|
|
54
|
-
constructor(t, e, s, i, r) {
|
|
55
|
-
super(t, e), this.condition = s, this.trueExp = i, this.falseExp = r;
|
|
56
|
-
}
|
|
57
|
-
visit(t, e = null) {
|
|
58
|
-
return t.visitConditional(this, e);
|
|
59
|
-
}
|
|
60
|
-
}, st = class extends D {
|
|
61
|
-
constructor(t, e, s, i, r) {
|
|
62
|
-
super(t, e, s), this.receiver = i, this.name = r;
|
|
63
|
-
}
|
|
64
|
-
visit(t, e = null) {
|
|
65
|
-
return t.visitPropertyRead(this, e);
|
|
66
|
-
}
|
|
67
|
-
}, Bt = class extends D {
|
|
68
|
-
constructor(t, e, s, i, r, n) {
|
|
69
|
-
super(t, e, s), this.receiver = i, this.name = r, this.value = n;
|
|
70
|
-
}
|
|
71
|
-
visit(t, e = null) {
|
|
72
|
-
return t.visitPropertyWrite(this, e);
|
|
73
|
-
}
|
|
74
|
-
}, it = class extends D {
|
|
75
|
-
constructor(t, e, s, i, r) {
|
|
76
|
-
super(t, e, s), this.receiver = i, this.name = r;
|
|
77
|
-
}
|
|
78
|
-
visit(t, e = null) {
|
|
79
|
-
return t.visitSafePropertyRead(this, e);
|
|
80
|
-
}
|
|
81
|
-
}, Wt = class extends g {
|
|
82
|
-
constructor(t, e, s, i) {
|
|
83
|
-
super(t, e), this.receiver = s, this.key = i;
|
|
84
|
-
}
|
|
85
|
-
visit(t, e = null) {
|
|
86
|
-
return t.visitKeyedRead(this, e);
|
|
87
|
-
}
|
|
88
|
-
}, rt = class extends g {
|
|
89
|
-
constructor(t, e, s, i) {
|
|
90
|
-
super(t, e), this.receiver = s, this.key = i;
|
|
91
|
-
}
|
|
92
|
-
visit(t, e = null) {
|
|
93
|
-
return t.visitSafeKeyedRead(this, e);
|
|
94
|
-
}
|
|
95
|
-
}, Ut = class extends g {
|
|
96
|
-
constructor(t, e, s, i, r) {
|
|
97
|
-
super(t, e), this.receiver = s, this.key = i, this.value = r;
|
|
98
|
-
}
|
|
99
|
-
visit(t, e = null) {
|
|
100
|
-
return t.visitKeyedWrite(this, e);
|
|
101
|
-
}
|
|
102
|
-
}, Rt = class extends D {
|
|
103
|
-
constructor(t, e, s, i, r, n) {
|
|
104
|
-
super(t, e, n), this.exp = s, this.name = i, this.args = r;
|
|
105
|
-
}
|
|
106
|
-
visit(t, e = null) {
|
|
107
|
-
return t.visitPipe(this, e);
|
|
108
|
-
}
|
|
109
|
-
}, O = class extends g {
|
|
110
|
-
constructor(t, e, s) {
|
|
111
|
-
super(t, e), this.value = s;
|
|
112
|
-
}
|
|
113
|
-
visit(t, e = null) {
|
|
114
|
-
return t.visitLiteralPrimitive(this, e);
|
|
115
|
-
}
|
|
116
|
-
}, Gt = class extends g {
|
|
117
|
-
constructor(t, e, s) {
|
|
118
|
-
super(t, e), this.expressions = s;
|
|
119
|
-
}
|
|
120
|
-
visit(t, e = null) {
|
|
121
|
-
return t.visitLiteralArray(this, e);
|
|
122
|
-
}
|
|
123
|
-
}, Vt = class extends g {
|
|
124
|
-
constructor(t, e, s, i) {
|
|
125
|
-
super(t, e), this.keys = s, this.values = i;
|
|
126
|
-
}
|
|
127
|
-
visit(t, e = null) {
|
|
128
|
-
return t.visitLiteralMap(this, e);
|
|
129
|
-
}
|
|
130
|
-
}, Ft = class extends g {
|
|
131
|
-
constructor(t, e, s, i) {
|
|
132
|
-
super(t, e), this.strings = s, this.expressions = i;
|
|
133
|
-
}
|
|
134
|
-
visit(t, e = null) {
|
|
135
|
-
return t.visitInterpolation(this, e);
|
|
136
|
-
}
|
|
137
|
-
}, E = class extends g {
|
|
138
|
-
constructor(t, e, s, i, r) {
|
|
139
|
-
super(t, e), this.operation = s, this.left = i, this.right = r;
|
|
140
|
-
}
|
|
141
|
-
visit(t, e = null) {
|
|
142
|
-
return t.visitBinary(this, e);
|
|
143
|
-
}
|
|
144
|
-
}, nt = class at extends E {
|
|
145
|
-
static createMinus(e, s, i) {
|
|
146
|
-
return new at(e, s, "-", i, "-", new O(e, s, 0), i);
|
|
147
|
-
}
|
|
148
|
-
static createPlus(e, s, i) {
|
|
149
|
-
return new at(e, s, "+", i, "-", i, new O(e, s, 0));
|
|
150
|
-
}
|
|
151
|
-
constructor(e, s, i, r, n, a, l) {
|
|
152
|
-
super(e, s, n, a, l), this.operator = i, this.expr = r, this.left = null, this.right = null, this.operation = null;
|
|
153
|
-
}
|
|
154
|
-
visit(e, s = null) {
|
|
155
|
-
return e.visitUnary !== void 0 ? e.visitUnary(this, s) : e.visitBinary(this, s);
|
|
156
|
-
}
|
|
157
|
-
}, jt = class extends g {
|
|
158
|
-
constructor(t, e, s) {
|
|
159
|
-
super(t, e), this.expression = s;
|
|
160
|
-
}
|
|
161
|
-
visit(t, e = null) {
|
|
162
|
-
return t.visitPrefixNot(this, e);
|
|
163
|
-
}
|
|
164
|
-
}, qt = class extends g {
|
|
165
|
-
constructor(t, e, s) {
|
|
166
|
-
super(t, e), this.expression = s;
|
|
167
|
-
}
|
|
168
|
-
visit(t, e = null) {
|
|
169
|
-
return t.visitNonNullAssert(this, e);
|
|
170
|
-
}
|
|
171
|
-
}, zt = class extends g {
|
|
172
|
-
constructor(t, e, s, i, r) {
|
|
173
|
-
super(t, e), this.receiver = s, this.args = i, this.argumentSpan = r;
|
|
174
|
-
}
|
|
175
|
-
visit(t, e = null) {
|
|
176
|
-
return t.visitCall(this, e);
|
|
177
|
-
}
|
|
178
|
-
}, ht = class extends g {
|
|
179
|
-
constructor(t, e, s, i, r) {
|
|
180
|
-
super(t, e), this.receiver = s, this.args = i, this.argumentSpan = r;
|
|
181
|
-
}
|
|
182
|
-
visit(t, e = null) {
|
|
183
|
-
return t.visitSafeCall(this, e);
|
|
184
|
-
}
|
|
185
|
-
}, T = class {
|
|
186
|
-
constructor(t, e) {
|
|
187
|
-
this.start = t, this.end = e;
|
|
188
|
-
}
|
|
189
|
-
}, L = class extends g {
|
|
190
|
-
constructor(t, e, s, i, r) {
|
|
191
|
-
super(new V(0, e === null ? 0 : e.length), new T(i, e === null ? i : i + e.length)), this.ast = t, this.source = e, this.location = s, this.errors = r;
|
|
192
|
-
}
|
|
193
|
-
visit(t, e = null) {
|
|
194
|
-
return t.visitASTWithSource ? t.visitASTWithSource(this, e) : this.ast.visit(t, e);
|
|
195
|
-
}
|
|
196
|
-
toString() {
|
|
197
|
-
return `${this.source} in ${this.location}`;
|
|
198
|
-
}
|
|
199
|
-
}, ot = class {
|
|
200
|
-
constructor(t, e, s) {
|
|
201
|
-
this.sourceSpan = t, this.key = e, this.value = s;
|
|
202
|
-
}
|
|
203
|
-
}, Dt = class {
|
|
204
|
-
constructor(t, e, s) {
|
|
205
|
-
this.sourceSpan = t, this.key = e, this.value = s;
|
|
206
|
-
}
|
|
207
|
-
}, oe = class {
|
|
208
|
-
visit(t, e) {
|
|
209
|
-
t.visit(this, e);
|
|
210
|
-
}
|
|
211
|
-
visitUnary(t, e) {
|
|
212
|
-
this.visit(t.expr, e);
|
|
213
|
-
}
|
|
214
|
-
visitBinary(t, e) {
|
|
215
|
-
this.visit(t.left, e), this.visit(t.right, e);
|
|
216
|
-
}
|
|
217
|
-
visitChain(t, e) {
|
|
218
|
-
this.visitAll(t.expressions, e);
|
|
219
|
-
}
|
|
220
|
-
visitConditional(t, e) {
|
|
221
|
-
this.visit(t.condition, e), this.visit(t.trueExp, e), this.visit(t.falseExp, e);
|
|
222
|
-
}
|
|
223
|
-
visitPipe(t, e) {
|
|
224
|
-
this.visit(t.exp, e), this.visitAll(t.args, e);
|
|
225
|
-
}
|
|
226
|
-
visitImplicitReceiver(t, e) {
|
|
227
|
-
}
|
|
228
|
-
visitThisReceiver(t, e) {
|
|
229
|
-
}
|
|
230
|
-
visitInterpolation(t, e) {
|
|
231
|
-
this.visitAll(t.expressions, e);
|
|
232
|
-
}
|
|
233
|
-
visitKeyedRead(t, e) {
|
|
234
|
-
this.visit(t.receiver, e), this.visit(t.key, e);
|
|
235
|
-
}
|
|
236
|
-
visitKeyedWrite(t, e) {
|
|
237
|
-
this.visit(t.receiver, e), this.visit(t.key, e), this.visit(t.value, e);
|
|
238
|
-
}
|
|
239
|
-
visitLiteralArray(t, e) {
|
|
240
|
-
this.visitAll(t.expressions, e);
|
|
241
|
-
}
|
|
242
|
-
visitLiteralMap(t, e) {
|
|
243
|
-
this.visitAll(t.values, e);
|
|
244
|
-
}
|
|
245
|
-
visitLiteralPrimitive(t, e) {
|
|
246
|
-
}
|
|
247
|
-
visitPrefixNot(t, e) {
|
|
248
|
-
this.visit(t.expression, e);
|
|
249
|
-
}
|
|
250
|
-
visitNonNullAssert(t, e) {
|
|
251
|
-
this.visit(t.expression, e);
|
|
252
|
-
}
|
|
253
|
-
visitPropertyRead(t, e) {
|
|
254
|
-
this.visit(t.receiver, e);
|
|
255
|
-
}
|
|
256
|
-
visitPropertyWrite(t, e) {
|
|
257
|
-
this.visit(t.receiver, e), this.visit(t.value, e);
|
|
258
|
-
}
|
|
259
|
-
visitSafePropertyRead(t, e) {
|
|
260
|
-
this.visit(t.receiver, e);
|
|
261
|
-
}
|
|
262
|
-
visitSafeKeyedRead(t, e) {
|
|
263
|
-
this.visit(t.receiver, e), this.visit(t.key, e);
|
|
264
|
-
}
|
|
265
|
-
visitCall(t, e) {
|
|
266
|
-
this.visit(t.receiver, e), this.visitAll(t.args, e);
|
|
267
|
-
}
|
|
268
|
-
visitSafeCall(t, e) {
|
|
269
|
-
this.visit(t.receiver, e), this.visitAll(t.args, e);
|
|
270
|
-
}
|
|
271
|
-
visitAll(t, e) {
|
|
272
|
-
for (let s of t) this.visit(s, e);
|
|
273
|
-
}
|
|
274
|
-
}, vt;
|
|
275
|
-
(function(t) {
|
|
276
|
-
t[t.DEFAULT = 0] = "DEFAULT", t[t.LITERAL_ATTR = 1] = "LITERAL_ATTR", t[t.ANIMATION = 2] = "ANIMATION", t[t.TWO_WAY = 3] = "TWO_WAY";
|
|
277
|
-
})(vt || (vt = {}));
|
|
278
|
-
var yt;
|
|
279
|
-
(function(t) {
|
|
280
|
-
t[t.Regular = 0] = "Regular", t[t.Animation = 1] = "Animation", t[t.TwoWay = 2] = "TwoWay";
|
|
281
|
-
})(yt || (yt = {}));
|
|
282
|
-
var gt;
|
|
283
|
-
(function(t) {
|
|
284
|
-
t[t.Property = 0] = "Property", t[t.Attribute = 1] = "Attribute", t[t.Class = 2] = "Class", t[t.Style = 3] = "Style", t[t.Animation = 4] = "Animation", t[t.TwoWay = 5] = "TwoWay";
|
|
285
|
-
})(gt || (gt = {}));
|
|
286
|
-
function le(t) {
|
|
287
|
-
return t >= 9 && t <= 32 || t == 160;
|
|
288
|
-
}
|
|
289
|
-
function K(t) {
|
|
290
|
-
return 48 <= t && t <= 57;
|
|
291
|
-
}
|
|
292
|
-
function ce(t) {
|
|
293
|
-
return t >= 97 && t <= 122 || t >= 65 && t <= 90;
|
|
294
|
-
}
|
|
295
|
-
function mt(t) {
|
|
296
|
-
return t === 39 || t === 34 || t === 96;
|
|
297
|
-
}
|
|
298
|
-
var p;
|
|
299
|
-
(function(t) {
|
|
300
|
-
t[t.Character = 0] = "Character", t[t.Identifier = 1] = "Identifier", t[t.PrivateIdentifier = 2] = "PrivateIdentifier", t[t.Keyword = 3] = "Keyword", t[t.String = 4] = "String", t[t.Operator = 5] = "Operator", t[t.Number = 6] = "Number", t[t.Error = 7] = "Error";
|
|
301
|
-
})(p || (p = {}));
|
|
302
|
-
var pe = ["var", "let", "as", "null", "undefined", "true", "false", "if", "else", "this"], ue = class {
|
|
303
|
-
tokenize(t) {
|
|
304
|
-
let e = new me(t), s = [], i = e.scanToken();
|
|
305
|
-
for (; i != null; ) s.push(i), i = e.scanToken();
|
|
306
|
-
return s;
|
|
307
|
-
}
|
|
308
|
-
}, b = class {
|
|
309
|
-
constructor(t, e, s, i, r) {
|
|
310
|
-
this.index = t, this.end = e, this.type = s, this.numValue = i, this.strValue = r;
|
|
311
|
-
}
|
|
312
|
-
isCharacter(t) {
|
|
313
|
-
return this.type == p.Character && this.numValue == t;
|
|
314
|
-
}
|
|
315
|
-
isNumber() {
|
|
316
|
-
return this.type == p.Number;
|
|
317
|
-
}
|
|
318
|
-
isString() {
|
|
319
|
-
return this.type == p.String;
|
|
320
|
-
}
|
|
321
|
-
isOperator(t) {
|
|
322
|
-
return this.type == p.Operator && this.strValue == t;
|
|
323
|
-
}
|
|
324
|
-
isIdentifier() {
|
|
325
|
-
return this.type == p.Identifier;
|
|
326
|
-
}
|
|
327
|
-
isPrivateIdentifier() {
|
|
328
|
-
return this.type == p.PrivateIdentifier;
|
|
329
|
-
}
|
|
330
|
-
isKeyword() {
|
|
331
|
-
return this.type == p.Keyword;
|
|
332
|
-
}
|
|
333
|
-
isKeywordLet() {
|
|
334
|
-
return this.type == p.Keyword && this.strValue == "let";
|
|
335
|
-
}
|
|
336
|
-
isKeywordAs() {
|
|
337
|
-
return this.type == p.Keyword && this.strValue == "as";
|
|
338
|
-
}
|
|
339
|
-
isKeywordNull() {
|
|
340
|
-
return this.type == p.Keyword && this.strValue == "null";
|
|
341
|
-
}
|
|
342
|
-
isKeywordUndefined() {
|
|
343
|
-
return this.type == p.Keyword && this.strValue == "undefined";
|
|
344
|
-
}
|
|
345
|
-
isKeywordTrue() {
|
|
346
|
-
return this.type == p.Keyword && this.strValue == "true";
|
|
347
|
-
}
|
|
348
|
-
isKeywordFalse() {
|
|
349
|
-
return this.type == p.Keyword && this.strValue == "false";
|
|
350
|
-
}
|
|
351
|
-
isKeywordThis() {
|
|
352
|
-
return this.type == p.Keyword && this.strValue == "this";
|
|
353
|
-
}
|
|
354
|
-
isError() {
|
|
355
|
-
return this.type == p.Error;
|
|
356
|
-
}
|
|
357
|
-
toNumber() {
|
|
358
|
-
return this.type == p.Number ? this.numValue : -1;
|
|
359
|
-
}
|
|
360
|
-
toString() {
|
|
361
|
-
switch (this.type) {
|
|
362
|
-
case p.Character:
|
|
363
|
-
case p.Identifier:
|
|
364
|
-
case p.Keyword:
|
|
365
|
-
case p.Operator:
|
|
366
|
-
case p.PrivateIdentifier:
|
|
367
|
-
case p.String:
|
|
368
|
-
case p.Error:
|
|
369
|
-
return this.strValue;
|
|
370
|
-
case p.Number:
|
|
371
|
-
return this.numValue.toString();
|
|
372
|
-
default:
|
|
373
|
-
return null;
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
};
|
|
377
|
-
function wt(t, e, s) {
|
|
378
|
-
return new b(t, e, p.Character, s, String.fromCharCode(s));
|
|
379
|
-
}
|
|
380
|
-
function de(t, e, s) {
|
|
381
|
-
return new b(t, e, p.Identifier, 0, s);
|
|
382
|
-
}
|
|
383
|
-
function fe(t, e, s) {
|
|
384
|
-
return new b(t, e, p.PrivateIdentifier, 0, s);
|
|
385
|
-
}
|
|
386
|
-
function xe(t, e, s) {
|
|
387
|
-
return new b(t, e, p.Keyword, 0, s);
|
|
388
|
-
}
|
|
389
|
-
function Q(t, e, s) {
|
|
390
|
-
return new b(t, e, p.Operator, 0, s);
|
|
391
|
-
}
|
|
392
|
-
function ve(t, e, s) {
|
|
393
|
-
return new b(t, e, p.String, 0, s);
|
|
394
|
-
}
|
|
395
|
-
function ye(t, e, s) {
|
|
396
|
-
return new b(t, e, p.Number, s, "");
|
|
397
|
-
}
|
|
398
|
-
function ge(t, e, s) {
|
|
399
|
-
return new b(t, e, p.Error, 0, s);
|
|
400
|
-
}
|
|
401
|
-
var Y = new b(-1, -1, p.Character, 0, ""), me = class {
|
|
402
|
-
constructor(t) {
|
|
403
|
-
this.input = t, this.peek = 0, this.index = -1, this.length = t.length, this.advance();
|
|
404
|
-
}
|
|
405
|
-
advance() {
|
|
406
|
-
this.peek = ++this.index >= this.length ? 0 : this.input.charCodeAt(this.index);
|
|
407
|
-
}
|
|
408
|
-
scanToken() {
|
|
409
|
-
let t = this.input, e = this.length, s = this.peek, i = this.index;
|
|
410
|
-
for (; s <= 32; ) if (++i >= e) {
|
|
411
|
-
s = 0;
|
|
412
|
-
break;
|
|
413
|
-
} else s = t.charCodeAt(i);
|
|
414
|
-
if (this.peek = s, this.index = i, i >= e) return null;
|
|
415
|
-
if (St(s)) return this.scanIdentifier();
|
|
416
|
-
if (K(s)) return this.scanNumber(i);
|
|
417
|
-
let r = i;
|
|
418
|
-
switch (s) {
|
|
419
|
-
case 46:
|
|
420
|
-
return this.advance(), K(this.peek) ? this.scanNumber(r) : wt(r, this.index, 46);
|
|
421
|
-
case 40:
|
|
422
|
-
case 41:
|
|
423
|
-
case 123:
|
|
424
|
-
case 125:
|
|
425
|
-
case 91:
|
|
426
|
-
case 93:
|
|
427
|
-
case 44:
|
|
428
|
-
case 58:
|
|
429
|
-
case 59:
|
|
430
|
-
return this.scanCharacter(r, s);
|
|
431
|
-
case 39:
|
|
432
|
-
case 34:
|
|
433
|
-
return this.scanString();
|
|
434
|
-
case 35:
|
|
435
|
-
return this.scanPrivateIdentifier();
|
|
436
|
-
case 43:
|
|
437
|
-
case 45:
|
|
438
|
-
case 42:
|
|
439
|
-
case 47:
|
|
440
|
-
case 37:
|
|
441
|
-
case 94:
|
|
442
|
-
return this.scanOperator(r, String.fromCharCode(s));
|
|
443
|
-
case 63:
|
|
444
|
-
return this.scanQuestion(r);
|
|
445
|
-
case 60:
|
|
446
|
-
case 62:
|
|
447
|
-
return this.scanComplexOperator(r, String.fromCharCode(s), 61, "=");
|
|
448
|
-
case 33:
|
|
449
|
-
case 61:
|
|
450
|
-
return this.scanComplexOperator(r, String.fromCharCode(s), 61, "=", 61, "=");
|
|
451
|
-
case 38:
|
|
452
|
-
return this.scanComplexOperator(r, "&", 38, "&");
|
|
453
|
-
case 124:
|
|
454
|
-
return this.scanComplexOperator(r, "|", 124, "|");
|
|
455
|
-
case 160:
|
|
456
|
-
for (; le(this.peek); ) this.advance();
|
|
457
|
-
return this.scanToken();
|
|
458
|
-
}
|
|
459
|
-
return this.advance(), this.error(`Unexpected character [${String.fromCharCode(s)}]`, 0);
|
|
460
|
-
}
|
|
461
|
-
scanCharacter(t, e) {
|
|
462
|
-
return this.advance(), wt(t, this.index, e);
|
|
463
|
-
}
|
|
464
|
-
scanOperator(t, e) {
|
|
465
|
-
return this.advance(), Q(t, this.index, e);
|
|
466
|
-
}
|
|
467
|
-
scanComplexOperator(t, e, s, i, r, n) {
|
|
468
|
-
this.advance();
|
|
469
|
-
let a = e;
|
|
470
|
-
return this.peek == s && (this.advance(), a += i), r != null && this.peek == r && (this.advance(), a += n), Q(t, this.index, a);
|
|
471
|
-
}
|
|
472
|
-
scanIdentifier() {
|
|
473
|
-
let t = this.index;
|
|
474
|
-
for (this.advance(); Ct(this.peek); ) this.advance();
|
|
475
|
-
let e = this.input.substring(t, this.index);
|
|
476
|
-
return pe.indexOf(e) > -1 ? xe(t, this.index, e) : de(t, this.index, e);
|
|
477
|
-
}
|
|
478
|
-
scanPrivateIdentifier() {
|
|
479
|
-
let t = this.index;
|
|
480
|
-
if (this.advance(), !St(this.peek)) return this.error("Invalid character [#]", -1);
|
|
481
|
-
for (; Ct(this.peek); ) this.advance();
|
|
482
|
-
let e = this.input.substring(t, this.index);
|
|
483
|
-
return fe(t, this.index, e);
|
|
484
|
-
}
|
|
485
|
-
scanNumber(t) {
|
|
486
|
-
let e = this.index === t, s = !1;
|
|
487
|
-
for (this.advance(); ; ) {
|
|
488
|
-
if (!K(this.peek)) if (this.peek === 95) {
|
|
489
|
-
if (!K(this.input.charCodeAt(this.index - 1)) || !K(this.input.charCodeAt(this.index + 1))) return this.error("Invalid numeric separator", 0);
|
|
490
|
-
s = !0;
|
|
491
|
-
} else if (this.peek === 46) e = !1;
|
|
492
|
-
else if (we(this.peek)) {
|
|
493
|
-
if (this.advance(), Se(this.peek) && this.advance(), !K(this.peek)) return this.error("Invalid exponent", -1);
|
|
494
|
-
e = !1;
|
|
495
|
-
} else break;
|
|
496
|
-
this.advance();
|
|
497
|
-
}
|
|
498
|
-
let i = this.input.substring(t, this.index);
|
|
499
|
-
s && (i = i.replace(/_/g, ""));
|
|
500
|
-
let r = e ? ke(i) : parseFloat(i);
|
|
501
|
-
return ye(t, this.index, r);
|
|
502
|
-
}
|
|
503
|
-
scanString() {
|
|
504
|
-
let t = this.index, e = this.peek;
|
|
505
|
-
this.advance();
|
|
506
|
-
let s = "", i = this.index, r = this.input;
|
|
507
|
-
for (; this.peek != e; ) if (this.peek == 92) {
|
|
508
|
-
s += r.substring(i, this.index);
|
|
509
|
-
let a;
|
|
510
|
-
if (this.advance(), this.peek == 117) {
|
|
511
|
-
let l = r.substring(this.index + 1, this.index + 5);
|
|
512
|
-
if (/^[0-9a-f]+$/i.test(l)) a = parseInt(l, 16);
|
|
513
|
-
else return this.error(`Invalid unicode escape [\\u${l}]`, 0);
|
|
514
|
-
for (let c = 0; c < 5; c++) this.advance();
|
|
515
|
-
} else a = Ce(this.peek), this.advance();
|
|
516
|
-
s += String.fromCharCode(a), i = this.index;
|
|
517
|
-
} else {
|
|
518
|
-
if (this.peek == 0) return this.error("Unterminated quote", 0);
|
|
519
|
-
this.advance();
|
|
520
|
-
}
|
|
521
|
-
let n = r.substring(i, this.index);
|
|
522
|
-
return this.advance(), ve(t, this.index, s + n);
|
|
523
|
-
}
|
|
524
|
-
scanQuestion(t) {
|
|
525
|
-
this.advance();
|
|
526
|
-
let e = "?";
|
|
527
|
-
return (this.peek === 63 || this.peek === 46) && (e += this.peek === 46 ? "." : "?", this.advance()), Q(t, this.index, e);
|
|
528
|
-
}
|
|
529
|
-
error(t, e) {
|
|
530
|
-
let s = this.index + e;
|
|
531
|
-
return ge(s, this.index, `Lexer Error: ${t} at column ${s} in expression [${this.input}]`);
|
|
532
|
-
}
|
|
533
|
-
};
|
|
534
|
-
function St(t) {
|
|
535
|
-
return 97 <= t && t <= 122 || 65 <= t && t <= 90 || t == 95 || t == 36;
|
|
536
|
-
}
|
|
537
|
-
function Ct(t) {
|
|
538
|
-
return ce(t) || K(t) || t == 95 || t == 36;
|
|
539
|
-
}
|
|
540
|
-
function we(t) {
|
|
541
|
-
return t == 101 || t == 69;
|
|
542
|
-
}
|
|
543
|
-
function Se(t) {
|
|
544
|
-
return t == 45 || t == 43;
|
|
545
|
-
}
|
|
546
|
-
function Ce(t) {
|
|
547
|
-
switch (t) {
|
|
548
|
-
case 110:
|
|
549
|
-
return 10;
|
|
550
|
-
case 102:
|
|
551
|
-
return 12;
|
|
552
|
-
case 114:
|
|
553
|
-
return 13;
|
|
554
|
-
case 116:
|
|
555
|
-
return 9;
|
|
556
|
-
case 118:
|
|
557
|
-
return 11;
|
|
558
|
-
default:
|
|
559
|
-
return t;
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
function ke(t) {
|
|
563
|
-
let e = parseInt(t);
|
|
564
|
-
if (isNaN(e)) throw new Error("Invalid integer literal when parsing " + t);
|
|
565
|
-
return e;
|
|
566
|
-
}
|
|
567
|
-
var Pe = [/@/, /^\s*$/, /[<>]/, /^[{}]$/, /&(#|[a-z])/i, /^\/\//];
|
|
568
|
-
function Oe(t, e) {
|
|
569
|
-
if (e != null && !(Array.isArray(e) && e.length == 2)) throw new Error(`Expected '${t}' to be an array, [start, end].`);
|
|
570
|
-
if (e != null) {
|
|
571
|
-
let s = e[0], i = e[1];
|
|
572
|
-
Pe.forEach((r) => {
|
|
573
|
-
if (r.test(s) || r.test(i)) throw new Error(`['${s}', '${i}'] contains unusable interpolation symbol.`);
|
|
574
|
-
});
|
|
575
|
-
}
|
|
576
|
-
}
|
|
577
|
-
var Ee = class Ht {
|
|
578
|
-
static fromArray(e) {
|
|
579
|
-
return e ? (Oe("interpolation", e), new Ht(e[0], e[1])) : _;
|
|
580
|
-
}
|
|
581
|
-
constructor(e, s) {
|
|
582
|
-
this.start = e, this.end = s;
|
|
583
|
-
}
|
|
584
|
-
}, _ = new Ee("{{", "}}"), Ie = class {
|
|
585
|
-
constructor(t, e, s) {
|
|
586
|
-
this.strings = t, this.expressions = e, this.offsets = s;
|
|
587
|
-
}
|
|
588
|
-
}, be = class {
|
|
589
|
-
constructor(t, e, s) {
|
|
590
|
-
this.templateBindings = t, this.warnings = e, this.errors = s;
|
|
591
|
-
}
|
|
592
|
-
}, Jt = class {
|
|
593
|
-
constructor(t) {
|
|
594
|
-
this._lexer = t, this.errors = [];
|
|
595
|
-
}
|
|
596
|
-
parseAction(t, e, s, i = _) {
|
|
597
|
-
this._checkNoInterpolation(t, e, i);
|
|
598
|
-
let r = this._stripComments(t), n = this._lexer.tokenize(r), a = new W(t, e, s, n, 1, this.errors, 0).parseChain();
|
|
599
|
-
return new L(a, t, e, s, this.errors);
|
|
600
|
-
}
|
|
601
|
-
parseBinding(t, e, s, i = _) {
|
|
602
|
-
let r = this._parseBindingAst(t, e, s, i);
|
|
603
|
-
return new L(r, t, e, s, this.errors);
|
|
604
|
-
}
|
|
605
|
-
checkSimpleExpression(t) {
|
|
606
|
-
let e = new Ae();
|
|
607
|
-
return t.visit(e), e.errors;
|
|
608
|
-
}
|
|
609
|
-
parseSimpleBinding(t, e, s, i = _) {
|
|
610
|
-
let r = this._parseBindingAst(t, e, s, i), n = this.checkSimpleExpression(r);
|
|
611
|
-
return n.length > 0 && this._reportError(`Host binding expression cannot contain ${n.join(" ")}`, t, e), new L(r, t, e, s, this.errors);
|
|
612
|
-
}
|
|
613
|
-
_reportError(t, e, s, i) {
|
|
614
|
-
this.errors.push(new et(t, e, s, i));
|
|
615
|
-
}
|
|
616
|
-
_parseBindingAst(t, e, s, i) {
|
|
617
|
-
this._checkNoInterpolation(t, e, i);
|
|
618
|
-
let r = this._stripComments(t), n = this._lexer.tokenize(r);
|
|
619
|
-
return new W(t, e, s, n, 0, this.errors, 0).parseChain();
|
|
620
|
-
}
|
|
621
|
-
parseTemplateBindings(t, e, s, i, r) {
|
|
622
|
-
let n = this._lexer.tokenize(e);
|
|
623
|
-
return new W(e, s, r, n, 0, this.errors, 0).parseTemplateBindings({ source: t, span: new T(i, i + t.length) });
|
|
624
|
-
}
|
|
625
|
-
parseInterpolation(t, e, s, i, r = _) {
|
|
626
|
-
let { strings: n, expressions: a, offsets: l } = this.splitInterpolation(t, e, i, r);
|
|
627
|
-
if (a.length === 0) return null;
|
|
628
|
-
let c = [];
|
|
629
|
-
for (let d = 0; d < a.length; ++d) {
|
|
630
|
-
let v = a[d].text, y = this._stripComments(v), k = this._lexer.tokenize(y), m = new W(t, e, s, k, 0, this.errors, l[d]).parseChain();
|
|
631
|
-
c.push(m);
|
|
632
|
-
}
|
|
633
|
-
return this.createInterpolationAst(n.map((d) => d.text), c, t, e, s);
|
|
634
|
-
}
|
|
635
|
-
parseInterpolationExpression(t, e, s) {
|
|
636
|
-
let i = this._stripComments(t), r = this._lexer.tokenize(i), n = new W(t, e, s, r, 0, this.errors, 0).parseChain(), a = ["", ""];
|
|
637
|
-
return this.createInterpolationAst(a, [n], t, e, s);
|
|
638
|
-
}
|
|
639
|
-
createInterpolationAst(t, e, s, i, r) {
|
|
640
|
-
let n = new V(0, s.length), a = new Ft(n, n.toAbsolute(r), t, e);
|
|
641
|
-
return new L(a, s, i, r, this.errors);
|
|
642
|
-
}
|
|
643
|
-
splitInterpolation(t, e, s, i = _) {
|
|
644
|
-
let r = [], n = [], a = [], l = s ? Ne(s) : null, c = 0, d = !1, v = !1, { start: y, end: k } = i;
|
|
645
|
-
for (; c < t.length; ) if (d) {
|
|
646
|
-
let m = c, N = m + y.length, A = this._getInterpolationEndIndex(t, k, N);
|
|
647
|
-
if (A === -1) {
|
|
648
|
-
d = !1, v = !0;
|
|
649
|
-
break;
|
|
650
|
-
}
|
|
651
|
-
let F = A + k.length, ft = t.substring(N, A);
|
|
652
|
-
ft.trim().length === 0 && this._reportError("Blank expressions are not allowed in interpolated strings", t, `at column ${c} in`, e), n.push({ text: ft, start: m, end: F });
|
|
653
|
-
let ie = ((l == null ? void 0 : l.get(m)) ?? m) + y.length;
|
|
654
|
-
a.push(ie), c = F, d = !1;
|
|
655
|
-
} else {
|
|
656
|
-
let m = c;
|
|
657
|
-
c = t.indexOf(y, c), c === -1 && (c = t.length);
|
|
658
|
-
let N = t.substring(m, c);
|
|
659
|
-
r.push({ text: N, start: m, end: c }), d = !0;
|
|
660
|
-
}
|
|
661
|
-
if (!d) if (v) {
|
|
662
|
-
let m = r[r.length - 1];
|
|
663
|
-
m.text += t.substring(c), m.end = t.length;
|
|
664
|
-
} else r.push({ text: t.substring(c), start: c, end: t.length });
|
|
665
|
-
return new Ie(r, n, a);
|
|
666
|
-
}
|
|
667
|
-
wrapLiteralPrimitive(t, e, s) {
|
|
668
|
-
let i = new V(0, t == null ? 0 : t.length);
|
|
669
|
-
return new L(new O(i, i.toAbsolute(s), t), t, e, s, this.errors);
|
|
670
|
-
}
|
|
671
|
-
_stripComments(t) {
|
|
672
|
-
let e = this._commentStart(t);
|
|
673
|
-
return e != null ? t.substring(0, e) : t;
|
|
674
|
-
}
|
|
675
|
-
_commentStart(t) {
|
|
676
|
-
let e = null;
|
|
677
|
-
for (let s = 0; s < t.length - 1; s++) {
|
|
678
|
-
let i = t.charCodeAt(s), r = t.charCodeAt(s + 1);
|
|
679
|
-
if (i === 47 && r == 47 && e == null) return s;
|
|
680
|
-
e === i ? e = null : e == null && mt(i) && (e = i);
|
|
681
|
-
}
|
|
682
|
-
return null;
|
|
683
|
-
}
|
|
684
|
-
_checkNoInterpolation(t, e, { start: s, end: i }) {
|
|
685
|
-
let r = -1, n = -1;
|
|
686
|
-
for (let a of this._forEachUnquotedChar(t, 0)) if (r === -1) t.startsWith(s) && (r = a);
|
|
687
|
-
else if (n = this._getInterpolationEndIndex(t, i, a), n > -1) break;
|
|
688
|
-
r > -1 && n > -1 && this._reportError(`Got interpolation (${s}${i}) where expression was expected`, t, `at column ${r} in`, e);
|
|
689
|
-
}
|
|
690
|
-
_getInterpolationEndIndex(t, e, s) {
|
|
691
|
-
for (let i of this._forEachUnquotedChar(t, s)) {
|
|
692
|
-
if (t.startsWith(e, i)) return i;
|
|
693
|
-
if (t.startsWith("//", i)) return t.indexOf(e, i);
|
|
694
|
-
}
|
|
695
|
-
return -1;
|
|
696
|
-
}
|
|
697
|
-
*_forEachUnquotedChar(t, e) {
|
|
698
|
-
let s = null, i = 0;
|
|
699
|
-
for (let r = e; r < t.length; r++) {
|
|
700
|
-
let n = t[r];
|
|
701
|
-
mt(t.charCodeAt(r)) && (s === null || s === n) && i % 2 === 0 ? s = s === null ? n : null : s === null && (yield r), i = n === "\\" ? i + 1 : 0;
|
|
702
|
-
}
|
|
703
|
-
}
|
|
704
|
-
}, $;
|
|
705
|
-
(function(t) {
|
|
706
|
-
t[t.None = 0] = "None", t[t.Writable = 1] = "Writable";
|
|
707
|
-
})($ || ($ = {}));
|
|
708
|
-
var W = class {
|
|
709
|
-
constructor(t, e, s, i, r, n, a) {
|
|
710
|
-
this.input = t, this.location = e, this.absoluteOffset = s, this.tokens = i, this.parseFlags = r, this.errors = n, this.offset = a, this.rparensExpected = 0, this.rbracketsExpected = 0, this.rbracesExpected = 0, this.context = $.None, this.sourceSpanCache = /* @__PURE__ */ new Map(), this.index = 0;
|
|
711
|
-
}
|
|
712
|
-
peek(t) {
|
|
713
|
-
let e = this.index + t;
|
|
714
|
-
return e < this.tokens.length ? this.tokens[e] : Y;
|
|
715
|
-
}
|
|
716
|
-
get next() {
|
|
717
|
-
return this.peek(0);
|
|
718
|
-
}
|
|
719
|
-
get atEOF() {
|
|
720
|
-
return this.index >= this.tokens.length;
|
|
721
|
-
}
|
|
722
|
-
get inputIndex() {
|
|
723
|
-
return this.atEOF ? this.currentEndIndex : this.next.index + this.offset;
|
|
724
|
-
}
|
|
725
|
-
get currentEndIndex() {
|
|
726
|
-
return this.index > 0 ? this.peek(-1).end + this.offset : this.tokens.length === 0 ? this.input.length + this.offset : this.next.index + this.offset;
|
|
727
|
-
}
|
|
728
|
-
get currentAbsoluteOffset() {
|
|
729
|
-
return this.absoluteOffset + this.inputIndex;
|
|
730
|
-
}
|
|
731
|
-
span(t, e) {
|
|
732
|
-
let s = this.currentEndIndex;
|
|
733
|
-
if (e !== void 0 && e > this.currentEndIndex && (s = e), t > s) {
|
|
734
|
-
let i = s;
|
|
735
|
-
s = t, t = i;
|
|
736
|
-
}
|
|
737
|
-
return new V(t, s);
|
|
738
|
-
}
|
|
739
|
-
sourceSpan(t, e) {
|
|
740
|
-
let s = `${t}@${this.inputIndex}:${e}`;
|
|
741
|
-
return this.sourceSpanCache.has(s) || this.sourceSpanCache.set(s, this.span(t, e).toAbsolute(this.absoluteOffset)), this.sourceSpanCache.get(s);
|
|
742
|
-
}
|
|
743
|
-
advance() {
|
|
744
|
-
this.index++;
|
|
745
|
-
}
|
|
746
|
-
withContext(t, e) {
|
|
747
|
-
this.context |= t;
|
|
748
|
-
let s = e();
|
|
749
|
-
return this.context ^= t, s;
|
|
750
|
-
}
|
|
751
|
-
consumeOptionalCharacter(t) {
|
|
752
|
-
return this.next.isCharacter(t) ? (this.advance(), !0) : !1;
|
|
753
|
-
}
|
|
754
|
-
peekKeywordLet() {
|
|
755
|
-
return this.next.isKeywordLet();
|
|
756
|
-
}
|
|
757
|
-
peekKeywordAs() {
|
|
758
|
-
return this.next.isKeywordAs();
|
|
759
|
-
}
|
|
760
|
-
expectCharacter(t) {
|
|
761
|
-
this.consumeOptionalCharacter(t) || this.error(`Missing expected ${String.fromCharCode(t)}`);
|
|
762
|
-
}
|
|
763
|
-
consumeOptionalOperator(t) {
|
|
764
|
-
return this.next.isOperator(t) ? (this.advance(), !0) : !1;
|
|
765
|
-
}
|
|
766
|
-
expectOperator(t) {
|
|
767
|
-
this.consumeOptionalOperator(t) || this.error(`Missing expected operator ${t}`);
|
|
768
|
-
}
|
|
769
|
-
prettyPrintToken(t) {
|
|
770
|
-
return t === Y ? "end of input" : `token ${t}`;
|
|
771
|
-
}
|
|
772
|
-
expectIdentifierOrKeyword() {
|
|
773
|
-
let t = this.next;
|
|
774
|
-
return !t.isIdentifier() && !t.isKeyword() ? (t.isPrivateIdentifier() ? this._reportErrorForPrivateIdentifier(t, "expected identifier or keyword") : this.error(`Unexpected ${this.prettyPrintToken(t)}, expected identifier or keyword`), null) : (this.advance(), t.toString());
|
|
775
|
-
}
|
|
776
|
-
expectIdentifierOrKeywordOrString() {
|
|
777
|
-
let t = this.next;
|
|
778
|
-
return !t.isIdentifier() && !t.isKeyword() && !t.isString() ? (t.isPrivateIdentifier() ? this._reportErrorForPrivateIdentifier(t, "expected identifier, keyword or string") : this.error(`Unexpected ${this.prettyPrintToken(t)}, expected identifier, keyword, or string`), "") : (this.advance(), t.toString());
|
|
779
|
-
}
|
|
780
|
-
parseChain() {
|
|
781
|
-
let t = [], e = this.inputIndex;
|
|
782
|
-
for (; this.index < this.tokens.length; ) {
|
|
783
|
-
let s = this.parsePipe();
|
|
784
|
-
if (t.push(s), this.consumeOptionalCharacter(59)) for (this.parseFlags & 1 || this.error("Binding expression cannot contain chained expression"); this.consumeOptionalCharacter(59); ) ;
|
|
785
|
-
else if (this.index < this.tokens.length) {
|
|
786
|
-
let i = this.index;
|
|
787
|
-
if (this.error(`Unexpected token '${this.next}'`), this.index === i) break;
|
|
788
|
-
}
|
|
789
|
-
}
|
|
790
|
-
if (t.length === 0) {
|
|
791
|
-
let s = this.offset, i = this.offset + this.input.length;
|
|
792
|
-
return new P(this.span(s, i), this.sourceSpan(s, i));
|
|
793
|
-
}
|
|
794
|
-
return t.length == 1 ? t[0] : new $t(this.span(e), this.sourceSpan(e), t);
|
|
795
|
-
}
|
|
796
|
-
parsePipe() {
|
|
797
|
-
let t = this.inputIndex, e = this.parseExpression();
|
|
798
|
-
if (this.consumeOptionalOperator("|")) {
|
|
799
|
-
this.parseFlags & 1 && this.error("Cannot have a pipe in an action expression");
|
|
800
|
-
do {
|
|
801
|
-
let s = this.inputIndex, i = this.expectIdentifierOrKeyword(), r, n;
|
|
802
|
-
i !== null ? r = this.sourceSpan(s) : (i = "", n = this.next.index !== -1 ? this.next.index : this.input.length + this.offset, r = new V(n, n).toAbsolute(this.absoluteOffset));
|
|
803
|
-
let a = [];
|
|
804
|
-
for (; this.consumeOptionalCharacter(58); ) a.push(this.parseExpression());
|
|
805
|
-
e = new Rt(this.span(t), this.sourceSpan(t, n), e, i, a, r);
|
|
806
|
-
} while (this.consumeOptionalOperator("|"));
|
|
807
|
-
}
|
|
808
|
-
return e;
|
|
809
|
-
}
|
|
810
|
-
parseExpression() {
|
|
811
|
-
return this.parseConditional();
|
|
812
|
-
}
|
|
813
|
-
parseConditional() {
|
|
814
|
-
let t = this.inputIndex, e = this.parseLogicalOr();
|
|
815
|
-
if (this.consumeOptionalOperator("?")) {
|
|
816
|
-
let s = this.parsePipe(), i;
|
|
817
|
-
if (this.consumeOptionalCharacter(58)) i = this.parsePipe();
|
|
818
|
-
else {
|
|
819
|
-
let r = this.inputIndex, n = this.input.substring(t, r);
|
|
820
|
-
this.error(`Conditional expression ${n} requires all 3 expressions`), i = new P(this.span(t), this.sourceSpan(t));
|
|
821
|
-
}
|
|
822
|
-
return new Mt(this.span(t), this.sourceSpan(t), e, s, i);
|
|
823
|
-
} else return e;
|
|
824
|
-
}
|
|
825
|
-
parseLogicalOr() {
|
|
826
|
-
let t = this.inputIndex, e = this.parseLogicalAnd();
|
|
827
|
-
for (; this.consumeOptionalOperator("||"); ) {
|
|
828
|
-
let s = this.parseLogicalAnd();
|
|
829
|
-
e = new E(this.span(t), this.sourceSpan(t), "||", e, s);
|
|
830
|
-
}
|
|
831
|
-
return e;
|
|
832
|
-
}
|
|
833
|
-
parseLogicalAnd() {
|
|
834
|
-
let t = this.inputIndex, e = this.parseNullishCoalescing();
|
|
835
|
-
for (; this.consumeOptionalOperator("&&"); ) {
|
|
836
|
-
let s = this.parseNullishCoalescing();
|
|
837
|
-
e = new E(this.span(t), this.sourceSpan(t), "&&", e, s);
|
|
838
|
-
}
|
|
839
|
-
return e;
|
|
840
|
-
}
|
|
841
|
-
parseNullishCoalescing() {
|
|
842
|
-
let t = this.inputIndex, e = this.parseEquality();
|
|
843
|
-
for (; this.consumeOptionalOperator("??"); ) {
|
|
844
|
-
let s = this.parseEquality();
|
|
845
|
-
e = new E(this.span(t), this.sourceSpan(t), "??", e, s);
|
|
846
|
-
}
|
|
847
|
-
return e;
|
|
848
|
-
}
|
|
849
|
-
parseEquality() {
|
|
850
|
-
let t = this.inputIndex, e = this.parseRelational();
|
|
851
|
-
for (; this.next.type == p.Operator; ) {
|
|
852
|
-
let s = this.next.strValue;
|
|
853
|
-
switch (s) {
|
|
854
|
-
case "==":
|
|
855
|
-
case "===":
|
|
856
|
-
case "!=":
|
|
857
|
-
case "!==":
|
|
858
|
-
this.advance();
|
|
859
|
-
let i = this.parseRelational();
|
|
860
|
-
e = new E(this.span(t), this.sourceSpan(t), s, e, i);
|
|
861
|
-
continue;
|
|
862
|
-
}
|
|
863
|
-
break;
|
|
864
|
-
}
|
|
865
|
-
return e;
|
|
866
|
-
}
|
|
867
|
-
parseRelational() {
|
|
868
|
-
let t = this.inputIndex, e = this.parseAdditive();
|
|
869
|
-
for (; this.next.type == p.Operator; ) {
|
|
870
|
-
let s = this.next.strValue;
|
|
871
|
-
switch (s) {
|
|
872
|
-
case "<":
|
|
873
|
-
case ">":
|
|
874
|
-
case "<=":
|
|
875
|
-
case ">=":
|
|
876
|
-
this.advance();
|
|
877
|
-
let i = this.parseAdditive();
|
|
878
|
-
e = new E(this.span(t), this.sourceSpan(t), s, e, i);
|
|
879
|
-
continue;
|
|
880
|
-
}
|
|
881
|
-
break;
|
|
882
|
-
}
|
|
883
|
-
return e;
|
|
884
|
-
}
|
|
885
|
-
parseAdditive() {
|
|
886
|
-
let t = this.inputIndex, e = this.parseMultiplicative();
|
|
887
|
-
for (; this.next.type == p.Operator; ) {
|
|
888
|
-
let s = this.next.strValue;
|
|
889
|
-
switch (s) {
|
|
890
|
-
case "+":
|
|
891
|
-
case "-":
|
|
892
|
-
this.advance();
|
|
893
|
-
let i = this.parseMultiplicative();
|
|
894
|
-
e = new E(this.span(t), this.sourceSpan(t), s, e, i);
|
|
895
|
-
continue;
|
|
896
|
-
}
|
|
897
|
-
break;
|
|
898
|
-
}
|
|
899
|
-
return e;
|
|
900
|
-
}
|
|
901
|
-
parseMultiplicative() {
|
|
902
|
-
let t = this.inputIndex, e = this.parsePrefix();
|
|
903
|
-
for (; this.next.type == p.Operator; ) {
|
|
904
|
-
let s = this.next.strValue;
|
|
905
|
-
switch (s) {
|
|
906
|
-
case "*":
|
|
907
|
-
case "%":
|
|
908
|
-
case "/":
|
|
909
|
-
this.advance();
|
|
910
|
-
let i = this.parsePrefix();
|
|
911
|
-
e = new E(this.span(t), this.sourceSpan(t), s, e, i);
|
|
912
|
-
continue;
|
|
913
|
-
}
|
|
914
|
-
break;
|
|
915
|
-
}
|
|
916
|
-
return e;
|
|
917
|
-
}
|
|
918
|
-
parsePrefix() {
|
|
919
|
-
if (this.next.type == p.Operator) {
|
|
920
|
-
let t = this.inputIndex, e = this.next.strValue, s;
|
|
921
|
-
switch (e) {
|
|
922
|
-
case "+":
|
|
923
|
-
return this.advance(), s = this.parsePrefix(), nt.createPlus(this.span(t), this.sourceSpan(t), s);
|
|
924
|
-
case "-":
|
|
925
|
-
return this.advance(), s = this.parsePrefix(), nt.createMinus(this.span(t), this.sourceSpan(t), s);
|
|
926
|
-
case "!":
|
|
927
|
-
return this.advance(), s = this.parsePrefix(), new jt(this.span(t), this.sourceSpan(t), s);
|
|
928
|
-
}
|
|
929
|
-
}
|
|
930
|
-
return this.parseCallChain();
|
|
931
|
-
}
|
|
932
|
-
parseCallChain() {
|
|
933
|
-
let t = this.inputIndex, e = this.parsePrimary();
|
|
934
|
-
for (; ; ) if (this.consumeOptionalCharacter(46)) e = this.parseAccessMember(e, t, !1);
|
|
935
|
-
else if (this.consumeOptionalOperator("?.")) this.consumeOptionalCharacter(40) ? e = this.parseCall(e, t, !0) : e = this.consumeOptionalCharacter(91) ? this.parseKeyedReadOrWrite(e, t, !0) : this.parseAccessMember(e, t, !0);
|
|
936
|
-
else if (this.consumeOptionalCharacter(91)) e = this.parseKeyedReadOrWrite(e, t, !1);
|
|
937
|
-
else if (this.consumeOptionalCharacter(40)) e = this.parseCall(e, t, !1);
|
|
938
|
-
else if (this.consumeOptionalOperator("!")) e = new qt(this.span(t), this.sourceSpan(t), e);
|
|
939
|
-
else return e;
|
|
940
|
-
}
|
|
941
|
-
parsePrimary() {
|
|
942
|
-
let t = this.inputIndex;
|
|
943
|
-
if (this.consumeOptionalCharacter(40)) {
|
|
944
|
-
this.rparensExpected++;
|
|
945
|
-
let e = this.parsePipe();
|
|
946
|
-
return this.rparensExpected--, this.expectCharacter(41), e;
|
|
947
|
-
} else {
|
|
948
|
-
if (this.next.isKeywordNull()) return this.advance(), new O(this.span(t), this.sourceSpan(t), null);
|
|
949
|
-
if (this.next.isKeywordUndefined()) return this.advance(), new O(this.span(t), this.sourceSpan(t), void 0);
|
|
950
|
-
if (this.next.isKeywordTrue()) return this.advance(), new O(this.span(t), this.sourceSpan(t), !0);
|
|
951
|
-
if (this.next.isKeywordFalse()) return this.advance(), new O(this.span(t), this.sourceSpan(t), !1);
|
|
952
|
-
if (this.next.isKeywordThis()) return this.advance(), new he(this.span(t), this.sourceSpan(t));
|
|
953
|
-
if (this.consumeOptionalCharacter(91)) {
|
|
954
|
-
this.rbracketsExpected++;
|
|
955
|
-
let e = this.parseExpressionList(93);
|
|
956
|
-
return this.rbracketsExpected--, this.expectCharacter(93), new Gt(this.span(t), this.sourceSpan(t), e);
|
|
957
|
-
} else {
|
|
958
|
-
if (this.next.isCharacter(123)) return this.parseLiteralMap();
|
|
959
|
-
if (this.next.isIdentifier()) return this.parseAccessMember(new z(this.span(t), this.sourceSpan(t)), t, !1);
|
|
960
|
-
if (this.next.isNumber()) {
|
|
961
|
-
let e = this.next.toNumber();
|
|
962
|
-
return this.advance(), new O(this.span(t), this.sourceSpan(t), e);
|
|
963
|
-
} else if (this.next.isString()) {
|
|
964
|
-
let e = this.next.toString();
|
|
965
|
-
return this.advance(), new O(this.span(t), this.sourceSpan(t), e);
|
|
966
|
-
} else return this.next.isPrivateIdentifier() ? (this._reportErrorForPrivateIdentifier(this.next, null), new P(this.span(t), this.sourceSpan(t))) : this.index >= this.tokens.length ? (this.error(`Unexpected end of expression: ${this.input}`), new P(this.span(t), this.sourceSpan(t))) : (this.error(`Unexpected token ${this.next}`), new P(this.span(t), this.sourceSpan(t)));
|
|
967
|
-
}
|
|
968
|
-
}
|
|
969
|
-
}
|
|
970
|
-
parseExpressionList(t) {
|
|
971
|
-
let e = [];
|
|
972
|
-
do
|
|
973
|
-
if (!this.next.isCharacter(t)) e.push(this.parsePipe());
|
|
974
|
-
else break;
|
|
975
|
-
while (this.consumeOptionalCharacter(44));
|
|
976
|
-
return e;
|
|
977
|
-
}
|
|
978
|
-
parseLiteralMap() {
|
|
979
|
-
let t = [], e = [], s = this.inputIndex;
|
|
980
|
-
if (this.expectCharacter(123), !this.consumeOptionalCharacter(125)) {
|
|
981
|
-
this.rbracesExpected++;
|
|
982
|
-
do {
|
|
983
|
-
let i = this.inputIndex, r = this.next.isString(), n = this.expectIdentifierOrKeywordOrString(), a = { key: n, quoted: r };
|
|
984
|
-
if (t.push(a), r) this.expectCharacter(58), e.push(this.parsePipe());
|
|
985
|
-
else if (this.consumeOptionalCharacter(58)) e.push(this.parsePipe());
|
|
986
|
-
else {
|
|
987
|
-
a.isShorthandInitialized = !0;
|
|
988
|
-
let l = this.span(i), c = this.sourceSpan(i);
|
|
989
|
-
e.push(new st(l, c, c, new z(l, c), n));
|
|
990
|
-
}
|
|
991
|
-
} while (this.consumeOptionalCharacter(44) && !this.next.isCharacter(125));
|
|
992
|
-
this.rbracesExpected--, this.expectCharacter(125);
|
|
993
|
-
}
|
|
994
|
-
return new Vt(this.span(s), this.sourceSpan(s), t, e);
|
|
995
|
-
}
|
|
996
|
-
parseAccessMember(t, e, s) {
|
|
997
|
-
let i = this.inputIndex, r = this.withContext($.Writable, () => {
|
|
998
|
-
let l = this.expectIdentifierOrKeyword() ?? "";
|
|
999
|
-
return l.length === 0 && this.error("Expected identifier for property access", t.span.end), l;
|
|
1000
|
-
}), n = this.sourceSpan(i), a;
|
|
1001
|
-
if (s) this.consumeOptionalOperator("=") ? (this.error("The '?.' operator cannot be used in the assignment"), a = new P(this.span(e), this.sourceSpan(e))) : a = new it(this.span(e), this.sourceSpan(e), n, t, r);
|
|
1002
|
-
else if (this.consumeOptionalOperator("=")) {
|
|
1003
|
-
if (!(this.parseFlags & 1)) return this.error("Bindings cannot contain assignments"), new P(this.span(e), this.sourceSpan(e));
|
|
1004
|
-
let l = this.parseConditional();
|
|
1005
|
-
a = new Bt(this.span(e), this.sourceSpan(e), n, t, r, l);
|
|
1006
|
-
} else a = new st(this.span(e), this.sourceSpan(e), n, t, r);
|
|
1007
|
-
return a;
|
|
1008
|
-
}
|
|
1009
|
-
parseCall(t, e, s) {
|
|
1010
|
-
let i = this.inputIndex;
|
|
1011
|
-
this.rparensExpected++;
|
|
1012
|
-
let r = this.parseCallArguments(), n = this.span(i, this.inputIndex).toAbsolute(this.absoluteOffset);
|
|
1013
|
-
this.expectCharacter(41), this.rparensExpected--;
|
|
1014
|
-
let a = this.span(e), l = this.sourceSpan(e);
|
|
1015
|
-
return s ? new ht(a, l, t, r, n) : new zt(a, l, t, r, n);
|
|
1016
|
-
}
|
|
1017
|
-
parseCallArguments() {
|
|
1018
|
-
if (this.next.isCharacter(41)) return [];
|
|
1019
|
-
let t = [];
|
|
1020
|
-
do
|
|
1021
|
-
t.push(this.parsePipe());
|
|
1022
|
-
while (this.consumeOptionalCharacter(44));
|
|
1023
|
-
return t;
|
|
1024
|
-
}
|
|
1025
|
-
expectTemplateBindingKey() {
|
|
1026
|
-
let t = "", e = !1, s = this.currentAbsoluteOffset;
|
|
1027
|
-
do
|
|
1028
|
-
t += this.expectIdentifierOrKeywordOrString(), e = this.consumeOptionalOperator("-"), e && (t += "-");
|
|
1029
|
-
while (e);
|
|
1030
|
-
return { source: t, span: new T(s, s + t.length) };
|
|
1031
|
-
}
|
|
1032
|
-
parseTemplateBindings(t) {
|
|
1033
|
-
let e = [];
|
|
1034
|
-
for (e.push(...this.parseDirectiveKeywordBindings(t)); this.index < this.tokens.length; ) {
|
|
1035
|
-
let s = this.parseLetBinding();
|
|
1036
|
-
if (s) e.push(s);
|
|
1037
|
-
else {
|
|
1038
|
-
let i = this.expectTemplateBindingKey(), r = this.parseAsBinding(i);
|
|
1039
|
-
r ? e.push(r) : (i.source = t.source + i.source.charAt(0).toUpperCase() + i.source.substring(1), e.push(...this.parseDirectiveKeywordBindings(i)));
|
|
1040
|
-
}
|
|
1041
|
-
this.consumeStatementTerminator();
|
|
1042
|
-
}
|
|
1043
|
-
return new be(e, [], this.errors);
|
|
1044
|
-
}
|
|
1045
|
-
parseKeyedReadOrWrite(t, e, s) {
|
|
1046
|
-
return this.withContext($.Writable, () => {
|
|
1047
|
-
this.rbracketsExpected++;
|
|
1048
|
-
let i = this.parsePipe();
|
|
1049
|
-
if (i instanceof P && this.error("Key access cannot be empty"), this.rbracketsExpected--, this.expectCharacter(93), this.consumeOptionalOperator("=")) if (s) this.error("The '?.' operator cannot be used in the assignment");
|
|
1050
|
-
else {
|
|
1051
|
-
let r = this.parseConditional();
|
|
1052
|
-
return new Ut(this.span(e), this.sourceSpan(e), t, i, r);
|
|
1053
|
-
}
|
|
1054
|
-
else return s ? new rt(this.span(e), this.sourceSpan(e), t, i) : new Wt(this.span(e), this.sourceSpan(e), t, i);
|
|
1055
|
-
return new P(this.span(e), this.sourceSpan(e));
|
|
1056
|
-
});
|
|
1057
|
-
}
|
|
1058
|
-
parseDirectiveKeywordBindings(t) {
|
|
1059
|
-
let e = [];
|
|
1060
|
-
this.consumeOptionalCharacter(58);
|
|
1061
|
-
let s = this.getDirectiveBoundTarget(), i = this.currentAbsoluteOffset, r = this.parseAsBinding(t);
|
|
1062
|
-
r || (this.consumeStatementTerminator(), i = this.currentAbsoluteOffset);
|
|
1063
|
-
let n = new T(t.span.start, i);
|
|
1064
|
-
return e.push(new Dt(n, t, s)), r && e.push(r), e;
|
|
1065
|
-
}
|
|
1066
|
-
getDirectiveBoundTarget() {
|
|
1067
|
-
if (this.next === Y || this.peekKeywordAs() || this.peekKeywordLet()) return null;
|
|
1068
|
-
let t = this.parsePipe(), { start: e, end: s } = t.span, i = this.input.substring(e, s);
|
|
1069
|
-
return new L(t, i, this.location, this.absoluteOffset + e, this.errors);
|
|
1070
|
-
}
|
|
1071
|
-
parseAsBinding(t) {
|
|
1072
|
-
if (!this.peekKeywordAs()) return null;
|
|
1073
|
-
this.advance();
|
|
1074
|
-
let e = this.expectTemplateBindingKey();
|
|
1075
|
-
this.consumeStatementTerminator();
|
|
1076
|
-
let s = new T(t.span.start, this.currentAbsoluteOffset);
|
|
1077
|
-
return new ot(s, e, t);
|
|
1078
|
-
}
|
|
1079
|
-
parseLetBinding() {
|
|
1080
|
-
if (!this.peekKeywordLet()) return null;
|
|
1081
|
-
let t = this.currentAbsoluteOffset;
|
|
1082
|
-
this.advance();
|
|
1083
|
-
let e = this.expectTemplateBindingKey(), s = null;
|
|
1084
|
-
this.consumeOptionalOperator("=") && (s = this.expectTemplateBindingKey()), this.consumeStatementTerminator();
|
|
1085
|
-
let i = new T(t, this.currentAbsoluteOffset);
|
|
1086
|
-
return new ot(i, e, s);
|
|
1087
|
-
}
|
|
1088
|
-
consumeStatementTerminator() {
|
|
1089
|
-
this.consumeOptionalCharacter(59) || this.consumeOptionalCharacter(44);
|
|
1090
|
-
}
|
|
1091
|
-
error(t, e = null) {
|
|
1092
|
-
this.errors.push(new et(t, this.input, this.locationText(e), this.location)), this.skip();
|
|
1093
|
-
}
|
|
1094
|
-
locationText(t = null) {
|
|
1095
|
-
return t == null && (t = this.index), t < this.tokens.length ? `at column ${this.tokens[t].index + 1} in` : "at the end of the expression";
|
|
1096
|
-
}
|
|
1097
|
-
_reportErrorForPrivateIdentifier(t, e) {
|
|
1098
|
-
let s = `Private identifiers are not supported. Unexpected private identifier: ${t}`;
|
|
1099
|
-
e !== null && (s += `, ${e}`), this.error(s);
|
|
1100
|
-
}
|
|
1101
|
-
skip() {
|
|
1102
|
-
let t = this.next;
|
|
1103
|
-
for (; this.index < this.tokens.length && !t.isCharacter(59) && !t.isOperator("|") && (this.rparensExpected <= 0 || !t.isCharacter(41)) && (this.rbracesExpected <= 0 || !t.isCharacter(125)) && (this.rbracketsExpected <= 0 || !t.isCharacter(93)) && (!(this.context & $.Writable) || !t.isOperator("=")); ) this.next.isError() && this.errors.push(new et(this.next.toString(), this.input, this.locationText(), this.location)), this.advance(), t = this.next;
|
|
1104
|
-
}
|
|
1105
|
-
}, Ae = class extends oe {
|
|
1106
|
-
constructor() {
|
|
1107
|
-
super(...arguments), this.errors = [];
|
|
1108
|
-
}
|
|
1109
|
-
visitPipe() {
|
|
1110
|
-
this.errors.push("pipes");
|
|
1111
|
-
}
|
|
1112
|
-
};
|
|
1113
|
-
function Ne(t) {
|
|
1114
|
-
let e = /* @__PURE__ */ new Map(), s = 0, i = 0, r = 0;
|
|
1115
|
-
for (; r < t.length; ) {
|
|
1116
|
-
let n = t[r];
|
|
1117
|
-
if (n.type === 9) {
|
|
1118
|
-
let [a, l] = n.parts;
|
|
1119
|
-
s += l.length, i += a.length;
|
|
1120
|
-
} else {
|
|
1121
|
-
let a = n.parts.reduce((l, c) => l + c.length, 0);
|
|
1122
|
-
i += a, s += a;
|
|
1123
|
-
}
|
|
1124
|
-
e.set(i, s), r++;
|
|
1125
|
-
}
|
|
1126
|
-
return e;
|
|
1127
|
-
}
|
|
1128
|
-
function kt({ start: t, end: e }, s) {
|
|
1129
|
-
let i = t, r = e;
|
|
1130
|
-
for (; r !== i && /\s/.test(s[r - 1]); ) r--;
|
|
1131
|
-
for (; i !== r && /\s/.test(s[i]); ) i++;
|
|
1132
|
-
return { start: i, end: r };
|
|
1133
|
-
}
|
|
1134
|
-
function Ke({ start: t, end: e }, s) {
|
|
1135
|
-
let i = t, r = e;
|
|
1136
|
-
for (; r !== s.length && /\s/.test(s[r]); ) r++;
|
|
1137
|
-
for (; i !== 0 && /\s/.test(s[i - 1]); ) i--;
|
|
1138
|
-
return { start: i, end: r };
|
|
1139
|
-
}
|
|
1140
|
-
function Te(t, e) {
|
|
1141
|
-
return e[t.start - 1] === "(" && e[t.end] === ")" ? { start: t.start - 1, end: t.end + 1 } : t;
|
|
1142
|
-
}
|
|
1143
|
-
function Le(t, e, s) {
|
|
1144
|
-
let i = 0, r = { start: t.start, end: t.end };
|
|
1145
|
-
for (; ; ) {
|
|
1146
|
-
let n = Ke(r, e), a = Te(n, e);
|
|
1147
|
-
if (n.start === a.start && n.end === a.end) break;
|
|
1148
|
-
r.start = a.start, r.end = a.end, i++;
|
|
1149
|
-
}
|
|
1150
|
-
return { hasParens: (s ? i - 1 : i) !== 0, outerSpan: kt(s ? { start: r.start + 1, end: r.end - 1 } : r, e), innerSpan: kt(t, e) };
|
|
1151
|
-
}
|
|
1152
|
-
function Qt(t) {
|
|
1153
|
-
return typeof t == "string" ? (e) => e === t : (e) => t.test(e);
|
|
1154
|
-
}
|
|
1155
|
-
function _e(t, e, s) {
|
|
1156
|
-
let i = Qt(e);
|
|
1157
|
-
for (let r = s; r >= 0; r--) {
|
|
1158
|
-
let n = t[r];
|
|
1159
|
-
if (i(n)) return r;
|
|
1160
|
-
}
|
|
1161
|
-
throw new Error(`Cannot find front char ${e} from index ${s} in ${JSON.stringify(t)}`);
|
|
1162
|
-
}
|
|
1163
|
-
function $e(t, e, s) {
|
|
1164
|
-
let i = Qt(e);
|
|
1165
|
-
for (let r = s; r < t.length; r++) {
|
|
1166
|
-
let n = t[r];
|
|
1167
|
-
if (i(n)) return r;
|
|
1168
|
-
}
|
|
1169
|
-
throw new Error(`Cannot find character ${e} from index ${s} in ${JSON.stringify(t)}`);
|
|
1170
|
-
}
|
|
1171
|
-
function Me(t) {
|
|
1172
|
-
return t.slice(0, 1).toLowerCase() + t.slice(1);
|
|
1173
|
-
}
|
|
1174
|
-
function lt(t) {
|
|
1175
|
-
let { start: e, end: s } = t;
|
|
1176
|
-
return { start: e, end: s, range: [e, s] };
|
|
1177
|
-
}
|
|
1178
|
-
var Be = (t) => Jt.prototype._commentStart(t);
|
|
1179
|
-
function We(t, e) {
|
|
1180
|
-
let s = e ? Be(t) : null;
|
|
1181
|
-
if (s === null) return { text: t, comments: [] };
|
|
1182
|
-
let i = { type: "CommentLine", value: t.slice(s + 2), ...lt({ start: s, end: t.length }) };
|
|
1183
|
-
return { text: t.slice(0, s), comments: [i] };
|
|
1184
|
-
}
|
|
1185
|
-
function H(t, e = !0) {
|
|
1186
|
-
return (s) => {
|
|
1187
|
-
let i = new ue(), r = new Jt(i), { text: n, comments: a } = We(s, e), l = t(n, r);
|
|
1188
|
-
if (l.errors.length !== 0) {
|
|
1189
|
-
let [{ message: c }] = l.errors;
|
|
1190
|
-
throw new SyntaxError(c.replace(/^Parser Error: | at column \d+ in [^]*$/g, ""));
|
|
1191
|
-
}
|
|
1192
|
-
return { result: l, comments: a, text: n };
|
|
1193
|
-
};
|
|
1194
|
-
}
|
|
1195
|
-
var Ue = H((t, e) => e.parseBinding(t, "", 0)), Re = H((t, e) => e.parseAction(t, "", 0)), Ge = H((t, e) => e.parseInterpolationExpression(t, "", 0)), Ve = H((t, e) => e.parseTemplateBindings("", t, "", 0, 0), !1), Fe = (t, e, s) => {
|
|
1196
|
-
if (!(t && e == null)) return Array.isArray(e) || typeof e == "string" ? e[s < 0 ? e.length + s : s] : e.at(s);
|
|
1197
|
-
}, Yt = Fe, je = class {
|
|
1198
|
-
constructor(t) {
|
|
1199
|
-
xt(this, "text");
|
|
1200
|
-
this.text = t;
|
|
1201
|
-
}
|
|
1202
|
-
getCharacterIndex(t, e) {
|
|
1203
|
-
return $e(this.text, t, e);
|
|
1204
|
-
}
|
|
1205
|
-
getCharacterLastIndex(t, e) {
|
|
1206
|
-
return _e(this.text, t, e);
|
|
1207
|
-
}
|
|
1208
|
-
transformSpan(t, { stripSpaces: e = !1, hasParentParens: s = !1 } = {}) {
|
|
1209
|
-
if (!e) return lt(t);
|
|
1210
|
-
let { outerSpan: i, innerSpan: r, hasParens: n } = Le(t, this.text, s), a = lt(r);
|
|
1211
|
-
return n && (a.extra = { parenthesized: !0, parenStart: i.start, parenEnd: i.end }), a;
|
|
1212
|
-
}
|
|
1213
|
-
createNode(t, { stripSpaces: e = !0, hasParentParens: s = !1 } = {}) {
|
|
1214
|
-
let { type: i, start: r, end: n } = t, a = { ...t, ...this.transformSpan({ start: r, end: n }, { stripSpaces: e, hasParentParens: s }) };
|
|
1215
|
-
switch (i) {
|
|
1216
|
-
case "NumericLiteral":
|
|
1217
|
-
case "StringLiteral": {
|
|
1218
|
-
let l = this.text.slice(a.start, a.end), { value: c } = a;
|
|
1219
|
-
a.extra = { ...a.extra, raw: l, rawValue: c };
|
|
1220
|
-
break;
|
|
1221
|
-
}
|
|
1222
|
-
case "ObjectProperty": {
|
|
1223
|
-
let { shorthand: l } = a;
|
|
1224
|
-
l && (a.extra = { ...a.extra, shorthand: l });
|
|
1225
|
-
break;
|
|
1226
|
-
}
|
|
1227
|
-
}
|
|
1228
|
-
return a;
|
|
1229
|
-
}
|
|
1230
|
-
}, qe = je;
|
|
1231
|
-
function ut(t) {
|
|
1232
|
-
var e;
|
|
1233
|
-
return !!((e = t.extra) != null && e.parenthesized);
|
|
1234
|
-
}
|
|
1235
|
-
function S(t) {
|
|
1236
|
-
return ut(t) ? t.extra.parenStart : t.start;
|
|
1237
|
-
}
|
|
1238
|
-
function C(t) {
|
|
1239
|
-
return ut(t) ? t.extra.parenEnd : t.end;
|
|
1240
|
-
}
|
|
1241
|
-
function Pt(t) {
|
|
1242
|
-
return (t.type === "OptionalCallExpression" || t.type === "OptionalMemberExpression") && !ut(t);
|
|
1243
|
-
}
|
|
1244
|
-
function Ot(t, e) {
|
|
1245
|
-
let { start: s, end: i } = t.sourceSpan;
|
|
1246
|
-
return s >= i || /^\s+$/.test(e.slice(s, i));
|
|
1247
|
-
}
|
|
1248
|
-
var j, R, o, u, U, x, ct, Zt = class extends qe {
|
|
1249
|
-
constructor(t, e) {
|
|
1250
|
-
super(e), B(this, o), B(this, j), B(this, R), q(this, j, t), q(this, R, e);
|
|
1251
|
-
}
|
|
1252
|
-
get node() {
|
|
1253
|
-
return h(this, o, x).call(this, I(this, j));
|
|
1254
|
-
}
|
|
1255
|
-
transformNode(t) {
|
|
1256
|
-
return h(this, o, ct).call(this, t);
|
|
1257
|
-
}
|
|
1258
|
-
};
|
|
1259
|
-
j = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap(), o = /* @__PURE__ */ new WeakSet(), u = function(t, { stripSpaces: e = !0, hasParentParens: s = !1 } = {}) {
|
|
1260
|
-
return this.createNode(t, { stripSpaces: e, hasParentParens: s });
|
|
1261
|
-
}, U = function(t, e, { computed: s, optional: i, end: r = C(e), hasParentParens: n = !1 }) {
|
|
1262
|
-
if (Ot(t, I(this, R)) || t.sourceSpan.start === e.start) return e;
|
|
1263
|
-
let a = h(this, o, x).call(this, t), l = Pt(a);
|
|
1264
|
-
return h(this, o, u).call(this, { type: i || l ? "OptionalMemberExpression" : "MemberExpression", object: a, property: e, computed: s, ...i ? { optional: !0 } : l ? { optional: !1 } : void 0, start: S(a), end: r }, { hasParentParens: n });
|
|
1265
|
-
}, x = function(t, e = !1) {
|
|
1266
|
-
return h(this, o, ct).call(this, t, e);
|
|
1267
|
-
}, ct = function(t, e = !1) {
|
|
1268
|
-
if (t instanceof Ft) {
|
|
1269
|
-
let { expressions: s } = t;
|
|
1270
|
-
if (s.length !== 1) throw new Error("Unexpected 'Interpolation'");
|
|
1271
|
-
return h(this, o, x).call(this, s[0]);
|
|
1272
|
-
}
|
|
1273
|
-
if (t instanceof nt) return h(this, o, u).call(this, { type: "UnaryExpression", prefix: !0, argument: h(this, o, x).call(this, t.expr), operator: t.operator, ...t.sourceSpan }, { hasParentParens: e });
|
|
1274
|
-
if (t instanceof E) {
|
|
1275
|
-
let { left: s, operation: i, right: r } = t, n = h(this, o, x).call(this, s), a = h(this, o, x).call(this, r), l = S(n), c = C(a), d = { left: n, right: a, start: l, end: c };
|
|
1276
|
-
return i === "&&" || i === "||" || i === "??" ? h(this, o, u).call(this, { ...d, type: "LogicalExpression", operator: i }, { hasParentParens: e }) : h(this, o, u).call(this, { ...d, type: "BinaryExpression", operator: i }, { hasParentParens: e });
|
|
1277
|
-
}
|
|
1278
|
-
if (t instanceof Rt) {
|
|
1279
|
-
let { exp: s, name: i, args: r } = t, n = h(this, o, x).call(this, s), a = S(n), l = C(n), c = this.getCharacterIndex(/\S/, this.getCharacterIndex("|", l) + 1), d = h(this, o, u).call(this, { type: "Identifier", name: i, start: c, end: c + i.length }), v = r.map((y) => h(this, o, x).call(this, y));
|
|
1280
|
-
return h(this, o, u).call(this, { type: "NGPipeExpression", left: n, right: d, arguments: v, start: a, end: C(v.length === 0 ? d : Yt(!1, v, -1)) }, { hasParentParens: e });
|
|
1281
|
-
}
|
|
1282
|
-
if (t instanceof $t) return h(this, o, u).call(this, { type: "NGChainedExpression", expressions: t.expressions.map((s) => h(this, o, x).call(this, s)), ...t.sourceSpan }, { hasParentParens: e });
|
|
1283
|
-
if (t instanceof Mt) {
|
|
1284
|
-
let { condition: s, trueExp: i, falseExp: r } = t, n = h(this, o, x).call(this, s), a = h(this, o, x).call(this, i), l = h(this, o, x).call(this, r);
|
|
1285
|
-
return h(this, o, u).call(this, { type: "ConditionalExpression", test: n, consequent: a, alternate: l, start: S(n), end: C(l) }, { hasParentParens: e });
|
|
1286
|
-
}
|
|
1287
|
-
if (t instanceof P) return h(this, o, u).call(this, { type: "NGEmptyExpression", ...t.sourceSpan }, { hasParentParens: e });
|
|
1288
|
-
if (t instanceof z) return h(this, o, u).call(this, { type: "ThisExpression", ...t.sourceSpan }, { hasParentParens: e });
|
|
1289
|
-
if (t instanceof Wt || t instanceof rt) return h(this, o, U).call(this, t.receiver, h(this, o, x).call(this, t.key), { computed: !0, optional: t instanceof rt, end: t.sourceSpan.end, hasParentParens: e });
|
|
1290
|
-
if (t instanceof Gt) return h(this, o, u).call(this, { type: "ArrayExpression", elements: t.expressions.map((s) => h(this, o, x).call(this, s)), ...t.sourceSpan }, { hasParentParens: e });
|
|
1291
|
-
if (t instanceof Vt) {
|
|
1292
|
-
let { keys: s, values: i } = t, r = i.map((a) => h(this, o, x).call(this, a)), n = s.map(({ key: a, quoted: l }, c) => {
|
|
1293
|
-
let d = r[c], v = S(d), y = C(d), k = this.getCharacterIndex(/\S/, c === 0 ? t.sourceSpan.start + 1 : this.getCharacterIndex(",", C(r[c - 1])) + 1), m = v === k ? y : this.getCharacterLastIndex(/\S/, this.getCharacterLastIndex(":", v - 1) - 1) + 1, N = { start: k, end: m }, A = l ? h(this, o, u).call(this, { type: "StringLiteral", value: a, ...N }) : h(this, o, u).call(this, { type: "Identifier", name: a, ...N }), F = A.end < A.start || k === v;
|
|
1294
|
-
return h(this, o, u).call(this, { type: "ObjectProperty", key: A, value: d, shorthand: F, computed: !1, start: S(A), end: y });
|
|
1295
|
-
});
|
|
1296
|
-
return h(this, o, u).call(this, { type: "ObjectExpression", properties: n, ...t.sourceSpan }, { hasParentParens: e });
|
|
1297
|
-
}
|
|
1298
|
-
if (t instanceof O) {
|
|
1299
|
-
let { value: s } = t;
|
|
1300
|
-
switch (typeof s) {
|
|
1301
|
-
case "boolean":
|
|
1302
|
-
return h(this, o, u).call(this, { type: "BooleanLiteral", value: s, ...t.sourceSpan }, { hasParentParens: e });
|
|
1303
|
-
case "number":
|
|
1304
|
-
return h(this, o, u).call(this, { type: "NumericLiteral", value: s, ...t.sourceSpan }, { hasParentParens: e });
|
|
1305
|
-
case "object":
|
|
1306
|
-
return h(this, o, u).call(this, { type: "NullLiteral", ...t.sourceSpan }, { hasParentParens: e });
|
|
1307
|
-
case "string":
|
|
1308
|
-
return h(this, o, u).call(this, { type: "StringLiteral", value: s, ...t.sourceSpan }, { hasParentParens: e });
|
|
1309
|
-
case "undefined":
|
|
1310
|
-
return h(this, o, u).call(this, { type: "Identifier", name: "undefined", ...t.sourceSpan }, { hasParentParens: e });
|
|
1311
|
-
default:
|
|
1312
|
-
throw new Error(`Unexpected LiteralPrimitive value type ${typeof s}`);
|
|
1313
|
-
}
|
|
1314
|
-
}
|
|
1315
|
-
if (t instanceof zt || t instanceof ht) {
|
|
1316
|
-
let s = t instanceof ht, { receiver: i, args: r } = t, n = r.length === 1 ? [h(this, o, x).call(this, r[0], !0)] : r.map((d) => h(this, o, x).call(this, d)), a = h(this, o, x).call(this, i), l = Pt(a), c = s || l ? "OptionalCallExpression" : "CallExpression";
|
|
1317
|
-
return h(this, o, u).call(this, { type: c, callee: a, arguments: n, optional: c === "OptionalCallExpression" ? s : void 0, start: S(a), end: t.sourceSpan.end }, { hasParentParens: e });
|
|
1318
|
-
}
|
|
1319
|
-
if (t instanceof qt) {
|
|
1320
|
-
let s = h(this, o, x).call(this, t.expression);
|
|
1321
|
-
return h(this, o, u).call(this, { type: "TSNonNullExpression", expression: s, start: S(s), end: t.sourceSpan.end }, { hasParentParens: e });
|
|
1322
|
-
}
|
|
1323
|
-
if (t instanceof jt) {
|
|
1324
|
-
let s = h(this, o, x).call(this, t.expression);
|
|
1325
|
-
return h(this, o, u).call(this, { type: "UnaryExpression", prefix: !0, operator: "!", argument: s, start: t.sourceSpan.start, end: C(s) }, { hasParentParens: e });
|
|
1326
|
-
}
|
|
1327
|
-
if (t instanceof st || t instanceof it) {
|
|
1328
|
-
let { receiver: s, name: i } = t, r = this.getCharacterLastIndex(/\S/, t.sourceSpan.end - 1) + 1, n = h(this, o, u).call(this, { type: "Identifier", name: i, start: r - i.length, end: r }, Ot(s, I(this, R)) ? { hasParentParens: e } : {});
|
|
1329
|
-
return h(this, o, U).call(this, s, n, { computed: !1, optional: t instanceof it, hasParentParens: e });
|
|
1330
|
-
}
|
|
1331
|
-
if (t instanceof Ut) {
|
|
1332
|
-
let s = h(this, o, x).call(this, t.key), i = h(this, o, x).call(this, t.value), r = h(this, o, U).call(this, t.receiver, s, { computed: !0, optional: !1, end: this.getCharacterIndex("]", C(s)) + 1 });
|
|
1333
|
-
return h(this, o, u).call(this, { type: "AssignmentExpression", left: r, operator: "=", right: i, start: S(r), end: C(i) }, { hasParentParens: e });
|
|
1334
|
-
}
|
|
1335
|
-
if (t instanceof Bt) {
|
|
1336
|
-
let { receiver: s, name: i, value: r } = t, n = h(this, o, x).call(this, r), a = this.getCharacterLastIndex(/\S/, this.getCharacterLastIndex("=", S(n) - 1) - 1) + 1, l = h(this, o, u).call(this, { type: "Identifier", name: i, start: a - i.length, end: a }), c = h(this, o, U).call(this, s, l, { computed: !1, optional: !1 });
|
|
1337
|
-
return h(this, o, u).call(this, { type: "AssignmentExpression", left: c, operator: "=", right: n, start: S(c), end: C(n) }, { hasParentParens: e });
|
|
1338
|
-
}
|
|
1339
|
-
throw Object.assign(new Error("Unexpected node"), { node: t });
|
|
1340
|
-
};
|
|
1341
|
-
function ze(t, e) {
|
|
1342
|
-
return new Zt(t, e).node;
|
|
1343
|
-
}
|
|
1344
|
-
function Et(t) {
|
|
1345
|
-
return t instanceof Dt;
|
|
1346
|
-
}
|
|
1347
|
-
function It(t) {
|
|
1348
|
-
return t instanceof ot;
|
|
1349
|
-
}
|
|
1350
|
-
var G, M, f, bt, w, Z, X, tt, Xt, At, te, Nt, De = class extends Zt {
|
|
1351
|
-
constructor(t, e) {
|
|
1352
|
-
super(void 0, e), B(this, f), B(this, G), B(this, M), q(this, G, t), q(this, M, e);
|
|
1353
|
-
for (let s of t) h(this, f, Xt).call(this, s);
|
|
1354
|
-
}
|
|
1355
|
-
get expressions() {
|
|
1356
|
-
return h(this, f, te).call(this);
|
|
1357
|
-
}
|
|
1358
|
-
};
|
|
1359
|
-
G = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap(), f = /* @__PURE__ */ new WeakSet(), bt = function() {
|
|
1360
|
-
return I(this, G)[0].key;
|
|
1361
|
-
}, w = function(t, { stripSpaces: e = !0 } = {}) {
|
|
1362
|
-
return this.createNode(t, { stripSpaces: e });
|
|
1363
|
-
}, Z = function(t) {
|
|
1364
|
-
return this.transformNode(t);
|
|
1365
|
-
}, X = function(t) {
|
|
1366
|
-
return Me(t.slice(I(this, f, bt).source.length));
|
|
1367
|
-
}, tt = function(t) {
|
|
1368
|
-
let e = I(this, M);
|
|
1369
|
-
if (e[t.start] !== '"' && e[t.start] !== "'") return;
|
|
1370
|
-
let s = e[t.start], i = !1;
|
|
1371
|
-
for (let r = t.start + 1; r < e.length; r++) switch (e[r]) {
|
|
1372
|
-
case s:
|
|
1373
|
-
if (!i) {
|
|
1374
|
-
t.end = r + 1;
|
|
1375
|
-
return;
|
|
1376
|
-
}
|
|
1377
|
-
default:
|
|
1378
|
-
i = !1;
|
|
1379
|
-
break;
|
|
1380
|
-
case "\\":
|
|
1381
|
-
i = !i;
|
|
1382
|
-
break;
|
|
1383
|
-
}
|
|
1384
|
-
}, Xt = function(t) {
|
|
1385
|
-
h(this, f, tt).call(this, t.key.span), It(t) && t.value && h(this, f, tt).call(this, t.value.span);
|
|
1386
|
-
}, At = function(t) {
|
|
1387
|
-
if (!t.value || t.value.source) return t.value;
|
|
1388
|
-
let e = this.getCharacterIndex(/\S/, t.sourceSpan.start);
|
|
1389
|
-
return { source: "$implicit", span: { start: e, end: e } };
|
|
1390
|
-
}, te = function() {
|
|
1391
|
-
let t = I(this, G), [e] = t, s = I(this, M).slice(e.sourceSpan.start, e.sourceSpan.end).trim().length === 0 ? t.slice(1) : t, i = [], r = null;
|
|
1392
|
-
for (let [n, a] of s.entries()) {
|
|
1393
|
-
if (r && Et(r) && It(a) && a.value && a.value.source === r.key.source) {
|
|
1394
|
-
let l = h(this, f, w).call(this, { type: "NGMicrosyntaxKey", name: a.key.source, ...a.key.span }), c = (y, k) => ({ ...y, ...this.transformSpan({ start: y.start, end: k }) }), d = (y) => ({ ...c(y, l.end), alias: l }), v = i.pop();
|
|
1395
|
-
if (v.type === "NGMicrosyntaxExpression") i.push(d(v));
|
|
1396
|
-
else if (v.type === "NGMicrosyntaxKeyedExpression") {
|
|
1397
|
-
let y = d(v.expression);
|
|
1398
|
-
i.push(c({ ...v, expression: y }, y.end));
|
|
1399
|
-
} else throw new Error(`Unexpected type ${v.type}`);
|
|
1400
|
-
} else i.push(h(this, f, Nt).call(this, a, n));
|
|
1401
|
-
r = a;
|
|
1402
|
-
}
|
|
1403
|
-
return h(this, f, w).call(this, { type: "NGMicrosyntax", body: i, ...i.length === 0 ? t[0].sourceSpan : { start: i[0].start, end: Yt(!1, i, -1).end } });
|
|
1404
|
-
}, Nt = function(t, e) {
|
|
1405
|
-
if (Et(t)) {
|
|
1406
|
-
let { key: s, value: i } = t;
|
|
1407
|
-
return i ? e === 0 ? h(this, f, w).call(this, { type: "NGMicrosyntaxExpression", expression: h(this, f, Z).call(this, i.ast), alias: null, ...i.sourceSpan }) : h(this, f, w).call(this, { type: "NGMicrosyntaxKeyedExpression", key: h(this, f, w).call(this, { type: "NGMicrosyntaxKey", name: h(this, f, X).call(this, s.source), ...s.span }), expression: h(this, f, w).call(this, { type: "NGMicrosyntaxExpression", expression: h(this, f, Z).call(this, i.ast), alias: null, ...i.sourceSpan }), start: s.span.start, end: i.sourceSpan.end }) : h(this, f, w).call(this, { type: "NGMicrosyntaxKey", name: h(this, f, X).call(this, s.source), ...s.span });
|
|
1408
|
-
} else {
|
|
1409
|
-
let { key: s, sourceSpan: i } = t;
|
|
1410
|
-
if (/^let\s$/.test(I(this, M).slice(i.start, i.start + 4))) {
|
|
1411
|
-
let { value: r } = t;
|
|
1412
|
-
return h(this, f, w).call(this, { type: "NGMicrosyntaxLet", key: h(this, f, w).call(this, { type: "NGMicrosyntaxKey", name: s.source, ...s.span }), value: r ? h(this, f, w).call(this, { type: "NGMicrosyntaxKey", name: r.source, ...r.span }) : null, start: i.start, end: r ? r.span.end : s.span.end });
|
|
1413
|
-
} else {
|
|
1414
|
-
let r = h(this, f, At).call(this, t);
|
|
1415
|
-
return h(this, f, w).call(this, { type: "NGMicrosyntaxAs", key: h(this, f, w).call(this, { type: "NGMicrosyntaxKey", name: r.source, ...r.span }), alias: h(this, f, w).call(this, { type: "NGMicrosyntaxKey", name: s.source, ...s.span }), start: r.span.start, end: s.span.end });
|
|
1416
|
-
}
|
|
1417
|
-
}
|
|
1418
|
-
};
|
|
1419
|
-
function He(t, e) {
|
|
1420
|
-
return new De(t, e).expressions;
|
|
1421
|
-
}
|
|
1422
|
-
function dt({ result: { ast: t }, text: e, comments: s }) {
|
|
1423
|
-
return Object.assign(ze(t, e), { comments: s });
|
|
1424
|
-
}
|
|
1425
|
-
function Je({ result: { templateBindings: t }, text: e }) {
|
|
1426
|
-
return He(t, e);
|
|
1427
|
-
}
|
|
1428
|
-
var Qe = (t) => dt(Ue(t)), Ye = (t) => dt(Ge(t)), ee = (t) => dt(Re(t)), Ze = (t) => Je(Ve(t));
|
|
1429
|
-
function se(t) {
|
|
1430
|
-
var e, s, i;
|
|
1431
|
-
let r = ((e = t.range) == null ? void 0 : e[0]) ?? t.start, n = (i = ((s = t.declaration) == null ? void 0 : s.decorators) ?? t.decorators) == null ? void 0 : i[0];
|
|
1432
|
-
return n ? Math.min(se(n), r) : r;
|
|
1433
|
-
}
|
|
1434
|
-
function Xe(t) {
|
|
1435
|
-
var e;
|
|
1436
|
-
return ((e = t.range) == null ? void 0 : e[1]) ?? t.end;
|
|
1437
|
-
}
|
|
1438
|
-
function J(t) {
|
|
1439
|
-
return { astFormat: "estree", parse(e) {
|
|
1440
|
-
let s = t(e);
|
|
1441
|
-
return { type: "NGRoot", node: t === ee && s.type !== "NGChainedExpression" ? { ...s, type: "NGChainedExpression", expressions: [s] } : s };
|
|
1442
|
-
}, locStart: se, locEnd: Xe };
|
|
1443
|
-
}
|
|
1444
|
-
var ts = J(ee), es = J(Qe), ss = J(Ye), is = J(Ze), ns = Lt;
|
|
1445
|
-
export {
|
|
1446
|
-
ns as default,
|
|
1447
|
-
_t as parsers
|
|
1448
|
-
};
|