@projectwallace/css-analyzer 5.9.0 → 5.11.0-alpha.1
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/analyzer.cjs +1 -1
- package/dist/analyzer.cjs.map +1 -1
- package/dist/analyzer.modern.js +1 -1
- package/dist/analyzer.modern.js.map +1 -1
- package/dist/analyzer.module.js +1 -1
- package/dist/analyzer.module.js.map +1 -1
- package/dist/analyzer.umd.js +1 -1
- package/dist/analyzer.umd.js.map +1 -1
- package/dist/index.d.ts +440 -207
- package/package.json +2 -2
package/dist/analyzer.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e=require("css-tree/parser"),t=require("css-tree/walker"),n=require("@bramus/specificity/core");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=/*#__PURE__*/r(e),a=/*#__PURE__*/r(t);function o(e,t){return t>=65&&t<=90&&(t|=32),e===t}function s(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!1===o(e.charCodeAt(n),t.charCodeAt(n)))return!1;return!0}function u(e,t){var n=t.length-e.length;if(n<0)return!1;for(var r=t.length-1;r>=n;r--)if(!1===o(e.charCodeAt(r-n),t.charCodeAt(r)))return!1;return!0}function l(e,t){if(t.length<e.length)return!1;for(var n=0;n<e.length;n++)if(!1===o(e.charCodeAt(n),t.charCodeAt(n)))return!1;return!0}function f(e,t,n){return s(t,e.property)&&"Identifier"===e.value.children.first.type&&s(n,e.value.children.first.name)}function c(e){return 45===e.charCodeAt(0)&&45!==e.charCodeAt(1)&&-1!==e.indexOf("-",2)}function d(e,t){return e[0]===t[0]?e[1]===t[1]?t[2]-e[2]:t[1]-e[1]:t[0]-e[0]}function h(e,t){var n=[];return a.default(e,{visit:"Selector",enter:function(e){n.push(t(e))}}),n}function m(e){return s(e,"not")||s(e,"nth-child")||s(e,"nth-last-child")||s(e,"where")||s(e,"is")||s(e,"has")||s(e,"matches")||s(e,"-webkit-any")||s(e,"-moz-any")}function w(e){var t=!1;return a.default(e,function(e){if("AttributeSelector"==e.type){if(s("role",e.name.name)||l("aria-",e.name.name))return t=!0,this.break}else if("PseudoClassSelector"==e.type&&m(e.name))return h(e,w).some(function(e){return 1==e})?(t=!0,this.skip):this.skip}),t}function v(e){var t=0,n=!1;return a.default(e,function(e){if("Selector"!=e.type&&"Nth"!=e.type){if(t++,"IdSelector"!=e.type&&"ClassSelector"!=e.type&&"PseudoElementSelector"!=e.type&&"TypeSelector"!=e.type&&"PseudoClassSelector"!=e.type||c(e.name)&&(n=!0,t++),"AttributeSelector"==e.type)return Boolean(e.value)&&t++,c(e.name.name)&&(n=!0,t++),this.skip;if("PseudoClassSelector"==e.type&&m(e.name)){var r=h(e,v);if(0===r.length)return;return r.forEach(function(e){t+=e[0],1==e[1]&&(n=!0)}),this.skip}}}),[t,n]}var b=new Set(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"]),p=new Set(["canvas","canvastext","linktext","visitedtext","activetext","buttonface","buttontext","buttonborder","field","fieldtext","highlight","highlighttext","selecteditem","selecteditemtext","mark","marktext","graytext"]),g=new Set(["rgb","rgba","hsl","hsla","hwb","lab","lch","oklab","oklch","color"]),y=new Set(["currentcolor","transparent"]),k=new Set(["inherit","initial","unset","revert","caption","icon","menu","message-box","small-caption","status-bar"]);function x(e){var t=e.children.first;return"Identifier"===t.type&&k.has(t.name)}var q=new Set(["xx-small","x-small","small","medium","large","x-large","xx-large","xxx-large","smaller","larger"]),S=new Set(["ultra-condensed","extra-condensed","condensed","semi-condensed","semi-expanded","expanded","extra-expanded","ultra-expanded"]),z=new Set(["italic","oblique"]),I=new Set(["light","bold","bolder"]),O=new Set(["small-caps","all-small-caps","petite-caps","all-petite-caps","unicase","titling-caps"]),C=new Set(["auto","inherit","initial","unset","revert","none"]);function D(e){if(!e.children)return!1;var t=e.children.first;return!!t&&!(e.children.size>1)&&"Identifier"===t.type&&C.has(t.name)}var U=new Set(["linear","ease","ease-in","ease-out","ease-in-out","step-start","step-end"]);function _(e){if(!e.children)return!1;for(var t=e.children.toArray(),n=0;n<t.length;n++){var r=t[n],i=r.type,a=r.name;if("Identifier"===i&&c(a))return!0;if("Function"===i){if(c(a))return!0;if(_(r))return!0}}return!1}function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var R=/*#__PURE__*/function(){function e(e){if(this.t=new Map,this.i=0,e)for(var t=0;t<e.length;t++)this.push(e[t])}var t=e.prototype;return t.push=function(e){this.i++,this.t.has(e)?this.t.set(e,this.t.get(e)+1):this.t.set(e,1)},t.size=function(){return this.i},t.count=function(){return{total:this.i,totalUnique:this.t.size,unique:Object.fromEntries(this.t),uniquenessRatio:0===this.i?0:this.t.size/this.i}},e}(),M=/*#__PURE__*/function(){function e(){this.o=new R,this.u=new Map}var t=e.prototype;return t.push=function(e,t){this.o.push(e),this.u.has(t)||this.u.set(t,new R),this.u.get(t).push(e)},t.count=function(){for(var e,t=new Map,n=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return j(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?j(e,t):void 0}}(e))){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(this.u.entries());!(e=n()).done;){var r=e.value;t.set(r[0],r[1].count())}return Object.assign(this.o.count(),{itemsPerContext:Object.fromEntries(t)})},e}(),A=/*#__PURE__*/function(){function e(){this.t=[],this.l=0}var t=e.prototype;return t.push=function(e){this.t.push(e),this.l+=e},t.size=function(){return this.t.length},t.aggregate=function(){if(0===this.t.length)return{min:0,max:0,mean:0,mode:0,median:0,range:0,sum:0};var e,t,n,r=this.t.slice().sort(function(e,t){return e-t}),i=r[0],a=r[r.length-1],o=function(e){for(var t=new Map,n=-1,r=0,i=0,a=0;a<e.length;a++){var o=e[a],s=(t.get(o)||0)+1;t.set(o,s),s>n&&(n=s,r=0,i=0),s>=n&&(r++,i+=o)}return i/r}(r),s=(t=(e=r).length/2)!==(n=Math.floor(t))?e[n]:(e[n]+e[n-1])/2;return{min:i,max:a,mean:this.l/r.length,mode:o,median:s,range:a-i,sum:this.l}},t.toArray=function(){return this.t},e}();function F(e){return!(e.length<3)&&45===e.charCodeAt(0)&&45===e.charCodeAt(1)}function P(e,t){return!F(t)&&u(e,t)}function T(e,t){return 0===t?0:e/t}exports.analyze=function(e){var t=Date.now(),r=e.split(/\r?\n/g);function o(e){return h(e).trim()}function h(t){return e.substring(t.loc.start.offset,t.loc.end.offset)}var m,k,C=0,j=0,E=new R,H=0,N={total:0,unique:new Map},B=Date.now(),K=i.default(e,{parseCustomProperty:!0,positions:!0,onComment:function(e){C++,j+=e.length}}),L=Date.now(),Q=0,V=[],$=new R,G=new R,J=new R,W=new R,X=new R,Y=new R,Z=new R,ee=new R,te=new R,ne=new R,re=0,ie=0,ae=new A,oe=new A,se=new A,ue=new R,le=new Set,fe=new R,ce=new A,de=new A,he=new A,me=new R,we=new A,ve=[],be=new R,pe=new R,ge=new Set,ye=0,ke=0,xe=0,qe=new R,Se=new R,ze=new R,Ie=new R,Oe=new R,Ce=new A,De=new R,Ue=new R,_e=new R,je=new R,Re=new R,Me=new R,Ae=new R,Fe=new R,Pe=new R,Te=new R,Ee=new M,He=new R,Ne=new M;a.default(K,function(e){switch(e.type){case"Atrule":Q++;var t=e.name;if("font-face"===t){var r={};e.block.children.forEach(function(e){"Declaration"==e.type&&(r[e.property]=o(e.value))}),V.push(r);break}if("media"===t){var i=o(e.prelude);J.push(i),function(e){var t=!1;return a.default(e,function(e){if("MediaQuery"===e.type&&1===e.children.size&&"Identifier"===e.children.first.type&&(l("\\0",(e=e.children.first).name)||u("\\9 ",e.name)))return t=!0,this.break;if("MediaFeature"===e.type){if(null!==e.value&&"\\0"===e.value.unit)return t=!0,this.break;if(s("-moz-images-in-menus",e.name)||s("min--moz-device-pixel-ratio",e.name)||s("-ms-high-contrast",e.name))return t=!0,this.break;if(s("min-resolution",e.name)&&s(".001",e.value.value)&&s("dpcm",e.value.unit))return t=!0,this.break;if(s("-webkit-min-device-pixel-ratio",e.name)&&(s("0",e.value.value)||s("10000",e.value.value)))return t=!0,this.break}}),t}(e.prelude)&&W.push(i);break}if("supports"===t){var C=o(e.prelude);Y.push(C),function(e){var t=!1;return a.default(e,function(e){if("Declaration"===e.type&&(f(e,"-webkit-appearance","none")||f(e,"-moz-appearance","meterbar")))return t=!0,this.break}),t}(e.prelude)&&Z.push(C);break}if(u("keyframes",t)){var j="@"+t+" "+o(e.prelude);c(t)&&te.push(j),ee.push(j);break}if("import"===t){G.push(o(e.prelude));break}if("charset"===t){X.push(o(e.prelude));break}if("container"===t){ne.push(o(e.prelude));break}"layer"===t&&o(e.prelude).split(",").forEach(function(e){return $.push(e.trim())});break;case"Rule":var R=e.prelude.children?e.prelude.children.size:0,M=e.block.children?e.block.children.size:0;ae.push(R+M),oe.push(R),se.push(M),re++,0===M&&ie++;break;case"Selector":var A=o(e);if(this.atrule&&u("keyframes",this.atrule.name))return ue.push(A),this.skip;var T=n.calculate(e)[0].value,B=[T.a,T.b,T.c];B[0]>0&&be.push(A),w(e)&&pe.push(A);var K=v(e),L=K[0];return K[1]&&fe.push(A),le.add(A),we.push(L),me.push(B[0]+","+B[1]+","+B[2]),void 0===m&&(m=B),void 0===k&&(k=B),ce.push(B[0]),de.push(B[1]),he.push(B[2]),void 0!==k&&d(k,B)<0&&(k=B),void 0!==m&&d(m,B)>0&&(m=B),ve.push(B),this.skip;case"Dimension":if(!this.declaration)break;return u("\\9",e.unit)?Ne.push(e.unit.substring(0,e.unit.length-2),this.declaration.property):Ne.push(e.unit,this.declaration.property),this.skip;case"Url":if(l("data:",e.value)){var Be=e.value,Ke=Be.length,Le=function(e){var t=e.indexOf(";"),n=e.indexOf(",");return e.substring(5,-1===t||-1!==n&&n<t?n:t)}(Be);if(N.total++,H+=Ke,N.unique.has(Le)){var Qe=N.unique.get(Le);Qe.count++,Qe.size+=Ke,N.unique.set(Le,Qe)}else N.unique.set(Le,{count:1,size:Ke});E.push(Be)}break;case"Value":if(D(e))break;var Ve=this.declaration,$e=Ve.property,Ge=Ve.important;if(_(e)&&De.push(o(e)),"string"==typeof Ge&&Ue.push(h(e)+"!"+Ge),function(e){return e.children&&e.children.last&&"Identifier"===e.children.last.type&&u("\\9",e.children.last.name)}(e)&&Ue.push(o(e)),P("z-index",$e))return D(e)||_e.push(o(e)),this.skip;if(P("font",$e)){if(x(e))return;var Je=function(e,t){var n,r,i,a,o,s,u=[];return e.children.forEach(function(e,l){if(l.next&&"Operator"==l.next.data.type&&47==l.next.data.value.charCodeAt(0))n=t(e);else if(l.prev&&"Operator"==l.prev.data.type&&47==l.prev.data.value.charCodeAt(0))r=t(e);else{if(l.next&&"Operator"==l.next.data.type&&44==l.next.data.value.charCodeAt(0)&&!u[0])return u[0]=e,void(n||null==l.prev||(n=t(l.prev.data)));if("Dimension"===e.type&&l.prev&&"Identifier"===l.prev.data.type&&"oblique"==l.prev.data.name)a+="".padStart(e.loc.start.offset-l.prev.data.loc.end.offset)+t(e);else if("Number"!=e.type){if(null==l.next)return u[1]=e,void(n||u[0]||!l.prev||(n=t(l.prev.data)));if("Identifier"==e.type){if(q.has(e.name))return void(n=e.name);if(S.has(e.name))return void(s=e.name);if(I.has(e.name))return void(i=e.name);if(z.has(e.name))return void(a=e.name);if(O.has(e.name))return void(o=e.name)}}else i=t(e)}}),{font_style:a,font_variant:o,font_weight:i,font_stretch:s,font_size:n,line_height:r,font_family:t({loc:{start:{offset:(u[0]||u[1]).loc.start.offset},end:{offset:u[1].loc.end.offset}}})}}(e,o),We=Je.font_size,Xe=Je.line_height,Ye=Je.font_family;Ye&&Me.push(Ye),We&&Ae.push(We),Xe&&Fe.push(Xe);break}if(P("font-size",$e)){x(e)||Ae.push(o(e));break}if(P("font-family",$e)){x(e)||Me.push(o(e));break}if(P("line-height",$e))Fe.push(o(e));else{if(P("transition",$e)||P("animation",$e)){for(var Ze=function(e,t){var n=!1,r=[],i=[];return e.forEach(function(e){return"Operator"===e.type?n=!1:"Dimension"===e.type&&!1===n?(n=!0,r.push(t(e))):"Identifier"===e.type&&U.has(e.name)?i.push(t(e)):"Function"!==e.type||"cubic-bezier"!==e.name&&"steps"!==e.name?void 0:i.push(t(e))}),[r,i]}(e.children,o),et=Ze[0],tt=Ze[1],nt=0;nt<et.length;nt++)Te.push(et[nt]);for(var rt=0;rt<tt.length;rt++)Pe.push(tt[rt]);break}if(P("animation-duration",$e)||P("transition-duration",$e)){Te.push(o(e));break}if(P("transition-timing-function",$e)||P("animation-timing-function",$e)){Pe.push(o(e));break}P("text-shadow",$e)?D(e)||je.push(o(e)):P("box-shadow",$e)&&(D(e)||Re.push(o(e)))}a.default(e,function(e){switch(e.type){case"Hash":var t=e.value.length;return u("\\9",e.value)&&(t-=2),Ee.push("#"+e.value,$e),He.push("hex"+t),this.skip;case"Identifier":var n=e.name;if(n.length>20||n.length<3)return this.skip;var r=o(e),i=n.toLowerCase();return b.has(i)?(Ee.push(r,$e),He.push("named")):y.has(i)?(Ee.push(r,$e),He.push(i)):p.has(i)&&(Ee.push(r,$e),He.push("system")),this.skip;case"Function":if(s("var",e.name))return this.skip;var a=e.name.toLowerCase(),l=o(e);g.has(a)&&(Ee.push(l,$e),He.push(a))}});break;case"Declaration":if(null!==this.atrulePrelude)return this.skip;ye++,ge.add(o(e)),!0===e.important&&(ke++,this.atrule&&u("keyframes",this.atrule.name)&&xe++);var it=e.property;Se.push(it),c(it)?(Ie.push(it),Ce.push(2)):function(e){if(F(e)||c(e))return!1;var t=e.charCodeAt(0);return 47===t||95===t||43===t||42===t||38===t||36===t||35===t}(it)?(ze.push(it),Ce.push(2)):F(it)?(Oe.push(it),Ce.push(2),!0===e.important&&qe.push(it)):Ce.push(1)}});var Be=E.count(),Ke=ge.size,Le=we.size(),Qe=ce.aggregate(),Ve=de.aggregate(),$e=he.aggregate(),Ge=me.count(),Je=new R(we.toArray()).count(),We=le.size,Xe=new R(ae.toArray()).count(),Ye=new R(oe.toArray()).count(),Ze=new R(se.toArray()).count(),et=Object.assign;return{stylesheet:{sourceLinesOfCode:Q+Le+ye+ue.size(),linesOfCode:r.length,size:e.length,comments:{total:C,size:j},embeddedContent:et(Be,{size:{total:H,ratio:T(H,e.length)},types:{total:N.total,totalUnique:N.unique.size,uniquenessRatio:T(N.unique.size,N.total),unique:Object.fromEntries(N.unique)}})},atrules:{fontface:{total:V.length,totalUnique:V.length,unique:V,uniquenessRatio:0===V.length?0:1},import:G.count(),media:et(J.count(),{browserhacks:W.count()}),charset:X.count(),supports:et(Y.count(),{browserhacks:Z.count()}),keyframes:et(ee.count(),{prefixed:et(te.count(),{ratio:T(te.size(),ee.size())})}),container:ne.count(),layer:$.count()},rules:{total:re,empty:{total:ie,ratio:T(ie,re)},sizes:et(ae.aggregate(),{items:ae.toArray(),unique:Xe.unique,totalUnique:Xe.totalUnique,uniquenessRatio:Xe.uniquenessRatio}),selectors:et(oe.aggregate(),{items:oe.toArray(),unique:Ye.unique,totalUnique:Ye.totalUnique,uniquenessRatio:Ye.uniquenessRatio}),declarations:et(se.aggregate(),{items:se.toArray(),unique:Ze.unique,totalUnique:Ze.totalUnique,uniquenessRatio:Ze.uniquenessRatio})},selectors:{total:Le,totalUnique:We,uniquenessRatio:T(We,Le),specificity:{min:void 0===k?[0,0,0]:k,max:void 0===m?[0,0,0]:m,sum:[Qe.sum,Ve.sum,$e.sum],mean:[Qe.mean,Ve.mean,$e.mean],mode:[Qe.mode,Ve.mode,$e.mode],median:[Qe.median,Ve.median,$e.median],items:ve,unique:Ge.unique,totalUnique:Ge.totalUnique,uniquenessRatio:Ge.uniquenessRatio},complexity:et(we.aggregate(),Je,{items:we.toArray()}),id:et(be.count(),{ratio:T(be.size(),Le)}),accessibility:et(pe.count(),{ratio:T(pe.size(),Le)}),keyframes:ue.count(),prefixed:et(fe.count(),{ratio:T(fe.size(),Le)})},declarations:{total:ye,totalUnique:Ke,uniquenessRatio:T(Ke,ye),unique:{total:Ke,ratio:T(Ke,ye)},importants:{total:ke,ratio:T(ke,ye),inKeyframes:{total:xe,ratio:T(xe,ke)}}},properties:et(Se.count(),{prefixed:et(Ie.count(),{ratio:T(Ie.size(),Se.size())}),custom:et(Oe.count(),{ratio:T(Oe.size(),Se.size()),importants:et(qe.count(),{ratio:T(qe.size(),Oe.size())})}),browserhacks:et(ze.count(),{ratio:T(ze.size(),Se.size())}),complexity:Ce.aggregate()}),values:{colors:et(Ee.count(),{formats:He.count()}),fontFamilies:Me.count(),fontSizes:Ae.count(),lineHeights:Fe.count(),zindexes:_e.count(),textShadows:je.count(),boxShadows:Re.count(),animations:{durations:Te.count(),timingFunctions:Pe.count()},prefixes:De.count(),browserhacks:Ue.count(),units:Ne.count()},__meta__:{parseTime:L-B,analyzeTime:Date.now()-L,total:Date.now()-t}}},exports.compareSpecificity=d;
|
|
1
|
+
var e=require("css-tree/parser"),t=require("css-tree/walker"),n=require("@bramus/specificity/core");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=/*#__PURE__*/i(e),a=/*#__PURE__*/i(t);function o(e,t){return t>=65&&t<=90&&(t|=32),e===t}function s(e,t){var n=e.length;if(n!==t.length)return!1;for(var i=0;i<n;i++)if(!1===o(e.charCodeAt(i),t.charCodeAt(i)))return!1;return!0}function u(e,t){var n=t.length,i=n-e.length;if(i<0)return!1;for(var r=n-1;r>=i;r--)if(!1===o(e.charCodeAt(r-i),t.charCodeAt(r)))return!1;return!0}function l(e,t){var n=e.length;if(t.length<n)return!1;for(var i=0;i<n;i++)if(!1===o(e.charCodeAt(i),t.charCodeAt(i)))return!1;return!0}function c(e,t,n){return s(t,e.property)&&"Identifier"===e.value.children.first.type&&s(n,e.value.children.first.name)}function f(e){return 45===e.charCodeAt(0)&&45!==e.charCodeAt(1)&&-1!==e.indexOf("-",2)}function h(e,t){return e[0]===t[0]?e[1]===t[1]?t[2]-e[2]:t[1]-e[1]:t[0]-e[0]}function d(e,t){var n=[];return a.default(e,{visit:"Selector",enter:function(e){n.push(t(e))}}),n}function m(e){return s(e,"not")||s(e,"nth-child")||s(e,"nth-last-child")||s(e,"where")||s(e,"is")||s(e,"has")||s(e,"matches")||s(e,"-webkit-any")||s(e,"-moz-any")}function v(e){var t=!1;return a.default(e,function(e){if("AttributeSelector"===e.type){if(s("role",e.name.name)||l("aria-",e.name.name))return t=!0,this.break}else if("PseudoClassSelector"===e.type&&m(e.name))return d(e,v).some(function(e){return!0===e})?(t=!0,this.skip):this.skip}),t}function w(e){var t=0,n=!1;return a.default(e,function(e){if("Selector"!==e.type&&"Nth"!==e.type){if(t++,"IdSelector"!==e.type&&"ClassSelector"!==e.type&&"PseudoElementSelector"!==e.type&&"TypeSelector"!==e.type&&"PseudoClassSelector"!==e.type||f(e.name)&&(n=!0,t++),"AttributeSelector"===e.type)return Boolean(e.value)&&t++,f(e.name.name)&&(n=!0,t++),this.skip;if("PseudoClassSelector"===e.type&&m(e.name)){var i=d(e,w);if(0===i.length)return;return i.forEach(function(e){t+=e[0],!0===e[1]&&(n=!0)}),this.skip}}}),[t,n]}var b=/*#__PURE__*/function(){function e(e){this.set=e}return e.prototype.has=function(e){for(var t=this.set.length,n=0;n<t;n++)if(s(this.set[n],e))return!0;return!1},e}(),g=new b(["white","black","red","blue","gray","grey","green","rebeccapurple","yellow","orange","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","blanchedalmond","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","whitesmoke","yellowgreen"]),p=new b(["canvas","canvastext","linktext","visitedtext","activetext","buttonface","buttontext","buttonborder","field","fieldtext","highlight","highlighttext","selecteditem","selecteditemtext","mark","marktext","graytext"]),y=new b(["rgb","rgba","hsl","hsla","hwb","lab","lch","oklab","oklch","color"]),k=new b(["transparent","currentcolor"]),L=new b(["caption","icon","menu","message-box","small-caption","status-bar"]),x=new b(["xx-small","x-small","small","medium","large","x-large","xx-large","xxx-large","smaller","larger"]);function q(e){var t=e.children.first;return"Identifier"===t.type&&L.has(t.name)}var S=new b(["auto","inherit","initial","unset","revert","revert-layer","none"]);function z(e){if(!e.children)return!1;if(e.children.size>1||0===e.children.size)return!1;var t=e.children.first;return"Identifier"===t.type&&S.has(t.name)}var O=new b(["linear","ease","ease-in","ease-out","ease-in-out","step-start","step-end"]),I=new b(["cubic-bezier","steps"]);function _(e){if(!e.children)return!1;for(var t=e.children.toArray(),n=0;n<t.length;n++){var i=t[n],r=i.type,a=i.name;if("Identifier"===r&&f(a))return!0;if("Function"===r){if(f(a))return!0;if(_(i))return!0}}return!1}function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var C=/*#__PURE__*/function(){function e(e){var t=e.useLocations,n=void 0!==t&&t;this.t=new Map,this.i=0,this.node_lines=[],this.node_columns=[],this.node_lengths=[],this.node_offsets=[],this.o=n}var t=e.prototype;return t.push=function(e,t){var n=this.i;if(this.node_lines[n]=t.start.line,this.node_columns[n]=t.start.column,this.node_offsets[n]=t.start.offset,this.node_lengths[n]=t.end.offset-t.start.offset,this.t.has(e))return this.t.get(e).push(n),void this.i++;this.t.set(e,[n]),this.i++},t.size=function(){return this.i},t.count=function(){var e=this,t=new Map,n={};return this.t.forEach(function(i,r){var a=i.map(function(t){return{line:e.node_lines[t],column:e.node_columns[t],offset:e.node_offsets[t],length:e.node_lengths[t]}});t.set(r,a),n[r]=i.length}),this.o?{total:this.i,totalUnique:this.t.size,unique:n,uniquenessRatio:0===this.i?0:this.t.size/this.i,__unstable__uniqueWithLocations:Object.fromEntries(t)}:{total:this.i,totalUnique:this.t.size,unique:n,uniquenessRatio:0===this.i?0:this.t.size/this.i}},e}(),D=/*#__PURE__*/function(){function e(e){var t=e.useLocations,n=void 0!==t&&t;this.u=new C({useLocations:n}),this.l=new Map,this.useLocations=n}var t=e.prototype;return t.push=function(e,t,n){this.u.push(e,n),this.l.has(t)||this.l.set(t,new C({useLocations:this.useLocations})),this.l.get(t).push(e,n)},t.count=function(){for(var e,t=new Map,n=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return j(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?j(e,t):void 0}}(e))){n&&(e=n);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(this.l.entries());!(e=n()).done;){var i=e.value;t.set(i[0],i[1].count())}return Object.assign(this.u.count(),{itemsPerContext:Object.fromEntries(t)})},e}(),M=/*#__PURE__*/function(){function e(){this.t=[],this.h=0}var t=e.prototype;return t.push=function(e){this.t.push(e),this.h+=e},t.size=function(){return this.t.length},t.aggregate=function(){if(0===this.t.length)return{min:0,max:0,mean:0,mode:0,median:0,range:0,sum:0};var e,t,n,i=this.t.slice().sort(function(e,t){return e-t}),r=i[0],a=i[i.length-1],o=function(e){for(var t=new Map,n=-1,i=0,r=0,a=0;a<e.length;a++){var o=e[a],s=(t.get(o)||0)+1;t.set(o,s),s>n&&(n=s,i=0,r=0),s>=n&&(i++,r+=o)}return r/i}(i),s=(t=(e=i).length/2)!==(n=Math.floor(t))?e[n]:(e[n]+e[n-1])/2;return{min:r,max:a,mean:this.h/i.length,mode:o,median:s,range:a-r,sum:this.h}},t.toArray=function(){return this.t},e}();function U(e){return!(e.length<3)&&45===e.charCodeAt(0)&&45===e.charCodeAt(1)}function A(e,t){return!U(t)&&u(e,t)}function R(e,t){return 0===t?0:e/t}var F={useUnstableLocations:!1};exports.analyze=function(e,t){void 0===t&&(t={});var i=!0===Object.assign({},F,t).useUnstableLocations,o=Date.now();function d(e){return m(e).trim()}function m(t){return e.substring(t.loc.start.offset,t.loc.end.offset)}var b,L,S=0,j=0,P=new C({useLocations:i}),T=0,E={total:0,unique:new Map},H=Date.now(),N=r.default(e,{parseCustomProperty:!0,positions:!0,onComment:function(e){S++,j+=e.length}}),B=Date.now(),K=N.loc.end.line-N.loc.start.line+1,Q=0,V=[],W=new C({useLocations:i}),$=new C({useLocations:i}),G=new C({useLocations:i}),J=new C({useLocations:i}),X=new C({useLocations:i}),Y=new C({useLocations:i}),Z=new C({useLocations:i}),ee=new C({useLocations:i}),te=new C({useLocations:i}),ne=new C({useLocations:i}),ie=0,re=0,ae=new M,oe=new M,se=new M,ue=new C({useLocations:i}),le=new C({useLocations:i}),ce=new C({useLocations:i}),fe=new C({useLocations:i}),he=new Set,de=new C({useLocations:i}),me=new M,ve=new M,we=new M,be=new C({useLocations:i}),ge=new M,pe=new C({useLocations:i}),ye=[],ke=new C({useLocations:i}),Le=new C({useLocations:i}),xe=new Set,qe=0,Se=0,ze=0,Oe=new C({useLocations:i}),Ie=new C({useLocations:i}),_e=new C({useLocations:i}),je=new C({useLocations:i}),Ce=new C({useLocations:i}),De=new M,Me=new C({useLocations:i}),Ue=new C({useLocations:i}),Ae=new C({useLocations:i}),Re=new C({useLocations:i}),Fe=new C({useLocations:i}),Pe=new C({useLocations:i}),Te=new C({useLocations:i}),Ee=new C({useLocations:i}),He=new C({useLocations:i}),Ne=new C({useLocations:i}),Be=new D({useLocations:i}),Ke=new C({useLocations:i}),Qe=new D({useLocations:i}),Ve=new C({useLocations:i});a.default(N,function(e){switch(e.type){case"Atrule":Q++;var t=e.name;if("font-face"===t){var i={};e.block.children.forEach(function(e){"Declaration"===e.type&&(i[e.property]=d(e.value))}),V.push(i);break}if("media"===t){var r=d(e.prelude);G.push(r,e.prelude.loc),function(e){var t=!1;return a.default(e,function(e){if("MediaQuery"===e.type&&1===e.children.size&&"Identifier"===e.children.first.type&&(l("\\0",(e=e.children.first).name)||u("\\9 ",e.name)))return t=!0,this.break;if("MediaFeature"===e.type){if(null!==e.value&&"\\0"===e.value.unit)return t=!0,this.break;if(s("-moz-images-in-menus",e.name)||s("min--moz-device-pixel-ratio",e.name)||s("-ms-high-contrast",e.name))return t=!0,this.break;if(s("min-resolution",e.name)&&s(".001",e.value.value)&&s("dpcm",e.value.unit))return t=!0,this.break;if(s("-webkit-min-device-pixel-ratio",e.name)&&(s("0",e.value.value)||s("10000",e.value.value)))return t=!0,this.break}}),t}(e.prelude)&&J.push(r,e.prelude.loc);break}if("supports"===t){var o=d(e.prelude);Y.push(o,e.prelude.loc),function(e){var t=!1;return a.default(e,function(e){if("Declaration"===e.type&&(c(e,"-webkit-appearance","none")||c(e,"-moz-appearance","meterbar")))return t=!0,this.break}),t}(e.prelude)&&Z.push(o,e.prelude.loc);break}if(u("keyframes",t)){var S="@"+t+" "+d(e.prelude);f(t)&&te.push(S,e.prelude.loc),ee.push(S,e.prelude.loc);break}if("import"===t){$.push(d(e.prelude),e.prelude.loc);break}if("charset"===t){X.push(d(e.prelude),e.prelude.loc);break}if("container"===t){ne.push(d(e.prelude),e.prelude.loc);break}"layer"===t&&d(e.prelude).split(",").forEach(function(t){return W.push(t.trim(),e.prelude.loc)});break;case"Rule":var j=e.prelude.children?e.prelude.children.size:0,C=e.block.children?e.block.children.size:0;ae.push(j+C),ue.push(j+C,e.loc),oe.push(j),le.push(j,e.prelude.loc),se.push(C),ce.push(C,e.block.loc),ie++,0===C&&re++;break;case"Selector":var D=d(e);if(this.atrule&&u("keyframes",this.atrule.name))return fe.push(D,e.loc),this.skip;var M=n.calculate(e)[0].value,R=[M.a,M.b,M.c];R[0]>0&&ke.push(D,e.loc),v(e)&&Le.push(D,e.loc);var F=w(e),H=F[0];return F[1]&&de.push(D,e.loc),he.add(D),ge.push(H),pe.push(H,e.loc),be.push(R[0]+","+R[1]+","+R[2],e.loc),void 0===b&&(b=R),void 0===L&&(L=R),me.push(R[0]),ve.push(R[1]),we.push(R[2]),void 0!==L&&h(L,R)<0&&(L=R),void 0!==b&&h(b,R)>0&&(b=R),ye.push(R),this.skip;case"Dimension":if(!this.declaration)break;var N=e.unit;return u("\\9",N)?Qe.push(N.substring(0,N.length-2),this.declaration.property,e.loc):Qe.push(N,this.declaration.property,e.loc),this.skip;case"Url":if(l("data:",e.value)){var B=e.value,K=B.length,We=function(e){var t=e.indexOf(";"),n=e.indexOf(",");return e.substring(5,-1===t||-1!==n&&n<t?n:t)}(B);if(E.total++,T+=K,E.unique.has(We)){var $e=E.unique.get(We);$e.count++,$e.size+=K,E.unique.set(We,$e)}else E.unique.set(We,{count:1,size:K});P.push(B,e.loc)}break;case"Value":if(z(e))break;var Ge=this.declaration,Je=Ge.property,Xe=Ge.important;if(_(e)&&Me.push(d(e),e.loc),"string"==typeof Xe&&Ue.push(m(e)+"!"+Xe,e.loc),function(e){var t=e.children;return t&&t.last&&"Identifier"===t.last.type&&u("\\9",t.last.name)}(e)&&Ue.push(d(e),e.loc),A("z-index",Je))return Ae.push(d(e),e.loc),this.skip;if(A("font",Je)){if(q(e))return;var Ye=function(e,t){var n,i,r=[];return e.children.forEach(function(e,a){if(a.next&&"Operator"===a.next.data.type&&47===a.next.data.value.charCodeAt(0))n=t(e);else if(a.prev&&"Operator"===a.prev.data.type&&47===a.prev.data.value.charCodeAt(0))i=t(e);else{if(a.next&&"Operator"===a.next.data.type&&44===a.next.data.value.charCodeAt(0)&&!r[0])return r[0]=e,void(n||null==a.prev||(n=t(a.prev.data)));if("Dimension"===e.type&&a.prev&&"Identifier"===a.prev.data.type&&"oblique"===a.prev.data.name)font_style+="".padStart(e.loc.start.offset-a.prev.data.loc.end.offset)+t(e);else if("Number"!==e.type)return null===a.next?(r[1]=e,void(n||r[0]||!a.prev||(n=t(a.prev.data)))):void("Identifier"===e.type&&x.has(e.name)&&(n=e.name))}}),{font_size:n,line_height:i,font_family:t({loc:{start:{offset:(r[0]||r[1]).loc.start.offset},end:{offset:r[1].loc.end.offset}}})}}(e,d),Ze=Ye.font_size,et=Ye.line_height,tt=Ye.font_family;tt&&Pe.push(tt,e.loc),Ze&&Te.push(Ze,e.loc),et&&Ee.push(et,e.loc);break}if(A("font-size",Je)){q(e)||Te.push(d(e),e.loc);break}if(A("font-family",Je)){q(e)||Pe.push(d(e),e.loc);break}if(A("line-height",Je))Ee.push(d(e),e.loc);else{if(A("transition",Je)||A("animation",Je)){for(var nt=function(e,t){var n=!1,i=[],r=[];return e.forEach(function(e){var a=e.type;return"Operator"===a?n=!1:"Dimension"===a&&!1===n?(n=!0,i.push(t(e))):"Identifier"===a&&O.has(e.name)||"Function"===a&&I.has(e.name)?r.push(t(e)):void 0}),[i,r]}(e.children,d),it=nt[0],rt=nt[1],at=0;at<it.length;at++)Ne.push(it[at],e.loc);for(var ot=0;ot<rt.length;ot++)He.push(rt[ot],e.loc);break}if(A("animation-duration",Je)||A("transition-duration",Je)){e.children&&e.children.size>1?e.children.forEach(function(t){"Operator"!==t.type&&Ne.push(d(t),e.loc)}):Ne.push(d(e),e.loc);break}if(A("transition-timing-function",Je)||A("animation-timing-function",Je)){e.children&&e.children.size>1?e.children.forEach(function(t){"Operator"!==t.type&&He.push(d(t),e.loc)}):He.push(d(e),e.loc);break}A("text-shadow",Je)?z(e)||Re.push(d(e),e.loc):A("box-shadow",Je)&&(z(e)||Fe.push(d(e),e.loc))}a.default(e,function(e){var t=e.name;switch(e.type){case"Hash":var n=e.value.length;return u("\\9",e.value)&&(n-=2),Be.push("#"+e.value,Je,e.loc),Ke.push("hex"+n,e.loc),this.skip;case"Identifier":if(t.length>20||t.length<3)return this.skip;if(g.has(t)){var i=d(e);return Be.push(i,Je,e.loc),void Ke.push("named",e.loc)}if(k.has(t)){var r=d(e);return Be.push(r,Je,e.loc),void Ke.push(t.toLowerCase(),e.loc)}if(p.has(t)){var a=d(e);return Be.push(a,Je,e.loc),void Ke.push("system",e.loc)}return this.skip;case"Function":if(s("var",t))return this.skip;if(y.has(t))return Be.push(d(e),Je,e.loc),void Ke.push(t.toLowerCase(),e.loc);if(u("gradient",t))return void Ve.push(d(e),e.loc)}});break;case"Declaration":if(null!==this.atrulePrelude)return this.skip;qe++,xe.add(d(e)),!0===e.important&&(Se++,this.atrule&&u("keyframes",this.atrule.name)&&ze++);var st=e.property,ut={start:{line:e.loc.start.line,column:e.loc.start.column,offset:e.loc.start.offset},end:{offset:e.loc.start.offset+st.length}};Ie.push(st,ut),f(st)?(je.push(st,ut),De.push(2)):function(e){if(U(e)||f(e))return!1;var t=e.charCodeAt(0);return 47===t||95===t||43===t||42===t||38===t||36===t||35===t}(st)?(_e.push(st,ut),De.push(2)):U(st)?(Ce.push(st,ut),De.push(2),!0===e.important&&Oe.push(st,ut)):De.push(1)}});var We=P.count(),$e=xe.size,Ge=ge.size(),Je=me.aggregate(),Xe=ve.aggregate(),Ye=we.aggregate(),Ze=he.size,et=Object.assign;return{stylesheet:{sourceLinesOfCode:Q+Ge+qe+fe.size(),linesOfCode:K,size:e.length,comments:{total:S,size:j},embeddedContent:et(We,{size:{total:T,ratio:R(T,e.length)},types:{total:E.total,totalUnique:E.unique.size,uniquenessRatio:R(E.unique.size,E.total),unique:Object.fromEntries(E.unique)}})},atrules:{fontface:{total:V.length,totalUnique:V.length,unique:V,uniquenessRatio:0===V.length?0:1},import:$.count(),media:et(G.count(),{browserhacks:J.count()}),charset:X.count(),supports:et(Y.count(),{browserhacks:Z.count()}),keyframes:et(ee.count(),{prefixed:et(te.count(),{ratio:R(te.size(),ee.size())})}),container:ne.count(),layer:W.count()},rules:{total:ie,empty:{total:re,ratio:R(re,ie)},sizes:et(ae.aggregate(),{items:ae.toArray()},ue.count()),selectors:et(oe.aggregate(),{items:oe.toArray()},le.count()),declarations:et(se.aggregate(),{items:se.toArray()},ce.count())},selectors:{total:Ge,totalUnique:Ze,uniquenessRatio:R(Ze,Ge),specificity:et({min:void 0===L?[0,0,0]:L,max:void 0===b?[0,0,0]:b,sum:[Je.sum,Xe.sum,Ye.sum],mean:[Je.mean,Xe.mean,Ye.mean],mode:[Je.mode,Xe.mode,Ye.mode],median:[Je.median,Xe.median,Ye.median],items:ye},be.count()),complexity:et(ge.aggregate(),pe.count(),{items:ge.toArray()}),id:et(ke.count(),{ratio:R(ke.size(),Ge)}),accessibility:et(Le.count(),{ratio:R(Le.size(),Ge)}),keyframes:fe.count(),prefixed:et(de.count(),{ratio:R(de.size(),Ge)})},declarations:{total:qe,totalUnique:$e,uniquenessRatio:R($e,qe),unique:{total:$e,ratio:R($e,qe)},importants:{total:Se,ratio:R(Se,qe),inKeyframes:{total:ze,ratio:R(ze,Se)}}},properties:et(Ie.count(),{prefixed:et(je.count(),{ratio:R(je.size(),Ie.size())}),custom:et(Ce.count(),{ratio:R(Ce.size(),Ie.size()),importants:et(Oe.count(),{ratio:R(Oe.size(),Ce.size())})}),browserhacks:et(_e.count(),{ratio:R(_e.size(),Ie.size())}),complexity:De.aggregate()}),values:{colors:et(Be.count(),{formats:Ke.count()}),gradients:Ve.count(),fontFamilies:Pe.count(),fontSizes:Te.count(),lineHeights:Ee.count(),zindexes:Ae.count(),textShadows:Re.count(),boxShadows:Fe.count(),animations:{durations:Ne.count(),timingFunctions:He.count()},prefixes:Me.count(),browserhacks:Ue.count(),units:Qe.count()},__meta__:{parseTime:B-H,analyzeTime:Date.now()-B,total:Date.now()-o}}},exports.compareSpecificity=h;
|
|
2
2
|
//# sourceMappingURL=analyzer.cjs.map
|
package/dist/analyzer.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyzer.cjs","sources":["../src/string-utils.js","../src/atrules/atrules.js","../src/vendor-prefix.js","../src/selectors/utils.js","../src/values/colors.js","../src/values/destructure-font-shorthand.js","../src/values/values.js","../src/values/animations.js","../src/values/vendor-prefix.js","../src/countable-collection.js","../src/context-collection.js","../src/aggregate-collection.js","../src/properties/property-utils.js","../src/index.js","../src/stylesheet/stylesheet.js","../src/values/browserhacks.js"],"sourcesContent":["/**\n * Case-insensitive compare two character codes\n * @param {string} charA\n * @param {string} charB\n * @see https://github.com/csstree/csstree/blob/41f276e8862d8223eeaa01a3d113ab70bb13d2d9/lib/tokenizer/utils.js#L22\n */\nfunction compareChar(referenceCode, testCode) {\n // if uppercase\n if (testCode >= 0x0041 && testCode <= 0x005A) {\n // shifting the 6th bit makes a letter lowercase\n testCode = testCode | 32\n }\n return referenceCode === testCode\n}\n\n/**\n * Case-insensitive string-comparison\n * @param {string} base\n * @param {string} test\n * @returns {boolean} true if the two strings are the same, false otherwise\n */\nexport function strEquals(base, test) {\n if (base.length !== test.length) return false\n\n for (let i = 0; i < base.length; i++) {\n if (compareChar(base.charCodeAt(i), test.charCodeAt(i)) === false) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * Case-insensitive testing whether a string ends with a given substring\n * @param {string} base e.g. '-webkit-transform'\n * @param {string} cmp e.g. 'transform'\n * @returns {boolean} true if `test` ends with `base`, false otherwise\n */\nexport function endsWith(base, test) {\n const offset = test.length - base.length\n\n if (offset < 0) {\n return false\n }\n\n for (let i = test.length - 1; i >= offset; i--) {\n if (compareChar(base.charCodeAt(i - offset), test.charCodeAt(i)) === false) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * Case-insensitive testing whether a string starts with a given substring\n * @param {string} base\n * @param {test} test\n * @returns {boolean} true if `test` starts with `base`, false otherwise\n */\nexport function startsWith(base, test) {\n if (test.length < base.length) return false\n\n for (let i = 0; i < base.length; i++) {\n if (compareChar(base.charCodeAt(i), test.charCodeAt(i)) === false) {\n return false\n }\n }\n\n return true\n}\n","import { strEquals, startsWith, endsWith } from '../string-utils.js'\nimport walk from 'css-tree/walker'\n\n/**\n * Check whether node.property === property and node.value === value,\n * but case-insensitive and fast.\n * @param {import('css-tree').Declaration} node\n * @param {string} property - The CSS property to compare with (case-insensitive)\n * @param {string} value - The identifier/keyword value to compare with\n * @returns true if declaratioNode is the given property: value, false otherwise\n */\nfunction isPropertyValue(node, property, value) {\n return strEquals(property, node.property)\n && node.value.children.first.type === 'Identifier'\n && strEquals(value, node.value.children.first.name)\n}\n\n/**\n * Check if an @supports atRule is a browserhack\n * @param {import('css-tree').AtrulePrelude} prelude\n * @returns true if the atrule is a browserhack\n */\nexport function isSupportsBrowserhack(prelude) {\n let returnValue = false\n\n walk(prelude, function (node) {\n if (node.type === 'Declaration') {\n if (\n isPropertyValue(node, '-webkit-appearance', 'none')\n || isPropertyValue(node, '-moz-appearance', 'meterbar')\n ) {\n returnValue = true\n return this.break\n }\n }\n })\n\n return returnValue\n}\n\n/**\n * Check if a @media atRule is a browserhack\n * @param {import('css-tree').AtrulePrelude} prelude\n * @returns true if the atrule is a browserhack\n */\nexport function isMediaBrowserhack(prelude) {\n let returnValue = false\n\n walk(prelude, function (node) {\n if (node.type === 'MediaQuery'\n && node.children.size === 1\n && node.children.first.type === 'Identifier'\n ) {\n node = node.children.first\n // Note: CSSTree adds a trailing space to \\\\9\n if (startsWith('\\\\0', node.name) || endsWith('\\\\9 ', node.name)) {\n returnValue = true\n return this.break\n }\n }\n if (node.type === 'MediaFeature') {\n if (node.value !== null && node.value.unit === '\\\\0') {\n returnValue = true\n return this.break\n }\n if (strEquals('-moz-images-in-menus', node.name)\n || strEquals('min--moz-device-pixel-ratio', node.name)\n || strEquals('-ms-high-contrast', node.name)\n ) {\n returnValue = true\n return this.break\n }\n if (strEquals('min-resolution', node.name)\n && strEquals('.001', node.value.value)\n && strEquals('dpcm', node.value.unit)\n ) {\n returnValue = true\n return this.break\n }\n if (strEquals('-webkit-min-device-pixel-ratio', node.name)) {\n if ((strEquals('0', node.value.value) || strEquals('10000', node.value.value))) {\n returnValue = true\n return this.break\n }\n }\n }\n })\n\n return returnValue\n}","const HYPHENMINUS = 45; // '-'.charCodeAt()\n\n/**\n * @param {string} keyword\n * @returns {boolean}\n */\nfunction hasVendorPrefix(keyword) {\n if (keyword.charCodeAt(0) === HYPHENMINUS && keyword.charCodeAt(1) !== HYPHENMINUS) {\n // String must have a 2nd occurrence of '-', at least at position 3 (offset=2)\n if (keyword.indexOf('-', 2) !== -1) {\n return true\n }\n }\n\n return false\n}\n\nexport {\n hasVendorPrefix\n}","import walk from 'css-tree/walker'\nimport { startsWith, strEquals } from '../string-utils.js'\nimport { hasVendorPrefix } from '../vendor-prefix.js'\n\n/**\n * Compare specificity A to Specificity B\n * @param {[number,number,number]} a - Specificity A\n * @param {[number,number,number]} b - Specificity B\n * @returns {number} sortIndex - 0 when a==b, 1 when a<b, -1 when a>b\n */\nexport function compareSpecificity(a, b) {\n if (a[0] === b[0]) {\n if (a[1] === b[1]) {\n return b[2] - a[2]\n }\n\n return b[1] - a[1]\n }\n\n return b[0] - a[0]\n}\n\n/**\n *\n * @param {import('css-tree').SelectorList} selectorListAst\n * @returns {Selector[]} Analyzed selectors in the selectorList\n */\nfunction analyzeList(selectorListAst, cb) {\n const childSelectors = []\n walk(selectorListAst, {\n visit: 'Selector',\n enter: function (node) {\n childSelectors.push(cb(node))\n }\n })\n\n return childSelectors\n}\n\nfunction isPseudoFunction(name) {\n return (\n strEquals(name, 'not')\n || strEquals(name, 'nth-child')\n || strEquals(name, 'nth-last-child')\n || strEquals(name, 'where')\n || strEquals(name, 'is')\n || strEquals(name, 'has')\n || strEquals(name, 'matches')\n || strEquals(name, '-webkit-any')\n || strEquals(name, '-moz-any')\n )\n}\n\nexport function isAccessibility(selector) {\n let isA11y = false\n\n walk(selector, function (node) {\n if (node.type == 'AttributeSelector') {\n if (strEquals('role', node.name.name) || startsWith('aria-', node.name.name)) {\n isA11y = true\n return this.break\n }\n }\n // Test for [aria-] or [role] inside :is()/:where() and friends\n else if (node.type == 'PseudoClassSelector') {\n if (isPseudoFunction(node.name)) {\n const list = analyzeList(node, isAccessibility)\n\n if (list.some(b => b == true)) {\n isA11y = true\n return this.skip\n }\n\n return this.skip\n }\n }\n })\n\n return isA11y;\n}\n\n/**\n * Get the Complexity for the AST of a Selector Node\n * @param {import('css-tree').Selector} ast - AST Node for a Selector\n * @return {number} - The numeric complexity of the Selector\n */\nexport function getComplexity(selector) {\n let complexity = 0\n let isPrefixed = false\n\n walk(selector, function (node) {\n if (node.type == 'Selector' || node.type == 'Nth') return\n\n complexity++\n\n if (node.type == 'IdSelector'\n || node.type == 'ClassSelector'\n || node.type == 'PseudoElementSelector'\n || node.type == 'TypeSelector'\n || node.type == 'PseudoClassSelector'\n ) {\n if (hasVendorPrefix(node.name)) {\n isPrefixed = true\n complexity++\n }\n }\n\n if (node.type == 'AttributeSelector') {\n if (Boolean(node.value)) {\n complexity++\n }\n if (hasVendorPrefix(node.name.name)) {\n isPrefixed = true\n complexity++\n }\n return this.skip\n }\n\n if (node.type == 'PseudoClassSelector') {\n if (isPseudoFunction(node.name)) {\n const list = analyzeList(node, getComplexity)\n\n // Bail out for empty/non-existent :nth-child() params\n if (list.length === 0) return\n\n list.forEach(([c, p]) => {\n complexity += c\n if (p == true) isPrefixed = true\n })\n return this.skip\n }\n }\n })\n\n return [complexity, isPrefixed]\n}\n","export const namedColors = new Set([\n // CSS Named Colors\n // Spec: https://drafts.csswg.org/css-color/#named-colors\n 'aliceblue',\n 'antiquewhite',\n 'aqua',\n 'aquamarine',\n 'azure',\n 'beige',\n 'bisque',\n 'black',\n 'blanchedalmond',\n 'blue',\n 'blueviolet',\n 'brown',\n 'burlywood',\n 'cadetblue',\n 'chartreuse',\n 'chocolate',\n 'coral',\n 'cornflowerblue',\n 'cornsilk',\n 'crimson',\n 'cyan',\n 'darkblue',\n 'darkcyan',\n 'darkgoldenrod',\n 'darkgray',\n 'darkgreen',\n 'darkgrey',\n 'darkkhaki',\n 'darkmagenta',\n 'darkolivegreen',\n 'darkorange',\n 'darkorchid',\n 'darkred',\n 'darksalmon',\n 'darkseagreen',\n 'darkslateblue',\n 'darkslategray',\n 'darkslategrey',\n 'darkturquoise',\n 'darkviolet',\n 'deeppink',\n 'deepskyblue',\n 'dimgray',\n 'dimgrey',\n 'dodgerblue',\n 'firebrick',\n 'floralwhite',\n 'forestgreen',\n 'fuchsia',\n 'gainsboro',\n 'ghostwhite',\n 'gold',\n 'goldenrod',\n 'gray',\n 'green',\n 'greenyellow',\n 'grey',\n 'honeydew',\n 'hotpink',\n 'indianred',\n 'indigo',\n 'ivory',\n 'khaki',\n 'lavender',\n 'lavenderblush',\n 'lawngreen',\n 'lemonchiffon',\n 'lightblue',\n 'lightcoral',\n 'lightcyan',\n 'lightgoldenrodyellow',\n 'lightgray',\n 'lightgreen',\n 'lightgrey',\n 'lightpink',\n 'lightsalmon',\n 'lightseagreen',\n 'lightskyblue',\n 'lightslategray',\n 'lightslategrey',\n 'lightsteelblue',\n 'lightyellow',\n 'lime',\n 'limegreen',\n 'linen',\n 'magenta',\n 'maroon',\n 'mediumaquamarine',\n 'mediumblue',\n 'mediumorchid',\n 'mediumpurple',\n 'mediumseagreen',\n 'mediumslateblue',\n 'mediumspringgreen',\n 'mediumturquoise',\n 'mediumvioletred',\n 'midnightblue',\n 'mintcream',\n 'mistyrose',\n 'moccasin',\n 'navajowhite',\n 'navy',\n 'oldlace',\n 'olive',\n 'olivedrab',\n 'orange',\n 'orangered',\n 'orchid',\n 'palegoldenrod',\n 'palegreen',\n 'paleturquoise',\n 'palevioletred',\n 'papayawhip',\n 'peachpuff',\n 'peru',\n 'pink',\n 'plum',\n 'powderblue',\n 'purple',\n 'rebeccapurple',\n 'red',\n 'rosybrown',\n 'royalblue',\n 'saddlebrown',\n 'salmon',\n 'sandybrown',\n 'seagreen',\n 'seashell',\n 'sienna',\n 'silver',\n 'skyblue',\n 'slateblue',\n 'slategray',\n 'slategrey',\n 'snow',\n 'springgreen',\n 'steelblue',\n 'tan',\n 'teal',\n 'thistle',\n 'tomato',\n 'turquoise',\n 'violet',\n 'wheat',\n 'white',\n 'whitesmoke',\n 'yellow',\n 'yellowgreen',\n])\n\nexport const systemColors = new Set([\n // CSS System Colors\n // Spec: https://drafts.csswg.org/css-color/#css-system-colors\n 'canvas',\n 'canvastext',\n 'linktext',\n 'visitedtext',\n 'activetext',\n 'buttonface',\n 'buttontext',\n 'buttonborder',\n 'field',\n 'fieldtext',\n 'highlight',\n 'highlighttext',\n 'selecteditem',\n 'selecteditemtext',\n 'mark',\n 'marktext',\n 'graytext',\n\n // TODO: Deprecated CSS System colors\n // Spec: https://drafts.csswg.org/css-color/#deprecated-system-colors\n])\n\nexport const colorFunctions = new Set([\n 'rgb',\n 'rgba',\n 'hsl',\n 'hsla',\n 'hwb',\n 'lab',\n 'lch',\n 'oklab',\n 'oklch',\n 'color',\n])\n\nexport const colorKeywords = new Set([\n 'currentcolor',\n 'transparent',\n])\n","const FONT_KEYWORDS = new Set([\n\t// Global CSS keywords\n\t'inherit',\n\t'initial',\n\t'unset',\n\t'revert',\n\n\t// System font keywords\n\t'caption',\n\t'icon',\n\t'menu',\n\t'message-box',\n\t'small-caption',\n\t'status-bar',\n])\n\nexport function isFontKeyword(node) {\n\tconst firstChild = node.children.first\n\treturn firstChild.type === 'Identifier' && FONT_KEYWORDS.has(firstChild.name)\n}\n\nconst SIZE_KEYWORDS = new Set([\n\t/* <absolute-size> values */\n\t'xx-small',\n\t'x-small',\n\t'small',\n\t'medium',\n\t'large',\n\t'x-large',\n\t'xx-large',\n\t'xxx-large',\n\t/* <relative-size> values */\n\t'smaller',\n\t'larger',\n])\n\nconst STRETCH_KEYWORDS = new Set([\n\t'ultra-condensed',\n\t'extra-condensed',\n\t'condensed',\n\t'semi-condensed',\n\t'semi-expanded',\n\t'expanded',\n\t'extra-expanded',\n\t'ultra-expanded',\n])\nconst STYLE_KEYWORDS = new Set(['italic', 'oblique'])\nconst WEIGHT_KEYWORDS = new Set(['light', 'bold', 'bolder'])\nconst VARIANT_KEYWORDS = new Set([\n\t'small-caps',\n\t'all-small-caps',\n\t'petite-caps',\n\t'all-petite-caps',\n\t'unicase',\n\t'titling-caps',\n])\n\nconst COMMA = 44 // ','.charCodeAt(0) === 44\nconst SLASH = 47 // '/'.charCodeAt(0) === 47\n\nexport function destructure(value, stringifyNode) {\n\tlet font_family = []\n\tlet font_size\n\tlet line_height\n\tlet font_weight\n\tlet font_style\n\tlet font_variant\n\tlet font_stretch\n\n\tvalue.children.forEach(function (node, item) {\n\t\t// any node that comes before the '/' is the font-size\n\t\tif (\n\t\t\titem.next &&\n\t\t\titem.next.data.type == 'Operator' &&\n\t\t\titem.next.data.value.charCodeAt(0) == SLASH\n\t\t) {\n\t\t\tfont_size = stringifyNode(node)\n\t\t\treturn\n\t\t}\n\n\t\t// any node that comes after '/' is the line-height\n\t\tif (\n\t\t\titem.prev &&\n\t\t\titem.prev.data.type == 'Operator' &&\n\t\t\titem.prev.data.value.charCodeAt(0) == SLASH\n\t\t) {\n\t\t\tline_height = stringifyNode(node)\n\t\t\treturn\n\t\t}\n\n\t\t// any node that's followed by ',' is a font-family\n\t\tif (\n\t\t\titem.next &&\n\t\t\titem.next.data.type == 'Operator' &&\n\t\t\titem.next.data.value.charCodeAt(0) == COMMA &&\n\t\t\t!font_family[0]\n\t\t) {\n\t\t\tfont_family[0] = node\n\n\t\t\tif (!font_size && item.prev != null) {\n\t\t\t\tfont_size = stringifyNode(item.prev.data)\n\t\t\t}\n\n\t\t\treturn\n\t\t}\n\n\t\t// If, after taking care of font-size and line-height, we still have a remaining dimension, it must be the oblique angle\n\t\tif (\n\t\t\tnode.type === 'Dimension' &&\n\t\t\titem.prev &&\n\t\t\titem.prev.data.type === 'Identifier' &&\n\t\t\titem.prev.data.name == 'oblique'\n\t\t) {\n\t\t\t// put in the correct amount of whitespace between `oblique` and `<angle>`\n\t\t\tfont_style +=\n\t\t\t\t''.padStart(node.loc.start.offset - item.prev.data.loc.end.offset) +\n\t\t\t\tstringifyNode(node)\n\t\t\treturn\n\t\t}\n\n\t\t// any node that's a number and not previously caught by line-height or font-size is the font-weight\n\t\t// (oblique <angle> will not be caught here, because that's a Dimension, not a Number)\n\t\tif (node.type == 'Number') {\n\t\t\tfont_weight = stringifyNode(node)\n\t\t\treturn\n\t\t}\n\n\t\t// last node always ends the font-family\n\t\tif (item.next == null) {\n\t\t\tfont_family[1] = node\n\n\t\t\t// if, at the last node, we don;t have a size yet, it *must* be the previous node\n\t\t\t// unless `font: menu` (system font), because then there's simply no size\n\t\t\tif (!font_size && !font_family[0] && item.prev) {\n\t\t\t\tfont_size = stringifyNode(item.prev.data)\n\t\t\t}\n\n\t\t\treturn\n\t\t}\n\n\t\t// Any remaining identifiers can be font-size, font-style, font-stretch, font-variant or font-weight\n\t\tif (node.type == 'Identifier') {\n\t\t\tif (SIZE_KEYWORDS.has(node.name)) {\n\t\t\t\tfont_size = node.name\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (STRETCH_KEYWORDS.has(node.name)) {\n\t\t\t\tfont_stretch = node.name\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (WEIGHT_KEYWORDS.has(node.name)) {\n\t\t\t\tfont_weight = node.name\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (STYLE_KEYWORDS.has(node.name)) {\n\t\t\t\tfont_style = node.name\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (VARIANT_KEYWORDS.has(node.name)) {\n\t\t\t\tfont_variant = node.name\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t})\n\n\treturn {\n\t\tfont_style,\n\t\tfont_variant,\n\t\tfont_weight,\n\t\tfont_stretch,\n\t\tfont_size,\n\t\tline_height,\n\t\tfont_family: stringifyNode({\n\t\t\tloc: {\n\t\t\t\tstart: {\n\t\t\t\t\toffset: (font_family[0] || font_family[1]).loc.start.offset\n\t\t\t\t},\n\t\t\t\tend: {\n\t\t\t\t\toffset: font_family[1].loc.end.offset\n\t\t\t\t}\n\t\t\t}\n\t\t}),\n\t}\n}","const keywords = new Set([\n 'auto',\n 'inherit',\n 'initial',\n 'unset',\n 'revert',\n 'none', // for `text-shadow`, `box-shadow` and `background`\n])\n\nexport function isValueKeyword(node) {\n if (!node.children) return false\n const firstChild = node.children.first\n if (!firstChild) return false\n\n if (node.children.size > 1) return false\n return firstChild.type === 'Identifier' && keywords.has(firstChild.name)\n}\n","const timingKeywords = new Set([\n 'linear',\n 'ease',\n 'ease-in',\n 'ease-out',\n 'ease-in-out',\n 'step-start',\n 'step-end',\n])\n\nexport function analyzeAnimation(children, stringifyNode) {\n let durationFound = false\n const durations = []\n const timingFunctions = []\n\n children.forEach(child => {\n // Right after a ',' we start over again\n if (child.type === 'Operator') {\n return durationFound = false\n }\n if (child.type === 'Dimension' && durationFound === false) {\n durationFound = true\n return durations.push(stringifyNode(child))\n }\n if (child.type === 'Identifier' && timingKeywords.has(child.name)) {\n return timingFunctions.push(stringifyNode(child))\n }\n if (child.type === 'Function'\n && (\n child.name === 'cubic-bezier' || child.name === 'steps'\n )\n ) {\n return timingFunctions.push(stringifyNode(child))\n }\n })\n\n return [durations, timingFunctions]\n}\n","import { hasVendorPrefix } from '../vendor-prefix.js'\n\nexport function isAstVendorPrefixed(node) {\n if (!node.children) {\n return false\n }\n\n const children = node.children.toArray()\n\n for (let index = 0; index < children.length; index++) {\n const node = children[index]\n const { type, name } = node;\n\n if (type === 'Identifier' && hasVendorPrefix(name)) {\n return true\n }\n\n if (type === 'Function') {\n if (hasVendorPrefix(name)) {\n return true\n }\n\n if (isAstVendorPrefixed(node)) {\n return true\n }\n }\n }\n\n return false\n}\n","class CountableCollection {\n /**\n * @param {string[]} initial\n */\n constructor(initial) {\n /** @type [index: string]: string */\n this._items = new Map()\n /** @type number */\n this._total = 0\n\n if (initial) {\n for (let i = 0; i < initial.length; i++) {\n this.push(initial[i])\n }\n }\n }\n\n /**\n * Push an item to the end of this collection\n * @param {string} item\n * @returns {void}\n */\n push(item) {\n this._total++\n\n if (this._items.has(item)) {\n this._items.set(item, this._items.get(item) + 1)\n return\n }\n\n this._items.set(item, 1)\n }\n\n /**\n * Get the size of this collection\n * @returns {number} the size of this collection\n */\n size() {\n return this._total\n }\n\n /**\n * Get the counts of this collection, like total, uniques, etc.\n */\n count() {\n return {\n total: this._total,\n totalUnique: this._items.size,\n unique: Object.fromEntries(this._items),\n uniquenessRatio: this._total === 0 ? 0 : this._items.size / this._total,\n }\n }\n}\n\nexport {\n CountableCollection\n}","import { CountableCollection } from './countable-collection.js'\n\nclass ContextCollection {\n constructor() {\n this._list = new CountableCollection()\n /** @type {[index; string]: CountableCollection} */\n this._contexts = new Map()\n }\n\n /**\n * Add an item to this _list's context\n * @param {string} item Item to push\n * @param {string} context Context to push Item to\n */\n push(item, context) {\n this._list.push(item)\n\n if (!this._contexts.has(context)) {\n this._contexts.set(context, new CountableCollection())\n }\n\n this._contexts.get(context).push(item)\n }\n\n count() {\n const itemsPerContext = new Map()\n\n for (let [context, value] of this._contexts.entries()) {\n itemsPerContext.set(context, value.count())\n }\n\n return Object.assign(this._list.count(), {\n itemsPerContext: Object.fromEntries(itemsPerContext)\n })\n }\n}\n\nexport {\n ContextCollection\n}","/**\n * Find the mode (most occurring value) in an array of Numbers\n * Takes the mean/average of multiple values if multiple values occur the same amount of times.\n *\n * @see https://github.com/angus-c/just/blob/684af9ca0c7808bc78543ec89379b1fdfce502b1/packages/array-mode/index.js\n * @param {Array} arr - Array to find the mode value for\n * @returns {Number} mode - The `mode` value of `arr`\n */\nfunction Mode(arr) {\n const frequencies = new Map()\n let maxOccurrences = -1\n let maxOccurenceCount = 0\n let sum = 0\n\n for (let i = 0; i < arr.length; i++) {\n const element = arr[i]\n const updatedCount = (frequencies.get(element) || 0) + 1\n frequencies.set(element, updatedCount)\n\n if (updatedCount > maxOccurrences) {\n maxOccurrences = updatedCount\n maxOccurenceCount = 0\n sum = 0\n }\n\n if (updatedCount >= maxOccurrences) {\n maxOccurenceCount++\n sum += element\n }\n }\n\n return sum / maxOccurenceCount\n}\n\n/**\n * Find the middle number in an Array of Numbers\n * Returns the average of 2 numbers if the Array length is an even number\n * @see https://github.com/angus-c/just/blob/684af9ca0c7808bc78543ec89379b1fdfce502b1/packages/array-median/index.js\n * @param {Array} arr - A sorted Array\n * @returns {Number} - The array's Median\n */\nfunction Median(arr) {\n const middle = arr.length / 2\n const lowerMiddleRank = Math.floor(middle)\n\n if (middle !== lowerMiddleRank) {\n return arr[lowerMiddleRank]\n }\n return (arr[lowerMiddleRank] + arr[lowerMiddleRank - 1]) / 2\n}\n\nclass AggregateCollection {\n constructor() {\n /** @type number[] */\n this._items = []\n this._sum = 0\n }\n\n /**\n * Add a new Integer at the end of this AggregateCollection\n * @param {number} item - The item to add\n */\n push(item) {\n this._items.push(item)\n this._sum += item\n }\n\n size() {\n return this._items.length\n }\n\n aggregate() {\n if (this._items.length === 0) {\n return {\n min: 0,\n max: 0,\n mean: 0,\n mode: 0,\n median: 0,\n range: 0,\n sum: 0,\n }\n }\n\n // TODO: can we avoid this sort()? It's slow\n /** @type Number[] */\n const sorted = this._items.slice().sort((a, b) => a - b)\n const min = sorted[0]\n const max = sorted[sorted.length - 1]\n\n const mode = Mode(sorted)\n const median = Median(sorted)\n\n return {\n min,\n max,\n mean: this._sum / sorted.length,\n mode,\n median,\n range: max - min,\n sum: this._sum,\n }\n }\n\n /**\n * @returns {number[]} All _items in this collection\n */\n toArray() {\n return this._items\n }\n}\n\nexport {\n AggregateCollection\n}","import { hasVendorPrefix } from '../vendor-prefix.js'\nimport { endsWith } from '../string-utils.js'\n\n/**\n * @param {string} property\n * @see https://github.com/csstree/csstree/blob/master/lib/utils/names.js#L69\n */\nexport function isHack(property) {\n if (isCustom(property) || hasVendorPrefix(property)) return false\n\n let code = property.charCodeAt(0)\n\n return code === 47 // /\n || code === 95 // _\n || code === 43 // +\n || code === 42 // *\n || code === 38 // &\n || code === 36 // $\n || code === 35 // #\n}\n\nexport function isCustom(property) {\n if (property.length < 3) return false\n // 45 === '-'.charCodeAt(0)\n return property.charCodeAt(0) === 45 && property.charCodeAt(1) === 45\n}\n\nexport function isProperty(basename, property) {\n if (isCustom(property)) return false\n return endsWith(basename, property)\n}","import parse from 'css-tree/parser'\nimport walk from 'css-tree/walker'\nimport { calculate } from '@bramus/specificity/core'\nimport { isSupportsBrowserhack, isMediaBrowserhack } from './atrules/atrules.js'\nimport { getComplexity, isAccessibility, compareSpecificity } from './selectors/utils.js'\nimport { colorFunctions, colorKeywords, namedColors, systemColors } from './values/colors.js'\nimport { destructure, isFontKeyword } from './values/destructure-font-shorthand.js'\nimport { isValueKeyword } from './values/values.js'\nimport { analyzeAnimation } from './values/animations.js'\nimport { isAstVendorPrefixed } from './values/vendor-prefix.js'\nimport { ContextCollection } from './context-collection.js'\nimport { CountableCollection } from './countable-collection.js'\nimport { AggregateCollection } from './aggregate-collection.js'\nimport { strEquals, startsWith, endsWith } from './string-utils.js'\nimport { hasVendorPrefix } from './vendor-prefix.js'\nimport { isCustom, isHack, isProperty } from './properties/property-utils.js'\nimport { getEmbedType } from './stylesheet/stylesheet.js'\nimport { isIe9Hack } from './values/browserhacks.js'\n\nfunction ratio(part, total) {\n if (total === 0) return 0\n return part / total\n}\n\n/**\n * Analyze CSS\n * @param {string} css\n */\nconst analyze = (css) => {\n const start = Date.now()\n let lines = css.split(/\\r?\\n/g)\n\n /**\n * Recreate the authored CSS from a CSSTree node\n * @param {import('css-tree').CssNode} node - Node from CSSTree AST to stringify\n * @returns {string} str - The stringified node\n */\n function stringifyNode(node) {\n return stringifyNodePlain(node).trim()\n }\n\n function stringifyNodePlain(node) {\n return css.substring(node.loc.start.offset, node.loc.end.offset)\n }\n\n // Stylesheet\n let totalComments = 0\n let commentsSize = 0\n const embeds = new CountableCollection()\n let embedSize = 0\n const embedTypes = {\n total: 0,\n unique: new Map()\n }\n\n const startParse = Date.now()\n\n const ast = parse(css, {\n parseCustomProperty: true, // To find font-families, colors, etc.\n positions: true, // So we can use stringifyNode()\n onComment: function (comment) {\n totalComments++\n commentsSize += comment.length\n },\n })\n\n const startAnalysis = Date.now()\n\n // Atrules\n let totalAtRules = 0\n /** @type {string}[]} */\n const fontfaces = []\n const layers = new CountableCollection()\n const imports = new CountableCollection()\n const medias = new CountableCollection()\n const mediaBrowserhacks = new CountableCollection()\n const charsets = new CountableCollection()\n const supports = new CountableCollection()\n const supportsBrowserhacks = new CountableCollection()\n const keyframes = new CountableCollection()\n const prefixedKeyframes = new CountableCollection()\n const containers = new CountableCollection()\n\n // Rules\n let totalRules = 0\n let emptyRules = 0\n const ruleSizes = new AggregateCollection()\n const selectorsPerRule = new AggregateCollection()\n const declarationsPerRule = new AggregateCollection()\n\n // Selectors\n const keyframeSelectors = new CountableCollection()\n const uniqueSelectors = new Set()\n const prefixedSelectors = new CountableCollection()\n /** @type [number,number,number] */\n let maxSpecificity\n /** @type [number,number,number] */\n let minSpecificity\n const specificityA = new AggregateCollection()\n const specificityB = new AggregateCollection()\n const specificityC = new AggregateCollection()\n const uniqueSpecificities = new CountableCollection()\n const selectorComplexities = new AggregateCollection()\n /** @type [number,number,number][] */\n const specificities = []\n const ids = new CountableCollection()\n const a11y = new CountableCollection()\n\n // Declarations\n const uniqueDeclarations = new Set()\n let totalDeclarations = 0\n let importantDeclarations = 0\n let importantsInKeyframes = 0\n let importantCustomProperties = new CountableCollection()\n\n // Properties\n const properties = new CountableCollection()\n const propertyHacks = new CountableCollection()\n const propertyVendorPrefixes = new CountableCollection()\n const customProperties = new CountableCollection()\n const propertyComplexities = new AggregateCollection()\n\n // Values\n const vendorPrefixedValues = new CountableCollection()\n const valueBrowserhacks = new CountableCollection()\n const zindex = new CountableCollection()\n const textShadows = new CountableCollection()\n const boxShadows = new CountableCollection()\n const fontFamilies = new CountableCollection()\n const fontSizes = new CountableCollection()\n const lineHeights = new CountableCollection()\n const timingFunctions = new CountableCollection()\n const durations = new CountableCollection()\n const colors = new ContextCollection()\n const colorFormats = new CountableCollection()\n const units = new ContextCollection()\n\n walk(ast, function (node) {\n switch (node.type) {\n case 'Atrule': {\n totalAtRules++\n const atRuleName = node.name\n\n if (atRuleName === 'font-face') {\n /** @type {[index: string]: string} */\n const descriptors = {}\n\n node.block.children.forEach(descriptor => {\n // Ignore 'Raw' nodes in case of CSS syntax errors\n if (descriptor.type == 'Declaration') {\n descriptors[descriptor.property] = stringifyNode(descriptor.value)\n }\n })\n\n fontfaces.push(descriptors)\n break\n }\n\n if (atRuleName === 'media') {\n const prelude = stringifyNode(node.prelude)\n medias.push(prelude)\n if (isMediaBrowserhack(node.prelude)) {\n mediaBrowserhacks.push(prelude)\n }\n break\n }\n if (atRuleName === 'supports') {\n const prelude = stringifyNode(node.prelude)\n supports.push(prelude)\n if (isSupportsBrowserhack(node.prelude)) {\n supportsBrowserhacks.push(prelude)\n }\n break\n }\n if (endsWith('keyframes', atRuleName)) {\n const name = '@' + atRuleName + ' ' + stringifyNode(node.prelude)\n if (hasVendorPrefix(atRuleName)) {\n prefixedKeyframes.push(name)\n }\n keyframes.push(name)\n break\n }\n if (atRuleName === 'import') {\n imports.push(stringifyNode(node.prelude))\n break\n }\n if (atRuleName === 'charset') {\n charsets.push(stringifyNode(node.prelude))\n break\n }\n if (atRuleName === 'container') {\n containers.push(stringifyNode(node.prelude))\n break\n }\n if (atRuleName === 'layer') {\n const prelude = stringifyNode(node.prelude)\n prelude\n .split(',')\n .forEach(name => layers.push(name.trim()))\n }\n break\n }\n case 'Rule': {\n const numSelectors = node.prelude.children ? node.prelude.children.size : 0\n const numDeclarations = node.block.children ? node.block.children.size : 0\n\n ruleSizes.push(numSelectors + numDeclarations)\n selectorsPerRule.push(numSelectors)\n declarationsPerRule.push(numDeclarations)\n\n totalRules++\n\n if (numDeclarations === 0) {\n emptyRules++\n }\n break\n }\n case 'Selector': {\n const selector = stringifyNode(node)\n\n if (this.atrule && endsWith('keyframes', this.atrule.name)) {\n keyframeSelectors.push(selector)\n return this.skip\n }\n\n const [{ value: specificityObj }] = calculate(node)\n const specificity = [specificityObj.a, specificityObj.b, specificityObj.c]\n\n if (specificity[0] > 0) {\n ids.push(selector)\n }\n\n if (isAccessibility(node)) {\n a11y.push(selector)\n }\n\n const [complexity, isPrefixed] = getComplexity(node)\n\n if (isPrefixed) {\n prefixedSelectors.push(selector)\n }\n\n uniqueSelectors.add(selector)\n selectorComplexities.push(complexity)\n uniqueSpecificities.push(specificity[0] + ',' + specificity[1] + ',' + specificity[2])\n\n if (maxSpecificity === undefined) {\n maxSpecificity = specificity\n }\n\n if (minSpecificity === undefined) {\n minSpecificity = specificity\n }\n\n specificityA.push(specificity[0])\n specificityB.push(specificity[1])\n specificityC.push(specificity[2])\n\n if (minSpecificity !== undefined && compareSpecificity(minSpecificity, specificity) < 0) {\n minSpecificity = specificity\n }\n\n if (maxSpecificity !== undefined && compareSpecificity(maxSpecificity, specificity) > 0) {\n maxSpecificity = specificity\n }\n\n specificities.push(specificity)\n\n // Avoid deeper walking of selectors to not mess with\n // our specificity calculations in case of a selector\n // with :where() or :is() that contain SelectorLists\n // as children\n return this.skip\n }\n case 'Dimension': {\n if (!this.declaration) {\n break\n }\n\n if (endsWith('\\\\9', node.unit)) {\n units.push(node.unit.substring(0, node.unit.length - 2), this.declaration.property)\n } else {\n units.push(node.unit, this.declaration.property)\n }\n\n return this.skip\n }\n case 'Url': {\n if (startsWith('data:', node.value)) {\n var embed = node.value\n var size = embed.length\n var type = getEmbedType(embed)\n\n embedTypes.total++\n embedSize += size\n\n if (embedTypes.unique.has(type)) {\n let item = embedTypes.unique.get(type)\n item.count++\n item.size += size\n embedTypes.unique.set(type, item)\n } else {\n embedTypes.unique.set(type, {\n count: 1,\n size\n })\n }\n\n // @deprecated\n embeds.push(embed)\n }\n break\n }\n case 'Value': {\n if (isValueKeyword(node)) {\n break\n }\n\n const declaration = this.declaration\n const { property, important } = declaration\n\n if (isAstVendorPrefixed(node)) {\n vendorPrefixedValues.push(stringifyNode(node))\n }\n\n // i.e. `property: value !ie`\n if (typeof important === 'string') {\n valueBrowserhacks.push(stringifyNodePlain(node) + '!' + important)\n }\n\n // i.e. `property: value\\9`\n if (isIe9Hack(node)) {\n valueBrowserhacks.push(stringifyNode(node))\n }\n\n // Process properties first that don't have colors,\n // so we can avoid further walking them;\n if (isProperty('z-index', property)) {\n if (!isValueKeyword(node)) {\n zindex.push(stringifyNode(node))\n }\n return this.skip\n } else if (isProperty('font', property)) {\n if (isFontKeyword(node)) return\n\n let { font_size, line_height, font_family } = destructure(node, stringifyNode)\n\n if (font_family) {\n fontFamilies.push(font_family)\n }\n if (font_size) {\n fontSizes.push(font_size)\n }\n if (line_height) {\n lineHeights.push(line_height)\n }\n\n break\n } else if (isProperty('font-size', property)) {\n if (!isFontKeyword(node)) {\n fontSizes.push(stringifyNode(node))\n }\n break\n } else if (isProperty('font-family', property)) {\n if (!isFontKeyword(node)) {\n fontFamilies.push(stringifyNode(node))\n }\n break\n } else if (isProperty('line-height', property)) {\n lineHeights.push((stringifyNode(node)))\n } else if (isProperty('transition', property) || isProperty('animation', property)) {\n const [times, fns] = analyzeAnimation(node.children, stringifyNode)\n for (let i = 0; i < times.length; i++) {\n durations.push(times[i])\n }\n for (let i = 0; i < fns.length; i++) {\n timingFunctions.push(fns[i])\n }\n break\n } else if (isProperty('animation-duration', property) || isProperty('transition-duration', property)) {\n durations.push(stringifyNode(node))\n break\n } else if (isProperty('transition-timing-function', property) || isProperty('animation-timing-function', property)) {\n timingFunctions.push(stringifyNode(node))\n break\n } else if (isProperty('text-shadow', property)) {\n if (!isValueKeyword(node)) {\n textShadows.push(stringifyNode(node))\n }\n // no break here: potentially contains colors\n } else if (isProperty('box-shadow', property)) {\n if (!isValueKeyword(node)) {\n boxShadows.push(stringifyNode(node))\n }\n // no break here: potentially contains colors\n }\n\n walk(node, function (valueNode) {\n switch (valueNode.type) {\n case 'Hash': {\n let hexLength = valueNode.value.length\n if (endsWith('\\\\9', valueNode.value)) {\n hexLength = hexLength - 2\n }\n colors.push('#' + valueNode.value, property)\n colorFormats.push(`hex` + hexLength)\n\n return this.skip\n }\n case 'Identifier': {\n const { name } = valueNode\n // Bail out if it can't be a color name\n // 20 === 'lightgoldenrodyellow'.length\n // 3 === 'red'.length\n if (name.length > 20 || name.length < 3) {\n return this.skip\n }\n const stringified = stringifyNode(valueNode)\n const lowerCased = name.toLowerCase()\n\n if (namedColors.has(lowerCased)) {\n colors.push(stringified, property)\n colorFormats.push('named')\n } else if (colorKeywords.has(lowerCased)) {\n colors.push(stringified, property)\n colorFormats.push(lowerCased)\n } else if (systemColors.has(lowerCased)) {\n colors.push(stringified, property)\n colorFormats.push('system')\n }\n return this.skip\n }\n case 'Function': {\n // Don't walk var() multiple times\n if (strEquals('var', valueNode.name)) {\n return this.skip\n }\n const fnName = valueNode.name.toLowerCase()\n const stringified = stringifyNode(valueNode)\n if (colorFunctions.has(fnName)) {\n colors.push(stringified, property)\n colorFormats.push(fnName)\n }\n // No this.skip here intentionally,\n // otherwise we'll miss colors in linear-gradient() etc.\n }\n }\n })\n break\n }\n case 'Declaration': {\n // Do not process Declarations in atRule preludes\n // because we will handle them manually\n if (this.atrulePrelude !== null) {\n return this.skip\n }\n\n totalDeclarations++\n\n uniqueDeclarations.add(stringifyNode(node))\n\n if (node.important === true) {\n importantDeclarations++\n\n if (this.atrule && endsWith('keyframes', this.atrule.name)) {\n importantsInKeyframes++\n }\n }\n\n const { property } = node\n\n properties.push(property)\n\n if (hasVendorPrefix(property)) {\n propertyVendorPrefixes.push(property)\n propertyComplexities.push(2)\n } else if (isHack(property)) {\n propertyHacks.push(property)\n propertyComplexities.push(2)\n } else if (isCustom(property)) {\n customProperties.push(property)\n propertyComplexities.push(2)\n if (node.important === true) {\n importantCustomProperties.push(property)\n }\n } else {\n propertyComplexities.push(1)\n }\n break\n }\n }\n })\n\n const embeddedContent = embeds.count()\n\n const totalUniqueDeclarations = uniqueDeclarations.size\n\n const totalSelectors = selectorComplexities.size()\n const specificitiesA = specificityA.aggregate()\n const specificitiesB = specificityB.aggregate()\n const specificitiesC = specificityC.aggregate()\n const uniqueSpecificitiesCount = uniqueSpecificities.count()\n const complexityCount = new CountableCollection(selectorComplexities.toArray()).count()\n const totalUniqueSelectors = uniqueSelectors.size\n const uniqueRuleSize = new CountableCollection(ruleSizes.toArray()).count()\n const uniqueSelectorsPerRule = new CountableCollection(selectorsPerRule.toArray()).count()\n const uniqueDeclarationsPerRule = new CountableCollection(declarationsPerRule.toArray()).count()\n const assign = Object.assign\n\n return {\n stylesheet: {\n sourceLinesOfCode: totalAtRules + totalSelectors + totalDeclarations + keyframeSelectors.size(),\n linesOfCode: lines.length,\n size: css.length,\n comments: {\n total: totalComments,\n size: commentsSize,\n },\n embeddedContent: assign(embeddedContent, {\n size: {\n total: embedSize,\n ratio: ratio(embedSize, css.length),\n },\n types: {\n total: embedTypes.total,\n totalUnique: embedTypes.unique.size,\n uniquenessRatio: ratio(embedTypes.unique.size, embedTypes.total),\n unique: Object.fromEntries(embedTypes.unique),\n },\n }),\n },\n atrules: {\n fontface: {\n total: fontfaces.length,\n totalUnique: fontfaces.length,\n unique: fontfaces,\n uniquenessRatio: fontfaces.length === 0 ? 0 : 1\n },\n import: imports.count(),\n media: assign(\n medias.count(),\n {\n browserhacks: mediaBrowserhacks.count(),\n }\n ),\n charset: charsets.count(),\n supports: assign(\n supports.count(),\n {\n browserhacks: supportsBrowserhacks.count(),\n },\n ),\n keyframes: assign(\n keyframes.count(), {\n prefixed: assign(\n prefixedKeyframes.count(), {\n ratio: ratio(prefixedKeyframes.size(), keyframes.size())\n }),\n }),\n container: containers.count(),\n layer: layers.count(),\n },\n rules: {\n total: totalRules,\n empty: {\n total: emptyRules,\n ratio: ratio(emptyRules, totalRules)\n },\n sizes: assign(\n ruleSizes.aggregate(),\n {\n items: ruleSizes.toArray(),\n unique: uniqueRuleSize.unique,\n totalUnique: uniqueRuleSize.totalUnique,\n uniquenessRatio: uniqueRuleSize.uniquenessRatio\n },\n ),\n selectors: assign(\n selectorsPerRule.aggregate(),\n {\n items: selectorsPerRule.toArray(),\n unique: uniqueSelectorsPerRule.unique,\n totalUnique: uniqueSelectorsPerRule.totalUnique,\n uniquenessRatio: uniqueSelectorsPerRule.uniquenessRatio\n },\n ),\n declarations: assign(\n declarationsPerRule.aggregate(),\n {\n items: declarationsPerRule.toArray(),\n unique: uniqueDeclarationsPerRule.unique,\n totalUnique: uniqueDeclarationsPerRule.totalUnique,\n uniquenessRatio: uniqueDeclarationsPerRule.uniquenessRatio,\n },\n ),\n },\n selectors: {\n total: totalSelectors,\n totalUnique: totalUniqueSelectors,\n uniquenessRatio: ratio(totalUniqueSelectors, totalSelectors),\n specificity: {\n /** @type [number, number, number] */\n min: minSpecificity === undefined ? [0, 0, 0] : minSpecificity,\n /** @type [number, number, number] */\n max: maxSpecificity === undefined ? [0, 0, 0] : maxSpecificity,\n /** @type [number, number, number] */\n sum: [specificitiesA.sum, specificitiesB.sum, specificitiesC.sum],\n /** @type [number, number, number] */\n mean: [specificitiesA.mean, specificitiesB.mean, specificitiesC.mean],\n /** @type [number, number, number] */\n mode: [specificitiesA.mode, specificitiesB.mode, specificitiesC.mode],\n /** @type [number, number, number] */\n median: [specificitiesA.median, specificitiesB.median, specificitiesC.median],\n items: specificities,\n unique: uniqueSpecificitiesCount.unique,\n totalUnique: uniqueSpecificitiesCount.totalUnique,\n uniquenessRatio: uniqueSpecificitiesCount.uniquenessRatio,\n },\n complexity: assign(\n selectorComplexities.aggregate(),\n complexityCount, {\n items: selectorComplexities.toArray(),\n }),\n id: assign(\n ids.count(), {\n ratio: ratio(ids.size(), totalSelectors),\n }),\n accessibility: assign(\n a11y.count(), {\n ratio: ratio(a11y.size(), totalSelectors),\n }),\n keyframes: keyframeSelectors.count(),\n prefixed: assign(\n prefixedSelectors.count(),\n {\n ratio: ratio(prefixedSelectors.size(), totalSelectors),\n },\n )\n },\n declarations: {\n total: totalDeclarations,\n totalUnique: totalUniqueDeclarations,\n uniquenessRatio: ratio(totalUniqueDeclarations, totalDeclarations),\n // @TODO: deprecated, remove in next major version\n unique: {\n total: totalUniqueDeclarations,\n ratio: ratio(totalUniqueDeclarations, totalDeclarations),\n },\n importants: {\n total: importantDeclarations,\n ratio: ratio(importantDeclarations, totalDeclarations),\n inKeyframes: {\n total: importantsInKeyframes,\n ratio: ratio(importantsInKeyframes, importantDeclarations),\n },\n },\n },\n properties: assign(\n properties.count(),\n {\n prefixed: assign(\n propertyVendorPrefixes.count(),\n {\n ratio: ratio(propertyVendorPrefixes.size(), properties.size()),\n },\n ),\n custom: assign(\n customProperties.count(),\n {\n ratio: ratio(customProperties.size(), properties.size()),\n importants: assign(\n importantCustomProperties.count(),\n {\n ratio: ratio(importantCustomProperties.size(), customProperties.size()),\n }\n ),\n },\n ),\n browserhacks: assign(\n propertyHacks.count(), {\n ratio: ratio(propertyHacks.size(), properties.size()),\n }),\n complexity: propertyComplexities.aggregate(),\n }),\n values: {\n colors: assign(\n colors.count(),\n {\n formats: colorFormats.count(),\n },\n ),\n fontFamilies: fontFamilies.count(),\n fontSizes: fontSizes.count(),\n lineHeights: lineHeights.count(),\n zindexes: zindex.count(),\n textShadows: textShadows.count(),\n boxShadows: boxShadows.count(),\n animations: {\n durations: durations.count(),\n timingFunctions: timingFunctions.count(),\n },\n prefixes: vendorPrefixedValues.count(),\n browserhacks: valueBrowserhacks.count(),\n units: units.count(),\n },\n __meta__: {\n parseTime: startAnalysis - startParse,\n analyzeTime: Date.now() - startAnalysis,\n total: Date.now() - start\n }\n }\n}\n\nexport {\n analyze,\n compareSpecificity,\n}\n","export function getEmbedType(/** @type string */embed) {\n\t// data:image/gif;base64,R0lG\n\tlet start = 5 // `data:`.length\n\tlet semicolon = embed.indexOf(';')\n\tlet comma = embed.indexOf(',')\n\n\tif (semicolon === -1) {\n\t\treturn embed.substring(start, comma)\n\t}\n\n\tif (comma !== -1 && comma < semicolon) {\n\t\treturn embed.substring(start, comma);\n\t}\n\n\treturn embed.substring(start, semicolon)\n}","import { endsWith } from \"../string-utils.js\"\n\nexport function isIe9Hack(node) {\n\treturn node.children\n\t\t&& node.children.last\n\t\t&& node.children.last.type === 'Identifier'\n\t\t&& endsWith('\\\\9', node.children.last.name)\n}"],"names":["compareChar","referenceCode","testCode","strEquals","base","test","length","i","charCodeAt","endsWith","offset","startsWith","isPropertyValue","node","property","value","children","first","type","name","hasVendorPrefix","keyword","indexOf","compareSpecificity","a","b","analyzeList","selectorListAst","cb","childSelectors","walk","visit","enter","push","isPseudoFunction","isAccessibility","selector","isA11y","some","skip","getComplexity","complexity","isPrefixed","Boolean","list","forEach","namedColors","Set","systemColors","colorFunctions","colorKeywords","FONT_KEYWORDS","isFontKeyword","firstChild","has","SIZE_KEYWORDS","STRETCH_KEYWORDS","STYLE_KEYWORDS","WEIGHT_KEYWORDS","VARIANT_KEYWORDS","keywords","isValueKeyword","size","timingKeywords","isAstVendorPrefixed","toArray","index","CountableCollection","initial","this","_items","Map","_total","item","set","get","count","total","totalUnique","unique","Object","fromEntries","uniquenessRatio","ContextCollection","_list","_contexts","context","itemsPerContext","entries","assign","AggregateCollection","_sum","aggregate","min","max","mean","mode","median","range","sum","arr","middle","lowerMiddleRank","sorted","slice","sort","frequencies","maxOccurrences","maxOccurenceCount","element","updatedCount","Mode","Math","floor","isCustom","isProperty","basename","ratio","part","css","start","Date","now","lines","split","stringifyNode","stringifyNodePlain","trim","substring","loc","end","maxSpecificity","minSpecificity","totalComments","commentsSize","embeds","embedSize","embedTypes","startParse","ast","parse","parseCustomProperty","positions","onComment","comment","startAnalysis","totalAtRules","fontfaces","layers","imports","medias","mediaBrowserhacks","charsets","supports","supportsBrowserhacks","keyframes","prefixedKeyframes","containers","totalRules","emptyRules","ruleSizes","selectorsPerRule","declarationsPerRule","keyframeSelectors","uniqueSelectors","prefixedSelectors","specificityA","specificityB","specificityC","uniqueSpecificities","selectorComplexities","specificities","ids","a11y","uniqueDeclarations","totalDeclarations","importantDeclarations","importantsInKeyframes","importantCustomProperties","properties","propertyHacks","propertyVendorPrefixes","customProperties","propertyComplexities","vendorPrefixedValues","valueBrowserhacks","zindex","textShadows","boxShadows","fontFamilies","fontSizes","lineHeights","timingFunctions","durations","colors","colorFormats","units","atRuleName","descriptors","block","descriptor","prelude","returnValue","unit","isMediaBrowserhack","isSupportsBrowserhack","numSelectors","numDeclarations","atrule","specificityObj","calculate","specificity","c","add","undefined","declaration","embed","semicolon","comma","getEmbedType","important","last","isIe9Hack","font_size","line_height","font_weight","font_style","font_variant","font_stretch","font_family","next","data","prev","padStart","destructure","durationFound","child","analyzeAnimation","times","fns","valueNode","hexLength","stringified","lowerCased","toLowerCase","fnName","atrulePrelude","code","isHack","embeddedContent","totalUniqueDeclarations","totalSelectors","specificitiesA","specificitiesB","specificitiesC","uniqueSpecificitiesCount","complexityCount","totalUniqueSelectors","uniqueRuleSize","uniqueSelectorsPerRule","uniqueDeclarationsPerRule","stylesheet","sourceLinesOfCode","linesOfCode","comments","types","atrules","fontface","import","media","browserhacks","charset","prefixed","container","layer","rules","empty","sizes","items","selectors","declarations","id","accessibility","importants","inKeyframes","custom","values","formats","zindexes","animations","prefixes","__meta__","parseTime","analyzeTime"],"mappings":"wNAMA,SAASA,EAAYC,EAAeC,GAMlC,OAJIA,GAAY,IAAUA,GAAY,KAEpCA,GAAsB,IAEjBD,IAA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AQ,YACXJ,QACS,UAAMC,GAAa,EAC7B,QACWH,IACb,EAEJ,GAEM,CAACE,EAAYC,EACrB,KCvIYI,EAAc,IAAIC,IAAI,CAGjC,YACA,eACA,OACA,aACA,QACA,QACA,SACA,QACA,iBACA,OACA,aACA,QACA,YACA,YACA,aACA,YACA,QACA,iBACA,WACA,UACA,OACA,WACA,WACA,gBACA,WACA,YACA,WACA,YACA,cACA,iBACA,aACA,aACA,UACA,aACA,eACA,gBACA,gBACA,gBACA,gBACA,aACA,WACA,cACA,UACA,UACA,aACA,YACA,cACA,cACA,UACA,YACA,aACA,OACA,YACA,OACA,QACA,cACA,OACA,WACA,UACA,YACA,SACA,QACA,QACA,WACA,gBACA,YACA,eACA,YACA,aACA,YACA,uBACA,YACA,aACA,YACA,YACA,cACA,gBACA,eACA,iBACA,iBACA,iBACA,cACA,OACA,YACA,QACA,UACA,SACA,mBACA,aACA,eACA,eACA,iBACA,kBACA,oBACA,kBACA,kBACA,eACA,YACA,YACA,WACA,cACA,OACA,UACA,QACA,YACA,SACA,YACA,SACA,gBACA,YACA,gBACA,gBACA,aACA,YACA,OACA,OACA,OACA,aACA,SACA,gBACA,MACA,YACA,YACA,cACA,SACA,aACA,WACA,WACA,SACA,SACA,UACA,YACA,YACA,YACA,OACA,cACA,YACA,MACA,OACA,UACA,SACA,YACA,SACA,QACA,QACA,aACA,SACA,gBAGWC,EAAe,IAAID,IAAI,CAGlC,SACA,aACA,WACA,cACA,aACA,aACA,aACA,eACA,QACA,YACA,YACA,gBACA,eACA,mBACA,OACA,WACA,aAMWE,EAAiB,IAAIF,IAAI,CACpC,MACA,OACA,MACA,OACA,MACA,MACA,MACA,QACA,QACA,UAGWG,EAAgB,IAAIH,IAAI,CACnC,eACA,gBCjMII,EAAgB,IAAIJ,IAAI,CAE7B,UACA,UACA,QACA,SAGA,UACA,OACA,OACA,cACA,gBACA,wBAGeK,EAAcvC,GAC7B,IAAMwC,EAAaxC,EAAKG,SAASC,MACjC,MAA2B,e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H,YAAaA,GAAYnH,QACzBoN,SAAUtG,GAAO9G,QACjB+G,YAAaA,GAAY/G,QACzBgH,WAAYA,GAAWhH,QACvBqN,WAAY,CACVhG,UAAWA,GAAUrH,QACrBoH,gBAAiBA,GAAgBpH,SAEnCsN,SAAU1G,GAAqB5G,QAC/BkM,aAAcrF,GAAkB7G,QAChCwH,MAAOA,GAAMxH,SAEfuN,SAAU,CACRC,UAAWnJ,EAAgBP,EAC3B2J,YAAa5K,KAAKC,MAAQuB,EAC1BpE,MAAO4C,KAAKC,MAAQF,GAGzB"}
|
|
1
|
+
{"version":3,"file":"analyzer.cjs","sources":["../src/string-utils.js","../src/atrules/atrules.js","../src/vendor-prefix.js","../src/selectors/utils.js","../src/keyword-set.js","../src/values/colors.js","../src/values/destructure-font-shorthand.js","../src/values/values.js","../src/values/animations.js","../src/values/vendor-prefix.js","../src/collection.js","../src/context-collection.js","../src/aggregate-collection.js","../src/properties/property-utils.js","../src/index.js","../src/stylesheet/stylesheet.js","../src/values/browserhacks.js"],"sourcesContent":["/**\n * Case-insensitive compare two character codes\n * @param {string} referenceCode\n * @param {string} testCode\n * @see https://github.com/csstree/csstree/blob/41f276e8862d8223eeaa01a3d113ab70bb13d2d9/lib/tokenizer/utils.js#L22\n */\nfunction compareChar(referenceCode, testCode) {\n // if uppercase\n if (testCode >= 0x0041 && testCode <= 0x005A) {\n // shifting the 6th bit makes a letter lowercase\n testCode = testCode | 32\n }\n return referenceCode === testCode\n}\n\n/**\n * Case-insensitive string-comparison\n * @example\n * strEquals('test', 'test') // true\n * strEquals('test', 'TEST') // true\n * strEquals('test', 'TesT') // true\n * strEquals('test', 'derp') // false\n *\n * @param {string} base The string to check against\n * @param {string} maybe The test string, possibly containing uppercased characters\n * @returns {boolean} true if the two strings are the same, false otherwise\n */\nexport function strEquals(base, maybe) {\n let len = base.length;\n if (len !== maybe.length) return false\n\n for (let i = 0; i < len; i++) {\n if (compareChar(base.charCodeAt(i), maybe.charCodeAt(i)) === false) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * Case-insensitive testing whether a string ends with a given substring\n *\n * @example\n * endsWith('test', 'my-test') // true\n * endsWith('test', 'est') // false\n *\n * @param {string} base e.g. '-webkit-transform'\n * @param {string} maybe e.g. 'transform'\n * @returns {boolean} true if `test` ends with `base`, false otherwise\n */\nexport function endsWith(base, maybe) {\n let len = maybe.length\n let offset = len - base.length\n\n if (offset < 0) {\n return false\n }\n\n for (let i = len - 1; i >= offset; i--) {\n if (compareChar(base.charCodeAt(i - offset), maybe.charCodeAt(i)) === false) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * Case-insensitive testing whether a string starts with a given substring\n * @param {string} base\n * @param {string} maybe\n * @returns {boolean} true if `test` starts with `base`, false otherwise\n */\nexport function startsWith(base, maybe) {\n let len = base.length\n if (maybe.length < len) return false\n\n for (let i = 0; i < len; i++) {\n if (compareChar(base.charCodeAt(i), maybe.charCodeAt(i)) === false) {\n return false\n }\n }\n\n return true\n}\n","import { strEquals, startsWith, endsWith } from '../string-utils.js'\nimport walk from 'css-tree/walker'\n\n/**\n * Check whether node.property === property and node.value === value,\n * but case-insensitive and fast.\n * @param {import('css-tree').Declaration} node\n * @param {string} property - The CSS property to compare with (case-insensitive)\n * @param {string} value - The identifier/keyword value to compare with\n * @returns true if declaratioNode is the given property: value, false otherwise\n */\nfunction isPropertyValue(node, property, value) {\n return strEquals(property, node.property)\n && node.value.children.first.type === 'Identifier'\n && strEquals(value, node.value.children.first.name)\n}\n\n/**\n * Check if an @supports atRule is a browserhack\n * @param {import('css-tree').AtrulePrelude} prelude\n * @returns true if the atrule is a browserhack\n */\nexport function isSupportsBrowserhack(prelude) {\n let returnValue = false\n\n walk(prelude, function (node) {\n if (node.type === 'Declaration') {\n if (\n isPropertyValue(node, '-webkit-appearance', 'none')\n || isPropertyValue(node, '-moz-appearance', 'meterbar')\n ) {\n returnValue = true\n return this.break\n }\n }\n })\n\n return returnValue\n}\n\n/**\n * Check if a @media atRule is a browserhack\n * @param {import('css-tree').AtrulePrelude} prelude\n * @returns true if the atrule is a browserhack\n */\nexport function isMediaBrowserhack(prelude) {\n let returnValue = false\n\n walk(prelude, function (node) {\n if (node.type === 'MediaQuery'\n && node.children.size === 1\n && node.children.first.type === 'Identifier'\n ) {\n node = node.children.first\n // Note: CSSTree adds a trailing space to \\\\9\n if (startsWith('\\\\0', node.name) || endsWith('\\\\9 ', node.name)) {\n returnValue = true\n return this.break\n }\n }\n if (node.type === 'MediaFeature') {\n if (node.value !== null && node.value.unit === '\\\\0') {\n returnValue = true\n return this.break\n }\n if (strEquals('-moz-images-in-menus', node.name)\n || strEquals('min--moz-device-pixel-ratio', node.name)\n || strEquals('-ms-high-contrast', node.name)\n ) {\n returnValue = true\n return this.break\n }\n if (strEquals('min-resolution', node.name)\n && strEquals('.001', node.value.value)\n && strEquals('dpcm', node.value.unit)\n ) {\n returnValue = true\n return this.break\n }\n if (strEquals('-webkit-min-device-pixel-ratio', node.name)) {\n if ((strEquals('0', node.value.value) || strEquals('10000', node.value.value))) {\n returnValue = true\n return this.break\n }\n }\n }\n })\n\n return returnValue\n}","const HYPHENMINUS = 45; // '-'.charCodeAt()\n\n/**\n * @param {string} keyword\n * @returns {boolean}\n */\nfunction hasVendorPrefix(keyword) {\n if (keyword.charCodeAt(0) === HYPHENMINUS && keyword.charCodeAt(1) !== HYPHENMINUS) {\n // String must have a 2nd occurrence of '-', at least at position 3 (offset=2)\n if (keyword.indexOf('-', 2) !== -1) {\n return true\n }\n }\n\n return false\n}\n\nexport {\n hasVendorPrefix\n}","import walk from 'css-tree/walker'\nimport { startsWith, strEquals } from '../string-utils.js'\nimport { hasVendorPrefix } from '../vendor-prefix.js'\n\n/**\n * Compare specificity A to Specificity B\n * @param {[number,number,number]} a - Specificity A\n * @param {[number,number,number]} b - Specificity B\n * @returns {number} sortIndex - 0 when a==b, 1 when a<b, -1 when a>b\n */\nexport function compareSpecificity(a, b) {\n if (a[0] === b[0]) {\n if (a[1] === b[1]) {\n return b[2] - a[2]\n }\n\n return b[1] - a[1]\n }\n\n return b[0] - a[0]\n}\n\n/**\n *\n * @param {import('css-tree').SelectorList} selectorListAst\n * @returns {Selector[]} Analyzed selectors in the selectorList\n */\nfunction analyzeList(selectorListAst, cb) {\n let childSelectors = []\n walk(selectorListAst, {\n visit: 'Selector',\n enter: function (node) {\n childSelectors.push(cb(node))\n }\n })\n\n return childSelectors\n}\n\nfunction isPseudoFunction(name) {\n return (\n strEquals(name, 'not')\n || strEquals(name, 'nth-child')\n || strEquals(name, 'nth-last-child')\n || strEquals(name, 'where')\n || strEquals(name, 'is')\n || strEquals(name, 'has')\n || strEquals(name, 'matches')\n || strEquals(name, '-webkit-any')\n || strEquals(name, '-moz-any')\n )\n}\n\n/** @param {import('css-tree').Selector} selector */\nexport function isAccessibility(selector) {\n let isA11y = false\n\n walk(selector, function (node) {\n if (node.type === 'AttributeSelector') {\n if (strEquals('role', node.name.name) || startsWith('aria-', node.name.name)) {\n isA11y = true\n return this.break\n }\n }\n // Test for [aria-] or [role] inside :is()/:where() and friends\n else if (node.type === 'PseudoClassSelector') {\n if (isPseudoFunction(node.name)) {\n let list = analyzeList(node, isAccessibility)\n\n if (list.some(b => b === true)) {\n isA11y = true\n return this.skip\n }\n\n return this.skip\n }\n }\n })\n\n return isA11y;\n}\n\n/**\n * Get the Complexity for the AST of a Selector Node\n * @param {import('css-tree').Selector} ast - AST Node for a Selector\n * @return {[number, boolean]} - The numeric complexity of the Selector and whether it's prefixed or not\n */\nexport function getComplexity(selector) {\n let complexity = 0\n let isPrefixed = false\n\n walk(selector, function (node) {\n if (node.type === 'Selector' || node.type === 'Nth') return\n\n complexity++\n\n if (node.type === 'IdSelector'\n || node.type === 'ClassSelector'\n || node.type === 'PseudoElementSelector'\n || node.type === 'TypeSelector'\n || node.type === 'PseudoClassSelector'\n ) {\n if (hasVendorPrefix(node.name)) {\n isPrefixed = true\n complexity++\n }\n }\n\n if (node.type === 'AttributeSelector') {\n if (Boolean(node.value)) {\n complexity++\n }\n if (hasVendorPrefix(node.name.name)) {\n isPrefixed = true\n complexity++\n }\n return this.skip\n }\n\n if (node.type === 'PseudoClassSelector') {\n if (isPseudoFunction(node.name)) {\n let list = analyzeList(node, getComplexity)\n\n // Bail out for empty/non-existent :nth-child() params\n if (list.length === 0) return\n\n list.forEach(([c, p]) => {\n complexity += c\n if (p === true) isPrefixed = true\n })\n return this.skip\n }\n }\n })\n\n return [complexity, isPrefixed]\n}\n","import { strEquals } from \"./string-utils.js\"\n\n/**\n * @description A Set-like construct to search CSS keywords in a case-insensitive way\n */\nexport class KeywordSet {\n\n\t/** @param {string[]} items */\n\tconstructor(items) {\n\t\t/** @type {string[]} */\n\t\tthis.set = items\n\t}\n\n\t/** @param {string} item */\n\thas(item) {\n\t\tlet len = this.set.length\n\n\t\tfor (let index = 0; index < len; index++) {\n\t\t\tif (strEquals(this.set[index], item)) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\treturn false\n\t}\n}","import { KeywordSet } from \"../keyword-set.js\"\n\nexport const namedColors = new KeywordSet([\n // CSS Named Colors\n // Spec: https://drafts.csswg.org/css-color/#named-colors\n\n // Heuristic: popular names first for quick finding in set.has()\n 'white',\n 'black',\n 'red',\n 'blue',\n 'gray',\n 'grey',\n 'green',\n 'rebeccapurple',\n 'yellow',\n 'orange',\n\n 'aliceblue',\n 'antiquewhite',\n 'aqua',\n 'aquamarine',\n 'azure',\n 'beige',\n 'bisque',\n 'blanchedalmond',\n 'blueviolet',\n 'brown',\n 'burlywood',\n 'cadetblue',\n 'chartreuse',\n 'chocolate',\n 'coral',\n 'cornflowerblue',\n 'cornsilk',\n 'crimson',\n 'cyan',\n 'darkblue',\n 'darkcyan',\n 'darkgoldenrod',\n 'darkgray',\n 'darkgreen',\n 'darkgrey',\n 'darkkhaki',\n 'darkmagenta',\n 'darkolivegreen',\n 'darkorange',\n 'darkorchid',\n 'darkred',\n 'darksalmon',\n 'darkseagreen',\n 'darkslateblue',\n 'darkslategray',\n 'darkslategrey',\n 'darkturquoise',\n 'darkviolet',\n 'deeppink',\n 'deepskyblue',\n 'dimgray',\n 'dimgrey',\n 'dodgerblue',\n 'firebrick',\n 'floralwhite',\n 'forestgreen',\n 'fuchsia',\n 'gainsboro',\n 'ghostwhite',\n 'gold',\n 'goldenrod',\n 'greenyellow',\n 'honeydew',\n 'hotpink',\n 'indianred',\n 'indigo',\n 'ivory',\n 'khaki',\n 'lavender',\n 'lavenderblush',\n 'lawngreen',\n 'lemonchiffon',\n 'lightblue',\n 'lightcoral',\n 'lightcyan',\n 'lightgoldenrodyellow',\n 'lightgray',\n 'lightgreen',\n 'lightgrey',\n 'lightpink',\n 'lightsalmon',\n 'lightseagreen',\n 'lightskyblue',\n 'lightslategray',\n 'lightslategrey',\n 'lightsteelblue',\n 'lightyellow',\n 'lime',\n 'limegreen',\n 'linen',\n 'magenta',\n 'maroon',\n 'mediumaquamarine',\n 'mediumblue',\n 'mediumorchid',\n 'mediumpurple',\n 'mediumseagreen',\n 'mediumslateblue',\n 'mediumspringgreen',\n 'mediumturquoise',\n 'mediumvioletred',\n 'midnightblue',\n 'mintcream',\n 'mistyrose',\n 'moccasin',\n 'navajowhite',\n 'navy',\n 'oldlace',\n 'olive',\n 'olivedrab',\n 'orangered',\n 'orchid',\n 'palegoldenrod',\n 'palegreen',\n 'paleturquoise',\n 'palevioletred',\n 'papayawhip',\n 'peachpuff',\n 'peru',\n 'pink',\n 'plum',\n 'powderblue',\n 'purple',\n 'rosybrown',\n 'royalblue',\n 'saddlebrown',\n 'salmon',\n 'sandybrown',\n 'seagreen',\n 'seashell',\n 'sienna',\n 'silver',\n 'skyblue',\n 'slateblue',\n 'slategray',\n 'slategrey',\n 'snow',\n 'springgreen',\n 'steelblue',\n 'tan',\n 'teal',\n 'thistle',\n 'tomato',\n 'turquoise',\n 'violet',\n 'wheat',\n 'whitesmoke',\n 'yellowgreen',\n])\n\nexport const systemColors = new KeywordSet([\n // CSS System Colors\n // Spec: https://drafts.csswg.org/css-color/#css-system-colors\n 'canvas',\n 'canvastext',\n 'linktext',\n 'visitedtext',\n 'activetext',\n 'buttonface',\n 'buttontext',\n 'buttonborder',\n 'field',\n 'fieldtext',\n 'highlight',\n 'highlighttext',\n 'selecteditem',\n 'selecteditemtext',\n 'mark',\n 'marktext',\n 'graytext',\n\n // TODO: Deprecated CSS System colors\n // Spec: https://drafts.csswg.org/css-color/#deprecated-system-colors\n])\n\nexport const colorFunctions = new KeywordSet([\n 'rgb',\n 'rgba',\n 'hsl',\n 'hsla',\n 'hwb',\n 'lab',\n 'lch',\n 'oklab',\n 'oklch',\n 'color',\n])\n\nexport const colorKeywords = new KeywordSet([\n 'transparent',\n 'currentcolor',\n])\n","import { KeywordSet } from \"../keyword-set.js\"\n\nconst SYSTEM_FONTS = new KeywordSet([\n\t'caption',\n\t'icon',\n\t'menu',\n\t'message-box',\n\t'small-caption',\n\t'status-bar',\n])\n\nconst SIZE_KEYWORDS = new KeywordSet([\n\t/* <absolute-size> values */\n\t'xx-small',\n\t'x-small',\n\t'small',\n\t'medium',\n\t'large',\n\t'x-large',\n\t'xx-large',\n\t'xxx-large',\n\t/* <relative-size> values */\n\t'smaller',\n\t'larger',\n])\n\nconst COMMA = 44 // ','.charCodeAt(0) === 44\nconst SLASH = 47 // '/'.charCodeAt(0) === 47\nconst TYPE_OPERATOR = 'Operator'\nconst TYPE_IDENTIFIER = 'Identifier'\n\nexport function isSystemFont(node) {\n\tlet firstChild = node.children.first\n\treturn firstChild.type === TYPE_IDENTIFIER && SYSTEM_FONTS.has(firstChild.name)\n}\n\nexport function destructure(value, stringifyNode) {\n\tlet font_family = []\n\tlet font_size\n\tlet line_height\n\n\tvalue.children.forEach(function (node, item) {\n\t\t// any node that comes before the '/' is the font-size\n\t\tif (\n\t\t\titem.next &&\n\t\t\titem.next.data.type === TYPE_OPERATOR &&\n\t\t\titem.next.data.value.charCodeAt(0) === SLASH\n\t\t) {\n\t\t\tfont_size = stringifyNode(node)\n\t\t\treturn\n\t\t}\n\n\t\t// any node that comes after '/' is the line-height\n\t\tif (\n\t\t\titem.prev &&\n\t\t\titem.prev.data.type === TYPE_OPERATOR &&\n\t\t\titem.prev.data.value.charCodeAt(0) === SLASH\n\t\t) {\n\t\t\tline_height = stringifyNode(node)\n\t\t\treturn\n\t\t}\n\n\t\t// any node that's followed by ',' is a font-family\n\t\tif (\n\t\t\titem.next &&\n\t\t\titem.next.data.type === TYPE_OPERATOR &&\n\t\t\titem.next.data.value.charCodeAt(0) === COMMA &&\n\t\t\t!font_family[0]\n\t\t) {\n\t\t\tfont_family[0] = node\n\n\t\t\tif (!font_size && item.prev != null) {\n\t\t\t\tfont_size = stringifyNode(item.prev.data)\n\t\t\t}\n\n\t\t\treturn\n\t\t}\n\n\t\t// If, after taking care of font-size and line-height, we still have a remaining dimension, it must be the oblique angle\n\t\tif (\n\t\t\tnode.type === 'Dimension' &&\n\t\t\titem.prev &&\n\t\t\titem.prev.data.type === TYPE_IDENTIFIER &&\n\t\t\titem.prev.data.name === 'oblique'\n\t\t) {\n\t\t\t// put in the correct amount of whitespace between `oblique` and `<angle>`\n\t\t\tfont_style +=\n\t\t\t\t''.padStart(node.loc.start.offset - item.prev.data.loc.end.offset) +\n\t\t\t\tstringifyNode(node)\n\t\t\treturn\n\t\t}\n\n\t\t// any node that's a number and not previously caught by line-height or font-size is the font-weight\n\t\t// (oblique <angle> will not be caught here, because that's a Dimension, not a Number)\n\t\tif (node.type === 'Number') {\n\t\t\treturn\n\t\t}\n\n\t\t// last node always ends the font-family\n\t\tif (item.next === null) {\n\t\t\tfont_family[1] = node\n\n\t\t\t// if, at the last node, we don;t have a size yet, it *must* be the previous node\n\t\t\t// unless `font: menu` (system font), because then there's simply no size\n\t\t\tif (!font_size && !font_family[0] && item.prev) {\n\t\t\t\tfont_size = stringifyNode(item.prev.data)\n\t\t\t}\n\n\t\t\treturn\n\t\t}\n\n\t\t// Any remaining identifiers can be font-size, font-style, font-stretch, font-variant or font-weight\n\t\tif (node.type === TYPE_IDENTIFIER) {\n\t\t\tif (SIZE_KEYWORDS.has(node.name)) {\n\t\t\t\tfont_size = node.name\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t})\n\n\treturn {\n\t\tfont_size,\n\t\tline_height,\n\t\tfont_family: stringifyNode({\n\t\t\tloc: {\n\t\t\t\tstart: {\n\t\t\t\t\toffset: (font_family[0] || font_family[1]).loc.start.offset\n\t\t\t\t},\n\t\t\t\tend: {\n\t\t\t\t\toffset: font_family[1].loc.end.offset\n\t\t\t\t}\n\t\t\t}\n\t\t}),\n\t}\n}","import { KeywordSet } from \"../keyword-set.js\"\n\nconst keywords = new KeywordSet([\n 'auto',\n 'inherit',\n 'initial',\n 'unset',\n 'revert',\n 'revert-layer',\n 'none', // for `text-shadow`, `box-shadow` and `background`\n])\n\nexport function isValueKeyword(node) {\n if (!node.children) return false\n if (node.children.size > 1 || node.children.size === 0) return false\n\n let firstChild = node.children.first\n return firstChild.type === 'Identifier' && keywords.has(firstChild.name)\n}\n","import { KeywordSet } from \"../keyword-set.js\"\n\nconst TIMING_KEYWORDS = new KeywordSet([\n 'linear',\n 'ease',\n 'ease-in',\n 'ease-out',\n 'ease-in-out',\n 'step-start',\n 'step-end',\n])\n\nconst TIMING_FUNCTION_VALUES = new KeywordSet([\n 'cubic-bezier',\n 'steps'\n])\n\nexport function analyzeAnimation(children, stringifyNode) {\n let durationFound = false\n let durations = []\n let timingFunctions = []\n\n children.forEach(child => {\n let type = child.type\n\n // Right after a ',' we start over again\n if (type === 'Operator') {\n return durationFound = false\n }\n if (type === 'Dimension' && durationFound === false) {\n durationFound = true\n return durations.push(stringifyNode(child))\n }\n if (type === 'Identifier' && TIMING_KEYWORDS.has(child.name)) {\n return timingFunctions.push(stringifyNode(child))\n }\n if (type === 'Function' && TIMING_FUNCTION_VALUES.has(child.name)) {\n return timingFunctions.push(stringifyNode(child))\n }\n })\n\n return [durations, timingFunctions]\n}\n","import { hasVendorPrefix } from '../vendor-prefix.js'\n\nexport function isAstVendorPrefixed(node) {\n if (!node.children) {\n return false\n }\n\n let children = node.children.toArray()\n\n for (let index = 0; index < children.length; index++) {\n let node = children[index]\n let { type, name } = node;\n\n if (type === 'Identifier' && hasVendorPrefix(name)) {\n return true\n }\n\n if (type === 'Function') {\n if (hasVendorPrefix(name)) {\n return true\n }\n\n if (isAstVendorPrefixed(node)) {\n return true\n }\n }\n }\n\n return false\n}\n","export class Collection {\n\tconstructor({ useLocations = false }) {\n\t\t/** @type {Map<string, Array<Number>>} */\n\t\tthis._items = new Map()\n\t\tthis._total = 0\n\t\t/** @type {number[]} */\n\t\tthis.node_lines = []\n\t\t/** @type {number[]} */\n\t\tthis.node_columns = []\n\t\t/** @type {number[]} */\n\t\tthis.node_lengths = []\n\t\t/** @type {number[]} */\n\t\tthis.node_offsets = []\n\n\t\t/** @type {boolean} */\n\t\tthis._useLocations = useLocations\n\t}\n\n\t/**\n\t * @param {string} item\n\t * @param {import('css-tree').CssLocation} node_location\n\t */\n\tpush(item, node_location) {\n\t\tlet index = this._total\n\n\t\tthis.node_lines[index] = node_location.start.line\n\t\tthis.node_columns[index] = node_location.start.column\n\t\tthis.node_offsets[index] = node_location.start.offset\n\t\tthis.node_lengths[index] = node_location.end.offset - node_location.start.offset\n\n\t\tif (this._items.has(item)) {\n\t\t\t/** @type number[] */\n\t\t\tlet list = this._items.get(item)\n\t\t\tlist.push(index)\n\t\t\tthis._total++\n\t\t\treturn\n\t\t}\n\n\t\tthis._items.set(item, [index])\n\t\tthis._total++\n\t}\n\n\tsize() {\n\t\treturn this._total\n\t}\n\n\tcount() {\n\t\tlet uniqueWithLocations = new Map()\n\t\tlet unique = {}\n\t\tthis._items.forEach((list, key) => {\n\t\t\tlet nodes = list.map(index => ({\n\t\t\t\tline: this.node_lines[index],\n\t\t\t\tcolumn: this.node_columns[index],\n\t\t\t\toffset: this.node_offsets[index],\n\t\t\t\tlength: this.node_lengths[index],\n\t\t\t}))\n\t\t\tuniqueWithLocations.set(key, nodes)\n\t\t\tunique[key] = list.length\n\t\t})\n\n\t\tif (this._useLocations) {\n\t\t\treturn {\n\t\t\t\ttotal: this._total,\n\t\t\t\ttotalUnique: this._items.size,\n\t\t\t\tunique,\n\t\t\t\tuniquenessRatio: this._total === 0 ? 0 : this._items.size / this._total,\n\t\t\t\t__unstable__uniqueWithLocations: Object.fromEntries(uniqueWithLocations),\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\ttotal: this._total,\n\t\t\ttotalUnique: this._items.size,\n\t\t\tunique,\n\t\t\tuniquenessRatio: this._total === 0 ? 0 : this._items.size / this._total,\n\t\t}\n\t}\n}\n","import { Collection } from './collection.js'\n\nclass ContextCollection {\n constructor({ useLocations = false }) {\n this._list = new Collection({ useLocations })\n /** @type {Map<string, Collection>} */\n this._contexts = new Map()\n /** @type {boolean} */\n this.useLocations = useLocations\n }\n\n /**\n * Add an item to this _list's context\n * @param {string} item Item to push\n * @param {string} context Context to push Item to\n * @param {import('css-tree').CssLocation} node_location\n */\n push(item, context, node_location) {\n this._list.push(item, node_location)\n\n if (!this._contexts.has(context)) {\n this._contexts.set(context, new Collection({ useLocations: this.useLocations }))\n }\n\n this._contexts.get(context).push(item, node_location)\n }\n\n count() {\n /**\n * @type {Map<string, {\n * total: number,\n * totalUnique: number,\n * unique: {[string]: number},\n * uniquenessRatio: number\n * }>}\n */\n let itemsPerContext = new Map()\n\n for (let [context, value] of this._contexts.entries()) {\n itemsPerContext.set(context, value.count())\n }\n\n return Object.assign(this._list.count(), {\n itemsPerContext: Object.fromEntries(itemsPerContext)\n })\n }\n}\n\nexport {\n ContextCollection\n}","/**\n * Find the mode (most occurring value) in an array of Numbers\n * Takes the mean/average of multiple values if multiple values occur the same amount of times.\n *\n * @see https://github.com/angus-c/just/blob/684af9ca0c7808bc78543ec89379b1fdfce502b1/packages/array-mode/index.js\n * @param {Array} arr - Array to find the mode value for\n * @returns {Number} mode - The `mode` value of `arr`\n */\nfunction Mode(arr) {\n let frequencies = new Map()\n let maxOccurrences = -1\n let maxOccurenceCount = 0\n let sum = 0\n\n for (let i = 0; i < arr.length; i++) {\n let element = arr[i]\n let updatedCount = (frequencies.get(element) || 0) + 1\n frequencies.set(element, updatedCount)\n\n if (updatedCount > maxOccurrences) {\n maxOccurrences = updatedCount\n maxOccurenceCount = 0\n sum = 0\n }\n\n if (updatedCount >= maxOccurrences) {\n maxOccurenceCount++\n sum += element\n }\n }\n\n return sum / maxOccurenceCount\n}\n\n/**\n * Find the middle number in an Array of Numbers\n * Returns the average of 2 numbers if the Array length is an even number\n * @see https://github.com/angus-c/just/blob/684af9ca0c7808bc78543ec89379b1fdfce502b1/packages/array-median/index.js\n * @param {Array} arr - A sorted Array\n * @returns {Number} - The array's Median\n */\nfunction Median(arr) {\n let middle = arr.length / 2\n let lowerMiddleRank = Math.floor(middle)\n\n if (middle !== lowerMiddleRank) {\n return arr[lowerMiddleRank]\n }\n return (arr[lowerMiddleRank] + arr[lowerMiddleRank - 1]) / 2\n}\n\nclass AggregateCollection {\n constructor() {\n /** @type number[] */\n this._items = []\n this._sum = 0\n }\n\n /**\n * Add a new Integer at the end of this AggregateCollection\n * @param {number} item - The item to add\n */\n push(item) {\n this._items.push(item)\n this._sum += item\n }\n\n size() {\n return this._items.length\n }\n\n aggregate() {\n if (this._items.length === 0) {\n return {\n min: 0,\n max: 0,\n mean: 0,\n mode: 0,\n median: 0,\n range: 0,\n sum: 0,\n }\n }\n\n // TODO: can we avoid this sort()? It's slow\n /** @type Number[] */\n let sorted = this._items.slice().sort((a, b) => a - b)\n let min = sorted[0]\n let max = sorted[sorted.length - 1]\n\n let mode = Mode(sorted)\n let median = Median(sorted)\n\n return {\n min,\n max,\n mean: this._sum / sorted.length,\n mode,\n median,\n range: max - min,\n sum: this._sum,\n }\n }\n\n /**\n * @returns {number[]} All _items in this collection\n */\n toArray() {\n return this._items\n }\n}\n\nexport {\n AggregateCollection\n}","import { hasVendorPrefix } from '../vendor-prefix.js'\nimport { endsWith } from '../string-utils.js'\n\n/**\n * @param {string} property\n * @see https://github.com/csstree/csstree/blob/master/lib/utils/names.js#L69\n */\nexport function isHack(property) {\n if (isCustom(property) || hasVendorPrefix(property)) return false\n\n let code = property.charCodeAt(0)\n\n return code === 47 // /\n || code === 95 // _\n || code === 43 // +\n || code === 42 // *\n || code === 38 // &\n || code === 36 // $\n || code === 35 // #\n}\n\nexport function isCustom(property) {\n if (property.length < 3) return false\n // 45 === '-'.charCodeAt(0)\n return property.charCodeAt(0) === 45 && property.charCodeAt(1) === 45\n}\n\n/**\n * A check to verify that a propery is `basename` or a prefixed\n * version of that, but never a custom property that accidentally\n * ends with the same substring.\n *\n * @example\n * isProperty('animation', 'animation') // true\n * isProperty('animation', '-webkit-animation') // true\n * isProperty('animation', '--my-animation') // false\n *\n * @param {string} basename\n * @param {string} property\n * @returns {boolean} True if `property` equals `basename` without prefix\n */\nexport function isProperty(basename, property) {\n if (isCustom(property)) return false\n return endsWith(basename, property)\n}","import parse from 'css-tree/parser'\nimport walk from 'css-tree/walker'\nimport { calculate } from '@bramus/specificity/core'\nimport { isSupportsBrowserhack, isMediaBrowserhack } from './atrules/atrules.js'\nimport { getComplexity, isAccessibility, compareSpecificity } from './selectors/utils.js'\nimport { colorFunctions, colorKeywords, namedColors, systemColors } from './values/colors.js'\nimport { destructure, isSystemFont } from './values/destructure-font-shorthand.js'\nimport { isValueKeyword } from './values/values.js'\nimport { analyzeAnimation } from './values/animations.js'\nimport { isAstVendorPrefixed } from './values/vendor-prefix.js'\nimport { ContextCollection } from './context-collection.js'\nimport { Collection } from './collection.js'\nimport { AggregateCollection } from './aggregate-collection.js'\nimport { strEquals, startsWith, endsWith } from './string-utils.js'\nimport { hasVendorPrefix } from './vendor-prefix.js'\nimport { isCustom, isHack, isProperty } from './properties/property-utils.js'\nimport { getEmbedType } from './stylesheet/stylesheet.js'\nimport { isIe9Hack } from './values/browserhacks.js'\n\n/** @typedef {[number, number, number]} Specificity */\n\nfunction ratio(part, total) {\n if (total === 0) return 0\n return part / total\n}\n\nlet defaults = {\n useUnstableLocations: false\n}\n\n/**\n * Analyze CSS\n * @param {string} css\n */\nfunction analyze(css, options = {}) {\n let settings = Object.assign({}, defaults, options)\n let useLocations = settings.useUnstableLocations === true\n let start = Date.now()\n\n /**\n * Recreate the authored CSS from a CSSTree node\n * @param {import('css-tree').CssNode} node - Node from CSSTree AST to stringify\n * @returns {string} str - The stringified node\n */\n function stringifyNode(node) {\n return stringifyNodePlain(node).trim()\n }\n\n function stringifyNodePlain(node) {\n return css.substring(node.loc.start.offset, node.loc.end.offset)\n }\n\n // Stylesheet\n let totalComments = 0\n let commentsSize = 0\n let embeds = new Collection({ useLocations })\n let embedSize = 0\n let embedTypes = {\n total: 0,\n /** @type {Map<string, {size: number, count: number}>} */\n unique: new Map()\n }\n\n let startParse = Date.now()\n\n let ast = parse(css, {\n parseCustomProperty: true, // To find font-families, colors, etc.\n positions: true, // So we can use stringifyNode()\n /** @param {string} comment */\n onComment: function (comment) {\n totalComments++\n commentsSize += comment.length\n },\n })\n\n let startAnalysis = Date.now()\n let linesOfCode = ast.loc.end.line - ast.loc.start.line + 1\n\n // Atrules\n let totalAtRules = 0\n /** @type {{[property: string]: string}[]} */\n let fontfaces = []\n let layers = new Collection({ useLocations })\n let imports = new Collection({ useLocations })\n let medias = new Collection({ useLocations })\n let mediaBrowserhacks = new Collection({ useLocations })\n let charsets = new Collection({ useLocations })\n let supports = new Collection({ useLocations })\n let supportsBrowserhacks = new Collection({ useLocations })\n let keyframes = new Collection({ useLocations })\n let prefixedKeyframes = new Collection({ useLocations })\n let containers = new Collection({ useLocations })\n\n // Rules\n let totalRules = 0\n let emptyRules = 0\n let ruleSizes = new AggregateCollection()\n let selectorsPerRule = new AggregateCollection()\n let declarationsPerRule = new AggregateCollection()\n let uniqueRuleSize = new Collection({ useLocations })\n let uniqueSelectorsPerRule = new Collection({ useLocations })\n let uniqueDeclarationsPerRule = new Collection({ useLocations })\n\n // Selectors\n let keyframeSelectors = new Collection({ useLocations })\n let uniqueSelectors = new Set()\n let prefixedSelectors = new Collection({ useLocations })\n /** @type {Specificity} */\n let maxSpecificity\n /** @type {Specificity} */\n let minSpecificity\n let specificityA = new AggregateCollection()\n let specificityB = new AggregateCollection()\n let specificityC = new AggregateCollection()\n let uniqueSpecificities = new Collection({ useLocations })\n let selectorComplexities = new AggregateCollection()\n let uniqueSelectorComplexities = new Collection({ useLocations })\n /** @type {Specificity[]} */\n let specificities = []\n let ids = new Collection({ useLocations })\n let a11y = new Collection({ useLocations })\n\n // Declarations\n let uniqueDeclarations = new Set()\n let totalDeclarations = 0\n let importantDeclarations = 0\n let importantsInKeyframes = 0\n let importantCustomProperties = new Collection({ useLocations })\n\n // Properties\n let properties = new Collection({ useLocations })\n let propertyHacks = new Collection({ useLocations })\n let propertyVendorPrefixes = new Collection({ useLocations })\n let customProperties = new Collection({ useLocations })\n let propertyComplexities = new AggregateCollection()\n\n // Values\n let vendorPrefixedValues = new Collection({ useLocations })\n let valueBrowserhacks = new Collection({ useLocations })\n let zindex = new Collection({ useLocations })\n let textShadows = new Collection({ useLocations })\n let boxShadows = new Collection({ useLocations })\n let fontFamilies = new Collection({ useLocations })\n let fontSizes = new Collection({ useLocations })\n let lineHeights = new Collection({ useLocations })\n let timingFunctions = new Collection({ useLocations })\n let durations = new Collection({ useLocations })\n let colors = new ContextCollection({ useLocations })\n let colorFormats = new Collection({ useLocations })\n let units = new ContextCollection({ useLocations })\n let gradients = new Collection({ useLocations })\n\n walk(ast, function (node) {\n switch (node.type) {\n case 'Atrule': {\n totalAtRules++\n let atRuleName = node.name\n\n if (atRuleName === 'font-face') {\n let descriptors = {}\n\n node.block.children.forEach(descriptor => {\n // Ignore 'Raw' nodes in case of CSS syntax errors\n if (descriptor.type === 'Declaration') {\n descriptors[descriptor.property] = stringifyNode(descriptor.value)\n }\n })\n\n fontfaces.push(descriptors)\n break\n }\n\n if (atRuleName === 'media') {\n let prelude = stringifyNode(node.prelude)\n medias.push(prelude, node.prelude.loc)\n if (isMediaBrowserhack(node.prelude)) {\n mediaBrowserhacks.push(prelude, node.prelude.loc)\n }\n break\n }\n if (atRuleName === 'supports') {\n let prelude = stringifyNode(node.prelude)\n supports.push(prelude, node.prelude.loc)\n if (isSupportsBrowserhack(node.prelude)) {\n supportsBrowserhacks.push(prelude, node.prelude.loc)\n }\n break\n }\n if (endsWith('keyframes', atRuleName)) {\n let name = '@' + atRuleName + ' ' + stringifyNode(node.prelude)\n if (hasVendorPrefix(atRuleName)) {\n prefixedKeyframes.push(name, node.prelude.loc)\n }\n keyframes.push(name, node.prelude.loc)\n break\n }\n if (atRuleName === 'import') {\n imports.push(stringifyNode(node.prelude), node.prelude.loc)\n break\n }\n if (atRuleName === 'charset') {\n charsets.push(stringifyNode(node.prelude), node.prelude.loc)\n break\n }\n if (atRuleName === 'container') {\n containers.push(stringifyNode(node.prelude), node.prelude.loc)\n break\n }\n if (atRuleName === 'layer') {\n let prelude = stringifyNode(node.prelude)\n prelude\n .split(',')\n .forEach(name => layers.push(name.trim(), node.prelude.loc))\n }\n break\n }\n case 'Rule': {\n let numSelectors = node.prelude.children ? node.prelude.children.size : 0\n let numDeclarations = node.block.children ? node.block.children.size : 0\n\n ruleSizes.push(numSelectors + numDeclarations)\n uniqueRuleSize.push(numSelectors + numDeclarations, node.loc)\n selectorsPerRule.push(numSelectors)\n uniqueSelectorsPerRule.push(numSelectors, node.prelude.loc)\n declarationsPerRule.push(numDeclarations)\n uniqueDeclarationsPerRule.push(numDeclarations, node.block.loc)\n\n totalRules++\n\n if (numDeclarations === 0) {\n emptyRules++\n }\n break\n }\n case 'Selector': {\n let selector = stringifyNode(node)\n\n if (this.atrule && endsWith('keyframes', this.atrule.name)) {\n keyframeSelectors.push(selector, node.loc)\n return this.skip\n }\n\n let [{ value: specificityObj }] = calculate(node)\n /** @type {Specificity} */\n let specificity = [specificityObj.a, specificityObj.b, specificityObj.c]\n\n if (specificity[0] > 0) {\n ids.push(selector, node.loc)\n }\n\n if (isAccessibility(node)) {\n a11y.push(selector, node.loc)\n }\n\n let [complexity, isPrefixed] = getComplexity(node)\n\n if (isPrefixed) {\n prefixedSelectors.push(selector, node.loc)\n }\n\n uniqueSelectors.add(selector)\n selectorComplexities.push(complexity)\n uniqueSelectorComplexities.push(complexity, node.loc)\n uniqueSpecificities.push(specificity[0] + ',' + specificity[1] + ',' + specificity[2], node.loc)\n\n if (maxSpecificity === undefined) {\n maxSpecificity = specificity\n }\n\n if (minSpecificity === undefined) {\n minSpecificity = specificity\n }\n\n specificityA.push(specificity[0])\n specificityB.push(specificity[1])\n specificityC.push(specificity[2])\n\n if (minSpecificity !== undefined && compareSpecificity(minSpecificity, specificity) < 0) {\n minSpecificity = specificity\n }\n\n if (maxSpecificity !== undefined && compareSpecificity(maxSpecificity, specificity) > 0) {\n maxSpecificity = specificity\n }\n\n specificities.push(specificity)\n\n // Avoid deeper walking of selectors to not mess with\n // our specificity calculations in case of a selector\n // with :where() or :is() that contain SelectorLists\n // as children\n return this.skip\n }\n case 'Dimension': {\n if (!this.declaration) {\n break\n }\n\n /** @type {string} */\n let unit = node.unit\n\n if (endsWith('\\\\9', unit)) {\n units.push(unit.substring(0, unit.length - 2), this.declaration.property, node.loc)\n } else {\n units.push(unit, this.declaration.property, node.loc)\n }\n\n return this.skip\n }\n case 'Url': {\n if (startsWith('data:', node.value)) {\n let embed = node.value\n let size = embed.length\n let type = getEmbedType(embed)\n\n embedTypes.total++\n embedSize += size\n\n if (embedTypes.unique.has(type)) {\n let item = embedTypes.unique.get(type)\n item.count++\n item.size += size\n embedTypes.unique.set(type, item)\n } else {\n embedTypes.unique.set(type, {\n count: 1,\n size\n })\n }\n\n // @deprecated\n embeds.push(embed, node.loc)\n }\n break\n }\n case 'Value': {\n if (isValueKeyword(node)) {\n break\n }\n\n let declaration = this.declaration\n let { property, important } = declaration\n\n if (isAstVendorPrefixed(node)) {\n vendorPrefixedValues.push(stringifyNode(node), node.loc)\n }\n\n // i.e. `property: value !ie`\n if (typeof important === 'string') {\n valueBrowserhacks.push(stringifyNodePlain(node) + '!' + important, node.loc)\n }\n\n // i.e. `property: value\\9`\n if (isIe9Hack(node)) {\n valueBrowserhacks.push(stringifyNode(node), node.loc)\n }\n\n // Process properties first that don't have colors,\n // so we can avoid further walking them;\n if (isProperty('z-index', property)) {\n zindex.push(stringifyNode(node), node.loc)\n return this.skip\n } else if (isProperty('font', property)) {\n if (isSystemFont(node)) return\n\n let { font_size, line_height, font_family } = destructure(node, stringifyNode)\n\n if (font_family) {\n fontFamilies.push(font_family, node.loc)\n }\n if (font_size) {\n fontSizes.push(font_size, node.loc)\n }\n if (line_height) {\n lineHeights.push(line_height, node.loc)\n }\n\n break\n } else if (isProperty('font-size', property)) {\n if (!isSystemFont(node)) {\n fontSizes.push(stringifyNode(node), node.loc)\n }\n break\n } else if (isProperty('font-family', property)) {\n if (!isSystemFont(node)) {\n fontFamilies.push(stringifyNode(node), node.loc)\n }\n break\n } else if (isProperty('line-height', property)) {\n lineHeights.push(stringifyNode(node), node.loc)\n } else if (isProperty('transition', property) || isProperty('animation', property)) {\n let [times, fns] = analyzeAnimation(node.children, stringifyNode)\n for (let i = 0; i < times.length; i++) {\n durations.push(times[i], node.loc)\n }\n for (let i = 0; i < fns.length; i++) {\n timingFunctions.push(fns[i], node.loc)\n }\n break\n } else if (isProperty('animation-duration', property) || isProperty('transition-duration', property)) {\n if (node.children && node.children.size > 1) {\n node.children.forEach(child => {\n if (child.type !== 'Operator') {\n durations.push(stringifyNode(child), node.loc)\n }\n })\n } else {\n durations.push(stringifyNode(node), node.loc)\n }\n break\n } else if (isProperty('transition-timing-function', property) || isProperty('animation-timing-function', property)) {\n if (node.children && node.children.size > 1) {\n node.children.forEach(child => {\n if (child.type !== 'Operator') {\n timingFunctions.push(stringifyNode(child), node.loc)\n }\n })\n } else {\n timingFunctions.push(stringifyNode(node), node.loc)\n }\n break\n } else if (isProperty('text-shadow', property)) {\n if (!isValueKeyword(node)) {\n textShadows.push(stringifyNode(node), node.loc)\n }\n // no break here: potentially contains colors\n } else if (isProperty('box-shadow', property)) {\n if (!isValueKeyword(node)) {\n boxShadows.push(stringifyNode(node), node.loc)\n }\n // no break here: potentially contains colors\n }\n\n walk(node, function (valueNode) {\n let nodeName = valueNode.name\n\n switch (valueNode.type) {\n case 'Hash': {\n let hexLength = valueNode.value.length\n if (endsWith('\\\\9', valueNode.value)) {\n hexLength = hexLength - 2\n }\n colors.push('#' + valueNode.value, property, valueNode.loc)\n colorFormats.push(`hex` + hexLength, valueNode.loc)\n\n return this.skip\n }\n case 'Identifier': {\n // Bail out if it can't be a color name\n // 20 === 'lightgoldenrodyellow'.length\n // 3 === 'red'.length\n if (nodeName.length > 20 || nodeName.length < 3) {\n return this.skip\n }\n\n if (namedColors.has(nodeName)) {\n let stringified = stringifyNode(valueNode)\n colors.push(stringified, property, valueNode.loc)\n colorFormats.push('named', valueNode.loc)\n return\n }\n\n if (colorKeywords.has(nodeName)) {\n let stringified = stringifyNode(valueNode)\n colors.push(stringified, property, valueNode.loc)\n colorFormats.push(nodeName.toLowerCase(), valueNode.loc)\n return\n }\n\n if (systemColors.has(nodeName)) {\n let stringified = stringifyNode(valueNode)\n colors.push(stringified, property, valueNode.loc)\n colorFormats.push('system', valueNode.loc)\n return\n }\n return this.skip\n }\n case 'Function': {\n // Don't walk var() multiple times\n if (strEquals('var', nodeName)) {\n return this.skip\n }\n\n if (colorFunctions.has(nodeName)) {\n colors.push(stringifyNode(valueNode), property, valueNode.loc)\n colorFormats.push(nodeName.toLowerCase(), valueNode.loc)\n return\n }\n\n if (endsWith('gradient', nodeName)) {\n gradients.push(stringifyNode(valueNode), valueNode.loc)\n return\n }\n // No this.skip here intentionally,\n // otherwise we'll miss colors in linear-gradient() etc.\n }\n }\n })\n break\n }\n case 'Declaration': {\n // Do not process Declarations in atRule preludes\n // because we will handle them manually\n if (this.atrulePrelude !== null) {\n return this.skip\n }\n\n totalDeclarations++\n\n uniqueDeclarations.add(stringifyNode(node))\n\n if (node.important === true) {\n importantDeclarations++\n\n if (this.atrule && endsWith('keyframes', this.atrule.name)) {\n importantsInKeyframes++\n }\n }\n\n let { property } = node\n let propertyLoc = {\n start: {\n line: node.loc.start.line,\n column: node.loc.start.column,\n offset: node.loc.start.offset\n },\n end: {\n offset: node.loc.start.offset + property.length\n }\n }\n\n properties.push(property, propertyLoc)\n\n if (hasVendorPrefix(property)) {\n propertyVendorPrefixes.push(property, propertyLoc)\n propertyComplexities.push(2)\n } else if (isHack(property)) {\n propertyHacks.push(property, propertyLoc)\n propertyComplexities.push(2)\n } else if (isCustom(property)) {\n customProperties.push(property, propertyLoc)\n propertyComplexities.push(2)\n if (node.important === true) {\n importantCustomProperties.push(property, propertyLoc)\n }\n } else {\n propertyComplexities.push(1)\n }\n break\n }\n }\n })\n\n let embeddedContent = embeds.count()\n\n let totalUniqueDeclarations = uniqueDeclarations.size\n\n let totalSelectors = selectorComplexities.size()\n let specificitiesA = specificityA.aggregate()\n let specificitiesB = specificityB.aggregate()\n let specificitiesC = specificityC.aggregate()\n let totalUniqueSelectors = uniqueSelectors.size\n let assign = Object.assign\n\n return {\n stylesheet: {\n sourceLinesOfCode: totalAtRules + totalSelectors + totalDeclarations + keyframeSelectors.size(),\n linesOfCode,\n size: css.length,\n comments: {\n total: totalComments,\n size: commentsSize,\n },\n embeddedContent: assign(embeddedContent, {\n size: {\n total: embedSize,\n ratio: ratio(embedSize, css.length),\n },\n types: {\n total: embedTypes.total,\n totalUnique: embedTypes.unique.size,\n uniquenessRatio: ratio(embedTypes.unique.size, embedTypes.total),\n unique: Object.fromEntries(embedTypes.unique),\n },\n }),\n },\n atrules: {\n fontface: {\n total: fontfaces.length,\n totalUnique: fontfaces.length,\n unique: fontfaces,\n uniquenessRatio: fontfaces.length === 0 ? 0 : 1\n },\n import: imports.count(),\n media: assign(\n medias.count(),\n {\n browserhacks: mediaBrowserhacks.count(),\n }\n ),\n charset: charsets.count(),\n supports: assign(\n supports.count(),\n {\n browserhacks: supportsBrowserhacks.count(),\n },\n ),\n keyframes: assign(\n keyframes.count(), {\n prefixed: assign(\n prefixedKeyframes.count(), {\n ratio: ratio(prefixedKeyframes.size(), keyframes.size())\n }),\n }),\n container: containers.count(),\n layer: layers.count(),\n },\n rules: {\n total: totalRules,\n empty: {\n total: emptyRules,\n ratio: ratio(emptyRules, totalRules)\n },\n sizes: assign(\n ruleSizes.aggregate(),\n {\n items: ruleSizes.toArray(),\n },\n uniqueRuleSize.count(),\n ),\n selectors: assign(\n selectorsPerRule.aggregate(),\n {\n items: selectorsPerRule.toArray(),\n },\n uniqueSelectorsPerRule.count(),\n ),\n declarations: assign(\n declarationsPerRule.aggregate(),\n {\n items: declarationsPerRule.toArray(),\n },\n uniqueDeclarationsPerRule.count(),\n ),\n },\n selectors: {\n total: totalSelectors,\n totalUnique: totalUniqueSelectors,\n uniquenessRatio: ratio(totalUniqueSelectors, totalSelectors),\n specificity: assign(\n {\n /** @type Specificity */\n min: minSpecificity === undefined ? [0, 0, 0] : minSpecificity,\n /** @type Specificity */\n max: maxSpecificity === undefined ? [0, 0, 0] : maxSpecificity,\n /** @type Specificity */\n sum: [specificitiesA.sum, specificitiesB.sum, specificitiesC.sum],\n /** @type Specificity */\n mean: [specificitiesA.mean, specificitiesB.mean, specificitiesC.mean],\n /** @type Specificity */\n mode: [specificitiesA.mode, specificitiesB.mode, specificitiesC.mode],\n /** @type Specificity */\n median: [specificitiesA.median, specificitiesB.median, specificitiesC.median],\n items: specificities,\n },\n uniqueSpecificities.count(),\n ),\n complexity: assign(\n selectorComplexities.aggregate(),\n uniqueSelectorComplexities.count(),\n {\n items: selectorComplexities.toArray(),\n }\n ),\n id: assign(\n ids.count(), {\n ratio: ratio(ids.size(), totalSelectors),\n }),\n accessibility: assign(\n a11y.count(), {\n ratio: ratio(a11y.size(), totalSelectors),\n }),\n keyframes: keyframeSelectors.count(),\n prefixed: assign(\n prefixedSelectors.count(),\n {\n ratio: ratio(prefixedSelectors.size(), totalSelectors),\n },\n )\n },\n declarations: {\n total: totalDeclarations,\n totalUnique: totalUniqueDeclarations,\n uniquenessRatio: ratio(totalUniqueDeclarations, totalDeclarations),\n // @TODO: deprecated, remove in next major version\n unique: {\n total: totalUniqueDeclarations,\n ratio: ratio(totalUniqueDeclarations, totalDeclarations),\n },\n importants: {\n total: importantDeclarations,\n ratio: ratio(importantDeclarations, totalDeclarations),\n inKeyframes: {\n total: importantsInKeyframes,\n ratio: ratio(importantsInKeyframes, importantDeclarations),\n },\n },\n },\n properties: assign(\n properties.count(),\n {\n prefixed: assign(\n propertyVendorPrefixes.count(),\n {\n ratio: ratio(propertyVendorPrefixes.size(), properties.size()),\n },\n ),\n custom: assign(\n customProperties.count(),\n {\n ratio: ratio(customProperties.size(), properties.size()),\n importants: assign(\n importantCustomProperties.count(),\n {\n ratio: ratio(importantCustomProperties.size(), customProperties.size()),\n }\n ),\n },\n ),\n browserhacks: assign(\n propertyHacks.count(), {\n ratio: ratio(propertyHacks.size(), properties.size()),\n }),\n complexity: propertyComplexities.aggregate(),\n }),\n values: {\n colors: assign(\n colors.count(),\n {\n formats: colorFormats.count(),\n },\n ),\n gradients: gradients.count(),\n fontFamilies: fontFamilies.count(),\n fontSizes: fontSizes.count(),\n lineHeights: lineHeights.count(),\n zindexes: zindex.count(),\n textShadows: textShadows.count(),\n boxShadows: boxShadows.count(),\n animations: {\n durations: durations.count(),\n timingFunctions: timingFunctions.count(),\n },\n prefixes: vendorPrefixedValues.count(),\n browserhacks: valueBrowserhacks.count(),\n units: units.count(),\n },\n __meta__: {\n parseTime: startAnalysis - startParse,\n analyzeTime: Date.now() - startAnalysis,\n total: Date.now() - start\n }\n }\n}\n\nexport {\n analyze,\n compareSpecificity,\n}\n","/** @param {string} embed */\nexport function getEmbedType(embed) {\n\t// data:image/gif;base64,R0lG\n\tlet start = 5 // `data:`.length\n\tlet semicolon = embed.indexOf(';')\n\tlet comma = embed.indexOf(',')\n\n\tif (semicolon === -1) {\n\t\treturn embed.substring(start, comma)\n\t}\n\n\tif (comma !== -1 && comma < semicolon) {\n\t\treturn embed.substring(start, comma);\n\t}\n\n\treturn embed.substring(start, semicolon)\n}","import { endsWith } from \"../string-utils.js\"\n\nexport function isIe9Hack(node) {\n\tlet children = node.children\n\treturn children\n\t\t&& children.last\n\t\t&& children.last.type === 'Identifier'\n\t\t&& endsWith('\\\\9', children.last.name)\n}"],"names":["compareChar","referenceCode","testCode","strEquals","base","maybe","len","length","i","charCodeAt","endsWith","offset","startsWith","isPropertyValue","node","property","value","children","first","type","name","hasVendorPrefix","keyword","indexOf","compareSpecificity","a","b","analyzeList","selectorListAst","cb","childSelectors","walk","visit","enter","push","isPseudoFunction","isAccessibility","selector","isA11y","some","skip","getComplexity","complexity","isPrefixed","Boolean","list","forEach","KeywordSet","items","this","set","has","item","index","namedColors","systemColors","colorFunctions","colorKeywords","SYSTEM_FONTS","SIZE_KEYWORDS","isSystemFont","firstChild","keywords","isValueKeyword","size","TIMING_KEYWORDS","TIMING_FUNCTION_VALUES","isAstVendorPrefixed","toArray","Collection","useLocations","_items","Map","_total","node_lines","node_columns","node_lengths","node_offsets","_useLocations","node_location","start","line","column","end","get","count","uniqueWithLocations","unique","key","nodes","map","_this","total","totalUnique","uniquenessRatio","__unstable__uniqueWithLocations","Object","fromEntries","ContextCollection","_list","_contexts","context","itemsPerContext","entries","assign","AggregateCollection","_sum","aggregate","min","max","mean","mode","median","range","sum","arr","middle","lowerMiddleRank","sorted","slice","sort","frequencies","maxOccurrences","maxOccurenceCount","element","updatedCount","Mode","Math","floor","isCustom","isProperty","basename","ratio","part","defaults","useUnstableLocations","css","options","Date","now","stringifyNode","stringifyNodePlain","trim","substring","loc","maxSpecificity","minSpecificity","totalComments","commentsSize","embeds","embedSize","embedTypes","startParse","ast","parse","parseCustomProperty","positions","onComment","comment","startAnalysis","linesOfCode","totalAtRules","fontfaces","layers","imports","medias","mediaBrowserhacks","charsets","supports","supportsBrowserhacks","keyframes","prefixedKeyframes","containers","totalRules","emptyRules","ruleSizes","selectorsPerRule","declarationsPerRule","uniqueRuleSize","uniqueSelectorsPerRule","uniqueDeclarationsPerRule","keyframeSelectors","uniqueSelectors","Set","prefixedSelectors","specificityA","specificityB","specificityC","uniqueSpecificities","selectorComplexities","uniqueSelectorComplexities","specificities","ids","a11y","uniqueDeclarations","totalDeclarations","importantDeclarations","importantsInKeyframes","importantCustomProperties","properties","propertyHacks","propertyVendorPrefixes","customProperties","propertyComplexities","vendorPrefixedValues","valueBrowserhacks","zindex","textShadows","boxShadows","fontFamilies","fontSizes","lineHeights","timingFunctions","durations","colors","colorFormats","units","gradients","atRuleName","descriptors","block","descriptor","prelude","returnValue","unit","isMediaBrowserhack","isSupportsBrowserhack","split","numSelectors","numDeclarations","atrule","specificityObj","calculate","specificity","c","add","undefined","declaration","embed","semicolon","comma","getEmbedType","important","last","isIe9Hack","font_size","line_height","font_family","next","data","prev","font_style","padStart","destructure","durationFound","child","analyzeAnimation","times","fns","valueNode","nodeName","hexLength","stringified","toLowerCase","atrulePrelude","propertyLoc","code","isHack","embeddedContent","totalUniqueDeclarations","totalSelectors","specificitiesA","specificitiesB","specificitiesC","totalUniqueSelectors","stylesheet","sourceLinesOfCode","comments","types","atrules","fontface","import","media","browserhacks","charset","prefixed","container","layer","rules","empty","sizes","selectors","declarations","id","accessibility","importants","inKeyframes","custom","values","formats","zindexes","animations","prefixes","__meta__","parseTime","analyzeTime"],"mappings":"wNAMA,SAASA,EAAYC,EAAeC,GAMlC,OAJIA,GAAY,IAAUA,GAAY,KAEpCA,GAAsB,IAEjBD,IAAkBC,CAC1B,UAceC,EAAUC,EAAMC,GAC9B,IAAIC,EAAMF,EAAKG,OACf,GAAID,IAAQD,EAAME,OAAQ,SAE1B,IAAK,IAAIC,EAAI,EAAGA,EAAIF,EAAKE,IACvB,IAA6D,IAAzDR,EAAYI,EAAKK,WAAWD,GAAIH,EAAMI,WAAWD,IACnD,SAIJ,QACD,UAaeE,EAASN,EAAMC,GAC7B,IAAIC,EAAMD,EAAME,OACZI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,KAAKC,IAAIG,GAAQD,GAC9B,SAGF,QACA,OCrBWE,EAAc,IAAIP,EAAW,CAKxC,QACA,QACA,MACA,OACA,OACA,OACA,QACA,gBACA,SACA,SAEA,YACA,eACA,OACA,aACA,QACA,QACA,SACA,iBACA,aACA,QACA,YACA,YACA,aACA,YACA,QACA,iBACA,WACA,UACA,OACA,WACA,WACA,gBACA,WACA,YACA,WACA,YACA,cACA,iBACA,aACA,aACA,UACA,aACA,eACA,gBACA,gBACA,gBACA,gBACA,aACA,WACA,cACA,UACA,UACA,aACA,YACA,cACA,cACA,UACA,YACA,aACA,OACA,YACA,cACA,WACA,UACA,YACA,SACA,QACA,QACA,WACA,gBACA,YACA,eACA,YACA,aACA,YACA,uBACA,YACA,aACA,YACA,YACA,cACA,gBACA,eACA,iBACA,iBACA,iBACA,cACA,OACA,YACA,QACA,UACA,SACA,mBACA,aACA,eACA,eACA,iBACA,kBACA,oBACA,kBACA,kBACA,eACA,YACA,YACA,WACA,cACA,OACA,UACA,QACA,YACA,YACA,SACA,gBACA,YACA,gBACA,gBACA,aACA,YACA,OACA,OACA,OACA,aACA,SACA,YACA,YACA,cACA,SACA,aACA,WACA,WACA,SACA,SACA,UACA,YACA,YACA,YACA,OACA,cACA,YACA,MACA,OACA,UACA,SACA,YACA,SACA,QACA,aACA,gBAGWQ,EAAe,IAAIR,EAAW,CAGzC,SACA,aACA,WACA,cACA,aACA,aACA,aACA,eACA,QACA,YACA,YACA,gBACA,eACA,mBACA,OACA,WACA,aAMWS,EAAiB,IAAIT,EAAW,CAC3C,MACA,OACA,MACA,OACA,MACA,MACA,MACA,QACA,QACA,UAGWU,EAAgB,IAAIV,EAAW,CAC1C,cACA,iBCpMIW,EAAe,IAAIX,EAAW,CACnC,UACA,OACA,OACA,cACA,gBACA,eAGKY,EAAgB,IAAIZ,EAAW,CAEpC,WACA,UACA,QACA,SACA,QACA,UACA,WACA,YAEA,UACA,oBAQea,EAAa9C,GAC5B,IAAI+C,EAAa/C,EAAK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