babylonjs-editor-cli 5.4.1-alpha.3 → 5.4.1-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -85,7 +85,7 @@ ${t}`,"wrappedToString"),Ule=Object.getOwnPropertyDescriptor(Function.prototype,
85
85
  `)),this}return this.isSpinning?this:(this.#e.hideCursor&&x_.hide(this.#c),this.#e.discardStdin&&fl.default.stdin.isTTY&&(D_.start(),this.#y=!0),this.#A(),this.render(),this.#l=setInterval(this.render.bind(this),this.interval),this)}stop(){return clearInterval(this.#l),this.#l=void 0,this.#r=-1,this.#n=0,this.#_(),this.#i(),this.#a&&(this.#c.removeListener("drain",this.#a),this.#a=void 0),this.isEnabled&&(this.clear(),this.#e.hideCursor&&x_.show(this.#c)),this.#y&&(this.#y=!1,D_.stop()),this}succeed(t){return this.stopAndPersist({symbol:Qa.success,text:t})}fail(t){return this.stopAndPersist({symbol:Qa.error,text:t})}warn(t){return this.stopAndPersist({symbol:Qa.warning,text:t})}info(t){return this.stopAndPersist({symbol:Qa.info,text:t})}stopAndPersist(t={}){if(this.isSilent)return this;let r=t.symbol??" ",n=t.text??this.text,s=t.prefixText??this.#e.prefixText,o=t.suffixText??this.#e.suffixText,a=this.#x(r,n,s,o)+`
86
86
  `;return this.stop(),this.#p(()=>this.#c.write(a)),this}};function jo(e){return new N_(e)}i(jo,"ora");async function fGe(e,t){let r=typeof e=="function",n=typeof e.then=="function";if(!r&&!n)throw new TypeError("Parameter `action` must be a Function or a Promise");let{successText:s,failText:o}=typeof t=="object"?t:{successText:void 0,failText:void 0},a=jo(t).start();try{let l=await(r?e(a):e);return a.succeed(s===void 0?void 0:typeof s=="string"?s:s(l)),l}catch(c){throw a.fail(o===void 0?void 0:typeof o=="string"?o:o(c)),c}}i(fGe,"oraPromise");var B_=i((e,t,r)=>{let n=e instanceof RegExp?AN(e,r):e,s=t instanceof RegExp?AN(t,r):t,o=n!==null&&s!=null&&uue(n,s,r);return o&&{start:o[0],end:o[1],pre:r.slice(0,o[0]),body:r.slice(o[0]+n.length,o[1]),post:r.slice(o[1]+s.length)}},"balanced"),AN=i((e,t)=>{let r=t.match(e);return r?r[0]:null},"maybeMatch"),uue=i((e,t,r)=>{let n,s,o,a,c,l=r.indexOf(e),u=r.indexOf(t,l+1),d=l;if(l>=0&&u>0){if(e===t)return[l,u];for(n=[],o=r.length;d>=0&&!c;){if(d===l)n.push(d),l=r.indexOf(e,d+1);else if(n.length===1){let f=n.pop();f!==void 0&&(c=[f,u])}else s=n.pop(),s!==void 0&&s<o&&(o=s,a=u),u=r.indexOf(t,d+1);d=l<u&&l>=0?l:u}n.length&&a!==void 0&&(c=[o,a])}return c},"range");var RN="\0SLASH"+Math.random()+"\0",TN="\0OPEN"+Math.random()+"\0",M_="\0CLOSE"+Math.random()+"\0",PN="\0COMMA"+Math.random()+"\0",kN="\0PERIOD"+Math.random()+"\0",due=new RegExp(RN,"g"),fue=new RegExp(TN,"g"),hue=new RegExp(M_,"g"),pue=new RegExp(PN,"g"),mue=new RegExp(kN,"g"),gue=/\\\\/g,yue=/\\{/g,Eue=/\\}/g,Sue=/\\,/g,bue=/\\./g;function $_(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}i($_,"numeric");function wue(e){return e.replace(gue,RN).replace(yue,TN).replace(Eue,M_).replace(Sue,PN).replace(bue,kN)}i(wue,"escapeBraces");function Cue(e){return e.replace(due,"\\").replace(fue,"{").replace(hue,"}").replace(pue,",").replace(mue,".")}i(Cue,"unescapeBraces");function ON(e){if(!e)return[""];let t=[],r=B_("{","}",e);if(!r)return e.split(",");let{pre:n,body:s,post:o}=r,a=n.split(",");a[a.length-1]+="{"+s+"}";let c=ON(o);return o.length&&(a[a.length-1]+=c.shift(),a.push.apply(a,c)),t.push.apply(t,a),t}i(ON,"parseCommaParts");function IN(e){return e?(e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),Jd(wue(e),!0).map(Cue)):[]}i(IN,"expand");function _ue(e){return"{"+e+"}"}i(_ue,"embrace");function xue(e){return/^-?0\d/.test(e)}i(xue,"isPadded");function vue(e,t){return e<=t}i(vue,"lte");function Aue(e,t){return e>=t}i(Aue,"gte");function Jd(e,t){let r=[],n=B_("{","}",e);if(!n)return[e];let s=n.pre,o=n.post.length?Jd(n.post,!1):[""];if(/\$$/.test(n.pre))for(let a=0;a<o.length;a++){let c=s+"{"+n.body+"}"+o[a];r.push(c)}else{let a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),l=a||c,u=n.body.indexOf(",")>=0;if(!l&&!u)return n.post.match(/,(?!,).*\}/)?(e=n.pre+"{"+n.body+M_+n.post,Jd(e)):[e];let d;if(l)d=n.body.split(/\.\./);else if(d=ON(n.body),d.length===1&&d[0]!==void 0&&(d=Jd(d[0],!1).map(_ue),d.length===1))return o.map(m=>n.pre+d[0]+m);let f;if(l&&d[0]!==void 0&&d[1]!==void 0){let m=$_(d[0]),g=$_(d[1]),E=Math.max(d[0].length,d[1].length),w=d.length===3&&d[2]!==void 0?Math.abs($_(d[2])):1,C=vue;g<m&&(w*=-1,C=Aue);let D=d.some(xue);f=[];for(let $=m;C($,g);$+=w){let U;if(c)U=String.fromCharCode($),U==="\\"&&(U="");else if(U=String($),D){let ie=E-U.length;if(ie>0){let fe=new Array(ie+1).join("0");$<0?U="-"+fe+U.slice(1):U=fe+U}}f.push(U)}}else{f=[];for(let m=0;m<d.length;m++)f.push.apply(f,Jd(d[m],!1))}for(let m=0;m<f.length;m++)for(let g=0;g<o.length;g++){let E=s+f[m]+o[g];(!t||l||E)&&r.push(E)}}return r}i(Jd,"expand_");var wGe=65536,Qd=i(e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var Rue={"[: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]},Zd=i(e=>e.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),Tue=i(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),DN=i(e=>e.join(""),"rangesToString"),NN=i((e,t)=>{let r=t;if(e.charAt(r)!=="[")throw new Error("not in a brace expression");let n=[],s=[],o=r+1,a=!1,c=!1,l=!1,u=!1,d=r,f="";e:for(;o<e.length;){let w=e.charAt(o);if((w==="!"||w==="^")&&o===r+1){u=!0,o++;continue}if(w==="]"&&a&&!l){d=o+1;break}if(a=!0,w==="\\"&&!l){l=!0,o++;continue}if(w==="["&&!l){for(let[C,[v,D,$]]of Object.entries(Rue))if(e.startsWith(C,o)){if(f)return["$.",!1,e.length-r,!0];o+=C.length,$?s.push(v):n.push(v),c=c||D;continue e}}if(l=!1,f){w>f?n.push(Zd(f)+"-"+Zd(w)):w===f&&n.push(Zd(w)),f="",o++;continue}if(e.startsWith("-]",o+1)){n.push(Zd(w+"-")),o+=2;continue}if(e.startsWith("-",o+1)){f=w,o+=2;continue}n.push(Zd(w)),o++}if(d<o)return["",!1,0,!1];if(!n.length&&!s.length)return["$.",!1,e.length-r,!0];if(s.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!u){let w=n[0].length===2?n[0].slice(-1):n[0];return[Tue(w),!1,d-r,!1]}let m="["+(u?"^":"")+DN(n)+"]",g="["+(u?"":"^")+DN(s)+"]";return[n.length&&s.length?"("+m+"|"+g+")":n.length?m:g,c,d-r,!0]},"parseClass");var Fs=i((e,{windowsPathsNoEscape:t=!1,magicalBraces:r=!0}={})=>r?t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):t?e.replace(/\[([^\/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1"),"unescape");var Pue=new Set(["!","?","+","*","@"]),BN=i(e=>Pue.has(e),"isExtglobType"),kue="(?!(?:^|/)\\.\\.?(?:$|/))",wm="(?!\\.)",Oue=new Set(["[","."]),Iue=new Set(["..","."]),Due=new Set("().*{}+?[]^$\\!"),Nue=i(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),L_="[^/]",MN=L_+"*?",$N=L_+"+?",hl=class e{static{i(this,"AST")}type;#t;#r;#n=!1;#e=[];#o;#c;#l;#d=!1;#u;#a;#s=!1;constructor(t,r,n={}){this.type=t,t&&(this.#r=!0),this.#o=r,this.#t=this.#o?this.#o.#t:this,this.#u=this.#t===this?n:this.#t.#u,this.#l=this.#t===this?[]:this.#t.#l,t==="!"&&!this.#t.#d&&this.#l.push(this),this.#c=this.#o?this.#o.#e.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let t of this.#e)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#a!==void 0?this.#a:this.type?this.#a=this.type+"("+this.#e.map(t=>String(t)).join("|")+")":this.#a=this.#e.map(t=>String(t)).join("")}#y(){if(this!==this.#t)throw new Error("should only call on root");if(this.#d)return this;this.toString(),this.#d=!0;let t;for(;t=this.#l.pop();){if(t.type!=="!")continue;let r=t,n=r.#o;for(;n;){for(let s=r.#c+1;!n.type&&s<n.#e.length;s++)for(let o of t.#e){if(typeof o=="string")throw new Error("string part in extglob AST??");o.copyIn(n.#e[s])}r=n,n=r.#o}}return this}push(...t){for(let r of t)if(r!==""){if(typeof r!="string"&&!(r instanceof e&&r.#o===this))throw new Error("invalid part: "+r);this.#e.push(r)}}toJSON(){let t=this.type===null?this.#e.slice().map(r=>typeof r=="string"?r:r.toJSON()):[this.type,...this.#e.map(r=>r.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#d&&this.#o?.type==="!")&&t.push({}),t}isStart(){if(this.#t===this)return!0;if(!this.#o?.isStart())return!1;if(this.#c===0)return!0;let t=this.#o;for(let r=0;r<this.#c;r++){let n=t.#e[r];if(!(n instanceof e&&n.type==="!"))return!1}return!0}isEnd(){if(this.#t===this||this.#o?.type==="!")return!0;if(!this.#o?.isEnd())return!1;if(!this.type)return this.#o?.isEnd();let t=this.#o?this.#o.#e.length:0;return this.#c===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let r=new e(this.type,t);for(let n of this.#e)r.copyIn(n);return r}static#p(t,r,n,s){let o=!1,a=!1,c=-1,l=!1;if(r.type===null){let g=n,E="";for(;g<t.length;){let w=t.charAt(g++);if(o||w==="\\"){o=!o,E+=w;continue}if(a){g===c+1?(w==="^"||w==="!")&&(l=!0):w==="]"&&!(g===c+2&&l)&&(a=!1),E+=w;continue}else if(w==="["){a=!0,c=g,l=!1,E+=w;continue}if(!s.noext&&BN(w)&&t.charAt(g)==="("){r.push(E),E="";let C=new e(w,r);g=e.#p(t,C,g,s),r.push(C);continue}E+=w}return r.push(E),g}let u=n+1,d=new e(null,r),f=[],m="";for(;u<t.length;){let g=t.charAt(u++);if(o||g==="\\"){o=!o,m+=g;continue}if(a){u===c+1?(g==="^"||g==="!")&&(l=!0):g==="]"&&!(u===c+2&&l)&&(a=!1),m+=g;continue}else if(g==="["){a=!0,c=u,l=!1,m+=g;continue}if(BN(g)&&t.charAt(u)==="("){d.push(m),m="";let E=new e(g,d);d.push(E),u=e.#p(t,E,u,s);continue}if(g==="|"){d.push(m),m="",f.push(d),d=new e(null,r);continue}if(g===")")return m===""&&r.#e.length===0&&(r.#s=!0),d.push(m),m="",r.push(...f,d),u;m+=g}return r.type=null,r.#r=void 0,r.#e=[t.substring(n-1)],u}static fromGlob(t,r={}){let n=new e(null,void 0,r);return e.#p(t,n,0,r),n}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();let t=this.toString(),[r,n,s,o]=this.toRegExpSource();if(!(s||this.#r||this.#u.nocase&&!this.#u.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return n;let c=(this.#u.nocase?"i":"")+(o?"u":"");return Object.assign(new RegExp(`^${r}$`,c),{_src:r,_glob:t})}get options(){return this.#u}toRegExpSource(t){let r=t??!!this.#u.dot;if(this.#t===this&&this.#y(),!this.type){let l=this.isStart()&&this.isEnd()&&!this.#e.some(g=>typeof g!="string"),u=this.#e.map(g=>{let[E,w,C,v]=typeof g=="string"?e.#g(g,this.#r,l):g.toRegExpSource(t);return this.#r=this.#r||C,this.#n=this.#n||v,E}).join(""),d="";if(this.isStart()&&typeof this.#e[0]=="string"&&!(this.#e.length===1&&Iue.has(this.#e[0]))){let E=Oue,w=r&&E.has(u.charAt(0))||u.startsWith("\\.")&&E.has(u.charAt(2))||u.startsWith("\\.\\.")&&E.has(u.charAt(4)),C=!r&&!t&&E.has(u.charAt(0));d=w?kue:C?wm:""}let f="";return this.isEnd()&&this.#t.#d&&this.#o?.type==="!"&&(f="(?:$|\\/)"),[d+u+f,Fs(u),this.#r=!!this.#r,this.#n]}let n=this.type==="*"||this.type==="+",s=this.type==="!"?"(?:(?!(?:":"(?:",o=this.#m(r);if(this.isStart()&&this.isEnd()&&!o&&this.type!=="!"){let l=this.toString();return this.#e=[l],this.type=null,this.#r=void 0,[l,Fs(this.toString()),!1,!1]}let a=!n||t||r||!wm?"":this.#m(!0);a===o&&(a=""),a&&(o=`(?:${o})(?:${a})*?`);let c="";if(this.type==="!"&&this.#s)c=(this.isStart()&&!r?wm:"")+$N;else{let l=this.type==="!"?"))"+(this.isStart()&&!r&&!t?wm:"")+MN+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;c=s+o+l}return[c,Fs(o),this.#r=!!this.#r,this.#n]}#m(t){return this.#e.map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");let[n,s,o,a]=r.toRegExpSource(t);return this.#n=this.#n||a,n}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")}static#g(t,r,n=!1){let s=!1,o="",a=!1;for(let c=0;c<t.length;c++){let l=t.charAt(c);if(s){s=!1,o+=(Due.has(l)?"\\":"")+l;continue}if(l==="\\"){c===t.length-1?o+="\\\\":s=!0;continue}if(l==="["){let[u,d,f,m]=NN(t,c);if(f){o+=u,a=a||d,c+=f-1,r=r||m;continue}}if(l==="*"){o+=n&&t==="*"?$N:MN,r=!0;continue}if(l==="?"){o+=L_,r=!0;continue}o+=Nue(l)}return[o,Fs(t),!!r,a]}};var pl=i((e,{windowsPathsNoEscape:t=!1,magicalBraces:r=!1}={})=>r?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var En=i((e,t,r={})=>(Qd(t),!r.nocomment&&t.charAt(0)==="#"?!1:new Jn(t,r).match(e)),"minimatch"),Bue=/^\*+([^+@!?\*\[\(]*)$/,Mue=i(e=>t=>!t.startsWith(".")&&t.endsWith(e),"starDotExtTest"),$ue=i(e=>t=>t.endsWith(e),"starDotExtTestDot"),Lue=i(e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),"starDotExtTestNocase"),Fue=i(e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),"starDotExtTestNocaseDot"),jue=/^\*+\.\*+$/,Uue=i(e=>!e.startsWith(".")&&e.includes("."),"starDotStarTest"),que=i(e=>e!=="."&&e!==".."&&e.includes("."),"starDotStarTestDot"),Hue=/^\.\*+$/,Gue=i(e=>e!=="."&&e!==".."&&e.startsWith("."),"dotStarTest"),zue=/^\*+$/,Vue=i(e=>e.length!==0&&!e.startsWith("."),"starTest"),Wue=i(e=>e.length!==0&&e!=="."&&e!=="..","starTestDot"),Kue=/^\?+([^+@!?\*\[\(]*)?$/,Yue=i(([e,t=""])=>{let r=LN([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},"qmarksTestNocase"),Xue=i(([e,t=""])=>{let r=FN([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},"qmarksTestNocaseDot"),Jue=i(([e,t=""])=>{let r=FN([e]);return t?n=>r(n)&&n.endsWith(t):r},"qmarksTestDot"),Que=i(([e,t=""])=>{let r=LN([e]);return t?n=>r(n)&&n.endsWith(t):r},"qmarksTest"),LN=i(([e])=>{let t=e.length;return r=>r.length===t&&!r.startsWith(".")},"qmarksTestNoExt"),FN=i(([e])=>{let t=e.length;return r=>r.length===t&&r!=="."&&r!==".."},"qmarksTestNoExtDot"),jN=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",UN={win32:{sep:"\\"},posix:{sep:"/"}},Zue=jN==="win32"?UN.win32.sep:UN.posix.sep;En.sep=Zue;var Hr=Symbol("globstar **");En.GLOBSTAR=Hr;var ede="[^/]",tde=ede+"*?",rde="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",nde="(?:(?!(?:\\/|^)\\.).)*?",sde=i((e,t={})=>r=>En(r,e,t),"filter");En.filter=sde;var gs=i((e,t={})=>Object.assign({},e,t),"ext"),ide=i(e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return En;let t=En;return Object.assign(i((n,s,o={})=>t(n,s,gs(e,o)),"m"),{Minimatch:class extends t.Minimatch{static{i(this,"Minimatch")}constructor(s,o={}){super(s,gs(e,o))}static defaults(s){return t.defaults(gs(e,s)).Minimatch}},AST:class extends t.AST{static{i(this,"AST")}constructor(s,o,a={}){super(s,o,gs(e,a))}static fromGlob(s,o={}){return t.AST.fromGlob(s,gs(e,o))}},unescape:i((n,s={})=>t.unescape(n,gs(e,s)),"unescape"),escape:i((n,s={})=>t.escape(n,gs(e,s)),"escape"),filter:i((n,s={})=>t.filter(n,gs(e,s)),"filter"),defaults:i(n=>t.defaults(gs(e,n)),"defaults"),makeRe:i((n,s={})=>t.makeRe(n,gs(e,s)),"makeRe"),braceExpand:i((n,s={})=>t.braceExpand(n,gs(e,s)),"braceExpand"),match:i((n,s,o={})=>t.match(n,s,gs(e,o)),"match"),sep:t.sep,GLOBSTAR:Hr})},"defaults");En.defaults=ide;var qN=i((e,t={})=>(Qd(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:IN(e)),"braceExpand");En.braceExpand=qN;var ode=i((e,t={})=>new Jn(e,t).makeRe(),"makeRe");En.makeRe=ode;var ade=i((e,t,r={})=>{let n=new Jn(t,r);return e=e.filter(s=>n.match(s)),n.options.nonull&&!e.length&&e.push(t),e},"match");En.match=ade;var HN=/[?*]|[+@!]\(.*?\)|\[|\]/,cde=i(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Jn=class{static{i(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,r={}){Qd(t),r=r||{},this.options=r,this.pattern=t,this.platform=r.platform||jN,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.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 r of t)if(typeof r!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,r=this.options;if(!r.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...o)=>console.error(...o)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(o=>this.slashSplit(o));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let s=this.globParts.map((o,a,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let l=o[0]===""&&o[1]===""&&(o[2]==="?"||!HN.test(o[2]))&&!HN.test(o[3]),u=/^[a-z]:/i.test(o[0]);if(l)return[...o.slice(0,4),...o.slice(4).map(d=>this.parse(d))];if(u)return[o[0],...o.slice(1).map(d=>this.parse(d))]}return o.map(l=>this.parse(l))});if(this.debug(this.pattern,s),this.set=s.filter(o=>o.indexOf(!1)===-1),this.isWindows)for(let o=0;o<this.set.length;o++){let a=this.set[o];a[0]===""&&a[1]===""&&this.globParts[o][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let n=0;n<t.length;n++)for(let s=0;s<t[n].length;s++)t[n][s]==="**"&&(t[n][s]="*");let{optimizationLevel:r=1}=this.options;return r>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):r>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(r=>{let n=-1;for(;(n=r.indexOf("**",n+1))!==-1;){let s=n;for(;r[s+1]==="**";)s++;s!==n&&r.splice(n,s-n)}return r})}levelOneOptimize(t){return t.map(r=>(r=r.reduce((n,s)=>{let o=n[n.length-1];return s==="**"&&o==="**"?n:s===".."&&o&&o!==".."&&o!=="."&&o!=="**"?(n.pop(),n):(n.push(s),n)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let s=1;s<t.length-1;s++){let o=t[s];s===1&&o===""&&t[0]===""||(o==="."||o==="")&&(r=!0,t.splice(s,1),s--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(r=!0,t.pop())}let n=0;for(;(n=t.indexOf("..",n+1))!==-1;){let s=t[n-1];s&&s!=="."&&s!==".."&&s!=="**"&&(r=!0,t.splice(n-1,2),n-=2)}}while(r);return t.length===0?[""]:t}firstPhasePreProcess(t){let r=!1;do{r=!1;for(let n of t){let s=-1;for(;(s=n.indexOf("**",s+1))!==-1;){let a=s;for(;n[a+1]==="**";)a++;a>s&&n.splice(s+1,a-s);let c=n[s+1],l=n[s+2],u=n[s+3];if(c!==".."||!l||l==="."||l===".."||!u||u==="."||u==="..")continue;r=!0,n.splice(s,1);let d=n.slice(0);d[s]="**",t.push(d),s--}if(!this.preserveMultipleSlashes){for(let a=1;a<n.length-1;a++){let c=n[a];a===1&&c===""&&n[0]===""||(c==="."||c==="")&&(r=!0,n.splice(a,1),a--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(r=!0,n.pop())}let o=0;for(;(o=n.indexOf("..",o+1))!==-1;){let a=n[o-1];if(a&&a!=="."&&a!==".."&&a!=="**"){r=!0;let l=o===1&&n[o+1]==="**"?["."]:[];n.splice(o-1,2,...l),n.length===0&&n.push(""),o-=2}}}}while(r);return t}secondPhasePreProcess(t){for(let r=0;r<t.length-1;r++)for(let n=r+1;n<t.length;n++){let s=this.partsMatch(t[r],t[n],!this.preserveMultipleSlashes);if(s){t[r]=[],t[n]=s;break}}return t.filter(r=>r.length)}partsMatch(t,r,n=!1){let s=0,o=0,a=[],c="";for(;s<t.length&&o<r.length;)if(t[s]===r[o])a.push(c==="b"?r[o]:t[s]),s++,o++;else if(n&&t[s]==="**"&&r[o]===t[s+1])a.push(t[s]),s++;else if(n&&r[o]==="**"&&t[s]===r[o+1])a.push(r[o]),o++;else if(t[s]==="*"&&r[o]&&(this.options.dot||!r[o].startsWith("."))&&r[o]!=="**"){if(c==="b")return!1;c="a",a.push(t[s]),s++,o++}else if(r[o]==="*"&&t[s]&&(this.options.dot||!t[s].startsWith("."))&&t[s]!=="**"){if(c==="a")return!1;c="b",a.push(r[o]),s++,o++}else return!1;return t.length===r.length&&a}parseNegate(){if(this.nonegate)return;let t=this.pattern,r=!1,n=0;for(let s=0;s<t.length&&t.charAt(s)==="!";s++)r=!r,n++;n&&(this.pattern=t.slice(n)),this.negate=r}matchOne(t,r,n=!1){let s=this.options;if(this.isWindows){let w=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),C=!w&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),v=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),D=!v&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),$=C?3:w?0:void 0,U=D?3:v?0:void 0;if(typeof $=="number"&&typeof U=="number"){let[ie,fe]=[t[$],r[U]];ie.toLowerCase()===fe.toLowerCase()&&(r[U]=ie,U>$?r=r.slice(U):$>U&&(t=t.slice($)))}}let{optimizationLevel:o=1}=this.options;o>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:r}),this.debug("matchOne",t.length,r.length);for(var a=0,c=0,l=t.length,u=r.length;a<l&&c<u;a++,c++){this.debug("matchOne loop");var d=r[c],f=t[a];if(this.debug(r,d,f),d===!1)return!1;if(d===Hr){this.debug("GLOBSTAR",[r,d,f]);var m=a,g=c+1;if(g===u){for(this.debug("** at the end");a<l;a++)if(t[a]==="."||t[a]===".."||!s.dot&&t[a].charAt(0)===".")return!1;return!0}for(;m<l;){var E=t[m];if(this.debug(`
87
87
  globstar while`,t,m,r,g,E),this.matchOne(t.slice(m),r.slice(g),n))return this.debug("globstar found match!",m,l,E),!0;if(E==="."||E===".."||!s.dot&&E.charAt(0)==="."){this.debug("dot detected!",t,m,r,g);break}this.debug("globstar swallow a segment, and continue"),m++}return!!(n&&(this.debug(`
88
- >>> no match, partial?`,t,m,r,g),m===l))}let w;if(typeof d=="string"?(w=f===d,this.debug("string match",d,f,w)):(w=d.test(f),this.debug("pattern match",d,f,w)),!w)return!1}if(a===l&&c===u)return!0;if(a===l)return n;if(c===u)return a===l-1&&t[a]==="";throw new Error("wtf?")}braceExpand(){return qN(this.pattern,this.options)}parse(t){Qd(t);let r=this.options;if(t==="**")return Hr;if(t==="")return"";let n,s=null;(n=t.match(zue))?s=r.dot?Wue:Vue:(n=t.match(Bue))?s=(r.nocase?r.dot?Fue:Lue:r.dot?$ue:Mue)(n[1]):(n=t.match(Kue))?s=(r.nocase?r.dot?Xue:Yue:r.dot?Jue:Que)(n):(n=t.match(jue))?s=r.dot?que:Uue:(n=t.match(Hue))&&(s=Gue);let o=hl.fromGlob(t,this.options).toMMPattern();return s&&typeof o=="object"&&Reflect.defineProperty(o,"test",{value:s}),o}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let r=this.options,n=r.noglobstar?tde:r.dot?rde:nde,s=new Set(r.nocase?["i"]:[]),o=t.map(l=>{let u=l.map(f=>{if(f instanceof RegExp)for(let m of f.flags.split(""))s.add(m);return typeof f=="string"?cde(f):f===Hr?Hr:f._src});u.forEach((f,m)=>{let g=u[m+1],E=u[m-1];f!==Hr||E===Hr||(E===void 0?g!==void 0&&g!==Hr?u[m+1]="(?:\\/|"+n+"\\/)?"+g:u[m]=n:g===void 0?u[m-1]=E+"(?:\\/|\\/"+n+")?":g!==Hr&&(u[m-1]=E+"(?:\\/|\\/"+n+"\\/)"+g,u[m+1]=Hr))});let d=u.filter(f=>f!==Hr);if(this.partial&&d.length>=1){let f=[];for(let m=1;m<=d.length;m++)f.push(d.slice(0,m).join("/"));return"(?:"+f.join("|")+")"}return d.join("/")}).join("|"),[a,c]=t.length>1?["(?:",")"]:["",""];o="^"+a+o+c+"$",this.partial&&(o="^(?:\\/|"+a+o.slice(1,-1)+c+")$"),this.negate&&(o="^(?!"+o+").+$");try{this.regexp=new RegExp(o,[...s].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,r=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&r)return!0;let n=this.options;this.isWindows&&(t=t.split("\\").join("/"));let s=this.slashSplit(t);this.debug(this.pattern,"split",s);let o=this.set;this.debug(this.pattern,"set",o);let a=s[s.length-1];if(!a)for(let c=s.length-2;!a&&c>=0;c--)a=s[c];for(let c=0;c<o.length;c++){let l=o[c],u=s;if(n.matchBase&&l.length===1&&(u=[a]),this.matchOne(u,l,r))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(t){return En.defaults(t).Minimatch}};En.AST=hl,En.Minimatch=Jn,En.escape=pl,En.unescape=Fs;var ml=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,GN=new Set,F_=typeof process=="object"&&process?process:{},zN=i((e,t,r,n)=>{typeof F_.emitWarning=="function"?F_.emitWarning(e,t,r,n):console.error(`[${r}] ${t}: ${e}`)},"emitWarning"),Cm=globalThis.AbortController,VN=globalThis.AbortSignal;if(typeof Cm>"u"){VN=class{static{i(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(n,s){this._onabort.push(s)}},Cm=class{static{i(this,"AbortController")}constructor(){t()}signal=new VN;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let s of this.signal._onabort)s(n);this.signal.onabort?.(n)}}};let e=F_.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=i(()=>{e&&(e=!1,zN("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))},"warnACPolyfill")}var lde=i(e=>!GN.has(e),"shouldWarn"),KGe=Symbol("type"),Uo=i(e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),"isPosInt"),WN=i(e=>Uo(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?gl:null:null,"getUintArray"),gl=class extends Array{static{i(this,"ZeroArray")}constructor(t){super(t),this.fill(0)}},j_=class e{static{i(this,"Stack")}heap;length;static#t=!1;static create(t){let r=WN(t);if(!r)return[];e.#t=!0;let n=new e(t,r);return e.#t=!1,n}constructor(t,r){if(!e.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},ef=class e{static{i(this,"LRUCache")}#t;#r;#n;#e;#o;#c;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#d;#u;#a;#s;#y;#p;#m;#g;#v;#E;#_;#x;#S;#w;#C;#h;static unsafeExposeInternals(t){return{starts:t.#x,ttls:t.#S,sizes:t.#_,keyMap:t.#u,keyList:t.#a,valList:t.#s,next:t.#y,prev:t.#p,get head(){return t.#m},get tail(){return t.#g},free:t.#v,isBackgroundFetch:i(r=>t.#f(r),"isBackgroundFetch"),backgroundFetch:i((r,n,s,o)=>t.#L(r,n,s,o),"backgroundFetch"),moveToTail:i(r=>t.#j(r),"moveToTail"),indexes:i(r=>t.#T(r),"indexes"),rindexes:i(r=>t.#P(r),"rindexes"),isStale:i(r=>t.#b(r),"isStale")}}get max(){return this.#t}get maxSize(){return this.#r}get calculatedSize(){return this.#d}get size(){return this.#l}get fetchMethod(){return this.#o}get memoMethod(){return this.#c}get dispose(){return this.#n}get disposeAfter(){return this.#e}constructor(t){let{max:r=0,ttl:n,ttlResolution:s=1,ttlAutopurge:o,updateAgeOnGet:a,updateAgeOnHas:c,allowStale:l,dispose:u,disposeAfter:d,noDisposeOnSet:f,noUpdateTTL:m,maxSize:g=0,maxEntrySize:E=0,sizeCalculation:w,fetchMethod:C,memoMethod:v,noDeleteOnFetchRejection:D,noDeleteOnStaleGet:$,allowStaleOnFetchRejection:U,allowStaleOnFetchAbort:ie,ignoreFetchAbort:fe}=t;if(r!==0&&!Uo(r))throw new TypeError("max option must be a nonnegative integer");let Me=r?WN(r):Array;if(!Me)throw new Error("invalid max value: "+r);if(this.#t=r,this.#r=g,this.maxEntrySize=E||this.#r,this.sizeCalculation=w,this.sizeCalculation){if(!this.#r&&!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(v!==void 0&&typeof v!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#c=v,C!==void 0&&typeof C!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=C,this.#C=!!C,this.#u=new Map,this.#a=new Array(r).fill(void 0),this.#s=new Array(r).fill(void 0),this.#y=new Me(r),this.#p=new Me(r),this.#m=0,this.#g=0,this.#v=j_.create(r),this.#l=0,this.#d=0,typeof u=="function"&&(this.#n=u),typeof d=="function"?(this.#e=d,this.#E=[]):(this.#e=void 0,this.#E=void 0),this.#w=!!this.#n,this.#h=!!this.#e,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!D,this.allowStaleOnFetchRejection=!!U,this.allowStaleOnFetchAbort=!!ie,this.ignoreFetchAbort=!!fe,this.maxEntrySize!==0){if(this.#r!==0&&!Uo(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!Uo(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#O()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!$,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!c,this.ttlResolution=Uo(s)||s===0?s:1,this.ttlAutopurge=!!o,this.ttl=n||0,this.ttl){if(!Uo(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#R()}if(this.#t===0&&this.ttl===0&&this.#r===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#r){let Se="LRU_CACHE_UNBOUNDED";lde(Se)&&(GN.add(Se),zN("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Se,e))}}getRemainingTTL(t){return this.#u.has(t)?1/0:0}#R(){let t=new gl(this.#t),r=new gl(this.#t);this.#S=t,this.#x=r,this.#k=(o,a,c=ml.now())=>{if(r[o]=a!==0?c:0,t[o]=a,a!==0&&this.ttlAutopurge){let l=setTimeout(()=>{this.#b(o)&&this.#I(this.#a[o],"expire")},a+1);l.unref&&l.unref()}},this.#A=o=>{r[o]=t[o]!==0?ml.now():0},this.#i=(o,a)=>{if(t[a]){let c=t[a],l=r[a];if(!c||!l)return;o.ttl=c,o.start=l,o.now=n||s();let u=o.now-l;o.remainingTTL=c-u}};let n=0,s=i(()=>{let o=ml.now();if(this.ttlResolution>0){n=o;let a=setTimeout(()=>n=0,this.ttlResolution);a.unref&&a.unref()}return o},"getNow");this.getRemainingTTL=o=>{let a=this.#u.get(o);if(a===void 0)return 0;let c=t[a],l=r[a];if(!c||!l)return 1/0;let u=(n||s())-l;return c-u},this.#b=o=>{let a=r[o],c=t[o];return!!c&&!!a&&(n||s())-a>c}}#A=i(()=>{},"#updateItemAge");#i=i(()=>{},"#statusTTL");#k=i(()=>{},"#setItemTTL");#b=i(()=>!1,"#isStale");#O(){let t=new gl(this.#t);this.#d=0,this.#_=t,this.#D=r=>{this.#d-=t[r],t[r]=0},this.#B=(r,n,s,o)=>{if(this.#f(n))return 0;if(!Uo(s))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(s=o(n,r),!Uo(s))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 s},this.#N=(r,n,s)=>{if(t[r]=n,this.#r){let o=this.#r-t[r];for(;this.#d>o;)this.#$(!0)}this.#d+=t[r],s&&(s.entrySize=n,s.totalCalculatedSize=this.#d)}}#D=i(t=>{},"#removeItemSize");#N=i((t,r,n)=>{},"#addItemSize");#B=i((t,r,n,s)=>{if(n||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#T({allowStale:t=this.allowStale}={}){if(this.#l)for(let r=this.#g;!(!this.#M(r)||((t||!this.#b(r))&&(yield r),r===this.#m));)r=this.#p[r]}*#P({allowStale:t=this.allowStale}={}){if(this.#l)for(let r=this.#m;!(!this.#M(r)||((t||!this.#b(r))&&(yield r),r===this.#g));)r=this.#y[r]}#M(t){return t!==void 0&&this.#u.get(this.#a[t])===t}*entries(){for(let t of this.#T())this.#s[t]!==void 0&&this.#a[t]!==void 0&&!this.#f(this.#s[t])&&(yield[this.#a[t],this.#s[t]])}*rentries(){for(let t of this.#P())this.#s[t]!==void 0&&this.#a[t]!==void 0&&!this.#f(this.#s[t])&&(yield[this.#a[t],this.#s[t]])}*keys(){for(let t of this.#T()){let r=this.#a[t];r!==void 0&&!this.#f(this.#s[t])&&(yield r)}}*rkeys(){for(let t of this.#P()){let r=this.#a[t];r!==void 0&&!this.#f(this.#s[t])&&(yield r)}}*values(){for(let t of this.#T())this.#s[t]!==void 0&&!this.#f(this.#s[t])&&(yield this.#s[t])}*rvalues(){for(let t of this.#P())this.#s[t]!==void 0&&!this.#f(this.#s[t])&&(yield this.#s[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,r={}){for(let n of this.#T()){let s=this.#s[n],o=this.#f(s)?s.__staleWhileFetching:s;if(o!==void 0&&t(o,this.#a[n],this))return this.get(this.#a[n],r)}}forEach(t,r=this){for(let n of this.#T()){let s=this.#s[n],o=this.#f(s)?s.__staleWhileFetching:s;o!==void 0&&t.call(r,o,this.#a[n],this)}}rforEach(t,r=this){for(let n of this.#P()){let s=this.#s[n],o=this.#f(s)?s.__staleWhileFetching:s;o!==void 0&&t.call(r,o,this.#a[n],this)}}purgeStale(){let t=!1;for(let r of this.#P({allowStale:!0}))this.#b(r)&&(this.#I(this.#a[r],"expire"),t=!0);return t}info(t){let r=this.#u.get(t);if(r===void 0)return;let n=this.#s[r],s=this.#f(n)?n.__staleWhileFetching:n;if(s===void 0)return;let o={value:s};if(this.#S&&this.#x){let a=this.#S[r],c=this.#x[r];if(a&&c){let l=a-(ml.now()-c);o.ttl=l,o.start=Date.now()}}return this.#_&&(o.size=this.#_[r]),o}dump(){let t=[];for(let r of this.#T({allowStale:!0})){let n=this.#a[r],s=this.#s[r],o=this.#f(s)?s.__staleWhileFetching:s;if(o===void 0||n===void 0)continue;let a={value:o};if(this.#S&&this.#x){a.ttl=this.#S[r];let c=ml.now()-this.#x[r];a.start=Math.floor(Date.now()-c)}this.#_&&(a.size=this.#_[r]),t.unshift([n,a])}return t}load(t){this.clear();for(let[r,n]of t){if(n.start){let s=Date.now()-n.start;n.start=ml.now()-s}this.set(r,n.value,n)}}set(t,r,n={}){if(r===void 0)return this.delete(t),this;let{ttl:s=this.ttl,start:o,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:l}=n,{noUpdateTTL:u=this.noUpdateTTL}=n,d=this.#B(t,r,n.size||0,c);if(this.maxEntrySize&&d>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.#I(t,"set"),this;let f=this.#l===0?void 0:this.#u.get(t);if(f===void 0)f=this.#l===0?this.#g:this.#v.length!==0?this.#v.pop():this.#l===this.#t?this.#$(!1):this.#l,this.#a[f]=t,this.#s[f]=r,this.#u.set(t,f),this.#y[this.#g]=f,this.#p[f]=this.#g,this.#g=f,this.#l++,this.#N(f,d,l),l&&(l.set="add"),u=!1;else{this.#j(f);let m=this.#s[f];if(r!==m){if(this.#C&&this.#f(m)){m.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=m;g!==void 0&&!a&&(this.#w&&this.#n?.(g,t,"set"),this.#h&&this.#E?.push([g,t,"set"]))}else a||(this.#w&&this.#n?.(m,t,"set"),this.#h&&this.#E?.push([m,t,"set"]));if(this.#D(f),this.#N(f,d,l),this.#s[f]=r,l){l.set="replace";let g=m&&this.#f(m)?m.__staleWhileFetching:m;g!==void 0&&(l.oldValue=g)}}else l&&(l.set="update")}if(s!==0&&!this.#S&&this.#R(),this.#S&&(u||this.#k(f,s,o),l&&this.#i(l,f)),!a&&this.#h&&this.#E){let m=this.#E,g;for(;g=m?.shift();)this.#e?.(...g)}return this}pop(){try{for(;this.#l;){let t=this.#s[this.#m];if(this.#$(!0),this.#f(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#h&&this.#E){let t=this.#E,r;for(;r=t?.shift();)this.#e?.(...r)}}}#$(t){let r=this.#m,n=this.#a[r],s=this.#s[r];return this.#C&&this.#f(s)?s.__abortController.abort(new Error("evicted")):(this.#w||this.#h)&&(this.#w&&this.#n?.(s,n,"evict"),this.#h&&this.#E?.push([s,n,"evict"])),this.#D(r),t&&(this.#a[r]=void 0,this.#s[r]=void 0,this.#v.push(r)),this.#l===1?(this.#m=this.#g=0,this.#v.length=0):this.#m=this.#y[r],this.#u.delete(n),this.#l--,r}has(t,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:s}=r,o=this.#u.get(t);if(o!==void 0){let a=this.#s[o];if(this.#f(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#b(o))s&&(s.has="stale",this.#i(s,o));else return n&&this.#A(o),s&&(s.has="hit",this.#i(s,o)),!0}else s&&(s.has="miss");return!1}peek(t,r={}){let{allowStale:n=this.allowStale}=r,s=this.#u.get(t);if(s===void 0||!n&&this.#b(s))return;let o=this.#s[s];return this.#f(o)?o.__staleWhileFetching:o}#L(t,r,n,s){let o=r===void 0?void 0:this.#s[r];if(this.#f(o))return o;let a=new Cm,{signal:c}=n;c?.addEventListener("abort",()=>a.abort(c.reason),{signal:a.signal});let l={signal:a.signal,options:n,context:s},u=i((w,C=!1)=>{let{aborted:v}=a.signal,D=n.ignoreFetchAbort&&w!==void 0;if(n.status&&(v&&!C?(n.status.fetchAborted=!0,n.status.fetchError=a.signal.reason,D&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),v&&!D&&!C)return f(a.signal.reason);let $=g;return this.#s[r]===g&&(w===void 0?$.__staleWhileFetching?this.#s[r]=$.__staleWhileFetching:this.#I(t,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(t,w,l.options))),w},"cb"),d=i(w=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=w),f(w)),"eb"),f=i(w=>{let{aborted:C}=a.signal,v=C&&n.allowStaleOnFetchAbort,D=v||n.allowStaleOnFetchRejection,$=D||n.noDeleteOnFetchRejection,U=g;if(this.#s[r]===g&&(!$||U.__staleWhileFetching===void 0?this.#I(t,"fetch"):v||(this.#s[r]=U.__staleWhileFetching)),D)return n.status&&U.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),U.__staleWhileFetching;if(U.__returned===U)throw w},"fetchFail"),m=i((w,C)=>{let v=this.#o?.(t,o,l);v&&v instanceof Promise&&v.then(D=>w(D===void 0?void 0:D),C),a.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(w(void 0),n.allowStaleOnFetchAbort&&(w=i(D=>u(D,!0),"res")))})},"pcall");n.status&&(n.status.fetchDispatched=!0);let g=new Promise(m).then(u,d),E=Object.assign(g,{__abortController:a,__staleWhileFetching:o,__returned:void 0});return r===void 0?(this.set(t,E,{...l.options,status:void 0}),r=this.#u.get(t)):this.#s[r]=E,E}#f(t){if(!this.#C)return!1;let r=t;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof Cm}async fetch(t,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:E=this.allowStaleOnFetchAbort,context:w,forceRefresh:C=!1,status:v,signal:D}=r;if(!this.#C)return v&&(v.fetch="get"),this.get(t,{allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:o,status:v});let $={allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:o,ttl:a,noDisposeOnSet:c,size:l,sizeCalculation:u,noUpdateTTL:d,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:E,ignoreFetchAbort:g,status:v,signal:D},U=this.#u.get(t);if(U===void 0){v&&(v.fetch="miss");let ie=this.#L(t,U,$,w);return ie.__returned=ie}else{let ie=this.#s[U];if(this.#f(ie)){let G=n&&ie.__staleWhileFetching!==void 0;return v&&(v.fetch="inflight",G&&(v.returnedStale=!0)),G?ie.__staleWhileFetching:ie.__returned=ie}let fe=this.#b(U);if(!C&&!fe)return v&&(v.fetch="hit"),this.#j(U),s&&this.#A(U),v&&this.#i(v,U),ie;let Me=this.#L(t,U,$,w),j=Me.__staleWhileFetching!==void 0&&n;return v&&(v.fetch=fe?"stale":"refresh",j&&fe&&(v.returnedStale=!0)),j?Me.__staleWhileFetching:Me.__returned=Me}}async forceFetch(t,r={}){let n=await this.fetch(t,r);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(t,r={}){let n=this.#c;if(!n)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:o,...a}=r,c=this.get(t,a);if(!o&&c!==void 0)return c;let l=n(t,c,{options:a,context:s});return this.set(t,l,a),l}get(t,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:a}=r,c=this.#u.get(t);if(c!==void 0){let l=this.#s[c],u=this.#f(l);return a&&this.#i(a,c),this.#b(c)?(a&&(a.get="stale"),u?(a&&n&&l.__staleWhileFetching!==void 0&&(a.returnedStale=!0),n?l.__staleWhileFetching:void 0):(o||this.#I(t,"expire"),a&&n&&(a.returnedStale=!0),n?l:void 0)):(a&&(a.get="hit"),u?l.__staleWhileFetching:(this.#j(c),s&&this.#A(c),l))}else a&&(a.get="miss")}#F(t,r){this.#p[r]=t,this.#y[t]=r}#j(t){t!==this.#g&&(t===this.#m?this.#m=this.#y[t]:this.#F(this.#p[t],this.#y[t]),this.#F(this.#g,t),this.#g=t)}delete(t){return this.#I(t,"delete")}#I(t,r){let n=!1;if(this.#l!==0){let s=this.#u.get(t);if(s!==void 0)if(n=!0,this.#l===1)this.#U(r);else{this.#D(s);let o=this.#s[s];if(this.#f(o)?o.__abortController.abort(new Error("deleted")):(this.#w||this.#h)&&(this.#w&&this.#n?.(o,t,r),this.#h&&this.#E?.push([o,t,r])),this.#u.delete(t),this.#a[s]=void 0,this.#s[s]=void 0,s===this.#g)this.#g=this.#p[s];else if(s===this.#m)this.#m=this.#y[s];else{let a=this.#p[s];this.#y[a]=this.#y[s];let c=this.#y[s];this.#p[c]=this.#p[s]}this.#l--,this.#v.push(s)}}if(this.#h&&this.#E?.length){let s=this.#E,o;for(;o=s?.shift();)this.#e?.(...o)}return n}clear(){return this.#U("delete")}#U(t){for(let r of this.#P({allowStale:!0})){let n=this.#s[r];if(this.#f(n))n.__abortController.abort(new Error("deleted"));else{let s=this.#a[r];this.#w&&this.#n?.(n,s,t),this.#h&&this.#E?.push([n,s,t])}}if(this.#u.clear(),this.#s.fill(void 0),this.#a.fill(void 0),this.#S&&this.#x&&(this.#S.fill(0),this.#x.fill(0)),this.#_&&this.#_.fill(0),this.#m=0,this.#g=0,this.#v.length=0,this.#d=0,this.#l=0,this.#h&&this.#E){let r=this.#E,n;for(;n=r?.shift();)this.#e?.(...n)}}};var Pm=require("node:events"),W_=k(require("node:stream"),1),QN=require("node:string_decoder"),KN=typeof process=="object"&&process?process:{stdout:null,stderr:null},ude=i(e=>!!e&&typeof e=="object"&&(e instanceof Ho||e instanceof W_.default||dde(e)||fde(e)),"isStream"),dde=i(e=>!!e&&typeof e=="object"&&e instanceof Pm.EventEmitter&&typeof e.pipe=="function"&&e.pipe!==W_.default.Writable.prototype.pipe,"isReadable"),fde=i(e=>!!e&&typeof e=="object"&&e instanceof Pm.EventEmitter&&typeof e.write=="function"&&typeof e.end=="function","isWritable"),eo=Symbol("EOF"),to=Symbol("maybeEmitEnd"),qo=Symbol("emittedEnd"),_m=Symbol("emittingEnd"),tf=Symbol("emittedError"),xm=Symbol("closed"),YN=Symbol("read"),vm=Symbol("flush"),XN=Symbol("flushChunk"),js=Symbol("encoding"),yl=Symbol("decoder"),vr=Symbol("flowing"),rf=Symbol("paused"),El=Symbol("resume"),Ar=Symbol("buffer"),Sn=Symbol("pipes"),Rr=Symbol("bufferLength"),U_=Symbol("bufferPush"),Am=Symbol("bufferShift"),Qr=Symbol("objectMode"),Yt=Symbol("destroyed"),q_=Symbol("error"),H_=Symbol("emitData"),JN=Symbol("emitEnd"),G_=Symbol("emitEnd2"),mi=Symbol("async"),z_=Symbol("abort"),Rm=Symbol("aborted"),nf=Symbol("signal"),Za=Symbol("dataListeners"),Qn=Symbol("discarded"),sf=i(e=>Promise.resolve().then(e),"defer"),hde=i(e=>e(),"nodefer"),pde=i(e=>e==="end"||e==="finish"||e==="prefinish","isEndish"),mde=i(e=>e instanceof ArrayBuffer||!!e&&typeof e=="object"&&e.constructor&&e.constructor.name==="ArrayBuffer"&&e.byteLength>=0,"isArrayBufferLike"),gde=i(e=>!Buffer.isBuffer(e)&&ArrayBuffer.isView(e),"isArrayBufferView"),Tm=class{static{i(this,"Pipe")}src;dest;opts;ondrain;constructor(t,r,n){this.src=t,this.dest=r,this.opts=n,this.ondrain=()=>t[El](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},V_=class extends Tm{static{i(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,r,n){super(t,r,n),this.proxyErrors=s=>r.emit("error",s),t.on("error",this.proxyErrors)}},yde=i(e=>!!e.objectMode,"isObjectModeOptions"),Ede=i(e=>!e.objectMode&&!!e.encoding&&e.encoding!=="buffer","isEncodingOptions"),Ho=class extends Pm.EventEmitter{static{i(this,"Minipass")}[vr]=!1;[rf]=!1;[Sn]=[];[Ar]=[];[Qr];[js];[mi];[yl];[eo]=!1;[qo]=!1;[_m]=!1;[xm]=!1;[tf]=null;[Rr]=0;[Yt]=!1;[nf];[Rm]=!1;[Za]=0;[Qn]=!1;writable=!0;readable=!0;constructor(...t){let r=t[0]||{};if(super(),r.objectMode&&typeof r.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");yde(r)?(this[Qr]=!0,this[js]=null):Ede(r)?(this[js]=r.encoding,this[Qr]=!1):(this[Qr]=!1,this[js]=null),this[mi]=!!r.async,this[yl]=this[js]?new QN.StringDecoder(this[js]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:i(()=>this[Ar],"get")}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:i(()=>this[Sn],"get")});let{signal:n}=r;n&&(this[nf]=n,n.aborted?this[z_]():n.addEventListener("abort",()=>this[z_]()))}get bufferLength(){return this[Rr]}get encoding(){return this[js]}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[Qr]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[mi]}set async(t){this[mi]=this[mi]||!!t}[z_](){this[Rm]=!0,this.emit("abort",this[nf]?.reason),this.destroy(this[nf]?.reason)}get aborted(){return this[Rm]}set aborted(t){}write(t,r,n){if(this[Rm])return!1;if(this[eo])throw new Error("write after end");if(this[Yt])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof r=="function"&&(n=r,r="utf8"),r||(r="utf8");let s=this[mi]?sf:hde;if(!this[Qr]&&!Buffer.isBuffer(t)){if(gde(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(mde(t))t=Buffer.from(t);else if(typeof t!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[Qr]?(this[vr]&&this[Rr]!==0&&this[vm](!0),this[vr]?this.emit("data",t):this[U_](t),this[Rr]!==0&&this.emit("readable"),n&&s(n),this[vr]):t.length?(typeof t=="string"&&!(r===this[js]&&!this[yl]?.lastNeed)&&(t=Buffer.from(t,r)),Buffer.isBuffer(t)&&this[js]&&(t=this[yl].write(t)),this[vr]&&this[Rr]!==0&&this[vm](!0),this[vr]?this.emit("data",t):this[U_](t),this[Rr]!==0&&this.emit("readable"),n&&s(n),this[vr]):(this[Rr]!==0&&this.emit("readable"),n&&s(n),this[vr])}read(t){if(this[Yt])return null;if(this[Qn]=!1,this[Rr]===0||t===0||t&&t>this[Rr])return this[to](),null;this[Qr]&&(t=null),this[Ar].length>1&&!this[Qr]&&(this[Ar]=[this[js]?this[Ar].join(""):Buffer.concat(this[Ar],this[Rr])]);let r=this[YN](t||null,this[Ar][0]);return this[to](),r}[YN](t,r){if(this[Qr])this[Am]();else{let n=r;t===n.length||t===null?this[Am]():typeof n=="string"?(this[Ar][0]=n.slice(t),r=n.slice(0,t),this[Rr]-=t):(this[Ar][0]=n.subarray(t),r=n.subarray(0,t),this[Rr]-=t)}return this.emit("data",r),!this[Ar].length&&!this[eo]&&this.emit("drain"),r}end(t,r,n){return typeof t=="function"&&(n=t,t=void 0),typeof r=="function"&&(n=r,r="utf8"),t!==void 0&&this.write(t,r),n&&this.once("end",n),this[eo]=!0,this.writable=!1,(this[vr]||!this[rf])&&this[to](),this}[El](){this[Yt]||(!this[Za]&&!this[Sn].length&&(this[Qn]=!0),this[rf]=!1,this[vr]=!0,this.emit("resume"),this[Ar].length?this[vm]():this[eo]?this[to]():this.emit("drain"))}resume(){return this[El]()}pause(){this[vr]=!1,this[rf]=!0,this[Qn]=!1}get destroyed(){return this[Yt]}get flowing(){return this[vr]}get paused(){return this[rf]}[U_](t){this[Qr]?this[Rr]+=1:this[Rr]+=t.length,this[Ar].push(t)}[Am](){return this[Qr]?this[Rr]-=1:this[Rr]-=this[Ar][0].length,this[Ar].shift()}[vm](t=!1){do;while(this[XN](this[Am]())&&this[Ar].length);!t&&!this[Ar].length&&!this[eo]&&this.emit("drain")}[XN](t){return this.emit("data",t),this[vr]}pipe(t,r){if(this[Yt])return t;this[Qn]=!1;let n=this[qo];return r=r||{},t===KN.stdout||t===KN.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,n?r.end&&t.end():(this[Sn].push(r.proxyErrors?new V_(this,t,r):new Tm(this,t,r)),this[mi]?sf(()=>this[El]()):this[El]()),t}unpipe(t){let r=this[Sn].find(n=>n.dest===t);r&&(this[Sn].length===1?(this[vr]&&this[Za]===0&&(this[vr]=!1),this[Sn]=[]):this[Sn].splice(this[Sn].indexOf(r),1),r.unpipe())}addListener(t,r){return this.on(t,r)}on(t,r){let n=super.on(t,r);if(t==="data")this[Qn]=!1,this[Za]++,!this[Sn].length&&!this[vr]&&this[El]();else if(t==="readable"&&this[Rr]!==0)super.emit("readable");else if(pde(t)&&this[qo])super.emit(t),this.removeAllListeners(t);else if(t==="error"&&this[tf]){let s=r;this[mi]?sf(()=>s.call(this,this[tf])):s.call(this,this[tf])}return n}removeListener(t,r){return this.off(t,r)}off(t,r){let n=super.off(t,r);return t==="data"&&(this[Za]=this.listeners("data").length,this[Za]===0&&!this[Qn]&&!this[Sn].length&&(this[vr]=!1)),n}removeAllListeners(t){let r=super.removeAllListeners(t);return(t==="data"||t===void 0)&&(this[Za]=0,!this[Qn]&&!this[Sn].length&&(this[vr]=!1)),r}get emittedEnd(){return this[qo]}[to](){!this[_m]&&!this[qo]&&!this[Yt]&&this[Ar].length===0&&this[eo]&&(this[_m]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[xm]&&this.emit("close"),this[_m]=!1)}emit(t,...r){let n=r[0];if(t!=="error"&&t!=="close"&&t!==Yt&&this[Yt])return!1;if(t==="data")return!this[Qr]&&!n?!1:this[mi]?(sf(()=>this[H_](n)),!0):this[H_](n);if(t==="end")return this[JN]();if(t==="close"){if(this[xm]=!0,!this[qo]&&!this[Yt])return!1;let o=super.emit("close");return this.removeAllListeners("close"),o}else if(t==="error"){this[tf]=n,super.emit(q_,n);let o=!this[nf]||this.listeners("error").length?super.emit("error",n):!1;return this[to](),o}else if(t==="resume"){let o=super.emit("resume");return this[to](),o}else if(t==="finish"||t==="prefinish"){let o=super.emit(t);return this.removeAllListeners(t),o}let s=super.emit(t,...r);return this[to](),s}[H_](t){for(let n of this[Sn])n.dest.write(t)===!1&&this.pause();let r=this[Qn]?!1:super.emit("data",t);return this[to](),r}[JN](){return this[qo]?!1:(this[qo]=!0,this.readable=!1,this[mi]?(sf(()=>this[G_]()),!0):this[G_]())}[G_](){if(this[yl]){let r=this[yl].end();if(r){for(let n of this[Sn])n.dest.write(r);this[Qn]||super.emit("data",r)}}for(let r of this[Sn])r.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[Qr]||(t.dataLength=0);let r=this.promise();return this.on("data",n=>{t.push(n),this[Qr]||(t.dataLength+=n.length)}),await r,t}async concat(){if(this[Qr])throw new Error("cannot concat in objectMode");let t=await this.collect();return this[js]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,r)=>{this.on(Yt,()=>r(new Error("stream destroyed"))),this.on("error",n=>r(n)),this.on("end",()=>t())})}[Symbol.asyncIterator](){this[Qn]=!1;let t=!1,r=i(async()=>(this.pause(),t=!0,{value:void 0,done:!0}),"stop");return{next:i(()=>{if(t)return r();let s=this.read();if(s!==null)return Promise.resolve({done:!1,value:s});if(this[eo])return r();let o,a,c=i(f=>{this.off("data",l),this.off("end",u),this.off(Yt,d),r(),a(f)},"onerr"),l=i(f=>{this.off("error",c),this.off("end",u),this.off(Yt,d),this.pause(),o({value:f,done:!!this[eo]})},"ondata"),u=i(()=>{this.off("error",c),this.off("data",l),this.off(Yt,d),r(),o({done:!0,value:void 0})},"onend"),d=i(()=>c(new Error("stream destroyed")),"ondestroy");return new Promise((f,m)=>{a=m,o=f,this.once(Yt,d),this.once("error",c),this.once("end",u),this.once("data",l)})},"next"),throw:r,return:r,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Qn]=!1;let t=!1,r=i(()=>(this.pause(),this.off(q_,r),this.off(Yt,r),this.off("end",r),t=!0,{done:!0,value:void 0}),"stop"),n=i(()=>{if(t)return r();let s=this.read();return s===null?r():{done:!1,value:s}},"next");return this.once("end",r),this.once(q_,r),this.once(Yt,r),{next:n,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(t){if(this[Yt])return t?this.emit("error",t):this.emit(Yt),this;this[Yt]=!0,this[Qn]=!0,this[Ar].length=0,this[Rr]=0;let r=this;return typeof r.close=="function"&&!this[xm]&&r.close(),t?this.emit("error",t):this.emit(Yt),this}static get isStream(){return ude}};var wl=require("node:path"),dB=require("node:url"),yi=require("fs"),Sde=k(require("node:fs"),1),Go=require("node:fs/promises"),bde=yi.realpathSync.native,of={lstatSync:yi.lstatSync,readdir:yi.readdir,readdirSync:yi.readdirSync,readlinkSync:yi.readlinkSync,realpathSync:bde,promises:{lstat:Go.lstat,readdir:Go.readdir,readlink:Go.readlink,realpath:Go.realpath}},ZN=i(e=>!e||e===of||e===Sde?of:{...of,...e,promises:{...of.promises,...e.promises||{}}},"fsFromOption"),eB=/^\\\\\?\\([a-z]:)\\?$/i,wde=i(e=>e.replace(/\//g,"\\").replace(eB,"$1\\"),"uncToDrive"),Cde=/[\\\/]/,ys=0,tB=1,rB=2,gi=4,nB=6,sB=8,ec=10,iB=12,Es=15,af=~Es,K_=16,oB=32,cf=64,Us=128,km=256,Om=512,aB=cf|Us|Om,_de=1023,Y_=i(e=>e.isFile()?sB:e.isDirectory()?gi:e.isSymbolicLink()?ec:e.isCharacterDevice()?rB:e.isBlockDevice()?nB:e.isSocket()?iB:e.isFIFO()?tB:ys,"entToType"),cB=new Map,lf=i(e=>{let t=cB.get(e);if(t)return t;let r=e.normalize("NFKD");return cB.set(e,r),r},"normalize"),lB=new Map,Im=i(e=>{let t=lB.get(e);if(t)return t;let r=lf(e.toLowerCase());return lB.set(e,r),r},"normalizeNocase"),Dm=class extends ef{static{i(this,"ResolveCache")}constructor(){super({max:256})}},X_=class extends ef{static{i(this,"ChildrenCache")}constructor(t=16*1024){super({maxSize:t,sizeCalculation:i(r=>r.length+1,"sizeCalculation")})}},uB=Symbol("PathScurry setAsCwd"),Zr=class{static{i(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#t;#r;get dev(){return this.#r}#n;get mode(){return this.#n}#e;get nlink(){return this.#e}#o;get uid(){return this.#o}#c;get gid(){return this.#c}#l;get rdev(){return this.#l}#d;get blksize(){return this.#d}#u;get ino(){return this.#u}#a;get size(){return this.#a}#s;get blocks(){return this.#s}#y;get atimeMs(){return this.#y}#p;get mtimeMs(){return this.#p}#m;get ctimeMs(){return this.#m}#g;get birthtimeMs(){return this.#g}#v;get atime(){return this.#v}#E;get mtime(){return this.#E}#_;get ctime(){return this.#_}#x;get birthtime(){return this.#x}#S;#w;#C;#h;#R;#A;#i;#k;#b;#O;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(t,r=ys,n,s,o,a,c){this.name=t,this.#S=o?Im(t):lf(t),this.#i=r&_de,this.nocase=o,this.roots=s,this.root=n||this,this.#k=a,this.#C=c.fullpath,this.#R=c.relative,this.#A=c.relativePosix,this.parent=c.parent,this.parent?this.#t=this.parent.#t:this.#t=ZN(c.fs)}depth(){return this.#w!==void 0?this.#w:this.parent?this.#w=this.parent.depth()+1:this.#w=0}childrenCache(){return this.#k}resolve(t){if(!t)return this;let r=this.getRootString(t),s=t.substring(r.length).split(this.splitSep);return r?this.getRoot(r).#D(s):this.#D(s)}#D(t){let r=this;for(let n of t)r=r.child(n);return r}children(){let t=this.#k.get(this);if(t)return t;let r=Object.assign([],{provisional:0});return this.#k.set(this,r),this.#i&=~K_,r}child(t,r){if(t===""||t===".")return this;if(t==="..")return this.parent||this;let n=this.children(),s=this.nocase?Im(t):lf(t);for(let l of n)if(l.#S===s)return l;let o=this.parent?this.sep:"",a=this.#C?this.#C+o+t:void 0,c=this.newChild(t,ys,{...r,parent:this,fullpath:a});return this.canReaddir()||(c.#i|=Us),n.push(c),c}relative(){if(this.isCWD)return"";if(this.#R!==void 0)return this.#R;let t=this.name,r=this.parent;if(!r)return this.#R=this.name;let n=r.relative();return n+(!n||!r.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#A!==void 0)return this.#A;let t=this.name,r=this.parent;if(!r)return this.#A=this.fullpathPosix();let n=r.relativePosix();return n+(!n||!r.parent?"":"/")+t}fullpath(){if(this.#C!==void 0)return this.#C;let t=this.name,r=this.parent;if(!r)return this.#C=this.name;let s=r.fullpath()+(r.parent?this.sep:"")+t;return this.#C=s}fullpathPosix(){if(this.#h!==void 0)return this.#h;if(this.sep==="/")return this.#h=this.fullpath();if(!this.parent){let s=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(s)?this.#h=`//?/${s}`:this.#h=s}let t=this.parent,r=t.fullpathPosix(),n=r+(!r||!t.parent?"":"/")+this.name;return this.#h=n}isUnknown(){return(this.#i&Es)===ys}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.#i&Es)===sB}isDirectory(){return(this.#i&Es)===gi}isCharacterDevice(){return(this.#i&Es)===rB}isBlockDevice(){return(this.#i&Es)===nB}isFIFO(){return(this.#i&Es)===tB}isSocket(){return(this.#i&Es)===iB}isSymbolicLink(){return(this.#i&ec)===ec}lstatCached(){return this.#i&oB?this:void 0}readlinkCached(){return this.#b}realpathCached(){return this.#O}readdirCached(){let t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(this.#b)return!0;if(!this.parent)return!1;let t=this.#i&Es;return!(t!==ys&&t!==ec||this.#i&km||this.#i&Us)}calledReaddir(){return!!(this.#i&K_)}isENOENT(){return!!(this.#i&Us)}isNamed(t){return this.nocase?this.#S===Im(t):this.#S===lf(t)}async readlink(){let t=this.#b;if(t)return t;if(this.canReadlink()&&this.parent)try{let r=await this.#t.promises.readlink(this.fullpath()),n=(await this.parent.realpath())?.resolve(r);if(n)return this.#b=n}catch(r){this.#f(r.code);return}}readlinkSync(){let t=this.#b;if(t)return t;if(this.canReadlink()&&this.parent)try{let r=this.#t.readlinkSync(this.fullpath()),n=this.parent.realpathSync()?.resolve(r);if(n)return this.#b=n}catch(r){this.#f(r.code);return}}#N(t){this.#i|=K_;for(let r=t.provisional;r<t.length;r++){let n=t[r];n&&n.#B()}}#B(){this.#i&Us||(this.#i=(this.#i|Us)&af,this.#T())}#T(){let t=this.children();t.provisional=0;for(let r of t)r.#B()}#P(){this.#i|=Om,this.#M()}#M(){if(this.#i&cf)return;let t=this.#i;(t&Es)===gi&&(t&=af),this.#i=t|cf,this.#T()}#$(t=""){t==="ENOTDIR"||t==="EPERM"?this.#M():t==="ENOENT"?this.#B():this.children().provisional=0}#L(t=""){t==="ENOTDIR"?this.parent.#M():t==="ENOENT"&&this.#B()}#f(t=""){let r=this.#i;r|=km,t==="ENOENT"&&(r|=Us),(t==="EINVAL"||t==="UNKNOWN")&&(r&=af),this.#i=r,t==="ENOTDIR"&&this.parent&&this.parent.#M()}#F(t,r){return this.#I(t,r)||this.#j(t,r)}#j(t,r){let n=Y_(t),s=this.newChild(t.name,n,{parent:this}),o=s.#i&Es;return o!==gi&&o!==ec&&o!==ys&&(s.#i|=cf),r.unshift(s),r.provisional++,s}#I(t,r){for(let n=r.provisional;n<r.length;n++){let s=r[n];if((this.nocase?Im(t.name):lf(t.name))===s.#S)return this.#U(t,s,n,r)}}#U(t,r,n,s){let o=r.name;return r.#i=r.#i&af|Y_(t),o!==t.name&&(r.name=t.name),n!==s.provisional&&(n===s.length-1?s.pop():s.splice(n,1),s.unshift(r)),s.provisional++,r}async lstat(){if((this.#i&Us)===0)try{return this.#z(await this.#t.promises.lstat(this.fullpath())),this}catch(t){this.#L(t.code)}}lstatSync(){if((this.#i&Us)===0)try{return this.#z(this.#t.lstatSync(this.fullpath())),this}catch(t){this.#L(t.code)}}#z(t){let{atime:r,atimeMs:n,birthtime:s,birthtimeMs:o,blksize:a,blocks:c,ctime:l,ctimeMs:u,dev:d,gid:f,ino:m,mode:g,mtime:E,mtimeMs:w,nlink:C,rdev:v,size:D,uid:$}=t;this.#v=r,this.#y=n,this.#x=s,this.#g=o,this.#d=a,this.#s=c,this.#_=l,this.#m=u,this.#r=d,this.#c=f,this.#u=m,this.#n=g,this.#E=E,this.#p=w,this.#e=C,this.#l=v,this.#a=D,this.#o=$;let U=Y_(t);this.#i=this.#i&af|U|oB,U!==ys&&U!==gi&&U!==ec&&(this.#i|=cf)}#H=[];#G=!1;#V(t){this.#G=!1;let r=this.#H.slice();this.#H.length=0,r.forEach(n=>n(null,t))}readdirCB(t,r=!1){if(!this.canReaddir()){r?t(null,[]):queueMicrotask(()=>t(null,[]));return}let n=this.children();if(this.calledReaddir()){let o=n.slice(0,n.provisional);r?t(null,o):queueMicrotask(()=>t(null,o));return}if(this.#H.push(t),this.#G)return;this.#G=!0;let s=this.fullpath();this.#t.readdir(s,{withFileTypes:!0},(o,a)=>{if(o)this.#$(o.code),n.provisional=0;else{for(let c of a)this.#F(c,n);this.#N(n)}this.#V(n.slice(0,n.provisional))})}#q;async readdir(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let r=this.fullpath();if(this.#q)await this.#q;else{let n=i(()=>{},"resolve");this.#q=new Promise(s=>n=s);try{for(let s of await this.#t.promises.readdir(r,{withFileTypes:!0}))this.#F(s,t);this.#N(t)}catch(s){this.#$(s.code),t.provisional=0}this.#q=void 0,n()}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 r=this.fullpath();try{for(let n of this.#t.readdirSync(r,{withFileTypes:!0}))this.#F(n,t);this.#N(t)}catch(n){this.#$(n.code),t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(this.#i&aB)return!1;let t=Es&this.#i;return t===ys||t===gi||t===ec}shouldWalk(t,r){return(this.#i&gi)===gi&&!(this.#i&aB)&&!t.has(this)&&(!r||r(this))}async realpath(){if(this.#O)return this.#O;if(!((Om|km|Us)&this.#i))try{let t=await this.#t.promises.realpath(this.fullpath());return this.#O=this.resolve(t)}catch{this.#P()}}realpathSync(){if(this.#O)return this.#O;if(!((Om|km|Us)&this.#i))try{let t=this.#t.realpathSync(this.fullpath());return this.#O=this.resolve(t)}catch{this.#P()}}[uB](t){if(t===this)return;t.isCWD=!1,this.isCWD=!0;let r=new Set([]),n=[],s=this;for(;s&&s.parent;)r.add(s),s.#R=n.join(this.sep),s.#A=n.join("/"),s=s.parent,n.push("..");for(s=t;s&&s.parent&&!r.has(s);)s.#R=void 0,s.#A=void 0,s=s.parent}},Nm=class e extends Zr{static{i(this,"PathWin32")}sep="\\";splitSep=Cde;constructor(t,r=ys,n,s,o,a,c){super(t,r,n,s,o,a,c)}newChild(t,r=ys,n={}){return new e(t,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(t){return wl.win32.parse(t).root}getRoot(t){if(t=wde(t.toUpperCase()),t===this.root.name)return this.root;for(let[r,n]of Object.entries(this.roots))if(this.sameRoot(t,r))return this.roots[t]=n;return this.roots[t]=new Sl(t,this).root}sameRoot(t,r=this.root.name){return t=t.toUpperCase().replace(/\//g,"\\").replace(eB,"$1\\"),t===r}},Bm=class e extends Zr{static{i(this,"PathPosix")}splitSep="/";sep="/";constructor(t,r=ys,n,s,o,a,c){super(t,r,n,s,o,a,c)}getRootString(t){return t.startsWith("/")?"/":""}getRoot(t){return this.root}newChild(t,r=ys,n={}){return new e(t,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}},Mm=class{static{i(this,"PathScurryBase")}root;rootPath;roots;cwd;#t;#r;#n;nocase;#e;constructor(t=process.cwd(),r,n,{nocase:s,childrenCacheSize:o=16*1024,fs:a=of}={}){this.#e=ZN(a),(t instanceof URL||t.startsWith("file://"))&&(t=(0,dB.fileURLToPath)(t));let c=r.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(c),this.#t=new Dm,this.#r=new Dm,this.#n=new X_(o);let l=c.substring(this.rootPath.length).split(n);if(l.length===1&&!l[0]&&l.pop(),s===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=s,this.root=this.newRoot(this.#e),this.roots[this.rootPath]=this.root;let u=this.root,d=l.length-1,f=r.sep,m=this.rootPath,g=!1;for(let E of l){let w=d--;u=u.child(E,{relative:new Array(w).fill("..").join(f),relativePosix:new Array(w).fill("..").join("/"),fullpath:m+=(g?"":f)+E}),g=!0}this.cwd=u}depth(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return this.#n}resolve(...t){let r="";for(let o=t.length-1;o>=0;o--){let a=t[o];if(!(!a||a===".")&&(r=r?`${a}/${r}`:a,this.isAbsolute(a)))break}let n=this.#t.get(r);if(n!==void 0)return n;let s=this.cwd.resolve(r).fullpath();return this.#t.set(r,s),s}resolvePosix(...t){let r="";for(let o=t.length-1;o>=0;o--){let a=t[o];if(!(!a||a===".")&&(r=r?`${a}/${r}`:a,this.isAbsolute(a)))break}let n=this.#r.get(r);if(n!==void 0)return n;let s=this.cwd.resolve(r).fullpathPosix();return this.#r.set(r,s),s}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,r={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Zr||(r=t,t=this.cwd);let{withFileTypes:n}=r;if(t.canReaddir()){let s=await t.readdir();return n?s:s.map(o=>o.name)}else return[]}readdirSync(t=this.cwd,r={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Zr||(r=t,t=this.cwd);let{withFileTypes:n=!0}=r;return t.canReaddir()?n?t.readdirSync():t.readdirSync().map(s=>s.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:r}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Zr||(r=t.withFileTypes,t=this.cwd);let n=await t.readlink();return r?n:n?.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Zr||(r=t.withFileTypes,t=this.cwd);let n=t.readlinkSync();return r?n:n?.fullpath()}async realpath(t=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Zr||(r=t.withFileTypes,t=this.cwd);let n=await t.realpath();return r?n:n?.fullpath()}realpathSync(t=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Zr||(r=t.withFileTypes,t=this.cwd);let n=t.realpathSync();return r?n:n?.fullpath()}async walk(t=this.cwd,r={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Zr||(r=t,t=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:o,walkFilter:a}=r,c=[];(!o||o(t))&&c.push(n?t:t.fullpath());let l=new Set,u=i((f,m)=>{l.add(f),f.readdirCB((g,E)=>{if(g)return m(g);let w=E.length;if(!w)return m();let C=i(()=>{--w===0&&m()},"next");for(let v of E)(!o||o(v))&&c.push(n?v:v.fullpath()),s&&v.isSymbolicLink()?v.realpath().then(D=>D?.isUnknown()?D.lstat():D).then(D=>D?.shouldWalk(l,a)?u(D,C):C()):v.shouldWalk(l,a)?u(v,C):C()},!0)},"walk"),d=t;return new Promise((f,m)=>{u(d,g=>{if(g)return m(g);f(c)})})}walkSync(t=this.cwd,r={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Zr||(r=t,t=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:o,walkFilter:a}=r,c=[];(!o||o(t))&&c.push(n?t:t.fullpath());let l=new Set([t]);for(let u of l){let d=u.readdirSync();for(let f of d){(!o||o(f))&&c.push(n?f:f.fullpath());let m=f;if(f.isSymbolicLink()){if(!(s&&(m=f.realpathSync())))continue;m.isUnknown()&&m.lstatSync()}m.shouldWalk(l,a)&&l.add(m)}}return c}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,r={}){return typeof t=="string"?t=this.cwd.resolve(t):t instanceof Zr||(r=t,t=this.cwd),this.stream(t,r)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,r={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Zr||(r=t,t=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:o,walkFilter:a}=r;(!o||o(t))&&(yield n?t:t.fullpath());let c=new Set([t]);for(let l of c){let u=l.readdirSync();for(let d of u){(!o||o(d))&&(yield n?d:d.fullpath());let f=d;if(d.isSymbolicLink()){if(!(s&&(f=d.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(c,a)&&c.add(f)}}}stream(t=this.cwd,r={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Zr||(r=t,t=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:o,walkFilter:a}=r,c=new Ho({objectMode:!0});(!o||o(t))&&c.write(n?t:t.fullpath());let l=new Set,u=[t],d=0,f=i(()=>{let m=!1;for(;!m;){let g=u.shift();if(!g){d===0&&c.end();return}d++,l.add(g);let E=i((C,v,D=!1)=>{if(C)return c.emit("error",C);if(s&&!D){let $=[];for(let U of v)U.isSymbolicLink()&&$.push(U.realpath().then(ie=>ie?.isUnknown()?ie.lstat():ie));if($.length){Promise.all($).then(()=>E(null,v,!0));return}}for(let $ of v)$&&(!o||o($))&&(c.write(n?$:$.fullpath())||(m=!0));d--;for(let $ of v){let U=$.realpathCached()||$;U.shouldWalk(l,a)&&u.push(U)}m&&!c.flowing?c.once("drain",f):w||f()},"onReaddir"),w=!0;g.readdirCB(E,!0),w=!1}},"process");return f(),c}streamSync(t=this.cwd,r={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Zr||(r=t,t=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:o,walkFilter:a}=r,c=new Ho({objectMode:!0}),l=new Set;(!o||o(t))&&c.write(n?t:t.fullpath());let u=[t],d=0,f=i(()=>{let m=!1;for(;!m;){let g=u.shift();if(!g){d===0&&c.end();return}d++,l.add(g);let E=g.readdirSync();for(let w of E)(!o||o(w))&&(c.write(n?w:w.fullpath())||(m=!0));d--;for(let w of E){let C=w;if(w.isSymbolicLink()){if(!(s&&(C=w.realpathSync())))continue;C.isUnknown()&&C.lstatSync()}C.shouldWalk(l,a)&&u.push(C)}}m&&!c.flowing&&c.once("drain",f)},"process");return f(),c}chdir(t=this.cwd){let r=this.cwd;this.cwd=typeof t=="string"?this.cwd.resolve(t):t,this.cwd[uB](r)}},Sl=class extends Mm{static{i(this,"PathScurryWin32")}sep="\\";constructor(t=process.cwd(),r={}){let{nocase:n=!0}=r;super(t,wl.win32,"\\",{...r,nocase:n}),this.nocase=n;for(let s=this.cwd;s;s=s.parent)s.nocase=this.nocase}parseRootPath(t){return wl.win32.parse(t).root.toUpperCase()}newRoot(t){return new Nm(this.rootPath,gi,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}},bl=class extends Mm{static{i(this,"PathScurryPosix")}sep="/";constructor(t=process.cwd(),r={}){let{nocase:n=!1}=r;super(t,wl.posix,"/",{...r,nocase:n}),this.nocase=n}parseRootPath(t){return"/"}newRoot(t){return new Bm(this.rootPath,gi,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}},uf=class extends bl{static{i(this,"PathScurryDarwin")}constructor(t=process.cwd(),r={}){let{nocase:n=!0}=r;super(t,{...r,nocase:n})}},tze=process.platform==="win32"?Nm:Bm,fB=process.platform==="win32"?Sl:process.platform==="darwin"?uf:bl;var xde=i(e=>e.length>=1,"isPatternList"),vde=i(e=>e.length>=1,"isGlobList"),Cl=class e{static{i(this,"Pattern")}#t;#r;#n;length;#e;#o;#c;#l;#d;#u;#a=!0;constructor(t,r,n,s){if(!xde(t))throw new TypeError("empty pattern list");if(!vde(r))throw new TypeError("empty glob list");if(r.length!==t.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=t.length,n<0||n>=this.length)throw new TypeError("index out of range");if(this.#t=t,this.#r=r,this.#n=n,this.#e=s,this.#n===0){if(this.isUNC()){let[o,a,c,l,...u]=this.#t,[d,f,m,g,...E]=this.#r;u[0]===""&&(u.shift(),E.shift());let w=[o,a,c,l,""].join("/"),C=[d,f,m,g,""].join("/");this.#t=[w,...u],this.#r=[C,...E],this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){let[o,...a]=this.#t,[c,...l]=this.#r;a[0]===""&&(a.shift(),l.shift());let u=o+"/",d=c+"/";this.#t=[u,...a],this.#r=[d,...l],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]===Hr}isRegExp(){return this.#t[this.#n]instanceof RegExp}globString(){return this.#c=this.#c||(this.#n===0?this.isAbsolute()?this.#r[0]+this.#r.slice(1).join("/"):this.#r.join("/"):this.#r.slice(this.#n).join("/"))}hasMore(){return this.length>this.#n+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new e(this.#t,this.#r,this.#n+1,this.#e),this.#o.#u=this.#u,this.#o.#d=this.#d,this.#o.#l=this.#l,this.#o):this.#o=null}isUNC(){let t=this.#t;return this.#d!==void 0?this.#d:this.#d=this.#e==="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.#l!==void 0?this.#l:this.#l=this.#e==="win32"&&this.#n===0&&this.length>1&&typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0])}isAbsolute(){let t=this.#t;return this.#u!==void 0?this.#u:this.#u=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.#a)}markFollowGlobstar(){return this.#n===0||!this.isGlobstar()||!this.#a?!1:(this.#a=!1,!0)}};var Ade=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",_l=class{static{i(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(t,{nobrace:r,nocase:n,noext:s,noglobstar:o,platform:a=Ade}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=a,this.mmopts={dot:!0,nobrace:r,nocase:n,noext:s,noglobstar:o,optimizationLevel:2,platform:a,nocomment:!0,nonegate:!0};for(let c of t)this.add(c)}add(t){let r=new Jn(t,this.mmopts);for(let n=0;n<r.set.length;n++){let s=r.set[n],o=r.globParts[n];if(!s||!o)throw new Error("invalid pattern object");for(;s[0]==="."&&o[0]===".";)s.shift(),o.shift();let a=new Cl(s,o,0,this.platform),c=new Jn(a.globString(),this.mmopts),l=o[o.length-1]==="**",u=a.isAbsolute();u?this.absolute.push(c):this.relative.push(c),l&&(u?this.absoluteChildren.push(c):this.relativeChildren.push(c))}}ignored(t){let r=t.fullpath(),n=`${r}/`,s=t.relative()||".",o=`${s}/`;for(let a of this.relative)if(a.match(s)||a.match(o))return!0;for(let a of this.absolute)if(a.match(r)||a.match(n))return!0;return!1}childrenIgnored(t){let r=t.fullpath()+"/",n=(t.relative()||".")+"/";for(let s of this.relativeChildren)if(s.match(n))return!0;for(let s of this.absoluteChildren)if(s.match(r))return!0;return!1}};var J_=class e{static{i(this,"HasWalkedCache")}store;constructor(t=new Map){this.store=t}copy(){return new e(new Map(this.store))}hasWalked(t,r){return this.store.get(t.fullpath())?.has(r.globString())}storeWalked(t,r){let n=t.fullpath(),s=this.store.get(n);s?s.add(r.globString()):this.store.set(n,new Set([r.globString()]))}},Q_=class{static{i(this,"MatchRecord")}store=new Map;add(t,r,n){let s=(r?2:0)|(n?1:0),o=this.store.get(t);this.store.set(t,o===void 0?s:s&o)}entries(){return[...this.store.entries()].map(([t,r])=>[t,!!(r&2),!!(r&1)])}},Z_=class{static{i(this,"SubWalks")}store=new Map;add(t,r){if(!t.canReaddir())return;let n=this.store.get(t);n?n.find(s=>s.globString()===r.globString())||n.push(r):this.store.set(t,[r])}get(t){let r=this.store.get(t);if(!r)throw new Error("attempting to walk unknown path");return r}entries(){return this.keys().map(t=>[t,this.store.get(t)])}keys(){return[...this.store.keys()].filter(t=>t.canReaddir())}},df=class e{static{i(this,"Processor")}hasWalkedCache;matches=new Q_;subwalks=new Z_;patterns;follow;dot;opts;constructor(t,r){this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=r?r.copy():new J_}processPatterns(t,r){this.patterns=r;let n=r.map(s=>[t,s]);for(let[s,o]of n){this.hasWalkedCache.storeWalked(s,o);let a=o.root(),c=o.isAbsolute()&&this.opts.absolute!==!1;if(a){s=s.resolve(a==="/"&&this.opts.root!==void 0?this.opts.root:a);let f=o.rest();if(f)o=f;else{this.matches.add(s,!0,!1);continue}}if(s.isENOENT())continue;let l,u,d=!1;for(;typeof(l=o.pattern())=="string"&&(u=o.rest());)s=s.resolve(l),o=u,d=!0;if(l=o.pattern(),u=o.rest(),d){if(this.hasWalkedCache.hasWalked(s,o))continue;this.hasWalkedCache.storeWalked(s,o)}if(typeof l=="string"){let f=l===".."||l===""||l===".";this.matches.add(s.resolve(l),c,f);continue}else if(l===Hr){(!s.isSymbolicLink()||this.follow||o.checkFollowGlobstar())&&this.subwalks.add(s,o);let f=u?.pattern(),m=u?.rest();if(!u||(f===""||f===".")&&!m)this.matches.add(s,c,f===""||f===".");else if(f===".."){let g=s.parent||s;m?this.hasWalkedCache.hasWalked(g,m)||this.subwalks.add(g,m):this.matches.add(g,c,!0)}}else l instanceof RegExp&&this.subwalks.add(s,o)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new e(this.opts,this.hasWalkedCache)}filterEntries(t,r){let n=this.subwalks.get(t),s=this.child();for(let o of r)for(let a of n){let c=a.isAbsolute(),l=a.pattern(),u=a.rest();l===Hr?s.testGlobstar(o,a,u,c):l instanceof RegExp?s.testRegExp(o,l,u,c):s.testString(o,l,u,c)}return s}testGlobstar(t,r,n,s){if((this.dot||!t.name.startsWith("."))&&(r.hasMore()||this.matches.add(t,s,!1),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,r):t.isSymbolicLink()&&(n&&r.checkFollowGlobstar()?this.subwalks.add(t,n):r.markFollowGlobstar()&&this.subwalks.add(t,r)))),n){let o=n.pattern();if(typeof o=="string"&&o!==".."&&o!==""&&o!==".")this.testString(t,o,n.rest(),s);else if(o===".."){let a=t.parent||t;this.subwalks.add(a,n)}else o instanceof RegExp&&this.testRegExp(t,o,n.rest(),s)}}testRegExp(t,r,n,s){r.test(t.name)&&(n?this.subwalks.add(t,n):this.matches.add(t,s,!1))}testString(t,r,n,s){t.isNamed(r)&&(n?this.subwalks.add(t,n):this.matches.add(t,s,!1))}};var Rde=i((e,t)=>typeof e=="string"?new _l([e],t):Array.isArray(e)?new _l(e,t):e,"makeIgnore"),$m=class{static{i(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#t=[];#r;#n;signal;maxDepth;includeChildMatches;constructor(t,r,n){if(this.patterns=t,this.path=r,this.opts=n,this.#n=!n.posix&&n.platform==="win32"?"\\":"/",this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#r=Rde(n.ignore??[],n),!this.includeChildMatches&&typeof this.#r.add!="function")){let s="cannot ignore child matches, ignore lacks add() method.";throw new Error(s)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener("abort",()=>{this.#t.length=0}))}#e(t){return this.seen.has(t)||!!this.#r?.ignored?.(t)}#o(t){return!!this.#r?.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,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=t.realpathCached()||await t.realpath(),!n)return;t=n}let o=t.isUnknown()||this.opts.stat?await t.lstat():t;if(this.opts.follow&&this.opts.nodir&&o?.isSymbolicLink()){let a=await o.realpath();a&&(a.isUnknown()||this.opts.stat)&&await a.lstat()}return this.matchCheckTest(o,r)}matchCheckTest(t,r){return t&&(this.maxDepth===1/0||t.depth()<=this.maxDepth)&&(!r||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!t.realpathCached()?.isDirectory())&&!this.#e(t)?t:void 0}matchCheckSync(t,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=t.realpathCached()||t.realpathSync(),!n)return;t=n}let o=t.isUnknown()||this.opts.stat?t.lstatSync():t;if(this.opts.follow&&this.opts.nodir&&o?.isSymbolicLink()){let a=o.realpathSync();a&&(a?.isUnknown()||this.opts.stat)&&a.lstatSync()}return this.matchCheckTest(o,r)}matchFinish(t,r){if(this.#e(t))return;if(!this.includeChildMatches&&this.#r?.add){let o=`${t.relativePosix()}/**`;this.#r.add(o)}let n=this.opts.absolute===void 0?r:this.opts.absolute;this.seen.add(t);let s=this.opts.mark&&t.isDirectory()?this.#n:"";if(this.opts.withFileTypes)this.matchEmit(t);else if(n){let o=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(o+s)}else{let o=this.opts.posix?t.relativePosix():t.relative(),a=this.opts.dotRelative&&!o.startsWith(".."+this.#n)?"."+this.#n:"";this.matchEmit(o?a+o+s:"."+s)}}async match(t,r,n){let s=await this.matchCheck(t,n);s&&this.matchFinish(s,r)}matchSync(t,r,n){let s=this.matchCheckSync(t,n);s&&this.matchFinish(s,r)}walkCB(t,r,n){this.signal?.aborted&&n(),this.walkCB2(t,r,new df(this.opts),n)}walkCB2(t,r,n,s){if(this.#o(t))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2(t,r,n,s));return}n.processPatterns(t,r);let o=1,a=i(()=>{--o===0&&s()},"next");for(let[c,l,u]of n.matches.entries())this.#e(c)||(o++,this.match(c,l,u).then(()=>a()));for(let c of n.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;o++;let l=c.readdirCached();c.calledReaddir()?this.walkCB3(c,l,n,a):c.readdirCB((u,d)=>this.walkCB3(c,d,n,a),!0)}a()}walkCB3(t,r,n,s){n=n.filterEntries(t,r);let o=1,a=i(()=>{--o===0&&s()},"next");for(let[c,l,u]of n.matches.entries())this.#e(c)||(o++,this.match(c,l,u).then(()=>a()));for(let[c,l]of n.subwalks.entries())o++,this.walkCB2(c,l,n.child(),a);a()}walkCBSync(t,r,n){this.signal?.aborted&&n(),this.walkCB2Sync(t,r,new df(this.opts),n)}walkCB2Sync(t,r,n,s){if(this.#o(t))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2Sync(t,r,n,s));return}n.processPatterns(t,r);let o=1,a=i(()=>{--o===0&&s()},"next");for(let[c,l,u]of n.matches.entries())this.#e(c)||this.matchSync(c,l,u);for(let c of n.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;o++;let l=c.readdirSync();this.walkCB3Sync(c,l,n,a)}a()}walkCB3Sync(t,r,n,s){n=n.filterEntries(t,r);let o=1,a=i(()=>{--o===0&&s()},"next");for(let[c,l,u]of n.matches.entries())this.#e(c)||this.matchSync(c,l,u);for(let[c,l]of n.subwalks.entries())o++,this.walkCB2Sync(c,l,n.child(),a);a()}},ff=class extends $m{static{i(this,"GlobWalker")}matches=new Set;constructor(t,r,n){super(t,r,n)}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,r)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?r(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}},hf=class extends $m{static{i(this,"GlobStream")}results;constructor(t,r,n){super(t,r,n),this.results=new Ho({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 hB=require("node:url"),Tde=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",qs=class{static{i(this,"Glob")}absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(t,r){if(!r)throw new TypeError("glob options required");if(this.withFileTypes=!!r.withFileTypes,this.signal=r.signal,this.follow=!!r.follow,this.dot=!!r.dot,this.dotRelative=!!r.dotRelative,this.nodir=!!r.nodir,this.mark=!!r.mark,r.cwd?(r.cwd instanceof URL||r.cwd.startsWith("file://"))&&(r.cwd=(0,hB.fileURLToPath)(r.cwd)):this.cwd="",this.cwd=r.cwd||"",this.root=r.root,this.magicalBraces=!!r.magicalBraces,this.nobrace=!!r.nobrace,this.noext=!!r.noext,this.realpath=!!r.realpath,this.absolute=r.absolute,this.includeChildMatches=r.includeChildMatches!==!1,this.noglobstar=!!r.noglobstar,this.matchBase=!!r.matchBase,this.maxDepth=typeof r.maxDepth=="number"?r.maxDepth:1/0,this.stat=!!r.stat,this.ignore=r.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof t=="string"&&(t=[t]),this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(t=t.map(l=>l.replace(/\\/g,"/"))),this.matchBase){if(r.noglobstar)throw new TypeError("base matching requires globstar");t=t.map(l=>l.includes("/")?l:`./**/${l}`)}if(this.pattern=t,this.platform=r.platform||Tde,this.opts={...r,platform:this.platform},r.scurry){if(this.scurry=r.scurry,r.nocase!==void 0&&r.nocase!==r.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let l=r.platform==="win32"?Sl:r.platform==="darwin"?uf:r.platform?bl:fB;this.scurry=new l(this.cwd,{nocase:r.nocase,fs:r.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",s={...r,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},o=this.pattern.map(l=>new Jn(l,s)),[a,c]=o.reduce((l,u)=>(l[0].push(...u.set),l[1].push(...u.globParts),l),[[],[]]);this.patterns=a.map((l,u)=>{let d=c[u];if(!d)throw new Error("invalid pattern object");return new Cl(l,d,0,this.platform)})}async walk(){return[...await new ff(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,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new ff(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,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new hf(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,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new hf(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,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var ex=i((e,t={})=>{Array.isArray(e)||(e=[e]);for(let r of e)if(new Jn(r,t).hasMagic())return!0;return!1},"hasMagic");function Lm(e,t={}){return new qs(e,t).streamSync()}i(Lm,"globStreamSync");function pB(e,t={}){return new qs(e,t).stream()}i(pB,"globStream");function mB(e,t={}){return new qs(e,t).walkSync()}i(mB,"globSync");async function gB(e,t={}){return new qs(e,t).walk()}i(gB,"glob_");function Fm(e,t={}){return new qs(e,t).iterateSync()}i(Fm,"globIterateSync");function yB(e,t={}){return new qs(e,t).iterate()}i(yB,"globIterate");var Pde=Lm,kde=Object.assign(pB,{sync:Lm}),Ode=Fm,Ide=Object.assign(yB,{sync:Fm}),Dde=Object.assign(mB,{stream:Lm,iterate:Fm}),jm=Object.assign(gB,{glob:gB,globSync:mB,sync:Dde,globStream:pB,stream:kde,globStreamSync:Lm,streamSync:Pde,globIterate:yB,iterate:Ide,globIterateSync:Fm,iterateSync:Ode,Glob:qs,hasMagic:ex,escape:pl,unescape:Fs});jm.glob=jm;var EB=require("node:path"),tx=k(Un(),1);async function Hs(...e){let t=await jm(...e);return t.forEach((r,n)=>{t[n]=t[n].toString().replace(/\\/g,"/")}),t}i(Hs,"normalizedGlob");function Um(e){let t=process.cwd();return e!==t&&(e=(0,EB.resolve)(t,e)),e=e.replace(/\\/g,"/"),e}i(Um,"getProjectDir");async function tc(e){return await tx.default.pathExists(e)?tx.default.readdir(e):[]}i(tc,"tryReadDir");var SB=k(require("node:os"),1),bB=require("node:path/posix"),Gs;function wB(e){Gs=e}i(wB,"setPVRTexToolAbsolutePath");async function CB(){if(process.env.PVRTexToolCLI)return Gs=process.env.PVRTexToolCLI;let e=SB.default.platform(),t=null;switch(e){case"darwin":t="/Applications/Imagination/";break;case"win32":t="C:/Imagination Technologies/";break;default:break}if(!t)return;let r=await Hs((0,bB.join)(t,"**"),{nodir:!0});switch(e){case"darwin":return Gs=r.find(n=>n.endsWith("macOS/PVRTexToolCLI"));case"win32":return Gs=r.find(n=>n.endsWith("Windows_x86_64/PVRTexToolCLI.exe"))}}i(CB,"locatePVRTexTool");var ze=require("node:path/posix"),lr=require("node:fs/promises"),ur=k(Un(),1);async function _B(e){await Promise.all([ur.default.ensureDir((0,ze.join)(e,"nodes")),ur.default.ensureDir((0,ze.join)(e,"meshes")),ur.default.ensureDir((0,ze.join)(e,"lods")),ur.default.ensureDir((0,ze.join)(e,"lights")),ur.default.ensureDir((0,ze.join)(e,"cameras")),ur.default.ensureDir((0,ze.join)(e,"geometries")),ur.default.ensureDir((0,ze.join)(e,"skeletons")),ur.default.ensureDir((0,ze.join)(e,"shadowGenerators")),ur.default.ensureDir((0,ze.join)(e,"sceneLinks")),ur.default.ensureDir((0,ze.join)(e,"gui")),ur.default.ensureDir((0,ze.join)(e,"sounds")),ur.default.ensureDir((0,ze.join)(e,"particleSystems")),ur.default.ensureDir((0,ze.join)(e,"morphTargetManagers")),ur.default.ensureDir((0,ze.join)(e,"morphTargets")),ur.default.ensureDir((0,ze.join)(e,"animationGroups")),ur.default.ensureDir((0,ze.join)(e,"sprite-maps")),ur.default.ensureDir((0,ze.join)(e,"sprite-managers")),ur.default.ensureDir((0,ze.join)(e,"nodeParticleSystemSets"))])}i(_B,"ensureSceneDirectories");async function xB(e){let[t,r,n,s,o,a,c,l,u,d,f,m,g,E,w,C,v,D]=await Promise.all([(0,lr.readdir)((0,ze.join)(e,"nodes")),(0,lr.readdir)((0,ze.join)(e,"meshes")),(0,lr.readdir)((0,ze.join)(e,"lods")),(0,lr.readdir)((0,ze.join)(e,"lights")),(0,lr.readdir)((0,ze.join)(e,"cameras")),(0,lr.readdir)((0,ze.join)(e,"skeletons")),(0,lr.readdir)((0,ze.join)(e,"shadowGenerators")),(0,lr.readdir)((0,ze.join)(e,"sceneLinks")),(0,lr.readdir)((0,ze.join)(e,"gui")),(0,lr.readdir)((0,ze.join)(e,"sounds")),(0,lr.readdir)((0,ze.join)(e,"particleSystems")),(0,lr.readdir)((0,ze.join)(e,"morphTargetManagers")),(0,lr.readdir)((0,ze.join)(e,"morphTargets")),(0,lr.readdir)((0,ze.join)(e,"animationGroups")),(0,lr.readdir)((0,ze.join)(e,"sprite-maps")),(0,lr.readdir)((0,ze.join)(e,"sprite-managers")),(0,lr.readdir)((0,ze.join)(e,"geometries")),(0,lr.readdir)((0,ze.join)(e,"nodeParticleSystemSets"))]);return{nodesFiles:t,meshesFiles:r,lodsFiles:n,lightsFiles:s,cameraFiles:o,skeletonFiles:a,shadowGeneratorFiles:c,sceneLinkFiles:l,guiFiles:u,soundFiles:d,particleSystemFiles:f,morphTargetManagerFiles:m,morphTargetFiles:g,animationGroupFiles:E,spriteMapFiles:w,spriteManagerFiles:C,geometryFiles:v,nodeParticleSystemSetFiles:D}}i(xB,"readSceneDirectories");var b2=require("node:child_process");function w2(e){return new Promise((t,r)=>{(0,b2.exec)(e,(n,s,o)=>{n?(console.error(pi.red(e),pi.red(o)),r(n)):(console.log(pi.gray(e),pi.gray(s)),t())})})}i(w2,"executeAsync");var Wo=require("node:path/posix"),_2=k(Un(),1),x2=k(S2(),1),v2=require("node:fs"),Lfe=["-astc.ktx","-dxt.ktx","-pvrtc.ktx","-etc1.ktx","-etc2.ktx"],Ffe=[".png",".jpg",".jpeg",".bmp"];function jfe(e,t){return`${e.substring(0,e.lastIndexOf("."))}${t}`}i(jfe,"getCompressedTextureFilename");async function bs(e,t){t.format?await C2(e,t):await Promise.all(Lfe.map(r=>C2(e,{...t,format:r})))}i(bs,"compressFileToKtx");async function C2(e,t){let r=(0,Wo.basename)(e),n=(0,Wo.extname)(r).toLocaleLowerCase();if(!Ffe.includes(n))return null;let s=jfe(r,t.format);if(t.destinationFolder??=(0,Wo.dirname)(e),t.destinationFolder=(0,Wo.join)(t.destinationFolder,s),!t.compressedTexturesEnabled)return t.exportedAssets?.push(t.destinationFolder),null;if(await _2.default.pathExists(t.destinationFolder)&&!t.force)return t.exportedAssets?.push(t.destinationFolder),t.destinationFolder;let o=await new Promise(c=>{let l=(0,v2.createReadStream)(e);l.pipe(new x2.PNG).on("metadata",u=>{c(u.alpha),l.close()}).on("error",()=>{c(!1),l.close()})});if(!Gs)return null;let a=null;switch(t.format){case"-astc.ktx":a=`"${Gs}" -i "${e}" -flip y -pot + -m -dither -ics lRGB -f ASTC_8x8,UBN,lRGB -q astcveryfast -o "${t.destinationFolder}"`;break;case"-dxt.ktx":a=`"${Gs}" -i "${e}" -flip y -pot + -m -ics lRGB ${o?"-l":""} -f ${o?"BC2":"BC1"},UBN,lRGB -o "${t.destinationFolder}"`;break;case"-pvrtc.ktx":a=`"${Gs}" -i "${e}" -flip y -pot + -square + -m -dither -ics lRGB ${o?"-l":""} -f ${o?"PVRTCI_2BPP_RGBA":"PVRTCI_2BPP_RGB"},UBN,lRGB -q pvrtcfastest -o "${t.destinationFolder}"`;break;case"-etc1.ktx":a=`"${Gs}" -i "${e}" -flip y -pot + -m -dither -ics lRGB -f ETC1,UBN,lRGB -q etcfast -o "${t.destinationFolder}"`;break;case"-etc2.ktx":a=`"${Gs}" -i "${e}" -flip y -pot + -m -dither -ics lRGB -f ${o?"ETC2_RGBA":"ETC2_RGB"},UBN,lRGB -q etcfast -o "${t.destinationFolder}"`;break}if(!a)return null;console.log(`Compressing image "${s}"`);try{return await w2(a),console.log(`Compressed image "${s}"`),t.exportedAssets?.push(t.destinationFolder),t.destinationFolder}catch{console.error(`Failed to compress image "${s}"`)}return null}i(C2,"compressFileToKtxFormat");var e$=require("node:path/posix"),t$=require("node:worker_threads"),ZM=i((e,t)=>(e=(0,e$.join)(__dirname.replace(/\\/g,"/"),e),new t$.Worker(e,{workerData:t})),"loadWorker"),_f=i(async(e,t)=>{let r=ZM(e,t);return new Promise(n=>{r.on("message",s=>{t.id&&s.id!==t.id||(t.id||r.terminate(),n(s))})})},"executeSimpleWorker");function r$(e,t){ZM=e,_f=t}i(r$,"overrideWorkerMethods");var zx=require("node:path/posix"),Vx=k(Un(),1),n$=k(Gx(),1);async function $l(e,t){let r=e.split(","),o=r[0].split(";")[1],a=r[1];if(o==="base64"){let c=Buffer.from(a,"base64"),l=(0,n$.default)(c),[u,d]=await Promise.all([l.metadata(),_f("workers/md5.js",c)]),f;switch(u.format){case"png":f=`${d}.png`;break;case"jpg":case"jpeg":f=`${d}.jpg`;break;default:return console.error(`Unsupported embedded texture format while extracting texture: ${u.format}`),null}let m=(0,zx.join)(t.extractedTexturesOutputPath,f);return await Vx.default.pathExists(m)||await Vx.default.writeFile(m,c),(0,zx.join)("assets","editor-generated_extracted-textures",f).replace(/\\/g,"/")}return null}i($l,"extractTextureAssetFromDataString");async function xf(e,t){try{let r=await fetch(e),n=await r.arrayBuffer(),s=Buffer.from(n).toString("base64"),o=`data:${r.headers.get("content-type")??"image/unknown"};base64,${s}`;return $l(o,{...t})}catch(r){console.error(`Failed to extract texture from url "${e}": ${r.message}`)}return null}i(xf,"extractTextureAssetFromUrl");function u9e(e=4096,t){let r=t??1,n=[];for(;r<=e;)n.push(r),r<<=1;return n}i(u9e,"getPowerOfTwoSizesUntil");function oc(e){let t=1;for(;t<=e;)t<<=1;return t>>1}i(oc,"getPowerOfTwoUntil");var so=require("node:path/posix"),Wx=k(Gx(),1),Kx=k(Un(),1);function Ll(e){return(0,so.join)(e,"assets","editor-generated_extracted-textures")}i(Ll,"getExtractedTextureOutputPath");async function s$(e,t){let r=(0,so.extname)(e).toLocaleLowerCase(),n=await(0,Wx.default)(e).metadata();if(!n.width||!n.height)return console.error(`Failed to compute exported image "${e}". Image metadata is invalid.`);let s=n.width,o=n.height,a=s===oc(s)||o===oc(o),c=[],l=s*.66>>0,u=o*.66>>0;a&&(l=oc(l),u=oc(u)),c.push({width:l,height:u});let d=s*.33>>0,f=o*.33>>0;a&&(d=oc(d),f=oc(f)),c.push({width:d,height:f});for(let m of c){let E=`${(0,so.basename)(e).replace(r,"")}_${m.width}_${m.height}${r}`,w=(0,so.join)((0,so.dirname)(e),E);if(t.exportedAssets.push(w),t.force||!await Kx.default.pathExists(w))try{let C=await(0,Wx.default)(e).resize(m.width,m.height).toBuffer();await Kx.default.writeFile(w,C),console.log(`Exported scaled texture "${E}"`),t.onStepChanged?.("assets",{message:`Exported scaled texture "${E}"`})}catch{console.error(`Failed to export image scaled image "${E}"`)}await bs(w,{...t})}}i(s$,"processExportedTexture");var i$=require("node:path/posix"),ag=k(Un(),1);async function o$(e,t){let r=await ag.default.readJSON(e);if(r.customType!=="BABYLON.NodeMaterial")return;let n=Ll(t.publicDir);await ag.default.ensureDir(n);let s=await Yx(r,{extractedTexturesOutputPath:n});await ag.default.writeJSON(e,r,{encoding:"utf-8"}),await Promise.all(s.map(async o=>{let a=(0,i$.join)(t.publicDir,o);t.exportedAssets.push(a),await bs(a,{force:t.force,exportedAssets:t.exportedAssets})}))}i(o$,"processExportedMaterial");async function Yx(e,t){let r=e.blocks.filter(s=>(s.customType==="BABYLON.TextureBlock"||s.customType==="BABYLON.ImageSourceBlock")&&s.texture?.name),n=[];return await Promise.all(r.map(async s=>{if(s.texture?.name?.startsWith("http://")||s.texture.name.startsWith("https://")){let o=await xf(s.texture.name,{...t});o&&(n.push(o),s.texture.name=s.texture.url=o)}if(s.texture.name?.startsWith("data:")){let o=await $l(s.texture.name,{...t});o&&(n.push(o),s.texture.name=s.texture.url=o)}})),n}i(Yx,"extractNodeMaterialTextures");var a$=require("node:path/posix"),cg=k(Un(),1);async function c$(e,t){let r=await cg.default.readJSON(e);if(r.customType!=="BABYLON.NodeParticleSystemSet")return;let n=Ll(t.publicDir);await cg.default.ensureDir(n);let s=await Xx(r,{extractedTexturesOutputPath:n});await cg.default.writeJSON(e,r,{encoding:"utf-8"}),await Promise.all(s.map(async o=>{let a=(0,a$.join)(t.publicDir,o);t.exportedAssets.push(a),t.optimize&&await bs(a,{force:t.force,exportedAssets:t.exportedAssets})}))}i(c$,"processExportedNodeParticleSystemSet");async function l$(e,t){let r=null;return e.texture?.name.startsWith("http://")||e.texture?.name.startsWith("https://")?r=await xf(e.texture.name,{...t}):e.texture?.name.startsWith("data:")&&(r=await $l(e.texture.name,{...t})),r&&(e.texture.name=r,e.texture.url=e.texture.name),r}i(l$,"extractParticleSystemTextures");async function Xx(e,t){let r=e.blocks.filter(s=>s.customType==="BABYLON.ParticleTextureSourceBlock"),n=[];return await Promise.all(r.map(async s=>{if(s.url?.startsWith("http://")||s.url?.startsWith("https://")){let o=await xf(s.url,{...t});o&&(n.push(o),s.url=o)}if(s.textureDataUrl?.startsWith("data:")){let o=await $l(s.textureDataUrl,{...t});o&&(n.push(o),delete s.textureDataUrl,s.url=o,s.serializedCachedData=!1)}})),n}i(Xx,"extractNodeParticleSystemSetTextures");var pt=require("node:path/posix"),Xt=k(Un(),1);async function u$(e){let t=[],r=[],n=[],s=[],o=[],a=[],c=[],l=[],u=[];(await Promise.all(e.directories.meshesFiles.map(async j=>{let G=await Xt.default.readJSON((0,pt.join)(e.sceneFile,"meshes",j)),K=G.meshes[0];if(K.metadata?.doNotSerialize)return null;K.delayLoadingFile&&(K.delayLoadingFile=(0,pt.join)(e.sceneName,(0,pt.basename)(K.delayLoadingFile))),K.metadata?.parentId&&(K.parentId=K.metadata.parentId),K.instances?.forEach(Ge=>{Ge.metadata?.parentId&&(Ge.parentId=Ge.metadata.parentId)}),K.instances=K.instances?.filter(Ge=>Ge.metadata?.doNotSerialize?null:Ge),G.basePoseMatrix&&(K.basePoseMatrix=G.basePoseMatrix);let _e;G.materials?.forEach(Ge=>{s.find(ft=>ft.id===Ge.id)||(_e=Ge)});let it=[];return G.lods&&(K.lodMeshIds=[],K.lodDistances=[],(await Promise.all(G.lods?.map(async Qe=>{let ft=await Xt.default.readJSON((0,pt.join)(e.sceneFile,"lods",Qe)),Ze=ft.meshes[0];return Ze.delayLoadingFile&&(Ze.delayLoadingFile=(0,pt.join)(e.sceneName,(0,pt.basename)(Ze.delayLoadingFile))),G.basePoseMatrix&&(Ze.basePoseMatrix=G.basePoseMatrix),{lodMesh:Ze,distanceOrScreenCoverage:ft.distanceOrScreenCoverage}}))).forEach(Qe=>{it.push(Qe.lodMesh),K.lodMeshIds.push(Qe.lodMesh.id),K.lodDistances.push(Qe.distanceOrScreenCoverage)})),{mesh:K,lodMeshes:it,effectiveMaterial:_e}}))).forEach(j=>{j&&(r.push(j.mesh),j.lodMeshes.forEach(G=>{r.push(G)}),j.effectiveMaterial&&s.push(j.effectiveMaterial))});let f=await Promise.all(e.directories.morphTargetManagerFiles.map(async j=>{let G=await Xt.default.readJSON((0,pt.join)(e.sceneFile,"morphTargetManagers",j));return e.babylonjsEditorToolsVersion>="5.2.6"?G.targets.forEach(K=>{K.delayLoadingFile&&(K.delayLoadingFile=(0,pt.join)(e.sceneName,"morphTargets",(0,pt.basename)(K.delayLoadingFile)))}):await Promise.all(G.targets.map(async K=>{let _e=(0,pt.join)(e.sceneFile,"morphTargets",(0,pt.basename)(K.delayLoadingFile)),it=(await Xt.default.readFile(_e)).buffer;K.positionsCount&&(K.positions=Array.prototype.slice.call(new Float32Array(it,K.positionsOffset,K.positionsCount))),K.normalsCount&&(K.normals=Array.prototype.slice.call(new Float32Array(it,K.normalsOffset,K.normalsCount))),K.tangentsCount&&(K.tangents=Array.prototype.slice.call(new Float32Array(it,K.tangentsOffset,K.tangentsCount))),K.uvsCount&&(K.uvs=Array.prototype.slice.call(new Float32Array(it,K.uvsOffset,K.uvsCount))),K.uv2sCount&&(K.uv2s=Array.prototype.slice.call(new Float32Array(it,K.uv2sOffset,K.uv2sCount))),delete K.delayLoadingFile,delete K.positionsCount,delete K.normalsCount,delete K.tangentsCount,delete K.uvsCount,delete K.uv2sCount,delete K.positionsOffset,delete K.normalsOffset,delete K.tangentsOffset,delete K.uvsOffset,delete K.uv2sOffset})),G}));u.push(...f);let m=await Promise.all(e.directories.nodesFiles.map(async j=>{let G=await Xt.default.readJSON((0,pt.join)(e.sceneFile,"nodes",j));return G.metadata?.doNotSerialize?null:(G.metadata?.parentId&&(G.parentId=G.metadata.parentId),G)}));a.push(...m.filter(j=>j!==null));let g=await Promise.all(e.directories.spriteManagerFiles.map(async j=>{let G=await Xt.default.readJSON((0,pt.join)(e.sceneFile,"sprite-managers",j));return G.metadata?.doNotSerialize?null:(G.metadata?.parentId&&(G.parentId=G.metadata.parentId),G)}));a.push(...g.filter(j=>j!==null));let E=await Promise.all(e.directories.spriteMapFiles.map(async j=>{let G=await Xt.default.readJSON((0,pt.join)(e.sceneFile,"sprite-maps",j));return G.metadata?.doNotSerialize?null:(G.metadata?.parentId&&(G.parentId=G.metadata.parentId),G)}));a.push(...E.filter(j=>j!==null));let w=await Promise.all(e.directories.lightsFiles.map(async j=>{let G=await Xt.default.readJSON((0,pt.join)(e.sceneFile,"lights",j));return G.metadata?.doNotSerialize?null:(G.metadata?.parentId&&(G.parentId=G.metadata.parentId),G)}));t.push(...w.filter(j=>j!==null));let C=await Promise.all(e.directories.cameraFiles.map(async j=>{let G=await Xt.default.readJSON((0,pt.join)(e.sceneFile,"cameras",j));return G.metadata?.doNotSerialize?null:(G.metadata?.parentId&&(G.parentId=G.metadata.parentId),G)}));n.push(...C.filter(j=>j!==null));let v=Ll(e.publicDir);await Xt.default.ensureDir(v),await Promise.all(s.map(async j=>{if(j.customType==="BABYLON.NodeMaterial"){let G=await Yx(j,{extractedTexturesOutputPath:v});await Promise.all(G.map(async K=>{let _e=(0,pt.join)(e.publicDir,K);e.exportedAssets.push(_e),e.optimize&&e.compressedTexturesEnabled&&await bs(_e,{...e,force:!1,exportedAssets:e.exportedAssets})}))}}));let D=await Promise.all(e.directories.particleSystemFiles.map(async j=>{let G=await Xt.default.readJSON((0,pt.join)(e.sceneFile,"particleSystems",j));if(G.metadata?.doNotSerialize)return null;let K=await l$(G,{extractedTexturesOutputPath:v});if(K){let _e=(0,pt.join)(e.publicDir,K);e.exportedAssets.push(_e),e.optimize&&e.compressedTexturesEnabled&&await bs(_e,{...e,force:!1,exportedAssets:e.exportedAssets})}return G}));c.push(...D.filter(j=>j!==null));let $=await Promise.all(e.directories.nodeParticleSystemSetFiles.map(async j=>{let G=await Xt.default.readJSON((0,pt.join)(e.sceneFile,"nodeParticleSystemSets",j));if(G.metadata?.doNotSerialize)return null;if(G.metadata?.parentId&&(G.parentId=G.metadata.parentId),G.nodeParticleSystemSet){let K=await Xx(G.nodeParticleSystemSet,{extractedTexturesOutputPath:v});await Promise.all(K.map(async _e=>{let it=(0,pt.join)(e.publicDir,_e);e.exportedAssets.push(it),e.optimize&&e.compressedTexturesEnabled&&await bs(it,{...e,force:!1,exportedAssets:e.exportedAssets})}))}return G}));r.push(...$.filter(j=>j!==null));let U=await Promise.all(e.directories.shadowGeneratorFiles.map(async j=>{let G=await Xt.default.readJSON((0,pt.join)(e.sceneFile,"shadowGenerators",j));return t.find(_e=>_e.id===G.lightId)?G:null}));l.push(...U.filter(j=>j!==null));let ie=await Promise.all(e.directories.skeletonFiles.map(async j=>{let G=await Xt.default.readJSON((0,pt.join)(e.sceneFile,"skeletons",j));return r.find(_e=>_e.skeletonId===G.id)?G:null}));o.push(...ie.filter(j=>j!==null));let fe={autoClear:!0,clearColor:e.config.clearColor,ambientColor:e.config.ambientColor,gravity:e.config.gravity??[0,-9.81,0],collisionsEnabled:!0,useRightHandedSystem:!1,fogMode:e.config.fog.fogMode,fogColor:e.config.fog.fogColor,fogStart:e.config.fog.fogStart,fogEnd:e.config.fog.fogEnd,fogDensity:e.config.fog.fogDensity,physicsEnabled:!0,physicsGravity:e.config.physics.gravity,physicsEngine:"HavokPlugin",metadata:{...e.config.metadata,rendering:e.config.rendering,clusteredLight:e.config.clusteredLight},morphTargetManagers:u,lights:t,cameras:n,animations:e.config.animations,materials:s,multiMaterials:[],environmentTexture:e.config.environment.environmentTexture,environmentIntensity:e.config.environment.environmentIntensity,iblIntensity:e.config.environment.iblIntensity??1,skeletons:o,transformNodes:a,geometries:{boxes:[],spheres:[],cylinders:[],toruses:[],grounds:[],planes:[],torusKnots:[],vertexData:[]},meshes:r,particleSystems:c,sounds:await Promise.all(e.directories.soundFiles.map(async j=>Xt.default.readJSON((0,pt.join)(e.sceneFile,"sounds",j)))),shadowGenerators:l,animationGroups:await Promise.all(e.directories.animationGroupFiles.map(async j=>Xt.default.readJSON((0,pt.join)(e.sceneFile,"animationGroups",j)))),postProcesses:[],spriteManagers:[],reflectionProbes:[]};[...fe.meshes,...fe.cameras,...fe.lights,...fe.transformNodes,...fe.meshes.map(j=>j.instances??[]).flat()].forEach(j=>{if(j.parentId!==void 0&&j.parentInstanceIndex!==void 0){let G=fe.meshes.find(K=>K.instances?.find(_e=>_e.uniqueId===j.parentId));G&&(j.parentId=G.uniqueId)}}),fe.environmentTexture?.name&&fe.environmentTexture.customType==="BABYLON.HDRCubeTexture"&&(fe.environmentTextureSize=512,fe.environmentTextureType="BABYLON.HDRCubeTexture",fe.environmentTextureRotationY=fe.environmentTexture.rotationY,fe.environmentTexture=fe.environmentTexture.name);let Se=(0,pt.join)(e.publicDir,`${e.sceneName}.babylon`);if(await Xt.default.writeJSON(Se,fe,{encoding:"utf-8"}),e.exportedAssets.push(Se),e.optimize){let j=(0,pt.join)(e.publicDir,`${e.sceneName}.babylon.manifest`),G={version:0,enableSceneOffline:!0,enableTexturesOffline:!0};await Xt.default.pathExists(j)&&(G=await Xt.default.readJSON(j)),++G.version,await Xt.default.writeJSON(j,G,{encoding:"utf-8"}),e.exportedAssets.push(j)}}i(u$,"createBabylonScene");var io=require("node:path/posix"),ac=k(Un(),1),d$=[".jpg",".jpeg",".webp",".png",".bmp"],Jge=[".env",".dds",".hdr"],Qge=[".mp3",".wav",".wave",".ogg"],f$=[".material",".gui",".cinematic",".npss",".ragdoll",".json"],Zge=[".3dl",".exr",".hdr"],e0e=[...d$,...Jge,...Qge,...f$,...Zge];async function h$(e,t){let r=e.includes(".navmesh"),n=(0,io.extname)(e).toLocaleLowerCase();if(!r&&!e0e.includes(n)||(0,io.basename)(e).startsWith("editor_preview"))return;let s=e.replace((0,io.join)(t.projectDir,"/"),""),o=s.split("/"),a="";for(let m=0;m<o.length-1;++m){try{await ac.default.ensureDir((0,io.join)(t.publicDir,a,o[m]))}catch{}a=(0,io.join)(a,o[m])}let c=!1,u=(await ac.default.stat(e)).mtimeMs.toString();c=!t.cache[s]||t.cache[s]!==u,t.cache[s]=u;let d=(0,io.join)(t.publicDir,s),f=await ac.default.pathExists(d);(c||!f)&&(f$.includes(n)?await ac.default.writeJSON(d,await ac.default.readJSON(e),{encoding:"utf-8"}):await ac.default.copyFile(e,d)),t.onStepChanged?.("assets",{message:`Processed asset: ${s}`}),t.exportedAssets.push(d),t.optimize&&await bs(d,{force:c,...t}),t.optimize&&(d$.includes(n)?await s$(d,{...t,force:c}):n===".material"?await o$(d,{...t,force:c}):n===".npss"&&await c$(d,{...t,force:c}))}i(h$,"processAssetFile");var p$=require("node:os"),lg=require("node:path/posix");async function m$(e){let t=await Hs((0,lg.join)(e.baseAssetsDir,"**/*"),{nodir:!0,ignore:{childrenIgnored:i(a=>(0,lg.extname)(a.name)===".scene","childrenIgnored")}}),r=[],n=(0,p$.cpus)().length;console.log(`Using ${n} cpus to process assets...`);let s=100/t.length,o=0;for(let a of t){if(r.length>=n&&(await Promise.all(r),r.length=0),e.cancellationToken?.isCanceled)break;r.push(new Promise(async c=>{await h$(a,{...e}),e.onProgress?.(o+=s),c()}))}await Promise.all(r)}i(m$,"createAssets");var Fl=k(Un(),1),Tt=require("node:path/posix"),t0e=`
88
+ >>> no match, partial?`,t,m,r,g),m===l))}let w;if(typeof d=="string"?(w=f===d,this.debug("string match",d,f,w)):(w=d.test(f),this.debug("pattern match",d,f,w)),!w)return!1}if(a===l&&c===u)return!0;if(a===l)return n;if(c===u)return a===l-1&&t[a]==="";throw new Error("wtf?")}braceExpand(){return qN(this.pattern,this.options)}parse(t){Qd(t);let r=this.options;if(t==="**")return Hr;if(t==="")return"";let n,s=null;(n=t.match(zue))?s=r.dot?Wue:Vue:(n=t.match(Bue))?s=(r.nocase?r.dot?Fue:Lue:r.dot?$ue:Mue)(n[1]):(n=t.match(Kue))?s=(r.nocase?r.dot?Xue:Yue:r.dot?Jue:Que)(n):(n=t.match(jue))?s=r.dot?que:Uue:(n=t.match(Hue))&&(s=Gue);let o=hl.fromGlob(t,this.options).toMMPattern();return s&&typeof o=="object"&&Reflect.defineProperty(o,"test",{value:s}),o}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let r=this.options,n=r.noglobstar?tde:r.dot?rde:nde,s=new Set(r.nocase?["i"]:[]),o=t.map(l=>{let u=l.map(f=>{if(f instanceof RegExp)for(let m of f.flags.split(""))s.add(m);return typeof f=="string"?cde(f):f===Hr?Hr:f._src});u.forEach((f,m)=>{let g=u[m+1],E=u[m-1];f!==Hr||E===Hr||(E===void 0?g!==void 0&&g!==Hr?u[m+1]="(?:\\/|"+n+"\\/)?"+g:u[m]=n:g===void 0?u[m-1]=E+"(?:\\/|\\/"+n+")?":g!==Hr&&(u[m-1]=E+"(?:\\/|\\/"+n+"\\/)"+g,u[m+1]=Hr))});let d=u.filter(f=>f!==Hr);if(this.partial&&d.length>=1){let f=[];for(let m=1;m<=d.length;m++)f.push(d.slice(0,m).join("/"));return"(?:"+f.join("|")+")"}return d.join("/")}).join("|"),[a,c]=t.length>1?["(?:",")"]:["",""];o="^"+a+o+c+"$",this.partial&&(o="^(?:\\/|"+a+o.slice(1,-1)+c+")$"),this.negate&&(o="^(?!"+o+").+$");try{this.regexp=new RegExp(o,[...s].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,r=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&r)return!0;let n=this.options;this.isWindows&&(t=t.split("\\").join("/"));let s=this.slashSplit(t);this.debug(this.pattern,"split",s);let o=this.set;this.debug(this.pattern,"set",o);let a=s[s.length-1];if(!a)for(let c=s.length-2;!a&&c>=0;c--)a=s[c];for(let c=0;c<o.length;c++){let l=o[c],u=s;if(n.matchBase&&l.length===1&&(u=[a]),this.matchOne(u,l,r))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(t){return En.defaults(t).Minimatch}};En.AST=hl,En.Minimatch=Jn,En.escape=pl,En.unescape=Fs;var ml=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,GN=new Set,F_=typeof process=="object"&&process?process:{},zN=i((e,t,r,n)=>{typeof F_.emitWarning=="function"?F_.emitWarning(e,t,r,n):console.error(`[${r}] ${t}: ${e}`)},"emitWarning"),Cm=globalThis.AbortController,VN=globalThis.AbortSignal;if(typeof Cm>"u"){VN=class{static{i(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(n,s){this._onabort.push(s)}},Cm=class{static{i(this,"AbortController")}constructor(){t()}signal=new VN;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let s of this.signal._onabort)s(n);this.signal.onabort?.(n)}}};let e=F_.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=i(()=>{e&&(e=!1,zN("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))},"warnACPolyfill")}var lde=i(e=>!GN.has(e),"shouldWarn"),KGe=Symbol("type"),Uo=i(e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),"isPosInt"),WN=i(e=>Uo(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?gl:null:null,"getUintArray"),gl=class extends Array{static{i(this,"ZeroArray")}constructor(t){super(t),this.fill(0)}},j_=class e{static{i(this,"Stack")}heap;length;static#t=!1;static create(t){let r=WN(t);if(!r)return[];e.#t=!0;let n=new e(t,r);return e.#t=!1,n}constructor(t,r){if(!e.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},ef=class e{static{i(this,"LRUCache")}#t;#r;#n;#e;#o;#c;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#d;#u;#a;#s;#y;#p;#m;#g;#v;#E;#_;#x;#S;#w;#C;#h;static unsafeExposeInternals(t){return{starts:t.#x,ttls:t.#S,sizes:t.#_,keyMap:t.#u,keyList:t.#a,valList:t.#s,next:t.#y,prev:t.#p,get head(){return t.#m},get tail(){return t.#g},free:t.#v,isBackgroundFetch:i(r=>t.#f(r),"isBackgroundFetch"),backgroundFetch:i((r,n,s,o)=>t.#L(r,n,s,o),"backgroundFetch"),moveToTail:i(r=>t.#j(r),"moveToTail"),indexes:i(r=>t.#T(r),"indexes"),rindexes:i(r=>t.#P(r),"rindexes"),isStale:i(r=>t.#b(r),"isStale")}}get max(){return this.#t}get maxSize(){return this.#r}get calculatedSize(){return this.#d}get size(){return this.#l}get fetchMethod(){return this.#o}get memoMethod(){return this.#c}get dispose(){return this.#n}get disposeAfter(){return this.#e}constructor(t){let{max:r=0,ttl:n,ttlResolution:s=1,ttlAutopurge:o,updateAgeOnGet:a,updateAgeOnHas:c,allowStale:l,dispose:u,disposeAfter:d,noDisposeOnSet:f,noUpdateTTL:m,maxSize:g=0,maxEntrySize:E=0,sizeCalculation:w,fetchMethod:C,memoMethod:v,noDeleteOnFetchRejection:D,noDeleteOnStaleGet:$,allowStaleOnFetchRejection:U,allowStaleOnFetchAbort:ie,ignoreFetchAbort:fe}=t;if(r!==0&&!Uo(r))throw new TypeError("max option must be a nonnegative integer");let Me=r?WN(r):Array;if(!Me)throw new Error("invalid max value: "+r);if(this.#t=r,this.#r=g,this.maxEntrySize=E||this.#r,this.sizeCalculation=w,this.sizeCalculation){if(!this.#r&&!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(v!==void 0&&typeof v!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#c=v,C!==void 0&&typeof C!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=C,this.#C=!!C,this.#u=new Map,this.#a=new Array(r).fill(void 0),this.#s=new Array(r).fill(void 0),this.#y=new Me(r),this.#p=new Me(r),this.#m=0,this.#g=0,this.#v=j_.create(r),this.#l=0,this.#d=0,typeof u=="function"&&(this.#n=u),typeof d=="function"?(this.#e=d,this.#E=[]):(this.#e=void 0,this.#E=void 0),this.#w=!!this.#n,this.#h=!!this.#e,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!D,this.allowStaleOnFetchRejection=!!U,this.allowStaleOnFetchAbort=!!ie,this.ignoreFetchAbort=!!fe,this.maxEntrySize!==0){if(this.#r!==0&&!Uo(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!Uo(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#O()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!$,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!c,this.ttlResolution=Uo(s)||s===0?s:1,this.ttlAutopurge=!!o,this.ttl=n||0,this.ttl){if(!Uo(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#R()}if(this.#t===0&&this.ttl===0&&this.#r===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#r){let Se="LRU_CACHE_UNBOUNDED";lde(Se)&&(GN.add(Se),zN("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Se,e))}}getRemainingTTL(t){return this.#u.has(t)?1/0:0}#R(){let t=new gl(this.#t),r=new gl(this.#t);this.#S=t,this.#x=r,this.#k=(o,a,c=ml.now())=>{if(r[o]=a!==0?c:0,t[o]=a,a!==0&&this.ttlAutopurge){let l=setTimeout(()=>{this.#b(o)&&this.#I(this.#a[o],"expire")},a+1);l.unref&&l.unref()}},this.#A=o=>{r[o]=t[o]!==0?ml.now():0},this.#i=(o,a)=>{if(t[a]){let c=t[a],l=r[a];if(!c||!l)return;o.ttl=c,o.start=l,o.now=n||s();let u=o.now-l;o.remainingTTL=c-u}};let n=0,s=i(()=>{let o=ml.now();if(this.ttlResolution>0){n=o;let a=setTimeout(()=>n=0,this.ttlResolution);a.unref&&a.unref()}return o},"getNow");this.getRemainingTTL=o=>{let a=this.#u.get(o);if(a===void 0)return 0;let c=t[a],l=r[a];if(!c||!l)return 1/0;let u=(n||s())-l;return c-u},this.#b=o=>{let a=r[o],c=t[o];return!!c&&!!a&&(n||s())-a>c}}#A=i(()=>{},"#updateItemAge");#i=i(()=>{},"#statusTTL");#k=i(()=>{},"#setItemTTL");#b=i(()=>!1,"#isStale");#O(){let t=new gl(this.#t);this.#d=0,this.#_=t,this.#D=r=>{this.#d-=t[r],t[r]=0},this.#B=(r,n,s,o)=>{if(this.#f(n))return 0;if(!Uo(s))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(s=o(n,r),!Uo(s))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 s},this.#N=(r,n,s)=>{if(t[r]=n,this.#r){let o=this.#r-t[r];for(;this.#d>o;)this.#$(!0)}this.#d+=t[r],s&&(s.entrySize=n,s.totalCalculatedSize=this.#d)}}#D=i(t=>{},"#removeItemSize");#N=i((t,r,n)=>{},"#addItemSize");#B=i((t,r,n,s)=>{if(n||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#T({allowStale:t=this.allowStale}={}){if(this.#l)for(let r=this.#g;!(!this.#M(r)||((t||!this.#b(r))&&(yield r),r===this.#m));)r=this.#p[r]}*#P({allowStale:t=this.allowStale}={}){if(this.#l)for(let r=this.#m;!(!this.#M(r)||((t||!this.#b(r))&&(yield r),r===this.#g));)r=this.#y[r]}#M(t){return t!==void 0&&this.#u.get(this.#a[t])===t}*entries(){for(let t of this.#T())this.#s[t]!==void 0&&this.#a[t]!==void 0&&!this.#f(this.#s[t])&&(yield[this.#a[t],this.#s[t]])}*rentries(){for(let t of this.#P())this.#s[t]!==void 0&&this.#a[t]!==void 0&&!this.#f(this.#s[t])&&(yield[this.#a[t],this.#s[t]])}*keys(){for(let t of this.#T()){let r=this.#a[t];r!==void 0&&!this.#f(this.#s[t])&&(yield r)}}*rkeys(){for(let t of this.#P()){let r=this.#a[t];r!==void 0&&!this.#f(this.#s[t])&&(yield r)}}*values(){for(let t of this.#T())this.#s[t]!==void 0&&!this.#f(this.#s[t])&&(yield this.#s[t])}*rvalues(){for(let t of this.#P())this.#s[t]!==void 0&&!this.#f(this.#s[t])&&(yield this.#s[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,r={}){for(let n of this.#T()){let s=this.#s[n],o=this.#f(s)?s.__staleWhileFetching:s;if(o!==void 0&&t(o,this.#a[n],this))return this.get(this.#a[n],r)}}forEach(t,r=this){for(let n of this.#T()){let s=this.#s[n],o=this.#f(s)?s.__staleWhileFetching:s;o!==void 0&&t.call(r,o,this.#a[n],this)}}rforEach(t,r=this){for(let n of this.#P()){let s=this.#s[n],o=this.#f(s)?s.__staleWhileFetching:s;o!==void 0&&t.call(r,o,this.#a[n],this)}}purgeStale(){let t=!1;for(let r of this.#P({allowStale:!0}))this.#b(r)&&(this.#I(this.#a[r],"expire"),t=!0);return t}info(t){let r=this.#u.get(t);if(r===void 0)return;let n=this.#s[r],s=this.#f(n)?n.__staleWhileFetching:n;if(s===void 0)return;let o={value:s};if(this.#S&&this.#x){let a=this.#S[r],c=this.#x[r];if(a&&c){let l=a-(ml.now()-c);o.ttl=l,o.start=Date.now()}}return this.#_&&(o.size=this.#_[r]),o}dump(){let t=[];for(let r of this.#T({allowStale:!0})){let n=this.#a[r],s=this.#s[r],o=this.#f(s)?s.__staleWhileFetching:s;if(o===void 0||n===void 0)continue;let a={value:o};if(this.#S&&this.#x){a.ttl=this.#S[r];let c=ml.now()-this.#x[r];a.start=Math.floor(Date.now()-c)}this.#_&&(a.size=this.#_[r]),t.unshift([n,a])}return t}load(t){this.clear();for(let[r,n]of t){if(n.start){let s=Date.now()-n.start;n.start=ml.now()-s}this.set(r,n.value,n)}}set(t,r,n={}){if(r===void 0)return this.delete(t),this;let{ttl:s=this.ttl,start:o,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:l}=n,{noUpdateTTL:u=this.noUpdateTTL}=n,d=this.#B(t,r,n.size||0,c);if(this.maxEntrySize&&d>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.#I(t,"set"),this;let f=this.#l===0?void 0:this.#u.get(t);if(f===void 0)f=this.#l===0?this.#g:this.#v.length!==0?this.#v.pop():this.#l===this.#t?this.#$(!1):this.#l,this.#a[f]=t,this.#s[f]=r,this.#u.set(t,f),this.#y[this.#g]=f,this.#p[f]=this.#g,this.#g=f,this.#l++,this.#N(f,d,l),l&&(l.set="add"),u=!1;else{this.#j(f);let m=this.#s[f];if(r!==m){if(this.#C&&this.#f(m)){m.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=m;g!==void 0&&!a&&(this.#w&&this.#n?.(g,t,"set"),this.#h&&this.#E?.push([g,t,"set"]))}else a||(this.#w&&this.#n?.(m,t,"set"),this.#h&&this.#E?.push([m,t,"set"]));if(this.#D(f),this.#N(f,d,l),this.#s[f]=r,l){l.set="replace";let g=m&&this.#f(m)?m.__staleWhileFetching:m;g!==void 0&&(l.oldValue=g)}}else l&&(l.set="update")}if(s!==0&&!this.#S&&this.#R(),this.#S&&(u||this.#k(f,s,o),l&&this.#i(l,f)),!a&&this.#h&&this.#E){let m=this.#E,g;for(;g=m?.shift();)this.#e?.(...g)}return this}pop(){try{for(;this.#l;){let t=this.#s[this.#m];if(this.#$(!0),this.#f(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#h&&this.#E){let t=this.#E,r;for(;r=t?.shift();)this.#e?.(...r)}}}#$(t){let r=this.#m,n=this.#a[r],s=this.#s[r];return this.#C&&this.#f(s)?s.__abortController.abort(new Error("evicted")):(this.#w||this.#h)&&(this.#w&&this.#n?.(s,n,"evict"),this.#h&&this.#E?.push([s,n,"evict"])),this.#D(r),t&&(this.#a[r]=void 0,this.#s[r]=void 0,this.#v.push(r)),this.#l===1?(this.#m=this.#g=0,this.#v.length=0):this.#m=this.#y[r],this.#u.delete(n),this.#l--,r}has(t,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:s}=r,o=this.#u.get(t);if(o!==void 0){let a=this.#s[o];if(this.#f(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#b(o))s&&(s.has="stale",this.#i(s,o));else return n&&this.#A(o),s&&(s.has="hit",this.#i(s,o)),!0}else s&&(s.has="miss");return!1}peek(t,r={}){let{allowStale:n=this.allowStale}=r,s=this.#u.get(t);if(s===void 0||!n&&this.#b(s))return;let o=this.#s[s];return this.#f(o)?o.__staleWhileFetching:o}#L(t,r,n,s){let o=r===void 0?void 0:this.#s[r];if(this.#f(o))return o;let a=new Cm,{signal:c}=n;c?.addEventListener("abort",()=>a.abort(c.reason),{signal:a.signal});let l={signal:a.signal,options:n,context:s},u=i((w,C=!1)=>{let{aborted:v}=a.signal,D=n.ignoreFetchAbort&&w!==void 0;if(n.status&&(v&&!C?(n.status.fetchAborted=!0,n.status.fetchError=a.signal.reason,D&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),v&&!D&&!C)return f(a.signal.reason);let $=g;return this.#s[r]===g&&(w===void 0?$.__staleWhileFetching?this.#s[r]=$.__staleWhileFetching:this.#I(t,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(t,w,l.options))),w},"cb"),d=i(w=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=w),f(w)),"eb"),f=i(w=>{let{aborted:C}=a.signal,v=C&&n.allowStaleOnFetchAbort,D=v||n.allowStaleOnFetchRejection,$=D||n.noDeleteOnFetchRejection,U=g;if(this.#s[r]===g&&(!$||U.__staleWhileFetching===void 0?this.#I(t,"fetch"):v||(this.#s[r]=U.__staleWhileFetching)),D)return n.status&&U.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),U.__staleWhileFetching;if(U.__returned===U)throw w},"fetchFail"),m=i((w,C)=>{let v=this.#o?.(t,o,l);v&&v instanceof Promise&&v.then(D=>w(D===void 0?void 0:D),C),a.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(w(void 0),n.allowStaleOnFetchAbort&&(w=i(D=>u(D,!0),"res")))})},"pcall");n.status&&(n.status.fetchDispatched=!0);let g=new Promise(m).then(u,d),E=Object.assign(g,{__abortController:a,__staleWhileFetching:o,__returned:void 0});return r===void 0?(this.set(t,E,{...l.options,status:void 0}),r=this.#u.get(t)):this.#s[r]=E,E}#f(t){if(!this.#C)return!1;let r=t;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof Cm}async fetch(t,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:d=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:E=this.allowStaleOnFetchAbort,context:w,forceRefresh:C=!1,status:v,signal:D}=r;if(!this.#C)return v&&(v.fetch="get"),this.get(t,{allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:o,status:v});let $={allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:o,ttl:a,noDisposeOnSet:c,size:l,sizeCalculation:u,noUpdateTTL:d,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:E,ignoreFetchAbort:g,status:v,signal:D},U=this.#u.get(t);if(U===void 0){v&&(v.fetch="miss");let ie=this.#L(t,U,$,w);return ie.__returned=ie}else{let ie=this.#s[U];if(this.#f(ie)){let G=n&&ie.__staleWhileFetching!==void 0;return v&&(v.fetch="inflight",G&&(v.returnedStale=!0)),G?ie.__staleWhileFetching:ie.__returned=ie}let fe=this.#b(U);if(!C&&!fe)return v&&(v.fetch="hit"),this.#j(U),s&&this.#A(U),v&&this.#i(v,U),ie;let Me=this.#L(t,U,$,w),j=Me.__staleWhileFetching!==void 0&&n;return v&&(v.fetch=fe?"stale":"refresh",j&&fe&&(v.returnedStale=!0)),j?Me.__staleWhileFetching:Me.__returned=Me}}async forceFetch(t,r={}){let n=await this.fetch(t,r);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(t,r={}){let n=this.#c;if(!n)throw new Error("no memoMethod provided to constructor");let{context:s,forceRefresh:o,...a}=r,c=this.get(t,a);if(!o&&c!==void 0)return c;let l=n(t,c,{options:a,context:s});return this.set(t,l,a),l}get(t,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:a}=r,c=this.#u.get(t);if(c!==void 0){let l=this.#s[c],u=this.#f(l);return a&&this.#i(a,c),this.#b(c)?(a&&(a.get="stale"),u?(a&&n&&l.__staleWhileFetching!==void 0&&(a.returnedStale=!0),n?l.__staleWhileFetching:void 0):(o||this.#I(t,"expire"),a&&n&&(a.returnedStale=!0),n?l:void 0)):(a&&(a.get="hit"),u?l.__staleWhileFetching:(this.#j(c),s&&this.#A(c),l))}else a&&(a.get="miss")}#F(t,r){this.#p[r]=t,this.#y[t]=r}#j(t){t!==this.#g&&(t===this.#m?this.#m=this.#y[t]:this.#F(this.#p[t],this.#y[t]),this.#F(this.#g,t),this.#g=t)}delete(t){return this.#I(t,"delete")}#I(t,r){let n=!1;if(this.#l!==0){let s=this.#u.get(t);if(s!==void 0)if(n=!0,this.#l===1)this.#U(r);else{this.#D(s);let o=this.#s[s];if(this.#f(o)?o.__abortController.abort(new Error("deleted")):(this.#w||this.#h)&&(this.#w&&this.#n?.(o,t,r),this.#h&&this.#E?.push([o,t,r])),this.#u.delete(t),this.#a[s]=void 0,this.#s[s]=void 0,s===this.#g)this.#g=this.#p[s];else if(s===this.#m)this.#m=this.#y[s];else{let a=this.#p[s];this.#y[a]=this.#y[s];let c=this.#y[s];this.#p[c]=this.#p[s]}this.#l--,this.#v.push(s)}}if(this.#h&&this.#E?.length){let s=this.#E,o;for(;o=s?.shift();)this.#e?.(...o)}return n}clear(){return this.#U("delete")}#U(t){for(let r of this.#P({allowStale:!0})){let n=this.#s[r];if(this.#f(n))n.__abortController.abort(new Error("deleted"));else{let s=this.#a[r];this.#w&&this.#n?.(n,s,t),this.#h&&this.#E?.push([n,s,t])}}if(this.#u.clear(),this.#s.fill(void 0),this.#a.fill(void 0),this.#S&&this.#x&&(this.#S.fill(0),this.#x.fill(0)),this.#_&&this.#_.fill(0),this.#m=0,this.#g=0,this.#v.length=0,this.#d=0,this.#l=0,this.#h&&this.#E){let r=this.#E,n;for(;n=r?.shift();)this.#e?.(...n)}}};var Pm=require("node:events"),W_=k(require("node:stream"),1),QN=require("node:string_decoder"),KN=typeof process=="object"&&process?process:{stdout:null,stderr:null},ude=i(e=>!!e&&typeof e=="object"&&(e instanceof Ho||e instanceof W_.default||dde(e)||fde(e)),"isStream"),dde=i(e=>!!e&&typeof e=="object"&&e instanceof Pm.EventEmitter&&typeof e.pipe=="function"&&e.pipe!==W_.default.Writable.prototype.pipe,"isReadable"),fde=i(e=>!!e&&typeof e=="object"&&e instanceof Pm.EventEmitter&&typeof e.write=="function"&&typeof e.end=="function","isWritable"),eo=Symbol("EOF"),to=Symbol("maybeEmitEnd"),qo=Symbol("emittedEnd"),_m=Symbol("emittingEnd"),tf=Symbol("emittedError"),xm=Symbol("closed"),YN=Symbol("read"),vm=Symbol("flush"),XN=Symbol("flushChunk"),js=Symbol("encoding"),yl=Symbol("decoder"),vr=Symbol("flowing"),rf=Symbol("paused"),El=Symbol("resume"),Ar=Symbol("buffer"),Sn=Symbol("pipes"),Rr=Symbol("bufferLength"),U_=Symbol("bufferPush"),Am=Symbol("bufferShift"),Qr=Symbol("objectMode"),Yt=Symbol("destroyed"),q_=Symbol("error"),H_=Symbol("emitData"),JN=Symbol("emitEnd"),G_=Symbol("emitEnd2"),mi=Symbol("async"),z_=Symbol("abort"),Rm=Symbol("aborted"),nf=Symbol("signal"),Za=Symbol("dataListeners"),Qn=Symbol("discarded"),sf=i(e=>Promise.resolve().then(e),"defer"),hde=i(e=>e(),"nodefer"),pde=i(e=>e==="end"||e==="finish"||e==="prefinish","isEndish"),mde=i(e=>e instanceof ArrayBuffer||!!e&&typeof e=="object"&&e.constructor&&e.constructor.name==="ArrayBuffer"&&e.byteLength>=0,"isArrayBufferLike"),gde=i(e=>!Buffer.isBuffer(e)&&ArrayBuffer.isView(e),"isArrayBufferView"),Tm=class{static{i(this,"Pipe")}src;dest;opts;ondrain;constructor(t,r,n){this.src=t,this.dest=r,this.opts=n,this.ondrain=()=>t[El](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},V_=class extends Tm{static{i(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,r,n){super(t,r,n),this.proxyErrors=s=>r.emit("error",s),t.on("error",this.proxyErrors)}},yde=i(e=>!!e.objectMode,"isObjectModeOptions"),Ede=i(e=>!e.objectMode&&!!e.encoding&&e.encoding!=="buffer","isEncodingOptions"),Ho=class extends Pm.EventEmitter{static{i(this,"Minipass")}[vr]=!1;[rf]=!1;[Sn]=[];[Ar]=[];[Qr];[js];[mi];[yl];[eo]=!1;[qo]=!1;[_m]=!1;[xm]=!1;[tf]=null;[Rr]=0;[Yt]=!1;[nf];[Rm]=!1;[Za]=0;[Qn]=!1;writable=!0;readable=!0;constructor(...t){let r=t[0]||{};if(super(),r.objectMode&&typeof r.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");yde(r)?(this[Qr]=!0,this[js]=null):Ede(r)?(this[js]=r.encoding,this[Qr]=!1):(this[Qr]=!1,this[js]=null),this[mi]=!!r.async,this[yl]=this[js]?new QN.StringDecoder(this[js]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:i(()=>this[Ar],"get")}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:i(()=>this[Sn],"get")});let{signal:n}=r;n&&(this[nf]=n,n.aborted?this[z_]():n.addEventListener("abort",()=>this[z_]()))}get bufferLength(){return this[Rr]}get encoding(){return this[js]}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[Qr]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[mi]}set async(t){this[mi]=this[mi]||!!t}[z_](){this[Rm]=!0,this.emit("abort",this[nf]?.reason),this.destroy(this[nf]?.reason)}get aborted(){return this[Rm]}set aborted(t){}write(t,r,n){if(this[Rm])return!1;if(this[eo])throw new Error("write after end");if(this[Yt])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof r=="function"&&(n=r,r="utf8"),r||(r="utf8");let s=this[mi]?sf:hde;if(!this[Qr]&&!Buffer.isBuffer(t)){if(gde(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(mde(t))t=Buffer.from(t);else if(typeof t!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[Qr]?(this[vr]&&this[Rr]!==0&&this[vm](!0),this[vr]?this.emit("data",t):this[U_](t),this[Rr]!==0&&this.emit("readable"),n&&s(n),this[vr]):t.length?(typeof t=="string"&&!(r===this[js]&&!this[yl]?.lastNeed)&&(t=Buffer.from(t,r)),Buffer.isBuffer(t)&&this[js]&&(t=this[yl].write(t)),this[vr]&&this[Rr]!==0&&this[vm](!0),this[vr]?this.emit("data",t):this[U_](t),this[Rr]!==0&&this.emit("readable"),n&&s(n),this[vr]):(this[Rr]!==0&&this.emit("readable"),n&&s(n),this[vr])}read(t){if(this[Yt])return null;if(this[Qn]=!1,this[Rr]===0||t===0||t&&t>this[Rr])return this[to](),null;this[Qr]&&(t=null),this[Ar].length>1&&!this[Qr]&&(this[Ar]=[this[js]?this[Ar].join(""):Buffer.concat(this[Ar],this[Rr])]);let r=this[YN](t||null,this[Ar][0]);return this[to](),r}[YN](t,r){if(this[Qr])this[Am]();else{let n=r;t===n.length||t===null?this[Am]():typeof n=="string"?(this[Ar][0]=n.slice(t),r=n.slice(0,t),this[Rr]-=t):(this[Ar][0]=n.subarray(t),r=n.subarray(0,t),this[Rr]-=t)}return this.emit("data",r),!this[Ar].length&&!this[eo]&&this.emit("drain"),r}end(t,r,n){return typeof t=="function"&&(n=t,t=void 0),typeof r=="function"&&(n=r,r="utf8"),t!==void 0&&this.write(t,r),n&&this.once("end",n),this[eo]=!0,this.writable=!1,(this[vr]||!this[rf])&&this[to](),this}[El](){this[Yt]||(!this[Za]&&!this[Sn].length&&(this[Qn]=!0),this[rf]=!1,this[vr]=!0,this.emit("resume"),this[Ar].length?this[vm]():this[eo]?this[to]():this.emit("drain"))}resume(){return this[El]()}pause(){this[vr]=!1,this[rf]=!0,this[Qn]=!1}get destroyed(){return this[Yt]}get flowing(){return this[vr]}get paused(){return this[rf]}[U_](t){this[Qr]?this[Rr]+=1:this[Rr]+=t.length,this[Ar].push(t)}[Am](){return this[Qr]?this[Rr]-=1:this[Rr]-=this[Ar][0].length,this[Ar].shift()}[vm](t=!1){do;while(this[XN](this[Am]())&&this[Ar].length);!t&&!this[Ar].length&&!this[eo]&&this.emit("drain")}[XN](t){return this.emit("data",t),this[vr]}pipe(t,r){if(this[Yt])return t;this[Qn]=!1;let n=this[qo];return r=r||{},t===KN.stdout||t===KN.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,n?r.end&&t.end():(this[Sn].push(r.proxyErrors?new V_(this,t,r):new Tm(this,t,r)),this[mi]?sf(()=>this[El]()):this[El]()),t}unpipe(t){let r=this[Sn].find(n=>n.dest===t);r&&(this[Sn].length===1?(this[vr]&&this[Za]===0&&(this[vr]=!1),this[Sn]=[]):this[Sn].splice(this[Sn].indexOf(r),1),r.unpipe())}addListener(t,r){return this.on(t,r)}on(t,r){let n=super.on(t,r);if(t==="data")this[Qn]=!1,this[Za]++,!this[Sn].length&&!this[vr]&&this[El]();else if(t==="readable"&&this[Rr]!==0)super.emit("readable");else if(pde(t)&&this[qo])super.emit(t),this.removeAllListeners(t);else if(t==="error"&&this[tf]){let s=r;this[mi]?sf(()=>s.call(this,this[tf])):s.call(this,this[tf])}return n}removeListener(t,r){return this.off(t,r)}off(t,r){let n=super.off(t,r);return t==="data"&&(this[Za]=this.listeners("data").length,this[Za]===0&&!this[Qn]&&!this[Sn].length&&(this[vr]=!1)),n}removeAllListeners(t){let r=super.removeAllListeners(t);return(t==="data"||t===void 0)&&(this[Za]=0,!this[Qn]&&!this[Sn].length&&(this[vr]=!1)),r}get emittedEnd(){return this[qo]}[to](){!this[_m]&&!this[qo]&&!this[Yt]&&this[Ar].length===0&&this[eo]&&(this[_m]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[xm]&&this.emit("close"),this[_m]=!1)}emit(t,...r){let n=r[0];if(t!=="error"&&t!=="close"&&t!==Yt&&this[Yt])return!1;if(t==="data")return!this[Qr]&&!n?!1:this[mi]?(sf(()=>this[H_](n)),!0):this[H_](n);if(t==="end")return this[JN]();if(t==="close"){if(this[xm]=!0,!this[qo]&&!this[Yt])return!1;let o=super.emit("close");return this.removeAllListeners("close"),o}else if(t==="error"){this[tf]=n,super.emit(q_,n);let o=!this[nf]||this.listeners("error").length?super.emit("error",n):!1;return this[to](),o}else if(t==="resume"){let o=super.emit("resume");return this[to](),o}else if(t==="finish"||t==="prefinish"){let o=super.emit(t);return this.removeAllListeners(t),o}let s=super.emit(t,...r);return this[to](),s}[H_](t){for(let n of this[Sn])n.dest.write(t)===!1&&this.pause();let r=this[Qn]?!1:super.emit("data",t);return this[to](),r}[JN](){return this[qo]?!1:(this[qo]=!0,this.readable=!1,this[mi]?(sf(()=>this[G_]()),!0):this[G_]())}[G_](){if(this[yl]){let r=this[yl].end();if(r){for(let n of this[Sn])n.dest.write(r);this[Qn]||super.emit("data",r)}}for(let r of this[Sn])r.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[Qr]||(t.dataLength=0);let r=this.promise();return this.on("data",n=>{t.push(n),this[Qr]||(t.dataLength+=n.length)}),await r,t}async concat(){if(this[Qr])throw new Error("cannot concat in objectMode");let t=await this.collect();return this[js]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,r)=>{this.on(Yt,()=>r(new Error("stream destroyed"))),this.on("error",n=>r(n)),this.on("end",()=>t())})}[Symbol.asyncIterator](){this[Qn]=!1;let t=!1,r=i(async()=>(this.pause(),t=!0,{value:void 0,done:!0}),"stop");return{next:i(()=>{if(t)return r();let s=this.read();if(s!==null)return Promise.resolve({done:!1,value:s});if(this[eo])return r();let o,a,c=i(f=>{this.off("data",l),this.off("end",u),this.off(Yt,d),r(),a(f)},"onerr"),l=i(f=>{this.off("error",c),this.off("end",u),this.off(Yt,d),this.pause(),o({value:f,done:!!this[eo]})},"ondata"),u=i(()=>{this.off("error",c),this.off("data",l),this.off(Yt,d),r(),o({done:!0,value:void 0})},"onend"),d=i(()=>c(new Error("stream destroyed")),"ondestroy");return new Promise((f,m)=>{a=m,o=f,this.once(Yt,d),this.once("error",c),this.once("end",u),this.once("data",l)})},"next"),throw:r,return:r,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Qn]=!1;let t=!1,r=i(()=>(this.pause(),this.off(q_,r),this.off(Yt,r),this.off("end",r),t=!0,{done:!0,value:void 0}),"stop"),n=i(()=>{if(t)return r();let s=this.read();return s===null?r():{done:!1,value:s}},"next");return this.once("end",r),this.once(q_,r),this.once(Yt,r),{next:n,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(t){if(this[Yt])return t?this.emit("error",t):this.emit(Yt),this;this[Yt]=!0,this[Qn]=!0,this[Ar].length=0,this[Rr]=0;let r=this;return typeof r.close=="function"&&!this[xm]&&r.close(),t?this.emit("error",t):this.emit(Yt),this}static get isStream(){return ude}};var wl=require("node:path"),dB=require("node:url"),yi=require("fs"),Sde=k(require("node:fs"),1),Go=require("node:fs/promises"),bde=yi.realpathSync.native,of={lstatSync:yi.lstatSync,readdir:yi.readdir,readdirSync:yi.readdirSync,readlinkSync:yi.readlinkSync,realpathSync:bde,promises:{lstat:Go.lstat,readdir:Go.readdir,readlink:Go.readlink,realpath:Go.realpath}},ZN=i(e=>!e||e===of||e===Sde?of:{...of,...e,promises:{...of.promises,...e.promises||{}}},"fsFromOption"),eB=/^\\\\\?\\([a-z]:)\\?$/i,wde=i(e=>e.replace(/\//g,"\\").replace(eB,"$1\\"),"uncToDrive"),Cde=/[\\\/]/,ys=0,tB=1,rB=2,gi=4,nB=6,sB=8,ec=10,iB=12,Es=15,af=~Es,K_=16,oB=32,cf=64,Us=128,km=256,Om=512,aB=cf|Us|Om,_de=1023,Y_=i(e=>e.isFile()?sB:e.isDirectory()?gi:e.isSymbolicLink()?ec:e.isCharacterDevice()?rB:e.isBlockDevice()?nB:e.isSocket()?iB:e.isFIFO()?tB:ys,"entToType"),cB=new Map,lf=i(e=>{let t=cB.get(e);if(t)return t;let r=e.normalize("NFKD");return cB.set(e,r),r},"normalize"),lB=new Map,Im=i(e=>{let t=lB.get(e);if(t)return t;let r=lf(e.toLowerCase());return lB.set(e,r),r},"normalizeNocase"),Dm=class extends ef{static{i(this,"ResolveCache")}constructor(){super({max:256})}},X_=class extends ef{static{i(this,"ChildrenCache")}constructor(t=16*1024){super({maxSize:t,sizeCalculation:i(r=>r.length+1,"sizeCalculation")})}},uB=Symbol("PathScurry setAsCwd"),Zr=class{static{i(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#t;#r;get dev(){return this.#r}#n;get mode(){return this.#n}#e;get nlink(){return this.#e}#o;get uid(){return this.#o}#c;get gid(){return this.#c}#l;get rdev(){return this.#l}#d;get blksize(){return this.#d}#u;get ino(){return this.#u}#a;get size(){return this.#a}#s;get blocks(){return this.#s}#y;get atimeMs(){return this.#y}#p;get mtimeMs(){return this.#p}#m;get ctimeMs(){return this.#m}#g;get birthtimeMs(){return this.#g}#v;get atime(){return this.#v}#E;get mtime(){return this.#E}#_;get ctime(){return this.#_}#x;get birthtime(){return this.#x}#S;#w;#C;#h;#R;#A;#i;#k;#b;#O;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(t,r=ys,n,s,o,a,c){this.name=t,this.#S=o?Im(t):lf(t),this.#i=r&_de,this.nocase=o,this.roots=s,this.root=n||this,this.#k=a,this.#C=c.fullpath,this.#R=c.relative,this.#A=c.relativePosix,this.parent=c.parent,this.parent?this.#t=this.parent.#t:this.#t=ZN(c.fs)}depth(){return this.#w!==void 0?this.#w:this.parent?this.#w=this.parent.depth()+1:this.#w=0}childrenCache(){return this.#k}resolve(t){if(!t)return this;let r=this.getRootString(t),s=t.substring(r.length).split(this.splitSep);return r?this.getRoot(r).#D(s):this.#D(s)}#D(t){let r=this;for(let n of t)r=r.child(n);return r}children(){let t=this.#k.get(this);if(t)return t;let r=Object.assign([],{provisional:0});return this.#k.set(this,r),this.#i&=~K_,r}child(t,r){if(t===""||t===".")return this;if(t==="..")return this.parent||this;let n=this.children(),s=this.nocase?Im(t):lf(t);for(let l of n)if(l.#S===s)return l;let o=this.parent?this.sep:"",a=this.#C?this.#C+o+t:void 0,c=this.newChild(t,ys,{...r,parent:this,fullpath:a});return this.canReaddir()||(c.#i|=Us),n.push(c),c}relative(){if(this.isCWD)return"";if(this.#R!==void 0)return this.#R;let t=this.name,r=this.parent;if(!r)return this.#R=this.name;let n=r.relative();return n+(!n||!r.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#A!==void 0)return this.#A;let t=this.name,r=this.parent;if(!r)return this.#A=this.fullpathPosix();let n=r.relativePosix();return n+(!n||!r.parent?"":"/")+t}fullpath(){if(this.#C!==void 0)return this.#C;let t=this.name,r=this.parent;if(!r)return this.#C=this.name;let s=r.fullpath()+(r.parent?this.sep:"")+t;return this.#C=s}fullpathPosix(){if(this.#h!==void 0)return this.#h;if(this.sep==="/")return this.#h=this.fullpath();if(!this.parent){let s=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(s)?this.#h=`//?/${s}`:this.#h=s}let t=this.parent,r=t.fullpathPosix(),n=r+(!r||!t.parent?"":"/")+this.name;return this.#h=n}isUnknown(){return(this.#i&Es)===ys}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.#i&Es)===sB}isDirectory(){return(this.#i&Es)===gi}isCharacterDevice(){return(this.#i&Es)===rB}isBlockDevice(){return(this.#i&Es)===nB}isFIFO(){return(this.#i&Es)===tB}isSocket(){return(this.#i&Es)===iB}isSymbolicLink(){return(this.#i&ec)===ec}lstatCached(){return this.#i&oB?this:void 0}readlinkCached(){return this.#b}realpathCached(){return this.#O}readdirCached(){let t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(this.#b)return!0;if(!this.parent)return!1;let t=this.#i&Es;return!(t!==ys&&t!==ec||this.#i&km||this.#i&Us)}calledReaddir(){return!!(this.#i&K_)}isENOENT(){return!!(this.#i&Us)}isNamed(t){return this.nocase?this.#S===Im(t):this.#S===lf(t)}async readlink(){let t=this.#b;if(t)return t;if(this.canReadlink()&&this.parent)try{let r=await this.#t.promises.readlink(this.fullpath()),n=(await this.parent.realpath())?.resolve(r);if(n)return this.#b=n}catch(r){this.#f(r.code);return}}readlinkSync(){let t=this.#b;if(t)return t;if(this.canReadlink()&&this.parent)try{let r=this.#t.readlinkSync(this.fullpath()),n=this.parent.realpathSync()?.resolve(r);if(n)return this.#b=n}catch(r){this.#f(r.code);return}}#N(t){this.#i|=K_;for(let r=t.provisional;r<t.length;r++){let n=t[r];n&&n.#B()}}#B(){this.#i&Us||(this.#i=(this.#i|Us)&af,this.#T())}#T(){let t=this.children();t.provisional=0;for(let r of t)r.#B()}#P(){this.#i|=Om,this.#M()}#M(){if(this.#i&cf)return;let t=this.#i;(t&Es)===gi&&(t&=af),this.#i=t|cf,this.#T()}#$(t=""){t==="ENOTDIR"||t==="EPERM"?this.#M():t==="ENOENT"?this.#B():this.children().provisional=0}#L(t=""){t==="ENOTDIR"?this.parent.#M():t==="ENOENT"&&this.#B()}#f(t=""){let r=this.#i;r|=km,t==="ENOENT"&&(r|=Us),(t==="EINVAL"||t==="UNKNOWN")&&(r&=af),this.#i=r,t==="ENOTDIR"&&this.parent&&this.parent.#M()}#F(t,r){return this.#I(t,r)||this.#j(t,r)}#j(t,r){let n=Y_(t),s=this.newChild(t.name,n,{parent:this}),o=s.#i&Es;return o!==gi&&o!==ec&&o!==ys&&(s.#i|=cf),r.unshift(s),r.provisional++,s}#I(t,r){for(let n=r.provisional;n<r.length;n++){let s=r[n];if((this.nocase?Im(t.name):lf(t.name))===s.#S)return this.#U(t,s,n,r)}}#U(t,r,n,s){let o=r.name;return r.#i=r.#i&af|Y_(t),o!==t.name&&(r.name=t.name),n!==s.provisional&&(n===s.length-1?s.pop():s.splice(n,1),s.unshift(r)),s.provisional++,r}async lstat(){if((this.#i&Us)===0)try{return this.#z(await this.#t.promises.lstat(this.fullpath())),this}catch(t){this.#L(t.code)}}lstatSync(){if((this.#i&Us)===0)try{return this.#z(this.#t.lstatSync(this.fullpath())),this}catch(t){this.#L(t.code)}}#z(t){let{atime:r,atimeMs:n,birthtime:s,birthtimeMs:o,blksize:a,blocks:c,ctime:l,ctimeMs:u,dev:d,gid:f,ino:m,mode:g,mtime:E,mtimeMs:w,nlink:C,rdev:v,size:D,uid:$}=t;this.#v=r,this.#y=n,this.#x=s,this.#g=o,this.#d=a,this.#s=c,this.#_=l,this.#m=u,this.#r=d,this.#c=f,this.#u=m,this.#n=g,this.#E=E,this.#p=w,this.#e=C,this.#l=v,this.#a=D,this.#o=$;let U=Y_(t);this.#i=this.#i&af|U|oB,U!==ys&&U!==gi&&U!==ec&&(this.#i|=cf)}#H=[];#G=!1;#V(t){this.#G=!1;let r=this.#H.slice();this.#H.length=0,r.forEach(n=>n(null,t))}readdirCB(t,r=!1){if(!this.canReaddir()){r?t(null,[]):queueMicrotask(()=>t(null,[]));return}let n=this.children();if(this.calledReaddir()){let o=n.slice(0,n.provisional);r?t(null,o):queueMicrotask(()=>t(null,o));return}if(this.#H.push(t),this.#G)return;this.#G=!0;let s=this.fullpath();this.#t.readdir(s,{withFileTypes:!0},(o,a)=>{if(o)this.#$(o.code),n.provisional=0;else{for(let c of a)this.#F(c,n);this.#N(n)}this.#V(n.slice(0,n.provisional))})}#q;async readdir(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let r=this.fullpath();if(this.#q)await this.#q;else{let n=i(()=>{},"resolve");this.#q=new Promise(s=>n=s);try{for(let s of await this.#t.promises.readdir(r,{withFileTypes:!0}))this.#F(s,t);this.#N(t)}catch(s){this.#$(s.code),t.provisional=0}this.#q=void 0,n()}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 r=this.fullpath();try{for(let n of this.#t.readdirSync(r,{withFileTypes:!0}))this.#F(n,t);this.#N(t)}catch(n){this.#$(n.code),t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(this.#i&aB)return!1;let t=Es&this.#i;return t===ys||t===gi||t===ec}shouldWalk(t,r){return(this.#i&gi)===gi&&!(this.#i&aB)&&!t.has(this)&&(!r||r(this))}async realpath(){if(this.#O)return this.#O;if(!((Om|km|Us)&this.#i))try{let t=await this.#t.promises.realpath(this.fullpath());return this.#O=this.resolve(t)}catch{this.#P()}}realpathSync(){if(this.#O)return this.#O;if(!((Om|km|Us)&this.#i))try{let t=this.#t.realpathSync(this.fullpath());return this.#O=this.resolve(t)}catch{this.#P()}}[uB](t){if(t===this)return;t.isCWD=!1,this.isCWD=!0;let r=new Set([]),n=[],s=this;for(;s&&s.parent;)r.add(s),s.#R=n.join(this.sep),s.#A=n.join("/"),s=s.parent,n.push("..");for(s=t;s&&s.parent&&!r.has(s);)s.#R=void 0,s.#A=void 0,s=s.parent}},Nm=class e extends Zr{static{i(this,"PathWin32")}sep="\\";splitSep=Cde;constructor(t,r=ys,n,s,o,a,c){super(t,r,n,s,o,a,c)}newChild(t,r=ys,n={}){return new e(t,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(t){return wl.win32.parse(t).root}getRoot(t){if(t=wde(t.toUpperCase()),t===this.root.name)return this.root;for(let[r,n]of Object.entries(this.roots))if(this.sameRoot(t,r))return this.roots[t]=n;return this.roots[t]=new Sl(t,this).root}sameRoot(t,r=this.root.name){return t=t.toUpperCase().replace(/\//g,"\\").replace(eB,"$1\\"),t===r}},Bm=class e extends Zr{static{i(this,"PathPosix")}splitSep="/";sep="/";constructor(t,r=ys,n,s,o,a,c){super(t,r,n,s,o,a,c)}getRootString(t){return t.startsWith("/")?"/":""}getRoot(t){return this.root}newChild(t,r=ys,n={}){return new e(t,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}},Mm=class{static{i(this,"PathScurryBase")}root;rootPath;roots;cwd;#t;#r;#n;nocase;#e;constructor(t=process.cwd(),r,n,{nocase:s,childrenCacheSize:o=16*1024,fs:a=of}={}){this.#e=ZN(a),(t instanceof URL||t.startsWith("file://"))&&(t=(0,dB.fileURLToPath)(t));let c=r.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(c),this.#t=new Dm,this.#r=new Dm,this.#n=new X_(o);let l=c.substring(this.rootPath.length).split(n);if(l.length===1&&!l[0]&&l.pop(),s===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=s,this.root=this.newRoot(this.#e),this.roots[this.rootPath]=this.root;let u=this.root,d=l.length-1,f=r.sep,m=this.rootPath,g=!1;for(let E of l){let w=d--;u=u.child(E,{relative:new Array(w).fill("..").join(f),relativePosix:new Array(w).fill("..").join("/"),fullpath:m+=(g?"":f)+E}),g=!0}this.cwd=u}depth(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return this.#n}resolve(...t){let r="";for(let o=t.length-1;o>=0;o--){let a=t[o];if(!(!a||a===".")&&(r=r?`${a}/${r}`:a,this.isAbsolute(a)))break}let n=this.#t.get(r);if(n!==void 0)return n;let s=this.cwd.resolve(r).fullpath();return this.#t.set(r,s),s}resolvePosix(...t){let r="";for(let o=t.length-1;o>=0;o--){let a=t[o];if(!(!a||a===".")&&(r=r?`${a}/${r}`:a,this.isAbsolute(a)))break}let n=this.#r.get(r);if(n!==void 0)return n;let s=this.cwd.resolve(r).fullpathPosix();return this.#r.set(r,s),s}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,r={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Zr||(r=t,t=this.cwd);let{withFileTypes:n}=r;if(t.canReaddir()){let s=await t.readdir();return n?s:s.map(o=>o.name)}else return[]}readdirSync(t=this.cwd,r={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Zr||(r=t,t=this.cwd);let{withFileTypes:n=!0}=r;return t.canReaddir()?n?t.readdirSync():t.readdirSync().map(s=>s.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:r}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Zr||(r=t.withFileTypes,t=this.cwd);let n=await t.readlink();return r?n:n?.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Zr||(r=t.withFileTypes,t=this.cwd);let n=t.readlinkSync();return r?n:n?.fullpath()}async realpath(t=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Zr||(r=t.withFileTypes,t=this.cwd);let n=await t.realpath();return r?n:n?.fullpath()}realpathSync(t=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Zr||(r=t.withFileTypes,t=this.cwd);let n=t.realpathSync();return r?n:n?.fullpath()}async walk(t=this.cwd,r={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Zr||(r=t,t=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:o,walkFilter:a}=r,c=[];(!o||o(t))&&c.push(n?t:t.fullpath());let l=new Set,u=i((f,m)=>{l.add(f),f.readdirCB((g,E)=>{if(g)return m(g);let w=E.length;if(!w)return m();let C=i(()=>{--w===0&&m()},"next");for(let v of E)(!o||o(v))&&c.push(n?v:v.fullpath()),s&&v.isSymbolicLink()?v.realpath().then(D=>D?.isUnknown()?D.lstat():D).then(D=>D?.shouldWalk(l,a)?u(D,C):C()):v.shouldWalk(l,a)?u(v,C):C()},!0)},"walk"),d=t;return new Promise((f,m)=>{u(d,g=>{if(g)return m(g);f(c)})})}walkSync(t=this.cwd,r={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Zr||(r=t,t=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:o,walkFilter:a}=r,c=[];(!o||o(t))&&c.push(n?t:t.fullpath());let l=new Set([t]);for(let u of l){let d=u.readdirSync();for(let f of d){(!o||o(f))&&c.push(n?f:f.fullpath());let m=f;if(f.isSymbolicLink()){if(!(s&&(m=f.realpathSync())))continue;m.isUnknown()&&m.lstatSync()}m.shouldWalk(l,a)&&l.add(m)}}return c}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,r={}){return typeof t=="string"?t=this.cwd.resolve(t):t instanceof Zr||(r=t,t=this.cwd),this.stream(t,r)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,r={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Zr||(r=t,t=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:o,walkFilter:a}=r;(!o||o(t))&&(yield n?t:t.fullpath());let c=new Set([t]);for(let l of c){let u=l.readdirSync();for(let d of u){(!o||o(d))&&(yield n?d:d.fullpath());let f=d;if(d.isSymbolicLink()){if(!(s&&(f=d.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(c,a)&&c.add(f)}}}stream(t=this.cwd,r={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Zr||(r=t,t=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:o,walkFilter:a}=r,c=new Ho({objectMode:!0});(!o||o(t))&&c.write(n?t:t.fullpath());let l=new Set,u=[t],d=0,f=i(()=>{let m=!1;for(;!m;){let g=u.shift();if(!g){d===0&&c.end();return}d++,l.add(g);let E=i((C,v,D=!1)=>{if(C)return c.emit("error",C);if(s&&!D){let $=[];for(let U of v)U.isSymbolicLink()&&$.push(U.realpath().then(ie=>ie?.isUnknown()?ie.lstat():ie));if($.length){Promise.all($).then(()=>E(null,v,!0));return}}for(let $ of v)$&&(!o||o($))&&(c.write(n?$:$.fullpath())||(m=!0));d--;for(let $ of v){let U=$.realpathCached()||$;U.shouldWalk(l,a)&&u.push(U)}m&&!c.flowing?c.once("drain",f):w||f()},"onReaddir"),w=!0;g.readdirCB(E,!0),w=!1}},"process");return f(),c}streamSync(t=this.cwd,r={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof Zr||(r=t,t=this.cwd);let{withFileTypes:n=!0,follow:s=!1,filter:o,walkFilter:a}=r,c=new Ho({objectMode:!0}),l=new Set;(!o||o(t))&&c.write(n?t:t.fullpath());let u=[t],d=0,f=i(()=>{let m=!1;for(;!m;){let g=u.shift();if(!g){d===0&&c.end();return}d++,l.add(g);let E=g.readdirSync();for(let w of E)(!o||o(w))&&(c.write(n?w:w.fullpath())||(m=!0));d--;for(let w of E){let C=w;if(w.isSymbolicLink()){if(!(s&&(C=w.realpathSync())))continue;C.isUnknown()&&C.lstatSync()}C.shouldWalk(l,a)&&u.push(C)}}m&&!c.flowing&&c.once("drain",f)},"process");return f(),c}chdir(t=this.cwd){let r=this.cwd;this.cwd=typeof t=="string"?this.cwd.resolve(t):t,this.cwd[uB](r)}},Sl=class extends Mm{static{i(this,"PathScurryWin32")}sep="\\";constructor(t=process.cwd(),r={}){let{nocase:n=!0}=r;super(t,wl.win32,"\\",{...r,nocase:n}),this.nocase=n;for(let s=this.cwd;s;s=s.parent)s.nocase=this.nocase}parseRootPath(t){return wl.win32.parse(t).root.toUpperCase()}newRoot(t){return new Nm(this.rootPath,gi,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}},bl=class extends Mm{static{i(this,"PathScurryPosix")}sep="/";constructor(t=process.cwd(),r={}){let{nocase:n=!1}=r;super(t,wl.posix,"/",{...r,nocase:n}),this.nocase=n}parseRootPath(t){return"/"}newRoot(t){return new Bm(this.rootPath,gi,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}},uf=class extends bl{static{i(this,"PathScurryDarwin")}constructor(t=process.cwd(),r={}){let{nocase:n=!0}=r;super(t,{...r,nocase:n})}},tze=process.platform==="win32"?Nm:Bm,fB=process.platform==="win32"?Sl:process.platform==="darwin"?uf:bl;var xde=i(e=>e.length>=1,"isPatternList"),vde=i(e=>e.length>=1,"isGlobList"),Cl=class e{static{i(this,"Pattern")}#t;#r;#n;length;#e;#o;#c;#l;#d;#u;#a=!0;constructor(t,r,n,s){if(!xde(t))throw new TypeError("empty pattern list");if(!vde(r))throw new TypeError("empty glob list");if(r.length!==t.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=t.length,n<0||n>=this.length)throw new TypeError("index out of range");if(this.#t=t,this.#r=r,this.#n=n,this.#e=s,this.#n===0){if(this.isUNC()){let[o,a,c,l,...u]=this.#t,[d,f,m,g,...E]=this.#r;u[0]===""&&(u.shift(),E.shift());let w=[o,a,c,l,""].join("/"),C=[d,f,m,g,""].join("/");this.#t=[w,...u],this.#r=[C,...E],this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){let[o,...a]=this.#t,[c,...l]=this.#r;a[0]===""&&(a.shift(),l.shift());let u=o+"/",d=c+"/";this.#t=[u,...a],this.#r=[d,...l],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]===Hr}isRegExp(){return this.#t[this.#n]instanceof RegExp}globString(){return this.#c=this.#c||(this.#n===0?this.isAbsolute()?this.#r[0]+this.#r.slice(1).join("/"):this.#r.join("/"):this.#r.slice(this.#n).join("/"))}hasMore(){return this.length>this.#n+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new e(this.#t,this.#r,this.#n+1,this.#e),this.#o.#u=this.#u,this.#o.#d=this.#d,this.#o.#l=this.#l,this.#o):this.#o=null}isUNC(){let t=this.#t;return this.#d!==void 0?this.#d:this.#d=this.#e==="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.#l!==void 0?this.#l:this.#l=this.#e==="win32"&&this.#n===0&&this.length>1&&typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0])}isAbsolute(){let t=this.#t;return this.#u!==void 0?this.#u:this.#u=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.#a)}markFollowGlobstar(){return this.#n===0||!this.isGlobstar()||!this.#a?!1:(this.#a=!1,!0)}};var Ade=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",_l=class{static{i(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(t,{nobrace:r,nocase:n,noext:s,noglobstar:o,platform:a=Ade}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=a,this.mmopts={dot:!0,nobrace:r,nocase:n,noext:s,noglobstar:o,optimizationLevel:2,platform:a,nocomment:!0,nonegate:!0};for(let c of t)this.add(c)}add(t){let r=new Jn(t,this.mmopts);for(let n=0;n<r.set.length;n++){let s=r.set[n],o=r.globParts[n];if(!s||!o)throw new Error("invalid pattern object");for(;s[0]==="."&&o[0]===".";)s.shift(),o.shift();let a=new Cl(s,o,0,this.platform),c=new Jn(a.globString(),this.mmopts),l=o[o.length-1]==="**",u=a.isAbsolute();u?this.absolute.push(c):this.relative.push(c),l&&(u?this.absoluteChildren.push(c):this.relativeChildren.push(c))}}ignored(t){let r=t.fullpath(),n=`${r}/`,s=t.relative()||".",o=`${s}/`;for(let a of this.relative)if(a.match(s)||a.match(o))return!0;for(let a of this.absolute)if(a.match(r)||a.match(n))return!0;return!1}childrenIgnored(t){let r=t.fullpath()+"/",n=(t.relative()||".")+"/";for(let s of this.relativeChildren)if(s.match(n))return!0;for(let s of this.absoluteChildren)if(s.match(r))return!0;return!1}};var J_=class e{static{i(this,"HasWalkedCache")}store;constructor(t=new Map){this.store=t}copy(){return new e(new Map(this.store))}hasWalked(t,r){return this.store.get(t.fullpath())?.has(r.globString())}storeWalked(t,r){let n=t.fullpath(),s=this.store.get(n);s?s.add(r.globString()):this.store.set(n,new Set([r.globString()]))}},Q_=class{static{i(this,"MatchRecord")}store=new Map;add(t,r,n){let s=(r?2:0)|(n?1:0),o=this.store.get(t);this.store.set(t,o===void 0?s:s&o)}entries(){return[...this.store.entries()].map(([t,r])=>[t,!!(r&2),!!(r&1)])}},Z_=class{static{i(this,"SubWalks")}store=new Map;add(t,r){if(!t.canReaddir())return;let n=this.store.get(t);n?n.find(s=>s.globString()===r.globString())||n.push(r):this.store.set(t,[r])}get(t){let r=this.store.get(t);if(!r)throw new Error("attempting to walk unknown path");return r}entries(){return this.keys().map(t=>[t,this.store.get(t)])}keys(){return[...this.store.keys()].filter(t=>t.canReaddir())}},df=class e{static{i(this,"Processor")}hasWalkedCache;matches=new Q_;subwalks=new Z_;patterns;follow;dot;opts;constructor(t,r){this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=r?r.copy():new J_}processPatterns(t,r){this.patterns=r;let n=r.map(s=>[t,s]);for(let[s,o]of n){this.hasWalkedCache.storeWalked(s,o);let a=o.root(),c=o.isAbsolute()&&this.opts.absolute!==!1;if(a){s=s.resolve(a==="/"&&this.opts.root!==void 0?this.opts.root:a);let f=o.rest();if(f)o=f;else{this.matches.add(s,!0,!1);continue}}if(s.isENOENT())continue;let l,u,d=!1;for(;typeof(l=o.pattern())=="string"&&(u=o.rest());)s=s.resolve(l),o=u,d=!0;if(l=o.pattern(),u=o.rest(),d){if(this.hasWalkedCache.hasWalked(s,o))continue;this.hasWalkedCache.storeWalked(s,o)}if(typeof l=="string"){let f=l===".."||l===""||l===".";this.matches.add(s.resolve(l),c,f);continue}else if(l===Hr){(!s.isSymbolicLink()||this.follow||o.checkFollowGlobstar())&&this.subwalks.add(s,o);let f=u?.pattern(),m=u?.rest();if(!u||(f===""||f===".")&&!m)this.matches.add(s,c,f===""||f===".");else if(f===".."){let g=s.parent||s;m?this.hasWalkedCache.hasWalked(g,m)||this.subwalks.add(g,m):this.matches.add(g,c,!0)}}else l instanceof RegExp&&this.subwalks.add(s,o)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new e(this.opts,this.hasWalkedCache)}filterEntries(t,r){let n=this.subwalks.get(t),s=this.child();for(let o of r)for(let a of n){let c=a.isAbsolute(),l=a.pattern(),u=a.rest();l===Hr?s.testGlobstar(o,a,u,c):l instanceof RegExp?s.testRegExp(o,l,u,c):s.testString(o,l,u,c)}return s}testGlobstar(t,r,n,s){if((this.dot||!t.name.startsWith("."))&&(r.hasMore()||this.matches.add(t,s,!1),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,r):t.isSymbolicLink()&&(n&&r.checkFollowGlobstar()?this.subwalks.add(t,n):r.markFollowGlobstar()&&this.subwalks.add(t,r)))),n){let o=n.pattern();if(typeof o=="string"&&o!==".."&&o!==""&&o!==".")this.testString(t,o,n.rest(),s);else if(o===".."){let a=t.parent||t;this.subwalks.add(a,n)}else o instanceof RegExp&&this.testRegExp(t,o,n.rest(),s)}}testRegExp(t,r,n,s){r.test(t.name)&&(n?this.subwalks.add(t,n):this.matches.add(t,s,!1))}testString(t,r,n,s){t.isNamed(r)&&(n?this.subwalks.add(t,n):this.matches.add(t,s,!1))}};var Rde=i((e,t)=>typeof e=="string"?new _l([e],t):Array.isArray(e)?new _l(e,t):e,"makeIgnore"),$m=class{static{i(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#t=[];#r;#n;signal;maxDepth;includeChildMatches;constructor(t,r,n){if(this.patterns=t,this.path=r,this.opts=n,this.#n=!n.posix&&n.platform==="win32"?"\\":"/",this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#r=Rde(n.ignore??[],n),!this.includeChildMatches&&typeof this.#r.add!="function")){let s="cannot ignore child matches, ignore lacks add() method.";throw new Error(s)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener("abort",()=>{this.#t.length=0}))}#e(t){return this.seen.has(t)||!!this.#r?.ignored?.(t)}#o(t){return!!this.#r?.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,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=t.realpathCached()||await t.realpath(),!n)return;t=n}let o=t.isUnknown()||this.opts.stat?await t.lstat():t;if(this.opts.follow&&this.opts.nodir&&o?.isSymbolicLink()){let a=await o.realpath();a&&(a.isUnknown()||this.opts.stat)&&await a.lstat()}return this.matchCheckTest(o,r)}matchCheckTest(t,r){return t&&(this.maxDepth===1/0||t.depth()<=this.maxDepth)&&(!r||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!t.realpathCached()?.isDirectory())&&!this.#e(t)?t:void 0}matchCheckSync(t,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=t.realpathCached()||t.realpathSync(),!n)return;t=n}let o=t.isUnknown()||this.opts.stat?t.lstatSync():t;if(this.opts.follow&&this.opts.nodir&&o?.isSymbolicLink()){let a=o.realpathSync();a&&(a?.isUnknown()||this.opts.stat)&&a.lstatSync()}return this.matchCheckTest(o,r)}matchFinish(t,r){if(this.#e(t))return;if(!this.includeChildMatches&&this.#r?.add){let o=`${t.relativePosix()}/**`;this.#r.add(o)}let n=this.opts.absolute===void 0?r:this.opts.absolute;this.seen.add(t);let s=this.opts.mark&&t.isDirectory()?this.#n:"";if(this.opts.withFileTypes)this.matchEmit(t);else if(n){let o=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(o+s)}else{let o=this.opts.posix?t.relativePosix():t.relative(),a=this.opts.dotRelative&&!o.startsWith(".."+this.#n)?"."+this.#n:"";this.matchEmit(o?a+o+s:"."+s)}}async match(t,r,n){let s=await this.matchCheck(t,n);s&&this.matchFinish(s,r)}matchSync(t,r,n){let s=this.matchCheckSync(t,n);s&&this.matchFinish(s,r)}walkCB(t,r,n){this.signal?.aborted&&n(),this.walkCB2(t,r,new df(this.opts),n)}walkCB2(t,r,n,s){if(this.#o(t))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2(t,r,n,s));return}n.processPatterns(t,r);let o=1,a=i(()=>{--o===0&&s()},"next");for(let[c,l,u]of n.matches.entries())this.#e(c)||(o++,this.match(c,l,u).then(()=>a()));for(let c of n.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;o++;let l=c.readdirCached();c.calledReaddir()?this.walkCB3(c,l,n,a):c.readdirCB((u,d)=>this.walkCB3(c,d,n,a),!0)}a()}walkCB3(t,r,n,s){n=n.filterEntries(t,r);let o=1,a=i(()=>{--o===0&&s()},"next");for(let[c,l,u]of n.matches.entries())this.#e(c)||(o++,this.match(c,l,u).then(()=>a()));for(let[c,l]of n.subwalks.entries())o++,this.walkCB2(c,l,n.child(),a);a()}walkCBSync(t,r,n){this.signal?.aborted&&n(),this.walkCB2Sync(t,r,new df(this.opts),n)}walkCB2Sync(t,r,n,s){if(this.#o(t))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2Sync(t,r,n,s));return}n.processPatterns(t,r);let o=1,a=i(()=>{--o===0&&s()},"next");for(let[c,l,u]of n.matches.entries())this.#e(c)||this.matchSync(c,l,u);for(let c of n.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;o++;let l=c.readdirSync();this.walkCB3Sync(c,l,n,a)}a()}walkCB3Sync(t,r,n,s){n=n.filterEntries(t,r);let o=1,a=i(()=>{--o===0&&s()},"next");for(let[c,l,u]of n.matches.entries())this.#e(c)||this.matchSync(c,l,u);for(let[c,l]of n.subwalks.entries())o++,this.walkCB2Sync(c,l,n.child(),a);a()}},ff=class extends $m{static{i(this,"GlobWalker")}matches=new Set;constructor(t,r,n){super(t,r,n)}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,r)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?r(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}},hf=class extends $m{static{i(this,"GlobStream")}results;constructor(t,r,n){super(t,r,n),this.results=new Ho({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 hB=require("node:url"),Tde=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",qs=class{static{i(this,"Glob")}absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(t,r){if(!r)throw new TypeError("glob options required");if(this.withFileTypes=!!r.withFileTypes,this.signal=r.signal,this.follow=!!r.follow,this.dot=!!r.dot,this.dotRelative=!!r.dotRelative,this.nodir=!!r.nodir,this.mark=!!r.mark,r.cwd?(r.cwd instanceof URL||r.cwd.startsWith("file://"))&&(r.cwd=(0,hB.fileURLToPath)(r.cwd)):this.cwd="",this.cwd=r.cwd||"",this.root=r.root,this.magicalBraces=!!r.magicalBraces,this.nobrace=!!r.nobrace,this.noext=!!r.noext,this.realpath=!!r.realpath,this.absolute=r.absolute,this.includeChildMatches=r.includeChildMatches!==!1,this.noglobstar=!!r.noglobstar,this.matchBase=!!r.matchBase,this.maxDepth=typeof r.maxDepth=="number"?r.maxDepth:1/0,this.stat=!!r.stat,this.ignore=r.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof t=="string"&&(t=[t]),this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(t=t.map(l=>l.replace(/\\/g,"/"))),this.matchBase){if(r.noglobstar)throw new TypeError("base matching requires globstar");t=t.map(l=>l.includes("/")?l:`./**/${l}`)}if(this.pattern=t,this.platform=r.platform||Tde,this.opts={...r,platform:this.platform},r.scurry){if(this.scurry=r.scurry,r.nocase!==void 0&&r.nocase!==r.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let l=r.platform==="win32"?Sl:r.platform==="darwin"?uf:r.platform?bl:fB;this.scurry=new l(this.cwd,{nocase:r.nocase,fs:r.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",s={...r,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},o=this.pattern.map(l=>new Jn(l,s)),[a,c]=o.reduce((l,u)=>(l[0].push(...u.set),l[1].push(...u.globParts),l),[[],[]]);this.patterns=a.map((l,u)=>{let d=c[u];if(!d)throw new Error("invalid pattern object");return new Cl(l,d,0,this.platform)})}async walk(){return[...await new ff(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,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new ff(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,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new hf(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,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new hf(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,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var ex=i((e,t={})=>{Array.isArray(e)||(e=[e]);for(let r of e)if(new Jn(r,t).hasMagic())return!0;return!1},"hasMagic");function Lm(e,t={}){return new qs(e,t).streamSync()}i(Lm,"globStreamSync");function pB(e,t={}){return new qs(e,t).stream()}i(pB,"globStream");function mB(e,t={}){return new qs(e,t).walkSync()}i(mB,"globSync");async function gB(e,t={}){return new qs(e,t).walk()}i(gB,"glob_");function Fm(e,t={}){return new qs(e,t).iterateSync()}i(Fm,"globIterateSync");function yB(e,t={}){return new qs(e,t).iterate()}i(yB,"globIterate");var Pde=Lm,kde=Object.assign(pB,{sync:Lm}),Ode=Fm,Ide=Object.assign(yB,{sync:Fm}),Dde=Object.assign(mB,{stream:Lm,iterate:Fm}),jm=Object.assign(gB,{glob:gB,globSync:mB,sync:Dde,globStream:pB,stream:kde,globStreamSync:Lm,streamSync:Pde,globIterate:yB,iterate:Ide,globIterateSync:Fm,iterateSync:Ode,Glob:qs,hasMagic:ex,escape:pl,unescape:Fs});jm.glob=jm;var EB=require("node:path"),tx=k(Un(),1);async function Hs(...e){let t=await jm(...e);return t.forEach((r,n)=>{t[n]=t[n].toString().replace(/\\/g,"/")}),t}i(Hs,"normalizedGlob");function Um(e){let t=process.cwd();return e!==t&&(e=(0,EB.resolve)(t,e)),e=e.replace(/\\/g,"/"),e}i(Um,"getProjectDir");async function tc(e){return await tx.default.pathExists(e)?tx.default.readdir(e):[]}i(tc,"tryReadDir");var SB=k(require("node:os"),1),bB=require("node:path/posix"),Gs;function wB(e){Gs=e}i(wB,"setPVRTexToolAbsolutePath");async function CB(){if(process.env.PVRTexToolCLI)return Gs=process.env.PVRTexToolCLI;let e=SB.default.platform(),t=null;switch(e){case"darwin":t="/Applications/Imagination/";break;case"win32":t="C:/Imagination Technologies/";break;default:break}if(!t)return;let r=await Hs((0,bB.join)(t,"**"),{nodir:!0});switch(e){case"darwin":return Gs=r.find(n=>n.endsWith("macOS/PVRTexToolCLI"));case"win32":return Gs=r.find(n=>n.endsWith("Windows_x86_64/PVRTexToolCLI.exe"))}}i(CB,"locatePVRTexTool");var ze=require("node:path/posix"),lr=require("node:fs/promises"),ur=k(Un(),1);async function _B(e){await Promise.all([ur.default.ensureDir((0,ze.join)(e,"nodes")),ur.default.ensureDir((0,ze.join)(e,"meshes")),ur.default.ensureDir((0,ze.join)(e,"lods")),ur.default.ensureDir((0,ze.join)(e,"lights")),ur.default.ensureDir((0,ze.join)(e,"cameras")),ur.default.ensureDir((0,ze.join)(e,"geometries")),ur.default.ensureDir((0,ze.join)(e,"skeletons")),ur.default.ensureDir((0,ze.join)(e,"shadowGenerators")),ur.default.ensureDir((0,ze.join)(e,"sceneLinks")),ur.default.ensureDir((0,ze.join)(e,"gui")),ur.default.ensureDir((0,ze.join)(e,"sounds")),ur.default.ensureDir((0,ze.join)(e,"particleSystems")),ur.default.ensureDir((0,ze.join)(e,"morphTargetManagers")),ur.default.ensureDir((0,ze.join)(e,"morphTargets")),ur.default.ensureDir((0,ze.join)(e,"animationGroups")),ur.default.ensureDir((0,ze.join)(e,"sprite-maps")),ur.default.ensureDir((0,ze.join)(e,"sprite-managers")),ur.default.ensureDir((0,ze.join)(e,"nodeParticleSystemSets"))])}i(_B,"ensureSceneDirectories");async function xB(e){let[t,r,n,s,o,a,c,l,u,d,f,m,g,E,w,C,v,D]=await Promise.all([(0,lr.readdir)((0,ze.join)(e,"nodes")),(0,lr.readdir)((0,ze.join)(e,"meshes")),(0,lr.readdir)((0,ze.join)(e,"lods")),(0,lr.readdir)((0,ze.join)(e,"lights")),(0,lr.readdir)((0,ze.join)(e,"cameras")),(0,lr.readdir)((0,ze.join)(e,"skeletons")),(0,lr.readdir)((0,ze.join)(e,"shadowGenerators")),(0,lr.readdir)((0,ze.join)(e,"sceneLinks")),(0,lr.readdir)((0,ze.join)(e,"gui")),(0,lr.readdir)((0,ze.join)(e,"sounds")),(0,lr.readdir)((0,ze.join)(e,"particleSystems")),(0,lr.readdir)((0,ze.join)(e,"morphTargetManagers")),(0,lr.readdir)((0,ze.join)(e,"morphTargets")),(0,lr.readdir)((0,ze.join)(e,"animationGroups")),(0,lr.readdir)((0,ze.join)(e,"sprite-maps")),(0,lr.readdir)((0,ze.join)(e,"sprite-managers")),(0,lr.readdir)((0,ze.join)(e,"geometries")),(0,lr.readdir)((0,ze.join)(e,"nodeParticleSystemSets"))]);return{nodesFiles:t,meshesFiles:r,lodsFiles:n,lightsFiles:s,cameraFiles:o,skeletonFiles:a,shadowGeneratorFiles:c,sceneLinkFiles:l,guiFiles:u,soundFiles:d,particleSystemFiles:f,morphTargetManagerFiles:m,morphTargetFiles:g,animationGroupFiles:E,spriteMapFiles:w,spriteManagerFiles:C,geometryFiles:v,nodeParticleSystemSetFiles:D}}i(xB,"readSceneDirectories");var b2=require("node:child_process");function w2(e){return new Promise((t,r)=>{(0,b2.exec)(e,(n,s,o)=>{n?(console.error(pi.red(e),pi.red(o)),r(n)):(console.log(pi.gray(e),pi.gray(s)),t())})})}i(w2,"executeAsync");var Wo=require("node:path/posix"),_2=k(Un(),1),x2=k(S2(),1),v2=require("node:fs"),Lfe=["-astc.ktx","-dxt.ktx","-pvrtc.ktx","-etc1.ktx","-etc2.ktx"],Ffe=[".png",".jpg",".jpeg",".bmp"];function jfe(e,t){return`${e.substring(0,e.lastIndexOf("."))}${t}`}i(jfe,"getCompressedTextureFilename");async function bs(e,t){t.format?await C2(e,t):await Promise.all(Lfe.map(r=>C2(e,{...t,format:r})))}i(bs,"compressFileToKtx");async function C2(e,t){let r=(0,Wo.basename)(e),n=(0,Wo.extname)(r).toLocaleLowerCase();if(!Ffe.includes(n))return null;let s=jfe(r,t.format);if(t.destinationFolder??=(0,Wo.dirname)(e),t.destinationFolder=(0,Wo.join)(t.destinationFolder,s),!t.compressedTexturesEnabled)return t.exportedAssets?.push(t.destinationFolder),null;if(await _2.default.pathExists(t.destinationFolder)&&!t.force)return t.exportedAssets?.push(t.destinationFolder),t.destinationFolder;let o=await new Promise(c=>{let l=(0,v2.createReadStream)(e);l.pipe(new x2.PNG).on("metadata",u=>{c(u.alpha),l.close()}).on("error",()=>{c(!1),l.close()})});if(!Gs)return null;let a=null;switch(t.format){case"-astc.ktx":a=`"${Gs}" -i "${e}" -flip y -pot + -m -dither -ics lRGB -f ASTC_8x8,UBN,lRGB -q astcveryfast -o "${t.destinationFolder}"`;break;case"-dxt.ktx":a=`"${Gs}" -i "${e}" -flip y -pot + -m -dither -ics lRGB ${o?"-l":""} -f ${o?"BC2":"BC1"},UBN,lRGB -o "${t.destinationFolder}"`;break;case"-pvrtc.ktx":a=`"${Gs}" -i "${e}" -flip y -pot + -square + -m -dither -ics lRGB ${o?"-l":""} -f ${o?"PVRTCI_2BPP_RGBA":"PVRTCI_2BPP_RGB"},UBN,lRGB -q pvrtcfastest -o "${t.destinationFolder}"`;break;case"-etc1.ktx":a=`"${Gs}" -i "${e}" -flip y -pot + -m -dither -ics lRGB -f ETC1,UBN,lRGB -q etcfast -o "${t.destinationFolder}"`;break;case"-etc2.ktx":a=`"${Gs}" -i "${e}" -flip y -pot + -m -dither -ics lRGB -f ${o?"ETC2_RGBA":"ETC2_RGB"},UBN,lRGB -q etcfast -o "${t.destinationFolder}"`;break}if(!a)return null;console.log(`Compressing image "${s}"`);try{return await w2(a),console.log(`Compressed image "${s}"`),t.exportedAssets?.push(t.destinationFolder),t.destinationFolder}catch{console.error(`Failed to compress image "${s}"`)}return null}i(C2,"compressFileToKtxFormat");var e$=require("node:path/posix"),t$=require("node:worker_threads"),ZM=i((e,t)=>(e=(0,e$.join)(__dirname.replace(/\\/g,"/"),e),new t$.Worker(e,{workerData:t})),"loadWorker"),_f=i(async(e,t)=>{let r=ZM(e,t);return new Promise(n=>{r.on("message",s=>{t.id&&s.id!==t.id||(t.id||r.terminate(),n(s))})})},"executeSimpleWorker");function r$(e,t){ZM=e,_f=t}i(r$,"overrideWorkerMethods");var zx=require("node:path/posix"),Vx=k(Un(),1),n$=k(Gx(),1);async function $l(e,t){let r=e.split(","),o=r[0].split(";")[1],a=r[1];if(o==="base64"){let c=Buffer.from(a,"base64"),l=(0,n$.default)(c),[u,d]=await Promise.all([l.metadata(),_f("workers/md5.js",c)]),f;switch(u.format){case"png":f=`${d}.png`;break;case"jpg":case"jpeg":f=`${d}.jpg`;break;default:return console.error(`Unsupported embedded texture format while extracting texture: ${u.format}`),null}let m=(0,zx.join)(t.extractedTexturesOutputPath,f);return await Vx.default.pathExists(m)||await Vx.default.writeFile(m,c),(0,zx.join)("assets","editor-generated_extracted-textures",f).replace(/\\/g,"/")}return null}i($l,"extractTextureAssetFromDataString");async function xf(e,t){try{let r=await fetch(e),n=await r.arrayBuffer(),s=Buffer.from(n).toString("base64"),o=`data:${r.headers.get("content-type")??"image/unknown"};base64,${s}`;return $l(o,{...t})}catch(r){console.error(`Failed to extract texture from url "${e}": ${r.message}`)}return null}i(xf,"extractTextureAssetFromUrl");function u9e(e=4096,t){let r=t??1,n=[];for(;r<=e;)n.push(r),r<<=1;return n}i(u9e,"getPowerOfTwoSizesUntil");function oc(e){let t=1;for(;t<=e;)t<<=1;return t>>1}i(oc,"getPowerOfTwoUntil");var so=require("node:path/posix"),Wx=k(Gx(),1),Kx=k(Un(),1);function Ll(e){return(0,so.join)(e,"assets","editor-generated_extracted-textures")}i(Ll,"getExtractedTextureOutputPath");async function s$(e,t){let r=(0,so.extname)(e),n=await(0,Wx.default)(e).metadata();if(!n.width||!n.height)return console.error(`Failed to compute exported image "${e}". Image metadata is invalid.`);let s=n.width,o=n.height,a=s===oc(s)||o===oc(o),c=[],l=s*.66>>0,u=o*.66>>0;a&&(l=oc(l),u=oc(u)),c.push({width:l,height:u});let d=s*.33>>0,f=o*.33>>0;a&&(d=oc(d),f=oc(f)),c.push({width:d,height:f});for(let m of c){let E=`${(0,so.basename)(e).replace(r,"")}_${m.width}_${m.height}${r}`,w=(0,so.join)((0,so.dirname)(e),E);if(t.exportedAssets.push(w),t.force||!await Kx.default.pathExists(w))try{let C=await(0,Wx.default)(e).resize(m.width,m.height).toBuffer();await Kx.default.writeFile(w,C),console.log(`Exported scaled texture "${E}"`),t.onStepChanged?.("assets",{message:`Exported scaled texture "${E}"`})}catch{console.error(`Failed to export image scaled image "${E}"`)}await bs(w,{...t})}}i(s$,"processExportedTexture");var i$=require("node:path/posix"),ag=k(Un(),1);async function o$(e,t){let r=await ag.default.readJSON(e);if(r.customType!=="BABYLON.NodeMaterial")return;let n=Ll(t.publicDir);await ag.default.ensureDir(n);let s=await Yx(r,{extractedTexturesOutputPath:n});await ag.default.writeJSON(e,r,{encoding:"utf-8"}),await Promise.all(s.map(async o=>{let a=(0,i$.join)(t.publicDir,o);t.exportedAssets.push(a),await bs(a,{force:t.force,exportedAssets:t.exportedAssets})}))}i(o$,"processExportedMaterial");async function Yx(e,t){let r=e.blocks.filter(s=>(s.customType==="BABYLON.TextureBlock"||s.customType==="BABYLON.ImageSourceBlock")&&s.texture?.name),n=[];return await Promise.all(r.map(async s=>{if(s.texture?.name?.startsWith("http://")||s.texture.name.startsWith("https://")){let o=await xf(s.texture.name,{...t});o&&(n.push(o),s.texture.name=s.texture.url=o)}if(s.texture.name?.startsWith("data:")){let o=await $l(s.texture.name,{...t});o&&(n.push(o),s.texture.name=s.texture.url=o)}})),n}i(Yx,"extractNodeMaterialTextures");var a$=require("node:path/posix"),cg=k(Un(),1);async function c$(e,t){let r=await cg.default.readJSON(e);if(r.customType!=="BABYLON.NodeParticleSystemSet")return;let n=Ll(t.publicDir);await cg.default.ensureDir(n);let s=await Xx(r,{extractedTexturesOutputPath:n});await cg.default.writeJSON(e,r,{encoding:"utf-8"}),await Promise.all(s.map(async o=>{let a=(0,a$.join)(t.publicDir,o);t.exportedAssets.push(a),t.optimize&&await bs(a,{force:t.force,exportedAssets:t.exportedAssets})}))}i(c$,"processExportedNodeParticleSystemSet");async function l$(e,t){let r=null;return e.texture?.name.startsWith("http://")||e.texture?.name.startsWith("https://")?r=await xf(e.texture.name,{...t}):e.texture?.name.startsWith("data:")&&(r=await $l(e.texture.name,{...t})),r&&(e.texture.name=r,e.texture.url=e.texture.name),r}i(l$,"extractParticleSystemTextures");async function Xx(e,t){let r=e.blocks.filter(s=>s.customType==="BABYLON.ParticleTextureSourceBlock"),n=[];return await Promise.all(r.map(async s=>{if(s.url?.startsWith("http://")||s.url?.startsWith("https://")){let o=await xf(s.url,{...t});o&&(n.push(o),s.url=o)}if(s.textureDataUrl?.startsWith("data:")){let o=await $l(s.textureDataUrl,{...t});o&&(n.push(o),delete s.textureDataUrl,s.url=o,s.serializedCachedData=!1)}})),n}i(Xx,"extractNodeParticleSystemSetTextures");var pt=require("node:path/posix"),Xt=k(Un(),1);async function u$(e){let t=[],r=[],n=[],s=[],o=[],a=[],c=[],l=[],u=[];(await Promise.all(e.directories.meshesFiles.map(async j=>{let G=await Xt.default.readJSON((0,pt.join)(e.sceneFile,"meshes",j)),K=G.meshes[0];if(K.metadata?.doNotSerialize)return null;K.delayLoadingFile&&(K.delayLoadingFile=(0,pt.join)(e.sceneName,(0,pt.basename)(K.delayLoadingFile))),K.metadata?.parentId&&(K.parentId=K.metadata.parentId),K.instances?.forEach(Ge=>{Ge.metadata?.parentId&&(Ge.parentId=Ge.metadata.parentId)}),K.instances=K.instances?.filter(Ge=>Ge.metadata?.doNotSerialize?null:Ge),G.basePoseMatrix&&(K.basePoseMatrix=G.basePoseMatrix);let _e;G.materials?.forEach(Ge=>{s.find(ft=>ft.id===Ge.id)||(_e=Ge)});let it=[];return G.lods&&(K.lodMeshIds=[],K.lodDistances=[],(await Promise.all(G.lods?.map(async Qe=>{let ft=await Xt.default.readJSON((0,pt.join)(e.sceneFile,"lods",Qe)),Ze=ft.meshes[0];return Ze.delayLoadingFile&&(Ze.delayLoadingFile=(0,pt.join)(e.sceneName,(0,pt.basename)(Ze.delayLoadingFile))),G.basePoseMatrix&&(Ze.basePoseMatrix=G.basePoseMatrix),{lodMesh:Ze,distanceOrScreenCoverage:ft.distanceOrScreenCoverage}}))).forEach(Qe=>{it.push(Qe.lodMesh),K.lodMeshIds.push(Qe.lodMesh.id),K.lodDistances.push(Qe.distanceOrScreenCoverage)})),{mesh:K,lodMeshes:it,effectiveMaterial:_e}}))).forEach(j=>{j&&(r.push(j.mesh),j.lodMeshes.forEach(G=>{r.push(G)}),j.effectiveMaterial&&s.push(j.effectiveMaterial))});let f=await Promise.all(e.directories.morphTargetManagerFiles.map(async j=>{let G=await Xt.default.readJSON((0,pt.join)(e.sceneFile,"morphTargetManagers",j));return e.babylonjsEditorToolsVersion>="5.2.6"?G.targets.forEach(K=>{K.delayLoadingFile&&(K.delayLoadingFile=(0,pt.join)(e.sceneName,"morphTargets",(0,pt.basename)(K.delayLoadingFile)))}):await Promise.all(G.targets.map(async K=>{let _e=(0,pt.join)(e.sceneFile,"morphTargets",(0,pt.basename)(K.delayLoadingFile)),it=(await Xt.default.readFile(_e)).buffer;K.positionsCount&&(K.positions=Array.prototype.slice.call(new Float32Array(it,K.positionsOffset,K.positionsCount))),K.normalsCount&&(K.normals=Array.prototype.slice.call(new Float32Array(it,K.normalsOffset,K.normalsCount))),K.tangentsCount&&(K.tangents=Array.prototype.slice.call(new Float32Array(it,K.tangentsOffset,K.tangentsCount))),K.uvsCount&&(K.uvs=Array.prototype.slice.call(new Float32Array(it,K.uvsOffset,K.uvsCount))),K.uv2sCount&&(K.uv2s=Array.prototype.slice.call(new Float32Array(it,K.uv2sOffset,K.uv2sCount))),delete K.delayLoadingFile,delete K.positionsCount,delete K.normalsCount,delete K.tangentsCount,delete K.uvsCount,delete K.uv2sCount,delete K.positionsOffset,delete K.normalsOffset,delete K.tangentsOffset,delete K.uvsOffset,delete K.uv2sOffset})),G}));u.push(...f);let m=await Promise.all(e.directories.nodesFiles.map(async j=>{let G=await Xt.default.readJSON((0,pt.join)(e.sceneFile,"nodes",j));return G.metadata?.doNotSerialize?null:(G.metadata?.parentId&&(G.parentId=G.metadata.parentId),G)}));a.push(...m.filter(j=>j!==null));let g=await Promise.all(e.directories.spriteManagerFiles.map(async j=>{let G=await Xt.default.readJSON((0,pt.join)(e.sceneFile,"sprite-managers",j));return G.metadata?.doNotSerialize?null:(G.metadata?.parentId&&(G.parentId=G.metadata.parentId),G)}));a.push(...g.filter(j=>j!==null));let E=await Promise.all(e.directories.spriteMapFiles.map(async j=>{let G=await Xt.default.readJSON((0,pt.join)(e.sceneFile,"sprite-maps",j));return G.metadata?.doNotSerialize?null:(G.metadata?.parentId&&(G.parentId=G.metadata.parentId),G)}));a.push(...E.filter(j=>j!==null));let w=await Promise.all(e.directories.lightsFiles.map(async j=>{let G=await Xt.default.readJSON((0,pt.join)(e.sceneFile,"lights",j));return G.metadata?.doNotSerialize?null:(G.metadata?.parentId&&(G.parentId=G.metadata.parentId),G)}));t.push(...w.filter(j=>j!==null));let C=await Promise.all(e.directories.cameraFiles.map(async j=>{let G=await Xt.default.readJSON((0,pt.join)(e.sceneFile,"cameras",j));return G.metadata?.doNotSerialize?null:(G.metadata?.parentId&&(G.parentId=G.metadata.parentId),G)}));n.push(...C.filter(j=>j!==null));let v=Ll(e.publicDir);await Xt.default.ensureDir(v),await Promise.all(s.map(async j=>{if(j.customType==="BABYLON.NodeMaterial"){let G=await Yx(j,{extractedTexturesOutputPath:v});await Promise.all(G.map(async K=>{let _e=(0,pt.join)(e.publicDir,K);e.exportedAssets.push(_e),e.optimize&&e.compressedTexturesEnabled&&await bs(_e,{...e,force:!1,exportedAssets:e.exportedAssets})}))}}));let D=await Promise.all(e.directories.particleSystemFiles.map(async j=>{let G=await Xt.default.readJSON((0,pt.join)(e.sceneFile,"particleSystems",j));if(G.metadata?.doNotSerialize)return null;let K=await l$(G,{extractedTexturesOutputPath:v});if(K){let _e=(0,pt.join)(e.publicDir,K);e.exportedAssets.push(_e),e.optimize&&e.compressedTexturesEnabled&&await bs(_e,{...e,force:!1,exportedAssets:e.exportedAssets})}return G}));c.push(...D.filter(j=>j!==null));let $=await Promise.all(e.directories.nodeParticleSystemSetFiles.map(async j=>{let G=await Xt.default.readJSON((0,pt.join)(e.sceneFile,"nodeParticleSystemSets",j));if(G.metadata?.doNotSerialize)return null;if(G.metadata?.parentId&&(G.parentId=G.metadata.parentId),G.nodeParticleSystemSet){let K=await Xx(G.nodeParticleSystemSet,{extractedTexturesOutputPath:v});await Promise.all(K.map(async _e=>{let it=(0,pt.join)(e.publicDir,_e);e.exportedAssets.push(it),e.optimize&&e.compressedTexturesEnabled&&await bs(it,{...e,force:!1,exportedAssets:e.exportedAssets})}))}return G}));r.push(...$.filter(j=>j!==null));let U=await Promise.all(e.directories.shadowGeneratorFiles.map(async j=>{let G=await Xt.default.readJSON((0,pt.join)(e.sceneFile,"shadowGenerators",j));return t.find(_e=>_e.id===G.lightId)?G:null}));l.push(...U.filter(j=>j!==null));let ie=await Promise.all(e.directories.skeletonFiles.map(async j=>{let G=await Xt.default.readJSON((0,pt.join)(e.sceneFile,"skeletons",j));return r.find(_e=>_e.skeletonId===G.id)?G:null}));o.push(...ie.filter(j=>j!==null));let fe={autoClear:!0,clearColor:e.config.clearColor,ambientColor:e.config.ambientColor,gravity:e.config.gravity??[0,-9.81,0],collisionsEnabled:!0,useRightHandedSystem:!1,fogMode:e.config.fog.fogMode,fogColor:e.config.fog.fogColor,fogStart:e.config.fog.fogStart,fogEnd:e.config.fog.fogEnd,fogDensity:e.config.fog.fogDensity,physicsEnabled:!0,physicsGravity:e.config.physics.gravity,physicsEngine:"HavokPlugin",metadata:{...e.config.metadata,rendering:e.config.rendering,clusteredLight:e.config.clusteredLight},morphTargetManagers:u,lights:t,cameras:n,animations:e.config.animations,materials:s,multiMaterials:[],environmentTexture:e.config.environment.environmentTexture,environmentIntensity:e.config.environment.environmentIntensity,iblIntensity:e.config.environment.iblIntensity??1,skeletons:o,transformNodes:a,geometries:{boxes:[],spheres:[],cylinders:[],toruses:[],grounds:[],planes:[],torusKnots:[],vertexData:[]},meshes:r,particleSystems:c,sounds:await Promise.all(e.directories.soundFiles.map(async j=>Xt.default.readJSON((0,pt.join)(e.sceneFile,"sounds",j)))),shadowGenerators:l,animationGroups:await Promise.all(e.directories.animationGroupFiles.map(async j=>Xt.default.readJSON((0,pt.join)(e.sceneFile,"animationGroups",j)))),postProcesses:[],spriteManagers:[],reflectionProbes:[]};[...fe.meshes,...fe.cameras,...fe.lights,...fe.transformNodes,...fe.meshes.map(j=>j.instances??[]).flat()].forEach(j=>{if(j.parentId!==void 0&&j.parentInstanceIndex!==void 0){let G=fe.meshes.find(K=>K.instances?.find(_e=>_e.uniqueId===j.parentId));G&&(j.parentId=G.uniqueId)}}),fe.environmentTexture?.name&&fe.environmentTexture.customType==="BABYLON.HDRCubeTexture"&&(fe.environmentTextureSize=512,fe.environmentTextureType="BABYLON.HDRCubeTexture",fe.environmentTextureRotationY=fe.environmentTexture.rotationY,fe.environmentTexture=fe.environmentTexture.name);let Se=(0,pt.join)(e.publicDir,`${e.sceneName}.babylon`);if(await Xt.default.writeJSON(Se,fe,{encoding:"utf-8"}),e.exportedAssets.push(Se),e.optimize){let j=(0,pt.join)(e.publicDir,`${e.sceneName}.babylon.manifest`),G={version:0,enableSceneOffline:!0,enableTexturesOffline:!0};await Xt.default.pathExists(j)&&(G=await Xt.default.readJSON(j)),++G.version,await Xt.default.writeJSON(j,G,{encoding:"utf-8"}),e.exportedAssets.push(j)}}i(u$,"createBabylonScene");var io=require("node:path/posix"),ac=k(Un(),1),d$=[".jpg",".jpeg",".webp",".png",".bmp"],Jge=[".env",".dds",".hdr"],Qge=[".mp3",".wav",".wave",".ogg"],f$=[".material",".gui",".cinematic",".npss",".ragdoll",".json"],Zge=[".3dl",".exr",".hdr"],e0e=[...d$,...Jge,...Qge,...f$,...Zge];async function h$(e,t){let r=e.includes(".navmesh"),n=(0,io.extname)(e).toLocaleLowerCase();if(!r&&!e0e.includes(n)||(0,io.basename)(e).startsWith("editor_preview"))return;let s=e.replace((0,io.join)(t.projectDir,"/"),""),o=s.split("/"),a="";for(let m=0;m<o.length-1;++m){try{await ac.default.ensureDir((0,io.join)(t.publicDir,a,o[m]))}catch{}a=(0,io.join)(a,o[m])}let c=!1,u=(await ac.default.stat(e)).mtimeMs.toString();c=!t.cache[s]||t.cache[s]!==u,t.cache[s]=u;let d=(0,io.join)(t.publicDir,s),f=await ac.default.pathExists(d);(c||!f)&&(f$.includes(n)?await ac.default.writeJSON(d,await ac.default.readJSON(e),{encoding:"utf-8"}):await ac.default.copyFile(e,d)),t.onStepChanged?.("assets",{message:`Processed asset: ${s}`}),t.exportedAssets.push(d),t.optimize&&await bs(d,{force:c,...t}),t.optimize&&(d$.includes(n)?await s$(d,{...t,force:c}):n===".material"?await o$(d,{...t,force:c}):n===".npss"&&await c$(d,{...t,force:c}))}i(h$,"processAssetFile");var p$=require("node:os"),lg=require("node:path/posix");async function m$(e){let t=await Hs((0,lg.join)(e.baseAssetsDir,"**/*"),{nodir:!0,ignore:{childrenIgnored:i(a=>(0,lg.extname)(a.name)===".scene","childrenIgnored")}}),r=[],n=(0,p$.cpus)().length;console.log(`Using ${n} cpus to process assets...`);let s=100/t.length,o=0;for(let a of t){if(r.length>=n&&(await Promise.all(r),r.length=0),e.cancellationToken?.isCanceled)break;r.push(new Promise(async c=>{await h$(a,{...e}),e.onProgress?.(o+=s),c()}))}await Promise.all(r)}i(m$,"createAssets");var Fl=k(Un(),1),Tt=require("node:path/posix"),t0e=`
89
89
  /**
90
90
  * Generated by Babylon.js Editor
91
91
  */
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babylonjs-editor-cli",
3
- "version": "5.4.1-alpha.3",
3
+ "version": "5.4.1-alpha.5",
4
4
  "description": "Babylon.js Editor CLI is a command line interface to help you package your scenes made using the Babylon.js Editor",
5
5
  "productName": "Babylon.js Editor CLI",
6
6
  "scripts": {
@@ -65,7 +65,7 @@ export async function compressFileToKtxFormat(absolutePath, options) {
65
65
  command = `"${pvrTexToolAbsolutePath}" -i "${absolutePath}" -flip y -pot + -m -dither -ics lRGB -f ASTC_8x8,UBN,lRGB -q astcveryfast -o "${options.destinationFolder}"`;
66
66
  break;
67
67
  case "-dxt.ktx":
68
- command = `"${pvrTexToolAbsolutePath}" -i "${absolutePath}" -flip y -pot + -m -ics lRGB ${hasAlpha ? "-l" : ""} -f ${hasAlpha ? "BC2" : "BC1"},UBN,lRGB -o "${options.destinationFolder}"`;
68
+ command = `"${pvrTexToolAbsolutePath}" -i "${absolutePath}" -flip y -pot + -m -dither -ics lRGB ${hasAlpha ? "-l" : ""} -f ${hasAlpha ? "BC2" : "BC1"},UBN,lRGB -o "${options.destinationFolder}"`;
69
69
  break;
70
70
  case "-pvrtc.ktx":
71
71
  command = `"${pvrTexToolAbsolutePath}" -i "${absolutePath}" -flip y -pot + -square + -m -dither -ics lRGB ${hasAlpha ? "-l" : ""} -f ${hasAlpha ? "PVRTCI_2BPP_RGBA" : "PVRTCI_2BPP_RGB"},UBN,lRGB -q pvrtcfastest -o "${options.destinationFolder}"`;
@@ -1 +1 @@
1
- {"version":3,"file":"ktx.mjs","sourceRoot":"","sources":["../../../../src/pack/assets/ktx.mts"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"ktx.mjs","sourceRoot":"","sources":["../../../../src/pack/assets/ktx.mts"],"names":[],"mappings":"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"}
@@ -7,7 +7,7 @@ export function getExtractedTextureOutputPath(publicDir) {
7
7
  return join(publicDir, "assets", "editor-generated_extracted-textures");
8
8
  }
9
9
  export async function processExportedTexture(absolutePath, options) {
10
- const extension = extname(absolutePath).toLocaleLowerCase();
10
+ const extension = extname(absolutePath);
11
11
  const metadata = await sharp(absolutePath).metadata();
12
12
  if (!metadata.width || !metadata.height) {
13
13
  return console.error(`Failed to compute exported image "${absolutePath}". Image metadata is invalid.`);
@@ -1 +1 @@
1
- {"version":3,"file":"texture.mjs","sourceRoot":"","sources":["../../../../src/pack/assets/texture.mts"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"texture.mjs","sourceRoot":"","sources":["../../../../src/pack/assets/texture.mts"],"names":[],"mappings":"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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "babylonjs-editor-cli",
3
- "version": "5.4.1-alpha.3",
3
+ "version": "5.4.1-alpha.5",
4
4
  "description": "Babylon.js Editor CLI is a command line interface to help you package your scenes made using the Babylon.js Editor",
5
5
  "productName": "Babylon.js Editor CLI",
6
6
  "scripts": {