/**
 * Minified by jsDelivr using Terser v5.37.0.
 * Original file: /npm/time-require@0.1.2/src/timeRequire.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";var requireData=[],write=process.stdout.write.bind(process.stdout),relative=require("path").relative,cwd=process.cwd(),hook=require("./requireHook")(_hooker),table=require("text-table"),dateTime=require("date-time"),prettyMs=require("pretty-ms"),chalk=require("chalk"),DEFAULT_COLUMNS=80,BAR_CHAR="win32"===process.platform?"■":"▇",sorted=hasArg("--sorted")||hasArg("--s"),treshold=hasArg("--verbose")||hasArg("--V")?0:.01,EXTRA_COLUMNS=sorted?24:20;function hasArg(e){return-1!==process.argv.indexOf(e)}function pad(e,r){return e>1?new Array(e).join(r):""}function log(e){write(e+"\n","utf8")}function _hooker(e){var r=relative(cwd,e.filename);r.length>e.filename&&(r=e.filename),requireData.push({order:requireData.length,time:e.startedIn,label:e.name+" ("+r+")"})}function formatTable(e,r){var t,o,l=/(.+)( \(.+\))/,a=process.stdout.columns||DEFAULT_COLUMNS,n=e.reduce((function(e,t){return t.time/r<treshold?e:Math.max(e,t.label.length)}),0),i=n>a/2?(a-EXTRA_COLUMNS)/2:a-(n+EXTRA_COLUMNS),s=[];return sorted&&e.sort((function(e,r){return r.time-e.time})),t=1,o=e.length.toString().length,s.push(["#"+(sorted?" [order]":""),"module","time","%"]),e.forEach((function(e){var a,n,h,u,c,d,g,m,f,p,k=e.time/r;k>=treshold&&(a=t++,sorted&&(a+=pad(o-e.order.toString().length+1," ")+" ["+e.order+"]"),d=e.label,p=d.length,(h=(n=d.length<i?d:(g=Math.floor((i-3)/2),m=d.substr(0,g+1),f=d.substr(p-g),m.trim()+"..."+f.trim())).match(l))&&(n=chalk.green(h[1])+h[2]),s.push([a,n,chalk.yellow(prettyMs(e.time)),chalk.blue((u=k,c=Math.round(100*u),(0===c?"0":pad(Math.ceil(i*u)+1,BAR_CHAR)+" "+c)+"%"))]))})),table(s,{align:["r","l","r","l"],stringLength:function(e){return chalk.stripColor(e).length}})}process.once("exit",(function(){var e=hook.hookedAt,r=Date.now()-e.getTime();log("\n\n"+chalk.underline("Start time: "+chalk.yellow("("+dateTime(e)+")")+" [treshold="+100*treshold+"%"+(sorted?",sorted":"")+"]")),log(formatTable(requireData,r)),log(chalk.bold.blue("Total require(): ")+chalk.yellow(requireData.length)),log(chalk.bold.blue("Total time: ")+chalk.yellow(prettyMs(r)))}));
//# sourceMappingURL=/sm/33b4afa6cdd76131323d3969c90f73f15b67c516d1f0d16bc2ae1f9ebc7f68cf.map