@projectwallace/css-analyzer 8.0.2 → 9.0.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.
- package/dist/css-analyzer.js +1164 -1060
- package/package.json +6 -6
package/dist/css-analyzer.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var Er = Object.defineProperty;
|
|
2
|
+
var ki = (r) => {
|
|
3
3
|
throw TypeError(r);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var w = (r, e, t) => (
|
|
8
|
-
var
|
|
5
|
+
var Cr = (r, e, t) => e in r ? Er(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
6
|
+
var m = (r, e, t) => Cr(r, typeof e != "symbol" ? e + "" : e, t), wi = (r, e, t) => e.has(r) || ki("Cannot " + t);
|
|
7
|
+
var w = (r, e, t) => (wi(r, e, "read from private field"), t ? t.call(r) : e.get(r)), W = (r, e, t) => e.has(r) ? ki("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), M = (r, e, t, s) => (wi(r, e, "write to private field"), s ? s.call(r, t) : e.set(r, t), t);
|
|
8
|
+
var jt = (r, e, t, s) => ({
|
|
9
9
|
set _(i) {
|
|
10
10
|
M(r, e, i, t);
|
|
11
11
|
},
|
|
@@ -13,121 +13,143 @@ var Vt = (r, e, t, s) => ({
|
|
|
13
13
|
return w(r, e, s);
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
import { walk as
|
|
17
|
-
function
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
if (t.type === Hi) {
|
|
16
|
+
import { walk as $, SUPPORTS_QUERY as zi, BREAK as Y, MEDIA_TYPE as yr, MEDIA_FEATURE as qi, str_equals as ge, DIMENSION as mt, NUMBER as ds, IDENTIFIER as _e, SELECTOR as me, NTH_SELECTOR as br, PSEUDO_ELEMENT_SELECTOR as pt, TYPE_SELECTOR as gs, PSEUDO_CLASS_SELECTOR as Le, ATTRIBUTE_SELECTOR as xs, SKIP as H, str_starts_with as Ki, COMBINATOR as rs, SELECTOR_LIST as ms, NTH_OF_SELECTOR as Rr, CLASS_SELECTOR as vr, ID_SELECTOR as Tr, FUNCTION as ks, OPERATOR as Re, is_custom as ws, is_vendor_prefixed as As, parse as Or, AT_RULE as Sr, BLOCK as Nr, DECLARATION as Xt, LAYER_NAME as Lr, CONTAINER_QUERY as Ur, STYLE_RULE as Ir, HASH as Hr, URL as Pr } from "@projectwallace/css-parser";
|
|
17
|
+
function Dr(r, e) {
|
|
18
|
+
$(r, function(t) {
|
|
19
|
+
if (t.type === zi) {
|
|
21
20
|
const i = (t.prelude || t.value || "").toString().toLowerCase().replaceAll(/\s+/g, "");
|
|
22
|
-
if (i.includes("-webkit-appearance:none")
|
|
23
|
-
return e
|
|
21
|
+
if (i.includes("-webkit-appearance:none"))
|
|
22
|
+
return e("-webkit-appearance: none"), Y;
|
|
23
|
+
if (i.includes("-moz-appearance:meterbar"))
|
|
24
|
+
return e("-moz-appearance: meterbar"), Y;
|
|
24
25
|
}
|
|
25
|
-
})
|
|
26
|
+
});
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (t.type === cr) {
|
|
28
|
+
function Fr(r, e) {
|
|
29
|
+
$(r, function(t) {
|
|
30
|
+
if (t.type === yr) {
|
|
31
31
|
const s = t.text || "";
|
|
32
|
-
if (s.startsWith("\\0")
|
|
33
|
-
return e
|
|
32
|
+
if (s.startsWith("\\0"))
|
|
33
|
+
return e("\\0"), Y;
|
|
34
|
+
if (s.includes("\\9"))
|
|
35
|
+
return e("\\9"), Y;
|
|
34
36
|
}
|
|
35
|
-
if (t.type ===
|
|
37
|
+
if (t.type === qi) {
|
|
36
38
|
const s = t.name || "";
|
|
37
|
-
if (
|
|
38
|
-
return e
|
|
39
|
-
if (
|
|
39
|
+
if (ge("-moz-images-in-menus", s))
|
|
40
|
+
return e("-moz-images-in-menus"), Y;
|
|
41
|
+
if (ge("min--moz-device-pixel-ratio", s))
|
|
42
|
+
return e("min--moz-device-pixel-ratio"), Y;
|
|
43
|
+
if (ge("-ms-high-contrast", s))
|
|
44
|
+
return e("-ms-high-contrast"), Y;
|
|
45
|
+
if (ge("min-resolution", s) && t.has_children) {
|
|
40
46
|
for (const i of t)
|
|
41
|
-
if (i.type ===
|
|
42
|
-
return e
|
|
47
|
+
if (i.type === mt && i.value === 1e-3 && ge("dpcm", i.unit || ""))
|
|
48
|
+
return e("min-resolution: .001dpcm"), Y;
|
|
43
49
|
}
|
|
44
|
-
if (
|
|
50
|
+
if (ge("-webkit-min-device-pixel-ratio", s) && t.has_children) {
|
|
45
51
|
for (const i of t)
|
|
46
|
-
if (i.type ===
|
|
47
|
-
return e
|
|
52
|
+
if (i.type === ds && (i.value === 0 || i.value === 1e4))
|
|
53
|
+
return e("-webkit-min-device-pixel-ratio"), Y;
|
|
48
54
|
}
|
|
49
55
|
if (t.has_children) {
|
|
50
56
|
for (const i of t)
|
|
51
|
-
if (i.type ===
|
|
52
|
-
return e
|
|
57
|
+
if (i.type === _e && i.text === "\\0")
|
|
58
|
+
return e("\\0"), Y;
|
|
53
59
|
}
|
|
54
60
|
}
|
|
55
|
-
})
|
|
61
|
+
});
|
|
56
62
|
}
|
|
57
|
-
class
|
|
63
|
+
class B {
|
|
58
64
|
constructor(e) {
|
|
59
|
-
|
|
65
|
+
m(this, "set");
|
|
60
66
|
this.set = new Set(e);
|
|
61
67
|
}
|
|
62
68
|
has(e) {
|
|
63
69
|
return this.set.has(e.toLowerCase());
|
|
64
70
|
}
|
|
65
71
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
let e = !1;
|
|
69
|
-
return B(r, function(t) {
|
|
70
|
-
if ((t.type === us || t.type === Oe || t.type === fs) && t.is_vendor_prefixed)
|
|
71
|
-
return e = !0, Q;
|
|
72
|
-
}), e;
|
|
72
|
+
function $i(r) {
|
|
73
|
+
return r.replaceAll(/(?:^['"])|(?:['"]$)/g, "");
|
|
73
74
|
}
|
|
74
|
-
function
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
75
|
+
function Mr(r, e) {
|
|
76
|
+
return e >= 65 && e <= 90 && (e = e | 32), r === e;
|
|
77
|
+
}
|
|
78
|
+
function ns(r, e) {
|
|
79
|
+
if (r === e) return !0;
|
|
80
|
+
let t = e.length, s = t - r.length;
|
|
81
|
+
if (s < 0)
|
|
82
|
+
return !1;
|
|
83
|
+
for (let i = t - 1; i >= s; i--)
|
|
84
|
+
if (Mr(r.charCodeAt(i - s), e.charCodeAt(i)) === !1)
|
|
85
|
+
return !1;
|
|
86
|
+
return !0;
|
|
87
|
+
}
|
|
88
|
+
const zr = new B(["nth-child", "where", "not", "is", "has", "nth-last-child", "matches", "-webkit-any", "-moz-any"]);
|
|
89
|
+
function qr(r, e) {
|
|
90
|
+
$(r, function(t) {
|
|
91
|
+
if ((t.type === pt || t.type === Le || t.type === gs) && t.is_vendor_prefixed) {
|
|
92
|
+
let s = "";
|
|
93
|
+
t.type === Le ? s = ":" : t.type === pt && (s = "::"), e(s + (t.name || t.text));
|
|
85
94
|
}
|
|
86
|
-
})
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
function Kr(r, e) {
|
|
98
|
+
function t(s) {
|
|
99
|
+
var n, l;
|
|
100
|
+
let i = s.clone();
|
|
101
|
+
return i.value ? "[" + ((n = i.name) == null ? void 0 : n.toLowerCase()) + i.attr_operator + '"' + $i(i.value.toString()) + '"]' : "[" + ((l = i.name) == null ? void 0 : l.toLowerCase()) + "]";
|
|
102
|
+
}
|
|
103
|
+
$(r, function(s) {
|
|
104
|
+
if (s.type === xs) {
|
|
105
|
+
const i = s.name || "";
|
|
106
|
+
(ge("role", i) || Ki(i, "aria-")) && e(t(s));
|
|
107
|
+
}
|
|
108
|
+
});
|
|
87
109
|
}
|
|
88
|
-
function
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}), e.length === 0 ? !1 : e;
|
|
110
|
+
function $r(r, e) {
|
|
111
|
+
$(r, function(t) {
|
|
112
|
+
t.type === Le && t.name && e(t.name);
|
|
113
|
+
});
|
|
93
114
|
}
|
|
94
|
-
function
|
|
115
|
+
function ls(r) {
|
|
95
116
|
let e = 0;
|
|
96
117
|
function t(s, i) {
|
|
97
|
-
|
|
98
|
-
n.type ===
|
|
118
|
+
$(s, function(n) {
|
|
119
|
+
n.type === me && i.push(ls(n));
|
|
99
120
|
});
|
|
100
121
|
}
|
|
101
|
-
return
|
|
122
|
+
return $(r, function(s) {
|
|
102
123
|
const i = s.type;
|
|
103
|
-
if (i !==
|
|
104
|
-
if (i ===
|
|
124
|
+
if (i !== me) {
|
|
125
|
+
if (i === br) {
|
|
105
126
|
s.text && s.text.trim() && e++;
|
|
106
127
|
return;
|
|
107
128
|
}
|
|
108
|
-
if (e++, (i ===
|
|
109
|
-
return s.value && e++,
|
|
110
|
-
if (i ===
|
|
129
|
+
if (e++, (i === pt || i === gs || i === Le) && s.is_vendor_prefixed && e++, i === xs)
|
|
130
|
+
return s.value && e++, H;
|
|
131
|
+
if (i === Le) {
|
|
111
132
|
const n = s.name || "";
|
|
112
|
-
if (
|
|
133
|
+
if (zr.has(n.toLowerCase())) {
|
|
113
134
|
const l = [];
|
|
114
135
|
if (s.has_children)
|
|
115
|
-
for (const
|
|
116
|
-
|
|
136
|
+
for (const a of s)
|
|
137
|
+
a.type === me ? l.push(ls(a)) : t(a, l);
|
|
117
138
|
if (l.length > 0) {
|
|
118
|
-
for (const
|
|
119
|
-
e +=
|
|
120
|
-
return
|
|
139
|
+
for (const a of l)
|
|
140
|
+
e += a;
|
|
141
|
+
return H;
|
|
121
142
|
}
|
|
122
143
|
}
|
|
123
144
|
}
|
|
124
145
|
}
|
|
125
146
|
}), e;
|
|
126
147
|
}
|
|
127
|
-
function
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
148
|
+
function Br(r, e) {
|
|
149
|
+
$(r, function(t) {
|
|
150
|
+
var s;
|
|
151
|
+
t.type === rs && e({
|
|
152
|
+
name: ((s = t.name) == null ? void 0 : s.trim()) === "" ? " " : t.name,
|
|
131
153
|
loc: {
|
|
132
154
|
offset: t.start,
|
|
133
155
|
line: t.line,
|
|
@@ -137,221 +159,221 @@ function Tr(r, e) {
|
|
|
137
159
|
});
|
|
138
160
|
});
|
|
139
161
|
}
|
|
140
|
-
let
|
|
162
|
+
let Es = 1, q = 2, kt = 4, ve = 8, ke = 16, C = new Uint8Array(128);
|
|
141
163
|
for (let r = 48; r <= 57; r++)
|
|
142
|
-
|
|
164
|
+
C[r] = q;
|
|
143
165
|
for (let r = 48; r <= 57; r++)
|
|
144
|
-
|
|
166
|
+
C[r] |= kt;
|
|
145
167
|
for (let r = 65; r <= 70; r++)
|
|
146
|
-
|
|
168
|
+
C[r] = kt;
|
|
147
169
|
for (let r = 97; r <= 102; r++)
|
|
148
|
-
|
|
170
|
+
C[r] = kt;
|
|
149
171
|
for (let r = 65; r <= 90; r++)
|
|
150
|
-
|
|
172
|
+
C[r] |= Es;
|
|
151
173
|
for (let r = 97; r <= 122; r++)
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
function
|
|
159
|
-
return r < 128 && (
|
|
174
|
+
C[r] |= Es;
|
|
175
|
+
C[32] = ve;
|
|
176
|
+
C[9] = ve;
|
|
177
|
+
C[10] = ke;
|
|
178
|
+
C[13] = ke;
|
|
179
|
+
C[12] = ke;
|
|
180
|
+
function Gr(r) {
|
|
181
|
+
return r < 128 && (C[r] & q) !== 0;
|
|
160
182
|
}
|
|
161
|
-
function
|
|
162
|
-
return r < 128 && (
|
|
183
|
+
function pe(r) {
|
|
184
|
+
return r < 128 && (C[r] & kt) !== 0;
|
|
163
185
|
}
|
|
164
|
-
function
|
|
165
|
-
return r < 128 && (
|
|
186
|
+
function Wr(r) {
|
|
187
|
+
return r < 128 && (C[r] & Es) !== 0;
|
|
166
188
|
}
|
|
167
|
-
function
|
|
168
|
-
return r < 128 && (
|
|
189
|
+
function Ai(r) {
|
|
190
|
+
return r < 128 && (C[r] & ve) !== 0;
|
|
169
191
|
}
|
|
170
|
-
function
|
|
171
|
-
return r < 128 && (
|
|
192
|
+
function ne(r) {
|
|
193
|
+
return r < 128 && (C[r] & ke) !== 0;
|
|
172
194
|
}
|
|
173
|
-
function
|
|
174
|
-
return r >= 128 || r === 95 ? !0 :
|
|
195
|
+
function Ke(r) {
|
|
196
|
+
return r >= 128 || r === 95 ? !0 : Wr(r);
|
|
175
197
|
}
|
|
176
|
-
function
|
|
177
|
-
return r === 45 ? !0 :
|
|
198
|
+
function lt(r) {
|
|
199
|
+
return r === 45 ? !0 : Ke(r) || Gr(r);
|
|
178
200
|
}
|
|
179
|
-
const
|
|
180
|
-
class
|
|
201
|
+
const ae = 1, at = 2, Yr = 3, Bi = 4, Gi = 5, Ei = 6, xe = 9, ht = 10, Wi = 11, Yi = 12, os = 13, Qr = 14, Vr = 15, Qi = 16, jr = 17, $e = 18, as = 19, Vi = 20, ji = 21, Xi = 22, Xr = 23, Zr = 24, hs = 26, Ci = 27, Jr = 123, en = 125, tn = 58, sn = 59, rn = 44, nn = 91, ln = 93, yi = 40, on = 41, bi = 47, Ri = 42, an = 34, hn = 39, Zt = 46, cn = 60, _n = 33, z = 45, un = 62, fn = 64, pn = 35, Jt = 92, Me = 43, dn = 37, gn = 101, xn = 69, mn = 117, kn = 85, wn = 63, vi = 13, Ti = 10;
|
|
202
|
+
class Zi {
|
|
181
203
|
constructor(e, t) {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
204
|
+
m(this, "source");
|
|
205
|
+
m(this, "pos");
|
|
206
|
+
m(this, "line");
|
|
207
|
+
m(this, "column");
|
|
208
|
+
m(this, "on_comment");
|
|
187
209
|
// Current token properties (avoiding object allocation)
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
this.source = e, this.pos = 0, this.line = 1, this.column = 1, this.on_comment = t, this.token_type =
|
|
210
|
+
m(this, "token_type");
|
|
211
|
+
m(this, "token_start");
|
|
212
|
+
m(this, "token_end");
|
|
213
|
+
m(this, "token_line");
|
|
214
|
+
m(this, "token_column");
|
|
215
|
+
this.source = e, this.pos = 0, this.line = 1, this.column = 1, this.on_comment = t, this.token_type = hs, this.token_start = 0, this.token_end = 0, this.token_line = 1, this.token_column = 1;
|
|
194
216
|
}
|
|
195
217
|
// Fast token advancing without object allocation (for internal parser use)
|
|
196
218
|
next_token_fast(e = !1) {
|
|
197
219
|
if (e)
|
|
198
220
|
for (; this.pos < this.source.length; ) {
|
|
199
221
|
let l = this.source.charCodeAt(this.pos);
|
|
200
|
-
if (l >= 128 || (
|
|
222
|
+
if (l >= 128 || (C[l] & (ve | ke)) === 0) break;
|
|
201
223
|
this.advance();
|
|
202
224
|
}
|
|
203
225
|
if (this.pos >= this.source.length)
|
|
204
|
-
return this.make_token(
|
|
226
|
+
return this.make_token(hs, this.pos, this.pos);
|
|
205
227
|
let t = this.source.charCodeAt(this.pos), s = this.pos, i = this.line, n = this.column;
|
|
206
228
|
switch (t) {
|
|
207
|
-
case
|
|
208
|
-
return this.advance(), this.make_token(
|
|
209
|
-
case
|
|
210
|
-
return this.advance(), this.make_token(
|
|
211
|
-
case
|
|
212
|
-
return this.advance(), this.make_token(
|
|
213
|
-
case
|
|
214
|
-
return this.advance(), this.make_token(
|
|
215
|
-
case
|
|
216
|
-
return this.advance(), this.make_token(
|
|
217
|
-
case
|
|
218
|
-
return this.advance(), this.make_token(
|
|
219
|
-
case
|
|
220
|
-
return this.advance(), this.make_token(
|
|
221
|
-
case
|
|
222
|
-
return this.advance(), this.make_token(
|
|
223
|
-
case
|
|
224
|
-
return this.advance(), this.make_token(
|
|
225
|
-
}
|
|
226
|
-
if (t < 128 && (
|
|
229
|
+
case Jr:
|
|
230
|
+
return this.advance(), this.make_token(Xr, s, this.pos, i, n);
|
|
231
|
+
case en:
|
|
232
|
+
return this.advance(), this.make_token(Zr, s, this.pos, i, n);
|
|
233
|
+
case tn:
|
|
234
|
+
return this.advance(), this.make_token(Qi, s, this.pos, i, n);
|
|
235
|
+
case sn:
|
|
236
|
+
return this.advance(), this.make_token(jr, s, this.pos, i, n);
|
|
237
|
+
case rn:
|
|
238
|
+
return this.advance(), this.make_token($e, s, this.pos, i, n);
|
|
239
|
+
case nn:
|
|
240
|
+
return this.advance(), this.make_token(as, s, this.pos, i, n);
|
|
241
|
+
case ln:
|
|
242
|
+
return this.advance(), this.make_token(Vi, s, this.pos, i, n);
|
|
243
|
+
case yi:
|
|
244
|
+
return this.advance(), this.make_token(ji, s, this.pos, i, n);
|
|
245
|
+
case on:
|
|
246
|
+
return this.advance(), this.make_token(Xi, s, this.pos, i, n);
|
|
247
|
+
}
|
|
248
|
+
if (t < 128 && (C[t] & (ve | ke)) !== 0)
|
|
227
249
|
return this.consume_whitespace(i, n);
|
|
228
|
-
if (t ===
|
|
229
|
-
let l = s,
|
|
250
|
+
if (t === bi && this.peek() === Ri) {
|
|
251
|
+
let l = s, a = i, h = n;
|
|
230
252
|
for (this.advance(2); this.pos < this.source.length - 1; ) {
|
|
231
|
-
if (this.source.charCodeAt(this.pos) ===
|
|
253
|
+
if (this.source.charCodeAt(this.pos) === Ri && this.peek() === bi) {
|
|
232
254
|
this.advance(2);
|
|
233
255
|
break;
|
|
234
256
|
}
|
|
235
257
|
this.advance();
|
|
236
258
|
}
|
|
237
|
-
let
|
|
259
|
+
let o = this.pos;
|
|
238
260
|
return this.on_comment && this.on_comment({
|
|
239
261
|
start: l,
|
|
240
|
-
end:
|
|
241
|
-
length:
|
|
242
|
-
line:
|
|
262
|
+
end: o,
|
|
263
|
+
length: o - l,
|
|
264
|
+
line: a,
|
|
243
265
|
column: h
|
|
244
266
|
}), this.next_token_fast(e);
|
|
245
267
|
}
|
|
246
|
-
if (t ===
|
|
268
|
+
if (t === an || t === hn)
|
|
247
269
|
return this.consume_string(t, i, n);
|
|
248
|
-
if (t < 128 && (
|
|
270
|
+
if (t < 128 && (C[t] & q) !== 0)
|
|
249
271
|
return this.consume_number(i, n);
|
|
250
|
-
if (t ===
|
|
272
|
+
if (t === Zt) {
|
|
251
273
|
let l = this.peek();
|
|
252
|
-
if (l < 128 && (
|
|
274
|
+
if (l < 128 && (C[l] & q) !== 0)
|
|
253
275
|
return this.consume_number(i, n);
|
|
254
276
|
}
|
|
255
|
-
if (t ===
|
|
256
|
-
return this.advance(4), this.make_token(
|
|
257
|
-
if (t ===
|
|
258
|
-
return this.advance(3), this.make_token(
|
|
259
|
-
if (t ===
|
|
277
|
+
if (t === cn && this.pos + 3 < this.source.length && this.peek() === _n && this.peek(2) === z && this.peek(3) === z)
|
|
278
|
+
return this.advance(4), this.make_token(Qr, s, this.pos, i, n);
|
|
279
|
+
if (t === z && this.pos + 2 < this.source.length && this.peek() === z && this.peek(2) === un)
|
|
280
|
+
return this.advance(3), this.make_token(Vr, s, this.pos, i, n);
|
|
281
|
+
if (t === fn)
|
|
260
282
|
return this.consume_at_keyword(i, n);
|
|
261
|
-
if (t ===
|
|
283
|
+
if (t === pn)
|
|
262
284
|
return this.consume_hash(i, n);
|
|
263
|
-
if (
|
|
285
|
+
if (Ke(t))
|
|
264
286
|
return this.consume_ident_or_function(i, n);
|
|
265
|
-
if (t ===
|
|
287
|
+
if (t === z) {
|
|
266
288
|
let l = this.peek();
|
|
267
|
-
if (
|
|
289
|
+
if (Ke(l) || l === z)
|
|
268
290
|
return this.consume_ident_or_function(i, n);
|
|
269
291
|
}
|
|
270
|
-
if (t ===
|
|
292
|
+
if (t === Jt) {
|
|
271
293
|
let l = this.peek();
|
|
272
|
-
if (l !== 0 && !
|
|
294
|
+
if (l !== 0 && !ne(l))
|
|
273
295
|
return this.consume_ident_or_function(i, n);
|
|
274
296
|
}
|
|
275
|
-
if (t ===
|
|
297
|
+
if (t === z || t === Me) {
|
|
276
298
|
let l = this.peek();
|
|
277
|
-
if (l < 128 && (
|
|
299
|
+
if (l < 128 && (C[l] & q) !== 0)
|
|
278
300
|
return this.consume_number(i, n);
|
|
279
|
-
if (l ===
|
|
301
|
+
if (l === Zt) {
|
|
280
302
|
let h = this.peek(2);
|
|
281
|
-
if (h < 128 && (
|
|
303
|
+
if (h < 128 && (C[h] & q) !== 0)
|
|
282
304
|
return this.consume_number(i, n);
|
|
283
305
|
}
|
|
284
306
|
}
|
|
285
|
-
return this.advance(), this.make_token(
|
|
307
|
+
return this.advance(), this.make_token(xe, s, this.pos, i, n);
|
|
286
308
|
}
|
|
287
309
|
consume_whitespace(e, t) {
|
|
288
310
|
let s = this.pos;
|
|
289
311
|
for (; this.pos < this.source.length; ) {
|
|
290
312
|
let i = this.source.charCodeAt(this.pos);
|
|
291
|
-
if (i >= 128 || (
|
|
313
|
+
if (i >= 128 || (C[i] & (ve | ke)) === 0) break;
|
|
292
314
|
this.advance();
|
|
293
315
|
}
|
|
294
|
-
return this.make_token(
|
|
316
|
+
return this.make_token(os, s, this.pos, e, t);
|
|
295
317
|
}
|
|
296
318
|
consume_string(e, t, s) {
|
|
297
319
|
let i = this.pos;
|
|
298
320
|
for (this.advance(); this.pos < this.source.length; ) {
|
|
299
321
|
let n = this.source.charCodeAt(this.pos);
|
|
300
322
|
if (n === e)
|
|
301
|
-
return this.advance(), this.make_token(
|
|
302
|
-
if (
|
|
303
|
-
return this.make_token(
|
|
304
|
-
if (n ===
|
|
323
|
+
return this.advance(), this.make_token(Gi, i, this.pos, t, s);
|
|
324
|
+
if (ne(n))
|
|
325
|
+
return this.make_token(Ei, i, this.pos, t, s);
|
|
326
|
+
if (n === Jt) {
|
|
305
327
|
if (this.advance(), this.pos < this.source.length) {
|
|
306
328
|
let l = this.source.charCodeAt(this.pos);
|
|
307
|
-
|
|
329
|
+
pe(l) ? this.consume_hex_escape() : ne(l) ? this.advance() : this.advance();
|
|
308
330
|
}
|
|
309
331
|
continue;
|
|
310
332
|
}
|
|
311
333
|
this.advance();
|
|
312
334
|
}
|
|
313
|
-
return this.make_token(
|
|
335
|
+
return this.make_token(Ei, i, this.pos, t, s);
|
|
314
336
|
}
|
|
315
337
|
consume_hex_escape() {
|
|
316
338
|
let e = 0;
|
|
317
339
|
for (; e < 6 && this.pos < this.source.length; ) {
|
|
318
340
|
let t = this.source.charCodeAt(this.pos);
|
|
319
|
-
if (!
|
|
341
|
+
if (!pe(t)) break;
|
|
320
342
|
this.advance(), e++;
|
|
321
343
|
}
|
|
322
344
|
if (this.pos < this.source.length) {
|
|
323
345
|
let t = this.source.charCodeAt(this.pos);
|
|
324
|
-
(
|
|
346
|
+
(Ai(t) || ne(t)) && this.advance();
|
|
325
347
|
}
|
|
326
348
|
}
|
|
327
349
|
consume_number(e, t) {
|
|
328
350
|
let s = this.pos, i = this.source.charCodeAt(this.pos);
|
|
329
|
-
for ((i ===
|
|
351
|
+
for ((i === Me || i === z) && this.advance(); this.pos < this.source.length; ) {
|
|
330
352
|
let n = this.source.charCodeAt(this.pos);
|
|
331
|
-
if (n >= 128 || (
|
|
353
|
+
if (n >= 128 || (C[n] & q) === 0) break;
|
|
332
354
|
this.advance();
|
|
333
355
|
}
|
|
334
|
-
if (this.pos < this.source.length && this.source.charCodeAt(this.pos) ===
|
|
356
|
+
if (this.pos < this.source.length && this.source.charCodeAt(this.pos) === Zt && this.pos + 1 < this.source.length) {
|
|
335
357
|
let n = this.peek();
|
|
336
|
-
if (n < 128 && (
|
|
358
|
+
if (n < 128 && (C[n] & q) !== 0)
|
|
337
359
|
for (this.advance(); this.pos < this.source.length; ) {
|
|
338
360
|
let l = this.source.charCodeAt(this.pos);
|
|
339
|
-
if (l >= 128 || (
|
|
361
|
+
if (l >= 128 || (C[l] & q) === 0) break;
|
|
340
362
|
this.advance();
|
|
341
363
|
}
|
|
342
364
|
}
|
|
343
365
|
if (this.pos < this.source.length) {
|
|
344
366
|
let n = this.source.charCodeAt(this.pos);
|
|
345
|
-
if (n ===
|
|
346
|
-
let l = this.peek(),
|
|
347
|
-
if (
|
|
367
|
+
if (n === gn || n === xn) {
|
|
368
|
+
let l = this.peek(), a = l < 128 && (C[l] & q) !== 0, h = this.peek(2), o = h < 128 && (C[h] & q) !== 0;
|
|
369
|
+
if (a || (l === Me || l === z) && o) {
|
|
348
370
|
if (this.advance(), this.pos < this.source.length) {
|
|
349
|
-
let
|
|
350
|
-
(
|
|
371
|
+
let _ = this.source.charCodeAt(this.pos);
|
|
372
|
+
(_ === Me || _ === z) && this.advance();
|
|
351
373
|
}
|
|
352
374
|
for (; this.pos < this.source.length; ) {
|
|
353
|
-
let
|
|
354
|
-
if (
|
|
375
|
+
let _ = this.source.charCodeAt(this.pos);
|
|
376
|
+
if (_ >= 128 || (C[_] & q) === 0) break;
|
|
355
377
|
this.advance();
|
|
356
378
|
}
|
|
357
379
|
}
|
|
@@ -359,63 +381,97 @@ class Yi {
|
|
|
359
381
|
}
|
|
360
382
|
if (this.pos < this.source.length) {
|
|
361
383
|
let n = this.source.charCodeAt(this.pos);
|
|
362
|
-
if (n ===
|
|
363
|
-
return this.advance(), this.make_token(
|
|
364
|
-
if (
|
|
365
|
-
for (; this.pos < this.source.length &&
|
|
384
|
+
if (n === dn)
|
|
385
|
+
return this.advance(), this.make_token(Wi, s, this.pos, e, t);
|
|
386
|
+
if (Ke(n) || n === z && Ke(this.peek())) {
|
|
387
|
+
for (; this.pos < this.source.length && lt(this.source.charCodeAt(this.pos)); )
|
|
366
388
|
this.advance();
|
|
367
|
-
return this.make_token(
|
|
389
|
+
return this.make_token(Yi, s, this.pos, e, t);
|
|
368
390
|
}
|
|
369
391
|
}
|
|
370
|
-
return this.make_token(
|
|
392
|
+
return this.make_token(ht, s, this.pos, e, t);
|
|
371
393
|
}
|
|
372
394
|
consume_ident_or_function(e, t) {
|
|
373
395
|
let s = this.pos;
|
|
374
396
|
for (; this.pos < this.source.length; ) {
|
|
375
397
|
let i = this.source.charCodeAt(this.pos);
|
|
376
|
-
if (i ===
|
|
398
|
+
if (i === Jt) {
|
|
377
399
|
if (this.pos + 1 >= this.source.length) break;
|
|
378
400
|
let n = this.peek();
|
|
379
|
-
if (
|
|
380
|
-
if (this.advance(),
|
|
401
|
+
if (ne(n)) break;
|
|
402
|
+
if (this.advance(), pe(n)) {
|
|
381
403
|
this.advance();
|
|
382
|
-
for (let l = 0; l < 5 && this.pos < this.source.length &&
|
|
404
|
+
for (let l = 0; l < 5 && this.pos < this.source.length && pe(this.source.charCodeAt(this.pos)); l++)
|
|
383
405
|
this.advance();
|
|
384
406
|
if (this.pos < this.source.length) {
|
|
385
407
|
let l = this.source.charCodeAt(this.pos);
|
|
386
|
-
(
|
|
408
|
+
(Ai(l) || ne(l)) && this.advance();
|
|
387
409
|
}
|
|
388
410
|
} else
|
|
389
411
|
this.advance();
|
|
390
|
-
} else if (
|
|
412
|
+
} else if (lt(i))
|
|
391
413
|
this.advance();
|
|
392
414
|
else
|
|
393
415
|
break;
|
|
394
416
|
}
|
|
395
|
-
|
|
417
|
+
if (this.pos - s === 1) {
|
|
418
|
+
let i = this.source.charCodeAt(s);
|
|
419
|
+
if ((i === mn || i === kn) && this.pos < this.source.length && this.source.charCodeAt(this.pos) === Me)
|
|
420
|
+
return this.consume_unicode_range(s, e, t);
|
|
421
|
+
}
|
|
422
|
+
return this.pos < this.source.length && this.source.charCodeAt(this.pos) === yi ? (this.advance(), this.make_token(at, s, this.pos, e, t)) : this.make_token(ae, s, this.pos, e, t);
|
|
423
|
+
}
|
|
424
|
+
consume_unicode_range(e, t, s) {
|
|
425
|
+
this.advance();
|
|
426
|
+
let i = 0, n = !1;
|
|
427
|
+
for (; this.pos < this.source.length && i < 6; ) {
|
|
428
|
+
let l = this.source.charCodeAt(this.pos);
|
|
429
|
+
if (pe(l)) {
|
|
430
|
+
if (n)
|
|
431
|
+
break;
|
|
432
|
+
this.advance(), i++;
|
|
433
|
+
} else if (l === wn)
|
|
434
|
+
this.advance(), i++, n = !0;
|
|
435
|
+
else
|
|
436
|
+
break;
|
|
437
|
+
}
|
|
438
|
+
if (n)
|
|
439
|
+
return this.make_token(Ci, e, this.pos, t, s);
|
|
440
|
+
if (this.pos < this.source.length && this.source.charCodeAt(this.pos) === z && this.pos + 1 < this.source.length && pe(this.source.charCodeAt(this.pos + 1))) {
|
|
441
|
+
this.advance();
|
|
442
|
+
let l = 0;
|
|
443
|
+
for (; this.pos < this.source.length && l < 6; ) {
|
|
444
|
+
let a = this.source.charCodeAt(this.pos);
|
|
445
|
+
if (pe(a))
|
|
446
|
+
this.advance(), l++;
|
|
447
|
+
else
|
|
448
|
+
break;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
return this.make_token(Ci, e, this.pos, t, s);
|
|
396
452
|
}
|
|
397
453
|
consume_at_keyword(e, t) {
|
|
398
454
|
let s = this.pos;
|
|
399
|
-
for (this.advance(); this.pos < this.source.length &&
|
|
455
|
+
for (this.advance(); this.pos < this.source.length && lt(this.source.charCodeAt(this.pos)); )
|
|
400
456
|
this.advance();
|
|
401
|
-
return this.make_token(
|
|
457
|
+
return this.make_token(Yr, s, this.pos, e, t);
|
|
402
458
|
}
|
|
403
459
|
consume_hash(e, t) {
|
|
404
460
|
let s = this.pos;
|
|
405
|
-
for (this.advance(); this.pos < this.source.length &&
|
|
461
|
+
for (this.advance(); this.pos < this.source.length && lt(this.source.charCodeAt(this.pos)); )
|
|
406
462
|
this.advance();
|
|
407
|
-
return this.make_token(
|
|
463
|
+
return this.make_token(Bi, s, this.pos, e, t);
|
|
408
464
|
}
|
|
409
465
|
advance(e = 1) {
|
|
410
466
|
if (e === 1) {
|
|
411
467
|
if (this.pos >= this.source.length) return;
|
|
412
468
|
let t = this.source.charCodeAt(this.pos);
|
|
413
|
-
this.pos++,
|
|
469
|
+
this.pos++, ne(t) ? (t === vi && this.pos < this.source.length && this.source.charCodeAt(this.pos) === Ti && this.pos++, this.line++, this.column = 1) : this.column++;
|
|
414
470
|
return;
|
|
415
471
|
}
|
|
416
472
|
for (let t = 0; t < e && !(this.pos >= this.source.length); t++) {
|
|
417
473
|
let s = this.source.charCodeAt(this.pos);
|
|
418
|
-
this.pos++,
|
|
474
|
+
this.pos++, ne(s) ? (s === vi && this.pos < this.source.length && this.source.charCodeAt(this.pos) === Ti && (this.pos++, t++), this.line++, this.column = 1) : this.column++;
|
|
419
475
|
}
|
|
420
476
|
}
|
|
421
477
|
peek(e = 1) {
|
|
@@ -459,23 +515,23 @@ class Yi {
|
|
|
459
515
|
this.pos = e.pos, this.line = e.line, this.column = e.column, this.token_type = e.token_type, this.token_start = e.token_start, this.token_end = e.token_end, this.token_line = e.token_line, this.token_column = e.token_column;
|
|
460
516
|
}
|
|
461
517
|
}
|
|
462
|
-
let
|
|
463
|
-
const
|
|
518
|
+
let ot = 36;
|
|
519
|
+
const An = 1, ct = 2, Be = 3, Z = 4, Cs = 5, Ji = 6, _t = 7, er = 10, cs = 11, Ge = 12, tr = 13, En = 14, sr = 15, _s = 16, Cn = 17, ir = 18, yn = 19, wt = 20, us = 21, rr = 22, nr = 23, We = 24, Te = 25, Qe = 26, ut = 27, fs = 28, lr = 29, Ye = 30, le = 31, or = 56, bn = 32, ar = 33, Rn = 34, vn = 35, Tn = 36, On = 37, Sn = 38, Nn = 39, hr = 40, Ln = 50, Un = 1, In = 2, Oi = 4, Hn = 8, Pn = 32, cr = 64, Dn = 128, ps = 0, _r = 1, ur = 2, fr = 3, pr = 4, dr = 5, gr = 6, ye = 0, xr = 1, mr = 2, oe = class oe {
|
|
464
520
|
constructor(e = 1024) {
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
521
|
+
m(this, "buffer");
|
|
522
|
+
m(this, "view");
|
|
523
|
+
m(this, "capacity");
|
|
468
524
|
// Number of nodes that can fit
|
|
469
|
-
|
|
525
|
+
m(this, "count");
|
|
470
526
|
// Number of nodes currently allocated
|
|
471
|
-
|
|
527
|
+
m(this, "growth_count");
|
|
472
528
|
// Number of times the arena has grown
|
|
473
|
-
|
|
474
|
-
this.capacity = e, this.count = 1, this.growth_count = 0, this.buffer = new ArrayBuffer(e *
|
|
529
|
+
m(this, "overflow_lengths");
|
|
530
|
+
this.capacity = e, this.count = 1, this.growth_count = 0, this.buffer = new ArrayBuffer(e * ot), this.view = new DataView(this.buffer), this.overflow_lengths = /* @__PURE__ */ new Map();
|
|
475
531
|
}
|
|
476
532
|
// Calculate recommended initial capacity based on CSS source size
|
|
477
533
|
static capacity_for_source(e) {
|
|
478
|
-
let t = e / 1024, s = Math.ceil(t *
|
|
534
|
+
let t = e / 1024, s = Math.ceil(t * oe.NODES_PER_KB), i = Math.ceil(s * oe.CAPACITY_BUFFER);
|
|
479
535
|
return Math.max(16, i);
|
|
480
536
|
}
|
|
481
537
|
// Get the number of nodes currently in the arena
|
|
@@ -492,7 +548,7 @@ const tn = 1, lt = 2, ze = 3, pe = 4, Wi = 5, Qi = 6, ot = 7, Vi = 10, as = 11,
|
|
|
492
548
|
}
|
|
493
549
|
// Calculate byte offset for a node
|
|
494
550
|
node_offset(e) {
|
|
495
|
-
return e *
|
|
551
|
+
return e * ot;
|
|
496
552
|
}
|
|
497
553
|
// Read node type
|
|
498
554
|
get_type(e) {
|
|
@@ -508,7 +564,7 @@ const tn = 1, lt = 2, ze = 3, pe = 4, Wi = 5, Qi = 6, ot = 7, Vi = 10, as = 11,
|
|
|
508
564
|
}
|
|
509
565
|
// Read length in source
|
|
510
566
|
get_length(e) {
|
|
511
|
-
if (this.has_flag(e,
|
|
567
|
+
if (this.has_flag(e, Oi)) {
|
|
512
568
|
const t = this.overflow_lengths.get(e);
|
|
513
569
|
if (t !== void 0)
|
|
514
570
|
return t;
|
|
@@ -568,7 +624,7 @@ const tn = 1, lt = 2, ze = 3, pe = 4, Wi = 5, Qi = 6, ot = 7, Vi = 10, as = 11,
|
|
|
568
624
|
}
|
|
569
625
|
// Write length in source
|
|
570
626
|
set_length(e, t) {
|
|
571
|
-
t > 65535 ? (this.view.setUint16(this.node_offset(e) + 2, 65535, !0), this.set_flag(e,
|
|
627
|
+
t > 65535 ? (this.view.setUint16(this.node_offset(e) + 2, 65535, !0), this.set_flag(e, Oi), this.overflow_lengths.set(e, t)) : this.view.setUint16(this.node_offset(e) + 2, t, !0);
|
|
572
628
|
}
|
|
573
629
|
// Write content start delta (offset from startOffset)
|
|
574
630
|
set_content_start_delta(e, t) {
|
|
@@ -606,7 +662,7 @@ const tn = 1, lt = 2, ze = 3, pe = 4, Wi = 5, Qi = 6, ot = 7, Vi = 10, as = 11,
|
|
|
606
662
|
// Grow the arena by 1.3x when capacity is exceeded
|
|
607
663
|
grow() {
|
|
608
664
|
this.growth_count++;
|
|
609
|
-
let e = Math.ceil(this.capacity *
|
|
665
|
+
let e = Math.ceil(this.capacity * oe.GROWTH_FACTOR), t = new ArrayBuffer(e * ot);
|
|
610
666
|
new Uint8Array(t).set(new Uint8Array(this.buffer)), this.buffer = t, this.view = new DataView(t), this.capacity = e;
|
|
611
667
|
}
|
|
612
668
|
// Allocate and initialize a new node with core properties
|
|
@@ -615,8 +671,8 @@ const tn = 1, lt = 2, ze = 3, pe = 4, Wi = 5, Qi = 6, ot = 7, Vi = 10, as = 11,
|
|
|
615
671
|
this.count >= this.capacity && this.grow();
|
|
616
672
|
const l = this.count;
|
|
617
673
|
this.count++;
|
|
618
|
-
const
|
|
619
|
-
return this.view.setUint8(
|
|
674
|
+
const a = l * ot;
|
|
675
|
+
return this.view.setUint8(a, e), this.view.setUint32(a + 12, t, !0), this.view.setUint32(a + 24, i, !0), this.view.setUint32(a + 28, n, !0), this.set_length(l, s), l;
|
|
620
676
|
}
|
|
621
677
|
// --- Tree Building Helpers ---
|
|
622
678
|
// Link multiple child nodes to a parent
|
|
@@ -654,23 +710,23 @@ const tn = 1, lt = 2, ze = 3, pe = 4, Wi = 5, Qi = 6, ot = 7, Vi = 10, as = 11,
|
|
|
654
710
|
};
|
|
655
711
|
// Stores actual lengths for nodes > 65535 chars
|
|
656
712
|
// Growth multiplier when capacity is exceeded
|
|
657
|
-
|
|
713
|
+
m(oe, "GROWTH_FACTOR", 1.3), // Estimated nodes per KB of CSS (based on real-world data)
|
|
658
714
|
// Increased from 270 to 325 to account for VALUE wrapper nodes
|
|
659
715
|
// (~20% of nodes are declarations, +1 VALUE node per declaration = +20% nodes)
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
let
|
|
663
|
-
const
|
|
664
|
-
function
|
|
665
|
-
return r ===
|
|
716
|
+
m(oe, "NODES_PER_KB", 325), // Buffer to avoid frequent growth (15%)
|
|
717
|
+
m(oe, "CAPACITY_BUFFER", 1.2);
|
|
718
|
+
let dt = oe;
|
|
719
|
+
const Fn = 32, Mn = 9, zn = 10, qn = 13, Kn = 12, Ue = 47, V = 42, F = 45, $n = 39, Bn = 34, se = 43, kr = 46, ft = 126, wr = 62, Gn = 38, de = 61, ze = 124, Si = 36, Ni = 94, Wn = 58;
|
|
720
|
+
function ie(r) {
|
|
721
|
+
return r === Fn || r === Mn || r === zn || r === qn || r === Kn;
|
|
666
722
|
}
|
|
667
|
-
function
|
|
668
|
-
return r ===
|
|
723
|
+
function Yn(r) {
|
|
724
|
+
return r === wr || r === se || r === ft;
|
|
669
725
|
}
|
|
670
|
-
function
|
|
726
|
+
function es(r) {
|
|
671
727
|
return r >= 48 && r <= 57;
|
|
672
728
|
}
|
|
673
|
-
function
|
|
729
|
+
function Q(r, e) {
|
|
674
730
|
if (r.length !== e.length)
|
|
675
731
|
return !1;
|
|
676
732
|
for (let t = 0; t < r.length; t++) {
|
|
@@ -680,7 +736,7 @@ function Y(r, e) {
|
|
|
680
736
|
}
|
|
681
737
|
return !0;
|
|
682
738
|
}
|
|
683
|
-
function
|
|
739
|
+
function Qn(r, e) {
|
|
684
740
|
if (r.length < e.length)
|
|
685
741
|
return !1;
|
|
686
742
|
for (let t = 0; t < e.length; t++) {
|
|
@@ -690,7 +746,7 @@ function Fn(r, e) {
|
|
|
690
746
|
}
|
|
691
747
|
return !0;
|
|
692
748
|
}
|
|
693
|
-
function
|
|
749
|
+
function Vn(r, e) {
|
|
694
750
|
if (e.length === 0)
|
|
695
751
|
return -1;
|
|
696
752
|
if (e.length === 1) {
|
|
@@ -716,7 +772,7 @@ function Mn(r, e) {
|
|
|
716
772
|
}
|
|
717
773
|
return -1;
|
|
718
774
|
}
|
|
719
|
-
function
|
|
775
|
+
function qe(r, e, t) {
|
|
720
776
|
if ((e === void 0 || t === void 0) && (e = 0, t = r.length), r.charCodeAt(e) !== F || r.charCodeAt(e + 1) === F || t - e < 3)
|
|
721
777
|
return !1;
|
|
722
778
|
for (let i = e + 2; i < t; i++)
|
|
@@ -724,21 +780,21 @@ function Fe(r, e, t) {
|
|
|
724
780
|
return !0;
|
|
725
781
|
return !1;
|
|
726
782
|
}
|
|
727
|
-
function
|
|
728
|
-
for (; e < t &&
|
|
783
|
+
function jn(r, e, t) {
|
|
784
|
+
for (; e < t && ie(r.charCodeAt(e)); )
|
|
729
785
|
e++;
|
|
730
786
|
return e;
|
|
731
787
|
}
|
|
732
|
-
function
|
|
788
|
+
function be(r, e, t) {
|
|
733
789
|
for (; e < t; ) {
|
|
734
790
|
let s = r.charCodeAt(e);
|
|
735
|
-
if (
|
|
791
|
+
if (ie(s)) {
|
|
736
792
|
e++;
|
|
737
793
|
continue;
|
|
738
794
|
}
|
|
739
|
-
if (s ===
|
|
795
|
+
if (s === Ue && e + 1 < t && r.charCodeAt(e + 1) === V) {
|
|
740
796
|
for (e += 2; e < t; ) {
|
|
741
|
-
if (r.charCodeAt(e) ===
|
|
797
|
+
if (r.charCodeAt(e) === V && e + 1 < t && r.charCodeAt(e + 1) === Ue) {
|
|
742
798
|
e += 2;
|
|
743
799
|
break;
|
|
744
800
|
}
|
|
@@ -750,16 +806,16 @@ function Ae(r, e, t) {
|
|
|
750
806
|
}
|
|
751
807
|
return e;
|
|
752
808
|
}
|
|
753
|
-
function
|
|
809
|
+
function Xn(r, e, t) {
|
|
754
810
|
for (; e > t; ) {
|
|
755
811
|
let s = r.charCodeAt(e - 1);
|
|
756
|
-
if (
|
|
812
|
+
if (ie(s)) {
|
|
757
813
|
e--;
|
|
758
814
|
continue;
|
|
759
815
|
}
|
|
760
|
-
if (e >= 2 && s ===
|
|
816
|
+
if (e >= 2 && s === Ue && r.charCodeAt(e - 2) === V) {
|
|
761
817
|
for (e -= 2; e > t; ) {
|
|
762
|
-
if (e >= 2 && r.charCodeAt(e - 2) ===
|
|
818
|
+
if (e >= 2 && r.charCodeAt(e - 2) === Ue && r.charCodeAt(e - 1) === V) {
|
|
763
819
|
e -= 2;
|
|
764
820
|
break;
|
|
765
821
|
}
|
|
@@ -771,20 +827,20 @@ function zn(r, e, t) {
|
|
|
771
827
|
}
|
|
772
828
|
return e;
|
|
773
829
|
}
|
|
774
|
-
function
|
|
830
|
+
function ts(r) {
|
|
775
831
|
let e = 0;
|
|
776
832
|
for (let n = 0; n < r.length; n++) {
|
|
777
833
|
let l = r.charCodeAt(n);
|
|
778
834
|
if (l === 101 || l === 69) {
|
|
779
835
|
if (n + 1 < r.length) {
|
|
780
|
-
let
|
|
781
|
-
if (
|
|
836
|
+
let a = r.charCodeAt(n + 1);
|
|
837
|
+
if (es(a)) {
|
|
782
838
|
e = n + 1;
|
|
783
839
|
continue;
|
|
784
840
|
}
|
|
785
|
-
if ((
|
|
841
|
+
if ((a === 43 || a === 45) && n + 2 < r.length) {
|
|
786
842
|
let h = r.charCodeAt(n + 2);
|
|
787
|
-
if (
|
|
843
|
+
if (es(h)) {
|
|
788
844
|
e = n + 1;
|
|
789
845
|
continue;
|
|
790
846
|
}
|
|
@@ -792,7 +848,7 @@ function es(r) {
|
|
|
792
848
|
}
|
|
793
849
|
break;
|
|
794
850
|
}
|
|
795
|
-
if (
|
|
851
|
+
if (es(l) || l === kr || l === F || l === se)
|
|
796
852
|
e = n + 1;
|
|
797
853
|
else
|
|
798
854
|
break;
|
|
@@ -800,52 +856,65 @@ function es(r) {
|
|
|
800
856
|
let t = r.substring(0, e), s = r.substring(e);
|
|
801
857
|
return { value: t ? parseFloat(t) : 0, unit: s };
|
|
802
858
|
}
|
|
803
|
-
const
|
|
804
|
-
[
|
|
805
|
-
[
|
|
806
|
-
[
|
|
807
|
-
[
|
|
808
|
-
[
|
|
809
|
-
[
|
|
810
|
-
[
|
|
811
|
-
[
|
|
812
|
-
[
|
|
813
|
-
[
|
|
814
|
-
[
|
|
815
|
-
[
|
|
816
|
-
[
|
|
817
|
-
[
|
|
818
|
-
[
|
|
819
|
-
[
|
|
820
|
-
[
|
|
821
|
-
[
|
|
822
|
-
[
|
|
823
|
-
[
|
|
824
|
-
[
|
|
825
|
-
[
|
|
826
|
-
[
|
|
827
|
-
[
|
|
828
|
-
[
|
|
829
|
-
[
|
|
830
|
-
[
|
|
831
|
-
[
|
|
832
|
-
[
|
|
833
|
-
[
|
|
834
|
-
[
|
|
835
|
-
[
|
|
836
|
-
[
|
|
837
|
-
[
|
|
838
|
-
[
|
|
839
|
-
[
|
|
840
|
-
[
|
|
841
|
-
[
|
|
842
|
-
[
|
|
859
|
+
const Zn = {
|
|
860
|
+
[An]: "StyleSheet",
|
|
861
|
+
[ct]: "Rule",
|
|
862
|
+
[Be]: "Atrule",
|
|
863
|
+
[Z]: "Declaration",
|
|
864
|
+
[Cs]: "Selector",
|
|
865
|
+
[Ji]: "Comment",
|
|
866
|
+
[_t]: "Block",
|
|
867
|
+
[er]: "Identifier",
|
|
868
|
+
[cs]: "Number",
|
|
869
|
+
[Ge]: "Dimension",
|
|
870
|
+
[tr]: "String",
|
|
871
|
+
[En]: "Hash",
|
|
872
|
+
[sr]: "Function",
|
|
873
|
+
[_s]: "Operator",
|
|
874
|
+
[Cn]: "Parentheses",
|
|
875
|
+
[ir]: "Url",
|
|
876
|
+
[yn]: "UnicodeRange",
|
|
877
|
+
[Ln]: "Value",
|
|
878
|
+
[wt]: "SelectorList",
|
|
879
|
+
[us]: "TypeSelector",
|
|
880
|
+
[rr]: "ClassSelector",
|
|
881
|
+
[nr]: "IdSelector",
|
|
882
|
+
[We]: "AttributeSelector",
|
|
883
|
+
[Te]: "PseudoClassSelector",
|
|
884
|
+
[Qe]: "PseudoElementSelector",
|
|
885
|
+
[ut]: "Combinator",
|
|
886
|
+
[fs]: "UniversalSelector",
|
|
887
|
+
[lr]: "NestingSelector",
|
|
888
|
+
[Ye]: "Nth",
|
|
889
|
+
[le]: "NthOf",
|
|
890
|
+
[or]: "Lang",
|
|
891
|
+
[bn]: "MediaQuery",
|
|
892
|
+
[ar]: "Feature",
|
|
893
|
+
[Rn]: "MediaType",
|
|
894
|
+
[vn]: "ContainerQuery",
|
|
895
|
+
[Tn]: "SupportsQuery",
|
|
896
|
+
[On]: "Layer",
|
|
897
|
+
[Sn]: "Operator",
|
|
898
|
+
[Nn]: "MediaFeatureRange",
|
|
899
|
+
[hr]: "AtrulePrelude"
|
|
900
|
+
}, Jn = {
|
|
901
|
+
[ps]: null,
|
|
902
|
+
[_r]: "=",
|
|
903
|
+
[ur]: "~=",
|
|
904
|
+
[fr]: "|=",
|
|
905
|
+
[pr]: "^=",
|
|
906
|
+
[dr]: "$=",
|
|
907
|
+
[gr]: "*="
|
|
908
|
+
}, el = {
|
|
909
|
+
[ye]: null,
|
|
910
|
+
[xr]: "i",
|
|
911
|
+
[mr]: "s"
|
|
843
912
|
};
|
|
844
|
-
class
|
|
913
|
+
class Ve {
|
|
845
914
|
constructor(e, t, s) {
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
915
|
+
m(this, "arena");
|
|
916
|
+
m(this, "source");
|
|
917
|
+
m(this, "index");
|
|
849
918
|
this.arena = e, this.source = t, this.index = s;
|
|
850
919
|
}
|
|
851
920
|
/**
|
|
@@ -855,30 +924,37 @@ class We {
|
|
|
855
924
|
__get_arena() {
|
|
856
925
|
return this.arena;
|
|
857
926
|
}
|
|
927
|
+
get_content() {
|
|
928
|
+
let e = this.arena.get_content_start(this.index), t = this.arena.get_content_length(this.index);
|
|
929
|
+
return t === 0 ? "" : this.source.substring(e, e + t);
|
|
930
|
+
}
|
|
858
931
|
/** Get node type as number (for performance) */
|
|
859
932
|
get type() {
|
|
860
933
|
return this.arena.get_type(this.index);
|
|
861
934
|
}
|
|
862
935
|
/** Get node type as human-readable string */
|
|
863
936
|
get type_name() {
|
|
864
|
-
return
|
|
937
|
+
return Zn[this.type] || "unknown";
|
|
865
938
|
}
|
|
866
939
|
/** Get the full text of this node from source */
|
|
867
940
|
get text() {
|
|
868
941
|
let e = this.arena.get_start_offset(this.index), t = this.arena.get_length(this.index);
|
|
869
942
|
return this.source.substring(e, e + t);
|
|
870
943
|
}
|
|
871
|
-
/** Get the "content" text (
|
|
944
|
+
/** Get the "content" text (at-rule name for at-rules, layer name for import layers) */
|
|
872
945
|
get name() {
|
|
873
|
-
let
|
|
874
|
-
|
|
946
|
+
let { type: e } = this;
|
|
947
|
+
if (!(e === Z || e === _s || e === Cs))
|
|
948
|
+
return this.get_content();
|
|
875
949
|
}
|
|
876
950
|
/**
|
|
877
951
|
* Alias for name (for declarations: "color" in "color: blue")
|
|
878
952
|
* More semantic than `name` for declaration nodes
|
|
879
953
|
*/
|
|
880
954
|
get property() {
|
|
881
|
-
|
|
955
|
+
let { type: e } = this;
|
|
956
|
+
if (!(e !== Z && e !== ar))
|
|
957
|
+
return this.get_content();
|
|
882
958
|
}
|
|
883
959
|
/**
|
|
884
960
|
* Get the value text (for declarations: "blue" in "color: blue")
|
|
@@ -888,31 +964,32 @@ class We {
|
|
|
888
964
|
* For URL nodes with unquoted URL: returns the URL content without quotes
|
|
889
965
|
*/
|
|
890
966
|
get value() {
|
|
891
|
-
let { type: e, text: t } = this;
|
|
892
|
-
if (e ===
|
|
893
|
-
return
|
|
894
|
-
if (e ===
|
|
895
|
-
return
|
|
896
|
-
if (e ===
|
|
897
|
-
return Number.parseFloat(
|
|
898
|
-
if (e ===
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
return t.substring(l + 1, o).trim();
|
|
967
|
+
let { type: e, text: t, first_child: s } = this;
|
|
968
|
+
if (e === Z && s)
|
|
969
|
+
return s;
|
|
970
|
+
if (e === Ge)
|
|
971
|
+
return ts(t).value;
|
|
972
|
+
if (e === cs)
|
|
973
|
+
return Number.parseFloat(t);
|
|
974
|
+
if (e === ir) {
|
|
975
|
+
if ((s == null ? void 0 : s.type) === tr)
|
|
976
|
+
return s.text;
|
|
977
|
+
if (Qn(t, "url(")) {
|
|
978
|
+
let l = t.indexOf("("), a = t.lastIndexOf(")");
|
|
979
|
+
if (l !== -1 && a !== -1 && a > l)
|
|
980
|
+
return t.substring(l + 1, a).trim();
|
|
906
981
|
} else if (t.startsWith('"') || t.startsWith("'"))
|
|
907
982
|
return t;
|
|
908
983
|
}
|
|
909
|
-
|
|
910
|
-
|
|
984
|
+
if (e === _s)
|
|
985
|
+
return this.get_content();
|
|
986
|
+
let i = this.arena.get_value_start(this.index), n = this.arena.get_value_length(this.index);
|
|
987
|
+
return n === 0 ? null : this.source.substring(i, i + n);
|
|
911
988
|
}
|
|
912
989
|
/** Get the numeric value for NUMBER and DIMENSION nodes, or null for other node types */
|
|
913
990
|
get value_as_number() {
|
|
914
|
-
let e = this
|
|
915
|
-
return
|
|
991
|
+
let { text: e, type: t } = this;
|
|
992
|
+
return t === cs ? Number.parseFloat(e) : t === Ge ? ts(e).value : null;
|
|
916
993
|
}
|
|
917
994
|
/**
|
|
918
995
|
* Get the prelude node:
|
|
@@ -921,11 +998,11 @@ class We {
|
|
|
921
998
|
* Returns null if no prelude exists
|
|
922
999
|
*/
|
|
923
1000
|
get prelude() {
|
|
924
|
-
if (this.type ===
|
|
1001
|
+
if (this.type === Be) {
|
|
925
1002
|
let e = this.first_child;
|
|
926
|
-
return e && e.type ===
|
|
1003
|
+
return e && e.type === hr ? e : null;
|
|
927
1004
|
}
|
|
928
|
-
if (this.type ===
|
|
1005
|
+
if (this.type === ct)
|
|
929
1006
|
return this.first_child;
|
|
930
1007
|
}
|
|
931
1008
|
/**
|
|
@@ -933,7 +1010,7 @@ class We {
|
|
|
933
1010
|
* Returns one of the ATTR_OPERATOR_* constants
|
|
934
1011
|
*/
|
|
935
1012
|
get attr_operator() {
|
|
936
|
-
if (this.type ===
|
|
1013
|
+
if (this.type === We)
|
|
937
1014
|
return this.arena.get_attr_operator(this.index);
|
|
938
1015
|
}
|
|
939
1016
|
/**
|
|
@@ -941,72 +1018,74 @@ class We {
|
|
|
941
1018
|
* Returns one of the ATTR_FLAG_* constants
|
|
942
1019
|
*/
|
|
943
1020
|
get attr_flags() {
|
|
944
|
-
if (this.type ===
|
|
1021
|
+
if (this.type === We)
|
|
945
1022
|
return this.arena.get_attr_flags(this.index);
|
|
946
1023
|
}
|
|
947
1024
|
/** Get the unit for dimension nodes (e.g., "px" from "100px", "%" from "50%") */
|
|
948
1025
|
get unit() {
|
|
949
|
-
if (this.type ===
|
|
950
|
-
return
|
|
1026
|
+
if (this.type === Ge)
|
|
1027
|
+
return ts(this.text).unit;
|
|
951
1028
|
}
|
|
952
1029
|
/** Check if this declaration has !important */
|
|
953
1030
|
get is_important() {
|
|
954
|
-
if (this.type ===
|
|
955
|
-
return this.arena.has_flag(this.index,
|
|
1031
|
+
if (this.type === Z)
|
|
1032
|
+
return this.arena.has_flag(this.index, Un);
|
|
956
1033
|
}
|
|
957
1034
|
/** Check if this declaration has a browser hack prefix */
|
|
958
1035
|
get is_browserhack() {
|
|
959
|
-
if (this.type ===
|
|
960
|
-
return this.arena.has_flag(this.index,
|
|
1036
|
+
if (this.type === Z)
|
|
1037
|
+
return this.arena.has_flag(this.index, Dn);
|
|
961
1038
|
}
|
|
962
1039
|
/** Check if this has a vendor prefix (computed on-demand) */
|
|
963
1040
|
get is_vendor_prefixed() {
|
|
964
1041
|
switch (this.type) {
|
|
965
|
-
case
|
|
966
|
-
return
|
|
967
|
-
case
|
|
968
|
-
case
|
|
969
|
-
return
|
|
970
|
-
case
|
|
971
|
-
return
|
|
972
|
-
case
|
|
973
|
-
return
|
|
974
|
-
case
|
|
975
|
-
return
|
|
1042
|
+
case Z:
|
|
1043
|
+
return qe(this.get_content());
|
|
1044
|
+
case Te:
|
|
1045
|
+
case Qe:
|
|
1046
|
+
return qe(this.get_content());
|
|
1047
|
+
case Be:
|
|
1048
|
+
return qe(this.get_content());
|
|
1049
|
+
case sr:
|
|
1050
|
+
return qe(this.get_content());
|
|
1051
|
+
case er:
|
|
1052
|
+
return qe(this.text);
|
|
976
1053
|
default:
|
|
977
1054
|
return !1;
|
|
978
1055
|
}
|
|
979
1056
|
}
|
|
980
1057
|
/** Check if this node has an error */
|
|
981
1058
|
get has_error() {
|
|
982
|
-
return this.arena.has_flag(this.index,
|
|
1059
|
+
return this.arena.has_flag(this.index, In);
|
|
983
1060
|
}
|
|
984
1061
|
/** Check if this node has a prelude (at-rules and style rules) */
|
|
985
1062
|
get has_prelude() {
|
|
986
|
-
|
|
1063
|
+
let { type: e } = this;
|
|
1064
|
+
return e === Be ? this.arena.get_value_length(this.index) > 0 : e === ct ? this.first_child !== null : !1;
|
|
987
1065
|
}
|
|
988
1066
|
/** Check if this rule has a block { } */
|
|
989
1067
|
get has_block() {
|
|
990
|
-
return this.arena.has_flag(this.index,
|
|
1068
|
+
return this.arena.has_flag(this.index, Hn);
|
|
991
1069
|
}
|
|
992
1070
|
/** Check if this style rule has declarations */
|
|
993
1071
|
get has_declarations() {
|
|
994
|
-
return this.arena.has_flag(this.index,
|
|
1072
|
+
return this.arena.has_flag(this.index, Pn);
|
|
995
1073
|
}
|
|
996
1074
|
/** Get the block node (for style rules and at-rules with blocks) */
|
|
997
1075
|
get block() {
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1076
|
+
let { type: e } = this;
|
|
1077
|
+
if (e === ct) {
|
|
1078
|
+
let t = this.first_child;
|
|
1079
|
+
if (!t) return null;
|
|
1080
|
+
let s = t.next_sibling;
|
|
1081
|
+
return (s == null ? void 0 : s.type) === _t ? s : null;
|
|
1082
|
+
}
|
|
1083
|
+
if (e === Be) {
|
|
1084
|
+
let t = this.first_child;
|
|
1085
|
+
for (; t; ) {
|
|
1086
|
+
if (t.type === _t && !t.next_sibling)
|
|
1087
|
+
return t;
|
|
1088
|
+
t = t.next_sibling;
|
|
1010
1089
|
}
|
|
1011
1090
|
return null;
|
|
1012
1091
|
}
|
|
@@ -1014,10 +1093,10 @@ class We {
|
|
|
1014
1093
|
}
|
|
1015
1094
|
/** Check if this block is empty (no declarations or rules, only comments allowed) */
|
|
1016
1095
|
get is_empty() {
|
|
1017
|
-
if (this.type !==
|
|
1096
|
+
if (this.type !== _t) return;
|
|
1018
1097
|
let e = this.first_child;
|
|
1019
1098
|
for (; e; ) {
|
|
1020
|
-
if (e.type !==
|
|
1099
|
+
if (e.type !== Ji)
|
|
1021
1100
|
return !1;
|
|
1022
1101
|
e = e.next_sibling;
|
|
1023
1102
|
}
|
|
@@ -1050,12 +1129,12 @@ class We {
|
|
|
1050
1129
|
/** Get first child node */
|
|
1051
1130
|
get first_child() {
|
|
1052
1131
|
let e = this.arena.get_first_child(this.index);
|
|
1053
|
-
return e === 0 ? null : new
|
|
1132
|
+
return e === 0 ? null : new Ve(this.arena, this.source, e);
|
|
1054
1133
|
}
|
|
1055
1134
|
/** Get next sibling node */
|
|
1056
1135
|
get next_sibling() {
|
|
1057
1136
|
let e = this.arena.get_next_sibling(this.index);
|
|
1058
|
-
return e === 0 ? null : new
|
|
1137
|
+
return e === 0 ? null : new Ve(this.arena, this.source, e);
|
|
1059
1138
|
}
|
|
1060
1139
|
/** Check if this node has a next sibling */
|
|
1061
1140
|
get has_next() {
|
|
@@ -1067,7 +1146,8 @@ class We {
|
|
|
1067
1146
|
* This allows formatters to distinguish :lang() from :hover
|
|
1068
1147
|
*/
|
|
1069
1148
|
get has_children() {
|
|
1070
|
-
|
|
1149
|
+
let { type: e } = this;
|
|
1150
|
+
return (e === Te || e === Qe) && this.arena.has_flag(this.index, cr) ? !0 : this.arena.has_children(this.index);
|
|
1071
1151
|
}
|
|
1072
1152
|
/** Get all children as an array */
|
|
1073
1153
|
get children() {
|
|
@@ -1085,38 +1165,40 @@ class We {
|
|
|
1085
1165
|
// --- An+B Expression Helpers (for NODE_SELECTOR_NTH) ---
|
|
1086
1166
|
/** Get the 'a' coefficient from An+B expression (e.g., "2n" from "2n+1", "odd" from "odd") */
|
|
1087
1167
|
get nth_a() {
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1168
|
+
let { type: e, arena: t, index: s } = this;
|
|
1169
|
+
if (e !== Ye && e !== le) return;
|
|
1170
|
+
let i = t.get_content_length(s);
|
|
1171
|
+
if (i === 0) return;
|
|
1172
|
+
let n = t.get_content_start(s);
|
|
1173
|
+
return this.source.substring(n, n + i);
|
|
1093
1174
|
}
|
|
1094
1175
|
/** Get the 'b' coefficient from An+B expression (e.g., "+1" from "2n+1") */
|
|
1095
1176
|
get nth_b() {
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1177
|
+
let { type: e, arena: t, index: s, source: i } = this;
|
|
1178
|
+
if (e !== Ye && e !== le) return;
|
|
1179
|
+
let n = t.get_value_length(s);
|
|
1180
|
+
if (n === 0) return;
|
|
1181
|
+
let l = t.get_value_start(s), a = i.substring(l, l + n), h = l - 1;
|
|
1182
|
+
for (; h >= 0; ) {
|
|
1183
|
+
let o = i.charCodeAt(h);
|
|
1184
|
+
if (ie(o)) {
|
|
1185
|
+
h--;
|
|
1104
1186
|
continue;
|
|
1105
1187
|
}
|
|
1106
|
-
|
|
1188
|
+
o === F ? a = "-" + a : o === se && (a = "+" + a);
|
|
1107
1189
|
break;
|
|
1108
1190
|
}
|
|
1109
|
-
return
|
|
1191
|
+
return a;
|
|
1110
1192
|
}
|
|
1111
1193
|
// --- Pseudo-Class Nth-Of Helpers (for NODE_SELECTOR_NTH_OF) ---
|
|
1112
1194
|
/** Get the An+B formula node from :nth-child(2n+1 of .foo) */
|
|
1113
1195
|
get nth() {
|
|
1114
|
-
if (this.type ===
|
|
1196
|
+
if (this.type === le)
|
|
1115
1197
|
return this.first_child ?? void 0;
|
|
1116
1198
|
}
|
|
1117
1199
|
/** Get the selector list from :nth-child(2n+1 of .foo) */
|
|
1118
1200
|
get selector() {
|
|
1119
|
-
if (this.type !==
|
|
1201
|
+
if (this.type !== le) return;
|
|
1120
1202
|
let e = this.first_child;
|
|
1121
1203
|
return (e == null ? void 0 : e.next_sibling) ?? void 0;
|
|
1122
1204
|
}
|
|
@@ -1126,12 +1208,12 @@ class We {
|
|
|
1126
1208
|
* Works for :is(.a), :not(.b), :has(.c), :where(.d), :nth-child(2n of .e)
|
|
1127
1209
|
*/
|
|
1128
1210
|
get selector_list() {
|
|
1129
|
-
if (this.type !==
|
|
1211
|
+
if (this.type !== Te) return;
|
|
1130
1212
|
let e = this.first_child;
|
|
1131
1213
|
if (e) {
|
|
1132
|
-
if (e.type ===
|
|
1214
|
+
if (e.type === wt)
|
|
1133
1215
|
return e;
|
|
1134
|
-
if (e.type ===
|
|
1216
|
+
if (e.type === le)
|
|
1135
1217
|
return e.selector;
|
|
1136
1218
|
}
|
|
1137
1219
|
}
|
|
@@ -1146,25 +1228,31 @@ class We {
|
|
|
1146
1228
|
*/
|
|
1147
1229
|
clone(e = {}) {
|
|
1148
1230
|
const { deep: t = !0, locations: s = !1 } = e;
|
|
1149
|
-
let i = {
|
|
1150
|
-
type:
|
|
1231
|
+
let { type: i, name: n, property: l, value: a, unit: h } = this, o = {
|
|
1232
|
+
type: i,
|
|
1151
1233
|
type_name: this.type_name,
|
|
1152
|
-
text: this.text
|
|
1153
|
-
children: []
|
|
1234
|
+
text: this.text
|
|
1154
1235
|
};
|
|
1155
|
-
if (
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1236
|
+
if (n && (o.name = n), l && (o.property = l), a && (o.value = a, h && (o.unit = h)), i === Z) {
|
|
1237
|
+
let { is_important: d, is_browserhack: u } = this;
|
|
1238
|
+
d && (o.is_important = !0), u && (o.is_browserhack = !0);
|
|
1239
|
+
}
|
|
1240
|
+
let { is_vendor_prefixed: _, has_error: p } = this;
|
|
1241
|
+
if (_ && (o.is_vendor_prefixed = !0), p && (o.has_error = !0), i === We && (o.attr_operator = Jn[this.attr_operator], o.attr_flags = el[this.attr_flags]), (i === Ye || i === le) && (o.nth_a = this.nth_a, o.nth_b = this.nth_b), s && (o.line = this.line, o.column = this.column, o.start = this.start, o.length = this.length, o.end = this.end), t && i !== Z) {
|
|
1242
|
+
o.children = [];
|
|
1243
|
+
for (let d of this.children)
|
|
1244
|
+
o.children.push(d.clone({ deep: !0, locations: s }));
|
|
1245
|
+
}
|
|
1246
|
+
return o;
|
|
1159
1247
|
}
|
|
1160
1248
|
}
|
|
1161
|
-
class
|
|
1249
|
+
class Li {
|
|
1162
1250
|
constructor(e, t) {
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
this.arena = e, this.source = t, this.lexer = new
|
|
1251
|
+
m(this, "lexer");
|
|
1252
|
+
m(this, "arena");
|
|
1253
|
+
m(this, "source");
|
|
1254
|
+
m(this, "expr_end");
|
|
1255
|
+
this.arena = e, this.source = t, this.lexer = new Zi(t), this.expr_end = 0;
|
|
1168
1256
|
}
|
|
1169
1257
|
/**
|
|
1170
1258
|
* Parse An+B expression
|
|
@@ -1172,35 +1260,35 @@ class vi {
|
|
|
1172
1260
|
*/
|
|
1173
1261
|
parse_anplusb(e, t, s = 1) {
|
|
1174
1262
|
this.expr_end = t, this.lexer.pos = e, this.lexer.line = s;
|
|
1175
|
-
let i = null, n = e, l = e,
|
|
1176
|
-
const
|
|
1263
|
+
let i = null, n = e, l = e, a = e, h = e;
|
|
1264
|
+
const o = e;
|
|
1177
1265
|
if (this.skip_whitespace(), this.lexer.pos >= this.expr_end)
|
|
1178
1266
|
return null;
|
|
1179
|
-
if (this.lexer.next_token_fast(!0), this.lexer.token_type ===
|
|
1180
|
-
const
|
|
1181
|
-
if (
|
|
1182
|
-
return n = this.lexer.token_start, l = this.lexer.token_end, this.create_anplusb_node(
|
|
1183
|
-
const
|
|
1184
|
-
return
|
|
1185
|
-
}
|
|
1186
|
-
if (this.lexer.token_type ===
|
|
1187
|
-
const
|
|
1188
|
-
if (this.lexer.next_token_fast(!0), this.lexer.token_type ===
|
|
1189
|
-
return n =
|
|
1190
|
-
this.lexer.restore_position(
|
|
1191
|
-
}
|
|
1192
|
-
if (this.lexer.token_type ===
|
|
1193
|
-
const
|
|
1194
|
-
if (
|
|
1195
|
-
if (n = this.lexer.token_start, l = this.lexer.token_start +
|
|
1196
|
-
const
|
|
1197
|
-
if (
|
|
1198
|
-
return i =
|
|
1267
|
+
if (this.lexer.next_token_fast(!0), this.lexer.token_type === ae) {
|
|
1268
|
+
const _ = this.source.substring(this.lexer.token_start, this.lexer.token_end);
|
|
1269
|
+
if (Q("odd", _) || Q("even", _))
|
|
1270
|
+
return n = this.lexer.token_start, l = this.lexer.token_end, this.create_anplusb_node(o, n, l, 0, 0);
|
|
1271
|
+
const p = this.source.charCodeAt(this.lexer.token_start), d = this.lexer.token_end > this.lexer.token_start + 1 ? this.source.charCodeAt(this.lexer.token_start + 1) : 0;
|
|
1272
|
+
return p === F && d === 110 ? this.lexer.token_end > this.lexer.token_start + 2 && this.source.charCodeAt(this.lexer.token_start + 2) === F ? (n = this.lexer.token_start, l = this.lexer.token_start + 2, i = this.source.substring(this.lexer.token_start + 2, this.lexer.token_end), a = this.lexer.token_start + 2, h = this.lexer.token_end, this.create_anplusb_node(o, n, l, a, h)) : (n = this.lexer.token_start, l = this.lexer.token_start + 2, i = this.parse_b_part(), i !== null && (a = this.lexer.token_start, h = this.lexer.token_end), this.create_anplusb_node(o, n, l, i !== null ? a : 0, i !== null ? h : 0)) : p === 110 ? this.lexer.token_end > this.lexer.token_start + 1 && this.source.charCodeAt(this.lexer.token_start + 1) === F ? (n = this.lexer.token_start, l = this.lexer.token_start + 1, i = this.source.substring(this.lexer.token_start + 1, this.lexer.token_end), a = this.lexer.token_start + 1, h = this.lexer.token_end, this.create_anplusb_node(o, n, l, a, h)) : (n = this.lexer.token_start, l = this.lexer.token_start + 1, i = this.parse_b_part(), i !== null && (a = this.lexer.token_start, h = this.lexer.token_end), this.create_anplusb_node(o, n, l, i !== null ? a : 0, i !== null ? h : 0)) : null;
|
|
1273
|
+
}
|
|
1274
|
+
if (this.lexer.token_type === xe && this.source.charCodeAt(this.lexer.token_start) === se) {
|
|
1275
|
+
const _ = this.lexer.save_position();
|
|
1276
|
+
if (this.lexer.next_token_fast(!0), this.lexer.token_type === ae && this.source.substring(this.lexer.token_start, this.lexer.token_end).charCodeAt(0) === 110)
|
|
1277
|
+
return n = _.pos - 1, l = this.lexer.token_start + 1, this.lexer.token_end > this.lexer.token_start + 1 && this.source.charCodeAt(this.lexer.token_start + 1) === F ? (i = this.source.substring(this.lexer.token_start + 1, this.lexer.token_end), a = this.lexer.token_start + 1, h = this.lexer.token_end, this.create_anplusb_node(o, n, l, a, h)) : (i = this.parse_b_part(), i !== null && (a = this.lexer.token_start, h = this.lexer.token_end), this.create_anplusb_node(o, n, l, i !== null ? a : 0, i !== null ? h : 0));
|
|
1278
|
+
this.lexer.restore_position(_);
|
|
1279
|
+
}
|
|
1280
|
+
if (this.lexer.token_type === Yi) {
|
|
1281
|
+
const _ = this.source.substring(this.lexer.token_start, this.lexer.token_end), p = Vn(_, "n");
|
|
1282
|
+
if (p !== -1) {
|
|
1283
|
+
if (n = this.lexer.token_start, l = this.lexer.token_start + p + 1, p + 1 < _.length) {
|
|
1284
|
+
const d = _.substring(p + 1);
|
|
1285
|
+
if (d.charCodeAt(0) === F)
|
|
1286
|
+
return i = d, a = this.lexer.token_start + p + 1, h = this.lexer.token_end, this.create_anplusb_node(o, n, l, a, h);
|
|
1199
1287
|
}
|
|
1200
|
-
return i = this.parse_b_part(), i !== null && (
|
|
1288
|
+
return i = this.parse_b_part(), i !== null && (a = this.lexer.token_start, h = this.lexer.token_end), this.create_anplusb_node(o, n, l, a, h);
|
|
1201
1289
|
}
|
|
1202
1290
|
}
|
|
1203
|
-
return this.lexer.token_type ===
|
|
1291
|
+
return this.lexer.token_type === ht ? (i = this.source.substring(this.lexer.token_start, this.lexer.token_end), a = this.lexer.token_start, h = this.lexer.token_end, this.create_anplusb_node(o, 0, 0, a, h)) : null;
|
|
1204
1292
|
}
|
|
1205
1293
|
/**
|
|
1206
1294
|
* Parse the b part after 'n'
|
|
@@ -1209,39 +1297,39 @@ class vi {
|
|
|
1209
1297
|
parse_b_part() {
|
|
1210
1298
|
if (this.skip_whitespace(), this.lexer.pos >= this.expr_end)
|
|
1211
1299
|
return null;
|
|
1212
|
-
if (this.lexer.next_token_fast(!0), this.lexer.token_type ===
|
|
1300
|
+
if (this.lexer.next_token_fast(!0), this.lexer.token_type === xe) {
|
|
1213
1301
|
const e = this.source.charCodeAt(this.lexer.token_start);
|
|
1214
|
-
if (e ===
|
|
1302
|
+
if (e === se || e === F) {
|
|
1215
1303
|
const t = e === F ? "-" : "";
|
|
1216
|
-
if (this.skip_whitespace(), this.lexer.next_token_fast(!0), this.lexer.token_type ===
|
|
1304
|
+
if (this.skip_whitespace(), this.lexer.next_token_fast(!0), this.lexer.token_type === ht) {
|
|
1217
1305
|
let s = this.source.substring(this.lexer.token_start, this.lexer.token_end);
|
|
1218
|
-
return s.charCodeAt(0) ===
|
|
1306
|
+
return s.charCodeAt(0) === se && (s = s.substring(1)), t === "-" ? t + s : s;
|
|
1219
1307
|
}
|
|
1220
1308
|
}
|
|
1221
1309
|
}
|
|
1222
|
-
if (this.lexer.token_type ===
|
|
1310
|
+
if (this.lexer.token_type === ht) {
|
|
1223
1311
|
let e = this.source.substring(this.lexer.token_start, this.lexer.token_end);
|
|
1224
1312
|
const t = e.charCodeAt(0);
|
|
1225
|
-
if (t ===
|
|
1226
|
-
return t ===
|
|
1313
|
+
if (t === se || t === F)
|
|
1314
|
+
return t === se && (e = e.substring(1)), e;
|
|
1227
1315
|
}
|
|
1228
1316
|
return null;
|
|
1229
1317
|
}
|
|
1230
1318
|
skip_whitespace() {
|
|
1231
|
-
this.lexer.pos =
|
|
1319
|
+
this.lexer.pos = be(this.source, this.lexer.pos, this.expr_end);
|
|
1232
1320
|
}
|
|
1233
1321
|
create_anplusb_node(e, t, s, i, n) {
|
|
1234
|
-
const l = this.arena.create_node(
|
|
1322
|
+
const l = this.arena.create_node(Ye, e, this.lexer.pos - e, this.lexer.line, 1);
|
|
1235
1323
|
return s > t && (this.arena.set_content_start_delta(l, t - e), this.arena.set_content_length(l, s - t)), n > i && (this.arena.set_value_start_delta(l, i - e), this.arena.set_value_length(l, n - i)), l;
|
|
1236
1324
|
}
|
|
1237
1325
|
}
|
|
1238
|
-
class
|
|
1326
|
+
class tl {
|
|
1239
1327
|
constructor(e, t) {
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
this.arena = e, this.source = t, this.lexer = new
|
|
1328
|
+
m(this, "lexer");
|
|
1329
|
+
m(this, "arena");
|
|
1330
|
+
m(this, "source");
|
|
1331
|
+
m(this, "selector_end");
|
|
1332
|
+
this.arena = e, this.source = t, this.lexer = new Zi(t), this.selector_end = 0;
|
|
1245
1333
|
}
|
|
1246
1334
|
// Parse a selector range into selector nodes (standalone use)
|
|
1247
1335
|
// Always returns a NODE_SELECTOR_LIST with selector components as children
|
|
@@ -1252,30 +1340,30 @@ class Bn {
|
|
|
1252
1340
|
parse_selector_list(e = !0) {
|
|
1253
1341
|
let t = [], s = this.lexer.pos, i = this.lexer.line, n = this.lexer.column;
|
|
1254
1342
|
for (; this.lexer.pos < this.selector_end; ) {
|
|
1255
|
-
let l = this.lexer.pos,
|
|
1256
|
-
if (
|
|
1257
|
-
let
|
|
1258
|
-
|
|
1343
|
+
let l = this.lexer.pos, a = this.lexer.line, h = this.lexer.column, o = this.parse_complex_selector(e);
|
|
1344
|
+
if (o !== null) {
|
|
1345
|
+
let p = this.arena.create_node(
|
|
1346
|
+
Cs,
|
|
1259
1347
|
l,
|
|
1260
1348
|
this.lexer.pos - l,
|
|
1261
|
-
|
|
1349
|
+
a,
|
|
1262
1350
|
h
|
|
1263
1351
|
);
|
|
1264
|
-
this.arena.set_content_start_delta(
|
|
1265
|
-
let
|
|
1266
|
-
for (;
|
|
1267
|
-
|
|
1268
|
-
this.arena.set_first_child(
|
|
1352
|
+
this.arena.set_content_start_delta(p, 0), this.arena.set_content_length(p, this.lexer.pos - l);
|
|
1353
|
+
let d = o, u = this.arena.get_next_sibling(d);
|
|
1354
|
+
for (; u !== 0; )
|
|
1355
|
+
d = u, u = this.arena.get_next_sibling(d);
|
|
1356
|
+
this.arena.set_first_child(p, o), t.push(p);
|
|
1269
1357
|
}
|
|
1270
1358
|
if (this.skip_whitespace(), this.lexer.pos >= this.selector_end) break;
|
|
1271
|
-
if (this.lexer.next_token_fast(!1), this.lexer.token_type ===
|
|
1359
|
+
if (this.lexer.next_token_fast(!1), this.lexer.token_type === $e) {
|
|
1272
1360
|
this.skip_whitespace();
|
|
1273
1361
|
continue;
|
|
1274
1362
|
} else
|
|
1275
1363
|
break;
|
|
1276
1364
|
}
|
|
1277
1365
|
if (t.length >= 1) {
|
|
1278
|
-
let l = this.arena.create_node(
|
|
1366
|
+
let l = this.arena.create_node(wt, s, this.lexer.pos - s, i, n);
|
|
1279
1367
|
return this.arena.append_children(l, t), l;
|
|
1280
1368
|
}
|
|
1281
1369
|
return null;
|
|
@@ -1287,11 +1375,11 @@ class Bn {
|
|
|
1287
1375
|
let t = [];
|
|
1288
1376
|
if (this.skip_whitespace(), e && this.lexer.pos < this.selector_end) {
|
|
1289
1377
|
const s = this.lexer.save_position();
|
|
1290
|
-
if (this.lexer.next_token_fast(!1), this.lexer.token_type ===
|
|
1378
|
+
if (this.lexer.next_token_fast(!1), this.lexer.token_type === xe) {
|
|
1291
1379
|
let n = this.source.charCodeAt(this.lexer.token_start);
|
|
1292
|
-
if (n ===
|
|
1380
|
+
if (n === wr || n === se || n === ft) {
|
|
1293
1381
|
let l = this.create_node_at(
|
|
1294
|
-
|
|
1382
|
+
ut,
|
|
1295
1383
|
this.lexer.token_start,
|
|
1296
1384
|
this.lexer.token_end,
|
|
1297
1385
|
this.lexer.token_line,
|
|
@@ -1319,7 +1407,7 @@ class Bn {
|
|
|
1319
1407
|
this.lexer.restore_position(n);
|
|
1320
1408
|
break;
|
|
1321
1409
|
}
|
|
1322
|
-
if (this.lexer.next_token_fast(!1), this.lexer.token_type ===
|
|
1410
|
+
if (this.lexer.next_token_fast(!1), this.lexer.token_type === $e || this.lexer.pos >= this.selector_end) {
|
|
1323
1411
|
this.lexer.restore_position(n);
|
|
1324
1412
|
break;
|
|
1325
1413
|
}
|
|
@@ -1341,7 +1429,7 @@ class Bn {
|
|
|
1341
1429
|
let e = [];
|
|
1342
1430
|
for (; this.lexer.pos < this.selector_end; ) {
|
|
1343
1431
|
const t = this.lexer.save_position();
|
|
1344
|
-
if (this.lexer.next_token_fast(!1), this.lexer.token_start >= this.selector_end || this.lexer.token_type ===
|
|
1432
|
+
if (this.lexer.next_token_fast(!1), this.lexer.token_start >= this.selector_end || this.lexer.token_type === hs) break;
|
|
1345
1433
|
let i = this.parse_simple_selector();
|
|
1346
1434
|
if (i !== null)
|
|
1347
1435
|
e.push(i);
|
|
@@ -1359,23 +1447,23 @@ class Bn {
|
|
|
1359
1447
|
parse_simple_selector() {
|
|
1360
1448
|
let e = this.lexer.token_type, t = this.lexer.token_start, s = this.lexer.token_end;
|
|
1361
1449
|
switch (e) {
|
|
1362
|
-
case
|
|
1450
|
+
case ae:
|
|
1363
1451
|
return this.parse_type_or_namespace_selector(t, s);
|
|
1364
|
-
case
|
|
1365
|
-
return this.create_node(
|
|
1366
|
-
case
|
|
1452
|
+
case Bi:
|
|
1453
|
+
return this.create_node(nr, t, s);
|
|
1454
|
+
case xe:
|
|
1367
1455
|
let i = this.source.charCodeAt(t);
|
|
1368
|
-
return i ===
|
|
1369
|
-
case
|
|
1456
|
+
return i === kr ? this.parse_class_selector(t) : i === V ? this.parse_universal_or_namespace_selector(t, s) : i === Gn ? this.create_node(lr, t, s) : i === ze ? this.parse_empty_namespace_selector(t) : null;
|
|
1457
|
+
case as:
|
|
1370
1458
|
return this.parse_attribute_selector(t);
|
|
1371
|
-
case
|
|
1459
|
+
case Qi:
|
|
1372
1460
|
return this.parse_pseudo(t);
|
|
1373
|
-
case
|
|
1461
|
+
case at:
|
|
1374
1462
|
return this.parse_pseudo_function(t, s);
|
|
1375
|
-
case
|
|
1376
|
-
return this.create_node(
|
|
1377
|
-
case
|
|
1378
|
-
case
|
|
1463
|
+
case Wi:
|
|
1464
|
+
return this.create_node(Ge, t, s);
|
|
1465
|
+
case os:
|
|
1466
|
+
case $e:
|
|
1379
1467
|
return null;
|
|
1380
1468
|
default:
|
|
1381
1469
|
return null;
|
|
@@ -1387,10 +1475,10 @@ class Bn {
|
|
|
1387
1475
|
const i = this.lexer.save_position();
|
|
1388
1476
|
this.lexer.next_token_fast(!1);
|
|
1389
1477
|
let n;
|
|
1390
|
-
if (this.lexer.token_type ===
|
|
1391
|
-
n =
|
|
1392
|
-
else if (this.lexer.token_type ===
|
|
1393
|
-
n =
|
|
1478
|
+
if (this.lexer.token_type === ae)
|
|
1479
|
+
n = us;
|
|
1480
|
+
else if (this.lexer.token_type === xe && this.source.charCodeAt(this.lexer.token_start) === V)
|
|
1481
|
+
n = fs;
|
|
1394
1482
|
else
|
|
1395
1483
|
return this.lexer.restore_position(i), null;
|
|
1396
1484
|
let l = this.create_node(n, e, this.lexer.token_end);
|
|
@@ -1400,27 +1488,27 @@ class Bn {
|
|
|
1400
1488
|
// Called when we've seen an IDENT token
|
|
1401
1489
|
parse_type_or_namespace_selector(e, t) {
|
|
1402
1490
|
const s = this.lexer.save_position();
|
|
1403
|
-
if (this.skip_whitespace(), this.lexer.pos < this.selector_end && this.source.charCodeAt(this.lexer.pos) ===
|
|
1491
|
+
if (this.skip_whitespace(), this.lexer.pos < this.selector_end && this.source.charCodeAt(this.lexer.pos) === ze) {
|
|
1404
1492
|
this.lexer.pos++;
|
|
1405
1493
|
let i = this.parse_namespace_local_part(e, e, t - e);
|
|
1406
1494
|
if (i !== null) return i;
|
|
1407
1495
|
this.lexer.pos = t;
|
|
1408
1496
|
} else
|
|
1409
1497
|
this.lexer.restore_position(s);
|
|
1410
|
-
return this.create_node(
|
|
1498
|
+
return this.create_node(us, e, t);
|
|
1411
1499
|
}
|
|
1412
1500
|
// Parse universal selector or namespace selector (*|E or *|*)
|
|
1413
1501
|
// Called when we've seen a * DELIM token
|
|
1414
1502
|
parse_universal_or_namespace_selector(e, t) {
|
|
1415
1503
|
const s = this.lexer.save_position();
|
|
1416
|
-
if (this.skip_whitespace(), this.lexer.pos < this.selector_end && this.source.charCodeAt(this.lexer.pos) ===
|
|
1504
|
+
if (this.skip_whitespace(), this.lexer.pos < this.selector_end && this.source.charCodeAt(this.lexer.pos) === ze) {
|
|
1417
1505
|
this.lexer.pos++;
|
|
1418
1506
|
let i = this.parse_namespace_local_part(e, e, t - e);
|
|
1419
1507
|
if (i !== null) return i;
|
|
1420
1508
|
this.lexer.pos = t;
|
|
1421
1509
|
} else
|
|
1422
1510
|
this.lexer.restore_position(s);
|
|
1423
|
-
return this.create_node(
|
|
1511
|
+
return this.create_node(fs, e, t);
|
|
1424
1512
|
}
|
|
1425
1513
|
// Parse empty namespace selector (|E or |*)
|
|
1426
1514
|
// Called when we've seen a | DELIM token at the start
|
|
@@ -1432,110 +1520,110 @@ class Bn {
|
|
|
1432
1520
|
let e = this.lexer.pos, t = this.lexer.line, s = this.lexer.column, i = this.lexer.pos < this.selector_end;
|
|
1433
1521
|
if (this.skip_whitespace(), i = i && this.lexer.pos > e, this.lexer.pos >= this.selector_end)
|
|
1434
1522
|
return this.lexer.pos = e, this.lexer.line = t, this.lexer.column = s, null;
|
|
1435
|
-
if (this.lexer.next_token_fast(!1), this.lexer.token_type ===
|
|
1523
|
+
if (this.lexer.next_token_fast(!1), this.lexer.token_type === xe) {
|
|
1436
1524
|
let n = this.source.charCodeAt(this.lexer.token_start);
|
|
1437
|
-
if (
|
|
1438
|
-
return this.create_node_at(
|
|
1525
|
+
if (Yn(n))
|
|
1526
|
+
return this.create_node_at(ut, this.lexer.token_start, this.lexer.token_end, this.lexer.token_line, this.lexer.token_column);
|
|
1439
1527
|
}
|
|
1440
|
-
return i ? (this.lexer.pos = e, this.lexer.line = t, this.lexer.column = s, this.skip_whitespace(), this.create_node_at(
|
|
1528
|
+
return i ? (this.lexer.pos = e, this.lexer.line = t, this.lexer.column = s, this.skip_whitespace(), this.create_node_at(ut, e, this.lexer.pos, t, s)) : (this.lexer.pos = e, this.lexer.line = t, this.lexer.column = s, null);
|
|
1441
1529
|
}
|
|
1442
1530
|
// Parse class selector (.classname)
|
|
1443
1531
|
parse_class_selector(e) {
|
|
1444
1532
|
const t = this.lexer.save_position();
|
|
1445
|
-
return this.lexer.next_token_fast(!1), this.lexer.token_type !==
|
|
1533
|
+
return this.lexer.next_token_fast(!1), this.lexer.token_type !== ae ? (this.lexer.restore_position(t), null) : this.create_node(rr, e, this.lexer.token_end);
|
|
1446
1534
|
}
|
|
1447
1535
|
// Parse attribute selector ([attr], [attr=value], etc.)
|
|
1448
1536
|
parse_attribute_selector(e) {
|
|
1449
1537
|
let t = 1, s = this.lexer.token_end, i = e + 1, n = i;
|
|
1450
1538
|
for (; this.lexer.pos < this.selector_end && t > 0; ) {
|
|
1451
1539
|
this.lexer.next_token_fast(!1);
|
|
1452
|
-
let
|
|
1453
|
-
if (
|
|
1540
|
+
let a = this.lexer.token_type;
|
|
1541
|
+
if (a === as)
|
|
1454
1542
|
t++;
|
|
1455
|
-
else if (
|
|
1543
|
+
else if (a === Vi && (t--, t === 0)) {
|
|
1456
1544
|
n = this.lexer.token_start, s = this.lexer.token_end;
|
|
1457
1545
|
break;
|
|
1458
1546
|
}
|
|
1459
1547
|
}
|
|
1460
|
-
let l = this.create_node(
|
|
1548
|
+
let l = this.create_node(We, e, s);
|
|
1461
1549
|
return this.parse_attribute_content(l, i, n), l;
|
|
1462
1550
|
}
|
|
1463
1551
|
// Parse attribute content to extract name, operator, and value
|
|
1464
1552
|
parse_attribute_content(e, t, s) {
|
|
1465
|
-
if (t =
|
|
1466
|
-
let i = t, n = t, l = -1,
|
|
1553
|
+
if (t = be(this.source, t, s), s = Xn(this.source, s, t), t >= s) return;
|
|
1554
|
+
let i = t, n = t, l = -1, a = -1, h = -1;
|
|
1467
1555
|
for (; n < s; ) {
|
|
1468
|
-
let
|
|
1469
|
-
if (
|
|
1556
|
+
let u = this.source.charCodeAt(n);
|
|
1557
|
+
if (ie(u) || u === de || u === ft || u === ze || u === Ni || u === Si || u === V)
|
|
1470
1558
|
break;
|
|
1471
1559
|
n++;
|
|
1472
1560
|
}
|
|
1473
1561
|
n > i && (this.arena.set_content_start_delta(e, i - this.arena.get_start_offset(e)), this.arena.set_content_length(e, n - i));
|
|
1474
|
-
let
|
|
1475
|
-
if (
|
|
1476
|
-
this.arena.set_attr_operator(e,
|
|
1562
|
+
let o = be(this.source, n, s);
|
|
1563
|
+
if (o >= s) {
|
|
1564
|
+
this.arena.set_attr_operator(e, ps), this.arena.set_attr_flags(e, ye);
|
|
1477
1565
|
return;
|
|
1478
1566
|
}
|
|
1479
|
-
let
|
|
1480
|
-
if (
|
|
1481
|
-
l =
|
|
1482
|
-
else if (
|
|
1483
|
-
l =
|
|
1484
|
-
else if (
|
|
1485
|
-
l =
|
|
1486
|
-
else if (
|
|
1487
|
-
l =
|
|
1488
|
-
else if (
|
|
1489
|
-
l =
|
|
1490
|
-
else if (
|
|
1491
|
-
l =
|
|
1567
|
+
let _ = this.source.charCodeAt(o), p = o + 1 < s ? this.source.charCodeAt(o + 1) : 0;
|
|
1568
|
+
if (_ === de)
|
|
1569
|
+
l = o + 1, this.arena.set_attr_operator(e, _r);
|
|
1570
|
+
else if (_ === ft && p === de)
|
|
1571
|
+
l = o + 2, this.arena.set_attr_operator(e, ur);
|
|
1572
|
+
else if (_ === ze && p === de)
|
|
1573
|
+
l = o + 2, this.arena.set_attr_operator(e, fr);
|
|
1574
|
+
else if (_ === Ni && p === de)
|
|
1575
|
+
l = o + 2, this.arena.set_attr_operator(e, pr);
|
|
1576
|
+
else if (_ === Si && p === de)
|
|
1577
|
+
l = o + 2, this.arena.set_attr_operator(e, dr);
|
|
1578
|
+
else if (_ === V && p === de)
|
|
1579
|
+
l = o + 2, this.arena.set_attr_operator(e, gr);
|
|
1492
1580
|
else {
|
|
1493
|
-
this.arena.set_attr_operator(e,
|
|
1581
|
+
this.arena.set_attr_operator(e, ps), this.arena.set_attr_flags(e, ye);
|
|
1494
1582
|
return;
|
|
1495
1583
|
}
|
|
1496
|
-
if (
|
|
1497
|
-
this.arena.set_attr_flags(e,
|
|
1584
|
+
if (o = be(this.source, l, s), o >= s) {
|
|
1585
|
+
this.arena.set_attr_flags(e, ye);
|
|
1498
1586
|
return;
|
|
1499
1587
|
}
|
|
1500
|
-
|
|
1501
|
-
let
|
|
1502
|
-
if (
|
|
1503
|
-
let
|
|
1504
|
-
for (
|
|
1505
|
-
let
|
|
1506
|
-
if (
|
|
1507
|
-
|
|
1588
|
+
a = o;
|
|
1589
|
+
let d = this.source.charCodeAt(o);
|
|
1590
|
+
if (d === $n || d === Bn) {
|
|
1591
|
+
let u = d;
|
|
1592
|
+
for (a = o, o++; o < s; ) {
|
|
1593
|
+
let N = this.source.charCodeAt(o);
|
|
1594
|
+
if (N === u) {
|
|
1595
|
+
o++;
|
|
1508
1596
|
break;
|
|
1509
1597
|
}
|
|
1510
|
-
|
|
1598
|
+
N === 92 ? o += 2 : o++;
|
|
1511
1599
|
}
|
|
1512
|
-
h =
|
|
1600
|
+
h = o;
|
|
1513
1601
|
} else {
|
|
1514
|
-
for (;
|
|
1515
|
-
let
|
|
1516
|
-
if (
|
|
1602
|
+
for (; o < s; ) {
|
|
1603
|
+
let u = this.source.charCodeAt(o);
|
|
1604
|
+
if (ie(u))
|
|
1517
1605
|
break;
|
|
1518
|
-
|
|
1606
|
+
o++;
|
|
1519
1607
|
}
|
|
1520
|
-
h =
|
|
1608
|
+
h = o;
|
|
1521
1609
|
}
|
|
1522
|
-
if (h >
|
|
1523
|
-
let
|
|
1524
|
-
|
|
1610
|
+
if (h > a && (this.arena.set_value_start_delta(e, a - this.arena.get_start_offset(e)), this.arena.set_value_length(e, h - a)), o = be(this.source, h, s), o < s) {
|
|
1611
|
+
let u = this.source.charCodeAt(o);
|
|
1612
|
+
u === 105 || u === 73 ? this.arena.set_attr_flags(e, xr) : u === 115 || u === 83 ? this.arena.set_attr_flags(e, mr) : this.arena.set_attr_flags(e, ye);
|
|
1525
1613
|
} else
|
|
1526
|
-
this.arena.set_attr_flags(e,
|
|
1614
|
+
this.arena.set_attr_flags(e, ye);
|
|
1527
1615
|
}
|
|
1528
1616
|
// Parse pseudo-class or pseudo-element (:hover, ::before)
|
|
1529
1617
|
parse_pseudo(e) {
|
|
1530
1618
|
const t = this.lexer.save_position(), s = this.lexer.save_position();
|
|
1531
1619
|
this.skip_whitespace();
|
|
1532
1620
|
let i = !1;
|
|
1533
|
-
this.lexer.pos < this.selector_end && this.source.charCodeAt(this.lexer.pos) ===
|
|
1621
|
+
this.lexer.pos < this.selector_end && this.source.charCodeAt(this.lexer.pos) === Wn ? (i = !0, this.lexer.pos++) : this.lexer.restore_position(s), this.lexer.next_token_fast(!1);
|
|
1534
1622
|
let n = this.lexer.token_type;
|
|
1535
|
-
if (n ===
|
|
1536
|
-
let l = this.create_node(i ?
|
|
1623
|
+
if (n === ae) {
|
|
1624
|
+
let l = this.create_node(i ? Qe : Te, e, this.lexer.token_end);
|
|
1537
1625
|
return this.arena.set_content_start_delta(l, this.lexer.token_start - e), this.arena.set_content_length(l, this.lexer.token_end - this.lexer.token_start), l;
|
|
1538
|
-
} else if (n ===
|
|
1626
|
+
} else if (n === at)
|
|
1539
1627
|
return this.parse_pseudo_function_after_colon(e, i);
|
|
1540
1628
|
return this.lexer.restore_position(t), null;
|
|
1541
1629
|
}
|
|
@@ -1545,37 +1633,37 @@ class Bn {
|
|
|
1545
1633
|
}
|
|
1546
1634
|
// Parse pseudo-class function after we've seen the colon
|
|
1547
1635
|
parse_pseudo_function_after_colon(e, t) {
|
|
1548
|
-
let s = this.lexer.token_start, i = this.lexer.token_end - 1, n = this.lexer.pos, l = n,
|
|
1549
|
-
for (; this.lexer.pos < this.selector_end &&
|
|
1636
|
+
let s = this.lexer.token_start, i = this.lexer.token_end - 1, n = this.lexer.pos, l = n, a = 1, h = this.lexer.token_end;
|
|
1637
|
+
for (; this.lexer.pos < this.selector_end && a > 0; ) {
|
|
1550
1638
|
this.lexer.next_token_fast(!1);
|
|
1551
|
-
let
|
|
1552
|
-
if (
|
|
1553
|
-
|
|
1554
|
-
else if (
|
|
1639
|
+
let _ = this.lexer.token_type;
|
|
1640
|
+
if (_ === ji || _ === at)
|
|
1641
|
+
a++;
|
|
1642
|
+
else if (_ === Xi && (a--, a === 0)) {
|
|
1555
1643
|
l = this.lexer.token_start, h = this.lexer.token_end;
|
|
1556
1644
|
break;
|
|
1557
1645
|
}
|
|
1558
1646
|
}
|
|
1559
|
-
let
|
|
1560
|
-
if (this.arena.set_content_start_delta(
|
|
1561
|
-
let
|
|
1562
|
-
if (this.is_nth_pseudo(
|
|
1563
|
-
let
|
|
1564
|
-
|
|
1565
|
-
} else if (
|
|
1566
|
-
this.parse_lang_identifiers(n, l,
|
|
1647
|
+
let o = this.create_node(t ? Qe : Te, e, h);
|
|
1648
|
+
if (this.arena.set_content_start_delta(o, s - e), this.arena.set_content_length(o, i - s), this.arena.set_flag(o, cr), l > n) {
|
|
1649
|
+
let _ = this.source.substring(s, i);
|
|
1650
|
+
if (this.is_nth_pseudo(_)) {
|
|
1651
|
+
let p = this.parse_nth_expression(n, l);
|
|
1652
|
+
p !== null && this.arena.set_first_child(o, p);
|
|
1653
|
+
} else if (Q("lang", _))
|
|
1654
|
+
this.parse_lang_identifiers(n, l, o);
|
|
1567
1655
|
else {
|
|
1568
|
-
let
|
|
1569
|
-
const
|
|
1570
|
-
let
|
|
1571
|
-
this.selector_end =
|
|
1656
|
+
let p = this.selector_end;
|
|
1657
|
+
const d = this.lexer.save_position();
|
|
1658
|
+
let u = Q("has", _), N = this.parse_selector(n, l, this.lexer.line, this.lexer.column, u);
|
|
1659
|
+
this.selector_end = p, this.lexer.restore_position(d), N !== null && this.arena.set_first_child(o, N);
|
|
1572
1660
|
}
|
|
1573
1661
|
}
|
|
1574
|
-
return
|
|
1662
|
+
return o;
|
|
1575
1663
|
}
|
|
1576
1664
|
// Check if pseudo-class name is an nth-* pseudo
|
|
1577
1665
|
is_nth_pseudo(e) {
|
|
1578
|
-
return
|
|
1666
|
+
return Q("nth-child", e) || Q("nth-last-child", e) || Q("nth-of-type", e) || Q("nth-last-of-type", e) || Q("nth-col", e) || Q("nth-last-col", e);
|
|
1579
1667
|
}
|
|
1580
1668
|
// Parse :lang() content - comma-separated language identifiers
|
|
1581
1669
|
// Accepts both quoted strings: :lang("en", "fr") and unquoted: :lang(en, fr)
|
|
@@ -1583,14 +1671,14 @@ class Bn {
|
|
|
1583
1671
|
let i = this.selector_end;
|
|
1584
1672
|
const n = this.lexer.save_position();
|
|
1585
1673
|
this.lexer.pos = e, this.selector_end = t;
|
|
1586
|
-
let l = null,
|
|
1674
|
+
let l = null, a = null;
|
|
1587
1675
|
for (; this.lexer.pos < t; ) {
|
|
1588
1676
|
this.lexer.next_token_fast(!1);
|
|
1589
|
-
let h = this.lexer.token_type,
|
|
1590
|
-
if (h !==
|
|
1591
|
-
if (h ===
|
|
1592
|
-
let
|
|
1593
|
-
l === null && (l =
|
|
1677
|
+
let h = this.lexer.token_type, o = this.lexer.token_start, _ = this.lexer.token_end;
|
|
1678
|
+
if (h !== os && h !== $e) {
|
|
1679
|
+
if (h === Gi || h === ae) {
|
|
1680
|
+
let p = this.create_node(or, o, _);
|
|
1681
|
+
l === null && (l = p), a !== null && this.arena.set_next_sibling(a, p), a = p;
|
|
1594
1682
|
}
|
|
1595
1683
|
if (this.lexer.pos >= t)
|
|
1596
1684
|
break;
|
|
@@ -1603,26 +1691,26 @@ class Bn {
|
|
|
1603
1691
|
parse_nth_expression(e, t) {
|
|
1604
1692
|
let s = this.find_of_keyword(e, t);
|
|
1605
1693
|
if (s !== -1) {
|
|
1606
|
-
let n = new
|
|
1607
|
-
l =
|
|
1608
|
-
let
|
|
1694
|
+
let n = new Li(this.arena, this.source).parse_anplusb(e, s, this.lexer.line), l = s + 2;
|
|
1695
|
+
l = jn(this.source, l, t);
|
|
1696
|
+
let a = this.selector_end;
|
|
1609
1697
|
const h = this.lexer.save_position();
|
|
1610
1698
|
this.selector_end = t, this.lexer.pos = l;
|
|
1611
|
-
let
|
|
1612
|
-
this.selector_end =
|
|
1613
|
-
let
|
|
1614
|
-
return n !== null &&
|
|
1699
|
+
let o = this.parse_selector_list();
|
|
1700
|
+
this.selector_end = a, this.lexer.restore_position(h);
|
|
1701
|
+
let _ = this.arena.create_node(le, e, t - e, this.lexer.line, 1);
|
|
1702
|
+
return n !== null && o !== null ? (this.arena.set_first_child(_, n), this.arena.set_next_sibling(n, o)) : n !== null && this.arena.set_first_child(_, n), _;
|
|
1615
1703
|
} else
|
|
1616
|
-
return new
|
|
1704
|
+
return new Li(this.arena, this.source).parse_anplusb(e, t, this.lexer.line);
|
|
1617
1705
|
}
|
|
1618
1706
|
// Find the position of standalone "of" keyword (case-insensitive)
|
|
1619
1707
|
find_of_keyword(e, t) {
|
|
1620
1708
|
let s = e;
|
|
1621
|
-
for (; s < t - 1 && (s =
|
|
1709
|
+
for (; s < t - 1 && (s = be(this.source, s, t), !(s >= t - 1)); ) {
|
|
1622
1710
|
let i = this.source.charCodeAt(s), n = this.source.charCodeAt(s + 1);
|
|
1623
1711
|
if ((i === 111 || i === 79) && (n === 102 || n === 70)) {
|
|
1624
|
-
let l = s === e ||
|
|
1625
|
-
if (l &&
|
|
1712
|
+
let l = s === e || ie(this.source.charCodeAt(s - 1)), a = s + 2 >= t || ie(this.source.charCodeAt(s + 2));
|
|
1713
|
+
if (l && a)
|
|
1626
1714
|
return s;
|
|
1627
1715
|
}
|
|
1628
1716
|
s++;
|
|
@@ -1641,13 +1729,13 @@ class Bn {
|
|
|
1641
1729
|
skip_whitespace() {
|
|
1642
1730
|
for (; this.lexer.pos < this.selector_end; ) {
|
|
1643
1731
|
let e = this.source.charCodeAt(this.lexer.pos);
|
|
1644
|
-
if (
|
|
1732
|
+
if (ie(e)) {
|
|
1645
1733
|
this.lexer.advance();
|
|
1646
1734
|
continue;
|
|
1647
1735
|
}
|
|
1648
|
-
if (e ===
|
|
1736
|
+
if (e === Ue && this.lexer.pos + 1 < this.selector_end && this.source.charCodeAt(this.lexer.pos + 1) === V) {
|
|
1649
1737
|
for (this.lexer.advance(2); this.lexer.pos < this.selector_end; ) {
|
|
1650
|
-
if (this.source.charCodeAt(this.lexer.pos) ===
|
|
1738
|
+
if (this.source.charCodeAt(this.lexer.pos) === V && this.lexer.pos + 1 < this.selector_end && this.source.charCodeAt(this.lexer.pos + 1) === Ue) {
|
|
1651
1739
|
this.lexer.advance(2);
|
|
1652
1740
|
break;
|
|
1653
1741
|
}
|
|
@@ -1659,34 +1747,34 @@ class Bn {
|
|
|
1659
1747
|
}
|
|
1660
1748
|
}
|
|
1661
1749
|
}
|
|
1662
|
-
function
|
|
1663
|
-
const e = new
|
|
1750
|
+
function sl(r) {
|
|
1751
|
+
const e = new dt(dt.capacity_for_source(r.length)), s = new tl(e, r).parse_selector(0, r.length);
|
|
1664
1752
|
if (s === null) {
|
|
1665
|
-
const i = e.create_node(
|
|
1666
|
-
return new
|
|
1753
|
+
const i = e.create_node(wt, 0, 0, 1, 1);
|
|
1754
|
+
return new Ve(e, r, i);
|
|
1667
1755
|
}
|
|
1668
|
-
return new
|
|
1756
|
+
return new Ve(e, r, s);
|
|
1669
1757
|
}
|
|
1670
|
-
function
|
|
1758
|
+
function il(r, e) {
|
|
1671
1759
|
return r[0] === e[0] ? r[1] === e[1] ? r[2] - e[2] : r[1] - e[1] : r[0] - e[0];
|
|
1672
1760
|
}
|
|
1673
|
-
function
|
|
1674
|
-
return r.sort(
|
|
1761
|
+
function Ui(r) {
|
|
1762
|
+
return r.sort(il).at(-1);
|
|
1675
1763
|
}
|
|
1676
|
-
const
|
|
1677
|
-
var n, l, o;
|
|
1764
|
+
const gt = (r) => {
|
|
1765
|
+
var n, l, a, h, o;
|
|
1678
1766
|
let e = 0, t = 0, s = 0, i = r.first_child;
|
|
1679
1767
|
for (; i; ) {
|
|
1680
1768
|
switch (i.type) {
|
|
1681
|
-
case
|
|
1769
|
+
case Tr:
|
|
1682
1770
|
e += 1;
|
|
1683
1771
|
break;
|
|
1684
|
-
case
|
|
1685
|
-
case
|
|
1772
|
+
case xs:
|
|
1773
|
+
case vr:
|
|
1686
1774
|
t += 1;
|
|
1687
1775
|
break;
|
|
1688
|
-
case
|
|
1689
|
-
switch (i.name.toLowerCase()) {
|
|
1776
|
+
case Le:
|
|
1777
|
+
switch ((n = i.name) == null ? void 0 : n.toLowerCase()) {
|
|
1690
1778
|
// "The specificity of a :where() pseudo-class is replaced by zero."
|
|
1691
1779
|
case "where":
|
|
1692
1780
|
break;
|
|
@@ -1701,10 +1789,10 @@ const _t = (r) => {
|
|
|
1701
1789
|
case "not":
|
|
1702
1790
|
case "has":
|
|
1703
1791
|
if (i.has_children) {
|
|
1704
|
-
const
|
|
1705
|
-
if ((
|
|
1706
|
-
const
|
|
1707
|
-
e +=
|
|
1792
|
+
const u = i.first_child;
|
|
1793
|
+
if ((u == null ? void 0 : u.type) === ms) {
|
|
1794
|
+
const N = Ui(Ii(u));
|
|
1795
|
+
e += N[0], t += N[1], s += N[2];
|
|
1708
1796
|
}
|
|
1709
1797
|
}
|
|
1710
1798
|
break;
|
|
@@ -1712,10 +1800,10 @@ const _t = (r) => {
|
|
|
1712
1800
|
case "nth-child":
|
|
1713
1801
|
case "nth-last-child":
|
|
1714
1802
|
t += 1;
|
|
1715
|
-
const
|
|
1716
|
-
if ((
|
|
1717
|
-
const
|
|
1718
|
-
e +=
|
|
1803
|
+
const p = i.first_child;
|
|
1804
|
+
if ((p == null ? void 0 : p.type) === Rr && p.selector) {
|
|
1805
|
+
const u = Ui(Ii(p.selector));
|
|
1806
|
+
e += u[0], t += u[1], s += u[2];
|
|
1719
1807
|
}
|
|
1720
1808
|
break;
|
|
1721
1809
|
// "The specificity of :host is that of a pseudo-class. The specificity of :host() is that of a pseudo-class, plus the specificity of its argument."
|
|
@@ -1723,14 +1811,14 @@ const _t = (r) => {
|
|
|
1723
1811
|
case "host-context":
|
|
1724
1812
|
case "host":
|
|
1725
1813
|
t += 1;
|
|
1726
|
-
const
|
|
1727
|
-
if ((
|
|
1728
|
-
let
|
|
1729
|
-
for (;
|
|
1730
|
-
const
|
|
1731
|
-
first_child:
|
|
1814
|
+
const d = (l = i.first_child) == null ? void 0 : l.first_child;
|
|
1815
|
+
if ((d == null ? void 0 : d.type) === me) {
|
|
1816
|
+
let u = d.first_child;
|
|
1817
|
+
for (; u && u.type !== rs; ) {
|
|
1818
|
+
const N = gt({
|
|
1819
|
+
first_child: u
|
|
1732
1820
|
});
|
|
1733
|
-
e +=
|
|
1821
|
+
e += N[0] ?? 0, t += N[1] ?? 0, s += N[2] ?? 0, u = u.next_sibling;
|
|
1734
1822
|
}
|
|
1735
1823
|
}
|
|
1736
1824
|
break;
|
|
@@ -1747,19 +1835,19 @@ const _t = (r) => {
|
|
|
1747
1835
|
break;
|
|
1748
1836
|
}
|
|
1749
1837
|
break;
|
|
1750
|
-
case
|
|
1751
|
-
switch (i.name.toLowerCase()) {
|
|
1838
|
+
case pt:
|
|
1839
|
+
switch ((a = i.name) == null ? void 0 : a.toLowerCase()) {
|
|
1752
1840
|
// "The specificity of ::slotted() is that of a pseudo-element, plus the specificity of its argument."
|
|
1753
1841
|
case "slotted":
|
|
1754
1842
|
s += 1;
|
|
1755
|
-
const
|
|
1756
|
-
if ((
|
|
1757
|
-
let
|
|
1758
|
-
for (;
|
|
1759
|
-
const
|
|
1760
|
-
first_child:
|
|
1843
|
+
const p = (h = i.first_child) == null ? void 0 : h.first_child;
|
|
1844
|
+
if ((p == null ? void 0 : p.type) === me) {
|
|
1845
|
+
let d = p.first_child;
|
|
1846
|
+
for (; d && d.type !== rs; ) {
|
|
1847
|
+
const u = gt({
|
|
1848
|
+
first_child: d
|
|
1761
1849
|
});
|
|
1762
|
-
e +=
|
|
1850
|
+
e += u[0] ?? 0, t += u[1] ?? 0, s += u[2] ?? 0, d = d.next_sibling;
|
|
1763
1851
|
}
|
|
1764
1852
|
}
|
|
1765
1853
|
break;
|
|
@@ -1776,37 +1864,37 @@ const _t = (r) => {
|
|
|
1776
1864
|
break;
|
|
1777
1865
|
}
|
|
1778
1866
|
break;
|
|
1779
|
-
case
|
|
1780
|
-
let
|
|
1781
|
-
|
|
1867
|
+
case gs:
|
|
1868
|
+
let _ = i.name ?? "";
|
|
1869
|
+
_.includes("|") && (_ = _.split("|")[1] ?? ""), _ !== "*" && (s += 1);
|
|
1782
1870
|
break;
|
|
1783
1871
|
}
|
|
1784
1872
|
i = i.next_sibling;
|
|
1785
1873
|
}
|
|
1786
1874
|
return [e, t, s];
|
|
1787
|
-
},
|
|
1875
|
+
}, rl = (r) => {
|
|
1788
1876
|
if (typeof r == "string")
|
|
1789
1877
|
try {
|
|
1790
|
-
return
|
|
1878
|
+
return sl(r);
|
|
1791
1879
|
} catch (e) {
|
|
1792
1880
|
const t = e instanceof Error ? e.message : String(e);
|
|
1793
1881
|
throw new TypeError(`Could not convert passed in source '${r}' to SelectorList: ${t}`);
|
|
1794
1882
|
}
|
|
1795
1883
|
if (r instanceof Object) {
|
|
1796
|
-
if (r.type ===
|
|
1884
|
+
if (r.type === ms)
|
|
1797
1885
|
return r;
|
|
1798
1886
|
throw new TypeError("Passed in source is an Object but no AST / AST of the type SelectorList");
|
|
1799
1887
|
}
|
|
1800
1888
|
throw new TypeError("Passed in source is not a String nor an Object. I don't know what to do with it.");
|
|
1801
|
-
},
|
|
1889
|
+
}, Ii = (r) => {
|
|
1802
1890
|
if (!r)
|
|
1803
1891
|
return [];
|
|
1804
|
-
const e =
|
|
1892
|
+
const e = rl(r), t = [];
|
|
1805
1893
|
let s = e.first_child;
|
|
1806
1894
|
for (; s; )
|
|
1807
|
-
t.push(
|
|
1895
|
+
t.push(gt(s)), s = s.next_sibling;
|
|
1808
1896
|
return t;
|
|
1809
|
-
},
|
|
1897
|
+
}, nl = new B([
|
|
1810
1898
|
// CSS Named Colors
|
|
1811
1899
|
// Spec: https://drafts.csswg.org/css-color/#named-colors
|
|
1812
1900
|
// Heuristic: popular names first for quick finding in set.has()
|
|
@@ -1959,7 +2047,7 @@ const _t = (r) => {
|
|
|
1959
2047
|
"mediumorchid",
|
|
1960
2048
|
"darksalmon",
|
|
1961
2049
|
"mediumspringgreen"
|
|
1962
|
-
]),
|
|
2050
|
+
]), ll = new B([
|
|
1963
2051
|
// CSS System Colors
|
|
1964
2052
|
// Spec: https://drafts.csswg.org/css-color/#css-system-colors
|
|
1965
2053
|
"accentcolor",
|
|
@@ -1981,7 +2069,7 @@ const _t = (r) => {
|
|
|
1981
2069
|
"selecteditem",
|
|
1982
2070
|
"selecteditemtext",
|
|
1983
2071
|
"visitedtext"
|
|
1984
|
-
]),
|
|
2072
|
+
]), ol = new B(["rgba", "rgb", "hsla", "hsl", "oklch", "color", "hwb", "lch", "lab", "oklab"]), al = new B(["transparent", "currentcolor"]), xt = new B([
|
|
1985
2073
|
"auto",
|
|
1986
2074
|
"none",
|
|
1987
2075
|
// for `text-shadow`, `box-shadow` and `background`
|
|
@@ -1991,13 +2079,13 @@ const _t = (r) => {
|
|
|
1991
2079
|
"revert",
|
|
1992
2080
|
"revert-layer"
|
|
1993
2081
|
]);
|
|
1994
|
-
function
|
|
2082
|
+
function hl(r) {
|
|
1995
2083
|
for (let e of r.children)
|
|
1996
|
-
if (!(e.type ===
|
|
2084
|
+
if (!(e.type === ds && e.value === 0) && !(e.type === mt && e.value === 0))
|
|
1997
2085
|
return !1;
|
|
1998
2086
|
return !0;
|
|
1999
2087
|
}
|
|
2000
|
-
const
|
|
2088
|
+
const ss = new B(["caption", "icon", "menu", "message-box", "small-caption", "status-bar"]), cl = new B([
|
|
2001
2089
|
/* <absolute-size> values */
|
|
2002
2090
|
"xx-small",
|
|
2003
2091
|
"x-small",
|
|
@@ -2010,45 +2098,46 @@ const ts = new $(["caption", "icon", "menu", "message-box", "small-caption", "st
|
|
|
2010
2098
|
/* <relative-size> values */
|
|
2011
2099
|
"smaller",
|
|
2012
2100
|
"larger"
|
|
2013
|
-
]),
|
|
2014
|
-
function
|
|
2101
|
+
]), _l = 44, Hi = 47;
|
|
2102
|
+
function ul(r, e) {
|
|
2103
|
+
var a;
|
|
2015
2104
|
let t = [void 0, void 0], s, i;
|
|
2016
|
-
if (r.first_child.type ===
|
|
2105
|
+
if (r.first_child.type === ks && ((a = r.first_child.name) == null ? void 0 : a.toLowerCase()) === "var")
|
|
2017
2106
|
return null;
|
|
2018
2107
|
let n;
|
|
2019
|
-
for (let
|
|
2020
|
-
let
|
|
2021
|
-
if (
|
|
2108
|
+
for (let h of r.children) {
|
|
2109
|
+
let o = h.next_sibling;
|
|
2110
|
+
if (h.type === _e && xt.has(h.name) && e({
|
|
2022
2111
|
type: "keyword",
|
|
2023
|
-
value:
|
|
2024
|
-
}),
|
|
2025
|
-
s =
|
|
2112
|
+
value: h.name
|
|
2113
|
+
}), o && o.type === Re && o.text.charCodeAt(0) === Hi) {
|
|
2114
|
+
s = h.text, n = h;
|
|
2026
2115
|
continue;
|
|
2027
2116
|
}
|
|
2028
|
-
if ((n == null ? void 0 : n.type) ===
|
|
2029
|
-
i =
|
|
2117
|
+
if ((n == null ? void 0 : n.type) === Re && n.text.charCodeAt(0) === Hi) {
|
|
2118
|
+
i = h.text, n = h;
|
|
2030
2119
|
continue;
|
|
2031
2120
|
}
|
|
2032
|
-
if ((
|
|
2033
|
-
t[0] =
|
|
2121
|
+
if ((o == null ? void 0 : o.type) === Re && o.text.charCodeAt(0) === _l && !t[0]) {
|
|
2122
|
+
t[0] = h, !s && n && (s = n.text), n = h;
|
|
2034
2123
|
continue;
|
|
2035
2124
|
}
|
|
2036
|
-
if (
|
|
2037
|
-
t[1] =
|
|
2125
|
+
if (h.next_sibling === null) {
|
|
2126
|
+
t[1] = h, !s && !t[0] && n && (s = n.text), n = h;
|
|
2038
2127
|
continue;
|
|
2039
2128
|
}
|
|
2040
|
-
if (
|
|
2041
|
-
n =
|
|
2129
|
+
if (h.type === ds) {
|
|
2130
|
+
n = h;
|
|
2042
2131
|
continue;
|
|
2043
2132
|
}
|
|
2044
|
-
if (
|
|
2045
|
-
let
|
|
2046
|
-
if (
|
|
2047
|
-
s =
|
|
2133
|
+
if (h.type === _e) {
|
|
2134
|
+
let _ = h.name;
|
|
2135
|
+
if (_ && cl.has(_)) {
|
|
2136
|
+
s = _, n = h;
|
|
2048
2137
|
continue;
|
|
2049
2138
|
}
|
|
2050
2139
|
}
|
|
2051
|
-
n =
|
|
2140
|
+
n = h;
|
|
2052
2141
|
}
|
|
2053
2142
|
let l = t[0] || t[1] ? r.text.substring(
|
|
2054
2143
|
((t == null ? void 0 : t[0]) || (t == null ? void 0 : t[1]) || { start: r.start }).start - r.start,
|
|
@@ -2062,98 +2151,96 @@ function el(r, e) {
|
|
|
2062
2151
|
font_family: l
|
|
2063
2152
|
};
|
|
2064
2153
|
}
|
|
2065
|
-
const
|
|
2066
|
-
function
|
|
2154
|
+
const fl = new B(["linear", "ease", "ease-in", "ease-out", "ease-in-out", "step-start", "step-end"]), pl = new B(["cubic-bezier", "steps"]);
|
|
2155
|
+
function dl(r, e) {
|
|
2067
2156
|
let t = !1;
|
|
2068
2157
|
for (let s of r) {
|
|
2069
2158
|
let i = s.type, n = s.name;
|
|
2070
|
-
i ===
|
|
2159
|
+
i === Re ? t = !1 : i === mt && t === !1 ? (t = !0, e({
|
|
2071
2160
|
type: "duration",
|
|
2072
2161
|
value: s
|
|
2073
|
-
})) : i ===
|
|
2162
|
+
})) : i === _e && n ? fl.has(n) ? e({
|
|
2074
2163
|
type: "fn",
|
|
2075
2164
|
value: s
|
|
2076
|
-
}) :
|
|
2165
|
+
}) : xt.has(n) && e({
|
|
2077
2166
|
type: "keyword",
|
|
2078
2167
|
value: s
|
|
2079
|
-
}) : i ===
|
|
2168
|
+
}) : i === ks && n && pl.has(n) && e({
|
|
2080
2169
|
type: "fn",
|
|
2081
2170
|
value: s
|
|
2082
2171
|
});
|
|
2083
2172
|
}
|
|
2084
2173
|
}
|
|
2085
|
-
function
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
return e = !0, Q;
|
|
2090
|
-
}), e;
|
|
2174
|
+
function gl(r, e) {
|
|
2175
|
+
$(r, function(t) {
|
|
2176
|
+
t.is_vendor_prefixed && e(t.name || t.text);
|
|
2177
|
+
});
|
|
2091
2178
|
}
|
|
2092
|
-
var
|
|
2093
|
-
class
|
|
2179
|
+
var he, J, ee, Oe;
|
|
2180
|
+
class f {
|
|
2094
2181
|
constructor(e = !1) {
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
M(this,
|
|
2182
|
+
W(this, he);
|
|
2183
|
+
W(this, J);
|
|
2184
|
+
W(this, ee, []);
|
|
2185
|
+
W(this, Oe);
|
|
2186
|
+
M(this, he, /* @__PURE__ */ new Map()), M(this, J, 0), e && M(this, ee, []), M(this, Oe, e);
|
|
2100
2187
|
}
|
|
2101
2188
|
p(e, t) {
|
|
2102
|
-
let s = w(this,
|
|
2103
|
-
if (w(this,
|
|
2189
|
+
let s = w(this, J);
|
|
2190
|
+
if (w(this, Oe)) {
|
|
2104
2191
|
let i = s * 4;
|
|
2105
|
-
w(this,
|
|
2192
|
+
w(this, ee)[i] = t.line, w(this, ee)[i + 1] = t.column, w(this, ee)[i + 2] = t.offset, w(this, ee)[i + 3] = t.length;
|
|
2106
2193
|
}
|
|
2107
|
-
if (w(this,
|
|
2108
|
-
w(this,
|
|
2194
|
+
if (w(this, he).has(e)) {
|
|
2195
|
+
w(this, he).get(e).push(s), jt(this, J)._++;
|
|
2109
2196
|
return;
|
|
2110
2197
|
}
|
|
2111
|
-
w(this,
|
|
2198
|
+
w(this, he).set(e, [s]), jt(this, J)._++;
|
|
2112
2199
|
}
|
|
2113
2200
|
size() {
|
|
2114
|
-
return w(this,
|
|
2201
|
+
return w(this, J);
|
|
2115
2202
|
}
|
|
2116
2203
|
c() {
|
|
2117
|
-
let e = /* @__PURE__ */ new Map(), t = {}, s = w(this,
|
|
2118
|
-
i.forEach((h,
|
|
2204
|
+
let e = /* @__PURE__ */ new Map(), t = {}, s = w(this, Oe), i = w(this, he), n = w(this, ee), l = i.size;
|
|
2205
|
+
i.forEach((h, o) => {
|
|
2119
2206
|
if (s) {
|
|
2120
|
-
let
|
|
2121
|
-
let
|
|
2207
|
+
let _ = h.map(function(p) {
|
|
2208
|
+
let d = p * 4;
|
|
2122
2209
|
return {
|
|
2123
|
-
line: n[
|
|
2124
|
-
column: n[
|
|
2125
|
-
offset: n[
|
|
2126
|
-
length: n[
|
|
2210
|
+
line: n[d],
|
|
2211
|
+
column: n[d + 1],
|
|
2212
|
+
offset: n[d + 2],
|
|
2213
|
+
length: n[d + 3]
|
|
2127
2214
|
};
|
|
2128
2215
|
});
|
|
2129
|
-
e.set(
|
|
2216
|
+
e.set(o, _);
|
|
2130
2217
|
} else
|
|
2131
|
-
t[
|
|
2218
|
+
t[o] = h.length;
|
|
2132
2219
|
});
|
|
2133
|
-
let
|
|
2220
|
+
let a = w(this, J);
|
|
2134
2221
|
return s ? {
|
|
2135
|
-
total:
|
|
2222
|
+
total: a,
|
|
2136
2223
|
totalUnique: l,
|
|
2137
2224
|
unique: t,
|
|
2138
|
-
uniquenessRatio:
|
|
2225
|
+
uniquenessRatio: a === 0 ? 0 : l / a,
|
|
2139
2226
|
uniqueWithLocations: Object.fromEntries(e)
|
|
2140
2227
|
} : {
|
|
2141
|
-
total:
|
|
2228
|
+
total: a,
|
|
2142
2229
|
totalUnique: l,
|
|
2143
2230
|
unique: t,
|
|
2144
|
-
uniquenessRatio:
|
|
2231
|
+
uniquenessRatio: a === 0 ? 0 : l / a,
|
|
2145
2232
|
uniqueWithLocations: void 0
|
|
2146
2233
|
};
|
|
2147
2234
|
}
|
|
2148
2235
|
}
|
|
2149
|
-
|
|
2150
|
-
var
|
|
2151
|
-
class
|
|
2236
|
+
he = new WeakMap(), J = new WeakMap(), ee = new WeakMap(), Oe = new WeakMap();
|
|
2237
|
+
var Se, ce, je;
|
|
2238
|
+
class is {
|
|
2152
2239
|
constructor(e) {
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
M(this,
|
|
2240
|
+
W(this, Se);
|
|
2241
|
+
W(this, ce);
|
|
2242
|
+
W(this, je);
|
|
2243
|
+
M(this, Se, new f(e)), M(this, ce, /* @__PURE__ */ new Map()), M(this, je, e);
|
|
2157
2244
|
}
|
|
2158
2245
|
/**
|
|
2159
2246
|
* Add an item to this #list's context
|
|
@@ -2162,45 +2249,45 @@ class ss {
|
|
|
2162
2249
|
* @param node_location
|
|
2163
2250
|
*/
|
|
2164
2251
|
push(e, t, s) {
|
|
2165
|
-
w(this,
|
|
2252
|
+
w(this, Se).p(e, s), w(this, ce).has(t) || w(this, ce).set(t, new f(w(this, je))), w(this, ce).get(t).p(e, s);
|
|
2166
2253
|
}
|
|
2167
2254
|
count() {
|
|
2168
2255
|
let e = /* @__PURE__ */ new Map();
|
|
2169
|
-
for (let [t, s] of w(this,
|
|
2256
|
+
for (let [t, s] of w(this, ce).entries())
|
|
2170
2257
|
e.set(t, s.c());
|
|
2171
|
-
return Object.assign(w(this,
|
|
2258
|
+
return Object.assign(w(this, Se).c(), {
|
|
2172
2259
|
itemsPerContext: Object.fromEntries(e)
|
|
2173
2260
|
});
|
|
2174
2261
|
}
|
|
2175
2262
|
}
|
|
2176
|
-
|
|
2177
|
-
function
|
|
2263
|
+
Se = new WeakMap(), ce = new WeakMap(), je = new WeakMap();
|
|
2264
|
+
function xl(r) {
|
|
2178
2265
|
let e = /* @__PURE__ */ new Map(), t = -1, s = 0, i = 0, n = r.length;
|
|
2179
2266
|
for (let l = 0; l < n; l++) {
|
|
2180
|
-
let
|
|
2181
|
-
e.set(
|
|
2267
|
+
let a = r[l], h = (e.get(a) || 0) + 1;
|
|
2268
|
+
e.set(a, h), h > t && (t = h, s = 0, i = 0), h >= t && (s++, i += a);
|
|
2182
2269
|
}
|
|
2183
2270
|
return i / s;
|
|
2184
2271
|
}
|
|
2185
|
-
var
|
|
2186
|
-
class
|
|
2272
|
+
var te, Ne;
|
|
2273
|
+
class U {
|
|
2187
2274
|
constructor() {
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
M(this,
|
|
2275
|
+
W(this, te);
|
|
2276
|
+
W(this, Ne);
|
|
2277
|
+
M(this, te, []), M(this, Ne, 0);
|
|
2191
2278
|
}
|
|
2192
2279
|
/**
|
|
2193
2280
|
* Add a new Integer at the end of this AggregateCollection
|
|
2194
2281
|
* @param item - The item to add
|
|
2195
2282
|
*/
|
|
2196
2283
|
push(e) {
|
|
2197
|
-
w(this,
|
|
2284
|
+
w(this, te).push(e), M(this, Ne, w(this, Ne) + e);
|
|
2198
2285
|
}
|
|
2199
2286
|
size() {
|
|
2200
|
-
return w(this,
|
|
2287
|
+
return w(this, te).length;
|
|
2201
2288
|
}
|
|
2202
2289
|
aggregate() {
|
|
2203
|
-
let e = w(this,
|
|
2290
|
+
let e = w(this, te).length;
|
|
2204
2291
|
if (e === 0)
|
|
2205
2292
|
return {
|
|
2206
2293
|
min: 0,
|
|
@@ -2210,7 +2297,7 @@ class L {
|
|
|
2210
2297
|
range: 0,
|
|
2211
2298
|
sum: 0
|
|
2212
2299
|
};
|
|
2213
|
-
let t = w(this,
|
|
2300
|
+
let t = w(this, te).slice().sort((a, h) => a - h), s = t[0], i = t[e - 1], n = xl(t), l = w(this, Ne);
|
|
2214
2301
|
return {
|
|
2215
2302
|
min: s,
|
|
2216
2303
|
max: i,
|
|
@@ -2221,59 +2308,46 @@ class L {
|
|
|
2221
2308
|
};
|
|
2222
2309
|
}
|
|
2223
2310
|
toArray() {
|
|
2224
|
-
return w(this,
|
|
2311
|
+
return w(this, te);
|
|
2225
2312
|
}
|
|
2226
2313
|
}
|
|
2227
|
-
|
|
2228
|
-
function
|
|
2229
|
-
return r.replaceAll(/(?:^['"])|(?:['"]$)/g, "");
|
|
2230
|
-
}
|
|
2231
|
-
function ol(r, e) {
|
|
2232
|
-
return e >= 65 && e <= 90 && (e = e | 32), r === e;
|
|
2233
|
-
}
|
|
2234
|
-
function Ge(r, e) {
|
|
2235
|
-
if (r === e) return !0;
|
|
2236
|
-
let t = e.length, s = t - r.length;
|
|
2237
|
-
if (s < 0)
|
|
2238
|
-
return !1;
|
|
2239
|
-
for (let i = t - 1; i >= s; i--)
|
|
2240
|
-
if (ol(r.charCodeAt(i - s), e.charCodeAt(i)) === !1)
|
|
2241
|
-
return !1;
|
|
2242
|
-
return !0;
|
|
2243
|
-
}
|
|
2244
|
-
function fl(r) {
|
|
2245
|
-
if (xs(r) || ms(r)) return !1;
|
|
2246
|
-
let e = r.charCodeAt(0);
|
|
2247
|
-
return e === 47 || // /
|
|
2248
|
-
e === 42 || // *
|
|
2249
|
-
e === 95 || // _
|
|
2250
|
-
e === 43 || // +
|
|
2251
|
-
e === 38 || // &
|
|
2252
|
-
e === 36 || // $
|
|
2253
|
-
e === 35;
|
|
2254
|
-
}
|
|
2255
|
-
function m(r, e) {
|
|
2256
|
-
return xs(e) ? !1 : Ge(r, e);
|
|
2257
|
-
}
|
|
2258
|
-
function al(r) {
|
|
2259
|
-
return ms(r) ? r.slice(r.indexOf("-", 2) + 1) : r;
|
|
2260
|
-
}
|
|
2261
|
-
function hl(r) {
|
|
2314
|
+
te = new WeakMap(), Ne = new WeakMap();
|
|
2315
|
+
function ml(r) {
|
|
2262
2316
|
let e = 5, t = r.indexOf(";"), s = r.indexOf(",");
|
|
2263
2317
|
return t === -1 || s !== -1 && s < t ? r.substring(e, s) : r.substring(e, t);
|
|
2264
2318
|
}
|
|
2265
|
-
function
|
|
2319
|
+
function Pi(r) {
|
|
2266
2320
|
let e = r.children;
|
|
2267
2321
|
if (e) {
|
|
2268
2322
|
let t = e.at(-1);
|
|
2269
|
-
return !!(t && t.type ===
|
|
2323
|
+
return !!(t && t.type === _e && ns("\\9", t.text));
|
|
2270
2324
|
}
|
|
2271
2325
|
return !1;
|
|
2272
2326
|
}
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2327
|
+
const kl = /* @__PURE__ */ new Set([
|
|
2328
|
+
"margin",
|
|
2329
|
+
"margin-block",
|
|
2330
|
+
"margin-inline",
|
|
2331
|
+
"margin-top",
|
|
2332
|
+
"margin-block-start",
|
|
2333
|
+
"margin-block-end",
|
|
2334
|
+
"margin-inline-end",
|
|
2335
|
+
"margin-inline-end",
|
|
2336
|
+
"margin-right",
|
|
2337
|
+
"margin-bottom",
|
|
2338
|
+
"margin-left",
|
|
2339
|
+
"padding",
|
|
2340
|
+
"padding-block",
|
|
2341
|
+
"padding-inline",
|
|
2342
|
+
"padding-top",
|
|
2343
|
+
"padding-right",
|
|
2344
|
+
"padding-bottom",
|
|
2345
|
+
"padding-left",
|
|
2346
|
+
"padding-block-start",
|
|
2347
|
+
"padding-block-end",
|
|
2348
|
+
"padding-inline-start",
|
|
2349
|
+
"padding-inline-end"
|
|
2350
|
+
]), wl = new B([
|
|
2277
2351
|
"border-radius",
|
|
2278
2352
|
"border-top-left-radius",
|
|
2279
2353
|
"border-top-right-radius",
|
|
@@ -2284,466 +2358,496 @@ let cl = new $([
|
|
|
2284
2358
|
"border-end-end-radius",
|
|
2285
2359
|
"border-end-start-radius"
|
|
2286
2360
|
]);
|
|
2287
|
-
function
|
|
2361
|
+
function Al(r) {
|
|
2362
|
+
if (ws(r) || As(r)) return !1;
|
|
2363
|
+
let e = r.charCodeAt(0);
|
|
2364
|
+
return e === 47 || // /
|
|
2365
|
+
e === 42 || // *
|
|
2366
|
+
e === 95 || // _
|
|
2367
|
+
e === 43 || // +
|
|
2368
|
+
e === 38 || // &
|
|
2369
|
+
e === 36 || // $
|
|
2370
|
+
e === 35;
|
|
2371
|
+
}
|
|
2372
|
+
function Di(r) {
|
|
2373
|
+
return ws(r) ? r : As(r) ? r.slice(r.indexOf("-", 2) + 1).toLowerCase() : Al(r) ? r.slice(1).toLowerCase() : r.toLowerCase();
|
|
2374
|
+
}
|
|
2375
|
+
function yl(r) {
|
|
2376
|
+
return As(r);
|
|
2377
|
+
}
|
|
2378
|
+
function I(r, e) {
|
|
2288
2379
|
return e === 0 ? 0 : r / e;
|
|
2289
2380
|
}
|
|
2290
|
-
function
|
|
2291
|
-
return e.useLocations === !0 ?
|
|
2381
|
+
function bl(r, e = {}) {
|
|
2382
|
+
return e.useLocations === !0 ? Fi(r, e, !0) : Fi(r, e, !1);
|
|
2292
2383
|
}
|
|
2293
|
-
function
|
|
2294
|
-
let s = Date.now(), i = (r.match(/\n/g) || []).length + 1, n = 0, l = 0,
|
|
2384
|
+
function Fi(r, e, t) {
|
|
2385
|
+
let s = Date.now(), i = (r.match(/\n/g) || []).length + 1, n = 0, l = 0, a = 0, h = {
|
|
2295
2386
|
total: 0,
|
|
2296
2387
|
unique: /* @__PURE__ */ new Map()
|
|
2297
|
-
},
|
|
2298
|
-
on_comment({ length:
|
|
2299
|
-
n++, l +=
|
|
2388
|
+
}, o = Date.now(), _ = Or(r, {
|
|
2389
|
+
on_comment({ length: c }) {
|
|
2390
|
+
n++, l += c;
|
|
2300
2391
|
}
|
|
2301
|
-
}),
|
|
2302
|
-
function
|
|
2392
|
+
}), p = Date.now(), d = new f(t), u = new U(), N = [], ys = new f(t), Xe = new f(t), bs = new f(t), Rs = new f(t), vs = new f(t), Ts = new f(t), Os = new f(t), At = new f(t), Ss = new f(t), Et = new f(t), Ct = new f(t), Ns = new f(t), Ze = new f(t), Ls = new f(t), yt = new U(), Us = new f(t), bt = 0, Rt = 0, vt = new U(), Tt = new U(), Ot = new U(), Is = new f(t), Hs = new f(t), Ps = new f(t), St = new U(), Ds = new f(t), Nt = new f(t), Fs = /* @__PURE__ */ new Set(), Lt = new f(t), ue, fe, Ms = new U(), zs = new U(), qs = new U(), Ks = new f(t), Je = new U(), $s = new f(t), Bs = [], Ut = new f(t), It = new f(t), Gs = new f(t), Ws = new f(t), Ht = new U(), Ys = new f(t), Qs = /* @__PURE__ */ new Set(), Ie = 0, Vs = new U(), et = 0, Pt = 0, Dt = new f(t), Ft = new U(), js = new f(t), He = new f(t), Mt = new f(t), zt = new f(t), tt = new f(t), Pe = new U(), qt = new U(), Xs = new f(t), Kt = new f(t), Zs = new f(t), Js = new f(t), ei = new f(t), $t = new f(t), st = new f(t), it = new f(t), Bt = new f(t), rt = new f(t), we = new is(t), Ae = new f(t), ti = new is(t), si = new f(t), De = new f(t), ii = new is(t), ri = new f(t);
|
|
2393
|
+
function A(c) {
|
|
2303
2394
|
return {
|
|
2304
|
-
line:
|
|
2305
|
-
column:
|
|
2306
|
-
offset:
|
|
2307
|
-
length:
|
|
2395
|
+
line: c.line,
|
|
2396
|
+
column: c.column,
|
|
2397
|
+
offset: c.start,
|
|
2398
|
+
length: c.length
|
|
2308
2399
|
};
|
|
2309
2400
|
}
|
|
2310
|
-
let
|
|
2311
|
-
|
|
2312
|
-
var
|
|
2313
|
-
|
|
2314
|
-
let
|
|
2315
|
-
if (
|
|
2316
|
-
let
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
let
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2401
|
+
let Ee = -1;
|
|
2402
|
+
$(_, (c, D) => {
|
|
2403
|
+
var pi, di, gi, xi, mi;
|
|
2404
|
+
Ee >= 0 && D <= Ee && (Ee = -1);
|
|
2405
|
+
let Vt = Ee >= 0 && D > Ee;
|
|
2406
|
+
if (c.type === Sr) {
|
|
2407
|
+
let v = A(c);
|
|
2408
|
+
yt.push(D), Us.p(D, v);
|
|
2409
|
+
let y = Di(c.name ?? "");
|
|
2410
|
+
if (d.p(y, v), y === "font-face") {
|
|
2411
|
+
let k = /* @__PURE__ */ Object.create(null);
|
|
2412
|
+
t && ys.p(c.start, A(c));
|
|
2413
|
+
let g = c.children.find((E) => E.type === Nr);
|
|
2414
|
+
for (let E of (g == null ? void 0 : g.children) || [])
|
|
2415
|
+
E.type === Xt && E.value && (k[E.property] = E.value.text);
|
|
2416
|
+
u.push(1), N.push(k);
|
|
2324
2417
|
}
|
|
2325
|
-
if (
|
|
2326
|
-
|
|
2418
|
+
if (c.prelude === null || c.prelude === void 0)
|
|
2419
|
+
y === "layer" && (Xe.p("<anonymous>", A(c)), u.push(2));
|
|
2327
2420
|
else {
|
|
2328
|
-
let
|
|
2329
|
-
if (
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
else if (
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2421
|
+
let k = 1;
|
|
2422
|
+
if (y === "media")
|
|
2423
|
+
Rs.p(c.prelude.text, A(c)), Fr(c.prelude, (g) => {
|
|
2424
|
+
vs.p(g, A(c)), k++;
|
|
2425
|
+
});
|
|
2426
|
+
else if (y === "supports")
|
|
2427
|
+
At.p(c.prelude.text, A(c)), Dr(c.prelude, (g) => {
|
|
2428
|
+
Ss.p(g, A(c)), k++;
|
|
2429
|
+
});
|
|
2430
|
+
else if (y.endsWith("keyframes")) {
|
|
2431
|
+
let g = c.prelude.text;
|
|
2432
|
+
Et.p(g, A(c)), c.is_vendor_prefixed && (Ct.p(`@${(pi = c.name) == null ? void 0 : pi.toLowerCase()} ${c.prelude.text}`, A(c)), k++), Ee = D;
|
|
2433
|
+
} else if (y === "layer")
|
|
2434
|
+
for (let g of c.prelude.text.split(",").map((E) => E.trim()))
|
|
2435
|
+
Xe.p(g, A(c));
|
|
2436
|
+
else if (y === "import") {
|
|
2437
|
+
if (bs.p(c.prelude.text, A(c)), c.prelude.has_children)
|
|
2438
|
+
for (let g of c.prelude)
|
|
2439
|
+
g.type === zi && typeof g.value == "string" ? At.p(g.value, A(g)) : g.type === Lr && typeof g.value == "string" && Xe.p(g.value, A(g));
|
|
2440
|
+
} else y === "container" ? (Ns.p(c.prelude.text, A(c)), ((di = c.prelude.first_child) == null ? void 0 : di.type) === Ur && ((gi = c.prelude.first_child.first_child) == null ? void 0 : gi.type) === _e && Ze.p(c.prelude.first_child.first_child.text, A(c))) : y === "property" ? Ls.p(c.prelude.text, A(c)) : y === "charset" && Os.p(c.prelude.text.toLowerCase(), A(c));
|
|
2441
|
+
u.push(k);
|
|
2345
2442
|
}
|
|
2346
|
-
} else if (
|
|
2347
|
-
if (
|
|
2348
|
-
if (
|
|
2349
|
-
for (let
|
|
2350
|
-
|
|
2443
|
+
} else if (c.type === Ir)
|
|
2444
|
+
if (Vt && c.prelude) {
|
|
2445
|
+
if (c.prelude.type === ms && c.prelude.children.length > 0)
|
|
2446
|
+
for (let v of c.prelude.children)
|
|
2447
|
+
Nt.p(v.text, A(v));
|
|
2351
2448
|
} else {
|
|
2352
|
-
|
|
2353
|
-
let
|
|
2354
|
-
if (
|
|
2355
|
-
for (const
|
|
2356
|
-
|
|
2357
|
-
if (
|
|
2358
|
-
for (const
|
|
2359
|
-
|
|
2360
|
-
|
|
2449
|
+
bt++, (xi = c.block) != null && xi.is_empty && Rt++;
|
|
2450
|
+
let v = 0, y = 0, k = A(c);
|
|
2451
|
+
if (c.prelude)
|
|
2452
|
+
for (const g of c.prelude.children)
|
|
2453
|
+
g.type === me && v++;
|
|
2454
|
+
if (c.block)
|
|
2455
|
+
for (const g of c.block.children)
|
|
2456
|
+
g.type === Xt && y++;
|
|
2457
|
+
vt.push(v + y), Is.p(v + y, k), Tt.push(v), Hs.p(v, k), Ot.push(y), Ps.p(y, k), St.push(D), Ds.p(D, k);
|
|
2361
2458
|
}
|
|
2362
|
-
else if (
|
|
2363
|
-
if (
|
|
2364
|
-
return
|
|
2365
|
-
let
|
|
2366
|
-
|
|
2367
|
-
let
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2459
|
+
else if (c.type === me) {
|
|
2460
|
+
if (Vt)
|
|
2461
|
+
return H;
|
|
2462
|
+
let v = A(c);
|
|
2463
|
+
Ht.push(D > 0 ? D - 1 : 0), Ys.p(D > 0 ? D - 1 : 0, v), Fs.add(c.text);
|
|
2464
|
+
let y = ls(c);
|
|
2465
|
+
Je.push(y), $s.p(y, v), qr(c, (re) => {
|
|
2466
|
+
Lt.p(re.toLowerCase(), v);
|
|
2467
|
+
}), Kr(c, (re) => {
|
|
2468
|
+
It.p(re, v);
|
|
2469
|
+
}), $r(c, (re) => {
|
|
2470
|
+
Gs.p(re.toLowerCase(), v);
|
|
2471
|
+
}), Br(c, function(G) {
|
|
2472
|
+
let T = G.name.trim() === "" ? " " : G.name;
|
|
2473
|
+
Ws.p(T, G.loc);
|
|
2376
2474
|
});
|
|
2377
|
-
let
|
|
2378
|
-
return
|
|
2379
|
-
} else if (
|
|
2380
|
-
|
|
2381
|
-
let
|
|
2382
|
-
|
|
2383
|
-
let
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
Wt && (Nt++, R++);
|
|
2392
|
-
}
|
|
2393
|
-
Gs.push(R);
|
|
2394
|
-
let { is_important: d, property: _, is_browserhack: z, is_vendor_prefixed: Qt } = a, j = y(a);
|
|
2395
|
-
j.length = _.length, Ue.p(_, j), d && Ze++, Qt ? (Le.push(2), It.p(_, j)) : xs(_) ? (Je.p(_, j), Le.push(d ? 3 : 2), d && Ut.p(_, j)) : z ? (Ht.p(_, j), Le.push(2)) : Le.push(1);
|
|
2475
|
+
let k = gt(c), [g, E, K] = k;
|
|
2476
|
+
return Ks.p(k.toString(), v), Ms.push(g), zs.push(E), qs.push(K), ue === void 0 && (ue = k), fe === void 0 && (fe = k), fe !== void 0 && Mi(fe, k) < 0 && (fe = k), ue !== void 0 && Mi(ue, k) > 0 && (ue = k), Bs.push(k), g > 0 && Ut.p(c.text, v), H;
|
|
2477
|
+
} else if (c.type === Xt) {
|
|
2478
|
+
Ie++, Qs.add(c.text);
|
|
2479
|
+
let v = A(c), y = D > 0 ? D - 1 : 0;
|
|
2480
|
+
Ft.push(y), js.p(y, v);
|
|
2481
|
+
let k = 1;
|
|
2482
|
+
c.is_important && (k++, c.text.toLowerCase().includes("!important") || Kt.p("!ie", A(c.value)), Vt && (Pt++, k++)), Vs.push(k);
|
|
2483
|
+
let { is_important: g, property: E, is_browserhack: K, is_vendor_prefixed: re } = c;
|
|
2484
|
+
if (!E) return;
|
|
2485
|
+
let G = A(c);
|
|
2486
|
+
G.length = E.length;
|
|
2487
|
+
let T = Di(E);
|
|
2488
|
+
He.p(T, G), g && et++, re ? (Pe.push(2), zt.p(E, G)) : ws(E) ? (tt.p(E, G), Pe.push(g ? 3 : 2), g && Dt.p(E, G)) : K ? (Mt.p(E.charAt(0), G), Pe.push(2)) : Pe.push(1);
|
|
2396
2489
|
{
|
|
2397
|
-
let
|
|
2398
|
-
if (
|
|
2399
|
-
|
|
2490
|
+
let P = c.value, { text: L } = P, R = A(P), nt = 1;
|
|
2491
|
+
if (xt.has(L)) {
|
|
2492
|
+
De.p(L.toLowerCase(), R), qt.push(nt);
|
|
2400
2493
|
return;
|
|
2401
2494
|
}
|
|
2402
|
-
if (
|
|
2403
|
-
|
|
2495
|
+
if (gl(P, (x) => {
|
|
2496
|
+
Xs.p(x.toLowerCase(), R), nt++;
|
|
2497
|
+
}), Pi(P) && (Kt.p("\\9", R), L = L.slice(0, -2), nt++), qt.push(nt), kl.has(T))
|
|
2498
|
+
hl(P) && ri.p(T, R);
|
|
2404
2499
|
else {
|
|
2405
|
-
if (
|
|
2406
|
-
return
|
|
2407
|
-
if (
|
|
2408
|
-
if (!
|
|
2409
|
-
let
|
|
2410
|
-
|
|
2500
|
+
if (T === "z-index")
|
|
2501
|
+
return Zs.p(L, R), H;
|
|
2502
|
+
if (T === "font") {
|
|
2503
|
+
if (!ss.has(L)) {
|
|
2504
|
+
let x = ul(P, function(X) {
|
|
2505
|
+
X.type === "keyword" && De.p(X.value.toLowerCase(), R);
|
|
2411
2506
|
});
|
|
2412
|
-
if (!
|
|
2413
|
-
return
|
|
2414
|
-
let { font_size:
|
|
2415
|
-
|
|
2507
|
+
if (!x)
|
|
2508
|
+
return H;
|
|
2509
|
+
let { font_size: j, line_height: S, font_family: O } = x;
|
|
2510
|
+
O && $t.p(O, R), j && st.p(j.toLowerCase(), R), S && it.p(S.toLowerCase(), R);
|
|
2416
2511
|
}
|
|
2417
|
-
} else if (
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
if (
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2512
|
+
} else if (T === "font-size") {
|
|
2513
|
+
if (!ss.has(L)) {
|
|
2514
|
+
let x = L.toLowerCase();
|
|
2515
|
+
x.includes("var(") ? st.p(L, R) : st.p(x, R);
|
|
2516
|
+
}
|
|
2517
|
+
} else {
|
|
2518
|
+
if (T === "font-family")
|
|
2519
|
+
return ss.has(L) || $t.p(L, R), H;
|
|
2520
|
+
if (T === "line-height") {
|
|
2521
|
+
let x = L.toLowerCase();
|
|
2522
|
+
x.includes("var(") ? it.p(L, R) : it.p(x, R);
|
|
2523
|
+
} else {
|
|
2524
|
+
if (T === "transition" || T === "animation")
|
|
2525
|
+
return dl(P.children, function(x) {
|
|
2526
|
+
x.type === "fn" ? Bt.p(x.value.text.toLowerCase(), R) : x.type === "duration" ? rt.p(x.value.text.toLowerCase(), R) : x.type === "keyword" && De.p(x.value.text.toLowerCase(), R);
|
|
2527
|
+
}), H;
|
|
2528
|
+
if (T === "animation-duration" || T === "transition-duration") {
|
|
2529
|
+
for (let x of P.children)
|
|
2530
|
+
if (x.type !== Re) {
|
|
2531
|
+
let j = x.text;
|
|
2532
|
+
/var\(/i.test(j) ? rt.p(j, R) : rt.p(j.toLowerCase(), R);
|
|
2533
|
+
}
|
|
2534
|
+
} else if (T === "transition-timing-function" || T === "animation-timing-function")
|
|
2535
|
+
for (let x of P.children)
|
|
2536
|
+
x.type !== Re && Bt.p(x.text, R);
|
|
2537
|
+
else T === "container-name" ? Ze.p(L, R) : T === "container" ? ((mi = P.first_child) == null ? void 0 : mi.type) === _e && Ze.p(P.first_child.text, R) : wl.has(T) ? ii.push(L, E, R) : T === "text-shadow" ? Js.p(L, R) : T === "box-shadow" && ei.p(L, R);
|
|
2436
2538
|
}
|
|
2437
2539
|
}
|
|
2438
2540
|
}
|
|
2439
|
-
let
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2541
|
+
let Ar = Pi(P);
|
|
2542
|
+
$(P, (x) => {
|
|
2543
|
+
var j;
|
|
2544
|
+
switch (x.type) {
|
|
2545
|
+
case mt: {
|
|
2546
|
+
let S = ((j = x.unit) == null ? void 0 : j.toLowerCase()) ?? "", O = A(x);
|
|
2547
|
+
return ti.push(S, E, O), H;
|
|
2445
2548
|
}
|
|
2446
|
-
case
|
|
2447
|
-
let S =
|
|
2549
|
+
case Hr: {
|
|
2550
|
+
let S = x.text;
|
|
2448
2551
|
if (!S || !S.startsWith("#"))
|
|
2449
|
-
return
|
|
2450
|
-
let
|
|
2451
|
-
|
|
2452
|
-
let X =
|
|
2453
|
-
|
|
2454
|
-
let
|
|
2455
|
-
return
|
|
2552
|
+
return H;
|
|
2553
|
+
let O = S.toLowerCase();
|
|
2554
|
+
Ar && !O.endsWith("\\9") && (O = O + "\\9");
|
|
2555
|
+
let X = O.length - 1;
|
|
2556
|
+
ns("\\9", O) && (X = X - 2);
|
|
2557
|
+
let Fe = A(x);
|
|
2558
|
+
return we.push(O, E, Fe), Ae.p("hex" + X, Fe), H;
|
|
2456
2559
|
}
|
|
2457
|
-
case
|
|
2458
|
-
let S =
|
|
2459
|
-
if (
|
|
2460
|
-
return
|
|
2461
|
-
|
|
2560
|
+
case _e: {
|
|
2561
|
+
let S = x.text, O = A(x);
|
|
2562
|
+
if (T === "font" || T === "font-family")
|
|
2563
|
+
return H;
|
|
2564
|
+
xt.has(S) && De.p(S.toLowerCase(), O);
|
|
2462
2565
|
let X = S.length;
|
|
2463
2566
|
if (X > 20 || X < 3)
|
|
2464
|
-
return
|
|
2465
|
-
if (
|
|
2466
|
-
|
|
2567
|
+
return H;
|
|
2568
|
+
if (al.has(S)) {
|
|
2569
|
+
let Fe = S.toLowerCase();
|
|
2570
|
+
we.push(Fe, E, O), Ae.p(Fe, O);
|
|
2467
2571
|
return;
|
|
2468
2572
|
}
|
|
2469
|
-
if (
|
|
2470
|
-
|
|
2573
|
+
if (nl.has(S)) {
|
|
2574
|
+
we.push(S.toLowerCase(), E, O), Ae.p("named", O);
|
|
2471
2575
|
return;
|
|
2472
2576
|
}
|
|
2473
|
-
if (
|
|
2474
|
-
|
|
2577
|
+
if (ll.has(S)) {
|
|
2578
|
+
we.push(S.toLowerCase(), E, O), Ae.p("system", O);
|
|
2475
2579
|
return;
|
|
2476
2580
|
}
|
|
2477
|
-
return
|
|
2581
|
+
return H;
|
|
2478
2582
|
}
|
|
2479
|
-
case
|
|
2480
|
-
let S =
|
|
2481
|
-
if (
|
|
2482
|
-
|
|
2583
|
+
case ks: {
|
|
2584
|
+
let S = x.name, O = A(x);
|
|
2585
|
+
if (ol.has(S)) {
|
|
2586
|
+
we.push(x.text, E, O), Ae.p(S.toLowerCase(), O);
|
|
2483
2587
|
return;
|
|
2484
2588
|
}
|
|
2485
|
-
if (
|
|
2486
|
-
|
|
2589
|
+
if (ns("gradient", S)) {
|
|
2590
|
+
si.p(x.text, O);
|
|
2487
2591
|
return;
|
|
2488
2592
|
}
|
|
2489
2593
|
}
|
|
2490
2594
|
}
|
|
2491
2595
|
});
|
|
2492
2596
|
}
|
|
2493
|
-
} else if (
|
|
2494
|
-
let { value:
|
|
2495
|
-
if (
|
|
2496
|
-
let
|
|
2497
|
-
h.total++,
|
|
2498
|
-
let
|
|
2499
|
-
line:
|
|
2500
|
-
column:
|
|
2501
|
-
offset:
|
|
2502
|
-
length:
|
|
2597
|
+
} else if (c.type === Pr) {
|
|
2598
|
+
let { value: v } = c, y = $i(v || "");
|
|
2599
|
+
if (Ki(y, "data:")) {
|
|
2600
|
+
let k = y.length, g = ml(y);
|
|
2601
|
+
h.total++, a += k;
|
|
2602
|
+
let E = {
|
|
2603
|
+
line: c.line,
|
|
2604
|
+
column: c.column,
|
|
2605
|
+
offset: c.start,
|
|
2606
|
+
length: c.length
|
|
2503
2607
|
};
|
|
2504
|
-
if (h.unique.has(
|
|
2505
|
-
let
|
|
2506
|
-
|
|
2608
|
+
if (h.unique.has(g)) {
|
|
2609
|
+
let K = h.unique.get(g);
|
|
2610
|
+
K.count++, K.size += k, h.unique.set(g, K), t && K.uniqueWithLocations && K.uniqueWithLocations.push(E);
|
|
2507
2611
|
} else {
|
|
2508
|
-
let
|
|
2612
|
+
let K = {
|
|
2509
2613
|
count: 1,
|
|
2510
|
-
size:
|
|
2511
|
-
uniqueWithLocations: t ? [
|
|
2614
|
+
size: k,
|
|
2615
|
+
uniqueWithLocations: t ? [E] : void 0
|
|
2512
2616
|
};
|
|
2513
|
-
h.unique.set(
|
|
2617
|
+
h.unique.set(g, K);
|
|
2514
2618
|
}
|
|
2515
2619
|
}
|
|
2516
|
-
} else if (
|
|
2517
|
-
return
|
|
2620
|
+
} else if (c.type === qi)
|
|
2621
|
+
return c.name && Ts.p(c.name.toLowerCase(), A(c)), H;
|
|
2518
2622
|
});
|
|
2519
|
-
let
|
|
2623
|
+
let ni = Qs.size, Ce = Je.size(), Gt = Ms.aggregate(), Wt = zs.aggregate(), Yt = qs.aggregate(), li = Fs.size, b = Object.assign, oi = r.length, Qt = N.length, ai = u.aggregate(), hi = Je.aggregate(), ci = Vs.aggregate(), _i = Pe.aggregate(), ui = qt.aggregate(), fi = d.c();
|
|
2520
2624
|
return {
|
|
2521
2625
|
stylesheet: {
|
|
2522
|
-
sourceLinesOfCode:
|
|
2626
|
+
sourceLinesOfCode: fi.total + Ce + Ie + Nt.size(),
|
|
2523
2627
|
linesOfCode: i,
|
|
2524
|
-
size:
|
|
2525
|
-
complexity:
|
|
2628
|
+
size: oi,
|
|
2629
|
+
complexity: ai.sum + hi.sum + ci.sum + _i.sum + ui.sum,
|
|
2526
2630
|
comments: {
|
|
2527
2631
|
total: n,
|
|
2528
2632
|
size: l
|
|
2529
2633
|
},
|
|
2530
2634
|
embeddedContent: {
|
|
2531
2635
|
size: {
|
|
2532
|
-
total:
|
|
2533
|
-
ratio:
|
|
2636
|
+
total: a,
|
|
2637
|
+
ratio: I(a, oi)
|
|
2534
2638
|
},
|
|
2535
2639
|
types: {
|
|
2536
2640
|
total: h.total,
|
|
2537
2641
|
totalUnique: h.unique.size,
|
|
2538
|
-
uniquenessRatio:
|
|
2642
|
+
uniquenessRatio: I(h.unique.size, h.total),
|
|
2539
2643
|
unique: Object.fromEntries(h.unique)
|
|
2540
2644
|
}
|
|
2541
2645
|
}
|
|
2542
2646
|
},
|
|
2543
|
-
atrules: b(
|
|
2647
|
+
atrules: b(fi, {
|
|
2544
2648
|
fontface: b(
|
|
2545
2649
|
{
|
|
2546
|
-
total:
|
|
2547
|
-
totalUnique:
|
|
2548
|
-
unique:
|
|
2549
|
-
uniquenessRatio:
|
|
2650
|
+
total: Qt,
|
|
2651
|
+
totalUnique: Qt,
|
|
2652
|
+
unique: N,
|
|
2653
|
+
uniquenessRatio: Qt === 0 ? 0 : 1
|
|
2550
2654
|
},
|
|
2551
2655
|
t ? {
|
|
2552
|
-
uniqueWithLocations:
|
|
2656
|
+
uniqueWithLocations: ys.c().uniqueWithLocations
|
|
2553
2657
|
} : {}
|
|
2554
2658
|
),
|
|
2555
|
-
import:
|
|
2556
|
-
media: b(
|
|
2557
|
-
browserhacks:
|
|
2558
|
-
features:
|
|
2659
|
+
import: bs.c(),
|
|
2660
|
+
media: b(Rs.c(), {
|
|
2661
|
+
browserhacks: vs.c(),
|
|
2662
|
+
features: Ts.c()
|
|
2559
2663
|
}),
|
|
2560
|
-
charset:
|
|
2561
|
-
supports: b(
|
|
2562
|
-
browserhacks:
|
|
2664
|
+
charset: Os.c(),
|
|
2665
|
+
supports: b(At.c(), {
|
|
2666
|
+
browserhacks: Ss.c()
|
|
2563
2667
|
}),
|
|
2564
|
-
keyframes: b(
|
|
2565
|
-
prefixed: b(
|
|
2566
|
-
ratio:
|
|
2668
|
+
keyframes: b(Et.c(), {
|
|
2669
|
+
prefixed: b(Ct.c(), {
|
|
2670
|
+
ratio: I(Ct.size(), Et.size())
|
|
2567
2671
|
})
|
|
2568
2672
|
}),
|
|
2569
|
-
container: b(
|
|
2570
|
-
names:
|
|
2673
|
+
container: b(Ns.c(), {
|
|
2674
|
+
names: Ze.c()
|
|
2571
2675
|
}),
|
|
2572
|
-
layer:
|
|
2573
|
-
property:
|
|
2574
|
-
complexity:
|
|
2676
|
+
layer: Xe.c(),
|
|
2677
|
+
property: Ls.c(),
|
|
2678
|
+
complexity: ai,
|
|
2575
2679
|
nesting: b(
|
|
2576
|
-
|
|
2680
|
+
yt.aggregate(),
|
|
2577
2681
|
{
|
|
2578
|
-
items:
|
|
2682
|
+
items: yt.toArray()
|
|
2579
2683
|
},
|
|
2580
|
-
|
|
2684
|
+
Us.c()
|
|
2581
2685
|
)
|
|
2582
2686
|
}),
|
|
2583
2687
|
rules: {
|
|
2584
|
-
total:
|
|
2688
|
+
total: bt,
|
|
2585
2689
|
empty: {
|
|
2586
|
-
total:
|
|
2587
|
-
ratio:
|
|
2690
|
+
total: Rt,
|
|
2691
|
+
ratio: I(Rt, bt)
|
|
2588
2692
|
},
|
|
2589
2693
|
sizes: b(
|
|
2590
|
-
|
|
2694
|
+
vt.aggregate(),
|
|
2591
2695
|
{
|
|
2592
|
-
items:
|
|
2696
|
+
items: vt.toArray()
|
|
2593
2697
|
},
|
|
2594
|
-
|
|
2698
|
+
Is.c()
|
|
2595
2699
|
),
|
|
2596
2700
|
nesting: b(
|
|
2597
|
-
|
|
2701
|
+
St.aggregate(),
|
|
2598
2702
|
{
|
|
2599
|
-
items:
|
|
2703
|
+
items: St.toArray()
|
|
2600
2704
|
},
|
|
2601
|
-
|
|
2705
|
+
Ds.c()
|
|
2602
2706
|
),
|
|
2603
2707
|
selectors: b(
|
|
2604
|
-
|
|
2708
|
+
Tt.aggregate(),
|
|
2605
2709
|
{
|
|
2606
|
-
items:
|
|
2710
|
+
items: Tt.toArray()
|
|
2607
2711
|
},
|
|
2608
|
-
|
|
2712
|
+
Hs.c()
|
|
2609
2713
|
),
|
|
2610
2714
|
declarations: b(
|
|
2611
|
-
|
|
2715
|
+
Ot.aggregate(),
|
|
2612
2716
|
{
|
|
2613
|
-
items:
|
|
2717
|
+
items: Ot.toArray()
|
|
2614
2718
|
},
|
|
2615
|
-
|
|
2719
|
+
Ps.c()
|
|
2616
2720
|
)
|
|
2617
2721
|
},
|
|
2618
2722
|
selectors: {
|
|
2619
|
-
total:
|
|
2620
|
-
totalUnique:
|
|
2621
|
-
uniquenessRatio:
|
|
2723
|
+
total: Ce,
|
|
2724
|
+
totalUnique: li,
|
|
2725
|
+
uniquenessRatio: I(li, Ce),
|
|
2622
2726
|
specificity: b(
|
|
2623
2727
|
{
|
|
2624
2728
|
/** @type Specificity */
|
|
2625
|
-
min:
|
|
2729
|
+
min: fe === void 0 ? [0, 0, 0] : fe,
|
|
2626
2730
|
/** @type Specificity */
|
|
2627
|
-
max:
|
|
2731
|
+
max: ue === void 0 ? [0, 0, 0] : ue,
|
|
2628
2732
|
/** @type Specificity */
|
|
2629
|
-
sum: [
|
|
2733
|
+
sum: [Gt.sum, Wt.sum, Yt.sum],
|
|
2630
2734
|
/** @type Specificity */
|
|
2631
|
-
mean: [
|
|
2735
|
+
mean: [Gt.mean, Wt.mean, Yt.mean],
|
|
2632
2736
|
/** @type Specificity */
|
|
2633
|
-
mode: [
|
|
2737
|
+
mode: [Gt.mode, Wt.mode, Yt.mode],
|
|
2634
2738
|
/** @type Specificity */
|
|
2635
|
-
items:
|
|
2739
|
+
items: Bs
|
|
2636
2740
|
},
|
|
2637
|
-
|
|
2741
|
+
Ks.c()
|
|
2638
2742
|
),
|
|
2639
|
-
complexity: b(
|
|
2640
|
-
items:
|
|
2743
|
+
complexity: b(hi, $s.c(), {
|
|
2744
|
+
items: Je.toArray()
|
|
2641
2745
|
}),
|
|
2642
2746
|
nesting: b(
|
|
2643
|
-
|
|
2747
|
+
Ht.aggregate(),
|
|
2644
2748
|
{
|
|
2645
|
-
items:
|
|
2749
|
+
items: Ht.toArray()
|
|
2646
2750
|
},
|
|
2647
|
-
|
|
2751
|
+
Ys.c()
|
|
2648
2752
|
),
|
|
2649
|
-
id: b(
|
|
2650
|
-
ratio:
|
|
2753
|
+
id: b(Ut.c(), {
|
|
2754
|
+
ratio: I(Ut.size(), Ce)
|
|
2651
2755
|
}),
|
|
2652
|
-
pseudoClasses:
|
|
2653
|
-
accessibility: b(
|
|
2654
|
-
ratio:
|
|
2756
|
+
pseudoClasses: Gs.c(),
|
|
2757
|
+
accessibility: b(It.c(), {
|
|
2758
|
+
ratio: I(It.size(), Ce)
|
|
2655
2759
|
}),
|
|
2656
|
-
keyframes:
|
|
2657
|
-
prefixed: b(
|
|
2658
|
-
ratio:
|
|
2760
|
+
keyframes: Nt.c(),
|
|
2761
|
+
prefixed: b(Lt.c(), {
|
|
2762
|
+
ratio: I(Lt.size(), Ce)
|
|
2659
2763
|
}),
|
|
2660
|
-
combinators:
|
|
2764
|
+
combinators: Ws.c()
|
|
2661
2765
|
},
|
|
2662
2766
|
declarations: {
|
|
2663
|
-
total:
|
|
2664
|
-
totalUnique:
|
|
2665
|
-
uniquenessRatio:
|
|
2767
|
+
total: Ie,
|
|
2768
|
+
totalUnique: ni,
|
|
2769
|
+
uniquenessRatio: I(ni, Ie),
|
|
2666
2770
|
importants: {
|
|
2667
|
-
total:
|
|
2668
|
-
ratio:
|
|
2771
|
+
total: et,
|
|
2772
|
+
ratio: I(et, Ie),
|
|
2669
2773
|
inKeyframes: {
|
|
2670
|
-
total:
|
|
2671
|
-
ratio:
|
|
2774
|
+
total: Pt,
|
|
2775
|
+
ratio: I(Pt, et)
|
|
2672
2776
|
}
|
|
2673
2777
|
},
|
|
2674
|
-
complexity:
|
|
2778
|
+
complexity: ci,
|
|
2675
2779
|
nesting: b(
|
|
2676
|
-
|
|
2780
|
+
Ft.aggregate(),
|
|
2677
2781
|
{
|
|
2678
|
-
items:
|
|
2782
|
+
items: Ft.toArray()
|
|
2679
2783
|
},
|
|
2680
|
-
|
|
2784
|
+
js.c()
|
|
2681
2785
|
)
|
|
2682
2786
|
},
|
|
2683
|
-
properties: b(
|
|
2684
|
-
prefixed: b(
|
|
2685
|
-
ratio:
|
|
2787
|
+
properties: b(He.c(), {
|
|
2788
|
+
prefixed: b(zt.c(), {
|
|
2789
|
+
ratio: I(zt.size(), He.size())
|
|
2686
2790
|
}),
|
|
2687
|
-
custom: b(
|
|
2688
|
-
ratio:
|
|
2689
|
-
importants: b(
|
|
2690
|
-
ratio:
|
|
2791
|
+
custom: b(tt.c(), {
|
|
2792
|
+
ratio: I(tt.size(), He.size()),
|
|
2793
|
+
importants: b(Dt.c(), {
|
|
2794
|
+
ratio: I(Dt.size(), tt.size())
|
|
2691
2795
|
})
|
|
2692
2796
|
}),
|
|
2693
|
-
browserhacks: b(
|
|
2694
|
-
ratio:
|
|
2797
|
+
browserhacks: b(Mt.c(), {
|
|
2798
|
+
ratio: I(Mt.size(), He.size())
|
|
2695
2799
|
}),
|
|
2696
|
-
complexity:
|
|
2800
|
+
complexity: _i
|
|
2697
2801
|
}),
|
|
2698
2802
|
values: {
|
|
2699
|
-
colors: b(
|
|
2700
|
-
formats:
|
|
2803
|
+
colors: b(we.count(), {
|
|
2804
|
+
formats: Ae.c()
|
|
2701
2805
|
}),
|
|
2702
|
-
gradients:
|
|
2703
|
-
fontFamilies:
|
|
2704
|
-
fontSizes:
|
|
2705
|
-
lineHeights:
|
|
2706
|
-
zindexes:
|
|
2707
|
-
textShadows:
|
|
2708
|
-
boxShadows:
|
|
2709
|
-
borderRadiuses:
|
|
2806
|
+
gradients: si.c(),
|
|
2807
|
+
fontFamilies: $t.c(),
|
|
2808
|
+
fontSizes: st.c(),
|
|
2809
|
+
lineHeights: it.c(),
|
|
2810
|
+
zindexes: Zs.c(),
|
|
2811
|
+
textShadows: Js.c(),
|
|
2812
|
+
boxShadows: ei.c(),
|
|
2813
|
+
borderRadiuses: ii.count(),
|
|
2710
2814
|
animations: {
|
|
2711
|
-
durations:
|
|
2712
|
-
timingFunctions:
|
|
2815
|
+
durations: rt.c(),
|
|
2816
|
+
timingFunctions: Bt.c()
|
|
2713
2817
|
},
|
|
2714
|
-
prefixes:
|
|
2715
|
-
browserhacks:
|
|
2716
|
-
units:
|
|
2717
|
-
complexity:
|
|
2718
|
-
keywords:
|
|
2719
|
-
resets:
|
|
2818
|
+
prefixes: Xs.c(),
|
|
2819
|
+
browserhacks: Kt.c(),
|
|
2820
|
+
units: ti.count(),
|
|
2821
|
+
complexity: ui,
|
|
2822
|
+
keywords: De.c(),
|
|
2823
|
+
resets: ri.c()
|
|
2720
2824
|
},
|
|
2721
2825
|
__meta__: {
|
|
2722
|
-
parseTime:
|
|
2723
|
-
analyzeTime: Date.now() -
|
|
2826
|
+
parseTime: p - o,
|
|
2827
|
+
analyzeTime: Date.now() - p,
|
|
2724
2828
|
total: Date.now() - s
|
|
2725
2829
|
}
|
|
2726
2830
|
};
|
|
2727
2831
|
}
|
|
2728
|
-
function
|
|
2832
|
+
function Mi(r, e) {
|
|
2729
2833
|
return r[0] === e[0] ? r[1] === e[1] ? e[2] - r[2] : e[1] - r[1] : e[0] - r[0];
|
|
2730
2834
|
}
|
|
2731
2835
|
export {
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2836
|
+
B as KeywordSet,
|
|
2837
|
+
bl as analyze,
|
|
2838
|
+
Ii as calculateSpecificity,
|
|
2839
|
+
ol as colorFunctions,
|
|
2840
|
+
al as colorKeywords,
|
|
2841
|
+
Mi as compareSpecificity,
|
|
2842
|
+
xt as cssKeywords,
|
|
2843
|
+
yl as hasVendorPrefix,
|
|
2844
|
+
Kr as isAccessibilitySelector,
|
|
2845
|
+
Fr as isMediaBrowserhack,
|
|
2846
|
+
Al as isPropertyHack,
|
|
2847
|
+
qr as isSelectorPrefixed,
|
|
2848
|
+
Dr as isSupportsBrowserhack,
|
|
2849
|
+
gl as isValuePrefixed,
|
|
2850
|
+
nl as namedColors,
|
|
2851
|
+
ls as selectorComplexity,
|
|
2852
|
+
ll as systemColors
|
|
2749
2853
|
};
|