@tencent-ai/codebuddy-code 1.24.0-next.f2e76f0.20251105 → 1.25.0-next.42e611b.20251106

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.
@@ -1 +0,0 @@
1
- "use strict";exports.id=344,exports.ids=[344],exports.modules={45344:(t,e,s)=>{s.r(e),s.d(e,{Glob:()=>Glob,Ignore:()=>Ignore,escape:()=>escape_escape,glob:()=>tt,globIterate:()=>globIterate,globIterateSync:()=>globIterateSync,globStream:()=>globStream,globStreamSync:()=>globStreamSync,globSync:()=>globSync,hasMagic:()=>hasMagic,iterate:()=>Y,iterateSync:()=>X,stream:()=>K,streamSync:()=>J,sync:()=>Q,unescape:()=>unescape_unescape});var i=s(14213);const assertValidPattern=t=>{if("string"!=typeof t)throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")},r={"[: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]},braceEscape=t=>t.replace(/[[\]\\-]/g,"\\$&"),rangesToString=t=>t.join(""),parseClass=(t,e)=>{const s=e;if("["!==t.charAt(s))throw new Error("not in a brace expression");const i=[],n=[];let h=s+1,o=!1,a=!1,l=!1,c=!1,p=s,d="";t:for(;h<t.length;){const e=t.charAt(h);if("!"!==e&&"^"!==e||h!==s+1){if("]"===e&&o&&!l){p=h+1;break}if(o=!0,"\\"!==e||l){if("["===e&&!l)for(const[e,[o,l,c]]of Object.entries(r))if(t.startsWith(e,h)){if(d)return["$.",!1,t.length-s,!0];h+=e.length,c?n.push(o):i.push(o),a=a||l;continue t}l=!1,d?(e>d?i.push(braceEscape(d)+"-"+braceEscape(e)):e===d&&i.push(braceEscape(e)),d="",h++):t.startsWith("-]",h+1)?(i.push(braceEscape(e+"-")),h+=2):t.startsWith("-",h+1)?(d=e,h+=2):(i.push(braceEscape(e)),h++)}else l=!0,h++}else c=!0,h++}if(p<h)return["",!1,0,!1];if(!i.length&&!n.length)return["$.",!1,t.length-s,!0];if(0===n.length&&1===i.length&&/^\\?.$/.test(i[0])&&!c){const t=2===i[0].length?i[0].slice(-1):i[0];return[(u=t,u.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")),!1,p-s,!1]}var u;const f="["+(c?"^":"")+rangesToString(i)+"]",g="["+(c?"":"^")+rangesToString(n)+"]";return[i.length&&n.length?"("+f+"|"+g+")":i.length?f:g,a,p-s,!0]},unescape_unescape=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),n=new Set(["!","?","+","*","@"]),isExtglobType=t=>n.has(t),h="(?!\\.)",o=new Set(["[","."]),a=new Set(["..","."]),l=new Set("().*{}+?[]^$\\!"),c="[^/]",p=c+"*?",d=c+"+?";class AST{type;#t;#e;#s=!1;#i=[];#r;#n;#h;#o=!1;#a;#l;#c=!1;constructor(t,e,s={}){this.type=t,t&&(this.#e=!0),this.#r=e,this.#t=this.#r?this.#r.#t:this,this.#a=this.#t===this?s:this.#t.#a,this.#h=this.#t===this?[]:this.#t.#h,"!"!==t||this.#t.#o||this.#h.push(this),this.#n=this.#r?this.#r.#i.length:0}get hasMagic(){if(void 0!==this.#e)return this.#e;for(const t of this.#i)if("string"!=typeof t&&(t.type||t.hasMagic))return this.#e=!0;return this.#e}toString(){return void 0!==this.#l?this.#l:this.type?this.#l=this.type+"("+this.#i.map((t=>String(t))).join("|")+")":this.#l=this.#i.map((t=>String(t))).join("")}#p(){if(this!==this.#t)throw new Error("should only call on root");if(this.#o)return this;let t;for(this.toString(),this.#o=!0;t=this.#h.pop();){if("!"!==t.type)continue;let e=t,s=e.#r;for(;s;){for(let i=e.#n+1;!s.type&&i<s.#i.length;i++)for(const e of t.#i){if("string"==typeof e)throw new Error("string part in extglob AST??");e.copyIn(s.#i[i])}e=s,s=e.#r}}return this}push(...t){for(const e of t)if(""!==e){if("string"!=typeof e&&!(e instanceof AST&&e.#r===this))throw new Error("invalid part: "+e);this.#i.push(e)}}toJSON(){const t=null===this.type?this.#i.slice().map((t=>"string"==typeof t?t:t.toJSON())):[this.type,...this.#i.map((t=>t.toJSON()))];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#o&&"!"===this.#r?.type)&&t.push({}),t}isStart(){if(this.#t===this)return!0;if(!this.#r?.isStart())return!1;if(0===this.#n)return!0;const t=this.#r;for(let e=0;e<this.#n;e++){const s=t.#i[e];if(!(s instanceof AST&&"!"===s.type))return!1}return!0}isEnd(){if(this.#t===this)return!0;if("!"===this.#r?.type)return!0;if(!this.#r?.isEnd())return!1;if(!this.type)return this.#r?.isEnd();const t=this.#r?this.#r.#i.length:0;return this.#n===t-1}copyIn(t){"string"==typeof t?this.push(t):this.push(t.clone(this))}clone(t){const e=new AST(this.type,t);for(const t of this.#i)e.copyIn(t);return e}static#d(t,e,s,i){let r=!1,n=!1,h=-1,o=!1;if(null===e.type){let a=s,l="";for(;a<t.length;){const s=t.charAt(a++);if(r||"\\"===s)r=!r,l+=s;else if(n)a===h+1?"^"!==s&&"!"!==s||(o=!0):"]"!==s||a===h+2&&o||(n=!1),l+=s;else if("["!==s)if(i.noext||!isExtglobType(s)||"("!==t.charAt(a))l+=s;else{e.push(l),l="";const r=new AST(s,e);a=AST.#d(t,r,a,i),e.push(r)}else n=!0,h=a,o=!1,l+=s}return e.push(l),a}let a=s+1,l=new AST(null,e);const c=[];let p="";for(;a<t.length;){const s=t.charAt(a++);if(r||"\\"===s)r=!r,p+=s;else if(n)a===h+1?"^"!==s&&"!"!==s||(o=!0):"]"!==s||a===h+2&&o||(n=!1),p+=s;else if("["!==s)if(isExtglobType(s)&&"("===t.charAt(a)){l.push(p),p="";const e=new AST(s,l);l.push(e),a=AST.#d(t,e,a,i)}else if("|"!==s){if(")"===s)return""===p&&0===e.#i.length&&(e.#c=!0),l.push(p),p="",e.push(...c,l),a;p+=s}else l.push(p),p="",c.push(l),l=new AST(null,e);else n=!0,h=a,o=!1,p+=s}return e.type=null,e.#e=void 0,e.#i=[t.substring(s-1)],a}static fromGlob(t,e={}){const s=new AST(null,void 0,e);return AST.#d(t,s,0,e),s}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();const t=this.toString(),[e,s,i,r]=this.toRegExpSource();if(!(i||this.#e||this.#a.nocase&&!this.#a.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return s;const n=(this.#a.nocase?"i":"")+(r?"u":"");return Object.assign(new RegExp(`^${e}$`,n),{_src:e,_glob:t})}get options(){return this.#a}toRegExpSource(t){const e=t??!!this.#a.dot;if(this.#t===this&&this.#p(),!this.type){const s=this.isStart()&&this.isEnd(),i=this.#i.map((e=>{const[i,r,n,h]="string"==typeof e?AST.#u(e,this.#e,s):e.toRegExpSource(t);return this.#e=this.#e||n,this.#s=this.#s||h,i})).join("");let r="";if(this.isStart()&&"string"==typeof this.#i[0]){if(!(1===this.#i.length&&a.has(this.#i[0]))){const s=o,n=e&&s.has(i.charAt(0))||i.startsWith("\\.")&&s.has(i.charAt(2))||i.startsWith("\\.\\.")&&s.has(i.charAt(4)),a=!e&&!t&&s.has(i.charAt(0));r=n?"(?!(?:^|/)\\.\\.?(?:$|/))":a?h:""}}let n="";this.isEnd()&&this.#t.#o&&"!"===this.#r?.type&&(n="(?:$|\\/)");return[r+i+n,unescape_unescape(i),this.#e=!!this.#e,this.#s]}const s="*"===this.type||"+"===this.type,i="!"===this.type?"(?:(?!(?:":"(?:";let r=this.#f(e);if(this.isStart()&&this.isEnd()&&!r&&"!"!==this.type){const t=this.toString();return this.#i=[t],this.type=null,this.#e=void 0,[t,unescape_unescape(this.toString()),!1,!1]}let n=!s||t||e?"":this.#f(!0);n===r&&(n=""),n&&(r=`(?:${r})(?:${n})*?`);let l="";if("!"===this.type&&this.#c)l=(this.isStart()&&!e?h:"")+d;else{l=i+r+("!"===this.type?"))"+(!this.isStart()||e||t?"":h)+p+")":"@"===this.type?")":"?"===this.type?")?":"+"===this.type&&n?")":"*"===this.type&&n?")?":`)${this.type}`)}return[l,unescape_unescape(r),this.#e=!!this.#e,this.#s]}#f(t){return this.#i.map((e=>{if("string"==typeof e)throw new Error("string type in extglob ast??");const[s,i,r,n]=e.toRegExpSource(t);return this.#s=this.#s||n,s})).filter((t=>!(this.isStart()&&this.isEnd()&&!t))).join("|")}static#u(t,e,s=!1){let i=!1,r="",n=!1;for(let h=0;h<t.length;h++){const o=t.charAt(h);if(i)i=!1,r+=(l.has(o)?"\\":"")+o;else if("\\"!==o){if("["===o){const[s,i,o,a]=parseClass(t,h);if(o){r+=s,n=n||i,h+=o-1,e=e||a;continue}}"*"!==o?"?"!==o?r+=o.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):(r+=c,e=!0):(r+=s&&"*"===t?d:p,e=!0)}else h===t.length-1?r+="\\\\":i=!0}return[r,unescape_unescape(t),!!e,n]}}const escape_escape=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&"),minimatch=(t,e,s={})=>(assertValidPattern(e),!(!s.nocomment&&"#"===e.charAt(0))&&new Minimatch(e,s).match(t)),u=/^\*+([^+@!?\*\[\(]*)$/,starDotExtTest=t=>e=>!e.startsWith(".")&&e.endsWith(t),starDotExtTestDot=t=>e=>e.endsWith(t),starDotExtTestNocase=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),starDotExtTestNocaseDot=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),f=/^\*+\.\*+$/,starDotStarTest=t=>!t.startsWith(".")&&t.includes("."),starDotStarTestDot=t=>"."!==t&&".."!==t&&t.includes("."),g=/^\.\*+$/,dotStarTest=t=>"."!==t&&".."!==t&&t.startsWith("."),m=/^\*+$/,starTest=t=>0!==t.length&&!t.startsWith("."),starTestDot=t=>0!==t.length&&"."!==t&&".."!==t,w=/^\?+([^+@!?\*\[\(]*)?$/,qmarksTestNocase=([t,e=""])=>{const s=qmarksTestNoExt([t]);return e?(e=e.toLowerCase(),t=>s(t)&&t.toLowerCase().endsWith(e)):s},qmarksTestNocaseDot=([t,e=""])=>{const s=qmarksTestNoExtDot([t]);return e?(e=e.toLowerCase(),t=>s(t)&&t.toLowerCase().endsWith(e)):s},qmarksTestDot=([t,e=""])=>{const s=qmarksTestNoExtDot([t]);return e?t=>s(t)&&t.endsWith(e):s},qmarksTest=([t,e=""])=>{const s=qmarksTestNoExt([t]);return e?t=>s(t)&&t.endsWith(e):s},qmarksTestNoExt=([t])=>{const e=t.length;return t=>t.length===e&&!t.startsWith(".")},qmarksTestNoExtDot=([t])=>{const e=t.length;return t=>t.length===e&&"."!==t&&".."!==t},y="object"==typeof process&&process?"object"==typeof process.env&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix";minimatch.sep="win32"===y?{sep:"\\"}.sep:{sep:"/"}.sep;const S=Symbol("globstar **");minimatch.GLOBSTAR=S;minimatch.filter=(t,e={})=>s=>minimatch(s,t,e);const ext=(t,e={})=>Object.assign({},t,e);minimatch.defaults=t=>{if(!t||"object"!=typeof t||!Object.keys(t).length)return minimatch;const e=minimatch;return Object.assign(((s,i,r={})=>e(s,i,ext(t,r))),{Minimatch:class Minimatch extends e.Minimatch{constructor(e,s={}){super(e,ext(t,s))}static defaults(s){return e.defaults(ext(t,s)).Minimatch}},AST:class AST extends e.AST{constructor(e,s,i={}){super(e,s,ext(t,i))}static fromGlob(s,i={}){return e.AST.fromGlob(s,ext(t,i))}},unescape:(s,i={})=>e.unescape(s,ext(t,i)),escape:(s,i={})=>e.escape(s,ext(t,i)),filter:(s,i={})=>e.filter(s,ext(t,i)),defaults:s=>e.defaults(ext(t,s)),makeRe:(s,i={})=>e.makeRe(s,ext(t,i)),braceExpand:(s,i={})=>e.braceExpand(s,ext(t,i)),match:(s,i,r={})=>e.match(s,i,ext(t,r)),sep:e.sep,GLOBSTAR:S})};const braceExpand=(t,e={})=>(assertValidPattern(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,i.f)(t));minimatch.braceExpand=braceExpand;minimatch.makeRe=(t,e={})=>new Minimatch(t,e).makeRe();minimatch.match=(t,e,s={})=>{const i=new Minimatch(e,s);return t=t.filter((t=>i.match(t))),i.options.nonull&&!t.length&&t.push(e),t};const b=/[?*]|[+@!]\(.*?\)|\[|\]/;class Minimatch{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){assertValidPattern(t),e=e||{},this.options=e,this.pattern=t,this.platform=e.platform||y,this.isWindows="win32"===this.platform,this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||!1===e.allowWindowsEscape,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=void 0!==e.windowsNoMagicRoot?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(const t of this.set)for(const e of t)if("string"!=typeof e)return!0;return!1}debug(...t){}make(){const t=this.pattern,e=this.options;if(!e.nocomment&&"#"===t.charAt(0))return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...t)=>console.error(...t)),this.debug(this.pattern,this.globSet);const s=this.globSet.map((t=>this.slashSplit(t)));this.globParts=this.preprocess(s),this.debug(this.pattern,this.globParts);let i=this.globParts.map(((t,e,s)=>{if(this.isWindows&&this.windowsNoMagicRoot){const e=!(""!==t[0]||""!==t[1]||"?"!==t[2]&&b.test(t[2])||b.test(t[3])),s=/^[a-z]:/i.test(t[0]);if(e)return[...t.slice(0,4),...t.slice(4).map((t=>this.parse(t)))];if(s)return[t[0],...t.slice(1).map((t=>this.parse(t)))]}return t.map((t=>this.parse(t)))}));if(this.debug(this.pattern,i),this.set=i.filter((t=>-1===t.indexOf(!1))),this.isWindows)for(let t=0;t<this.set.length;t++){const e=this.set[t];""===e[0]&&""===e[1]&&"?"===this.globParts[t][2]&&"string"==typeof e[3]&&/^[a-z]:$/i.test(e[3])&&(e[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let e=0;e<t.length;e++)for(let s=0;s<t[e].length;s++)"**"===t[e][s]&&(t[e][s]="*");const{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):t=e>=1?this.levelOneOptimize(t):this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map((t=>{let e=-1;for(;-1!==(e=t.indexOf("**",e+1));){let s=e;for(;"**"===t[s+1];)s++;s!==e&&t.splice(e,s-e)}return t}))}levelOneOptimize(t){return t.map((t=>0===(t=t.reduce(((t,e)=>{const s=t[t.length-1];return"**"===e&&"**"===s?t:".."===e&&s&&".."!==s&&"."!==s&&"**"!==s?(t.pop(),t):(t.push(e),t)}),[])).length?[""]:t))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let s=1;s<t.length-1;s++){const i=t[s];1===s&&""===i&&""===t[0]||("."!==i&&""!==i||(e=!0,t.splice(s,1),s--))}"."!==t[0]||2!==t.length||"."!==t[1]&&""!==t[1]||(e=!0,t.pop())}let s=0;for(;-1!==(s=t.indexOf("..",s+1));){const i=t[s-1];i&&"."!==i&&".."!==i&&"**"!==i&&(e=!0,t.splice(s-1,2),s-=2)}}while(e);return 0===t.length?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let s of t){let i=-1;for(;-1!==(i=s.indexOf("**",i+1));){let r=i;for(;"**"===s[r+1];)r++;r>i&&s.splice(i+1,r-i);let n=s[i+1];const h=s[i+2],o=s[i+3];if(".."!==n)continue;if(!h||"."===h||".."===h||!o||"."===o||".."===o)continue;e=!0,s.splice(i,1);const a=s.slice(0);a[i]="**",t.push(a),i--}if(!this.preserveMultipleSlashes){for(let t=1;t<s.length-1;t++){const i=s[t];1===t&&""===i&&""===s[0]||("."!==i&&""!==i||(e=!0,s.splice(t,1),t--))}"."!==s[0]||2!==s.length||"."!==s[1]&&""!==s[1]||(e=!0,s.pop())}let r=0;for(;-1!==(r=s.indexOf("..",r+1));){const t=s[r-1];if(t&&"."!==t&&".."!==t&&"**"!==t){e=!0;const t=1===r&&"**"===s[r+1]?["."]:[];s.splice(r-1,2,...t),0===s.length&&s.push(""),r-=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++){const i=this.partsMatch(t[e],t[s],!this.preserveMultipleSlashes);if(i){t[e]=[],t[s]=i;break}}return t.filter((t=>t.length))}partsMatch(t,e,s=!1){let i=0,r=0,n=[],h="";for(;i<t.length&&r<e.length;)if(t[i]===e[r])n.push("b"===h?e[r]:t[i]),i++,r++;else if(s&&"**"===t[i]&&e[r]===t[i+1])n.push(t[i]),i++;else if(s&&"**"===e[r]&&t[i]===e[r+1])n.push(e[r]),r++;else if("*"!==t[i]||!e[r]||!this.options.dot&&e[r].startsWith(".")||"**"===e[r]){if("*"!==e[r]||!t[i]||!this.options.dot&&t[i].startsWith(".")||"**"===t[i])return!1;if("a"===h)return!1;h="b",n.push(e[r]),i++,r++}else{if("b"===h)return!1;h="a",n.push(t[i]),i++,r++}return t.length===e.length&&n}parseNegate(){if(this.nonegate)return;const t=this.pattern;let e=!1,s=0;for(let i=0;i<t.length&&"!"===t.charAt(i);i++)e=!e,s++;s&&(this.pattern=t.slice(s)),this.negate=e}matchOne(t,e,s=!1){const i=this.options;if(this.isWindows){const s="string"==typeof t[0]&&/^[a-z]:$/i.test(t[0]),i=!s&&""===t[0]&&""===t[1]&&"?"===t[2]&&/^[a-z]:$/i.test(t[3]),r="string"==typeof e[0]&&/^[a-z]:$/i.test(e[0]),n=i?3:s?0:void 0,h=!r&&""===e[0]&&""===e[1]&&"?"===e[2]&&"string"==typeof e[3]&&/^[a-z]:$/i.test(e[3])?3:r?0:void 0;if("number"==typeof n&&"number"==typeof h){const[s,i]=[t[n],e[h]];s.toLowerCase()===i.toLowerCase()&&(e[h]=s,h>n?e=e.slice(h):n>h&&(t=t.slice(n)))}}const{optimizationLevel:r=1}=this.options;r>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var n=0,h=0,o=t.length,a=e.length;n<o&&h<a;n++,h++){this.debug("matchOne loop");var l=e[h],c=t[n];if(this.debug(e,l,c),!1===l)return!1;if(l===S){this.debug("GLOBSTAR",[e,l,c]);var p=n,d=h+1;if(d===a){for(this.debug("** at the end");n<o;n++)if("."===t[n]||".."===t[n]||!i.dot&&"."===t[n].charAt(0))return!1;return!0}for(;p<o;){var u=t[p];if(this.debug("\nglobstar while",t,p,e,d,u),this.matchOne(t.slice(p),e.slice(d),s))return this.debug("globstar found match!",p,o,u),!0;if("."===u||".."===u||!i.dot&&"."===u.charAt(0)){this.debug("dot detected!",t,p,e,d);break}this.debug("globstar swallow a segment, and continue"),p++}return!(!s||(this.debug("\n>>> no match, partial?",t,p,e,d),p!==o))}let r;if("string"==typeof l?(r=c===l,this.debug("string match",l,c,r)):(r=l.test(c),this.debug("pattern match",l,c,r)),!r)return!1}if(n===o&&h===a)return!0;if(n===o)return s;if(h===a)return n===o-1&&""===t[n];throw new Error("wtf?")}braceExpand(){return braceExpand(this.pattern,this.options)}parse(t){assertValidPattern(t);const e=this.options;if("**"===t)return S;if(""===t)return"";let s,i=null;(s=t.match(m))?i=e.dot?starTestDot:starTest:(s=t.match(u))?i=(e.nocase?e.dot?starDotExtTestNocaseDot:starDotExtTestNocase:e.dot?starDotExtTestDot:starDotExtTest)(s[1]):(s=t.match(w))?i=(e.nocase?e.dot?qmarksTestNocaseDot:qmarksTestNocase:e.dot?qmarksTestDot:qmarksTest)(s):(s=t.match(f))?i=e.dot?starDotStarTestDot:starDotStarTest:(s=t.match(g))&&(i=dotStarTest);const r=AST.fromGlob(t,this.options).toMMPattern();return i&&"object"==typeof r&&Reflect.defineProperty(r,"test",{value:i}),r}makeRe(){if(this.regexp||!1===this.regexp)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const e=this.options,s=e.noglobstar?"[^/]*?":e.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",i=new Set(e.nocase?["i"]:[]);let r=t.map((t=>{const e=t.map((t=>{if(t instanceof RegExp)for(const e of t.flags.split(""))i.add(e);return"string"==typeof t?t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):t===S?S:t._src}));return e.forEach(((t,i)=>{const r=e[i+1],n=e[i-1];t===S&&n!==S&&(void 0===n?void 0!==r&&r!==S?e[i+1]="(?:\\/|"+s+"\\/)?"+r:e[i]=s:void 0===r?e[i-1]=n+"(?:\\/|"+s+")?":r!==S&&(e[i-1]=n+"(?:\\/|\\/"+s+"\\/)"+r,e[i+1]=S))})),e.filter((t=>t!==S)).join("/")})).join("|");const[n,h]=t.length>1?["(?:",")"]:["",""];r="^"+n+r+h+"$",this.negate&&(r="^(?!"+r+").+$");try{this.regexp=new RegExp(r,[...i].join(""))}catch(t){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;const s=this.options;this.isWindows&&(t=t.split("\\").join("/"));const i=this.slashSplit(t);this.debug(this.pattern,"split",i);const r=this.set;this.debug(this.pattern,"set",r);let n=i[i.length-1];if(!n)for(let t=i.length-2;!n&&t>=0;t--)n=i[t];for(let t=0;t<r.length;t++){const h=r[t];let o=i;s.matchBase&&1===h.length&&(o=[n]);if(this.matchOne(o,h,e))return!!s.flipNegate||!this.negate}return!s.flipNegate&&this.negate}static defaults(t){return minimatch.defaults(t).Minimatch}}minimatch.AST=AST,minimatch.Minimatch=Minimatch,minimatch.escape=escape_escape,minimatch.unescape=unescape_unescape;var v=s(73136);const k="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,x=new Set,C="object"==typeof process&&process?process:{},emitWarning=(t,e,s,i)=>{"function"==typeof C.emitWarning?C.emitWarning(t,e,s,i):console.error(`[${s}] ${e}: ${t}`)};let T=globalThis.AbortController,A=globalThis.AbortSignal;if(void 0===T){A=class AbortSignal{onabort;_onabort=[];reason;aborted=!1;addEventListener(t,e){this._onabort.push(e)}},T=class AbortController{constructor(){warnACPolyfill()}signal=new A;abort(t){if(!this.signal.aborted){this.signal.reason=t,this.signal.aborted=!0;for(const e of this.signal._onabort)e(t);this.signal.onabort?.(t)}}};let t="1"!==C.env?.LRU_CACHE_IGNORE_AC_WARNING;const warnACPolyfill=()=>{t&&(t=!1,emitWarning("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",warnACPolyfill))}}Symbol("type");const isPosInt=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),getUintArray=t=>isPosInt(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?ZeroArray:null:null;class ZeroArray extends Array{constructor(t){super(t),this.fill(0)}}class Stack{heap;length;static#g=!1;static create(t){const e=getUintArray(t);if(!e)return[];Stack.#g=!0;const s=new Stack(t,e);return Stack.#g=!1,s}constructor(t,e){if(!Stack.#g)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]}}class LRUCache{#m;#w;#y;#S;#b;#v;#k;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#x;#C;#T;#A;#L;#E;#F;#M;#P;#R;#z;#O;#D;#N;#W;#_;#I;#B;static unsafeExposeInternals(t){return{starts:t.#D,ttls:t.#N,sizes:t.#O,keyMap:t.#T,keyList:t.#A,valList:t.#L,next:t.#E,prev:t.#F,get head(){return t.#M},get tail(){return t.#P},free:t.#R,isBackgroundFetch:e=>t.#G(e),backgroundFetch:(e,s,i,r)=>t.#U(e,s,i,r),moveToTail:e=>t.#j(e),indexes:e=>t.#$(e),rindexes:e=>t.#H(e),isStale:e=>t.#q(e)}}get max(){return this.#m}get maxSize(){return this.#w}get calculatedSize(){return this.#C}get size(){return this.#x}get fetchMethod(){return this.#v}get memoMethod(){return this.#k}get dispose(){return this.#y}get onInsert(){return this.#S}get disposeAfter(){return this.#b}constructor(t){const{max:e=0,ttl:s,ttlResolution:i=1,ttlAutopurge:r,updateAgeOnGet:n,updateAgeOnHas:h,allowStale:o,dispose:a,onInsert:l,disposeAfter:c,noDisposeOnSet:p,noUpdateTTL:d,maxSize:u=0,maxEntrySize:f=0,sizeCalculation:g,fetchMethod:m,memoMethod:w,noDeleteOnFetchRejection:y,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:v,ignoreFetchAbort:k}=t;if(0!==e&&!isPosInt(e))throw new TypeError("max option must be a nonnegative integer");const C=e?getUintArray(e):Array;if(!C)throw new Error("invalid max value: "+e);if(this.#m=e,this.#w=u,this.maxEntrySize=f||this.#w,this.sizeCalculation=g,this.sizeCalculation){if(!this.#w&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==w&&"function"!=typeof w)throw new TypeError("memoMethod must be a function if defined");if(this.#k=w,void 0!==m&&"function"!=typeof m)throw new TypeError("fetchMethod must be a function if specified");if(this.#v=m,this.#_=!!m,this.#T=new Map,this.#A=new Array(e).fill(void 0),this.#L=new Array(e).fill(void 0),this.#E=new C(e),this.#F=new C(e),this.#M=0,this.#P=0,this.#R=Stack.create(e),this.#x=0,this.#C=0,"function"==typeof a&&(this.#y=a),"function"==typeof l&&(this.#S=l),"function"==typeof c?(this.#b=c,this.#z=[]):(this.#b=void 0,this.#z=void 0),this.#W=!!this.#y,this.#B=!!this.#S,this.#I=!!this.#b,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!y,this.allowStaleOnFetchRejection=!!b,this.allowStaleOnFetchAbort=!!v,this.ignoreFetchAbort=!!k,0!==this.maxEntrySize){if(0!==this.#w&&!isPosInt(this.#w))throw new TypeError("maxSize must be a positive integer if specified");if(!isPosInt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#Z()}if(this.allowStale=!!o,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!n,this.updateAgeOnHas=!!h,this.ttlResolution=isPosInt(i)||0===i?i:1,this.ttlAutopurge=!!r,this.ttl=s||0,this.ttl){if(!isPosInt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#V()}if(0===this.#m&&0===this.ttl&&0===this.#w)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#m&&!this.#w){const t="LRU_CACHE_UNBOUNDED";if((t=>!x.has(t))(t)){x.add(t);emitWarning("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,LRUCache)}}}getRemainingTTL(t){return this.#T.has(t)?1/0:0}#V(){const t=new ZeroArray(this.#m),e=new ZeroArray(this.#m);this.#N=t,this.#D=e,this.#J=(s,i,r=k.now())=>{if(e[s]=0!==i?r:0,t[s]=i,0!==i&&this.ttlAutopurge){const t=setTimeout((()=>{this.#q(s)&&this.#K(this.#A[s],"expire")}),i+1);t.unref&&t.unref()}},this.#X=s=>{e[s]=0!==t[s]?k.now():0},this.#Y=(i,r)=>{if(t[r]){const n=t[r],h=e[r];if(!n||!h)return;i.ttl=n,i.start=h,i.now=s||getNow();const o=i.now-h;i.remainingTTL=n-o}};let s=0;const getNow=()=>{const t=k.now();if(this.ttlResolution>0){s=t;const e=setTimeout((()=>s=0),this.ttlResolution);e.unref&&e.unref()}return t};this.getRemainingTTL=i=>{const r=this.#T.get(i);if(void 0===r)return 0;const n=t[r],h=e[r];if(!n||!h)return 1/0;return n-((s||getNow())-h)},this.#q=i=>{const r=e[i],n=t[i];return!!n&&!!r&&(s||getNow())-r>n}}#X=()=>{};#Y=()=>{};#J=()=>{};#q=()=>!1;#Z(){const t=new ZeroArray(this.#m);this.#C=0,this.#O=t,this.#Q=e=>{this.#C-=t[e],t[e]=0},this.#tt=(t,e,s,i)=>{if(this.#G(e))return 0;if(!isPosInt(s)){if(!i)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof i)throw new TypeError("sizeCalculation must be a function");if(s=i(e,t),!isPosInt(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return s},this.#et=(e,s,i)=>{if(t[e]=s,this.#w){const s=this.#w-t[e];for(;this.#C>s;)this.#st(!0)}this.#C+=t[e],i&&(i.entrySize=s,i.totalCalculatedSize=this.#C)}}#Q=t=>{};#et=(t,e,s)=>{};#tt=(t,e,s,i)=>{if(s||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#$({allowStale:t=this.allowStale}={}){if(this.#x)for(let e=this.#P;this.#it(e)&&(!t&&this.#q(e)||(yield e),e!==this.#M);)e=this.#F[e]}*#H({allowStale:t=this.allowStale}={}){if(this.#x)for(let e=this.#M;this.#it(e)&&(!t&&this.#q(e)||(yield e),e!==this.#P);)e=this.#E[e]}#it(t){return void 0!==t&&this.#T.get(this.#A[t])===t}*entries(){for(const t of this.#$())void 0===this.#L[t]||void 0===this.#A[t]||this.#G(this.#L[t])||(yield[this.#A[t],this.#L[t]])}*rentries(){for(const t of this.#H())void 0===this.#L[t]||void 0===this.#A[t]||this.#G(this.#L[t])||(yield[this.#A[t],this.#L[t]])}*keys(){for(const t of this.#$()){const e=this.#A[t];void 0===e||this.#G(this.#L[t])||(yield e)}}*rkeys(){for(const t of this.#H()){const e=this.#A[t];void 0===e||this.#G(this.#L[t])||(yield e)}}*values(){for(const t of this.#$()){void 0===this.#L[t]||this.#G(this.#L[t])||(yield this.#L[t])}}*rvalues(){for(const t of this.#H()){void 0===this.#L[t]||this.#G(this.#L[t])||(yield this.#L[t])}}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(const s of this.#$()){const i=this.#L[s],r=this.#G(i)?i.__staleWhileFetching:i;if(void 0!==r&&t(r,this.#A[s],this))return this.get(this.#A[s],e)}}forEach(t,e=this){for(const s of this.#$()){const i=this.#L[s],r=this.#G(i)?i.__staleWhileFetching:i;void 0!==r&&t.call(e,r,this.#A[s],this)}}rforEach(t,e=this){for(const s of this.#H()){const i=this.#L[s],r=this.#G(i)?i.__staleWhileFetching:i;void 0!==r&&t.call(e,r,this.#A[s],this)}}purgeStale(){let t=!1;for(const e of this.#H({allowStale:!0}))this.#q(e)&&(this.#K(this.#A[e],"expire"),t=!0);return t}info(t){const e=this.#T.get(t);if(void 0===e)return;const s=this.#L[e],i=this.#G(s)?s.__staleWhileFetching:s;if(void 0===i)return;const r={value:i};if(this.#N&&this.#D){const t=this.#N[e],s=this.#D[e];if(t&&s){const e=t-(k.now()-s);r.ttl=e,r.start=Date.now()}}return this.#O&&(r.size=this.#O[e]),r}dump(){const t=[];for(const e of this.#$({allowStale:!0})){const s=this.#A[e],i=this.#L[e],r=this.#G(i)?i.__staleWhileFetching:i;if(void 0===r||void 0===s)continue;const n={value:r};if(this.#N&&this.#D){n.ttl=this.#N[e];const t=k.now()-this.#D[e];n.start=Math.floor(Date.now()-t)}this.#O&&(n.size=this.#O[e]),t.unshift([s,n])}return t}load(t){this.clear();for(const[e,s]of t){if(s.start){const t=Date.now()-s.start;s.start=k.now()-t}this.set(e,s.value,s)}}set(t,e,s={}){if(void 0===e)return this.delete(t),this;const{ttl:i=this.ttl,start:r,noDisposeOnSet:n=this.noDisposeOnSet,sizeCalculation:h=this.sizeCalculation,status:o}=s;let{noUpdateTTL:a=this.noUpdateTTL}=s;const l=this.#tt(t,e,s.size||0,h);if(this.maxEntrySize&&l>this.maxEntrySize)return o&&(o.set="miss",o.maxEntrySizeExceeded=!0),this.#K(t,"set"),this;let c=0===this.#x?void 0:this.#T.get(t);if(void 0===c)c=0===this.#x?this.#P:0!==this.#R.length?this.#R.pop():this.#x===this.#m?this.#st(!1):this.#x,this.#A[c]=t,this.#L[c]=e,this.#T.set(t,c),this.#E[this.#P]=c,this.#F[c]=this.#P,this.#P=c,this.#x++,this.#et(c,l,o),o&&(o.set="add"),a=!1,this.#B&&this.#S?.(e,t,"add");else{this.#j(c);const s=this.#L[c];if(e!==s){if(this.#_&&this.#G(s)){s.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:e}=s;void 0===e||n||(this.#W&&this.#y?.(e,t,"set"),this.#I&&this.#z?.push([e,t,"set"]))}else n||(this.#W&&this.#y?.(s,t,"set"),this.#I&&this.#z?.push([s,t,"set"]));if(this.#Q(c),this.#et(c,l,o),this.#L[c]=e,o){o.set="replace";const t=s&&this.#G(s)?s.__staleWhileFetching:s;void 0!==t&&(o.oldValue=t)}}else o&&(o.set="update");this.#B&&this.onInsert?.(e,t,e===s?"update":"replace")}if(0===i||this.#N||this.#V(),this.#N&&(a||this.#J(c,i,r),o&&this.#Y(o,c)),!n&&this.#I&&this.#z){const t=this.#z;let e;for(;e=t?.shift();)this.#b?.(...e)}return this}pop(){try{for(;this.#x;){const t=this.#L[this.#M];if(this.#st(!0),this.#G(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(void 0!==t)return t}}finally{if(this.#I&&this.#z){const t=this.#z;let e;for(;e=t?.shift();)this.#b?.(...e)}}}#st(t){const e=this.#M,s=this.#A[e],i=this.#L[e];return this.#_&&this.#G(i)?i.__abortController.abort(new Error("evicted")):(this.#W||this.#I)&&(this.#W&&this.#y?.(i,s,"evict"),this.#I&&this.#z?.push([i,s,"evict"])),this.#Q(e),t&&(this.#A[e]=void 0,this.#L[e]=void 0,this.#R.push(e)),1===this.#x?(this.#M=this.#P=0,this.#R.length=0):this.#M=this.#E[e],this.#T.delete(s),this.#x--,e}has(t,e={}){const{updateAgeOnHas:s=this.updateAgeOnHas,status:i}=e,r=this.#T.get(t);if(void 0!==r){const t=this.#L[r];if(this.#G(t)&&void 0===t.__staleWhileFetching)return!1;if(!this.#q(r))return s&&this.#X(r),i&&(i.has="hit",this.#Y(i,r)),!0;i&&(i.has="stale",this.#Y(i,r))}else i&&(i.has="miss");return!1}peek(t,e={}){const{allowStale:s=this.allowStale}=e,i=this.#T.get(t);if(void 0===i||!s&&this.#q(i))return;const r=this.#L[i];return this.#G(r)?r.__staleWhileFetching:r}#U(t,e,s,i){const r=void 0===e?void 0:this.#L[e];if(this.#G(r))return r;const n=new T,{signal:h}=s;h?.addEventListener("abort",(()=>n.abort(h.reason)),{signal:n.signal});const o={signal:n.signal,options:s,context:i},cb=(i,r=!1)=>{const{aborted:h}=n.signal,l=s.ignoreFetchAbort&&void 0!==i;if(s.status&&(h&&!r?(s.status.fetchAborted=!0,s.status.fetchError=n.signal.reason,l&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),h&&!l&&!r)return fetchFail(n.signal.reason);const c=a;return this.#L[e]===a&&(void 0===i?c.__staleWhileFetching?this.#L[e]=c.__staleWhileFetching:this.#K(t,"fetch"):(s.status&&(s.status.fetchUpdated=!0),this.set(t,i,o.options))),i},fetchFail=i=>{const{aborted:r}=n.signal,h=r&&s.allowStaleOnFetchAbort,o=h||s.allowStaleOnFetchRejection,l=o||s.noDeleteOnFetchRejection,c=a;if(this.#L[e]===a){!l||void 0===c.__staleWhileFetching?this.#K(t,"fetch"):h||(this.#L[e]=c.__staleWhileFetching)}if(o)return s.status&&void 0!==c.__staleWhileFetching&&(s.status.returnedStale=!0),c.__staleWhileFetching;if(c.__returned===c)throw i};s.status&&(s.status.fetchDispatched=!0);const a=new Promise(((e,i)=>{const h=this.#v?.(t,r,o);h&&h instanceof Promise&&h.then((t=>e(void 0===t?void 0:t)),i),n.signal.addEventListener("abort",(()=>{s.ignoreFetchAbort&&!s.allowStaleOnFetchAbort||(e(void 0),s.allowStaleOnFetchAbort&&(e=t=>cb(t,!0)))}))})).then(cb,(t=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=t),fetchFail(t)))),l=Object.assign(a,{__abortController:n,__staleWhileFetching:r,__returned:void 0});return void 0===e?(this.set(t,l,{...o.options,status:void 0}),e=this.#T.get(t)):this.#L[e]=l,l}#G(t){if(!this.#_)return!1;const e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof T}async fetch(t,e={}){const{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:n=this.ttl,noDisposeOnSet:h=this.noDisposeOnSet,size:o=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:u=this.allowStaleOnFetchAbort,context:f,forceRefresh:g=!1,status:m,signal:w}=e;if(!this.#_)return m&&(m.fetch="get"),this.get(t,{allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:r,status:m});const y={allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:r,ttl:n,noDisposeOnSet:h,size:o,sizeCalculation:a,noUpdateTTL:l,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:u,ignoreFetchAbort:d,status:m,signal:w};let S=this.#T.get(t);if(void 0===S){m&&(m.fetch="miss");const e=this.#U(t,S,y,f);return e.__returned=e}{const e=this.#L[S];if(this.#G(e)){const t=s&&void 0!==e.__staleWhileFetching;return m&&(m.fetch="inflight",t&&(m.returnedStale=!0)),t?e.__staleWhileFetching:e.__returned=e}const r=this.#q(S);if(!g&&!r)return m&&(m.fetch="hit"),this.#j(S),i&&this.#X(S),m&&this.#Y(m,S),e;const n=this.#U(t,S,y,f),h=void 0!==n.__staleWhileFetching&&s;return m&&(m.fetch=r?"stale":"refresh",h&&r&&(m.returnedStale=!0)),h?n.__staleWhileFetching:n.__returned=n}}async forceFetch(t,e={}){const s=await this.fetch(t,e);if(void 0===s)throw new Error("fetch() returned undefined");return s}memo(t,e={}){const s=this.#k;if(!s)throw new Error("no memoMethod provided to constructor");const{context:i,forceRefresh:r,...n}=e,h=this.get(t,n);if(!r&&void 0!==h)return h;const o=s(t,h,{options:n,context:i});return this.set(t,o,n),o}get(t,e={}){const{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:n}=e,h=this.#T.get(t);if(void 0!==h){const e=this.#L[h],o=this.#G(e);return n&&this.#Y(n,h),this.#q(h)?(n&&(n.get="stale"),o?(n&&s&&void 0!==e.__staleWhileFetching&&(n.returnedStale=!0),s?e.__staleWhileFetching:void 0):(r||this.#K(t,"expire"),n&&s&&(n.returnedStale=!0),s?e:void 0)):(n&&(n.get="hit"),o?e.__staleWhileFetching:(this.#j(h),i&&this.#X(h),e))}n&&(n.get="miss")}#rt(t,e){this.#F[e]=t,this.#E[t]=e}#j(t){t!==this.#P&&(t===this.#M?this.#M=this.#E[t]:this.#rt(this.#F[t],this.#E[t]),this.#rt(this.#P,t),this.#P=t)}delete(t){return this.#K(t,"delete")}#K(t,e){let s=!1;if(0!==this.#x){const i=this.#T.get(t);if(void 0!==i)if(s=!0,1===this.#x)this.#nt(e);else{this.#Q(i);const s=this.#L[i];if(this.#G(s)?s.__abortController.abort(new Error("deleted")):(this.#W||this.#I)&&(this.#W&&this.#y?.(s,t,e),this.#I&&this.#z?.push([s,t,e])),this.#T.delete(t),this.#A[i]=void 0,this.#L[i]=void 0,i===this.#P)this.#P=this.#F[i];else if(i===this.#M)this.#M=this.#E[i];else{const t=this.#F[i];this.#E[t]=this.#E[i];const e=this.#E[i];this.#F[e]=this.#F[i]}this.#x--,this.#R.push(i)}}if(this.#I&&this.#z?.length){const t=this.#z;let e;for(;e=t?.shift();)this.#b?.(...e)}return s}clear(){return this.#nt("delete")}#nt(t){for(const e of this.#H({allowStale:!0})){const s=this.#L[e];if(this.#G(s))s.__abortController.abort(new Error("deleted"));else{const i=this.#A[e];this.#W&&this.#y?.(s,i,t),this.#I&&this.#z?.push([s,i,t])}}if(this.#T.clear(),this.#L.fill(void 0),this.#A.fill(void 0),this.#N&&this.#D&&(this.#N.fill(0),this.#D.fill(0)),this.#O&&this.#O.fill(0),this.#M=0,this.#P=0,this.#R.length=0,this.#C=0,this.#x=0,this.#I&&this.#z){const t=this.#z;let e;for(;e=t?.shift();)this.#b?.(...e)}}}var L=s(76760),E=s(79896),F=s(73024),M=s.t(F,2),P=s(51455),R=s(26022);const z=E.realpathSync.native,O={lstatSync:E.lstatSync,readdir:E.readdir,readdirSync:E.readdirSync,readlinkSync:E.readlinkSync,realpathSync:z,promises:{lstat:P.lstat,readdir:P.readdir,readlink:P.readlink,realpath:P.realpath}},fsFromOption=t=>t&&t!==O&&t!==M?{...O,...t,promises:{...O.promises,...t.promises||{}}}:O,D=/^\\\\\?\\([a-z]:)\\?$/i,N=/[\\\/]/,W=10,_=15,I=-16,B=128,G=256,U=512,entToType=t=>t.isFile()?8:t.isDirectory()?4:t.isSymbolicLink()?W:t.isCharacterDevice()?2:t.isBlockDevice()?6:t.isSocket()?12:t.isFIFO()?1:0,j=new Map,normalize=t=>{const e=j.get(t);if(e)return e;const s=t.normalize("NFKD");return j.set(t,s),s},$=new Map,normalizeNocase=t=>{const e=$.get(t);if(e)return e;const s=normalize(t.toLowerCase());return $.set(t,s),s};class ResolveCache extends LRUCache{constructor(){super({max:256})}}class ChildrenCache extends LRUCache{constructor(t=16384){super({maxSize:t,sizeCalculation:t=>t.length+1})}}const H=Symbol("PathScurry setAsCwd");class PathBase{name;root;roots;parent;nocase;isCWD=!1;#ht;#ot;get dev(){return this.#ot}#at;get mode(){return this.#at}#lt;get nlink(){return this.#lt}#ct;get uid(){return this.#ct}#pt;get gid(){return this.#pt}#dt;get rdev(){return this.#dt}#ut;get blksize(){return this.#ut}#ft;get ino(){return this.#ft}#x;get size(){return this.#x}#gt;get blocks(){return this.#gt}#mt;get atimeMs(){return this.#mt}#wt;get mtimeMs(){return this.#wt}#yt;get ctimeMs(){return this.#yt}#St;get birthtimeMs(){return this.#St}#bt;get atime(){return this.#bt}#vt;get mtime(){return this.#vt}#kt;get ctime(){return this.#kt}#xt;get birthtime(){return this.#xt}#Ct;#Tt;#At;#Lt;#Et;#Ft;#Mt;#Pt;#Rt;#zt;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(t,e=0,s,i,r,n,h){this.name=t,this.#Ct=r?normalizeNocase(t):normalize(t),this.#Mt=1023&e,this.nocase=r,this.roots=i,this.root=s||this,this.#Pt=n,this.#At=h.fullpath,this.#Et=h.relative,this.#Ft=h.relativePosix,this.parent=h.parent,this.parent?this.#ht=this.parent.#ht:this.#ht=fsFromOption(h.fs)}depth(){return void 0!==this.#Tt?this.#Tt:this.parent?this.#Tt=this.parent.depth()+1:this.#Tt=0}childrenCache(){return this.#Pt}resolve(t){if(!t)return this;const e=this.getRootString(t),s=t.substring(e.length).split(this.splitSep);return e?this.getRoot(e).#Ot(s):this.#Ot(s)}#Ot(t){let e=this;for(const s of t)e=e.child(s);return e}children(){const t=this.#Pt.get(this);if(t)return t;const e=Object.assign([],{provisional:0});return this.#Pt.set(this,e),this.#Mt&=-17,e}child(t,e){if(""===t||"."===t)return this;if(".."===t)return this.parent||this;const s=this.children(),i=this.nocase?normalizeNocase(t):normalize(t);for(const t of s)if(t.#Ct===i)return t;const r=this.parent?this.sep:"",n=this.#At?this.#At+r+t:void 0,h=this.newChild(t,0,{...e,parent:this,fullpath:n});return this.canReaddir()||(h.#Mt|=B),s.push(h),h}relative(){if(this.isCWD)return"";if(void 0!==this.#Et)return this.#Et;const t=this.name,e=this.parent;if(!e)return this.#Et=this.name;const s=e.relative();return s+(s&&e.parent?this.sep:"")+t}relativePosix(){if("/"===this.sep)return this.relative();if(this.isCWD)return"";if(void 0!==this.#Ft)return this.#Ft;const t=this.name,e=this.parent;if(!e)return this.#Ft=this.fullpathPosix();const s=e.relativePosix();return s+(s&&e.parent?"/":"")+t}fullpath(){if(void 0!==this.#At)return this.#At;const t=this.name,e=this.parent;if(!e)return this.#At=this.name;const s=e.fullpath()+(e.parent?this.sep:"")+t;return this.#At=s}fullpathPosix(){if(void 0!==this.#Lt)return this.#Lt;if("/"===this.sep)return this.#Lt=this.fullpath();if(!this.parent){const t=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(t)?this.#Lt=`//?/${t}`:this.#Lt=t}const t=this.parent,e=t.fullpathPosix(),s=e+(e&&t.parent?"/":"")+this.name;return this.#Lt=s}isUnknown(){return!(this.#Mt&_)}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 8==(this.#Mt&_)}isDirectory(){return 4==(this.#Mt&_)}isCharacterDevice(){return 2==(this.#Mt&_)}isBlockDevice(){return 6==(this.#Mt&_)}isFIFO(){return 1==(this.#Mt&_)}isSocket(){return 12==(this.#Mt&_)}isSymbolicLink(){return(this.#Mt&W)===W}lstatCached(){return 32&this.#Mt?this:void 0}readlinkCached(){return this.#Rt}realpathCached(){return this.#zt}readdirCached(){const t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(this.#Rt)return!0;if(!this.parent)return!1;const t=this.#Mt&_;return!(0!==t&&t!==W||this.#Mt&G||this.#Mt&B)}calledReaddir(){return!!(16&this.#Mt)}isENOENT(){return!!(this.#Mt&B)}isNamed(t){return this.nocase?this.#Ct===normalizeNocase(t):this.#Ct===normalize(t)}async readlink(){const t=this.#Rt;if(t)return t;if(this.canReadlink()&&this.parent)try{const t=await this.#ht.promises.readlink(this.fullpath()),e=(await this.parent.realpath())?.resolve(t);if(e)return this.#Rt=e}catch(t){return void this.#Dt(t.code)}}readlinkSync(){const t=this.#Rt;if(t)return t;if(this.canReadlink()&&this.parent)try{const t=this.#ht.readlinkSync(this.fullpath()),e=this.parent.realpathSync()?.resolve(t);if(e)return this.#Rt=e}catch(t){return void this.#Dt(t.code)}}#Nt(t){this.#Mt|=16;for(let e=t.provisional;e<t.length;e++){const s=t[e];s&&s.#Wt()}}#Wt(){this.#Mt&B||(this.#Mt=(this.#Mt|B)&I,this.#_t())}#_t(){const t=this.children();t.provisional=0;for(const e of t)e.#Wt()}#It(){this.#Mt|=U,this.#Bt()}#Bt(){if(64&this.#Mt)return;let t=this.#Mt;4==(t&_)&&(t&=I),this.#Mt=64|t,this.#_t()}#Gt(t=""){"ENOTDIR"===t||"EPERM"===t?this.#Bt():"ENOENT"===t?this.#Wt():this.children().provisional=0}#Ut(t=""){if("ENOTDIR"===t){this.parent.#Bt()}else"ENOENT"===t&&this.#Wt()}#Dt(t=""){let e=this.#Mt;e|=G,"ENOENT"===t&&(e|=B),"EINVAL"!==t&&"UNKNOWN"!==t||(e&=I),this.#Mt=e,"ENOTDIR"===t&&this.parent&&this.parent.#Bt()}#jt(t,e){return this.#$t(t,e)||this.#Ht(t,e)}#Ht(t,e){const s=entToType(t),i=this.newChild(t.name,s,{parent:this}),r=i.#Mt&_;return 4!==r&&r!==W&&0!==r&&(i.#Mt|=64),e.unshift(i),e.provisional++,i}#$t(t,e){for(let s=e.provisional;s<e.length;s++){const i=e[s];if((this.nocase?normalizeNocase(t.name):normalize(t.name))===i.#Ct)return this.#qt(t,i,s,e)}}#qt(t,e,s,i){const r=e.name;return e.#Mt=e.#Mt&I|entToType(t),r!==t.name&&(e.name=t.name),s!==i.provisional&&(s===i.length-1?i.pop():i.splice(s,1),i.unshift(e)),i.provisional++,e}async lstat(){if(!(this.#Mt&B))try{return this.#Zt(await this.#ht.promises.lstat(this.fullpath())),this}catch(t){this.#Ut(t.code)}}lstatSync(){if(!(this.#Mt&B))try{return this.#Zt(this.#ht.lstatSync(this.fullpath())),this}catch(t){this.#Ut(t.code)}}#Zt(t){const{atime:e,atimeMs:s,birthtime:i,birthtimeMs:r,blksize:n,blocks:h,ctime:o,ctimeMs:a,dev:l,gid:c,ino:p,mode:d,mtime:u,mtimeMs:f,nlink:g,rdev:m,size:w,uid:y}=t;this.#bt=e,this.#mt=s,this.#xt=i,this.#St=r,this.#ut=n,this.#gt=h,this.#kt=o,this.#yt=a,this.#ot=l,this.#pt=c,this.#ft=p,this.#at=d,this.#vt=u,this.#wt=f,this.#lt=g,this.#dt=m,this.#x=w,this.#ct=y;const S=entToType(t);this.#Mt=this.#Mt&I|S|32,0!==S&&4!==S&&S!==W&&(this.#Mt|=64)}#Vt=[];#Jt=!1;#Kt(t){this.#Jt=!1;const e=this.#Vt.slice();this.#Vt.length=0,e.forEach((e=>e(null,t)))}readdirCB(t,e=!1){if(!this.canReaddir())return void(e?t(null,[]):queueMicrotask((()=>t(null,[]))));const s=this.children();if(this.calledReaddir()){const i=s.slice(0,s.provisional);return void(e?t(null,i):queueMicrotask((()=>t(null,i))))}if(this.#Vt.push(t),this.#Jt)return;this.#Jt=!0;const i=this.fullpath();this.#ht.readdir(i,{withFileTypes:!0},((t,e)=>{if(t)this.#Gt(t.code),s.provisional=0;else{for(const t of e)this.#jt(t,s);this.#Nt(s)}this.#Kt(s.slice(0,s.provisional))}))}#Xt;async readdir(){if(!this.canReaddir())return[];const t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);const e=this.fullpath();if(this.#Xt)await this.#Xt;else{let resolve=()=>{};this.#Xt=new Promise((t=>resolve=t));try{for(const s of await this.#ht.promises.readdir(e,{withFileTypes:!0}))this.#jt(s,t);this.#Nt(t)}catch(e){this.#Gt(e.code),t.provisional=0}this.#Xt=void 0,resolve()}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir())return[];const t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);const e=this.fullpath();try{for(const s of this.#ht.readdirSync(e,{withFileTypes:!0}))this.#jt(s,t);this.#Nt(t)}catch(e){this.#Gt(e.code),t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(704&this.#Mt)return!1;const t=_&this.#Mt;return 0===t||4===t||t===W}shouldWalk(t,e){return!(4&~this.#Mt)&&!(704&this.#Mt)&&!t.has(this)&&(!e||e(this))}async realpath(){if(this.#zt)return this.#zt;if(!(896&this.#Mt))try{const t=await this.#ht.promises.realpath(this.fullpath());return this.#zt=this.resolve(t)}catch(t){this.#It()}}realpathSync(){if(this.#zt)return this.#zt;if(!(896&this.#Mt))try{const t=this.#ht.realpathSync(this.fullpath());return this.#zt=this.resolve(t)}catch(t){this.#It()}}[H](t){if(t===this)return;t.isCWD=!1,this.isCWD=!0;const e=new Set([]);let s=[],i=this;for(;i&&i.parent;)e.add(i),i.#Et=s.join(this.sep),i.#Ft=s.join("/"),i=i.parent,s.push("..");for(i=t;i&&i.parent&&!e.has(i);)i.#Et=void 0,i.#Ft=void 0,i=i.parent}}class PathWin32 extends PathBase{sep="\\";splitSep=N;constructor(t,e=0,s,i,r,n,h){super(t,e,s,i,r,n,h)}newChild(t,e=0,s={}){return new PathWin32(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}getRootString(t){return L.win32.parse(t).root}getRoot(t){if((t=(t=>t.replace(/\//g,"\\").replace(D,"$1\\"))(t.toUpperCase()))===this.root.name)return this.root;for(const[e,s]of Object.entries(this.roots))if(this.sameRoot(t,e))return this.roots[t]=s;return this.roots[t]=new PathScurryWin32(t,this).root}sameRoot(t,e=this.root.name){return(t=t.toUpperCase().replace(/\//g,"\\").replace(D,"$1\\"))===e}}class PathPosix extends PathBase{splitSep="/";sep="/";constructor(t,e=0,s,i,r,n,h){super(t,e,s,i,r,n,h)}getRootString(t){return t.startsWith("/")?"/":""}getRoot(t){return this.root}newChild(t,e=0,s={}){return new PathPosix(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}}class PathScurryBase{root;rootPath;roots;cwd;#Yt;#Qt;#Pt;nocase;#ht;constructor(t=process.cwd(),e,s,{nocase:i,childrenCacheSize:r=16384,fs:n=O}={}){this.#ht=fsFromOption(n),(t instanceof URL||t.startsWith("file://"))&&(t=(0,v.fileURLToPath)(t));const h=e.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(h),this.#Yt=new ResolveCache,this.#Qt=new ResolveCache,this.#Pt=new ChildrenCache(r);const o=h.substring(this.rootPath.length).split(s);if(1!==o.length||o[0]||o.pop(),void 0===i)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#ht),this.roots[this.rootPath]=this.root;let a=this.root,l=o.length-1;const c=e.sep;let p=this.rootPath,d=!1;for(const t of o){const e=l--;a=a.child(t,{relative:new Array(e).fill("..").join(c),relativePosix:new Array(e).fill("..").join("/"),fullpath:p+=(d?"":c)+t}),d=!0}this.cwd=a}depth(t=this.cwd){return"string"==typeof t&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return this.#Pt}resolve(...t){let e="";for(let s=t.length-1;s>=0;s--){const i=t[s];if(i&&"."!==i&&(e=e?`${i}/${e}`:i,this.isAbsolute(i)))break}const s=this.#Yt.get(e);if(void 0!==s)return s;const i=this.cwd.resolve(e).fullpath();return this.#Yt.set(e,i),i}resolvePosix(...t){let e="";for(let s=t.length-1;s>=0;s--){const i=t[s];if(i&&"."!==i&&(e=e?`${i}/${e}`:i,this.isAbsolute(i)))break}const s=this.#Qt.get(e);if(void 0!==s)return s;const i=this.cwd.resolve(e).fullpathPosix();return this.#Qt.set(e,i),i}relative(t=this.cwd){return"string"==typeof t&&(t=this.cwd.resolve(t)),t.relative()}relativePosix(t=this.cwd){return"string"==typeof t&&(t=this.cwd.resolve(t)),t.relativePosix()}basename(t=this.cwd){return"string"==typeof t&&(t=this.cwd.resolve(t)),t.name}dirname(t=this.cwd){return"string"==typeof t&&(t=this.cwd.resolve(t)),(t.parent||t).fullpath()}async readdir(t=this.cwd,e={withFileTypes:!0}){"string"==typeof t?t=this.cwd.resolve(t):t instanceof PathBase||(e=t,t=this.cwd);const{withFileTypes:s}=e;if(t.canReaddir()){const e=await t.readdir();return s?e:e.map((t=>t.name))}return[]}readdirSync(t=this.cwd,e={withFileTypes:!0}){"string"==typeof t?t=this.cwd.resolve(t):t instanceof PathBase||(e=t,t=this.cwd);const{withFileTypes:s=!0}=e;return t.canReaddir()?s?t.readdirSync():t.readdirSync().map((t=>t.name)):[]}async lstat(t=this.cwd){return"string"==typeof t&&(t=this.cwd.resolve(t)),t.lstat()}lstatSync(t=this.cwd){return"string"==typeof t&&(t=this.cwd.resolve(t)),t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){"string"==typeof t?t=this.cwd.resolve(t):t instanceof PathBase||(e=t.withFileTypes,t=this.cwd);const s=await t.readlink();return e?s:s?.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){"string"==typeof t?t=this.cwd.resolve(t):t instanceof PathBase||(e=t.withFileTypes,t=this.cwd);const s=t.readlinkSync();return e?s:s?.fullpath()}async realpath(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){"string"==typeof t?t=this.cwd.resolve(t):t instanceof PathBase||(e=t.withFileTypes,t=this.cwd);const s=await t.realpath();return e?s:s?.fullpath()}realpathSync(t=this.cwd,{withFileTypes:e}={withFileTypes:!1}){"string"==typeof t?t=this.cwd.resolve(t):t instanceof PathBase||(e=t.withFileTypes,t=this.cwd);const s=t.realpathSync();return e?s:s?.fullpath()}async walk(t=this.cwd,e={}){"string"==typeof t?t=this.cwd.resolve(t):t instanceof PathBase||(e=t,t=this.cwd);const{withFileTypes:s=!0,follow:i=!1,filter:r,walkFilter:n}=e,h=[];r&&!r(t)||h.push(s?t:t.fullpath());const o=new Set,walk=(t,e)=>{o.add(t),t.readdirCB(((t,a)=>{if(t)return e(t);let l=a.length;if(!l)return e();const next=()=>{0==--l&&e()};for(const t of a)r&&!r(t)||h.push(s?t:t.fullpath()),i&&t.isSymbolicLink()?t.realpath().then((t=>t?.isUnknown()?t.lstat():t)).then((t=>t?.shouldWalk(o,n)?walk(t,next):next())):t.shouldWalk(o,n)?walk(t,next):next()}),!0)},a=t;return new Promise(((t,e)=>{walk(a,(s=>{if(s)return e(s);t(h)}))}))}walkSync(t=this.cwd,e={}){"string"==typeof t?t=this.cwd.resolve(t):t instanceof PathBase||(e=t,t=this.cwd);const{withFileTypes:s=!0,follow:i=!1,filter:r,walkFilter:n}=e,h=[];r&&!r(t)||h.push(s?t:t.fullpath());const o=new Set([t]);for(const t of o){const e=t.readdirSync();for(const t of e){r&&!r(t)||h.push(s?t:t.fullpath());let e=t;if(t.isSymbolicLink()){if(!i||!(e=t.realpathSync()))continue;e.isUnknown()&&e.lstatSync()}e.shouldWalk(o,n)&&o.add(e)}}return h}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,e={}){return"string"==typeof t?t=this.cwd.resolve(t):t instanceof PathBase||(e=t,t=this.cwd),this.stream(t,e)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,e={}){"string"==typeof t?t=this.cwd.resolve(t):t instanceof PathBase||(e=t,t=this.cwd);const{withFileTypes:s=!0,follow:i=!1,filter:r,walkFilter:n}=e;r&&!r(t)||(yield s?t:t.fullpath());const h=new Set([t]);for(const t of h){const e=t.readdirSync();for(const t of e){r&&!r(t)||(yield s?t:t.fullpath());let e=t;if(t.isSymbolicLink()){if(!i||!(e=t.realpathSync()))continue;e.isUnknown()&&e.lstatSync()}e.shouldWalk(h,n)&&h.add(e)}}}stream(t=this.cwd,e={}){"string"==typeof t?t=this.cwd.resolve(t):t instanceof PathBase||(e=t,t=this.cwd);const{withFileTypes:s=!0,follow:i=!1,filter:r,walkFilter:n}=e,h=new R.n_({objectMode:!0});r&&!r(t)||h.write(s?t:t.fullpath());const o=new Set,a=[t];let l=0;const process=()=>{let t=!1;for(;!t;){const e=a.shift();if(!e)return void(0===l&&h.end());l++,o.add(e);const onReaddir=(e,p,d=!1)=>{if(e)return h.emit("error",e);if(i&&!d){const t=[];for(const e of p)e.isSymbolicLink()&&t.push(e.realpath().then((t=>t?.isUnknown()?t.lstat():t)));if(t.length)return void Promise.all(t).then((()=>onReaddir(null,p,!0)))}for(const e of p)!e||r&&!r(e)||h.write(s?e:e.fullpath())||(t=!0);l--;for(const t of p){const e=t.realpathCached()||t;e.shouldWalk(o,n)&&a.push(e)}t&&!h.flowing?h.once("drain",process):c||process()};let c=!0;e.readdirCB(onReaddir,!0),c=!1}};return process(),h}streamSync(t=this.cwd,e={}){"string"==typeof t?t=this.cwd.resolve(t):t instanceof PathBase||(e=t,t=this.cwd);const{withFileTypes:s=!0,follow:i=!1,filter:r,walkFilter:n}=e,h=new R.n_({objectMode:!0}),o=new Set;r&&!r(t)||h.write(s?t:t.fullpath());const a=[t];let l=0;const process=()=>{let t=!1;for(;!t;){const e=a.shift();if(!e)return void(0===l&&h.end());l++,o.add(e);const c=e.readdirSync();for(const e of c)r&&!r(e)||h.write(s?e:e.fullpath())||(t=!0);l--;for(const t of c){let e=t;if(t.isSymbolicLink()){if(!i||!(e=t.realpathSync()))continue;e.isUnknown()&&e.lstatSync()}e.shouldWalk(o,n)&&a.push(e)}}t&&!h.flowing&&h.once("drain",process)};return process(),h}chdir(t=this.cwd){const e=this.cwd;this.cwd="string"==typeof t?this.cwd.resolve(t):t,this.cwd[H](e)}}class PathScurryWin32 extends PathScurryBase{sep="\\";constructor(t=process.cwd(),e={}){const{nocase:s=!0}=e;super(t,L.win32,"\\",{...e,nocase:s}),this.nocase=s;for(let t=this.cwd;t;t=t.parent)t.nocase=this.nocase}parseRootPath(t){return L.win32.parse(t).root.toUpperCase()}newRoot(t){return new PathWin32(this.rootPath,4,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}}class PathScurryPosix extends PathScurryBase{sep="/";constructor(t=process.cwd(),e={}){const{nocase:s=!1}=e;super(t,L.posix,"/",{...e,nocase:s}),this.nocase=s}parseRootPath(t){return"/"}newRoot(t){return new PathPosix(this.rootPath,4,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}}class PathScurryDarwin extends PathScurryPosix{constructor(t=process.cwd(),e={}){const{nocase:s=!0}=e;super(t,{...e,nocase:s})}}process.platform;const q="win32"===process.platform?PathScurryWin32:"darwin"===process.platform?PathScurryDarwin:PathScurryPosix;class Pattern{#te;#ee;#se;length;#ie;#re;#ne;#he;#oe;#ae;#le=!0;constructor(t,e,s,i){if(!(t.length>=1))throw new TypeError("empty pattern list");if(!(e.length>=1))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.#te=t,this.#ee=e,this.#se=s,this.#ie=i,0===this.#se)if(this.isUNC()){const[t,e,s,i,...r]=this.#te,[n,h,o,a,...l]=this.#ee;""===r[0]&&(r.shift(),l.shift());const c=[t,e,s,i,""].join("/"),p=[n,h,o,a,""].join("/");this.#te=[c,...r],this.#ee=[p,...l],this.length=this.#te.length}else if(this.isDrive()||this.isAbsolute()){const[t,...e]=this.#te,[s,...i]=this.#ee;""===e[0]&&(e.shift(),i.shift());const r=t+"/",n=s+"/";this.#te=[r,...e],this.#ee=[n,...i],this.length=this.#te.length}}pattern(){return this.#te[this.#se]}isString(){return"string"==typeof this.#te[this.#se]}isGlobstar(){return this.#te[this.#se]===S}isRegExp(){return this.#te[this.#se]instanceof RegExp}globString(){return this.#ne=this.#ne||(0===this.#se?this.isAbsolute()?this.#ee[0]+this.#ee.slice(1).join("/"):this.#ee.join("/"):this.#ee.slice(this.#se).join("/"))}hasMore(){return this.length>this.#se+1}rest(){return void 0!==this.#re?this.#re:this.hasMore()?(this.#re=new Pattern(this.#te,this.#ee,this.#se+1,this.#ie),this.#re.#ae=this.#ae,this.#re.#oe=this.#oe,this.#re.#he=this.#he,this.#re):this.#re=null}isUNC(){const t=this.#te;return void 0!==this.#oe?this.#oe:this.#oe="win32"===this.#ie&&0===this.#se&&""===t[0]&&""===t[1]&&"string"==typeof t[2]&&!!t[2]&&"string"==typeof t[3]&&!!t[3]}isDrive(){const t=this.#te;return void 0!==this.#he?this.#he:this.#he="win32"===this.#ie&&0===this.#se&&this.length>1&&"string"==typeof t[0]&&/^[a-z]:$/i.test(t[0])}isAbsolute(){const t=this.#te;return void 0!==this.#ae?this.#ae:this.#ae=""===t[0]&&t.length>1||this.isDrive()||this.isUNC()}root(){const t=this.#te[0];return"string"==typeof t&&this.isAbsolute()&&0===this.#se?t:""}checkFollowGlobstar(){return!(0===this.#se||!this.isGlobstar()||!this.#le)}markFollowGlobstar(){return!(0===this.#se||!this.isGlobstar()||!this.#le)&&(this.#le=!1,!0)}}const Z="object"==typeof process&&process&&"string"==typeof process.platform?process.platform:"linux";class Ignore{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(t,{nobrace:e,nocase:s,noext:i,noglobstar:r,platform:n=Z}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=n,this.mmopts={dot:!0,nobrace:e,nocase:s,noext:i,noglobstar:r,optimizationLevel:2,platform:n,nocomment:!0,nonegate:!0};for(const e of t)this.add(e)}add(t){const e=new Minimatch(t,this.mmopts);for(let t=0;t<e.set.length;t++){const s=e.set[t],i=e.globParts[t];if(!s||!i)throw new Error("invalid pattern object");for(;"."===s[0]&&"."===i[0];)s.shift(),i.shift();const r=new Pattern(s,i,0,this.platform),n=new Minimatch(r.globString(),this.mmopts),h="**"===i[i.length-1],o=r.isAbsolute();o?this.absolute.push(n):this.relative.push(n),h&&(o?this.absoluteChildren.push(n):this.relativeChildren.push(n))}}ignored(t){const e=t.fullpath(),s=`${e}/`,i=t.relative()||".",r=`${i}/`;for(const t of this.relative)if(t.match(i)||t.match(r))return!0;for(const t of this.absolute)if(t.match(e)||t.match(s))return!0;return!1}childrenIgnored(t){const e=t.fullpath()+"/",s=(t.relative()||".")+"/";for(const t of this.relativeChildren)if(t.match(s))return!0;for(const t of this.absoluteChildren)if(t.match(e))return!0;return!1}}class HasWalkedCache{store;constructor(t=new Map){this.store=t}copy(){return new HasWalkedCache(new Map(this.store))}hasWalked(t,e){return this.store.get(t.fullpath())?.has(e.globString())}storeWalked(t,e){const s=t.fullpath(),i=this.store.get(s);i?i.add(e.globString()):this.store.set(s,new Set([e.globString()]))}}class MatchRecord{store=new Map;add(t,e,s){const i=(e?2:0)|(s?1:0),r=this.store.get(t);this.store.set(t,void 0===r?i:i&r)}entries(){return[...this.store.entries()].map((([t,e])=>[t,!!(2&e),!!(1&e)]))}}class SubWalks{store=new Map;add(t,e){if(!t.canReaddir())return;const s=this.store.get(t);s?s.find((t=>t.globString()===e.globString()))||s.push(e):this.store.set(t,[e])}get(t){const 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()))}}class Processor{hasWalkedCache;matches=new MatchRecord;subwalks=new SubWalks;patterns;follow;dot;opts;constructor(t,e){this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=e?e.copy():new HasWalkedCache}processPatterns(t,e){this.patterns=e;const s=e.map((e=>[t,e]));for(let[t,e]of s){this.hasWalkedCache.storeWalked(t,e);const s=e.root(),i=e.isAbsolute()&&!1!==this.opts.absolute;if(s){t=t.resolve("/"===s&&void 0!==this.opts.root?this.opts.root:s);const i=e.rest();if(!i){this.matches.add(t,!0,!1);continue}e=i}if(t.isENOENT())continue;let r,n,h=!1;for(;"string"==typeof(r=e.pattern())&&(n=e.rest());){const s=t.resolve(r);t=s,e=n,h=!0}if(r=e.pattern(),n=e.rest(),h){if(this.hasWalkedCache.hasWalked(t,e))continue;this.hasWalkedCache.storeWalked(t,e)}if("string"!=typeof r)if(r===S){(!t.isSymbolicLink()||this.follow||e.checkFollowGlobstar())&&this.subwalks.add(t,e);const s=n?.pattern(),r=n?.rest();if(n&&(""!==s&&"."!==s||r)){if(".."===s){const e=t.parent||t;r?this.hasWalkedCache.hasWalked(e,r)||this.subwalks.add(e,r):this.matches.add(e,i,!0)}}else this.matches.add(t,i,""===s||"."===s)}else r instanceof RegExp&&this.subwalks.add(t,e);else{const e=".."===r||""===r||"."===r;this.matches.add(t.resolve(r),i,e)}}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new Processor(this.opts,this.hasWalkedCache)}filterEntries(t,e){const s=this.subwalks.get(t),i=this.child();for(const t of e)for(const e of s){const s=e.isAbsolute(),r=e.pattern(),n=e.rest();r===S?i.testGlobstar(t,e,n,s):r instanceof RegExp?i.testRegExp(t,r,n,s):i.testString(t,r,n,s)}return i}testGlobstar(t,e,s,i){if(!this.dot&&t.name.startsWith(".")||(e.hasMore()||this.matches.add(t,i,!1),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,e):t.isSymbolicLink()&&(s&&e.checkFollowGlobstar()?this.subwalks.add(t,s):e.markFollowGlobstar()&&this.subwalks.add(t,e)))),s){const e=s.pattern();if("string"==typeof e&&".."!==e&&""!==e&&"."!==e)this.testString(t,e,s.rest(),i);else if(".."===e){const e=t.parent||t;this.subwalks.add(e,s)}else e instanceof RegExp&&this.testRegExp(t,e,s.rest(),i)}}testRegExp(t,e,s,i){e.test(t.name)&&(s?this.subwalks.add(t,s):this.matches.add(t,i,!1))}testString(t,e,s,i){t.isNamed(e)&&(s?this.subwalks.add(t,s):this.matches.add(t,i,!1))}}class GlobUtil{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#ce=[];#pe;#de;signal;maxDepth;includeChildMatches;constructor(t,e,s){if(this.patterns=t,this.path=e,this.opts=s,this.#de=s.posix||"win32"!==s.platform?"/":"\\",this.includeChildMatches=!1!==s.includeChildMatches,(s.ignore||!this.includeChildMatches)&&(this.#pe=((t,e)=>"string"==typeof t?new Ignore([t],e):Array.isArray(t)?new Ignore(t,e):t)(s.ignore??[],s),!this.includeChildMatches&&"function"!=typeof this.#pe.add)){throw new Error("cannot ignore child matches, ignore lacks add() method.")}this.maxDepth=s.maxDepth||1/0,s.signal&&(this.signal=s.signal,this.signal.addEventListener("abort",(()=>{this.#ce.length=0})))}#ue(t){return this.seen.has(t)||!!this.#pe?.ignored?.(t)}#fe(t){return!!this.#pe?.childrenIgnored?.(t)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;let t;for(this.paused=!1;!this.paused&&(t=this.#ce.shift());)t()}onResume(t){this.signal?.aborted||(this.paused?this.#ce.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}const i=t.isUnknown()||this.opts.stat?await t.lstat():t;if(this.opts.follow&&this.opts.nodir&&i?.isSymbolicLink()){const t=await i.realpath();t&&(t.isUnknown()||this.opts.stat)&&await t.lstat()}return this.matchCheckTest(i,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.#ue(t)?void 0:t}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}const i=t.isUnknown()||this.opts.stat?t.lstatSync():t;if(this.opts.follow&&this.opts.nodir&&i?.isSymbolicLink()){const t=i.realpathSync();t&&(t?.isUnknown()||this.opts.stat)&&t.lstatSync()}return this.matchCheckTest(i,e)}matchFinish(t,e){if(this.#ue(t))return;if(!this.includeChildMatches&&this.#pe?.add){const e=`${t.relativePosix()}/**`;this.#pe.add(e)}const s=void 0===this.opts.absolute?e:this.opts.absolute;this.seen.add(t);const i=this.opts.mark&&t.isDirectory()?this.#de:"";if(this.opts.withFileTypes)this.matchEmit(t);else if(s){const e=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(e+i)}else{const e=this.opts.posix?t.relativePosix():t.relative(),s=this.opts.dotRelative&&!e.startsWith(".."+this.#de)?"."+this.#de:"";this.matchEmit(e?s+e+i:"."+i)}}async match(t,e,s){const i=await this.matchCheck(t,s);i&&this.matchFinish(i,e)}matchSync(t,e,s){const i=this.matchCheckSync(t,s);i&&this.matchFinish(i,e)}walkCB(t,e,s){this.signal?.aborted&&s(),this.walkCB2(t,e,new Processor(this.opts),s)}walkCB2(t,e,s,i){if(this.#fe(t))return i();if(this.signal?.aborted&&i(),this.paused)return void this.onResume((()=>this.walkCB2(t,e,s,i)));s.processPatterns(t,e);let r=1;const next=()=>{0==--r&&i()};for(const[t,e,i]of s.matches.entries())this.#ue(t)||(r++,this.match(t,e,i).then((()=>next())));for(const t of s.subwalkTargets()){if(this.maxDepth!==1/0&&t.depth()>=this.maxDepth)continue;r++;const e=t.readdirCached();t.calledReaddir()?this.walkCB3(t,e,s,next):t.readdirCB(((e,i)=>this.walkCB3(t,i,s,next)),!0)}next()}walkCB3(t,e,s,i){s=s.filterEntries(t,e);let r=1;const next=()=>{0==--r&&i()};for(const[t,e,i]of s.matches.entries())this.#ue(t)||(r++,this.match(t,e,i).then((()=>next())));for(const[t,e]of s.subwalks.entries())r++,this.walkCB2(t,e,s.child(),next);next()}walkCBSync(t,e,s){this.signal?.aborted&&s(),this.walkCB2Sync(t,e,new Processor(this.opts),s)}walkCB2Sync(t,e,s,i){if(this.#fe(t))return i();if(this.signal?.aborted&&i(),this.paused)return void this.onResume((()=>this.walkCB2Sync(t,e,s,i)));s.processPatterns(t,e);let r=1;const next=()=>{0==--r&&i()};for(const[t,e,i]of s.matches.entries())this.#ue(t)||this.matchSync(t,e,i);for(const t of s.subwalkTargets()){if(this.maxDepth!==1/0&&t.depth()>=this.maxDepth)continue;r++;const e=t.readdirSync();this.walkCB3Sync(t,e,s,next)}next()}walkCB3Sync(t,e,s,i){s=s.filterEntries(t,e);let r=1;const next=()=>{0==--r&&i()};for(const[t,e,i]of s.matches.entries())this.#ue(t)||this.matchSync(t,e,i);for(const[t,e]of s.subwalks.entries())r++,this.walkCB2Sync(t,e,s.child(),next);next()}}class GlobWalker extends GlobUtil{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}}class GlobStream extends GlobUtil{results;constructor(t,e,s){super(t,e,s),this.results=new R.n_({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(){const 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}}const V="object"==typeof process&&process&&"string"==typeof process.platform?process.platform:"linux";class Glob{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(t,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=(0,v.fileURLToPath)(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=!1!==e.includeChildMatches,this.noglobstar=!!e.noglobstar,this.matchBase=!!e.matchBase,this.maxDepth="number"==typeof e.maxDepth?e.maxDepth:1/0,this.stat=!!e.stat,this.ignore=e.ignore,this.withFileTypes&&void 0!==this.absolute)throw new Error("cannot set absolute and withFileTypes:true");if("string"==typeof t&&(t=[t]),this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||!1===e.allowWindowsEscape,this.windowsPathsNoEscape&&(t=t.map((t=>t.replace(/\\/g,"/")))),this.matchBase){if(e.noglobstar)throw new TypeError("base matching requires globstar");t=t.map((t=>t.includes("/")?t:`./**/${t}`))}if(this.pattern=t,this.platform=e.platform||V,this.opts={...e,platform:this.platform},e.scurry){if(this.scurry=e.scurry,void 0!==e.nocase&&e.nocase!==e.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{const t="win32"===e.platform?PathScurryWin32:"darwin"===e.platform?PathScurryDarwin:e.platform?PathScurryPosix:q;this.scurry=new t(this.cwd,{nocase:e.nocase,fs:e.fs})}this.nocase=this.scurry.nocase;const s="darwin"===this.platform||"win32"===this.platform,i={...e,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:s,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},r=this.pattern.map((t=>new Minimatch(t,i))),[n,h]=r.reduce(((t,e)=>(t[0].push(...e.set),t[1].push(...e.globParts),t)),[[],[]]);this.patterns=n.map(((t,e)=>{const s=h[e];if(!s)throw new Error("invalid pattern object");return new Pattern(t,s,0,this.platform)}))}async walk(){return[...await new GlobWalker(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 GlobWalker(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 GlobStream(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 GlobStream(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()}}const hasMagic=(t,e={})=>{Array.isArray(t)||(t=[t]);for(const s of t)if(new Minimatch(s,e).hasMagic())return!0;return!1};function globStreamSync(t,e={}){return new Glob(t,e).streamSync()}function globStream(t,e={}){return new Glob(t,e).stream()}function globSync(t,e={}){return new Glob(t,e).walkSync()}async function glob_(t,e={}){return new Glob(t,e).walk()}function globIterateSync(t,e={}){return new Glob(t,e).iterateSync()}function globIterate(t,e={}){return new Glob(t,e).iterate()}const J=globStreamSync,K=Object.assign(globStream,{sync:globStreamSync}),X=globIterateSync,Y=Object.assign(globIterate,{sync:globIterateSync}),Q=Object.assign(globSync,{stream:globStreamSync,iterate:globIterateSync}),tt=Object.assign(glob_,{glob:glob_,globSync,sync:Q,globStream,stream:K,globStreamSync,streamSync:J,globIterate,iterate:Y,globIterateSync,iterateSync:X,Glob,hasMagic,escape:escape_escape,unescape:unescape_unescape});tt.glob=tt}};