nf3 0.3.10 → 0.3.12

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.
Files changed (52) hide show
  1. package/README.md +20 -1
  2. package/dist/_chunks/libs/exsolve.d.mts +1 -0
  3. package/dist/_chunks/libs/exsolve.mjs +292 -292
  4. package/dist/_chunks/libs/pathe.mjs +25 -24
  5. package/dist/_chunks/libs/pkg-types.d.mts +1 -1
  6. package/dist/_chunks/trace.mjs +39 -15
  7. package/dist/_chunks/types.d.mts +18 -0
  8. package/dist/db.mjs +12 -38
  9. package/dist/index.mjs +1 -0
  10. package/dist/node_modules/.nf3/minipass@7.1.3/dist/commonjs/index.js +1 -0
  11. package/dist/node_modules/{path-scurry → .nf3/minipass@7.1.3}/package.json +2 -2
  12. package/dist/node_modules/@vercel/nft/out/analyze.js +1 -1
  13. package/dist/node_modules/@vercel/nft/out/node-file-trace.js +1 -1
  14. package/dist/node_modules/@vercel/nft/package.json +1 -1
  15. package/dist/node_modules/acorn/dist/acorn.js +6 -6
  16. package/dist/node_modules/acorn/package.json +1 -1
  17. package/dist/node_modules/consola/dist/basic.cjs +1 -1
  18. package/dist/node_modules/consola/dist/core.cjs +2 -2
  19. package/dist/node_modules/consola/dist/shared/consola.DCGIlDNP.cjs +7 -7
  20. package/dist/node_modules/glob/dist/commonjs/index.min.js +3 -0
  21. package/dist/node_modules/glob/package.json +13 -3
  22. package/dist/plugin.mjs +10 -2
  23. package/package.json +13 -13
  24. package/dist/node_modules/@isaacs/balanced-match/dist/commonjs/index.js +0 -1
  25. package/dist/node_modules/@isaacs/balanced-match/package.json +0 -19
  26. package/dist/node_modules/@isaacs/brace-expansion/dist/commonjs/index.js +0 -1
  27. package/dist/node_modules/@isaacs/brace-expansion/package.json +0 -19
  28. package/dist/node_modules/glob/dist/commonjs/glob.js +0 -1
  29. package/dist/node_modules/glob/dist/commonjs/has-magic.js +0 -1
  30. package/dist/node_modules/glob/dist/commonjs/ignore.js +0 -1
  31. package/dist/node_modules/glob/dist/commonjs/index.js +0 -1
  32. package/dist/node_modules/glob/dist/commonjs/pattern.js +0 -1
  33. package/dist/node_modules/glob/dist/commonjs/processor.js +0 -1
  34. package/dist/node_modules/glob/dist/commonjs/walker.js +0 -1
  35. package/dist/node_modules/lru-cache/dist/commonjs/index.js +0 -1
  36. package/dist/node_modules/lru-cache/dist/commonjs/package.json +0 -3
  37. package/dist/node_modules/lru-cache/package.json +0 -28
  38. package/dist/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +0 -1
  39. package/dist/node_modules/minimatch/dist/commonjs/ast.js +0 -1
  40. package/dist/node_modules/minimatch/dist/commonjs/brace-expressions.js +0 -1
  41. package/dist/node_modules/minimatch/dist/commonjs/escape.js +0 -1
  42. package/dist/node_modules/minimatch/dist/commonjs/index.js +0 -3
  43. package/dist/node_modules/minimatch/dist/commonjs/package.json +0 -3
  44. package/dist/node_modules/minimatch/dist/commonjs/unescape.js +0 -1
  45. package/dist/node_modules/minimatch/package.json +0 -19
  46. package/dist/node_modules/minipass/dist/commonjs/package.json +0 -3
  47. package/dist/node_modules/path-scurry/dist/commonjs/index.js +0 -1
  48. package/dist/node_modules/path-scurry/dist/commonjs/package.json +0 -3
  49. /package/dist/node_modules/{minipass → .nf3/minipass@7.1.2}/dist/commonjs/index.js +0 -0
  50. /package/dist/node_modules/{@isaacs/balanced-match → .nf3/minipass@7.1.2}/dist/commonjs/package.json +0 -0
  51. /package/dist/node_modules/{minipass → .nf3/minipass@7.1.2}/package.json +0 -0
  52. /package/dist/node_modules/{@isaacs/brace-expansion → .nf3/minipass@7.1.3}/dist/commonjs/package.json +0 -0
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,`__esModule`,{value:!0});const core=require(`./core.cjs`),basic=require(`./shared/consola.DCGIlDNP.cjs`);require(`node:util`),require(`node:path`);function createConsola(e={}){let t=core.LogLevels.info;return process.env.CONSOLA_LEVEL&&(t=Number.parseInt(process.env.CONSOLA_LEVEL)??t),core.createConsola({level:t,defaults:{level:t},stdout:process.stdout,stderr:process.stderr,reporters:e.reporters||[new basic.BasicReporter],...e})}const consola=createConsola();exports.Consola=core.Consola,exports.LogLevels=core.LogLevels,exports.LogTypes=core.LogTypes,exports.consola=consola,exports.createConsola=createConsola,exports.default=consola;
1
+ "use strict";Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`./core.cjs`),t=require(`./shared/consola.DCGIlDNP.cjs`);require(`node:util`),require(`node:path`);function n(n={}){let r=e.LogLevels.info;return process.env.CONSOLA_LEVEL&&(r=Number.parseInt(process.env.CONSOLA_LEVEL)??r),e.createConsola({level:r,defaults:{level:r},stdout:process.stdout,stderr:process.stderr,reporters:n.reporters||[new t.BasicReporter],...n})}const r=n();exports.Consola=e.Consola,exports.LogLevels=e.LogLevels,exports.LogTypes=e.LogTypes,exports.consola=r,exports.createConsola=n,exports.default=r;
@@ -1,4 +1,4 @@
1
- "use strict";const LogLevels={silent:-1/0,fatal:0,error:0,warn:1,log:2,info:3,success:3,fail:3,ready:3,start:3,box:3,debug:4,trace:5,verbose:1/0},LogTypes={silent:{level:-1},fatal:{level:LogLevels.fatal},error:{level:LogLevels.error},warn:{level:LogLevels.warn},log:{level:LogLevels.log},info:{level:LogLevels.info},success:{level:LogLevels.success},fail:{level:LogLevels.fail},ready:{level:LogLevels.info},start:{level:LogLevels.info},box:{level:LogLevels.info},debug:{level:LogLevels.debug},trace:{level:LogLevels.trace},verbose:{level:LogLevels.verbose}};function isPlainObject$1(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)===`[object Module]`:!0}function _defu(e,t,i=`.`,a){if(!isPlainObject$1(t))return _defu(e,{},i,a);let o=Object.assign({},t);for(let t in e){if(t===`__proto__`||t===`constructor`)continue;let s=e[t];s!=null&&(a&&a(o,t,s,i)||(Array.isArray(s)&&Array.isArray(o[t])?o[t]=[...s,...o[t]]:isPlainObject$1(s)&&isPlainObject$1(o[t])?o[t]=_defu(s,o[t],(i?`${i}.`:``)+t.toString(),a):o[t]=s))}return o}function createDefu(e){return(...t)=>t.reduce((t,n)=>_defu(t,n,``,e),{})}const defu=createDefu();function isPlainObject(e){return Object.prototype.toString.call(e)===`[object Object]`}function isLogObj(e){return!(!isPlainObject(e)||!e.message&&!e.args||e.stack)}let paused=!1;const queue=[];class Consola{options;_lastLog;_mockFn;constructor(e={}){let n=e.types||LogTypes;this.options=defu({...e,defaults:{...e.defaults},level:_normalizeLogLevel(e.level,n),reporters:[...e.reporters||[]]},{types:LogTypes,throttle:1e3,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(let e in n){let t={type:e,...this.options.defaults,...n[e]};this[e]=this._wrapLogFn(t),this[e].raw=this._wrapLogFn(t,!0)}this.options.mockFn&&this.mockTypes(),this._lastLog={}}get level(){return this.options.level}set level(e){this.options.level=_normalizeLogLevel(e,this.options.types,this.options.level)}prompt(e,t){if(!this.options.prompt)throw Error(`prompt is not supported!`);return this.options.prompt(e,t)}create(e){let t=new Consola({...this.options,...e});return this._mockFn&&t.mockTypes(this._mockFn),t}withDefaults(e){return this.create({...this.options,defaults:{...this.options.defaults,...e}})}withTag(e){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+`:`+e:e})}addReporter(e){return this.options.reporters.push(e),this}removeReporter(e){if(e){let t=this.options.reporters.indexOf(e);if(t!==-1)return this.options.reporters.splice(t,1)}else this.options.reporters.splice(0);return this}setReporters(e){return this.options.reporters=Array.isArray(e)?e:[e],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(let e in this.options.types)console[`__`+e]||(console[`__`+e]=console[e]),console[e]=this[e].raw}restoreConsole(){for(let e in this.options.types)console[`__`+e]&&(console[e]=console[`__`+e],delete console[`__`+e])}wrapStd(){this._wrapStream(this.options.stdout,`log`),this._wrapStream(this.options.stderr,`log`)}_wrapStream(e,t){e&&(e.__write||=e.write,e.write=e=>{this[t].raw(String(e).trim())})}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(e){e&&e.__write&&(e.write=e.__write,delete e.__write)}pauseLogs(){paused=!0}resumeLogs(){paused=!1;let e=queue.splice(0);for(let t of e)t[0]._logFn(t[1],t[2])}mockTypes(e){let t=e||this.options.mockFn;if(this._mockFn=t,typeof t==`function`)for(let e in this.options.types)this[e]=t(e,this.options.types[e])||this[e],this[e].raw=this[e]}_wrapLogFn(e,t){return(...n)=>{if(paused){queue.push([this,e,n,t]);return}return this._logFn(e,n,t)}}_logFn(e,t,n){if((e.level||0)>this.level)return!1;let r={date:new Date,args:[],...e,level:_normalizeLogLevel(e.level,this.options.types)};!n&&t.length===1&&isLogObj(t[0])?Object.assign(r,t[0]):r.args=[...t],r.message&&(r.args.unshift(r.message),delete r.message),r.additional&&(Array.isArray(r.additional)||(r.additional=r.additional.split(`
1
+ "use strict";const e={silent:-1/0,fatal:0,error:0,warn:1,log:2,info:3,success:3,fail:3,ready:3,start:3,box:3,debug:4,trace:5,verbose:1/0},t={silent:{level:-1},fatal:{level:e.fatal},error:{level:e.error},warn:{level:e.warn},log:{level:e.log},info:{level:e.info},success:{level:e.success},fail:{level:e.fail},ready:{level:e.info},start:{level:e.info},box:{level:e.info},debug:{level:e.debug},trace:{level:e.trace},verbose:{level:e.verbose}};function n(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)===`[object Module]`:!0}function r(e,t,i=`.`,a){if(!n(t))return r(e,{},i,a);let o=Object.assign({},t);for(let t in e){if(t===`__proto__`||t===`constructor`)continue;let s=e[t];s!=null&&(a&&a(o,t,s,i)||(Array.isArray(s)&&Array.isArray(o[t])?o[t]=[...s,...o[t]]:n(s)&&n(o[t])?o[t]=r(s,o[t],(i?`${i}.`:``)+t.toString(),a):o[t]=s))}return o}function i(e){return(...t)=>t.reduce((t,n)=>r(t,n,``,e),{})}const a=i();function o(e){return Object.prototype.toString.call(e)===`[object Object]`}function s(e){return!(!o(e)||!e.message&&!e.args||e.stack)}let c=!1;const l=[];class u{options;_lastLog;_mockFn;constructor(e={}){let n=e.types||t;this.options=a({...e,defaults:{...e.defaults},level:d(e.level,n),reporters:[...e.reporters||[]]},{types:t,throttle:1e3,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(let e in n){let t={type:e,...this.options.defaults,...n[e]};this[e]=this._wrapLogFn(t),this[e].raw=this._wrapLogFn(t,!0)}this.options.mockFn&&this.mockTypes(),this._lastLog={}}get level(){return this.options.level}set level(e){this.options.level=d(e,this.options.types,this.options.level)}prompt(e,t){if(!this.options.prompt)throw Error(`prompt is not supported!`);return this.options.prompt(e,t)}create(e){let t=new u({...this.options,...e});return this._mockFn&&t.mockTypes(this._mockFn),t}withDefaults(e){return this.create({...this.options,defaults:{...this.options.defaults,...e}})}withTag(e){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+`:`+e:e})}addReporter(e){return this.options.reporters.push(e),this}removeReporter(e){if(e){let t=this.options.reporters.indexOf(e);if(t!==-1)return this.options.reporters.splice(t,1)}else this.options.reporters.splice(0);return this}setReporters(e){return this.options.reporters=Array.isArray(e)?e:[e],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(let e in this.options.types)console[`__`+e]||(console[`__`+e]=console[e]),console[e]=this[e].raw}restoreConsole(){for(let e in this.options.types)console[`__`+e]&&(console[e]=console[`__`+e],delete console[`__`+e])}wrapStd(){this._wrapStream(this.options.stdout,`log`),this._wrapStream(this.options.stderr,`log`)}_wrapStream(e,t){e&&(e.__write||=e.write,e.write=e=>{this[t].raw(String(e).trim())})}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(e){e&&e.__write&&(e.write=e.__write,delete e.__write)}pauseLogs(){c=!0}resumeLogs(){c=!1;let e=l.splice(0);for(let t of e)t[0]._logFn(t[1],t[2])}mockTypes(e){let t=e||this.options.mockFn;if(this._mockFn=t,typeof t==`function`)for(let e in this.options.types)this[e]=t(e,this.options.types[e])||this[e],this[e].raw=this[e]}_wrapLogFn(e,t){return(...n)=>{if(c){l.push([this,e,n,t]);return}return this._logFn(e,n,t)}}_logFn(e,t,n){if((e.level||0)>this.level)return!1;let r={date:new Date,args:[],...e,level:d(e.level,this.options.types)};!n&&t.length===1&&s(t[0])?Object.assign(r,t[0]):r.args=[...t],r.message&&(r.args.unshift(r.message),delete r.message),r.additional&&(Array.isArray(r.additional)||(r.additional=r.additional.split(`
2
2
  `)),r.args.push(`
3
3
  `+r.additional.join(`
4
- `)),delete r.additional),r.type=typeof r.type==`string`?r.type.toLowerCase():`log`,r.tag=typeof r.tag==`string`?r.tag:``;let i=(e=!1)=>{let t=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&t>0){let e=[...this._lastLog.object.args];t>1&&e.push(`(repeated ${t} times)`),this._log({...this._lastLog.object,args:e}),this._lastLog.count=1}e&&(this._lastLog.object=r,this._log(r))};clearTimeout(this._lastLog.timeout);let a=this._lastLog.time&&r.date?r.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=r.date,a<this.options.throttle)try{let e=JSON.stringify([r.type,r.tag,r.args]),t=this._lastLog.serialized===e;if(this._lastLog.serialized=e,t&&(this._lastLog.count=(this._lastLog.count||0)+1,this._lastLog.count>this.options.throttleMin)){this._lastLog.timeout=setTimeout(i,this.options.throttle);return}}catch{}i(!0)}_log(e){for(let t of this.options.reporters)t.log(e,{options:this.options})}}function _normalizeLogLevel(e,t={},n=3){return e===void 0?n:typeof e==`number`?e:t[e]&&t[e].level!==void 0?t[e].level:n}Consola.prototype.add=Consola.prototype.addReporter,Consola.prototype.remove=Consola.prototype.removeReporter,Consola.prototype.clear=Consola.prototype.removeReporter,Consola.prototype.withScope=Consola.prototype.withTag,Consola.prototype.mock=Consola.prototype.mockTypes,Consola.prototype.pause=Consola.prototype.pauseLogs,Consola.prototype.resume=Consola.prototype.resumeLogs;function createConsola(e={}){return new Consola(e)}exports.Consola=Consola,exports.LogLevels=LogLevels,exports.LogTypes=LogTypes,exports.createConsola=createConsola;
4
+ `)),delete r.additional),r.type=typeof r.type==`string`?r.type.toLowerCase():`log`,r.tag=typeof r.tag==`string`?r.tag:``;let i=(e=!1)=>{let t=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&t>0){let e=[...this._lastLog.object.args];t>1&&e.push(`(repeated ${t} times)`),this._log({...this._lastLog.object,args:e}),this._lastLog.count=1}e&&(this._lastLog.object=r,this._log(r))};clearTimeout(this._lastLog.timeout);let a=this._lastLog.time&&r.date?r.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=r.date,a<this.options.throttle)try{let e=JSON.stringify([r.type,r.tag,r.args]),t=this._lastLog.serialized===e;if(this._lastLog.serialized=e,t&&(this._lastLog.count=(this._lastLog.count||0)+1,this._lastLog.count>this.options.throttleMin)){this._lastLog.timeout=setTimeout(i,this.options.throttle);return}}catch{}i(!0)}_log(e){for(let t of this.options.reporters)t.log(e,{options:this.options})}}function d(e,t={},n=3){return e===void 0?n:typeof e==`number`?e:t[e]&&t[e].level!==void 0?t[e].level:n}u.prototype.add=u.prototype.addReporter,u.prototype.remove=u.prototype.removeReporter,u.prototype.clear=u.prototype.removeReporter,u.prototype.withScope=u.prototype.withTag,u.prototype.mock=u.prototype.mockTypes,u.prototype.pause=u.prototype.pauseLogs,u.prototype.resume=u.prototype.resumeLogs;function f(e={}){return new u(e)}exports.Consola=u,exports.LogLevels=e,exports.LogTypes=t,exports.createConsola=f;
@@ -1,12 +1,12 @@
1
- "use strict";const node_util=require(`node:util`),node_path=require(`node:path`);function parseStack(e,n){let r=process.cwd()+node_path.sep;return e.split(`
1
+ "use strict";const e=require(`node:util`),t=require(`node:path`);function n(e,n){let r=process.cwd()+t.sep;return e.split(`
2
2
  `).splice(n.split(`
3
- `).length).map(e=>e.trim().replace(`file://`,``).replace(r,``))}function writeStream(e,t){return(t.__write||t.write).call(t,e)}const bracket=e=>e?`[${e}]`:``;class BasicReporter{formatStack(e,t,r){let i=` `.repeat((r?.errorLevel||0)+1);return i+parseStack(e,t).join(`
4
- ${i}`)}formatError(t,n){let r=t.message??node_util.formatWithOptions(n,t),i=t.stack?this.formatStack(t.stack,r,n):``,a=n?.errorLevel||0,o=a>0?`${` `.repeat(a)}[cause]: `:``,s=t.cause?`
3
+ `).length).map(e=>e.trim().replace(`file://`,``).replace(r,``))}function r(e,t){return(t.__write||t.write).call(t,e)}const i=e=>e?`[${e}]`:``;class a{formatStack(e,t,r){let i=` `.repeat((r?.errorLevel||0)+1);return i+n(e,t).join(`
4
+ ${i}`)}formatError(t,n){let r=t.message??e.formatWithOptions(n,t),i=t.stack?this.formatStack(t.stack,r,n):``,a=n?.errorLevel||0,o=a>0?`${` `.repeat(a)}[cause]: `:``,s=t.cause?`
5
5
 
6
6
  `+this.formatError(t.cause,{...n,errorLevel:a+1}):``;return o+r+`
7
- `+i+s}formatArgs(t,n){let r=t.map(e=>e&&typeof e.stack==`string`?this.formatError(e,n):e);return node_util.formatWithOptions(n,...r)}formatDate(e,t){return t.date?e.toLocaleTimeString():``}filterAndJoin(e){return e.filter(Boolean).join(` `)}formatLogObj(e,t){let n=this.formatArgs(e.args,t);return e.type===`box`?`
8
- `+[bracket(e.tag),e.title&&e.title,...n.split(`
7
+ `+i+s}formatArgs(t,n){let r=t.map(e=>e&&typeof e.stack==`string`?this.formatError(e,n):e);return e.formatWithOptions(n,...r)}formatDate(e,t){return t.date?e.toLocaleTimeString():``}filterAndJoin(e){return e.filter(Boolean).join(` `)}formatLogObj(e,t){let n=this.formatArgs(e.args,t);return e.type===`box`?`
8
+ `+[i(e.tag),e.title&&e.title,...n.split(`
9
9
  `)].filter(Boolean).map(e=>` > `+e).join(`
10
10
  `)+`
11
- `:this.filterAndJoin([bracket(e.type),bracket(e.tag),n])}log(e,t){return writeStream(this.formatLogObj(e,{columns:t.options.stdout.columns||0,...t.options.formatOptions})+`
12
- `,e.level<2?t.options.stderr||process.stderr:t.options.stdout||process.stdout)}}exports.BasicReporter=BasicReporter,exports.parseStack=parseStack;
11
+ `:this.filterAndJoin([i(e.type),i(e.tag),n])}log(e,t){return r(this.formatLogObj(e,{columns:t.options.stdout.columns||0,...t.options.formatOptions})+`
12
+ `,e.level<2?t.options.stderr||process.stderr:t.options.stdout||process.stdout)}}exports.BasicReporter=a,exports.parseStack=n;
@@ -0,0 +1,3 @@
1
+ "use strict";var R=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ge=R(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.range=e.balanced=void 0,e.balanced=(n,r,i)=>{let a=n instanceof RegExp?t(n,i):n,o=r instanceof RegExp?t(r,i):r,s=a!==null&&o!=null&&(0,e.range)(a,o,i);return s&&{start:s[0],end:s[1],pre:i.slice(0,s[0]),body:i.slice(s[0]+a.length,s[1]),post:i.slice(s[1]+o.length)}};var t=(e,t)=>{let n=t.match(e);return n?n[0]:null};e.range=(e,t,n)=>{let r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;){if(u===c)r.push(u),c=n.indexOf(e,u+1);else if(r.length===1){let e=r.pop();e!==void 0&&(s=[e,l])}else i=r.pop(),i!==void 0&&i<a&&(a=i,o=l),l=n.indexOf(t,u+1);u=c<l&&c>=0?c:l}r.length&&o!==void 0&&(s=[a,o])}return s}}),Ke=R(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.EXPANSION_MAX=void 0,e.expand=S;var n=Ge(),r=`\0SLASH`+Math.random()+`\0`,i=`\0OPEN`+Math.random()+`\0`,a=`\0CLOSE`+Math.random()+`\0`,o=`\0COMMA`+Math.random()+`\0`,s=`\0PERIOD`+Math.random()+`\0`,c=new RegExp(r,`g`),l=new RegExp(i,`g`),u=new RegExp(a,`g`),d=new RegExp(o,`g`),f=new RegExp(s,`g`),p=/\\\\/g,m=/\\{/g,h=/\\}/g,g=/\\,/g,_=/\\./g;e.EXPANSION_MAX=1e5;function v(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function y(e){return e.replace(p,r).replace(m,i).replace(h,a).replace(g,o).replace(_,s)}function b(e){return e.replace(c,`\\`).replace(l,`{`).replace(u,`}`).replace(d,`,`).replace(f,`.`)}function x(e){if(!e)return[``];let t=[],r=(0,n.balanced)(`{`,`}`,e);if(!r)return e.split(`,`);let{pre:i,body:a,post:o}=r,s=i.split(`,`);s[s.length-1]+=`{`+a+`}`;let c=x(o);return o.length&&(s[s.length-1]+=c.shift(),s.push.apply(s,c)),t.push.apply(t,s),t}function S(t,n={}){if(!t)return[];let{max:r=e.EXPANSION_MAX}=n;return t.slice(0,2)===`{}`&&(t=`\\{\\}`+t.slice(2)),D(y(t),r,!0).map(b)}function C(e){return`{`+e+`}`}function w(e){return/^-?0\d/.test(e)}function T(e,t){return e<=t}function E(e,t){return e>=t}function D(e,t,r){let i=[],o=(0,n.balanced)(`{`,`}`,e);if(!o)return[e];let s=o.pre,c=o.post.length?D(o.post,t,!1):[``];if(/\$$/.test(o.pre))for(let e=0;e<c.length&&e<t;e++){let t=s+`{`+o.body+`}`+c[e];i.push(t)}else{let n=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(o.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(o.body),u=n||l,d=o.body.indexOf(`,`)>=0;if(!u&&!d)return o.post.match(/,(?!,).*\}/)?(e=o.pre+`{`+o.body+a+o.post,D(e,t,!0)):[e];let f;if(u)f=o.body.split(/\.\./);else if(f=x(o.body),f.length===1&&f[0]!==void 0&&(f=D(f[0],t,!1).map(C),f.length===1))return c.map(e=>o.pre+f[0]+e);let p;if(u&&f[0]!==void 0&&f[1]!==void 0){let e=v(f[0]),t=v(f[1]),n=Math.max(f[0].length,f[1].length),r=f.length===3&&f[2]!==void 0?Math.abs(v(f[2])):1,i=T;t<e&&(r*=-1,i=E);let a=f.some(w);p=[];for(let o=e;i(o,t);o+=r){let e;if(l)e=String.fromCharCode(o),e===`\\`&&(e=``);else if(e=String(o),a){let t=n-e.length;if(t>0){let n=Array(t+1).join(`0`);e=o<0?`-`+n+e.slice(1):n+e}}p.push(e)}}else{p=[];for(let e=0;e<f.length;e++)p.push.apply(p,D(f[e],t,!1))}for(let e=0;e<p.length;e++)for(let n=0;n<c.length&&i.length<t;n++){let t=s+p[e]+c[n];(!r||u||t)&&i.push(t)}}return i}}),Xe=R(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.assertValidPattern=void 0;var t=1024*64;e.assertValidPattern=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>t)throw TypeError(`pattern is too long`)}}),Je=R(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.parseClass=void 0;var t={"[: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]},n=e=>e.replace(/[[\]\\-]/g,`\\$&`),r=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),i=e=>e.join(``);e.parseClass=(e,a)=>{let o=a;if(e.charAt(o)!==`[`)throw Error(`not in a brace expression`);let s=[],c=[],l=o+1,u=!1,d=!1,f=!1,p=!1,m=o,h=``;t:for(;l<e.length;){let r=e.charAt(l);if((r===`!`||r===`^`)&&l===o+1){p=!0,l++;continue}if(r===`]`&&u&&!f){m=l+1;break}if(u=!0,r===`\\`&&!f){f=!0,l++;continue}if(r===`[`&&!f){for(let[n,[r,i,a]]of Object.entries(t))if(e.startsWith(n,l)){if(h)return[`$.`,!1,e.length-o,!0];l+=n.length,a?c.push(r):s.push(r),d||=i;continue t}}if(f=!1,h){r>h?s.push(n(h)+`-`+n(r)):r===h&&s.push(n(r)),h=``,l++;continue}if(e.startsWith(`-]`,l+1)){s.push(n(r+`-`)),l+=2;continue}if(e.startsWith(`-`,l+1)){h=r,l+=2;continue}s.push(n(r)),l++}if(m<l)return[``,!1,0,!1];if(!s.length&&!c.length)return[`$.`,!1,e.length-o,!0];if(c.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!p)return[r(s[0].length===2?s[0].slice(-1):s[0]),!1,m-o,!1];let g=`[`+(p?`^`:``)+i(s)+`]`,_=`[`+(p?``:`^`)+i(c)+`]`;return[s.length&&c.length?`(`+g+`|`+_+`)`:s.length?g:_,d,m-o,!0]}}),kt=R(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.unescape=void 0,e.unescape=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^\/\\])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,`$1$2`).replace(/\\([^\/])/g,`$1`):t?e.replace(/\[([^\/\\{}])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,`$1$2`).replace(/\\([^\/{}])/g,`$1`)}),pe=R(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.AST=void 0;var t=Je(),n=kt(),r=new Set([`!`,`?`,`+`,`*`,`@`]),o=e=>r.has(e),s=`(?!(?:^|/)\\.\\.?(?:$|/))`,c=`(?!\\.)`,l=new Set([`[`,`.`]),u=new Set([`..`,`.`]),d=new Set(`().*{}+?[]^$\\!`),f=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),p=`[^/]`,m=p+`*?`,h=p+`+?`;e.AST=class e{type;#t;#s;#n=!1;#r=[];#h;#S;#w;#c=!1;#o;#f;#u=!1;constructor(e,t,n={}){this.type=e,e&&(this.#s=!0),this.#h=t,this.#t=this.#h?this.#h.#t:this,this.#o=this.#t===this?n:this.#t.#o,this.#w=this.#t===this?[]:this.#t.#w,e===`!`&&!this.#t.#c&&this.#w.push(this),this.#S=this.#h?this.#h.#r.length:0}get hasMagic(){if(this.#s!==void 0)return this.#s;for(let e of this.#r)if(typeof e!=`string`&&(e.type||e.hasMagic))return this.#s=!0;return this.#s}toString(){return this.#f===void 0?this.type?this.#f=this.type+`(`+this.#r.map(e=>String(e)).join(`|`)+`)`:this.#f=this.#r.map(e=>String(e)).join(``):this.#f}#a(){if(this!==this.#t)throw Error(`should only call on root`);if(this.#c)return this;this.toString(),this.#c=!0;let e;for(;e=this.#w.pop();){if(e.type!==`!`)continue;let t=e,n=t.#h;for(;n;){for(let r=t.#S+1;!n.type&&r<n.#r.length;r++)for(let t of e.#r){if(typeof t==`string`)throw Error(`string part in extglob AST??`);t.copyIn(n.#r[r])}t=n,n=t.#h}}return this}push(...t){for(let n of t)if(n!==``){if(typeof n!=`string`&&!(n instanceof e&&n.#h===this))throw Error(`invalid part: `+n);this.#r.push(n)}}toJSON(){let e=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&&e.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#c&&this.#h?.type===`!`)&&e.push({}),e}isStart(){if(this.#t===this)return!0;if(!this.#h?.isStart())return!1;if(this.#S===0)return!0;let t=this.#h;for(let n=0;n<this.#S;n++){let r=t.#r[n];if(!(r instanceof e&&r.type===`!`))return!1}return!0}isEnd(){if(this.#t===this||this.#h?.type===`!`)return!0;if(!this.#h?.isEnd())return!1;if(!this.type)return this.#h?.isEnd();let e=this.#h?this.#h.#r.length:0;return this.#S===e-1}copyIn(e){typeof e==`string`?this.push(e):this.push(e.clone(this))}clone(t){let n=new e(this.type,t);for(let e of this.#r)n.copyIn(e);return n}static#i(t,n,r,i){let a=!1,s=!1,c=-1,l=!1;if(n.type===null){let u=r,d=``;for(;u<t.length;){let r=t.charAt(u++);if(a||r===`\\`){a=!a,d+=r;continue}if(s){u===c+1?(r===`^`||r===`!`)&&(l=!0):r===`]`&&!(u===c+2&&l)&&(s=!1),d+=r;continue}else if(r===`[`){s=!0,c=u,l=!1,d+=r;continue}if(!i.noext&&o(r)&&t.charAt(u)===`(`){n.push(d),d=``;let a=new e(r,n);u=e.#i(t,a,u,i),n.push(a);continue}d+=r}return n.push(d),u}let u=r+1,d=new e(null,n),f=[],p=``;for(;u<t.length;){let r=t.charAt(u++);if(a||r===`\\`){a=!a,p+=r;continue}if(s){u===c+1?(r===`^`||r===`!`)&&(l=!0):r===`]`&&!(u===c+2&&l)&&(s=!1),p+=r;continue}else if(r===`[`){s=!0,c=u,l=!1,p+=r;continue}if(o(r)&&t.charAt(u)===`(`){d.push(p),p=``;let n=new e(r,d);d.push(n),u=e.#i(t,n,u,i);continue}if(r===`|`){d.push(p),p=``,f.push(d),d=new e(null,n);continue}if(r===`)`)return p===``&&n.#r.length===0&&(n.#u=!0),d.push(p),p=``,n.push(...f,d),u;p+=r}return n.type=null,n.#s=void 0,n.#r=[t.substring(r-1)],u}static fromGlob(t,n={}){let r=new e(null,void 0,n);return e.#i(t,r,0,n),r}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();let e=this.toString(),[t,n,r,i]=this.toRegExpSource();if(!(r||this.#s||this.#o.nocase&&!this.#o.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#o.nocase?`i`:``)+(i?`u`:``);return Object.assign(RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#o}toRegExpSource(t){let r=t??!!this.#o.dot;if(this.#t===this&&this.#a(),!this.type){let i=this.isStart()&&this.isEnd()&&!this.#r.some(e=>typeof e!=`string`),a=this.#r.map(n=>{let[r,a,o,s]=typeof n==`string`?e.#v(n,this.#s,i):n.toRegExpSource(t);return this.#s=this.#s||o,this.#n=this.#n||s,r}).join(``),o=``;if(this.isStart()&&typeof this.#r[0]==`string`&&!(this.#r.length===1&&u.has(this.#r[0]))){let e=l,n=r&&e.has(a.charAt(0))||a.startsWith(`\\.`)&&e.has(a.charAt(2))||a.startsWith(`\\.\\.`)&&e.has(a.charAt(4)),i=!r&&!t&&e.has(a.charAt(0));o=n?s:i?c:``}let d=``;return this.isEnd()&&this.#t.#c&&this.#h?.type===`!`&&(d=`(?:$|\\/)`),[o+a+d,(0,n.unescape)(a),this.#s=!!this.#s,this.#n]}let i=this.type===`*`||this.type===`+`,a=this.type===`!`?`(?:(?!(?:`:`(?:`,o=this.#d(r);if(this.isStart()&&this.isEnd()&&!o&&this.type!==`!`){let e=this.toString();return this.#r=[e],this.type=null,this.#s=void 0,[e,(0,n.unescape)(this.toString()),!1,!1]}let d=!i||t||r||!c?``:this.#d(!0);d===o&&(d=``),d&&(o=`(?:${o})(?:${d})*?`);let f=``;if(this.type===`!`&&this.#u)f=(this.isStart()&&!r?c:``)+h;else{let e=this.type===`!`?`))`+(this.isStart()&&!r&&!t?c:``)+m+`)`:this.type===`@`?`)`:this.type===`?`?`)?`:this.type===`+`&&d?`)`:this.type===`*`&&d?`)?`:`)${this.type}`;f=a+o+e}return[f,(0,n.unescape)(o),this.#s=!!this.#s,this.#n]}#d(e){return this.#r.map(t=>{if(typeof t==`string`)throw Error(`string type in extglob ast??`);let[n,r,i,a]=t.toRegExpSource(e);return this.#n=this.#n||a,n}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join(`|`)}static#v(e,r,i=!1){let a=!1,o=``,s=!1,c=!1;for(let n=0;n<e.length;n++){let l=e.charAt(n);if(a){a=!1,o+=(d.has(l)?`\\`:``)+l;continue}if(l===`*`){if(c)continue;c=!0,o+=i&&/^[*]+$/.test(e)?h:m,r=!0;continue}else c=!1;if(l===`\\`){n===e.length-1?o+=`\\\\`:a=!0;continue}if(l===`[`){let[i,a,c,l]=(0,t.parseClass)(e,n);if(c){o+=i,s||=a,n+=c-1,r||=l;continue}}if(l===`?`){o+=p,r=!0;continue}o+=f(l)}return[o,(0,n.unescape)(e),!!r,s]}}}),me=R(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.escape=void 0,e.escape=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,`[$&]`):e.replace(/[?*()[\]\\{}]/g,`\\$&`):t?e.replace(/[?*()[\]]/g,`[$&]`):e.replace(/[?*()[\]\\]/g,`\\$&`)}),H=R(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.unescape=e.escape=e.AST=e.Minimatch=e.match=e.makeRe=e.braceExpand=e.defaults=e.filter=e.GLOBSTAR=e.sep=e.minimatch=void 0;var t=Ke(),i=Xe(),c=pe(),l=me(),u=kt();e.minimatch=(e,t,n={})=>((0,i.assertValidPattern)(t),!n.nocomment&&t.charAt(0)===`#`?!1:new B(t,n).match(e));var d=/^\*+([^+@!?\*\[\(]*)$/,f=e=>t=>!t.startsWith(`.`)&&t.endsWith(e),p=e=>t=>t.endsWith(e),m=e=>(e=e.toLowerCase(),t=>!t.startsWith(`.`)&&t.toLowerCase().endsWith(e)),h=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),g=/^\*+\.\*+$/,_=e=>!e.startsWith(`.`)&&e.includes(`.`),v=e=>e!==`.`&&e!==`..`&&e.includes(`.`),y=/^\.\*+$/,b=e=>e!==`.`&&e!==`..`&&e.startsWith(`.`),x=/^\*+$/,S=e=>e.length!==0&&!e.startsWith(`.`),C=e=>e.length!==0&&e!==`.`&&e!==`..`,w=/^\?+([^+@!?\*\[\(]*)?$/,T=([e,t=``])=>{let n=k([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},E=([e,t=``])=>{let n=A([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},D=([e,t=``])=>{let n=A([e]);return t?e=>n(e)&&e.endsWith(t):n},O=([e,t=``])=>{let n=k([e]);return t?e=>n(e)&&e.endsWith(t):n},k=([e])=>{let t=e.length;return e=>e.length===t&&!e.startsWith(`.`)},A=([e])=>{let t=e.length;return e=>e.length===t&&e!==`.`&&e!==`..`},j=typeof process==`object`&&process?typeof process.env==`object`&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:`posix`,M={win32:{sep:`\\`},posix:{sep:`/`}};e.sep=j===`win32`?M.win32.sep:M.posix.sep,e.minimatch.sep=e.sep,e.GLOBSTAR=Symbol(`globstar **`),e.minimatch.GLOBSTAR=e.GLOBSTAR;var N=`[^/]*?`,P=`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`,F=`(?:(?!(?:\\/|^)\\.).)*?`;e.filter=(t,n={})=>r=>(0,e.minimatch)(r,t,n),e.minimatch.filter=e.filter;var I=(e,t={})=>Object.assign({},e,t);e.defaults=t=>{if(!t||typeof t!=`object`||!Object.keys(t).length)return e.minimatch;let n=e.minimatch;return Object.assign((e,r,i={})=>n(e,r,I(t,i)),{Minimatch:class extends n.Minimatch{constructor(e,n={}){super(e,I(t,n))}static defaults(e){return n.defaults(I(t,e)).Minimatch}},AST:class extends n.AST{constructor(e,n,r={}){super(e,n,I(t,r))}static fromGlob(e,r={}){return n.AST.fromGlob(e,I(t,r))}},unescape:(e,r={})=>n.unescape(e,I(t,r)),escape:(e,r={})=>n.escape(e,I(t,r)),filter:(e,r={})=>n.filter(e,I(t,r)),defaults:e=>n.defaults(I(t,e)),makeRe:(e,r={})=>n.makeRe(e,I(t,r)),braceExpand:(e,r={})=>n.braceExpand(e,I(t,r)),match:(e,r,i={})=>n.match(e,r,I(t,i)),sep:n.sep,GLOBSTAR:e.GLOBSTAR})},e.minimatch.defaults=e.defaults,e.braceExpand=(e,n={})=>((0,i.assertValidPattern)(e),n.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:(0,t.expand)(e,{max:n.braceExpandMax})),e.minimatch.braceExpand=e.braceExpand,e.makeRe=(e,t={})=>new B(e,t).makeRe(),e.minimatch.makeRe=e.makeRe,e.match=(e,t,n={})=>{let r=new B(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e},e.minimatch.match=e.match;var L=/[?*]|[+@!]\(.*?\)|\[|\]/,z=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),B=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,t={}){(0,i.assertValidPattern)(e),t||={},this.options=t,this.pattern=e,this.platform=t.platform||j,this.isWindows=this.platform===`win32`,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot===void 0?!!(this.isWindows&&this.nocase):t.windowsNoMagicRoot,this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!=`string`)return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(e=>this.slashSplit(e));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let r=this.globParts.map((e,t,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){let t=e[0]===``&&e[1]===``&&(e[2]===`?`||!L.test(e[2]))&&!L.test(e[3]),n=/^[a-z]:/i.test(e[0]);if(t)return[...e.slice(0,4),...e.slice(4).map(e=>this.parse(e))];if(n)return[e[0],...e.slice(1).map(e=>this.parse(e))]}return e.map(e=>this.parse(e))});if(this.debug(this.pattern,r),this.set=r.filter(e=>e.indexOf(!1)===-1),this.isWindows)for(let e=0;e<this.set.length;e++){let t=this.set[e];t[0]===``&&t[1]===``&&this.globParts[e][2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3])&&(t[2]=`?`)}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let t=0;t<e.length;t++)for(let n=0;n<e[t].length;n++)e[t][n]===`**`&&(e[t][n]=`*`);let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):e=t>=1?this.levelOneOptimize(e):this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(e=>{let t=-1;for(;(t=e.indexOf(`**`,t+1))!==-1;){let n=t;for(;e[n+1]===`**`;)n++;n!==t&&e.splice(t,n-t)}return e})}levelOneOptimize(e){return e.map(e=>(e=e.reduce((e,t)=>{let n=e[e.length-1];return t===`**`&&n===`**`?e:t===`..`&&n&&n!==`..`&&n!==`.`&&n!==`**`?(e.pop(),e):(e.push(t),e)},[]),e.length===0?[``]:e))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let n=1;n<e.length-1;n++){let r=e[n];n===1&&r===``&&e[0]===``||(r===`.`||r===``)&&(t=!0,e.splice(n,1),n--)}e[0]===`.`&&e.length===2&&(e[1]===`.`||e[1]===``)&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf(`..`,n+1))!==-1;){let r=e[n-1];r&&r!==`.`&&r!==`..`&&r!==`**`&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[``]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let r=-1;for(;(r=n.indexOf(`**`,r+1))!==-1;){let i=r;for(;n[i+1]===`**`;)i++;i>r&&n.splice(r+1,i-r);let a=n[r+1],o=n[r+2],s=n[r+3];if(a!==`..`||!o||o===`.`||o===`..`||!s||s===`.`||s===`..`)continue;t=!0,n.splice(r,1);let c=n.slice(0);c[r]=`**`,e.push(c),r--}if(!this.preserveMultipleSlashes){for(let e=1;e<n.length-1;e++){let r=n[e];e===1&&r===``&&n[0]===``||(r===`.`||r===``)&&(t=!0,n.splice(e,1),e--)}n[0]===`.`&&n.length===2&&(n[1]===`.`||n[1]===``)&&(t=!0,n.pop())}let i=0;for(;(i=n.indexOf(`..`,i+1))!==-1;){let e=n[i-1];if(e&&e!==`.`&&e!==`..`&&e!==`**`){t=!0;let e=i===1&&n[i+1]===`**`?[`.`]:[];n.splice(i-1,2,...e),n.length===0&&n.push(``),i-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let r=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(r){e[t]=[],e[n]=r;break}}return e.filter(e=>e.length)}partsMatch(e,t,n=!1){let r=0,i=0,a=[],o=``;for(;r<e.length&&i<t.length;)if(e[r]===t[i])a.push(o===`b`?t[i]:e[r]),r++,i++;else if(n&&e[r]===`**`&&t[i]===e[r+1])a.push(e[r]),r++;else if(n&&t[i]===`**`&&e[r]===t[i+1])a.push(t[i]),i++;else if(e[r]===`*`&&t[i]&&(this.options.dot||!t[i].startsWith(`.`))&&t[i]!==`**`){if(o===`b`)return!1;o=`a`,a.push(e[r]),r++,i++}else if(t[i]===`*`&&e[r]&&(this.options.dot||!e[r].startsWith(`.`))&&e[r]!==`**`){if(o===`a`)return!1;o=`b`,a.push(t[i]),r++,i++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let r=0;r<e.length&&e.charAt(r)===`!`;r++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(t,n,r=!1){let i=this.options;if(this.isWindows){let e=typeof t[0]==`string`&&/^[a-z]:$/i.test(t[0]),r=!e&&t[0]===``&&t[1]===``&&t[2]===`?`&&/^[a-z]:$/i.test(t[3]),i=typeof n[0]==`string`&&/^[a-z]:$/i.test(n[0]),a=!i&&n[0]===``&&n[1]===``&&n[2]===`?`&&typeof n[3]==`string`&&/^[a-z]:$/i.test(n[3]),o=r?3:e?0:void 0,s=a?3:i?0:void 0;if(typeof o==`number`&&typeof s==`number`){let[e,r]=[t[o],n[s]];e.toLowerCase()===r.toLowerCase()&&(n[s]=e,s>o?n=n.slice(s):o>s&&(t=t.slice(o)))}}let{optimizationLevel:a=1}=this.options;a>=2&&(t=this.levelTwoFileOptimize(t)),this.debug(`matchOne`,this,{file:t,pattern:n}),this.debug(`matchOne`,t.length,n.length);for(var o=0,s=0,c=t.length,l=n.length;o<c&&s<l;o++,s++){this.debug(`matchOne loop`);var u=n[s],d=t[o];if(this.debug(n,u,d),u===!1)return!1;if(u===e.GLOBSTAR){this.debug(`GLOBSTAR`,[n,u,d]);var f=o,p=s+1;if(p===l){for(this.debug(`** at the end`);o<c;o++)if(t[o]===`.`||t[o]===`..`||!i.dot&&t[o].charAt(0)===`.`)return!1;return!0}for(;f<c;){var m=t[f];if(this.debug(`
2
+ globstar while`,t,f,n,p,m),this.matchOne(t.slice(f),n.slice(p),r))return this.debug(`globstar found match!`,f,c,m),!0;if(m===`.`||m===`..`||!i.dot&&m.charAt(0)===`.`){this.debug(`dot detected!`,t,f,n,p);break}this.debug(`globstar swallow a segment, and continue`),f++}return!!(r&&(this.debug(`
3
+ >>> no match, partial?`,t,f,n,p),f===c))}let a;if(typeof u==`string`?(a=d===u,this.debug(`string match`,u,d,a)):(a=u.test(d),this.debug(`pattern match`,u,d,a)),!a)return!1}if(o===c&&s===l)return!0;if(o===c)return r;if(s===l)return o===c-1&&t[o]===``;throw Error(`wtf?`)}braceExpand(){return(0,e.braceExpand)(this.pattern,this.options)}parse(t){(0,i.assertValidPattern)(t);let n=this.options;if(t===`**`)return e.GLOBSTAR;if(t===``)return``;let r,a=null;(r=t.match(x))?a=n.dot?C:S:(r=t.match(d))?a=(n.nocase?n.dot?h:m:n.dot?p:f)(r[1]):(r=t.match(w))?a=(n.nocase?n.dot?E:T:n.dot?D:O)(r):(r=t.match(g))?a=n.dot?v:_:(r=t.match(y))&&(a=b);let o=c.AST.fromGlob(t,this.options).toMMPattern();return a&&typeof o==`object`&&Reflect.defineProperty(o,`test`,{value:a}),o}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let n=this.options,r=n.noglobstar?N:n.dot?P:F,i=new Set(n.nocase?[`i`]:[]),a=t.map(t=>{let n=t.map(t=>{if(t instanceof RegExp)for(let e of t.flags.split(``))i.add(e);return typeof t==`string`?z(t):t===e.GLOBSTAR?e.GLOBSTAR:t._src});n.forEach((t,i)=>{let a=n[i+1],o=n[i-1];t!==e.GLOBSTAR||o===e.GLOBSTAR||(o===void 0?a!==void 0&&a!==e.GLOBSTAR?n[i+1]=`(?:\\/|`+r+`\\/)?`+a:n[i]=r:a===void 0?n[i-1]=o+`(?:\\/|\\/`+r+`)?`:a!==e.GLOBSTAR&&(n[i-1]=o+`(?:\\/|\\/`+r+`\\/)`+a,n[i+1]=e.GLOBSTAR))});let a=n.filter(t=>t!==e.GLOBSTAR);if(this.partial&&a.length>=1){let e=[];for(let t=1;t<=a.length;t++)e.push(a.slice(0,t).join(`/`));return`(?:`+e.join(`|`)+`)`}return a.join(`/`)}).join(`|`),[o,s]=t.length>1?[`(?:`,`)`]:[``,``];a=`^`+o+a+s+`$`,this.partial&&(a=`^(?:\\/|`+o+a.slice(1,-1)+s+`)$`),this.negate&&(a=`^(?!`+a+`).+$`);try{this.regexp=new RegExp(a,[...i].join(``))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split(`/`):this.isWindows&&/^\/\/[^\/]+/.test(e)?[``,...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;this.isWindows&&(e=e.split(`\\`).join(`/`));let r=this.slashSplit(e);this.debug(this.pattern,`split`,r);let i=this.set;this.debug(this.pattern,`set`,i);let a=r[r.length-1];if(!a)for(let e=r.length-2;!a&&e>=0;e--)a=r[e];for(let e=0;e<i.length;e++){let o=i[e],s=r;if(n.matchBase&&o.length===1&&(s=[a]),this.matchOne(s,o,t))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(t){return e.minimatch.defaults(t).Minimatch}};e.Minimatch=B;var V=pe();Object.defineProperty(e,`AST`,{enumerable:!0,get:function(){return V.AST}});var U=me();Object.defineProperty(e,`escape`,{enumerable:!0,get:function(){return U.escape}});var W=kt();Object.defineProperty(e,`unescape`,{enumerable:!0,get:function(){return W.unescape}}),e.minimatch.AST=c.AST,e.minimatch.Minimatch=B,e.minimatch.escape=l.escape,e.minimatch.unescape=u.unescape}),fs=R(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.LRUCache=void 0;var t=typeof performance==`object`&&performance&&typeof performance.now==`function`?performance:Date,n=new Set,r=typeof process==`object`&&process?process:{},i=(e,t,n,i)=>{typeof r.emitWarning==`function`?r.emitWarning(e,t,n,i):console.error(`[${n}] ${t}: ${e}`)},a=globalThis.AbortController,o=globalThis.AbortSignal;if(typeof a>`u`){o=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},a=class{constructor(){t()}signal=new o;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(let t of this.signal._onabort)t(e);this.signal.onabort?.(e)}}};let e=r.env?.LRU_CACHE_IGNORE_AC_WARNING!==`1`,t=()=>{e&&(e=!1,i("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 s=e=>!n.has(e),c=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),l=e=>c(e)?e<=2**8?Uint8Array:e<=2**16?Uint16Array:e<=2**32?Uint32Array:e<=2**53-1?u:null:null,u=class extends Array{constructor(e){super(e),this.fill(0)}},d=class e{heap;length;static#t=!1;static create(t){let n=l(t);if(!n)return[];e.#t=!0;let r=new e(t,n);return e.#t=!1,r}constructor(t,n){if(!e.#t)throw TypeError(`instantiate Stack using Stack.create(n)`);this.heap=new n(t),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};e.LRUCache=class e{#t;#s;#n;#r;#h;#S;#w;#c;get perf(){return this.#c}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#o;#f;#u;#a;#i;#d;#v;#y;#p;#R;#m;#O;#x;#g;#b;#E;#T;#e;#F;static unsafeExposeInternals(e){return{starts:e.#x,ttls:e.#g,autopurgeTimers:e.#b,sizes:e.#O,keyMap:e.#u,keyList:e.#a,valList:e.#i,next:e.#d,prev:e.#v,get head(){return e.#y},get tail(){return e.#p},free:e.#R,isBackgroundFetch:t=>e.#l(t),backgroundFetch:(t,n,r,i)=>e.#z(t,n,r,i),moveToTail:t=>e.#N(t),indexes:t=>e.#k(t),rindexes:t=>e.#M(t),isStale:t=>e.#_(t)}}get max(){return this.#t}get maxSize(){return this.#s}get calculatedSize(){return this.#f}get size(){return this.#o}get fetchMethod(){return this.#S}get memoMethod(){return this.#w}get dispose(){return this.#n}get onInsert(){return this.#r}get disposeAfter(){return this.#h}constructor(r){let{max:a=0,ttl:o,ttlResolution:u=1,ttlAutopurge:f,updateAgeOnGet:p,updateAgeOnHas:m,allowStale:h,dispose:g,onInsert:_,disposeAfter:v,noDisposeOnSet:y,noUpdateTTL:b,maxSize:x=0,maxEntrySize:S=0,sizeCalculation:C,fetchMethod:w,memoMethod:T,noDeleteOnFetchRejection:E,noDeleteOnStaleGet:D,allowStaleOnFetchRejection:O,allowStaleOnFetchAbort:k,ignoreFetchAbort:A,perf:j}=r;if(j!==void 0&&typeof j?.now!=`function`)throw TypeError(`perf option must have a now() method if specified`);if(this.#c=j??t,a!==0&&!c(a))throw TypeError(`max option must be a nonnegative integer`);let M=a?l(a):Array;if(!M)throw Error(`invalid max value: `+a);if(this.#t=a,this.#s=x,this.maxEntrySize=S||this.#s,this.sizeCalculation=C,this.sizeCalculation){if(!this.#s&&!this.maxEntrySize)throw TypeError(`cannot set sizeCalculation without setting maxSize or maxEntrySize`);if(typeof this.sizeCalculation!=`function`)throw TypeError(`sizeCalculation set to non-function`)}if(T!==void 0&&typeof T!=`function`)throw TypeError(`memoMethod must be a function if defined`);if(this.#w=T,w!==void 0&&typeof w!=`function`)throw TypeError(`fetchMethod must be a function if specified`);if(this.#S=w,this.#T=!!w,this.#u=new Map,this.#a=Array(a).fill(void 0),this.#i=Array(a).fill(void 0),this.#d=new M(a),this.#v=new M(a),this.#y=0,this.#p=0,this.#R=d.create(a),this.#o=0,this.#f=0,typeof g==`function`&&(this.#n=g),typeof _==`function`&&(this.#r=_),typeof v==`function`?(this.#h=v,this.#m=[]):(this.#h=void 0,this.#m=void 0),this.#E=!!this.#n,this.#F=!!this.#r,this.#e=!!this.#h,this.noDisposeOnSet=!!y,this.noUpdateTTL=!!b,this.noDeleteOnFetchRejection=!!E,this.allowStaleOnFetchRejection=!!O,this.allowStaleOnFetchAbort=!!k,this.ignoreFetchAbort=!!A,this.maxEntrySize!==0){if(this.#s!==0&&!c(this.#s))throw TypeError(`maxSize must be a positive integer if specified`);if(!c(this.maxEntrySize))throw TypeError(`maxEntrySize must be a positive integer if specified`);this.#$()}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!D,this.updateAgeOnGet=!!p,this.updateAgeOnHas=!!m,this.ttlResolution=c(u)||u===0?u:1,this.ttlAutopurge=!!f,this.ttl=o||0,this.ttl){if(!c(this.ttl))throw TypeError(`ttl must be a positive integer if specified`);this.#P()}if(this.#t===0&&this.ttl===0&&this.#s===0)throw TypeError(`At least one of max, maxSize, or ttl is required`);if(!this.ttlAutopurge&&!this.#t&&!this.#s){let t=`LRU_CACHE_UNBOUNDED`;s(t)&&(n.add(t),i(`TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.`,`UnboundedCacheWarning`,t,e))}}getRemainingTTL(e){return this.#u.has(e)?1/0:0}#P(){let e=new u(this.#t),t=new u(this.#t);this.#g=e,this.#x=t;let n=this.ttlAutopurge?Array(this.#t):void 0;this.#b=n,this.#W=(r,i,a=this.#c.now())=>{if(t[r]=i===0?0:a,e[r]=i,n?.[r]&&(clearTimeout(n[r]),n[r]=void 0),i!==0&&n){let e=setTimeout(()=>{this.#_(r)&&this.#A(this.#a[r],`expire`)},i+1);e.unref&&e.unref(),n[r]=e}},this.#C=n=>{t[n]=e[n]===0?0:this.#c.now()},this.#D=(n,a)=>{if(e[a]){let o=e[a],s=t[a];if(!o||!s)return;n.ttl=o,n.start=s,n.now=r||i(),n.remainingTTL=o-(n.now-s)}};let r=0,i=()=>{let e=this.#c.now();if(this.ttlResolution>0){r=e;let t=setTimeout(()=>r=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=n=>{let a=this.#u.get(n);if(a===void 0)return 0;let o=e[a],s=t[a];return!o||!s?1/0:o-((r||i())-s)},this.#_=n=>{let a=t[n],o=e[n];return!!o&&!!a&&(r||i())-a>o}}#C=()=>{};#D=()=>{};#W=()=>{};#_=()=>!1;#$(){let e=new u(this.#t);this.#f=0,this.#O=e,this.#L=t=>{this.#f-=e[t],e[t]=0},this.#B=(e,t,n,r)=>{if(this.#l(t))return 0;if(!c(n))if(r){if(typeof r!=`function`)throw TypeError(`sizeCalculation must be a function`);if(n=r(t,e),!c(n))throw TypeError(`sizeCalculation return invalid (expect positive integer)`)}else throw TypeError(`invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.`);return n},this.#j=(t,n,r)=>{if(e[t]=n,this.#s){let n=this.#s-e[t];for(;this.#f>n;)this.#G(!0)}this.#f+=e[t],r&&(r.entrySize=n,r.totalCalculatedSize=this.#f)}}#L=e=>{};#j=(e,t,n)=>{};#B=(e,t,n,r)=>{if(n||r)throw TypeError(`cannot set size without setting maxSize or maxEntrySize on cache`);return 0};*#k({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#p;!(!this.#I(t)||((e||!this.#_(t))&&(yield t),t===this.#y));)t=this.#v[t]}*#M({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#y;!(!this.#I(t)||((e||!this.#_(t))&&(yield t),t===this.#p));)t=this.#d[t]}#I(e){return e!==void 0&&this.#u.get(this.#a[e])===e}*entries(){for(let e of this.#k())this.#i[e]!==void 0&&this.#a[e]!==void 0&&!this.#l(this.#i[e])&&(yield[this.#a[e],this.#i[e]])}*rentries(){for(let e of this.#M())this.#i[e]!==void 0&&this.#a[e]!==void 0&&!this.#l(this.#i[e])&&(yield[this.#a[e],this.#i[e]])}*keys(){for(let e of this.#k()){let t=this.#a[e];t!==void 0&&!this.#l(this.#i[e])&&(yield t)}}*rkeys(){for(let e of this.#M()){let t=this.#a[e];t!==void 0&&!this.#l(this.#i[e])&&(yield t)}}*values(){for(let e of this.#k())this.#i[e]!==void 0&&!this.#l(this.#i[e])&&(yield this.#i[e])}*rvalues(){for(let e of this.#M())this.#i[e]!==void 0&&!this.#l(this.#i[e])&&(yield this.#i[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]=`LRUCache`;find(e,t={}){for(let n of this.#k()){let r=this.#i[n],i=this.#l(r)?r.__staleWhileFetching:r;if(i!==void 0&&e(i,this.#a[n],this))return this.get(this.#a[n],t)}}forEach(e,t=this){for(let n of this.#k()){let r=this.#i[n],i=this.#l(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#a[n],this)}}rforEach(e,t=this){for(let n of this.#M()){let r=this.#i[n],i=this.#l(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#a[n],this)}}purgeStale(){let e=!1;for(let t of this.#M({allowStale:!0}))this.#_(t)&&(this.#A(this.#a[t],`expire`),e=!0);return e}info(e){let t=this.#u.get(e);if(t===void 0)return;let n=this.#i[t],r=this.#l(n)?n.__staleWhileFetching:n;if(r===void 0)return;let i={value:r};if(this.#g&&this.#x){let e=this.#g[t],n=this.#x[t];e&&n&&(i.ttl=e-(this.#c.now()-n),i.start=Date.now())}return this.#O&&(i.size=this.#O[t]),i}dump(){let e=[];for(let t of this.#k({allowStale:!0})){let n=this.#a[t],r=this.#i[t],i=this.#l(r)?r.__staleWhileFetching:r;if(i===void 0||n===void 0)continue;let a={value:i};if(this.#g&&this.#x){a.ttl=this.#g[t];let e=this.#c.now()-this.#x[t];a.start=Math.floor(Date.now()-e)}this.#O&&(a.size=this.#O[t]),e.unshift([n,a])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let e=Date.now()-n.start;n.start=this.#c.now()-e}this.set(t,n.value,n)}}set(e,t,n={}){if(t===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:i,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:s}=n,{noUpdateTTL:c=this.noUpdateTTL}=n,l=this.#B(e,t,n.size||0,o);if(this.maxEntrySize&&l>this.maxEntrySize)return s&&(s.set=`miss`,s.maxEntrySizeExceeded=!0),this.#A(e,`set`),this;let u=this.#o===0?void 0:this.#u.get(e);if(u===void 0)u=this.#o===0?this.#p:this.#R.length===0?this.#o===this.#t?this.#G(!1):this.#o:this.#R.pop(),this.#a[u]=e,this.#i[u]=t,this.#u.set(e,u),this.#d[this.#p]=u,this.#v[u]=this.#p,this.#p=u,this.#o++,this.#j(u,l,s),s&&(s.set=`add`),c=!1,this.#F&&this.#r?.(t,e,`add`);else{this.#N(u);let n=this.#i[u];if(t!==n){if(this.#T&&this.#l(n)){n.__abortController.abort(Error(`replaced`));let{__staleWhileFetching:t}=n;t!==void 0&&!a&&(this.#E&&this.#n?.(t,e,`set`),this.#e&&this.#m?.push([t,e,`set`]))}else a||(this.#E&&this.#n?.(n,e,`set`),this.#e&&this.#m?.push([n,e,`set`]));if(this.#L(u),this.#j(u,l,s),this.#i[u]=t,s){s.set=`replace`;let e=n&&this.#l(n)?n.__staleWhileFetching:n;e!==void 0&&(s.oldValue=e)}}else s&&(s.set=`update`);this.#F&&this.onInsert?.(t,e,t===n?`update`:`replace`)}if(r!==0&&!this.#g&&this.#P(),this.#g&&(c||this.#W(u,r,i),s&&this.#D(s,u)),!a&&this.#e&&this.#m){let e=this.#m,t;for(;t=e?.shift();)this.#h?.(...t)}return this}pop(){try{for(;this.#o;){let e=this.#i[this.#y];if(this.#G(!0),this.#l(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#e&&this.#m){let e=this.#m,t;for(;t=e?.shift();)this.#h?.(...t)}}}#G(e){let t=this.#y,n=this.#a[t],r=this.#i[t];return this.#T&&this.#l(r)?r.__abortController.abort(Error(`evicted`)):(this.#E||this.#e)&&(this.#E&&this.#n?.(r,n,`evict`),this.#e&&this.#m?.push([r,n,`evict`])),this.#L(t),this.#b?.[t]&&(clearTimeout(this.#b[t]),this.#b[t]=void 0),e&&(this.#a[t]=void 0,this.#i[t]=void 0,this.#R.push(t)),this.#o===1?(this.#y=this.#p=0,this.#R.length=0):this.#y=this.#d[t],this.#u.delete(n),this.#o--,t}has(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:r}=t,i=this.#u.get(e);if(i!==void 0){let e=this.#i[i];if(this.#l(e)&&e.__staleWhileFetching===void 0)return!1;if(this.#_(i))r&&(r.has=`stale`,this.#D(r,i));else return n&&this.#C(i),r&&(r.has=`hit`,this.#D(r,i)),!0}else r&&(r.has=`miss`);return!1}peek(e,t={}){let{allowStale:n=this.allowStale}=t,r=this.#u.get(e);if(r===void 0||!n&&this.#_(r))return;let i=this.#i[r];return this.#l(i)?i.__staleWhileFetching:i}#z(e,t,n,r){let i=t===void 0?void 0:this.#i[t];if(this.#l(i))return i;let o=new a,{signal:s}=n;s?.addEventListener(`abort`,()=>o.abort(s.reason),{signal:o.signal});let c={signal:o.signal,options:n,context:r},l=(r,i=!1)=>{let{aborted:a}=o.signal,s=n.ignoreFetchAbort&&r!==void 0,l=n.ignoreFetchAbort||!!(n.allowStaleOnFetchAbort&&r!==void 0);if(n.status&&(a&&!i?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,s&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),a&&!s&&!i)return d(o.signal.reason,l);let u=p,f=this.#i[t];return(f===p||s&&i&&f===void 0)&&(r===void 0?u.__staleWhileFetching===void 0?this.#A(e,`fetch`):this.#i[t]=u.__staleWhileFetching:(n.status&&(n.status.fetchUpdated=!0),this.set(e,r,c.options))),r},u=e=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),d(e,!1)),d=(r,i)=>{let{aborted:a}=o.signal,s=a&&n.allowStaleOnFetchAbort,c=s||n.allowStaleOnFetchRejection,l=c||n.noDeleteOnFetchRejection,u=p;if(this.#i[t]===p&&(!l||!i&&u.__staleWhileFetching===void 0?this.#A(e,`fetch`):s||(this.#i[t]=u.__staleWhileFetching)),c)return n.status&&u.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),u.__staleWhileFetching;if(u.__returned===u)throw r},f=(t,r)=>{let a=this.#S?.(e,i,c);a&&a instanceof Promise&&a.then(e=>t(e===void 0?void 0:e),r),o.signal.addEventListener(`abort`,()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(t(void 0),n.allowStaleOnFetchAbort&&(t=e=>l(e,!0)))})};n.status&&(n.status.fetchDispatched=!0);let p=new Promise(f).then(l,u),m=Object.assign(p,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return t===void 0?(this.set(e,m,{...c.options,status:void 0}),t=this.#u.get(e)):this.#i[t]=m,m}#l(e){if(!this.#T)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty(`__staleWhileFetching`)&&t.__abortController instanceof a}async fetch(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:s=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:h=!1,status:g,signal:_}=t;if(!this.#T)return g&&(g.fetch=`get`),this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:g});let v={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:a,noDisposeOnSet:o,size:s,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:p,ignoreFetchAbort:f,status:g,signal:_},y=this.#u.get(e);if(y===void 0){g&&(g.fetch=`miss`);let t=this.#z(e,y,v,m);return t.__returned=t}else{let t=this.#i[y];if(this.#l(t)){let e=n&&t.__staleWhileFetching!==void 0;return g&&(g.fetch=`inflight`,e&&(g.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}let i=this.#_(y);if(!h&&!i)return g&&(g.fetch=`hit`),this.#N(y),r&&this.#C(y),g&&this.#D(g,y),t;let a=this.#z(e,y,v,m),o=a.__staleWhileFetching!==void 0&&n;return g&&(g.fetch=i?`stale`:`refresh`,o&&i&&(g.returnedStale=!0)),o?a.__staleWhileFetching:a.__returned=a}}async forceFetch(e,t={}){let n=await this.fetch(e,t);if(n===void 0)throw Error(`fetch() returned undefined`);return n}memo(e,t={}){let n=this.#w;if(!n)throw Error(`no memoMethod provided to constructor`);let{context:r,forceRefresh:i,...a}=t,o=this.get(e,a);if(!i&&o!==void 0)return o;let s=n(e,o,{options:a,context:r});return this.set(e,s,a),s}get(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:a}=t,o=this.#u.get(e);if(o!==void 0){let t=this.#i[o],s=this.#l(t);return a&&this.#D(a,o),this.#_(o)?(a&&(a.get=`stale`),s?(a&&n&&t.__staleWhileFetching!==void 0&&(a.returnedStale=!0),n?t.__staleWhileFetching:void 0):(i||this.#A(e,`expire`),a&&n&&(a.returnedStale=!0),n?t:void 0)):(a&&(a.get=`hit`),s?t.__staleWhileFetching:(this.#N(o),r&&this.#C(o),t))}else a&&(a.get=`miss`)}#U(e,t){this.#v[t]=e,this.#d[e]=t}#N(e){e!==this.#p&&(e===this.#y?this.#y=this.#d[e]:this.#U(this.#v[e],this.#d[e]),this.#U(this.#p,e),this.#p=e)}delete(e){return this.#A(e,`delete`)}#A(e,t){let n=!1;if(this.#o!==0){let r=this.#u.get(e);if(r!==void 0)if(this.#b?.[r]&&(clearTimeout(this.#b?.[r]),this.#b[r]=void 0),n=!0,this.#o===1)this.#q(t);else{this.#L(r);let n=this.#i[r];if(this.#l(n)?n.__abortController.abort(Error(`deleted`)):(this.#E||this.#e)&&(this.#E&&this.#n?.(n,e,t),this.#e&&this.#m?.push([n,e,t])),this.#u.delete(e),this.#a[r]=void 0,this.#i[r]=void 0,r===this.#p)this.#p=this.#v[r];else if(r===this.#y)this.#y=this.#d[r];else{let e=this.#v[r];this.#d[e]=this.#d[r];let t=this.#d[r];this.#v[t]=this.#v[r]}this.#o--,this.#R.push(r)}}if(this.#e&&this.#m?.length){let e=this.#m,t;for(;t=e?.shift();)this.#h?.(...t)}return n}clear(){return this.#q(`delete`)}#q(e){for(let t of this.#M({allowStale:!0})){let n=this.#i[t];if(this.#l(n))n.__abortController.abort(Error(`deleted`));else{let r=this.#a[t];this.#E&&this.#n?.(n,r,e),this.#e&&this.#m?.push([n,r,e])}}if(this.#u.clear(),this.#i.fill(void 0),this.#a.fill(void 0),this.#g&&this.#x){this.#g.fill(0),this.#x.fill(0);for(let e of this.#b??[])e!==void 0&&clearTimeout(e);this.#b?.fill(void 0)}if(this.#O&&this.#O.fill(0),this.#y=0,this.#p=0,this.#R.length=0,this.#f=0,this.#o=0,this.#e&&this.#m){let e=this.#m,t;for(;t=e?.shift();)this.#h?.(...t)}}}}),Oe=R(e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.Minipass=e.isWritable=e.isReadable=e.isStream=void 0;var n=typeof process==`object`&&process?process:{stdout:null,stderr:null},r=require(`node:events`),i=t(require(`node:stream`)),a=require(`node:string_decoder`);e.isStream=t=>!!t&&typeof t==`object`&&(t instanceof J||t instanceof i.default||(0,e.isReadable)(t)||(0,e.isWritable)(t)),e.isReadable=e=>!!e&&typeof e==`object`&&e instanceof r.EventEmitter&&typeof e.pipe==`function`&&e.pipe!==i.default.Writable.prototype.pipe,e.isWritable=e=>!!e&&typeof e==`object`&&e instanceof r.EventEmitter&&typeof e.write==`function`&&typeof e.end==`function`;var o=Symbol(`EOF`),s=Symbol(`maybeEmitEnd`),c=Symbol(`emittedEnd`),l=Symbol(`emittingEnd`),u=Symbol(`emittedError`),d=Symbol(`closed`),f=Symbol(`read`),p=Symbol(`flush`),m=Symbol(`flushChunk`),h=Symbol(`encoding`),g=Symbol(`decoder`),_=Symbol(`flowing`),v=Symbol(`paused`),y=Symbol(`resume`),b=Symbol(`buffer`),x=Symbol(`pipes`),S=Symbol(`bufferLength`),C=Symbol(`bufferPush`),w=Symbol(`bufferShift`),T=Symbol(`objectMode`),E=Symbol(`destroyed`),D=Symbol(`error`),O=Symbol(`emitData`),k=Symbol(`emitEnd`),A=Symbol(`emitEnd2`),j=Symbol(`async`),M=Symbol(`abort`),N=Symbol(`aborted`),P=Symbol(`signal`),F=Symbol(`dataListeners`),I=Symbol(`discarded`),L=e=>Promise.resolve().then(e),z=e=>e(),B=e=>e===`end`||e===`finish`||e===`prefinish`,V=e=>e instanceof ArrayBuffer||!!e&&typeof e==`object`&&e.constructor&&e.constructor.name===`ArrayBuffer`&&e.byteLength>=0,U=e=>!Buffer.isBuffer(e)&&ArrayBuffer.isView(e),W=class{src;dest;opts;ondrain;constructor(e,t,n){this.src=e,this.dest=t,this.opts=n,this.ondrain=()=>e[y](),this.dest.on(`drain`,this.ondrain)}unpipe(){this.dest.removeListener(`drain`,this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},G=class extends W{unpipe(){this.src.removeListener(`error`,this.proxyErrors),super.unpipe()}constructor(e,t,n){super(e,t,n),this.proxyErrors=e=>this.dest.emit(`error`,e),e.on(`error`,this.proxyErrors)}},K=e=>!!e.objectMode,q=e=>!e.objectMode&&!!e.encoding&&e.encoding!==`buffer`,J=class extends r.EventEmitter{[_]=!1;[v]=!1;[x]=[];[b]=[];[T];[h];[j];[g];[o]=!1;[c]=!1;[l]=!1;[d]=!1;[u]=null;[S]=0;[E]=!1;[P];[N]=!1;[F]=0;[I]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding==`string`)throw TypeError(`Encoding and objectMode may not be used together`);K(t)?(this[T]=!0,this[h]=null):q(t)?(this[h]=t.encoding,this[T]=!1):(this[T]=!1,this[h]=null),this[j]=!!t.async,this[g]=this[h]?new a.StringDecoder(this[h]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,`buffer`,{get:()=>this[b]}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,`pipes`,{get:()=>this[x]});let{signal:n}=t;n&&(this[P]=n,n.aborted?this[M]():n.addEventListener(`abort`,()=>this[M]()))}get bufferLength(){return this[S]}get encoding(){return this[h]}set encoding(e){throw Error(`Encoding must be set at instantiation time`)}setEncoding(e){throw Error(`Encoding must be set at instantiation time`)}get objectMode(){return this[T]}set objectMode(e){throw Error(`objectMode must be set at instantiation time`)}get async(){return this[j]}set async(e){this[j]=this[j]||!!e}[M](){this[N]=!0,this.emit(`abort`,this[P]?.reason),this.destroy(this[P]?.reason)}get aborted(){return this[N]}set aborted(e){}write(e,t,n){if(this[N])return!1;if(this[o])throw Error(`write after end`);if(this[E])return this.emit(`error`,Object.assign(Error(`Cannot call write after a stream was destroyed`),{code:`ERR_STREAM_DESTROYED`})),!0;typeof t==`function`&&(n=t,t=`utf8`),t||=`utf8`;let r=this[j]?L:z;if(!this[T]&&!Buffer.isBuffer(e)){if(U(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(V(e))e=Buffer.from(e);else if(typeof e!=`string`)throw Error(`Non-contiguous data written to non-objectMode stream`)}return this[T]?(this[_]&&this[S]!==0&&this[p](!0),this[_]?this.emit(`data`,e):this[C](e),this[S]!==0&&this.emit(`readable`),n&&r(n),this[_]):e.length?(typeof e==`string`&&!(t===this[h]&&!this[g]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[h]&&(e=this[g].write(e)),this[_]&&this[S]!==0&&this[p](!0),this[_]?this.emit(`data`,e):this[C](e),this[S]!==0&&this.emit(`readable`),n&&r(n),this[_]):(this[S]!==0&&this.emit(`readable`),n&&r(n),this[_])}read(e){if(this[E])return null;if(this[I]=!1,this[S]===0||e===0||e&&e>this[S])return this[s](),null;this[T]&&(e=null),this[b].length>1&&!this[T]&&(this[b]=[this[h]?this[b].join(``):Buffer.concat(this[b],this[S])]);let t=this[f](e||null,this[b][0]);return this[s](),t}[f](e,t){if(this[T])this[w]();else{let n=t;e===n.length||e===null?this[w]():typeof n==`string`?(this[b][0]=n.slice(e),t=n.slice(0,e),this[S]-=e):(this[b][0]=n.subarray(e),t=n.subarray(0,e),this[S]-=e)}return this.emit(`data`,t),!this[b].length&&!this[o]&&this.emit(`drain`),t}end(e,t,n){return typeof e==`function`&&(n=e,e=void 0),typeof t==`function`&&(n=t,t=`utf8`),e!==void 0&&this.write(e,t),n&&this.once(`end`,n),this[o]=!0,this.writable=!1,(this[_]||!this[v])&&this[s](),this}[y](){this[E]||(!this[F]&&!this[x].length&&(this[I]=!0),this[v]=!1,this[_]=!0,this.emit(`resume`),this[b].length?this[p]():this[o]?this[s]():this.emit(`drain`))}resume(){return this[y]()}pause(){this[_]=!1,this[v]=!0,this[I]=!1}get destroyed(){return this[E]}get flowing(){return this[_]}get paused(){return this[v]}[C](e){this[T]?this[S]+=1:this[S]+=e.length,this[b].push(e)}[w](){return this[T]?--this[S]:this[S]-=this[b][0].length,this[b].shift()}[p](e=!1){do;while(this[m](this[w]())&&this[b].length);!e&&!this[b].length&&!this[o]&&this.emit(`drain`)}[m](e){return this.emit(`data`,e),this[_]}pipe(e,t){if(this[E])return e;this[I]=!1;let r=this[c];return t||={},e===n.stdout||e===n.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this[x].push(t.proxyErrors?new G(this,e,t):new W(this,e,t)),this[j]?L(()=>this[y]()):this[y]()),e}unpipe(e){let t=this[x].find(t=>t.dest===e);t&&(this[x].length===1?(this[_]&&this[F]===0&&(this[_]=!1),this[x]=[]):this[x].splice(this[x].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let n=super.on(e,t);if(e===`data`)this[I]=!1,this[F]++,!this[x].length&&!this[_]&&this[y]();else if(e===`readable`&&this[S]!==0)super.emit(`readable`);else if(B(e)&&this[c])super.emit(e),this.removeAllListeners(e);else if(e===`error`&&this[u]){let e=t;this[j]?L(()=>e.call(this,this[u])):e.call(this,this[u])}return n}removeListener(e,t){return this.off(e,t)}off(e,t){let n=super.off(e,t);return e===`data`&&(this[F]=this.listeners(`data`).length,this[F]===0&&!this[I]&&!this[x].length&&(this[_]=!1)),n}removeAllListeners(e){let t=super.removeAllListeners(e);return(e===`data`||e===void 0)&&(this[F]=0,!this[I]&&!this[x].length&&(this[_]=!1)),t}get emittedEnd(){return this[c]}[s](){!this[l]&&!this[c]&&!this[E]&&this[b].length===0&&this[o]&&(this[l]=!0,this.emit(`end`),this.emit(`prefinish`),this.emit(`finish`),this[d]&&this.emit(`close`),this[l]=!1)}emit(e,...t){let n=t[0];if(e!==`error`&&e!==`close`&&e!==E&&this[E])return!1;if(e===`data`)return!this[T]&&!n?!1:this[j]?(L(()=>this[O](n)),!0):this[O](n);if(e===`end`)return this[k]();if(e===`close`){if(this[d]=!0,!this[c]&&!this[E])return!1;let e=super.emit(`close`);return this.removeAllListeners(`close`),e}else if(e===`error`){this[u]=n,super.emit(D,n);let e=!this[P]||this.listeners(`error`).length?super.emit(`error`,n):!1;return this[s](),e}else if(e===`resume`){let e=super.emit(`resume`);return this[s](),e}else if(e===`finish`||e===`prefinish`){let t=super.emit(e);return this.removeAllListeners(e),t}let r=super.emit(e,...t);return this[s](),r}[O](e){for(let t of this[x])t.dest.write(e)===!1&&this.pause();let t=this[I]?!1:super.emit(`data`,e);return this[s](),t}[k](){return this[c]?!1:(this[c]=!0,this.readable=!1,this[j]?(L(()=>this[A]()),!0):this[A]())}[A](){if(this[g]){let e=this[g].end();if(e){for(let t of this[x])t.dest.write(e);this[I]||super.emit(`data`,e)}}for(let e of this[x])e.end();let e=super.emit(`end`);return this.removeAllListeners(`end`),e}async collect(){let e=Object.assign([],{dataLength:0});this[T]||(e.dataLength=0);let t=this.promise();return this.on(`data`,t=>{e.push(t),this[T]||(e.dataLength+=t.length)}),await t,e}async concat(){if(this[T])throw Error(`cannot concat in objectMode`);let e=await this.collect();return this[h]?e.join(``):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(E,()=>t(Error(`stream destroyed`))),this.on(`error`,e=>t(e)),this.on(`end`,()=>e())})}[Symbol.asyncIterator](){this[I]=!1;let e=!1,t=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return t();let n=this.read();if(n!==null)return Promise.resolve({done:!1,value:n});if(this[o])return t();let r,i,a=e=>{this.off(`data`,s),this.off(`end`,c),this.off(E,l),t(),i(e)},s=e=>{this.off(`error`,a),this.off(`end`,c),this.off(E,l),this.pause(),r({value:e,done:!!this[o]})},c=()=>{this.off(`error`,a),this.off(`data`,s),this.off(E,l),t(),r({done:!0,value:void 0})},l=()=>a(Error(`stream destroyed`));return new Promise((e,t)=>{i=t,r=e,this.once(E,l),this.once(`error`,a),this.once(`end`,c),this.once(`data`,s)})},throw:t,return:t,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[I]=!1;let e=!1,t=()=>(this.pause(),this.off(D,t),this.off(E,t),this.off(`end`,t),e=!0,{done:!0,value:void 0});return this.once(`end`,t),this.once(D,t),this.once(E,t),{next:()=>{if(e)return t();let n=this.read();return n===null?t():{done:!1,value:n}},throw:t,return:t,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(e){if(this[E])return e?this.emit(`error`,e):this.emit(E),this;this[E]=!0,this[I]=!0,this[b].length=0,this[S]=0;let t=this;return typeof t.close==`function`&&!this[d]&&t.close(),e?this.emit(`error`,e):this.emit(E),this}static get isStream(){return e.isStream}};e.Minipass=J}),Ms=R(e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r};Object.defineProperty(e,`__esModule`,{value:!0}),e.PathScurry=e.Path=e.PathScurryDarwin=e.PathScurryPosix=e.PathScurryWin32=e.PathScurryBase=e.PathPosix=e.PathWin32=e.PathBase=e.ChildrenCache=e.ResolveCache=void 0;var i=fs(),a=require(`node:path`),o=require(`node:url`),s=require(`fs`),c=r(require(`node:fs`)),d=s.realpathSync.native,f=require(`node:fs/promises`),p=Oe(),m={lstatSync:s.lstatSync,readdir:s.readdir,readdirSync:s.readdirSync,readlinkSync:s.readlinkSync,realpathSync:d,promises:{lstat:f.lstat,readdir:f.readdir,readlink:f.readlink,realpath:f.realpath}},h=e=>!e||e===m||e===c?m:{...m,...e,promises:{...m.promises,...e.promises||{}}},g=/^\\\\\?\\([a-z]:)\\?$/i,_=e=>e.replace(/\//g,`\\`).replace(g,`$1\\`),v=/[\\\/]/,y=0,b=1,x=2,S=4,C=6,w=8,T=10,E=12,D=15,O=~D,k=16,A=32,j=64,M=128,N=256,P=512,F=j|M|P,I=1023,L=e=>e.isFile()?w:e.isDirectory()?S:e.isSymbolicLink()?T:e.isCharacterDevice()?x:e.isBlockDevice()?C:e.isSocket()?E:e.isFIFO()?b:y,z=new i.LRUCache({max:2**12}),B=e=>{let t=z.get(e);if(t)return t;let n=e.normalize(`NFKD`);return z.set(e,n),n},V=new i.LRUCache({max:2**12}),U=e=>{let t=V.get(e);if(t)return t;let n=B(e.toLowerCase());return V.set(e,n),n},W=class extends i.LRUCache{constructor(){super({max:256})}};e.ResolveCache=W;var G=class extends i.LRUCache{constructor(e=16*1024){super({maxSize:e,sizeCalculation:e=>e.length+1})}};e.ChildrenCache=G;var K=Symbol(`PathScurry setAsCwd`),q=class{name;root;roots;parent;nocase;isCWD=!1;#t;#s;get dev(){return this.#s}#n;get mode(){return this.#n}#r;get nlink(){return this.#r}#h;get uid(){return this.#h}#S;get gid(){return this.#S}#w;get rdev(){return this.#w}#c;get blksize(){return this.#c}#o;get ino(){return this.#o}#f;get size(){return this.#f}#u;get blocks(){return this.#u}#a;get atimeMs(){return this.#a}#i;get mtimeMs(){return this.#i}#d;get ctimeMs(){return this.#d}#v;get birthtimeMs(){return this.#v}#y;get atime(){return this.#y}#p;get mtime(){return this.#p}#R;get ctime(){return this.#R}#m;get birthtime(){return this.#m}#O;#x;#g;#b;#E;#T;#e;#F;#P;#C;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=y,n,r,i,a,o){this.name=e,this.#O=i?U(e):B(e),this.#e=t&I,this.nocase=i,this.roots=r,this.root=n||this,this.#F=a,this.#g=o.fullpath,this.#E=o.relative,this.#T=o.relativePosix,this.parent=o.parent,this.parent?this.#t=this.parent.#t:this.#t=h(o.fs)}depth(){return this.#x===void 0?this.parent?this.#x=this.parent.depth()+1:this.#x=0:this.#x}childrenCache(){return this.#F}resolve(e){if(!e)return this;let t=this.getRootString(e),n=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#D(n):this.#D(n)}#D(e){let t=this;for(let n of e)t=t.child(n);return t}children(){let e=this.#F.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#F.set(this,t),this.#e&=~k,t}child(e,t){if(e===``||e===`.`)return this;if(e===`..`)return this.parent||this;let n=this.children(),r=this.nocase?U(e):B(e);for(let e of n)if(e.#O===r)return e;let i=this.parent?this.sep:``,a=this.#g?this.#g+i+e:void 0,o=this.newChild(e,y,{...t,parent:this,fullpath:a});return this.canReaddir()||(o.#e|=M),n.push(o),o}relative(){if(this.isCWD)return``;if(this.#E!==void 0)return this.#E;let e=this.name,t=this.parent;if(!t)return this.#E=this.name;let n=t.relative();return n+(!n||!t.parent?``:this.sep)+e}relativePosix(){if(this.sep===`/`)return this.relative();if(this.isCWD)return``;if(this.#T!==void 0)return this.#T;let e=this.name,t=this.parent;if(!t)return this.#T=this.fullpathPosix();let n=t.relativePosix();return n+(!n||!t.parent?``:`/`)+e}fullpath(){if(this.#g!==void 0)return this.#g;let e=this.name,t=this.parent;return t?this.#g=t.fullpath()+(t.parent?this.sep:``)+e:this.#g=this.name}fullpathPosix(){if(this.#b!==void 0)return this.#b;if(this.sep===`/`)return this.#b=this.fullpath();if(!this.parent){let e=this.fullpath().replace(/\\/g,`/`);return/^[a-z]:\//i.test(e)?this.#b=`//?/${e}`:this.#b=e}let e=this.parent,t=e.fullpathPosix();return this.#b=t+(!t||!e.parent?``:`/`)+this.name}isUnknown(){return(this.#e&D)===y}isType(e){return this[`is${e}`]()}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.#e&D)===w}isDirectory(){return(this.#e&D)===S}isCharacterDevice(){return(this.#e&D)===x}isBlockDevice(){return(this.#e&D)===C}isFIFO(){return(this.#e&D)===b}isSocket(){return(this.#e&D)===E}isSymbolicLink(){return(this.#e&T)===T}lstatCached(){return this.#e&A?this:void 0}readlinkCached(){return this.#P}realpathCached(){return this.#C}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#P)return!0;if(!this.parent)return!1;let e=this.#e&D;return!(e!==y&&e!==T||this.#e&N||this.#e&M)}calledReaddir(){return!!(this.#e&k)}isENOENT(){return!!(this.#e&M)}isNamed(e){return this.nocase?this.#O===U(e):this.#O===B(e)}async readlink(){let e=this.#P;if(e)return e;if(this.canReadlink()&&this.parent)try{let e=await this.#t.promises.readlink(this.fullpath()),t=(await this.parent.realpath())?.resolve(e);if(t)return this.#P=t}catch(e){this.#M(e.code);return}}readlinkSync(){let e=this.#P;if(e)return e;if(this.canReadlink()&&this.parent)try{let e=this.#t.readlinkSync(this.fullpath()),t=this.parent.realpathSync()?.resolve(e);if(t)return this.#P=t}catch(e){this.#M(e.code);return}}#W(e){this.#e|=k;for(let t=e.provisional;t<e.length;t++){let n=e[t];n&&n.#_()}}#_(){this.#e&M||(this.#e=(this.#e|M)&O,this.#$())}#$(){let e=this.children();e.provisional=0;for(let t of e)t.#_()}#L(){this.#e|=P,this.#j()}#j(){if(this.#e&j)return;let e=this.#e;(e&D)===S&&(e&=O),this.#e=e|j,this.#$()}#B(e=``){e===`ENOTDIR`||e===`EPERM`?this.#j():e===`ENOENT`?this.#_():this.children().provisional=0}#k(e=``){e===`ENOTDIR`?this.parent.#j():e===`ENOENT`&&this.#_()}#M(e=``){let t=this.#e;t|=N,e===`ENOENT`&&(t|=M),(e===`EINVAL`||e===`UNKNOWN`)&&(t&=O),this.#e=t,e===`ENOTDIR`&&this.parent&&this.parent.#j()}#I(e,t){return this.#z(e,t)||this.#G(e,t)}#G(e,t){let n=L(e),r=this.newChild(e.name,n,{parent:this}),i=r.#e&D;return i!==S&&i!==T&&i!==y&&(r.#e|=j),t.unshift(r),t.provisional++,r}#z(e,t){for(let n=t.provisional;n<t.length;n++){let r=t[n];if((this.nocase?U(e.name):B(e.name))===r.#O)return this.#l(e,r,n,t)}}#l(e,t,n,r){let i=t.name;return t.#e=t.#e&O|L(e),i!==e.name&&(t.name=e.name),n!==r.provisional&&(n===r.length-1?r.pop():r.splice(n,1),r.unshift(t)),r.provisional++,t}async lstat(){if((this.#e&M)===0)try{return this.#U(await this.#t.promises.lstat(this.fullpath())),this}catch(e){this.#k(e.code)}}lstatSync(){if((this.#e&M)===0)try{return this.#U(this.#t.lstatSync(this.fullpath())),this}catch(e){this.#k(e.code)}}#U(e){let{atime:t,atimeMs:n,birthtime:r,birthtimeMs:i,blksize:a,blocks:o,ctime:s,ctimeMs:c,dev:l,gid:u,ino:d,mode:f,mtime:p,mtimeMs:m,nlink:h,rdev:g,size:_,uid:v}=e;this.#y=t,this.#a=n,this.#m=r,this.#v=i,this.#c=a,this.#u=o,this.#R=s,this.#d=c,this.#s=l,this.#S=u,this.#o=d,this.#n=f,this.#p=p,this.#i=m,this.#r=h,this.#w=g,this.#f=_,this.#h=v;let b=L(e);this.#e=this.#e&O|b|A,b!==y&&b!==S&&b!==T&&(this.#e|=j)}#N=[];#A=!1;#q(e){this.#A=!1;let t=this.#N.slice();this.#N.length=0,t.forEach(t=>t(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let r=n.slice(0,n.provisional);t?e(null,r):queueMicrotask(()=>e(null,r));return}if(this.#N.push(e),this.#A)return;this.#A=!0;let r=this.fullpath();this.#t.readdir(r,{withFileTypes:!0},(e,t)=>{if(e)this.#B(e.code),n.provisional=0;else{for(let e of t)this.#I(e,n);this.#W(n)}this.#q(n.slice(0,n.provisional))})}#H;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#H)await this.#H;else{let n=()=>{};this.#H=new Promise(e=>n=e);try{for(let n of await this.#t.promises.readdir(t,{withFileTypes:!0}))this.#I(n,e);this.#W(e)}catch(t){this.#B(t.code),e.provisional=0}this.#H=void 0,n()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let n of this.#t.readdirSync(t,{withFileTypes:!0}))this.#I(n,e);this.#W(e)}catch(t){this.#B(t.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#e&F)return!1;let e=D&this.#e;return e===y||e===S||e===T}shouldWalk(e,t){return(this.#e&S)===S&&!(this.#e&F)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#C)return this.#C;if(!((P|N|M)&this.#e))try{let e=await this.#t.promises.realpath(this.fullpath());return this.#C=this.resolve(e)}catch{this.#L()}}realpathSync(){if(this.#C)return this.#C;if(!((P|N|M)&this.#e))try{let e=this.#t.realpathSync(this.fullpath());return this.#C=this.resolve(e)}catch{this.#L()}}[K](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),n=[],r=this;for(;r&&r.parent;)t.add(r),r.#E=n.join(this.sep),r.#T=n.join(`/`),r=r.parent,n.push(`..`);for(r=e;r&&r.parent&&!t.has(r);)r.#E=void 0,r.#T=void 0,r=r.parent}};e.PathBase=q;var J=class e extends q{sep=`\\`;splitSep=v;constructor(e,t=y,n,r,i,a,o){super(e,t,n,r,i,a,o)}newChild(t,n=y,r={}){return new e(t,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return a.win32.parse(e).root}getRoot(e){if(e=_(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,n]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=n;return this.roots[e]=new Z(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,`\\`).replace(g,`$1\\`),e===t}};e.PathWin32=J;var Y=class e extends q{splitSep=`/`;sep=`/`;constructor(e,t=y,n,r,i,a,o){super(e,t,n,r,i,a,o)}getRootString(e){return e.startsWith(`/`)?`/`:``}getRoot(e){return this.root}newChild(t,n=y,r={}){return new e(t,n,this.root,this.roots,this.nocase,this.childrenCache(),r)}};e.PathPosix=Y;var X=class{root;rootPath;roots;cwd;#t;#s;#n;nocase;#r;constructor(e=process.cwd(),t,n,{nocase:r,childrenCacheSize:i=16*1024,fs:a=m}={}){this.#r=h(a),(e instanceof URL||e.startsWith(`file://`))&&(e=(0,o.fileURLToPath)(e));let s=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(s),this.#t=new W,this.#s=new W,this.#n=new G(i);let c=s.substring(this.rootPath.length).split(n);if(c.length===1&&!c[0]&&c.pop(),r===void 0)throw 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,u=c.length-1,d=t.sep,f=this.rootPath,p=!1;for(let e of c){let t=u--;l=l.child(e,{relative:Array(t).fill(`..`).join(d),relativePosix:Array(t).fill(`..`).join(`/`),fullpath:f+=(p?``:d)+e}),p=!0}this.cwd=l}depth(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#n}resolve(...e){let t=``;for(let n=e.length-1;n>=0;n--){let r=e[n];if(!(!r||r===`.`)&&(t=t?`${r}/${t}`:r,this.isAbsolute(r)))break}let n=this.#t.get(t);if(n!==void 0)return n;let r=this.cwd.resolve(t).fullpath();return this.#t.set(t,r),r}resolvePosix(...e){let t=``;for(let n=e.length-1;n>=0;n--){let r=e[n];if(!(!r||r===`.`)&&(t=t?`${r}/${t}`:r,this.isAbsolute(r)))break}let n=this.#s.get(t);if(n!==void 0)return n;let r=this.cwd.resolve(t).fullpathPosix();return this.#s.set(t,r),r}relative(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof q||(t=e,e=this.cwd);let{withFileTypes:n}=t;if(e.canReaddir()){let t=await e.readdir();return n?t:t.map(e=>e.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof q||(t=e,e=this.cwd);let{withFileTypes:n=!0}=t;return e.canReaddir()?n?e.readdirSync():e.readdirSync().map(e=>e.name):[]}async lstat(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e==`string`&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof q||(t=e.withFileTypes,e=this.cwd);let n=await e.readlink();return t?n:n?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof q||(t=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return t?n:n?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof q||(t=e.withFileTypes,e=this.cwd);let n=await e.realpath();return t?n:n?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof q||(t=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return t?n:n?.fullpath()}async walk(e=this.cwd,t={}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof q||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:r=!1,filter:i,walkFilter:a}=t,o=[];(!i||i(e))&&o.push(n?e:e.fullpath());let s=new Set,c=(e,t)=>{s.add(e),e.readdirCB((e,l)=>{if(e)return t(e);let u=l.length;if(!u)return t();let d=()=>{--u===0&&t()};for(let e of l)(!i||i(e))&&o.push(n?e:e.fullpath()),r&&e.isSymbolicLink()?e.realpath().then(e=>e?.isUnknown()?e.lstat():e).then(e=>e?.shouldWalk(s,a)?c(e,d):d()):e.shouldWalk(s,a)?c(e,d):d()},!0)},l=e;return new Promise((e,t)=>{c(l,n=>{if(n)return t(n);e(o)})})}walkSync(e=this.cwd,t={}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof q||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:r=!1,filter:i,walkFilter:a}=t,o=[];(!i||i(e))&&o.push(n?e:e.fullpath());let s=new Set([e]);for(let e of s){let t=e.readdirSync();for(let e of t){(!i||i(e))&&o.push(n?e:e.fullpath());let t=e;if(e.isSymbolicLink()){if(!(r&&(t=e.realpathSync())))continue;t.isUnknown()&&t.lstatSync()}t.shouldWalk(s,a)&&s.add(t)}}return o}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e==`string`?e=this.cwd.resolve(e):e instanceof q||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof q||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:r=!1,filter:i,walkFilter:a}=t;(!i||i(e))&&(yield n?e:e.fullpath());let o=new Set([e]);for(let e of o){let t=e.readdirSync();for(let e of t){(!i||i(e))&&(yield n?e:e.fullpath());let t=e;if(e.isSymbolicLink()){if(!(r&&(t=e.realpathSync())))continue;t.isUnknown()&&t.lstatSync()}t.shouldWalk(o,a)&&o.add(t)}}}stream(e=this.cwd,t={}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof q||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:r=!1,filter:i,walkFilter:a}=t,o=new p.Minipass({objectMode:!0});(!i||i(e))&&o.write(n?e:e.fullpath());let s=new Set,c=[e],l=0,u=()=>{let e=!1;for(;!e;){let t=c.shift();if(!t){l===0&&o.end();return}l++,s.add(t);let d=(t,p,m=!1)=>{if(t)return o.emit(`error`,t);if(r&&!m){let e=[];for(let t of p)t.isSymbolicLink()&&e.push(t.realpath().then(e=>e?.isUnknown()?e.lstat():e));if(e.length){Promise.all(e).then(()=>d(null,p,!0));return}}for(let t of p)t&&(!i||i(t))&&(o.write(n?t:t.fullpath())||(e=!0));l--;for(let e of p){let t=e.realpathCached()||e;t.shouldWalk(s,a)&&c.push(t)}e&&!o.flowing?o.once(`drain`,u):f||u()},f=!0;t.readdirCB(d,!0),f=!1}};return u(),o}streamSync(e=this.cwd,t={}){typeof e==`string`?e=this.cwd.resolve(e):e instanceof q||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:r=!1,filter:i,walkFilter:a}=t,o=new p.Minipass({objectMode:!0}),s=new Set;(!i||i(e))&&o.write(n?e:e.fullpath());let c=[e],l=0,u=()=>{let e=!1;for(;!e;){let t=c.shift();if(!t){l===0&&o.end();return}l++,s.add(t);let u=t.readdirSync();for(let t of u)(!i||i(t))&&(o.write(n?t:t.fullpath())||(e=!0));l--;for(let e of u){let t=e;if(e.isSymbolicLink()){if(!(r&&(t=e.realpathSync())))continue;t.isUnknown()&&t.lstatSync()}t.shouldWalk(s,a)&&c.push(t)}}e&&!o.flowing&&o.once(`drain`,u)};return u(),o}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e==`string`?this.cwd.resolve(e):e,this.cwd[K](t)}};e.PathScurryBase=X;var Z=class extends X{sep=`\\`;constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,a.win32,`\\`,{...t,nocase:n}),this.nocase=n;for(let e=this.cwd;e;e=e.parent)e.nocase=this.nocase}parseRootPath(e){return a.win32.parse(e).root.toUpperCase()}newRoot(e){return new J(this.rootPath,S,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith(`/`)||e.startsWith(`\\`)||/^[a-z]:(\/|\\)/i.test(e)}};e.PathScurryWin32=Z;var Q=class extends X{sep=`/`;constructor(e=process.cwd(),t={}){let{nocase:n=!1}=t;super(e,a.posix,`/`,{...t,nocase:n}),this.nocase=n}parseRootPath(e){return`/`}newRoot(e){return new Y(this.rootPath,S,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith(`/`)}};e.PathScurryPosix=Q;var $=class extends Q{constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,{...t,nocase:n})}};e.PathScurryDarwin=$,e.Path=process.platform===`win32`?J:Y,e.PathScurry=process.platform===`win32`?Z:process.platform===`darwin`?$:Q}),Re=R(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Pattern=void 0;var t=H(),n=e=>e.length>=1,r=e=>e.length>=1,i=Symbol.for(`nodejs.util.inspect.custom`);e.Pattern=class e{#t;#s;#n;length;#r;#h;#S;#w;#c;#o;#f=!0;constructor(e,t,i,a){if(!n(e))throw TypeError(`empty pattern list`);if(!r(t))throw TypeError(`empty glob list`);if(t.length!==e.length)throw TypeError(`mismatched pattern list and glob list lengths`);if(this.length=e.length,i<0||i>=this.length)throw TypeError(`index out of range`);if(this.#t=e,this.#s=t,this.#n=i,this.#r=a,this.#n===0){if(this.isUNC()){let[e,t,n,r,...i]=this.#t,[a,o,s,c,...l]=this.#s;i[0]===``&&(i.shift(),l.shift());let u=[e,t,n,r,``].join(`/`),d=[a,o,s,c,``].join(`/`);this.#t=[u,...i],this.#s=[d,...l],this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){let[e,...t]=this.#t,[n,...r]=this.#s;t[0]===``&&(t.shift(),r.shift());let i=e+`/`,a=n+`/`;this.#t=[i,...t],this.#s=[a,...r],this.length=this.#t.length}}}[i](){return`Pattern <`+this.#s.slice(this.#n).join(`/`)+`>`}pattern(){return this.#t[this.#n]}isString(){return typeof this.#t[this.#n]==`string`}isGlobstar(){return this.#t[this.#n]===t.GLOBSTAR}isRegExp(){return this.#t[this.#n]instanceof RegExp}globString(){return this.#S=this.#S||(this.#n===0?this.isAbsolute()?this.#s[0]+this.#s.slice(1).join(`/`):this.#s.join(`/`):this.#s.slice(this.#n).join(`/`))}hasMore(){return this.length>this.#n+1}rest(){return this.#h===void 0?this.hasMore()?(this.#h=new e(this.#t,this.#s,this.#n+1,this.#r),this.#h.#o=this.#o,this.#h.#c=this.#c,this.#h.#w=this.#w,this.#h):this.#h=null:this.#h}isUNC(){let e=this.#t;return this.#c===void 0?this.#c=this.#r===`win32`&&this.#n===0&&e[0]===``&&e[1]===``&&typeof e[2]==`string`&&!!e[2]&&typeof e[3]==`string`&&!!e[3]:this.#c}isDrive(){let e=this.#t;return this.#w===void 0?this.#w=this.#r===`win32`&&this.#n===0&&this.length>1&&typeof e[0]==`string`&&/^[a-z]:$/i.test(e[0]):this.#w}isAbsolute(){let e=this.#t;return this.#o===void 0?this.#o=e[0]===``&&e.length>1||this.isDrive()||this.isUNC():this.#o}root(){let e=this.#t[0];return typeof e==`string`&&this.isAbsolute()&&this.#n===0?e:``}checkFollowGlobstar(){return!(this.#n===0||!this.isGlobstar()||!this.#f)}markFollowGlobstar(){return this.#n===0||!this.isGlobstar()||!this.#f?!1:(this.#f=!1,!0)}}}),ke=R(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Ignore=void 0;var t=H(),n=Re(),r=typeof process==`object`&&process&&typeof process.platform==`string`?process.platform:`linux`;e.Ignore=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:n,noext:i,noglobstar:a,platform:o=r}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:n,noext:i,noglobstar:a,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let t of e)this.add(t)}add(e){let r=new t.Minimatch(e,this.mmopts);for(let e=0;e<r.set.length;e++){let i=r.set[e],a=r.globParts[e];if(!i||!a)throw Error(`invalid pattern object`);for(;i[0]===`.`&&a[0]===`.`;)i.shift(),a.shift();let o=new n.Pattern(i,a,0,this.platform),s=new t.Minimatch(o.globString(),this.mmopts),c=a[a.length-1]===`**`,l=o.isAbsolute();l?this.absolute.push(s):this.relative.push(s),c&&(l?this.absoluteChildren.push(s):this.relativeChildren.push(s))}}ignored(e){let t=e.fullpath(),n=`${t}/`,r=e.relative()||`.`,i=`${r}/`;for(let e of this.relative)if(e.match(r)||e.match(i))return!0;for(let e of this.absolute)if(e.match(t)||e.match(n))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+`/`,n=(e.relative()||`.`)+`/`;for(let e of this.relativeChildren)if(e.match(n))return!0;for(let e of this.absoluteChildren)if(e.match(t))return!0;return!1}}}),Fs=R(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Processor=e.SubWalks=e.MatchRecord=e.HasWalkedCache=void 0;var t=H(),n=class e{store;constructor(e=new Map){this.store=e}copy(){return new e(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let n=e.fullpath(),r=this.store.get(n);r?r.add(t.globString()):this.store.set(n,new Set([t.globString()]))}};e.HasWalkedCache=n;var r=class{store=new Map;add(e,t,n){let r=(t?2:0)|(n?1:0),i=this.store.get(e);this.store.set(e,i===void 0?r:r&i)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}};e.MatchRecord=r;var i=class{store=new Map;add(e,t){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(e=>e.globString()===t.globString())||n.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw Error(`attempting to walk unknown path`);return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}};e.SubWalks=i,e.Processor=class e{hasWalkedCache;matches=new r;subwalks=new i;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new n}processPatterns(e,n){this.patterns=n;let r=n.map(t=>[e,t]);for(let[e,n]of r){this.hasWalkedCache.storeWalked(e,n);let r=n.root(),i=n.isAbsolute()&&this.opts.absolute!==!1;if(r){e=e.resolve(r===`/`&&this.opts.root!==void 0?this.opts.root:r);let t=n.rest();if(t)n=t;else{this.matches.add(e,!0,!1);continue}}if(e.isENOENT())continue;let a,o,s=!1;for(;typeof(a=n.pattern())==`string`&&(o=n.rest());)e=e.resolve(a),n=o,s=!0;if(a=n.pattern(),o=n.rest(),s){if(this.hasWalkedCache.hasWalked(e,n))continue;this.hasWalkedCache.storeWalked(e,n)}if(typeof a==`string`){let t=a===`..`||a===``||a===`.`;this.matches.add(e.resolve(a),i,t);continue}else if(a===t.GLOBSTAR){(!e.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(e,n);let t=o?.pattern(),r=o?.rest();if(!o||(t===``||t===`.`)&&!r)this.matches.add(e,i,t===``||t===`.`);else if(t===`..`){let t=e.parent||e;r?this.hasWalkedCache.hasWalked(t,r)||this.subwalks.add(t,r):this.matches.add(t,i,!0)}}else a instanceof RegExp&&this.subwalks.add(e,n)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new e(this.opts,this.hasWalkedCache)}filterEntries(e,n){let r=this.subwalks.get(e),i=this.child();for(let e of n)for(let n of r){let r=n.isAbsolute(),a=n.pattern(),o=n.rest();a===t.GLOBSTAR?i.testGlobstar(e,n,o,r):a instanceof RegExp?i.testRegExp(e,a,o,r):i.testString(e,a,o,r)}return i}testGlobstar(e,t,n,r){if((this.dot||!e.name.startsWith(`.`))&&(t.hasMore()||this.matches.add(e,r,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(n&&t.checkFollowGlobstar()?this.subwalks.add(e,n):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),n){let t=n.pattern();if(typeof t==`string`&&t!==`..`&&t!==``&&t!==`.`)this.testString(e,t,n.rest(),r);else if(t===`..`){let t=e.parent||e;this.subwalks.add(t,n)}else t instanceof RegExp&&this.testRegExp(e,t,n.rest(),r)}}testRegExp(e,t,n,r){t.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,r,!1))}testString(e,t,n,r){e.isNamed(t)&&(n?this.subwalks.add(e,n):this.matches.add(e,r,!1))}}}),Ls=R(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.GlobStream=e.GlobWalker=e.GlobUtil=void 0;var t=Oe(),n=ke(),r=Fs(),i=(e,t)=>typeof e==`string`?new n.Ignore([e],t):Array.isArray(e)?new n.Ignore(e,t):e,a=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#t=[];#s;#n;signal;maxDepth;includeChildMatches;constructor(e,t,n){if(this.patterns=e,this.path=t,this.opts=n,this.#n=!n.posix&&n.platform===`win32`?`\\`:`/`,this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#s=i(n.ignore??[],n),!this.includeChildMatches&&typeof this.#s.add!=`function`))throw Error(`cannot ignore child matches, ignore lacks add() method.`);this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener(`abort`,()=>{this.#t.length=0}))}#r(e){return this.seen.has(e)||!!this.#s?.ignored?.(e)}#h(e){return!!this.#s?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#t.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#t.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}let r=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let e=await r.realpath();e&&(e.isUnknown()||this.opts.stat)&&await e.lstat()}return this.matchCheckTest(r,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#r(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}let r=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let e=r.realpathSync();e&&(e?.isUnknown()||this.opts.stat)&&e.lstatSync()}return this.matchCheckTest(r,t)}matchFinish(e,t){if(this.#r(e))return;if(!this.includeChildMatches&&this.#s?.add){let t=`${e.relativePosix()}/**`;this.#s.add(t)}let n=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let r=this.opts.mark&&e.isDirectory()?this.#n:``;if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let t=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(t+r)}else{let t=this.opts.posix?e.relativePosix():e.relative(),n=this.opts.dotRelative&&!t.startsWith(`..`+this.#n)?`.`+this.#n:``;this.matchEmit(t?n+t+r:`.`+r)}}async match(e,t,n){let r=await this.matchCheck(e,n);r&&this.matchFinish(r,t)}matchSync(e,t,n){let r=this.matchCheckSync(e,n);r&&this.matchFinish(r,t)}walkCB(e,t,n){this.signal?.aborted&&n(),this.walkCB2(e,t,new r.Processor(this.opts),n)}walkCB2(e,t,n,r){if(this.#h(e))return r();if(this.signal?.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2(e,t,n,r));return}n.processPatterns(e,t);let i=1,a=()=>{--i===0&&r()};for(let[e,t,r]of n.matches.entries())this.#r(e)||(i++,this.match(e,t,r).then(()=>a()));for(let e of n.subwalkTargets()){if(this.maxDepth!==1/0&&e.depth()>=this.maxDepth)continue;i++;let t=e.readdirCached();e.calledReaddir()?this.walkCB3(e,t,n,a):e.readdirCB((t,r)=>this.walkCB3(e,r,n,a),!0)}a()}walkCB3(e,t,n,r){n=n.filterEntries(e,t);let i=1,a=()=>{--i===0&&r()};for(let[e,t,r]of n.matches.entries())this.#r(e)||(i++,this.match(e,t,r).then(()=>a()));for(let[e,t]of n.subwalks.entries())i++,this.walkCB2(e,t,n.child(),a);a()}walkCBSync(e,t,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,t,new r.Processor(this.opts),n)}walkCB2Sync(e,t,n,r){if(this.#h(e))return r();if(this.signal?.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,n,r));return}n.processPatterns(e,t);let i=1,a=()=>{--i===0&&r()};for(let[e,t,r]of n.matches.entries())this.#r(e)||this.matchSync(e,t,r);for(let e of n.subwalkTargets()){if(this.maxDepth!==1/0&&e.depth()>=this.maxDepth)continue;i++;let t=e.readdirSync();this.walkCB3Sync(e,t,n,a)}a()}walkCB3Sync(e,t,n,r){n=n.filterEntries(e,t);let i=1,a=()=>{--i===0&&r()};for(let[e,t,r]of n.matches.entries())this.#r(e)||this.matchSync(e,t,r);for(let[e,t]of n.subwalks.entries())i++,this.walkCB2Sync(e,t,n.child(),a);a()}};e.GlobUtil=a,e.GlobWalker=class extends a{matches=new Set;constructor(e,t,n){super(e,t,n)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(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}},e.GlobStream=class extends a{results;constructor(e,n,r){super(e,n,r),this.results=new t.Minipass({signal:this.signal,objectMode:!0}),this.results.on(`drain`,()=>this.resume()),this.results.on(`resume`,()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,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}}}),je=R(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Glob=void 0;var t=H(),n=require(`node:url`),r=Ms(),i=Re(),a=Ls(),o=typeof process==`object`&&process&&typeof process.platform==`string`?process.platform:`linux`;e.Glob=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(e,a){if(!a)throw TypeError(`glob options required`);if(this.withFileTypes=!!a.withFileTypes,this.signal=a.signal,this.follow=!!a.follow,this.dot=!!a.dot,this.dotRelative=!!a.dotRelative,this.nodir=!!a.nodir,this.mark=!!a.mark,a.cwd?(a.cwd instanceof URL||a.cwd.startsWith(`file://`))&&(a.cwd=(0,n.fileURLToPath)(a.cwd)):this.cwd=``,this.cwd=a.cwd||``,this.root=a.root,this.magicalBraces=!!a.magicalBraces,this.nobrace=!!a.nobrace,this.noext=!!a.noext,this.realpath=!!a.realpath,this.absolute=a.absolute,this.includeChildMatches=a.includeChildMatches!==!1,this.noglobstar=!!a.noglobstar,this.matchBase=!!a.matchBase,this.maxDepth=typeof a.maxDepth==`number`?a.maxDepth:1/0,this.stat=!!a.stat,this.ignore=a.ignore,this.withFileTypes&&this.absolute!==void 0)throw Error(`cannot set absolute and withFileTypes:true`);if(typeof e==`string`&&(e=[e]),this.windowsPathsNoEscape=!!a.windowsPathsNoEscape||a.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(e=>e.replace(/\\/g,`/`))),this.matchBase){if(a.noglobstar)throw TypeError(`base matching requires globstar`);e=e.map(e=>e.includes(`/`)?e:`./**/${e}`)}if(this.pattern=e,this.platform=a.platform||o,this.opts={...a,platform:this.platform},a.scurry){if(this.scurry=a.scurry,a.nocase!==void 0&&a.nocase!==a.scurry.nocase)throw Error(`nocase option contradicts provided scurry option`)}else this.scurry=new(a.platform===`win32`?r.PathScurryWin32:a.platform===`darwin`?r.PathScurryDarwin:a.platform?r.PathScurryPosix:r.PathScurry)(this.cwd,{nocase:a.nocase,fs:a.fs});this.nocase=this.scurry.nocase;let s=this.platform===`darwin`||this.platform===`win32`,c={braceExpandMax:1e4,...a,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},[l,u]=this.pattern.map(e=>new t.Minimatch(e,c)).reduce((e,t)=>(e[0].push(...t.set),e[1].push(...t.globParts),e),[[],[]]);this.patterns=l.map((e,t)=>{let n=u[t];if(!n)throw Error(`invalid pattern object`);return new i.Pattern(e,n,0,this.platform)})}async walk(){return[...await new a.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth===1/0?1/0:this.maxDepth+this.scurry.cwd.depth(),platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new a.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth===1/0?1/0:this.maxDepth+this.scurry.cwd.depth(),platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new a.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth===1/0?1/0:this.maxDepth+this.scurry.cwd.depth(),platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new a.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth===1/0?1/0:this.maxDepth+this.scurry.cwd.depth(),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()}}}),Ne=R(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.hasMagic=void 0;var t=H();e.hasMagic=(e,n={})=>{Array.isArray(e)||(e=[e]);for(let r of e)if(new t.Minimatch(r,n).hasMagic())return!0;return!1}});Object.defineProperty(exports,`__esModule`,{value:!0}),exports.glob=exports.sync=exports.iterate=exports.iterateSync=exports.stream=exports.streamSync=exports.Ignore=exports.hasMagic=exports.Glob=exports.unescape=exports.escape=void 0,exports.globStreamSync=xt,exports.globStream=Le,exports.globSync=We,exports.globIterateSync=Tt,exports.globIterate=Be;var Ws=H(),tt=je(),Br=Ne(),Is=H();Object.defineProperty(exports,`escape`,{enumerable:!0,get:function(){return Is.escape}}),Object.defineProperty(exports,`unescape`,{enumerable:!0,get:function(){return Is.unescape}});var Ir=je();Object.defineProperty(exports,`Glob`,{enumerable:!0,get:function(){return Ir.Glob}});var Gr=Ne();Object.defineProperty(exports,`hasMagic`,{enumerable:!0,get:function(){return Gr.hasMagic}});var zr=ke();Object.defineProperty(exports,`Ignore`,{enumerable:!0,get:function(){return zr.Ignore}});function xt(e,t={}){return new tt.Glob(e,t).streamSync()}function Le(e,t={}){return new tt.Glob(e,t).stream()}function We(e,t={}){return new tt.Glob(e,t).walkSync()}async function Bs(e,t={}){return new tt.Glob(e,t).walk()}function Tt(e,t={}){return new tt.Glob(e,t).iterateSync()}function Be(e,t={}){return new tt.Glob(e,t).iterate()}exports.streamSync=xt,exports.stream=Object.assign(Le,{sync:xt}),exports.iterateSync=Tt,exports.iterate=Object.assign(Be,{sync:Tt}),exports.sync=Object.assign(We,{stream:xt,iterate:Tt}),exports.glob=Object.assign(Bs,{glob:Bs,globSync:We,sync:exports.sync,globStream:Le,stream:exports.stream,globStreamSync:xt,streamSync:exports.streamSync,globIterate:Be,iterate:exports.iterate,globIterateSync:Tt,iterateSync:exports.iterateSync,Glob:tt.Glob,hasMagic:Br.hasMagic,escape:Ws.escape,unescape:Ws.unescape}),exports.glob.glob=exports.glob;
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "glob",
3
- "version": "13.0.1",
3
+ "version": "13.0.6",
4
4
  "type": "module",
5
- "main": "./dist/commonjs/index.js",
5
+ "main": "./dist/commonjs/index.min.js",
6
6
  "exports": {
7
7
  "./package.json": "./package.json",
8
- ".": {
8
+ "./raw": {
9
9
  "import": {
10
10
  "types": "./dist/esm/index.d.ts",
11
11
  "default": "./dist/esm/index.js"
@@ -14,6 +14,16 @@
14
14
  "types": "./dist/commonjs/index.d.ts",
15
15
  "default": "./dist/commonjs/index.js"
16
16
  }
17
+ },
18
+ ".": {
19
+ "import": {
20
+ "types": "./dist/esm/index.d.ts",
21
+ "default": "./dist/esm/index.min.js"
22
+ },
23
+ "require": {
24
+ "types": "./dist/commonjs/index.d.ts",
25
+ "default": "./dist/commonjs/index.min.js"
26
+ }
17
27
  }
18
28
  }
19
29
  }
package/dist/plugin.mjs CHANGED
@@ -3,6 +3,7 @@ import { n as isAbsolute, o as resolve } from "./_chunks/libs/pathe.mjs";
3
3
  import { t as resolveModulePath } from "./_chunks/libs/exsolve.mjs";
4
4
  import { builtinModules } from "node:module";
5
5
  import { pathToFileURL } from "node:url";
6
+ //#region src/plugin.ts
6
7
  const PLUGIN_NAME = "nitro:externals";
7
8
  function externals(opts) {
8
9
  const rootDir = resolve(opts.rootDir || ".");
@@ -71,18 +72,25 @@ function externals(opts) {
71
72
  };
72
73
  }
73
74
  },
74
- buildEnd: {
75
+ writeBundle: {
75
76
  order: "post",
76
77
  async handler() {
78
+ for (const entry of opts.traceInclude || []) tracedPaths.add(isAbsolute(entry) ? entry : tryResolve(entry, void 0) ?? resolve(rootDir, entry));
77
79
  if (opts.trace === false || tracedPaths.size === 0) return;
80
+ const traceOpts = opts.trace === true ? {} : opts.trace;
81
+ if (traceOpts?.fullTraceInclude) for (const pkg of traceOpts.fullTraceInclude) {
82
+ const resolved = tryResolve(Array.isArray(pkg) ? pkg[0] : pkg, void 0);
83
+ if (resolved) tracedPaths.add(resolved);
84
+ }
78
85
  const { traceNodeModules } = await import("./_chunks/trace.mjs").then((n) => n.r);
79
86
  await traceNodeModules([...tracedPaths], {
80
87
  conditions: opts.conditions,
81
88
  rootDir,
82
- ...opts.trace === true ? {} : opts.trace
89
+ ...traceOpts
83
90
  });
84
91
  }
85
92
  }
86
93
  };
87
94
  }
95
+ //#endregion
88
96
  export { externals };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nf3",
3
- "version": "0.3.10",
3
+ "version": "0.3.12",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "repository": "unjs/nf3",
@@ -27,27 +27,27 @@
27
27
  },
28
28
  "devDependencies": {
29
29
  "@rollup/plugin-node-resolve": "^16.0.3",
30
- "@types/node": "^25.2.1",
30
+ "@types/node": "^25.5.0",
31
31
  "@types/semver": "^7.7.1",
32
- "@typescript/native-preview": "7.0.0-dev.20260206.1",
33
- "@vercel/nft": "^1.3.0",
34
- "@vitest/coverage-v8": "^4.0.18",
32
+ "@typescript/native-preview": "^7.0.0-dev.20260319.1",
33
+ "@vercel/nft": "^1.4.0",
34
+ "@vitest/coverage-v8": "^4.1.0",
35
35
  "automd": "^0.4.3",
36
36
  "changelogen": "^0.6.2",
37
37
  "eslint-config-unjs": "^0.6.2",
38
38
  "exsolve": "^1.0.8",
39
- "obuild": "^0.4.26",
40
- "oxc-minify": "^0.112.0",
41
- "oxfmt": "^0.28.0",
42
- "oxlint": "^1.43.0",
39
+ "obuild": "^0.4.32",
40
+ "oxc-minify": "^0.121.0",
41
+ "oxfmt": "^0.41.0",
42
+ "oxlint": "^1.56.0",
43
43
  "pathe": "^2.0.3",
44
44
  "pkg-types": "^2.3.0",
45
- "rolldown": "^1.0.0-rc.3",
46
- "rollup": "^4.57.1",
45
+ "rolldown": "^1.0.0-rc.10",
46
+ "rollup": "^4.59.0",
47
47
  "rollup-plugin-esbuild": "^6.2.1",
48
48
  "semver": "^7.7.4",
49
49
  "typescript": "^5.9.3",
50
- "vitest": "^4.0.18"
50
+ "vitest": "^4.1.0"
51
51
  },
52
- "packageManager": "pnpm@10.28.2"
52
+ "packageManager": "pnpm@10.32.1"
53
53
  }
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,`__esModule`,{value:!0}),exports.range=exports.balanced=void 0;const balanced=(e,n,r)=>{let i=e instanceof RegExp?maybeMatch(e,r):e,a=n instanceof RegExp?maybeMatch(n,r):n,o=i!==null&&a!=null&&(0,exports.range)(i,a,r);return o&&{start:o[0],end:o[1],pre:r.slice(0,o[0]),body:r.slice(o[0]+i.length,o[1]),post:r.slice(o[1]+a.length)}};exports.balanced=balanced;const maybeMatch=(e,t)=>{let n=t.match(e);return n?n[0]:null},range=(e,t,n)=>{let r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;){if(u===c)r.push(u),c=n.indexOf(e,u+1);else if(r.length===1){let e=r.pop();e!==void 0&&(s=[e,l])}else i=r.pop(),i!==void 0&&i<a&&(a=i,o=l),l=n.indexOf(t,u+1);u=c<l&&c>=0?c:l}r.length&&o!==void 0&&(s=[a,o])}return s};exports.range=range;
@@ -1,19 +0,0 @@
1
- {
2
- "name": "@isaacs/balanced-match",
3
- "version": "4.0.1",
4
- "exports": {
5
- "./package.json": "./package.json",
6
- ".": {
7
- "import": {
8
- "types": "./dist/esm/index.d.ts",
9
- "default": "./dist/esm/index.js"
10
- },
11
- "require": {
12
- "types": "./dist/commonjs/index.d.ts",
13
- "default": "./dist/commonjs/index.js"
14
- }
15
- }
16
- },
17
- "type": "module",
18
- "main": "./dist/commonjs/index.js"
19
- }
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,`__esModule`,{value:!0}),exports.EXPANSION_MAX=void 0,exports.expand=expand;const balanced_match_1=require(`@isaacs/balanced-match`),escSlash=`\0SLASH`+Math.random()+`\0`,escOpen=`\0OPEN`+Math.random()+`\0`,escClose=`\0CLOSE`+Math.random()+`\0`,escComma=`\0COMMA`+Math.random()+`\0`,escPeriod=`\0PERIOD`+Math.random()+`\0`,escSlashPattern=new RegExp(escSlash,`g`),escOpenPattern=new RegExp(escOpen,`g`),escClosePattern=new RegExp(escClose,`g`),escCommaPattern=new RegExp(escComma,`g`),escPeriodPattern=new RegExp(escPeriod,`g`),slashPattern=/\\\\/g,openPattern=/\\{/g,closePattern=/\\}/g,commaPattern=/\\,/g,periodPattern=/\\./g;exports.EXPANSION_MAX=1e5;function numeric(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function escapeBraces(e){return e.replace(slashPattern,escSlash).replace(openPattern,escOpen).replace(closePattern,escClose).replace(commaPattern,escComma).replace(periodPattern,escPeriod)}function unescapeBraces(e){return e.replace(escSlashPattern,`\\`).replace(escOpenPattern,`{`).replace(escClosePattern,`}`).replace(escCommaPattern,`,`).replace(escPeriodPattern,`.`)}function parseCommaParts(t){if(!t)return[``];let n=[],r=(0,balanced_match_1.balanced)(`{`,`}`,t);if(!r)return t.split(`,`);let{pre:i,body:a,post:o}=r,s=i.split(`,`);s[s.length-1]+=`{`+a+`}`;let c=parseCommaParts(o);return o.length&&(s[s.length-1]+=c.shift(),s.push.apply(s,c)),n.push.apply(n,s),n}function expand(e,t={}){if(!e)return[];let{max:n=exports.EXPANSION_MAX}=t;return e.slice(0,2)===`{}`&&(e=`\\{\\}`+e.slice(2)),expand_(escapeBraces(e),n,!0).map(unescapeBraces)}function embrace(e){return`{`+e+`}`}function isPadded(e){return/^-?0\d/.test(e)}function lte(e,t){return e<=t}function gte(e,t){return e>=t}function expand_(t,n,i){let a=[],o=(0,balanced_match_1.balanced)(`{`,`}`,t);if(!o)return[t];let s=o.pre,c=o.post.length?expand_(o.post,n,!1):[``];if(/\$$/.test(o.pre))for(let e=0;e<c.length&&e<n;e++){let t=s+`{`+o.body+`}`+c[e];a.push(t)}else{let e=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(o.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(o.body),u=e||l,d=o.body.indexOf(`,`)>=0;if(!u&&!d)return o.post.match(/,(?!,).*\}/)?(t=o.pre+`{`+o.body+escClose+o.post,expand_(t,n,!0)):[t];let f;if(u)f=o.body.split(/\.\./);else if(f=parseCommaParts(o.body),f.length===1&&f[0]!==void 0&&(f=expand_(f[0],n,!1).map(embrace),f.length===1))return c.map(e=>o.pre+f[0]+e);let p;if(u&&f[0]!==void 0&&f[1]!==void 0){let e=numeric(f[0]),t=numeric(f[1]),n=Math.max(f[0].length,f[1].length),r=f.length===3&&f[2]!==void 0?Math.abs(numeric(f[2])):1,i=lte;t<e&&(r*=-1,i=gte);let a=f.some(isPadded);p=[];for(let o=e;i(o,t);o+=r){let e;if(l)e=String.fromCharCode(o),e===`\\`&&(e=``);else if(e=String(o),a){let t=n-e.length;if(t>0){let n=Array(t+1).join(`0`);e=o<0?`-`+n+e.slice(1):n+e}}p.push(e)}}else{p=[];for(let e=0;e<f.length;e++)p.push.apply(p,expand_(f[e],n,!1))}for(let e=0;e<p.length;e++)for(let t=0;t<c.length&&a.length<n;t++){let n=s+p[e]+c[t];(!i||u||n)&&a.push(n)}}return a}
@@ -1,19 +0,0 @@
1
- {
2
- "name": "@isaacs/brace-expansion",
3
- "version": "5.0.1",
4
- "exports": {
5
- "./package.json": "./package.json",
6
- ".": {
7
- "import": {
8
- "types": "./dist/esm/index.d.ts",
9
- "default": "./dist/esm/index.js"
10
- },
11
- "require": {
12
- "types": "./dist/commonjs/index.d.ts",
13
- "default": "./dist/commonjs/index.js"
14
- }
15
- }
16
- },
17
- "type": "module",
18
- "main": "./dist/commonjs/index.js"
19
- }
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,`__esModule`,{value:!0}),exports.Glob=void 0;const minimatch_1=require(`minimatch`),node_url_1=require(`node:url`),path_scurry_1=require(`path-scurry`),pattern_js_1=require(`./pattern.js`),walker_js_1=require(`./walker.js`),defaultPlatform=typeof process==`object`&&process&&typeof process.platform==`string`?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(r,i){if(!i)throw TypeError(`glob options required`);if(this.withFileTypes=!!i.withFileTypes,this.signal=i.signal,this.follow=!!i.follow,this.dot=!!i.dot,this.dotRelative=!!i.dotRelative,this.nodir=!!i.nodir,this.mark=!!i.mark,i.cwd?(i.cwd instanceof URL||i.cwd.startsWith(`file://`))&&(i.cwd=(0,node_url_1.fileURLToPath)(i.cwd)):this.cwd=``,this.cwd=i.cwd||``,this.root=i.root,this.magicalBraces=!!i.magicalBraces,this.nobrace=!!i.nobrace,this.noext=!!i.noext,this.realpath=!!i.realpath,this.absolute=i.absolute,this.includeChildMatches=i.includeChildMatches!==!1,this.noglobstar=!!i.noglobstar,this.matchBase=!!i.matchBase,this.maxDepth=typeof i.maxDepth==`number`?i.maxDepth:1/0,this.stat=!!i.stat,this.ignore=i.ignore,this.withFileTypes&&this.absolute!==void 0)throw Error(`cannot set absolute and withFileTypes:true`);if(typeof r==`string`&&(r=[r]),this.windowsPathsNoEscape=!!i.windowsPathsNoEscape||i.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(r=r.map(e=>e.replace(/\\/g,`/`))),this.matchBase){if(i.noglobstar)throw TypeError(`base matching requires globstar`);r=r.map(e=>e.includes(`/`)?e:`./**/${e}`)}if(this.pattern=r,this.platform=i.platform||defaultPlatform,this.opts={...i,platform:this.platform},i.scurry){if(this.scurry=i.scurry,i.nocase!==void 0&&i.nocase!==i.scurry.nocase)throw Error(`nocase option contradicts provided scurry option`)}else this.scurry=new(i.platform===`win32`?path_scurry_1.PathScurryWin32:i.platform===`darwin`?path_scurry_1.PathScurryDarwin:i.platform?path_scurry_1.PathScurryPosix:path_scurry_1.PathScurry)(this.cwd,{nocase:i.nocase,fs:i.fs});this.nocase=this.scurry.nocase;let a=this.platform===`darwin`||this.platform===`win32`,o={...i,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:a,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},[s,c]=this.pattern.map(t=>new minimatch_1.Minimatch(t,o)).reduce((e,t)=>(e[0].push(...t.set),e[1].push(...t.globParts),e),[[],[]]);this.patterns=s.map((e,t)=>{let n=c[t];if(!n)throw Error(`invalid pattern object`);return new pattern_js_1.Pattern(e,n,0,this.platform)})}async walk(){return[...await new walker_js_1.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth===1/0?1/0:this.maxDepth+this.scurry.cwd.depth(),platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new walker_js_1.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth===1/0?1/0:this.maxDepth+this.scurry.cwd.depth(),platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new walker_js_1.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth===1/0?1/0:this.maxDepth+this.scurry.cwd.depth(),platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new walker_js_1.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth===1/0?1/0:this.maxDepth+this.scurry.cwd.depth(),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()}}exports.Glob=Glob;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,`__esModule`,{value:!0}),exports.hasMagic=void 0;const minimatch_1=require(`minimatch`),hasMagic=(e,t={})=>{Array.isArray(e)||(e=[e]);for(let n of e)if(new minimatch_1.Minimatch(n,t).hasMagic())return!0;return!1};exports.hasMagic=hasMagic;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,`__esModule`,{value:!0}),exports.Ignore=void 0;const minimatch_1=require(`minimatch`),pattern_js_1=require(`./pattern.js`),defaultPlatform=typeof process==`object`&&process&&typeof process.platform==`string`?process.platform:`linux`;class Ignore{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:r,noext:i,noglobstar:a,platform:o=defaultPlatform}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:r,noext:i,noglobstar:a,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let t of e)this.add(t)}add(n){let r=new minimatch_1.Minimatch(n,this.mmopts);for(let n=0;n<r.set.length;n++){let i=r.set[n],a=r.globParts[n];if(!i||!a)throw Error(`invalid pattern object`);for(;i[0]===`.`&&a[0]===`.`;)i.shift(),a.shift();let o=new pattern_js_1.Pattern(i,a,0,this.platform),s=new minimatch_1.Minimatch(o.globString(),this.mmopts),c=a[a.length-1]===`**`,l=o.isAbsolute();l?this.absolute.push(s):this.relative.push(s),c&&(l?this.absoluteChildren.push(s):this.relativeChildren.push(s))}}ignored(e){let t=e.fullpath(),n=`${t}/`,r=e.relative()||`.`,i=`${r}/`;for(let e of this.relative)if(e.match(r)||e.match(i))return!0;for(let e of this.absolute)if(e.match(t)||e.match(n))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+`/`,n=(e.relative()||`.`)+`/`;for(let e of this.relativeChildren)if(e.match(n))return!0;for(let e of this.absoluteChildren)if(e.match(t))return!0;return!1}}exports.Ignore=Ignore;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,`__esModule`,{value:!0}),exports.glob=exports.sync=exports.iterate=exports.iterateSync=exports.stream=exports.streamSync=exports.Ignore=exports.hasMagic=exports.Glob=exports.unescape=exports.escape=void 0,exports.globStreamSync=globStreamSync,exports.globStream=globStream,exports.globSync=globSync,exports.globIterateSync=globIterateSync,exports.globIterate=globIterate;const minimatch_1=require(`minimatch`),glob_js_1=require(`./glob.js`),has_magic_js_1=require(`./has-magic.js`);var minimatch_2=require(`minimatch`);Object.defineProperty(exports,`escape`,{enumerable:!0,get:function(){return minimatch_2.escape}}),Object.defineProperty(exports,`unescape`,{enumerable:!0,get:function(){return minimatch_2.unescape}});var glob_js_2=require(`./glob.js`);Object.defineProperty(exports,`Glob`,{enumerable:!0,get:function(){return glob_js_2.Glob}});var has_magic_js_2=require(`./has-magic.js`);Object.defineProperty(exports,`hasMagic`,{enumerable:!0,get:function(){return has_magic_js_2.hasMagic}});var ignore_js_1=require(`./ignore.js`);Object.defineProperty(exports,`Ignore`,{enumerable:!0,get:function(){return ignore_js_1.Ignore}});function globStreamSync(e,t={}){return new glob_js_1.Glob(e,t).streamSync()}function globStream(e,t={}){return new glob_js_1.Glob(e,t).stream()}function globSync(e,t={}){return new glob_js_1.Glob(e,t).walkSync()}async function glob_(e,t={}){return new glob_js_1.Glob(e,t).walk()}function globIterateSync(e,t={}){return new glob_js_1.Glob(e,t).iterateSync()}function globIterate(e,t={}){return new glob_js_1.Glob(e,t).iterate()}exports.streamSync=globStreamSync,exports.stream=Object.assign(globStream,{sync:globStreamSync}),exports.iterateSync=globIterateSync,exports.iterate=Object.assign(globIterate,{sync:globIterateSync}),exports.sync=Object.assign(globSync,{stream:globStreamSync,iterate:globIterateSync}),exports.glob=Object.assign(glob_,{glob:glob_,globSync,sync:exports.sync,globStream,stream:exports.stream,globStreamSync,streamSync:exports.streamSync,globIterate,iterate:exports.iterate,globIterateSync,iterateSync:exports.iterateSync,Glob:glob_js_1.Glob,hasMagic:has_magic_js_1.hasMagic,escape:minimatch_1.escape,unescape:minimatch_1.unescape}),exports.glob.glob=exports.glob;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,`__esModule`,{value:!0}),exports.Pattern=void 0;const minimatch_1=require(`minimatch`),isPatternList=e=>e.length>=1,isGlobList=e=>e.length>=1;class Pattern{#patternList;#globList;#index;length;#platform;#rest;#globString;#isDrive;#isUNC;#isAbsolute;#followGlobstar=!0;constructor(e,r,i,a){if(!isPatternList(e))throw TypeError(`empty pattern list`);if(!isGlobList(r))throw TypeError(`empty glob list`);if(r.length!==e.length)throw TypeError(`mismatched pattern list and glob list lengths`);if(this.length=e.length,i<0||i>=this.length)throw TypeError(`index out of range`);if(this.#patternList=e,this.#globList=r,this.#index=i,this.#platform=a,this.#index===0){if(this.isUNC()){let[e,t,n,r,...i]=this.#patternList,[a,o,s,c,...l]=this.#globList;i[0]===``&&(i.shift(),l.shift());let u=[e,t,n,r,``].join(`/`),d=[a,o,s,c,``].join(`/`);this.#patternList=[u,...i],this.#globList=[d,...l],this.length=this.#patternList.length}else if(this.isDrive()||this.isAbsolute()){let[e,...t]=this.#patternList,[n,...r]=this.#globList;t[0]===``&&(t.shift(),r.shift());let i=e+`/`,a=n+`/`;this.#patternList=[i,...t],this.#globList=[a,...r],this.length=this.#patternList.length}}}pattern(){return this.#patternList[this.#index]}isString(){return typeof this.#patternList[this.#index]==`string`}isGlobstar(){return this.#patternList[this.#index]===minimatch_1.GLOBSTAR}isRegExp(){return this.#patternList[this.#index]instanceof RegExp}globString(){return this.#globString=this.#globString||(this.#index===0?this.isAbsolute()?this.#globList[0]+this.#globList.slice(1).join(`/`):this.#globList.join(`/`):this.#globList.slice(this.#index).join(`/`))}hasMore(){return this.length>this.#index+1}rest(){return this.#rest===void 0?this.hasMore()?(this.#rest=new Pattern(this.#patternList,this.#globList,this.#index+1,this.#platform),this.#rest.#isAbsolute=this.#isAbsolute,this.#rest.#isUNC=this.#isUNC,this.#rest.#isDrive=this.#isDrive,this.#rest):this.#rest=null:this.#rest}isUNC(){let e=this.#patternList;return this.#isUNC===void 0?this.#isUNC=this.#platform===`win32`&&this.#index===0&&e[0]===``&&e[1]===``&&typeof e[2]==`string`&&!!e[2]&&typeof e[3]==`string`&&!!e[3]:this.#isUNC}isDrive(){let e=this.#patternList;return this.#isDrive===void 0?this.#isDrive=this.#platform===`win32`&&this.#index===0&&this.length>1&&typeof e[0]==`string`&&/^[a-z]:$/i.test(e[0]):this.#isDrive}isAbsolute(){let e=this.#patternList;return this.#isAbsolute===void 0?this.#isAbsolute=e[0]===``&&e.length>1||this.isDrive()||this.isUNC():this.#isAbsolute}root(){let e=this.#patternList[0];return typeof e==`string`&&this.isAbsolute()&&this.#index===0?e:``}checkFollowGlobstar(){return!(this.#index===0||!this.isGlobstar()||!this.#followGlobstar)}markFollowGlobstar(){return this.#index===0||!this.isGlobstar()||!this.#followGlobstar?!1:(this.#followGlobstar=!1,!0)}}exports.Pattern=Pattern;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,`__esModule`,{value:!0}),exports.Processor=exports.SubWalks=exports.MatchRecord=exports.HasWalkedCache=void 0;const minimatch_1=require(`minimatch`);class HasWalkedCache{store;constructor(e=new Map){this.store=e}copy(){return new HasWalkedCache(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let n=e.fullpath(),r=this.store.get(n);r?r.add(t.globString()):this.store.set(n,new Set([t.globString()]))}}exports.HasWalkedCache=HasWalkedCache;class MatchRecord{store=new Map;add(e,t,n){let r=(t?2:0)|(n?1:0),i=this.store.get(e);this.store.set(e,i===void 0?r:r&i)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}}exports.MatchRecord=MatchRecord;class SubWalks{store=new Map;add(e,t){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(e=>e.globString()===t.globString())||n.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw Error(`attempting to walk unknown path`);return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}}exports.SubWalks=SubWalks;class Processor{hasWalkedCache;matches=new MatchRecord;subwalks=new SubWalks;patterns;follow;dot;opts;constructor(e,n){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=n?n.copy():new HasWalkedCache}processPatterns(t,n){this.patterns=n;let r=n.map(e=>[t,e]);for(let[t,n]of r){this.hasWalkedCache.storeWalked(t,n);let r=n.root(),i=n.isAbsolute()&&this.opts.absolute!==!1;if(r){t=t.resolve(r===`/`&&this.opts.root!==void 0?this.opts.root:r);let e=n.rest();if(e)n=e;else{this.matches.add(t,!0,!1);continue}}if(t.isENOENT())continue;let a,o,s=!1;for(;typeof(a=n.pattern())==`string`&&(o=n.rest());)t=t.resolve(a),n=o,s=!0;if(a=n.pattern(),o=n.rest(),s){if(this.hasWalkedCache.hasWalked(t,n))continue;this.hasWalkedCache.storeWalked(t,n)}if(typeof a==`string`){let e=a===`..`||a===``||a===`.`;this.matches.add(t.resolve(a),i,e);continue}else if(a===minimatch_1.GLOBSTAR){(!t.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(t,n);let e=o?.pattern(),r=o?.rest();if(!o||(e===``||e===`.`)&&!r)this.matches.add(t,i,e===``||e===`.`);else if(e===`..`){let e=t.parent||t;r?this.hasWalkedCache.hasWalked(e,r)||this.subwalks.add(e,r):this.matches.add(e,i,!0)}}else a instanceof RegExp&&this.subwalks.add(t,n)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new Processor(this.opts,this.hasWalkedCache)}filterEntries(t,n){let r=this.subwalks.get(t),i=this.child();for(let t of n)for(let n of r){let r=n.isAbsolute(),a=n.pattern(),o=n.rest();a===minimatch_1.GLOBSTAR?i.testGlobstar(t,n,o,r):a instanceof RegExp?i.testRegExp(t,a,o,r):i.testString(t,a,o,r)}return i}testGlobstar(e,t,n,r){if((this.dot||!e.name.startsWith(`.`))&&(t.hasMore()||this.matches.add(e,r,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(n&&t.checkFollowGlobstar()?this.subwalks.add(e,n):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),n){let t=n.pattern();if(typeof t==`string`&&t!==`..`&&t!==``&&t!==`.`)this.testString(e,t,n.rest(),r);else if(t===`..`){let t=e.parent||e;this.subwalks.add(t,n)}else t instanceof RegExp&&this.testRegExp(e,t,n.rest(),r)}}testRegExp(e,t,n,r){t.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,r,!1))}testString(e,t,n,r){e.isNamed(t)&&(n?this.subwalks.add(e,n):this.matches.add(e,r,!1))}}exports.Processor=Processor;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,`__esModule`,{value:!0}),exports.GlobStream=exports.GlobWalker=exports.GlobUtil=void 0;const minipass_1=require(`minipass`),ignore_js_1=require(`./ignore.js`),processor_js_1=require(`./processor.js`),makeIgnore=(e,n)=>typeof e==`string`?new ignore_js_1.Ignore([e],n):Array.isArray(e)?new ignore_js_1.Ignore(e,n):e;class GlobUtil{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#onResume=[];#ignore;#sep;signal;maxDepth;includeChildMatches;constructor(e,t,n){if(this.patterns=e,this.path=t,this.opts=n,this.#sep=!n.posix&&n.platform===`win32`?`\\`:`/`,this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#ignore=makeIgnore(n.ignore??[],n),!this.includeChildMatches&&typeof this.#ignore.add!=`function`))throw Error(`cannot ignore child matches, ignore lacks add() method.`);this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener(`abort`,()=>{this.#onResume.length=0}))}#ignored(e){return this.seen.has(e)||!!this.#ignore?.ignored?.(e)}#childrenIgnored(e){return!!this.#ignore?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#onResume.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#onResume.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}let r=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let e=await r.realpath();e&&(e.isUnknown()||this.opts.stat)&&await e.lstat()}return this.matchCheckTest(r,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#ignored(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}let r=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){let e=r.realpathSync();e&&(e?.isUnknown()||this.opts.stat)&&e.lstatSync()}return this.matchCheckTest(r,t)}matchFinish(e,t){if(this.#ignored(e))return;if(!this.includeChildMatches&&this.#ignore?.add){let t=`${e.relativePosix()}/**`;this.#ignore.add(t)}let n=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let r=this.opts.mark&&e.isDirectory()?this.#sep:``;if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let t=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(t+r)}else{let t=this.opts.posix?e.relativePosix():e.relative(),n=this.opts.dotRelative&&!t.startsWith(`..`+this.#sep)?`.`+this.#sep:``;this.matchEmit(t?n+t+r:`.`+r)}}async match(e,t,n){let r=await this.matchCheck(e,n);r&&this.matchFinish(r,t)}matchSync(e,t,n){let r=this.matchCheckSync(e,n);r&&this.matchFinish(r,t)}walkCB(e,t,r){this.signal?.aborted&&r(),this.walkCB2(e,t,new processor_js_1.Processor(this.opts),r)}walkCB2(e,t,n,r){if(this.#childrenIgnored(e))return r();if(this.signal?.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2(e,t,n,r));return}n.processPatterns(e,t);let i=1,a=()=>{--i===0&&r()};for(let[e,t,r]of n.matches.entries())this.#ignored(e)||(i++,this.match(e,t,r).then(()=>a()));for(let e of n.subwalkTargets()){if(this.maxDepth!==1/0&&e.depth()>=this.maxDepth)continue;i++;let t=e.readdirCached();e.calledReaddir()?this.walkCB3(e,t,n,a):e.readdirCB((t,r)=>this.walkCB3(e,r,n,a),!0)}a()}walkCB3(e,t,n,r){n=n.filterEntries(e,t);let i=1,a=()=>{--i===0&&r()};for(let[e,t,r]of n.matches.entries())this.#ignored(e)||(i++,this.match(e,t,r).then(()=>a()));for(let[e,t]of n.subwalks.entries())i++,this.walkCB2(e,t,n.child(),a);a()}walkCBSync(e,t,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,t,new processor_js_1.Processor(this.opts),r)}walkCB2Sync(e,t,n,r){if(this.#childrenIgnored(e))return r();if(this.signal?.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,n,r));return}n.processPatterns(e,t);let i=1,a=()=>{--i===0&&r()};for(let[e,t,r]of n.matches.entries())this.#ignored(e)||this.matchSync(e,t,r);for(let e of n.subwalkTargets()){if(this.maxDepth!==1/0&&e.depth()>=this.maxDepth)continue;i++;let t=e.readdirSync();this.walkCB3Sync(e,t,n,a)}a()}walkCB3Sync(e,t,n,r){n=n.filterEntries(e,t);let i=1,a=()=>{--i===0&&r()};for(let[e,t,r]of n.matches.entries())this.#ignored(e)||this.matchSync(e,t,r);for(let[e,t]of n.subwalks.entries())i++,this.walkCB2Sync(e,t,n.child(),a);a()}}exports.GlobUtil=GlobUtil;class GlobWalker extends GlobUtil{matches=new Set;constructor(e,t,n){super(e,t,n)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(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}}exports.GlobWalker=GlobWalker;class GlobStream extends GlobUtil{results;constructor(t,n,r){super(t,n,r),this.results=new minipass_1.Minipass({signal:this.signal,objectMode:!0}),this.results.on(`drain`,()=>this.resume()),this.results.on(`resume`,()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,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}}exports.GlobStream=GlobStream;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,`__esModule`,{value:!0}),exports.LRUCache=void 0;const defaultPerf=typeof performance==`object`&&performance&&typeof performance.now==`function`?performance:Date,warned=new Set,PROCESS=typeof process==`object`&&process?process:{},emitWarning=(e,t,r,i)=>{typeof PROCESS.emitWarning==`function`?PROCESS.emitWarning(e,t,r,i):console.error(`[${r}] ${t}: ${e}`)};let AC=globalThis.AbortController,AS=globalThis.AbortSignal;if(AC===void 0){AS=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},AC=class{constructor(){t()}signal=new AS;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(let t of this.signal._onabort)t(e);this.signal.onabort?.(e)}}};let e=PROCESS.env?.LRU_CACHE_IGNORE_AC_WARNING!==`1`,t=()=>{e&&(e=!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`,t))}}const shouldWarn=e=>!warned.has(e),TYPE=Symbol(`type`),isPosInt=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),getUintArray=e=>isPosInt(e)?e<=2**8?Uint8Array:e<=2**16?Uint16Array:e<=2**32?Uint32Array:e<=2**53-1?ZeroArray:null:null;class ZeroArray extends Array{constructor(e){super(e),this.fill(0)}}class Stack{heap;length;static#constructing=!1;static create(e){let t=getUintArray(e);if(!t)return[];Stack.#constructing=!0;let n=new Stack(e,t);return Stack.#constructing=!1,n}constructor(e,t){if(!Stack.#constructing)throw TypeError(`instantiate Stack using Stack.create(n)`);this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}}class LRUCache{#max;#maxSize;#dispose;#onInsert;#disposeAfter;#fetchMethod;#memoMethod;#perf;get perf(){return this.#perf}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#size;#calculatedSize;#keyMap;#keyList;#valList;#next;#prev;#head;#tail;#free;#disposed;#sizes;#starts;#ttls;#autopurgeTimers;#hasDispose;#hasFetchMethod;#hasDisposeAfter;#hasOnInsert;static unsafeExposeInternals(e){return{starts:e.#starts,ttls:e.#ttls,autopurgeTimers:e.#autopurgeTimers,sizes:e.#sizes,keyMap:e.#keyMap,keyList:e.#keyList,valList:e.#valList,next:e.#next,prev:e.#prev,get head(){return e.#head},get tail(){return e.#tail},free:e.#free,isBackgroundFetch:t=>e.#isBackgroundFetch(t),backgroundFetch:(t,n,r,i)=>e.#backgroundFetch(t,n,r,i),moveToTail:t=>e.#moveToTail(t),indexes:t=>e.#indexes(t),rindexes:t=>e.#rindexes(t),isStale:t=>e.#isStale(t)}}get max(){return this.#max}get maxSize(){return this.#maxSize}get calculatedSize(){return this.#calculatedSize}get size(){return this.#size}get fetchMethod(){return this.#fetchMethod}get memoMethod(){return this.#memoMethod}get dispose(){return this.#dispose}get onInsert(){return this.#onInsert}get disposeAfter(){return this.#disposeAfter}constructor(n){let{max:i=0,ttl:a,ttlResolution:s=1,ttlAutopurge:u,updateAgeOnGet:p,updateAgeOnHas:m,allowStale:h,dispose:g,onInsert:_,disposeAfter:v,noDisposeOnSet:y,noUpdateTTL:b,maxSize:x=0,maxEntrySize:S=0,sizeCalculation:C,fetchMethod:w,memoMethod:T,noDeleteOnFetchRejection:E,noDeleteOnStaleGet:D,allowStaleOnFetchRejection:O,allowStaleOnFetchAbort:k,ignoreFetchAbort:A,perf:j}=n;if(j!==void 0&&typeof j?.now!=`function`)throw TypeError(`perf option must have a now() method if specified`);if(this.#perf=j??defaultPerf,i!==0&&!isPosInt(i))throw TypeError(`max option must be a nonnegative integer`);let M=i?getUintArray(i):Array;if(!M)throw Error(`invalid max value: `+i);if(this.#max=i,this.#maxSize=x,this.maxEntrySize=S||this.#maxSize,this.sizeCalculation=C,this.sizeCalculation){if(!this.#maxSize&&!this.maxEntrySize)throw TypeError(`cannot set sizeCalculation without setting maxSize or maxEntrySize`);if(typeof this.sizeCalculation!=`function`)throw TypeError(`sizeCalculation set to non-function`)}if(T!==void 0&&typeof T!=`function`)throw TypeError(`memoMethod must be a function if defined`);if(this.#memoMethod=T,w!==void 0&&typeof w!=`function`)throw TypeError(`fetchMethod must be a function if specified`);if(this.#fetchMethod=w,this.#hasFetchMethod=!!w,this.#keyMap=new Map,this.#keyList=Array(i).fill(void 0),this.#valList=Array(i).fill(void 0),this.#next=new M(i),this.#prev=new M(i),this.#head=0,this.#tail=0,this.#free=Stack.create(i),this.#size=0,this.#calculatedSize=0,typeof g==`function`&&(this.#dispose=g),typeof _==`function`&&(this.#onInsert=_),typeof v==`function`?(this.#disposeAfter=v,this.#disposed=[]):(this.#disposeAfter=void 0,this.#disposed=void 0),this.#hasDispose=!!this.#dispose,this.#hasOnInsert=!!this.#onInsert,this.#hasDisposeAfter=!!this.#disposeAfter,this.noDisposeOnSet=!!y,this.noUpdateTTL=!!b,this.noDeleteOnFetchRejection=!!E,this.allowStaleOnFetchRejection=!!O,this.allowStaleOnFetchAbort=!!k,this.ignoreFetchAbort=!!A,this.maxEntrySize!==0){if(this.#maxSize!==0&&!isPosInt(this.#maxSize))throw TypeError(`maxSize must be a positive integer if specified`);if(!isPosInt(this.maxEntrySize))throw TypeError(`maxEntrySize must be a positive integer if specified`);this.#initializeSizeTracking()}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!D,this.updateAgeOnGet=!!p,this.updateAgeOnHas=!!m,this.ttlResolution=isPosInt(s)||s===0?s:1,this.ttlAutopurge=!!u,this.ttl=a||0,this.ttl){if(!isPosInt(this.ttl))throw TypeError(`ttl must be a positive integer if specified`);this.#initializeTTLTracking()}if(this.#max===0&&this.ttl===0&&this.#maxSize===0)throw TypeError(`At least one of max, maxSize, or ttl is required`);if(!this.ttlAutopurge&&!this.#max&&!this.#maxSize){let e=`LRU_CACHE_UNBOUNDED`;shouldWarn(e)&&(warned.add(e),emitWarning(`TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.`,`UnboundedCacheWarning`,e,LRUCache))}}getRemainingTTL(e){return this.#keyMap.has(e)?1/0:0}#initializeTTLTracking(){let e=new ZeroArray(this.#max),t=new ZeroArray(this.#max);this.#ttls=e,this.#starts=t;let n=this.ttlAutopurge?Array(this.#max):void 0;this.#autopurgeTimers=n,this.#setItemTTL=(r,i,a=this.#perf.now())=>{if(t[r]=i===0?0:a,e[r]=i,n?.[r]&&(clearTimeout(n[r]),n[r]=void 0),i!==0&&n){let e=setTimeout(()=>{this.#isStale(r)&&this.#delete(this.#keyList[r],`expire`)},i+1);e.unref&&e.unref(),n[r]=e}},this.#updateItemAge=n=>{t[n]=e[n]===0?0:this.#perf.now()},this.#statusTTL=(n,a)=>{if(e[a]){let o=e[a],s=t[a];if(!o||!s)return;n.ttl=o,n.start=s,n.now=r||i(),n.remainingTTL=o-(n.now-s)}};let r=0,i=()=>{let e=this.#perf.now();if(this.ttlResolution>0){r=e;let t=setTimeout(()=>r=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=n=>{let a=this.#keyMap.get(n);if(a===void 0)return 0;let o=e[a],s=t[a];return!o||!s?1/0:o-((r||i())-s)},this.#isStale=n=>{let a=t[n],o=e[n];return!!o&&!!a&&(r||i())-a>o}}#updateItemAge=()=>{};#statusTTL=()=>{};#setItemTTL=()=>{};#isStale=()=>!1;#initializeSizeTracking(){let e=new ZeroArray(this.#max);this.#calculatedSize=0,this.#sizes=e,this.#removeItemSize=t=>{this.#calculatedSize-=e[t],e[t]=0},this.#requireSize=(e,t,n,r)=>{if(this.#isBackgroundFetch(t))return 0;if(!isPosInt(n))if(r){if(typeof r!=`function`)throw TypeError(`sizeCalculation must be a function`);if(n=r(t,e),!isPosInt(n))throw TypeError(`sizeCalculation return invalid (expect positive integer)`)}else throw TypeError(`invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.`);return n},this.#addItemSize=(t,n,r)=>{if(e[t]=n,this.#maxSize){let n=this.#maxSize-e[t];for(;this.#calculatedSize>n;)this.#evict(!0)}this.#calculatedSize+=e[t],r&&(r.entrySize=n,r.totalCalculatedSize=this.#calculatedSize)}}#removeItemSize=e=>{};#addItemSize=(e,t,n)=>{};#requireSize=(e,t,n,r)=>{if(n||r)throw TypeError(`cannot set size without setting maxSize or maxEntrySize on cache`);return 0};*#indexes({allowStale:e=this.allowStale}={}){if(this.#size)for(let t=this.#tail;!(!this.#isValidIndex(t)||((e||!this.#isStale(t))&&(yield t),t===this.#head));)t=this.#prev[t]}*#rindexes({allowStale:e=this.allowStale}={}){if(this.#size)for(let t=this.#head;!(!this.#isValidIndex(t)||((e||!this.#isStale(t))&&(yield t),t===this.#tail));)t=this.#next[t]}#isValidIndex(e){return e!==void 0&&this.#keyMap.get(this.#keyList[e])===e}*entries(){for(let e of this.#indexes())this.#valList[e]!==void 0&&this.#keyList[e]!==void 0&&!this.#isBackgroundFetch(this.#valList[e])&&(yield[this.#keyList[e],this.#valList[e]])}*rentries(){for(let e of this.#rindexes())this.#valList[e]!==void 0&&this.#keyList[e]!==void 0&&!this.#isBackgroundFetch(this.#valList[e])&&(yield[this.#keyList[e],this.#valList[e]])}*keys(){for(let e of this.#indexes()){let t=this.#keyList[e];t!==void 0&&!this.#isBackgroundFetch(this.#valList[e])&&(yield t)}}*rkeys(){for(let e of this.#rindexes()){let t=this.#keyList[e];t!==void 0&&!this.#isBackgroundFetch(this.#valList[e])&&(yield t)}}*values(){for(let e of this.#indexes())this.#valList[e]!==void 0&&!this.#isBackgroundFetch(this.#valList[e])&&(yield this.#valList[e])}*rvalues(){for(let e of this.#rindexes())this.#valList[e]!==void 0&&!this.#isBackgroundFetch(this.#valList[e])&&(yield this.#valList[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]=`LRUCache`;find(e,t={}){for(let n of this.#indexes()){let r=this.#valList[n],i=this.#isBackgroundFetch(r)?r.__staleWhileFetching:r;if(i!==void 0&&e(i,this.#keyList[n],this))return this.get(this.#keyList[n],t)}}forEach(e,t=this){for(let n of this.#indexes()){let r=this.#valList[n],i=this.#isBackgroundFetch(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#keyList[n],this)}}rforEach(e,t=this){for(let n of this.#rindexes()){let r=this.#valList[n],i=this.#isBackgroundFetch(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#keyList[n],this)}}purgeStale(){let e=!1;for(let t of this.#rindexes({allowStale:!0}))this.#isStale(t)&&(this.#delete(this.#keyList[t],`expire`),e=!0);return e}info(e){let t=this.#keyMap.get(e);if(t===void 0)return;let n=this.#valList[t],r=this.#isBackgroundFetch(n)?n.__staleWhileFetching:n;if(r===void 0)return;let i={value:r};if(this.#ttls&&this.#starts){let e=this.#ttls[t],n=this.#starts[t];e&&n&&(i.ttl=e-(this.#perf.now()-n),i.start=Date.now())}return this.#sizes&&(i.size=this.#sizes[t]),i}dump(){let e=[];for(let t of this.#indexes({allowStale:!0})){let n=this.#keyList[t],r=this.#valList[t],i=this.#isBackgroundFetch(r)?r.__staleWhileFetching:r;if(i===void 0||n===void 0)continue;let a={value:i};if(this.#ttls&&this.#starts){a.ttl=this.#ttls[t];let e=this.#perf.now()-this.#starts[t];a.start=Math.floor(Date.now()-e)}this.#sizes&&(a.size=this.#sizes[t]),e.unshift([n,a])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let e=Date.now()-n.start;n.start=this.#perf.now()-e}this.set(t,n.value,n)}}set(e,t,n={}){if(t===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:i,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:s}=n,{noUpdateTTL:c=this.noUpdateTTL}=n,l=this.#requireSize(e,t,n.size||0,o);if(this.maxEntrySize&&l>this.maxEntrySize)return s&&(s.set=`miss`,s.maxEntrySizeExceeded=!0),this.#delete(e,`set`),this;let u=this.#size===0?void 0:this.#keyMap.get(e);if(u===void 0)u=this.#size===0?this.#tail:this.#free.length===0?this.#size===this.#max?this.#evict(!1):this.#size:this.#free.pop(),this.#keyList[u]=e,this.#valList[u]=t,this.#keyMap.set(e,u),this.#next[this.#tail]=u,this.#prev[u]=this.#tail,this.#tail=u,this.#size++,this.#addItemSize(u,l,s),s&&(s.set=`add`),c=!1,this.#hasOnInsert&&this.#onInsert?.(t,e,`add`);else{this.#moveToTail(u);let n=this.#valList[u];if(t!==n){if(this.#hasFetchMethod&&this.#isBackgroundFetch(n)){n.__abortController.abort(Error(`replaced`));let{__staleWhileFetching:t}=n;t!==void 0&&!a&&(this.#hasDispose&&this.#dispose?.(t,e,`set`),this.#hasDisposeAfter&&this.#disposed?.push([t,e,`set`]))}else a||(this.#hasDispose&&this.#dispose?.(n,e,`set`),this.#hasDisposeAfter&&this.#disposed?.push([n,e,`set`]));if(this.#removeItemSize(u),this.#addItemSize(u,l,s),this.#valList[u]=t,s){s.set=`replace`;let e=n&&this.#isBackgroundFetch(n)?n.__staleWhileFetching:n;e!==void 0&&(s.oldValue=e)}}else s&&(s.set=`update`);this.#hasOnInsert&&this.onInsert?.(t,e,t===n?`update`:`replace`)}if(r!==0&&!this.#ttls&&this.#initializeTTLTracking(),this.#ttls&&(c||this.#setItemTTL(u,r,i),s&&this.#statusTTL(s,u)),!a&&this.#hasDisposeAfter&&this.#disposed){let e=this.#disposed,t;for(;t=e?.shift();)this.#disposeAfter?.(...t)}return this}pop(){try{for(;this.#size;){let e=this.#valList[this.#head];if(this.#evict(!0),this.#isBackgroundFetch(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#hasDisposeAfter&&this.#disposed){let e=this.#disposed,t;for(;t=e?.shift();)this.#disposeAfter?.(...t)}}}#evict(e){let t=this.#head,n=this.#keyList[t],r=this.#valList[t];return this.#hasFetchMethod&&this.#isBackgroundFetch(r)?r.__abortController.abort(Error(`evicted`)):(this.#hasDispose||this.#hasDisposeAfter)&&(this.#hasDispose&&this.#dispose?.(r,n,`evict`),this.#hasDisposeAfter&&this.#disposed?.push([r,n,`evict`])),this.#removeItemSize(t),this.#autopurgeTimers?.[t]&&(clearTimeout(this.#autopurgeTimers[t]),this.#autopurgeTimers[t]=void 0),e&&(this.#keyList[t]=void 0,this.#valList[t]=void 0,this.#free.push(t)),this.#size===1?(this.#head=this.#tail=0,this.#free.length=0):this.#head=this.#next[t],this.#keyMap.delete(n),this.#size--,t}has(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:r}=t,i=this.#keyMap.get(e);if(i!==void 0){let e=this.#valList[i];if(this.#isBackgroundFetch(e)&&e.__staleWhileFetching===void 0)return!1;if(this.#isStale(i))r&&(r.has=`stale`,this.#statusTTL(r,i));else return n&&this.#updateItemAge(i),r&&(r.has=`hit`,this.#statusTTL(r,i)),!0}else r&&(r.has=`miss`);return!1}peek(e,t={}){let{allowStale:n=this.allowStale}=t,r=this.#keyMap.get(e);if(r===void 0||!n&&this.#isStale(r))return;let i=this.#valList[r];return this.#isBackgroundFetch(i)?i.__staleWhileFetching:i}#backgroundFetch(e,t,n,r){let a=t===void 0?void 0:this.#valList[t];if(this.#isBackgroundFetch(a))return a;let o=new AC,{signal:s}=n;s?.addEventListener(`abort`,()=>o.abort(s.reason),{signal:o.signal});let c={signal:o.signal,options:n,context:r},l=(r,i=!1)=>{let{aborted:a}=o.signal,s=n.ignoreFetchAbort&&r!==void 0,l=n.ignoreFetchAbort||!!(n.allowStaleOnFetchAbort&&r!==void 0);if(n.status&&(a&&!i?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,s&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),a&&!s&&!i)return d(o.signal.reason,l);let u=p,f=this.#valList[t];return(f===p||s&&i&&f===void 0)&&(r===void 0?u.__staleWhileFetching===void 0?this.#delete(e,`fetch`):this.#valList[t]=u.__staleWhileFetching:(n.status&&(n.status.fetchUpdated=!0),this.set(e,r,c.options))),r},u=e=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),d(e,!1)),d=(r,i)=>{let{aborted:a}=o.signal,s=a&&n.allowStaleOnFetchAbort,c=s||n.allowStaleOnFetchRejection,l=c||n.noDeleteOnFetchRejection,u=p;if(this.#valList[t]===p&&(!l||!i&&u.__staleWhileFetching===void 0?this.#delete(e,`fetch`):s||(this.#valList[t]=u.__staleWhileFetching)),c)return n.status&&u.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),u.__staleWhileFetching;if(u.__returned===u)throw r},f=(t,r)=>{let i=this.#fetchMethod?.(e,a,c);i&&i instanceof Promise&&i.then(e=>t(e===void 0?void 0:e),r),o.signal.addEventListener(`abort`,()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(t(void 0),n.allowStaleOnFetchAbort&&(t=e=>l(e,!0)))})};n.status&&(n.status.fetchDispatched=!0);let p=new Promise(f).then(l,u),m=Object.assign(p,{__abortController:o,__staleWhileFetching:a,__returned:void 0});return t===void 0?(this.set(e,m,{...c.options,status:void 0}),t=this.#keyMap.get(e)):this.#valList[t]=m,m}#isBackgroundFetch(e){if(!this.#hasFetchMethod)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty(`__staleWhileFetching`)&&t.__abortController instanceof AC}async fetch(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:s=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:h=!1,status:g,signal:_}=t;if(!this.#hasFetchMethod)return g&&(g.fetch=`get`),this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:g});let v={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:a,noDisposeOnSet:o,size:s,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:p,ignoreFetchAbort:f,status:g,signal:_},y=this.#keyMap.get(e);if(y===void 0){g&&(g.fetch=`miss`);let t=this.#backgroundFetch(e,y,v,m);return t.__returned=t}else{let t=this.#valList[y];if(this.#isBackgroundFetch(t)){let e=n&&t.__staleWhileFetching!==void 0;return g&&(g.fetch=`inflight`,e&&(g.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}let i=this.#isStale(y);if(!h&&!i)return g&&(g.fetch=`hit`),this.#moveToTail(y),r&&this.#updateItemAge(y),g&&this.#statusTTL(g,y),t;let a=this.#backgroundFetch(e,y,v,m),o=a.__staleWhileFetching!==void 0&&n;return g&&(g.fetch=i?`stale`:`refresh`,o&&i&&(g.returnedStale=!0)),o?a.__staleWhileFetching:a.__returned=a}}async forceFetch(e,t={}){let n=await this.fetch(e,t);if(n===void 0)throw Error(`fetch() returned undefined`);return n}memo(e,t={}){let n=this.#memoMethod;if(!n)throw Error(`no memoMethod provided to constructor`);let{context:r,forceRefresh:i,...a}=t,o=this.get(e,a);if(!i&&o!==void 0)return o;let s=n(e,o,{options:a,context:r});return this.set(e,s,a),s}get(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:a}=t,o=this.#keyMap.get(e);if(o!==void 0){let t=this.#valList[o],s=this.#isBackgroundFetch(t);return a&&this.#statusTTL(a,o),this.#isStale(o)?(a&&(a.get=`stale`),s?(a&&n&&t.__staleWhileFetching!==void 0&&(a.returnedStale=!0),n?t.__staleWhileFetching:void 0):(i||this.#delete(e,`expire`),a&&n&&(a.returnedStale=!0),n?t:void 0)):(a&&(a.get=`hit`),s?t.__staleWhileFetching:(this.#moveToTail(o),r&&this.#updateItemAge(o),t))}else a&&(a.get=`miss`)}#connect(e,t){this.#prev[t]=e,this.#next[e]=t}#moveToTail(e){e!==this.#tail&&(e===this.#head?this.#head=this.#next[e]:this.#connect(this.#prev[e],this.#next[e]),this.#connect(this.#tail,e),this.#tail=e)}delete(e){return this.#delete(e,`delete`)}#delete(e,t){let n=!1;if(this.#size!==0){let r=this.#keyMap.get(e);if(r!==void 0)if(this.#autopurgeTimers?.[r]&&(clearTimeout(this.#autopurgeTimers?.[r]),this.#autopurgeTimers[r]=void 0),n=!0,this.#size===1)this.#clear(t);else{this.#removeItemSize(r);let n=this.#valList[r];if(this.#isBackgroundFetch(n)?n.__abortController.abort(Error(`deleted`)):(this.#hasDispose||this.#hasDisposeAfter)&&(this.#hasDispose&&this.#dispose?.(n,e,t),this.#hasDisposeAfter&&this.#disposed?.push([n,e,t])),this.#keyMap.delete(e),this.#keyList[r]=void 0,this.#valList[r]=void 0,r===this.#tail)this.#tail=this.#prev[r];else if(r===this.#head)this.#head=this.#next[r];else{let e=this.#prev[r];this.#next[e]=this.#next[r];let t=this.#next[r];this.#prev[t]=this.#prev[r]}this.#size--,this.#free.push(r)}}if(this.#hasDisposeAfter&&this.#disposed?.length){let e=this.#disposed,t;for(;t=e?.shift();)this.#disposeAfter?.(...t)}return n}clear(){return this.#clear(`delete`)}#clear(e){for(let t of this.#rindexes({allowStale:!0})){let n=this.#valList[t];if(this.#isBackgroundFetch(n))n.__abortController.abort(Error(`deleted`));else{let r=this.#keyList[t];this.#hasDispose&&this.#dispose?.(n,r,e),this.#hasDisposeAfter&&this.#disposed?.push([n,r,e])}}if(this.#keyMap.clear(),this.#valList.fill(void 0),this.#keyList.fill(void 0),this.#ttls&&this.#starts){this.#ttls.fill(0),this.#starts.fill(0);for(let e of this.#autopurgeTimers??[])e!==void 0&&clearTimeout(e);this.#autopurgeTimers?.fill(void 0)}if(this.#sizes&&this.#sizes.fill(0),this.#head=0,this.#tail=0,this.#free.length=0,this.#calculatedSize=0,this.#size=0,this.#hasDisposeAfter&&this.#disposed){let e=this.#disposed,t;for(;t=e?.shift();)this.#disposeAfter?.(...t)}}}exports.LRUCache=LRUCache;
@@ -1,3 +0,0 @@
1
- {
2
- "type": "commonjs"
3
- }