diff --git a/dist/index.mjs b/dist/index.mjs index 0ba77b3..a81bcf3 100644 --- a/dist/index.mjs +++ b/dist/index.mjs @@ -1,6 +1,6 @@ -var Ds=Object.create;var Te=Object.defineProperty;var Ms=Object.getOwnPropertyDescriptor;var Ns=Object.getOwnPropertyNames;var _s=Object.getPrototypeOf,Ls=Object.prototype.hasOwnProperty;var Ae=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports);var js=(r,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ns(t))!Ls.call(r,i)&&i!==e&&Te(r,i,{get:()=>t[i],enumerable:!(s=Ms(t,i))||s.enumerable});return r};var zs=(r,t,e)=>(e=r!=null?Ds(_s(r)):{},js(t||!r||!r.__esModule?Te(e,"default",{value:r,enumerable:!0}):e,r));var Fe=Ae((Cr,Oe)=>{"use strict";Oe.exports=ke;function ke(r,t,e){r instanceof RegExp&&(r=Re(r,e)),t instanceof RegExp&&(t=Re(t,e));var s=Ce(r,t,e);return s&&{start:s[0],end:s[1],pre:e.slice(0,s[0]),body:e.slice(s[0]+r.length,s[1]),post:e.slice(s[1]+t.length)}}function Re(r,t){var e=t.match(r);return e?e[0]:null}ke.range=Ce;function Ce(r,t,e){var s,i,n,o,h,a=e.indexOf(r),l=e.indexOf(t,a+1),c=a;if(a>=0&&l>0){if(r===t)return[a,l];for(s=[],n=e.length;c>=0&&!h;)c==a?(s.push(c),a=e.indexOf(r,c+1)):s.length==1?h=[s.pop(),l]:(i=s.pop(),i=0?a:l;s.length&&(h=[n,o])}return h}});var Ie=Ae((Or,ze)=>{var De=Fe();ze.exports=$s;var Me="\0SLASH"+Math.random()+"\0",Ne="\0OPEN"+Math.random()+"\0",te="\0CLOSE"+Math.random()+"\0",_e="\0COMMA"+Math.random()+"\0",Le="\0PERIOD"+Math.random()+"\0";function Qt(r){return parseInt(r,10)==r?parseInt(r,10):r.charCodeAt(0)}function Is(r){return r.split("\\\\").join(Me).split("\\{").join(Ne).split("\\}").join(te).split("\\,").join(_e).split("\\.").join(Le)}function Ps(r){return r.split(Me).join("\\").split(Ne).join("{").split(te).join("}").split(_e).join(",").split(Le).join(".")}function je(r){if(!r)return[""];var t=[],e=De("{","}",r);if(!e)return r.split(",");var s=e.pre,i=e.body,n=e.post,o=s.split(",");o[o.length-1]+="{"+i+"}";var h=je(n);return n.length&&(o[o.length-1]+=h.shift(),o.push.apply(o,h)),t.push.apply(t,o),t}function $s(r){return r?(r.substr(0,2)==="{}"&&(r="\\{\\}"+r.substr(2)),at(Is(r),!0).map(Ps)):[]}function Ws(r){return"{"+r+"}"}function Bs(r){return/^-?0\d/.test(r)}function Us(r,t){return r<=t}function Gs(r,t){return r>=t}function at(r,t){var e=[],s=De("{","}",r);if(!s)return[r];var i=s.pre,n=s.post.length?at(s.post,!1):[""];if(/\$$/.test(s.pre))for(var o=0;o=0;if(!c&&!f)return s.post.match(/,.*\}/)?(r=s.pre+"{"+s.body+te+s.post,at(r)):[r];var u;if(c)u=s.body.split(/\.\./);else if(u=je(s.body),u.length===1&&(u=at(u[0],!1).map(Ws),u.length===1))return n.map(function(Ct){return s.pre+u[0]+Ct});var d;if(c){var m=Qt(u[0]),p=Qt(u[1]),w=Math.max(u[0].length,u[1].length),g=u.length==3?Math.abs(Qt(u[2])):1,S=Us,b=p0){var kt=new Array(z+1).join("0");E<0?x="-"+kt+x.slice(1):x=kt+x}}d.push(x)}}else{d=[];for(var B=0;B{if(typeof r!="string")throw new TypeError("invalid pattern");if(r.length>65536)throw new TypeError("pattern is too long")};var Hs={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},ct=r=>r.replace(/[[\]\\-]/g,"\\$&"),qs=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Pe=r=>r.join(""),$e=(r,t)=>{let e=t;if(r.charAt(e)!=="[")throw new Error("not in a brace expression");let s=[],i=[],n=e+1,o=!1,h=!1,a=!1,l=!1,c=e,f="";t:for(;nf?s.push(ct(f)+"-"+ct(p)):p===f&&s.push(ct(p)),f="",n++;continue}if(r.startsWith("-]",n+1)){s.push(ct(p+"-")),n+=2;continue}if(r.startsWith("-",n+1)){f=p,n+=2;continue}s.push(ct(p)),n++}if(ct?r.replace(/\[([^\/\\])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var Js=new Set(["!","?","+","*","@"]),We=r=>Js.has(r),Ks="(?!(?:^|/)\\.\\.?(?:$|/))",Ot="(?!\\.)",Vs=new Set(["[","."]),Ys=new Set(["..","."]),Xs=new Set("().*{}+?[]^$\\!"),Zs=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),ee="[^/]",Be=ee+"*?",Ue=ee+"+?",Q=class r{type;#t;#s;#n=!1;#i=[];#h;#l;#f;#a=!1;#o;#e;#m=!1;constructor(t,e,s={}){this.type=t,t&&(this.#s=!0),this.#h=e,this.#t=this.#h?this.#h.#t:this,this.#o=this.#t===this?s:this.#t.#o,this.#f=this.#t===this?[]:this.#t.#f,t==="!"&&!this.#t.#a&&this.#f.push(this),this.#l=this.#h?this.#h.#i.length:0}get hasMagic(){if(this.#s!==void 0)return this.#s;for(let t of this.#i)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#s=!0;return this.#s}toString(){return this.#e!==void 0?this.#e:this.type?this.#e=this.type+"("+this.#i.map(t=>String(t)).join("|")+")":this.#e=this.#i.map(t=>String(t)).join("")}#w(){if(this!==this.#t)throw new Error("should only call on root");if(this.#a)return this;this.toString(),this.#a=!0;let t;for(;t=this.#f.pop();){if(t.type!=="!")continue;let e=t,s=e.#h;for(;s;){for(let i=e.#l+1;!s.type&&itypeof e=="string"?e:e.toJSON()):[this.type,...this.#i.map(e=>e.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#a&&this.#h?.type==="!")&&t.push({}),t}isStart(){if(this.#t===this)return!0;if(!this.#h?.isStart())return!1;if(this.#l===0)return!0;let t=this.#h;for(let e=0;e{let[m,p,w,g]=typeof d=="string"?r.#S(d,this.#s,a):d.toRegExpSource(t);return this.#s=this.#s||w,this.#n=this.#n||g,m}).join(""),c="";if(this.isStart()&&typeof this.#i[0]=="string"&&!(this.#i.length===1&&Ys.has(this.#i[0]))){let m=Vs,p=e&&m.has(l.charAt(0))||l.startsWith("\\.")&&m.has(l.charAt(2))||l.startsWith("\\.\\.")&&m.has(l.charAt(4)),w=!e&&!t&&m.has(l.charAt(0));c=p?Ks:w?Ot:""}let f="";return this.isEnd()&&this.#t.#a&&this.#h?.type==="!"&&(f="(?:$|\\/)"),[c+l+f,I(l),this.#s=!!this.#s,this.#n]}let s=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",n=this.#u(e);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){let a=this.toString();return this.#i=[a],this.type=null,this.#s=void 0,[a,I(this.toString()),!1,!1]}let o=!s||t||e||!Ot?"":this.#u(!0);o===n&&(o=""),o&&(n=`(?:${n})(?:${o})*?`);let h="";if(this.type==="!"&&this.#m)h=(this.isStart()&&!e?Ot:"")+Ue;else{let a=this.type==="!"?"))"+(this.isStart()&&!e&&!t?Ot:"")+Be+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;h=i+n+a}return[h,I(n),this.#s=!!this.#s,this.#n]}#u(t){return this.#i.map(e=>{if(typeof e=="string")throw new Error("string type in extglob ast??");let[s,i,n,o]=e.toRegExpSource(t);return this.#n=this.#n||o,s}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join("|")}static#S(t,e,s=!1){let i=!1,n="",o=!1;for(let h=0;ht?r.replace(/[?*()[\]]/g,"[$&]"):r.replace(/[?*()[\]\\]/g,"\\$&");var F=(r,t,e={})=>(lt(t),!e.nocomment&&t.charAt(0)==="#"?!1:new M(t,e).match(r)),Qs=/^\*+([^+@!?\*\[\(]*)$/,ti=r=>t=>!t.startsWith(".")&&t.endsWith(r),ei=r=>t=>t.endsWith(r),si=r=>(r=r.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(r)),ii=r=>(r=r.toLowerCase(),t=>t.toLowerCase().endsWith(r)),ri=/^\*+\.\*+$/,ni=r=>!r.startsWith(".")&&r.includes("."),oi=r=>r!=="."&&r!==".."&&r.includes("."),hi=/^\.\*+$/,ai=r=>r!=="."&&r!==".."&&r.startsWith("."),li=/^\*+$/,ci=r=>r.length!==0&&!r.startsWith("."),fi=r=>r.length!==0&&r!=="."&&r!=="..",ui=/^\?+([^+@!?\*\[\(]*)?$/,di=([r,t=""])=>{let e=Je([r]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},pi=([r,t=""])=>{let e=Ke([r]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},mi=([r,t=""])=>{let e=Ke([r]);return t?s=>e(s)&&s.endsWith(t):e},gi=([r,t=""])=>{let e=Je([r]);return t?s=>e(s)&&s.endsWith(t):e},Je=([r])=>{let t=r.length;return e=>e.length===t&&!e.startsWith(".")},Ke=([r])=>{let t=r.length;return e=>e.length===t&&e!=="."&&e!==".."},Ve=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Ge={win32:{sep:"\\"},posix:{sep:"/"}},wi=Ve==="win32"?Ge.win32.sep:Ge.posix.sep;F.sep=wi;var k=Symbol("globstar **");F.GLOBSTAR=k;var yi="[^/]",bi=yi+"*?",Si="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Ei="(?:(?!(?:\\/|^)\\.).)*?",vi=(r,t={})=>e=>F(e,r,t);F.filter=vi;var _=(r,t={})=>Object.assign({},r,t),xi=r=>{if(!r||typeof r!="object"||!Object.keys(r).length)return F;let t=F;return Object.assign((s,i,n={})=>t(s,i,_(r,n)),{Minimatch:class extends t.Minimatch{constructor(i,n={}){super(i,_(r,n))}static defaults(i){return t.defaults(_(r,i)).Minimatch}},AST:class extends t.AST{constructor(i,n,o={}){super(i,n,_(r,o))}static fromGlob(i,n={}){return t.AST.fromGlob(i,_(r,n))}},unescape:(s,i={})=>t.unescape(s,_(r,i)),escape:(s,i={})=>t.escape(s,_(r,i)),filter:(s,i={})=>t.filter(s,_(r,i)),defaults:s=>t.defaults(_(r,s)),makeRe:(s,i={})=>t.makeRe(s,_(r,i)),braceExpand:(s,i={})=>t.braceExpand(s,_(r,i)),match:(s,i,n={})=>t.match(s,i,_(r,n)),sep:t.sep,GLOBSTAR:k})};F.defaults=xi;var Ye=(r,t={})=>(lt(r),t.nobrace||!/\{(?:(?!\{).)*\}/.test(r)?[r]:(0,qe.default)(r));F.braceExpand=Ye;var Ti=(r,t={})=>new M(r,t).makeRe();F.makeRe=Ti;var Ai=(r,t,e={})=>{let s=new M(t,e);return r=r.filter(i=>s.match(i)),s.options.nonull&&!r.length&&r.push(t),r};F.match=Ai;var He=/[?*]|[+@!]\(.*?\)|\[|\]/,Ri=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),M=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){lt(t),e=e||{},this.options=e,this.pattern=t,this.platform=e.platform||Ve,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let e of t)if(typeof e!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...n)=>console.error(...n)),this.debug(this.pattern,this.globSet);let s=this.globSet.map(n=>this.slashSplit(n));this.globParts=this.preprocess(s),this.debug(this.pattern,this.globParts);let i=this.globParts.map((n,o,h)=>{if(this.isWindows&&this.windowsNoMagicRoot){let a=n[0]===""&&n[1]===""&&(n[2]==="?"||!He.test(n[2]))&&!He.test(n[3]),l=/^[a-z]:/i.test(n[0]);if(a)return[...n.slice(0,4),...n.slice(4).map(c=>this.parse(c))];if(l)return[n[0],...n.slice(1).map(c=>this.parse(c))]}return n.map(a=>this.parse(a))});if(this.debug(this.pattern,i),this.set=i.filter(n=>n.indexOf(!1)===-1),this.isWindows)for(let n=0;n=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let s=-1;for(;(s=e.indexOf("**",s+1))!==-1;){let i=s;for(;e[i+1]==="**";)i++;i!==s&&e.splice(s,i-s)}return e})}levelOneOptimize(t){return t.map(e=>(e=e.reduce((s,i)=>{let n=s[s.length-1];return i==="**"&&n==="**"?s:i===".."&&n&&n!==".."&&n!=="."&&n!=="**"?(s.pop(),s):(s.push(i),s)},[]),e.length===0?[""]:e))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let i=1;ii&&s.splice(i+1,o-i);let h=s[i+1],a=s[i+2],l=s[i+3];if(h!==".."||!a||a==="."||a===".."||!l||l==="."||l==="..")continue;e=!0,s.splice(i,1);let c=s.slice(0);c[i]="**",t.push(c),i--}if(!this.preserveMultipleSlashes){for(let o=1;oe.length)}partsMatch(t,e,s=!1){let i=0,n=0,o=[],h="";for(;ib?e=e.slice(y):b>y&&(t=t.slice(b)))}}let{optimizationLevel:n=1}=this.options;n>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var o=0,h=0,a=t.length,l=e.length;o()=>(t||r((t={exports:{}}).exports,t),t.exports);var js=(r,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ms(t))!Ls.call(r,i)&&i!==e&&Te(r,i,{get:()=>t[i],enumerable:!(s=Ns(t,i))||s.enumerable});return r};var zs=(r,t,e)=>(e=r!=null?Ds(_s(r)):{},js(t||!r||!r.__esModule?Te(e,"default",{value:r,enumerable:!0}):e,r));var Fe=Ae((Cr,Oe)=>{"use strict";Oe.exports=ke;function ke(r,t,e){r instanceof RegExp&&(r=Re(r,e)),t instanceof RegExp&&(t=Re(t,e));var s=Ce(r,t,e);return s&&{start:s[0],end:s[1],pre:e.slice(0,s[0]),body:e.slice(s[0]+r.length,s[1]),post:e.slice(s[1]+t.length)}}function Re(r,t){var e=t.match(r);return e?e[0]:null}ke.range=Ce;function Ce(r,t,e){var s,i,n,o,h,a=e.indexOf(r),l=e.indexOf(t,a+1),c=a;if(a>=0&&l>0){if(r===t)return[a,l];for(s=[],n=e.length;c>=0&&!h;)c==a?(s.push(c),a=e.indexOf(r,c+1)):s.length==1?h=[s.pop(),l]:(i=s.pop(),i=0?a:l;s.length&&(h=[n,o])}return h}});var Ie=Ae((Or,ze)=>{var De=Fe();ze.exports=$s;var Ne="\0SLASH"+Math.random()+"\0",Me="\0OPEN"+Math.random()+"\0",te="\0CLOSE"+Math.random()+"\0",_e="\0COMMA"+Math.random()+"\0",Le="\0PERIOD"+Math.random()+"\0";function Qt(r){return parseInt(r,10)==r?parseInt(r,10):r.charCodeAt(0)}function Is(r){return r.split("\\\\").join(Ne).split("\\{").join(Me).split("\\}").join(te).split("\\,").join(_e).split("\\.").join(Le)}function Ps(r){return r.split(Ne).join("\\").split(Me).join("{").split(te).join("}").split(_e).join(",").split(Le).join(".")}function je(r){if(!r)return[""];var t=[],e=De("{","}",r);if(!e)return r.split(",");var s=e.pre,i=e.body,n=e.post,o=s.split(",");o[o.length-1]+="{"+i+"}";var h=je(n);return n.length&&(o[o.length-1]+=h.shift(),o.push.apply(o,h)),t.push.apply(t,o),t}function $s(r){return r?(r.substr(0,2)==="{}"&&(r="\\{\\}"+r.substr(2)),at(Is(r),!0).map(Ps)):[]}function Ws(r){return"{"+r+"}"}function Bs(r){return/^-?0\d/.test(r)}function Us(r,t){return r<=t}function Gs(r,t){return r>=t}function at(r,t){var e=[],s=De("{","}",r);if(!s)return[r];var i=s.pre,n=s.post.length?at(s.post,!1):[""];if(/\$$/.test(s.pre))for(var o=0;o=0;if(!c&&!f)return s.post.match(/,.*\}/)?(r=s.pre+"{"+s.body+te+s.post,at(r)):[r];var u;if(c)u=s.body.split(/\.\./);else if(u=je(s.body),u.length===1&&(u=at(u[0],!1).map(Ws),u.length===1))return n.map(function(Ct){return s.pre+u[0]+Ct});var d;if(c){var m=Qt(u[0]),p=Qt(u[1]),w=Math.max(u[0].length,u[1].length),g=u.length==3?Math.abs(Qt(u[2])):1,S=Us,b=p0){var kt=new Array(z+1).join("0");E<0?x="-"+kt+x.slice(1):x=kt+x}}d.push(x)}}else{d=[];for(var B=0;B{if(typeof r!="string")throw new TypeError("invalid pattern");if(r.length>65536)throw new TypeError("pattern is too long")};var Hs={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},ct=r=>r.replace(/[[\]\\-]/g,"\\$&"),qs=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Pe=r=>r.join(""),$e=(r,t)=>{let e=t;if(r.charAt(e)!=="[")throw new Error("not in a brace expression");let s=[],i=[],n=e+1,o=!1,h=!1,a=!1,l=!1,c=e,f="";t:for(;nf?s.push(ct(f)+"-"+ct(p)):p===f&&s.push(ct(p)),f="",n++;continue}if(r.startsWith("-]",n+1)){s.push(ct(p+"-")),n+=2;continue}if(r.startsWith("-",n+1)){f=p,n+=2;continue}s.push(ct(p)),n++}if(ct?r.replace(/\[([^\/\\])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var Js=new Set(["!","?","+","*","@"]),We=r=>Js.has(r),Ks="(?!(?:^|/)\\.\\.?(?:$|/))",Ot="(?!\\.)",Vs=new Set(["[","."]),Ys=new Set(["..","."]),Xs=new Set("().*{}+?[]^$\\!"),Zs=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),ee="[^/]",Be=ee+"*?",Ue=ee+"+?",Q=class r{type;#t;#s;#n=!1;#i=[];#h;#l;#f;#a=!1;#o;#e;#m=!1;constructor(t,e,s={}){this.type=t,t&&(this.#s=!0),this.#h=e,this.#t=this.#h?this.#h.#t:this,this.#o=this.#t===this?s:this.#t.#o,this.#f=this.#t===this?[]:this.#t.#f,t==="!"&&!this.#t.#a&&this.#f.push(this),this.#l=this.#h?this.#h.#i.length:0}get hasMagic(){if(this.#s!==void 0)return this.#s;for(let t of this.#i)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#s=!0;return this.#s}toString(){return this.#e!==void 0?this.#e:this.type?this.#e=this.type+"("+this.#i.map(t=>String(t)).join("|")+")":this.#e=this.#i.map(t=>String(t)).join("")}#w(){if(this!==this.#t)throw new Error("should only call on root");if(this.#a)return this;this.toString(),this.#a=!0;let t;for(;t=this.#f.pop();){if(t.type!=="!")continue;let e=t,s=e.#h;for(;s;){for(let i=e.#l+1;!s.type&&itypeof e=="string"?e:e.toJSON()):[this.type,...this.#i.map(e=>e.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#a&&this.#h?.type==="!")&&t.push({}),t}isStart(){if(this.#t===this)return!0;if(!this.#h?.isStart())return!1;if(this.#l===0)return!0;let t=this.#h;for(let e=0;e{let[m,p,w,g]=typeof d=="string"?r.#S(d,this.#s,a):d.toRegExpSource(t);return this.#s=this.#s||w,this.#n=this.#n||g,m}).join(""),c="";if(this.isStart()&&typeof this.#i[0]=="string"&&!(this.#i.length===1&&Ys.has(this.#i[0]))){let m=Vs,p=e&&m.has(l.charAt(0))||l.startsWith("\\.")&&m.has(l.charAt(2))||l.startsWith("\\.\\.")&&m.has(l.charAt(4)),w=!e&&!t&&m.has(l.charAt(0));c=p?Ks:w?Ot:""}let f="";return this.isEnd()&&this.#t.#a&&this.#h?.type==="!"&&(f="(?:$|\\/)"),[c+l+f,I(l),this.#s=!!this.#s,this.#n]}let s=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",n=this.#u(e);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){let a=this.toString();return this.#i=[a],this.type=null,this.#s=void 0,[a,I(this.toString()),!1,!1]}let o=!s||t||e||!Ot?"":this.#u(!0);o===n&&(o=""),o&&(n=`(?:${n})(?:${o})*?`);let h="";if(this.type==="!"&&this.#m)h=(this.isStart()&&!e?Ot:"")+Ue;else{let a=this.type==="!"?"))"+(this.isStart()&&!e&&!t?Ot:"")+Be+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;h=i+n+a}return[h,I(n),this.#s=!!this.#s,this.#n]}#u(t){return this.#i.map(e=>{if(typeof e=="string")throw new Error("string type in extglob ast??");let[s,i,n,o]=e.toRegExpSource(t);return this.#n=this.#n||o,s}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join("|")}static#S(t,e,s=!1){let i=!1,n="",o=!1;for(let h=0;ht?r.replace(/[?*()[\]]/g,"[$&]"):r.replace(/[?*()[\]\\]/g,"\\$&");var F=(r,t,e={})=>(lt(t),!e.nocomment&&t.charAt(0)==="#"?!1:new N(t,e).match(r)),Qs=/^\*+([^+@!?\*\[\(]*)$/,ti=r=>t=>!t.startsWith(".")&&t.endsWith(r),ei=r=>t=>t.endsWith(r),si=r=>(r=r.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(r)),ii=r=>(r=r.toLowerCase(),t=>t.toLowerCase().endsWith(r)),ri=/^\*+\.\*+$/,ni=r=>!r.startsWith(".")&&r.includes("."),oi=r=>r!=="."&&r!==".."&&r.includes("."),hi=/^\.\*+$/,ai=r=>r!=="."&&r!==".."&&r.startsWith("."),li=/^\*+$/,ci=r=>r.length!==0&&!r.startsWith("."),fi=r=>r.length!==0&&r!=="."&&r!=="..",ui=/^\?+([^+@!?\*\[\(]*)?$/,di=([r,t=""])=>{let e=Je([r]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},pi=([r,t=""])=>{let e=Ke([r]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},mi=([r,t=""])=>{let e=Ke([r]);return t?s=>e(s)&&s.endsWith(t):e},gi=([r,t=""])=>{let e=Je([r]);return t?s=>e(s)&&s.endsWith(t):e},Je=([r])=>{let t=r.length;return e=>e.length===t&&!e.startsWith(".")},Ke=([r])=>{let t=r.length;return e=>e.length===t&&e!=="."&&e!==".."},Ve=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Ge={win32:{sep:"\\"},posix:{sep:"/"}},wi=Ve==="win32"?Ge.win32.sep:Ge.posix.sep;F.sep=wi;var k=Symbol("globstar **");F.GLOBSTAR=k;var yi="[^/]",bi=yi+"*?",Si="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Ei="(?:(?!(?:\\/|^)\\.).)*?",vi=(r,t={})=>e=>F(e,r,t);F.filter=vi;var _=(r,t={})=>Object.assign({},r,t),xi=r=>{if(!r||typeof r!="object"||!Object.keys(r).length)return F;let t=F;return Object.assign((s,i,n={})=>t(s,i,_(r,n)),{Minimatch:class extends t.Minimatch{constructor(i,n={}){super(i,_(r,n))}static defaults(i){return t.defaults(_(r,i)).Minimatch}},AST:class extends t.AST{constructor(i,n,o={}){super(i,n,_(r,o))}static fromGlob(i,n={}){return t.AST.fromGlob(i,_(r,n))}},unescape:(s,i={})=>t.unescape(s,_(r,i)),escape:(s,i={})=>t.escape(s,_(r,i)),filter:(s,i={})=>t.filter(s,_(r,i)),defaults:s=>t.defaults(_(r,s)),makeRe:(s,i={})=>t.makeRe(s,_(r,i)),braceExpand:(s,i={})=>t.braceExpand(s,_(r,i)),match:(s,i,n={})=>t.match(s,i,_(r,n)),sep:t.sep,GLOBSTAR:k})};F.defaults=xi;var Ye=(r,t={})=>(lt(r),t.nobrace||!/\{(?:(?!\{).)*\}/.test(r)?[r]:(0,qe.default)(r));F.braceExpand=Ye;var Ti=(r,t={})=>new N(r,t).makeRe();F.makeRe=Ti;var Ai=(r,t,e={})=>{let s=new N(t,e);return r=r.filter(i=>s.match(i)),s.options.nonull&&!r.length&&r.push(t),r};F.match=Ai;var He=/[?*]|[+@!]\(.*?\)|\[|\]/,Ri=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),N=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){lt(t),e=e||{},this.options=e,this.pattern=t,this.platform=e.platform||Ve,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let e of t)if(typeof e!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...n)=>console.error(...n)),this.debug(this.pattern,this.globSet);let s=this.globSet.map(n=>this.slashSplit(n));this.globParts=this.preprocess(s),this.debug(this.pattern,this.globParts);let i=this.globParts.map((n,o,h)=>{if(this.isWindows&&this.windowsNoMagicRoot){let a=n[0]===""&&n[1]===""&&(n[2]==="?"||!He.test(n[2]))&&!He.test(n[3]),l=/^[a-z]:/i.test(n[0]);if(a)return[...n.slice(0,4),...n.slice(4).map(c=>this.parse(c))];if(l)return[n[0],...n.slice(1).map(c=>this.parse(c))]}return n.map(a=>this.parse(a))});if(this.debug(this.pattern,i),this.set=i.filter(n=>n.indexOf(!1)===-1),this.isWindows)for(let n=0;n=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let s=-1;for(;(s=e.indexOf("**",s+1))!==-1;){let i=s;for(;e[i+1]==="**";)i++;i!==s&&e.splice(s,i-s)}return e})}levelOneOptimize(t){return t.map(e=>(e=e.reduce((s,i)=>{let n=s[s.length-1];return i==="**"&&n==="**"?s:i===".."&&n&&n!==".."&&n!=="."&&n!=="**"?(s.pop(),s):(s.push(i),s)},[]),e.length===0?[""]:e))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let i=1;ii&&s.splice(i+1,o-i);let h=s[i+1],a=s[i+2],l=s[i+3];if(h!==".."||!a||a==="."||a===".."||!l||l==="."||l==="..")continue;e=!0,s.splice(i,1);let c=s.slice(0);c[i]="**",t.push(c),i--}if(!this.preserveMultipleSlashes){for(let o=1;oe.length)}partsMatch(t,e,s=!1){let i=0,n=0,o=[],h="";for(;ib?e=e.slice(y):b>y&&(t=t.slice(b)))}}let{optimizationLevel:n=1}=this.options;n>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var o=0,h=0,a=t.length,l=e.length;o>> no match, partial?`,t,u,e,d),u===a))}let p;if(typeof c=="string"?(p=f===c,this.debug("string match",c,f,p)):(p=c.test(f),this.debug("pattern match",c,f,p)),!p)return!1}if(o===a&&h===l)return!0;if(o===a)return s;if(h===l)return o===a-1&&t[o]==="";throw new Error("wtf?")}braceExpand(){return Ye(this.pattern,this.options)}parse(t){lt(t);let e=this.options;if(t==="**")return k;if(t==="")return"";let s,i=null;(s=t.match(li))?i=e.dot?fi:ci:(s=t.match(Qs))?i=(e.nocase?e.dot?ii:si:e.dot?ei:ti)(s[1]):(s=t.match(ui))?i=(e.nocase?e.dot?pi:di:e.dot?mi:gi)(s):(s=t.match(ri))?i=e.dot?oi:ni:(s=t.match(hi))&&(i=ai);let n=Q.fromGlob(t,this.options).toMMPattern();return i&&typeof n=="object"&&Reflect.defineProperty(n,"test",{value:i}),n}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let e=this.options,s=e.noglobstar?bi:e.dot?Si:Ei,i=new Set(e.nocase?["i"]:[]),n=t.map(a=>{let l=a.map(c=>{if(c instanceof RegExp)for(let f of c.flags.split(""))i.add(f);return typeof c=="string"?Ri(c):c===k?k:c._src});return l.forEach((c,f)=>{let u=l[f+1],d=l[f-1];c!==k||d===k||(d===void 0?u!==void 0&&u!==k?l[f+1]="(?:\\/|"+s+"\\/)?"+u:l[f]=s:u===void 0?l[f-1]=d+"(?:\\/|"+s+")?":u!==k&&(l[f-1]=d+"(?:\\/|\\/"+s+"\\/)"+u,l[f+1]=k))}),l.filter(c=>c!==k).join("/")}).join("|"),[o,h]=t.length>1?["(?:",")"]:["",""];n="^"+o+n+h+"$",this.negate&&(n="^(?!"+n+").+$");try{this.regexp=new RegExp(n,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&e)return!0;let s=this.options;this.isWindows&&(t=t.split("\\").join("/"));let i=this.slashSplit(t);this.debug(this.pattern,"split",i);let n=this.set;this.debug(this.pattern,"set",n);let o=i[i.length-1];if(!o)for(let h=i.length-2;!o&&h>=0;h--)o=i[h];for(let h=0;h{typeof se.emitWarning=="function"?se.emitWarning(r,t,e,s):console.error(`[${e}] ${t}: ${r}`)},Ft=globalThis.AbortController,Xe=globalThis.AbortSignal;if(typeof Ft>"u"){Xe=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(s,i){this._onabort.push(i)}},Ft=class{constructor(){t()}signal=new Xe;abort(s){if(!this.signal.aborted){this.signal.reason=s,this.signal.aborted=!0;for(let i of this.signal._onabort)i(s);this.signal.onabort?.(s)}}};let r=se.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{r&&(r=!1,Qe("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}var ki=r=>!Ze.has(r),Vr=Symbol("type"),J=r=>r&&r===Math.floor(r)&&r>0&&isFinite(r),ts=r=>J(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?st:null:null,st=class extends Array{constructor(t){super(t),this.fill(0)}},ie=class r{heap;length;static#t=!1;static create(t){let e=ts(t);if(!e)return[];r.#t=!0;let s=new r(t,e);return r.#t=!1,s}constructor(t,e){if(!r.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},ft=class r{#t;#s;#n;#i;#h;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#f;#a;#o;#e;#m;#w;#d;#u;#S;#g;#A;#R;#E;#b;#C;#p;static unsafeExposeInternals(t){return{starts:t.#R,ttls:t.#E,sizes:t.#A,keyMap:t.#a,keyList:t.#o,valList:t.#e,next:t.#m,prev:t.#w,get head(){return t.#d},get tail(){return t.#u},free:t.#S,isBackgroundFetch:e=>t.#c(e),backgroundFetch:(e,s,i,n)=>t.#_(e,s,i,n),moveToTail:e=>t.#N(e),indexes:e=>t.#T(e),rindexes:e=>t.#O(e),isStale:e=>t.#y(e)}}get max(){return this.#t}get maxSize(){return this.#s}get calculatedSize(){return this.#f}get size(){return this.#l}get fetchMethod(){return this.#h}get dispose(){return this.#n}get disposeAfter(){return this.#i}constructor(t){let{max:e=0,ttl:s,ttlResolution:i=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:h,allowStale:a,dispose:l,disposeAfter:c,noDisposeOnSet:f,noUpdateTTL:u,maxSize:d=0,maxEntrySize:m=0,sizeCalculation:p,fetchMethod:w,noDeleteOnFetchRejection:g,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:y,ignoreFetchAbort:E}=t;if(e!==0&&!J(e))throw new TypeError("max option must be a nonnegative integer");let x=e?ts(e):Array;if(!x)throw new Error("invalid max value: "+e);if(this.#t=e,this.#s=d,this.maxEntrySize=m||this.#s,this.sizeCalculation=p,this.sizeCalculation){if(!this.#s&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(w!==void 0&&typeof w!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#h=w,this.#C=!!w,this.#a=new Map,this.#o=new Array(e).fill(void 0),this.#e=new Array(e).fill(void 0),this.#m=new x(e),this.#w=new x(e),this.#d=0,this.#u=0,this.#S=ie.create(e),this.#l=0,this.#f=0,typeof l=="function"&&(this.#n=l),typeof c=="function"?(this.#i=c,this.#g=[]):(this.#i=void 0,this.#g=void 0),this.#b=!!this.#n,this.#p=!!this.#i,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!u,this.noDeleteOnFetchRejection=!!g,this.allowStaleOnFetchRejection=!!b,this.allowStaleOnFetchAbort=!!y,this.ignoreFetchAbort=!!E,this.maxEntrySize!==0){if(this.#s!==0&&!J(this.#s))throw new TypeError("maxSize must be a positive integer if specified");if(!J(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#D()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!h,this.ttlResolution=J(i)||i===0?i:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!J(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#F()}if(this.#t===0&&this.ttl===0&&this.#s===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#s){let z="LRU_CACHE_UNBOUNDED";ki(z)&&(Ze.add(z),Qe("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",z,r))}}getRemainingTTL(t){return this.#a.has(t)?1/0:0}#F(){let t=new st(this.#t),e=new st(this.#t);this.#E=t,this.#R=e,this.#r=(n,o,h=et.now())=>{if(e[n]=o!==0?h:0,t[n]=o,o!==0&&this.ttlAutopurge){let a=setTimeout(()=>{this.#y(n)&&this.delete(this.#o[n])},o+1);a.unref&&a.unref()}},this.#k=n=>{e[n]=t[n]!==0?et.now():0},this.#v=(n,o)=>{if(t[o]){let h=t[o],a=e[o];if(!h||!a)return;n.ttl=h,n.start=a,n.now=s||i();let l=n.now-a;n.remainingTTL=h-l}};let s=0,i=()=>{let n=et.now();if(this.ttlResolution>0){s=n;let o=setTimeout(()=>s=0,this.ttlResolution);o.unref&&o.unref()}return n};this.getRemainingTTL=n=>{let o=this.#a.get(n);if(o===void 0)return 0;let h=t[o],a=e[o];if(!h||!a)return 1/0;let l=(s||i())-a;return h-l},this.#y=n=>{let o=e[n],h=t[n];return!!h&&!!o&&(s||i())-o>h}}#k=()=>{};#v=()=>{};#r=()=>{};#y=()=>!1;#D(){let t=new st(this.#t);this.#f=0,this.#A=t,this.#x=e=>{this.#f-=t[e],t[e]=0},this.#j=(e,s,i,n)=>{if(this.#c(s))return 0;if(!J(i))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(i=n(s,e),!J(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#L=(e,s,i)=>{if(t[e]=s,this.#s){let n=this.#s-t[e];for(;this.#f>n;)this.#M(!0)}this.#f+=t[e],i&&(i.entrySize=s,i.totalCalculatedSize=this.#f)}}#x=t=>{};#L=(t,e,s)=>{};#j=(t,e,s,i)=>{if(s||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#T({allowStale:t=this.allowStale}={}){if(this.#l)for(let e=this.#u;!(!this.#z(e)||((t||!this.#y(e))&&(yield e),e===this.#d));)e=this.#w[e]}*#O({allowStale:t=this.allowStale}={}){if(this.#l)for(let e=this.#d;!(!this.#z(e)||((t||!this.#y(e))&&(yield e),e===this.#u));)e=this.#m[e]}#z(t){return t!==void 0&&this.#a.get(this.#o[t])===t}*entries(){for(let t of this.#T())this.#e[t]!==void 0&&this.#o[t]!==void 0&&!this.#c(this.#e[t])&&(yield[this.#o[t],this.#e[t]])}*rentries(){for(let t of this.#O())this.#e[t]!==void 0&&this.#o[t]!==void 0&&!this.#c(this.#e[t])&&(yield[this.#o[t],this.#e[t]])}*keys(){for(let t of this.#T()){let e=this.#o[t];e!==void 0&&!this.#c(this.#e[t])&&(yield e)}}*rkeys(){for(let t of this.#O()){let e=this.#o[t];e!==void 0&&!this.#c(this.#e[t])&&(yield e)}}*values(){for(let t of this.#T())this.#e[t]!==void 0&&!this.#c(this.#e[t])&&(yield this.#e[t])}*rvalues(){for(let t of this.#O())this.#e[t]!==void 0&&!this.#c(this.#e[t])&&(yield this.#e[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(let s of this.#T()){let i=this.#e[s],n=this.#c(i)?i.__staleWhileFetching:i;if(n!==void 0&&t(n,this.#o[s],this))return this.get(this.#o[s],e)}}forEach(t,e=this){for(let s of this.#T()){let i=this.#e[s],n=this.#c(i)?i.__staleWhileFetching:i;n!==void 0&&t.call(e,n,this.#o[s],this)}}rforEach(t,e=this){for(let s of this.#O()){let i=this.#e[s],n=this.#c(i)?i.__staleWhileFetching:i;n!==void 0&&t.call(e,n,this.#o[s],this)}}purgeStale(){let t=!1;for(let e of this.#O({allowStale:!0}))this.#y(e)&&(this.delete(this.#o[e]),t=!0);return t}info(t){let e=this.#a.get(t);if(e===void 0)return;let s=this.#e[e],i=this.#c(s)?s.__staleWhileFetching:s;if(i===void 0)return;let n={value:i};if(this.#E&&this.#R){let o=this.#E[e],h=this.#R[e];if(o&&h){let a=o-(et.now()-h);n.ttl=a,n.start=Date.now()}}return this.#A&&(n.size=this.#A[e]),n}dump(){let t=[];for(let e of this.#T({allowStale:!0})){let s=this.#o[e],i=this.#e[e],n=this.#c(i)?i.__staleWhileFetching:i;if(n===void 0||s===void 0)continue;let o={value:n};if(this.#E&&this.#R){o.ttl=this.#E[e];let h=et.now()-this.#R[e];o.start=Math.floor(Date.now()-h)}this.#A&&(o.size=this.#A[e]),t.unshift([s,o])}return t}load(t){this.clear();for(let[e,s]of t){if(s.start){let i=Date.now()-s.start;s.start=et.now()-i}this.set(e,s.value,s)}}set(t,e,s={}){if(e===void 0)return this.delete(t),this;let{ttl:i=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:h=this.sizeCalculation,status:a}=s,{noUpdateTTL:l=this.noUpdateTTL}=s,c=this.#j(t,e,s.size||0,h);if(this.maxEntrySize&&c>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.delete(t),this;let f=this.#l===0?void 0:this.#a.get(t);if(f===void 0)f=this.#l===0?this.#u:this.#S.length!==0?this.#S.pop():this.#l===this.#t?this.#M(!1):this.#l,this.#o[f]=t,this.#e[f]=e,this.#a.set(t,f),this.#m[this.#u]=f,this.#w[f]=this.#u,this.#u=f,this.#l++,this.#L(f,c,a),a&&(a.set="add"),l=!1;else{this.#N(f);let u=this.#e[f];if(e!==u){if(this.#C&&this.#c(u)){u.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:d}=u;d!==void 0&&!o&&(this.#b&&this.#n?.(d,t,"set"),this.#p&&this.#g?.push([d,t,"set"]))}else o||(this.#b&&this.#n?.(u,t,"set"),this.#p&&this.#g?.push([u,t,"set"]));if(this.#x(f),this.#L(f,c,a),this.#e[f]=e,a){a.set="replace";let d=u&&this.#c(u)?u.__staleWhileFetching:u;d!==void 0&&(a.oldValue=d)}}else a&&(a.set="update")}if(i!==0&&!this.#E&&this.#F(),this.#E&&(l||this.#r(f,i,n),a&&this.#v(a,f)),!o&&this.#p&&this.#g){let u=this.#g,d;for(;d=u?.shift();)this.#i?.(...d)}return this}pop(){try{for(;this.#l;){let t=this.#e[this.#d];if(this.#M(!0),this.#c(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#p&&this.#g){let t=this.#g,e;for(;e=t?.shift();)this.#i?.(...e)}}}#M(t){let e=this.#d,s=this.#o[e],i=this.#e[e];return this.#C&&this.#c(i)?i.__abortController.abort(new Error("evicted")):(this.#b||this.#p)&&(this.#b&&this.#n?.(i,s,"evict"),this.#p&&this.#g?.push([i,s,"evict"])),this.#x(e),t&&(this.#o[e]=void 0,this.#e[e]=void 0,this.#S.push(e)),this.#l===1?(this.#d=this.#u=0,this.#S.length=0):this.#d=this.#m[e],this.#a.delete(s),this.#l--,e}has(t,e={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:i}=e,n=this.#a.get(t);if(n!==void 0){let o=this.#e[n];if(this.#c(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#y(n))i&&(i.has="stale",this.#v(i,n));else return s&&this.#k(n),i&&(i.has="hit",this.#v(i,n)),!0}else i&&(i.has="miss");return!1}peek(t,e={}){let{allowStale:s=this.allowStale}=e,i=this.#a.get(t);if(i===void 0||!s&&this.#y(i))return;let n=this.#e[i];return this.#c(n)?n.__staleWhileFetching:n}#_(t,e,s,i){let n=e===void 0?void 0:this.#e[e];if(this.#c(n))return n;let o=new Ft,{signal:h}=s;h?.addEventListener("abort",()=>o.abort(h.reason),{signal:o.signal});let a={signal:o.signal,options:s,context:i},l=(p,w=!1)=>{let{aborted:g}=o.signal,S=s.ignoreFetchAbort&&p!==void 0;if(s.status&&(g&&!w?(s.status.fetchAborted=!0,s.status.fetchError=o.signal.reason,S&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),g&&!S&&!w)return f(o.signal.reason);let b=d;return this.#e[e]===d&&(p===void 0?b.__staleWhileFetching?this.#e[e]=b.__staleWhileFetching:this.delete(t):(s.status&&(s.status.fetchUpdated=!0),this.set(t,p,a.options))),p},c=p=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=p),f(p)),f=p=>{let{aborted:w}=o.signal,g=w&&s.allowStaleOnFetchAbort,S=g||s.allowStaleOnFetchRejection,b=S||s.noDeleteOnFetchRejection,y=d;if(this.#e[e]===d&&(!b||y.__staleWhileFetching===void 0?this.delete(t):g||(this.#e[e]=y.__staleWhileFetching)),S)return s.status&&y.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),y.__staleWhileFetching;if(y.__returned===y)throw p},u=(p,w)=>{let g=this.#h?.(t,n,a);g&&g instanceof Promise&&g.then(S=>p(S===void 0?void 0:S),w),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(p(void 0),s.allowStaleOnFetchAbort&&(p=S=>l(S,!0)))})};s.status&&(s.status.fetchDispatched=!0);let d=new Promise(u).then(l,c),m=Object.assign(d,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.set(t,m,{...a.options,status:void 0}),e=this.#a.get(t)):this.#e[e]=m,m}#c(t){if(!this.#C)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof Ft}async fetch(t,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:a=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:m=this.allowStaleOnFetchAbort,context:p,forceRefresh:w=!1,status:g,signal:S}=e;if(!this.#C)return g&&(g.fetch="get"),this.get(t,{allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:n,status:g});let b={allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:h,size:a,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:m,ignoreFetchAbort:d,status:g,signal:S},y=this.#a.get(t);if(y===void 0){g&&(g.fetch="miss");let E=this.#_(t,y,b,p);return E.__returned=E}else{let E=this.#e[y];if(this.#c(E)){let Ct=s&&E.__staleWhileFetching!==void 0;return g&&(g.fetch="inflight",Ct&&(g.returnedStale=!0)),Ct?E.__staleWhileFetching:E.__returned=E}let x=this.#y(y);if(!w&&!x)return g&&(g.fetch="hit"),this.#N(y),i&&this.#k(y),g&&this.#v(g,y),E;let z=this.#_(t,y,b,p),B=z.__staleWhileFetching!==void 0&&s;return g&&(g.fetch=x?"stale":"refresh",B&&x&&(g.returnedStale=!0)),B?z.__staleWhileFetching:z.__returned=z}}get(t,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=e,h=this.#a.get(t);if(h!==void 0){let a=this.#e[h],l=this.#c(a);return o&&this.#v(o,h),this.#y(h)?(o&&(o.get="stale"),l?(o&&s&&a.__staleWhileFetching!==void 0&&(o.returnedStale=!0),s?a.__staleWhileFetching:void 0):(n||this.delete(t),o&&s&&(o.returnedStale=!0),s?a:void 0)):(o&&(o.get="hit"),l?a.__staleWhileFetching:(this.#N(h),i&&this.#k(h),a))}else o&&(o.get="miss")}#I(t,e){this.#w[e]=t,this.#m[t]=e}#N(t){t!==this.#u&&(t===this.#d?this.#d=this.#m[t]:this.#I(this.#w[t],this.#m[t]),this.#I(this.#u,t),this.#u=t)}delete(t){let e=!1;if(this.#l!==0){let s=this.#a.get(t);if(s!==void 0)if(e=!0,this.#l===1)this.clear();else{this.#x(s);let i=this.#e[s];if(this.#c(i)?i.__abortController.abort(new Error("deleted")):(this.#b||this.#p)&&(this.#b&&this.#n?.(i,t,"delete"),this.#p&&this.#g?.push([i,t,"delete"])),this.#a.delete(t),this.#o[s]=void 0,this.#e[s]=void 0,s===this.#u)this.#u=this.#w[s];else if(s===this.#d)this.#d=this.#m[s];else{let n=this.#w[s];this.#m[n]=this.#m[s];let o=this.#m[s];this.#w[o]=this.#w[s]}this.#l--,this.#S.push(s)}}if(this.#p&&this.#g?.length){let s=this.#g,i;for(;i=s?.shift();)this.#i?.(...i)}return e}clear(){for(let t of this.#O({allowStale:!0})){let e=this.#e[t];if(this.#c(e))e.__abortController.abort(new Error("deleted"));else{let s=this.#o[t];this.#b&&this.#n?.(e,s,"delete"),this.#p&&this.#g?.push([e,s,"delete"])}}if(this.#a.clear(),this.#e.fill(void 0),this.#o.fill(void 0),this.#E&&this.#R&&(this.#E.fill(0),this.#R.fill(0)),this.#A&&this.#A.fill(0),this.#d=0,this.#u=0,this.#S.length=0,this.#f=0,this.#l=0,this.#p&&this.#g){let t=this.#g,e;for(;e=t?.shift();)this.#i?.(...e)}}};import{posix as Ii,win32 as de}from"path";import{fileURLToPath as Pi}from"url";import*as $i from"fs";import{lstatSync as Wi,readdir as Bi,readdirSync as Ui,readlinkSync as Gi,realpathSync as Hi}from"fs";import{lstat as Ji,readdir as Ki,readlink as Vi,realpath as Yi}from"fs/promises";import{EventEmitter as ce}from"events";import ns from"stream";import{StringDecoder as Ci}from"string_decoder";var es=typeof process=="object"&&process?process:{stdout:null,stderr:null},Oi=r=>!!r&&typeof r=="object"&&(r instanceof V||r instanceof ns||Fi(r)||Di(r)),Fi=r=>!!r&&typeof r=="object"&&r instanceof ce&&typeof r.pipe=="function"&&r.pipe!==ns.Writable.prototype.pipe,Di=r=>!!r&&typeof r=="object"&&r instanceof ce&&typeof r.write=="function"&&typeof r.end=="function",H=Symbol("EOF"),q=Symbol("maybeEmitEnd"),K=Symbol("emittedEnd"),Dt=Symbol("emittingEnd"),ut=Symbol("emittedError"),Mt=Symbol("closed"),ss=Symbol("read"),Nt=Symbol("flush"),is=Symbol("flushChunk"),P=Symbol("encoding"),it=Symbol("decoder"),T=Symbol("flowing"),dt=Symbol("paused"),rt=Symbol("resume"),A=Symbol("buffer"),D=Symbol("pipes"),R=Symbol("bufferLength"),re=Symbol("bufferPush"),_t=Symbol("bufferShift"),C=Symbol("objectMode"),v=Symbol("destroyed"),ne=Symbol("error"),oe=Symbol("emitData"),rs=Symbol("emitEnd"),he=Symbol("emitEnd2"),U=Symbol("async"),ae=Symbol("abort"),Lt=Symbol("aborted"),pt=Symbol("signal"),X=Symbol("dataListeners"),N=Symbol("discarded"),mt=r=>Promise.resolve().then(r),Mi=r=>r(),Ni=r=>r==="end"||r==="finish"||r==="prefinish",_i=r=>r instanceof ArrayBuffer||!!r&&typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,Li=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),jt=class{src;dest;opts;ondrain;constructor(t,e,s){this.src=t,this.dest=e,this.opts=s,this.ondrain=()=>t[rt](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},le=class extends jt{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,e,s){super(t,e,s),this.proxyErrors=i=>e.emit("error",i),t.on("error",this.proxyErrors)}},ji=r=>!!r.objectMode,zi=r=>!r.objectMode&&!!r.encoding&&r.encoding!=="buffer",V=class extends ce{[T]=!1;[dt]=!1;[D]=[];[A]=[];[C];[P];[U];[it];[H]=!1;[K]=!1;[Dt]=!1;[Mt]=!1;[ut]=null;[R]=0;[v]=!1;[pt];[Lt]=!1;[X]=0;[N]=!1;writable=!0;readable=!0;constructor(...t){let e=t[0]||{};if(super(),e.objectMode&&typeof e.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");ji(e)?(this[C]=!0,this[P]=null):zi(e)?(this[P]=e.encoding,this[C]=!1):(this[C]=!1,this[P]=null),this[U]=!!e.async,this[it]=this[P]?new Ci(this[P]):null,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[A]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[D]});let{signal:s}=e;s&&(this[pt]=s,s.aborted?this[ae]():s.addEventListener("abort",()=>this[ae]()))}get bufferLength(){return this[R]}get encoding(){return this[P]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[C]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[U]}set async(t){this[U]=this[U]||!!t}[ae](){this[Lt]=!0,this.emit("abort",this[pt]?.reason),this.destroy(this[pt]?.reason)}get aborted(){return this[Lt]}set aborted(t){}write(t,e,s){if(this[Lt])return!1;if(this[H])throw new Error("write after end");if(this[v])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof e=="function"&&(s=e,e="utf8"),e||(e="utf8");let i=this[U]?mt:Mi;if(!this[C]&&!Buffer.isBuffer(t)){if(Li(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(_i(t))t=Buffer.from(t);else if(typeof t!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[C]?(this[T]&&this[R]!==0&&this[Nt](!0),this[T]?this.emit("data",t):this[re](t),this[R]!==0&&this.emit("readable"),s&&i(s),this[T]):t.length?(typeof t=="string"&&!(e===this[P]&&!this[it]?.lastNeed)&&(t=Buffer.from(t,e)),Buffer.isBuffer(t)&&this[P]&&(t=this[it].write(t)),this[T]&&this[R]!==0&&this[Nt](!0),this[T]?this.emit("data",t):this[re](t),this[R]!==0&&this.emit("readable"),s&&i(s),this[T]):(this[R]!==0&&this.emit("readable"),s&&i(s),this[T])}read(t){if(this[v])return null;if(this[N]=!1,this[R]===0||t===0||t&&t>this[R])return this[q](),null;this[C]&&(t=null),this[A].length>1&&!this[C]&&(this[A]=[this[P]?this[A].join(""):Buffer.concat(this[A],this[R])]);let e=this[ss](t||null,this[A][0]);return this[q](),e}[ss](t,e){if(this[C])this[_t]();else{let s=e;t===s.length||t===null?this[_t]():typeof s=="string"?(this[A][0]=s.slice(t),e=s.slice(0,t),this[R]-=t):(this[A][0]=s.subarray(t),e=s.subarray(0,t),this[R]-=t)}return this.emit("data",e),!this[A].length&&!this[H]&&this.emit("drain"),e}end(t,e,s){return typeof t=="function"&&(s=t,t=void 0),typeof e=="function"&&(s=e,e="utf8"),t!==void 0&&this.write(t,e),s&&this.once("end",s),this[H]=!0,this.writable=!1,(this[T]||!this[dt])&&this[q](),this}[rt](){this[v]||(!this[X]&&!this[D].length&&(this[N]=!0),this[dt]=!1,this[T]=!0,this.emit("resume"),this[A].length?this[Nt]():this[H]?this[q]():this.emit("drain"))}resume(){return this[rt]()}pause(){this[T]=!1,this[dt]=!0,this[N]=!1}get destroyed(){return this[v]}get flowing(){return this[T]}get paused(){return this[dt]}[re](t){this[C]?this[R]+=1:this[R]+=t.length,this[A].push(t)}[_t](){return this[C]?this[R]-=1:this[R]-=this[A][0].length,this[A].shift()}[Nt](t=!1){do;while(this[is](this[_t]())&&this[A].length);!t&&!this[A].length&&!this[H]&&this.emit("drain")}[is](t){return this.emit("data",t),this[T]}pipe(t,e){if(this[v])return t;this[N]=!1;let s=this[K];return e=e||{},t===es.stdout||t===es.stderr?e.end=!1:e.end=e.end!==!1,e.proxyErrors=!!e.proxyErrors,s?e.end&&t.end():(this[D].push(e.proxyErrors?new le(this,t,e):new jt(this,t,e)),this[U]?mt(()=>this[rt]()):this[rt]()),t}unpipe(t){let e=this[D].find(s=>s.dest===t);e&&(this[D].length===1?(this[T]&&this[X]===0&&(this[T]=!1),this[D]=[]):this[D].splice(this[D].indexOf(e),1),e.unpipe())}addListener(t,e){return this.on(t,e)}on(t,e){let s=super.on(t,e);if(t==="data")this[N]=!1,this[X]++,!this[D].length&&!this[T]&&this[rt]();else if(t==="readable"&&this[R]!==0)super.emit("readable");else if(Ni(t)&&this[K])super.emit(t),this.removeAllListeners(t);else if(t==="error"&&this[ut]){let i=e;this[U]?mt(()=>i.call(this,this[ut])):i.call(this,this[ut])}return s}removeListener(t,e){return this.off(t,e)}off(t,e){let s=super.off(t,e);return t==="data"&&(this[X]=this.listeners("data").length,this[X]===0&&!this[N]&&!this[D].length&&(this[T]=!1)),s}removeAllListeners(t){let e=super.removeAllListeners(t);return(t==="data"||t===void 0)&&(this[X]=0,!this[N]&&!this[D].length&&(this[T]=!1)),e}get emittedEnd(){return this[K]}[q](){!this[Dt]&&!this[K]&&!this[v]&&this[A].length===0&&this[H]&&(this[Dt]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Mt]&&this.emit("close"),this[Dt]=!1)}emit(t,...e){let s=e[0];if(t!=="error"&&t!=="close"&&t!==v&&this[v])return!1;if(t==="data")return!this[C]&&!s?!1:this[U]?(mt(()=>this[oe](s)),!0):this[oe](s);if(t==="end")return this[rs]();if(t==="close"){if(this[Mt]=!0,!this[K]&&!this[v])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(t==="error"){this[ut]=s,super.emit(ne,s);let n=!this[pt]||this.listeners("error").length?super.emit("error",s):!1;return this[q](),n}else if(t==="resume"){let n=super.emit("resume");return this[q](),n}else if(t==="finish"||t==="prefinish"){let n=super.emit(t);return this.removeAllListeners(t),n}let i=super.emit(t,...e);return this[q](),i}[oe](t){for(let s of this[D])s.dest.write(t)===!1&&this.pause();let e=this[N]?!1:super.emit("data",t);return this[q](),e}[rs](){return this[K]?!1:(this[K]=!0,this.readable=!1,this[U]?(mt(()=>this[he]()),!0):this[he]())}[he](){if(this[it]){let e=this[it].end();if(e){for(let s of this[D])s.dest.write(e);this[N]||super.emit("data",e)}}for(let e of this[D])e.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[C]||(t.dataLength=0);let e=this.promise();return this.on("data",s=>{t.push(s),this[C]||(t.dataLength+=s.length)}),await e,t}async concat(){if(this[C])throw new Error("cannot concat in objectMode");let t=await this.collect();return this[P]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,e)=>{this.on(v,()=>e(new Error("stream destroyed"))),this.on("error",s=>e(s)),this.on("end",()=>t())})}[Symbol.asyncIterator](){this[N]=!1;let t=!1,e=async()=>(this.pause(),t=!0,{value:void 0,done:!0});return{next:()=>{if(t)return e();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[H])return e();let n,o,h=f=>{this.off("data",a),this.off("end",l),this.off(v,c),e(),o(f)},a=f=>{this.off("error",h),this.off("end",l),this.off(v,c),this.pause(),n({value:f,done:!!this[H]})},l=()=>{this.off("error",h),this.off("data",a),this.off(v,c),e(),n({done:!0,value:void 0})},c=()=>h(new Error("stream destroyed"));return new Promise((f,u)=>{o=u,n=f,this.once(v,c),this.once("error",h),this.once("end",l),this.once("data",a)})},throw:e,return:e,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[N]=!1;let t=!1,e=()=>(this.pause(),this.off(ne,e),this.off(v,e),this.off("end",e),t=!0,{done:!0,value:void 0}),s=()=>{if(t)return e();let i=this.read();return i===null?e():{done:!1,value:i}};return this.once("end",e),this.once(ne,e),this.once(v,e),{next:s,throw:e,return:e,[Symbol.iterator](){return this}}}destroy(t){if(this[v])return t?this.emit("error",t):this.emit(v),this;this[v]=!0,this[N]=!0,this[A].length=0,this[R]=0;let e=this;return typeof e.close=="function"&&!this[Mt]&&e.close(),t?this.emit("error",t):this.emit(v),this}static get isStream(){return Oi}};var qi=Hi.native,wt={lstatSync:Wi,readdir:Bi,readdirSync:Ui,readlinkSync:Gi,realpathSync:qi,promises:{lstat:Ji,readdir:Ki,readlink:Vi,realpath:Yi}},cs=r=>!r||r===wt||r===$i?wt:{...wt,...r,promises:{...wt.promises,...r.promises||{}}},fs=/^\\\\\?\\([a-z]:)\\?$/i,Xi=r=>r.replace(/\//g,"\\").replace(fs,"$1\\"),Zi=/[\\\/]/,j=0,us=1,ds=2,G=4,ps=6,ms=8,Z=10,gs=12,L=15,gt=~L,fe=16,os=32,yt=64,$=128,zt=256,Pt=512,hs=yt|$|Pt,Qi=1023,ue=r=>r.isFile()?ms:r.isDirectory()?G:r.isSymbolicLink()?Z:r.isCharacterDevice()?ds:r.isBlockDevice()?ps:r.isSocket()?gs:r.isFIFO()?us:j,as=new Map,bt=r=>{let t=as.get(r);if(t)return t;let e=r.normalize("NFKD");return as.set(r,e),e},ls=new Map,It=r=>{let t=ls.get(r);if(t)return t;let e=bt(r.toLowerCase());return ls.set(r,e),e},$t=class extends ft{constructor(){super({max:256})}},pe=class extends ft{constructor(t=16*1024){super({maxSize:t,sizeCalculation:e=>e.length+1})}},ws=Symbol("PathScurry setAsCwd"),O=class{name;root;roots;parent;nocase;#t;#s;get dev(){return this.#s}#n;get mode(){return this.#n}#i;get nlink(){return this.#i}#h;get uid(){return this.#h}#l;get gid(){return this.#l}#f;get rdev(){return this.#f}#a;get blksize(){return this.#a}#o;get ino(){return this.#o}#e;get size(){return this.#e}#m;get blocks(){return this.#m}#w;get atimeMs(){return this.#w}#d;get mtimeMs(){return this.#d}#u;get ctimeMs(){return this.#u}#S;get birthtimeMs(){return this.#S}#g;get atime(){return this.#g}#A;get mtime(){return this.#A}#R;get ctime(){return this.#R}#E;get birthtime(){return this.#E}#b;#C;#p;#F;#k;#v;#r;#y;#D;#x;get path(){return(this.parent||this).fullpath()}constructor(t,e=j,s,i,n,o,h){this.name=t,this.#b=n?It(t):bt(t),this.#r=e&Qi,this.nocase=n,this.roots=i,this.root=s||this,this.#y=o,this.#p=h.fullpath,this.#k=h.relative,this.#v=h.relativePosix,this.parent=h.parent,this.parent?this.#t=this.parent.#t:this.#t=cs(h.fs)}depth(){return this.#C!==void 0?this.#C:this.parent?this.#C=this.parent.depth()+1:this.#C=0}childrenCache(){return this.#y}resolve(t){if(!t)return this;let e=this.getRootString(t),i=t.substring(e.length).split(this.splitSep);return e?this.getRoot(e).#L(i):this.#L(i)}#L(t){let e=this;for(let s of t)e=e.child(s);return e}children(){let t=this.#y.get(this);if(t)return t;let e=Object.assign([],{provisional:0});return this.#y.set(this,e),this.#r&=~fe,e}child(t,e){if(t===""||t===".")return this;if(t==="..")return this.parent||this;let s=this.children(),i=this.nocase?It(t):bt(t);for(let a of s)if(a.#b===i)return a;let n=this.parent?this.sep:"",o=this.#p?this.#p+n+t:void 0,h=this.newChild(t,j,{...e,parent:this,fullpath:o});return this.canReaddir()||(h.#r|=$),s.push(h),h}relative(){if(this.#k!==void 0)return this.#k;let t=this.name,e=this.parent;if(!e)return this.#k=this.name;let s=e.relative();return s+(!s||!e.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.#v!==void 0)return this.#v;let t=this.name,e=this.parent;if(!e)return this.#v=this.fullpathPosix();let s=e.relativePosix();return s+(!s||!e.parent?"":"/")+t}fullpath(){if(this.#p!==void 0)return this.#p;let t=this.name,e=this.parent;if(!e)return this.#p=this.name;let i=e.fullpath()+(e.parent?this.sep:"")+t;return this.#p=i}fullpathPosix(){if(this.#F!==void 0)return this.#F;if(this.sep==="/")return this.#F=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#F=`//?/${i}`:this.#F=i}let t=this.parent,e=t.fullpathPosix(),s=e+(!e||!t.parent?"":"/")+this.name;return this.#F=s}isUnknown(){return(this.#r&L)===j}isType(t){return this[`is${t}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#r&L)===ms}isDirectory(){return(this.#r&L)===G}isCharacterDevice(){return(this.#r&L)===ds}isBlockDevice(){return(this.#r&L)===ps}isFIFO(){return(this.#r&L)===us}isSocket(){return(this.#r&L)===gs}isSymbolicLink(){return(this.#r&Z)===Z}lstatCached(){return this.#r&os?this:void 0}readlinkCached(){return this.#D}realpathCached(){return this.#x}readdirCached(){let t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(this.#D)return!0;if(!this.parent)return!1;let t=this.#r&L;return!(t!==j&&t!==Z||this.#r&zt||this.#r&$)}calledReaddir(){return!!(this.#r&fe)}isENOENT(){return!!(this.#r&$)}isNamed(t){return this.nocase?this.#b===It(t):this.#b===bt(t)}async readlink(){let t=this.#D;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=await this.#t.promises.readlink(this.fullpath()),s=(await this.parent.realpath())?.resolve(e);if(s)return this.#D=s}catch(e){this.#I(e.code);return}}readlinkSync(){let t=this.#D;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=this.#t.readlinkSync(this.fullpath()),s=this.parent.realpathSync()?.resolve(e);if(s)return this.#D=s}catch(e){this.#I(e.code);return}}#j(t){this.#r|=fe;for(let e=t.provisional;es(null,t))}readdirCB(t,e=!1){if(!this.canReaddir()){e?t(null,[]):queueMicrotask(()=>t(null,[]));return}let s=this.children();if(this.calledReaddir()){let n=s.slice(0,s.provisional);e?t(null,n):queueMicrotask(()=>t(null,n));return}if(this.#$.push(t),this.#W)return;this.#W=!0;let i=this.fullpath();this.#t.readdir(i,{withFileTypes:!0},(n,o)=>{if(n)this.#_(n.code),s.provisional=0;else{for(let h of o)this.#N(h,s);this.#j(s)}this.#q(s.slice(0,s.provisional))})}#P;async readdir(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();if(this.#P)await this.#P;else{let s=()=>{};this.#P=new Promise(i=>s=i);try{for(let i of await this.#t.promises.readdir(e,{withFileTypes:!0}))this.#N(i,t);this.#j(t)}catch(i){this.#_(i.code),t.provisional=0}this.#P=void 0,s()}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();try{for(let s of this.#t.readdirSync(e,{withFileTypes:!0}))this.#N(s,t);this.#j(t)}catch(s){this.#_(s.code),t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(this.#r&hs)return!1;let t=L&this.#r;return t===j||t===G||t===Z}shouldWalk(t,e){return(this.#r&G)===G&&!(this.#r&hs)&&!t.has(this)&&(!e||e(this))}async realpath(){if(this.#x)return this.#x;if(!((Pt|zt|$)&this.#r))try{let t=await this.#t.promises.realpath(this.fullpath());return this.#x=this.resolve(t)}catch{this.#z()}}realpathSync(){if(this.#x)return this.#x;if(!((Pt|zt|$)&this.#r))try{let t=this.#t.realpathSync(this.fullpath());return this.#x=this.resolve(t)}catch{this.#z()}}[ws](t){if(t===this)return;let e=new Set([]),s=[],i=this;for(;i&&i.parent;)e.add(i),i.#k=s.join(this.sep),i.#v=s.join("/"),i=i.parent,s.push("..");for(i=t;i&&i.parent&&!e.has(i);)i.#k=void 0,i.#v=void 0,i=i.parent}},Wt=class r extends O{sep="\\";splitSep=Zi;constructor(t,e=j,s,i,n,o,h){super(t,e,s,i,n,o,h)}newChild(t,e=j,s={}){return new r(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}getRootString(t){return de.parse(t).root}getRoot(t){if(t=Xi(t.toUpperCase()),t===this.root.name)return this.root;for(let[e,s]of Object.entries(this.roots))if(this.sameRoot(t,e))return this.roots[t]=s;return this.roots[t]=new nt(t,this).root}sameRoot(t,e=this.root.name){return t=t.toUpperCase().replace(/\//g,"\\").replace(fs,"$1\\"),t===e}},Bt=class r extends O{splitSep="/";sep="/";constructor(t,e=j,s,i,n,o,h){super(t,e,s,i,n,o,h)}getRootString(t){return t.startsWith("/")?"/":""}getRoot(t){return this.root}newChild(t,e=j,s={}){return new r(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}},Ut=class{root;rootPath;roots;cwd;#t;#s;#n;nocase;#i;constructor(t=process.cwd(),e,s,{nocase:i,childrenCacheSize:n=16*1024,fs:o=wt}={}){this.#i=cs(o),(t instanceof URL||t.startsWith("file://"))&&(t=Pi(t));let h=e.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(h),this.#t=new $t,this.#s=new $t,this.#n=new pe(n);let a=h.substring(this.rootPath.length).split(s);if(a.length===1&&!a[0]&&a.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#i),this.roots[this.rootPath]=this.root;let l=this.root,c=a.length-1,f=e.sep,u=this.rootPath,d=!1;for(let m of a){let p=c--;l=l.child(m,{relative:new Array(p).fill("..").join(f),relativePosix:new Array(p).fill("..").join("/"),fullpath:u+=(d?"":f)+m}),d=!0}this.cwd=l}depth(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return this.#n}resolve(...t){let e="";for(let n=t.length-1;n>=0;n--){let o=t[n];if(!(!o||o===".")&&(e=e?`${o}/${e}`:o,this.isAbsolute(o)))break}let s=this.#t.get(e);if(s!==void 0)return s;let i=this.cwd.resolve(e).fullpath();return this.#t.set(e,i),i}resolvePosix(...t){let e="";for(let n=t.length-1;n>=0;n--){let o=t[n];if(!(!o||o===".")&&(e=e?`${o}/${e}`:o,this.isAbsolute(o)))break}let s=this.#s.get(e);if(s!==void 0)return s;let i=this.cwd.resolve(e).fullpathPosix();return this.#s.set(e,i),i}relative(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relative()}relativePosix(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relativePosix()}basename(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.name}dirname(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),(t.parent||t).fullpath()}async readdir(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof O||(e=t,t=this.cwd);let{withFileTypes:s}=e;if(t.canReaddir()){let i=await t.readdir();return s?i:i.map(n=>n.name)}else return[]}readdirSync(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof O||(e=t,t=this.cwd);let{withFileTypes:s=!0}=e;return t.canReaddir()?s?t.readdirSync():t.readdirSync().map(i=>i.name):[]}async lstat(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstat()}lstatSync(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof O||(e=t.withFileTypes,t=this.cwd);let s=await t.readlink();return e?s:s?.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof O||(e=t.withFileTypes,t=this.cwd);let s=t.readlinkSync();return e?s:s?.fullpath()}async realpath(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof O||(e=t.withFileTypes,t=this.cwd);let s=await t.realpath();return e?s:s?.fullpath()}realpathSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof O||(e=t.withFileTypes,t=this.cwd);let s=t.realpathSync();return e?s:s?.fullpath()}async walk(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof O||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=e,h=[];(!n||n(t))&&h.push(s?t:t.fullpath());let a=new Set,l=(f,u)=>{a.add(f),f.readdirCB((d,m)=>{if(d)return u(d);let p=m.length;if(!p)return u();let w=()=>{--p===0&&u()};for(let g of m)(!n||n(g))&&h.push(s?g:g.fullpath()),i&&g.isSymbolicLink()?g.realpath().then(S=>S?.isUnknown()?S.lstat():S).then(S=>S?.shouldWalk(a,o)?l(S,w):w()):g.shouldWalk(a,o)?l(g,w):w()},!0)},c=t;return new Promise((f,u)=>{l(c,d=>{if(d)return u(d);f(h)})})}walkSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof O||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=e,h=[];(!n||n(t))&&h.push(s?t:t.fullpath());let a=new Set([t]);for(let l of a){let c=l.readdirSync();for(let f of c){(!n||n(f))&&h.push(s?f:f.fullpath());let u=f;if(f.isSymbolicLink()){if(!(i&&(u=f.realpathSync())))continue;u.isUnknown()&&u.lstatSync()}u.shouldWalk(a,o)&&a.add(u)}}return h}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,e={}){return typeof t=="string"?t=this.cwd.resolve(t):t instanceof O||(e=t,t=this.cwd),this.stream(t,e)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof O||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=e;(!n||n(t))&&(yield s?t:t.fullpath());let h=new Set([t]);for(let a of h){let l=a.readdirSync();for(let c of l){(!n||n(c))&&(yield s?c:c.fullpath());let f=c;if(c.isSymbolicLink()){if(!(i&&(f=c.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(h,o)&&h.add(f)}}}stream(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof O||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=e,h=new V({objectMode:!0});(!n||n(t))&&h.write(s?t:t.fullpath());let a=new Set,l=[t],c=0,f=()=>{let u=!1;for(;!u;){let d=l.shift();if(!d){c===0&&h.end();return}c++,a.add(d);let m=(w,g,S=!1)=>{if(w)return h.emit("error",w);if(i&&!S){let b=[];for(let y of g)y.isSymbolicLink()&&b.push(y.realpath().then(E=>E?.isUnknown()?E.lstat():E));if(b.length){Promise.all(b).then(()=>m(null,g,!0));return}}for(let b of g)b&&(!n||n(b))&&(h.write(s?b:b.fullpath())||(u=!0));c--;for(let b of g){let y=b.realpathCached()||b;y.shouldWalk(a,o)&&l.push(y)}u&&!h.flowing?h.once("drain",f):p||f()},p=!0;d.readdirCB(m,!0),p=!1}};return f(),h}streamSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof O||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=e,h=new V({objectMode:!0}),a=new Set;(!n||n(t))&&h.write(s?t:t.fullpath());let l=[t],c=0,f=()=>{let u=!1;for(;!u;){let d=l.shift();if(!d){c===0&&h.end();return}c++,a.add(d);let m=d.readdirSync();for(let p of m)(!n||n(p))&&(h.write(s?p:p.fullpath())||(u=!0));c--;for(let p of m){let w=p;if(p.isSymbolicLink()){if(!(i&&(w=p.realpathSync())))continue;w.isUnknown()&&w.lstatSync()}w.shouldWalk(a,o)&&l.push(w)}}u&&!h.flowing&&h.once("drain",f)};return f(),h}chdir(t=this.cwd){let e=this.cwd;this.cwd=typeof t=="string"?this.cwd.resolve(t):t,this.cwd[ws](e)}},nt=class extends Ut{sep="\\";constructor(t=process.cwd(),e={}){let{nocase:s=!0}=e;super(t,de,"\\",{...e,nocase:s}),this.nocase=s;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(t){return de.parse(t).root.toUpperCase()}newRoot(t){return new Wt(this.rootPath,G,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}},ot=class extends Ut{sep="/";constructor(t=process.cwd(),e={}){let{nocase:s=!1}=e;super(t,Ii,"/",{...e,nocase:s}),this.nocase=s}parseRootPath(t){return"/"}newRoot(t){return new Bt(this.rootPath,G,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}},St=class extends ot{constructor(t=process.cwd(),e={}){let{nocase:s=!0}=e;super(t,{...e,nocase:s})}},an=process.platform==="win32"?Wt:Bt,ys=process.platform==="win32"?nt:process.platform==="darwin"?St:ot;import{fileURLToPath as rr}from"url";var tr=r=>r.length>=1,er=r=>r.length>=1,ht=class r{#t;#s;#n;length;#i;#h;#l;#f;#a;#o;#e=!0;constructor(t,e,s,i){if(!tr(t))throw new TypeError("empty pattern list");if(!er(e))throw new TypeError("empty glob list");if(e.length!==t.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=t.length,s<0||s>=this.length)throw new TypeError("index out of range");if(this.#t=t,this.#s=e,this.#n=s,this.#i=i,this.#n===0){if(this.isUNC()){let[n,o,h,a,...l]=this.#t,[c,f,u,d,...m]=this.#s;l[0]===""&&(l.shift(),m.shift());let p=[n,o,h,a,""].join("/"),w=[c,f,u,d,""].join("/");this.#t=[p,...l],this.#s=[w,...m],this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){let[n,...o]=this.#t,[h,...a]=this.#s;o[0]===""&&(o.shift(),a.shift());let l=n+"/",c=h+"/";this.#t=[l,...o],this.#s=[c,...a],this.length=this.#t.length}}}pattern(){return this.#t[this.#n]}isString(){return typeof this.#t[this.#n]=="string"}isGlobstar(){return this.#t[this.#n]===k}isRegExp(){return this.#t[this.#n]instanceof RegExp}globString(){return this.#l=this.#l||(this.#n===0?this.isAbsolute()?this.#s[0]+this.#s.slice(1).join("/"):this.#s.join("/"):this.#s.slice(this.#n).join("/"))}hasMore(){return this.length>this.#n+1}rest(){return this.#h!==void 0?this.#h:this.hasMore()?(this.#h=new r(this.#t,this.#s,this.#n+1,this.#i),this.#h.#o=this.#o,this.#h.#a=this.#a,this.#h.#f=this.#f,this.#h):this.#h=null}isUNC(){let t=this.#t;return this.#a!==void 0?this.#a:this.#a=this.#i==="win32"&&this.#n===0&&t[0]===""&&t[1]===""&&typeof t[2]=="string"&&!!t[2]&&typeof t[3]=="string"&&!!t[3]}isDrive(){let t=this.#t;return this.#f!==void 0?this.#f:this.#f=this.#i==="win32"&&this.#n===0&&this.length>1&&typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0])}isAbsolute(){let t=this.#t;return this.#o!==void 0?this.#o:this.#o=t[0]===""&&t.length>1||this.isDrive()||this.isUNC()}root(){let t=this.#t[0];return typeof t=="string"&&this.isAbsolute()&&this.#n===0?t:""}checkFollowGlobstar(){return!(this.#n===0||!this.isGlobstar()||!this.#e)}markFollowGlobstar(){return this.#n===0||!this.isGlobstar()||!this.#e?!1:(this.#e=!1,!0)}};var sr=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Et=class{relative;relativeChildren;absolute;absoluteChildren;constructor(t,{nobrace:e,nocase:s,noext:i,noglobstar:n,platform:o=sr}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[];let h={dot:!0,nobrace:e,nocase:s,noext:i,noglobstar:n,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of t){let l=new M(a,h);for(let c=0;c[t,!!(e&2),!!(e&1)])}},we=class{store=new Map;add(t,e){if(!t.canReaddir())return;let s=this.store.get(t);s?s.find(i=>i.globString()===e.globString())||s.push(e):this.store.set(t,[e])}get(t){let e=this.store.get(t);if(!e)throw new Error("attempting to walk unknown path");return e}entries(){return this.keys().map(t=>[t,this.store.get(t)])}keys(){return[...this.store.keys()].filter(t=>t.canReaddir())}},vt=class r{hasWalkedCache;matches=new ge;subwalks=new we;patterns;follow;dot;opts;constructor(t,e){this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=e?e.copy():new me}processPatterns(t,e){this.patterns=e;let s=e.map(i=>[t,i]);for(let[i,n]of s){this.hasWalkedCache.storeWalked(i,n);let o=n.root(),h=n.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let f=n.rest();if(f)n=f;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let a,l,c=!1;for(;typeof(a=n.pattern())=="string"&&(l=n.rest());)i=i.resolve(a),n=l,c=!0;if(a=n.pattern(),l=n.rest(),c){if(this.hasWalkedCache.hasWalked(i,n))continue;this.hasWalkedCache.storeWalked(i,n)}if(typeof a=="string"){let f=a===".."||a===""||a===".";this.matches.add(i.resolve(a),h,f);continue}else if(a===k){(!i.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(i,n);let f=l?.pattern(),u=l?.rest();if(!l||(f===""||f===".")&&!u)this.matches.add(i,h,f===""||f===".");else if(f===".."){let d=i.parent||i;u?this.hasWalkedCache.hasWalked(d,u)||this.subwalks.add(d,u):this.matches.add(d,h,!0)}}else a instanceof RegExp&&this.subwalks.add(i,n)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new r(this.opts,this.hasWalkedCache)}filterEntries(t,e){let s=this.subwalks.get(t),i=this.child();for(let n of e)for(let o of s){let h=o.isAbsolute(),a=o.pattern(),l=o.rest();a===k?i.testGlobstar(n,o,l,h):a instanceof RegExp?i.testRegExp(n,a,l,h):i.testString(n,a,l,h)}return i}testGlobstar(t,e,s,i){if((this.dot||!t.name.startsWith("."))&&(e.hasMore()||this.matches.add(t,i,!1),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,e):t.isSymbolicLink()&&(s&&e.checkFollowGlobstar()?this.subwalks.add(t,s):e.markFollowGlobstar()&&this.subwalks.add(t,e)))),s){let n=s.pattern();if(typeof n=="string"&&n!==".."&&n!==""&&n!==".")this.testString(t,n,s.rest(),i);else if(n===".."){let o=t.parent||t;this.subwalks.add(o,s)}else n instanceof RegExp&&this.testRegExp(t,n,s.rest(),i)}}testRegExp(t,e,s,i){e.test(t.name)&&(s?this.subwalks.add(t,s):this.matches.add(t,i,!1))}testString(t,e,s,i){t.isNamed(e)&&(s?this.subwalks.add(t,s):this.matches.add(t,i,!1))}};var ir=(r,t)=>typeof r=="string"?new Et([r],t):Array.isArray(r)?new Et(r,t):r,Gt=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#t=[];#s;#n;signal;maxDepth;constructor(t,e,s){this.patterns=t,this.path=e,this.opts=s,this.#n=!s.posix&&s.platform==="win32"?"\\":"/",s.ignore&&(this.#s=ir(s.ignore,s)),this.maxDepth=s.maxDepth||1/0,s.signal&&(this.signal=s.signal,this.signal.addEventListener("abort",()=>{this.#t.length=0}))}#i(t){return this.seen.has(t)||!!this.#s?.ignored?.(t)}#h(t){return!!this.#s?.childrenIgnored?.(t)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let t;for(;!this.paused&&(t=this.#t.shift());)t()}onResume(t){this.signal?.aborted||(this.paused?this.#t.push(t):t())}async matchCheck(t,e){if(e&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=t.realpathCached()||await t.realpath(),!s)return;t=s}let n=t.isUnknown()||this.opts.stat?await t.lstat():t;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let o=await n.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(n,e)}matchCheckTest(t,e){return t&&(this.maxDepth===1/0||t.depth()<=this.maxDepth)&&(!e||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!t.realpathCached()?.isDirectory())&&!this.#i(t)?t:void 0}matchCheckSync(t,e){if(e&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=t.realpathCached()||t.realpathSync(),!s)return;t=s}let n=t.isUnknown()||this.opts.stat?t.lstatSync():t;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let o=n.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(n,e)}matchFinish(t,e){if(this.#i(t))return;let s=this.opts.absolute===void 0?e:this.opts.absolute;this.seen.add(t);let i=this.opts.mark&&t.isDirectory()?this.#n:"";if(this.opts.withFileTypes)this.matchEmit(t);else if(s){let n=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(n+i)}else{let n=this.opts.posix?t.relativePosix():t.relative(),o=this.opts.dotRelative&&!n.startsWith(".."+this.#n)?"."+this.#n:"";this.matchEmit(n?o+n+i:"."+i)}}async match(t,e,s){let i=await this.matchCheck(t,s);i&&this.matchFinish(i,e)}matchSync(t,e,s){let i=this.matchCheckSync(t,s);i&&this.matchFinish(i,e)}walkCB(t,e,s){this.signal?.aborted&&s(),this.walkCB2(t,e,new vt(this.opts),s)}walkCB2(t,e,s,i){if(this.#h(t))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(t,e,s,i));return}s.processPatterns(t,e);let n=1,o=()=>{--n===0&&i()};for(let[h,a,l]of s.matches.entries())this.#i(h)||(n++,this.match(h,a,l).then(()=>o()));for(let h of s.subwalkTargets()){if(this.maxDepth!==1/0&&h.depth()>=this.maxDepth)continue;n++;let a=h.readdirCached();h.calledReaddir()?this.walkCB3(h,a,s,o):h.readdirCB((l,c)=>this.walkCB3(h,c,s,o),!0)}o()}walkCB3(t,e,s,i){s=s.filterEntries(t,e);let n=1,o=()=>{--n===0&&i()};for(let[h,a,l]of s.matches.entries())this.#i(h)||(n++,this.match(h,a,l).then(()=>o()));for(let[h,a]of s.subwalks.entries())n++,this.walkCB2(h,a,s.child(),o);o()}walkCBSync(t,e,s){this.signal?.aborted&&s(),this.walkCB2Sync(t,e,new vt(this.opts),s)}walkCB2Sync(t,e,s,i){if(this.#h(t))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(t,e,s,i));return}s.processPatterns(t,e);let n=1,o=()=>{--n===0&&i()};for(let[h,a,l]of s.matches.entries())this.#i(h)||this.matchSync(h,a,l);for(let h of s.subwalkTargets()){if(this.maxDepth!==1/0&&h.depth()>=this.maxDepth)continue;n++;let a=h.readdirSync();this.walkCB3Sync(h,a,s,o)}o()}walkCB3Sync(t,e,s,i){s=s.filterEntries(t,e);let n=1,o=()=>{--n===0&&i()};for(let[h,a,l]of s.matches.entries())this.#i(h)||this.matchSync(h,a,l);for(let[h,a]of s.subwalks.entries())n++,this.walkCB2Sync(h,a,s.child(),o);o()}},xt=class extends Gt{matches;constructor(t,e,s){super(t,e,s),this.matches=new Set}matchEmit(t){this.matches.add(t)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((t,e)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?e(this.signal.reason):t(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},Tt=class extends Gt{results;constructor(t,e,s){super(t,e,s),this.results=new V({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(t){this.results.write(t),this.results.flowing||this.pause()}stream(){let t=this.path;return t.isUnknown()?t.lstat().then(()=>{this.walkCB(t,this.patterns,()=>this.results.end())}):this.walkCB(t,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var nr=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",W=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;opts;patterns;constructor(t,e){if(!e)throw new TypeError("glob options required");if(this.withFileTypes=!!e.withFileTypes,this.signal=e.signal,this.follow=!!e.follow,this.dot=!!e.dot,this.dotRelative=!!e.dotRelative,this.nodir=!!e.nodir,this.mark=!!e.mark,e.cwd?(e.cwd instanceof URL||e.cwd.startsWith("file://"))&&(e.cwd=rr(e.cwd)):this.cwd="",this.cwd=e.cwd||"",this.root=e.root,this.magicalBraces=!!e.magicalBraces,this.nobrace=!!e.nobrace,this.noext=!!e.noext,this.realpath=!!e.realpath,this.absolute=e.absolute,this.noglobstar=!!e.noglobstar,this.matchBase=!!e.matchBase,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:1/0,this.stat=!!e.stat,this.ignore=e.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof t=="string"&&(t=[t]),this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(t=t.map(a=>a.replace(/\\/g,"/"))),this.matchBase){if(e.noglobstar)throw new TypeError("base matching requires globstar");t=t.map(a=>a.includes("/")?a:`./**/${a}`)}if(this.pattern=t,this.platform=e.platform||nr,this.opts={...e,platform:this.platform},e.scurry){if(this.scurry=e.scurry,e.nocase!==void 0&&e.nocase!==e.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let a=e.platform==="win32"?nt:e.platform==="darwin"?St:e.platform?ot:ys;this.scurry=new a(this.cwd,{nocase:e.nocase,fs:e.fs})}this.nocase=this.scurry.nocase;let s=this.platform==="darwin"||this.platform==="win32",i={...e,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:s,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},n=this.pattern.map(a=>new M(a,i)),[o,h]=n.reduce((a,l)=>(a[0].push(...l.set),a[1].push(...l.globParts),a),[[],[]]);this.patterns=o.map((a,l)=>{let c=h[l];if(!c)throw new Error("invalid pattern object");return new ht(a,c,0,this.platform)})}async walk(){return[...await new xt(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase}).walk()]}walkSync(){return[...new xt(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase}).walkSync()]}stream(){return new Tt(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase}).stream()}streamSync(){return new Tt(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var ye=(r,t={})=>{Array.isArray(r)||(r=[r]);for(let e of r)if(new M(e,t).hasMagic())return!0;return!1};function Ht(r,t={}){return new W(r,t).streamSync()}function Es(r,t={}){return new W(r,t).stream()}function qt(r,t={}){return new W(r,t).walkSync()}async function bs(r,t={}){return new W(r,t).walk()}function Jt(r,t={}){return new W(r,t).iterateSync()}function vs(r,t={}){return new W(r,t).iterate()}var or=Ht,hr=Object.assign(Es,{sync:Ht}),ar=Jt,lr=Object.assign(vs,{sync:Jt}),cr=Object.assign(qt,{stream:Ht,iterate:Jt}),Ss=Object.assign(bs,{glob:bs,globSync:qt,sync:cr,globStream:Es,stream:hr,globStreamSync:Ht,streamSync:or,globIterate:vs,iterate:lr,globIterateSync:Jt,iterateSync:ar,Glob:W,hasMagic:ye,escape:tt,unescape:I});Ss.glob=Ss;import fr from"node:fs";function xs(r){return JSON.parse(fr.readFileSync(r).toString("utf-8"))}function Kt(r){return xs(r)}function be(r){return xs(r)}function Y(r){return(process.env[`INPUT_${r.toUpperCase()}`]||"").trim()}function Ts(r){let t=ur(r);Vt.mkdirSync(Yt.join(At.cwd(),r.analyzerDirectory),{recursive:!0});let e=Yt.join(At.cwd(),r.analyzerDirectory,"bundle_analysis.json");Vt.writeFileSync(e,JSON.stringify(t,null,2)),Xt.log(`Wrote ${e}`)}function Se(r){return r.metafiles.flatMap(t=>qt(Yt.join(At.cwd(),t),{nodir:!0}).map(e=>({relativePath:Yt.relative(At.cwd(),e),absolutePath:e})))}function ur(r){let t={};return Se(r).reduce((e,{relativePath:s,absolutePath:i})=>{try{Vt.accessSync(i,Vt.constants.R_OK)}catch{Xt.error(`No meta file found at "${i}" - a path to meta file may be wrong, or esbuild is not executed.`),At.exit(1)}let n=Kt(i);return Object.entries(n.outputs).reduce((o,h)=>{let[a,l]=h;return r.includeExtensions.some(c=>a.toLowerCase().endsWith(c))&&(o[`${s} -> ${a}`]={bytes:l.bytes,metafile:s,outfile:a}),o},e),e},t)}function ks(r){let t=!1,e=`## \u{1F4E6} esbuild Bundle Analysis for ${r.name} +>>> no match, partial?`,t,u,e,d),u===a))}let p;if(typeof c=="string"?(p=f===c,this.debug("string match",c,f,p)):(p=c.test(f),this.debug("pattern match",c,f,p)),!p)return!1}if(o===a&&h===l)return!0;if(o===a)return s;if(h===l)return o===a-1&&t[o]==="";throw new Error("wtf?")}braceExpand(){return Ye(this.pattern,this.options)}parse(t){lt(t);let e=this.options;if(t==="**")return k;if(t==="")return"";let s,i=null;(s=t.match(li))?i=e.dot?fi:ci:(s=t.match(Qs))?i=(e.nocase?e.dot?ii:si:e.dot?ei:ti)(s[1]):(s=t.match(ui))?i=(e.nocase?e.dot?pi:di:e.dot?mi:gi)(s):(s=t.match(ri))?i=e.dot?oi:ni:(s=t.match(hi))&&(i=ai);let n=Q.fromGlob(t,this.options).toMMPattern();return i&&typeof n=="object"&&Reflect.defineProperty(n,"test",{value:i}),n}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let e=this.options,s=e.noglobstar?bi:e.dot?Si:Ei,i=new Set(e.nocase?["i"]:[]),n=t.map(a=>{let l=a.map(c=>{if(c instanceof RegExp)for(let f of c.flags.split(""))i.add(f);return typeof c=="string"?Ri(c):c===k?k:c._src});return l.forEach((c,f)=>{let u=l[f+1],d=l[f-1];c!==k||d===k||(d===void 0?u!==void 0&&u!==k?l[f+1]="(?:\\/|"+s+"\\/)?"+u:l[f]=s:u===void 0?l[f-1]=d+"(?:\\/|"+s+")?":u!==k&&(l[f-1]=d+"(?:\\/|\\/"+s+"\\/)"+u,l[f+1]=k))}),l.filter(c=>c!==k).join("/")}).join("|"),[o,h]=t.length>1?["(?:",")"]:["",""];n="^"+o+n+h+"$",this.negate&&(n="^(?!"+n+").+$");try{this.regexp=new RegExp(n,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&e)return!0;let s=this.options;this.isWindows&&(t=t.split("\\").join("/"));let i=this.slashSplit(t);this.debug(this.pattern,"split",i);let n=this.set;this.debug(this.pattern,"set",n);let o=i[i.length-1];if(!o)for(let h=i.length-2;!o&&h>=0;h--)o=i[h];for(let h=0;h{typeof se.emitWarning=="function"?se.emitWarning(r,t,e,s):console.error(`[${e}] ${t}: ${r}`)},Ft=globalThis.AbortController,Xe=globalThis.AbortSignal;if(typeof Ft>"u"){Xe=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(s,i){this._onabort.push(i)}},Ft=class{constructor(){t()}signal=new Xe;abort(s){if(!this.signal.aborted){this.signal.reason=s,this.signal.aborted=!0;for(let i of this.signal._onabort)i(s);this.signal.onabort?.(s)}}};let r=se.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{r&&(r=!1,Qe("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}var ki=r=>!Ze.has(r),Vr=Symbol("type"),J=r=>r&&r===Math.floor(r)&&r>0&&isFinite(r),ts=r=>J(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?st:null:null,st=class extends Array{constructor(t){super(t),this.fill(0)}},ie=class r{heap;length;static#t=!1;static create(t){let e=ts(t);if(!e)return[];r.#t=!0;let s=new r(t,e);return r.#t=!1,s}constructor(t,e){if(!r.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},ft=class r{#t;#s;#n;#i;#h;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#f;#a;#o;#e;#m;#w;#d;#u;#S;#g;#A;#R;#E;#b;#C;#p;static unsafeExposeInternals(t){return{starts:t.#R,ttls:t.#E,sizes:t.#A,keyMap:t.#a,keyList:t.#o,valList:t.#e,next:t.#m,prev:t.#w,get head(){return t.#d},get tail(){return t.#u},free:t.#S,isBackgroundFetch:e=>t.#c(e),backgroundFetch:(e,s,i,n)=>t.#_(e,s,i,n),moveToTail:e=>t.#M(e),indexes:e=>t.#T(e),rindexes:e=>t.#O(e),isStale:e=>t.#y(e)}}get max(){return this.#t}get maxSize(){return this.#s}get calculatedSize(){return this.#f}get size(){return this.#l}get fetchMethod(){return this.#h}get dispose(){return this.#n}get disposeAfter(){return this.#i}constructor(t){let{max:e=0,ttl:s,ttlResolution:i=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:h,allowStale:a,dispose:l,disposeAfter:c,noDisposeOnSet:f,noUpdateTTL:u,maxSize:d=0,maxEntrySize:m=0,sizeCalculation:p,fetchMethod:w,noDeleteOnFetchRejection:g,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:y,ignoreFetchAbort:E}=t;if(e!==0&&!J(e))throw new TypeError("max option must be a nonnegative integer");let x=e?ts(e):Array;if(!x)throw new Error("invalid max value: "+e);if(this.#t=e,this.#s=d,this.maxEntrySize=m||this.#s,this.sizeCalculation=p,this.sizeCalculation){if(!this.#s&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(w!==void 0&&typeof w!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#h=w,this.#C=!!w,this.#a=new Map,this.#o=new Array(e).fill(void 0),this.#e=new Array(e).fill(void 0),this.#m=new x(e),this.#w=new x(e),this.#d=0,this.#u=0,this.#S=ie.create(e),this.#l=0,this.#f=0,typeof l=="function"&&(this.#n=l),typeof c=="function"?(this.#i=c,this.#g=[]):(this.#i=void 0,this.#g=void 0),this.#b=!!this.#n,this.#p=!!this.#i,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!u,this.noDeleteOnFetchRejection=!!g,this.allowStaleOnFetchRejection=!!b,this.allowStaleOnFetchAbort=!!y,this.ignoreFetchAbort=!!E,this.maxEntrySize!==0){if(this.#s!==0&&!J(this.#s))throw new TypeError("maxSize must be a positive integer if specified");if(!J(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#D()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!h,this.ttlResolution=J(i)||i===0?i:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!J(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#F()}if(this.#t===0&&this.ttl===0&&this.#s===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#s){let z="LRU_CACHE_UNBOUNDED";ki(z)&&(Ze.add(z),Qe("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",z,r))}}getRemainingTTL(t){return this.#a.has(t)?1/0:0}#F(){let t=new st(this.#t),e=new st(this.#t);this.#E=t,this.#R=e,this.#r=(n,o,h=et.now())=>{if(e[n]=o!==0?h:0,t[n]=o,o!==0&&this.ttlAutopurge){let a=setTimeout(()=>{this.#y(n)&&this.delete(this.#o[n])},o+1);a.unref&&a.unref()}},this.#k=n=>{e[n]=t[n]!==0?et.now():0},this.#v=(n,o)=>{if(t[o]){let h=t[o],a=e[o];if(!h||!a)return;n.ttl=h,n.start=a,n.now=s||i();let l=n.now-a;n.remainingTTL=h-l}};let s=0,i=()=>{let n=et.now();if(this.ttlResolution>0){s=n;let o=setTimeout(()=>s=0,this.ttlResolution);o.unref&&o.unref()}return n};this.getRemainingTTL=n=>{let o=this.#a.get(n);if(o===void 0)return 0;let h=t[o],a=e[o];if(!h||!a)return 1/0;let l=(s||i())-a;return h-l},this.#y=n=>{let o=e[n],h=t[n];return!!h&&!!o&&(s||i())-o>h}}#k=()=>{};#v=()=>{};#r=()=>{};#y=()=>!1;#D(){let t=new st(this.#t);this.#f=0,this.#A=t,this.#x=e=>{this.#f-=t[e],t[e]=0},this.#j=(e,s,i,n)=>{if(this.#c(s))return 0;if(!J(i))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(i=n(s,e),!J(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#L=(e,s,i)=>{if(t[e]=s,this.#s){let n=this.#s-t[e];for(;this.#f>n;)this.#N(!0)}this.#f+=t[e],i&&(i.entrySize=s,i.totalCalculatedSize=this.#f)}}#x=t=>{};#L=(t,e,s)=>{};#j=(t,e,s,i)=>{if(s||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#T({allowStale:t=this.allowStale}={}){if(this.#l)for(let e=this.#u;!(!this.#z(e)||((t||!this.#y(e))&&(yield e),e===this.#d));)e=this.#w[e]}*#O({allowStale:t=this.allowStale}={}){if(this.#l)for(let e=this.#d;!(!this.#z(e)||((t||!this.#y(e))&&(yield e),e===this.#u));)e=this.#m[e]}#z(t){return t!==void 0&&this.#a.get(this.#o[t])===t}*entries(){for(let t of this.#T())this.#e[t]!==void 0&&this.#o[t]!==void 0&&!this.#c(this.#e[t])&&(yield[this.#o[t],this.#e[t]])}*rentries(){for(let t of this.#O())this.#e[t]!==void 0&&this.#o[t]!==void 0&&!this.#c(this.#e[t])&&(yield[this.#o[t],this.#e[t]])}*keys(){for(let t of this.#T()){let e=this.#o[t];e!==void 0&&!this.#c(this.#e[t])&&(yield e)}}*rkeys(){for(let t of this.#O()){let e=this.#o[t];e!==void 0&&!this.#c(this.#e[t])&&(yield e)}}*values(){for(let t of this.#T())this.#e[t]!==void 0&&!this.#c(this.#e[t])&&(yield this.#e[t])}*rvalues(){for(let t of this.#O())this.#e[t]!==void 0&&!this.#c(this.#e[t])&&(yield this.#e[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(let s of this.#T()){let i=this.#e[s],n=this.#c(i)?i.__staleWhileFetching:i;if(n!==void 0&&t(n,this.#o[s],this))return this.get(this.#o[s],e)}}forEach(t,e=this){for(let s of this.#T()){let i=this.#e[s],n=this.#c(i)?i.__staleWhileFetching:i;n!==void 0&&t.call(e,n,this.#o[s],this)}}rforEach(t,e=this){for(let s of this.#O()){let i=this.#e[s],n=this.#c(i)?i.__staleWhileFetching:i;n!==void 0&&t.call(e,n,this.#o[s],this)}}purgeStale(){let t=!1;for(let e of this.#O({allowStale:!0}))this.#y(e)&&(this.delete(this.#o[e]),t=!0);return t}info(t){let e=this.#a.get(t);if(e===void 0)return;let s=this.#e[e],i=this.#c(s)?s.__staleWhileFetching:s;if(i===void 0)return;let n={value:i};if(this.#E&&this.#R){let o=this.#E[e],h=this.#R[e];if(o&&h){let a=o-(et.now()-h);n.ttl=a,n.start=Date.now()}}return this.#A&&(n.size=this.#A[e]),n}dump(){let t=[];for(let e of this.#T({allowStale:!0})){let s=this.#o[e],i=this.#e[e],n=this.#c(i)?i.__staleWhileFetching:i;if(n===void 0||s===void 0)continue;let o={value:n};if(this.#E&&this.#R){o.ttl=this.#E[e];let h=et.now()-this.#R[e];o.start=Math.floor(Date.now()-h)}this.#A&&(o.size=this.#A[e]),t.unshift([s,o])}return t}load(t){this.clear();for(let[e,s]of t){if(s.start){let i=Date.now()-s.start;s.start=et.now()-i}this.set(e,s.value,s)}}set(t,e,s={}){if(e===void 0)return this.delete(t),this;let{ttl:i=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:h=this.sizeCalculation,status:a}=s,{noUpdateTTL:l=this.noUpdateTTL}=s,c=this.#j(t,e,s.size||0,h);if(this.maxEntrySize&&c>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.delete(t),this;let f=this.#l===0?void 0:this.#a.get(t);if(f===void 0)f=this.#l===0?this.#u:this.#S.length!==0?this.#S.pop():this.#l===this.#t?this.#N(!1):this.#l,this.#o[f]=t,this.#e[f]=e,this.#a.set(t,f),this.#m[this.#u]=f,this.#w[f]=this.#u,this.#u=f,this.#l++,this.#L(f,c,a),a&&(a.set="add"),l=!1;else{this.#M(f);let u=this.#e[f];if(e!==u){if(this.#C&&this.#c(u)){u.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:d}=u;d!==void 0&&!o&&(this.#b&&this.#n?.(d,t,"set"),this.#p&&this.#g?.push([d,t,"set"]))}else o||(this.#b&&this.#n?.(u,t,"set"),this.#p&&this.#g?.push([u,t,"set"]));if(this.#x(f),this.#L(f,c,a),this.#e[f]=e,a){a.set="replace";let d=u&&this.#c(u)?u.__staleWhileFetching:u;d!==void 0&&(a.oldValue=d)}}else a&&(a.set="update")}if(i!==0&&!this.#E&&this.#F(),this.#E&&(l||this.#r(f,i,n),a&&this.#v(a,f)),!o&&this.#p&&this.#g){let u=this.#g,d;for(;d=u?.shift();)this.#i?.(...d)}return this}pop(){try{for(;this.#l;){let t=this.#e[this.#d];if(this.#N(!0),this.#c(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#p&&this.#g){let t=this.#g,e;for(;e=t?.shift();)this.#i?.(...e)}}}#N(t){let e=this.#d,s=this.#o[e],i=this.#e[e];return this.#C&&this.#c(i)?i.__abortController.abort(new Error("evicted")):(this.#b||this.#p)&&(this.#b&&this.#n?.(i,s,"evict"),this.#p&&this.#g?.push([i,s,"evict"])),this.#x(e),t&&(this.#o[e]=void 0,this.#e[e]=void 0,this.#S.push(e)),this.#l===1?(this.#d=this.#u=0,this.#S.length=0):this.#d=this.#m[e],this.#a.delete(s),this.#l--,e}has(t,e={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:i}=e,n=this.#a.get(t);if(n!==void 0){let o=this.#e[n];if(this.#c(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#y(n))i&&(i.has="stale",this.#v(i,n));else return s&&this.#k(n),i&&(i.has="hit",this.#v(i,n)),!0}else i&&(i.has="miss");return!1}peek(t,e={}){let{allowStale:s=this.allowStale}=e,i=this.#a.get(t);if(i===void 0||!s&&this.#y(i))return;let n=this.#e[i];return this.#c(n)?n.__staleWhileFetching:n}#_(t,e,s,i){let n=e===void 0?void 0:this.#e[e];if(this.#c(n))return n;let o=new Ft,{signal:h}=s;h?.addEventListener("abort",()=>o.abort(h.reason),{signal:o.signal});let a={signal:o.signal,options:s,context:i},l=(p,w=!1)=>{let{aborted:g}=o.signal,S=s.ignoreFetchAbort&&p!==void 0;if(s.status&&(g&&!w?(s.status.fetchAborted=!0,s.status.fetchError=o.signal.reason,S&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),g&&!S&&!w)return f(o.signal.reason);let b=d;return this.#e[e]===d&&(p===void 0?b.__staleWhileFetching?this.#e[e]=b.__staleWhileFetching:this.delete(t):(s.status&&(s.status.fetchUpdated=!0),this.set(t,p,a.options))),p},c=p=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=p),f(p)),f=p=>{let{aborted:w}=o.signal,g=w&&s.allowStaleOnFetchAbort,S=g||s.allowStaleOnFetchRejection,b=S||s.noDeleteOnFetchRejection,y=d;if(this.#e[e]===d&&(!b||y.__staleWhileFetching===void 0?this.delete(t):g||(this.#e[e]=y.__staleWhileFetching)),S)return s.status&&y.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),y.__staleWhileFetching;if(y.__returned===y)throw p},u=(p,w)=>{let g=this.#h?.(t,n,a);g&&g instanceof Promise&&g.then(S=>p(S===void 0?void 0:S),w),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(p(void 0),s.allowStaleOnFetchAbort&&(p=S=>l(S,!0)))})};s.status&&(s.status.fetchDispatched=!0);let d=new Promise(u).then(l,c),m=Object.assign(d,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.set(t,m,{...a.options,status:void 0}),e=this.#a.get(t)):this.#e[e]=m,m}#c(t){if(!this.#C)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof Ft}async fetch(t,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:a=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:m=this.allowStaleOnFetchAbort,context:p,forceRefresh:w=!1,status:g,signal:S}=e;if(!this.#C)return g&&(g.fetch="get"),this.get(t,{allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:n,status:g});let b={allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:h,size:a,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:m,ignoreFetchAbort:d,status:g,signal:S},y=this.#a.get(t);if(y===void 0){g&&(g.fetch="miss");let E=this.#_(t,y,b,p);return E.__returned=E}else{let E=this.#e[y];if(this.#c(E)){let Ct=s&&E.__staleWhileFetching!==void 0;return g&&(g.fetch="inflight",Ct&&(g.returnedStale=!0)),Ct?E.__staleWhileFetching:E.__returned=E}let x=this.#y(y);if(!w&&!x)return g&&(g.fetch="hit"),this.#M(y),i&&this.#k(y),g&&this.#v(g,y),E;let z=this.#_(t,y,b,p),B=z.__staleWhileFetching!==void 0&&s;return g&&(g.fetch=x?"stale":"refresh",B&&x&&(g.returnedStale=!0)),B?z.__staleWhileFetching:z.__returned=z}}get(t,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=e,h=this.#a.get(t);if(h!==void 0){let a=this.#e[h],l=this.#c(a);return o&&this.#v(o,h),this.#y(h)?(o&&(o.get="stale"),l?(o&&s&&a.__staleWhileFetching!==void 0&&(o.returnedStale=!0),s?a.__staleWhileFetching:void 0):(n||this.delete(t),o&&s&&(o.returnedStale=!0),s?a:void 0)):(o&&(o.get="hit"),l?a.__staleWhileFetching:(this.#M(h),i&&this.#k(h),a))}else o&&(o.get="miss")}#I(t,e){this.#w[e]=t,this.#m[t]=e}#M(t){t!==this.#u&&(t===this.#d?this.#d=this.#m[t]:this.#I(this.#w[t],this.#m[t]),this.#I(this.#u,t),this.#u=t)}delete(t){let e=!1;if(this.#l!==0){let s=this.#a.get(t);if(s!==void 0)if(e=!0,this.#l===1)this.clear();else{this.#x(s);let i=this.#e[s];if(this.#c(i)?i.__abortController.abort(new Error("deleted")):(this.#b||this.#p)&&(this.#b&&this.#n?.(i,t,"delete"),this.#p&&this.#g?.push([i,t,"delete"])),this.#a.delete(t),this.#o[s]=void 0,this.#e[s]=void 0,s===this.#u)this.#u=this.#w[s];else if(s===this.#d)this.#d=this.#m[s];else{let n=this.#w[s];this.#m[n]=this.#m[s];let o=this.#m[s];this.#w[o]=this.#w[s]}this.#l--,this.#S.push(s)}}if(this.#p&&this.#g?.length){let s=this.#g,i;for(;i=s?.shift();)this.#i?.(...i)}return e}clear(){for(let t of this.#O({allowStale:!0})){let e=this.#e[t];if(this.#c(e))e.__abortController.abort(new Error("deleted"));else{let s=this.#o[t];this.#b&&this.#n?.(e,s,"delete"),this.#p&&this.#g?.push([e,s,"delete"])}}if(this.#a.clear(),this.#e.fill(void 0),this.#o.fill(void 0),this.#E&&this.#R&&(this.#E.fill(0),this.#R.fill(0)),this.#A&&this.#A.fill(0),this.#d=0,this.#u=0,this.#S.length=0,this.#f=0,this.#l=0,this.#p&&this.#g){let t=this.#g,e;for(;e=t?.shift();)this.#i?.(...e)}}};import{posix as Ii,win32 as de}from"path";import{fileURLToPath as Pi}from"url";import*as $i from"fs";import{lstatSync as Wi,readdir as Bi,readdirSync as Ui,readlinkSync as Gi,realpathSync as Hi}from"fs";import{lstat as Ji,readdir as Ki,readlink as Vi,realpath as Yi}from"fs/promises";import{EventEmitter as ce}from"events";import ns from"stream";import{StringDecoder as Ci}from"string_decoder";var es=typeof process=="object"&&process?process:{stdout:null,stderr:null},Oi=r=>!!r&&typeof r=="object"&&(r instanceof V||r instanceof ns||Fi(r)||Di(r)),Fi=r=>!!r&&typeof r=="object"&&r instanceof ce&&typeof r.pipe=="function"&&r.pipe!==ns.Writable.prototype.pipe,Di=r=>!!r&&typeof r=="object"&&r instanceof ce&&typeof r.write=="function"&&typeof r.end=="function",H=Symbol("EOF"),q=Symbol("maybeEmitEnd"),K=Symbol("emittedEnd"),Dt=Symbol("emittingEnd"),ut=Symbol("emittedError"),Nt=Symbol("closed"),ss=Symbol("read"),Mt=Symbol("flush"),is=Symbol("flushChunk"),P=Symbol("encoding"),it=Symbol("decoder"),T=Symbol("flowing"),dt=Symbol("paused"),rt=Symbol("resume"),A=Symbol("buffer"),D=Symbol("pipes"),R=Symbol("bufferLength"),re=Symbol("bufferPush"),_t=Symbol("bufferShift"),C=Symbol("objectMode"),v=Symbol("destroyed"),ne=Symbol("error"),oe=Symbol("emitData"),rs=Symbol("emitEnd"),he=Symbol("emitEnd2"),U=Symbol("async"),ae=Symbol("abort"),Lt=Symbol("aborted"),pt=Symbol("signal"),X=Symbol("dataListeners"),M=Symbol("discarded"),mt=r=>Promise.resolve().then(r),Ni=r=>r(),Mi=r=>r==="end"||r==="finish"||r==="prefinish",_i=r=>r instanceof ArrayBuffer||!!r&&typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,Li=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),jt=class{src;dest;opts;ondrain;constructor(t,e,s){this.src=t,this.dest=e,this.opts=s,this.ondrain=()=>t[rt](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},le=class extends jt{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,e,s){super(t,e,s),this.proxyErrors=i=>e.emit("error",i),t.on("error",this.proxyErrors)}},ji=r=>!!r.objectMode,zi=r=>!r.objectMode&&!!r.encoding&&r.encoding!=="buffer",V=class extends ce{[T]=!1;[dt]=!1;[D]=[];[A]=[];[C];[P];[U];[it];[H]=!1;[K]=!1;[Dt]=!1;[Nt]=!1;[ut]=null;[R]=0;[v]=!1;[pt];[Lt]=!1;[X]=0;[M]=!1;writable=!0;readable=!0;constructor(...t){let e=t[0]||{};if(super(),e.objectMode&&typeof e.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");ji(e)?(this[C]=!0,this[P]=null):zi(e)?(this[P]=e.encoding,this[C]=!1):(this[C]=!1,this[P]=null),this[U]=!!e.async,this[it]=this[P]?new Ci(this[P]):null,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[A]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[D]});let{signal:s}=e;s&&(this[pt]=s,s.aborted?this[ae]():s.addEventListener("abort",()=>this[ae]()))}get bufferLength(){return this[R]}get encoding(){return this[P]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[C]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[U]}set async(t){this[U]=this[U]||!!t}[ae](){this[Lt]=!0,this.emit("abort",this[pt]?.reason),this.destroy(this[pt]?.reason)}get aborted(){return this[Lt]}set aborted(t){}write(t,e,s){if(this[Lt])return!1;if(this[H])throw new Error("write after end");if(this[v])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof e=="function"&&(s=e,e="utf8"),e||(e="utf8");let i=this[U]?mt:Ni;if(!this[C]&&!Buffer.isBuffer(t)){if(Li(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(_i(t))t=Buffer.from(t);else if(typeof t!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[C]?(this[T]&&this[R]!==0&&this[Mt](!0),this[T]?this.emit("data",t):this[re](t),this[R]!==0&&this.emit("readable"),s&&i(s),this[T]):t.length?(typeof t=="string"&&!(e===this[P]&&!this[it]?.lastNeed)&&(t=Buffer.from(t,e)),Buffer.isBuffer(t)&&this[P]&&(t=this[it].write(t)),this[T]&&this[R]!==0&&this[Mt](!0),this[T]?this.emit("data",t):this[re](t),this[R]!==0&&this.emit("readable"),s&&i(s),this[T]):(this[R]!==0&&this.emit("readable"),s&&i(s),this[T])}read(t){if(this[v])return null;if(this[M]=!1,this[R]===0||t===0||t&&t>this[R])return this[q](),null;this[C]&&(t=null),this[A].length>1&&!this[C]&&(this[A]=[this[P]?this[A].join(""):Buffer.concat(this[A],this[R])]);let e=this[ss](t||null,this[A][0]);return this[q](),e}[ss](t,e){if(this[C])this[_t]();else{let s=e;t===s.length||t===null?this[_t]():typeof s=="string"?(this[A][0]=s.slice(t),e=s.slice(0,t),this[R]-=t):(this[A][0]=s.subarray(t),e=s.subarray(0,t),this[R]-=t)}return this.emit("data",e),!this[A].length&&!this[H]&&this.emit("drain"),e}end(t,e,s){return typeof t=="function"&&(s=t,t=void 0),typeof e=="function"&&(s=e,e="utf8"),t!==void 0&&this.write(t,e),s&&this.once("end",s),this[H]=!0,this.writable=!1,(this[T]||!this[dt])&&this[q](),this}[rt](){this[v]||(!this[X]&&!this[D].length&&(this[M]=!0),this[dt]=!1,this[T]=!0,this.emit("resume"),this[A].length?this[Mt]():this[H]?this[q]():this.emit("drain"))}resume(){return this[rt]()}pause(){this[T]=!1,this[dt]=!0,this[M]=!1}get destroyed(){return this[v]}get flowing(){return this[T]}get paused(){return this[dt]}[re](t){this[C]?this[R]+=1:this[R]+=t.length,this[A].push(t)}[_t](){return this[C]?this[R]-=1:this[R]-=this[A][0].length,this[A].shift()}[Mt](t=!1){do;while(this[is](this[_t]())&&this[A].length);!t&&!this[A].length&&!this[H]&&this.emit("drain")}[is](t){return this.emit("data",t),this[T]}pipe(t,e){if(this[v])return t;this[M]=!1;let s=this[K];return e=e||{},t===es.stdout||t===es.stderr?e.end=!1:e.end=e.end!==!1,e.proxyErrors=!!e.proxyErrors,s?e.end&&t.end():(this[D].push(e.proxyErrors?new le(this,t,e):new jt(this,t,e)),this[U]?mt(()=>this[rt]()):this[rt]()),t}unpipe(t){let e=this[D].find(s=>s.dest===t);e&&(this[D].length===1?(this[T]&&this[X]===0&&(this[T]=!1),this[D]=[]):this[D].splice(this[D].indexOf(e),1),e.unpipe())}addListener(t,e){return this.on(t,e)}on(t,e){let s=super.on(t,e);if(t==="data")this[M]=!1,this[X]++,!this[D].length&&!this[T]&&this[rt]();else if(t==="readable"&&this[R]!==0)super.emit("readable");else if(Mi(t)&&this[K])super.emit(t),this.removeAllListeners(t);else if(t==="error"&&this[ut]){let i=e;this[U]?mt(()=>i.call(this,this[ut])):i.call(this,this[ut])}return s}removeListener(t,e){return this.off(t,e)}off(t,e){let s=super.off(t,e);return t==="data"&&(this[X]=this.listeners("data").length,this[X]===0&&!this[M]&&!this[D].length&&(this[T]=!1)),s}removeAllListeners(t){let e=super.removeAllListeners(t);return(t==="data"||t===void 0)&&(this[X]=0,!this[M]&&!this[D].length&&(this[T]=!1)),e}get emittedEnd(){return this[K]}[q](){!this[Dt]&&!this[K]&&!this[v]&&this[A].length===0&&this[H]&&(this[Dt]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Nt]&&this.emit("close"),this[Dt]=!1)}emit(t,...e){let s=e[0];if(t!=="error"&&t!=="close"&&t!==v&&this[v])return!1;if(t==="data")return!this[C]&&!s?!1:this[U]?(mt(()=>this[oe](s)),!0):this[oe](s);if(t==="end")return this[rs]();if(t==="close"){if(this[Nt]=!0,!this[K]&&!this[v])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(t==="error"){this[ut]=s,super.emit(ne,s);let n=!this[pt]||this.listeners("error").length?super.emit("error",s):!1;return this[q](),n}else if(t==="resume"){let n=super.emit("resume");return this[q](),n}else if(t==="finish"||t==="prefinish"){let n=super.emit(t);return this.removeAllListeners(t),n}let i=super.emit(t,...e);return this[q](),i}[oe](t){for(let s of this[D])s.dest.write(t)===!1&&this.pause();let e=this[M]?!1:super.emit("data",t);return this[q](),e}[rs](){return this[K]?!1:(this[K]=!0,this.readable=!1,this[U]?(mt(()=>this[he]()),!0):this[he]())}[he](){if(this[it]){let e=this[it].end();if(e){for(let s of this[D])s.dest.write(e);this[M]||super.emit("data",e)}}for(let e of this[D])e.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[C]||(t.dataLength=0);let e=this.promise();return this.on("data",s=>{t.push(s),this[C]||(t.dataLength+=s.length)}),await e,t}async concat(){if(this[C])throw new Error("cannot concat in objectMode");let t=await this.collect();return this[P]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,e)=>{this.on(v,()=>e(new Error("stream destroyed"))),this.on("error",s=>e(s)),this.on("end",()=>t())})}[Symbol.asyncIterator](){this[M]=!1;let t=!1,e=async()=>(this.pause(),t=!0,{value:void 0,done:!0});return{next:()=>{if(t)return e();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[H])return e();let n,o,h=f=>{this.off("data",a),this.off("end",l),this.off(v,c),e(),o(f)},a=f=>{this.off("error",h),this.off("end",l),this.off(v,c),this.pause(),n({value:f,done:!!this[H]})},l=()=>{this.off("error",h),this.off("data",a),this.off(v,c),e(),n({done:!0,value:void 0})},c=()=>h(new Error("stream destroyed"));return new Promise((f,u)=>{o=u,n=f,this.once(v,c),this.once("error",h),this.once("end",l),this.once("data",a)})},throw:e,return:e,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[M]=!1;let t=!1,e=()=>(this.pause(),this.off(ne,e),this.off(v,e),this.off("end",e),t=!0,{done:!0,value:void 0}),s=()=>{if(t)return e();let i=this.read();return i===null?e():{done:!1,value:i}};return this.once("end",e),this.once(ne,e),this.once(v,e),{next:s,throw:e,return:e,[Symbol.iterator](){return this}}}destroy(t){if(this[v])return t?this.emit("error",t):this.emit(v),this;this[v]=!0,this[M]=!0,this[A].length=0,this[R]=0;let e=this;return typeof e.close=="function"&&!this[Nt]&&e.close(),t?this.emit("error",t):this.emit(v),this}static get isStream(){return Oi}};var qi=Hi.native,wt={lstatSync:Wi,readdir:Bi,readdirSync:Ui,readlinkSync:Gi,realpathSync:qi,promises:{lstat:Ji,readdir:Ki,readlink:Vi,realpath:Yi}},cs=r=>!r||r===wt||r===$i?wt:{...wt,...r,promises:{...wt.promises,...r.promises||{}}},fs=/^\\\\\?\\([a-z]:)\\?$/i,Xi=r=>r.replace(/\//g,"\\").replace(fs,"$1\\"),Zi=/[\\\/]/,j=0,us=1,ds=2,G=4,ps=6,ms=8,Z=10,gs=12,L=15,gt=~L,fe=16,os=32,yt=64,$=128,zt=256,Pt=512,hs=yt|$|Pt,Qi=1023,ue=r=>r.isFile()?ms:r.isDirectory()?G:r.isSymbolicLink()?Z:r.isCharacterDevice()?ds:r.isBlockDevice()?ps:r.isSocket()?gs:r.isFIFO()?us:j,as=new Map,bt=r=>{let t=as.get(r);if(t)return t;let e=r.normalize("NFKD");return as.set(r,e),e},ls=new Map,It=r=>{let t=ls.get(r);if(t)return t;let e=bt(r.toLowerCase());return ls.set(r,e),e},$t=class extends ft{constructor(){super({max:256})}},pe=class extends ft{constructor(t=16*1024){super({maxSize:t,sizeCalculation:e=>e.length+1})}},ws=Symbol("PathScurry setAsCwd"),O=class{name;root;roots;parent;nocase;#t;#s;get dev(){return this.#s}#n;get mode(){return this.#n}#i;get nlink(){return this.#i}#h;get uid(){return this.#h}#l;get gid(){return this.#l}#f;get rdev(){return this.#f}#a;get blksize(){return this.#a}#o;get ino(){return this.#o}#e;get size(){return this.#e}#m;get blocks(){return this.#m}#w;get atimeMs(){return this.#w}#d;get mtimeMs(){return this.#d}#u;get ctimeMs(){return this.#u}#S;get birthtimeMs(){return this.#S}#g;get atime(){return this.#g}#A;get mtime(){return this.#A}#R;get ctime(){return this.#R}#E;get birthtime(){return this.#E}#b;#C;#p;#F;#k;#v;#r;#y;#D;#x;get path(){return(this.parent||this).fullpath()}constructor(t,e=j,s,i,n,o,h){this.name=t,this.#b=n?It(t):bt(t),this.#r=e&Qi,this.nocase=n,this.roots=i,this.root=s||this,this.#y=o,this.#p=h.fullpath,this.#k=h.relative,this.#v=h.relativePosix,this.parent=h.parent,this.parent?this.#t=this.parent.#t:this.#t=cs(h.fs)}depth(){return this.#C!==void 0?this.#C:this.parent?this.#C=this.parent.depth()+1:this.#C=0}childrenCache(){return this.#y}resolve(t){if(!t)return this;let e=this.getRootString(t),i=t.substring(e.length).split(this.splitSep);return e?this.getRoot(e).#L(i):this.#L(i)}#L(t){let e=this;for(let s of t)e=e.child(s);return e}children(){let t=this.#y.get(this);if(t)return t;let e=Object.assign([],{provisional:0});return this.#y.set(this,e),this.#r&=~fe,e}child(t,e){if(t===""||t===".")return this;if(t==="..")return this.parent||this;let s=this.children(),i=this.nocase?It(t):bt(t);for(let a of s)if(a.#b===i)return a;let n=this.parent?this.sep:"",o=this.#p?this.#p+n+t:void 0,h=this.newChild(t,j,{...e,parent:this,fullpath:o});return this.canReaddir()||(h.#r|=$),s.push(h),h}relative(){if(this.#k!==void 0)return this.#k;let t=this.name,e=this.parent;if(!e)return this.#k=this.name;let s=e.relative();return s+(!s||!e.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.#v!==void 0)return this.#v;let t=this.name,e=this.parent;if(!e)return this.#v=this.fullpathPosix();let s=e.relativePosix();return s+(!s||!e.parent?"":"/")+t}fullpath(){if(this.#p!==void 0)return this.#p;let t=this.name,e=this.parent;if(!e)return this.#p=this.name;let i=e.fullpath()+(e.parent?this.sep:"")+t;return this.#p=i}fullpathPosix(){if(this.#F!==void 0)return this.#F;if(this.sep==="/")return this.#F=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#F=`//?/${i}`:this.#F=i}let t=this.parent,e=t.fullpathPosix(),s=e+(!e||!t.parent?"":"/")+this.name;return this.#F=s}isUnknown(){return(this.#r&L)===j}isType(t){return this[`is${t}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#r&L)===ms}isDirectory(){return(this.#r&L)===G}isCharacterDevice(){return(this.#r&L)===ds}isBlockDevice(){return(this.#r&L)===ps}isFIFO(){return(this.#r&L)===us}isSocket(){return(this.#r&L)===gs}isSymbolicLink(){return(this.#r&Z)===Z}lstatCached(){return this.#r&os?this:void 0}readlinkCached(){return this.#D}realpathCached(){return this.#x}readdirCached(){let t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(this.#D)return!0;if(!this.parent)return!1;let t=this.#r&L;return!(t!==j&&t!==Z||this.#r&zt||this.#r&$)}calledReaddir(){return!!(this.#r&fe)}isENOENT(){return!!(this.#r&$)}isNamed(t){return this.nocase?this.#b===It(t):this.#b===bt(t)}async readlink(){let t=this.#D;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=await this.#t.promises.readlink(this.fullpath()),s=(await this.parent.realpath())?.resolve(e);if(s)return this.#D=s}catch(e){this.#I(e.code);return}}readlinkSync(){let t=this.#D;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=this.#t.readlinkSync(this.fullpath()),s=this.parent.realpathSync()?.resolve(e);if(s)return this.#D=s}catch(e){this.#I(e.code);return}}#j(t){this.#r|=fe;for(let e=t.provisional;es(null,t))}readdirCB(t,e=!1){if(!this.canReaddir()){e?t(null,[]):queueMicrotask(()=>t(null,[]));return}let s=this.children();if(this.calledReaddir()){let n=s.slice(0,s.provisional);e?t(null,n):queueMicrotask(()=>t(null,n));return}if(this.#$.push(t),this.#W)return;this.#W=!0;let i=this.fullpath();this.#t.readdir(i,{withFileTypes:!0},(n,o)=>{if(n)this.#_(n.code),s.provisional=0;else{for(let h of o)this.#M(h,s);this.#j(s)}this.#q(s.slice(0,s.provisional))})}#P;async readdir(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();if(this.#P)await this.#P;else{let s=()=>{};this.#P=new Promise(i=>s=i);try{for(let i of await this.#t.promises.readdir(e,{withFileTypes:!0}))this.#M(i,t);this.#j(t)}catch(i){this.#_(i.code),t.provisional=0}this.#P=void 0,s()}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();try{for(let s of this.#t.readdirSync(e,{withFileTypes:!0}))this.#M(s,t);this.#j(t)}catch(s){this.#_(s.code),t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(this.#r&hs)return!1;let t=L&this.#r;return t===j||t===G||t===Z}shouldWalk(t,e){return(this.#r&G)===G&&!(this.#r&hs)&&!t.has(this)&&(!e||e(this))}async realpath(){if(this.#x)return this.#x;if(!((Pt|zt|$)&this.#r))try{let t=await this.#t.promises.realpath(this.fullpath());return this.#x=this.resolve(t)}catch{this.#z()}}realpathSync(){if(this.#x)return this.#x;if(!((Pt|zt|$)&this.#r))try{let t=this.#t.realpathSync(this.fullpath());return this.#x=this.resolve(t)}catch{this.#z()}}[ws](t){if(t===this)return;let e=new Set([]),s=[],i=this;for(;i&&i.parent;)e.add(i),i.#k=s.join(this.sep),i.#v=s.join("/"),i=i.parent,s.push("..");for(i=t;i&&i.parent&&!e.has(i);)i.#k=void 0,i.#v=void 0,i=i.parent}},Wt=class r extends O{sep="\\";splitSep=Zi;constructor(t,e=j,s,i,n,o,h){super(t,e,s,i,n,o,h)}newChild(t,e=j,s={}){return new r(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}getRootString(t){return de.parse(t).root}getRoot(t){if(t=Xi(t.toUpperCase()),t===this.root.name)return this.root;for(let[e,s]of Object.entries(this.roots))if(this.sameRoot(t,e))return this.roots[t]=s;return this.roots[t]=new nt(t,this).root}sameRoot(t,e=this.root.name){return t=t.toUpperCase().replace(/\//g,"\\").replace(fs,"$1\\"),t===e}},Bt=class r extends O{splitSep="/";sep="/";constructor(t,e=j,s,i,n,o,h){super(t,e,s,i,n,o,h)}getRootString(t){return t.startsWith("/")?"/":""}getRoot(t){return this.root}newChild(t,e=j,s={}){return new r(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}},Ut=class{root;rootPath;roots;cwd;#t;#s;#n;nocase;#i;constructor(t=process.cwd(),e,s,{nocase:i,childrenCacheSize:n=16*1024,fs:o=wt}={}){this.#i=cs(o),(t instanceof URL||t.startsWith("file://"))&&(t=Pi(t));let h=e.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(h),this.#t=new $t,this.#s=new $t,this.#n=new pe(n);let a=h.substring(this.rootPath.length).split(s);if(a.length===1&&!a[0]&&a.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#i),this.roots[this.rootPath]=this.root;let l=this.root,c=a.length-1,f=e.sep,u=this.rootPath,d=!1;for(let m of a){let p=c--;l=l.child(m,{relative:new Array(p).fill("..").join(f),relativePosix:new Array(p).fill("..").join("/"),fullpath:u+=(d?"":f)+m}),d=!0}this.cwd=l}depth(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return this.#n}resolve(...t){let e="";for(let n=t.length-1;n>=0;n--){let o=t[n];if(!(!o||o===".")&&(e=e?`${o}/${e}`:o,this.isAbsolute(o)))break}let s=this.#t.get(e);if(s!==void 0)return s;let i=this.cwd.resolve(e).fullpath();return this.#t.set(e,i),i}resolvePosix(...t){let e="";for(let n=t.length-1;n>=0;n--){let o=t[n];if(!(!o||o===".")&&(e=e?`${o}/${e}`:o,this.isAbsolute(o)))break}let s=this.#s.get(e);if(s!==void 0)return s;let i=this.cwd.resolve(e).fullpathPosix();return this.#s.set(e,i),i}relative(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relative()}relativePosix(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relativePosix()}basename(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.name}dirname(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),(t.parent||t).fullpath()}async readdir(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof O||(e=t,t=this.cwd);let{withFileTypes:s}=e;if(t.canReaddir()){let i=await t.readdir();return s?i:i.map(n=>n.name)}else return[]}readdirSync(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof O||(e=t,t=this.cwd);let{withFileTypes:s=!0}=e;return t.canReaddir()?s?t.readdirSync():t.readdirSync().map(i=>i.name):[]}async lstat(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstat()}lstatSync(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof O||(e=t.withFileTypes,t=this.cwd);let s=await t.readlink();return e?s:s?.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof O||(e=t.withFileTypes,t=this.cwd);let s=t.readlinkSync();return e?s:s?.fullpath()}async realpath(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof O||(e=t.withFileTypes,t=this.cwd);let s=await t.realpath();return e?s:s?.fullpath()}realpathSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof O||(e=t.withFileTypes,t=this.cwd);let s=t.realpathSync();return e?s:s?.fullpath()}async walk(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof O||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=e,h=[];(!n||n(t))&&h.push(s?t:t.fullpath());let a=new Set,l=(f,u)=>{a.add(f),f.readdirCB((d,m)=>{if(d)return u(d);let p=m.length;if(!p)return u();let w=()=>{--p===0&&u()};for(let g of m)(!n||n(g))&&h.push(s?g:g.fullpath()),i&&g.isSymbolicLink()?g.realpath().then(S=>S?.isUnknown()?S.lstat():S).then(S=>S?.shouldWalk(a,o)?l(S,w):w()):g.shouldWalk(a,o)?l(g,w):w()},!0)},c=t;return new Promise((f,u)=>{l(c,d=>{if(d)return u(d);f(h)})})}walkSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof O||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=e,h=[];(!n||n(t))&&h.push(s?t:t.fullpath());let a=new Set([t]);for(let l of a){let c=l.readdirSync();for(let f of c){(!n||n(f))&&h.push(s?f:f.fullpath());let u=f;if(f.isSymbolicLink()){if(!(i&&(u=f.realpathSync())))continue;u.isUnknown()&&u.lstatSync()}u.shouldWalk(a,o)&&a.add(u)}}return h}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,e={}){return typeof t=="string"?t=this.cwd.resolve(t):t instanceof O||(e=t,t=this.cwd),this.stream(t,e)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof O||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=e;(!n||n(t))&&(yield s?t:t.fullpath());let h=new Set([t]);for(let a of h){let l=a.readdirSync();for(let c of l){(!n||n(c))&&(yield s?c:c.fullpath());let f=c;if(c.isSymbolicLink()){if(!(i&&(f=c.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(h,o)&&h.add(f)}}}stream(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof O||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=e,h=new V({objectMode:!0});(!n||n(t))&&h.write(s?t:t.fullpath());let a=new Set,l=[t],c=0,f=()=>{let u=!1;for(;!u;){let d=l.shift();if(!d){c===0&&h.end();return}c++,a.add(d);let m=(w,g,S=!1)=>{if(w)return h.emit("error",w);if(i&&!S){let b=[];for(let y of g)y.isSymbolicLink()&&b.push(y.realpath().then(E=>E?.isUnknown()?E.lstat():E));if(b.length){Promise.all(b).then(()=>m(null,g,!0));return}}for(let b of g)b&&(!n||n(b))&&(h.write(s?b:b.fullpath())||(u=!0));c--;for(let b of g){let y=b.realpathCached()||b;y.shouldWalk(a,o)&&l.push(y)}u&&!h.flowing?h.once("drain",f):p||f()},p=!0;d.readdirCB(m,!0),p=!1}};return f(),h}streamSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof O||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=e,h=new V({objectMode:!0}),a=new Set;(!n||n(t))&&h.write(s?t:t.fullpath());let l=[t],c=0,f=()=>{let u=!1;for(;!u;){let d=l.shift();if(!d){c===0&&h.end();return}c++,a.add(d);let m=d.readdirSync();for(let p of m)(!n||n(p))&&(h.write(s?p:p.fullpath())||(u=!0));c--;for(let p of m){let w=p;if(p.isSymbolicLink()){if(!(i&&(w=p.realpathSync())))continue;w.isUnknown()&&w.lstatSync()}w.shouldWalk(a,o)&&l.push(w)}}u&&!h.flowing&&h.once("drain",f)};return f(),h}chdir(t=this.cwd){let e=this.cwd;this.cwd=typeof t=="string"?this.cwd.resolve(t):t,this.cwd[ws](e)}},nt=class extends Ut{sep="\\";constructor(t=process.cwd(),e={}){let{nocase:s=!0}=e;super(t,de,"\\",{...e,nocase:s}),this.nocase=s;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(t){return de.parse(t).root.toUpperCase()}newRoot(t){return new Wt(this.rootPath,G,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}},ot=class extends Ut{sep="/";constructor(t=process.cwd(),e={}){let{nocase:s=!1}=e;super(t,Ii,"/",{...e,nocase:s}),this.nocase=s}parseRootPath(t){return"/"}newRoot(t){return new Bt(this.rootPath,G,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}},St=class extends ot{constructor(t=process.cwd(),e={}){let{nocase:s=!0}=e;super(t,{...e,nocase:s})}},an=process.platform==="win32"?Wt:Bt,ys=process.platform==="win32"?nt:process.platform==="darwin"?St:ot;import{fileURLToPath as rr}from"url";var tr=r=>r.length>=1,er=r=>r.length>=1,ht=class r{#t;#s;#n;length;#i;#h;#l;#f;#a;#o;#e=!0;constructor(t,e,s,i){if(!tr(t))throw new TypeError("empty pattern list");if(!er(e))throw new TypeError("empty glob list");if(e.length!==t.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=t.length,s<0||s>=this.length)throw new TypeError("index out of range");if(this.#t=t,this.#s=e,this.#n=s,this.#i=i,this.#n===0){if(this.isUNC()){let[n,o,h,a,...l]=this.#t,[c,f,u,d,...m]=this.#s;l[0]===""&&(l.shift(),m.shift());let p=[n,o,h,a,""].join("/"),w=[c,f,u,d,""].join("/");this.#t=[p,...l],this.#s=[w,...m],this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){let[n,...o]=this.#t,[h,...a]=this.#s;o[0]===""&&(o.shift(),a.shift());let l=n+"/",c=h+"/";this.#t=[l,...o],this.#s=[c,...a],this.length=this.#t.length}}}pattern(){return this.#t[this.#n]}isString(){return typeof this.#t[this.#n]=="string"}isGlobstar(){return this.#t[this.#n]===k}isRegExp(){return this.#t[this.#n]instanceof RegExp}globString(){return this.#l=this.#l||(this.#n===0?this.isAbsolute()?this.#s[0]+this.#s.slice(1).join("/"):this.#s.join("/"):this.#s.slice(this.#n).join("/"))}hasMore(){return this.length>this.#n+1}rest(){return this.#h!==void 0?this.#h:this.hasMore()?(this.#h=new r(this.#t,this.#s,this.#n+1,this.#i),this.#h.#o=this.#o,this.#h.#a=this.#a,this.#h.#f=this.#f,this.#h):this.#h=null}isUNC(){let t=this.#t;return this.#a!==void 0?this.#a:this.#a=this.#i==="win32"&&this.#n===0&&t[0]===""&&t[1]===""&&typeof t[2]=="string"&&!!t[2]&&typeof t[3]=="string"&&!!t[3]}isDrive(){let t=this.#t;return this.#f!==void 0?this.#f:this.#f=this.#i==="win32"&&this.#n===0&&this.length>1&&typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0])}isAbsolute(){let t=this.#t;return this.#o!==void 0?this.#o:this.#o=t[0]===""&&t.length>1||this.isDrive()||this.isUNC()}root(){let t=this.#t[0];return typeof t=="string"&&this.isAbsolute()&&this.#n===0?t:""}checkFollowGlobstar(){return!(this.#n===0||!this.isGlobstar()||!this.#e)}markFollowGlobstar(){return this.#n===0||!this.isGlobstar()||!this.#e?!1:(this.#e=!1,!0)}};var sr=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Et=class{relative;relativeChildren;absolute;absoluteChildren;constructor(t,{nobrace:e,nocase:s,noext:i,noglobstar:n,platform:o=sr}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[];let h={dot:!0,nobrace:e,nocase:s,noext:i,noglobstar:n,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of t){let l=new N(a,h);for(let c=0;c[t,!!(e&2),!!(e&1)])}},we=class{store=new Map;add(t,e){if(!t.canReaddir())return;let s=this.store.get(t);s?s.find(i=>i.globString()===e.globString())||s.push(e):this.store.set(t,[e])}get(t){let e=this.store.get(t);if(!e)throw new Error("attempting to walk unknown path");return e}entries(){return this.keys().map(t=>[t,this.store.get(t)])}keys(){return[...this.store.keys()].filter(t=>t.canReaddir())}},vt=class r{hasWalkedCache;matches=new ge;subwalks=new we;patterns;follow;dot;opts;constructor(t,e){this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=e?e.copy():new me}processPatterns(t,e){this.patterns=e;let s=e.map(i=>[t,i]);for(let[i,n]of s){this.hasWalkedCache.storeWalked(i,n);let o=n.root(),h=n.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let f=n.rest();if(f)n=f;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let a,l,c=!1;for(;typeof(a=n.pattern())=="string"&&(l=n.rest());)i=i.resolve(a),n=l,c=!0;if(a=n.pattern(),l=n.rest(),c){if(this.hasWalkedCache.hasWalked(i,n))continue;this.hasWalkedCache.storeWalked(i,n)}if(typeof a=="string"){let f=a===".."||a===""||a===".";this.matches.add(i.resolve(a),h,f);continue}else if(a===k){(!i.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(i,n);let f=l?.pattern(),u=l?.rest();if(!l||(f===""||f===".")&&!u)this.matches.add(i,h,f===""||f===".");else if(f===".."){let d=i.parent||i;u?this.hasWalkedCache.hasWalked(d,u)||this.subwalks.add(d,u):this.matches.add(d,h,!0)}}else a instanceof RegExp&&this.subwalks.add(i,n)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new r(this.opts,this.hasWalkedCache)}filterEntries(t,e){let s=this.subwalks.get(t),i=this.child();for(let n of e)for(let o of s){let h=o.isAbsolute(),a=o.pattern(),l=o.rest();a===k?i.testGlobstar(n,o,l,h):a instanceof RegExp?i.testRegExp(n,a,l,h):i.testString(n,a,l,h)}return i}testGlobstar(t,e,s,i){if((this.dot||!t.name.startsWith("."))&&(e.hasMore()||this.matches.add(t,i,!1),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,e):t.isSymbolicLink()&&(s&&e.checkFollowGlobstar()?this.subwalks.add(t,s):e.markFollowGlobstar()&&this.subwalks.add(t,e)))),s){let n=s.pattern();if(typeof n=="string"&&n!==".."&&n!==""&&n!==".")this.testString(t,n,s.rest(),i);else if(n===".."){let o=t.parent||t;this.subwalks.add(o,s)}else n instanceof RegExp&&this.testRegExp(t,n,s.rest(),i)}}testRegExp(t,e,s,i){e.test(t.name)&&(s?this.subwalks.add(t,s):this.matches.add(t,i,!1))}testString(t,e,s,i){t.isNamed(e)&&(s?this.subwalks.add(t,s):this.matches.add(t,i,!1))}};var ir=(r,t)=>typeof r=="string"?new Et([r],t):Array.isArray(r)?new Et(r,t):r,Gt=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#t=[];#s;#n;signal;maxDepth;constructor(t,e,s){this.patterns=t,this.path=e,this.opts=s,this.#n=!s.posix&&s.platform==="win32"?"\\":"/",s.ignore&&(this.#s=ir(s.ignore,s)),this.maxDepth=s.maxDepth||1/0,s.signal&&(this.signal=s.signal,this.signal.addEventListener("abort",()=>{this.#t.length=0}))}#i(t){return this.seen.has(t)||!!this.#s?.ignored?.(t)}#h(t){return!!this.#s?.childrenIgnored?.(t)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let t;for(;!this.paused&&(t=this.#t.shift());)t()}onResume(t){this.signal?.aborted||(this.paused?this.#t.push(t):t())}async matchCheck(t,e){if(e&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=t.realpathCached()||await t.realpath(),!s)return;t=s}let n=t.isUnknown()||this.opts.stat?await t.lstat():t;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let o=await n.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(n,e)}matchCheckTest(t,e){return t&&(this.maxDepth===1/0||t.depth()<=this.maxDepth)&&(!e||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!t.realpathCached()?.isDirectory())&&!this.#i(t)?t:void 0}matchCheckSync(t,e){if(e&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=t.realpathCached()||t.realpathSync(),!s)return;t=s}let n=t.isUnknown()||this.opts.stat?t.lstatSync():t;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let o=n.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(n,e)}matchFinish(t,e){if(this.#i(t))return;let s=this.opts.absolute===void 0?e:this.opts.absolute;this.seen.add(t);let i=this.opts.mark&&t.isDirectory()?this.#n:"";if(this.opts.withFileTypes)this.matchEmit(t);else if(s){let n=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(n+i)}else{let n=this.opts.posix?t.relativePosix():t.relative(),o=this.opts.dotRelative&&!n.startsWith(".."+this.#n)?"."+this.#n:"";this.matchEmit(n?o+n+i:"."+i)}}async match(t,e,s){let i=await this.matchCheck(t,s);i&&this.matchFinish(i,e)}matchSync(t,e,s){let i=this.matchCheckSync(t,s);i&&this.matchFinish(i,e)}walkCB(t,e,s){this.signal?.aborted&&s(),this.walkCB2(t,e,new vt(this.opts),s)}walkCB2(t,e,s,i){if(this.#h(t))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(t,e,s,i));return}s.processPatterns(t,e);let n=1,o=()=>{--n===0&&i()};for(let[h,a,l]of s.matches.entries())this.#i(h)||(n++,this.match(h,a,l).then(()=>o()));for(let h of s.subwalkTargets()){if(this.maxDepth!==1/0&&h.depth()>=this.maxDepth)continue;n++;let a=h.readdirCached();h.calledReaddir()?this.walkCB3(h,a,s,o):h.readdirCB((l,c)=>this.walkCB3(h,c,s,o),!0)}o()}walkCB3(t,e,s,i){s=s.filterEntries(t,e);let n=1,o=()=>{--n===0&&i()};for(let[h,a,l]of s.matches.entries())this.#i(h)||(n++,this.match(h,a,l).then(()=>o()));for(let[h,a]of s.subwalks.entries())n++,this.walkCB2(h,a,s.child(),o);o()}walkCBSync(t,e,s){this.signal?.aborted&&s(),this.walkCB2Sync(t,e,new vt(this.opts),s)}walkCB2Sync(t,e,s,i){if(this.#h(t))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(t,e,s,i));return}s.processPatterns(t,e);let n=1,o=()=>{--n===0&&i()};for(let[h,a,l]of s.matches.entries())this.#i(h)||this.matchSync(h,a,l);for(let h of s.subwalkTargets()){if(this.maxDepth!==1/0&&h.depth()>=this.maxDepth)continue;n++;let a=h.readdirSync();this.walkCB3Sync(h,a,s,o)}o()}walkCB3Sync(t,e,s,i){s=s.filterEntries(t,e);let n=1,o=()=>{--n===0&&i()};for(let[h,a,l]of s.matches.entries())this.#i(h)||this.matchSync(h,a,l);for(let[h,a]of s.subwalks.entries())n++,this.walkCB2Sync(h,a,s.child(),o);o()}},xt=class extends Gt{matches;constructor(t,e,s){super(t,e,s),this.matches=new Set}matchEmit(t){this.matches.add(t)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((t,e)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?e(this.signal.reason):t(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},Tt=class extends Gt{results;constructor(t,e,s){super(t,e,s),this.results=new V({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(t){this.results.write(t),this.results.flowing||this.pause()}stream(){let t=this.path;return t.isUnknown()?t.lstat().then(()=>{this.walkCB(t,this.patterns,()=>this.results.end())}):this.walkCB(t,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var nr=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",W=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;opts;patterns;constructor(t,e){if(!e)throw new TypeError("glob options required");if(this.withFileTypes=!!e.withFileTypes,this.signal=e.signal,this.follow=!!e.follow,this.dot=!!e.dot,this.dotRelative=!!e.dotRelative,this.nodir=!!e.nodir,this.mark=!!e.mark,e.cwd?(e.cwd instanceof URL||e.cwd.startsWith("file://"))&&(e.cwd=rr(e.cwd)):this.cwd="",this.cwd=e.cwd||"",this.root=e.root,this.magicalBraces=!!e.magicalBraces,this.nobrace=!!e.nobrace,this.noext=!!e.noext,this.realpath=!!e.realpath,this.absolute=e.absolute,this.noglobstar=!!e.noglobstar,this.matchBase=!!e.matchBase,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:1/0,this.stat=!!e.stat,this.ignore=e.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof t=="string"&&(t=[t]),this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(t=t.map(a=>a.replace(/\\/g,"/"))),this.matchBase){if(e.noglobstar)throw new TypeError("base matching requires globstar");t=t.map(a=>a.includes("/")?a:`./**/${a}`)}if(this.pattern=t,this.platform=e.platform||nr,this.opts={...e,platform:this.platform},e.scurry){if(this.scurry=e.scurry,e.nocase!==void 0&&e.nocase!==e.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let a=e.platform==="win32"?nt:e.platform==="darwin"?St:e.platform?ot:ys;this.scurry=new a(this.cwd,{nocase:e.nocase,fs:e.fs})}this.nocase=this.scurry.nocase;let s=this.platform==="darwin"||this.platform==="win32",i={...e,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:s,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},n=this.pattern.map(a=>new N(a,i)),[o,h]=n.reduce((a,l)=>(a[0].push(...l.set),a[1].push(...l.globParts),a),[[],[]]);this.patterns=o.map((a,l)=>{let c=h[l];if(!c)throw new Error("invalid pattern object");return new ht(a,c,0,this.platform)})}async walk(){return[...await new xt(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase}).walk()]}walkSync(){return[...new xt(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase}).walkSync()]}stream(){return new Tt(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase}).stream()}streamSync(){return new Tt(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var ye=(r,t={})=>{Array.isArray(r)||(r=[r]);for(let e of r)if(new N(e,t).hasMagic())return!0;return!1};function Ht(r,t={}){return new W(r,t).streamSync()}function Es(r,t={}){return new W(r,t).stream()}function qt(r,t={}){return new W(r,t).walkSync()}async function bs(r,t={}){return new W(r,t).walk()}function Jt(r,t={}){return new W(r,t).iterateSync()}function vs(r,t={}){return new W(r,t).iterate()}var or=Ht,hr=Object.assign(Es,{sync:Ht}),ar=Jt,lr=Object.assign(vs,{sync:Jt}),cr=Object.assign(qt,{stream:Ht,iterate:Jt}),Ss=Object.assign(bs,{glob:bs,globSync:qt,sync:cr,globStream:Es,stream:hr,globStreamSync:Ht,streamSync:or,globIterate:vs,iterate:lr,globIterateSync:Jt,iterateSync:ar,Glob:W,hasMagic:ye,escape:tt,unescape:I});Ss.glob=Ss;import fr from"node:fs";function xs(r){return JSON.parse(fr.readFileSync(r).toString("utf-8"))}function Kt(r){return xs(r)}function be(r){return xs(r)}function Y(r){return(process.env[`INPUT_${r.toUpperCase()}`]||"").trim()}function Ts(r){let t=ur(r);Vt.mkdirSync(Yt.join(At.cwd(),r.analyzerDirectory),{recursive:!0});let e=Yt.join(At.cwd(),r.analyzerDirectory,"bundle_analysis.json");Vt.writeFileSync(e,JSON.stringify(t,null,2)),Xt.log(`Wrote ${e}`)}function Se(r){return r.metafiles.flatMap(t=>qt(Yt.join(At.cwd(),t),{nodir:!0}).map(e=>({relativePath:Yt.relative(At.cwd(),e),absolutePath:e})))}function ur(r){let t={};return Se(r).reduce((e,{relativePath:s,absolutePath:i})=>{try{Vt.accessSync(i,Vt.constants.R_OK)}catch{Xt.error(`No meta file found at "${i}" - a path to meta file may be wrong, or esbuild is not executed.`),At.exit(1)}let n=Kt(i);return Object.entries(n.outputs).reduce((o,h)=>{let[a,l]=h;return r.includeExtensions.some(c=>a.toLowerCase().endsWith(c))&&(o[`${s} -> ${a}`]={bytes:l.bytes,metafile:s,outfile:a}),o},e),e},t)}function ks(r){let t=!1,e=`## \u{1F4E6} esbuild Bundle Analysis for ${r.name} This analysis was generated by [esbuild-bundle-analyzer](https://github.com/exoego/esbuild-bundle-analyzer). \u{1F916} `,s=be(Rt.join(process.cwd(),r.analyzerDirectory,"bundle_analysis.json")),i=mr(r),n=gr(r),h=[...new Set([...Object.keys(s),...Object.keys(i)])].sort().map(a=>{let l=s[a],c=i[a];if(!l)return t=!0,{...c,baseBytes:-1,remark:"deleted",tree:void 0};let f=n.get(Cs(l.metafile,l.outfile));if(!c)return t=!0,{...l,baseBytes:-1,remark:"added",tree:f};let u=l.bytes-c.bytes;return u!==0&&(t=!0),{...l,baseBytes:c.bytes,tree:f,remark:Math.sign(u)?"increased":"decreased"}});t?(e+=wr(h,r.percentExtraAttention),e+=br(h,r.topNLargestPaths),e+=pr(r)):e+="This PR introduced no changes to the esbuild bundle! \u{1F64C}",e+=``,dr(r,e)}function Cs(r,t){return`${r} -> ${t}`}function dr(r,t){ve.mkdirSync(Rt.join(process.cwd(),r.analyzerDirectory),{recursive:!0}),ve.writeFileSync(Rt.join(process.cwd(),r.analyzerDirectory,"bundle_analysis_comment.txt"),t.trim())}function pr(r){return r.showDetails?` @@ -15,7 +15,7 @@ This analysis was generated by [esbuild-bundle-analyzer](https://github.com/exoe
  • \u{1F195}: The out file is newly found: will be added to base branch.
  • -`:""}function mr(r){try{return be(Rt.join(process.cwd(),r.analyzerDirectory,"base/bundle/bundle_analysis.json"))}catch{return{}}}function gr(r){function t(i){let n={name:"",path:"",value:0,children:[]};for(let[o,{bytesInOutput:h}]of Object.entries(i)){let a=o.split("/");e(n,a,h)}return n}function e(i,n,o){let h=n.shift();if(h===void 0){i.value+=o;return}let a=i.children.find(l=>l.name===h);a||(a={name:h,path:`${i.path}/${h}`.replace(/^\//,""),value:0,children:[]},i.children.push(a)),i.value+=o,e(a,n,o)}let s=new Map;if(r.topNLargestPaths<=0)return s;for(let{relativePath:i,absolutePath:n}of Se(r)){let o=Kt(n);for(let[h,a]of Object.entries(o.outputs)){let l=t(a.inputs);s.set(Cs(i,h),l),ve.writeFileSync(Rt.join(process.cwd(),r.analyzerDirectory,"tree.json"),JSON.stringify(l,null,2))}}return s}var Zt="\xA0";function xe(r){let t=r<0?"-":"",e=Math.abs(r);if(e<1e3)return`${t}${e}${Zt}B`;if(e<1e3*1e3)return`${t}${(e/1e3).toFixed(2)}${Zt}KB`;if(e<1e3*1e3*1e3)return`${t}${(e/1e3/1e3).toFixed(2)}${Zt}MB`;if(e<1e3*1e3*1e3*1e3)return`${t}${(e/1e3/1e3/1e3).toFixed(2)}${Zt}GB`;throw new Error("Too large file size!! Are you sure?")}function wr(r,t){return` +`:""}function mr(r){try{let t=be(Rt.join(process.cwd(),r.analyzerDirectory,"base/bundle/bundle_analysis.json"));return console.info("Base analysis found.",t),t}catch{return console.warn("No base analysis found. First setup or all artifacts are expired."),{}}}function gr(r){function t(i){let n={name:"",path:"",value:0,children:[]};for(let[o,{bytesInOutput:h}]of Object.entries(i)){let a=o.split("/");e(n,a,h)}return n}function e(i,n,o){let h=n.shift();if(h===void 0){i.value+=o;return}let a=i.children.find(l=>l.name===h);a||(a={name:h,path:`${i.path}/${h}`.replace(/^\//,""),value:0,children:[]},i.children.push(a)),i.value+=o,e(a,n,o)}let s=new Map;if(r.topNLargestPaths<=0)return s;for(let{relativePath:i,absolutePath:n}of Se(r)){let o=Kt(n);for(let[h,a]of Object.entries(o.outputs)){let l=t(a.inputs);s.set(Cs(i,h),l),ve.writeFileSync(Rt.join(process.cwd(),r.analyzerDirectory,"tree.json"),JSON.stringify(l,null,2))}}return s}var Zt="\xA0";function xe(r){let t=r<0?"-":"",e=Math.abs(r);if(e<1e3)return`${t}${e}${Zt}B`;if(e<1e3*1e3)return`${t}${(e/1e3).toFixed(2)}${Zt}KB`;if(e<1e3*1e3*1e3)return`${t}${(e/1e3/1e3).toFixed(2)}${Zt}MB`;if(e<1e3*1e3*1e3*1e3)return`${t}${(e/1e3/1e3/1e3).toFixed(2)}${Zt}GB`;throw new Error("Too large file size!! Are you sure?")}function wr(r,t){return` Meta File | Out File | Size (raw) | Note ----------|----------|-----------:|------ ${r.map(s=>`${s.metafile} | ${s.outfile} | ${Er(s)} | ${vr(s,t)} @@ -31,4 +31,4 @@ ${r.map(s=>`${s.metafile} | ${s.outfile} | ${Er(s)} | ${vr(s,t)} `}if(o){let h=i-n[0].value,a=As(h,i);e+=`| (other) | ${Rs(a,h)} | `}}return e+=` `,e}function Rs(r,t){return`\${{\\color{Goldenrod}{ ${Sr(r/100)} }}}$ ${r.toFixed(1)}%, ${xe(t)}`}var Os=["","\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u2588"],Ee=1/(Os.length-1);function Sr(r,t=25,e=0,s=1){let i=r*t,n=Math.floor(i),o=i-n,h=Math.round(Ee*Math.floor(o/Ee)/Ee);return"\u2588".repeat(n)+Os[h]}function Er(r){return xe(r.bytes)}function vr(r,t){if(r.remark==="deleted")return"\u{1F5D1}\uFE0F Deleted";if(r.remark==="added")return"\u{1F195} Added";let e=r.bytes-r.baseBytes;if(e!==0){let s=e/r.baseBytes*100;return`${xr(s,t)}${xe(e)} (${Fs(s)}${s.toFixed(1)}%)`}return"\u2705 No change"}function Fs(r){return r<0?"":"+"}function xr(r,t){let e;return r>0&&r=t?e="\u203C\uFE0F":e="\u2705 ",`${e} ${Fs(r)}`}function Ar(){let r=Y("metafiles");if(!r)throw new Error("metafiles is not specified");let t=Y("name");if(!t)throw new Error("name is not specified");return{percentExtraAttention:Number.parseInt(Y("percent_extra_attention")||"20",10),showDetails:["true","True","TRUE"].includes(Y("show_details")||"true"),topNLargestPaths:Number.parseInt(Y("top_n_largest_paths")||"20",10),includeExtensions:(Y("include_extensions")||".js,.mjs,.cjs").split(","),name:t,analyzerDirectory:Y("analyze_directory")||".analyzer",metafiles:r.split(",")}}function Rr(r=Ar()){Ts(r),ks(r)}import.meta.url===Tr(process.argv[1]).href&&Rr();export{Rr as run}; -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vc3JjL2luZGV4LnRzIiwgIi4uL3NyYy9jb21wYXJlLnRzIiwgIi4uL3NyYy9yZXBvcnQudHMiLCAiLi4vc3JjL3V0aWxzLnRzIl0sCiAgInNvdXJjZXNDb250ZW50IjogWyJpbXBvcnQgeyBwYXRoVG9GaWxlVVJMIH0gZnJvbSBcIm5vZGU6dXJsXCI7XG5pbXBvcnQ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oZXIiLCAicGVyY2VudCIsICJyZW5kZXJCYXIiLCAib3RoZXJTaXplIiwgIm90aGVyUGVyY2VudCIsICJwcm9ncmVzcyIsICJibG9ja3MiLCAicHJvZ3Jlc3Npb24iLCAibGVuZ3RoIiwgInZtaW4iLCAidm1heCIsICJ2IiwgImludGVnZXJQYXJ0IiwgImZyYWN0aW9uYWxQYXJ0IiwgImkiLCAicGVyY2VudENoYW5nZSIsICJyZW5kZXJTdGF0dXNJbmRpY2F0b3IiLCAibnVtIiwgInJlcyIsICJnZXRJbnB1dCIsICJyYXdNZXRhZmlsZXMiLCAiZ2V0U2luZ2xlSW5wdXQiLCAibmFtZSIsICJydW4iLCAiaW5wdXQiLCAicmVwb3J0IiwgImNvbXBhcmUiLCAicGF0aFRvRmlsZVVSTCJdCn0K diff --git a/src/compare.ts b/src/compare.ts index 3ecdf0f..2262d98 100644 --- a/src/compare.ts +++ b/src/compare.ts @@ -110,16 +110,19 @@ function detail(input: Input): string { function loadBaseAnalysisJson(input: Input): Report { try { - return loadAnalysisJson( + const report = loadAnalysisJson( path.join( process.cwd(), input.analyzerDirectory, "base/bundle/bundle_analysis.json", ), ); + console.info("Base analysis found.", report); + return report; } catch (e) { - // Empty if no base analysis found. - // This is a case when analyzer is first set up or all artifacts are expired. + console.warn( + "No base analysis found. First setup or all artifacts are expired.", + ); return {}; } }