@projectwallace/css-analyzer 7.1.1 → 7.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- import It from "css-tree/parser";
1
+ import Ht from "css-tree/parser";
2
2
  import q from "css-tree/walker";
3
- import { calculateForAST as Ut } from "@bramus/specificity/core";
4
- function Fe(i, t) {
3
+ import { calculateForAST as Wt } from "@bramus/specificity/core";
4
+ function De(i, t) {
5
5
  return t >= 65 && t <= 90 && (t = t | 32), i === t;
6
6
  }
7
7
  function z(i, t) {
@@ -9,7 +9,7 @@ function z(i, t) {
9
9
  let r = i.length;
10
10
  if (r !== t.length) return !1;
11
11
  for (let e = 0; e < r; e++)
12
- if (Fe(i.charCodeAt(e), t.charCodeAt(e)) === !1)
12
+ if (De(i.charCodeAt(e), t.charCodeAt(e)) === !1)
13
13
  return !1;
14
14
  return !0;
15
15
  }
@@ -18,8 +18,8 @@ function L(i, t) {
18
18
  let r = t.length, e = r - i.length;
19
19
  if (e < 0)
20
20
  return !1;
21
- for (let l = r - 1; l >= e; l--)
22
- if (Fe(i.charCodeAt(l - e), t.charCodeAt(l)) === !1)
21
+ for (let n = r - 1; n >= e; n--)
22
+ if (De(i.charCodeAt(n - e), t.charCodeAt(n)) === !1)
23
23
  return !1;
24
24
  return !0;
25
25
  }
@@ -28,44 +28,44 @@ function Te(i, t) {
28
28
  let r = i.length;
29
29
  if (t.length < r) return !1;
30
30
  for (let e = 0; e < r; e++)
31
- if (Fe(i.charCodeAt(e), t.charCodeAt(e)) === !1)
31
+ if (De(i.charCodeAt(e), t.charCodeAt(e)) === !1)
32
32
  return !1;
33
33
  return !0;
34
34
  }
35
- const Ht = "Atrule", Vt = "MediaQuery", Wt = "Rule", Me = "Selector", At = "TypeSelector", G = "PseudoClassSelector", Pt = "AttributeSelector", Lt = "PseudoElementSelector", De = "Declaration", Kt = "Value", O = "Identifier", jt = "Nth", Bt = "Combinator", Yt = "Number", Ot = "Dimension", V = "Operator", Gt = "Hash", Qt = "Url", Ie = "Function";
36
- function _t(i, t, r) {
35
+ const Kt = "Atrule", jt = "MediaQuery", Bt = "Rule", Me = "Selector", Ot = "TypeSelector", G = "PseudoClassSelector", Rt = "AttributeSelector", Et = "PseudoElementSelector", Fe = "Declaration", Yt = "Value", O = "Identifier", Gt = "Nth", Qt = "Combinator", Ft = "Number", Ie = "Dimension", H = "Operator", Zt = "Hash", Nt = "Url", Ue = "Function";
36
+ function vt(i, t, r) {
37
37
  let e = i.value.children.first;
38
38
  return z(t, i.property) && e.type === O && z(r, e.name);
39
39
  }
40
- function Nt(i) {
40
+ function Jt(i) {
41
41
  let t = !1;
42
42
  return q(i, function(r) {
43
- if (r.type === De && (_t(r, "-webkit-appearance", "none") || _t(r, "-moz-appearance", "meterbar")))
43
+ if (r.type === Fe && (vt(r, "-webkit-appearance", "none") || vt(r, "-moz-appearance", "meterbar")))
44
44
  return t = !0, this.break;
45
45
  }), t;
46
46
  }
47
- function Zt(i) {
47
+ function Xt(i) {
48
48
  let t = !1;
49
49
  return q(i, function(r) {
50
- let e = r.name, l = r.value;
51
- if (r.type === Vt && r.mediaType !== null) {
50
+ let e = r.name, n = r.value;
51
+ if (r.type === jt && r.mediaType !== null) {
52
52
  if (Te("\\0", r.mediaType) || L("\\9 ", r.mediaType))
53
53
  return t = !0, this.break;
54
54
  } else if (r.type === "Feature" && r.kind === "media") {
55
- if (l && l.unit && l.unit === "\\0")
55
+ if (n && n.unit && n.unit === "\\0")
56
56
  return t = !0, this.break;
57
57
  if (z("-moz-images-in-menus", e) || z("min--moz-device-pixel-ratio", e) || z("-ms-high-contrast", e))
58
58
  return t = !0, this.break;
59
- if (z("min-resolution", e) && l && z(".001", l.value) && z("dpcm", l.unit))
59
+ if (z("min-resolution", e) && n && z(".001", n.value) && z("dpcm", n.unit))
60
60
  return t = !0, this.break;
61
- if (z("-webkit-min-device-pixel-ratio", e) && l && l.value && (z("0", l.value) || z("10000", l.value)))
61
+ if (z("-webkit-min-device-pixel-ratio", e) && n && n.value && (z("0", n.value) || z("10000", n.value)))
62
62
  return t = !0, this.break;
63
63
  }
64
64
  }), t;
65
65
  }
66
- const St = 45;
67
- function D(i) {
68
- return i.charCodeAt(0) === St && i.charCodeAt(1) !== St && i.indexOf("-", 2) !== -1;
66
+ const qt = 45;
67
+ function F(i) {
68
+ return i.charCodeAt(0) === qt && i.charCodeAt(1) !== qt && i.indexOf("-", 2) !== -1;
69
69
  }
70
70
  class A {
71
71
  /** @param {string[]} items */
@@ -77,7 +77,7 @@ class A {
77
77
  return this.set.has(t.toLowerCase());
78
78
  }
79
79
  }
80
- function Rt(i, t) {
80
+ function Dt(i, t) {
81
81
  let r = [];
82
82
  return q(i, {
83
83
  visit: Me,
@@ -86,7 +86,7 @@ function Rt(i, t) {
86
86
  }
87
87
  }), r;
88
88
  }
89
- const Et = new A([
89
+ const Tt = new A([
90
90
  "nth-child",
91
91
  "where",
92
92
  "not",
@@ -97,17 +97,17 @@ const Et = new A([
97
97
  "-webkit-any",
98
98
  "-moz-any"
99
99
  ]);
100
- function Dt(i) {
100
+ function Mt(i) {
101
101
  let t = !1;
102
102
  return q(i, function(r) {
103
- if (r.type === Pt) {
103
+ if (r.type === Rt) {
104
104
  let e = r.name.name;
105
105
  if (z("role", e) || Te("aria-", e))
106
106
  return t = !0, this.break;
107
- } else if (r.type === G && Et.has(r.name)) {
108
- let e = Rt(r, Dt);
109
- for (let l of e)
110
- if (l === !0) {
107
+ } else if (r.type === G && Tt.has(r.name)) {
108
+ let e = Dt(r, Mt);
109
+ for (let n of e)
110
+ if (n === !0) {
111
111
  t = !0;
112
112
  break;
113
113
  }
@@ -115,67 +115,67 @@ function Dt(i) {
115
115
  }
116
116
  }), t;
117
117
  }
118
- function Jt(i) {
118
+ function $t(i) {
119
119
  let t = !1;
120
120
  return q(i, function(r) {
121
121
  let e = r.type;
122
- if ((e === Lt || e === At || e === G) && D(r.name))
122
+ if ((e === Et || e === Ot || e === G) && F(r.name))
123
123
  return t = !0, this.break;
124
124
  }), t;
125
125
  }
126
- function Xt(i) {
126
+ function ei(i) {
127
127
  let t = [];
128
128
  return q(i, function(r) {
129
129
  r.type === G && t.push(r.name);
130
130
  }), t.length === 0 ? !1 : t;
131
131
  }
132
- function Ft(i) {
132
+ function It(i) {
133
133
  let t = 0;
134
134
  return q(i, function(r) {
135
135
  let e = r.type;
136
- if (!(e === Me || e === jt)) {
137
- if (t++, (e === Lt || e === At || e === G) && D(r.name) && t++, e === Pt)
136
+ if (!(e === Me || e === Gt)) {
137
+ if (t++, (e === Et || e === Ot || e === G) && F(r.name) && t++, e === Rt)
138
138
  return r.value && t++, this.skip;
139
- if (e === G && Et.has(r.name)) {
140
- let l = Rt(r, Ft);
141
- if (l.length === 0) return;
142
- for (let n of l)
143
- t += n;
139
+ if (e === G && Tt.has(r.name)) {
140
+ let n = Dt(r, It);
141
+ if (n.length === 0) return;
142
+ for (let a of n)
143
+ t += a;
144
144
  return this.skip;
145
145
  }
146
146
  }
147
147
  }), t;
148
148
  }
149
- function $t(i, t) {
149
+ function ti(i, t) {
150
150
  q(i, function(r, e) {
151
- if (r.type === Bt) {
152
- let l = r.loc, n = r.name;
153
- if (l === null) {
154
- let g = e.prev.data.loc.end, w = {
155
- offset: g.offset,
156
- line: g.line,
157
- column: g.column
151
+ if (r.type === Qt) {
152
+ let n = r.loc, a = r.name;
153
+ if (n === null) {
154
+ let d = e.prev.data.loc.end, b = {
155
+ offset: d.offset,
156
+ line: d.line,
157
+ column: d.column
158
158
  };
159
159
  t({
160
- name: n,
160
+ name: a,
161
161
  loc: {
162
- start: w,
162
+ start: b,
163
163
  end: {
164
- offset: w.offset + 1,
165
- line: w.line,
166
- column: w.column + 1
164
+ offset: b.offset + 1,
165
+ line: b.line,
166
+ column: b.column + 1
167
167
  }
168
168
  }
169
169
  });
170
170
  } else
171
171
  t({
172
- name: n,
173
- loc: l
172
+ name: a,
173
+ loc: n
174
174
  });
175
175
  }
176
176
  });
177
177
  }
178
- const ei = new A([
178
+ const ii = new A([
179
179
  // CSS Named Colors
180
180
  // Spec: https://drafts.csswg.org/css-color/#named-colors
181
181
  // Heuristic: popular names first for quick finding in set.has()
@@ -328,7 +328,7 @@ const ei = new A([
328
328
  "mediumorchid",
329
329
  "darksalmon",
330
330
  "mediumspringgreen"
331
- ]), ti = new A([
331
+ ]), ri = new A([
332
332
  // CSS System Colors
333
333
  // Spec: https://drafts.csswg.org/css-color/#css-system-colors
334
334
  "accentcolor",
@@ -350,7 +350,7 @@ const ei = new A([
350
350
  "selecteditem",
351
351
  "selecteditemtext",
352
352
  "visitedtext"
353
- ]), ii = new A([
353
+ ]), si = new A([
354
354
  "rgba",
355
355
  "rgb",
356
356
  "hsla",
@@ -361,7 +361,7 @@ const ei = new A([
361
361
  "lch",
362
362
  "lab",
363
363
  "oklab"
364
- ]), ri = new A([
364
+ ]), li = new A([
365
365
  "transparent",
366
366
  "currentcolor"
367
367
  ]), te = new A([
@@ -380,14 +380,23 @@ function ee(i) {
380
380
  let e = t.first;
381
381
  return e.type === O && te.has(e.name);
382
382
  }
383
- const si = new A([
383
+ function At(i) {
384
+ return parseFloat(i) === 0;
385
+ }
386
+ function ni(i) {
387
+ for (let t of i.children.toArray())
388
+ if (!(t.type === Ft && At(t.value)) && !(t.type === Ie && At(t.value)))
389
+ return !1;
390
+ return !0;
391
+ }
392
+ const ai = new A([
384
393
  "caption",
385
394
  "icon",
386
395
  "menu",
387
396
  "message-box",
388
397
  "small-caption",
389
398
  "status-bar"
390
- ]), li = new A([
399
+ ]), oi = new A([
391
400
  /* <absolute-size> values */
392
401
  "xx-small",
393
402
  "x-small",
@@ -400,46 +409,46 @@ const si = new A([
400
409
  /* <relative-size> values */
401
410
  "smaller",
402
411
  "larger"
403
- ]), ni = 44, vt = 47;
412
+ ]), ui = 44, Pt = 47;
404
413
  function Re(i) {
405
414
  let t = i.children.first;
406
- return t === null ? !1 : t.type === O && si.has(t.name);
415
+ return t === null ? !1 : t.type === O && ai.has(t.name);
407
416
  }
408
- function ai(i, t, r) {
409
- var w;
410
- let e = Array.from({ length: 2 }), l, n;
411
- i.children.forEach(function(d, _) {
412
- let y = _.prev ? _.prev.data : void 0, P = _.next ? _.next.data : void 0;
413
- if (d.type === O && te.has(d.name) && r({
417
+ function ci(i, t, r) {
418
+ var b;
419
+ let e = Array.from({ length: 2 }), n, a;
420
+ i.children.forEach(function(y, _) {
421
+ let w = _.prev ? _.prev.data : void 0, P = _.next ? _.next.data : void 0;
422
+ if (y.type === O && te.has(y.name) && r({
414
423
  type: "keyword",
415
- value: d.name
416
- }), P && P.type === V && P.value.charCodeAt(0) === vt) {
417
- l = t(d);
424
+ value: y.name
425
+ }), P && P.type === H && P.value.charCodeAt(0) === Pt) {
426
+ n = t(y);
418
427
  return;
419
428
  }
420
- if (y && y.type === V && y.value.charCodeAt(0) === vt) {
421
- n = t(d);
429
+ if (w && w.type === H && w.value.charCodeAt(0) === Pt) {
430
+ a = t(y);
422
431
  return;
423
432
  }
424
- if (P && P.type === V && P.value.charCodeAt(0) === ni && !e[0]) {
425
- e[0] = d, !l && y && (l = t(y));
433
+ if (P && P.type === H && P.value.charCodeAt(0) === ui && !e[0]) {
434
+ e[0] = y, !n && w && (n = t(w));
426
435
  return;
427
436
  }
428
- if (d.type !== Yt) {
437
+ if (y.type !== Ft) {
429
438
  if (_.next === null) {
430
- e[1] = d, !l && !e[0] && y && (l = t(y));
439
+ e[1] = y, !n && !e[0] && w && (n = t(w));
431
440
  return;
432
441
  }
433
- if (d.type === O) {
434
- let R = d.name;
435
- if (li.has(R)) {
436
- l = R;
442
+ if (y.type === O) {
443
+ let R = y.name;
444
+ if (oi.has(R)) {
445
+ n = R;
437
446
  return;
438
447
  }
439
448
  }
440
449
  }
441
450
  });
442
- let g = e[0] || e[1] ? t({
451
+ let d = e[0] || e[1] ? t({
443
452
  loc: {
444
453
  start: {
445
454
  offset: (e[0] || e[1]).loc.start.offset
@@ -447,17 +456,17 @@ function ai(i, t, r) {
447
456
  end: {
448
457
  // Either the node we detected as the last node, or the end of the whole value
449
458
  // It's never 0 because the first node is always a font-size or font-style
450
- offset: ((w = e[1]) == null ? void 0 : w.loc.end.offset) || i.loc.end.offset
459
+ offset: ((b = e[1]) == null ? void 0 : b.loc.end.offset) || i.loc.end.offset
451
460
  }
452
461
  }
453
462
  }) : null;
454
463
  return {
455
- font_size: l,
456
- line_height: n,
457
- font_family: g
464
+ font_size: n,
465
+ line_height: a,
466
+ font_family: d
458
467
  };
459
468
  }
460
- const oi = new A([
469
+ const fi = new A([
461
470
  "linear",
462
471
  "ease",
463
472
  "ease-in",
@@ -465,36 +474,36 @@ const oi = new A([
465
474
  "ease-in-out",
466
475
  "step-start",
467
476
  "step-end"
468
- ]), ui = new A([
477
+ ]), pi = new A([
469
478
  "cubic-bezier",
470
479
  "steps"
471
480
  ]);
472
- function ci(i, t) {
481
+ function hi(i, t) {
473
482
  let r = !1;
474
483
  for (let e of i) {
475
- let l = e.type, n = e.name;
476
- l === V ? r = !1 : l === Ot && r === !1 ? (r = !0, t({
484
+ let n = e.type, a = e.name;
485
+ n === H ? r = !1 : n === Ie && r === !1 ? (r = !0, t({
477
486
  type: "duration",
478
487
  value: e
479
- })) : l === O ? oi.has(n) ? t({
488
+ })) : n === O ? fi.has(a) ? t({
480
489
  type: "fn",
481
490
  value: e
482
- }) : te.has(n) && t({
491
+ }) : te.has(a) && t({
483
492
  type: "keyword",
484
493
  value: e
485
- }) : l === Ie && ui.has(n) && t({
494
+ }) : n === Ue && pi.has(a) && t({
486
495
  type: "fn",
487
496
  value: e
488
497
  });
489
498
  }
490
499
  }
491
- function Tt(i) {
500
+ function Ut(i) {
492
501
  let t = i.children;
493
502
  if (!t)
494
503
  return !1;
495
504
  for (let r of t) {
496
- let { type: e, name: l } = r;
497
- if (e === O && D(l) || e === Ie && (D(l) || Tt(r)))
505
+ let { type: e, name: n } = r;
506
+ if (e === O && F(n) || e === Ue && (F(n) || Ut(r)))
498
507
  return !0;
499
508
  }
500
509
  return !1;
@@ -511,8 +520,8 @@ class u {
511
520
  p(t, r) {
512
521
  let e = this._total;
513
522
  if (this._useLocations) {
514
- let l = r.start, n = l.offset, g = e * 4;
515
- this._nodes[g] = l.line, this._nodes[g + 1] = l.column, this._nodes[g + 2] = n, this._nodes[g + 3] = r.end.offset - n;
523
+ let n = r.start, a = n.offset, d = e * 4;
524
+ this._nodes[d] = n.line, this._nodes[d + 1] = n.column, this._nodes[d + 2] = a, this._nodes[d + 3] = r.end.offset - a;
516
525
  }
517
526
  if (this._items.has(t)) {
518
527
  this._items.get(t).push(e), this._total++;
@@ -542,29 +551,29 @@ class u {
542
551
  * })}
543
552
  */
544
553
  c() {
545
- let t = /* @__PURE__ */ new Map(), r = {}, e = this._useLocations, l = this._items, n = this._nodes, g = l.size;
546
- l.forEach((_, y) => {
554
+ let t = /* @__PURE__ */ new Map(), r = {}, e = this._useLocations, n = this._items, a = this._nodes, d = n.size;
555
+ n.forEach((_, w) => {
547
556
  if (e) {
548
557
  let P = _.map(function(R) {
549
- let F = R * 4;
558
+ let D = R * 4;
550
559
  return {
551
- line: n[F],
552
- column: n[F + 1],
553
- offset: n[F + 2],
554
- length: n[F + 3]
560
+ line: a[D],
561
+ column: a[D + 1],
562
+ offset: a[D + 2],
563
+ length: a[D + 3]
555
564
  };
556
565
  });
557
- t.set(y, P);
566
+ t.set(w, P);
558
567
  } else
559
- r[y] = _.length;
568
+ r[w] = _.length;
560
569
  });
561
- let w = this._total, d = {
562
- total: w,
563
- totalUnique: g,
570
+ let b = this._total, y = {
571
+ total: b,
572
+ totalUnique: d,
564
573
  unique: r,
565
- uniquenessRatio: w === 0 ? 0 : g / w
574
+ uniquenessRatio: b === 0 ? 0 : d / b
566
575
  };
567
- return e && (d.uniqueWithLocations = Object.fromEntries(t)), d;
576
+ return e && (y.uniqueWithLocations = Object.fromEntries(t)), y;
568
577
  }
569
578
  }
570
579
  class Ee {
@@ -590,13 +599,13 @@ class Ee {
590
599
  });
591
600
  }
592
601
  }
593
- function fi(i) {
594
- let t = /* @__PURE__ */ new Map(), r = -1, e = 0, l = 0, n = i.length;
595
- for (let g = 0; g < n; g++) {
596
- let w = i[g], d = (t.get(w) || 0) + 1;
597
- t.set(w, d), d > r && (r = d, e = 0, l = 0), d >= r && (e++, l += w);
602
+ function mi(i) {
603
+ let t = /* @__PURE__ */ new Map(), r = -1, e = 0, n = 0, a = i.length;
604
+ for (let d = 0; d < a; d++) {
605
+ let b = i[d], y = (t.get(b) || 0) + 1;
606
+ t.set(b, y), y > r && (r = y, e = 0, n = 0), y >= r && (e++, n += b);
598
607
  }
599
- return l / e;
608
+ return n / e;
600
609
  }
601
610
  class v {
602
611
  constructor() {
@@ -623,14 +632,14 @@ class v {
623
632
  range: 0,
624
633
  sum: 0
625
634
  };
626
- let r = this._items.slice().sort((w, d) => w - d), e = r[0], l = r[t - 1], n = fi(r), g = this._sum;
635
+ let r = this._items.slice().sort((b, y) => b - y), e = r[0], n = r[t - 1], a = mi(r), d = this._sum;
627
636
  return {
628
637
  min: e,
629
- max: l,
630
- mean: g / t,
631
- mode: n,
632
- range: l - e,
633
- sum: g
638
+ max: n,
639
+ mean: d / t,
640
+ mode: a,
641
+ range: n - e,
642
+ sum: d
634
643
  };
635
644
  }
636
645
  /**
@@ -640,25 +649,25 @@ class v {
640
649
  return this._items;
641
650
  }
642
651
  }
643
- function pi(i) {
644
- if (Ue(i) || D(i)) return !1;
652
+ function gi(i) {
653
+ if (Ve(i) || F(i)) return !1;
645
654
  let t = i.charCodeAt(0);
646
655
  return t === 47 || t === 42 || t === 95 || t === 43 || t === 38 || t === 36 || t === 35;
647
656
  }
648
- function Ue(i) {
657
+ function Ve(i) {
649
658
  return i.length < 3 ? !1 : i.charCodeAt(0) === 45 && i.charCodeAt(1) === 45;
650
659
  }
651
- function x(i, t) {
652
- return Ue(t) ? !1 : L(i, t);
660
+ function m(i, t) {
661
+ return Ve(t) ? !1 : L(i, t);
653
662
  }
654
- function hi(i) {
655
- return D(i) ? i.slice(i.indexOf("-", 2) + 1) : i;
663
+ function di(i) {
664
+ return F(i) ? i.slice(i.indexOf("-", 2) + 1) : i;
656
665
  }
657
- function mi(i) {
666
+ function yi(i) {
658
667
  let t = 5, r = i.indexOf(";"), e = i.indexOf(",");
659
668
  return r === -1 || e !== -1 && e < r ? i.substring(t, e) : i.substring(t, r);
660
669
  }
661
- function gi(i) {
670
+ function wi(i) {
662
671
  let t = i.children;
663
672
  if (t) {
664
673
  let r = t.last;
@@ -666,7 +675,7 @@ function gi(i) {
666
675
  }
667
676
  return !1;
668
677
  }
669
- let di = new A([
678
+ let bi = new A([
670
679
  "border-radius",
671
680
  "border-top-left-radius",
672
681
  "border-top-right-radius",
@@ -680,73 +689,73 @@ let di = new A([
680
689
  function C(i, t) {
681
690
  return t === 0 ? 0 : i / t;
682
691
  }
683
- let yi = {
692
+ let ki = {
684
693
  useLocations: !1
685
694
  };
686
- function xi(i, t = {}) {
687
- let e = Object.assign({}, yi, t).useLocations === !0, l = Date.now();
688
- function n(s) {
689
- return g(s).trim();
695
+ function _i(i, t = {}) {
696
+ let e = Object.assign({}, ki, t).useLocations === !0, n = Date.now();
697
+ function a(s) {
698
+ return d(s).trim();
690
699
  }
691
- function g(s) {
700
+ function d(s) {
692
701
  let Y = s.loc;
693
702
  return i.substring(Y.start.offset, Y.end.offset);
694
703
  }
695
- let w = 0, d = 0, _ = 0, y = {
704
+ let b = 0, y = 0, _ = 0, w = {
696
705
  total: 0,
697
706
  /** @type {Map<string, { size: number, count: number } & ({ uniqueWithLocations?: undefined } | ({ uniqueWithLocations: { offset: number, line: number, column: number, length: number }[] })) }>} */
698
707
  unique: /* @__PURE__ */ new Map()
699
- }, P = Date.now(), R = It(i, {
708
+ }, P = Date.now(), R = Ht(i, {
700
709
  parseCustomProperty: !0,
701
710
  // To find font-families, colors, etc.
702
711
  positions: !0,
703
712
  // So we can use stringifyNode()
704
713
  /** @param {string} comment */
705
714
  onComment: function(s) {
706
- w++, d += s.length;
715
+ b++, y += s.length;
707
716
  }
708
- }), F = Date.now(), Mt = R.loc.end.line - R.loc.start.line + 1, ie = 0, re = new v(), se = [], He = new u(e), le = new u(e), Ve = new u(e), We = new u(e), Ke = new u(e), je = new u(e), Be = new u(e), ne = new u(e), Ye = new u(e), ae = new u(e), oe = new u(e), Ge = new u(e), Q = new u(e), Qe = new u(e), ue = 0, ce = 0, fe = new v(), pe = new v(), he = new v(), Ne = new u(e), Ze = new u(e), Je = new u(e), me = new u(e), Xe = /* @__PURE__ */ new Set(), ge = new u(e), T, M, $e = new v(), et = new v(), tt = new v(), it = new u(e), N = new v(), rt = new u(e), st = [], de = new u(e), ye = new u(e), lt = new u(e), nt = new u(e), at = /* @__PURE__ */ new Set(), W = 0, ot = new v(), Z = 0, we = 0, ke = new u(e), K = new u(e), be = new u(e), xe = new u(e), J = new u(e), j = new v(), Ce = new v(), ut = new u(e), ze = new u(e), ct = new u(e), ft = new u(e), pt = new u(e), _e = new u(e), Se = new u(e), ve = new u(e), X = new u(e), $ = new u(e), I = new Ee(e), U = new u(e), qe = new Ee(e), ht = new u(e), B = new u(e), mt = new Ee(e);
717
+ }), D = Date.now(), Vt = R.loc.end.line - R.loc.start.line + 1, ie = 0, re = new v(), se = [], He = new u(e), le = new u(e), We = new u(e), Ke = new u(e), je = new u(e), Be = new u(e), Ye = new u(e), ne = new u(e), Ge = new u(e), ae = new u(e), oe = new u(e), Qe = new u(e), Q = new u(e), Ze = new u(e), ue = 0, ce = 0, fe = new v(), pe = new v(), he = new v(), Ne = new u(e), Je = new u(e), Xe = new u(e), me = new u(e), $e = /* @__PURE__ */ new Set(), ge = new u(e), T, M, et = new v(), tt = new v(), it = new v(), rt = new u(e), Z = new v(), st = new u(e), lt = [], de = new u(e), ye = new u(e), nt = new u(e), at = new u(e), ot = /* @__PURE__ */ new Set(), W = 0, ut = new v(), N = 0, we = 0, be = new u(e), K = new u(e), ke = new u(e), xe = new u(e), J = new u(e), j = new v(), Ce = new v(), ct = new u(e), ze = new u(e), ft = new u(e), pt = new u(e), ht = new u(e), _e = new u(e), Se = new u(e), ve = new u(e), X = new u(e), $ = new u(e), I = new Ee(e), U = new u(e), qe = new Ee(e), mt = new u(e), B = new u(e), gt = new Ee(e), dt = new u(e);
709
718
  q(R, function(s) {
710
- var Y, zt;
719
+ var Y, St;
711
720
  switch (s.type) {
712
- case Ht: {
721
+ case Kt: {
713
722
  ie++;
714
723
  let p = s.name;
715
724
  if (p === "font-face") {
716
- let m = {};
725
+ let g = {};
717
726
  e && He.p(s.loc.start.offset, s.loc), s.block.children.forEach((c) => {
718
- c.type === De && (m[c.property] = n(c.value));
719
- }), se.push(m), re.push(1);
727
+ c.type === Fe && (g[c.property] = a(c.value));
728
+ }), se.push(g), re.push(1);
720
729
  break;
721
730
  }
722
- let a = 1;
731
+ let l = 1;
723
732
  if (s.prelude !== null) {
724
- let m = s.prelude, c = m && n(s.prelude), f = m.loc;
733
+ let g = s.prelude, c = g && a(s.prelude), f = g.loc;
725
734
  if (p === "media")
726
- We.p(c, f), Zt(m) && (Ke.p(c, f), a++);
735
+ Ke.p(c, f), Xt(g) && (je.p(c, f), l++);
727
736
  else if (p === "supports")
728
- ne.p(c, f), Nt(m) && (Ye.p(c, f), a++);
737
+ ne.p(c, f), Jt(g) && (Ge.p(c, f), l++);
729
738
  else if (L("keyframes", p)) {
730
739
  let o = "@" + p + " " + c;
731
- D(p) && (oe.p(o, f), a++), ae.p(o, f);
740
+ F(p) && (oe.p(o, f), l++), ae.p(o, f);
732
741
  } else if (p === "import")
733
742
  q(s, function(o) {
734
743
  if (o.type === "Condition" && o.kind === "supports") {
735
- let h = n(o);
744
+ let h = a(o);
736
745
  return ne.p(h, o.loc), this.break;
737
746
  }
738
- }), Ve.p(c, f);
747
+ }), We.p(c, f);
739
748
  else if (p === "charset")
740
- Be.p(c, f);
749
+ Ye.p(c, f);
741
750
  else if (p === "container") {
742
- if (Ge.p(c, f), ((Y = m.children.first) == null ? void 0 : Y.type) === "Identifier") {
743
- let o = m.children.first.name;
751
+ if (Qe.p(c, f), ((Y = g.children.first) == null ? void 0 : Y.type) === "Identifier") {
752
+ let o = g.children.first.name;
744
753
  Q.p(o, f);
745
754
  }
746
- } else p === "property" && Qe.p(c, f);
755
+ } else p === "property" && Ze.p(c, f);
747
756
  } else
748
- p === "layer" && (le.p("<anonymous>", s.loc), a++);
749
- re.push(a);
757
+ p === "layer" && (le.p("<anonymous>", s.loc), l++);
758
+ re.push(l);
750
759
  break;
751
760
  }
752
761
  case "Layer": {
@@ -754,40 +763,40 @@ function xi(i, t = {}) {
754
763
  break;
755
764
  }
756
765
  case "Feature": {
757
- je.p(s.name, s.loc);
766
+ Be.p(s.name, s.loc);
758
767
  break;
759
768
  }
760
- case Wt: {
761
- let p = s.prelude, a = s.block, m = p.children, c = a.children, f = m ? m.size : 0, o = c ? c.size : 0;
762
- fe.push(f + o), Ne.p(f + o, s.loc), pe.push(f), Ze.p(f, p.loc), he.push(o), Je.p(o, a.loc), ue++, o === 0 && ce++;
769
+ case Bt: {
770
+ let p = s.prelude, l = s.block, g = p.children, c = l.children, f = g ? g.size : 0, o = c ? c.size : 0;
771
+ fe.push(f + o), Ne.p(f + o, s.loc), pe.push(f), Je.p(f, p.loc), he.push(o), Xe.p(o, l.loc), ue++, o === 0 && ce++;
763
772
  break;
764
773
  }
765
774
  case Me: {
766
- let p = n(s);
775
+ let p = a(s);
767
776
  if (this.atrule && L("keyframes", this.atrule.name))
768
777
  return me.p(p, s.loc), this.skip;
769
- Dt(s) && ye.p(p, s.loc);
770
- let a = Xt(s);
771
- if (a !== !1)
772
- for (let b of a)
773
- lt.p(b, s.loc);
774
- let m = Ft(s);
775
- Jt(s) && ge.p(p, s.loc), Xe.add(p), N.push(m), rt.p(m, s.loc);
776
- let c = Ut(s).toArray(), [f, o, h] = c;
777
- return it.p(c.toString(), s.loc), $e.push(f), et.push(o), tt.push(h), T === void 0 && (T = c), M === void 0 && (M = c), M !== void 0 && qt(M, c) < 0 && (M = c), T !== void 0 && qt(T, c) > 0 && (T = c), st.push(c), f > 0 && de.p(p, s.loc), $t(s, function(S) {
778
- nt.p(S.name, S.loc);
778
+ Mt(s) && ye.p(p, s.loc);
779
+ let l = ei(s);
780
+ if (l !== !1)
781
+ for (let x of l)
782
+ nt.p(x, s.loc);
783
+ let g = It(s);
784
+ $t(s) && ge.p(p, s.loc), $e.add(p), Z.push(g), st.p(g, s.loc);
785
+ let c = Wt(s).toArray(), [f, o, h] = c;
786
+ return rt.p(c.toString(), s.loc), et.push(f), tt.push(o), it.push(h), T === void 0 && (T = c), M === void 0 && (M = c), M !== void 0 && Lt(M, c) < 0 && (M = c), T !== void 0 && Lt(T, c) > 0 && (T = c), lt.push(c), f > 0 && de.p(p, s.loc), ti(s, function(S) {
787
+ at.p(S.name, S.loc);
779
788
  }), this.skip;
780
789
  }
781
- case Ot: {
790
+ case Ie: {
782
791
  if (!this.declaration)
783
792
  break;
784
793
  let p = s.unit;
785
794
  return L("\\9", p) ? qe.push(p.substring(0, p.length - 2), this.declaration.property, s.loc) : qe.push(p, this.declaration.property, s.loc), this.skip;
786
795
  }
787
- case Qt: {
796
+ case Nt: {
788
797
  if (Te("data:", s.value)) {
789
- let p = s.value, a = p.length, m = mi(p);
790
- y.total++, _ += a;
798
+ let p = s.value, l = p.length, g = yi(p);
799
+ w.total++, _ += l;
791
800
  let c = {
792
801
  /** @type {number} */
793
802
  line: s.loc.start.line,
@@ -798,105 +807,109 @@ function xi(i, t = {}) {
798
807
  /** @type {number} */
799
808
  length: s.loc.end.offset - s.loc.start.offset
800
809
  };
801
- if (y.unique.has(m)) {
802
- let f = y.unique.get(m);
803
- f.count++, f.size += a, y.unique.set(m, f), e && f.uniqueWithLocations.push(c);
810
+ if (w.unique.has(g)) {
811
+ let f = w.unique.get(g);
812
+ f.count++, f.size += l, w.unique.set(g, f), e && f.uniqueWithLocations.push(c);
804
813
  } else {
805
814
  let f = {
806
815
  count: 1,
807
- size: a
816
+ size: l
808
817
  };
809
- e && (f.uniqueWithLocations = [c]), y.unique.set(m, f);
818
+ e && (f.uniqueWithLocations = [c]), w.unique.set(g, f);
810
819
  }
811
820
  }
812
821
  break;
813
822
  }
814
- case Kt: {
823
+ case Yt: {
815
824
  if (ee(s)) {
816
- Ce.push(1), B.p(n(s), s.loc);
825
+ Ce.push(1), B.p(a(s), s.loc);
817
826
  break;
818
827
  }
819
- let p = this.declaration, { property: a, important: m } = p, c = 1;
820
- Tt(s) && (ut.p(n(s), s.loc), c++), typeof m == "string" && (ze.p(g(s) + "!" + m, s.loc), c++), gi(s) && (ze.p(n(s), s.loc), c++);
828
+ let p = this.declaration, { property: l, important: g } = p, c = 1;
829
+ Ut(s) && (ct.p(a(s), s.loc), c++), typeof g == "string" && (ze.p(d(s) + "!" + g, s.loc), c++), wi(s) && (ze.p(a(s), s.loc), c++);
821
830
  let f = s.children, o = s.loc;
822
- if (Ce.push(c), x("z-index", a))
823
- return ct.p(n(s), o), this.skip;
824
- if (x("font", a)) {
825
- if (Re(s)) return;
826
- let { font_size: h, line_height: b, font_family: S } = ai(s, n, function(E) {
827
- E.type === "keyword" && B.p(E.value, o);
828
- });
829
- S && _e.p(S, o), h && Se.p(h, o), b && ve.p(b, o);
830
- break;
831
- } else if (x("font-size", a)) {
832
- Re(s) || Se.p(n(s), o);
833
- break;
834
- } else if (x("font-family", a)) {
835
- Re(s) || _e.p(n(s), o);
836
- break;
837
- } else if (x("line-height", a))
838
- ve.p(n(s), o);
839
- else if (x("transition", a) || x("animation", a)) {
840
- ci(f, function(h) {
841
- h.type === "fn" ? X.p(n(h.value), o) : h.type === "duration" ? $.p(n(h.value), o) : h.type === "keyword" && B.p(n(h.value), o);
842
- });
843
- break;
844
- } else if (x("animation-duration", a) || x("transition-duration", a)) {
845
- f && f.size > 1 ? f.forEach((h) => {
846
- h.type !== V && $.p(n(h), o);
847
- }) : $.p(n(s), o);
848
- break;
849
- } else if (x("transition-timing-function", a) || x("animation-timing-function", a)) {
850
- f && f.size > 1 ? f.forEach((h) => {
851
- h.type !== V && X.p(n(h), o);
852
- }) : X.p(n(s), o);
853
- break;
854
- } else if (x("container-name", a))
855
- Q.p(n(s), o);
856
- else if (x("container", a))
857
- ((zt = f.first) == null ? void 0 : zt.type) === "Identifier" && Q.p(f.first.name, o);
858
- else if (di.has(hi(a))) {
859
- ee(s) || mt.push(n(s), a, o);
860
- break;
861
- } else x("text-shadow", a) ? ee(s) || ft.p(n(s), o) : x("box-shadow", a) && (ee(s) || pt.p(n(s), o));
831
+ if (Ce.push(c), m("margin", l) || m("margin-block", l) || m("margin-inline", l) || m("margin-top", l) || m("margin-right", l) || m("margin-bottom", l) || m("margin-left", l) || m("padding", l) || m("padding-block", l) || m("padding-inline", l) || m("padding-top", l) || m("padding-right", l) || m("padding-bottom", l) || m("padding-left", l))
832
+ ni(s) && dt.p(l, p.loc);
833
+ else {
834
+ if (m("z-index", l))
835
+ return ft.p(a(s), o), this.skip;
836
+ if (m("font", l)) {
837
+ if (Re(s)) return;
838
+ let { font_size: h, line_height: x, font_family: S } = ci(s, a, function(E) {
839
+ E.type === "keyword" && B.p(E.value, o);
840
+ });
841
+ S && _e.p(S, o), h && Se.p(h, o), x && ve.p(x, o);
842
+ break;
843
+ } else if (m("font-size", l)) {
844
+ Re(s) || Se.p(a(s), o);
845
+ break;
846
+ } else if (m("font-family", l)) {
847
+ Re(s) || _e.p(a(s), o);
848
+ break;
849
+ } else if (m("line-height", l))
850
+ ve.p(a(s), o);
851
+ else if (m("transition", l) || m("animation", l)) {
852
+ hi(f, function(h) {
853
+ h.type === "fn" ? X.p(a(h.value), o) : h.type === "duration" ? $.p(a(h.value), o) : h.type === "keyword" && B.p(a(h.value), o);
854
+ });
855
+ break;
856
+ } else if (m("animation-duration", l) || m("transition-duration", l)) {
857
+ f && f.size > 1 ? f.forEach((h) => {
858
+ h.type !== H && $.p(a(h), o);
859
+ }) : $.p(a(s), o);
860
+ break;
861
+ } else if (m("transition-timing-function", l) || m("animation-timing-function", l)) {
862
+ f && f.size > 1 ? f.forEach((h) => {
863
+ h.type !== H && X.p(a(h), o);
864
+ }) : X.p(a(s), o);
865
+ break;
866
+ } else if (m("container-name", l))
867
+ Q.p(a(s), o);
868
+ else if (m("container", l))
869
+ ((St = f.first) == null ? void 0 : St.type) === "Identifier" && Q.p(f.first.name, o);
870
+ else if (bi.has(di(l))) {
871
+ ee(s) || gt.push(a(s), l, o);
872
+ break;
873
+ } else m("text-shadow", l) ? ee(s) || pt.p(a(s), o) : m("box-shadow", l) && (ee(s) || ht.p(a(s), o));
874
+ }
862
875
  q(s, function(h) {
863
- let b = h.name;
876
+ let x = h.name;
864
877
  switch (h.type) {
865
- case Gt: {
878
+ case Zt: {
866
879
  let S = h.value.length;
867
- return L("\\9", h.value) && (S = S - 2), I.push("#" + h.value, a, o), U.p("hex" + S, o), this.skip;
880
+ return L("\\9", h.value) && (S = S - 2), I.push("#" + h.value, l, o), U.p("hex" + S, o), this.skip;
868
881
  }
869
882
  case O: {
870
- te.has(b) && B.p(b, o);
871
- let S = b.length;
883
+ te.has(x) && B.p(x, o);
884
+ let S = x.length;
872
885
  if (S > 20 || S < 3)
873
886
  return this.skip;
874
- if (ri.has(b)) {
875
- let E = n(h);
876
- I.push(E, a, o), U.p(b.toLowerCase(), o);
887
+ if (li.has(x)) {
888
+ let E = a(h);
889
+ I.push(E, l, o), U.p(x.toLowerCase(), o);
877
890
  return;
878
891
  }
879
- if (ei.has(b)) {
880
- let E = n(h);
881
- I.push(E, a, o), U.p("named", o);
892
+ if (ii.has(x)) {
893
+ let E = a(h);
894
+ I.push(E, l, o), U.p("named", o);
882
895
  return;
883
896
  }
884
- if (ti.has(b)) {
885
- let E = n(h);
886
- I.push(E, a, o), U.p("system", o);
897
+ if (ri.has(x)) {
898
+ let E = a(h);
899
+ I.push(E, l, o), U.p("system", o);
887
900
  return;
888
901
  }
889
902
  return this.skip;
890
903
  }
891
- case Ie: {
892
- if (z("var", b))
904
+ case Ue: {
905
+ if (z("var", x))
893
906
  return this.skip;
894
- if (ii.has(b)) {
895
- I.push(n(h), a, h.loc), U.p(b.toLowerCase(), h.loc);
907
+ if (si.has(x)) {
908
+ I.push(a(h), l, h.loc), U.p(x.toLowerCase(), h.loc);
896
909
  return;
897
910
  }
898
- if (L("gradient", b)) {
899
- ht.p(n(h), h.loc);
911
+ if (L("gradient", x)) {
912
+ mt.p(a(h), h.loc);
900
913
  return;
901
914
  }
902
915
  }
@@ -904,48 +917,48 @@ function xi(i, t = {}) {
904
917
  });
905
918
  break;
906
919
  }
907
- case De: {
920
+ case Fe: {
908
921
  if (this.atrulePrelude !== null)
909
922
  return this.skip;
910
923
  W++;
911
924
  let p = 1;
912
- at.add(n(s)), s.important === !0 && (Z++, p++, this.atrule && L("keyframes", this.atrule.name) && (we++, p++)), ot.push(p);
913
- let { property: a, loc: { start: m } } = s, c = {
925
+ ot.add(a(s)), s.important === !0 && (N++, p++, this.atrule && L("keyframes", this.atrule.name) && (we++, p++)), ut.push(p);
926
+ let { property: l, loc: { start: g } } = s, c = {
914
927
  start: {
915
- line: m.line,
916
- column: m.column,
917
- offset: m.offset
928
+ line: g.line,
929
+ column: g.column,
930
+ offset: g.offset
918
931
  },
919
932
  end: {
920
- offset: m.offset + a.length
933
+ offset: g.offset + l.length
921
934
  }
922
935
  };
923
- K.p(a, c), D(a) ? (xe.p(a, c), j.push(2)) : pi(a) ? (be.p(a, c), j.push(2)) : Ue(a) ? (J.p(a, c), j.push(s.important ? 3 : 2), s.important === !0 && ke.p(a, c)) : j.push(1);
936
+ K.p(l, c), F(l) ? (xe.p(l, c), j.push(2)) : gi(l) ? (ke.p(l, c), j.push(2)) : Ve(l) ? (J.p(l, c), j.push(s.important ? 3 : 2), s.important === !0 && be.p(l, c)) : j.push(1);
924
937
  break;
925
938
  }
926
939
  }
927
940
  });
928
- let gt = at.size, H = N.size(), Ae = $e.aggregate(), Pe = et.aggregate(), Le = tt.aggregate(), dt = Xe.size, k = Object.assign, yt = i.length, Oe = se.length, wt = re.aggregate(), kt = N.aggregate(), bt = ot.aggregate(), xt = j.aggregate(), Ct = Ce.aggregate();
941
+ let yt = ot.size, V = Z.size(), Ae = et.aggregate(), Pe = tt.aggregate(), Le = it.aggregate(), wt = $e.size, k = Object.assign, bt = i.length, Oe = se.length, kt = re.aggregate(), xt = Z.aggregate(), Ct = ut.aggregate(), zt = j.aggregate(), _t = Ce.aggregate();
929
942
  return {
930
943
  stylesheet: {
931
- sourceLinesOfCode: ie + H + W + me.size(),
932
- linesOfCode: Mt,
933
- size: yt,
934
- complexity: wt.sum + kt.sum + bt.sum + xt.sum + Ct.sum,
944
+ sourceLinesOfCode: ie + V + W + me.size(),
945
+ linesOfCode: Vt,
946
+ size: bt,
947
+ complexity: kt.sum + xt.sum + Ct.sum + zt.sum + _t.sum,
935
948
  comments: {
936
- total: w,
937
- size: d
949
+ total: b,
950
+ size: y
938
951
  },
939
952
  embeddedContent: {
940
953
  size: {
941
954
  total: _,
942
- ratio: C(_, yt)
955
+ ratio: C(_, bt)
943
956
  },
944
957
  types: {
945
- total: y.total,
946
- totalUnique: y.unique.size,
947
- uniquenessRatio: C(y.unique.size, y.total),
948
- unique: Object.fromEntries(y.unique)
958
+ total: w.total,
959
+ totalUnique: w.unique.size,
960
+ uniquenessRatio: C(w.unique.size, w.total),
961
+ unique: Object.fromEntries(w.unique)
949
962
  }
950
963
  }
951
964
  },
@@ -958,19 +971,19 @@ function xi(i, t = {}) {
958
971
  }, e ? {
959
972
  uniqueWithLocations: He.c().uniqueWithLocations
960
973
  } : {}),
961
- import: Ve.c(),
974
+ import: We.c(),
962
975
  media: k(
963
- We.c(),
976
+ Ke.c(),
964
977
  {
965
- browserhacks: Ke.c(),
966
- features: je.c()
978
+ browserhacks: je.c(),
979
+ features: Be.c()
967
980
  }
968
981
  ),
969
- charset: Be.c(),
982
+ charset: Ye.c(),
970
983
  supports: k(
971
984
  ne.c(),
972
985
  {
973
- browserhacks: Ye.c()
986
+ browserhacks: Ge.c()
974
987
  }
975
988
  ),
976
989
  keyframes: k(
@@ -985,15 +998,15 @@ function xi(i, t = {}) {
985
998
  }
986
999
  ),
987
1000
  container: k(
988
- Ge.c(),
1001
+ Qe.c(),
989
1002
  {
990
1003
  names: Q.c()
991
1004
  }
992
1005
  ),
993
1006
  layer: le.c(),
994
- property: Qe.c(),
1007
+ property: Ze.c(),
995
1008
  total: ie,
996
- complexity: wt
1009
+ complexity: kt
997
1010
  },
998
1011
  rules: {
999
1012
  total: ue,
@@ -1013,20 +1026,20 @@ function xi(i, t = {}) {
1013
1026
  {
1014
1027
  items: pe.toArray()
1015
1028
  },
1016
- Ze.c()
1029
+ Je.c()
1017
1030
  ),
1018
1031
  declarations: k(
1019
1032
  he.aggregate(),
1020
1033
  {
1021
1034
  items: he.toArray()
1022
1035
  },
1023
- Je.c()
1036
+ Xe.c()
1024
1037
  )
1025
1038
  },
1026
1039
  selectors: {
1027
- total: H,
1028
- totalUnique: dt,
1029
- uniquenessRatio: C(dt, H),
1040
+ total: V,
1041
+ totalUnique: wt,
1042
+ uniquenessRatio: C(wt, V),
1030
1043
  specificity: k(
1031
1044
  {
1032
1045
  /** @type Specificity */
@@ -1040,52 +1053,52 @@ function xi(i, t = {}) {
1040
1053
  /** @type Specificity */
1041
1054
  mode: [Ae.mode, Pe.mode, Le.mode],
1042
1055
  /** @type Specificity */
1043
- items: st
1056
+ items: lt
1044
1057
  },
1045
- it.c()
1058
+ rt.c()
1046
1059
  ),
1047
1060
  complexity: k(
1048
- kt,
1049
- rt.c(),
1061
+ xt,
1062
+ st.c(),
1050
1063
  {
1051
- items: N.toArray()
1064
+ items: Z.toArray()
1052
1065
  }
1053
1066
  ),
1054
1067
  id: k(
1055
1068
  de.c(),
1056
1069
  {
1057
- ratio: C(de.size(), H)
1070
+ ratio: C(de.size(), V)
1058
1071
  }
1059
1072
  ),
1060
- pseudoClasses: lt.c(),
1073
+ pseudoClasses: nt.c(),
1061
1074
  accessibility: k(
1062
1075
  ye.c(),
1063
1076
  {
1064
- ratio: C(ye.size(), H)
1077
+ ratio: C(ye.size(), V)
1065
1078
  }
1066
1079
  ),
1067
1080
  keyframes: me.c(),
1068
1081
  prefixed: k(
1069
1082
  ge.c(),
1070
1083
  {
1071
- ratio: C(ge.size(), H)
1084
+ ratio: C(ge.size(), V)
1072
1085
  }
1073
1086
  ),
1074
- combinators: nt.c()
1087
+ combinators: at.c()
1075
1088
  },
1076
1089
  declarations: {
1077
1090
  total: W,
1078
- totalUnique: gt,
1079
- uniquenessRatio: C(gt, W),
1091
+ totalUnique: yt,
1092
+ uniquenessRatio: C(yt, W),
1080
1093
  importants: {
1081
- total: Z,
1082
- ratio: C(Z, W),
1094
+ total: N,
1095
+ ratio: C(N, W),
1083
1096
  inKeyframes: {
1084
1097
  total: we,
1085
- ratio: C(we, Z)
1098
+ ratio: C(we, N)
1086
1099
  }
1087
1100
  },
1088
- complexity: bt
1101
+ complexity: Ct
1089
1102
  },
1090
1103
  properties: k(
1091
1104
  K.c(),
@@ -1101,20 +1114,20 @@ function xi(i, t = {}) {
1101
1114
  {
1102
1115
  ratio: C(J.size(), K.size()),
1103
1116
  importants: k(
1104
- ke.c(),
1117
+ be.c(),
1105
1118
  {
1106
- ratio: C(ke.size(), J.size())
1119
+ ratio: C(be.size(), J.size())
1107
1120
  }
1108
1121
  )
1109
1122
  }
1110
1123
  ),
1111
1124
  browserhacks: k(
1112
- be.c(),
1125
+ ke.c(),
1113
1126
  {
1114
- ratio: C(be.size(), K.size())
1127
+ ratio: C(ke.size(), K.size())
1115
1128
  }
1116
1129
  ),
1117
- complexity: xt
1130
+ complexity: zt
1118
1131
  }
1119
1132
  ),
1120
1133
  values: {
@@ -1124,43 +1137,44 @@ function xi(i, t = {}) {
1124
1137
  formats: U.c()
1125
1138
  }
1126
1139
  ),
1127
- gradients: ht.c(),
1140
+ gradients: mt.c(),
1128
1141
  fontFamilies: _e.c(),
1129
1142
  fontSizes: Se.c(),
1130
1143
  lineHeights: ve.c(),
1131
- zindexes: ct.c(),
1132
- textShadows: ft.c(),
1133
- boxShadows: pt.c(),
1134
- borderRadiuses: mt.count(),
1144
+ zindexes: ft.c(),
1145
+ textShadows: pt.c(),
1146
+ boxShadows: ht.c(),
1147
+ borderRadiuses: gt.count(),
1135
1148
  animations: {
1136
1149
  durations: $.c(),
1137
1150
  timingFunctions: X.c()
1138
1151
  },
1139
- prefixes: ut.c(),
1152
+ prefixes: ct.c(),
1140
1153
  browserhacks: ze.c(),
1141
1154
  units: qe.count(),
1142
- complexity: Ct,
1143
- keywords: B.c()
1155
+ complexity: _t,
1156
+ keywords: B.c(),
1157
+ resets: dt.c()
1144
1158
  },
1145
1159
  __meta__: {
1146
- parseTime: F - P,
1147
- analyzeTime: Date.now() - F,
1148
- total: Date.now() - l
1160
+ parseTime: D - P,
1161
+ analyzeTime: Date.now() - D,
1162
+ total: Date.now() - n
1149
1163
  }
1150
1164
  };
1151
1165
  }
1152
- function qt(i, t) {
1166
+ function Lt(i, t) {
1153
1167
  return i[0] === t[0] ? i[1] === t[1] ? t[2] - i[2] : t[1] - i[1] : t[0] - i[0];
1154
1168
  }
1155
1169
  export {
1156
- xi as analyze,
1157
- qt as compareSpecificity,
1158
- D as hasVendorPrefix,
1159
- Dt as isAccessibilitySelector,
1160
- Zt as isMediaBrowserhack,
1161
- pi as isPropertyHack,
1162
- Jt as isSelectorPrefixed,
1163
- Nt as isSupportsBrowserhack,
1164
- Tt as isValuePrefixed,
1165
- Ft as selectorComplexity
1170
+ _i as analyze,
1171
+ Lt as compareSpecificity,
1172
+ F as hasVendorPrefix,
1173
+ Mt as isAccessibilitySelector,
1174
+ Xt as isMediaBrowserhack,
1175
+ gi as isPropertyHack,
1176
+ $t as isSelectorPrefixed,
1177
+ Jt as isSupportsBrowserhack,
1178
+ Ut as isValuePrefixed,
1179
+ It as selectorComplexity
1166
1180
  };
package/dist/index.d.ts CHANGED
@@ -895,6 +895,21 @@ export function analyze(css: string, options?: Options): {
895
895
  } | {
896
896
  uniqueWithLocations?: undefined;
897
897
  });
898
+ resets: {
899
+ total: number;
900
+ totalUnique: number;
901
+ uniquenessRatio: number;
902
+ unique: Record<string, number>;
903
+ } & ({
904
+ uniqueWithLocations: Record<string, {
905
+ line: number;
906
+ column: number;
907
+ offset: number;
908
+ length: number;
909
+ }[]>;
910
+ } | {
911
+ uniqueWithLocations?: undefined;
912
+ });
898
913
  };
899
914
  __meta__: {
900
915
  parseTime: number;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@projectwallace/css-analyzer",
3
3
  "description": "The best CSS analyzer out there. Check design tokens, complexity, specificity, performance and more.",
4
- "version": "7.1.1",
4
+ "version": "7.2.0",
5
5
  "author": "Bart Veneman",
6
6
  "repository": {
7
7
  "type": "git",