"use strict";const creator=s=>{const o=s?.ignore??[];return{postcssPlugin:"postcss-slow-plugins",async Once(s,{result:n,postcss:t}){console.log("Analyzing with file:\n "+s.source?.input.from+"\n");const e=s.source?.input.css??"",i=[...n.processor.plugins.filter((s=>"postcssPlugin"in s&&"postcss-slow-plugins"!==s.postcssPlugin))],r=(await t(i).process(e??"",n.opts)).css.length/1024,medianDuration=async s=>{const o=[];for(let n=0;n<21;n++){const n=performance.now();await s(),o.push(performance.now()-n)}return o.sort(((s,o)=>s-o)),o[10]},p=await medianDuration((async()=>{await t(i).process(e??"",n.opts)}));{const s=[];for(let c=0;cs!==i[c])),a=await medianDuration((async()=>{await t(u).process(e??"",n.opts)})),d=p-a;s.push({duration:`${a.toFixed(2)}ms`,"kb's per ms":`${(r/a).toFixed(2)}kb/ms`,drop:d,name:l,"index in plugins list":c})}s.sort(((s,o)=>Number(o.drop)-Number(s.drop))),s.splice(0,0,{duration:`${p.toFixed(2)}ms`,"kb's per ms":`${(r/p).toFixed(2)}kb/ms`,drop:"--",name:"-- all plugins --","index in plugins list":"--"}),s.map((s=>("string"==typeof s.drop||(s.drop=`${s.drop.toFixed(2)}ms`),s))),console.log("Most impactful to improve, ordered by drop in duration when excluded:"),console.table(s.slice(0,11))}{const s=[];for(let c=0;cs===i[c]||"postcssPlugin"in s&&o.includes(s.postcssPlugin)))],a=await medianDuration((async()=>{await t(u).process(e??"",n.opts)})),d=p-a;s.push({duration:`${a.toFixed(2)}ms`,"kb's per ms":`${(r/a).toFixed(2)}kb/ms`,drop:d,name:l,"index in plugins list":c})}s.sort(((s,o)=>Number(s.drop)-Number(o.drop))),s.map((s=>(delete s.drop,s))),console.log("Most impactful to improve, ordered by increase in duration when running alone:"),console.table(s.slice(0,11))}}}};creator.postcss=!0,module.exports=creator;