@upstart.gg/sdk 0.0.88 → 0.0.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/node/cli/api.js +2 -2
- package/dist/node/cli/commands/build/cmd-build.js +2 -2
- package/dist/node/cli/commands/login/cmd-login.js +3 -3
- package/dist/node/cli/commands/logout/cmd-logout.js +2 -2
- package/dist/node/cli/commands/publish/cmd-publish.js +17 -17
- package/dist/node/cli/commands/publish/uploader.js +4 -4
- package/dist/node/cli/is-logged-in.js +2 -2
- package/dist/node/cli/program.js +26 -26
- package/dist/node/cli/store.js +1 -1
- package/dist/node/shared/config.js +3 -3
- package/dist/node/shared/logger.js +2 -2
- package/dist/shared/bricks.js +1 -1
- package/dist/shared/chunk-HC4I5B3L.js +3 -0
- package/dist/shared/{chunk-TGGTFM2R.js → chunk-OTJI3IWM.js} +1 -1
- package/dist/shared/{chunk-KK7J6SRT.js → chunk-SWGSHUTE.js} +1 -1
- package/dist/shared/datasources/internal/blog/schema.d.ts +2 -5
- package/dist/shared/datasources/internal/blog/schema.d.ts.map +1 -1
- package/dist/shared/datasources/internal/changelog/schema.d.ts.map +1 -1
- package/dist/shared/datasources/internal/faq/schema.d.ts.map +1 -1
- package/dist/shared/datasources/internal/job-board/schema.d.ts +80 -81
- package/dist/shared/datasources/internal/job-board/schema.d.ts.map +1 -1
- package/dist/shared/datasources/schemas.js +1 -1
- package/dist/shared/datasources.js +1 -1
- package/dist/shared/page.js +1 -1
- package/dist/shared/template.js +1 -1
- package/dist/shared/utils/try-catch.d.ts +2 -2
- package/dist/shared/utils/try-catch.d.ts.map +1 -1
- package/dist/shared/utils/try-catch.js +1 -1
- package/package.json +3 -5
- package/dist/shared/chunk-ZRWRIZBR.js +0 -3
package/dist/node/cli/api.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! Upstart.gg - Copyright (C) 2024 Flippable - https://github.com/upstart-gg/upstart/blob/main/LICENSE */
|
|
2
2
|
|
|
3
|
-
import{createLogger as T}from"vite";var g="0.0.
|
|
4
|
-
`)),{...s,success:(r,n)=>s.info(i.green(r),n),error:(r,n)=>s.error(i.red(r),n),warn:(r,n)=>s.warn(i.yellow(r),n),warnOnce:(r,n)=>s.warnOnce(i.yellow(r),n),debug:(r,n)=>{e==="debug"&&s.info(i.gray(r),n)}}}var p=h();var m="upstart-cli";var w=process.env.PUBLIC_UPSTART_OAUTH_CLIENT_ID??"50000000-0000-0000-0000-000000000001",
|
|
3
|
+
import{createLogger as T}from"vite";var g="0.0.90";import i from"chalk";function h(e,t,o=!1){let s=T(e==="debug"?"info":e,{prefix:"[upstart]",allowClearScreen:t});return o&&s.info(i.hex("#7270c6").bold(`\u{1F680} Upstart v${g}
|
|
4
|
+
`)),{...s,success:(r,n)=>s.info(i.green(r),n),error:(r,n)=>s.error(i.red(r),n),warn:(r,n)=>s.warn(i.yellow(r),n),warnOnce:(r,n)=>s.warnOnce(i.yellow(r),n),debug:(r,n)=>{e==="debug"&&s.info(i.gray(r),n)}}}var p=h();var m="upstart-cli";var w=process.env.PUBLIC_UPSTART_OAUTH_CLIENT_ID??"50000000-0000-0000-0000-000000000001",d=process.env.PUBLIC_UPSTART_API_BASE_URL??"https://api.upstart.gg",A=process.env.PUBLIC_UPSTART_EDITOR_BASE_URL??"https://upstart.gg";import E from"conf";import c from"node:path";import _ from"node:crypto";import a from"node:fs";import{fileURLToPath as L}from"node:url";import W from"chalk";var R=L(new URL(".",import.meta.url)),x=S(),u=new E({projectName:m,encryptionKey:x,clearInvalidConfig:!0});function O(){let e=R;for(;e!==c.parse(e).root;){let t=c.join(e,"node_modules");if(a.existsSync(t))return t;e=c.dirname(e)}return null}function S(){let e=O();if(!e)throw new Error("Could not find nearest node_modules directory.");let t=c.join(e,".enpage-tmp");a.existsSync(t)||a.mkdirSync(t,{recursive:!0,mode:448});let o=c.join(t,".enpage-key");if(!a.existsSync(o)){let r=_.randomBytes(32).toString("hex");return a.writeFileSync(o,r,{mode:384}),r}return a.readFileSync(o,"utf8")}async function J(e,t,o={}){u.get("access_token")&&(o.Authorization=`Bearer ${u.get("access_token")}`);let s=await fetch(l(e),{method:"POST",headers:{"Content-Type":t instanceof URLSearchParams?"application/x-www-form-urlencoded":"application/json",...o},body:t instanceof URLSearchParams?t:JSON.stringify(t)}).catch(r=>{p.error(`Fatal Error requesting API: ${r.message} (${r.cause.code})`),p.error("Please check your internet connection and try again, or retry later."),process.exit(1)});return y(s)}async function K(e,t={}){u.get("access_token")&&(t.Authorization=`Bearer ${u.get("access_token")}`);let o=await fetch(l(e),{headers:t,method:"GET"}).catch(s=>{p.error(`Fatal Error requesting API: ${s.message} (${s.cause.code})`),p.error("Please check your internet connection and try again, or retry later."),process.exit(1)});return y(o)}function l(e){let t=new URL(d.endsWith("/")?d:`${d}/`);return new URL(e,t)}async function y(e){let t=e.headers.get("content-type")?.startsWith("application/json")?await e.json():await e.text();return e.ok?{isSuccess:!0,isError:!1,status:e.status,statusText:e.statusText,data:t}:{isSuccess:!1,isError:!0,status:e.status,statusText:e.statusText,data:t}}export{K as get,J as post};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*! Upstart.gg - Copyright (C) 2024 Flippable - https://github.com/upstart-gg/upstart/blob/main/LICENSE */
|
|
2
2
|
|
|
3
|
-
var Ii=Object.create;var ts=Object.defineProperty;var Wi=Object.getOwnPropertyDescriptor;var ji=Object.getOwnPropertyNames;var Bi=Object.getPrototypeOf,zi=Object.prototype.hasOwnProperty;var es=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports);var Ui=(i,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ji(t))!zi.call(i,r)&&r!==e&&ts(i,r,{get:()=>t[r],enumerable:!(s=Wi(t,r))||s.enumerable});return i};var $i=(i,t,e)=>(e=i!=null?Ii(Bi(i)):{},Ui(t||!i||!i.__esModule?ts(e,"default",{value:i,enumerable:!0}):e,i));var os=es((So,ns)=>{"use strict";ns.exports=is;function is(i,t,e){i instanceof RegExp&&(i=ss(i,e)),t instanceof RegExp&&(t=ss(t,e));var s=rs(i,t,e);return s&&{start:s[0],end:s[1],pre:e.slice(0,s[0]),body:e.slice(s[0]+i.length,s[1]),post:e.slice(s[1]+t.length)}}function ss(i,t){var e=t.match(i);return e?e[0]:null}is.range=rs;function rs(i,t,e){var s,r,n,o,h,a=e.indexOf(i),l=e.indexOf(t,a+1),c=a;if(a>=0&&l>0){if(i===t)return[a,l];for(s=[],n=e.length;c>=0&&!h;)c==a?(s.push(c),a=e.indexOf(i,c+1)):s.length==1?h=[s.pop(),l]:(r=s.pop(),r<n&&(n=r,o=l),l=e.indexOf(t,c+1)),c=a<l&&a>=0?a:l;s.length&&(h=[n,o])}return h}});var ps=es((bo,ds)=>{"use strict";var hs=os();ds.exports=Vi;var as="\0SLASH"+Math.random()+"\0",ls="\0OPEN"+Math.random()+"\0",be="\0CLOSE"+Math.random()+"\0",cs="\0COMMA"+Math.random()+"\0",fs="\0PERIOD"+Math.random()+"\0";function Se(i){return parseInt(i,10)==i?parseInt(i,10):i.charCodeAt(0)}function Gi(i){return i.split("\\\\").join(as).split("\\{").join(ls).split("\\}").join(be).split("\\,").join(cs).split("\\.").join(fs)}function Hi(i){return i.split(as).join("\\").split(ls).join("{").split(be).join("}").split(cs).join(",").split(fs).join(".")}function us(i){if(!i)return[""];var t=[],e=hs("{","}",i);if(!e)return i.split(",");var s=e.pre,r=e.body,n=e.post,o=s.split(",");o[o.length-1]+="{"+r+"}";var h=us(n);return n.length&&(o[o.length-1]+=h.shift(),o.push.apply(o,h)),t.push.apply(t,o),t}function Vi(i){return i?(i.substr(0,2)==="{}"&&(i="\\{\\}"+i.substr(2)),xt(Gi(i),!0).map(Hi)):[]}function qi(i){return"{"+i+"}"}function Ki(i){return/^-?0\d/.test(i)}function Yi(i,t){return i<=t}function Xi(i,t){return i>=t}function xt(i,t){var e=[],s=hs("{","}",i);if(!s)return[i];var r=s.pre,n=s.post.length?xt(s.post,!1):[""];if(/\$$/.test(s.pre))for(var o=0;o<n.length;o++){var h=r+"{"+s.body+"}"+n[o];e.push(h)}else{var a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),c=a||l,f=s.body.indexOf(",")>=0;if(!c&&!f)return s.post.match(/,.*\}/)?(i=s.pre+"{"+s.body+be+s.post,xt(i)):[i];var u;if(c)u=s.body.split(/\.\./);else if(u=us(s.body),u.length===1&&(u=xt(u[0],!1).map(qi),u.length===1))return n.map(function(Bt){return s.pre+u[0]+Bt});var d;if(c){var g=Se(u[0]),p=Se(u[1]),w=Math.max(u[0].length,u[1].length),m=u.length==3?Math.abs(Se(u[2])):1,b=Yi,S=p<g;S&&(m*=-1,b=Xi);var y=u.some(Ki);d=[];for(var E=g;b(E,p);E+=m){var x;if(l)x=String.fromCharCode(E),x==="\\"&&(x="");else if(x=String(E),y){var W=w-x.length;if(W>0){var it=new Array(W+1).join("0");E<0?x="-"+it+x.slice(1):x=it+x}}d.push(x)}}else{d=[];for(var j=0;j<u.length;j++)d.push.apply(d,xt(u[j],!1))}for(var j=0;j<d.length;j++)for(var o=0;o<n.length;o++){var h=r+d[j]+n[o];(!t||c||h)&&e.push(h)}}return e}});import{build as Ze}from"vite";import mo,{resolve as Li}from"node:path";import{fileURLToPath as go}from"node:url";var vs=$i(ps(),1);var Tt=i=>{if(typeof i!="string")throw new TypeError("invalid pattern");if(i.length>65536)throw new TypeError("pattern is too long")};var Ji={"[: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]},Rt=i=>i.replace(/[[\]\\-]/g,"\\$&"),Zi=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),ms=i=>i.join(""),gs=(i,t)=>{let e=t;if(i.charAt(e)!=="[")throw new Error("not in a brace expression");let s=[],r=[],n=e+1,o=!1,h=!1,a=!1,l=!1,c=e,f="";t:for(;n<i.length;){let p=i.charAt(n);if((p==="!"||p==="^")&&n===e+1){l=!0,n++;continue}if(p==="]"&&o&&!a){c=n+1;break}if(o=!0,p==="\\"&&!a){a=!0,n++;continue}if(p==="["&&!a){for(let[w,[m,b,S]]of Object.entries(Ji))if(i.startsWith(w,n)){if(f)return["$.",!1,i.length-e,!0];n+=w.length,S?r.push(m):s.push(m),h=h||b;continue t}}if(a=!1,f){p>f?s.push(Rt(f)+"-"+Rt(p)):p===f&&s.push(Rt(p)),f="",n++;continue}if(i.startsWith("-]",n+1)){s.push(Rt(p+"-")),n+=2;continue}if(i.startsWith("-",n+1)){f=p,n+=2;continue}s.push(Rt(p)),n++}if(c<n)return["",!1,0,!1];if(!s.length&&!r.length)return["$.",!1,i.length-e,!0];if(r.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!l){let p=s[0].length===2?s[0].slice(-1):s[0];return[Zi(p),!1,c-e,!1]}let u="["+(l?"^":"")+ms(s)+"]",d="["+(l?"":"^")+ms(r)+"]";return[s.length&&r.length?"("+u+"|"+d+")":s.length?u:d,h,c-e,!0]};var B=(i,{windowsPathsNoEscape:t=!1}={})=>t?i.replace(/\[([^\/\\])\]/g,"$1"):i.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var Qi=new Set(["!","?","+","*","@"]),ws=i=>Qi.has(i),tr="(?!(?:^|/)\\.\\.?(?:$|/))",zt="(?!\\.)",er=new Set(["[","."]),sr=new Set(["..","."]),ir=new Set("().*{}+?[]^$\\!"),rr=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Ee="[^/]",ys=Ee+"*?",Ss=Ee+"+?",ot=class i{type;#t;#e;#n=!1;#i=[];#o;#b;#l;#f=!1;#h;#a;#r=!1;constructor(t,e,s={}){this.type=t,t&&(this.#e=!0),this.#o=e,this.#t=this.#o?this.#o.#t:this,this.#h=this.#t===this?s:this.#t.#h,this.#l=this.#t===this?[]:this.#t.#l,t==="!"&&!this.#t.#f&&this.#l.push(this),this.#b=this.#o?this.#o.#i.length:0}get hasMagic(){if(this.#e!==void 0)return this.#e;for(let t of this.#i)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#e=!0;return this.#e}toString(){return this.#a!==void 0?this.#a:this.type?this.#a=this.type+"("+this.#i.map(t=>String(t)).join("|")+")":this.#a=this.#i.map(t=>String(t)).join("")}#g(){if(this!==this.#t)throw new Error("should only call on root");if(this.#f)return this;this.toString(),this.#f=!0;let t;for(;t=this.#l.pop();){if(t.type!=="!")continue;let e=t,s=e.#o;for(;s;){for(let r=e.#b+1;!s.type&&r<s.#i.length;r++)for(let n of t.#i){if(typeof n=="string")throw new Error("string part in extglob AST??");n.copyIn(s.#i[r])}e=s,s=e.#o}}return this}push(...t){for(let e of t)if(e!==""){if(typeof e!="string"&&!(e instanceof i&&e.#o===this))throw new Error("invalid part: "+e);this.#i.push(e)}}toJSON(){let t=this.type===null?this.#i.slice().map(e=>typeof e=="string"?e:e.toJSON()):[this.type,...this.#i.map(e=>e.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#f&&this.#o?.type==="!")&&t.push({}),t}isStart(){if(this.#t===this)return!0;if(!this.#o?.isStart())return!1;if(this.#b===0)return!0;let t=this.#o;for(let e=0;e<this.#b;e++){let s=t.#i[e];if(!(s instanceof i&&s.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.#i.length:0;return this.#b===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let e=new i(this.type,t);for(let s of this.#i)e.copyIn(s);return e}static#w(t,e,s,r){let n=!1,o=!1,h=-1,a=!1;if(e.type===null){let d=s,g="";for(;d<t.length;){let p=t.charAt(d++);if(n||p==="\\"){n=!n,g+=p;continue}if(o){d===h+1?(p==="^"||p==="!")&&(a=!0):p==="]"&&!(d===h+2&&a)&&(o=!1),g+=p;continue}else if(p==="["){o=!0,h=d,a=!1,g+=p;continue}if(!r.noext&&ws(p)&&t.charAt(d)==="("){e.push(g),g="";let w=new i(p,e);d=i.#w(t,w,d,r),e.push(w);continue}g+=p}return e.push(g),d}let l=s+1,c=new i(null,e),f=[],u="";for(;l<t.length;){let d=t.charAt(l++);if(n||d==="\\"){n=!n,u+=d;continue}if(o){l===h+1?(d==="^"||d==="!")&&(a=!0):d==="]"&&!(l===h+2&&a)&&(o=!1),u+=d;continue}else if(d==="["){o=!0,h=l,a=!1,u+=d;continue}if(ws(d)&&t.charAt(l)==="("){c.push(u),u="";let g=new i(d,c);c.push(g),l=i.#w(t,g,l,r);continue}if(d==="|"){c.push(u),u="",f.push(c),c=new i(null,e);continue}if(d===")")return u===""&&e.#i.length===0&&(e.#r=!0),c.push(u),u="",e.push(...f,c),l;u+=d}return e.type=null,e.#e=void 0,e.#i=[t.substring(s-1)],l}static fromGlob(t,e={}){let s=new i(null,void 0,e);return i.#w(t,s,0,e),s}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();let t=this.toString(),[e,s,r,n]=this.toRegExpSource();if(!(r||this.#e||this.#h.nocase&&!this.#h.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return s;let h=(this.#h.nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${e}$`,h),{_src:e,_glob:t})}get options(){return this.#h}toRegExpSource(t){let e=t??!!this.#h.dot;if(this.#t===this&&this.#g(),!this.type){let a=this.isStart()&&this.isEnd(),l=this.#i.map(d=>{let[g,p,w,m]=typeof d=="string"?i.#u(d,this.#e,a):d.toRegExpSource(t);return this.#e=this.#e||w,this.#n=this.#n||m,g}).join(""),c="";if(this.isStart()&&typeof this.#i[0]=="string"&&!(this.#i.length===1&&sr.has(this.#i[0]))){let g=er,p=e&&g.has(l.charAt(0))||l.startsWith("\\.")&&g.has(l.charAt(2))||l.startsWith("\\.\\.")&&g.has(l.charAt(4)),w=!e&&!t&&g.has(l.charAt(0));c=p?tr:w?zt:""}let f="";return this.isEnd()&&this.#t.#f&&this.#o?.type==="!"&&(f="(?:$|\\/)"),[c+l+f,B(l),this.#e=!!this.#e,this.#n]}let s=this.type==="*"||this.type==="+",r=this.type==="!"?"(?:(?!(?:":"(?:",n=this.#d(e);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){let a=this.toString();return this.#i=[a],this.type=null,this.#e=void 0,[a,B(this.toString()),!1,!1]}let o=!s||t||e||!zt?"":this.#d(!0);o===n&&(o=""),o&&(n=`(?:${n})(?:${o})*?`);let h="";if(this.type==="!"&&this.#r)h=(this.isStart()&&!e?zt:"")+Ss;else{let a=this.type==="!"?"))"+(this.isStart()&&!e&&!t?zt:"")+ys+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;h=r+n+a}return[h,B(n),this.#e=!!this.#e,this.#n]}#d(t){return this.#i.map(e=>{if(typeof e=="string")throw new Error("string type in extglob ast??");let[s,r,n,o]=e.toRegExpSource(t);return this.#n=this.#n||o,s}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join("|")}static#u(t,e,s=!1){let r=!1,n="",o=!1;for(let h=0;h<t.length;h++){let a=t.charAt(h);if(r){r=!1,n+=(ir.has(a)?"\\":"")+a;continue}if(a==="\\"){h===t.length-1?n+="\\\\":r=!0;continue}if(a==="["){let[l,c,f,u]=gs(t,h);if(f){n+=l,o=o||c,h+=f-1,e=e||u;continue}}if(a==="*"){s&&t==="*"?n+=Ss:n+=ys,e=!0;continue}if(a==="?"){n+=Ee,e=!0;continue}n+=rr(a)}return[n,B(t),!!e,o]}};var ht=(i,{windowsPathsNoEscape:t=!1}={})=>t?i.replace(/[?*()[\]]/g,"[$&]"):i.replace(/[?*()[\]\\]/g,"\\$&");var k=(i,t,e={})=>(Tt(t),!e.nocomment&&t.charAt(0)==="#"?!1:new F(t,e).match(i)),nr=/^\*+([^+@!?\*\[\(]*)$/,or=i=>t=>!t.startsWith(".")&&t.endsWith(i),hr=i=>t=>t.endsWith(i),ar=i=>(i=i.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(i)),lr=i=>(i=i.toLowerCase(),t=>t.toLowerCase().endsWith(i)),cr=/^\*+\.\*+$/,fr=i=>!i.startsWith(".")&&i.includes("."),ur=i=>i!=="."&&i!==".."&&i.includes("."),dr=/^\.\*+$/,pr=i=>i!=="."&&i!==".."&&i.startsWith("."),mr=/^\*+$/,gr=i=>i.length!==0&&!i.startsWith("."),wr=i=>i.length!==0&&i!=="."&&i!=="..",yr=/^\?+([^+@!?\*\[\(]*)?$/,Sr=([i,t=""])=>{let e=xs([i]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},br=([i,t=""])=>{let e=Ts([i]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},Er=([i,t=""])=>{let e=Ts([i]);return t?s=>e(s)&&s.endsWith(t):e},vr=([i,t=""])=>{let e=xs([i]);return t?s=>e(s)&&s.endsWith(t):e},xs=([i])=>{let t=i.length;return e=>e.length===t&&!e.startsWith(".")},Ts=([i])=>{let t=i.length;return e=>e.length===t&&e!=="."&&e!==".."},Rs=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",bs={win32:{sep:"\\"},posix:{sep:"/"}},xr=Rs==="win32"?bs.win32.sep:bs.posix.sep;k.sep=xr;var A=Symbol("globstar **");k.GLOBSTAR=A;var Tr="[^/]",Rr=Tr+"*?",Or="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Ar="(?:(?!(?:\\/|^)\\.).)*?",Nr=(i,t={})=>e=>k(e,i,t);k.filter=Nr;var L=(i,t={})=>Object.assign({},i,t),Cr=i=>{if(!i||typeof i!="object"||!Object.keys(i).length)return k;let t=k;return Object.assign((s,r,n={})=>t(s,r,L(i,n)),{Minimatch:class extends t.Minimatch{constructor(r,n={}){super(r,L(i,n))}static defaults(r){return t.defaults(L(i,r)).Minimatch}},AST:class extends t.AST{constructor(r,n,o={}){super(r,n,L(i,o))}static fromGlob(r,n={}){return t.AST.fromGlob(r,L(i,n))}},unescape:(s,r={})=>t.unescape(s,L(i,r)),escape:(s,r={})=>t.escape(s,L(i,r)),filter:(s,r={})=>t.filter(s,L(i,r)),defaults:s=>t.defaults(L(i,s)),makeRe:(s,r={})=>t.makeRe(s,L(i,r)),braceExpand:(s,r={})=>t.braceExpand(s,L(i,r)),match:(s,r,n={})=>t.match(s,r,L(i,n)),sep:t.sep,GLOBSTAR:A})};k.defaults=Cr;var Os=(i,t={})=>(Tt(i),t.nobrace||!/\{(?:(?!\{).)*\}/.test(i)?[i]:(0,vs.default)(i));k.braceExpand=Os;var kr=(i,t={})=>new F(i,t).makeRe();k.makeRe=kr;var Dr=(i,t,e={})=>{let s=new F(t,e);return i=i.filter(r=>s.match(r)),s.options.nonull&&!i.length&&i.push(t),i};k.match=Dr;var Es=/[?*]|[+@!]\(.*?\)|\[|\]/,Mr=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),F=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){Tt(t),e=e||{},this.options=e,this.pattern=t,this.platform=e.platform||Rs,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let e of t)if(typeof e!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...n)=>console.error(...n)),this.debug(this.pattern,this.globSet);let s=this.globSet.map(n=>this.slashSplit(n));this.globParts=this.preprocess(s),this.debug(this.pattern,this.globParts);let r=this.globParts.map((n,o,h)=>{if(this.isWindows&&this.windowsNoMagicRoot){let a=n[0]===""&&n[1]===""&&(n[2]==="?"||!Es.test(n[2]))&&!Es.test(n[3]),l=/^[a-z]:/i.test(n[0]);if(a)return[...n.slice(0,4),...n.slice(4).map(c=>this.parse(c))];if(l)return[n[0],...n.slice(1).map(c=>this.parse(c))]}return n.map(a=>this.parse(a))});if(this.debug(this.pattern,r),this.set=r.filter(n=>n.indexOf(!1)===-1),this.isWindows)for(let n=0;n<this.set.length;n++){let o=this.set[n];o[0]===""&&o[1]===""&&this.globParts[n][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let s=0;s<t.length;s++)for(let r=0;r<t[s].length;r++)t[s][r]==="**"&&(t[s][r]="*");let{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let s=-1;for(;(s=e.indexOf("**",s+1))!==-1;){let r=s;for(;e[r+1]==="**";)r++;r!==s&&e.splice(s,r-s)}return e})}levelOneOptimize(t){return t.map(e=>(e=e.reduce((s,r)=>{let n=s[s.length-1];return r==="**"&&n==="**"?s:r===".."&&n&&n!==".."&&n!=="."&&n!=="**"?(s.pop(),s):(s.push(r),s)},[]),e.length===0?[""]:e))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let r=1;r<t.length-1;r++){let n=t[r];r===1&&n===""&&t[0]===""||(n==="."||n==="")&&(e=!0,t.splice(r,1),r--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(e=!0,t.pop())}let s=0;for(;(s=t.indexOf("..",s+1))!==-1;){let r=t[s-1];r&&r!=="."&&r!==".."&&r!=="**"&&(e=!0,t.splice(s-1,2),s-=2)}}while(e);return t.length===0?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let s of t){let r=-1;for(;(r=s.indexOf("**",r+1))!==-1;){let o=r;for(;s[o+1]==="**";)o++;o>r&&s.splice(r+1,o-r);let h=s[r+1],a=s[r+2],l=s[r+3];if(h!==".."||!a||a==="."||a===".."||!l||l==="."||l==="..")continue;e=!0,s.splice(r,1);let c=s.slice(0);c[r]="**",t.push(c),r--}if(!this.preserveMultipleSlashes){for(let o=1;o<s.length-1;o++){let h=s[o];o===1&&h===""&&s[0]===""||(h==="."||h==="")&&(e=!0,s.splice(o,1),o--)}s[0]==="."&&s.length===2&&(s[1]==="."||s[1]==="")&&(e=!0,s.pop())}let n=0;for(;(n=s.indexOf("..",n+1))!==-1;){let o=s[n-1];if(o&&o!=="."&&o!==".."&&o!=="**"){e=!0;let a=n===1&&s[n+1]==="**"?["."]:[];s.splice(n-1,2,...a),s.length===0&&s.push(""),n-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let s=e+1;s<t.length;s++){let r=this.partsMatch(t[e],t[s],!this.preserveMultipleSlashes);if(r){t[e]=[],t[s]=r;break}}return t.filter(e=>e.length)}partsMatch(t,e,s=!1){let r=0,n=0,o=[],h="";for(;r<t.length&&n<e.length;)if(t[r]===e[n])o.push(h==="b"?e[n]:t[r]),r++,n++;else if(s&&t[r]==="**"&&e[n]===t[r+1])o.push(t[r]),r++;else if(s&&e[n]==="**"&&t[r]===e[n+1])o.push(e[n]),n++;else if(t[r]==="*"&&e[n]&&(this.options.dot||!e[n].startsWith("."))&&e[n]!=="**"){if(h==="b")return!1;h="a",o.push(t[r]),r++,n++}else if(e[n]==="*"&&t[r]&&(this.options.dot||!t[r].startsWith("."))&&t[r]!=="**"){if(h==="a")return!1;h="b",o.push(e[n]),r++,n++}else return!1;return t.length===e.length&&o}parseNegate(){if(this.nonegate)return;let t=this.pattern,e=!1,s=0;for(let r=0;r<t.length&&t.charAt(r)==="!";r++)e=!e,s++;s&&(this.pattern=t.slice(s)),this.negate=e}matchOne(t,e,s=!1){let r=this.options;if(this.isWindows){let p=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),w=!p&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),m=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),b=!m&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]=="string"&&/^[a-z]:$/i.test(e[3]),S=w?3:p?0:void 0,y=b?3:m?0:void 0;if(typeof S=="number"&&typeof y=="number"){let[E,x]=[t[S],e[y]];E.toLowerCase()===x.toLowerCase()&&(e[y]=E,y>S?e=e.slice(y):S>y&&(t=t.slice(S)))}}let{optimizationLevel:n=1}=this.options;n>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var o=0,h=0,a=t.length,l=e.length;o<a&&h<l;o++,h++){this.debug("matchOne loop");var c=e[h],f=t[o];if(this.debug(e,c,f),c===!1)return!1;if(c===A){this.debug("GLOBSTAR",[e,c,f]);var u=o,d=h+1;if(d===l){for(this.debug("** at the end");o<a;o++)if(t[o]==="."||t[o]===".."||!r.dot&&t[o].charAt(0)===".")return!1;return!0}for(;u<a;){var g=t[u];if(this.debug(`
|
|
3
|
+
var Ii=Object.create;var ts=Object.defineProperty;var Wi=Object.getOwnPropertyDescriptor;var ji=Object.getOwnPropertyNames;var Bi=Object.getPrototypeOf,zi=Object.prototype.hasOwnProperty;var es=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports);var Ui=(i,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ji(t))!zi.call(i,r)&&r!==e&&ts(i,r,{get:()=>t[r],enumerable:!(s=Wi(t,r))||s.enumerable});return i};var $i=(i,t,e)=>(e=i!=null?Ii(Bi(i)):{},Ui(t||!i||!i.__esModule?ts(e,"default",{value:i,enumerable:!0}):e,i));var os=es((So,ns)=>{"use strict";ns.exports=is;function is(i,t,e){i instanceof RegExp&&(i=ss(i,e)),t instanceof RegExp&&(t=ss(t,e));var s=rs(i,t,e);return s&&{start:s[0],end:s[1],pre:e.slice(0,s[0]),body:e.slice(s[0]+i.length,s[1]),post:e.slice(s[1]+t.length)}}function ss(i,t){var e=t.match(i);return e?e[0]:null}is.range=rs;function rs(i,t,e){var s,r,n,o,h,a=e.indexOf(i),l=e.indexOf(t,a+1),f=a;if(a>=0&&l>0){if(i===t)return[a,l];for(s=[],n=e.length;f>=0&&!h;)f==a?(s.push(f),a=e.indexOf(i,f+1)):s.length==1?h=[s.pop(),l]:(r=s.pop(),r<n&&(n=r,o=l),l=e.indexOf(t,f+1)),f=a<l&&a>=0?a:l;s.length&&(h=[n,o])}return h}});var ps=es((bo,ds)=>{"use strict";var hs=os();ds.exports=Vi;var as="\0SLASH"+Math.random()+"\0",ls="\0OPEN"+Math.random()+"\0",be="\0CLOSE"+Math.random()+"\0",cs="\0COMMA"+Math.random()+"\0",fs="\0PERIOD"+Math.random()+"\0";function Se(i){return parseInt(i,10)==i?parseInt(i,10):i.charCodeAt(0)}function Gi(i){return i.split("\\\\").join(as).split("\\{").join(ls).split("\\}").join(be).split("\\,").join(cs).split("\\.").join(fs)}function Hi(i){return i.split(as).join("\\").split(ls).join("{").split(be).join("}").split(cs).join(",").split(fs).join(".")}function us(i){if(!i)return[""];var t=[],e=hs("{","}",i);if(!e)return i.split(",");var s=e.pre,r=e.body,n=e.post,o=s.split(",");o[o.length-1]+="{"+r+"}";var h=us(n);return n.length&&(o[o.length-1]+=h.shift(),o.push.apply(o,h)),t.push.apply(t,o),t}function Vi(i){return i?(i.substr(0,2)==="{}"&&(i="\\{\\}"+i.substr(2)),Tt(Gi(i),!0).map(Hi)):[]}function qi(i){return"{"+i+"}"}function Ki(i){return/^-?0\d/.test(i)}function Yi(i,t){return i<=t}function Xi(i,t){return i>=t}function Tt(i,t){var e=[],s=hs("{","}",i);if(!s)return[i];var r=s.pre,n=s.post.length?Tt(s.post,!1):[""];if(/\$$/.test(s.pre))for(var o=0;o<n.length;o++){var h=r+"{"+s.body+"}"+n[o];e.push(h)}else{var a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),f=a||l,c=s.body.indexOf(",")>=0;if(!f&&!c)return s.post.match(/,.*\}/)?(i=s.pre+"{"+s.body+be+s.post,Tt(i)):[i];var u;if(f)u=s.body.split(/\.\./);else if(u=us(s.body),u.length===1&&(u=Tt(u[0],!1).map(qi),u.length===1))return n.map(function(xt){return s.pre+u[0]+xt});var d;if(f){var g=Se(u[0]),p=Se(u[1]),w=Math.max(u[0].length,u[1].length),m=u.length==3?Math.abs(Se(u[2])):1,S=Yi,b=p<g;b&&(m*=-1,S=Xi);var y=u.some(Ki);d=[];for(var E=g;S(E,p);E+=m){var x;if(l)x=String.fromCharCode(E),x==="\\"&&(x="");else if(x=String(E),y){var V=w-x.length;if(V>0){var it=new Array(V+1).join("0");E<0?x="-"+it+x.slice(1):x=it+x}}d.push(x)}}else{d=[];for(var M=0;M<u.length;M++)d.push.apply(d,Tt(u[M],!1))}for(var M=0;M<d.length;M++)for(var o=0;o<n.length;o++){var h=r+d[M]+n[o];(!t||f||h)&&e.push(h)}}return e}});import{build as Ze}from"vite";import mo,{resolve as Li}from"node:path";import{fileURLToPath as go}from"node:url";var vs=$i(ps(),1);var Rt=i=>{if(typeof i!="string")throw new TypeError("invalid pattern");if(i.length>65536)throw new TypeError("pattern is too long")};var Ji={"[: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]},Ot=i=>i.replace(/[[\]\\-]/g,"\\$&"),Zi=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),ms=i=>i.join(""),gs=(i,t)=>{let e=t;if(i.charAt(e)!=="[")throw new Error("not in a brace expression");let s=[],r=[],n=e+1,o=!1,h=!1,a=!1,l=!1,f=e,c="";t:for(;n<i.length;){let p=i.charAt(n);if((p==="!"||p==="^")&&n===e+1){l=!0,n++;continue}if(p==="]"&&o&&!a){f=n+1;break}if(o=!0,p==="\\"&&!a){a=!0,n++;continue}if(p==="["&&!a){for(let[w,[m,S,b]]of Object.entries(Ji))if(i.startsWith(w,n)){if(c)return["$.",!1,i.length-e,!0];n+=w.length,b?r.push(m):s.push(m),h=h||S;continue t}}if(a=!1,c){p>c?s.push(Ot(c)+"-"+Ot(p)):p===c&&s.push(Ot(p)),c="",n++;continue}if(i.startsWith("-]",n+1)){s.push(Ot(p+"-")),n+=2;continue}if(i.startsWith("-",n+1)){c=p,n+=2;continue}s.push(Ot(p)),n++}if(f<n)return["",!1,0,!1];if(!s.length&&!r.length)return["$.",!1,i.length-e,!0];if(r.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!l){let p=s[0].length===2?s[0].slice(-1):s[0];return[Zi(p),!1,f-e,!1]}let u="["+(l?"^":"")+ms(s)+"]",d="["+(l?"":"^")+ms(r)+"]";return[s.length&&r.length?"("+u+"|"+d+")":s.length?u:d,h,f-e,!0]};var j=(i,{windowsPathsNoEscape:t=!1}={})=>t?i.replace(/\[([^\/\\])\]/g,"$1"):i.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var Qi=new Set(["!","?","+","*","@"]),ws=i=>Qi.has(i),tr="(?!(?:^|/)\\.\\.?(?:$|/))",zt="(?!\\.)",er=new Set(["[","."]),sr=new Set(["..","."]),ir=new Set("().*{}+?[]^$\\!"),rr=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Ee="[^/]",ys=Ee+"*?",Ss=Ee+"+?",ot=class i{type;#t;#e;#n=!1;#r=[];#o;#b;#w;#h=!1;#f;#a;#l=!1;constructor(t,e,s={}){this.type=t,t&&(this.#e=!0),this.#o=e,this.#t=this.#o?this.#o.#t:this,this.#f=this.#t===this?s:this.#t.#f,this.#w=this.#t===this?[]:this.#t.#w,t==="!"&&!this.#t.#h&&this.#w.push(this),this.#b=this.#o?this.#o.#r.length:0}get hasMagic(){if(this.#e!==void 0)return this.#e;for(let t of this.#r)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#e=!0;return this.#e}toString(){return this.#a!==void 0?this.#a:this.type?this.#a=this.type+"("+this.#r.map(t=>String(t)).join("|")+")":this.#a=this.#r.map(t=>String(t)).join("")}#s(){if(this!==this.#t)throw new Error("should only call on root");if(this.#h)return this;this.toString(),this.#h=!0;let t;for(;t=this.#w.pop();){if(t.type!=="!")continue;let e=t,s=e.#o;for(;s;){for(let r=e.#b+1;!s.type&&r<s.#r.length;r++)for(let n of t.#r){if(typeof n=="string")throw new Error("string part in extglob AST??");n.copyIn(s.#r[r])}e=s,s=e.#o}}return this}push(...t){for(let e of t)if(e!==""){if(typeof e!="string"&&!(e instanceof i&&e.#o===this))throw new Error("invalid part: "+e);this.#r.push(e)}}toJSON(){let t=this.type===null?this.#r.slice().map(e=>typeof e=="string"?e:e.toJSON()):[this.type,...this.#r.map(e=>e.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#h&&this.#o?.type==="!")&&t.push({}),t}isStart(){if(this.#t===this)return!0;if(!this.#o?.isStart())return!1;if(this.#b===0)return!0;let t=this.#o;for(let e=0;e<this.#b;e++){let s=t.#r[e];if(!(s instanceof i&&s.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.#r.length:0;return this.#b===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let e=new i(this.type,t);for(let s of this.#r)e.copyIn(s);return e}static#u(t,e,s,r){let n=!1,o=!1,h=-1,a=!1;if(e.type===null){let d=s,g="";for(;d<t.length;){let p=t.charAt(d++);if(n||p==="\\"){n=!n,g+=p;continue}if(o){d===h+1?(p==="^"||p==="!")&&(a=!0):p==="]"&&!(d===h+2&&a)&&(o=!1),g+=p;continue}else if(p==="["){o=!0,h=d,a=!1,g+=p;continue}if(!r.noext&&ws(p)&&t.charAt(d)==="("){e.push(g),g="";let w=new i(p,e);d=i.#u(t,w,d,r),e.push(w);continue}g+=p}return e.push(g),d}let l=s+1,f=new i(null,e),c=[],u="";for(;l<t.length;){let d=t.charAt(l++);if(n||d==="\\"){n=!n,u+=d;continue}if(o){l===h+1?(d==="^"||d==="!")&&(a=!0):d==="]"&&!(l===h+2&&a)&&(o=!1),u+=d;continue}else if(d==="["){o=!0,h=l,a=!1,u+=d;continue}if(ws(d)&&t.charAt(l)==="("){f.push(u),u="";let g=new i(d,f);f.push(g),l=i.#u(t,g,l,r);continue}if(d==="|"){f.push(u),u="",c.push(f),f=new i(null,e);continue}if(d===")")return u===""&&e.#r.length===0&&(e.#l=!0),f.push(u),u="",e.push(...c,f),l;u+=d}return e.type=null,e.#e=void 0,e.#r=[t.substring(s-1)],l}static fromGlob(t,e={}){let s=new i(null,void 0,e);return i.#u(t,s,0,e),s}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();let t=this.toString(),[e,s,r,n]=this.toRegExpSource();if(!(r||this.#e||this.#f.nocase&&!this.#f.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return s;let h=(this.#f.nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${e}$`,h),{_src:e,_glob:t})}get options(){return this.#f}toRegExpSource(t){let e=t??!!this.#f.dot;if(this.#t===this&&this.#s(),!this.type){let a=this.isStart()&&this.isEnd(),l=this.#r.map(d=>{let[g,p,w,m]=typeof d=="string"?i.#p(d,this.#e,a):d.toRegExpSource(t);return this.#e=this.#e||w,this.#n=this.#n||m,g}).join(""),f="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&sr.has(this.#r[0]))){let g=er,p=e&&g.has(l.charAt(0))||l.startsWith("\\.")&&g.has(l.charAt(2))||l.startsWith("\\.\\.")&&g.has(l.charAt(4)),w=!e&&!t&&g.has(l.charAt(0));f=p?tr:w?zt:""}let c="";return this.isEnd()&&this.#t.#h&&this.#o?.type==="!"&&(c="(?:$|\\/)"),[f+l+c,j(l),this.#e=!!this.#e,this.#n]}let s=this.type==="*"||this.type==="+",r=this.type==="!"?"(?:(?!(?:":"(?:",n=this.#y(e);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){let a=this.toString();return this.#r=[a],this.type=null,this.#e=void 0,[a,j(this.toString()),!1,!1]}let o=!s||t||e||!zt?"":this.#y(!0);o===n&&(o=""),o&&(n=`(?:${n})(?:${o})*?`);let h="";if(this.type==="!"&&this.#l)h=(this.isStart()&&!e?zt:"")+Ss;else{let a=this.type==="!"?"))"+(this.isStart()&&!e&&!t?zt:"")+ys+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;h=r+n+a}return[h,j(n),this.#e=!!this.#e,this.#n]}#y(t){return this.#r.map(e=>{if(typeof e=="string")throw new Error("string type in extglob ast??");let[s,r,n,o]=e.toRegExpSource(t);return this.#n=this.#n||o,s}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join("|")}static#p(t,e,s=!1){let r=!1,n="",o=!1;for(let h=0;h<t.length;h++){let a=t.charAt(h);if(r){r=!1,n+=(ir.has(a)?"\\":"")+a;continue}if(a==="\\"){h===t.length-1?n+="\\\\":r=!0;continue}if(a==="["){let[l,f,c,u]=gs(t,h);if(c){n+=l,o=o||f,h+=c-1,e=e||u;continue}}if(a==="*"){s&&t==="*"?n+=Ss:n+=ys,e=!0;continue}if(a==="?"){n+=Ee,e=!0;continue}n+=rr(a)}return[n,j(t),!!e,o]}};var ht=(i,{windowsPathsNoEscape:t=!1}={})=>t?i.replace(/[?*()[\]]/g,"[$&]"):i.replace(/[?*()[\]\\]/g,"\\$&");var k=(i,t,e={})=>(Rt(t),!e.nocomment&&t.charAt(0)==="#"?!1:new _(t,e).match(i)),nr=/^\*+([^+@!?\*\[\(]*)$/,or=i=>t=>!t.startsWith(".")&&t.endsWith(i),hr=i=>t=>t.endsWith(i),ar=i=>(i=i.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(i)),lr=i=>(i=i.toLowerCase(),t=>t.toLowerCase().endsWith(i)),cr=/^\*+\.\*+$/,fr=i=>!i.startsWith(".")&&i.includes("."),ur=i=>i!=="."&&i!==".."&&i.includes("."),dr=/^\.\*+$/,pr=i=>i!=="."&&i!==".."&&i.startsWith("."),mr=/^\*+$/,gr=i=>i.length!==0&&!i.startsWith("."),wr=i=>i.length!==0&&i!=="."&&i!=="..",yr=/^\?+([^+@!?\*\[\(]*)?$/,Sr=([i,t=""])=>{let e=xs([i]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},br=([i,t=""])=>{let e=Ts([i]);return t?(t=t.toLowerCase(),s=>e(s)&&s.toLowerCase().endsWith(t)):e},Er=([i,t=""])=>{let e=Ts([i]);return t?s=>e(s)&&s.endsWith(t):e},vr=([i,t=""])=>{let e=xs([i]);return t?s=>e(s)&&s.endsWith(t):e},xs=([i])=>{let t=i.length;return e=>e.length===t&&!e.startsWith(".")},Ts=([i])=>{let t=i.length;return e=>e.length===t&&e!=="."&&e!==".."},Rs=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",bs={win32:{sep:"\\"},posix:{sep:"/"}},xr=Rs==="win32"?bs.win32.sep:bs.posix.sep;k.sep=xr;var A=Symbol("globstar **");k.GLOBSTAR=A;var Tr="[^/]",Rr=Tr+"*?",Or="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Ar="(?:(?!(?:\\/|^)\\.).)*?",Nr=(i,t={})=>e=>k(e,i,t);k.filter=Nr;var P=(i,t={})=>Object.assign({},i,t),Cr=i=>{if(!i||typeof i!="object"||!Object.keys(i).length)return k;let t=k;return Object.assign((s,r,n={})=>t(s,r,P(i,n)),{Minimatch:class extends t.Minimatch{constructor(r,n={}){super(r,P(i,n))}static defaults(r){return t.defaults(P(i,r)).Minimatch}},AST:class extends t.AST{constructor(r,n,o={}){super(r,n,P(i,o))}static fromGlob(r,n={}){return t.AST.fromGlob(r,P(i,n))}},unescape:(s,r={})=>t.unescape(s,P(i,r)),escape:(s,r={})=>t.escape(s,P(i,r)),filter:(s,r={})=>t.filter(s,P(i,r)),defaults:s=>t.defaults(P(i,s)),makeRe:(s,r={})=>t.makeRe(s,P(i,r)),braceExpand:(s,r={})=>t.braceExpand(s,P(i,r)),match:(s,r,n={})=>t.match(s,r,P(i,n)),sep:t.sep,GLOBSTAR:A})};k.defaults=Cr;var Os=(i,t={})=>(Rt(i),t.nobrace||!/\{(?:(?!\{).)*\}/.test(i)?[i]:(0,vs.default)(i));k.braceExpand=Os;var kr=(i,t={})=>new _(i,t).makeRe();k.makeRe=kr;var Dr=(i,t,e={})=>{let s=new _(t,e);return i=i.filter(r=>s.match(r)),s.options.nonull&&!i.length&&i.push(t),i};k.match=Dr;var Es=/[?*]|[+@!]\(.*?\)|\[|\]/,Mr=i=>i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),_=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){Rt(t),e=e||{},this.options=e,this.pattern=t,this.platform=e.platform||Rs,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let e of t)if(typeof e!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...n)=>console.error(...n)),this.debug(this.pattern,this.globSet);let s=this.globSet.map(n=>this.slashSplit(n));this.globParts=this.preprocess(s),this.debug(this.pattern,this.globParts);let r=this.globParts.map((n,o,h)=>{if(this.isWindows&&this.windowsNoMagicRoot){let a=n[0]===""&&n[1]===""&&(n[2]==="?"||!Es.test(n[2]))&&!Es.test(n[3]),l=/^[a-z]:/i.test(n[0]);if(a)return[...n.slice(0,4),...n.slice(4).map(f=>this.parse(f))];if(l)return[n[0],...n.slice(1).map(f=>this.parse(f))]}return n.map(a=>this.parse(a))});if(this.debug(this.pattern,r),this.set=r.filter(n=>n.indexOf(!1)===-1),this.isWindows)for(let n=0;n<this.set.length;n++){let o=this.set[n];o[0]===""&&o[1]===""&&this.globParts[n][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let s=0;s<t.length;s++)for(let r=0;r<t[s].length;r++)t[s][r]==="**"&&(t[s][r]="*");let{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let s=-1;for(;(s=e.indexOf("**",s+1))!==-1;){let r=s;for(;e[r+1]==="**";)r++;r!==s&&e.splice(s,r-s)}return e})}levelOneOptimize(t){return t.map(e=>(e=e.reduce((s,r)=>{let n=s[s.length-1];return r==="**"&&n==="**"?s:r===".."&&n&&n!==".."&&n!=="."&&n!=="**"?(s.pop(),s):(s.push(r),s)},[]),e.length===0?[""]:e))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let r=1;r<t.length-1;r++){let n=t[r];r===1&&n===""&&t[0]===""||(n==="."||n==="")&&(e=!0,t.splice(r,1),r--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(e=!0,t.pop())}let s=0;for(;(s=t.indexOf("..",s+1))!==-1;){let r=t[s-1];r&&r!=="."&&r!==".."&&r!=="**"&&(e=!0,t.splice(s-1,2),s-=2)}}while(e);return t.length===0?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let s of t){let r=-1;for(;(r=s.indexOf("**",r+1))!==-1;){let o=r;for(;s[o+1]==="**";)o++;o>r&&s.splice(r+1,o-r);let h=s[r+1],a=s[r+2],l=s[r+3];if(h!==".."||!a||a==="."||a===".."||!l||l==="."||l==="..")continue;e=!0,s.splice(r,1);let f=s.slice(0);f[r]="**",t.push(f),r--}if(!this.preserveMultipleSlashes){for(let o=1;o<s.length-1;o++){let h=s[o];o===1&&h===""&&s[0]===""||(h==="."||h==="")&&(e=!0,s.splice(o,1),o--)}s[0]==="."&&s.length===2&&(s[1]==="."||s[1]==="")&&(e=!0,s.pop())}let n=0;for(;(n=s.indexOf("..",n+1))!==-1;){let o=s[n-1];if(o&&o!=="."&&o!==".."&&o!=="**"){e=!0;let a=n===1&&s[n+1]==="**"?["."]:[];s.splice(n-1,2,...a),s.length===0&&s.push(""),n-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let s=e+1;s<t.length;s++){let r=this.partsMatch(t[e],t[s],!this.preserveMultipleSlashes);if(r){t[e]=[],t[s]=r;break}}return t.filter(e=>e.length)}partsMatch(t,e,s=!1){let r=0,n=0,o=[],h="";for(;r<t.length&&n<e.length;)if(t[r]===e[n])o.push(h==="b"?e[n]:t[r]),r++,n++;else if(s&&t[r]==="**"&&e[n]===t[r+1])o.push(t[r]),r++;else if(s&&e[n]==="**"&&t[r]===e[n+1])o.push(e[n]),n++;else if(t[r]==="*"&&e[n]&&(this.options.dot||!e[n].startsWith("."))&&e[n]!=="**"){if(h==="b")return!1;h="a",o.push(t[r]),r++,n++}else if(e[n]==="*"&&t[r]&&(this.options.dot||!t[r].startsWith("."))&&t[r]!=="**"){if(h==="a")return!1;h="b",o.push(e[n]),r++,n++}else return!1;return t.length===e.length&&o}parseNegate(){if(this.nonegate)return;let t=this.pattern,e=!1,s=0;for(let r=0;r<t.length&&t.charAt(r)==="!";r++)e=!e,s++;s&&(this.pattern=t.slice(s)),this.negate=e}matchOne(t,e,s=!1){let r=this.options;if(this.isWindows){let p=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),w=!p&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),m=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),S=!m&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]=="string"&&/^[a-z]:$/i.test(e[3]),b=w?3:p?0:void 0,y=S?3:m?0:void 0;if(typeof b=="number"&&typeof y=="number"){let[E,x]=[t[b],e[y]];E.toLowerCase()===x.toLowerCase()&&(e[y]=E,y>b?e=e.slice(y):b>y&&(t=t.slice(b)))}}let{optimizationLevel:n=1}=this.options;n>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var o=0,h=0,a=t.length,l=e.length;o<a&&h<l;o++,h++){this.debug("matchOne loop");var f=e[h],c=t[o];if(this.debug(e,f,c),f===!1)return!1;if(f===A){this.debug("GLOBSTAR",[e,f,c]);var u=o,d=h+1;if(d===l){for(this.debug("** at the end");o<a;o++)if(t[o]==="."||t[o]===".."||!r.dot&&t[o].charAt(0)===".")return!1;return!0}for(;u<a;){var g=t[u];if(this.debug(`
|
|
4
4
|
globstar while`,t,u,e,d,g),this.matchOne(t.slice(u),e.slice(d),s))return this.debug("globstar found match!",u,a,g),!0;if(g==="."||g===".."||!r.dot&&g.charAt(0)==="."){this.debug("dot detected!",t,u,e,d);break}this.debug("globstar swallow a segment, and continue"),u++}return!!(s&&(this.debug(`
|
|
5
|
-
>>> no match, partial?`,t,u,e,d),u===a))}let p;if(typeof c=="string"?(p=f===c,this.debug("string match",c,f,p)):(p=c.test(f),this.debug("pattern match",c,f,p)),!p)return!1}if(o===a&&h===l)return!0;if(o===a)return s;if(h===l)return o===a-1&&t[o]==="";throw new Error("wtf?")}braceExpand(){return Os(this.pattern,this.options)}parse(t){Tt(t);let e=this.options;if(t==="**")return A;if(t==="")return"";let s,r=null;(s=t.match(mr))?r=e.dot?wr:gr:(s=t.match(nr))?r=(e.nocase?e.dot?lr:ar:e.dot?hr:or)(s[1]):(s=t.match(yr))?r=(e.nocase?e.dot?br:Sr:e.dot?Er:vr)(s):(s=t.match(cr))?r=e.dot?ur:fr:(s=t.match(dr))&&(r=pr);let n=ot.fromGlob(t,this.options).toMMPattern();return r&&typeof n=="object"&&Reflect.defineProperty(n,"test",{value:r}),n}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let e=this.options,s=e.noglobstar?Rr:e.dot?Or:Ar,r=new Set(e.nocase?["i"]:[]),n=t.map(a=>{let l=a.map(c=>{if(c instanceof RegExp)for(let f of c.flags.split(""))r.add(f);return typeof c=="string"?Mr(c):c===A?A:c._src});return l.forEach((c,f)=>{let u=l[f+1],d=l[f-1];c!==A||d===A||(d===void 0?u!==void 0&&u!==A?l[f+1]="(?:\\/|"+s+"\\/)?"+u:l[f]=s:u===void 0?l[f-1]=d+"(?:\\/|"+s+")?":u!==A&&(l[f-1]=d+"(?:\\/|\\/"+s+"\\/)"+u,l[f+1]=A))}),l.filter(c=>c!==A).join("/")}).join("|"),[o,h]=t.length>1?["(?:",")"]:["",""];n="^"+o+n+h+"$",this.negate&&(n="^(?!"+n+").+$");try{this.regexp=new RegExp(n,[...r].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&e)return!0;let s=this.options;this.isWindows&&(t=t.split("\\").join("/"));let r=this.slashSplit(t);this.debug(this.pattern,"split",r);let n=this.set;this.debug(this.pattern,"set",n);let o=r[r.length-1];if(!o)for(let h=r.length-2;!o&&h>=0;h--)o=r[h];for(let h=0;h<n.length;h++){let a=n[h],l=r;if(s.matchBase&&a.length===1&&(l=[o]),this.matchOne(l,a,e))return s.flipNegate?!0:!this.negate}return s.flipNegate?!1:this.negate}static defaults(t){return k.defaults(t).Minimatch}};k.AST=ot;k.Minimatch=F;k.escape=ht;k.unescape=B;import{fileURLToPath as fn}from"node:url";var at=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Ns=new Set,ve=typeof process=="object"&&process?process:{},Cs=(i,t,e,s)=>{typeof ve.emitWarning=="function"?ve.emitWarning(i,t,e,s):console.error(`[${e}] ${t}: ${i}`)},Ut=globalThis.AbortController,As=globalThis.AbortSignal;if(typeof Ut>"u"){As=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(s,r){this._onabort.push(r)}},Ut=class{constructor(){t()}signal=new As;abort(s){if(!this.signal.aborted){this.signal.reason=s,this.signal.aborted=!0;for(let r of this.signal._onabort)r(s);this.signal.onabort?.(s)}}};let i=ve.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{i&&(i=!1,Cs("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}var Fr=i=>!Ns.has(i),Bo=Symbol("type"),Z=i=>i&&i===Math.floor(i)&&i>0&&isFinite(i),ks=i=>Z(i)?i<=Math.pow(2,8)?Uint8Array:i<=Math.pow(2,16)?Uint16Array:i<=Math.pow(2,32)?Uint32Array:i<=Number.MAX_SAFE_INTEGER?lt:null:null,lt=class extends Array{constructor(t){super(t),this.fill(0)}},xe=class i{heap;length;static#t=!1;static create(t){let e=ks(t);if(!e)return[];i.#t=!0;let s=new i(t,e);return i.#t=!1,s}constructor(t,e){if(!i.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},Ot=class i{#t;#e;#n;#i;#o;#b;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#f;#h;#a;#r;#g;#w;#d;#u;#x;#m;#T;#R;#S;#E;#v;#p;static unsafeExposeInternals(t){return{starts:t.#R,ttls:t.#S,sizes:t.#T,keyMap:t.#h,keyList:t.#a,valList:t.#r,next:t.#g,prev:t.#w,get head(){return t.#d},get tail(){return t.#u},free:t.#x,isBackgroundFetch:e=>t.#c(e),backgroundFetch:(e,s,r,n)=>t.#W(e,s,r,n),moveToTail:e=>t.#B(e),indexes:e=>t.#A(e),rindexes:e=>t.#N(e),isStale:e=>t.#y(e)}}get max(){return this.#t}get maxSize(){return this.#e}get calculatedSize(){return this.#f}get size(){return this.#l}get fetchMethod(){return this.#o}get memoMethod(){return this.#b}get dispose(){return this.#n}get disposeAfter(){return this.#i}constructor(t){let{max:e=0,ttl:s,ttlResolution:r=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:h,allowStale:a,dispose:l,disposeAfter:c,noDisposeOnSet:f,noUpdateTTL:u,maxSize:d=0,maxEntrySize:g=0,sizeCalculation:p,fetchMethod:w,memoMethod:m,noDeleteOnFetchRejection:b,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:y,allowStaleOnFetchAbort:E,ignoreFetchAbort:x}=t;if(e!==0&&!Z(e))throw new TypeError("max option must be a nonnegative integer");let W=e?ks(e):Array;if(!W)throw new Error("invalid max value: "+e);if(this.#t=e,this.#e=d,this.maxEntrySize=g||this.#e,this.sizeCalculation=p,this.sizeCalculation){if(!this.#e&&!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(m!==void 0&&typeof m!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#b=m,w!==void 0&&typeof w!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=w,this.#v=!!w,this.#h=new Map,this.#a=new Array(e).fill(void 0),this.#r=new Array(e).fill(void 0),this.#g=new W(e),this.#w=new W(e),this.#d=0,this.#u=0,this.#x=xe.create(e),this.#l=0,this.#f=0,typeof l=="function"&&(this.#n=l),typeof c=="function"?(this.#i=c,this.#m=[]):(this.#i=void 0,this.#m=void 0),this.#E=!!this.#n,this.#p=!!this.#i,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!u,this.noDeleteOnFetchRejection=!!b,this.allowStaleOnFetchRejection=!!y,this.allowStaleOnFetchAbort=!!E,this.ignoreFetchAbort=!!x,this.maxEntrySize!==0){if(this.#e!==0&&!Z(this.#e))throw new TypeError("maxSize must be a positive integer if specified");if(!Z(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#k()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!h,this.ttlResolution=Z(r)||r===0?r:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!Z(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#C()}if(this.#t===0&&this.ttl===0&&this.#e===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#e){let it="LRU_CACHE_UNBOUNDED";Fr(it)&&(Ns.add(it),Cs("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",it,i))}}getRemainingTTL(t){return this.#h.has(t)?1/0:0}#C(){let t=new lt(this.#t),e=new lt(this.#t);this.#S=t,this.#R=e,this.#M=(n,o,h=at.now())=>{if(e[n]=o!==0?h:0,t[n]=o,o!==0&&this.ttlAutopurge){let a=setTimeout(()=>{this.#y(n)&&this.#D(this.#a[n],"expire")},o+1);a.unref&&a.unref()}},this.#O=n=>{e[n]=t[n]!==0?at.now():0},this.#s=(n,o)=>{if(t[o]){let h=t[o],a=e[o];if(!h||!a)return;n.ttl=h,n.start=a,n.now=s||r();let l=n.now-a;n.remainingTTL=h-l}};let s=0,r=()=>{let n=at.now();if(this.ttlResolution>0){s=n;let o=setTimeout(()=>s=0,this.ttlResolution);o.unref&&o.unref()}return n};this.getRemainingTTL=n=>{let o=this.#h.get(n);if(o===void 0)return 0;let h=t[o],a=e[o];if(!h||!a)return 1/0;let l=(s||r())-a;return h-l},this.#y=n=>{let o=e[n],h=t[n];return!!h&&!!o&&(s||r())-o>h}}#O=()=>{};#s=()=>{};#M=()=>{};#y=()=>!1;#k(){let t=new lt(this.#t);this.#f=0,this.#T=t,this.#F=e=>{this.#f-=t[e],t[e]=0},this.#L=(e,s,r,n)=>{if(this.#c(s))return 0;if(!Z(r))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(r=n(s,e),!Z(r))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 r},this.#_=(e,s,r)=>{if(t[e]=s,this.#e){let n=this.#e-t[e];for(;this.#f>n;)this.#I(!0)}this.#f+=t[e],r&&(r.entrySize=s,r.totalCalculatedSize=this.#f)}}#F=t=>{};#_=(t,e,s)=>{};#L=(t,e,s,r)=>{if(s||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:t=this.allowStale}={}){if(this.#l)for(let e=this.#u;!(!this.#P(e)||((t||!this.#y(e))&&(yield e),e===this.#d));)e=this.#w[e]}*#N({allowStale:t=this.allowStale}={}){if(this.#l)for(let e=this.#d;!(!this.#P(e)||((t||!this.#y(e))&&(yield e),e===this.#u));)e=this.#g[e]}#P(t){return t!==void 0&&this.#h.get(this.#a[t])===t}*entries(){for(let t of this.#A())this.#r[t]!==void 0&&this.#a[t]!==void 0&&!this.#c(this.#r[t])&&(yield[this.#a[t],this.#r[t]])}*rentries(){for(let t of this.#N())this.#r[t]!==void 0&&this.#a[t]!==void 0&&!this.#c(this.#r[t])&&(yield[this.#a[t],this.#r[t]])}*keys(){for(let t of this.#A()){let e=this.#a[t];e!==void 0&&!this.#c(this.#r[t])&&(yield e)}}*rkeys(){for(let t of this.#N()){let e=this.#a[t];e!==void 0&&!this.#c(this.#r[t])&&(yield e)}}*values(){for(let t of this.#A())this.#r[t]!==void 0&&!this.#c(this.#r[t])&&(yield this.#r[t])}*rvalues(){for(let t of this.#N())this.#r[t]!==void 0&&!this.#c(this.#r[t])&&(yield this.#r[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(let s of this.#A()){let r=this.#r[s],n=this.#c(r)?r.__staleWhileFetching:r;if(n!==void 0&&t(n,this.#a[s],this))return this.get(this.#a[s],e)}}forEach(t,e=this){for(let s of this.#A()){let r=this.#r[s],n=this.#c(r)?r.__staleWhileFetching:r;n!==void 0&&t.call(e,n,this.#a[s],this)}}rforEach(t,e=this){for(let s of this.#N()){let r=this.#r[s],n=this.#c(r)?r.__staleWhileFetching:r;n!==void 0&&t.call(e,n,this.#a[s],this)}}purgeStale(){let t=!1;for(let e of this.#N({allowStale:!0}))this.#y(e)&&(this.#D(this.#a[e],"expire"),t=!0);return t}info(t){let e=this.#h.get(t);if(e===void 0)return;let s=this.#r[e],r=this.#c(s)?s.__staleWhileFetching:s;if(r===void 0)return;let n={value:r};if(this.#S&&this.#R){let o=this.#S[e],h=this.#R[e];if(o&&h){let a=o-(at.now()-h);n.ttl=a,n.start=Date.now()}}return this.#T&&(n.size=this.#T[e]),n}dump(){let t=[];for(let e of this.#A({allowStale:!0})){let s=this.#a[e],r=this.#r[e],n=this.#c(r)?r.__staleWhileFetching:r;if(n===void 0||s===void 0)continue;let o={value:n};if(this.#S&&this.#R){o.ttl=this.#S[e];let h=at.now()-this.#R[e];o.start=Math.floor(Date.now()-h)}this.#T&&(o.size=this.#T[e]),t.unshift([s,o])}return t}load(t){this.clear();for(let[e,s]of t){if(s.start){let r=Date.now()-s.start;s.start=at.now()-r}this.set(e,s.value,s)}}set(t,e,s={}){if(e===void 0)return this.delete(t),this;let{ttl:r=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:h=this.sizeCalculation,status:a}=s,{noUpdateTTL:l=this.noUpdateTTL}=s,c=this.#L(t,e,s.size||0,h);if(this.maxEntrySize&&c>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#D(t,"set"),this;let f=this.#l===0?void 0:this.#h.get(t);if(f===void 0)f=this.#l===0?this.#u:this.#x.length!==0?this.#x.pop():this.#l===this.#t?this.#I(!1):this.#l,this.#a[f]=t,this.#r[f]=e,this.#h.set(t,f),this.#g[this.#u]=f,this.#w[f]=this.#u,this.#u=f,this.#l++,this.#_(f,c,a),a&&(a.set="add"),l=!1;else{this.#B(f);let u=this.#r[f];if(e!==u){if(this.#v&&this.#c(u)){u.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:d}=u;d!==void 0&&!o&&(this.#E&&this.#n?.(d,t,"set"),this.#p&&this.#m?.push([d,t,"set"]))}else o||(this.#E&&this.#n?.(u,t,"set"),this.#p&&this.#m?.push([u,t,"set"]));if(this.#F(f),this.#_(f,c,a),this.#r[f]=e,a){a.set="replace";let d=u&&this.#c(u)?u.__staleWhileFetching:u;d!==void 0&&(a.oldValue=d)}}else a&&(a.set="update")}if(r!==0&&!this.#S&&this.#C(),this.#S&&(l||this.#M(f,r,n),a&&this.#s(a,f)),!o&&this.#p&&this.#m){let u=this.#m,d;for(;d=u?.shift();)this.#i?.(...d)}return this}pop(){try{for(;this.#l;){let t=this.#r[this.#d];if(this.#I(!0),this.#c(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#p&&this.#m){let t=this.#m,e;for(;e=t?.shift();)this.#i?.(...e)}}}#I(t){let e=this.#d,s=this.#a[e],r=this.#r[e];return this.#v&&this.#c(r)?r.__abortController.abort(new Error("evicted")):(this.#E||this.#p)&&(this.#E&&this.#n?.(r,s,"evict"),this.#p&&this.#m?.push([r,s,"evict"])),this.#F(e),t&&(this.#a[e]=void 0,this.#r[e]=void 0,this.#x.push(e)),this.#l===1?(this.#d=this.#u=0,this.#x.length=0):this.#d=this.#g[e],this.#h.delete(s),this.#l--,e}has(t,e={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:r}=e,n=this.#h.get(t);if(n!==void 0){let o=this.#r[n];if(this.#c(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#y(n))r&&(r.has="stale",this.#s(r,n));else return s&&this.#O(n),r&&(r.has="hit",this.#s(r,n)),!0}else r&&(r.has="miss");return!1}peek(t,e={}){let{allowStale:s=this.allowStale}=e,r=this.#h.get(t);if(r===void 0||!s&&this.#y(r))return;let n=this.#r[r];return this.#c(n)?n.__staleWhileFetching:n}#W(t,e,s,r){let n=e===void 0?void 0:this.#r[e];if(this.#c(n))return n;let o=new Ut,{signal:h}=s;h?.addEventListener("abort",()=>o.abort(h.reason),{signal:o.signal});let a={signal:o.signal,options:s,context:r},l=(p,w=!1)=>{let{aborted:m}=o.signal,b=s.ignoreFetchAbort&&p!==void 0;if(s.status&&(m&&!w?(s.status.fetchAborted=!0,s.status.fetchError=o.signal.reason,b&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),m&&!b&&!w)return f(o.signal.reason);let S=d;return this.#r[e]===d&&(p===void 0?S.__staleWhileFetching?this.#r[e]=S.__staleWhileFetching:this.#D(t,"fetch"):(s.status&&(s.status.fetchUpdated=!0),this.set(t,p,a.options))),p},c=p=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=p),f(p)),f=p=>{let{aborted:w}=o.signal,m=w&&s.allowStaleOnFetchAbort,b=m||s.allowStaleOnFetchRejection,S=b||s.noDeleteOnFetchRejection,y=d;if(this.#r[e]===d&&(!S||y.__staleWhileFetching===void 0?this.#D(t,"fetch"):m||(this.#r[e]=y.__staleWhileFetching)),b)return s.status&&y.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),y.__staleWhileFetching;if(y.__returned===y)throw p},u=(p,w)=>{let m=this.#o?.(t,n,a);m&&m instanceof Promise&&m.then(b=>p(b===void 0?void 0:b),w),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(p(void 0),s.allowStaleOnFetchAbort&&(p=b=>l(b,!0)))})};s.status&&(s.status.fetchDispatched=!0);let d=new Promise(u).then(l,c),g=Object.assign(d,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.set(t,g,{...a.options,status:void 0}),e=this.#h.get(t)):this.#r[e]=g,g}#c(t){if(!this.#v)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof Ut}async fetch(t,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:a=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:p,forceRefresh:w=!1,status:m,signal:b}=e;if(!this.#v)return m&&(m.fetch="get"),this.get(t,{allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,status:m});let S={allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:h,size:a,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:g,ignoreFetchAbort:d,status:m,signal:b},y=this.#h.get(t);if(y===void 0){m&&(m.fetch="miss");let E=this.#W(t,y,S,p);return E.__returned=E}else{let E=this.#r[y];if(this.#c(E)){let Bt=s&&E.__staleWhileFetching!==void 0;return m&&(m.fetch="inflight",Bt&&(m.returnedStale=!0)),Bt?E.__staleWhileFetching:E.__returned=E}let x=this.#y(y);if(!w&&!x)return m&&(m.fetch="hit"),this.#B(y),r&&this.#O(y),m&&this.#s(m,y),E;let W=this.#W(t,y,S,p),j=W.__staleWhileFetching!==void 0&&s;return m&&(m.fetch=x?"stale":"refresh",j&&x&&(m.returnedStale=!0)),j?W.__staleWhileFetching:W.__returned=W}}async forceFetch(t,e={}){let s=await this.fetch(t,e);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(t,e={}){let s=this.#b;if(!s)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:n,...o}=e,h=this.get(t,o);if(!n&&h!==void 0)return h;let a=s(t,h,{options:o,context:r});return this.set(t,a,o),a}get(t,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=e,h=this.#h.get(t);if(h!==void 0){let a=this.#r[h],l=this.#c(a);return o&&this.#s(o,h),this.#y(h)?(o&&(o.get="stale"),l?(o&&s&&a.__staleWhileFetching!==void 0&&(o.returnedStale=!0),s?a.__staleWhileFetching:void 0):(n||this.#D(t,"expire"),o&&s&&(o.returnedStale=!0),s?a:void 0)):(o&&(o.get="hit"),l?a.__staleWhileFetching:(this.#B(h),r&&this.#O(h),a))}else o&&(o.get="miss")}#j(t,e){this.#w[e]=t,this.#g[t]=e}#B(t){t!==this.#u&&(t===this.#d?this.#d=this.#g[t]:this.#j(this.#w[t],this.#g[t]),this.#j(this.#u,t),this.#u=t)}delete(t){return this.#D(t,"delete")}#D(t,e){let s=!1;if(this.#l!==0){let r=this.#h.get(t);if(r!==void 0)if(s=!0,this.#l===1)this.#z(e);else{this.#F(r);let n=this.#r[r];if(this.#c(n)?n.__abortController.abort(new Error("deleted")):(this.#E||this.#p)&&(this.#E&&this.#n?.(n,t,e),this.#p&&this.#m?.push([n,t,e])),this.#h.delete(t),this.#a[r]=void 0,this.#r[r]=void 0,r===this.#u)this.#u=this.#w[r];else if(r===this.#d)this.#d=this.#g[r];else{let o=this.#w[r];this.#g[o]=this.#g[r];let h=this.#g[r];this.#w[h]=this.#w[r]}this.#l--,this.#x.push(r)}}if(this.#p&&this.#m?.length){let r=this.#m,n;for(;n=r?.shift();)this.#i?.(...n)}return s}clear(){return this.#z("delete")}#z(t){for(let e of this.#N({allowStale:!0})){let s=this.#r[e];if(this.#c(s))s.__abortController.abort(new Error("deleted"));else{let r=this.#a[e];this.#E&&this.#n?.(s,r,t),this.#p&&this.#m?.push([s,r,t])}}if(this.#h.clear(),this.#r.fill(void 0),this.#a.fill(void 0),this.#S&&this.#R&&(this.#S.fill(0),this.#R.fill(0)),this.#T&&this.#T.fill(0),this.#d=0,this.#u=0,this.#x.length=0,this.#f=0,this.#l=0,this.#p&&this.#m){let e=this.#m,s;for(;s=e?.shift();)this.#i?.(...s)}}};import{posix as Gr,win32 as Fe}from"node:path";import{fileURLToPath as Hr}from"node:url";import{lstatSync as Vr,readdir as qr,readdirSync as Kr,readlinkSync as Yr,realpathSync as Xr}from"fs";import*as Jr from"node:fs";import{lstat as Qr,readdir as tn,readlink as en,realpath as sn}from"node:fs/promises";import{EventEmitter as ke}from"node:events";import Ls from"node:stream";import{StringDecoder as _r}from"node:string_decoder";var Ds=typeof process=="object"&&process?process:{stdout:null,stderr:null},Lr=i=>!!i&&typeof i=="object"&&(i instanceof tt||i instanceof Ls||Pr(i)||Ir(i)),Pr=i=>!!i&&typeof i=="object"&&i instanceof ke&&typeof i.pipe=="function"&&i.pipe!==Ls.Writable.prototype.pipe,Ir=i=>!!i&&typeof i=="object"&&i instanceof ke&&typeof i.write=="function"&&typeof i.end=="function",q=Symbol("EOF"),K=Symbol("maybeEmitEnd"),Q=Symbol("emittedEnd"),$t=Symbol("emittingEnd"),At=Symbol("emittedError"),Gt=Symbol("closed"),Ms=Symbol("read"),Ht=Symbol("flush"),Fs=Symbol("flushChunk"),z=Symbol("encoding"),ct=Symbol("decoder"),T=Symbol("flowing"),Nt=Symbol("paused"),ft=Symbol("resume"),R=Symbol("buffer"),D=Symbol("pipes"),O=Symbol("bufferLength"),Te=Symbol("bufferPush"),Vt=Symbol("bufferShift"),N=Symbol("objectMode"),v=Symbol("destroyed"),Re=Symbol("error"),Oe=Symbol("emitData"),_s=Symbol("emitEnd"),Ae=Symbol("emitEnd2"),H=Symbol("async"),Ne=Symbol("abort"),qt=Symbol("aborted"),Ct=Symbol("signal"),rt=Symbol("dataListeners"),_=Symbol("discarded"),kt=i=>Promise.resolve().then(i),Wr=i=>i(),jr=i=>i==="end"||i==="finish"||i==="prefinish",Br=i=>i instanceof ArrayBuffer||!!i&&typeof i=="object"&&i.constructor&&i.constructor.name==="ArrayBuffer"&&i.byteLength>=0,zr=i=>!Buffer.isBuffer(i)&&ArrayBuffer.isView(i),Kt=class{src;dest;opts;ondrain;constructor(t,e,s){this.src=t,this.dest=e,this.opts=s,this.ondrain=()=>t[ft](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Ce=class extends Kt{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,e,s){super(t,e,s),this.proxyErrors=r=>e.emit("error",r),t.on("error",this.proxyErrors)}},Ur=i=>!!i.objectMode,$r=i=>!i.objectMode&&!!i.encoding&&i.encoding!=="buffer",tt=class extends ke{[T]=!1;[Nt]=!1;[D]=[];[R]=[];[N];[z];[H];[ct];[q]=!1;[Q]=!1;[$t]=!1;[Gt]=!1;[At]=null;[O]=0;[v]=!1;[Ct];[qt]=!1;[rt]=0;[_]=!1;writable=!0;readable=!0;constructor(...t){let e=t[0]||{};if(super(),e.objectMode&&typeof e.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");Ur(e)?(this[N]=!0,this[z]=null):$r(e)?(this[z]=e.encoding,this[N]=!1):(this[N]=!1,this[z]=null),this[H]=!!e.async,this[ct]=this[z]?new _r(this[z]):null,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[R]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[D]});let{signal:s}=e;s&&(this[Ct]=s,s.aborted?this[Ne]():s.addEventListener("abort",()=>this[Ne]()))}get bufferLength(){return this[O]}get encoding(){return this[z]}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[N]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[H]}set async(t){this[H]=this[H]||!!t}[Ne](){this[qt]=!0,this.emit("abort",this[Ct]?.reason),this.destroy(this[Ct]?.reason)}get aborted(){return this[qt]}set aborted(t){}write(t,e,s){if(this[qt])return!1;if(this[q])throw new Error("write after end");if(this[v])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof e=="function"&&(s=e,e="utf8"),e||(e="utf8");let r=this[H]?kt:Wr;if(!this[N]&&!Buffer.isBuffer(t)){if(zr(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(Br(t))t=Buffer.from(t);else if(typeof t!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[N]?(this[T]&&this[O]!==0&&this[Ht](!0),this[T]?this.emit("data",t):this[Te](t),this[O]!==0&&this.emit("readable"),s&&r(s),this[T]):t.length?(typeof t=="string"&&!(e===this[z]&&!this[ct]?.lastNeed)&&(t=Buffer.from(t,e)),Buffer.isBuffer(t)&&this[z]&&(t=this[ct].write(t)),this[T]&&this[O]!==0&&this[Ht](!0),this[T]?this.emit("data",t):this[Te](t),this[O]!==0&&this.emit("readable"),s&&r(s),this[T]):(this[O]!==0&&this.emit("readable"),s&&r(s),this[T])}read(t){if(this[v])return null;if(this[_]=!1,this[O]===0||t===0||t&&t>this[O])return this[K](),null;this[N]&&(t=null),this[R].length>1&&!this[N]&&(this[R]=[this[z]?this[R].join(""):Buffer.concat(this[R],this[O])]);let e=this[Ms](t||null,this[R][0]);return this[K](),e}[Ms](t,e){if(this[N])this[Vt]();else{let s=e;t===s.length||t===null?this[Vt]():typeof s=="string"?(this[R][0]=s.slice(t),e=s.slice(0,t),this[O]-=t):(this[R][0]=s.subarray(t),e=s.subarray(0,t),this[O]-=t)}return this.emit("data",e),!this[R].length&&!this[q]&&this.emit("drain"),e}end(t,e,s){return typeof t=="function"&&(s=t,t=void 0),typeof e=="function"&&(s=e,e="utf8"),t!==void 0&&this.write(t,e),s&&this.once("end",s),this[q]=!0,this.writable=!1,(this[T]||!this[Nt])&&this[K](),this}[ft](){this[v]||(!this[rt]&&!this[D].length&&(this[_]=!0),this[Nt]=!1,this[T]=!0,this.emit("resume"),this[R].length?this[Ht]():this[q]?this[K]():this.emit("drain"))}resume(){return this[ft]()}pause(){this[T]=!1,this[Nt]=!0,this[_]=!1}get destroyed(){return this[v]}get flowing(){return this[T]}get paused(){return this[Nt]}[Te](t){this[N]?this[O]+=1:this[O]+=t.length,this[R].push(t)}[Vt](){return this[N]?this[O]-=1:this[O]-=this[R][0].length,this[R].shift()}[Ht](t=!1){do;while(this[Fs](this[Vt]())&&this[R].length);!t&&!this[R].length&&!this[q]&&this.emit("drain")}[Fs](t){return this.emit("data",t),this[T]}pipe(t,e){if(this[v])return t;this[_]=!1;let s=this[Q];return e=e||{},t===Ds.stdout||t===Ds.stderr?e.end=!1:e.end=e.end!==!1,e.proxyErrors=!!e.proxyErrors,s?e.end&&t.end():(this[D].push(e.proxyErrors?new Ce(this,t,e):new Kt(this,t,e)),this[H]?kt(()=>this[ft]()):this[ft]()),t}unpipe(t){let e=this[D].find(s=>s.dest===t);e&&(this[D].length===1?(this[T]&&this[rt]===0&&(this[T]=!1),this[D]=[]):this[D].splice(this[D].indexOf(e),1),e.unpipe())}addListener(t,e){return this.on(t,e)}on(t,e){let s=super.on(t,e);if(t==="data")this[_]=!1,this[rt]++,!this[D].length&&!this[T]&&this[ft]();else if(t==="readable"&&this[O]!==0)super.emit("readable");else if(jr(t)&&this[Q])super.emit(t),this.removeAllListeners(t);else if(t==="error"&&this[At]){let r=e;this[H]?kt(()=>r.call(this,this[At])):r.call(this,this[At])}return s}removeListener(t,e){return this.off(t,e)}off(t,e){let s=super.off(t,e);return t==="data"&&(this[rt]=this.listeners("data").length,this[rt]===0&&!this[_]&&!this[D].length&&(this[T]=!1)),s}removeAllListeners(t){let e=super.removeAllListeners(t);return(t==="data"||t===void 0)&&(this[rt]=0,!this[_]&&!this[D].length&&(this[T]=!1)),e}get emittedEnd(){return this[Q]}[K](){!this[$t]&&!this[Q]&&!this[v]&&this[R].length===0&&this[q]&&(this[$t]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Gt]&&this.emit("close"),this[$t]=!1)}emit(t,...e){let s=e[0];if(t!=="error"&&t!=="close"&&t!==v&&this[v])return!1;if(t==="data")return!this[N]&&!s?!1:this[H]?(kt(()=>this[Oe](s)),!0):this[Oe](s);if(t==="end")return this[_s]();if(t==="close"){if(this[Gt]=!0,!this[Q]&&!this[v])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(t==="error"){this[At]=s,super.emit(Re,s);let n=!this[Ct]||this.listeners("error").length?super.emit("error",s):!1;return this[K](),n}else if(t==="resume"){let n=super.emit("resume");return this[K](),n}else if(t==="finish"||t==="prefinish"){let n=super.emit(t);return this.removeAllListeners(t),n}let r=super.emit(t,...e);return this[K](),r}[Oe](t){for(let s of this[D])s.dest.write(t)===!1&&this.pause();let e=this[_]?!1:super.emit("data",t);return this[K](),e}[_s](){return this[Q]?!1:(this[Q]=!0,this.readable=!1,this[H]?(kt(()=>this[Ae]()),!0):this[Ae]())}[Ae](){if(this[ct]){let e=this[ct].end();if(e){for(let s of this[D])s.dest.write(e);this[_]||super.emit("data",e)}}for(let e of this[D])e.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[N]||(t.dataLength=0);let e=this.promise();return this.on("data",s=>{t.push(s),this[N]||(t.dataLength+=s.length)}),await e,t}async concat(){if(this[N])throw new Error("cannot concat in objectMode");let t=await this.collect();return this[z]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,e)=>{this.on(v,()=>e(new Error("stream destroyed"))),this.on("error",s=>e(s)),this.on("end",()=>t())})}[Symbol.asyncIterator](){this[_]=!1;let t=!1,e=async()=>(this.pause(),t=!0,{value:void 0,done:!0});return{next:()=>{if(t)return e();let r=this.read();if(r!==null)return Promise.resolve({done:!1,value:r});if(this[q])return e();let n,o,h=f=>{this.off("data",a),this.off("end",l),this.off(v,c),e(),o(f)},a=f=>{this.off("error",h),this.off("end",l),this.off(v,c),this.pause(),n({value:f,done:!!this[q]})},l=()=>{this.off("error",h),this.off("data",a),this.off(v,c),e(),n({done:!0,value:void 0})},c=()=>h(new Error("stream destroyed"));return new Promise((f,u)=>{o=u,n=f,this.once(v,c),this.once("error",h),this.once("end",l),this.once("data",a)})},throw:e,return:e,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[_]=!1;let t=!1,e=()=>(this.pause(),this.off(Re,e),this.off(v,e),this.off("end",e),t=!0,{done:!0,value:void 0}),s=()=>{if(t)return e();let r=this.read();return r===null?e():{done:!1,value:r}};return this.once("end",e),this.once(Re,e),this.once(v,e),{next:s,throw:e,return:e,[Symbol.iterator](){return this}}}destroy(t){if(this[v])return t?this.emit("error",t):this.emit(v),this;this[v]=!0,this[_]=!0,this[R].length=0,this[O]=0;let e=this;return typeof e.close=="function"&&!this[Gt]&&e.close(),t?this.emit("error",t):this.emit(v),this}static get isStream(){return Lr}};var Zr=Xr.native,Mt={lstatSync:Vr,readdir:qr,readdirSync:Kr,readlinkSync:Yr,realpathSync:Zr,promises:{lstat:Qr,readdir:tn,readlink:en,realpath:sn}},Bs=i=>!i||i===Mt||i===Jr?Mt:{...Mt,...i,promises:{...Mt.promises,...i.promises||{}}},zs=/^\\\\\?\\([a-z]:)\\?$/i,rn=i=>i.replace(/\//g,"\\").replace(zs,"$1\\"),nn=/[\\\/]/,I=0,Us=1,$s=2,V=4,Gs=6,Hs=8,nt=10,Vs=12,P=15,Dt=~P,De=16,Ps=32,Ft=64,U=128,Yt=256,Jt=512,Is=Ft|U|Jt,on=1023,Me=i=>i.isFile()?Hs:i.isDirectory()?V:i.isSymbolicLink()?nt:i.isCharacterDevice()?$s:i.isBlockDevice()?Gs:i.isSocket()?Vs:i.isFIFO()?Us:I,Ws=new Map,_t=i=>{let t=Ws.get(i);if(t)return t;let e=i.normalize("NFKD");return Ws.set(i,e),e},js=new Map,Xt=i=>{let t=js.get(i);if(t)return t;let e=_t(i.toLowerCase());return js.set(i,e),e},Zt=class extends Ot{constructor(){super({max:256})}},_e=class extends Ot{constructor(t=16*1024){super({maxSize:t,sizeCalculation:e=>e.length+1})}},qs=Symbol("PathScurry setAsCwd"),C=class{name;root;roots;parent;nocase;isCWD=!1;#t;#e;get dev(){return this.#e}#n;get mode(){return this.#n}#i;get nlink(){return this.#i}#o;get uid(){return this.#o}#b;get gid(){return this.#b}#l;get rdev(){return this.#l}#f;get blksize(){return this.#f}#h;get ino(){return this.#h}#a;get size(){return this.#a}#r;get blocks(){return this.#r}#g;get atimeMs(){return this.#g}#w;get mtimeMs(){return this.#w}#d;get ctimeMs(){return this.#d}#u;get birthtimeMs(){return this.#u}#x;get atime(){return this.#x}#m;get mtime(){return this.#m}#T;get ctime(){return this.#T}#R;get birthtime(){return this.#R}#S;#E;#v;#p;#C;#O;#s;#M;#y;#k;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(t,e=I,s,r,n,o,h){this.name=t,this.#S=n?Xt(t):_t(t),this.#s=e&on,this.nocase=n,this.roots=r,this.root=s||this,this.#M=o,this.#v=h.fullpath,this.#C=h.relative,this.#O=h.relativePosix,this.parent=h.parent,this.parent?this.#t=this.parent.#t:this.#t=Bs(h.fs)}depth(){return this.#E!==void 0?this.#E:this.parent?this.#E=this.parent.depth()+1:this.#E=0}childrenCache(){return this.#M}resolve(t){if(!t)return this;let e=this.getRootString(t),r=t.substring(e.length).split(this.splitSep);return e?this.getRoot(e).#F(r):this.#F(r)}#F(t){let e=this;for(let s of t)e=e.child(s);return e}children(){let t=this.#M.get(this);if(t)return t;let e=Object.assign([],{provisional:0});return this.#M.set(this,e),this.#s&=~De,e}child(t,e){if(t===""||t===".")return this;if(t==="..")return this.parent||this;let s=this.children(),r=this.nocase?Xt(t):_t(t);for(let a of s)if(a.#S===r)return a;let n=this.parent?this.sep:"",o=this.#v?this.#v+n+t:void 0,h=this.newChild(t,I,{...e,parent:this,fullpath:o});return this.canReaddir()||(h.#s|=U),s.push(h),h}relative(){if(this.isCWD)return"";if(this.#C!==void 0)return this.#C;let t=this.name,e=this.parent;if(!e)return this.#C=this.name;let s=e.relative();return s+(!s||!e.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#O!==void 0)return this.#O;let t=this.name,e=this.parent;if(!e)return this.#O=this.fullpathPosix();let s=e.relativePosix();return s+(!s||!e.parent?"":"/")+t}fullpath(){if(this.#v!==void 0)return this.#v;let t=this.name,e=this.parent;if(!e)return this.#v=this.name;let r=e.fullpath()+(e.parent?this.sep:"")+t;return this.#v=r}fullpathPosix(){if(this.#p!==void 0)return this.#p;if(this.sep==="/")return this.#p=this.fullpath();if(!this.parent){let r=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(r)?this.#p=`//?/${r}`:this.#p=r}let t=this.parent,e=t.fullpathPosix(),s=e+(!e||!t.parent?"":"/")+this.name;return this.#p=s}isUnknown(){return(this.#s&P)===I}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.#s&P)===Hs}isDirectory(){return(this.#s&P)===V}isCharacterDevice(){return(this.#s&P)===$s}isBlockDevice(){return(this.#s&P)===Gs}isFIFO(){return(this.#s&P)===Us}isSocket(){return(this.#s&P)===Vs}isSymbolicLink(){return(this.#s&nt)===nt}lstatCached(){return this.#s&Ps?this:void 0}readlinkCached(){return this.#y}realpathCached(){return this.#k}readdirCached(){let t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(this.#y)return!0;if(!this.parent)return!1;let t=this.#s&P;return!(t!==I&&t!==nt||this.#s&Yt||this.#s&U)}calledReaddir(){return!!(this.#s&De)}isENOENT(){return!!(this.#s&U)}isNamed(t){return this.nocase?this.#S===Xt(t):this.#S===_t(t)}async readlink(){let t=this.#y;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=await this.#t.promises.readlink(this.fullpath()),s=(await this.parent.realpath())?.resolve(e);if(s)return this.#y=s}catch(e){this.#c(e.code);return}}readlinkSync(){let t=this.#y;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=this.#t.readlinkSync(this.fullpath()),s=this.parent.realpathSync()?.resolve(e);if(s)return this.#y=s}catch(e){this.#c(e.code);return}}#_(t){this.#s|=De;for(let e=t.provisional;e<t.length;e++){let s=t[e];s&&s.#L()}}#L(){this.#s&U||(this.#s=(this.#s|U)&Dt,this.#A())}#A(){let t=this.children();t.provisional=0;for(let e of t)e.#L()}#N(){this.#s|=Jt,this.#P()}#P(){if(this.#s&Ft)return;let t=this.#s;(t&P)===V&&(t&=Dt),this.#s=t|Ft,this.#A()}#I(t=""){t==="ENOTDIR"||t==="EPERM"?this.#P():t==="ENOENT"?this.#L():this.children().provisional=0}#W(t=""){t==="ENOTDIR"?this.parent.#P():t==="ENOENT"&&this.#L()}#c(t=""){let e=this.#s;e|=Yt,t==="ENOENT"&&(e|=U),(t==="EINVAL"||t==="UNKNOWN")&&(e&=Dt),this.#s=e,t==="ENOTDIR"&&this.parent&&this.parent.#P()}#j(t,e){return this.#D(t,e)||this.#B(t,e)}#B(t,e){let s=Me(t),r=this.newChild(t.name,s,{parent:this}),n=r.#s&P;return n!==V&&n!==nt&&n!==I&&(r.#s|=Ft),e.unshift(r),e.provisional++,r}#D(t,e){for(let s=e.provisional;s<e.length;s++){let r=e[s];if((this.nocase?Xt(t.name):_t(t.name))===r.#S)return this.#z(t,r,s,e)}}#z(t,e,s,r){let n=e.name;return e.#s=e.#s&Dt|Me(t),n!==t.name&&(e.name=t.name),s!==r.provisional&&(s===r.length-1?r.pop():r.splice(s,1),r.unshift(e)),r.provisional++,e}async lstat(){if(!(this.#s&U))try{return this.#H(await this.#t.promises.lstat(this.fullpath())),this}catch(t){this.#W(t.code)}}lstatSync(){if(!(this.#s&U))try{return this.#H(this.#t.lstatSync(this.fullpath())),this}catch(t){this.#W(t.code)}}#H(t){let{atime:e,atimeMs:s,birthtime:r,birthtimeMs:n,blksize:o,blocks:h,ctime:a,ctimeMs:l,dev:c,gid:f,ino:u,mode:d,mtime:g,mtimeMs:p,nlink:w,rdev:m,size:b,uid:S}=t;this.#x=e,this.#g=s,this.#R=r,this.#u=n,this.#f=o,this.#r=h,this.#T=a,this.#d=l,this.#e=c,this.#b=f,this.#h=u,this.#n=d,this.#m=g,this.#w=p,this.#i=w,this.#l=m,this.#a=b,this.#o=S;let y=Me(t);this.#s=this.#s&Dt|y|Ps,y!==I&&y!==V&&y!==nt&&(this.#s|=Ft)}#$=[];#G=!1;#V(t){this.#G=!1;let e=this.#$.slice();this.#$.length=0,e.forEach(s=>s(null,t))}readdirCB(t,e=!1){if(!this.canReaddir()){e?t(null,[]):queueMicrotask(()=>t(null,[]));return}let s=this.children();if(this.calledReaddir()){let n=s.slice(0,s.provisional);e?t(null,n):queueMicrotask(()=>t(null,n));return}if(this.#$.push(t),this.#G)return;this.#G=!0;let r=this.fullpath();this.#t.readdir(r,{withFileTypes:!0},(n,o)=>{if(n)this.#I(n.code),s.provisional=0;else{for(let h of o)this.#j(h,s);this.#_(s)}this.#V(s.slice(0,s.provisional))})}#U;async readdir(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();if(this.#U)await this.#U;else{let s=()=>{};this.#U=new Promise(r=>s=r);try{for(let r of await this.#t.promises.readdir(e,{withFileTypes:!0}))this.#j(r,t);this.#_(t)}catch(r){this.#I(r.code),t.provisional=0}this.#U=void 0,s()}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();try{for(let s of this.#t.readdirSync(e,{withFileTypes:!0}))this.#j(s,t);this.#_(t)}catch(s){this.#I(s.code),t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(this.#s&Is)return!1;let t=P&this.#s;return t===I||t===V||t===nt}shouldWalk(t,e){return(this.#s&V)===V&&!(this.#s&Is)&&!t.has(this)&&(!e||e(this))}async realpath(){if(this.#k)return this.#k;if(!((Jt|Yt|U)&this.#s))try{let t=await this.#t.promises.realpath(this.fullpath());return this.#k=this.resolve(t)}catch{this.#N()}}realpathSync(){if(this.#k)return this.#k;if(!((Jt|Yt|U)&this.#s))try{let t=this.#t.realpathSync(this.fullpath());return this.#k=this.resolve(t)}catch{this.#N()}}[qs](t){if(t===this)return;t.isCWD=!1,this.isCWD=!0;let e=new Set([]),s=[],r=this;for(;r&&r.parent;)e.add(r),r.#C=s.join(this.sep),r.#O=s.join("/"),r=r.parent,s.push("..");for(r=t;r&&r.parent&&!e.has(r);)r.#C=void 0,r.#O=void 0,r=r.parent}},Qt=class i extends C{sep="\\";splitSep=nn;constructor(t,e=I,s,r,n,o,h){super(t,e,s,r,n,o,h)}newChild(t,e=I,s={}){return new i(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}getRootString(t){return Fe.parse(t).root}getRoot(t){if(t=rn(t.toUpperCase()),t===this.root.name)return this.root;for(let[e,s]of Object.entries(this.roots))if(this.sameRoot(t,e))return this.roots[t]=s;return this.roots[t]=new ut(t,this).root}sameRoot(t,e=this.root.name){return t=t.toUpperCase().replace(/\//g,"\\").replace(zs,"$1\\"),t===e}},te=class i extends C{splitSep="/";sep="/";constructor(t,e=I,s,r,n,o,h){super(t,e,s,r,n,o,h)}getRootString(t){return t.startsWith("/")?"/":""}getRoot(t){return this.root}newChild(t,e=I,s={}){return new i(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}},ee=class{root;rootPath;roots;cwd;#t;#e;#n;nocase;#i;constructor(t=process.cwd(),e,s,{nocase:r,childrenCacheSize:n=16*1024,fs:o=Mt}={}){this.#i=Bs(o),(t instanceof URL||t.startsWith("file://"))&&(t=Hr(t));let h=e.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(h),this.#t=new Zt,this.#e=new Zt,this.#n=new _e(n);let a=h.substring(this.rootPath.length).split(s);if(a.length===1&&!a[0]&&a.pop(),r===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=r,this.root=this.newRoot(this.#i),this.roots[this.rootPath]=this.root;let l=this.root,c=a.length-1,f=e.sep,u=this.rootPath,d=!1;for(let g of a){let p=c--;l=l.child(g,{relative:new Array(p).fill("..").join(f),relativePosix:new Array(p).fill("..").join("/"),fullpath:u+=(d?"":f)+g}),d=!0}this.cwd=l}depth(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return this.#n}resolve(...t){let e="";for(let n=t.length-1;n>=0;n--){let o=t[n];if(!(!o||o===".")&&(e=e?`${o}/${e}`:o,this.isAbsolute(o)))break}let s=this.#t.get(e);if(s!==void 0)return s;let r=this.cwd.resolve(e).fullpath();return this.#t.set(e,r),r}resolvePosix(...t){let e="";for(let n=t.length-1;n>=0;n--){let o=t[n];if(!(!o||o===".")&&(e=e?`${o}/${e}`:o,this.isAbsolute(o)))break}let s=this.#e.get(e);if(s!==void 0)return s;let r=this.cwd.resolve(e).fullpathPosix();return this.#e.set(e,r),r}relative(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relative()}relativePosix(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relativePosix()}basename(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.name}dirname(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),(t.parent||t).fullpath()}async readdir(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof C||(e=t,t=this.cwd);let{withFileTypes:s}=e;if(t.canReaddir()){let r=await t.readdir();return s?r:r.map(n=>n.name)}else return[]}readdirSync(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof C||(e=t,t=this.cwd);let{withFileTypes:s=!0}=e;return t.canReaddir()?s?t.readdirSync():t.readdirSync().map(r=>r.name):[]}async lstat(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstat()}lstatSync(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof C||(e=t.withFileTypes,t=this.cwd);let s=await t.readlink();return e?s:s?.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof C||(e=t.withFileTypes,t=this.cwd);let s=t.readlinkSync();return e?s:s?.fullpath()}async realpath(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof C||(e=t.withFileTypes,t=this.cwd);let s=await t.realpath();return e?s:s?.fullpath()}realpathSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof C||(e=t.withFileTypes,t=this.cwd);let s=t.realpathSync();return e?s:s?.fullpath()}async walk(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof C||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:r=!1,filter:n,walkFilter:o}=e,h=[];(!n||n(t))&&h.push(s?t:t.fullpath());let a=new Set,l=(f,u)=>{a.add(f),f.readdirCB((d,g)=>{if(d)return u(d);let p=g.length;if(!p)return u();let w=()=>{--p===0&&u()};for(let m of g)(!n||n(m))&&h.push(s?m:m.fullpath()),r&&m.isSymbolicLink()?m.realpath().then(b=>b?.isUnknown()?b.lstat():b).then(b=>b?.shouldWalk(a,o)?l(b,w):w()):m.shouldWalk(a,o)?l(m,w):w()},!0)},c=t;return new Promise((f,u)=>{l(c,d=>{if(d)return u(d);f(h)})})}walkSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof C||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:r=!1,filter:n,walkFilter:o}=e,h=[];(!n||n(t))&&h.push(s?t:t.fullpath());let a=new Set([t]);for(let l of a){let c=l.readdirSync();for(let f of c){(!n||n(f))&&h.push(s?f:f.fullpath());let u=f;if(f.isSymbolicLink()){if(!(r&&(u=f.realpathSync())))continue;u.isUnknown()&&u.lstatSync()}u.shouldWalk(a,o)&&a.add(u)}}return h}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,e={}){return typeof t=="string"?t=this.cwd.resolve(t):t instanceof C||(e=t,t=this.cwd),this.stream(t,e)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof C||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:r=!1,filter:n,walkFilter:o}=e;(!n||n(t))&&(yield s?t:t.fullpath());let h=new Set([t]);for(let a of h){let l=a.readdirSync();for(let c of l){(!n||n(c))&&(yield s?c:c.fullpath());let f=c;if(c.isSymbolicLink()){if(!(r&&(f=c.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(h,o)&&h.add(f)}}}stream(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof C||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:r=!1,filter:n,walkFilter:o}=e,h=new tt({objectMode:!0});(!n||n(t))&&h.write(s?t:t.fullpath());let a=new Set,l=[t],c=0,f=()=>{let u=!1;for(;!u;){let d=l.shift();if(!d){c===0&&h.end();return}c++,a.add(d);let g=(w,m,b=!1)=>{if(w)return h.emit("error",w);if(r&&!b){let S=[];for(let y of m)y.isSymbolicLink()&&S.push(y.realpath().then(E=>E?.isUnknown()?E.lstat():E));if(S.length){Promise.all(S).then(()=>g(null,m,!0));return}}for(let S of m)S&&(!n||n(S))&&(h.write(s?S:S.fullpath())||(u=!0));c--;for(let S of m){let y=S.realpathCached()||S;y.shouldWalk(a,o)&&l.push(y)}u&&!h.flowing?h.once("drain",f):p||f()},p=!0;d.readdirCB(g,!0),p=!1}};return f(),h}streamSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof C||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:r=!1,filter:n,walkFilter:o}=e,h=new tt({objectMode:!0}),a=new Set;(!n||n(t))&&h.write(s?t:t.fullpath());let l=[t],c=0,f=()=>{let u=!1;for(;!u;){let d=l.shift();if(!d){c===0&&h.end();return}c++,a.add(d);let g=d.readdirSync();for(let p of g)(!n||n(p))&&(h.write(s?p:p.fullpath())||(u=!0));c--;for(let p of g){let w=p;if(p.isSymbolicLink()){if(!(r&&(w=p.realpathSync())))continue;w.isUnknown()&&w.lstatSync()}w.shouldWalk(a,o)&&l.push(w)}}u&&!h.flowing&&h.once("drain",f)};return f(),h}chdir(t=this.cwd){let e=this.cwd;this.cwd=typeof t=="string"?this.cwd.resolve(t):t,this.cwd[qs](e)}},ut=class extends ee{sep="\\";constructor(t=process.cwd(),e={}){let{nocase:s=!0}=e;super(t,Fe,"\\",{...e,nocase:s}),this.nocase=s;for(let r=this.cwd;r;r=r.parent)r.nocase=this.nocase}parseRootPath(t){return Fe.parse(t).root.toUpperCase()}newRoot(t){return new Qt(this.rootPath,V,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}},dt=class extends ee{sep="/";constructor(t=process.cwd(),e={}){let{nocase:s=!1}=e;super(t,Gr,"/",{...e,nocase:s}),this.nocase=s}parseRootPath(t){return"/"}newRoot(t){return new te(this.rootPath,V,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}},Lt=class extends dt{constructor(t=process.cwd(),e={}){let{nocase:s=!0}=e;super(t,{...e,nocase:s})}},Zo=process.platform==="win32"?Qt:te,Ks=process.platform==="win32"?ut:process.platform==="darwin"?Lt:dt;var hn=i=>i.length>=1,an=i=>i.length>=1,pt=class i{#t;#e;#n;length;#i;#o;#b;#l;#f;#h;#a=!0;constructor(t,e,s,r){if(!hn(t))throw new TypeError("empty pattern list");if(!an(e))throw new TypeError("empty glob list");if(e.length!==t.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=t.length,s<0||s>=this.length)throw new TypeError("index out of range");if(this.#t=t,this.#e=e,this.#n=s,this.#i=r,this.#n===0){if(this.isUNC()){let[n,o,h,a,...l]=this.#t,[c,f,u,d,...g]=this.#e;l[0]===""&&(l.shift(),g.shift());let p=[n,o,h,a,""].join("/"),w=[c,f,u,d,""].join("/");this.#t=[p,...l],this.#e=[w,...g],this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){let[n,...o]=this.#t,[h,...a]=this.#e;o[0]===""&&(o.shift(),a.shift());let l=n+"/",c=h+"/";this.#t=[l,...o],this.#e=[c,...a],this.length=this.#t.length}}}pattern(){return this.#t[this.#n]}isString(){return typeof this.#t[this.#n]=="string"}isGlobstar(){return this.#t[this.#n]===A}isRegExp(){return this.#t[this.#n]instanceof RegExp}globString(){return this.#b=this.#b||(this.#n===0?this.isAbsolute()?this.#e[0]+this.#e.slice(1).join("/"):this.#e.join("/"):this.#e.slice(this.#n).join("/"))}hasMore(){return this.length>this.#n+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new i(this.#t,this.#e,this.#n+1,this.#i),this.#o.#h=this.#h,this.#o.#f=this.#f,this.#o.#l=this.#l,this.#o):this.#o=null}isUNC(){let t=this.#t;return this.#f!==void 0?this.#f:this.#f=this.#i==="win32"&&this.#n===0&&t[0]===""&&t[1]===""&&typeof t[2]=="string"&&!!t[2]&&typeof t[3]=="string"&&!!t[3]}isDrive(){let t=this.#t;return this.#l!==void 0?this.#l:this.#l=this.#i==="win32"&&this.#n===0&&this.length>1&&typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0])}isAbsolute(){let t=this.#t;return this.#h!==void 0?this.#h:this.#h=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 ln=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",mt=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(t,{nobrace:e,nocase:s,noext:r,noglobstar:n,platform:o=ln}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:e,nocase:s,noext:r,noglobstar:n,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let h of t)this.add(h)}add(t){let e=new F(t,this.mmopts);for(let s=0;s<e.set.length;s++){let r=e.set[s],n=e.globParts[s];if(!r||!n)throw new Error("invalid pattern object");for(;r[0]==="."&&n[0]===".";)r.shift(),n.shift();let o=new pt(r,n,0,this.platform),h=new F(o.globString(),this.mmopts),a=n[n.length-1]==="**",l=o.isAbsolute();l?this.absolute.push(h):this.relative.push(h),a&&(l?this.absoluteChildren.push(h):this.relativeChildren.push(h))}}ignored(t){let e=t.fullpath(),s=`${e}/`,r=t.relative()||".",n=`${r}/`;for(let o of this.relative)if(o.match(r)||o.match(n))return!0;for(let o of this.absolute)if(o.match(e)||o.match(s))return!0;return!1}childrenIgnored(t){let e=t.fullpath()+"/",s=(t.relative()||".")+"/";for(let r of this.relativeChildren)if(r.match(s))return!0;for(let r of this.absoluteChildren)if(r.match(e))return!0;return!1}};var Le=class i{store;constructor(t=new Map){this.store=t}copy(){return new i(new Map(this.store))}hasWalked(t,e){return this.store.get(t.fullpath())?.has(e.globString())}storeWalked(t,e){let s=t.fullpath(),r=this.store.get(s);r?r.add(e.globString()):this.store.set(s,new Set([e.globString()]))}},Pe=class{store=new Map;add(t,e,s){let r=(e?2:0)|(s?1:0),n=this.store.get(t);this.store.set(t,n===void 0?r:r&n)}entries(){return[...this.store.entries()].map(([t,e])=>[t,!!(e&2),!!(e&1)])}},Ie=class{store=new Map;add(t,e){if(!t.canReaddir())return;let s=this.store.get(t);s?s.find(r=>r.globString()===e.globString())||s.push(e):this.store.set(t,[e])}get(t){let e=this.store.get(t);if(!e)throw new Error("attempting to walk unknown path");return e}entries(){return this.keys().map(t=>[t,this.store.get(t)])}keys(){return[...this.store.keys()].filter(t=>t.canReaddir())}},Pt=class i{hasWalkedCache;matches=new Pe;subwalks=new Ie;patterns;follow;dot;opts;constructor(t,e){this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=e?e.copy():new Le}processPatterns(t,e){this.patterns=e;let s=e.map(r=>[t,r]);for(let[r,n]of s){this.hasWalkedCache.storeWalked(r,n);let o=n.root(),h=n.isAbsolute()&&this.opts.absolute!==!1;if(o){r=r.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let f=n.rest();if(f)n=f;else{this.matches.add(r,!0,!1);continue}}if(r.isENOENT())continue;let a,l,c=!1;for(;typeof(a=n.pattern())=="string"&&(l=n.rest());)r=r.resolve(a),n=l,c=!0;if(a=n.pattern(),l=n.rest(),c){if(this.hasWalkedCache.hasWalked(r,n))continue;this.hasWalkedCache.storeWalked(r,n)}if(typeof a=="string"){let f=a===".."||a===""||a===".";this.matches.add(r.resolve(a),h,f);continue}else if(a===A){(!r.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(r,n);let f=l?.pattern(),u=l?.rest();if(!l||(f===""||f===".")&&!u)this.matches.add(r,h,f===""||f===".");else if(f===".."){let d=r.parent||r;u?this.hasWalkedCache.hasWalked(d,u)||this.subwalks.add(d,u):this.matches.add(d,h,!0)}}else a instanceof RegExp&&this.subwalks.add(r,n)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new i(this.opts,this.hasWalkedCache)}filterEntries(t,e){let s=this.subwalks.get(t),r=this.child();for(let n of e)for(let o of s){let h=o.isAbsolute(),a=o.pattern(),l=o.rest();a===A?r.testGlobstar(n,o,l,h):a instanceof RegExp?r.testRegExp(n,a,l,h):r.testString(n,a,l,h)}return r}testGlobstar(t,e,s,r){if((this.dot||!t.name.startsWith("."))&&(e.hasMore()||this.matches.add(t,r,!1),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,e):t.isSymbolicLink()&&(s&&e.checkFollowGlobstar()?this.subwalks.add(t,s):e.markFollowGlobstar()&&this.subwalks.add(t,e)))),s){let n=s.pattern();if(typeof n=="string"&&n!==".."&&n!==""&&n!==".")this.testString(t,n,s.rest(),r);else if(n===".."){let o=t.parent||t;this.subwalks.add(o,s)}else n instanceof RegExp&&this.testRegExp(t,n,s.rest(),r)}}testRegExp(t,e,s,r){e.test(t.name)&&(s?this.subwalks.add(t,s):this.matches.add(t,r,!1))}testString(t,e,s,r){t.isNamed(e)&&(s?this.subwalks.add(t,s):this.matches.add(t,r,!1))}};var cn=(i,t)=>typeof i=="string"?new mt([i],t):Array.isArray(i)?new mt(i,t):i,se=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#t=[];#e;#n;signal;maxDepth;includeChildMatches;constructor(t,e,s){if(this.patterns=t,this.path=e,this.opts=s,this.#n=!s.posix&&s.platform==="win32"?"\\":"/",this.includeChildMatches=s.includeChildMatches!==!1,(s.ignore||!this.includeChildMatches)&&(this.#e=cn(s.ignore??[],s),!this.includeChildMatches&&typeof this.#e.add!="function")){let r="cannot ignore child matches, ignore lacks add() method.";throw new Error(r)}this.maxDepth=s.maxDepth||1/0,s.signal&&(this.signal=s.signal,this.signal.addEventListener("abort",()=>{this.#t.length=0}))}#i(t){return this.seen.has(t)||!!this.#e?.ignored?.(t)}#o(t){return!!this.#e?.childrenIgnored?.(t)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let t;for(;!this.paused&&(t=this.#t.shift());)t()}onResume(t){this.signal?.aborted||(this.paused?this.#t.push(t):t())}async matchCheck(t,e){if(e&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=t.realpathCached()||await t.realpath(),!s)return;t=s}let n=t.isUnknown()||this.opts.stat?await t.lstat():t;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let o=await n.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(n,e)}matchCheckTest(t,e){return t&&(this.maxDepth===1/0||t.depth()<=this.maxDepth)&&(!e||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!t.realpathCached()?.isDirectory())&&!this.#i(t)?t:void 0}matchCheckSync(t,e){if(e&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=t.realpathCached()||t.realpathSync(),!s)return;t=s}let n=t.isUnknown()||this.opts.stat?t.lstatSync():t;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let o=n.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(n,e)}matchFinish(t,e){if(this.#i(t))return;if(!this.includeChildMatches&&this.#e?.add){let n=`${t.relativePosix()}/**`;this.#e.add(n)}let s=this.opts.absolute===void 0?e:this.opts.absolute;this.seen.add(t);let r=this.opts.mark&&t.isDirectory()?this.#n:"";if(this.opts.withFileTypes)this.matchEmit(t);else if(s){let n=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(n+r)}else{let n=this.opts.posix?t.relativePosix():t.relative(),o=this.opts.dotRelative&&!n.startsWith(".."+this.#n)?"."+this.#n:"";this.matchEmit(n?o+n+r:"."+r)}}async match(t,e,s){let r=await this.matchCheck(t,s);r&&this.matchFinish(r,e)}matchSync(t,e,s){let r=this.matchCheckSync(t,s);r&&this.matchFinish(r,e)}walkCB(t,e,s){this.signal?.aborted&&s(),this.walkCB2(t,e,new Pt(this.opts),s)}walkCB2(t,e,s,r){if(this.#o(t))return r();if(this.signal?.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2(t,e,s,r));return}s.processPatterns(t,e);let n=1,o=()=>{--n===0&&r()};for(let[h,a,l]of s.matches.entries())this.#i(h)||(n++,this.match(h,a,l).then(()=>o()));for(let h of s.subwalkTargets()){if(this.maxDepth!==1/0&&h.depth()>=this.maxDepth)continue;n++;let a=h.readdirCached();h.calledReaddir()?this.walkCB3(h,a,s,o):h.readdirCB((l,c)=>this.walkCB3(h,c,s,o),!0)}o()}walkCB3(t,e,s,r){s=s.filterEntries(t,e);let n=1,o=()=>{--n===0&&r()};for(let[h,a,l]of s.matches.entries())this.#i(h)||(n++,this.match(h,a,l).then(()=>o()));for(let[h,a]of s.subwalks.entries())n++,this.walkCB2(h,a,s.child(),o);o()}walkCBSync(t,e,s){this.signal?.aborted&&s(),this.walkCB2Sync(t,e,new Pt(this.opts),s)}walkCB2Sync(t,e,s,r){if(this.#o(t))return r();if(this.signal?.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2Sync(t,e,s,r));return}s.processPatterns(t,e);let n=1,o=()=>{--n===0&&r()};for(let[h,a,l]of s.matches.entries())this.#i(h)||this.matchSync(h,a,l);for(let h of s.subwalkTargets()){if(this.maxDepth!==1/0&&h.depth()>=this.maxDepth)continue;n++;let a=h.readdirSync();this.walkCB3Sync(h,a,s,o)}o()}walkCB3Sync(t,e,s,r){s=s.filterEntries(t,e);let n=1,o=()=>{--n===0&&r()};for(let[h,a,l]of s.matches.entries())this.#i(h)||this.matchSync(h,a,l);for(let[h,a]of s.subwalks.entries())n++,this.walkCB2Sync(h,a,s.child(),o);o()}},It=class extends se{matches=new Set;constructor(t,e,s){super(t,e,s)}matchEmit(t){this.matches.add(t)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((t,e)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?e(this.signal.reason):t(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},Wt=class extends se{results;constructor(t,e,s){super(t,e,s),this.results=new tt({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 un=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",$=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(t,e){if(!e)throw new TypeError("glob options required");if(this.withFileTypes=!!e.withFileTypes,this.signal=e.signal,this.follow=!!e.follow,this.dot=!!e.dot,this.dotRelative=!!e.dotRelative,this.nodir=!!e.nodir,this.mark=!!e.mark,e.cwd?(e.cwd instanceof URL||e.cwd.startsWith("file://"))&&(e.cwd=fn(e.cwd)):this.cwd="",this.cwd=e.cwd||"",this.root=e.root,this.magicalBraces=!!e.magicalBraces,this.nobrace=!!e.nobrace,this.noext=!!e.noext,this.realpath=!!e.realpath,this.absolute=e.absolute,this.includeChildMatches=e.includeChildMatches!==!1,this.noglobstar=!!e.noglobstar,this.matchBase=!!e.matchBase,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:1/0,this.stat=!!e.stat,this.ignore=e.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof t=="string"&&(t=[t]),this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(t=t.map(a=>a.replace(/\\/g,"/"))),this.matchBase){if(e.noglobstar)throw new TypeError("base matching requires globstar");t=t.map(a=>a.includes("/")?a:`./**/${a}`)}if(this.pattern=t,this.platform=e.platform||un,this.opts={...e,platform:this.platform},e.scurry){if(this.scurry=e.scurry,e.nocase!==void 0&&e.nocase!==e.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let a=e.platform==="win32"?ut:e.platform==="darwin"?Lt:e.platform?dt:Ks;this.scurry=new a(this.cwd,{nocase:e.nocase,fs:e.fs})}this.nocase=this.scurry.nocase;let s=this.platform==="darwin"||this.platform==="win32",r={...e,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:s,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},n=this.pattern.map(a=>new F(a,r)),[o,h]=n.reduce((a,l)=>(a[0].push(...l.set),a[1].push(...l.globParts),a),[[],[]]);this.patterns=o.map((a,l)=>{let c=h[l];if(!c)throw new Error("invalid pattern object");return new pt(a,c,0,this.platform)})}async walk(){return[...await new It(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 It(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 Wt(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 Wt(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 We=(i,t={})=>{Array.isArray(i)||(i=[i]);for(let e of i)if(new F(e,t).hasMagic())return!0;return!1};function re(i,t={}){return new $(i,t).streamSync()}function Xs(i,t={}){return new $(i,t).stream()}function ne(i,t={}){return new $(i,t).walkSync()}async function Ys(i,t={}){return new $(i,t).walk()}function oe(i,t={}){return new $(i,t).iterateSync()}function Js(i,t={}){return new $(i,t).iterate()}var dn=re,pn=Object.assign(Xs,{sync:re}),mn=oe,gn=Object.assign(Js,{sync:oe}),wn=Object.assign(ne,{stream:re,iterate:oe}),ie=Object.assign(Ys,{glob:Ys,globSync:ne,sync:wn,globStream:Xs,stream:pn,globStreamSync:re,streamSync:dn,globIterate:Js,iterate:gn,globIterateSync:oe,iterateSync:mn,Glob:$,hasMagic:We,escape:ht,unescape:B});ie.glob=ie;var et=(i,t)=>typeof i>"u"||typeof i===t,Zs=i=>!!i&&typeof i=="object"&&et(i.preserveRoot,"boolean")&&et(i.tmp,"string")&&et(i.maxRetries,"number")&&et(i.retryDelay,"number")&&et(i.backoff,"number")&&et(i.maxBackoff,"number")&&(et(i.glob,"boolean")||i.glob&&typeof i.glob=="object")&&et(i.filter,"function"),Qs=i=>{if(!Zs(i))throw new Error("invalid rimraf options")},ti=i=>{Qs(i);let{glob:t,...e}=i;if(!t)return e;let s=t===!0?i.signal?{signal:i.signal}:{}:i.signal?{signal:i.signal,...t}:t;return{...e,glob:{...s,absolute:!0,withFileTypes:!1}}},ei=(i={})=>ti(i),si=(i={})=>ti(i);import{parse as ii,resolve as yn}from"path";import{inspect as Sn}from"util";var G=process.env.__TESTING_RIMRAF_PLATFORM__||process.platform;var bn=(i,t={})=>{let e=typeof i;if(e!=="string"){let r=i&&e==="object"&&i.constructor,o=`The "path" argument must be of type string. Received ${r&&r.name?`an instance of ${r.name}`:e==="object"?Sn(i):`type ${e} ${i}`}`;throw Object.assign(new TypeError(o),{path:i,code:"ERR_INVALID_ARG_TYPE"})}if(/\0/.test(i)){let r="path must be a string without null bytes";throw Object.assign(new TypeError(r),{path:i,code:"ERR_INVALID_ARG_VALUE"})}i=yn(i);let{root:s}=ii(i);if(i===s&&t.preserveRoot!==!1){let r="refusing to remove root directory without preserveRoot:false";throw Object.assign(new Error(r),{path:i,code:"ERR_PRESERVE_ROOT"})}if(G==="win32"){let r=/[*|"<>?:]/,{root:n}=ii(i);if(r.test(i.substring(n.length)))throw Object.assign(new Error("Illegal characters in path."),{path:i,code:"EINVAL"})}return i},jt=bn;import Y from"fs";import{chmodSync as he,mkdirSync as Ih,renameSync as ni,rmdirSync as gt,rmSync as oi,statSync as hi,lstatSync as wt,unlinkSync as yt}from"fs";import{readdirSync as En}from"fs";var ri=i=>En(i,{withFileTypes:!0}),vn=(i,t)=>new Promise((e,s)=>Y.chmod(i,t,(r,...n)=>r?s(r):e(...n))),xn=(i,t)=>new Promise((e,s)=>Y.mkdir(i,t,(r,n)=>r?s(r):e(n))),Tn=i=>new Promise((t,e)=>Y.readdir(i,{withFileTypes:!0},(s,r)=>s?e(s):t(r))),Rn=(i,t)=>new Promise((e,s)=>Y.rename(i,t,(r,...n)=>r?s(r):e(...n))),On=(i,t)=>new Promise((e,s)=>Y.rm(i,t,(r,...n)=>r?s(r):e(...n))),An=i=>new Promise((t,e)=>Y.rmdir(i,(s,...r)=>s?e(s):t(...r))),Nn=i=>new Promise((t,e)=>Y.stat(i,(s,r)=>s?e(s):t(r))),Cn=i=>new Promise((t,e)=>Y.lstat(i,(s,r)=>s?e(s):t(r))),kn=i=>new Promise((t,e)=>Y.unlink(i,(s,...r)=>s?e(s):t(...r))),M={chmod:vn,mkdir:xn,readdir:Tn,rename:Rn,rm:On,rmdir:An,stat:Nn,lstat:Cn,unlink:kn};import{parse as ai,resolve as li}from"path";var{readdir:Dn}=M,St=i=>Dn(i).catch(t=>t),bt=i=>{try{return ri(i)}catch(t){return t}};var X=async i=>i.catch(t=>{if(t.code!=="ENOENT")throw t}),J=i=>{try{return i()}catch(t){if(t?.code!=="ENOENT")throw t}};var{lstat:Mn,rmdir:Fn,unlink:_n}=M,ae=async(i,t)=>{if(t?.signal?.aborted)throw t.signal.reason;try{return await ci(i,t,await Mn(i))}catch(e){if(e?.code==="ENOENT")return!0;throw e}},le=(i,t)=>{if(t?.signal?.aborted)throw t.signal.reason;try{return fi(i,t,wt(i))}catch(e){if(e?.code==="ENOENT")return!0;throw e}},ci=async(i,t,e)=>{if(t?.signal?.aborted)throw t.signal.reason;let s=e.isDirectory()?await St(i):null;if(!Array.isArray(s)){if(s){if(s.code==="ENOENT")return!0;if(s.code!=="ENOTDIR")throw s}return t.filter&&!await t.filter(i,e)?!1:(await X(_n(i)),!0)}return!(await Promise.all(s.map(n=>ci(li(i,n.name),t,n)))).reduce((n,o)=>n&&o,!0)||t.preserveRoot===!1&&i===ai(i).root||t.filter&&!await t.filter(i,e)?!1:(await X(Fn(i)),!0)},fi=(i,t,e)=>{if(t?.signal?.aborted)throw t.signal.reason;let s=e.isDirectory()?bt(i):null;if(!Array.isArray(s)){if(s){if(s.code==="ENOENT")return!0;if(s.code!=="ENOTDIR")throw s}return t.filter&&!t.filter(i,e)?!1:(J(()=>yt(i)),!0)}let r=!0;for(let n of s){let o=li(i,n.name);r=fi(o,t,n)&&r}return t.preserveRoot===!1&&i===ai(i).root||!r||t.filter&&!t.filter(i,e)?!1:(J(()=>gt(i)),!0)};import{parse as bi,resolve as Ei}from"path";var{chmod:Ln}=M,je=i=>async t=>{try{return await i(t)}catch(e){let s=e;if(s?.code==="ENOENT")return;if(s?.code==="EPERM"){try{await Ln(t,438)}catch(r){if(r?.code==="ENOENT")return;throw e}return await i(t)}throw e}},Be=i=>t=>{try{return i(t)}catch(e){let s=e;if(s?.code==="ENOENT")return;if(s?.code==="EPERM"){try{he(t,438)}catch(r){if(r?.code==="ENOENT")return;throw e}return i(t)}throw e}};var ui=new Set(["EMFILE","ENFILE","EBUSY"]),ze=i=>{let t=async(e,s,r=1,n=0)=>{let o=s.maxBackoff||200,h=s.backoff||1.2,a=s.maxRetries||10,l=0;for(;;)try{return await i(e)}catch(c){let f=c;if(f?.path===e&&f?.code&&ui.has(f.code)){if(r=Math.ceil(r*h),n=r+n,n<o)return new Promise((u,d)=>{setTimeout(()=>{t(e,s,r,n).then(u,d)},r)});if(l<a){l++;continue}}throw c}};return t},Ue=i=>(e,s)=>{let r=s.maxRetries||10,n=0;for(;;)try{return i(e)}catch(o){let h=o;if(h?.path===e&&h?.code&&ui.has(h.code)&&n<r){n++;continue}throw o}};import{basename as $n,parse as ue,resolve as de}from"path";import{tmpdir as fe}from"os";import{parse as ce,resolve as di}from"path";var{stat:Pn}=M,In=i=>{try{return hi(i).isDirectory()}catch{return!1}},Wn=i=>Pn(i).then(t=>t.isDirectory(),()=>!1),jn=async i=>{let{root:t}=ce(i),e=fe(),{root:s}=ce(e);if(t.toLowerCase()===s.toLowerCase())return e;let r=di(t,"/temp");return await Wn(r)?r:t},Bn=i=>{let{root:t}=ce(i),e=fe(),{root:s}=ce(e);if(t.toLowerCase()===s.toLowerCase())return e;let r=di(t,"/temp");return In(r)?r:t},zn=async()=>fe(),Un=()=>fe(),pi=G==="win32"?jn:zn,mi=G==="win32"?Bn:Un;var{lstat:Gn,rename:Hn,unlink:gi,rmdir:Vn,chmod:qn}=M,Si=i=>`.${$n(i)}.${Math.random()}`,Kn=async i=>gi(i).catch(t=>{if(t.code==="EPERM")return qn(i,438).then(()=>gi(i),e=>{if(e.code!=="ENOENT")throw t});if(t.code==="ENOENT")return;throw t}),Yn=i=>{try{yt(i)}catch(t){if(t?.code==="EPERM")try{return he(i,438)}catch(e){if(e?.code==="ENOENT")return;throw t}else if(t?.code==="ENOENT")return;throw t}},pe=async(i,t)=>{if(t?.signal?.aborted)throw t.signal.reason;try{return await $e(i,t,await Gn(i))}catch(e){if(e?.code==="ENOENT")return!0;throw e}},$e=async(i,t,e)=>{if(t?.signal?.aborted)throw t.signal.reason;if(!t.tmp)return $e(i,{...t,tmp:await pi(i)},e);if(i===t.tmp&&ue(i).root!==i)throw new Error("cannot delete temp directory used for deletion");let s=e.isDirectory()?await St(i):null;if(!Array.isArray(s)){if(s){if(s.code==="ENOENT")return!0;if(s.code!=="ENOTDIR")throw s}return t.filter&&!await t.filter(i,e)?!1:(await X(wi(i,t.tmp,Kn)),!0)}return!(await Promise.all(s.map(n=>$e(de(i,n.name),t,n)))).reduce((n,o)=>n&&o,!0)||t.preserveRoot===!1&&i===ue(i).root||t.filter&&!await t.filter(i,e)?!1:(await X(wi(i,t.tmp,Vn)),!0)},wi=async(i,t,e)=>{let s=de(t,Si(i));return await Hn(i,s),await e(s)},me=(i,t)=>{if(t?.signal?.aborted)throw t.signal.reason;try{return Ge(i,t,wt(i))}catch(e){if(e?.code==="ENOENT")return!0;throw e}},Ge=(i,t,e)=>{if(t?.signal?.aborted)throw t.signal.reason;if(!t.tmp)return Ge(i,{...t,tmp:mi(i)},e);let s=t.tmp;if(i===t.tmp&&ue(i).root!==i)throw new Error("cannot delete temp directory used for deletion");let r=e.isDirectory()?bt(i):null;if(!Array.isArray(r)){if(r){if(r.code==="ENOENT")return!0;if(r.code!=="ENOTDIR")throw r}return t.filter&&!t.filter(i,e)?!1:(J(()=>yi(i,s,Yn)),!0)}let n=!0;for(let o of r){let h=de(i,o.name);n=Ge(h,t,o)&&n}return!n||t.preserveRoot===!1&&i===ue(i).root||t.filter&&!t.filter(i,e)?!1:(J(()=>yi(i,s,gt)),!0)},yi=(i,t,e)=>{let s=de(t,Si(i));return ni(i,s),e(s)};var{unlink:Xn,rmdir:Jn,lstat:Zn}=M,Qn=ze(je(Xn)),to=Ue(Be(yt)),eo=ze(je(Jn)),so=Ue(Be(gt)),io=async(i,t)=>{if(t?.signal?.aborted)throw t.signal.reason;let{filter:e,...s}=t;try{return await eo(i,s)}catch(r){if(r?.code==="ENOTEMPTY")return await pe(i,s);throw r}},ro=(i,t)=>{if(t?.signal?.aborted)throw t.signal.reason;let{filter:e,...s}=t;try{return so(i,s)}catch(r){if(r?.code==="ENOTEMPTY")return me(i,s);throw r}},st=Symbol("start"),vi=Symbol("child"),ge=Symbol("finish"),we=async(i,t)=>{if(t?.signal?.aborted)throw t.signal.reason;try{return await He(i,t,await Zn(i),st)}catch(e){if(e?.code==="ENOENT")return!0;throw e}},ye=(i,t)=>{if(t?.signal?.aborted)throw t.signal.reason;try{return Ve(i,t,wt(i),st)}catch(e){if(e?.code==="ENOENT")return!0;throw e}},He=async(i,t,e,s=st)=>{if(t?.signal?.aborted)throw t.signal.reason;let r=e.isDirectory()?await St(i):null;if(!Array.isArray(r)){if(r){if(r.code==="ENOENT")return!0;if(r.code!=="ENOTDIR")throw r}return t.filter&&!await t.filter(i,e)?!1:(await X(Qn(i,t)),!0)}let n=s===st?vi:s,o=(await Promise.all(r.map(h=>He(Ei(i,h.name),t,h,n)))).reduce((h,a)=>h&&a,!0);if(s===st)return He(i,t,e,ge);if(s===ge){if(t.preserveRoot===!1&&i===bi(i).root||!o||t.filter&&!await t.filter(i,e))return!1;await X(io(i,t))}return!0},Ve=(i,t,e,s=st)=>{let r=e.isDirectory()?bt(i):null;if(!Array.isArray(r)){if(r){if(r.code==="ENOENT")return!0;if(r.code!=="ENOTDIR")throw r}return t.filter&&!t.filter(i,e)?!1:(J(()=>to(i,t)),!0)}let n=!0;for(let o of r){let h=s===st?vi:s,a=Ei(i,o.name);n=Ve(a,t,o,h)&&n}if(s===st)return Ve(i,t,e,ge);if(s===ge){if(t.preserveRoot===!1&&i===bi(i).root||!n||t.filter&&!t.filter(i,e))return!1;J(()=>{ro(i,t)})}return!0};var qe=G==="win32"?we:ae,Ke=G==="win32"?ye:le;var{rm:no}=M,Ye=async(i,t)=>(await no(i,{...t,force:!0,recursive:!0}),!0),Xe=(i,t)=>(oi(i,{...t,force:!0,recursive:!0}),!0);var oo=process.env.__TESTING_RIMRAF_NODE_VERSION__||process.version,ho=oo.replace(/^v/,"").split("."),[xi=0,ao=0]=ho.map(i=>parseInt(i,10)),Ti=xi>14||xi===14&&ao>=14,Ri=!Ti||G==="win32"?()=>!1:i=>!i?.signal&&!i?.filter,Oi=!Ti||G==="win32"?()=>!1:i=>!i?.signal&&!i?.filter;var Et=i=>async(t,e)=>{let s=ei(e);return s.glob&&(t=await ie(t,s.glob)),Array.isArray(t)?!!(await Promise.all(t.map(r=>i(jt(r,s),s)))).reduce((r,n)=>r&&n,!0):!!await i(jt(t,s),s)},vt=i=>(t,e)=>{let s=si(e);return s.glob&&(t=ne(t,s.glob)),Array.isArray(t)?!!t.map(r=>i(jt(r,s),s)).reduce((r,n)=>r&&n,!0):!!i(jt(t,s),s)},Ci=vt(Xe),lo=Object.assign(Et(Ye),{sync:Ci}),ki=vt(Ke),co=Object.assign(Et(qe),{sync:ki}),Di=vt(ye),fo=Object.assign(Et(we),{sync:Di}),Mi=vt(le),uo=Object.assign(Et(ae),{sync:Mi}),Fi=vt(me),po=Object.assign(Et(pe),{sync:Fi}),Je=vt((i,t)=>Oi(t)?Xe(i,t):Ke(i,t)),_i=Je,Ai=Et((i,t)=>Ri(t)?Ye(i,t):qe(i,t)),Ni=Object.assign(Ai,{rimraf:Ai,sync:Je,rimrafSync:Je,manual:co,manualSync:ki,native:lo,nativeSync:Ci,posix:uo,posixSync:Mi,windows:fo,windowsSync:Di,moveRemove:po,moveRemoveSync:Fi});Ni.rimraf=Ni;var Pi=go(new URL(".",import.meta.url)),Qe=Li(Pi,"../builder/vite-config.js"),wo=Li(Pi,"../builder/vite-entry-server.js");async function Ia({options:i,logger:t}){t.info(`Building template...
|
|
5
|
+
>>> no match, partial?`,t,u,e,d),u===a))}let p;if(typeof f=="string"?(p=c===f,this.debug("string match",f,c,p)):(p=f.test(c),this.debug("pattern match",f,c,p)),!p)return!1}if(o===a&&h===l)return!0;if(o===a)return s;if(h===l)return o===a-1&&t[o]==="";throw new Error("wtf?")}braceExpand(){return Os(this.pattern,this.options)}parse(t){Rt(t);let e=this.options;if(t==="**")return A;if(t==="")return"";let s,r=null;(s=t.match(mr))?r=e.dot?wr:gr:(s=t.match(nr))?r=(e.nocase?e.dot?lr:ar:e.dot?hr:or)(s[1]):(s=t.match(yr))?r=(e.nocase?e.dot?br:Sr:e.dot?Er:vr)(s):(s=t.match(cr))?r=e.dot?ur:fr:(s=t.match(dr))&&(r=pr);let n=ot.fromGlob(t,this.options).toMMPattern();return r&&typeof n=="object"&&Reflect.defineProperty(n,"test",{value:r}),n}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let e=this.options,s=e.noglobstar?Rr:e.dot?Or:Ar,r=new Set(e.nocase?["i"]:[]),n=t.map(a=>{let l=a.map(f=>{if(f instanceof RegExp)for(let c of f.flags.split(""))r.add(c);return typeof f=="string"?Mr(f):f===A?A:f._src});return l.forEach((f,c)=>{let u=l[c+1],d=l[c-1];f!==A||d===A||(d===void 0?u!==void 0&&u!==A?l[c+1]="(?:\\/|"+s+"\\/)?"+u:l[c]=s:u===void 0?l[c-1]=d+"(?:\\/|"+s+")?":u!==A&&(l[c-1]=d+"(?:\\/|\\/"+s+"\\/)"+u,l[c+1]=A))}),l.filter(f=>f!==A).join("/")}).join("|"),[o,h]=t.length>1?["(?:",")"]:["",""];n="^"+o+n+h+"$",this.negate&&(n="^(?!"+n+").+$");try{this.regexp=new RegExp(n,[...r].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&e)return!0;let s=this.options;this.isWindows&&(t=t.split("\\").join("/"));let r=this.slashSplit(t);this.debug(this.pattern,"split",r);let n=this.set;this.debug(this.pattern,"set",n);let o=r[r.length-1];if(!o)for(let h=r.length-2;!o&&h>=0;h--)o=r[h];for(let h=0;h<n.length;h++){let a=n[h],l=r;if(s.matchBase&&a.length===1&&(l=[o]),this.matchOne(l,a,e))return s.flipNegate?!0:!this.negate}return s.flipNegate?!1:this.negate}static defaults(t){return k.defaults(t).Minimatch}};k.AST=ot;k.Minimatch=_;k.escape=ht;k.unescape=j;import{fileURLToPath as fn}from"node:url";var at=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Ns=new Set,ve=typeof process=="object"&&process?process:{},Cs=(i,t,e,s)=>{typeof ve.emitWarning=="function"?ve.emitWarning(i,t,e,s):console.error(`[${e}] ${t}: ${i}`)},Ut=globalThis.AbortController,As=globalThis.AbortSignal;if(typeof Ut>"u"){As=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(s,r){this._onabort.push(r)}},Ut=class{constructor(){t()}signal=new As;abort(s){if(!this.signal.aborted){this.signal.reason=s,this.signal.aborted=!0;for(let r of this.signal._onabort)r(s);this.signal.onabort?.(s)}}};let i=ve.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",t=()=>{i&&(i=!1,Cs("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}var Fr=i=>!Ns.has(i),Bo=Symbol("type"),Z=i=>i&&i===Math.floor(i)&&i>0&&isFinite(i),ks=i=>Z(i)?i<=Math.pow(2,8)?Uint8Array:i<=Math.pow(2,16)?Uint16Array:i<=Math.pow(2,32)?Uint32Array:i<=Number.MAX_SAFE_INTEGER?lt:null:null,lt=class extends Array{constructor(t){super(t),this.fill(0)}},xe=class i{heap;length;static#t=!1;static create(t){let e=ks(t);if(!e)return[];i.#t=!0;let s=new i(t,e);return i.#t=!1,s}constructor(t,e){if(!i.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},At=class i{#t;#e;#n;#r;#o;#b;#w;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#h;#f;#a;#l;#s;#u;#y;#p;#m;#A;#g;#N;#v;#E;#S;#R;#d;#k;static unsafeExposeInternals(t){return{starts:t.#v,ttls:t.#E,sizes:t.#N,keyMap:t.#a,keyList:t.#l,valList:t.#s,next:t.#u,prev:t.#y,get head(){return t.#p},get tail(){return t.#m},free:t.#A,isBackgroundFetch:e=>t.#c(e),backgroundFetch:(e,s,r,n)=>t.#L(e,s,r,n),moveToTail:e=>t.#W(e),indexes:e=>t.#O(e),rindexes:e=>t.#C(e),isStale:e=>t.#T(e)}}get max(){return this.#t}get maxSize(){return this.#e}get calculatedSize(){return this.#f}get size(){return this.#h}get fetchMethod(){return this.#b}get memoMethod(){return this.#w}get dispose(){return this.#n}get onInsert(){return this.#r}get disposeAfter(){return this.#o}constructor(t){let{max:e=0,ttl:s,ttlResolution:r=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:h,allowStale:a,dispose:l,onInsert:f,disposeAfter:c,noDisposeOnSet:u,noUpdateTTL:d,maxSize:g=0,maxEntrySize:p=0,sizeCalculation:w,fetchMethod:m,memoMethod:S,noDeleteOnFetchRejection:b,noDeleteOnStaleGet:y,allowStaleOnFetchRejection:E,allowStaleOnFetchAbort:x,ignoreFetchAbort:V}=t;if(e!==0&&!Z(e))throw new TypeError("max option must be a nonnegative integer");let it=e?ks(e):Array;if(!it)throw new Error("invalid max value: "+e);if(this.#t=e,this.#e=g,this.maxEntrySize=p||this.#e,this.sizeCalculation=w,this.sizeCalculation){if(!this.#e&&!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(S!==void 0&&typeof S!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#w=S,m!==void 0&&typeof m!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#b=m,this.#R=!!m,this.#a=new Map,this.#l=new Array(e).fill(void 0),this.#s=new Array(e).fill(void 0),this.#u=new it(e),this.#y=new it(e),this.#p=0,this.#m=0,this.#A=xe.create(e),this.#h=0,this.#f=0,typeof l=="function"&&(this.#n=l),typeof f=="function"&&(this.#r=f),typeof c=="function"?(this.#o=c,this.#g=[]):(this.#o=void 0,this.#g=void 0),this.#S=!!this.#n,this.#k=!!this.#r,this.#d=!!this.#o,this.noDisposeOnSet=!!u,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!b,this.allowStaleOnFetchRejection=!!E,this.allowStaleOnFetchAbort=!!x,this.ignoreFetchAbort=!!V,this.maxEntrySize!==0){if(this.#e!==0&&!Z(this.#e))throw new TypeError("maxSize must be a positive integer if specified");if(!Z(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#B()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!y,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!h,this.ttlResolution=Z(r)||r===0?r:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!Z(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#i()}if(this.#t===0&&this.ttl===0&&this.#e===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#e){let M="LRU_CACHE_UNBOUNDED";Fr(M)&&(Ns.add(M),Cs("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",M,i))}}getRemainingTTL(t){return this.#a.has(t)?1/0:0}#i(){let t=new lt(this.#t),e=new lt(this.#t);this.#E=t,this.#v=e,this.#D=(n,o,h=at.now())=>{if(e[n]=o!==0?h:0,t[n]=o,o!==0&&this.ttlAutopurge){let a=setTimeout(()=>{this.#T(n)&&this.#M(this.#l[n],"expire")},o+1);a.unref&&a.unref()}},this.#F=n=>{e[n]=t[n]!==0?at.now():0},this.#x=(n,o)=>{if(t[o]){let h=t[o],a=e[o];if(!h||!a)return;n.ttl=h,n.start=a,n.now=s||r();let l=n.now-a;n.remainingTTL=h-l}};let s=0,r=()=>{let n=at.now();if(this.ttlResolution>0){s=n;let o=setTimeout(()=>s=0,this.ttlResolution);o.unref&&o.unref()}return n};this.getRemainingTTL=n=>{let o=this.#a.get(n);if(o===void 0)return 0;let h=t[o],a=e[o];if(!h||!a)return 1/0;let l=(s||r())-a;return h-l},this.#T=n=>{let o=e[n],h=t[n];return!!h&&!!o&&(s||r())-o>h}}#F=()=>{};#x=()=>{};#D=()=>{};#T=()=>!1;#B(){let t=new lt(this.#t);this.#f=0,this.#N=t,this.#_=e=>{this.#f-=t[e],t[e]=0},this.#z=(e,s,r,n)=>{if(this.#c(s))return 0;if(!Z(r))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(r=n(s,e),!Z(r))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 r},this.#P=(e,s,r)=>{if(t[e]=s,this.#e){let n=this.#e-t[e];for(;this.#f>n;)this.#I(!0)}this.#f+=t[e],r&&(r.entrySize=s,r.totalCalculatedSize=this.#f)}}#_=t=>{};#P=(t,e,s)=>{};#z=(t,e,s,r)=>{if(s||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#O({allowStale:t=this.allowStale}={}){if(this.#h)for(let e=this.#m;!(!this.#U(e)||((t||!this.#T(e))&&(yield e),e===this.#p));)e=this.#y[e]}*#C({allowStale:t=this.allowStale}={}){if(this.#h)for(let e=this.#p;!(!this.#U(e)||((t||!this.#T(e))&&(yield e),e===this.#m));)e=this.#u[e]}#U(t){return t!==void 0&&this.#a.get(this.#l[t])===t}*entries(){for(let t of this.#O())this.#s[t]!==void 0&&this.#l[t]!==void 0&&!this.#c(this.#s[t])&&(yield[this.#l[t],this.#s[t]])}*rentries(){for(let t of this.#C())this.#s[t]!==void 0&&this.#l[t]!==void 0&&!this.#c(this.#s[t])&&(yield[this.#l[t],this.#s[t]])}*keys(){for(let t of this.#O()){let e=this.#l[t];e!==void 0&&!this.#c(this.#s[t])&&(yield e)}}*rkeys(){for(let t of this.#C()){let e=this.#l[t];e!==void 0&&!this.#c(this.#s[t])&&(yield e)}}*values(){for(let t of this.#O())this.#s[t]!==void 0&&!this.#c(this.#s[t])&&(yield this.#s[t])}*rvalues(){for(let t of this.#C())this.#s[t]!==void 0&&!this.#c(this.#s[t])&&(yield this.#s[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(let s of this.#O()){let r=this.#s[s],n=this.#c(r)?r.__staleWhileFetching:r;if(n!==void 0&&t(n,this.#l[s],this))return this.get(this.#l[s],e)}}forEach(t,e=this){for(let s of this.#O()){let r=this.#s[s],n=this.#c(r)?r.__staleWhileFetching:r;n!==void 0&&t.call(e,n,this.#l[s],this)}}rforEach(t,e=this){for(let s of this.#C()){let r=this.#s[s],n=this.#c(r)?r.__staleWhileFetching:r;n!==void 0&&t.call(e,n,this.#l[s],this)}}purgeStale(){let t=!1;for(let e of this.#C({allowStale:!0}))this.#T(e)&&(this.#M(this.#l[e],"expire"),t=!0);return t}info(t){let e=this.#a.get(t);if(e===void 0)return;let s=this.#s[e],r=this.#c(s)?s.__staleWhileFetching:s;if(r===void 0)return;let n={value:r};if(this.#E&&this.#v){let o=this.#E[e],h=this.#v[e];if(o&&h){let a=o-(at.now()-h);n.ttl=a,n.start=Date.now()}}return this.#N&&(n.size=this.#N[e]),n}dump(){let t=[];for(let e of this.#O({allowStale:!0})){let s=this.#l[e],r=this.#s[e],n=this.#c(r)?r.__staleWhileFetching:r;if(n===void 0||s===void 0)continue;let o={value:n};if(this.#E&&this.#v){o.ttl=this.#E[e];let h=at.now()-this.#v[e];o.start=Math.floor(Date.now()-h)}this.#N&&(o.size=this.#N[e]),t.unshift([s,o])}return t}load(t){this.clear();for(let[e,s]of t){if(s.start){let r=Date.now()-s.start;s.start=at.now()-r}this.set(e,s.value,s)}}set(t,e,s={}){if(e===void 0)return this.delete(t),this;let{ttl:r=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:h=this.sizeCalculation,status:a}=s,{noUpdateTTL:l=this.noUpdateTTL}=s,f=this.#z(t,e,s.size||0,h);if(this.maxEntrySize&&f>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#M(t,"set"),this;let c=this.#h===0?void 0:this.#a.get(t);if(c===void 0)c=this.#h===0?this.#m:this.#A.length!==0?this.#A.pop():this.#h===this.#t?this.#I(!1):this.#h,this.#l[c]=t,this.#s[c]=e,this.#a.set(t,c),this.#u[this.#m]=c,this.#y[c]=this.#m,this.#m=c,this.#h++,this.#P(c,f,a),a&&(a.set="add"),l=!1,this.#k&&this.#r?.(e,t,"add");else{this.#W(c);let u=this.#s[c];if(e!==u){if(this.#R&&this.#c(u)){u.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:d}=u;d!==void 0&&!o&&(this.#S&&this.#n?.(d,t,"set"),this.#d&&this.#g?.push([d,t,"set"]))}else o||(this.#S&&this.#n?.(u,t,"set"),this.#d&&this.#g?.push([u,t,"set"]));if(this.#_(c),this.#P(c,f,a),this.#s[c]=e,a){a.set="replace";let d=u&&this.#c(u)?u.__staleWhileFetching:u;d!==void 0&&(a.oldValue=d)}}else a&&(a.set="update");this.#k&&this.onInsert?.(e,t,e===u?"update":"replace")}if(r!==0&&!this.#E&&this.#i(),this.#E&&(l||this.#D(c,r,n),a&&this.#x(a,c)),!o&&this.#d&&this.#g){let u=this.#g,d;for(;d=u?.shift();)this.#o?.(...d)}return this}pop(){try{for(;this.#h;){let t=this.#s[this.#p];if(this.#I(!0),this.#c(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#d&&this.#g){let t=this.#g,e;for(;e=t?.shift();)this.#o?.(...e)}}}#I(t){let e=this.#p,s=this.#l[e],r=this.#s[e];return this.#R&&this.#c(r)?r.__abortController.abort(new Error("evicted")):(this.#S||this.#d)&&(this.#S&&this.#n?.(r,s,"evict"),this.#d&&this.#g?.push([r,s,"evict"])),this.#_(e),t&&(this.#l[e]=void 0,this.#s[e]=void 0,this.#A.push(e)),this.#h===1?(this.#p=this.#m=0,this.#A.length=0):this.#p=this.#u[e],this.#a.delete(s),this.#h--,e}has(t,e={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:r}=e,n=this.#a.get(t);if(n!==void 0){let o=this.#s[n];if(this.#c(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#T(n))r&&(r.has="stale",this.#x(r,n));else return s&&this.#F(n),r&&(r.has="hit",this.#x(r,n)),!0}else r&&(r.has="miss");return!1}peek(t,e={}){let{allowStale:s=this.allowStale}=e,r=this.#a.get(t);if(r===void 0||!s&&this.#T(r))return;let n=this.#s[r];return this.#c(n)?n.__staleWhileFetching:n}#L(t,e,s,r){let n=e===void 0?void 0:this.#s[e];if(this.#c(n))return n;let o=new Ut,{signal:h}=s;h?.addEventListener("abort",()=>o.abort(h.reason),{signal:o.signal});let a={signal:o.signal,options:s,context:r},l=(p,w=!1)=>{let{aborted:m}=o.signal,S=s.ignoreFetchAbort&&p!==void 0;if(s.status&&(m&&!w?(s.status.fetchAborted=!0,s.status.fetchError=o.signal.reason,S&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),m&&!S&&!w)return c(o.signal.reason);let b=d;return this.#s[e]===d&&(p===void 0?b.__staleWhileFetching?this.#s[e]=b.__staleWhileFetching:this.#M(t,"fetch"):(s.status&&(s.status.fetchUpdated=!0),this.set(t,p,a.options))),p},f=p=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=p),c(p)),c=p=>{let{aborted:w}=o.signal,m=w&&s.allowStaleOnFetchAbort,S=m||s.allowStaleOnFetchRejection,b=S||s.noDeleteOnFetchRejection,y=d;if(this.#s[e]===d&&(!b||y.__staleWhileFetching===void 0?this.#M(t,"fetch"):m||(this.#s[e]=y.__staleWhileFetching)),S)return s.status&&y.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),y.__staleWhileFetching;if(y.__returned===y)throw p},u=(p,w)=>{let m=this.#b?.(t,n,a);m&&m instanceof Promise&&m.then(S=>p(S===void 0?void 0:S),w),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(p(void 0),s.allowStaleOnFetchAbort&&(p=S=>l(S,!0)))})};s.status&&(s.status.fetchDispatched=!0);let d=new Promise(u).then(l,f),g=Object.assign(d,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.set(t,g,{...a.options,status:void 0}),e=this.#a.get(t)):this.#s[e]=g,g}#c(t){if(!this.#R)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof Ut}async fetch(t,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:a=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:p,forceRefresh:w=!1,status:m,signal:S}=e;if(!this.#R)return m&&(m.fetch="get"),this.get(t,{allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,status:m});let b={allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:h,size:a,sizeCalculation:l,noUpdateTTL:f,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:g,ignoreFetchAbort:d,status:m,signal:S},y=this.#a.get(t);if(y===void 0){m&&(m.fetch="miss");let E=this.#L(t,y,b,p);return E.__returned=E}else{let E=this.#s[y];if(this.#c(E)){let xt=s&&E.__staleWhileFetching!==void 0;return m&&(m.fetch="inflight",xt&&(m.returnedStale=!0)),xt?E.__staleWhileFetching:E.__returned=E}let x=this.#T(y);if(!w&&!x)return m&&(m.fetch="hit"),this.#W(y),r&&this.#F(y),m&&this.#x(m,y),E;let V=this.#L(t,y,b,p),M=V.__staleWhileFetching!==void 0&&s;return m&&(m.fetch=x?"stale":"refresh",M&&x&&(m.returnedStale=!0)),M?V.__staleWhileFetching:V.__returned=V}}async forceFetch(t,e={}){let s=await this.fetch(t,e);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(t,e={}){let s=this.#w;if(!s)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:n,...o}=e,h=this.get(t,o);if(!n&&h!==void 0)return h;let a=s(t,h,{options:o,context:r});return this.set(t,a,o),a}get(t,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=e,h=this.#a.get(t);if(h!==void 0){let a=this.#s[h],l=this.#c(a);return o&&this.#x(o,h),this.#T(h)?(o&&(o.get="stale"),l?(o&&s&&a.__staleWhileFetching!==void 0&&(o.returnedStale=!0),s?a.__staleWhileFetching:void 0):(n||this.#M(t,"expire"),o&&s&&(o.returnedStale=!0),s?a:void 0)):(o&&(o.get="hit"),l?a.__staleWhileFetching:(this.#W(h),r&&this.#F(h),a))}else o&&(o.get="miss")}#$(t,e){this.#y[e]=t,this.#u[t]=e}#W(t){t!==this.#m&&(t===this.#p?this.#p=this.#u[t]:this.#$(this.#y[t],this.#u[t]),this.#$(this.#m,t),this.#m=t)}delete(t){return this.#M(t,"delete")}#M(t,e){let s=!1;if(this.#h!==0){let r=this.#a.get(t);if(r!==void 0)if(s=!0,this.#h===1)this.#j(e);else{this.#_(r);let n=this.#s[r];if(this.#c(n)?n.__abortController.abort(new Error("deleted")):(this.#S||this.#d)&&(this.#S&&this.#n?.(n,t,e),this.#d&&this.#g?.push([n,t,e])),this.#a.delete(t),this.#l[r]=void 0,this.#s[r]=void 0,r===this.#m)this.#m=this.#y[r];else if(r===this.#p)this.#p=this.#u[r];else{let o=this.#y[r];this.#u[o]=this.#u[r];let h=this.#u[r];this.#y[h]=this.#y[r]}this.#h--,this.#A.push(r)}}if(this.#d&&this.#g?.length){let r=this.#g,n;for(;n=r?.shift();)this.#o?.(...n)}return s}clear(){return this.#j("delete")}#j(t){for(let e of this.#C({allowStale:!0})){let s=this.#s[e];if(this.#c(s))s.__abortController.abort(new Error("deleted"));else{let r=this.#l[e];this.#S&&this.#n?.(s,r,t),this.#d&&this.#g?.push([s,r,t])}}if(this.#a.clear(),this.#s.fill(void 0),this.#l.fill(void 0),this.#E&&this.#v&&(this.#E.fill(0),this.#v.fill(0)),this.#N&&this.#N.fill(0),this.#p=0,this.#m=0,this.#A.length=0,this.#f=0,this.#h=0,this.#d&&this.#g){let e=this.#g,s;for(;s=e?.shift();)this.#o?.(...s)}}};import{posix as Gr,win32 as Fe}from"node:path";import{fileURLToPath as Hr}from"node:url";import{lstatSync as Vr,readdir as qr,readdirSync as Kr,readlinkSync as Yr,realpathSync as Xr}from"fs";import*as Jr from"node:fs";import{lstat as Qr,readdir as tn,readlink as en,realpath as sn}from"node:fs/promises";import{EventEmitter as ke}from"node:events";import Ls from"node:stream";import{StringDecoder as _r}from"node:string_decoder";var Ds=typeof process=="object"&&process?process:{stdout:null,stderr:null},Lr=i=>!!i&&typeof i=="object"&&(i instanceof tt||i instanceof Ls||Pr(i)||Ir(i)),Pr=i=>!!i&&typeof i=="object"&&i instanceof ke&&typeof i.pipe=="function"&&i.pipe!==Ls.Writable.prototype.pipe,Ir=i=>!!i&&typeof i=="object"&&i instanceof ke&&typeof i.write=="function"&&typeof i.end=="function",q=Symbol("EOF"),K=Symbol("maybeEmitEnd"),Q=Symbol("emittedEnd"),$t=Symbol("emittingEnd"),Nt=Symbol("emittedError"),Gt=Symbol("closed"),Ms=Symbol("read"),Ht=Symbol("flush"),Fs=Symbol("flushChunk"),B=Symbol("encoding"),ct=Symbol("decoder"),T=Symbol("flowing"),Ct=Symbol("paused"),ft=Symbol("resume"),R=Symbol("buffer"),D=Symbol("pipes"),O=Symbol("bufferLength"),Te=Symbol("bufferPush"),Vt=Symbol("bufferShift"),N=Symbol("objectMode"),v=Symbol("destroyed"),Re=Symbol("error"),Oe=Symbol("emitData"),_s=Symbol("emitEnd"),Ae=Symbol("emitEnd2"),G=Symbol("async"),Ne=Symbol("abort"),qt=Symbol("aborted"),kt=Symbol("signal"),rt=Symbol("dataListeners"),L=Symbol("discarded"),Dt=i=>Promise.resolve().then(i),Wr=i=>i(),jr=i=>i==="end"||i==="finish"||i==="prefinish",Br=i=>i instanceof ArrayBuffer||!!i&&typeof i=="object"&&i.constructor&&i.constructor.name==="ArrayBuffer"&&i.byteLength>=0,zr=i=>!Buffer.isBuffer(i)&&ArrayBuffer.isView(i),Kt=class{src;dest;opts;ondrain;constructor(t,e,s){this.src=t,this.dest=e,this.opts=s,this.ondrain=()=>t[ft](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Ce=class extends Kt{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,e,s){super(t,e,s),this.proxyErrors=r=>e.emit("error",r),t.on("error",this.proxyErrors)}},Ur=i=>!!i.objectMode,$r=i=>!i.objectMode&&!!i.encoding&&i.encoding!=="buffer",tt=class extends ke{[T]=!1;[Ct]=!1;[D]=[];[R]=[];[N];[B];[G];[ct];[q]=!1;[Q]=!1;[$t]=!1;[Gt]=!1;[Nt]=null;[O]=0;[v]=!1;[kt];[qt]=!1;[rt]=0;[L]=!1;writable=!0;readable=!0;constructor(...t){let e=t[0]||{};if(super(),e.objectMode&&typeof e.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");Ur(e)?(this[N]=!0,this[B]=null):$r(e)?(this[B]=e.encoding,this[N]=!1):(this[N]=!1,this[B]=null),this[G]=!!e.async,this[ct]=this[B]?new _r(this[B]):null,e&&e.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[R]}),e&&e.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[D]});let{signal:s}=e;s&&(this[kt]=s,s.aborted?this[Ne]():s.addEventListener("abort",()=>this[Ne]()))}get bufferLength(){return this[O]}get encoding(){return this[B]}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[N]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[G]}set async(t){this[G]=this[G]||!!t}[Ne](){this[qt]=!0,this.emit("abort",this[kt]?.reason),this.destroy(this[kt]?.reason)}get aborted(){return this[qt]}set aborted(t){}write(t,e,s){if(this[qt])return!1;if(this[q])throw new Error("write after end");if(this[v])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof e=="function"&&(s=e,e="utf8"),e||(e="utf8");let r=this[G]?Dt:Wr;if(!this[N]&&!Buffer.isBuffer(t)){if(zr(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(Br(t))t=Buffer.from(t);else if(typeof t!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[N]?(this[T]&&this[O]!==0&&this[Ht](!0),this[T]?this.emit("data",t):this[Te](t),this[O]!==0&&this.emit("readable"),s&&r(s),this[T]):t.length?(typeof t=="string"&&!(e===this[B]&&!this[ct]?.lastNeed)&&(t=Buffer.from(t,e)),Buffer.isBuffer(t)&&this[B]&&(t=this[ct].write(t)),this[T]&&this[O]!==0&&this[Ht](!0),this[T]?this.emit("data",t):this[Te](t),this[O]!==0&&this.emit("readable"),s&&r(s),this[T]):(this[O]!==0&&this.emit("readable"),s&&r(s),this[T])}read(t){if(this[v])return null;if(this[L]=!1,this[O]===0||t===0||t&&t>this[O])return this[K](),null;this[N]&&(t=null),this[R].length>1&&!this[N]&&(this[R]=[this[B]?this[R].join(""):Buffer.concat(this[R],this[O])]);let e=this[Ms](t||null,this[R][0]);return this[K](),e}[Ms](t,e){if(this[N])this[Vt]();else{let s=e;t===s.length||t===null?this[Vt]():typeof s=="string"?(this[R][0]=s.slice(t),e=s.slice(0,t),this[O]-=t):(this[R][0]=s.subarray(t),e=s.subarray(0,t),this[O]-=t)}return this.emit("data",e),!this[R].length&&!this[q]&&this.emit("drain"),e}end(t,e,s){return typeof t=="function"&&(s=t,t=void 0),typeof e=="function"&&(s=e,e="utf8"),t!==void 0&&this.write(t,e),s&&this.once("end",s),this[q]=!0,this.writable=!1,(this[T]||!this[Ct])&&this[K](),this}[ft](){this[v]||(!this[rt]&&!this[D].length&&(this[L]=!0),this[Ct]=!1,this[T]=!0,this.emit("resume"),this[R].length?this[Ht]():this[q]?this[K]():this.emit("drain"))}resume(){return this[ft]()}pause(){this[T]=!1,this[Ct]=!0,this[L]=!1}get destroyed(){return this[v]}get flowing(){return this[T]}get paused(){return this[Ct]}[Te](t){this[N]?this[O]+=1:this[O]+=t.length,this[R].push(t)}[Vt](){return this[N]?this[O]-=1:this[O]-=this[R][0].length,this[R].shift()}[Ht](t=!1){do;while(this[Fs](this[Vt]())&&this[R].length);!t&&!this[R].length&&!this[q]&&this.emit("drain")}[Fs](t){return this.emit("data",t),this[T]}pipe(t,e){if(this[v])return t;this[L]=!1;let s=this[Q];return e=e||{},t===Ds.stdout||t===Ds.stderr?e.end=!1:e.end=e.end!==!1,e.proxyErrors=!!e.proxyErrors,s?e.end&&t.end():(this[D].push(e.proxyErrors?new Ce(this,t,e):new Kt(this,t,e)),this[G]?Dt(()=>this[ft]()):this[ft]()),t}unpipe(t){let e=this[D].find(s=>s.dest===t);e&&(this[D].length===1?(this[T]&&this[rt]===0&&(this[T]=!1),this[D]=[]):this[D].splice(this[D].indexOf(e),1),e.unpipe())}addListener(t,e){return this.on(t,e)}on(t,e){let s=super.on(t,e);if(t==="data")this[L]=!1,this[rt]++,!this[D].length&&!this[T]&&this[ft]();else if(t==="readable"&&this[O]!==0)super.emit("readable");else if(jr(t)&&this[Q])super.emit(t),this.removeAllListeners(t);else if(t==="error"&&this[Nt]){let r=e;this[G]?Dt(()=>r.call(this,this[Nt])):r.call(this,this[Nt])}return s}removeListener(t,e){return this.off(t,e)}off(t,e){let s=super.off(t,e);return t==="data"&&(this[rt]=this.listeners("data").length,this[rt]===0&&!this[L]&&!this[D].length&&(this[T]=!1)),s}removeAllListeners(t){let e=super.removeAllListeners(t);return(t==="data"||t===void 0)&&(this[rt]=0,!this[L]&&!this[D].length&&(this[T]=!1)),e}get emittedEnd(){return this[Q]}[K](){!this[$t]&&!this[Q]&&!this[v]&&this[R].length===0&&this[q]&&(this[$t]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Gt]&&this.emit("close"),this[$t]=!1)}emit(t,...e){let s=e[0];if(t!=="error"&&t!=="close"&&t!==v&&this[v])return!1;if(t==="data")return!this[N]&&!s?!1:this[G]?(Dt(()=>this[Oe](s)),!0):this[Oe](s);if(t==="end")return this[_s]();if(t==="close"){if(this[Gt]=!0,!this[Q]&&!this[v])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(t==="error"){this[Nt]=s,super.emit(Re,s);let n=!this[kt]||this.listeners("error").length?super.emit("error",s):!1;return this[K](),n}else if(t==="resume"){let n=super.emit("resume");return this[K](),n}else if(t==="finish"||t==="prefinish"){let n=super.emit(t);return this.removeAllListeners(t),n}let r=super.emit(t,...e);return this[K](),r}[Oe](t){for(let s of this[D])s.dest.write(t)===!1&&this.pause();let e=this[L]?!1:super.emit("data",t);return this[K](),e}[_s](){return this[Q]?!1:(this[Q]=!0,this.readable=!1,this[G]?(Dt(()=>this[Ae]()),!0):this[Ae]())}[Ae](){if(this[ct]){let e=this[ct].end();if(e){for(let s of this[D])s.dest.write(e);this[L]||super.emit("data",e)}}for(let e of this[D])e.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[N]||(t.dataLength=0);let e=this.promise();return this.on("data",s=>{t.push(s),this[N]||(t.dataLength+=s.length)}),await e,t}async concat(){if(this[N])throw new Error("cannot concat in objectMode");let t=await this.collect();return this[B]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,e)=>{this.on(v,()=>e(new Error("stream destroyed"))),this.on("error",s=>e(s)),this.on("end",()=>t())})}[Symbol.asyncIterator](){this[L]=!1;let t=!1,e=async()=>(this.pause(),t=!0,{value:void 0,done:!0});return{next:()=>{if(t)return e();let r=this.read();if(r!==null)return Promise.resolve({done:!1,value:r});if(this[q])return e();let n,o,h=c=>{this.off("data",a),this.off("end",l),this.off(v,f),e(),o(c)},a=c=>{this.off("error",h),this.off("end",l),this.off(v,f),this.pause(),n({value:c,done:!!this[q]})},l=()=>{this.off("error",h),this.off("data",a),this.off(v,f),e(),n({done:!0,value:void 0})},f=()=>h(new Error("stream destroyed"));return new Promise((c,u)=>{o=u,n=c,this.once(v,f),this.once("error",h),this.once("end",l),this.once("data",a)})},throw:e,return:e,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[L]=!1;let t=!1,e=()=>(this.pause(),this.off(Re,e),this.off(v,e),this.off("end",e),t=!0,{done:!0,value:void 0}),s=()=>{if(t)return e();let r=this.read();return r===null?e():{done:!1,value:r}};return this.once("end",e),this.once(Re,e),this.once(v,e),{next:s,throw:e,return:e,[Symbol.iterator](){return this}}}destroy(t){if(this[v])return t?this.emit("error",t):this.emit(v),this;this[v]=!0,this[L]=!0,this[R].length=0,this[O]=0;let e=this;return typeof e.close=="function"&&!this[Gt]&&e.close(),t?this.emit("error",t):this.emit(v),this}static get isStream(){return Lr}};var Zr=Xr.native,Ft={lstatSync:Vr,readdir:qr,readdirSync:Kr,readlinkSync:Yr,realpathSync:Zr,promises:{lstat:Qr,readdir:tn,readlink:en,realpath:sn}},Bs=i=>!i||i===Ft||i===Jr?Ft:{...Ft,...i,promises:{...Ft.promises,...i.promises||{}}},zs=/^\\\\\?\\([a-z]:)\\?$/i,rn=i=>i.replace(/\//g,"\\").replace(zs,"$1\\"),nn=/[\\\/]/,W=0,Us=1,$s=2,H=4,Gs=6,Hs=8,nt=10,Vs=12,I=15,Mt=~I,De=16,Ps=32,_t=64,z=128,Yt=256,Jt=512,Is=_t|z|Jt,on=1023,Me=i=>i.isFile()?Hs:i.isDirectory()?H:i.isSymbolicLink()?nt:i.isCharacterDevice()?$s:i.isBlockDevice()?Gs:i.isSocket()?Vs:i.isFIFO()?Us:W,Ws=new Map,Lt=i=>{let t=Ws.get(i);if(t)return t;let e=i.normalize("NFKD");return Ws.set(i,e),e},js=new Map,Xt=i=>{let t=js.get(i);if(t)return t;let e=Lt(i.toLowerCase());return js.set(i,e),e},Zt=class extends At{constructor(){super({max:256})}},_e=class extends At{constructor(t=16*1024){super({maxSize:t,sizeCalculation:e=>e.length+1})}},qs=Symbol("PathScurry setAsCwd"),C=class{name;root;roots;parent;nocase;isCWD=!1;#t;#e;get dev(){return this.#e}#n;get mode(){return this.#n}#r;get nlink(){return this.#r}#o;get uid(){return this.#o}#b;get gid(){return this.#b}#w;get rdev(){return this.#w}#h;get blksize(){return this.#h}#f;get ino(){return this.#f}#a;get size(){return this.#a}#l;get blocks(){return this.#l}#s;get atimeMs(){return this.#s}#u;get mtimeMs(){return this.#u}#y;get ctimeMs(){return this.#y}#p;get birthtimeMs(){return this.#p}#m;get atime(){return this.#m}#A;get mtime(){return this.#A}#g;get ctime(){return this.#g}#N;get birthtime(){return this.#N}#v;#E;#S;#R;#d;#k;#i;#F;#x;#D;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(t,e=W,s,r,n,o,h){this.name=t,this.#v=n?Xt(t):Lt(t),this.#i=e&on,this.nocase=n,this.roots=r,this.root=s||this,this.#F=o,this.#S=h.fullpath,this.#d=h.relative,this.#k=h.relativePosix,this.parent=h.parent,this.parent?this.#t=this.parent.#t:this.#t=Bs(h.fs)}depth(){return this.#E!==void 0?this.#E:this.parent?this.#E=this.parent.depth()+1:this.#E=0}childrenCache(){return this.#F}resolve(t){if(!t)return this;let e=this.getRootString(t),r=t.substring(e.length).split(this.splitSep);return e?this.getRoot(e).#T(r):this.#T(r)}#T(t){let e=this;for(let s of t)e=e.child(s);return e}children(){let t=this.#F.get(this);if(t)return t;let e=Object.assign([],{provisional:0});return this.#F.set(this,e),this.#i&=~De,e}child(t,e){if(t===""||t===".")return this;if(t==="..")return this.parent||this;let s=this.children(),r=this.nocase?Xt(t):Lt(t);for(let a of s)if(a.#v===r)return a;let n=this.parent?this.sep:"",o=this.#S?this.#S+n+t:void 0,h=this.newChild(t,W,{...e,parent:this,fullpath:o});return this.canReaddir()||(h.#i|=z),s.push(h),h}relative(){if(this.isCWD)return"";if(this.#d!==void 0)return this.#d;let t=this.name,e=this.parent;if(!e)return this.#d=this.name;let s=e.relative();return s+(!s||!e.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#k!==void 0)return this.#k;let t=this.name,e=this.parent;if(!e)return this.#k=this.fullpathPosix();let s=e.relativePosix();return s+(!s||!e.parent?"":"/")+t}fullpath(){if(this.#S!==void 0)return this.#S;let t=this.name,e=this.parent;if(!e)return this.#S=this.name;let r=e.fullpath()+(e.parent?this.sep:"")+t;return this.#S=r}fullpathPosix(){if(this.#R!==void 0)return this.#R;if(this.sep==="/")return this.#R=this.fullpath();if(!this.parent){let r=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(r)?this.#R=`//?/${r}`:this.#R=r}let t=this.parent,e=t.fullpathPosix(),s=e+(!e||!t.parent?"":"/")+this.name;return this.#R=s}isUnknown(){return(this.#i&I)===W}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&I)===Hs}isDirectory(){return(this.#i&I)===H}isCharacterDevice(){return(this.#i&I)===$s}isBlockDevice(){return(this.#i&I)===Gs}isFIFO(){return(this.#i&I)===Us}isSocket(){return(this.#i&I)===Vs}isSymbolicLink(){return(this.#i&nt)===nt}lstatCached(){return this.#i&Ps?this:void 0}readlinkCached(){return this.#x}realpathCached(){return this.#D}readdirCached(){let t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(this.#x)return!0;if(!this.parent)return!1;let t=this.#i&I;return!(t!==W&&t!==nt||this.#i&Yt||this.#i&z)}calledReaddir(){return!!(this.#i&De)}isENOENT(){return!!(this.#i&z)}isNamed(t){return this.nocase?this.#v===Xt(t):this.#v===Lt(t)}async readlink(){let t=this.#x;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=await this.#t.promises.readlink(this.fullpath()),s=(await this.parent.realpath())?.resolve(e);if(s)return this.#x=s}catch(e){this.#I(e.code);return}}readlinkSync(){let t=this.#x;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=this.#t.readlinkSync(this.fullpath()),s=this.parent.realpathSync()?.resolve(e);if(s)return this.#x=s}catch(e){this.#I(e.code);return}}#B(t){this.#i|=De;for(let e=t.provisional;e<t.length;e++){let s=t[e];s&&s.#_()}}#_(){this.#i&z||(this.#i=(this.#i|z)&Mt,this.#P())}#P(){let t=this.children();t.provisional=0;for(let e of t)e.#_()}#z(){this.#i|=Jt,this.#O()}#O(){if(this.#i&_t)return;let t=this.#i;(t&I)===H&&(t&=Mt),this.#i=t|_t,this.#P()}#C(t=""){t==="ENOTDIR"||t==="EPERM"?this.#O():t==="ENOENT"?this.#_():this.children().provisional=0}#U(t=""){t==="ENOTDIR"?this.parent.#O():t==="ENOENT"&&this.#_()}#I(t=""){let e=this.#i;e|=Yt,t==="ENOENT"&&(e|=z),(t==="EINVAL"||t==="UNKNOWN")&&(e&=Mt),this.#i=e,t==="ENOTDIR"&&this.parent&&this.parent.#O()}#L(t,e){return this.#$(t,e)||this.#c(t,e)}#c(t,e){let s=Me(t),r=this.newChild(t.name,s,{parent:this}),n=r.#i&I;return n!==H&&n!==nt&&n!==W&&(r.#i|=_t),e.unshift(r),e.provisional++,r}#$(t,e){for(let s=e.provisional;s<e.length;s++){let r=e[s];if((this.nocase?Xt(t.name):Lt(t.name))===r.#v)return this.#W(t,r,s,e)}}#W(t,e,s,r){let n=e.name;return e.#i=e.#i&Mt|Me(t),n!==t.name&&(e.name=t.name),s!==r.provisional&&(s===r.length-1?r.pop():r.splice(s,1),r.unshift(e)),r.provisional++,e}async lstat(){if(!(this.#i&z))try{return this.#M(await this.#t.promises.lstat(this.fullpath())),this}catch(t){this.#U(t.code)}}lstatSync(){if(!(this.#i&z))try{return this.#M(this.#t.lstatSync(this.fullpath())),this}catch(t){this.#U(t.code)}}#M(t){let{atime:e,atimeMs:s,birthtime:r,birthtimeMs:n,blksize:o,blocks:h,ctime:a,ctimeMs:l,dev:f,gid:c,ino:u,mode:d,mtime:g,mtimeMs:p,nlink:w,rdev:m,size:S,uid:b}=t;this.#m=e,this.#s=s,this.#N=r,this.#p=n,this.#h=o,this.#l=h,this.#g=a,this.#y=l,this.#e=f,this.#b=c,this.#f=u,this.#n=d,this.#A=g,this.#u=p,this.#r=w,this.#w=m,this.#a=S,this.#o=b;let y=Me(t);this.#i=this.#i&Mt|y|Ps,y!==W&&y!==H&&y!==nt&&(this.#i|=_t)}#j=[];#H=!1;#V(t){this.#H=!1;let e=this.#j.slice();this.#j.length=0,e.forEach(s=>s(null,t))}readdirCB(t,e=!1){if(!this.canReaddir()){e?t(null,[]):queueMicrotask(()=>t(null,[]));return}let s=this.children();if(this.calledReaddir()){let n=s.slice(0,s.provisional);e?t(null,n):queueMicrotask(()=>t(null,n));return}if(this.#j.push(t),this.#H)return;this.#H=!0;let r=this.fullpath();this.#t.readdir(r,{withFileTypes:!0},(n,o)=>{if(n)this.#C(n.code),s.provisional=0;else{for(let h of o)this.#L(h,s);this.#B(s)}this.#V(s.slice(0,s.provisional))})}#G;async readdir(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();if(this.#G)await this.#G;else{let s=()=>{};this.#G=new Promise(r=>s=r);try{for(let r of await this.#t.promises.readdir(e,{withFileTypes:!0}))this.#L(r,t);this.#B(t)}catch(r){this.#C(r.code),t.provisional=0}this.#G=void 0,s()}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();try{for(let s of this.#t.readdirSync(e,{withFileTypes:!0}))this.#L(s,t);this.#B(t)}catch(s){this.#C(s.code),t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(this.#i&Is)return!1;let t=I&this.#i;return t===W||t===H||t===nt}shouldWalk(t,e){return(this.#i&H)===H&&!(this.#i&Is)&&!t.has(this)&&(!e||e(this))}async realpath(){if(this.#D)return this.#D;if(!((Jt|Yt|z)&this.#i))try{let t=await this.#t.promises.realpath(this.fullpath());return this.#D=this.resolve(t)}catch{this.#z()}}realpathSync(){if(this.#D)return this.#D;if(!((Jt|Yt|z)&this.#i))try{let t=this.#t.realpathSync(this.fullpath());return this.#D=this.resolve(t)}catch{this.#z()}}[qs](t){if(t===this)return;t.isCWD=!1,this.isCWD=!0;let e=new Set([]),s=[],r=this;for(;r&&r.parent;)e.add(r),r.#d=s.join(this.sep),r.#k=s.join("/"),r=r.parent,s.push("..");for(r=t;r&&r.parent&&!e.has(r);)r.#d=void 0,r.#k=void 0,r=r.parent}},Qt=class i extends C{sep="\\";splitSep=nn;constructor(t,e=W,s,r,n,o,h){super(t,e,s,r,n,o,h)}newChild(t,e=W,s={}){return new i(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}getRootString(t){return Fe.parse(t).root}getRoot(t){if(t=rn(t.toUpperCase()),t===this.root.name)return this.root;for(let[e,s]of Object.entries(this.roots))if(this.sameRoot(t,e))return this.roots[t]=s;return this.roots[t]=new ut(t,this).root}sameRoot(t,e=this.root.name){return t=t.toUpperCase().replace(/\//g,"\\").replace(zs,"$1\\"),t===e}},te=class i extends C{splitSep="/";sep="/";constructor(t,e=W,s,r,n,o,h){super(t,e,s,r,n,o,h)}getRootString(t){return t.startsWith("/")?"/":""}getRoot(t){return this.root}newChild(t,e=W,s={}){return new i(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}},ee=class{root;rootPath;roots;cwd;#t;#e;#n;nocase;#r;constructor(t=process.cwd(),e,s,{nocase:r,childrenCacheSize:n=16*1024,fs:o=Ft}={}){this.#r=Bs(o),(t instanceof URL||t.startsWith("file://"))&&(t=Hr(t));let h=e.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(h),this.#t=new Zt,this.#e=new Zt,this.#n=new _e(n);let a=h.substring(this.rootPath.length).split(s);if(a.length===1&&!a[0]&&a.pop(),r===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=r,this.root=this.newRoot(this.#r),this.roots[this.rootPath]=this.root;let l=this.root,f=a.length-1,c=e.sep,u=this.rootPath,d=!1;for(let g of a){let p=f--;l=l.child(g,{relative:new Array(p).fill("..").join(c),relativePosix:new Array(p).fill("..").join("/"),fullpath:u+=(d?"":c)+g}),d=!0}this.cwd=l}depth(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return this.#n}resolve(...t){let e="";for(let n=t.length-1;n>=0;n--){let o=t[n];if(!(!o||o===".")&&(e=e?`${o}/${e}`:o,this.isAbsolute(o)))break}let s=this.#t.get(e);if(s!==void 0)return s;let r=this.cwd.resolve(e).fullpath();return this.#t.set(e,r),r}resolvePosix(...t){let e="";for(let n=t.length-1;n>=0;n--){let o=t[n];if(!(!o||o===".")&&(e=e?`${o}/${e}`:o,this.isAbsolute(o)))break}let s=this.#e.get(e);if(s!==void 0)return s;let r=this.cwd.resolve(e).fullpathPosix();return this.#e.set(e,r),r}relative(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relative()}relativePosix(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relativePosix()}basename(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.name}dirname(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),(t.parent||t).fullpath()}async readdir(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof C||(e=t,t=this.cwd);let{withFileTypes:s}=e;if(t.canReaddir()){let r=await t.readdir();return s?r:r.map(n=>n.name)}else return[]}readdirSync(t=this.cwd,e={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof C||(e=t,t=this.cwd);let{withFileTypes:s=!0}=e;return t.canReaddir()?s?t.readdirSync():t.readdirSync().map(r=>r.name):[]}async lstat(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstat()}lstatSync(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof C||(e=t.withFileTypes,t=this.cwd);let s=await t.readlink();return e?s:s?.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof C||(e=t.withFileTypes,t=this.cwd);let s=t.readlinkSync();return e?s:s?.fullpath()}async realpath(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof C||(e=t.withFileTypes,t=this.cwd);let s=await t.realpath();return e?s:s?.fullpath()}realpathSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof C||(e=t.withFileTypes,t=this.cwd);let s=t.realpathSync();return e?s:s?.fullpath()}async walk(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof C||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:r=!1,filter:n,walkFilter:o}=e,h=[];(!n||n(t))&&h.push(s?t:t.fullpath());let a=new Set,l=(c,u)=>{a.add(c),c.readdirCB((d,g)=>{if(d)return u(d);let p=g.length;if(!p)return u();let w=()=>{--p===0&&u()};for(let m of g)(!n||n(m))&&h.push(s?m:m.fullpath()),r&&m.isSymbolicLink()?m.realpath().then(S=>S?.isUnknown()?S.lstat():S).then(S=>S?.shouldWalk(a,o)?l(S,w):w()):m.shouldWalk(a,o)?l(m,w):w()},!0)},f=t;return new Promise((c,u)=>{l(f,d=>{if(d)return u(d);c(h)})})}walkSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof C||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:r=!1,filter:n,walkFilter:o}=e,h=[];(!n||n(t))&&h.push(s?t:t.fullpath());let a=new Set([t]);for(let l of a){let f=l.readdirSync();for(let c of f){(!n||n(c))&&h.push(s?c:c.fullpath());let u=c;if(c.isSymbolicLink()){if(!(r&&(u=c.realpathSync())))continue;u.isUnknown()&&u.lstatSync()}u.shouldWalk(a,o)&&a.add(u)}}return h}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,e={}){return typeof t=="string"?t=this.cwd.resolve(t):t instanceof C||(e=t,t=this.cwd),this.stream(t,e)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof C||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:r=!1,filter:n,walkFilter:o}=e;(!n||n(t))&&(yield s?t:t.fullpath());let h=new Set([t]);for(let a of h){let l=a.readdirSync();for(let f of l){(!n||n(f))&&(yield s?f:f.fullpath());let c=f;if(f.isSymbolicLink()){if(!(r&&(c=f.realpathSync())))continue;c.isUnknown()&&c.lstatSync()}c.shouldWalk(h,o)&&h.add(c)}}}stream(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof C||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:r=!1,filter:n,walkFilter:o}=e,h=new tt({objectMode:!0});(!n||n(t))&&h.write(s?t:t.fullpath());let a=new Set,l=[t],f=0,c=()=>{let u=!1;for(;!u;){let d=l.shift();if(!d){f===0&&h.end();return}f++,a.add(d);let g=(w,m,S=!1)=>{if(w)return h.emit("error",w);if(r&&!S){let b=[];for(let y of m)y.isSymbolicLink()&&b.push(y.realpath().then(E=>E?.isUnknown()?E.lstat():E));if(b.length){Promise.all(b).then(()=>g(null,m,!0));return}}for(let b of m)b&&(!n||n(b))&&(h.write(s?b:b.fullpath())||(u=!0));f--;for(let b of m){let y=b.realpathCached()||b;y.shouldWalk(a,o)&&l.push(y)}u&&!h.flowing?h.once("drain",c):p||c()},p=!0;d.readdirCB(g,!0),p=!1}};return c(),h}streamSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof C||(e=t,t=this.cwd);let{withFileTypes:s=!0,follow:r=!1,filter:n,walkFilter:o}=e,h=new tt({objectMode:!0}),a=new Set;(!n||n(t))&&h.write(s?t:t.fullpath());let l=[t],f=0,c=()=>{let u=!1;for(;!u;){let d=l.shift();if(!d){f===0&&h.end();return}f++,a.add(d);let g=d.readdirSync();for(let p of g)(!n||n(p))&&(h.write(s?p:p.fullpath())||(u=!0));f--;for(let p of g){let w=p;if(p.isSymbolicLink()){if(!(r&&(w=p.realpathSync())))continue;w.isUnknown()&&w.lstatSync()}w.shouldWalk(a,o)&&l.push(w)}}u&&!h.flowing&&h.once("drain",c)};return c(),h}chdir(t=this.cwd){let e=this.cwd;this.cwd=typeof t=="string"?this.cwd.resolve(t):t,this.cwd[qs](e)}},ut=class extends ee{sep="\\";constructor(t=process.cwd(),e={}){let{nocase:s=!0}=e;super(t,Fe,"\\",{...e,nocase:s}),this.nocase=s;for(let r=this.cwd;r;r=r.parent)r.nocase=this.nocase}parseRootPath(t){return Fe.parse(t).root.toUpperCase()}newRoot(t){return new Qt(this.rootPath,H,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}},dt=class extends ee{sep="/";constructor(t=process.cwd(),e={}){let{nocase:s=!1}=e;super(t,Gr,"/",{...e,nocase:s}),this.nocase=s}parseRootPath(t){return"/"}newRoot(t){return new te(this.rootPath,H,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}},Pt=class extends dt{constructor(t=process.cwd(),e={}){let{nocase:s=!0}=e;super(t,{...e,nocase:s})}},Zo=process.platform==="win32"?Qt:te,Ks=process.platform==="win32"?ut:process.platform==="darwin"?Pt:dt;var hn=i=>i.length>=1,an=i=>i.length>=1,pt=class i{#t;#e;#n;length;#r;#o;#b;#w;#h;#f;#a=!0;constructor(t,e,s,r){if(!hn(t))throw new TypeError("empty pattern list");if(!an(e))throw new TypeError("empty glob list");if(e.length!==t.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=t.length,s<0||s>=this.length)throw new TypeError("index out of range");if(this.#t=t,this.#e=e,this.#n=s,this.#r=r,this.#n===0){if(this.isUNC()){let[n,o,h,a,...l]=this.#t,[f,c,u,d,...g]=this.#e;l[0]===""&&(l.shift(),g.shift());let p=[n,o,h,a,""].join("/"),w=[f,c,u,d,""].join("/");this.#t=[p,...l],this.#e=[w,...g],this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){let[n,...o]=this.#t,[h,...a]=this.#e;o[0]===""&&(o.shift(),a.shift());let l=n+"/",f=h+"/";this.#t=[l,...o],this.#e=[f,...a],this.length=this.#t.length}}}pattern(){return this.#t[this.#n]}isString(){return typeof this.#t[this.#n]=="string"}isGlobstar(){return this.#t[this.#n]===A}isRegExp(){return this.#t[this.#n]instanceof RegExp}globString(){return this.#b=this.#b||(this.#n===0?this.isAbsolute()?this.#e[0]+this.#e.slice(1).join("/"):this.#e.join("/"):this.#e.slice(this.#n).join("/"))}hasMore(){return this.length>this.#n+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new i(this.#t,this.#e,this.#n+1,this.#r),this.#o.#f=this.#f,this.#o.#h=this.#h,this.#o.#w=this.#w,this.#o):this.#o=null}isUNC(){let t=this.#t;return this.#h!==void 0?this.#h:this.#h=this.#r==="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.#w!==void 0?this.#w:this.#w=this.#r==="win32"&&this.#n===0&&this.length>1&&typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0])}isAbsolute(){let t=this.#t;return this.#f!==void 0?this.#f:this.#f=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 ln=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",mt=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(t,{nobrace:e,nocase:s,noext:r,noglobstar:n,platform:o=ln}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:e,nocase:s,noext:r,noglobstar:n,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let h of t)this.add(h)}add(t){let e=new _(t,this.mmopts);for(let s=0;s<e.set.length;s++){let r=e.set[s],n=e.globParts[s];if(!r||!n)throw new Error("invalid pattern object");for(;r[0]==="."&&n[0]===".";)r.shift(),n.shift();let o=new pt(r,n,0,this.platform),h=new _(o.globString(),this.mmopts),a=n[n.length-1]==="**",l=o.isAbsolute();l?this.absolute.push(h):this.relative.push(h),a&&(l?this.absoluteChildren.push(h):this.relativeChildren.push(h))}}ignored(t){let e=t.fullpath(),s=`${e}/`,r=t.relative()||".",n=`${r}/`;for(let o of this.relative)if(o.match(r)||o.match(n))return!0;for(let o of this.absolute)if(o.match(e)||o.match(s))return!0;return!1}childrenIgnored(t){let e=t.fullpath()+"/",s=(t.relative()||".")+"/";for(let r of this.relativeChildren)if(r.match(s))return!0;for(let r of this.absoluteChildren)if(r.match(e))return!0;return!1}};var Le=class i{store;constructor(t=new Map){this.store=t}copy(){return new i(new Map(this.store))}hasWalked(t,e){return this.store.get(t.fullpath())?.has(e.globString())}storeWalked(t,e){let s=t.fullpath(),r=this.store.get(s);r?r.add(e.globString()):this.store.set(s,new Set([e.globString()]))}},Pe=class{store=new Map;add(t,e,s){let r=(e?2:0)|(s?1:0),n=this.store.get(t);this.store.set(t,n===void 0?r:r&n)}entries(){return[...this.store.entries()].map(([t,e])=>[t,!!(e&2),!!(e&1)])}},Ie=class{store=new Map;add(t,e){if(!t.canReaddir())return;let s=this.store.get(t);s?s.find(r=>r.globString()===e.globString())||s.push(e):this.store.set(t,[e])}get(t){let e=this.store.get(t);if(!e)throw new Error("attempting to walk unknown path");return e}entries(){return this.keys().map(t=>[t,this.store.get(t)])}keys(){return[...this.store.keys()].filter(t=>t.canReaddir())}},It=class i{hasWalkedCache;matches=new Pe;subwalks=new Ie;patterns;follow;dot;opts;constructor(t,e){this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=e?e.copy():new Le}processPatterns(t,e){this.patterns=e;let s=e.map(r=>[t,r]);for(let[r,n]of s){this.hasWalkedCache.storeWalked(r,n);let o=n.root(),h=n.isAbsolute()&&this.opts.absolute!==!1;if(o){r=r.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let c=n.rest();if(c)n=c;else{this.matches.add(r,!0,!1);continue}}if(r.isENOENT())continue;let a,l,f=!1;for(;typeof(a=n.pattern())=="string"&&(l=n.rest());)r=r.resolve(a),n=l,f=!0;if(a=n.pattern(),l=n.rest(),f){if(this.hasWalkedCache.hasWalked(r,n))continue;this.hasWalkedCache.storeWalked(r,n)}if(typeof a=="string"){let c=a===".."||a===""||a===".";this.matches.add(r.resolve(a),h,c);continue}else if(a===A){(!r.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(r,n);let c=l?.pattern(),u=l?.rest();if(!l||(c===""||c===".")&&!u)this.matches.add(r,h,c===""||c===".");else if(c===".."){let d=r.parent||r;u?this.hasWalkedCache.hasWalked(d,u)||this.subwalks.add(d,u):this.matches.add(d,h,!0)}}else a instanceof RegExp&&this.subwalks.add(r,n)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new i(this.opts,this.hasWalkedCache)}filterEntries(t,e){let s=this.subwalks.get(t),r=this.child();for(let n of e)for(let o of s){let h=o.isAbsolute(),a=o.pattern(),l=o.rest();a===A?r.testGlobstar(n,o,l,h):a instanceof RegExp?r.testRegExp(n,a,l,h):r.testString(n,a,l,h)}return r}testGlobstar(t,e,s,r){if((this.dot||!t.name.startsWith("."))&&(e.hasMore()||this.matches.add(t,r,!1),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,e):t.isSymbolicLink()&&(s&&e.checkFollowGlobstar()?this.subwalks.add(t,s):e.markFollowGlobstar()&&this.subwalks.add(t,e)))),s){let n=s.pattern();if(typeof n=="string"&&n!==".."&&n!==""&&n!==".")this.testString(t,n,s.rest(),r);else if(n===".."){let o=t.parent||t;this.subwalks.add(o,s)}else n instanceof RegExp&&this.testRegExp(t,n,s.rest(),r)}}testRegExp(t,e,s,r){e.test(t.name)&&(s?this.subwalks.add(t,s):this.matches.add(t,r,!1))}testString(t,e,s,r){t.isNamed(e)&&(s?this.subwalks.add(t,s):this.matches.add(t,r,!1))}};var cn=(i,t)=>typeof i=="string"?new mt([i],t):Array.isArray(i)?new mt(i,t):i,se=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#t=[];#e;#n;signal;maxDepth;includeChildMatches;constructor(t,e,s){if(this.patterns=t,this.path=e,this.opts=s,this.#n=!s.posix&&s.platform==="win32"?"\\":"/",this.includeChildMatches=s.includeChildMatches!==!1,(s.ignore||!this.includeChildMatches)&&(this.#e=cn(s.ignore??[],s),!this.includeChildMatches&&typeof this.#e.add!="function")){let r="cannot ignore child matches, ignore lacks add() method.";throw new Error(r)}this.maxDepth=s.maxDepth||1/0,s.signal&&(this.signal=s.signal,this.signal.addEventListener("abort",()=>{this.#t.length=0}))}#r(t){return this.seen.has(t)||!!this.#e?.ignored?.(t)}#o(t){return!!this.#e?.childrenIgnored?.(t)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let t;for(;!this.paused&&(t=this.#t.shift());)t()}onResume(t){this.signal?.aborted||(this.paused?this.#t.push(t):t())}async matchCheck(t,e){if(e&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=t.realpathCached()||await t.realpath(),!s)return;t=s}let n=t.isUnknown()||this.opts.stat?await t.lstat():t;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let o=await n.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(n,e)}matchCheckTest(t,e){return t&&(this.maxDepth===1/0||t.depth()<=this.maxDepth)&&(!e||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!t.realpathCached()?.isDirectory())&&!this.#r(t)?t:void 0}matchCheckSync(t,e){if(e&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=t.realpathCached()||t.realpathSync(),!s)return;t=s}let n=t.isUnknown()||this.opts.stat?t.lstatSync():t;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let o=n.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(n,e)}matchFinish(t,e){if(this.#r(t))return;if(!this.includeChildMatches&&this.#e?.add){let n=`${t.relativePosix()}/**`;this.#e.add(n)}let s=this.opts.absolute===void 0?e:this.opts.absolute;this.seen.add(t);let r=this.opts.mark&&t.isDirectory()?this.#n:"";if(this.opts.withFileTypes)this.matchEmit(t);else if(s){let n=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(n+r)}else{let n=this.opts.posix?t.relativePosix():t.relative(),o=this.opts.dotRelative&&!n.startsWith(".."+this.#n)?"."+this.#n:"";this.matchEmit(n?o+n+r:"."+r)}}async match(t,e,s){let r=await this.matchCheck(t,s);r&&this.matchFinish(r,e)}matchSync(t,e,s){let r=this.matchCheckSync(t,s);r&&this.matchFinish(r,e)}walkCB(t,e,s){this.signal?.aborted&&s(),this.walkCB2(t,e,new It(this.opts),s)}walkCB2(t,e,s,r){if(this.#o(t))return r();if(this.signal?.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2(t,e,s,r));return}s.processPatterns(t,e);let n=1,o=()=>{--n===0&&r()};for(let[h,a,l]of s.matches.entries())this.#r(h)||(n++,this.match(h,a,l).then(()=>o()));for(let h of s.subwalkTargets()){if(this.maxDepth!==1/0&&h.depth()>=this.maxDepth)continue;n++;let a=h.readdirCached();h.calledReaddir()?this.walkCB3(h,a,s,o):h.readdirCB((l,f)=>this.walkCB3(h,f,s,o),!0)}o()}walkCB3(t,e,s,r){s=s.filterEntries(t,e);let n=1,o=()=>{--n===0&&r()};for(let[h,a,l]of s.matches.entries())this.#r(h)||(n++,this.match(h,a,l).then(()=>o()));for(let[h,a]of s.subwalks.entries())n++,this.walkCB2(h,a,s.child(),o);o()}walkCBSync(t,e,s){this.signal?.aborted&&s(),this.walkCB2Sync(t,e,new It(this.opts),s)}walkCB2Sync(t,e,s,r){if(this.#o(t))return r();if(this.signal?.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2Sync(t,e,s,r));return}s.processPatterns(t,e);let n=1,o=()=>{--n===0&&r()};for(let[h,a,l]of s.matches.entries())this.#r(h)||this.matchSync(h,a,l);for(let h of s.subwalkTargets()){if(this.maxDepth!==1/0&&h.depth()>=this.maxDepth)continue;n++;let a=h.readdirSync();this.walkCB3Sync(h,a,s,o)}o()}walkCB3Sync(t,e,s,r){s=s.filterEntries(t,e);let n=1,o=()=>{--n===0&&r()};for(let[h,a,l]of s.matches.entries())this.#r(h)||this.matchSync(h,a,l);for(let[h,a]of s.subwalks.entries())n++,this.walkCB2Sync(h,a,s.child(),o);o()}},Wt=class extends se{matches=new Set;constructor(t,e,s){super(t,e,s)}matchEmit(t){this.matches.add(t)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((t,e)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?e(this.signal.reason):t(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},jt=class extends se{results;constructor(t,e,s){super(t,e,s),this.results=new tt({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 un=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",U=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(t,e){if(!e)throw new TypeError("glob options required");if(this.withFileTypes=!!e.withFileTypes,this.signal=e.signal,this.follow=!!e.follow,this.dot=!!e.dot,this.dotRelative=!!e.dotRelative,this.nodir=!!e.nodir,this.mark=!!e.mark,e.cwd?(e.cwd instanceof URL||e.cwd.startsWith("file://"))&&(e.cwd=fn(e.cwd)):this.cwd="",this.cwd=e.cwd||"",this.root=e.root,this.magicalBraces=!!e.magicalBraces,this.nobrace=!!e.nobrace,this.noext=!!e.noext,this.realpath=!!e.realpath,this.absolute=e.absolute,this.includeChildMatches=e.includeChildMatches!==!1,this.noglobstar=!!e.noglobstar,this.matchBase=!!e.matchBase,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:1/0,this.stat=!!e.stat,this.ignore=e.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof t=="string"&&(t=[t]),this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(t=t.map(a=>a.replace(/\\/g,"/"))),this.matchBase){if(e.noglobstar)throw new TypeError("base matching requires globstar");t=t.map(a=>a.includes("/")?a:`./**/${a}`)}if(this.pattern=t,this.platform=e.platform||un,this.opts={...e,platform:this.platform},e.scurry){if(this.scurry=e.scurry,e.nocase!==void 0&&e.nocase!==e.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let a=e.platform==="win32"?ut:e.platform==="darwin"?Pt:e.platform?dt:Ks;this.scurry=new a(this.cwd,{nocase:e.nocase,fs:e.fs})}this.nocase=this.scurry.nocase;let s=this.platform==="darwin"||this.platform==="win32",r={...e,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:s,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},n=this.pattern.map(a=>new _(a,r)),[o,h]=n.reduce((a,l)=>(a[0].push(...l.set),a[1].push(...l.globParts),a),[[],[]]);this.patterns=o.map((a,l)=>{let f=h[l];if(!f)throw new Error("invalid pattern object");return new pt(a,f,0,this.platform)})}async walk(){return[...await new Wt(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 Wt(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 jt(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 jt(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 We=(i,t={})=>{Array.isArray(i)||(i=[i]);for(let e of i)if(new _(e,t).hasMagic())return!0;return!1};function re(i,t={}){return new U(i,t).streamSync()}function Xs(i,t={}){return new U(i,t).stream()}function ne(i,t={}){return new U(i,t).walkSync()}async function Ys(i,t={}){return new U(i,t).walk()}function oe(i,t={}){return new U(i,t).iterateSync()}function Js(i,t={}){return new U(i,t).iterate()}var dn=re,pn=Object.assign(Xs,{sync:re}),mn=oe,gn=Object.assign(Js,{sync:oe}),wn=Object.assign(ne,{stream:re,iterate:oe}),ie=Object.assign(Ys,{glob:Ys,globSync:ne,sync:wn,globStream:Xs,stream:pn,globStreamSync:re,streamSync:dn,globIterate:Js,iterate:gn,globIterateSync:oe,iterateSync:mn,Glob:U,hasMagic:We,escape:ht,unescape:j});ie.glob=ie;var et=(i,t)=>typeof i>"u"||typeof i===t,Zs=i=>!!i&&typeof i=="object"&&et(i.preserveRoot,"boolean")&&et(i.tmp,"string")&&et(i.maxRetries,"number")&&et(i.retryDelay,"number")&&et(i.backoff,"number")&&et(i.maxBackoff,"number")&&(et(i.glob,"boolean")||i.glob&&typeof i.glob=="object")&&et(i.filter,"function"),Qs=i=>{if(!Zs(i))throw new Error("invalid rimraf options")},ti=i=>{Qs(i);let{glob:t,...e}=i;if(!t)return e;let s=t===!0?i.signal?{signal:i.signal}:{}:i.signal?{signal:i.signal,...t}:t;return{...e,glob:{...s,absolute:!0,withFileTypes:!1}}},ei=(i={})=>ti(i),si=(i={})=>ti(i);import{parse as ii,resolve as yn}from"path";import{inspect as Sn}from"util";var $=process.env.__TESTING_RIMRAF_PLATFORM__||process.platform;var bn=(i,t={})=>{let e=typeof i;if(e!=="string"){let r=i&&e==="object"&&i.constructor,o=`The "path" argument must be of type string. Received ${r&&r.name?`an instance of ${r.name}`:e==="object"?Sn(i):`type ${e} ${i}`}`;throw Object.assign(new TypeError(o),{path:i,code:"ERR_INVALID_ARG_TYPE"})}if(/\0/.test(i)){let r="path must be a string without null bytes";throw Object.assign(new TypeError(r),{path:i,code:"ERR_INVALID_ARG_VALUE"})}i=yn(i);let{root:s}=ii(i);if(i===s&&t.preserveRoot!==!1){let r="refusing to remove root directory without preserveRoot:false";throw Object.assign(new Error(r),{path:i,code:"ERR_PRESERVE_ROOT"})}if($==="win32"){let r=/[*|"<>?:]/,{root:n}=ii(i);if(r.test(i.substring(n.length)))throw Object.assign(new Error("Illegal characters in path."),{path:i,code:"EINVAL"})}return i},Bt=bn;import Y from"fs";import{chmodSync as he,mkdirSync as Ih,renameSync as ni,rmdirSync as gt,rmSync as oi,statSync as hi,lstatSync as wt,unlinkSync as yt}from"fs";import{readdirSync as En}from"fs";var ri=i=>En(i,{withFileTypes:!0}),vn=(i,t)=>new Promise((e,s)=>Y.chmod(i,t,(r,...n)=>r?s(r):e(...n))),xn=(i,t)=>new Promise((e,s)=>Y.mkdir(i,t,(r,n)=>r?s(r):e(n))),Tn=i=>new Promise((t,e)=>Y.readdir(i,{withFileTypes:!0},(s,r)=>s?e(s):t(r))),Rn=(i,t)=>new Promise((e,s)=>Y.rename(i,t,(r,...n)=>r?s(r):e(...n))),On=(i,t)=>new Promise((e,s)=>Y.rm(i,t,(r,...n)=>r?s(r):e(...n))),An=i=>new Promise((t,e)=>Y.rmdir(i,(s,...r)=>s?e(s):t(...r))),Nn=i=>new Promise((t,e)=>Y.stat(i,(s,r)=>s?e(s):t(r))),Cn=i=>new Promise((t,e)=>Y.lstat(i,(s,r)=>s?e(s):t(r))),kn=i=>new Promise((t,e)=>Y.unlink(i,(s,...r)=>s?e(s):t(...r))),F={chmod:vn,mkdir:xn,readdir:Tn,rename:Rn,rm:On,rmdir:An,stat:Nn,lstat:Cn,unlink:kn};import{parse as ai,resolve as li}from"path";var{readdir:Dn}=F,St=i=>Dn(i).catch(t=>t),bt=i=>{try{return ri(i)}catch(t){return t}};var X=async i=>i.catch(t=>{if(t.code!=="ENOENT")throw t}),J=i=>{try{return i()}catch(t){if(t?.code!=="ENOENT")throw t}};var{lstat:Mn,rmdir:Fn,unlink:_n}=F,ae=async(i,t)=>{if(t?.signal?.aborted)throw t.signal.reason;try{return await ci(i,t,await Mn(i))}catch(e){if(e?.code==="ENOENT")return!0;throw e}},le=(i,t)=>{if(t?.signal?.aborted)throw t.signal.reason;try{return fi(i,t,wt(i))}catch(e){if(e?.code==="ENOENT")return!0;throw e}},ci=async(i,t,e)=>{if(t?.signal?.aborted)throw t.signal.reason;let s=e.isDirectory()?await St(i):null;if(!Array.isArray(s)){if(s){if(s.code==="ENOENT")return!0;if(s.code!=="ENOTDIR")throw s}return t.filter&&!await t.filter(i,e)?!1:(await X(_n(i)),!0)}return!(await Promise.all(s.map(n=>ci(li(i,n.name),t,n)))).reduce((n,o)=>n&&o,!0)||t.preserveRoot===!1&&i===ai(i).root||t.filter&&!await t.filter(i,e)?!1:(await X(Fn(i)),!0)},fi=(i,t,e)=>{if(t?.signal?.aborted)throw t.signal.reason;let s=e.isDirectory()?bt(i):null;if(!Array.isArray(s)){if(s){if(s.code==="ENOENT")return!0;if(s.code!=="ENOTDIR")throw s}return t.filter&&!t.filter(i,e)?!1:(J(()=>yt(i)),!0)}let r=!0;for(let n of s){let o=li(i,n.name);r=fi(o,t,n)&&r}return t.preserveRoot===!1&&i===ai(i).root||!r||t.filter&&!t.filter(i,e)?!1:(J(()=>gt(i)),!0)};import{parse as bi,resolve as Ei}from"path";var{chmod:Ln}=F,je=i=>async t=>{try{return await i(t)}catch(e){let s=e;if(s?.code==="ENOENT")return;if(s?.code==="EPERM"){try{await Ln(t,438)}catch(r){if(r?.code==="ENOENT")return;throw e}return await i(t)}throw e}},Be=i=>t=>{try{return i(t)}catch(e){let s=e;if(s?.code==="ENOENT")return;if(s?.code==="EPERM"){try{he(t,438)}catch(r){if(r?.code==="ENOENT")return;throw e}return i(t)}throw e}};var ui=new Set(["EMFILE","ENFILE","EBUSY"]),ze=i=>{let t=async(e,s,r=1,n=0)=>{let o=s.maxBackoff||200,h=s.backoff||1.2,a=s.maxRetries||10,l=0;for(;;)try{return await i(e)}catch(f){let c=f;if(c?.path===e&&c?.code&&ui.has(c.code)){if(r=Math.ceil(r*h),n=r+n,n<o)return new Promise((u,d)=>{setTimeout(()=>{t(e,s,r,n).then(u,d)},r)});if(l<a){l++;continue}}throw f}};return t},Ue=i=>(e,s)=>{let r=s.maxRetries||10,n=0;for(;;)try{return i(e)}catch(o){let h=o;if(h?.path===e&&h?.code&&ui.has(h.code)&&n<r){n++;continue}throw o}};import{basename as $n,parse as ue,resolve as de}from"path";import{tmpdir as fe}from"os";import{parse as ce,resolve as di}from"path";var{stat:Pn}=F,In=i=>{try{return hi(i).isDirectory()}catch{return!1}},Wn=i=>Pn(i).then(t=>t.isDirectory(),()=>!1),jn=async i=>{let{root:t}=ce(i),e=fe(),{root:s}=ce(e);if(t.toLowerCase()===s.toLowerCase())return e;let r=di(t,"/temp");return await Wn(r)?r:t},Bn=i=>{let{root:t}=ce(i),e=fe(),{root:s}=ce(e);if(t.toLowerCase()===s.toLowerCase())return e;let r=di(t,"/temp");return In(r)?r:t},zn=async()=>fe(),Un=()=>fe(),pi=$==="win32"?jn:zn,mi=$==="win32"?Bn:Un;var{lstat:Gn,rename:Hn,unlink:gi,rmdir:Vn,chmod:qn}=F,Si=i=>`.${$n(i)}.${Math.random()}`,Kn=async i=>gi(i).catch(t=>{if(t.code==="EPERM")return qn(i,438).then(()=>gi(i),e=>{if(e.code!=="ENOENT")throw t});if(t.code==="ENOENT")return;throw t}),Yn=i=>{try{yt(i)}catch(t){if(t?.code==="EPERM")try{return he(i,438)}catch(e){if(e?.code==="ENOENT")return;throw t}else if(t?.code==="ENOENT")return;throw t}},pe=async(i,t)=>{if(t?.signal?.aborted)throw t.signal.reason;try{return await $e(i,t,await Gn(i))}catch(e){if(e?.code==="ENOENT")return!0;throw e}},$e=async(i,t,e)=>{if(t?.signal?.aborted)throw t.signal.reason;if(!t.tmp)return $e(i,{...t,tmp:await pi(i)},e);if(i===t.tmp&&ue(i).root!==i)throw new Error("cannot delete temp directory used for deletion");let s=e.isDirectory()?await St(i):null;if(!Array.isArray(s)){if(s){if(s.code==="ENOENT")return!0;if(s.code!=="ENOTDIR")throw s}return t.filter&&!await t.filter(i,e)?!1:(await X(wi(i,t.tmp,Kn)),!0)}return!(await Promise.all(s.map(n=>$e(de(i,n.name),t,n)))).reduce((n,o)=>n&&o,!0)||t.preserveRoot===!1&&i===ue(i).root||t.filter&&!await t.filter(i,e)?!1:(await X(wi(i,t.tmp,Vn)),!0)},wi=async(i,t,e)=>{let s=de(t,Si(i));return await Hn(i,s),await e(s)},me=(i,t)=>{if(t?.signal?.aborted)throw t.signal.reason;try{return Ge(i,t,wt(i))}catch(e){if(e?.code==="ENOENT")return!0;throw e}},Ge=(i,t,e)=>{if(t?.signal?.aborted)throw t.signal.reason;if(!t.tmp)return Ge(i,{...t,tmp:mi(i)},e);let s=t.tmp;if(i===t.tmp&&ue(i).root!==i)throw new Error("cannot delete temp directory used for deletion");let r=e.isDirectory()?bt(i):null;if(!Array.isArray(r)){if(r){if(r.code==="ENOENT")return!0;if(r.code!=="ENOTDIR")throw r}return t.filter&&!t.filter(i,e)?!1:(J(()=>yi(i,s,Yn)),!0)}let n=!0;for(let o of r){let h=de(i,o.name);n=Ge(h,t,o)&&n}return!n||t.preserveRoot===!1&&i===ue(i).root||t.filter&&!t.filter(i,e)?!1:(J(()=>yi(i,s,gt)),!0)},yi=(i,t,e)=>{let s=de(t,Si(i));return ni(i,s),e(s)};var{unlink:Xn,rmdir:Jn,lstat:Zn}=F,Qn=ze(je(Xn)),to=Ue(Be(yt)),eo=ze(je(Jn)),so=Ue(Be(gt)),io=async(i,t)=>{if(t?.signal?.aborted)throw t.signal.reason;let{filter:e,...s}=t;try{return await eo(i,s)}catch(r){if(r?.code==="ENOTEMPTY")return await pe(i,s);throw r}},ro=(i,t)=>{if(t?.signal?.aborted)throw t.signal.reason;let{filter:e,...s}=t;try{return so(i,s)}catch(r){if(r?.code==="ENOTEMPTY")return me(i,s);throw r}},st=Symbol("start"),vi=Symbol("child"),ge=Symbol("finish"),we=async(i,t)=>{if(t?.signal?.aborted)throw t.signal.reason;try{return await He(i,t,await Zn(i),st)}catch(e){if(e?.code==="ENOENT")return!0;throw e}},ye=(i,t)=>{if(t?.signal?.aborted)throw t.signal.reason;try{return Ve(i,t,wt(i),st)}catch(e){if(e?.code==="ENOENT")return!0;throw e}},He=async(i,t,e,s=st)=>{if(t?.signal?.aborted)throw t.signal.reason;let r=e.isDirectory()?await St(i):null;if(!Array.isArray(r)){if(r){if(r.code==="ENOENT")return!0;if(r.code!=="ENOTDIR")throw r}return t.filter&&!await t.filter(i,e)?!1:(await X(Qn(i,t)),!0)}let n=s===st?vi:s,o=(await Promise.all(r.map(h=>He(Ei(i,h.name),t,h,n)))).reduce((h,a)=>h&&a,!0);if(s===st)return He(i,t,e,ge);if(s===ge){if(t.preserveRoot===!1&&i===bi(i).root||!o||t.filter&&!await t.filter(i,e))return!1;await X(io(i,t))}return!0},Ve=(i,t,e,s=st)=>{let r=e.isDirectory()?bt(i):null;if(!Array.isArray(r)){if(r){if(r.code==="ENOENT")return!0;if(r.code!=="ENOTDIR")throw r}return t.filter&&!t.filter(i,e)?!1:(J(()=>to(i,t)),!0)}let n=!0;for(let o of r){let h=s===st?vi:s,a=Ei(i,o.name);n=Ve(a,t,o,h)&&n}if(s===st)return Ve(i,t,e,ge);if(s===ge){if(t.preserveRoot===!1&&i===bi(i).root||!n||t.filter&&!t.filter(i,e))return!1;J(()=>{ro(i,t)})}return!0};var qe=$==="win32"?we:ae,Ke=$==="win32"?ye:le;var{rm:no}=F,Ye=async(i,t)=>(await no(i,{...t,force:!0,recursive:!0}),!0),Xe=(i,t)=>(oi(i,{...t,force:!0,recursive:!0}),!0);var oo=process.env.__TESTING_RIMRAF_NODE_VERSION__||process.version,ho=oo.replace(/^v/,"").split("."),[xi=0,ao=0]=ho.map(i=>parseInt(i,10)),Ti=xi>14||xi===14&&ao>=14,Ri=!Ti||$==="win32"?()=>!1:i=>!i?.signal&&!i?.filter,Oi=!Ti||$==="win32"?()=>!1:i=>!i?.signal&&!i?.filter;var Et=i=>async(t,e)=>{let s=ei(e);return s.glob&&(t=await ie(t,s.glob)),Array.isArray(t)?!!(await Promise.all(t.map(r=>i(Bt(r,s),s)))).reduce((r,n)=>r&&n,!0):!!await i(Bt(t,s),s)},vt=i=>(t,e)=>{let s=si(e);return s.glob&&(t=ne(t,s.glob)),Array.isArray(t)?!!t.map(r=>i(Bt(r,s),s)).reduce((r,n)=>r&&n,!0):!!i(Bt(t,s),s)},Ci=vt(Xe),lo=Object.assign(Et(Ye),{sync:Ci}),ki=vt(Ke),co=Object.assign(Et(qe),{sync:ki}),Di=vt(ye),fo=Object.assign(Et(we),{sync:Di}),Mi=vt(le),uo=Object.assign(Et(ae),{sync:Mi}),Fi=vt(me),po=Object.assign(Et(pe),{sync:Fi}),Je=vt((i,t)=>Oi(t)?Xe(i,t):Ke(i,t)),_i=Je,Ai=Et((i,t)=>Ri(t)?Ye(i,t):qe(i,t)),Ni=Object.assign(Ai,{rimraf:Ai,sync:Je,rimrafSync:Je,manual:co,manualSync:ki,native:lo,nativeSync:Ci,posix:uo,posixSync:Mi,windows:fo,windowsSync:Di,moveRemove:po,moveRemoveSync:Fi});Ni.rimraf=Ni;var Pi=go(new URL(".",import.meta.url)),Qe=Li(Pi,"../builder/vite-config.js"),wo=Li(Pi,"../builder/vite-entry-server.js");async function Ia({options:i,logger:t}){t.info(`Building template...
|
|
6
6
|
`),i.clean&&_i(mo.join(process.cwd(),"dist"));let e="production";i.ssr==="local"&&(e="development",process.env.NODE_ENV=e),i.ssr?(await Ze({configFile:Qe,customLogger:t,mode:e,logLevel:i.logLevel,clearScreen:i.clearScreen,build:{ssrManifest:!0,emptyOutDir:!0}}),await Ze({configFile:Qe,customLogger:t,mode:e,logLevel:i.logLevel,clearScreen:i.clearScreen,ssr:{target:"webworker"},build:{ssr:wo}})):await Ze({configFile:Qe,customLogger:t,logLevel:i.logLevel,clearScreen:i.clearScreen,build:{emptyOutDir:!0}})}export{Ia as buildTemplate};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*! Upstart.gg - Copyright (C) 2024 Flippable - https://github.com/upstart-gg/upstart/blob/main/LICENSE */
|
|
2
2
|
|
|
3
|
-
import U from"chalk";import{confirm as
|
|
4
|
-
`)),{...s,success:(r,o)=>s.info(i.green(r),o),error:(r,o)=>s.error(i.red(r),o),warn:(r,o)=>s.warn(i.yellow(r),o),warnOnce:(r,o)=>s.warnOnce(i.yellow(r),o),debug:(r,o)=>{t==="debug"&&s.info(i.gray(r),o)}}}var m=x();import R from"conf";import c from"node:path";import O from"node:crypto";import a from"node:fs";import{fileURLToPath as v}from"node:url";import Q from"chalk";var k=v(new URL(".",import.meta.url)),w=P(),p=new R({projectName:
|
|
5
|
-
`);let{isError:n,data:s}=await l(_,{client_id:g,scope:"profile,templates:publish"});n&&(e.error("Failed to get device code. Please try again."),e.error(`Error: ${s.error_description??s.error}`),process.exit(1));let{verification_uri:r,device_code:o}=s;await
|
|
3
|
+
import U from"chalk";import{confirm as N}from"@inquirer/prompts";import b from"open";var y="upstart-cli";var g=process.env.PUBLIC_UPSTART_OAUTH_CLIENT_ID??"50000000-0000-0000-0000-000000000001",u=process.env.PUBLIC_UPSTART_API_BASE_URL??"https://api.upstart.gg",j=process.env.PUBLIC_UPSTART_EDITOR_BASE_URL??"https://upstart.gg";var _="oauth/devicecode",T="oauth/token";import{createLogger as L}from"vite";var h="0.0.90";import i from"chalk";function x(t,e,n=!1){let s=L(t==="debug"?"info":t,{prefix:"[upstart]",allowClearScreen:e});return n&&s.info(i.hex("#7270c6").bold(`\u{1F680} Upstart v${h}
|
|
4
|
+
`)),{...s,success:(r,o)=>s.info(i.green(r),o),error:(r,o)=>s.error(i.red(r),o),warn:(r,o)=>s.warn(i.yellow(r),o),warnOnce:(r,o)=>s.warnOnce(i.yellow(r),o),debug:(r,o)=>{t==="debug"&&s.info(i.gray(r),o)}}}var m=x();import R from"conf";import c from"node:path";import O from"node:crypto";import a from"node:fs";import{fileURLToPath as v}from"node:url";import Q from"chalk";var k=v(new URL(".",import.meta.url)),w=P(),p=new R({projectName:y,encryptionKey:w,clearInvalidConfig:!0});function S(){let t=k;for(;t!==c.parse(t).root;){let e=c.join(t,"node_modules");if(a.existsSync(e))return e;t=c.dirname(t)}return null}function P(){let t=S();if(!t)throw new Error("Could not find nearest node_modules directory.");let e=c.join(t,".enpage-tmp");a.existsSync(e)||a.mkdirSync(e,{recursive:!0,mode:448});let n=c.join(e,".enpage-key");if(!a.existsSync(n)){let r=O.randomBytes(32).toString("hex");return a.writeFileSync(n,r,{mode:384}),r}return a.readFileSync(n,"utf8")}async function l(t,e,n={}){p.get("access_token")&&(n.Authorization=`Bearer ${p.get("access_token")}`);let s=await fetch(C(t),{method:"POST",headers:{"Content-Type":e instanceof URLSearchParams?"application/x-www-form-urlencoded":"application/json",...n},body:e instanceof URLSearchParams?e:JSON.stringify(e)}).catch(r=>{m.error(`Fatal Error requesting API: ${r.message} (${r.cause.code})`),m.error("Please check your internet connection and try again, or retry later."),process.exit(1)});return I(s)}function C(t){let e=new URL(u.endsWith("/")?u:`${u}/`);return new URL(t,e)}async function I(t){let e=t.headers.get("content-type")?.startsWith("application/json")?await t.json():await t.text();return t.ok?{isSuccess:!0,isError:!1,status:t.status,statusText:t.statusText,data:e}:{isSuccess:!1,isError:!0,status:t.status,statusText:t.statusText,data:e}}async function A(t,e){for(;;){let n=new URLSearchParams({grant_type:"device_code",device_code:t,client_id:g}),s=await l(T,n),{data:r,isSuccess:o}=s;if(o)return r;if(r.error==="authorization_pending")await new Promise(f=>setTimeout(f,5e3));else return e.error(`Error while polling for login: ${r.error_description??r.error}`),!1}}async function de({options:t,logger:e}){e.info(`Logging in to Enpage...
|
|
5
|
+
`);let{isError:n,data:s}=await l(_,{client_id:g,scope:"profile,templates:publish"});n&&(e.error("Failed to get device code. Please try again."),e.error(`Error: ${s.error_description??s.error}`),process.exit(1));let{verification_uri:r,device_code:o}=s;await N({message:"Would you like to open the login page in your browser?",default:!0}).catch(D=>{process.exit(0)})?b(r):e.info(`
|
|
6
6
|
Please visit the following URL to login:
|
|
7
7
|
${r}
|
|
8
8
|
`),e.info(U.gray(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! Upstart.gg - Copyright (C) 2024 Flippable - https://github.com/upstart-gg/upstart/blob/main/LICENSE */
|
|
2
2
|
|
|
3
|
-
var i="upstart-cli";var d=process.env.PUBLIC_UPSTART_OAUTH_CLIENT_ID??"50000000-0000-0000-0000-000000000001",I=process.env.PUBLIC_UPSTART_API_BASE_URL??"https://api.upstart.gg",O=process.env.PUBLIC_UPSTART_EDITOR_BASE_URL??"https://upstart.gg";import p from"conf";import
|
|
4
|
-
`),process.exit(0)}export{
|
|
3
|
+
var i="upstart-cli";var d=process.env.PUBLIC_UPSTART_OAUTH_CLIENT_ID??"50000000-0000-0000-0000-000000000001",I=process.env.PUBLIC_UPSTART_API_BASE_URL??"https://api.upstart.gg",O=process.env.PUBLIC_UPSTART_EDITOR_BASE_URL??"https://upstart.gg";import p from"conf";import n from"node:path";import _ from"node:crypto";import e from"node:fs";import{fileURLToPath as a}from"node:url";import U from"chalk";var m=a(new URL(".",import.meta.url)),u=f(),c=new p({projectName:i,encryptionKey:u,clearInvalidConfig:!0});function E(){let o=m;for(;o!==n.parse(o).root;){let t=n.join(o,"node_modules");if(e.existsSync(t))return t;o=n.dirname(o)}return null}function f(){let o=E();if(!o)throw new Error("Could not find nearest node_modules directory.");let t=n.join(o,".enpage-tmp");e.existsSync(t)||e.mkdirSync(t,{recursive:!0,mode:448});let r=n.join(t,".enpage-key");if(!e.existsSync(r)){let s=_.randomBytes(32).toString("hex");return e.writeFileSync(r,s,{mode:384}),s}return e.readFileSync(r,"utf8")}async function h({options:o,logger:t}){t.info("Logging out fom Enpage..."),c.clear(),t.info(`Done.
|
|
4
|
+
`),process.exit(0)}export{h as logout};
|