create-flink-app 0.13.0 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -280,4 +280,4 @@ var i=r(8709);var n=i.Buffer;function copyProps(e,t){for(var r in e){t[r]=e[r]}}
|
|
|
280
280
|
*
|
|
281
281
|
* Copyright (c) 2015-2017, Jon Schlinkert.
|
|
282
282
|
* Released under the MIT License.
|
|
283
|
-
*/e.exports=function base(e,t){if(!isObject(e)&&typeof e!=="function"){throw new TypeError("expected an object or function")}var r=isObject(t)?t:{};var i=typeof r.prop==="string"?r.prop:"fns";if(!Array.isArray(e[i])){define(e,i,[])}define(e,"use",use);define(e,"run",(function(t){if(!isObject(t))return;if(!t.use||!t.run){define(t,i,t[i]||[]);define(t,"use",use)}if(!t[i]||t[i].indexOf(base)===-1){t.use(base)}var r=this||e;var n=r[i];var s=n.length;var o=-1;while(++o<s){t.use(n[o])}return t}));function use(t,n,s){var o=1;if(typeof t==="string"||Array.isArray(t)){n=wrap(t,n);o++}else{s=n;n=t}if(typeof n!=="function"){throw new TypeError("expected a function")}var a=this||e;var c=a[i];var u=[].slice.call(arguments,o);u.unshift(a);if(typeof r.hook==="function"){r.hook.apply(a,u)}var l=n.apply(a,u);if(typeof l==="function"&&c.indexOf(l)===-1){c.push(l)}return a}function wrap(e,t){return function plugin(){return this.type===e?t.apply(this,arguments):plugin}}return e};function isObject(e){return e&&typeof e==="object"&&!Array.isArray(e)}function define(e,t,r){Object.defineProperty(e,t,{configurable:true,writable:true,value:r})}},238:(e,t,r)=>{"use strict";var i=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$");var n=r(3113);var s=["node_modules","favicon.ico"];var o=e.exports=function(e){var t=[];var r=[];if(e===null){r.push("name cannot be null");return done(t,r)}if(e===undefined){r.push("name cannot be undefined");return done(t,r)}if(typeof e!=="string"){r.push("name must be a string");return done(t,r)}if(!e.length){r.push("name length must be greater than zero")}if(e.match(/^\./)){r.push("name cannot start with a period")}if(e.match(/^_/)){r.push("name cannot start with an underscore")}if(e.trim()!==e){r.push("name cannot contain leading or trailing spaces")}s.forEach((function(t){if(e.toLowerCase()===t){r.push(t+" is a blacklisted name")}}));n.forEach((function(r){if(e.toLowerCase()===r){t.push(r+" is a core module name")}}));if(e.length>214){t.push("name can no longer contain more than 214 characters")}if(e.toLowerCase()!==e){t.push("name can no longer contain capital letters")}if(/[~'!()*]/.test(e.split("/").slice(-1)[0])){t.push('name can no longer contain special characters ("~\'!()*")')}if(encodeURIComponent(e)!==e){var o=e.match(i);if(o){var a=o[1];var c=o[2];if(encodeURIComponent(a)===a&&encodeURIComponent(c)===c){return done(t,r)}}r.push("name can only contain URL-friendly characters")}return done(t,r)};o.scopedPackagePattern=i;var done=function(e,t){var r={validForNewPackages:t.length===0&&e.length===0,validForOldPackages:t.length===0,warnings:e,errors:t};if(!r.warnings.length)delete r.warnings;if(!r.errors.length)delete r.errors;return r}},1834:(e,t,r)=>{e.exports=which;which.sync=whichSync;var i=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys";var n=r(1017);var s=i?";":":";var o=r(2284);function getNotFoundError(e){var t=new Error("not found: "+e);t.code="ENOENT";return t}function getPathInfo(e,t){var r=t.colon||s;var n=t.path||process.env.PATH||"";var o=[""];n=n.split(r);var a="";if(i){n.unshift(process.cwd());a=t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM";o=a.split(r);if(e.indexOf(".")!==-1&&o[0]!=="")o.unshift("")}if(e.match(/\//)||i&&e.match(/\\/))n=[""];return{env:n,ext:o,extExe:a}}function which(e,t,r){if(typeof t==="function"){r=t;t={}}var i=getPathInfo(e,t);var s=i.env;var a=i.ext;var c=i.extExe;var u=[];(function F(i,l){if(i===l){if(t.all&&u.length)return r(null,u);else return r(getNotFoundError(e))}var h=s[i];if(h.charAt(0)==='"'&&h.slice(-1)==='"')h=h.slice(1,-1);var p=n.join(h,e);if(!h&&/^\.[\\\/]/.test(e)){p=e.slice(0,2)+p}(function E(e,n){if(e===n)return F(i+1,l);var s=a[e];o(p+s,{pathExt:c},(function(i,o){if(!i&&o){if(t.all)u.push(p+s);else return r(null,p+s)}return E(e+1,n)}))})(0,a.length)})(0,s.length)}function whichSync(e,t){t=t||{};var r=getPathInfo(e,t);var i=r.env;var s=r.ext;var a=r.extExe;var c=[];for(var u=0,l=i.length;u<l;u++){var h=i[u];if(h.charAt(0)==='"'&&h.slice(-1)==='"')h=h.slice(1,-1);var p=n.join(h,e);if(!h&&/^\.[\\\/]/.test(e)){p=e.slice(0,2)+p}for(var d=0,g=s.length;d<g;d++){var v=p+s[d];var y;try{y=o.sync(v,{pathExt:a});if(y){if(t.all)c.push(v);else return v}}catch(e){}}}if(t.all&&c.length)return c;if(t.nothrow)return null;throw getNotFoundError(e)}},6010:e=>{e.exports=wrappy;function wrappy(e,t){if(e&&t)return wrappy(e)(t);if(typeof e!=="function")throw new TypeError("need wrapper function");Object.keys(e).forEach((function(t){wrapper[t]=e[t]}));return wrapper;function wrapper(){var t=new Array(arguments.length);for(var r=0;r<t.length;r++){t[r]=arguments[r]}var i=e.apply(this,t);var n=t[t.length-1];if(typeof i==="function"&&i!==n){Object.keys(n).forEach((function(e){i[e]=n[e]}))}return i}}},9491:e=>{"use strict";e.exports=require("assert")},8709:e=>{"use strict";e.exports=require("buffer")},2081:e=>{"use strict";e.exports=require("child_process")},2057:e=>{"use strict";e.exports=require("constants")},2361:e=>{"use strict";e.exports=require("events")},7147:e=>{"use strict";e.exports=require("fs")},3685:e=>{"use strict";e.exports=require("http")},5687:e=>{"use strict";e.exports=require("https")},1808:e=>{"use strict";e.exports=require("net")},2037:e=>{"use strict";e.exports=require("os")},1017:e=>{"use strict";e.exports=require("path")},4521:e=>{"use strict";e.exports=require("readline")},2781:e=>{"use strict";e.exports=require("stream")},6224:e=>{"use strict";e.exports=require("tty")},7310:e=>{"use strict";e.exports=require("url")},3837:e=>{"use strict";e.exports=require("util")},3113:e=>{"use strict";e.exports=JSON.parse('["assert","buffer","child_process","cluster","console","constants","crypto","dgram","dns","domain","events","fs","http","https","module","net","os","path","process","punycode","querystring","readline","repl","stream","string_decoder","timers","tls","tty","url","util","v8","vm","zlib"]')}};var t={};function __nccwpck_require__(r){var i=t[r];if(i!==undefined){return i.exports}var n=t[r]={id:r,loaded:false,exports:{}};var s=true;try{e[r].call(n.exports,n,n.exports,__nccwpck_require__);s=false}finally{if(s)delete t[r]}n.loaded=true;return n.exports}(()=>{__nccwpck_require__.n=e=>{var t=e&&e.__esModule?()=>e["default"]:()=>e;__nccwpck_require__.d(t,{a:t});return t}})();(()=>{var e=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;var t;__nccwpck_require__.t=function(r,i){if(i&1)r=this(r);if(i&8)return r;if(typeof r==="object"&&r){if(i&4&&r.__esModule)return r;if(i&16&&typeof r.then==="function")return r}var n=Object.create(null);__nccwpck_require__.r(n);var s={};t=t||[null,e({}),e([]),e(e)];for(var o=i&2&&r;typeof o=="object"&&!~t.indexOf(o);o=e(o)){Object.getOwnPropertyNames(o).forEach((e=>s[e]=()=>r[e]))}s["default"]=()=>r;__nccwpck_require__.d(n,s);return n}})();(()=>{__nccwpck_require__.d=(e,t)=>{for(var r in t){if(__nccwpck_require__.o(t,r)&&!__nccwpck_require__.o(e,r)){Object.defineProperty(e,r,{enumerable:true,get:t[r]})}}}})();(()=>{__nccwpck_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})();(()=>{__nccwpck_require__.r=e=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})}})();(()=>{__nccwpck_require__.nmd=e=>{e.paths=[];if(!e.children)e.children=[];return e}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r={};(()=>{"use strict";__nccwpck_require__.r(r);var e={};__nccwpck_require__.r(e);var t=__nccwpck_require__(1294);var i=__nccwpck_require__.n(t);var n=__nccwpck_require__(9468);var s=__nccwpck_require__.n(n);var o=__nccwpck_require__(1017);var a=__nccwpck_require__.n(o);var c=__nccwpck_require__(485);var u=__nccwpck_require__.n(c);var l=__nccwpck_require__(4531);var h=__nccwpck_require__.n(l);var p=__nccwpck_require__(8599);var d=__nccwpck_require__.n(p);var g=__nccwpck_require__(7147);var v=__nccwpck_require__.n(g);var y=__nccwpck_require__(2037);var b=__nccwpck_require__.n(y);var w=__nccwpck_require__(2081);const balanced=(e,t,r)=>{const i=e instanceof RegExp?maybeMatch(e,r):e;const n=t instanceof RegExp?maybeMatch(t,r):t;const s=i!==null&&n!=null&&range(i,n,r);return s&&{start:s[0],end:s[1],pre:r.slice(0,s[0]),body:r.slice(s[0]+i.length,s[1]),post:r.slice(s[1]+n.length)}};const maybeMatch=(e,t)=>{const r=t.match(e);return r?r[0]:null};const range=(e,t,r)=>{let i,n,s,o=undefined,a;let c=r.indexOf(e);let u=r.indexOf(t,c+1);let l=c;if(c>=0&&u>0){if(e===t){return[c,u]}i=[];s=r.length;while(l>=0&&!a){if(l===c){i.push(l);c=r.indexOf(e,l+1)}else if(i.length===1){const e=i.pop();if(e!==undefined)a=[e,u]}else{n=i.pop();if(n!==undefined&&n<s){s=n;o=u}u=r.indexOf(t,l+1)}l=c<u&&c>=0?c:u}if(i.length&&o!==undefined){a=[s,o]}}return a};const S="\0SLASH"+Math.random()+"\0";const x="\0OPEN"+Math.random()+"\0";const _="\0CLOSE"+Math.random()+"\0";const k="\0COMMA"+Math.random()+"\0";const O="\0PERIOD"+Math.random()+"\0";const A=new RegExp(S,"g");const C=new RegExp(x,"g");const P=new RegExp(_,"g");const M=new RegExp(k,"g");const R=new RegExp(O,"g");const j=/\\\\/g;const T=/\\{/g;const N=/\\}/g;const I=/\\,/g;const L=/\\./g;function numeric(e){return!isNaN(e)?parseInt(e,10):e.charCodeAt(0)}function escapeBraces(e){return e.replace(j,S).replace(T,x).replace(N,_).replace(I,k).replace(L,O)}function unescapeBraces(e){return e.replace(A,"\\").replace(C,"{").replace(P,"}").replace(M,",").replace(R,".")}function parseCommaParts(e){if(!e){return[""]}const t=[];const r=balanced("{","}",e);if(!r){return e.split(",")}const{pre:i,body:n,post:s}=r;const o=i.split(",");o[o.length-1]+="{"+n+"}";const a=parseCommaParts(s);if(s.length){o[o.length-1]+=a.shift();o.push.apply(o,a)}t.push.apply(t,o);return t}function expand(e){if(!e){return[]}if(e.slice(0,2)==="{}"){e="\\{\\}"+e.slice(2)}return expand_(escapeBraces(e),true).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_(e,t){const r=[];const i=balanced("{","}",e);if(!i)return[e];const n=i.pre;const s=i.post.length?expand_(i.post,false):[""];if(/\$$/.test(i.pre)){for(let e=0;e<s.length;e++){const t=n+"{"+i.body+"}"+s[e];r.push(t)}}else{const o=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body);const a=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body);const c=o||a;const u=i.body.indexOf(",")>=0;if(!c&&!u){if(i.post.match(/,(?!,).*\}/)){e=i.pre+"{"+i.body+_+i.post;return expand_(e)}return[e]}let l;if(c){l=i.body.split(/\.\./)}else{l=parseCommaParts(i.body);if(l.length===1&&l[0]!==undefined){l=expand_(l[0],false).map(embrace);if(l.length===1){return s.map((e=>i.pre+l[0]+e))}}}let h;if(c&&l[0]!==undefined&&l[1]!==undefined){const e=numeric(l[0]);const t=numeric(l[1]);const r=Math.max(l[0].length,l[1].length);let i=l.length===3&&l[2]!==undefined?Math.abs(numeric(l[2])):1;let n=lte;const s=t<e;if(s){i*=-1;n=gte}const o=l.some(isPadded);h=[];for(let s=e;n(s,t);s+=i){let e;if(a){e=String.fromCharCode(s);if(e==="\\"){e=""}}else{e=String(s);if(o){const t=r-e.length;if(t>0){const r=new Array(t+1).join("0");if(s<0){e="-"+r+e.slice(1)}else{e=r+e}}}}h.push(e)}}else{h=[];for(let e=0;e<l.length;e++){h.push.apply(h,expand_(l[e],false))}}for(let e=0;e<h.length;e++){for(let i=0;i<s.length;i++){const o=n+h[e]+s[i];if(!t||c||o){r.push(o)}}}}return r}const $=1024*64;const assertValidPattern=e=>{if(typeof e!=="string"){throw new TypeError("invalid pattern")}if(e.length>$){throw new TypeError("pattern is too long")}};const D={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",true],"[:alpha:]":["\\p{L}\\p{Nl}",true],"[:ascii:]":["\\x"+"00-\\x"+"7f",false],"[:blank:]":["\\p{Zs}\\t",true],"[:cntrl:]":["\\p{Cc}",true],"[:digit:]":["\\p{Nd}",true],"[:graph:]":["\\p{Z}\\p{C}",true,true],"[:lower:]":["\\p{Ll}",true],"[:print:]":["\\p{C}",true],"[:punct:]":["\\p{P}",true],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",true],"[:upper:]":["\\p{Lu}",true],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",true],"[:xdigit:]":["A-Fa-f0-9",false]};const braceEscape=e=>e.replace(/[[\]\\-]/g,"\\$&");const regexpEscape=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");const rangesToString=e=>e.join("");const parseClass=(e,t)=>{const r=t;if(e.charAt(r)!=="["){throw new Error("not in a brace expression")}const i=[];const n=[];let s=r+1;let o=false;let a=false;let c=false;let u=false;let l=r;let h="";e:while(s<e.length){const t=e.charAt(s);if((t==="!"||t==="^")&&s===r+1){u=true;s++;continue}if(t==="]"&&o&&!c){l=s+1;break}o=true;if(t==="\\"){if(!c){c=true;s++;continue}}if(t==="["&&!c){for(const[t,[o,c,u]]of Object.entries(D)){if(e.startsWith(t,s)){if(h){return["$.",false,e.length-r,true]}s+=t.length;if(u)n.push(o);else i.push(o);a=a||c;continue e}}}c=false;if(h){if(t>h){i.push(braceEscape(h)+"-"+braceEscape(t))}else if(t===h){i.push(braceEscape(t))}h="";s++;continue}if(e.startsWith("-]",s+1)){i.push(braceEscape(t+"-"));s+=2;continue}if(e.startsWith("-",s+1)){h=t;s+=2;continue}i.push(braceEscape(t));s++}if(l<s){return["",false,0,false]}if(!i.length&&!n.length){return["$.",false,e.length-r,true]}if(n.length===0&&i.length===1&&/^\\?.$/.test(i[0])&&!u){const e=i[0].length===2?i[0].slice(-1):i[0];return[regexpEscape(e),false,l-r,false]}const p="["+(u?"^":"")+rangesToString(i)+"]";const d="["+(u?"":"^")+rangesToString(n)+"]";const g=i.length&&n.length?"("+p+"|"+d+")":i.length?p:d;return[g,a,l-r,true]};const unescape_unescape=(e,{windowsPathsNoEscape:t=false,magicalBraces:r=true}={})=>{if(r){return t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")}return t?e.replace(/\[([^\/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1")};const B=new Set(["!","?","+","*","@"]);const isExtglobType=e=>B.has(e);const G="(?!(?:^|/)\\.\\.?(?:$|/))";const z="(?!\\.)";const W=new Set(["[","."]);const q=new Set(["..","."]);const U=new Set("().*{}+?[]^$\\!");const regExpEscape=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");const V="[^/]";const H=V+"*?";const Y=V+"+?";class AST{type;#e;#t;#r=false;#i=[];#n;#s;#o;#a=false;#c;#u;#l=false;constructor(e,t,r={}){this.type=e;if(e)this.#t=true;this.#n=t;this.#e=this.#n?this.#n.#e:this;this.#c=this.#e===this?r:this.#e.#c;this.#o=this.#e===this?[]:this.#e.#o;if(e==="!"&&!this.#e.#a)this.#o.push(this);this.#s=this.#n?this.#n.#i.length:0}get hasMagic(){if(this.#t!==undefined)return this.#t;for(const e of this.#i){if(typeof e==="string")continue;if(e.type||e.hasMagic)return this.#t=true}return this.#t}toString(){if(this.#u!==undefined)return this.#u;if(!this.type){return this.#u=this.#i.map((e=>String(e))).join("")}else{return this.#u=this.type+"("+this.#i.map((e=>String(e))).join("|")+")"}}#h(){if(this!==this.#e)throw new Error("should only call on root");if(this.#a)return this;this.toString();this.#a=true;let e;while(e=this.#o.pop()){if(e.type!=="!")continue;let t=e;let r=t.#n;while(r){for(let i=t.#s+1;!r.type&&i<r.#i.length;i++){for(const t of e.#i){if(typeof t==="string"){throw new Error("string part in extglob AST??")}t.copyIn(r.#i[i])}}t=r;r=t.#n}}return this}push(...e){for(const t of e){if(t==="")continue;if(typeof t!=="string"&&!(t instanceof AST&&t.#n===this)){throw new Error("invalid part: "+t)}this.#i.push(t)}}toJSON(){const e=this.type===null?this.#i.slice().map((e=>typeof e==="string"?e:e.toJSON())):[this.type,...this.#i.map((e=>e.toJSON()))];if(this.isStart()&&!this.type)e.unshift([]);if(this.isEnd()&&(this===this.#e||this.#e.#a&&this.#n?.type==="!")){e.push({})}return e}isStart(){if(this.#e===this)return true;if(!this.#n?.isStart())return false;if(this.#s===0)return true;const e=this.#n;for(let t=0;t<this.#s;t++){const r=e.#i[t];if(!(r instanceof AST&&r.type==="!")){return false}}return true}isEnd(){if(this.#e===this)return true;if(this.#n?.type==="!")return true;if(!this.#n?.isEnd())return false;if(!this.type)return this.#n?.isEnd();const e=this.#n?this.#n.#i.length:0;return this.#s===e-1}copyIn(e){if(typeof e==="string")this.push(e);else this.push(e.clone(this))}clone(e){const t=new AST(this.type,e);for(const e of this.#i){t.copyIn(e)}return t}static#f(e,t,r,i){let n=false;let s=false;let o=-1;let a=false;if(t.type===null){let c=r;let u="";while(c<e.length){const r=e.charAt(c++);if(n||r==="\\"){n=!n;u+=r;continue}if(s){if(c===o+1){if(r==="^"||r==="!"){a=true}}else if(r==="]"&&!(c===o+2&&a)){s=false}u+=r;continue}else if(r==="["){s=true;o=c;a=false;u+=r;continue}if(!i.noext&&isExtglobType(r)&&e.charAt(c)==="("){t.push(u);u="";const n=new AST(r,t);c=AST.#f(e,n,c,i);t.push(n);continue}u+=r}t.push(u);return c}let c=r+1;let u=new AST(null,t);const l=[];let h="";while(c<e.length){const r=e.charAt(c++);if(n||r==="\\"){n=!n;h+=r;continue}if(s){if(c===o+1){if(r==="^"||r==="!"){a=true}}else if(r==="]"&&!(c===o+2&&a)){s=false}h+=r;continue}else if(r==="["){s=true;o=c;a=false;h+=r;continue}if(isExtglobType(r)&&e.charAt(c)==="("){u.push(h);h="";const t=new AST(r,u);u.push(t);c=AST.#f(e,t,c,i);continue}if(r==="|"){u.push(h);h="";l.push(u);u=new AST(null,t);continue}if(r===")"){if(h===""&&t.#i.length===0){t.#l=true}u.push(h);h="";t.push(...l,u);return c}h+=r}t.type=null;t.#t=undefined;t.#i=[e.substring(r-1)];return c}static fromGlob(e,t={}){const r=new AST(null,undefined,t);AST.#f(e,r,0,t);return r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();const e=this.toString();const[t,r,i,n]=this.toRegExpSource();const s=i||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase();if(!s){return r}const o=(this.#c.nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${t}$`,o),{_src:t,_glob:e})}get options(){return this.#c}toRegExpSource(e){const t=e??!!this.#c.dot;if(this.#e===this)this.#h();if(!this.type){const r=this.isStart()&&this.isEnd()&&!this.#i.some((e=>typeof e!=="string"));const i=this.#i.map((t=>{const[i,n,s,o]=typeof t==="string"?AST.#p(t,this.#t,r):t.toRegExpSource(e);this.#t=this.#t||s;this.#r=this.#r||o;return i})).join("");let n="";if(this.isStart()){if(typeof this.#i[0]==="string"){const r=this.#i.length===1&&q.has(this.#i[0]);if(!r){const r=W;const s=t&&r.has(i.charAt(0))||i.startsWith("\\.")&&r.has(i.charAt(2))||i.startsWith("\\.\\.")&&r.has(i.charAt(4));const o=!t&&!e&&r.has(i.charAt(0));n=s?G:o?z:""}}}let s="";if(this.isEnd()&&this.#e.#a&&this.#n?.type==="!"){s="(?:$|\\/)"}const o=n+i+s;return[o,unescape_unescape(i),this.#t=!!this.#t,this.#r]}const r=this.type==="*"||this.type==="+";const i=this.type==="!"?"(?:(?!(?:":"(?:";let n=this.#d(t);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){const e=this.toString();this.#i=[e];this.type=null;this.#t=undefined;return[e,unescape_unescape(this.toString()),false,false]}let s=!r||e||t||!z?"":this.#d(true);if(s===n){s=""}if(s){n=`(?:${n})(?:${s})*?`}let o="";if(this.type==="!"&&this.#l){o=(this.isStart()&&!t?z:"")+Y}else{const r=this.type==="!"?"))"+(this.isStart()&&!t&&!e?z:"")+H+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&s?")":this.type==="*"&&s?`)?`:`)${this.type}`;o=i+n+r}return[o,unescape_unescape(n),this.#t=!!this.#t,this.#r]}#d(e){return this.#i.map((t=>{if(typeof t==="string"){throw new Error("string type in extglob ast??")}const[r,i,n,s]=t.toRegExpSource(e);this.#r=this.#r||s;return r})).filter((e=>!(this.isStart()&&this.isEnd())||!!e)).join("|")}static#p(e,t,r=false){let i=false;let n="";let s=false;for(let o=0;o<e.length;o++){const a=e.charAt(o);if(i){i=false;n+=(U.has(a)?"\\":"")+a;continue}if(a==="\\"){if(o===e.length-1){n+="\\\\"}else{i=true}continue}if(a==="["){const[r,i,a,c]=parseClass(e,o);if(a){n+=r;s=s||i;o+=a-1;t=t||c;continue}}if(a==="*"){n+=r&&e==="*"?Y:H;t=true;continue}if(a==="?"){n+=V;t=true;continue}n+=regExpEscape(a)}return[n,unescape_unescape(e),!!t,s]}}const escape_escape=(e,{windowsPathsNoEscape:t=false,magicalBraces:r=false}={})=>{if(r){return t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&")}return t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&")};const minimatch=(e,t,r={})=>{assertValidPattern(t);if(!r.nocomment&&t.charAt(0)==="#"){return false}return new Minimatch(t,r).match(e)};const Q=/^\*+([^+@!?\*\[\(]*)$/;const starDotExtTest=e=>t=>!t.startsWith(".")&&t.endsWith(e);const starDotExtTestDot=e=>t=>t.endsWith(e);const starDotExtTestNocase=e=>{e=e.toLowerCase();return t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)};const starDotExtTestNocaseDot=e=>{e=e.toLowerCase();return t=>t.toLowerCase().endsWith(e)};const J=/^\*+\.\*+$/;const starDotStarTest=e=>!e.startsWith(".")&&e.includes(".");const starDotStarTestDot=e=>e!=="."&&e!==".."&&e.includes(".");const K=/^\.\*+$/;const dotStarTest=e=>e!=="."&&e!==".."&&e.startsWith(".");const Z=/^\*+$/;const starTest=e=>e.length!==0&&!e.startsWith(".");const starTestDot=e=>e.length!==0&&e!=="."&&e!=="..";const X=/^\?+([^+@!?\*\[\(]*)?$/;const qmarksTestNocase=([e,t=""])=>{const r=qmarksTestNoExt([e]);if(!t)return r;t=t.toLowerCase();return e=>r(e)&&e.toLowerCase().endsWith(t)};const qmarksTestNocaseDot=([e,t=""])=>{const r=qmarksTestNoExtDot([e]);if(!t)return r;t=t.toLowerCase();return e=>r(e)&&e.toLowerCase().endsWith(t)};const qmarksTestDot=([e,t=""])=>{const r=qmarksTestNoExtDot([e]);return!t?r:e=>r(e)&&e.endsWith(t)};const qmarksTest=([e,t=""])=>{const r=qmarksTestNoExt([e]);return!t?r:e=>r(e)&&e.endsWith(t)};const qmarksTestNoExt=([e])=>{const t=e.length;return e=>e.length===t&&!e.startsWith(".")};const qmarksTestNoExtDot=([e])=>{const t=e.length;return e=>e.length===t&&e!=="."&&e!==".."};const ee=typeof process==="object"&&process?typeof process.env==="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix";const te={win32:{sep:"\\"},posix:{sep:"/"}};const re=ee==="win32"?te.win32.sep:te.posix.sep;minimatch.sep=re;const ie=Symbol("globstar **");minimatch.GLOBSTAR=ie;const ne="[^/]";const se=ne+"*?";const oe="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";const ae="(?:(?!(?:\\/|^)\\.).)*?";const filter=(e,t={})=>r=>minimatch(r,e,t);minimatch.filter=filter;const ext=(e,t={})=>Object.assign({},e,t);const defaults=e=>{if(!e||typeof e!=="object"||!Object.keys(e).length){return minimatch}const t=minimatch;const m=(r,i,n={})=>t(r,i,ext(e,n));return Object.assign(m,{Minimatch:class Minimatch extends t.Minimatch{constructor(t,r={}){super(t,ext(e,r))}static defaults(r){return t.defaults(ext(e,r)).Minimatch}},AST:class AST extends t.AST{constructor(t,r,i={}){super(t,r,ext(e,i))}static fromGlob(r,i={}){return t.AST.fromGlob(r,ext(e,i))}},unescape:(r,i={})=>t.unescape(r,ext(e,i)),escape:(r,i={})=>t.escape(r,ext(e,i)),filter:(r,i={})=>t.filter(r,ext(e,i)),defaults:r=>t.defaults(ext(e,r)),makeRe:(r,i={})=>t.makeRe(r,ext(e,i)),braceExpand:(r,i={})=>t.braceExpand(r,ext(e,i)),match:(r,i,n={})=>t.match(r,i,ext(e,n)),sep:t.sep,GLOBSTAR:ie})};minimatch.defaults=defaults;const braceExpand=(e,t={})=>{assertValidPattern(e);if(t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)){return[e]}return expand(e)};minimatch.braceExpand=braceExpand;const makeRe=(e,t={})=>new Minimatch(e,t).makeRe();minimatch.makeRe=makeRe;const match=(e,t,r={})=>{const i=new Minimatch(t,r);e=e.filter((e=>i.match(e)));if(i.options.nonull&&!e.length){e.push(t)}return e};minimatch.match=match;const ce=/[?*]|[+@!]\(.*?\)|\[|\]/;const esm_regExpEscape=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class Minimatch{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,t={}){assertValidPattern(e);t=t||{};this.options=t;this.pattern=e;this.platform=t.platform||ee;this.isWindows=this.platform==="win32";this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===false;if(this.windowsPathsNoEscape){this.pattern=this.pattern.replace(/\\/g,"/")}this.preserveMultipleSlashes=!!t.preserveMultipleSlashes;this.regexp=null;this.negate=false;this.nonegate=!!t.nonegate;this.comment=false;this.empty=false;this.partial=!!t.partial;this.nocase=!!this.options.nocase;this.windowsNoMagicRoot=t.windowsNoMagicRoot!==undefined?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase);this.globSet=[];this.globParts=[];this.set=[];this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1){return true}for(const e of this.set){for(const t of e){if(typeof t!=="string")return true}}return false}debug(...e){}make(){const e=this.pattern;const t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=true;return}if(!e){this.empty=true;return}this.parseNegate();this.globSet=[...new Set(this.braceExpand())];if(t.debug){this.debug=(...e)=>console.error(...e)}this.debug(this.pattern,this.globSet);const r=this.globSet.map((e=>this.slashSplit(e)));this.globParts=this.preprocess(r);this.debug(this.pattern,this.globParts);let i=this.globParts.map(((e,t,r)=>{if(this.isWindows&&this.windowsNoMagicRoot){const t=e[0]===""&&e[1]===""&&(e[2]==="?"||!ce.test(e[2]))&&!ce.test(e[3]);const r=/^[a-z]:/i.test(e[0]);if(t){return[...e.slice(0,4),...e.slice(4).map((e=>this.parse(e)))]}else if(r){return[e[0],...e.slice(1).map((e=>this.parse(e)))]}}return e.map((e=>this.parse(e)))}));this.debug(this.pattern,i);this.set=i.filter((e=>e.indexOf(false)===-1));if(this.isWindows){for(let e=0;e<this.set.length;e++){const t=this.set[e];if(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 r=0;r<e[t].length;r++){if(e[t][r]==="**"){e[t][r]="*"}}}}const{optimizationLevel:t=1}=this.options;if(t>=2){e=this.firstPhasePreProcess(e);e=this.secondPhasePreProcess(e)}else if(t>=1){e=this.levelOneOptimize(e)}else{e=this.adjascentGlobstarOptimize(e)}return e}adjascentGlobstarOptimize(e){return e.map((e=>{let t=-1;while(-1!==(t=e.indexOf("**",t+1))){let r=t;while(e[r+1]==="**"){r++}if(r!==t){e.splice(t,r-t)}}return e}))}levelOneOptimize(e){return e.map((e=>{e=e.reduce(((e,t)=>{const r=e[e.length-1];if(t==="**"&&r==="**"){return e}if(t===".."){if(r&&r!==".."&&r!=="."&&r!=="**"){e.pop();return e}}e.push(t);return e}),[]);return e.length===0?[""]:e}))}levelTwoFileOptimize(e){if(!Array.isArray(e)){e=this.slashSplit(e)}let t=false;do{t=false;if(!this.preserveMultipleSlashes){for(let r=1;r<e.length-1;r++){const i=e[r];if(r===1&&i===""&&e[0]==="")continue;if(i==="."||i===""){t=true;e.splice(r,1);r--}}if(e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")){t=true;e.pop()}}let r=0;while(-1!==(r=e.indexOf("..",r+1))){const i=e[r-1];if(i&&i!=="."&&i!==".."&&i!=="**"){t=true;e.splice(r-1,2);r-=2}}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=false;do{t=false;for(let r of e){let i=-1;while(-1!==(i=r.indexOf("**",i+1))){let n=i;while(r[n+1]==="**"){n++}if(n>i){r.splice(i+1,n-i)}let s=r[i+1];const o=r[i+2];const a=r[i+3];if(s!=="..")continue;if(!o||o==="."||o===".."||!a||a==="."||a===".."){continue}t=true;r.splice(i,1);const c=r.slice(0);c[i]="**";e.push(c);i--}if(!this.preserveMultipleSlashes){for(let e=1;e<r.length-1;e++){const i=r[e];if(e===1&&i===""&&r[0]==="")continue;if(i==="."||i===""){t=true;r.splice(e,1);e--}}if(r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")){t=true;r.pop()}}let n=0;while(-1!==(n=r.indexOf("..",n+1))){const e=r[n-1];if(e&&e!=="."&&e!==".."&&e!=="**"){t=true;const e=n===1&&r[n+1]==="**";const i=e?["."]:[];r.splice(n-1,2,...i);if(r.length===0)r.push("");n-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++){for(let r=t+1;r<e.length;r++){const i=this.partsMatch(e[t],e[r],!this.preserveMultipleSlashes);if(i){e[t]=[];e[r]=i;break}}}return e.filter((e=>e.length))}partsMatch(e,t,r=false){let i=0;let n=0;let s=[];let o="";while(i<e.length&&n<t.length){if(e[i]===t[n]){s.push(o==="b"?t[n]:e[i]);i++;n++}else if(r&&e[i]==="**"&&t[n]===e[i+1]){s.push(e[i]);i++}else if(r&&t[n]==="**"&&e[i]===t[n+1]){s.push(t[n]);n++}else if(e[i]==="*"&&t[n]&&(this.options.dot||!t[n].startsWith("."))&&t[n]!=="**"){if(o==="b")return false;o="a";s.push(e[i]);i++;n++}else if(t[n]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(o==="a")return false;o="b";s.push(t[n]);i++;n++}else{return false}}return e.length===t.length&&s}parseNegate(){if(this.nonegate)return;const e=this.pattern;let t=false;let r=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++){t=!t;r++}if(r)this.pattern=e.slice(r);this.negate=t}matchOne(e,t,r=false){const i=this.options;if(this.isWindows){const r=typeof e[0]==="string"&&/^[a-z]:$/i.test(e[0]);const i=!r&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]);const n=typeof t[0]==="string"&&/^[a-z]:$/i.test(t[0]);const s=!n&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]==="string"&&/^[a-z]:$/i.test(t[3]);const o=i?3:r?0:undefined;const a=s?3:n?0:undefined;if(typeof o==="number"&&typeof a==="number"){const[r,i]=[e[o],t[a]];if(r.toLowerCase()===i.toLowerCase()){t[a]=r;if(a>o){t=t.slice(a)}else if(o>a){e=e.slice(o)}}}}const{optimizationLevel:n=1}=this.options;if(n>=2){e=this.levelTwoFileOptimize(e)}this.debug("matchOne",this,{file:e,pattern:t});this.debug("matchOne",e.length,t.length);for(var s=0,o=0,a=e.length,c=t.length;s<a&&o<c;s++,o++){this.debug("matchOne loop");var u=t[o];var l=e[s];this.debug(t,u,l);if(u===false){return false}if(u===ie){this.debug("GLOBSTAR",[t,u,l]);var h=s;var p=o+1;if(p===c){this.debug("** at the end");for(;s<a;s++){if(e[s]==="."||e[s]===".."||!i.dot&&e[s].charAt(0)===".")return false}return true}while(h<a){var d=e[h];this.debug("\nglobstar while",e,h,t,p,d);if(this.matchOne(e.slice(h),t.slice(p),r)){this.debug("globstar found match!",h,a,d);return true}else{if(d==="."||d===".."||!i.dot&&d.charAt(0)==="."){this.debug("dot detected!",e,h,t,p);break}this.debug("globstar swallow a segment, and continue");h++}}if(r){this.debug("\n>>> no match, partial?",e,h,t,p);if(h===a){return true}}return false}let n;if(typeof u==="string"){n=l===u;this.debug("string match",u,l,n)}else{n=u.test(l);this.debug("pattern match",u,l,n)}if(!n)return false}if(s===a&&o===c){return true}else if(s===a){return r}else if(o===c){return s===a-1&&e[s]===""}else{throw new Error("wtf?")}}braceExpand(){return braceExpand(this.pattern,this.options)}parse(e){assertValidPattern(e);const t=this.options;if(e==="**")return ie;if(e==="")return"";let r;let i=null;if(r=e.match(Z)){i=t.dot?starTestDot:starTest}else if(r=e.match(Q)){i=(t.nocase?t.dot?starDotExtTestNocaseDot:starDotExtTestNocase:t.dot?starDotExtTestDot:starDotExtTest)(r[1])}else if(r=e.match(X)){i=(t.nocase?t.dot?qmarksTestNocaseDot:qmarksTestNocase:t.dot?qmarksTestDot:qmarksTest)(r)}else if(r=e.match(J)){i=t.dot?starDotStarTestDot:starDotStarTest}else if(r=e.match(K)){i=dotStarTest}const n=AST.fromGlob(e,this.options).toMMPattern();if(i&&typeof n==="object"){Reflect.defineProperty(n,"test",{value:i})}return n}makeRe(){if(this.regexp||this.regexp===false)return this.regexp;const e=this.set;if(!e.length){this.regexp=false;return this.regexp}const t=this.options;const r=t.noglobstar?se:t.dot?oe:ae;const i=new Set(t.nocase?["i"]:[]);let n=e.map((e=>{const t=e.map((e=>{if(e instanceof RegExp){for(const t of e.flags.split(""))i.add(t)}return typeof e==="string"?esm_regExpEscape(e):e===ie?ie:e._src}));t.forEach(((e,i)=>{const n=t[i+1];const s=t[i-1];if(e!==ie||s===ie){return}if(s===undefined){if(n!==undefined&&n!==ie){t[i+1]="(?:\\/|"+r+"\\/)?"+n}else{t[i]=r}}else if(n===undefined){t[i-1]=s+"(?:\\/|\\/"+r+")?"}else if(n!==ie){t[i-1]=s+"(?:\\/|\\/"+r+"\\/)"+n;t[i+1]=ie}}));const n=t.filter((e=>e!==ie));if(this.partial&&n.length>=1){const e=[];for(let t=1;t<=n.length;t++){e.push(n.slice(0,t).join("/"))}return"(?:"+e.join("|")+")"}return n.join("/")})).join("|");const[s,o]=e.length>1?["(?:",")"]:["",""];n="^"+s+n+o+"$";if(this.partial){n="^(?:\\/|"+s+n.slice(1,-1)+o+")$"}if(this.negate)n="^(?!"+n+").+$";try{this.regexp=new RegExp(n,[...i].join(""))}catch(e){this.regexp=false}return this.regexp}slashSplit(e){if(this.preserveMultipleSlashes){return e.split("/")}else if(this.isWindows&&/^\/\/[^\/]+/.test(e)){return["",...e.split(/\/+/)]}else{return e.split(/\/+/)}}match(e,t=this.partial){this.debug("match",e,this.pattern);if(this.comment){return false}if(this.empty){return e===""}if(e==="/"&&t){return true}const r=this.options;if(this.isWindows){e=e.split("\\").join("/")}const i=this.slashSplit(e);this.debug(this.pattern,"split",i);const n=this.set;this.debug(this.pattern,"set",n);let s=i[i.length-1];if(!s){for(let e=i.length-2;!s&&e>=0;e--){s=i[e]}}for(let e=0;e<n.length;e++){const o=n[e];let a=i;if(r.matchBase&&o.length===1){a=[s]}const c=this.matchOne(a,o,t);if(c){if(r.flipNegate){return true}return!this.negate}}if(r.flipNegate){return false}return this.negate}static defaults(e){return minimatch.defaults(e).Minimatch}}minimatch.AST=AST;minimatch.Minimatch=Minimatch;minimatch.escape=escape_escape;minimatch.unescape=unescape_unescape;const ue=require("node:url");const le=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date;const he=new Set;const fe=typeof process==="object"&&!!process?process:{};const emitWarning=(e,t,r,i)=>{typeof fe.emitWarning==="function"?fe.emitWarning(e,t,r,i):console.error(`[${r}] ${t}: ${e}`)};let pe=globalThis.AbortController;let de=globalThis.AbortSignal;if(typeof pe==="undefined"){de=class AbortSignal{onabort;_onabort=[];reason;aborted=false;addEventListener(e,t){this._onabort.push(t)}};pe=class AbortController{constructor(){warnACPolyfill()}signal=new de;abort(e){if(this.signal.aborted)return;this.signal.reason=e;this.signal.aborted=true;for(const t of this.signal._onabort){t(e)}this.signal.onabort?.(e)}};let e=fe.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1";const warnACPolyfill=()=>{if(!e)return;e=false;emitWarning("AbortController is not defined. If using lru-cache in "+"node 14, load an AbortController polyfill from the "+"`node-abort-controller` package. A minimal polyfill is "+"provided for use by LRUCache.fetch(), but it should not be "+"relied upon in other contexts (eg, passing it to other APIs that "+"use AbortController/AbortSignal might have undesirable effects). "+"You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",warnACPolyfill)}}const shouldWarn=e=>!he.has(e);const me=Symbol("type");const isPosInt=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e);const getUintArray=e=>!isPosInt(e)?null:e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?ZeroArray:null;class ZeroArray extends Array{constructor(e){super(e);this.fill(0)}}class Stack{heap;length;static#m=false;static create(e){const t=getUintArray(e);if(!t)return[];Stack.#m=true;const r=new Stack(e,t);Stack.#m=false;return r}constructor(e,t){if(!Stack.#m){throw new 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{#g;#v;#y;#b;#w;#S;#x;#_;get perf(){return this.#_}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#k;#E;#O;#A;#C;#P;#M;#R;#j;#T;#N;#F;#I;#L;#$;#D;#B;#G;#z;static unsafeExposeInternals(e){return{starts:e.#I,ttls:e.#L,autopurgeTimers:e.#$,sizes:e.#F,keyMap:e.#O,keyList:e.#A,valList:e.#C,next:e.#P,prev:e.#M,get head(){return e.#R},get tail(){return e.#j},free:e.#T,isBackgroundFetch:t=>e.#W(t),backgroundFetch:(t,r,i,n)=>e.#q(t,r,i,n),moveToTail:t=>e.#U(t),indexes:t=>e.#V(t),rindexes:t=>e.#H(t),isStale:t=>e.#Y(t)}}get max(){return this.#g}get maxSize(){return this.#v}get calculatedSize(){return this.#E}get size(){return this.#k}get fetchMethod(){return this.#S}get memoMethod(){return this.#x}get dispose(){return this.#y}get onInsert(){return this.#b}get disposeAfter(){return this.#w}constructor(e){const{max:t=0,ttl:r,ttlResolution:i=1,ttlAutopurge:n,updateAgeOnGet:s,updateAgeOnHas:o,allowStale:a,dispose:c,onInsert:u,disposeAfter:l,noDisposeOnSet:h,noUpdateTTL:p,maxSize:d=0,maxEntrySize:g=0,sizeCalculation:v,fetchMethod:y,memoMethod:b,noDeleteOnFetchRejection:w,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:x,allowStaleOnFetchAbort:_,ignoreFetchAbort:k,perf:O}=e;if(O!==undefined){if(typeof O?.now!=="function"){throw new TypeError("perf option must have a now() method if specified")}}this.#_=O??le;if(t!==0&&!isPosInt(t)){throw new TypeError("max option must be a nonnegative integer")}const A=t?getUintArray(t):Array;if(!A){throw new Error("invalid max value: "+t)}this.#g=t;this.#v=d;this.maxEntrySize=g||this.#v;this.sizeCalculation=v;if(this.sizeCalculation){if(!this.#v&&!this.maxEntrySize){throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize")}if(typeof this.sizeCalculation!=="function"){throw new TypeError("sizeCalculation set to non-function")}}if(b!==undefined&&typeof b!=="function"){throw new TypeError("memoMethod must be a function if defined")}this.#x=b;if(y!==undefined&&typeof y!=="function"){throw new TypeError("fetchMethod must be a function if specified")}this.#S=y;this.#B=!!y;this.#O=new Map;this.#A=new Array(t).fill(undefined);this.#C=new Array(t).fill(undefined);this.#P=new A(t);this.#M=new A(t);this.#R=0;this.#j=0;this.#T=Stack.create(t);this.#k=0;this.#E=0;if(typeof c==="function"){this.#y=c}if(typeof u==="function"){this.#b=u}if(typeof l==="function"){this.#w=l;this.#N=[]}else{this.#w=undefined;this.#N=undefined}this.#D=!!this.#y;this.#z=!!this.#b;this.#G=!!this.#w;this.noDisposeOnSet=!!h;this.noUpdateTTL=!!p;this.noDeleteOnFetchRejection=!!w;this.allowStaleOnFetchRejection=!!x;this.allowStaleOnFetchAbort=!!_;this.ignoreFetchAbort=!!k;if(this.maxEntrySize!==0){if(this.#v!==0){if(!isPosInt(this.#v)){throw new TypeError("maxSize must be a positive integer if specified")}}if(!isPosInt(this.maxEntrySize)){throw new TypeError("maxEntrySize must be a positive integer if specified")}this.#Q()}this.allowStale=!!a;this.noDeleteOnStaleGet=!!S;this.updateAgeOnGet=!!s;this.updateAgeOnHas=!!o;this.ttlResolution=isPosInt(i)||i===0?i:1;this.ttlAutopurge=!!n;this.ttl=r||0;if(this.ttl){if(!isPosInt(this.ttl)){throw new TypeError("ttl must be a positive integer if specified")}this.#J()}if(this.#g===0&&this.ttl===0&&this.#v===0){throw new TypeError("At least one of max, maxSize, or ttl is required")}if(!this.ttlAutopurge&&!this.#g&&!this.#v){const e="LRU_CACHE_UNBOUNDED";if(shouldWarn(e)){he.add(e);const t="TTL caching without ttlAutopurge, max, or maxSize can "+"result in unbounded memory consumption.";emitWarning(t,"UnboundedCacheWarning",e,LRUCache)}}}getRemainingTTL(e){return this.#O.has(e)?Infinity:0}#J(){const e=new ZeroArray(this.#g);const t=new ZeroArray(this.#g);this.#L=e;this.#I=t;const r=this.ttlAutopurge?new Array(this.#g):undefined;this.#$=r;this.#K=(i,n,s=this.#_.now())=>{t[i]=n!==0?s:0;e[i]=n;if(r?.[i]){clearTimeout(r[i]);r[i]=undefined}if(n!==0&&r){const e=setTimeout((()=>{if(this.#Y(i)){this.#Z(this.#A[i],"expire")}}),n+1);if(e.unref){e.unref()}r[i]=e}};this.#X=r=>{t[r]=e[r]!==0?this.#_.now():0};this.#ee=(r,n)=>{if(e[n]){const s=e[n];const o=t[n];if(!s||!o)return;r.ttl=s;r.start=o;r.now=i||getNow();const a=r.now-o;r.remainingTTL=s-a}};let i=0;const getNow=()=>{const e=this.#_.now();if(this.ttlResolution>0){i=e;const t=setTimeout((()=>i=0),this.ttlResolution);if(t.unref){t.unref()}}return e};this.getRemainingTTL=r=>{const n=this.#O.get(r);if(n===undefined){return 0}const s=e[n];const o=t[n];if(!s||!o){return Infinity}const a=(i||getNow())-o;return s-a};this.#Y=r=>{const n=t[r];const s=e[r];return!!s&&!!n&&(i||getNow())-n>s}}#X=()=>{};#ee=()=>{};#K=()=>{};#Y=()=>false;#Q(){const e=new ZeroArray(this.#g);this.#E=0;this.#F=e;this.#te=t=>{this.#E-=e[t];e[t]=0};this.#re=(e,t,r,i)=>{if(this.#W(t)){return 0}if(!isPosInt(r)){if(i){if(typeof i!=="function"){throw new TypeError("sizeCalculation must be a function")}r=i(t,e);if(!isPosInt(r)){throw new TypeError("sizeCalculation return invalid (expect positive integer)")}}else{throw new TypeError("invalid size value (must be positive integer). "+"When maxSize or maxEntrySize is used, sizeCalculation "+"or size must be set.")}}return r};this.#ie=(t,r,i)=>{e[t]=r;if(this.#v){const r=this.#v-e[t];while(this.#E>r){this.#ne(true)}}this.#E+=e[t];if(i){i.entrySize=r;i.totalCalculatedSize=this.#E}}}#te=e=>{};#ie=(e,t,r)=>{};#re=(e,t,r,i)=>{if(r||i){throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}return 0};*#V({allowStale:e=this.allowStale}={}){if(this.#k){for(let t=this.#j;true;){if(!this.#se(t)){break}if(e||!this.#Y(t)){yield t}if(t===this.#R){break}else{t=this.#M[t]}}}}*#H({allowStale:e=this.allowStale}={}){if(this.#k){for(let t=this.#R;true;){if(!this.#se(t)){break}if(e||!this.#Y(t)){yield t}if(t===this.#j){break}else{t=this.#P[t]}}}}#se(e){return e!==undefined&&this.#O.get(this.#A[e])===e}*entries(){for(const e of this.#V()){if(this.#C[e]!==undefined&&this.#A[e]!==undefined&&!this.#W(this.#C[e])){yield[this.#A[e],this.#C[e]]}}}*rentries(){for(const e of this.#H()){if(this.#C[e]!==undefined&&this.#A[e]!==undefined&&!this.#W(this.#C[e])){yield[this.#A[e],this.#C[e]]}}}*keys(){for(const e of this.#V()){const t=this.#A[e];if(t!==undefined&&!this.#W(this.#C[e])){yield t}}}*rkeys(){for(const e of this.#H()){const t=this.#A[e];if(t!==undefined&&!this.#W(this.#C[e])){yield t}}}*values(){for(const e of this.#V()){const t=this.#C[e];if(t!==undefined&&!this.#W(this.#C[e])){yield this.#C[e]}}}*rvalues(){for(const e of this.#H()){const t=this.#C[e];if(t!==undefined&&!this.#W(this.#C[e])){yield this.#C[e]}}}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(const r of this.#V()){const i=this.#C[r];const n=this.#W(i)?i.__staleWhileFetching:i;if(n===undefined)continue;if(e(n,this.#A[r],this)){return this.get(this.#A[r],t)}}}forEach(e,t=this){for(const r of this.#V()){const i=this.#C[r];const n=this.#W(i)?i.__staleWhileFetching:i;if(n===undefined)continue;e.call(t,n,this.#A[r],this)}}rforEach(e,t=this){for(const r of this.#H()){const i=this.#C[r];const n=this.#W(i)?i.__staleWhileFetching:i;if(n===undefined)continue;e.call(t,n,this.#A[r],this)}}purgeStale(){let e=false;for(const t of this.#H({allowStale:true})){if(this.#Y(t)){this.#Z(this.#A[t],"expire");e=true}}return e}info(e){const t=this.#O.get(e);if(t===undefined)return undefined;const r=this.#C[t];const i=this.#W(r)?r.__staleWhileFetching:r;if(i===undefined)return undefined;const n={value:i};if(this.#L&&this.#I){const e=this.#L[t];const r=this.#I[t];if(e&&r){const t=e-(this.#_.now()-r);n.ttl=t;n.start=Date.now()}}if(this.#F){n.size=this.#F[t]}return n}dump(){const e=[];for(const t of this.#V({allowStale:true})){const r=this.#A[t];const i=this.#C[t];const n=this.#W(i)?i.__staleWhileFetching:i;if(n===undefined||r===undefined)continue;const s={value:n};if(this.#L&&this.#I){s.ttl=this.#L[t];const e=this.#_.now()-this.#I[t];s.start=Math.floor(Date.now()-e)}if(this.#F){s.size=this.#F[t]}e.unshift([r,s])}return e}load(e){this.clear();for(const[t,r]of e){if(r.start){const e=Date.now()-r.start;r.start=this.#_.now()-e}this.set(t,r.value,r)}}set(e,t,r={}){if(t===undefined){this.delete(e);return this}const{ttl:i=this.ttl,start:n,noDisposeOnSet:s=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:a}=r;let{noUpdateTTL:c=this.noUpdateTTL}=r;const u=this.#re(e,t,r.size||0,o);if(this.maxEntrySize&&u>this.maxEntrySize){if(a){a.set="miss";a.maxEntrySizeExceeded=true}this.#Z(e,"set");return this}let l=this.#k===0?undefined:this.#O.get(e);if(l===undefined){l=this.#k===0?this.#j:this.#T.length!==0?this.#T.pop():this.#k===this.#g?this.#ne(false):this.#k;this.#A[l]=e;this.#C[l]=t;this.#O.set(e,l);this.#P[this.#j]=l;this.#M[l]=this.#j;this.#j=l;this.#k++;this.#ie(l,u,a);if(a)a.set="add";c=false;if(this.#z){this.#b?.(t,e,"add")}}else{this.#U(l);const r=this.#C[l];if(t!==r){if(this.#B&&this.#W(r)){r.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:t}=r;if(t!==undefined&&!s){if(this.#D){this.#y?.(t,e,"set")}if(this.#G){this.#N?.push([t,e,"set"])}}}else if(!s){if(this.#D){this.#y?.(r,e,"set")}if(this.#G){this.#N?.push([r,e,"set"])}}this.#te(l);this.#ie(l,u,a);this.#C[l]=t;if(a){a.set="replace";const e=r&&this.#W(r)?r.__staleWhileFetching:r;if(e!==undefined)a.oldValue=e}}else if(a){a.set="update"}if(this.#z){this.onInsert?.(t,e,t===r?"update":"replace")}}if(i!==0&&!this.#L){this.#J()}if(this.#L){if(!c){this.#K(l,i,n)}if(a)this.#ee(a,l)}if(!s&&this.#G&&this.#N){const e=this.#N;let t;while(t=e?.shift()){this.#w?.(...t)}}return this}pop(){try{while(this.#k){const e=this.#C[this.#R];this.#ne(true);if(this.#W(e)){if(e.__staleWhileFetching){return e.__staleWhileFetching}}else if(e!==undefined){return e}}}finally{if(this.#G&&this.#N){const e=this.#N;let t;while(t=e?.shift()){this.#w?.(...t)}}}}#ne(e){const t=this.#R;const r=this.#A[t];const i=this.#C[t];if(this.#B&&this.#W(i)){i.__abortController.abort(new Error("evicted"))}else if(this.#D||this.#G){if(this.#D){this.#y?.(i,r,"evict")}if(this.#G){this.#N?.push([i,r,"evict"])}}this.#te(t);if(this.#$?.[t]){clearTimeout(this.#$[t]);this.#$[t]=undefined}if(e){this.#A[t]=undefined;this.#C[t]=undefined;this.#T.push(t)}if(this.#k===1){this.#R=this.#j=0;this.#T.length=0}else{this.#R=this.#P[t]}this.#O.delete(r);this.#k--;return t}has(e,t={}){const{updateAgeOnHas:r=this.updateAgeOnHas,status:i}=t;const n=this.#O.get(e);if(n!==undefined){const e=this.#C[n];if(this.#W(e)&&e.__staleWhileFetching===undefined){return false}if(!this.#Y(n)){if(r){this.#X(n)}if(i){i.has="hit";this.#ee(i,n)}return true}else if(i){i.has="stale";this.#ee(i,n)}}else if(i){i.has="miss"}return false}peek(e,t={}){const{allowStale:r=this.allowStale}=t;const i=this.#O.get(e);if(i===undefined||!r&&this.#Y(i)){return}const n=this.#C[i];return this.#W(n)?n.__staleWhileFetching:n}#q(e,t,r,i){const n=t===undefined?undefined:this.#C[t];if(this.#W(n)){return n}const s=new pe;const{signal:o}=r;o?.addEventListener("abort",(()=>s.abort(o.reason)),{signal:s.signal});const a={signal:s.signal,options:r,context:i};const cb=(i,n=false)=>{const{aborted:o}=s.signal;const u=r.ignoreFetchAbort&&i!==undefined;if(r.status){if(o&&!n){r.status.fetchAborted=true;r.status.fetchError=s.signal.reason;if(u)r.status.fetchAbortIgnored=true}else{r.status.fetchResolved=true}}if(o&&!u&&!n){return fetchFail(s.signal.reason)}const l=c;const h=this.#C[t];if(h===c||u&&n&&h===undefined){if(i===undefined){if(l.__staleWhileFetching!==undefined){this.#C[t]=l.__staleWhileFetching}else{this.#Z(e,"fetch")}}else{if(r.status)r.status.fetchUpdated=true;this.set(e,i,a.options)}}return i};const eb=e=>{if(r.status){r.status.fetchRejected=true;r.status.fetchError=e}return fetchFail(e)};const fetchFail=i=>{const{aborted:n}=s.signal;const o=n&&r.allowStaleOnFetchAbort;const a=o||r.allowStaleOnFetchRejection;const u=a||r.noDeleteOnFetchRejection;const l=c;if(this.#C[t]===c){const r=!u||l.__staleWhileFetching===undefined;if(r){this.#Z(e,"fetch")}else if(!o){this.#C[t]=l.__staleWhileFetching}}if(a){if(r.status&&l.__staleWhileFetching!==undefined){r.status.returnedStale=true}return l.__staleWhileFetching}else if(l.__returned===l){throw i}};const pcall=(t,i)=>{const o=this.#S?.(e,n,a);if(o&&o instanceof Promise){o.then((e=>t(e===undefined?undefined:e)),i)}s.signal.addEventListener("abort",(()=>{if(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort){t(undefined);if(r.allowStaleOnFetchAbort){t=e=>cb(e,true)}}}))};if(r.status)r.status.fetchDispatched=true;const c=new Promise(pcall).then(cb,eb);const u=Object.assign(c,{__abortController:s,__staleWhileFetching:n,__returned:undefined});if(t===undefined){this.set(e,u,{...a.options,status:undefined});t=this.#O.get(e)}else{this.#C[t]=u}return u}#W(e){if(!this.#B)return false;const t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof pe}async fetch(e,t={}){const{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:a=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:l=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:d=this.allowStaleOnFetchAbort,context:g,forceRefresh:v=false,status:y,signal:b}=t;if(!this.#B){if(y)y.fetch="get";return this.get(e,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:n,status:y})}const w={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:n,ttl:s,noDisposeOnSet:o,size:a,sizeCalculation:c,noUpdateTTL:u,noDeleteOnFetchRejection:l,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:d,ignoreFetchAbort:p,status:y,signal:b};let S=this.#O.get(e);if(S===undefined){if(y)y.fetch="miss";const t=this.#q(e,S,w,g);return t.__returned=t}else{const t=this.#C[S];if(this.#W(t)){const e=r&&t.__staleWhileFetching!==undefined;if(y){y.fetch="inflight";if(e)y.returnedStale=true}return e?t.__staleWhileFetching:t.__returned=t}const n=this.#Y(S);if(!v&&!n){if(y)y.fetch="hit";this.#U(S);if(i){this.#X(S)}if(y)this.#ee(y,S);return t}const s=this.#q(e,S,w,g);const o=s.__staleWhileFetching!==undefined;const a=o&&r;if(y){y.fetch=n?"stale":"refresh";if(a&&n)y.returnedStale=true}return a?s.__staleWhileFetching:s.__returned=s}}async forceFetch(e,t={}){const r=await this.fetch(e,t);if(r===undefined)throw new Error("fetch() returned undefined");return r}memo(e,t={}){const r=this.#x;if(!r){throw new Error("no memoMethod provided to constructor")}const{context:i,forceRefresh:n,...s}=t;const o=this.get(e,s);if(!n&&o!==undefined)return o;const a=r(e,o,{options:s,context:i});this.set(e,a,s);return a}get(e,t={}){const{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:s}=t;const o=this.#O.get(e);if(o!==undefined){const t=this.#C[o];const a=this.#W(t);if(s)this.#ee(s,o);if(this.#Y(o)){if(s)s.get="stale";if(!a){if(!n){this.#Z(e,"expire")}if(s&&r)s.returnedStale=true;return r?t:undefined}else{if(s&&r&&t.__staleWhileFetching!==undefined){s.returnedStale=true}return r?t.__staleWhileFetching:undefined}}else{if(s)s.get="hit";if(a){return t.__staleWhileFetching}this.#U(o);if(i){this.#X(o)}return t}}else if(s){s.get="miss"}}#oe(e,t){this.#M[t]=e;this.#P[e]=t}#U(e){if(e!==this.#j){if(e===this.#R){this.#R=this.#P[e]}else{this.#oe(this.#M[e],this.#P[e])}this.#oe(this.#j,e);this.#j=e}}delete(e){return this.#Z(e,"delete")}#Z(e,t){let r=false;if(this.#k!==0){const i=this.#O.get(e);if(i!==undefined){if(this.#$?.[i]){clearTimeout(this.#$?.[i]);this.#$[i]=undefined}r=true;if(this.#k===1){this.#ae(t)}else{this.#te(i);const r=this.#C[i];if(this.#W(r)){r.__abortController.abort(new Error("deleted"))}else if(this.#D||this.#G){if(this.#D){this.#y?.(r,e,t)}if(this.#G){this.#N?.push([r,e,t])}}this.#O.delete(e);this.#A[i]=undefined;this.#C[i]=undefined;if(i===this.#j){this.#j=this.#M[i]}else if(i===this.#R){this.#R=this.#P[i]}else{const e=this.#M[i];this.#P[e]=this.#P[i];const t=this.#P[i];this.#M[t]=this.#M[i]}this.#k--;this.#T.push(i)}}}if(this.#G&&this.#N?.length){const e=this.#N;let t;while(t=e?.shift()){this.#w?.(...t)}}return r}clear(){return this.#ae("delete")}#ae(e){for(const t of this.#H({allowStale:true})){const r=this.#C[t];if(this.#W(r)){r.__abortController.abort(new Error("deleted"))}else{const i=this.#A[t];if(this.#D){this.#y?.(r,i,e)}if(this.#G){this.#N?.push([r,i,e])}}}this.#O.clear();this.#C.fill(undefined);this.#A.fill(undefined);if(this.#L&&this.#I){this.#L.fill(0);this.#I.fill(0);for(const e of this.#$??[]){if(e!==undefined)clearTimeout(e)}this.#$?.fill(undefined)}if(this.#F){this.#F.fill(0)}this.#R=0;this.#j=0;this.#T.length=0;this.#E=0;this.#k=0;if(this.#G&&this.#N){const e=this.#N;let t;while(t=e?.shift()){this.#w?.(...t)}}}}const ge=require("node:path");const ve=require("node:fs");var ye=__nccwpck_require__.t(ve,2);const be=require("node:fs/promises");const we=require("node:events");const Se=require("node:stream");const xe=require("node:string_decoder");const _e=typeof process==="object"&&process?process:{stdout:null,stderr:null};const isStream=e=>!!e&&typeof e==="object"&&(e instanceof Minipass||e instanceof Se||isReadable(e)||isWritable(e));const isReadable=e=>!!e&&typeof e==="object"&&e instanceof we.EventEmitter&&typeof e.pipe==="function"&&e.pipe!==Se.Writable.prototype.pipe;const isWritable=e=>!!e&&typeof e==="object"&&e instanceof we.EventEmitter&&typeof e.write==="function"&&typeof e.end==="function";const ke=Symbol("EOF");const Ee=Symbol("maybeEmitEnd");const Oe=Symbol("emittedEnd");const Ae=Symbol("emittingEnd");const Ce=Symbol("emittedError");const Pe=Symbol("closed");const Me=Symbol("read");const Re=Symbol("flush");const je=Symbol("flushChunk");const Te=Symbol("encoding");const Ne=Symbol("decoder");const Fe=Symbol("flowing");const Ie=Symbol("paused");const Le=Symbol("resume");const $e=Symbol("buffer");const De=Symbol("pipes");const Be=Symbol("bufferLength");const Ge=Symbol("bufferPush");const ze=Symbol("bufferShift");const We=Symbol("objectMode");const qe=Symbol("destroyed");const Ue=Symbol("error");const Ve=Symbol("emitData");const He=Symbol("emitEnd");const Ye=Symbol("emitEnd2");const Qe=Symbol("async");const Je=Symbol("abort");const Ke=Symbol("aborted");const Ze=Symbol("signal");const Xe=Symbol("dataListeners");const et=Symbol("discarded");const defer=e=>Promise.resolve().then(e);const nodefer=e=>e();const isEndish=e=>e==="end"||e==="finish"||e==="prefinish";const isArrayBufferLike=e=>e instanceof ArrayBuffer||!!e&&typeof e==="object"&&e.constructor&&e.constructor.name==="ArrayBuffer"&&e.byteLength>=0;const isArrayBufferView=e=>!Buffer.isBuffer(e)&&ArrayBuffer.isView(e);class Pipe{src;dest;opts;ondrain;constructor(e,t,r){this.src=e;this.dest=t;this.opts=r;this.ondrain=()=>e[Le]();this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe();if(this.opts.end)this.dest.end()}}class PipeProxyErrors extends Pipe{unpipe(){this.src.removeListener("error",this.proxyErrors);super.unpipe()}constructor(e,t,r){super(e,t,r);this.proxyErrors=e=>t.emit("error",e);e.on("error",this.proxyErrors)}}const isObjectModeOptions=e=>!!e.objectMode;const isEncodingOptions=e=>!e.objectMode&&!!e.encoding&&e.encoding!=="buffer";class Minipass extends we.EventEmitter{[Fe]=false;[Ie]=false;[De]=[];[$e]=[];[We];[Te];[Qe];[Ne];[ke]=false;[Oe]=false;[Ae]=false;[Pe]=false;[Ce]=null;[Be]=0;[qe]=false;[Ze];[Ke]=false;[Xe]=0;[et]=false;writable=true;readable=true;constructor(...e){const t=e[0]||{};super();if(t.objectMode&&typeof t.encoding==="string"){throw new TypeError("Encoding and objectMode may not be used together")}if(isObjectModeOptions(t)){this[We]=true;this[Te]=null}else if(isEncodingOptions(t)){this[Te]=t.encoding;this[We]=false}else{this[We]=false;this[Te]=null}this[Qe]=!!t.async;this[Ne]=this[Te]?new xe.StringDecoder(this[Te]):null;if(t&&t.debugExposeBuffer===true){Object.defineProperty(this,"buffer",{get:()=>this[$e]})}if(t&&t.debugExposePipes===true){Object.defineProperty(this,"pipes",{get:()=>this[De]})}const{signal:r}=t;if(r){this[Ze]=r;if(r.aborted){this[Je]()}else{r.addEventListener("abort",(()=>this[Je]()))}}}get bufferLength(){return this[Be]}get encoding(){return this[Te]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[We]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get["async"](){return this[Qe]}set["async"](e){this[Qe]=this[Qe]||!!e}[Je](){this[Ke]=true;this.emit("abort",this[Ze]?.reason);this.destroy(this[Ze]?.reason)}get aborted(){return this[Ke]}set aborted(e){}write(e,t,r){if(this[Ke])return false;if(this[ke])throw new Error("write after end");if(this[qe]){this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"}));return true}if(typeof t==="function"){r=t;t="utf8"}if(!t)t="utf8";const i=this[Qe]?defer:nodefer;if(!this[We]&&!Buffer.isBuffer(e)){if(isArrayBufferView(e)){e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)}else if(isArrayBufferLike(e)){e=Buffer.from(e)}else if(typeof e!=="string"){throw new Error("Non-contiguous data written to non-objectMode stream")}}if(this[We]){if(this[Fe]&&this[Be]!==0)this[Re](true);if(this[Fe])this.emit("data",e);else this[Ge](e);if(this[Be]!==0)this.emit("readable");if(r)i(r);return this[Fe]}if(!e.length){if(this[Be]!==0)this.emit("readable");if(r)i(r);return this[Fe]}if(typeof e==="string"&&!(t===this[Te]&&!this[Ne]?.lastNeed)){e=Buffer.from(e,t)}if(Buffer.isBuffer(e)&&this[Te]){e=this[Ne].write(e)}if(this[Fe]&&this[Be]!==0)this[Re](true);if(this[Fe])this.emit("data",e);else this[Ge](e);if(this[Be]!==0)this.emit("readable");if(r)i(r);return this[Fe]}read(e){if(this[qe])return null;this[et]=false;if(this[Be]===0||e===0||e&&e>this[Be]){this[Ee]();return null}if(this[We])e=null;if(this[$e].length>1&&!this[We]){this[$e]=[this[Te]?this[$e].join(""):Buffer.concat(this[$e],this[Be])]}const t=this[Me](e||null,this[$e][0]);this[Ee]();return t}[Me](e,t){if(this[We])this[ze]();else{const r=t;if(e===r.length||e===null)this[ze]();else if(typeof r==="string"){this[$e][0]=r.slice(e);t=r.slice(0,e);this[Be]-=e}else{this[$e][0]=r.subarray(e);t=r.subarray(0,e);this[Be]-=e}}this.emit("data",t);if(!this[$e].length&&!this[ke])this.emit("drain");return t}end(e,t,r){if(typeof e==="function"){r=e;e=undefined}if(typeof t==="function"){r=t;t="utf8"}if(e!==undefined)this.write(e,t);if(r)this.once("end",r);this[ke]=true;this.writable=false;if(this[Fe]||!this[Ie])this[Ee]();return this}[Le](){if(this[qe])return;if(!this[Xe]&&!this[De].length){this[et]=true}this[Ie]=false;this[Fe]=true;this.emit("resume");if(this[$e].length)this[Re]();else if(this[ke])this[Ee]();else this.emit("drain")}resume(){return this[Le]()}pause(){this[Fe]=false;this[Ie]=true;this[et]=false}get destroyed(){return this[qe]}get flowing(){return this[Fe]}get paused(){return this[Ie]}[Ge](e){if(this[We])this[Be]+=1;else this[Be]+=e.length;this[$e].push(e)}[ze](){if(this[We])this[Be]-=1;else this[Be]-=this[$e][0].length;return this[$e].shift()}[Re](e=false){do{}while(this[je](this[ze]())&&this[$e].length);if(!e&&!this[$e].length&&!this[ke])this.emit("drain")}[je](e){this.emit("data",e);return this[Fe]}pipe(e,t){if(this[qe])return e;this[et]=false;const r=this[Oe];t=t||{};if(e===_e.stdout||e===_e.stderr)t.end=false;else t.end=t.end!==false;t.proxyErrors=!!t.proxyErrors;if(r){if(t.end)e.end()}else{this[De].push(!t.proxyErrors?new Pipe(this,e,t):new PipeProxyErrors(this,e,t));if(this[Qe])defer((()=>this[Le]()));else this[Le]()}return e}unpipe(e){const t=this[De].find((t=>t.dest===e));if(t){if(this[De].length===1){if(this[Fe]&&this[Xe]===0){this[Fe]=false}this[De]=[]}else this[De].splice(this[De].indexOf(t),1);t.unpipe()}}addListener(e,t){return this.on(e,t)}on(e,t){const r=super.on(e,t);if(e==="data"){this[et]=false;this[Xe]++;if(!this[De].length&&!this[Fe]){this[Le]()}}else if(e==="readable"&&this[Be]!==0){super.emit("readable")}else if(isEndish(e)&&this[Oe]){super.emit(e);this.removeAllListeners(e)}else if(e==="error"&&this[Ce]){const e=t;if(this[Qe])defer((()=>e.call(this,this[Ce])));else e.call(this,this[Ce])}return r}removeListener(e,t){return this.off(e,t)}off(e,t){const r=super.off(e,t);if(e==="data"){this[Xe]=this.listeners("data").length;if(this[Xe]===0&&!this[et]&&!this[De].length){this[Fe]=false}}return r}removeAllListeners(e){const t=super.removeAllListeners(e);if(e==="data"||e===undefined){this[Xe]=0;if(!this[et]&&!this[De].length){this[Fe]=false}}return t}get emittedEnd(){return this[Oe]}[Ee](){if(!this[Ae]&&!this[Oe]&&!this[qe]&&this[$e].length===0&&this[ke]){this[Ae]=true;this.emit("end");this.emit("prefinish");this.emit("finish");if(this[Pe])this.emit("close");this[Ae]=false}}emit(e,...t){const r=t[0];if(e!=="error"&&e!=="close"&&e!==qe&&this[qe]){return false}else if(e==="data"){return!this[We]&&!r?false:this[Qe]?(defer((()=>this[Ve](r))),true):this[Ve](r)}else if(e==="end"){return this[He]()}else if(e==="close"){this[Pe]=true;if(!this[Oe]&&!this[qe])return false;const e=super.emit("close");this.removeAllListeners("close");return e}else if(e==="error"){this[Ce]=r;super.emit(Ue,r);const e=!this[Ze]||this.listeners("error").length?super.emit("error",r):false;this[Ee]();return e}else if(e==="resume"){const e=super.emit("resume");this[Ee]();return e}else if(e==="finish"||e==="prefinish"){const t=super.emit(e);this.removeAllListeners(e);return t}const i=super.emit(e,...t);this[Ee]();return i}[Ve](e){for(const t of this[De]){if(t.dest.write(e)===false)this.pause()}const t=this[et]?false:super.emit("data",e);this[Ee]();return t}[He](){if(this[Oe])return false;this[Oe]=true;this.readable=false;return this[Qe]?(defer((()=>this[Ye]())),true):this[Ye]()}[Ye](){if(this[Ne]){const e=this[Ne].end();if(e){for(const t of this[De]){t.dest.write(e)}if(!this[et])super.emit("data",e)}}for(const e of this[De]){e.end()}const e=super.emit("end");this.removeAllListeners("end");return e}async collect(){const e=Object.assign([],{dataLength:0});if(!this[We])e.dataLength=0;const t=this.promise();this.on("data",(t=>{e.push(t);if(!this[We])e.dataLength+=t.length}));await t;return e}async concat(){if(this[We]){throw new Error("cannot concat in objectMode")}const e=await this.collect();return this[Te]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise(((e,t)=>{this.on(qe,(()=>t(new Error("stream destroyed"))));this.on("error",(e=>t(e)));this.on("end",(()=>e()))}))}[Symbol.asyncIterator](){this[et]=false;let e=false;const stop=async()=>{this.pause();e=true;return{value:undefined,done:true}};const next=()=>{if(e)return stop();const t=this.read();if(t!==null)return Promise.resolve({done:false,value:t});if(this[ke])return stop();let r;let i;const onerr=e=>{this.off("data",ondata);this.off("end",onend);this.off(qe,ondestroy);stop();i(e)};const ondata=e=>{this.off("error",onerr);this.off("end",onend);this.off(qe,ondestroy);this.pause();r({value:e,done:!!this[ke]})};const onend=()=>{this.off("error",onerr);this.off("data",ondata);this.off(qe,ondestroy);stop();r({done:true,value:undefined})};const ondestroy=()=>onerr(new Error("stream destroyed"));return new Promise(((e,t)=>{i=t;r=e;this.once(qe,ondestroy);this.once("error",onerr);this.once("end",onend);this.once("data",ondata)}))};return{next:next,throw:stop,return:stop,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[et]=false;let e=false;const stop=()=>{this.pause();this.off(Ue,stop);this.off(qe,stop);this.off("end",stop);e=true;return{done:true,value:undefined}};const next=()=>{if(e)return stop();const t=this.read();return t===null?stop():{done:false,value:t}};this.once("end",stop);this.once(Ue,stop);this.once(qe,stop);return{next:next,throw:stop,return:stop,[Symbol.iterator](){return this}}}destroy(e){if(this[qe]){if(e)this.emit("error",e);else this.emit(qe);return this}this[qe]=true;this[et]=true;this[$e].length=0;this[Be]=0;const t=this;if(typeof t.close==="function"&&!this[Pe])t.close();if(e)this.emit("error",e);else this.emit(qe);return this}static get isStream(){return isStream}}const tt=g.realpathSync.native;const rt={lstatSync:g.lstatSync,readdir:g.readdir,readdirSync:g.readdirSync,readlinkSync:g.readlinkSync,realpathSync:tt,promises:{lstat:be.lstat,readdir:be.readdir,readlink:be.readlink,realpath:be.realpath}};const fsFromOption=e=>!e||e===rt||e===ye?rt:{...rt,...e,promises:{...rt.promises,...e.promises||{}}};const it=/^\\\\\?\\([a-z]:)\\?$/i;const uncToDrive=e=>e.replace(/\//g,"\\").replace(it,"$1\\");const nt=/[\\\/]/;const st=0;const ot=1;const at=2;const ct=4;const ut=6;const ht=8;const ft=10;const pt=12;const dt=15;const mt=~dt;const vt=16;const yt=32;const bt=64;const wt=128;const St=256;const xt=512;const _t=bt|wt|xt;const kt=1023;const entToType=e=>e.isFile()?ht:e.isDirectory()?ct:e.isSymbolicLink()?ft:e.isCharacterDevice()?at:e.isBlockDevice()?ut:e.isSocket()?pt:e.isFIFO()?ot:st;const Et=new LRUCache({max:2**12});const normalize=e=>{const t=Et.get(e);if(t)return t;const r=e.normalize("NFKD");Et.set(e,r);return r};const Ot=new LRUCache({max:2**12});const normalizeNocase=e=>{const t=Ot.get(e);if(t)return t;const r=normalize(e.toLowerCase());Ot.set(e,r);return r};class ResolveCache extends LRUCache{constructor(){super({max:256})}}class ChildrenCache extends LRUCache{constructor(e=16*1024){super({maxSize:e,sizeCalculation:e=>e.length+1})}}const At=Symbol("PathScurry setAsCwd");class PathBase{name;root;roots;parent;nocase;isCWD=false;#ce;#ue;get dev(){return this.#ue}#le;get mode(){return this.#le}#he;get nlink(){return this.#he}#fe;get uid(){return this.#fe}#pe;get gid(){return this.#pe}#de;get rdev(){return this.#de}#me;get blksize(){return this.#me}#ge;get ino(){return this.#ge}#k;get size(){return this.#k}#ve;get blocks(){return this.#ve}#ye;get atimeMs(){return this.#ye}#be;get mtimeMs(){return this.#be}#we;get ctimeMs(){return this.#we}#Se;get birthtimeMs(){return this.#Se}#xe;get atime(){return this.#xe}#_e;get mtime(){return this.#_e}#ke;get ctime(){return this.#ke}#Ee;get birthtime(){return this.#Ee}#Oe;#Ae;#Ce;#Pe;#Me;#Re;#je;#Te;#Ne;#Fe;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=st,r,i,n,s,o){this.name=e;this.#Oe=n?normalizeNocase(e):normalize(e);this.#je=t&kt;this.nocase=n;this.roots=i;this.root=r||this;this.#Te=s;this.#Ce=o.fullpath;this.#Me=o.relative;this.#Re=o.relativePosix;this.parent=o.parent;if(this.parent){this.#ce=this.parent.#ce}else{this.#ce=fsFromOption(o.fs)}}depth(){if(this.#Ae!==undefined)return this.#Ae;if(!this.parent)return this.#Ae=0;return this.#Ae=this.parent.depth()+1}childrenCache(){return this.#Te}resolve(e){if(!e){return this}const t=this.getRootString(e);const r=e.substring(t.length);const i=r.split(this.splitSep);const n=t?this.getRoot(t).#Ie(i):this.#Ie(i);return n}#Ie(e){let t=this;for(const r of e){t=t.child(r)}return t}children(){const e=this.#Te.get(this);if(e){return e}const t=Object.assign([],{provisional:0});this.#Te.set(this,t);this.#je&=~vt;return t}child(e,t){if(e===""||e==="."){return this}if(e===".."){return this.parent||this}const r=this.children();const i=this.nocase?normalizeNocase(e):normalize(e);for(const e of r){if(e.#Oe===i){return e}}const n=this.parent?this.sep:"";const s=this.#Ce?this.#Ce+n+e:undefined;const o=this.newChild(e,st,{...t,parent:this,fullpath:s});if(!this.canReaddir()){o.#je|=wt}r.push(o);return o}relative(){if(this.isCWD)return"";if(this.#Me!==undefined){return this.#Me}const e=this.name;const t=this.parent;if(!t){return this.#Me=this.name}const r=t.relative();return r+(!r||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#Re!==undefined)return this.#Re;const e=this.name;const t=this.parent;if(!t){return this.#Re=this.fullpathPosix()}const r=t.relativePosix();return r+(!r||!t.parent?"":"/")+e}fullpath(){if(this.#Ce!==undefined){return this.#Ce}const e=this.name;const t=this.parent;if(!t){return this.#Ce=this.name}const r=t.fullpath();const i=r+(!t.parent?"":this.sep)+e;return this.#Ce=i}fullpathPosix(){if(this.#Pe!==undefined)return this.#Pe;if(this.sep==="/")return this.#Pe=this.fullpath();if(!this.parent){const e=this.fullpath().replace(/\\/g,"/");if(/^[a-z]:\//i.test(e)){return this.#Pe=`//?/${e}`}else{return this.#Pe=e}}const e=this.parent;const t=e.fullpathPosix();const r=t+(!t||!e.parent?"":"/")+this.name;return this.#Pe=r}isUnknown(){return(this.#je&dt)===st}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.#je&dt)===ht}isDirectory(){return(this.#je&dt)===ct}isCharacterDevice(){return(this.#je&dt)===at}isBlockDevice(){return(this.#je&dt)===ut}isFIFO(){return(this.#je&dt)===ot}isSocket(){return(this.#je&dt)===pt}isSymbolicLink(){return(this.#je&ft)===ft}lstatCached(){return this.#je&yt?this:undefined}readlinkCached(){return this.#Ne}realpathCached(){return this.#Fe}readdirCached(){const e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#Ne)return true;if(!this.parent)return false;const e=this.#je&dt;return!(e!==st&&e!==ft||this.#je&St||this.#je&wt)}calledReaddir(){return!!(this.#je&vt)}isENOENT(){return!!(this.#je&wt)}isNamed(e){return!this.nocase?this.#Oe===normalize(e):this.#Oe===normalizeNocase(e)}async readlink(){const e=this.#Ne;if(e){return e}if(!this.canReadlink()){return undefined}if(!this.parent){return undefined}try{const e=await this.#ce.promises.readlink(this.fullpath());const t=(await this.parent.realpath())?.resolve(e);if(t){return this.#Ne=t}}catch(e){this.#Le(e.code);return undefined}}readlinkSync(){const e=this.#Ne;if(e){return e}if(!this.canReadlink()){return undefined}if(!this.parent){return undefined}try{const e=this.#ce.readlinkSync(this.fullpath());const t=this.parent.realpathSync()?.resolve(e);if(t){return this.#Ne=t}}catch(e){this.#Le(e.code);return undefined}}#$e(e){this.#je|=vt;for(let t=e.provisional;t<e.length;t++){const r=e[t];if(r)r.#De()}}#De(){if(this.#je&wt)return;this.#je=(this.#je|wt)&mt;this.#Be()}#Be(){const e=this.children();e.provisional=0;for(const t of e){t.#De()}}#Ge(){this.#je|=xt;this.#ze()}#ze(){if(this.#je&bt)return;let e=this.#je;if((e&dt)===ct)e&=mt;this.#je=e|bt;this.#Be()}#We(e=""){if(e==="ENOTDIR"||e==="EPERM"){this.#ze()}else if(e==="ENOENT"){this.#De()}else{this.children().provisional=0}}#qe(e=""){if(e==="ENOTDIR"){const e=this.parent;e.#ze()}else if(e==="ENOENT"){this.#De()}}#Le(e=""){let t=this.#je;t|=St;if(e==="ENOENT")t|=wt;if(e==="EINVAL"||e==="UNKNOWN"){t&=mt}this.#je=t;if(e==="ENOTDIR"&&this.parent){this.parent.#ze()}}#Ue(e,t){return this.#Ve(e,t)||this.#He(e,t)}#He(e,t){const r=entToType(e);const i=this.newChild(e.name,r,{parent:this});const n=i.#je&dt;if(n!==ct&&n!==ft&&n!==st){i.#je|=bt}t.unshift(i);t.provisional++;return i}#Ve(e,t){for(let r=t.provisional;r<t.length;r++){const i=t[r];const n=this.nocase?normalizeNocase(e.name):normalize(e.name);if(n!==i.#Oe){continue}return this.#Ye(e,i,r,t)}}#Ye(e,t,r,i){const n=t.name;t.#je=t.#je&mt|entToType(e);if(n!==e.name)t.name=e.name;if(r!==i.provisional){if(r===i.length-1)i.pop();else i.splice(r,1);i.unshift(t)}i.provisional++;return t}async lstat(){if((this.#je&wt)===0){try{this.#Qe(await this.#ce.promises.lstat(this.fullpath()));return this}catch(e){this.#qe(e.code)}}}lstatSync(){if((this.#je&wt)===0){try{this.#Qe(this.#ce.lstatSync(this.fullpath()));return this}catch(e){this.#qe(e.code)}}}#Qe(e){const{atime:t,atimeMs:r,birthtime:i,birthtimeMs:n,blksize:s,blocks:o,ctime:a,ctimeMs:c,dev:u,gid:l,ino:h,mode:p,mtime:d,mtimeMs:g,nlink:v,rdev:y,size:b,uid:w}=e;this.#xe=t;this.#ye=r;this.#Ee=i;this.#Se=n;this.#me=s;this.#ve=o;this.#ke=a;this.#we=c;this.#ue=u;this.#pe=l;this.#ge=h;this.#le=p;this.#_e=d;this.#be=g;this.#he=v;this.#de=y;this.#k=b;this.#fe=w;const S=entToType(e);this.#je=this.#je&mt|S|yt;if(S!==st&&S!==ct&&S!==ft){this.#je|=bt}}#Je=[];#Ke=false;#Ze(e){this.#Ke=false;const t=this.#Je.slice();this.#Je.length=0;t.forEach((t=>t(null,e)))}readdirCB(e,t=false){if(!this.canReaddir()){if(t)e(null,[]);else queueMicrotask((()=>e(null,[])));return}const r=this.children();if(this.calledReaddir()){const i=r.slice(0,r.provisional);if(t)e(null,i);else queueMicrotask((()=>e(null,i)));return}this.#Je.push(e);if(this.#Ke){return}this.#Ke=true;const i=this.fullpath();this.#ce.readdir(i,{withFileTypes:true},((e,t)=>{if(e){this.#We(e.code);r.provisional=0}else{for(const e of t){this.#Ue(e,r)}this.#$e(r)}this.#Ze(r.slice(0,r.provisional));return}))}#Xe;async readdir(){if(!this.canReaddir()){return[]}const e=this.children();if(this.calledReaddir()){return e.slice(0,e.provisional)}const t=this.fullpath();if(this.#Xe){await this.#Xe}else{let resolve=()=>{};this.#Xe=new Promise((e=>resolve=e));try{for(const r of await this.#ce.promises.readdir(t,{withFileTypes:true})){this.#Ue(r,e)}this.#$e(e)}catch(t){this.#We(t.code);e.provisional=0}this.#Xe=undefined;resolve()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir()){return[]}const e=this.children();if(this.calledReaddir()){return e.slice(0,e.provisional)}const t=this.fullpath();try{for(const r of this.#ce.readdirSync(t,{withFileTypes:true})){this.#Ue(r,e)}this.#$e(e)}catch(t){this.#We(t.code);e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#je&_t)return false;const e=dt&this.#je;if(!(e===st||e===ct||e===ft)){return false}return true}shouldWalk(e,t){return(this.#je&ct)===ct&&!(this.#je&_t)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#Fe)return this.#Fe;if((xt|St|wt)&this.#je)return undefined;try{const e=await this.#ce.promises.realpath(this.fullpath());return this.#Fe=this.resolve(e)}catch(e){this.#Ge()}}realpathSync(){if(this.#Fe)return this.#Fe;if((xt|St|wt)&this.#je)return undefined;try{const e=this.#ce.realpathSync(this.fullpath());return this.#Fe=this.resolve(e)}catch(e){this.#Ge()}}[At](e){if(e===this)return;e.isCWD=false;this.isCWD=true;const t=new Set([]);let r=[];let i=this;while(i&&i.parent){t.add(i);i.#Me=r.join(this.sep);i.#Re=r.join("/");i=i.parent;r.push("..")}i=e;while(i&&i.parent&&!t.has(i)){i.#Me=undefined;i.#Re=undefined;i=i.parent}}}class PathWin32 extends PathBase{sep="\\";splitSep=nt;constructor(e,t=st,r,i,n,s,o){super(e,t,r,i,n,s,o)}newChild(e,t=st,r={}){return new PathWin32(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return ge.win32.parse(e).root}getRoot(e){e=uncToDrive(e.toUpperCase());if(e===this.root.name){return this.root}for(const[t,r]of Object.entries(this.roots)){if(this.sameRoot(e,t)){return this.roots[e]=r}}return this.roots[e]=new PathScurryWin32(e,this).root}sameRoot(e,t=this.root.name){e=e.toUpperCase().replace(/\//g,"\\").replace(it,"$1\\");return e===t}}class PathPosix extends PathBase{splitSep="/";sep="/";constructor(e,t=st,r,i,n,s,o){super(e,t,r,i,n,s,o)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=st,r={}){return new PathPosix(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}}class PathScurryBase{root;rootPath;roots;cwd;#et;#tt;#Te;nocase;#ce;constructor(e=process.cwd(),t,r,{nocase:i,childrenCacheSize:n=16*1024,fs:s=rt}={}){this.#ce=fsFromOption(s);if(e instanceof URL||e.startsWith("file://")){e=(0,ue.fileURLToPath)(e)}const o=t.resolve(e);this.roots=Object.create(null);this.rootPath=this.parseRootPath(o);this.#et=new ResolveCache;this.#tt=new ResolveCache;this.#Te=new ChildrenCache(n);const a=o.substring(this.rootPath.length).split(r);if(a.length===1&&!a[0]){a.pop()}if(i===undefined){throw new TypeError("must provide nocase setting to PathScurryBase ctor")}this.nocase=i;this.root=this.newRoot(this.#ce);this.roots[this.rootPath]=this.root;let c=this.root;let u=a.length-1;const l=t.sep;let h=this.rootPath;let p=false;for(const e of a){const t=u--;c=c.child(e,{relative:new Array(t).fill("..").join(l),relativePosix:new Array(t).fill("..").join("/"),fullpath:h+=(p?"":l)+e});p=true}this.cwd=c}depth(e=this.cwd){if(typeof e==="string"){e=this.cwd.resolve(e)}return e.depth()}childrenCache(){return this.#Te}resolve(...e){let t="";for(let r=e.length-1;r>=0;r--){const i=e[r];if(!i||i===".")continue;t=t?`${i}/${t}`:i;if(this.isAbsolute(i)){break}}const r=this.#et.get(t);if(r!==undefined){return r}const i=this.cwd.resolve(t).fullpath();this.#et.set(t,i);return i}resolvePosix(...e){let t="";for(let r=e.length-1;r>=0;r--){const i=e[r];if(!i||i===".")continue;t=t?`${i}/${t}`:i;if(this.isAbsolute(i)){break}}const r=this.#tt.get(t);if(r!==undefined){return r}const i=this.cwd.resolve(t).fullpathPosix();this.#tt.set(t,i);return i}relative(e=this.cwd){if(typeof e==="string"){e=this.cwd.resolve(e)}return e.relative()}relativePosix(e=this.cwd){if(typeof e==="string"){e=this.cwd.resolve(e)}return e.relativePosix()}basename(e=this.cwd){if(typeof e==="string"){e=this.cwd.resolve(e)}return e.name}dirname(e=this.cwd){if(typeof e==="string"){e=this.cwd.resolve(e)}return(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:true}){if(typeof e==="string"){e=this.cwd.resolve(e)}else if(!(e instanceof PathBase)){t=e;e=this.cwd}const{withFileTypes:r}=t;if(!e.canReaddir()){return[]}else{const t=await e.readdir();return r?t:t.map((e=>e.name))}}readdirSync(e=this.cwd,t={withFileTypes:true}){if(typeof e==="string"){e=this.cwd.resolve(e)}else if(!(e instanceof PathBase)){t=e;e=this.cwd}const{withFileTypes:r=true}=t;if(!e.canReaddir()){return[]}else if(r){return e.readdirSync()}else{return e.readdirSync().map((e=>e.name))}}async lstat(e=this.cwd){if(typeof e==="string"){e=this.cwd.resolve(e)}return e.lstat()}lstatSync(e=this.cwd){if(typeof e==="string"){e=this.cwd.resolve(e)}return e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:false}){if(typeof e==="string"){e=this.cwd.resolve(e)}else if(!(e instanceof PathBase)){t=e.withFileTypes;e=this.cwd}const r=await e.readlink();return t?r:r?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:false}){if(typeof e==="string"){e=this.cwd.resolve(e)}else if(!(e instanceof PathBase)){t=e.withFileTypes;e=this.cwd}const r=e.readlinkSync();return t?r:r?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:false}){if(typeof e==="string"){e=this.cwd.resolve(e)}else if(!(e instanceof PathBase)){t=e.withFileTypes;e=this.cwd}const r=await e.realpath();return t?r:r?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:false}){if(typeof e==="string"){e=this.cwd.resolve(e)}else if(!(e instanceof PathBase)){t=e.withFileTypes;e=this.cwd}const r=e.realpathSync();return t?r:r?.fullpath()}async walk(e=this.cwd,t={}){if(typeof e==="string"){e=this.cwd.resolve(e)}else if(!(e instanceof PathBase)){t=e;e=this.cwd}const{withFileTypes:r=true,follow:i=false,filter:n,walkFilter:s}=t;const o=[];if(!n||n(e)){o.push(r?e:e.fullpath())}const a=new Set;const walk=(e,t)=>{a.add(e);e.readdirCB(((e,c)=>{if(e){return t(e)}let u=c.length;if(!u)return t();const next=()=>{if(--u===0){t()}};for(const e of c){if(!n||n(e)){o.push(r?e:e.fullpath())}if(i&&e.isSymbolicLink()){e.realpath().then((e=>e?.isUnknown()?e.lstat():e)).then((e=>e?.shouldWalk(a,s)?walk(e,next):next()))}else{if(e.shouldWalk(a,s)){walk(e,next)}else{next()}}}}),true)};const c=e;return new Promise(((e,t)=>{walk(c,(r=>{if(r)return t(r);e(o)}))}))}walkSync(e=this.cwd,t={}){if(typeof e==="string"){e=this.cwd.resolve(e)}else if(!(e instanceof PathBase)){t=e;e=this.cwd}const{withFileTypes:r=true,follow:i=false,filter:n,walkFilter:s}=t;const o=[];if(!n||n(e)){o.push(r?e:e.fullpath())}const a=new Set([e]);for(const e of a){const t=e.readdirSync();for(const e of t){if(!n||n(e)){o.push(r?e:e.fullpath())}let t=e;if(e.isSymbolicLink()){if(!(i&&(t=e.realpathSync())))continue;if(t.isUnknown())t.lstatSync()}if(t.shouldWalk(a,s)){a.add(t)}}}return o}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){if(typeof e==="string"){e=this.cwd.resolve(e)}else if(!(e instanceof PathBase)){t=e;e=this.cwd}return this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){if(typeof e==="string"){e=this.cwd.resolve(e)}else if(!(e instanceof PathBase)){t=e;e=this.cwd}const{withFileTypes:r=true,follow:i=false,filter:n,walkFilter:s}=t;if(!n||n(e)){yield r?e:e.fullpath()}const o=new Set([e]);for(const e of o){const t=e.readdirSync();for(const e of t){if(!n||n(e)){yield r?e:e.fullpath()}let t=e;if(e.isSymbolicLink()){if(!(i&&(t=e.realpathSync())))continue;if(t.isUnknown())t.lstatSync()}if(t.shouldWalk(o,s)){o.add(t)}}}}stream(e=this.cwd,t={}){if(typeof e==="string"){e=this.cwd.resolve(e)}else if(!(e instanceof PathBase)){t=e;e=this.cwd}const{withFileTypes:r=true,follow:i=false,filter:n,walkFilter:s}=t;const o=new Minipass({objectMode:true});if(!n||n(e)){o.write(r?e:e.fullpath())}const a=new Set;const c=[e];let u=0;const process=()=>{let e=false;while(!e){const t=c.shift();if(!t){if(u===0)o.end();return}u++;a.add(t);const onReaddir=(t,h,p=false)=>{if(t)return o.emit("error",t);if(i&&!p){const e=[];for(const t of h){if(t.isSymbolicLink()){e.push(t.realpath().then((e=>e?.isUnknown()?e.lstat():e)))}}if(e.length){Promise.all(e).then((()=>onReaddir(null,h,true)));return}}for(const t of h){if(t&&(!n||n(t))){if(!o.write(r?t:t.fullpath())){e=true}}}u--;for(const e of h){const t=e.realpathCached()||e;if(t.shouldWalk(a,s)){c.push(t)}}if(e&&!o.flowing){o.once("drain",process)}else if(!l){process()}};let l=true;t.readdirCB(onReaddir,true);l=false}};process();return o}streamSync(e=this.cwd,t={}){if(typeof e==="string"){e=this.cwd.resolve(e)}else if(!(e instanceof PathBase)){t=e;e=this.cwd}const{withFileTypes:r=true,follow:i=false,filter:n,walkFilter:s}=t;const o=new Minipass({objectMode:true});const a=new Set;if(!n||n(e)){o.write(r?e:e.fullpath())}const c=[e];let u=0;const process=()=>{let e=false;while(!e){const t=c.shift();if(!t){if(u===0)o.end();return}u++;a.add(t);const l=t.readdirSync();for(const t of l){if(!n||n(t)){if(!o.write(r?t:t.fullpath())){e=true}}}u--;for(const e of l){let t=e;if(e.isSymbolicLink()){if(!(i&&(t=e.realpathSync())))continue;if(t.isUnknown())t.lstatSync()}if(t.shouldWalk(a,s)){c.push(t)}}}if(e&&!o.flowing)o.once("drain",process)};process();return o}chdir(e=this.cwd){const t=this.cwd;this.cwd=typeof e==="string"?this.cwd.resolve(e):e;this.cwd[At](t)}}class PathScurryWin32 extends PathScurryBase{sep="\\";constructor(e=process.cwd(),t={}){const{nocase:r=true}=t;super(e,ge.win32,"\\",{...t,nocase:r});this.nocase=r;for(let e=this.cwd;e;e=e.parent){e.nocase=this.nocase}}parseRootPath(e){return ge.win32.parse(e).root.toUpperCase()}newRoot(e){return new PathWin32(this.rootPath,ct,undefined,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}}class PathScurryPosix extends PathScurryBase{sep="/";constructor(e=process.cwd(),t={}){const{nocase:r=false}=t;super(e,ge.posix,"/",{...t,nocase:r});this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new PathPosix(this.rootPath,ct,undefined,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}}class PathScurryDarwin extends PathScurryPosix{constructor(e=process.cwd(),t={}){const{nocase:r=true}=t;super(e,{...t,nocase:r})}}const Ct=process.platform==="win32"?PathWin32:PathPosix;const Pt=process.platform==="win32"?PathScurryWin32:process.platform==="darwin"?PathScurryDarwin:PathScurryPosix;const isPatternList=e=>e.length>=1;const isGlobList=e=>e.length>=1;class Pattern{#rt;#it;#nt;length;#st;#ot;#at;#ct;#ut;#lt;#ht=true;constructor(e,t,r,i){if(!isPatternList(e)){throw new TypeError("empty pattern list")}if(!isGlobList(t)){throw new TypeError("empty glob list")}if(t.length!==e.length){throw new TypeError("mismatched pattern list and glob list lengths")}this.length=e.length;if(r<0||r>=this.length){throw new TypeError("index out of range")}this.#rt=e;this.#it=t;this.#nt=r;this.#st=i;if(this.#nt===0){if(this.isUNC()){const[e,t,r,i,...n]=this.#rt;const[s,o,a,c,...u]=this.#it;if(n[0]===""){n.shift();u.shift()}const l=[e,t,r,i,""].join("/");const h=[s,o,a,c,""].join("/");this.#rt=[l,...n];this.#it=[h,...u];this.length=this.#rt.length}else if(this.isDrive()||this.isAbsolute()){const[e,...t]=this.#rt;const[r,...i]=this.#it;if(t[0]===""){t.shift();i.shift()}const n=e+"/";const s=r+"/";this.#rt=[n,...t];this.#it=[s,...i];this.length=this.#rt.length}}}pattern(){return this.#rt[this.#nt]}isString(){return typeof this.#rt[this.#nt]==="string"}isGlobstar(){return this.#rt[this.#nt]===ie}isRegExp(){return this.#rt[this.#nt]instanceof RegExp}globString(){return this.#at=this.#at||(this.#nt===0?this.isAbsolute()?this.#it[0]+this.#it.slice(1).join("/"):this.#it.join("/"):this.#it.slice(this.#nt).join("/"))}hasMore(){return this.length>this.#nt+1}rest(){if(this.#ot!==undefined)return this.#ot;if(!this.hasMore())return this.#ot=null;this.#ot=new Pattern(this.#rt,this.#it,this.#nt+1,this.#st);this.#ot.#lt=this.#lt;this.#ot.#ut=this.#ut;this.#ot.#ct=this.#ct;return this.#ot}isUNC(){const e=this.#rt;return this.#ut!==undefined?this.#ut:this.#ut=this.#st==="win32"&&this.#nt===0&&e[0]===""&&e[1]===""&&typeof e[2]==="string"&&!!e[2]&&typeof e[3]==="string"&&!!e[3]}isDrive(){const e=this.#rt;return this.#ct!==undefined?this.#ct:this.#ct=this.#st==="win32"&&this.#nt===0&&this.length>1&&typeof e[0]==="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){const e=this.#rt;return this.#lt!==undefined?this.#lt:this.#lt=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){const e=this.#rt[0];return typeof e==="string"&&this.isAbsolute()&&this.#nt===0?e:""}checkFollowGlobstar(){return!(this.#nt===0||!this.isGlobstar()||!this.#ht)}markFollowGlobstar(){if(this.#nt===0||!this.isGlobstar()||!this.#ht)return false;this.#ht=false;return true}}const Mt=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:n,platform:s=Mt}){this.relative=[];this.absolute=[];this.relativeChildren=[];this.absoluteChildren=[];this.platform=s;this.mmopts={dot:true,nobrace:t,nocase:r,noext:i,noglobstar:n,optimizationLevel:2,platform:s,nocomment:true,nonegate:true};for(const t of e)this.add(t)}add(e){const t=new Minimatch(e,this.mmopts);for(let e=0;e<t.set.length;e++){const r=t.set[e];const i=t.globParts[e];if(!r||!i){throw new Error("invalid pattern object")}while(r[0]==="."&&i[0]==="."){r.shift();i.shift()}const n=new Pattern(r,i,0,this.platform);const s=new Minimatch(n.globString(),this.mmopts);const o=i[i.length-1]==="**";const a=n.isAbsolute();if(a)this.absolute.push(s);else this.relative.push(s);if(o){if(a)this.absoluteChildren.push(s);else this.relativeChildren.push(s)}}}ignored(e){const t=e.fullpath();const r=`${t}/`;const i=e.relative()||".";const n=`${i}/`;for(const e of this.relative){if(e.match(i)||e.match(n))return true}for(const e of this.absolute){if(e.match(t)||e.match(r))return true}return false}childrenIgnored(e){const t=e.fullpath()+"/";const r=(e.relative()||".")+"/";for(const e of this.relativeChildren){if(e.match(r))return true}for(const e of this.absoluteChildren){if(e.match(t))return true}return false}}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){const r=e.fullpath();const i=this.store.get(r);if(i)i.add(t.globString());else this.store.set(r,new Set([t.globString()]))}}class MatchRecord{store=new Map;add(e,t,r){const i=(t?2:0)|(r?1:0);const n=this.store.get(e);this.store.set(e,n===undefined?i:i&n)}entries(){return[...this.store.entries()].map((([e,t])=>[e,!!(t&2),!!(t&1)]))}}class SubWalks{store=new Map;add(e,t){if(!e.canReaddir()){return}const r=this.store.get(e);if(r){if(!r.find((e=>e.globString()===t.globString()))){r.push(t)}}else this.store.set(e,[t])}get(e){const t=this.store.get(e);if(!t){throw new 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()))}}class Processor{hasWalkedCache;matches=new MatchRecord;subwalks=new SubWalks;patterns;follow;dot;opts;constructor(e,t){this.opts=e;this.follow=!!e.follow;this.dot=!!e.dot;this.hasWalkedCache=t?t.copy():new HasWalkedCache}processPatterns(e,t){this.patterns=t;const r=t.map((t=>[e,t]));for(let[e,t]of r){this.hasWalkedCache.storeWalked(e,t);const r=t.root();const i=t.isAbsolute()&&this.opts.absolute!==false;if(r){e=e.resolve(r==="/"&&this.opts.root!==undefined?this.opts.root:r);const i=t.rest();if(!i){this.matches.add(e,true,false);continue}else{t=i}}if(e.isENOENT())continue;let n;let s;let o=false;while(typeof(n=t.pattern())==="string"&&(s=t.rest())){const r=e.resolve(n);e=r;t=s;o=true}n=t.pattern();s=t.rest();if(o){if(this.hasWalkedCache.hasWalked(e,t))continue;this.hasWalkedCache.storeWalked(e,t)}if(typeof n==="string"){const t=n===".."||n===""||n===".";this.matches.add(e.resolve(n),i,t);continue}else if(n===ie){if(!e.isSymbolicLink()||this.follow||t.checkFollowGlobstar()){this.subwalks.add(e,t)}const r=s?.pattern();const n=s?.rest();if(!s||(r===""||r===".")&&!n){this.matches.add(e,i,r===""||r===".")}else{if(r===".."){const t=e.parent||e;if(!n)this.matches.add(t,i,true);else if(!this.hasWalkedCache.hasWalked(t,n)){this.subwalks.add(t,n)}}}}else if(n instanceof RegExp){this.subwalks.add(e,t)}}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new Processor(this.opts,this.hasWalkedCache)}filterEntries(e,t){const r=this.subwalks.get(e);const i=this.child();for(const e of t){for(const t of r){const r=t.isAbsolute();const n=t.pattern();const s=t.rest();if(n===ie){i.testGlobstar(e,t,s,r)}else if(n instanceof RegExp){i.testRegExp(e,n,s,r)}else{i.testString(e,n,s,r)}}}return i}testGlobstar(e,t,r,i){if(this.dot||!e.name.startsWith(".")){if(!t.hasMore()){this.matches.add(e,i,false)}if(e.canReaddir()){if(this.follow||!e.isSymbolicLink()){this.subwalks.add(e,t)}else if(e.isSymbolicLink()){if(r&&t.checkFollowGlobstar()){this.subwalks.add(e,r)}else if(t.markFollowGlobstar()){this.subwalks.add(e,t)}}}}if(r){const t=r.pattern();if(typeof t==="string"&&t!==".."&&t!==""&&t!=="."){this.testString(e,t,r.rest(),i)}else if(t===".."){const t=e.parent||e;this.subwalks.add(t,r)}else if(t instanceof RegExp){this.testRegExp(e,t,r.rest(),i)}}}testRegExp(e,t,r,i){if(!t.test(e.name))return;if(!r){this.matches.add(e,i,false)}else{this.subwalks.add(e,r)}}testString(e,t,r,i){if(!e.isNamed(t))return;if(!r){this.matches.add(e,i,false)}else{this.subwalks.add(e,r)}}}const makeIgnore=(e,t)=>typeof e==="string"?new Ignore([e],t):Array.isArray(e)?new Ignore(e,t):e;class GlobUtil{path;patterns;opts;seen=new Set;paused=false;aborted=false;#ft=[];#pt;#dt;signal;maxDepth;includeChildMatches;constructor(e,t,r){this.patterns=e;this.path=t;this.opts=r;this.#dt=!r.posix&&r.platform==="win32"?"\\":"/";this.includeChildMatches=r.includeChildMatches!==false;if(r.ignore||!this.includeChildMatches){this.#pt=makeIgnore(r.ignore??[],r);if(!this.includeChildMatches&&typeof this.#pt.add!=="function"){const e="cannot ignore child matches, ignore lacks add() method.";throw new Error(e)}}this.maxDepth=r.maxDepth||Infinity;if(r.signal){this.signal=r.signal;this.signal.addEventListener("abort",(()=>{this.#ft.length=0}))}}#mt(e){return this.seen.has(e)||!!this.#pt?.ignored?.(e)}#gt(e){return!!this.#pt?.childrenIgnored?.(e)}pause(){this.paused=true}resume(){if(this.signal?.aborted)return;this.paused=false;let e=undefined;while(!this.paused&&(e=this.#ft.shift())){e()}}onResume(e){if(this.signal?.aborted)return;if(!this.paused){e()}else{this.#ft.push(e)}}async matchCheck(e,t){if(t&&this.opts.nodir)return undefined;let r;if(this.opts.realpath){r=e.realpathCached()||await e.realpath();if(!r)return undefined;e=r}const i=e.isUnknown()||this.opts.stat;const n=i?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){const e=await n.realpath();if(e&&(e.isUnknown()||this.opts.stat)){await e.lstat()}}return this.matchCheckTest(n,t)}matchCheckTest(e,t){return e&&(this.maxDepth===Infinity||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#mt(e)?e:undefined}matchCheckSync(e,t){if(t&&this.opts.nodir)return undefined;let r;if(this.opts.realpath){r=e.realpathCached()||e.realpathSync();if(!r)return undefined;e=r}const i=e.isUnknown()||this.opts.stat;const n=i?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){const e=n.realpathSync();if(e&&(e?.isUnknown()||this.opts.stat)){e.lstatSync()}}return this.matchCheckTest(n,t)}matchFinish(e,t){if(this.#mt(e))return;if(!this.includeChildMatches&&this.#pt?.add){const t=`${e.relativePosix()}/**`;this.#pt.add(t)}const r=this.opts.absolute===undefined?t:this.opts.absolute;this.seen.add(e);const i=this.opts.mark&&e.isDirectory()?this.#dt:"";if(this.opts.withFileTypes){this.matchEmit(e)}else if(r){const t=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(t+i)}else{const t=this.opts.posix?e.relativePosix():e.relative();const r=this.opts.dotRelative&&!t.startsWith(".."+this.#dt)?"."+this.#dt:"";this.matchEmit(!t?"."+i:r+t+i)}}async match(e,t,r){const i=await this.matchCheck(e,r);if(i)this.matchFinish(i,t)}matchSync(e,t,r){const i=this.matchCheckSync(e,r);if(i)this.matchFinish(i,t)}walkCB(e,t,r){if(this.signal?.aborted)r();this.walkCB2(e,t,new Processor(this.opts),r)}walkCB2(e,t,r,i){if(this.#gt(e))return i();if(this.signal?.aborted)i();if(this.paused){this.onResume((()=>this.walkCB2(e,t,r,i)));return}r.processPatterns(e,t);let n=1;const next=()=>{if(--n===0)i()};for(const[e,t,i]of r.matches.entries()){if(this.#mt(e))continue;n++;this.match(e,t,i).then((()=>next()))}for(const e of r.subwalkTargets()){if(this.maxDepth!==Infinity&&e.depth()>=this.maxDepth){continue}n++;const t=e.readdirCached();if(e.calledReaddir())this.walkCB3(e,t,r,next);else{e.readdirCB(((t,i)=>this.walkCB3(e,i,r,next)),true)}}next()}walkCB3(e,t,r,i){r=r.filterEntries(e,t);let n=1;const next=()=>{if(--n===0)i()};for(const[e,t,i]of r.matches.entries()){if(this.#mt(e))continue;n++;this.match(e,t,i).then((()=>next()))}for(const[e,t]of r.subwalks.entries()){n++;this.walkCB2(e,t,r.child(),next)}next()}walkCBSync(e,t,r){if(this.signal?.aborted)r();this.walkCB2Sync(e,t,new Processor(this.opts),r)}walkCB2Sync(e,t,r,i){if(this.#gt(e))return i();if(this.signal?.aborted)i();if(this.paused){this.onResume((()=>this.walkCB2Sync(e,t,r,i)));return}r.processPatterns(e,t);let n=1;const next=()=>{if(--n===0)i()};for(const[e,t,i]of r.matches.entries()){if(this.#mt(e))continue;this.matchSync(e,t,i)}for(const e of r.subwalkTargets()){if(this.maxDepth!==Infinity&&e.depth()>=this.maxDepth){continue}n++;const t=e.readdirSync();this.walkCB3Sync(e,t,r,next)}next()}walkCB3Sync(e,t,r,i){r=r.filterEntries(e,t);let n=1;const next=()=>{if(--n===0)i()};for(const[e,t,i]of r.matches.entries()){if(this.#mt(e))continue;this.matchSync(e,t,i)}for(const[e,t]of r.subwalks.entries()){n++;this.walkCB2Sync(e,t,r.child(),next)}next()}}class GlobWalker extends GlobUtil{matches=new Set;constructor(e,t,r){super(e,t,r)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown()){await this.path.lstat()}await new Promise(((e,t)=>{this.walkCB(this.path,this.patterns,(()=>{if(this.signal?.aborted){t(this.signal.reason)}else{e(this.matches)}}))}));return this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown()){this.path.lstatSync()}this.walkCBSync(this.path,this.patterns,(()=>{if(this.signal?.aborted)throw this.signal.reason}));return this.matches}}class GlobStream extends GlobUtil{results;constructor(e,t,r){super(e,t,r);this.results=new Minipass({signal:this.signal,objectMode:true});this.results.on("drain",(()=>this.resume()));this.results.on("resume",(()=>this.resume()))}matchEmit(e){this.results.write(e);if(!this.results.flowing)this.pause()}stream(){const e=this.path;if(e.isUnknown()){e.lstat().then((()=>{this.walkCB(e,this.patterns,(()=>this.results.end()))}))}else{this.walkCB(e,this.patterns,(()=>this.results.end()))}return this.results}streamSync(){if(this.path.isUnknown()){this.path.lstatSync()}this.walkCBSync(this.path,this.patterns,(()=>this.results.end()));return this.results}}const Rt=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(e,t){if(!t)throw new TypeError("glob options required");this.withFileTypes=!!t.withFileTypes;this.signal=t.signal;this.follow=!!t.follow;this.dot=!!t.dot;this.dotRelative=!!t.dotRelative;this.nodir=!!t.nodir;this.mark=!!t.mark;if(!t.cwd){this.cwd=""}else if(t.cwd instanceof URL||t.cwd.startsWith("file://")){t.cwd=(0,ue.fileURLToPath)(t.cwd)}this.cwd=t.cwd||"";this.root=t.root;this.magicalBraces=!!t.magicalBraces;this.nobrace=!!t.nobrace;this.noext=!!t.noext;this.realpath=!!t.realpath;this.absolute=t.absolute;this.includeChildMatches=t.includeChildMatches!==false;this.noglobstar=!!t.noglobstar;this.matchBase=!!t.matchBase;this.maxDepth=typeof t.maxDepth==="number"?t.maxDepth:Infinity;this.stat=!!t.stat;this.ignore=t.ignore;if(this.withFileTypes&&this.absolute!==undefined){throw new Error("cannot set absolute and withFileTypes:true")}if(typeof e==="string"){e=[e]}this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===false;if(this.windowsPathsNoEscape){e=e.map((e=>e.replace(/\\/g,"/")))}if(this.matchBase){if(t.noglobstar){throw new TypeError("base matching requires globstar")}e=e.map((e=>e.includes("/")?e:`./**/${e}`))}this.pattern=e;this.platform=t.platform||Rt;this.opts={...t,platform:this.platform};if(t.scurry){this.scurry=t.scurry;if(t.nocase!==undefined&&t.nocase!==t.scurry.nocase){throw new Error("nocase option contradicts provided scurry option")}}else{const e=t.platform==="win32"?PathScurryWin32:t.platform==="darwin"?PathScurryDarwin:t.platform?PathScurryPosix:Pt;this.scurry=new e(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;const r=this.platform==="darwin"||this.platform==="win32";const i={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:r,nocomment:true,noext:this.noext,nonegate:true,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug};const n=this.pattern.map((e=>new Minimatch(e,i)));const[s,o]=n.reduce(((e,t)=>{e[0].push(...t.set);e[1].push(...t.globParts);return e}),[[],[]]);this.patterns=s.map(((e,t)=>{const r=o[t];if(!r)throw new Error("invalid pattern object");return new Pattern(e,r,0,this.platform)}))}async walk(){return[...await new GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}const hasMagic=(e,t={})=>{if(!Array.isArray(e)){e=[e]}for(const r of e){if(new Minimatch(r,t).hasMagic())return true}return false};function globStreamSync(e,t={}){return new Glob(e,t).streamSync()}function globStream(e,t={}){return new Glob(e,t).stream()}function globSync(e,t={}){return new Glob(e,t).walkSync()}async function glob_(e,t={}){return new Glob(e,t).walk()}function globIterateSync(e,t={}){return new Glob(e,t).iterateSync()}function globIterate(e,t={}){return new Glob(e,t).iterate()}const jt=globStreamSync;const Tt=Object.assign(globStream,{sync:globStreamSync});const Nt=globIterateSync;const Ft=Object.assign(globIterate,{sync:globIterateSync});const It=Object.assign(globSync,{stream:globStreamSync,iterate:globIterateSync});const Lt=Object.assign(glob_,{glob:glob_,globSync:globSync,sync:It,globStream:globStream,stream:Tt,globStreamSync:globStreamSync,streamSync:jt,globIterate:globIterate,iterate:Ft,globIterateSync:globIterateSync,iterateSync:Nt,Glob:Glob,hasMagic:hasMagic,escape:escape_escape,unescape:unescape_unescape});Lt.glob=Lt;const typeOrUndef=(e,t)=>typeof e==="undefined"||typeof e===t;const isRimrafOptions=e=>!!e&&typeof e==="object"&&typeOrUndef(e.preserveRoot,"boolean")&&typeOrUndef(e.tmp,"string")&&typeOrUndef(e.maxRetries,"number")&&typeOrUndef(e.retryDelay,"number")&&typeOrUndef(e.backoff,"number")&&typeOrUndef(e.maxBackoff,"number")&&(typeOrUndef(e.glob,"boolean")||e.glob&&typeof e.glob==="object")&&typeOrUndef(e.filter,"function");const assertRimrafOptions=e=>{if(!isRimrafOptions(e)){throw new Error("invalid rimraf options")}};const optArgT=e=>{assertRimrafOptions(e);const{glob:t,...r}=e;if(!t){return r}const i=t===true?e.signal?{signal:e.signal}:{}:e.signal?{signal:e.signal,...t}:t;return{...r,glob:{...i,absolute:true,withFileTypes:false}}};const optArg=(e={})=>optArgT(e);const optArgSync=(e={})=>optArgT(e);var $t=__nccwpck_require__(3837);const pathArg=(e,t={})=>{const r=typeof e;if(r!=="string"){const t=e&&r==="object"&&e.constructor;const i=t&&t.name?`an instance of ${t.name}`:r==="object"?(0,$t.inspect)(e):`type ${r} ${e}`;const n='The "path" argument must be of type string. '+`Received ${i}`;throw Object.assign(new TypeError(n),{path:e,code:"ERR_INVALID_ARG_TYPE"})}if(/\0/.test(e)){const t="path must be a string without null bytes";throw Object.assign(new TypeError(t),{path:e,code:"ERR_INVALID_ARG_VALUE"})}e=(0,o.resolve)(e);const{root:i}=(0,o.parse)(e);if(e===i&&t.preserveRoot!==false){const t="refusing to remove root directory without preserveRoot:false";throw Object.assign(new Error(t),{path:e,code:"ERR_PRESERVE_ROOT"})}if(process.platform==="win32"){const t=/[*|"<>?:]/;const{root:r}=(0,o.parse)(e);if(t.test(e.substring(r.length))){throw Object.assign(new Error("Illegal characters in path."),{path:e,code:"EINVAL"})}}return e};const Dt=pathArg;const Bt=require("fs/promises");const readdirSync=e=>(0,g.readdirSync)(e,{withFileTypes:true});const Gt={chmod:Bt.chmod,mkdir:Bt.mkdir,readdir:e=>Bt.readdir(e,{withFileTypes:true}),rename:Bt.rename,rm:Bt.rm,rmdir:Bt.rmdir,stat:Bt.stat,lstat:Bt.lstat,unlink:Bt.unlink};const{readdir:zt}=Gt;const readdirOrError=e=>zt(e).catch((e=>e));const readdirOrErrorSync=e=>{try{return readdirSync(e)}catch(e){return e}};const isRecord=e=>!!e&&typeof e==="object";const hasString=(e,t)=>t in e&&typeof e[t]==="string";const isFsError=e=>isRecord(e)&&hasString(e,"code")&&hasString(e,"path");const errorCode=e=>isRecord(e)&&hasString(e,"code")?e.code:null;const ignoreENOENT=async(e,t)=>e.catch((e=>{if(errorCode(e)==="ENOENT"){return}throw t??e}));const ignoreENOENTSync=(e,t)=>{try{return e()}catch(e){if(errorCode(e)==="ENOENT"){return}throw t??e}};const{lstat:Wt,rmdir:qt,unlink:Ut}=Gt;const rimrafPosix=async(e,t)=>{t?.signal?.throwIfAborted();return await ignoreENOENT(Wt(e).then((r=>rimrafPosixDir(e,t,r))))??true};const rimrafPosixSync=(e,t)=>{t?.signal?.throwIfAborted();return ignoreENOENTSync((()=>rimrafPosixDirSync(e,t,(0,g.lstatSync)(e))))??true};const rimrafPosixDir=async(e,t,r)=>{t?.signal?.throwIfAborted();const i=r.isDirectory()?await readdirOrError(e):null;if(!Array.isArray(i)){if(i){if(errorCode(i)==="ENOENT"){return true}if(errorCode(i)!=="ENOTDIR"){throw i}}if(t.filter&&!await t.filter(e,r)){return false}await ignoreENOENT(Ut(e));return true}const n=(await Promise.all(i.map((r=>rimrafPosixDir((0,o.resolve)(e,r.name),t,r))))).every((e=>e===true));if(!n){return false}if(t.preserveRoot===false&&e===(0,o.parse)(e).root){return false}if(t.filter&&!await t.filter(e,r)){return false}await ignoreENOENT(qt(e));return true};const rimrafPosixDirSync=(e,t,r)=>{t?.signal?.throwIfAborted();const i=r.isDirectory()?readdirOrErrorSync(e):null;if(!Array.isArray(i)){if(i){if(errorCode(i)==="ENOENT"){return true}if(errorCode(i)!=="ENOTDIR"){throw i}}if(t.filter&&!t.filter(e,r)){return false}ignoreENOENTSync((()=>(0,g.unlinkSync)(e)));return true}let n=true;for(const r of i){const i=(0,o.resolve)(e,r.name);n=rimrafPosixDirSync(i,t,r)&&n}if(t.preserveRoot===false&&e===(0,o.parse)(e).root){return false}if(!n){return false}if(t.filter&&!t.filter(e,r)){return false}ignoreENOENTSync((()=>(0,g.rmdirSync)(e)));return true};const{chmod:Vt}=Gt;const fixEPERM=e=>async t=>{try{return void await ignoreENOENT(e(t))}catch(r){if(errorCode(r)==="EPERM"){if(!await ignoreENOENT(Vt(t,438).then((()=>true)),r)){return}return void await e(t)}throw r}};const fixEPERMSync=e=>t=>{try{return void ignoreENOENTSync((()=>e(t)))}catch(r){if(errorCode(r)==="EPERM"){if(!ignoreENOENTSync((()=>((0,g.chmodSync)(t,438),true)),r)){return}return void e(t)}throw r}};const Ht=require("timers/promises");const Yt=200;const Qt=1.2;const Jt=10;const Kt=new Set(["EMFILE","ENFILE","EBUSY"]);const retryBusy=e=>{const method=async(t,r,i=1,n=0)=>{const s=r.maxBackoff||Yt;const o=r.backoff||Qt;const a=r.maxRetries||Jt;let c=0;while(true){try{return await e(t)}catch(e){if(isFsError(e)&&e.path===t&&Kt.has(e.code)){i=Math.ceil(i*o);n=i+n;if(n<s){await(0,Ht.setTimeout)(i);return method(t,r,i,n)}if(c<a){c++;continue}}throw e}}};return method};const retryBusySync=e=>{const method=(t,r)=>{const i=r.maxRetries||Jt;let n=0;while(true){try{return e(t)}catch(e){if(isFsError(e)&&e.path===t&&Kt.has(e.code)&&n<i){n++;continue}throw e}}};return method};const{stat:Zt}=Gt;const isDirSync=e=>{try{return(0,g.statSync)(e).isDirectory()}catch{return false}};const isDir=e=>Zt(e).then((e=>e.isDirectory()),(()=>false));const win32DefaultTmp=async e=>{const{root:t}=(0,o.parse)(e);const r=(0,y.tmpdir)();const{root:i}=(0,o.parse)(r);if(t.toLowerCase()===i.toLowerCase()){return r}const n=(0,o.resolve)(t,"/temp");if(await isDir(n)){return n}return t};const win32DefaultTmpSync=e=>{const{root:t}=(0,o.parse)(e);const r=(0,y.tmpdir)();const{root:i}=(0,o.parse)(r);if(t.toLowerCase()===i.toLowerCase()){return r}const n=(0,o.resolve)(t,"/temp");if(isDirSync(n)){return n}return t};const posixDefaultTmp=async()=>(0,y.tmpdir)();const posixDefaultTmpSync=()=>(0,y.tmpdir)();const Xt=process.platform==="win32"?win32DefaultTmp:posixDefaultTmp;const er=process.platform==="win32"?win32DefaultTmpSync:posixDefaultTmpSync;const{lstat:tr,rename:rr,unlink:ir,rmdir:nr}=Gt;const uniqueFilename=e=>`.${(0,o.basename)(e)}.${Math.random()}`;const sr=fixEPERM(ir);const or=fixEPERMSync(g.unlinkSync);const rimrafMoveRemove=async(e,t)=>{t?.signal?.throwIfAborted();return await ignoreENOENT(tr(e).then((r=>rimrafMoveRemoveDir(e,t,r))))??true};const rimrafMoveRemoveDir=async(e,t,r)=>{t?.signal?.throwIfAborted();if(!t.tmp){return rimrafMoveRemoveDir(e,{...t,tmp:await Xt(e)},r)}if(e===t.tmp&&(0,o.parse)(e).root!==e){throw new Error("cannot delete temp directory used for deletion")}const i=r.isDirectory()?await readdirOrError(e):null;if(!Array.isArray(i)){if(i){if(errorCode(i)==="ENOENT"){return true}if(errorCode(i)!=="ENOTDIR"){throw i}}if(t.filter&&!await t.filter(e,r)){return false}await ignoreENOENT(tmpUnlink(e,t.tmp,sr));return true}const n=(await Promise.all(i.map((r=>rimrafMoveRemoveDir((0,o.resolve)(e,r.name),t,r))))).every((e=>e===true));if(!n){return false}if(t.preserveRoot===false&&e===(0,o.parse)(e).root){return false}if(t.filter&&!await t.filter(e,r)){return false}await ignoreENOENT(tmpUnlink(e,t.tmp,nr));return true};const tmpUnlink=async(e,t,r)=>{const i=(0,o.resolve)(t,uniqueFilename(e));await rr(e,i);return await r(i)};const rimrafMoveRemoveSync=(e,t)=>{t?.signal?.throwIfAborted();return ignoreENOENTSync((()=>rimrafMoveRemoveDirSync(e,t,(0,g.lstatSync)(e))))??true};const rimrafMoveRemoveDirSync=(e,t,r)=>{t?.signal?.throwIfAborted();if(!t.tmp){return rimrafMoveRemoveDirSync(e,{...t,tmp:er(e)},r)}const i=t.tmp;if(e===t.tmp&&(0,o.parse)(e).root!==e){throw new Error("cannot delete temp directory used for deletion")}const n=r.isDirectory()?readdirOrErrorSync(e):null;if(!Array.isArray(n)){if(n){if(errorCode(n)==="ENOENT"){return true}if(errorCode(n)!=="ENOTDIR"){throw n}}if(t.filter&&!t.filter(e,r)){return false}ignoreENOENTSync((()=>tmpUnlinkSync(e,i,or)));return true}let s=true;for(const r of n){const i=(0,o.resolve)(e,r.name);s=rimrafMoveRemoveDirSync(i,t,r)&&s}if(!s){return false}if(t.preserveRoot===false&&e===(0,o.parse)(e).root){return false}if(t.filter&&!t.filter(e,r)){return false}ignoreENOENTSync((()=>tmpUnlinkSync(e,i,g.rmdirSync)));return true};const tmpUnlinkSync=(e,t,r)=>{const i=(0,o.resolve)(t,uniqueFilename(e));(0,g.renameSync)(e,i);return r(i)};const{unlink:ar,rmdir:cr,lstat:ur}=Gt;const lr=retryBusy(fixEPERM(ar));const hr=retryBusySync(fixEPERMSync(g.unlinkSync));const fr=retryBusy(fixEPERM(cr));const pr=retryBusySync(fixEPERMSync(g.rmdirSync));const rimrafWindowsDirMoveRemoveFallback=async(e,{filter:t,...r})=>{r?.signal?.throwIfAborted();try{await fr(e,r);return true}catch(t){if(errorCode(t)==="ENOTEMPTY"){return rimrafMoveRemove(e,r)}throw t}};const rimrafWindowsDirMoveRemoveFallbackSync=(e,{filter:t,...r})=>{r?.signal?.throwIfAborted();try{pr(e,r);return true}catch(t){if(errorCode(t)==="ENOTEMPTY"){return rimrafMoveRemoveSync(e,r)}throw t}};const dr=Symbol("start");const mr=Symbol("child");const gr=Symbol("finish");const rimrafWindows=async(e,t)=>{t?.signal?.throwIfAborted();return await ignoreENOENT(ur(e).then((r=>rimrafWindowsDir(e,t,r,dr))))??true};const rimrafWindowsSync=(e,t)=>{t?.signal?.throwIfAborted();return ignoreENOENTSync((()=>rimrafWindowsDirSync(e,t,(0,g.lstatSync)(e),dr)))??true};const rimrafWindowsDir=async(e,t,r,i=dr)=>{t?.signal?.throwIfAborted();const n=r.isDirectory()?await readdirOrError(e):null;if(!Array.isArray(n)){if(n){if(errorCode(n)==="ENOENT"){return true}if(errorCode(n)!=="ENOTDIR"){throw n}}if(t.filter&&!await t.filter(e,r)){return false}await ignoreENOENT(lr(e,t));return true}const s=i===dr?mr:i;const a=(await Promise.all(n.map((r=>rimrafWindowsDir((0,o.resolve)(e,r.name),t,r,s))))).every((e=>e===true));if(i===dr){return rimrafWindowsDir(e,t,r,gr)}else if(i===gr){if(t.preserveRoot===false&&e===(0,o.parse)(e).root){return false}if(!a){return false}if(t.filter&&!await t.filter(e,r)){return false}await ignoreENOENT(rimrafWindowsDirMoveRemoveFallback(e,t))}return true};const rimrafWindowsDirSync=(e,t,r,i=dr)=>{const n=r.isDirectory()?readdirOrErrorSync(e):null;if(!Array.isArray(n)){if(n){if(errorCode(n)==="ENOENT"){return true}if(errorCode(n)!=="ENOTDIR"){throw n}}if(t.filter&&!t.filter(e,r)){return false}ignoreENOENTSync((()=>hr(e,t)));return true}let s=true;for(const r of n){const n=i===dr?mr:i;const a=(0,o.resolve)(e,r.name);s=rimrafWindowsDirSync(a,t,r,n)&&s}if(i===dr){return rimrafWindowsDirSync(e,t,r,gr)}else if(i===gr){if(t.preserveRoot===false&&e===(0,o.parse)(e).root){return false}if(!s){return false}if(t.filter&&!t.filter(e,r)){return false}ignoreENOENTSync((()=>rimrafWindowsDirMoveRemoveFallbackSync(e,t)))}return true};const vr=process.platform==="win32"?rimrafWindows:rimrafPosix;const yr=process.platform==="win32"?rimrafWindowsSync:rimrafPosixSync;const{rm:br}=Gt;const rimrafNative=async(e,t)=>{await br(e,{...t,force:true,recursive:true});return true};const rimrafNativeSync=(e,t)=>{(0,g.rmSync)(e,{...t,force:true,recursive:true});return true};const[wr=0,Sr=0]=process.version.replace(/^v/,"").split(".").map((e=>parseInt(e,10)));const xr=wr>14||wr===14&&Sr>=14;const _r=!xr||process.platform==="win32"?()=>false:e=>!e?.signal&&!e?.filter;const kr=!xr||process.platform==="win32"?()=>false:e=>!e?.signal&&!e?.filter;const wrap=e=>async(t,r)=>{const i=optArg(r);if(i.glob){t=await Lt(t,i.glob)}if(Array.isArray(t)){return!!(await Promise.all(t.map((t=>e(Dt(t,i),i))))).reduce(((e,t)=>e&&t),true)}else{return!!await e(Dt(t,i),i)}};const wrapSync=e=>(t,r)=>{const i=optArgSync(r);if(i.glob){t=globSync(t,i.glob)}if(Array.isArray(t)){return!!t.map((t=>e(Dt(t,i),i))).reduce(((e,t)=>e&&t),true)}else{return!!e(Dt(t,i),i)}};const Er=wrapSync(rimrafNativeSync);const Or=Object.assign(wrap(rimrafNative),{sync:Er});const Ar=wrapSync(yr);const Cr=Object.assign(wrap(vr),{sync:Ar});const Pr=wrapSync(rimrafWindowsSync);const Mr=Object.assign(wrap(rimrafWindows),{sync:Pr});const Rr=wrapSync(rimrafPosixSync);const jr=Object.assign(wrap(rimrafPosix),{sync:Rr});const Tr=wrapSync(rimrafMoveRemoveSync);const Nr=Object.assign(wrap(rimrafMoveRemove),{sync:Tr});const Fr=wrapSync(((e,t)=>kr(t)?rimrafNativeSync(e,t):yr(e,t)));const Ir=null&&Fr;const Lr=wrap(((e,t)=>_r(t)?rimrafNative(e,t):vr(e,t)));const $r=Object.assign(Lr,{rimraf:Lr,sync:Fr,rimrafSync:Fr,manual:Cr,manualSync:Ar,native:Or,nativeSync:Er,posix:jr,posixSync:Rr,windows:Mr,windowsSync:Pr,moveRemove:Nr,moveRemoveSync:Tr});$r.rimraf=$r;function isInGitRepository(){try{(0,w.execSync)("git rev-parse --is-inside-work-tree",{stdio:"ignore"});return true}catch(e){}return false}function isInMercurialRepository(){try{(0,w.execSync)("hg --cwd . root",{stdio:"ignore"});return true}catch(e){}return false}function tryGitInit(t){let r=false;try{(0,w.execSync)("git --version",{stdio:"ignore"});if(isInGitRepository()||isInMercurialRepository()){return false}(0,w.execSync)("git init",{stdio:"ignore"});r=true;(0,w.execSync)("git checkout -b main",{stdio:"ignore"});(0,w.execSync)("git add -A",{stdio:"ignore"});(0,w.execSync)('git commit -m "Initial commit from Create Flink App"',{stdio:"ignore"});return true}catch(i){if(r){try{e["default"].sync(a().join(t,".git"))}catch(e){}}return false}}var Dr=__nccwpck_require__(1484);var Br=__nccwpck_require__.n(Dr);function install(e,t){return new Promise(((r,i)=>{let n;let s;n="npm";s=["install",e&&`--${t?"save-dev":"save"}`,e&&"--save-exact","--loglevel","error"].filter(Boolean).concat(e||[]);const o=Br()(n,s,{stdio:"inherit",env:Object.assign(Object.assign({},process.env),{ADBLOCK:"1",DISABLE_OPENCOLLECTIVE:"1"})});o.on("close",(e=>{if(e!==0){i({command:`${n} ${s.join(" ")}`});return}r()}))}))}function isFolderEmpty(e,t){const r=[".DS_Store",".git",".gitattributes",".gitignore",".gitlab-ci.yml",".hg",".hgcheck",".hgignore",".idea",".npmignore",".travis.yml","LICENSE","Thumbs.db","docs","mkdocs.yml","npm-debug.log","yarn-debug.log","yarn-error.log"];const n=v().readdirSync(e).filter((e=>!r.includes(e))).filter((e=>!/\.iml$/.test(e)));if(n.length>0){console.log(`The directory ${i().green(t)} contains files that could conflict:`);console.log();for(const t of n){try{const r=v().lstatSync(a().join(e,t));if(r.isDirectory()){console.log(` ${i().blue(t)}/`)}else{console.log(` ${t}`)}}catch(e){console.log(` ${t}`)}}console.log();console.log("Either try using a new directory name, or remove the files listed above.");console.log();return false}return true}var Gr=undefined&&undefined.__awaiter||function(e,t,r,i){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(i.next(e))}catch(e){n(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())}))};function isWriteable(e){return Gr(this,void 0,void 0,(function*(){try{yield v().promises.access(e,(v().constants||v()).W_OK);return true}catch(e){return false}}))}function makeDir(e,t={recursive:true}){return v().promises.mkdir(e,t)}var zr=undefined&&undefined.__awaiter||function(e,t,r,i){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(i.next(e))}catch(e){n(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())}))};class DownloadError extends Error{}function createApp(e){return zr(this,arguments,void 0,(function*({appPath:e}){const t=a().resolve(e);if(!(yield isWriteable(a().dirname(t)))){console.error("The application path is not writable, please check folder permissions and try again.");console.error("It is likely you do not have write permissions for this folder.");process.exit(1)}const r=a().basename(t);yield makeDir(t);if(!isFolderEmpty(t,r)){process.exit(1)}const n=process.cwd();console.log(`Creating a new Flink app in ${i().green(t)}.`);console.log();yield makeDir(t);process.chdir(t);const s={name:r,version:"0.1.0",private:true,scripts:{dev:'nodemon --exec "flink run"',test:"flink run --entry spec/support/runner.ts","test:watch":'nodemon --exec "flink run --entry spec/support/runner.ts"',start:"flink run",build:"flink build",clean:"flink clean && rimraf dist"}};v().writeFileSync(a().join(t,"package.json"),JSON.stringify(s,null,2)+b().EOL);console.log(`Installing dependencies using npm...`);console.log();yield install(["@flink-app/flink"]);yield install(["typescript@5.6.2","nodemon","jasmine","@types/jasmine","jasmine-spec-reporter","@flink-app/test-utils","rimraf"],true);console.log();yield d()("**",t,{parents:true,cwd:__nccwpck_require__.ab+"default",rename:e=>{switch(e){case"gitignore":{return".".concat(e)}case"README-template.md":{return"README.md"}default:{return e}}}});if(tryGitInit(t)){console.log("Initialized a git repository.");console.log()}let o;if(a().join(n,r)===e){o=r}else{o=e}console.log(`${i().green("Success!")} Created ${r} at ${e}`);console.log("Inside that directory, you can run several commands:");console.log();console.log(i().cyan(` npm run dev`));console.log(" Starts the development server.");console.log();console.log(i().cyan(` npm start`));console.log(" Runs the built app in production mode.");console.log();console.log("We suggest that you begin by typing:");console.log();console.log(i().cyan(" cd"),o);console.log(` ${i().cyan(`npm run dev`)}`);console.log()}))}var Wr=__nccwpck_require__(238);var qr=__nccwpck_require__.n(Wr);function validateNpmName(e){const t=qr()(e);if(t.validForNewPackages){return{valid:true}}return{valid:false,problems:[...t.errors||[],...t.warnings||[]]}}const Ur=JSON.parse('{"name":"create-flink-app","version":"0.13.0","keywords":["flinkapp","flink"],"description":"Create a Flink app with one command","repository":{"type":"git","url":"https://github.com/FrostDigital/flink","directory":"packages/create-flink-app"},"license":"MIT","bin":{"create-flink-app":"./dist/index.js"},"files":["dist"],"scripts":{"dev":"ncc build ./index.ts -w -o dist/","prepare":"npm run build","build":"rimraf ./dist/ && ncc build ./index.ts -o ./dist/ --minify --no-cache --no-source-map-register","clean":"rimraf dist .flink"},"devDependencies":{"@flink-app/flink":"workspace:*","@flink-app/test-utils":"workspace:*","@types/async-retry":"1.4.2","@types/cross-spawn":"^6.0.2","@types/jasmine":"3.8.1","@types/node":"22.13.10","@types/prompts":"2.0.1","@types/rimraf":"3.0.0","@types/tar":"4.0.3","@types/validate-npm-package-name":"3.0.0","@vercel/ncc":"0.36.1","async-retry":"1.3.1","chalk":"2.4.2","commander":"2.20.0","cpy":"7.3.0","cross-spawn":"6.0.5","got":"10.7.0","prompts":"2.1.0","tar":"4.4.10","update-check":"1.5.4","validate-npm-package-name":"3.0.0"},"engines":{"node":">=10.13.0"},"gitHead":"4243e3b3cd6d4e1ca001a61baa8436bf2bbe4113"}');var Vr=undefined&&undefined.__awaiter||function(e,t,r,i){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(i.next(e))}catch(e){n(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())}))};let Hr="";const Yr=new(s().Command)(Ur.name).version(Ur.version).arguments("<project-directory>").usage(`${i().green("<project-directory>")} [options]`).action((e=>{Hr=e})).allowUnknownOption().parse(process.argv);function run(){return Vr(this,void 0,void 0,(function*(){if(typeof Hr==="string"){Hr=Hr.trim()}if(!Hr){const e=yield u()({type:"text",name:"path",message:"What is your project named?",initial:"my-app",validate:e=>{const t=validateNpmName(a().basename(a().resolve(e)));if(t.valid){return true}return"Invalid project name: "+t.problems[0]}});if(typeof e.path==="string"){Hr=e.path.trim()}}if(!Hr){console.log();console.log("Please specify the project directory:");console.log(` ${i().cyan(Yr.name())} ${i().green("<project-directory>")}`);console.log();console.log("For example:");console.log(` ${i().cyan(Yr.name())} ${i().green("my-flink-app")}`);console.log();console.log(`Run ${i().cyan(`${Yr.name()} --help`)} to see all options.`);process.exit(1)}const e=a().resolve(Hr);const t=a().basename(e);const{valid:r,problems:n}=validateNpmName(t);if(!r){console.error(`Could not create a project called ${i().red(`"${t}"`)} because of npm naming restrictions:`);n.forEach((e=>console.error(` ${i().red.bold("*")} ${e}`)));process.exit(1)}try{yield createApp({appPath:e})}catch(e){if(!(e instanceof DownloadError)){throw e}}}))}const Qr=h()(Ur).catch((()=>null));function notifyUpdate(){return Vr(this,void 0,void 0,(function*(){try{const e=yield Qr;if(e===null||e===void 0?void 0:e.latest){console.log();console.log(i().yellow.bold("A new version of `create-flink-app` is available!"));console.log("You can update by running: "+i().cyan("npm i -g create-flink-app"));console.log()}process.exit()}catch(e){}}))}run().then(notifyUpdate).catch((e=>Vr(void 0,void 0,void 0,(function*(){console.log();console.log("Aborting installation.");if(e.command){console.log(` ${i().cyan(e.command)} has failed.`)}else{console.log(i().red("Unexpected error. Please report it as a bug:"));console.log(e)}console.log();yield notifyUpdate();process.exit(1)}))))})();module.exports=r})();
|
|
283
|
+
*/e.exports=function base(e,t){if(!isObject(e)&&typeof e!=="function"){throw new TypeError("expected an object or function")}var r=isObject(t)?t:{};var i=typeof r.prop==="string"?r.prop:"fns";if(!Array.isArray(e[i])){define(e,i,[])}define(e,"use",use);define(e,"run",(function(t){if(!isObject(t))return;if(!t.use||!t.run){define(t,i,t[i]||[]);define(t,"use",use)}if(!t[i]||t[i].indexOf(base)===-1){t.use(base)}var r=this||e;var n=r[i];var s=n.length;var o=-1;while(++o<s){t.use(n[o])}return t}));function use(t,n,s){var o=1;if(typeof t==="string"||Array.isArray(t)){n=wrap(t,n);o++}else{s=n;n=t}if(typeof n!=="function"){throw new TypeError("expected a function")}var a=this||e;var c=a[i];var u=[].slice.call(arguments,o);u.unshift(a);if(typeof r.hook==="function"){r.hook.apply(a,u)}var l=n.apply(a,u);if(typeof l==="function"&&c.indexOf(l)===-1){c.push(l)}return a}function wrap(e,t){return function plugin(){return this.type===e?t.apply(this,arguments):plugin}}return e};function isObject(e){return e&&typeof e==="object"&&!Array.isArray(e)}function define(e,t,r){Object.defineProperty(e,t,{configurable:true,writable:true,value:r})}},238:(e,t,r)=>{"use strict";var i=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$");var n=r(3113);var s=["node_modules","favicon.ico"];var o=e.exports=function(e){var t=[];var r=[];if(e===null){r.push("name cannot be null");return done(t,r)}if(e===undefined){r.push("name cannot be undefined");return done(t,r)}if(typeof e!=="string"){r.push("name must be a string");return done(t,r)}if(!e.length){r.push("name length must be greater than zero")}if(e.match(/^\./)){r.push("name cannot start with a period")}if(e.match(/^_/)){r.push("name cannot start with an underscore")}if(e.trim()!==e){r.push("name cannot contain leading or trailing spaces")}s.forEach((function(t){if(e.toLowerCase()===t){r.push(t+" is a blacklisted name")}}));n.forEach((function(r){if(e.toLowerCase()===r){t.push(r+" is a core module name")}}));if(e.length>214){t.push("name can no longer contain more than 214 characters")}if(e.toLowerCase()!==e){t.push("name can no longer contain capital letters")}if(/[~'!()*]/.test(e.split("/").slice(-1)[0])){t.push('name can no longer contain special characters ("~\'!()*")')}if(encodeURIComponent(e)!==e){var o=e.match(i);if(o){var a=o[1];var c=o[2];if(encodeURIComponent(a)===a&&encodeURIComponent(c)===c){return done(t,r)}}r.push("name can only contain URL-friendly characters")}return done(t,r)};o.scopedPackagePattern=i;var done=function(e,t){var r={validForNewPackages:t.length===0&&e.length===0,validForOldPackages:t.length===0,warnings:e,errors:t};if(!r.warnings.length)delete r.warnings;if(!r.errors.length)delete r.errors;return r}},1834:(e,t,r)=>{e.exports=which;which.sync=whichSync;var i=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys";var n=r(1017);var s=i?";":":";var o=r(2284);function getNotFoundError(e){var t=new Error("not found: "+e);t.code="ENOENT";return t}function getPathInfo(e,t){var r=t.colon||s;var n=t.path||process.env.PATH||"";var o=[""];n=n.split(r);var a="";if(i){n.unshift(process.cwd());a=t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM";o=a.split(r);if(e.indexOf(".")!==-1&&o[0]!=="")o.unshift("")}if(e.match(/\//)||i&&e.match(/\\/))n=[""];return{env:n,ext:o,extExe:a}}function which(e,t,r){if(typeof t==="function"){r=t;t={}}var i=getPathInfo(e,t);var s=i.env;var a=i.ext;var c=i.extExe;var u=[];(function F(i,l){if(i===l){if(t.all&&u.length)return r(null,u);else return r(getNotFoundError(e))}var h=s[i];if(h.charAt(0)==='"'&&h.slice(-1)==='"')h=h.slice(1,-1);var p=n.join(h,e);if(!h&&/^\.[\\\/]/.test(e)){p=e.slice(0,2)+p}(function E(e,n){if(e===n)return F(i+1,l);var s=a[e];o(p+s,{pathExt:c},(function(i,o){if(!i&&o){if(t.all)u.push(p+s);else return r(null,p+s)}return E(e+1,n)}))})(0,a.length)})(0,s.length)}function whichSync(e,t){t=t||{};var r=getPathInfo(e,t);var i=r.env;var s=r.ext;var a=r.extExe;var c=[];for(var u=0,l=i.length;u<l;u++){var h=i[u];if(h.charAt(0)==='"'&&h.slice(-1)==='"')h=h.slice(1,-1);var p=n.join(h,e);if(!h&&/^\.[\\\/]/.test(e)){p=e.slice(0,2)+p}for(var d=0,g=s.length;d<g;d++){var v=p+s[d];var y;try{y=o.sync(v,{pathExt:a});if(y){if(t.all)c.push(v);else return v}}catch(e){}}}if(t.all&&c.length)return c;if(t.nothrow)return null;throw getNotFoundError(e)}},6010:e=>{e.exports=wrappy;function wrappy(e,t){if(e&&t)return wrappy(e)(t);if(typeof e!=="function")throw new TypeError("need wrapper function");Object.keys(e).forEach((function(t){wrapper[t]=e[t]}));return wrapper;function wrapper(){var t=new Array(arguments.length);for(var r=0;r<t.length;r++){t[r]=arguments[r]}var i=e.apply(this,t);var n=t[t.length-1];if(typeof i==="function"&&i!==n){Object.keys(n).forEach((function(e){i[e]=n[e]}))}return i}}},9491:e=>{"use strict";e.exports=require("assert")},8709:e=>{"use strict";e.exports=require("buffer")},2081:e=>{"use strict";e.exports=require("child_process")},2057:e=>{"use strict";e.exports=require("constants")},2361:e=>{"use strict";e.exports=require("events")},7147:e=>{"use strict";e.exports=require("fs")},3685:e=>{"use strict";e.exports=require("http")},5687:e=>{"use strict";e.exports=require("https")},1808:e=>{"use strict";e.exports=require("net")},2037:e=>{"use strict";e.exports=require("os")},1017:e=>{"use strict";e.exports=require("path")},4521:e=>{"use strict";e.exports=require("readline")},2781:e=>{"use strict";e.exports=require("stream")},6224:e=>{"use strict";e.exports=require("tty")},7310:e=>{"use strict";e.exports=require("url")},3837:e=>{"use strict";e.exports=require("util")},3113:e=>{"use strict";e.exports=JSON.parse('["assert","buffer","child_process","cluster","console","constants","crypto","dgram","dns","domain","events","fs","http","https","module","net","os","path","process","punycode","querystring","readline","repl","stream","string_decoder","timers","tls","tty","url","util","v8","vm","zlib"]')}};var t={};function __nccwpck_require__(r){var i=t[r];if(i!==undefined){return i.exports}var n=t[r]={id:r,loaded:false,exports:{}};var s=true;try{e[r].call(n.exports,n,n.exports,__nccwpck_require__);s=false}finally{if(s)delete t[r]}n.loaded=true;return n.exports}(()=>{__nccwpck_require__.n=e=>{var t=e&&e.__esModule?()=>e["default"]:()=>e;__nccwpck_require__.d(t,{a:t});return t}})();(()=>{var e=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;var t;__nccwpck_require__.t=function(r,i){if(i&1)r=this(r);if(i&8)return r;if(typeof r==="object"&&r){if(i&4&&r.__esModule)return r;if(i&16&&typeof r.then==="function")return r}var n=Object.create(null);__nccwpck_require__.r(n);var s={};t=t||[null,e({}),e([]),e(e)];for(var o=i&2&&r;typeof o=="object"&&!~t.indexOf(o);o=e(o)){Object.getOwnPropertyNames(o).forEach((e=>s[e]=()=>r[e]))}s["default"]=()=>r;__nccwpck_require__.d(n,s);return n}})();(()=>{__nccwpck_require__.d=(e,t)=>{for(var r in t){if(__nccwpck_require__.o(t,r)&&!__nccwpck_require__.o(e,r)){Object.defineProperty(e,r,{enumerable:true,get:t[r]})}}}})();(()=>{__nccwpck_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})();(()=>{__nccwpck_require__.r=e=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})}})();(()=>{__nccwpck_require__.nmd=e=>{e.paths=[];if(!e.children)e.children=[];return e}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var r={};(()=>{"use strict";__nccwpck_require__.r(r);var e={};__nccwpck_require__.r(e);var t=__nccwpck_require__(1294);var i=__nccwpck_require__.n(t);var n=__nccwpck_require__(9468);var s=__nccwpck_require__.n(n);var o=__nccwpck_require__(1017);var a=__nccwpck_require__.n(o);var c=__nccwpck_require__(485);var u=__nccwpck_require__.n(c);var l=__nccwpck_require__(4531);var h=__nccwpck_require__.n(l);var p=__nccwpck_require__(8599);var d=__nccwpck_require__.n(p);var g=__nccwpck_require__(7147);var v=__nccwpck_require__.n(g);var y=__nccwpck_require__(2037);var b=__nccwpck_require__.n(y);var w=__nccwpck_require__(2081);const balanced=(e,t,r)=>{const i=e instanceof RegExp?maybeMatch(e,r):e;const n=t instanceof RegExp?maybeMatch(t,r):t;const s=i!==null&&n!=null&&range(i,n,r);return s&&{start:s[0],end:s[1],pre:r.slice(0,s[0]),body:r.slice(s[0]+i.length,s[1]),post:r.slice(s[1]+n.length)}};const maybeMatch=(e,t)=>{const r=t.match(e);return r?r[0]:null};const range=(e,t,r)=>{let i,n,s,o=undefined,a;let c=r.indexOf(e);let u=r.indexOf(t,c+1);let l=c;if(c>=0&&u>0){if(e===t){return[c,u]}i=[];s=r.length;while(l>=0&&!a){if(l===c){i.push(l);c=r.indexOf(e,l+1)}else if(i.length===1){const e=i.pop();if(e!==undefined)a=[e,u]}else{n=i.pop();if(n!==undefined&&n<s){s=n;o=u}u=r.indexOf(t,l+1)}l=c<u&&c>=0?c:u}if(i.length&&o!==undefined){a=[s,o]}}return a};const S="\0SLASH"+Math.random()+"\0";const x="\0OPEN"+Math.random()+"\0";const _="\0CLOSE"+Math.random()+"\0";const k="\0COMMA"+Math.random()+"\0";const O="\0PERIOD"+Math.random()+"\0";const A=new RegExp(S,"g");const C=new RegExp(x,"g");const P=new RegExp(_,"g");const M=new RegExp(k,"g");const R=new RegExp(O,"g");const j=/\\\\/g;const T=/\\{/g;const N=/\\}/g;const I=/\\,/g;const L=/\\./g;function numeric(e){return!isNaN(e)?parseInt(e,10):e.charCodeAt(0)}function escapeBraces(e){return e.replace(j,S).replace(T,x).replace(N,_).replace(I,k).replace(L,O)}function unescapeBraces(e){return e.replace(A,"\\").replace(C,"{").replace(P,"}").replace(M,",").replace(R,".")}function parseCommaParts(e){if(!e){return[""]}const t=[];const r=balanced("{","}",e);if(!r){return e.split(",")}const{pre:i,body:n,post:s}=r;const o=i.split(",");o[o.length-1]+="{"+n+"}";const a=parseCommaParts(s);if(s.length){o[o.length-1]+=a.shift();o.push.apply(o,a)}t.push.apply(t,o);return t}function expand(e){if(!e){return[]}if(e.slice(0,2)==="{}"){e="\\{\\}"+e.slice(2)}return expand_(escapeBraces(e),true).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_(e,t){const r=[];const i=balanced("{","}",e);if(!i)return[e];const n=i.pre;const s=i.post.length?expand_(i.post,false):[""];if(/\$$/.test(i.pre)){for(let e=0;e<s.length;e++){const t=n+"{"+i.body+"}"+s[e];r.push(t)}}else{const o=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body);const a=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body);const c=o||a;const u=i.body.indexOf(",")>=0;if(!c&&!u){if(i.post.match(/,(?!,).*\}/)){e=i.pre+"{"+i.body+_+i.post;return expand_(e)}return[e]}let l;if(c){l=i.body.split(/\.\./)}else{l=parseCommaParts(i.body);if(l.length===1&&l[0]!==undefined){l=expand_(l[0],false).map(embrace);if(l.length===1){return s.map((e=>i.pre+l[0]+e))}}}let h;if(c&&l[0]!==undefined&&l[1]!==undefined){const e=numeric(l[0]);const t=numeric(l[1]);const r=Math.max(l[0].length,l[1].length);let i=l.length===3&&l[2]!==undefined?Math.abs(numeric(l[2])):1;let n=lte;const s=t<e;if(s){i*=-1;n=gte}const o=l.some(isPadded);h=[];for(let s=e;n(s,t);s+=i){let e;if(a){e=String.fromCharCode(s);if(e==="\\"){e=""}}else{e=String(s);if(o){const t=r-e.length;if(t>0){const r=new Array(t+1).join("0");if(s<0){e="-"+r+e.slice(1)}else{e=r+e}}}}h.push(e)}}else{h=[];for(let e=0;e<l.length;e++){h.push.apply(h,expand_(l[e],false))}}for(let e=0;e<h.length;e++){for(let i=0;i<s.length;i++){const o=n+h[e]+s[i];if(!t||c||o){r.push(o)}}}}return r}const $=1024*64;const assertValidPattern=e=>{if(typeof e!=="string"){throw new TypeError("invalid pattern")}if(e.length>$){throw new TypeError("pattern is too long")}};const D={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",true],"[:alpha:]":["\\p{L}\\p{Nl}",true],"[:ascii:]":["\\x"+"00-\\x"+"7f",false],"[:blank:]":["\\p{Zs}\\t",true],"[:cntrl:]":["\\p{Cc}",true],"[:digit:]":["\\p{Nd}",true],"[:graph:]":["\\p{Z}\\p{C}",true,true],"[:lower:]":["\\p{Ll}",true],"[:print:]":["\\p{C}",true],"[:punct:]":["\\p{P}",true],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",true],"[:upper:]":["\\p{Lu}",true],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",true],"[:xdigit:]":["A-Fa-f0-9",false]};const braceEscape=e=>e.replace(/[[\]\\-]/g,"\\$&");const regexpEscape=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");const rangesToString=e=>e.join("");const parseClass=(e,t)=>{const r=t;if(e.charAt(r)!=="["){throw new Error("not in a brace expression")}const i=[];const n=[];let s=r+1;let o=false;let a=false;let c=false;let u=false;let l=r;let h="";e:while(s<e.length){const t=e.charAt(s);if((t==="!"||t==="^")&&s===r+1){u=true;s++;continue}if(t==="]"&&o&&!c){l=s+1;break}o=true;if(t==="\\"){if(!c){c=true;s++;continue}}if(t==="["&&!c){for(const[t,[o,c,u]]of Object.entries(D)){if(e.startsWith(t,s)){if(h){return["$.",false,e.length-r,true]}s+=t.length;if(u)n.push(o);else i.push(o);a=a||c;continue e}}}c=false;if(h){if(t>h){i.push(braceEscape(h)+"-"+braceEscape(t))}else if(t===h){i.push(braceEscape(t))}h="";s++;continue}if(e.startsWith("-]",s+1)){i.push(braceEscape(t+"-"));s+=2;continue}if(e.startsWith("-",s+1)){h=t;s+=2;continue}i.push(braceEscape(t));s++}if(l<s){return["",false,0,false]}if(!i.length&&!n.length){return["$.",false,e.length-r,true]}if(n.length===0&&i.length===1&&/^\\?.$/.test(i[0])&&!u){const e=i[0].length===2?i[0].slice(-1):i[0];return[regexpEscape(e),false,l-r,false]}const p="["+(u?"^":"")+rangesToString(i)+"]";const d="["+(u?"":"^")+rangesToString(n)+"]";const g=i.length&&n.length?"("+p+"|"+d+")":i.length?p:d;return[g,a,l-r,true]};const unescape_unescape=(e,{windowsPathsNoEscape:t=false,magicalBraces:r=true}={})=>{if(r){return t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")}return t?e.replace(/\[([^\/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1")};const B=new Set(["!","?","+","*","@"]);const isExtglobType=e=>B.has(e);const G="(?!(?:^|/)\\.\\.?(?:$|/))";const z="(?!\\.)";const W=new Set(["[","."]);const q=new Set(["..","."]);const U=new Set("().*{}+?[]^$\\!");const regExpEscape=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");const V="[^/]";const H=V+"*?";const Y=V+"+?";class AST{type;#e;#t;#r=false;#i=[];#n;#s;#o;#a=false;#c;#u;#l=false;constructor(e,t,r={}){this.type=e;if(e)this.#t=true;this.#n=t;this.#e=this.#n?this.#n.#e:this;this.#c=this.#e===this?r:this.#e.#c;this.#o=this.#e===this?[]:this.#e.#o;if(e==="!"&&!this.#e.#a)this.#o.push(this);this.#s=this.#n?this.#n.#i.length:0}get hasMagic(){if(this.#t!==undefined)return this.#t;for(const e of this.#i){if(typeof e==="string")continue;if(e.type||e.hasMagic)return this.#t=true}return this.#t}toString(){if(this.#u!==undefined)return this.#u;if(!this.type){return this.#u=this.#i.map((e=>String(e))).join("")}else{return this.#u=this.type+"("+this.#i.map((e=>String(e))).join("|")+")"}}#h(){if(this!==this.#e)throw new Error("should only call on root");if(this.#a)return this;this.toString();this.#a=true;let e;while(e=this.#o.pop()){if(e.type!=="!")continue;let t=e;let r=t.#n;while(r){for(let i=t.#s+1;!r.type&&i<r.#i.length;i++){for(const t of e.#i){if(typeof t==="string"){throw new Error("string part in extglob AST??")}t.copyIn(r.#i[i])}}t=r;r=t.#n}}return this}push(...e){for(const t of e){if(t==="")continue;if(typeof t!=="string"&&!(t instanceof AST&&t.#n===this)){throw new Error("invalid part: "+t)}this.#i.push(t)}}toJSON(){const e=this.type===null?this.#i.slice().map((e=>typeof e==="string"?e:e.toJSON())):[this.type,...this.#i.map((e=>e.toJSON()))];if(this.isStart()&&!this.type)e.unshift([]);if(this.isEnd()&&(this===this.#e||this.#e.#a&&this.#n?.type==="!")){e.push({})}return e}isStart(){if(this.#e===this)return true;if(!this.#n?.isStart())return false;if(this.#s===0)return true;const e=this.#n;for(let t=0;t<this.#s;t++){const r=e.#i[t];if(!(r instanceof AST&&r.type==="!")){return false}}return true}isEnd(){if(this.#e===this)return true;if(this.#n?.type==="!")return true;if(!this.#n?.isEnd())return false;if(!this.type)return this.#n?.isEnd();const e=this.#n?this.#n.#i.length:0;return this.#s===e-1}copyIn(e){if(typeof e==="string")this.push(e);else this.push(e.clone(this))}clone(e){const t=new AST(this.type,e);for(const e of this.#i){t.copyIn(e)}return t}static#f(e,t,r,i){let n=false;let s=false;let o=-1;let a=false;if(t.type===null){let c=r;let u="";while(c<e.length){const r=e.charAt(c++);if(n||r==="\\"){n=!n;u+=r;continue}if(s){if(c===o+1){if(r==="^"||r==="!"){a=true}}else if(r==="]"&&!(c===o+2&&a)){s=false}u+=r;continue}else if(r==="["){s=true;o=c;a=false;u+=r;continue}if(!i.noext&&isExtglobType(r)&&e.charAt(c)==="("){t.push(u);u="";const n=new AST(r,t);c=AST.#f(e,n,c,i);t.push(n);continue}u+=r}t.push(u);return c}let c=r+1;let u=new AST(null,t);const l=[];let h="";while(c<e.length){const r=e.charAt(c++);if(n||r==="\\"){n=!n;h+=r;continue}if(s){if(c===o+1){if(r==="^"||r==="!"){a=true}}else if(r==="]"&&!(c===o+2&&a)){s=false}h+=r;continue}else if(r==="["){s=true;o=c;a=false;h+=r;continue}if(isExtglobType(r)&&e.charAt(c)==="("){u.push(h);h="";const t=new AST(r,u);u.push(t);c=AST.#f(e,t,c,i);continue}if(r==="|"){u.push(h);h="";l.push(u);u=new AST(null,t);continue}if(r===")"){if(h===""&&t.#i.length===0){t.#l=true}u.push(h);h="";t.push(...l,u);return c}h+=r}t.type=null;t.#t=undefined;t.#i=[e.substring(r-1)];return c}static fromGlob(e,t={}){const r=new AST(null,undefined,t);AST.#f(e,r,0,t);return r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();const e=this.toString();const[t,r,i,n]=this.toRegExpSource();const s=i||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase();if(!s){return r}const o=(this.#c.nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${t}$`,o),{_src:t,_glob:e})}get options(){return this.#c}toRegExpSource(e){const t=e??!!this.#c.dot;if(this.#e===this)this.#h();if(!this.type){const r=this.isStart()&&this.isEnd()&&!this.#i.some((e=>typeof e!=="string"));const i=this.#i.map((t=>{const[i,n,s,o]=typeof t==="string"?AST.#p(t,this.#t,r):t.toRegExpSource(e);this.#t=this.#t||s;this.#r=this.#r||o;return i})).join("");let n="";if(this.isStart()){if(typeof this.#i[0]==="string"){const r=this.#i.length===1&&q.has(this.#i[0]);if(!r){const r=W;const s=t&&r.has(i.charAt(0))||i.startsWith("\\.")&&r.has(i.charAt(2))||i.startsWith("\\.\\.")&&r.has(i.charAt(4));const o=!t&&!e&&r.has(i.charAt(0));n=s?G:o?z:""}}}let s="";if(this.isEnd()&&this.#e.#a&&this.#n?.type==="!"){s="(?:$|\\/)"}const o=n+i+s;return[o,unescape_unescape(i),this.#t=!!this.#t,this.#r]}const r=this.type==="*"||this.type==="+";const i=this.type==="!"?"(?:(?!(?:":"(?:";let n=this.#d(t);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){const e=this.toString();this.#i=[e];this.type=null;this.#t=undefined;return[e,unescape_unescape(this.toString()),false,false]}let s=!r||e||t||!z?"":this.#d(true);if(s===n){s=""}if(s){n=`(?:${n})(?:${s})*?`}let o="";if(this.type==="!"&&this.#l){o=(this.isStart()&&!t?z:"")+Y}else{const r=this.type==="!"?"))"+(this.isStart()&&!t&&!e?z:"")+H+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&s?")":this.type==="*"&&s?`)?`:`)${this.type}`;o=i+n+r}return[o,unescape_unescape(n),this.#t=!!this.#t,this.#r]}#d(e){return this.#i.map((t=>{if(typeof t==="string"){throw new Error("string type in extglob ast??")}const[r,i,n,s]=t.toRegExpSource(e);this.#r=this.#r||s;return r})).filter((e=>!(this.isStart()&&this.isEnd())||!!e)).join("|")}static#p(e,t,r=false){let i=false;let n="";let s=false;for(let o=0;o<e.length;o++){const a=e.charAt(o);if(i){i=false;n+=(U.has(a)?"\\":"")+a;continue}if(a==="\\"){if(o===e.length-1){n+="\\\\"}else{i=true}continue}if(a==="["){const[r,i,a,c]=parseClass(e,o);if(a){n+=r;s=s||i;o+=a-1;t=t||c;continue}}if(a==="*"){n+=r&&e==="*"?Y:H;t=true;continue}if(a==="?"){n+=V;t=true;continue}n+=regExpEscape(a)}return[n,unescape_unescape(e),!!t,s]}}const escape_escape=(e,{windowsPathsNoEscape:t=false,magicalBraces:r=false}={})=>{if(r){return t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&")}return t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&")};const minimatch=(e,t,r={})=>{assertValidPattern(t);if(!r.nocomment&&t.charAt(0)==="#"){return false}return new Minimatch(t,r).match(e)};const Q=/^\*+([^+@!?\*\[\(]*)$/;const starDotExtTest=e=>t=>!t.startsWith(".")&&t.endsWith(e);const starDotExtTestDot=e=>t=>t.endsWith(e);const starDotExtTestNocase=e=>{e=e.toLowerCase();return t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)};const starDotExtTestNocaseDot=e=>{e=e.toLowerCase();return t=>t.toLowerCase().endsWith(e)};const J=/^\*+\.\*+$/;const starDotStarTest=e=>!e.startsWith(".")&&e.includes(".");const starDotStarTestDot=e=>e!=="."&&e!==".."&&e.includes(".");const K=/^\.\*+$/;const dotStarTest=e=>e!=="."&&e!==".."&&e.startsWith(".");const Z=/^\*+$/;const starTest=e=>e.length!==0&&!e.startsWith(".");const starTestDot=e=>e.length!==0&&e!=="."&&e!=="..";const X=/^\?+([^+@!?\*\[\(]*)?$/;const qmarksTestNocase=([e,t=""])=>{const r=qmarksTestNoExt([e]);if(!t)return r;t=t.toLowerCase();return e=>r(e)&&e.toLowerCase().endsWith(t)};const qmarksTestNocaseDot=([e,t=""])=>{const r=qmarksTestNoExtDot([e]);if(!t)return r;t=t.toLowerCase();return e=>r(e)&&e.toLowerCase().endsWith(t)};const qmarksTestDot=([e,t=""])=>{const r=qmarksTestNoExtDot([e]);return!t?r:e=>r(e)&&e.endsWith(t)};const qmarksTest=([e,t=""])=>{const r=qmarksTestNoExt([e]);return!t?r:e=>r(e)&&e.endsWith(t)};const qmarksTestNoExt=([e])=>{const t=e.length;return e=>e.length===t&&!e.startsWith(".")};const qmarksTestNoExtDot=([e])=>{const t=e.length;return e=>e.length===t&&e!=="."&&e!==".."};const ee=typeof process==="object"&&process?typeof process.env==="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix";const te={win32:{sep:"\\"},posix:{sep:"/"}};const re=ee==="win32"?te.win32.sep:te.posix.sep;minimatch.sep=re;const ie=Symbol("globstar **");minimatch.GLOBSTAR=ie;const ne="[^/]";const se=ne+"*?";const oe="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";const ae="(?:(?!(?:\\/|^)\\.).)*?";const filter=(e,t={})=>r=>minimatch(r,e,t);minimatch.filter=filter;const ext=(e,t={})=>Object.assign({},e,t);const defaults=e=>{if(!e||typeof e!=="object"||!Object.keys(e).length){return minimatch}const t=minimatch;const m=(r,i,n={})=>t(r,i,ext(e,n));return Object.assign(m,{Minimatch:class Minimatch extends t.Minimatch{constructor(t,r={}){super(t,ext(e,r))}static defaults(r){return t.defaults(ext(e,r)).Minimatch}},AST:class AST extends t.AST{constructor(t,r,i={}){super(t,r,ext(e,i))}static fromGlob(r,i={}){return t.AST.fromGlob(r,ext(e,i))}},unescape:(r,i={})=>t.unescape(r,ext(e,i)),escape:(r,i={})=>t.escape(r,ext(e,i)),filter:(r,i={})=>t.filter(r,ext(e,i)),defaults:r=>t.defaults(ext(e,r)),makeRe:(r,i={})=>t.makeRe(r,ext(e,i)),braceExpand:(r,i={})=>t.braceExpand(r,ext(e,i)),match:(r,i,n={})=>t.match(r,i,ext(e,n)),sep:t.sep,GLOBSTAR:ie})};minimatch.defaults=defaults;const braceExpand=(e,t={})=>{assertValidPattern(e);if(t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)){return[e]}return expand(e)};minimatch.braceExpand=braceExpand;const makeRe=(e,t={})=>new Minimatch(e,t).makeRe();minimatch.makeRe=makeRe;const match=(e,t,r={})=>{const i=new Minimatch(t,r);e=e.filter((e=>i.match(e)));if(i.options.nonull&&!e.length){e.push(t)}return e};minimatch.match=match;const ce=/[?*]|[+@!]\(.*?\)|\[|\]/;const esm_regExpEscape=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class Minimatch{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,t={}){assertValidPattern(e);t=t||{};this.options=t;this.pattern=e;this.platform=t.platform||ee;this.isWindows=this.platform==="win32";this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===false;if(this.windowsPathsNoEscape){this.pattern=this.pattern.replace(/\\/g,"/")}this.preserveMultipleSlashes=!!t.preserveMultipleSlashes;this.regexp=null;this.negate=false;this.nonegate=!!t.nonegate;this.comment=false;this.empty=false;this.partial=!!t.partial;this.nocase=!!this.options.nocase;this.windowsNoMagicRoot=t.windowsNoMagicRoot!==undefined?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase);this.globSet=[];this.globParts=[];this.set=[];this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1){return true}for(const e of this.set){for(const t of e){if(typeof t!=="string")return true}}return false}debug(...e){}make(){const e=this.pattern;const t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=true;return}if(!e){this.empty=true;return}this.parseNegate();this.globSet=[...new Set(this.braceExpand())];if(t.debug){this.debug=(...e)=>console.error(...e)}this.debug(this.pattern,this.globSet);const r=this.globSet.map((e=>this.slashSplit(e)));this.globParts=this.preprocess(r);this.debug(this.pattern,this.globParts);let i=this.globParts.map(((e,t,r)=>{if(this.isWindows&&this.windowsNoMagicRoot){const t=e[0]===""&&e[1]===""&&(e[2]==="?"||!ce.test(e[2]))&&!ce.test(e[3]);const r=/^[a-z]:/i.test(e[0]);if(t){return[...e.slice(0,4),...e.slice(4).map((e=>this.parse(e)))]}else if(r){return[e[0],...e.slice(1).map((e=>this.parse(e)))]}}return e.map((e=>this.parse(e)))}));this.debug(this.pattern,i);this.set=i.filter((e=>e.indexOf(false)===-1));if(this.isWindows){for(let e=0;e<this.set.length;e++){const t=this.set[e];if(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 r=0;r<e[t].length;r++){if(e[t][r]==="**"){e[t][r]="*"}}}}const{optimizationLevel:t=1}=this.options;if(t>=2){e=this.firstPhasePreProcess(e);e=this.secondPhasePreProcess(e)}else if(t>=1){e=this.levelOneOptimize(e)}else{e=this.adjascentGlobstarOptimize(e)}return e}adjascentGlobstarOptimize(e){return e.map((e=>{let t=-1;while(-1!==(t=e.indexOf("**",t+1))){let r=t;while(e[r+1]==="**"){r++}if(r!==t){e.splice(t,r-t)}}return e}))}levelOneOptimize(e){return e.map((e=>{e=e.reduce(((e,t)=>{const r=e[e.length-1];if(t==="**"&&r==="**"){return e}if(t===".."){if(r&&r!==".."&&r!=="."&&r!=="**"){e.pop();return e}}e.push(t);return e}),[]);return e.length===0?[""]:e}))}levelTwoFileOptimize(e){if(!Array.isArray(e)){e=this.slashSplit(e)}let t=false;do{t=false;if(!this.preserveMultipleSlashes){for(let r=1;r<e.length-1;r++){const i=e[r];if(r===1&&i===""&&e[0]==="")continue;if(i==="."||i===""){t=true;e.splice(r,1);r--}}if(e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")){t=true;e.pop()}}let r=0;while(-1!==(r=e.indexOf("..",r+1))){const i=e[r-1];if(i&&i!=="."&&i!==".."&&i!=="**"){t=true;e.splice(r-1,2);r-=2}}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=false;do{t=false;for(let r of e){let i=-1;while(-1!==(i=r.indexOf("**",i+1))){let n=i;while(r[n+1]==="**"){n++}if(n>i){r.splice(i+1,n-i)}let s=r[i+1];const o=r[i+2];const a=r[i+3];if(s!=="..")continue;if(!o||o==="."||o===".."||!a||a==="."||a===".."){continue}t=true;r.splice(i,1);const c=r.slice(0);c[i]="**";e.push(c);i--}if(!this.preserveMultipleSlashes){for(let e=1;e<r.length-1;e++){const i=r[e];if(e===1&&i===""&&r[0]==="")continue;if(i==="."||i===""){t=true;r.splice(e,1);e--}}if(r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")){t=true;r.pop()}}let n=0;while(-1!==(n=r.indexOf("..",n+1))){const e=r[n-1];if(e&&e!=="."&&e!==".."&&e!=="**"){t=true;const e=n===1&&r[n+1]==="**";const i=e?["."]:[];r.splice(n-1,2,...i);if(r.length===0)r.push("");n-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++){for(let r=t+1;r<e.length;r++){const i=this.partsMatch(e[t],e[r],!this.preserveMultipleSlashes);if(i){e[t]=[];e[r]=i;break}}}return e.filter((e=>e.length))}partsMatch(e,t,r=false){let i=0;let n=0;let s=[];let o="";while(i<e.length&&n<t.length){if(e[i]===t[n]){s.push(o==="b"?t[n]:e[i]);i++;n++}else if(r&&e[i]==="**"&&t[n]===e[i+1]){s.push(e[i]);i++}else if(r&&t[n]==="**"&&e[i]===t[n+1]){s.push(t[n]);n++}else if(e[i]==="*"&&t[n]&&(this.options.dot||!t[n].startsWith("."))&&t[n]!=="**"){if(o==="b")return false;o="a";s.push(e[i]);i++;n++}else if(t[n]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(o==="a")return false;o="b";s.push(t[n]);i++;n++}else{return false}}return e.length===t.length&&s}parseNegate(){if(this.nonegate)return;const e=this.pattern;let t=false;let r=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++){t=!t;r++}if(r)this.pattern=e.slice(r);this.negate=t}matchOne(e,t,r=false){const i=this.options;if(this.isWindows){const r=typeof e[0]==="string"&&/^[a-z]:$/i.test(e[0]);const i=!r&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]);const n=typeof t[0]==="string"&&/^[a-z]:$/i.test(t[0]);const s=!n&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]==="string"&&/^[a-z]:$/i.test(t[3]);const o=i?3:r?0:undefined;const a=s?3:n?0:undefined;if(typeof o==="number"&&typeof a==="number"){const[r,i]=[e[o],t[a]];if(r.toLowerCase()===i.toLowerCase()){t[a]=r;if(a>o){t=t.slice(a)}else if(o>a){e=e.slice(o)}}}}const{optimizationLevel:n=1}=this.options;if(n>=2){e=this.levelTwoFileOptimize(e)}this.debug("matchOne",this,{file:e,pattern:t});this.debug("matchOne",e.length,t.length);for(var s=0,o=0,a=e.length,c=t.length;s<a&&o<c;s++,o++){this.debug("matchOne loop");var u=t[o];var l=e[s];this.debug(t,u,l);if(u===false){return false}if(u===ie){this.debug("GLOBSTAR",[t,u,l]);var h=s;var p=o+1;if(p===c){this.debug("** at the end");for(;s<a;s++){if(e[s]==="."||e[s]===".."||!i.dot&&e[s].charAt(0)===".")return false}return true}while(h<a){var d=e[h];this.debug("\nglobstar while",e,h,t,p,d);if(this.matchOne(e.slice(h),t.slice(p),r)){this.debug("globstar found match!",h,a,d);return true}else{if(d==="."||d===".."||!i.dot&&d.charAt(0)==="."){this.debug("dot detected!",e,h,t,p);break}this.debug("globstar swallow a segment, and continue");h++}}if(r){this.debug("\n>>> no match, partial?",e,h,t,p);if(h===a){return true}}return false}let n;if(typeof u==="string"){n=l===u;this.debug("string match",u,l,n)}else{n=u.test(l);this.debug("pattern match",u,l,n)}if(!n)return false}if(s===a&&o===c){return true}else if(s===a){return r}else if(o===c){return s===a-1&&e[s]===""}else{throw new Error("wtf?")}}braceExpand(){return braceExpand(this.pattern,this.options)}parse(e){assertValidPattern(e);const t=this.options;if(e==="**")return ie;if(e==="")return"";let r;let i=null;if(r=e.match(Z)){i=t.dot?starTestDot:starTest}else if(r=e.match(Q)){i=(t.nocase?t.dot?starDotExtTestNocaseDot:starDotExtTestNocase:t.dot?starDotExtTestDot:starDotExtTest)(r[1])}else if(r=e.match(X)){i=(t.nocase?t.dot?qmarksTestNocaseDot:qmarksTestNocase:t.dot?qmarksTestDot:qmarksTest)(r)}else if(r=e.match(J)){i=t.dot?starDotStarTestDot:starDotStarTest}else if(r=e.match(K)){i=dotStarTest}const n=AST.fromGlob(e,this.options).toMMPattern();if(i&&typeof n==="object"){Reflect.defineProperty(n,"test",{value:i})}return n}makeRe(){if(this.regexp||this.regexp===false)return this.regexp;const e=this.set;if(!e.length){this.regexp=false;return this.regexp}const t=this.options;const r=t.noglobstar?se:t.dot?oe:ae;const i=new Set(t.nocase?["i"]:[]);let n=e.map((e=>{const t=e.map((e=>{if(e instanceof RegExp){for(const t of e.flags.split(""))i.add(t)}return typeof e==="string"?esm_regExpEscape(e):e===ie?ie:e._src}));t.forEach(((e,i)=>{const n=t[i+1];const s=t[i-1];if(e!==ie||s===ie){return}if(s===undefined){if(n!==undefined&&n!==ie){t[i+1]="(?:\\/|"+r+"\\/)?"+n}else{t[i]=r}}else if(n===undefined){t[i-1]=s+"(?:\\/|\\/"+r+")?"}else if(n!==ie){t[i-1]=s+"(?:\\/|\\/"+r+"\\/)"+n;t[i+1]=ie}}));const n=t.filter((e=>e!==ie));if(this.partial&&n.length>=1){const e=[];for(let t=1;t<=n.length;t++){e.push(n.slice(0,t).join("/"))}return"(?:"+e.join("|")+")"}return n.join("/")})).join("|");const[s,o]=e.length>1?["(?:",")"]:["",""];n="^"+s+n+o+"$";if(this.partial){n="^(?:\\/|"+s+n.slice(1,-1)+o+")$"}if(this.negate)n="^(?!"+n+").+$";try{this.regexp=new RegExp(n,[...i].join(""))}catch(e){this.regexp=false}return this.regexp}slashSplit(e){if(this.preserveMultipleSlashes){return e.split("/")}else if(this.isWindows&&/^\/\/[^\/]+/.test(e)){return["",...e.split(/\/+/)]}else{return e.split(/\/+/)}}match(e,t=this.partial){this.debug("match",e,this.pattern);if(this.comment){return false}if(this.empty){return e===""}if(e==="/"&&t){return true}const r=this.options;if(this.isWindows){e=e.split("\\").join("/")}const i=this.slashSplit(e);this.debug(this.pattern,"split",i);const n=this.set;this.debug(this.pattern,"set",n);let s=i[i.length-1];if(!s){for(let e=i.length-2;!s&&e>=0;e--){s=i[e]}}for(let e=0;e<n.length;e++){const o=n[e];let a=i;if(r.matchBase&&o.length===1){a=[s]}const c=this.matchOne(a,o,t);if(c){if(r.flipNegate){return true}return!this.negate}}if(r.flipNegate){return false}return this.negate}static defaults(e){return minimatch.defaults(e).Minimatch}}minimatch.AST=AST;minimatch.Minimatch=Minimatch;minimatch.escape=escape_escape;minimatch.unescape=unescape_unescape;const ue=require("node:url");const le=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date;const he=new Set;const fe=typeof process==="object"&&!!process?process:{};const emitWarning=(e,t,r,i)=>{typeof fe.emitWarning==="function"?fe.emitWarning(e,t,r,i):console.error(`[${r}] ${t}: ${e}`)};let pe=globalThis.AbortController;let de=globalThis.AbortSignal;if(typeof pe==="undefined"){de=class AbortSignal{onabort;_onabort=[];reason;aborted=false;addEventListener(e,t){this._onabort.push(t)}};pe=class AbortController{constructor(){warnACPolyfill()}signal=new de;abort(e){if(this.signal.aborted)return;this.signal.reason=e;this.signal.aborted=true;for(const t of this.signal._onabort){t(e)}this.signal.onabort?.(e)}};let e=fe.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1";const warnACPolyfill=()=>{if(!e)return;e=false;emitWarning("AbortController is not defined. If using lru-cache in "+"node 14, load an AbortController polyfill from the "+"`node-abort-controller` package. A minimal polyfill is "+"provided for use by LRUCache.fetch(), but it should not be "+"relied upon in other contexts (eg, passing it to other APIs that "+"use AbortController/AbortSignal might have undesirable effects). "+"You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",warnACPolyfill)}}const shouldWarn=e=>!he.has(e);const me=Symbol("type");const isPosInt=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e);const getUintArray=e=>!isPosInt(e)?null:e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?ZeroArray:null;class ZeroArray extends Array{constructor(e){super(e);this.fill(0)}}class Stack{heap;length;static#m=false;static create(e){const t=getUintArray(e);if(!t)return[];Stack.#m=true;const r=new Stack(e,t);Stack.#m=false;return r}constructor(e,t){if(!Stack.#m){throw new 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{#g;#v;#y;#b;#w;#S;#x;#_;get perf(){return this.#_}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#k;#E;#O;#A;#C;#P;#M;#R;#j;#T;#N;#F;#I;#L;#$;#D;#B;#G;#z;static unsafeExposeInternals(e){return{starts:e.#I,ttls:e.#L,autopurgeTimers:e.#$,sizes:e.#F,keyMap:e.#O,keyList:e.#A,valList:e.#C,next:e.#P,prev:e.#M,get head(){return e.#R},get tail(){return e.#j},free:e.#T,isBackgroundFetch:t=>e.#W(t),backgroundFetch:(t,r,i,n)=>e.#q(t,r,i,n),moveToTail:t=>e.#U(t),indexes:t=>e.#V(t),rindexes:t=>e.#H(t),isStale:t=>e.#Y(t)}}get max(){return this.#g}get maxSize(){return this.#v}get calculatedSize(){return this.#E}get size(){return this.#k}get fetchMethod(){return this.#S}get memoMethod(){return this.#x}get dispose(){return this.#y}get onInsert(){return this.#b}get disposeAfter(){return this.#w}constructor(e){const{max:t=0,ttl:r,ttlResolution:i=1,ttlAutopurge:n,updateAgeOnGet:s,updateAgeOnHas:o,allowStale:a,dispose:c,onInsert:u,disposeAfter:l,noDisposeOnSet:h,noUpdateTTL:p,maxSize:d=0,maxEntrySize:g=0,sizeCalculation:v,fetchMethod:y,memoMethod:b,noDeleteOnFetchRejection:w,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:x,allowStaleOnFetchAbort:_,ignoreFetchAbort:k,perf:O}=e;if(O!==undefined){if(typeof O?.now!=="function"){throw new TypeError("perf option must have a now() method if specified")}}this.#_=O??le;if(t!==0&&!isPosInt(t)){throw new TypeError("max option must be a nonnegative integer")}const A=t?getUintArray(t):Array;if(!A){throw new Error("invalid max value: "+t)}this.#g=t;this.#v=d;this.maxEntrySize=g||this.#v;this.sizeCalculation=v;if(this.sizeCalculation){if(!this.#v&&!this.maxEntrySize){throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize")}if(typeof this.sizeCalculation!=="function"){throw new TypeError("sizeCalculation set to non-function")}}if(b!==undefined&&typeof b!=="function"){throw new TypeError("memoMethod must be a function if defined")}this.#x=b;if(y!==undefined&&typeof y!=="function"){throw new TypeError("fetchMethod must be a function if specified")}this.#S=y;this.#B=!!y;this.#O=new Map;this.#A=new Array(t).fill(undefined);this.#C=new Array(t).fill(undefined);this.#P=new A(t);this.#M=new A(t);this.#R=0;this.#j=0;this.#T=Stack.create(t);this.#k=0;this.#E=0;if(typeof c==="function"){this.#y=c}if(typeof u==="function"){this.#b=u}if(typeof l==="function"){this.#w=l;this.#N=[]}else{this.#w=undefined;this.#N=undefined}this.#D=!!this.#y;this.#z=!!this.#b;this.#G=!!this.#w;this.noDisposeOnSet=!!h;this.noUpdateTTL=!!p;this.noDeleteOnFetchRejection=!!w;this.allowStaleOnFetchRejection=!!x;this.allowStaleOnFetchAbort=!!_;this.ignoreFetchAbort=!!k;if(this.maxEntrySize!==0){if(this.#v!==0){if(!isPosInt(this.#v)){throw new TypeError("maxSize must be a positive integer if specified")}}if(!isPosInt(this.maxEntrySize)){throw new TypeError("maxEntrySize must be a positive integer if specified")}this.#Q()}this.allowStale=!!a;this.noDeleteOnStaleGet=!!S;this.updateAgeOnGet=!!s;this.updateAgeOnHas=!!o;this.ttlResolution=isPosInt(i)||i===0?i:1;this.ttlAutopurge=!!n;this.ttl=r||0;if(this.ttl){if(!isPosInt(this.ttl)){throw new TypeError("ttl must be a positive integer if specified")}this.#J()}if(this.#g===0&&this.ttl===0&&this.#v===0){throw new TypeError("At least one of max, maxSize, or ttl is required")}if(!this.ttlAutopurge&&!this.#g&&!this.#v){const e="LRU_CACHE_UNBOUNDED";if(shouldWarn(e)){he.add(e);const t="TTL caching without ttlAutopurge, max, or maxSize can "+"result in unbounded memory consumption.";emitWarning(t,"UnboundedCacheWarning",e,LRUCache)}}}getRemainingTTL(e){return this.#O.has(e)?Infinity:0}#J(){const e=new ZeroArray(this.#g);const t=new ZeroArray(this.#g);this.#L=e;this.#I=t;const r=this.ttlAutopurge?new Array(this.#g):undefined;this.#$=r;this.#K=(i,n,s=this.#_.now())=>{t[i]=n!==0?s:0;e[i]=n;if(r?.[i]){clearTimeout(r[i]);r[i]=undefined}if(n!==0&&r){const e=setTimeout((()=>{if(this.#Y(i)){this.#Z(this.#A[i],"expire")}}),n+1);if(e.unref){e.unref()}r[i]=e}};this.#X=r=>{t[r]=e[r]!==0?this.#_.now():0};this.#ee=(r,n)=>{if(e[n]){const s=e[n];const o=t[n];if(!s||!o)return;r.ttl=s;r.start=o;r.now=i||getNow();const a=r.now-o;r.remainingTTL=s-a}};let i=0;const getNow=()=>{const e=this.#_.now();if(this.ttlResolution>0){i=e;const t=setTimeout((()=>i=0),this.ttlResolution);if(t.unref){t.unref()}}return e};this.getRemainingTTL=r=>{const n=this.#O.get(r);if(n===undefined){return 0}const s=e[n];const o=t[n];if(!s||!o){return Infinity}const a=(i||getNow())-o;return s-a};this.#Y=r=>{const n=t[r];const s=e[r];return!!s&&!!n&&(i||getNow())-n>s}}#X=()=>{};#ee=()=>{};#K=()=>{};#Y=()=>false;#Q(){const e=new ZeroArray(this.#g);this.#E=0;this.#F=e;this.#te=t=>{this.#E-=e[t];e[t]=0};this.#re=(e,t,r,i)=>{if(this.#W(t)){return 0}if(!isPosInt(r)){if(i){if(typeof i!=="function"){throw new TypeError("sizeCalculation must be a function")}r=i(t,e);if(!isPosInt(r)){throw new TypeError("sizeCalculation return invalid (expect positive integer)")}}else{throw new TypeError("invalid size value (must be positive integer). "+"When maxSize or maxEntrySize is used, sizeCalculation "+"or size must be set.")}}return r};this.#ie=(t,r,i)=>{e[t]=r;if(this.#v){const r=this.#v-e[t];while(this.#E>r){this.#ne(true)}}this.#E+=e[t];if(i){i.entrySize=r;i.totalCalculatedSize=this.#E}}}#te=e=>{};#ie=(e,t,r)=>{};#re=(e,t,r,i)=>{if(r||i){throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}return 0};*#V({allowStale:e=this.allowStale}={}){if(this.#k){for(let t=this.#j;true;){if(!this.#se(t)){break}if(e||!this.#Y(t)){yield t}if(t===this.#R){break}else{t=this.#M[t]}}}}*#H({allowStale:e=this.allowStale}={}){if(this.#k){for(let t=this.#R;true;){if(!this.#se(t)){break}if(e||!this.#Y(t)){yield t}if(t===this.#j){break}else{t=this.#P[t]}}}}#se(e){return e!==undefined&&this.#O.get(this.#A[e])===e}*entries(){for(const e of this.#V()){if(this.#C[e]!==undefined&&this.#A[e]!==undefined&&!this.#W(this.#C[e])){yield[this.#A[e],this.#C[e]]}}}*rentries(){for(const e of this.#H()){if(this.#C[e]!==undefined&&this.#A[e]!==undefined&&!this.#W(this.#C[e])){yield[this.#A[e],this.#C[e]]}}}*keys(){for(const e of this.#V()){const t=this.#A[e];if(t!==undefined&&!this.#W(this.#C[e])){yield t}}}*rkeys(){for(const e of this.#H()){const t=this.#A[e];if(t!==undefined&&!this.#W(this.#C[e])){yield t}}}*values(){for(const e of this.#V()){const t=this.#C[e];if(t!==undefined&&!this.#W(this.#C[e])){yield this.#C[e]}}}*rvalues(){for(const e of this.#H()){const t=this.#C[e];if(t!==undefined&&!this.#W(this.#C[e])){yield this.#C[e]}}}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(const r of this.#V()){const i=this.#C[r];const n=this.#W(i)?i.__staleWhileFetching:i;if(n===undefined)continue;if(e(n,this.#A[r],this)){return this.get(this.#A[r],t)}}}forEach(e,t=this){for(const r of this.#V()){const i=this.#C[r];const n=this.#W(i)?i.__staleWhileFetching:i;if(n===undefined)continue;e.call(t,n,this.#A[r],this)}}rforEach(e,t=this){for(const r of this.#H()){const i=this.#C[r];const n=this.#W(i)?i.__staleWhileFetching:i;if(n===undefined)continue;e.call(t,n,this.#A[r],this)}}purgeStale(){let e=false;for(const t of this.#H({allowStale:true})){if(this.#Y(t)){this.#Z(this.#A[t],"expire");e=true}}return e}info(e){const t=this.#O.get(e);if(t===undefined)return undefined;const r=this.#C[t];const i=this.#W(r)?r.__staleWhileFetching:r;if(i===undefined)return undefined;const n={value:i};if(this.#L&&this.#I){const e=this.#L[t];const r=this.#I[t];if(e&&r){const t=e-(this.#_.now()-r);n.ttl=t;n.start=Date.now()}}if(this.#F){n.size=this.#F[t]}return n}dump(){const e=[];for(const t of this.#V({allowStale:true})){const r=this.#A[t];const i=this.#C[t];const n=this.#W(i)?i.__staleWhileFetching:i;if(n===undefined||r===undefined)continue;const s={value:n};if(this.#L&&this.#I){s.ttl=this.#L[t];const e=this.#_.now()-this.#I[t];s.start=Math.floor(Date.now()-e)}if(this.#F){s.size=this.#F[t]}e.unshift([r,s])}return e}load(e){this.clear();for(const[t,r]of e){if(r.start){const e=Date.now()-r.start;r.start=this.#_.now()-e}this.set(t,r.value,r)}}set(e,t,r={}){if(t===undefined){this.delete(e);return this}const{ttl:i=this.ttl,start:n,noDisposeOnSet:s=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:a}=r;let{noUpdateTTL:c=this.noUpdateTTL}=r;const u=this.#re(e,t,r.size||0,o);if(this.maxEntrySize&&u>this.maxEntrySize){if(a){a.set="miss";a.maxEntrySizeExceeded=true}this.#Z(e,"set");return this}let l=this.#k===0?undefined:this.#O.get(e);if(l===undefined){l=this.#k===0?this.#j:this.#T.length!==0?this.#T.pop():this.#k===this.#g?this.#ne(false):this.#k;this.#A[l]=e;this.#C[l]=t;this.#O.set(e,l);this.#P[this.#j]=l;this.#M[l]=this.#j;this.#j=l;this.#k++;this.#ie(l,u,a);if(a)a.set="add";c=false;if(this.#z){this.#b?.(t,e,"add")}}else{this.#U(l);const r=this.#C[l];if(t!==r){if(this.#B&&this.#W(r)){r.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:t}=r;if(t!==undefined&&!s){if(this.#D){this.#y?.(t,e,"set")}if(this.#G){this.#N?.push([t,e,"set"])}}}else if(!s){if(this.#D){this.#y?.(r,e,"set")}if(this.#G){this.#N?.push([r,e,"set"])}}this.#te(l);this.#ie(l,u,a);this.#C[l]=t;if(a){a.set="replace";const e=r&&this.#W(r)?r.__staleWhileFetching:r;if(e!==undefined)a.oldValue=e}}else if(a){a.set="update"}if(this.#z){this.onInsert?.(t,e,t===r?"update":"replace")}}if(i!==0&&!this.#L){this.#J()}if(this.#L){if(!c){this.#K(l,i,n)}if(a)this.#ee(a,l)}if(!s&&this.#G&&this.#N){const e=this.#N;let t;while(t=e?.shift()){this.#w?.(...t)}}return this}pop(){try{while(this.#k){const e=this.#C[this.#R];this.#ne(true);if(this.#W(e)){if(e.__staleWhileFetching){return e.__staleWhileFetching}}else if(e!==undefined){return e}}}finally{if(this.#G&&this.#N){const e=this.#N;let t;while(t=e?.shift()){this.#w?.(...t)}}}}#ne(e){const t=this.#R;const r=this.#A[t];const i=this.#C[t];if(this.#B&&this.#W(i)){i.__abortController.abort(new Error("evicted"))}else if(this.#D||this.#G){if(this.#D){this.#y?.(i,r,"evict")}if(this.#G){this.#N?.push([i,r,"evict"])}}this.#te(t);if(this.#$?.[t]){clearTimeout(this.#$[t]);this.#$[t]=undefined}if(e){this.#A[t]=undefined;this.#C[t]=undefined;this.#T.push(t)}if(this.#k===1){this.#R=this.#j=0;this.#T.length=0}else{this.#R=this.#P[t]}this.#O.delete(r);this.#k--;return t}has(e,t={}){const{updateAgeOnHas:r=this.updateAgeOnHas,status:i}=t;const n=this.#O.get(e);if(n!==undefined){const e=this.#C[n];if(this.#W(e)&&e.__staleWhileFetching===undefined){return false}if(!this.#Y(n)){if(r){this.#X(n)}if(i){i.has="hit";this.#ee(i,n)}return true}else if(i){i.has="stale";this.#ee(i,n)}}else if(i){i.has="miss"}return false}peek(e,t={}){const{allowStale:r=this.allowStale}=t;const i=this.#O.get(e);if(i===undefined||!r&&this.#Y(i)){return}const n=this.#C[i];return this.#W(n)?n.__staleWhileFetching:n}#q(e,t,r,i){const n=t===undefined?undefined:this.#C[t];if(this.#W(n)){return n}const s=new pe;const{signal:o}=r;o?.addEventListener("abort",(()=>s.abort(o.reason)),{signal:s.signal});const a={signal:s.signal,options:r,context:i};const cb=(i,n=false)=>{const{aborted:o}=s.signal;const u=r.ignoreFetchAbort&&i!==undefined;if(r.status){if(o&&!n){r.status.fetchAborted=true;r.status.fetchError=s.signal.reason;if(u)r.status.fetchAbortIgnored=true}else{r.status.fetchResolved=true}}if(o&&!u&&!n){return fetchFail(s.signal.reason)}const l=c;const h=this.#C[t];if(h===c||u&&n&&h===undefined){if(i===undefined){if(l.__staleWhileFetching!==undefined){this.#C[t]=l.__staleWhileFetching}else{this.#Z(e,"fetch")}}else{if(r.status)r.status.fetchUpdated=true;this.set(e,i,a.options)}}return i};const eb=e=>{if(r.status){r.status.fetchRejected=true;r.status.fetchError=e}return fetchFail(e)};const fetchFail=i=>{const{aborted:n}=s.signal;const o=n&&r.allowStaleOnFetchAbort;const a=o||r.allowStaleOnFetchRejection;const u=a||r.noDeleteOnFetchRejection;const l=c;if(this.#C[t]===c){const r=!u||l.__staleWhileFetching===undefined;if(r){this.#Z(e,"fetch")}else if(!o){this.#C[t]=l.__staleWhileFetching}}if(a){if(r.status&&l.__staleWhileFetching!==undefined){r.status.returnedStale=true}return l.__staleWhileFetching}else if(l.__returned===l){throw i}};const pcall=(t,i)=>{const o=this.#S?.(e,n,a);if(o&&o instanceof Promise){o.then((e=>t(e===undefined?undefined:e)),i)}s.signal.addEventListener("abort",(()=>{if(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort){t(undefined);if(r.allowStaleOnFetchAbort){t=e=>cb(e,true)}}}))};if(r.status)r.status.fetchDispatched=true;const c=new Promise(pcall).then(cb,eb);const u=Object.assign(c,{__abortController:s,__staleWhileFetching:n,__returned:undefined});if(t===undefined){this.set(e,u,{...a.options,status:undefined});t=this.#O.get(e)}else{this.#C[t]=u}return u}#W(e){if(!this.#B)return false;const t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof pe}async fetch(e,t={}){const{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:a=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:l=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:d=this.allowStaleOnFetchAbort,context:g,forceRefresh:v=false,status:y,signal:b}=t;if(!this.#B){if(y)y.fetch="get";return this.get(e,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:n,status:y})}const w={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:n,ttl:s,noDisposeOnSet:o,size:a,sizeCalculation:c,noUpdateTTL:u,noDeleteOnFetchRejection:l,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:d,ignoreFetchAbort:p,status:y,signal:b};let S=this.#O.get(e);if(S===undefined){if(y)y.fetch="miss";const t=this.#q(e,S,w,g);return t.__returned=t}else{const t=this.#C[S];if(this.#W(t)){const e=r&&t.__staleWhileFetching!==undefined;if(y){y.fetch="inflight";if(e)y.returnedStale=true}return e?t.__staleWhileFetching:t.__returned=t}const n=this.#Y(S);if(!v&&!n){if(y)y.fetch="hit";this.#U(S);if(i){this.#X(S)}if(y)this.#ee(y,S);return t}const s=this.#q(e,S,w,g);const o=s.__staleWhileFetching!==undefined;const a=o&&r;if(y){y.fetch=n?"stale":"refresh";if(a&&n)y.returnedStale=true}return a?s.__staleWhileFetching:s.__returned=s}}async forceFetch(e,t={}){const r=await this.fetch(e,t);if(r===undefined)throw new Error("fetch() returned undefined");return r}memo(e,t={}){const r=this.#x;if(!r){throw new Error("no memoMethod provided to constructor")}const{context:i,forceRefresh:n,...s}=t;const o=this.get(e,s);if(!n&&o!==undefined)return o;const a=r(e,o,{options:s,context:i});this.set(e,a,s);return a}get(e,t={}){const{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:s}=t;const o=this.#O.get(e);if(o!==undefined){const t=this.#C[o];const a=this.#W(t);if(s)this.#ee(s,o);if(this.#Y(o)){if(s)s.get="stale";if(!a){if(!n){this.#Z(e,"expire")}if(s&&r)s.returnedStale=true;return r?t:undefined}else{if(s&&r&&t.__staleWhileFetching!==undefined){s.returnedStale=true}return r?t.__staleWhileFetching:undefined}}else{if(s)s.get="hit";if(a){return t.__staleWhileFetching}this.#U(o);if(i){this.#X(o)}return t}}else if(s){s.get="miss"}}#oe(e,t){this.#M[t]=e;this.#P[e]=t}#U(e){if(e!==this.#j){if(e===this.#R){this.#R=this.#P[e]}else{this.#oe(this.#M[e],this.#P[e])}this.#oe(this.#j,e);this.#j=e}}delete(e){return this.#Z(e,"delete")}#Z(e,t){let r=false;if(this.#k!==0){const i=this.#O.get(e);if(i!==undefined){if(this.#$?.[i]){clearTimeout(this.#$?.[i]);this.#$[i]=undefined}r=true;if(this.#k===1){this.#ae(t)}else{this.#te(i);const r=this.#C[i];if(this.#W(r)){r.__abortController.abort(new Error("deleted"))}else if(this.#D||this.#G){if(this.#D){this.#y?.(r,e,t)}if(this.#G){this.#N?.push([r,e,t])}}this.#O.delete(e);this.#A[i]=undefined;this.#C[i]=undefined;if(i===this.#j){this.#j=this.#M[i]}else if(i===this.#R){this.#R=this.#P[i]}else{const e=this.#M[i];this.#P[e]=this.#P[i];const t=this.#P[i];this.#M[t]=this.#M[i]}this.#k--;this.#T.push(i)}}}if(this.#G&&this.#N?.length){const e=this.#N;let t;while(t=e?.shift()){this.#w?.(...t)}}return r}clear(){return this.#ae("delete")}#ae(e){for(const t of this.#H({allowStale:true})){const r=this.#C[t];if(this.#W(r)){r.__abortController.abort(new Error("deleted"))}else{const i=this.#A[t];if(this.#D){this.#y?.(r,i,e)}if(this.#G){this.#N?.push([r,i,e])}}}this.#O.clear();this.#C.fill(undefined);this.#A.fill(undefined);if(this.#L&&this.#I){this.#L.fill(0);this.#I.fill(0);for(const e of this.#$??[]){if(e!==undefined)clearTimeout(e)}this.#$?.fill(undefined)}if(this.#F){this.#F.fill(0)}this.#R=0;this.#j=0;this.#T.length=0;this.#E=0;this.#k=0;if(this.#G&&this.#N){const e=this.#N;let t;while(t=e?.shift()){this.#w?.(...t)}}}}const ge=require("node:path");const ve=require("node:fs");var ye=__nccwpck_require__.t(ve,2);const be=require("node:fs/promises");const we=require("node:events");const Se=require("node:stream");const xe=require("node:string_decoder");const _e=typeof process==="object"&&process?process:{stdout:null,stderr:null};const isStream=e=>!!e&&typeof e==="object"&&(e instanceof Minipass||e instanceof Se||isReadable(e)||isWritable(e));const isReadable=e=>!!e&&typeof e==="object"&&e instanceof we.EventEmitter&&typeof e.pipe==="function"&&e.pipe!==Se.Writable.prototype.pipe;const isWritable=e=>!!e&&typeof e==="object"&&e instanceof we.EventEmitter&&typeof e.write==="function"&&typeof e.end==="function";const ke=Symbol("EOF");const Ee=Symbol("maybeEmitEnd");const Oe=Symbol("emittedEnd");const Ae=Symbol("emittingEnd");const Ce=Symbol("emittedError");const Pe=Symbol("closed");const Me=Symbol("read");const Re=Symbol("flush");const je=Symbol("flushChunk");const Te=Symbol("encoding");const Ne=Symbol("decoder");const Fe=Symbol("flowing");const Ie=Symbol("paused");const Le=Symbol("resume");const $e=Symbol("buffer");const De=Symbol("pipes");const Be=Symbol("bufferLength");const Ge=Symbol("bufferPush");const ze=Symbol("bufferShift");const We=Symbol("objectMode");const qe=Symbol("destroyed");const Ue=Symbol("error");const Ve=Symbol("emitData");const He=Symbol("emitEnd");const Ye=Symbol("emitEnd2");const Qe=Symbol("async");const Je=Symbol("abort");const Ke=Symbol("aborted");const Ze=Symbol("signal");const Xe=Symbol("dataListeners");const et=Symbol("discarded");const defer=e=>Promise.resolve().then(e);const nodefer=e=>e();const isEndish=e=>e==="end"||e==="finish"||e==="prefinish";const isArrayBufferLike=e=>e instanceof ArrayBuffer||!!e&&typeof e==="object"&&e.constructor&&e.constructor.name==="ArrayBuffer"&&e.byteLength>=0;const isArrayBufferView=e=>!Buffer.isBuffer(e)&&ArrayBuffer.isView(e);class Pipe{src;dest;opts;ondrain;constructor(e,t,r){this.src=e;this.dest=t;this.opts=r;this.ondrain=()=>e[Le]();this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe();if(this.opts.end)this.dest.end()}}class PipeProxyErrors extends Pipe{unpipe(){this.src.removeListener("error",this.proxyErrors);super.unpipe()}constructor(e,t,r){super(e,t,r);this.proxyErrors=e=>t.emit("error",e);e.on("error",this.proxyErrors)}}const isObjectModeOptions=e=>!!e.objectMode;const isEncodingOptions=e=>!e.objectMode&&!!e.encoding&&e.encoding!=="buffer";class Minipass extends we.EventEmitter{[Fe]=false;[Ie]=false;[De]=[];[$e]=[];[We];[Te];[Qe];[Ne];[ke]=false;[Oe]=false;[Ae]=false;[Pe]=false;[Ce]=null;[Be]=0;[qe]=false;[Ze];[Ke]=false;[Xe]=0;[et]=false;writable=true;readable=true;constructor(...e){const t=e[0]||{};super();if(t.objectMode&&typeof t.encoding==="string"){throw new TypeError("Encoding and objectMode may not be used together")}if(isObjectModeOptions(t)){this[We]=true;this[Te]=null}else if(isEncodingOptions(t)){this[Te]=t.encoding;this[We]=false}else{this[We]=false;this[Te]=null}this[Qe]=!!t.async;this[Ne]=this[Te]?new xe.StringDecoder(this[Te]):null;if(t&&t.debugExposeBuffer===true){Object.defineProperty(this,"buffer",{get:()=>this[$e]})}if(t&&t.debugExposePipes===true){Object.defineProperty(this,"pipes",{get:()=>this[De]})}const{signal:r}=t;if(r){this[Ze]=r;if(r.aborted){this[Je]()}else{r.addEventListener("abort",(()=>this[Je]()))}}}get bufferLength(){return this[Be]}get encoding(){return this[Te]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[We]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get["async"](){return this[Qe]}set["async"](e){this[Qe]=this[Qe]||!!e}[Je](){this[Ke]=true;this.emit("abort",this[Ze]?.reason);this.destroy(this[Ze]?.reason)}get aborted(){return this[Ke]}set aborted(e){}write(e,t,r){if(this[Ke])return false;if(this[ke])throw new Error("write after end");if(this[qe]){this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"}));return true}if(typeof t==="function"){r=t;t="utf8"}if(!t)t="utf8";const i=this[Qe]?defer:nodefer;if(!this[We]&&!Buffer.isBuffer(e)){if(isArrayBufferView(e)){e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)}else if(isArrayBufferLike(e)){e=Buffer.from(e)}else if(typeof e!=="string"){throw new Error("Non-contiguous data written to non-objectMode stream")}}if(this[We]){if(this[Fe]&&this[Be]!==0)this[Re](true);if(this[Fe])this.emit("data",e);else this[Ge](e);if(this[Be]!==0)this.emit("readable");if(r)i(r);return this[Fe]}if(!e.length){if(this[Be]!==0)this.emit("readable");if(r)i(r);return this[Fe]}if(typeof e==="string"&&!(t===this[Te]&&!this[Ne]?.lastNeed)){e=Buffer.from(e,t)}if(Buffer.isBuffer(e)&&this[Te]){e=this[Ne].write(e)}if(this[Fe]&&this[Be]!==0)this[Re](true);if(this[Fe])this.emit("data",e);else this[Ge](e);if(this[Be]!==0)this.emit("readable");if(r)i(r);return this[Fe]}read(e){if(this[qe])return null;this[et]=false;if(this[Be]===0||e===0||e&&e>this[Be]){this[Ee]();return null}if(this[We])e=null;if(this[$e].length>1&&!this[We]){this[$e]=[this[Te]?this[$e].join(""):Buffer.concat(this[$e],this[Be])]}const t=this[Me](e||null,this[$e][0]);this[Ee]();return t}[Me](e,t){if(this[We])this[ze]();else{const r=t;if(e===r.length||e===null)this[ze]();else if(typeof r==="string"){this[$e][0]=r.slice(e);t=r.slice(0,e);this[Be]-=e}else{this[$e][0]=r.subarray(e);t=r.subarray(0,e);this[Be]-=e}}this.emit("data",t);if(!this[$e].length&&!this[ke])this.emit("drain");return t}end(e,t,r){if(typeof e==="function"){r=e;e=undefined}if(typeof t==="function"){r=t;t="utf8"}if(e!==undefined)this.write(e,t);if(r)this.once("end",r);this[ke]=true;this.writable=false;if(this[Fe]||!this[Ie])this[Ee]();return this}[Le](){if(this[qe])return;if(!this[Xe]&&!this[De].length){this[et]=true}this[Ie]=false;this[Fe]=true;this.emit("resume");if(this[$e].length)this[Re]();else if(this[ke])this[Ee]();else this.emit("drain")}resume(){return this[Le]()}pause(){this[Fe]=false;this[Ie]=true;this[et]=false}get destroyed(){return this[qe]}get flowing(){return this[Fe]}get paused(){return this[Ie]}[Ge](e){if(this[We])this[Be]+=1;else this[Be]+=e.length;this[$e].push(e)}[ze](){if(this[We])this[Be]-=1;else this[Be]-=this[$e][0].length;return this[$e].shift()}[Re](e=false){do{}while(this[je](this[ze]())&&this[$e].length);if(!e&&!this[$e].length&&!this[ke])this.emit("drain")}[je](e){this.emit("data",e);return this[Fe]}pipe(e,t){if(this[qe])return e;this[et]=false;const r=this[Oe];t=t||{};if(e===_e.stdout||e===_e.stderr)t.end=false;else t.end=t.end!==false;t.proxyErrors=!!t.proxyErrors;if(r){if(t.end)e.end()}else{this[De].push(!t.proxyErrors?new Pipe(this,e,t):new PipeProxyErrors(this,e,t));if(this[Qe])defer((()=>this[Le]()));else this[Le]()}return e}unpipe(e){const t=this[De].find((t=>t.dest===e));if(t){if(this[De].length===1){if(this[Fe]&&this[Xe]===0){this[Fe]=false}this[De]=[]}else this[De].splice(this[De].indexOf(t),1);t.unpipe()}}addListener(e,t){return this.on(e,t)}on(e,t){const r=super.on(e,t);if(e==="data"){this[et]=false;this[Xe]++;if(!this[De].length&&!this[Fe]){this[Le]()}}else if(e==="readable"&&this[Be]!==0){super.emit("readable")}else if(isEndish(e)&&this[Oe]){super.emit(e);this.removeAllListeners(e)}else if(e==="error"&&this[Ce]){const e=t;if(this[Qe])defer((()=>e.call(this,this[Ce])));else e.call(this,this[Ce])}return r}removeListener(e,t){return this.off(e,t)}off(e,t){const r=super.off(e,t);if(e==="data"){this[Xe]=this.listeners("data").length;if(this[Xe]===0&&!this[et]&&!this[De].length){this[Fe]=false}}return r}removeAllListeners(e){const t=super.removeAllListeners(e);if(e==="data"||e===undefined){this[Xe]=0;if(!this[et]&&!this[De].length){this[Fe]=false}}return t}get emittedEnd(){return this[Oe]}[Ee](){if(!this[Ae]&&!this[Oe]&&!this[qe]&&this[$e].length===0&&this[ke]){this[Ae]=true;this.emit("end");this.emit("prefinish");this.emit("finish");if(this[Pe])this.emit("close");this[Ae]=false}}emit(e,...t){const r=t[0];if(e!=="error"&&e!=="close"&&e!==qe&&this[qe]){return false}else if(e==="data"){return!this[We]&&!r?false:this[Qe]?(defer((()=>this[Ve](r))),true):this[Ve](r)}else if(e==="end"){return this[He]()}else if(e==="close"){this[Pe]=true;if(!this[Oe]&&!this[qe])return false;const e=super.emit("close");this.removeAllListeners("close");return e}else if(e==="error"){this[Ce]=r;super.emit(Ue,r);const e=!this[Ze]||this.listeners("error").length?super.emit("error",r):false;this[Ee]();return e}else if(e==="resume"){const e=super.emit("resume");this[Ee]();return e}else if(e==="finish"||e==="prefinish"){const t=super.emit(e);this.removeAllListeners(e);return t}const i=super.emit(e,...t);this[Ee]();return i}[Ve](e){for(const t of this[De]){if(t.dest.write(e)===false)this.pause()}const t=this[et]?false:super.emit("data",e);this[Ee]();return t}[He](){if(this[Oe])return false;this[Oe]=true;this.readable=false;return this[Qe]?(defer((()=>this[Ye]())),true):this[Ye]()}[Ye](){if(this[Ne]){const e=this[Ne].end();if(e){for(const t of this[De]){t.dest.write(e)}if(!this[et])super.emit("data",e)}}for(const e of this[De]){e.end()}const e=super.emit("end");this.removeAllListeners("end");return e}async collect(){const e=Object.assign([],{dataLength:0});if(!this[We])e.dataLength=0;const t=this.promise();this.on("data",(t=>{e.push(t);if(!this[We])e.dataLength+=t.length}));await t;return e}async concat(){if(this[We]){throw new Error("cannot concat in objectMode")}const e=await this.collect();return this[Te]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise(((e,t)=>{this.on(qe,(()=>t(new Error("stream destroyed"))));this.on("error",(e=>t(e)));this.on("end",(()=>e()))}))}[Symbol.asyncIterator](){this[et]=false;let e=false;const stop=async()=>{this.pause();e=true;return{value:undefined,done:true}};const next=()=>{if(e)return stop();const t=this.read();if(t!==null)return Promise.resolve({done:false,value:t});if(this[ke])return stop();let r;let i;const onerr=e=>{this.off("data",ondata);this.off("end",onend);this.off(qe,ondestroy);stop();i(e)};const ondata=e=>{this.off("error",onerr);this.off("end",onend);this.off(qe,ondestroy);this.pause();r({value:e,done:!!this[ke]})};const onend=()=>{this.off("error",onerr);this.off("data",ondata);this.off(qe,ondestroy);stop();r({done:true,value:undefined})};const ondestroy=()=>onerr(new Error("stream destroyed"));return new Promise(((e,t)=>{i=t;r=e;this.once(qe,ondestroy);this.once("error",onerr);this.once("end",onend);this.once("data",ondata)}))};return{next:next,throw:stop,return:stop,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[et]=false;let e=false;const stop=()=>{this.pause();this.off(Ue,stop);this.off(qe,stop);this.off("end",stop);e=true;return{done:true,value:undefined}};const next=()=>{if(e)return stop();const t=this.read();return t===null?stop():{done:false,value:t}};this.once("end",stop);this.once(Ue,stop);this.once(qe,stop);return{next:next,throw:stop,return:stop,[Symbol.iterator](){return this}}}destroy(e){if(this[qe]){if(e)this.emit("error",e);else this.emit(qe);return this}this[qe]=true;this[et]=true;this[$e].length=0;this[Be]=0;const t=this;if(typeof t.close==="function"&&!this[Pe])t.close();if(e)this.emit("error",e);else this.emit(qe);return this}static get isStream(){return isStream}}const tt=g.realpathSync.native;const rt={lstatSync:g.lstatSync,readdir:g.readdir,readdirSync:g.readdirSync,readlinkSync:g.readlinkSync,realpathSync:tt,promises:{lstat:be.lstat,readdir:be.readdir,readlink:be.readlink,realpath:be.realpath}};const fsFromOption=e=>!e||e===rt||e===ye?rt:{...rt,...e,promises:{...rt.promises,...e.promises||{}}};const it=/^\\\\\?\\([a-z]:)\\?$/i;const uncToDrive=e=>e.replace(/\//g,"\\").replace(it,"$1\\");const nt=/[\\\/]/;const st=0;const ot=1;const at=2;const ct=4;const ut=6;const ht=8;const ft=10;const pt=12;const dt=15;const mt=~dt;const vt=16;const yt=32;const bt=64;const wt=128;const St=256;const xt=512;const _t=bt|wt|xt;const kt=1023;const entToType=e=>e.isFile()?ht:e.isDirectory()?ct:e.isSymbolicLink()?ft:e.isCharacterDevice()?at:e.isBlockDevice()?ut:e.isSocket()?pt:e.isFIFO()?ot:st;const Et=new LRUCache({max:2**12});const normalize=e=>{const t=Et.get(e);if(t)return t;const r=e.normalize("NFKD");Et.set(e,r);return r};const Ot=new LRUCache({max:2**12});const normalizeNocase=e=>{const t=Ot.get(e);if(t)return t;const r=normalize(e.toLowerCase());Ot.set(e,r);return r};class ResolveCache extends LRUCache{constructor(){super({max:256})}}class ChildrenCache extends LRUCache{constructor(e=16*1024){super({maxSize:e,sizeCalculation:e=>e.length+1})}}const At=Symbol("PathScurry setAsCwd");class PathBase{name;root;roots;parent;nocase;isCWD=false;#ce;#ue;get dev(){return this.#ue}#le;get mode(){return this.#le}#he;get nlink(){return this.#he}#fe;get uid(){return this.#fe}#pe;get gid(){return this.#pe}#de;get rdev(){return this.#de}#me;get blksize(){return this.#me}#ge;get ino(){return this.#ge}#k;get size(){return this.#k}#ve;get blocks(){return this.#ve}#ye;get atimeMs(){return this.#ye}#be;get mtimeMs(){return this.#be}#we;get ctimeMs(){return this.#we}#Se;get birthtimeMs(){return this.#Se}#xe;get atime(){return this.#xe}#_e;get mtime(){return this.#_e}#ke;get ctime(){return this.#ke}#Ee;get birthtime(){return this.#Ee}#Oe;#Ae;#Ce;#Pe;#Me;#Re;#je;#Te;#Ne;#Fe;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=st,r,i,n,s,o){this.name=e;this.#Oe=n?normalizeNocase(e):normalize(e);this.#je=t&kt;this.nocase=n;this.roots=i;this.root=r||this;this.#Te=s;this.#Ce=o.fullpath;this.#Me=o.relative;this.#Re=o.relativePosix;this.parent=o.parent;if(this.parent){this.#ce=this.parent.#ce}else{this.#ce=fsFromOption(o.fs)}}depth(){if(this.#Ae!==undefined)return this.#Ae;if(!this.parent)return this.#Ae=0;return this.#Ae=this.parent.depth()+1}childrenCache(){return this.#Te}resolve(e){if(!e){return this}const t=this.getRootString(e);const r=e.substring(t.length);const i=r.split(this.splitSep);const n=t?this.getRoot(t).#Ie(i):this.#Ie(i);return n}#Ie(e){let t=this;for(const r of e){t=t.child(r)}return t}children(){const e=this.#Te.get(this);if(e){return e}const t=Object.assign([],{provisional:0});this.#Te.set(this,t);this.#je&=~vt;return t}child(e,t){if(e===""||e==="."){return this}if(e===".."){return this.parent||this}const r=this.children();const i=this.nocase?normalizeNocase(e):normalize(e);for(const e of r){if(e.#Oe===i){return e}}const n=this.parent?this.sep:"";const s=this.#Ce?this.#Ce+n+e:undefined;const o=this.newChild(e,st,{...t,parent:this,fullpath:s});if(!this.canReaddir()){o.#je|=wt}r.push(o);return o}relative(){if(this.isCWD)return"";if(this.#Me!==undefined){return this.#Me}const e=this.name;const t=this.parent;if(!t){return this.#Me=this.name}const r=t.relative();return r+(!r||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#Re!==undefined)return this.#Re;const e=this.name;const t=this.parent;if(!t){return this.#Re=this.fullpathPosix()}const r=t.relativePosix();return r+(!r||!t.parent?"":"/")+e}fullpath(){if(this.#Ce!==undefined){return this.#Ce}const e=this.name;const t=this.parent;if(!t){return this.#Ce=this.name}const r=t.fullpath();const i=r+(!t.parent?"":this.sep)+e;return this.#Ce=i}fullpathPosix(){if(this.#Pe!==undefined)return this.#Pe;if(this.sep==="/")return this.#Pe=this.fullpath();if(!this.parent){const e=this.fullpath().replace(/\\/g,"/");if(/^[a-z]:\//i.test(e)){return this.#Pe=`//?/${e}`}else{return this.#Pe=e}}const e=this.parent;const t=e.fullpathPosix();const r=t+(!t||!e.parent?"":"/")+this.name;return this.#Pe=r}isUnknown(){return(this.#je&dt)===st}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.#je&dt)===ht}isDirectory(){return(this.#je&dt)===ct}isCharacterDevice(){return(this.#je&dt)===at}isBlockDevice(){return(this.#je&dt)===ut}isFIFO(){return(this.#je&dt)===ot}isSocket(){return(this.#je&dt)===pt}isSymbolicLink(){return(this.#je&ft)===ft}lstatCached(){return this.#je&yt?this:undefined}readlinkCached(){return this.#Ne}realpathCached(){return this.#Fe}readdirCached(){const e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#Ne)return true;if(!this.parent)return false;const e=this.#je&dt;return!(e!==st&&e!==ft||this.#je&St||this.#je&wt)}calledReaddir(){return!!(this.#je&vt)}isENOENT(){return!!(this.#je&wt)}isNamed(e){return!this.nocase?this.#Oe===normalize(e):this.#Oe===normalizeNocase(e)}async readlink(){const e=this.#Ne;if(e){return e}if(!this.canReadlink()){return undefined}if(!this.parent){return undefined}try{const e=await this.#ce.promises.readlink(this.fullpath());const t=(await this.parent.realpath())?.resolve(e);if(t){return this.#Ne=t}}catch(e){this.#Le(e.code);return undefined}}readlinkSync(){const e=this.#Ne;if(e){return e}if(!this.canReadlink()){return undefined}if(!this.parent){return undefined}try{const e=this.#ce.readlinkSync(this.fullpath());const t=this.parent.realpathSync()?.resolve(e);if(t){return this.#Ne=t}}catch(e){this.#Le(e.code);return undefined}}#$e(e){this.#je|=vt;for(let t=e.provisional;t<e.length;t++){const r=e[t];if(r)r.#De()}}#De(){if(this.#je&wt)return;this.#je=(this.#je|wt)&mt;this.#Be()}#Be(){const e=this.children();e.provisional=0;for(const t of e){t.#De()}}#Ge(){this.#je|=xt;this.#ze()}#ze(){if(this.#je&bt)return;let e=this.#je;if((e&dt)===ct)e&=mt;this.#je=e|bt;this.#Be()}#We(e=""){if(e==="ENOTDIR"||e==="EPERM"){this.#ze()}else if(e==="ENOENT"){this.#De()}else{this.children().provisional=0}}#qe(e=""){if(e==="ENOTDIR"){const e=this.parent;e.#ze()}else if(e==="ENOENT"){this.#De()}}#Le(e=""){let t=this.#je;t|=St;if(e==="ENOENT")t|=wt;if(e==="EINVAL"||e==="UNKNOWN"){t&=mt}this.#je=t;if(e==="ENOTDIR"&&this.parent){this.parent.#ze()}}#Ue(e,t){return this.#Ve(e,t)||this.#He(e,t)}#He(e,t){const r=entToType(e);const i=this.newChild(e.name,r,{parent:this});const n=i.#je&dt;if(n!==ct&&n!==ft&&n!==st){i.#je|=bt}t.unshift(i);t.provisional++;return i}#Ve(e,t){for(let r=t.provisional;r<t.length;r++){const i=t[r];const n=this.nocase?normalizeNocase(e.name):normalize(e.name);if(n!==i.#Oe){continue}return this.#Ye(e,i,r,t)}}#Ye(e,t,r,i){const n=t.name;t.#je=t.#je&mt|entToType(e);if(n!==e.name)t.name=e.name;if(r!==i.provisional){if(r===i.length-1)i.pop();else i.splice(r,1);i.unshift(t)}i.provisional++;return t}async lstat(){if((this.#je&wt)===0){try{this.#Qe(await this.#ce.promises.lstat(this.fullpath()));return this}catch(e){this.#qe(e.code)}}}lstatSync(){if((this.#je&wt)===0){try{this.#Qe(this.#ce.lstatSync(this.fullpath()));return this}catch(e){this.#qe(e.code)}}}#Qe(e){const{atime:t,atimeMs:r,birthtime:i,birthtimeMs:n,blksize:s,blocks:o,ctime:a,ctimeMs:c,dev:u,gid:l,ino:h,mode:p,mtime:d,mtimeMs:g,nlink:v,rdev:y,size:b,uid:w}=e;this.#xe=t;this.#ye=r;this.#Ee=i;this.#Se=n;this.#me=s;this.#ve=o;this.#ke=a;this.#we=c;this.#ue=u;this.#pe=l;this.#ge=h;this.#le=p;this.#_e=d;this.#be=g;this.#he=v;this.#de=y;this.#k=b;this.#fe=w;const S=entToType(e);this.#je=this.#je&mt|S|yt;if(S!==st&&S!==ct&&S!==ft){this.#je|=bt}}#Je=[];#Ke=false;#Ze(e){this.#Ke=false;const t=this.#Je.slice();this.#Je.length=0;t.forEach((t=>t(null,e)))}readdirCB(e,t=false){if(!this.canReaddir()){if(t)e(null,[]);else queueMicrotask((()=>e(null,[])));return}const r=this.children();if(this.calledReaddir()){const i=r.slice(0,r.provisional);if(t)e(null,i);else queueMicrotask((()=>e(null,i)));return}this.#Je.push(e);if(this.#Ke){return}this.#Ke=true;const i=this.fullpath();this.#ce.readdir(i,{withFileTypes:true},((e,t)=>{if(e){this.#We(e.code);r.provisional=0}else{for(const e of t){this.#Ue(e,r)}this.#$e(r)}this.#Ze(r.slice(0,r.provisional));return}))}#Xe;async readdir(){if(!this.canReaddir()){return[]}const e=this.children();if(this.calledReaddir()){return e.slice(0,e.provisional)}const t=this.fullpath();if(this.#Xe){await this.#Xe}else{let resolve=()=>{};this.#Xe=new Promise((e=>resolve=e));try{for(const r of await this.#ce.promises.readdir(t,{withFileTypes:true})){this.#Ue(r,e)}this.#$e(e)}catch(t){this.#We(t.code);e.provisional=0}this.#Xe=undefined;resolve()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir()){return[]}const e=this.children();if(this.calledReaddir()){return e.slice(0,e.provisional)}const t=this.fullpath();try{for(const r of this.#ce.readdirSync(t,{withFileTypes:true})){this.#Ue(r,e)}this.#$e(e)}catch(t){this.#We(t.code);e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#je&_t)return false;const e=dt&this.#je;if(!(e===st||e===ct||e===ft)){return false}return true}shouldWalk(e,t){return(this.#je&ct)===ct&&!(this.#je&_t)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#Fe)return this.#Fe;if((xt|St|wt)&this.#je)return undefined;try{const e=await this.#ce.promises.realpath(this.fullpath());return this.#Fe=this.resolve(e)}catch(e){this.#Ge()}}realpathSync(){if(this.#Fe)return this.#Fe;if((xt|St|wt)&this.#je)return undefined;try{const e=this.#ce.realpathSync(this.fullpath());return this.#Fe=this.resolve(e)}catch(e){this.#Ge()}}[At](e){if(e===this)return;e.isCWD=false;this.isCWD=true;const t=new Set([]);let r=[];let i=this;while(i&&i.parent){t.add(i);i.#Me=r.join(this.sep);i.#Re=r.join("/");i=i.parent;r.push("..")}i=e;while(i&&i.parent&&!t.has(i)){i.#Me=undefined;i.#Re=undefined;i=i.parent}}}class PathWin32 extends PathBase{sep="\\";splitSep=nt;constructor(e,t=st,r,i,n,s,o){super(e,t,r,i,n,s,o)}newChild(e,t=st,r={}){return new PathWin32(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return ge.win32.parse(e).root}getRoot(e){e=uncToDrive(e.toUpperCase());if(e===this.root.name){return this.root}for(const[t,r]of Object.entries(this.roots)){if(this.sameRoot(e,t)){return this.roots[e]=r}}return this.roots[e]=new PathScurryWin32(e,this).root}sameRoot(e,t=this.root.name){e=e.toUpperCase().replace(/\//g,"\\").replace(it,"$1\\");return e===t}}class PathPosix extends PathBase{splitSep="/";sep="/";constructor(e,t=st,r,i,n,s,o){super(e,t,r,i,n,s,o)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=st,r={}){return new PathPosix(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}}class PathScurryBase{root;rootPath;roots;cwd;#et;#tt;#Te;nocase;#ce;constructor(e=process.cwd(),t,r,{nocase:i,childrenCacheSize:n=16*1024,fs:s=rt}={}){this.#ce=fsFromOption(s);if(e instanceof URL||e.startsWith("file://")){e=(0,ue.fileURLToPath)(e)}const o=t.resolve(e);this.roots=Object.create(null);this.rootPath=this.parseRootPath(o);this.#et=new ResolveCache;this.#tt=new ResolveCache;this.#Te=new ChildrenCache(n);const a=o.substring(this.rootPath.length).split(r);if(a.length===1&&!a[0]){a.pop()}if(i===undefined){throw new TypeError("must provide nocase setting to PathScurryBase ctor")}this.nocase=i;this.root=this.newRoot(this.#ce);this.roots[this.rootPath]=this.root;let c=this.root;let u=a.length-1;const l=t.sep;let h=this.rootPath;let p=false;for(const e of a){const t=u--;c=c.child(e,{relative:new Array(t).fill("..").join(l),relativePosix:new Array(t).fill("..").join("/"),fullpath:h+=(p?"":l)+e});p=true}this.cwd=c}depth(e=this.cwd){if(typeof e==="string"){e=this.cwd.resolve(e)}return e.depth()}childrenCache(){return this.#Te}resolve(...e){let t="";for(let r=e.length-1;r>=0;r--){const i=e[r];if(!i||i===".")continue;t=t?`${i}/${t}`:i;if(this.isAbsolute(i)){break}}const r=this.#et.get(t);if(r!==undefined){return r}const i=this.cwd.resolve(t).fullpath();this.#et.set(t,i);return i}resolvePosix(...e){let t="";for(let r=e.length-1;r>=0;r--){const i=e[r];if(!i||i===".")continue;t=t?`${i}/${t}`:i;if(this.isAbsolute(i)){break}}const r=this.#tt.get(t);if(r!==undefined){return r}const i=this.cwd.resolve(t).fullpathPosix();this.#tt.set(t,i);return i}relative(e=this.cwd){if(typeof e==="string"){e=this.cwd.resolve(e)}return e.relative()}relativePosix(e=this.cwd){if(typeof e==="string"){e=this.cwd.resolve(e)}return e.relativePosix()}basename(e=this.cwd){if(typeof e==="string"){e=this.cwd.resolve(e)}return e.name}dirname(e=this.cwd){if(typeof e==="string"){e=this.cwd.resolve(e)}return(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:true}){if(typeof e==="string"){e=this.cwd.resolve(e)}else if(!(e instanceof PathBase)){t=e;e=this.cwd}const{withFileTypes:r}=t;if(!e.canReaddir()){return[]}else{const t=await e.readdir();return r?t:t.map((e=>e.name))}}readdirSync(e=this.cwd,t={withFileTypes:true}){if(typeof e==="string"){e=this.cwd.resolve(e)}else if(!(e instanceof PathBase)){t=e;e=this.cwd}const{withFileTypes:r=true}=t;if(!e.canReaddir()){return[]}else if(r){return e.readdirSync()}else{return e.readdirSync().map((e=>e.name))}}async lstat(e=this.cwd){if(typeof e==="string"){e=this.cwd.resolve(e)}return e.lstat()}lstatSync(e=this.cwd){if(typeof e==="string"){e=this.cwd.resolve(e)}return e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:false}){if(typeof e==="string"){e=this.cwd.resolve(e)}else if(!(e instanceof PathBase)){t=e.withFileTypes;e=this.cwd}const r=await e.readlink();return t?r:r?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:false}){if(typeof e==="string"){e=this.cwd.resolve(e)}else if(!(e instanceof PathBase)){t=e.withFileTypes;e=this.cwd}const r=e.readlinkSync();return t?r:r?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:false}){if(typeof e==="string"){e=this.cwd.resolve(e)}else if(!(e instanceof PathBase)){t=e.withFileTypes;e=this.cwd}const r=await e.realpath();return t?r:r?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:false}){if(typeof e==="string"){e=this.cwd.resolve(e)}else if(!(e instanceof PathBase)){t=e.withFileTypes;e=this.cwd}const r=e.realpathSync();return t?r:r?.fullpath()}async walk(e=this.cwd,t={}){if(typeof e==="string"){e=this.cwd.resolve(e)}else if(!(e instanceof PathBase)){t=e;e=this.cwd}const{withFileTypes:r=true,follow:i=false,filter:n,walkFilter:s}=t;const o=[];if(!n||n(e)){o.push(r?e:e.fullpath())}const a=new Set;const walk=(e,t)=>{a.add(e);e.readdirCB(((e,c)=>{if(e){return t(e)}let u=c.length;if(!u)return t();const next=()=>{if(--u===0){t()}};for(const e of c){if(!n||n(e)){o.push(r?e:e.fullpath())}if(i&&e.isSymbolicLink()){e.realpath().then((e=>e?.isUnknown()?e.lstat():e)).then((e=>e?.shouldWalk(a,s)?walk(e,next):next()))}else{if(e.shouldWalk(a,s)){walk(e,next)}else{next()}}}}),true)};const c=e;return new Promise(((e,t)=>{walk(c,(r=>{if(r)return t(r);e(o)}))}))}walkSync(e=this.cwd,t={}){if(typeof e==="string"){e=this.cwd.resolve(e)}else if(!(e instanceof PathBase)){t=e;e=this.cwd}const{withFileTypes:r=true,follow:i=false,filter:n,walkFilter:s}=t;const o=[];if(!n||n(e)){o.push(r?e:e.fullpath())}const a=new Set([e]);for(const e of a){const t=e.readdirSync();for(const e of t){if(!n||n(e)){o.push(r?e:e.fullpath())}let t=e;if(e.isSymbolicLink()){if(!(i&&(t=e.realpathSync())))continue;if(t.isUnknown())t.lstatSync()}if(t.shouldWalk(a,s)){a.add(t)}}}return o}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){if(typeof e==="string"){e=this.cwd.resolve(e)}else if(!(e instanceof PathBase)){t=e;e=this.cwd}return this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){if(typeof e==="string"){e=this.cwd.resolve(e)}else if(!(e instanceof PathBase)){t=e;e=this.cwd}const{withFileTypes:r=true,follow:i=false,filter:n,walkFilter:s}=t;if(!n||n(e)){yield r?e:e.fullpath()}const o=new Set([e]);for(const e of o){const t=e.readdirSync();for(const e of t){if(!n||n(e)){yield r?e:e.fullpath()}let t=e;if(e.isSymbolicLink()){if(!(i&&(t=e.realpathSync())))continue;if(t.isUnknown())t.lstatSync()}if(t.shouldWalk(o,s)){o.add(t)}}}}stream(e=this.cwd,t={}){if(typeof e==="string"){e=this.cwd.resolve(e)}else if(!(e instanceof PathBase)){t=e;e=this.cwd}const{withFileTypes:r=true,follow:i=false,filter:n,walkFilter:s}=t;const o=new Minipass({objectMode:true});if(!n||n(e)){o.write(r?e:e.fullpath())}const a=new Set;const c=[e];let u=0;const process=()=>{let e=false;while(!e){const t=c.shift();if(!t){if(u===0)o.end();return}u++;a.add(t);const onReaddir=(t,h,p=false)=>{if(t)return o.emit("error",t);if(i&&!p){const e=[];for(const t of h){if(t.isSymbolicLink()){e.push(t.realpath().then((e=>e?.isUnknown()?e.lstat():e)))}}if(e.length){Promise.all(e).then((()=>onReaddir(null,h,true)));return}}for(const t of h){if(t&&(!n||n(t))){if(!o.write(r?t:t.fullpath())){e=true}}}u--;for(const e of h){const t=e.realpathCached()||e;if(t.shouldWalk(a,s)){c.push(t)}}if(e&&!o.flowing){o.once("drain",process)}else if(!l){process()}};let l=true;t.readdirCB(onReaddir,true);l=false}};process();return o}streamSync(e=this.cwd,t={}){if(typeof e==="string"){e=this.cwd.resolve(e)}else if(!(e instanceof PathBase)){t=e;e=this.cwd}const{withFileTypes:r=true,follow:i=false,filter:n,walkFilter:s}=t;const o=new Minipass({objectMode:true});const a=new Set;if(!n||n(e)){o.write(r?e:e.fullpath())}const c=[e];let u=0;const process=()=>{let e=false;while(!e){const t=c.shift();if(!t){if(u===0)o.end();return}u++;a.add(t);const l=t.readdirSync();for(const t of l){if(!n||n(t)){if(!o.write(r?t:t.fullpath())){e=true}}}u--;for(const e of l){let t=e;if(e.isSymbolicLink()){if(!(i&&(t=e.realpathSync())))continue;if(t.isUnknown())t.lstatSync()}if(t.shouldWalk(a,s)){c.push(t)}}}if(e&&!o.flowing)o.once("drain",process)};process();return o}chdir(e=this.cwd){const t=this.cwd;this.cwd=typeof e==="string"?this.cwd.resolve(e):e;this.cwd[At](t)}}class PathScurryWin32 extends PathScurryBase{sep="\\";constructor(e=process.cwd(),t={}){const{nocase:r=true}=t;super(e,ge.win32,"\\",{...t,nocase:r});this.nocase=r;for(let e=this.cwd;e;e=e.parent){e.nocase=this.nocase}}parseRootPath(e){return ge.win32.parse(e).root.toUpperCase()}newRoot(e){return new PathWin32(this.rootPath,ct,undefined,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}}class PathScurryPosix extends PathScurryBase{sep="/";constructor(e=process.cwd(),t={}){const{nocase:r=false}=t;super(e,ge.posix,"/",{...t,nocase:r});this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new PathPosix(this.rootPath,ct,undefined,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}}class PathScurryDarwin extends PathScurryPosix{constructor(e=process.cwd(),t={}){const{nocase:r=true}=t;super(e,{...t,nocase:r})}}const Ct=process.platform==="win32"?PathWin32:PathPosix;const Pt=process.platform==="win32"?PathScurryWin32:process.platform==="darwin"?PathScurryDarwin:PathScurryPosix;const isPatternList=e=>e.length>=1;const isGlobList=e=>e.length>=1;class Pattern{#rt;#it;#nt;length;#st;#ot;#at;#ct;#ut;#lt;#ht=true;constructor(e,t,r,i){if(!isPatternList(e)){throw new TypeError("empty pattern list")}if(!isGlobList(t)){throw new TypeError("empty glob list")}if(t.length!==e.length){throw new TypeError("mismatched pattern list and glob list lengths")}this.length=e.length;if(r<0||r>=this.length){throw new TypeError("index out of range")}this.#rt=e;this.#it=t;this.#nt=r;this.#st=i;if(this.#nt===0){if(this.isUNC()){const[e,t,r,i,...n]=this.#rt;const[s,o,a,c,...u]=this.#it;if(n[0]===""){n.shift();u.shift()}const l=[e,t,r,i,""].join("/");const h=[s,o,a,c,""].join("/");this.#rt=[l,...n];this.#it=[h,...u];this.length=this.#rt.length}else if(this.isDrive()||this.isAbsolute()){const[e,...t]=this.#rt;const[r,...i]=this.#it;if(t[0]===""){t.shift();i.shift()}const n=e+"/";const s=r+"/";this.#rt=[n,...t];this.#it=[s,...i];this.length=this.#rt.length}}}pattern(){return this.#rt[this.#nt]}isString(){return typeof this.#rt[this.#nt]==="string"}isGlobstar(){return this.#rt[this.#nt]===ie}isRegExp(){return this.#rt[this.#nt]instanceof RegExp}globString(){return this.#at=this.#at||(this.#nt===0?this.isAbsolute()?this.#it[0]+this.#it.slice(1).join("/"):this.#it.join("/"):this.#it.slice(this.#nt).join("/"))}hasMore(){return this.length>this.#nt+1}rest(){if(this.#ot!==undefined)return this.#ot;if(!this.hasMore())return this.#ot=null;this.#ot=new Pattern(this.#rt,this.#it,this.#nt+1,this.#st);this.#ot.#lt=this.#lt;this.#ot.#ut=this.#ut;this.#ot.#ct=this.#ct;return this.#ot}isUNC(){const e=this.#rt;return this.#ut!==undefined?this.#ut:this.#ut=this.#st==="win32"&&this.#nt===0&&e[0]===""&&e[1]===""&&typeof e[2]==="string"&&!!e[2]&&typeof e[3]==="string"&&!!e[3]}isDrive(){const e=this.#rt;return this.#ct!==undefined?this.#ct:this.#ct=this.#st==="win32"&&this.#nt===0&&this.length>1&&typeof e[0]==="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){const e=this.#rt;return this.#lt!==undefined?this.#lt:this.#lt=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){const e=this.#rt[0];return typeof e==="string"&&this.isAbsolute()&&this.#nt===0?e:""}checkFollowGlobstar(){return!(this.#nt===0||!this.isGlobstar()||!this.#ht)}markFollowGlobstar(){if(this.#nt===0||!this.isGlobstar()||!this.#ht)return false;this.#ht=false;return true}}const Mt=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:n,platform:s=Mt}){this.relative=[];this.absolute=[];this.relativeChildren=[];this.absoluteChildren=[];this.platform=s;this.mmopts={dot:true,nobrace:t,nocase:r,noext:i,noglobstar:n,optimizationLevel:2,platform:s,nocomment:true,nonegate:true};for(const t of e)this.add(t)}add(e){const t=new Minimatch(e,this.mmopts);for(let e=0;e<t.set.length;e++){const r=t.set[e];const i=t.globParts[e];if(!r||!i){throw new Error("invalid pattern object")}while(r[0]==="."&&i[0]==="."){r.shift();i.shift()}const n=new Pattern(r,i,0,this.platform);const s=new Minimatch(n.globString(),this.mmopts);const o=i[i.length-1]==="**";const a=n.isAbsolute();if(a)this.absolute.push(s);else this.relative.push(s);if(o){if(a)this.absoluteChildren.push(s);else this.relativeChildren.push(s)}}}ignored(e){const t=e.fullpath();const r=`${t}/`;const i=e.relative()||".";const n=`${i}/`;for(const e of this.relative){if(e.match(i)||e.match(n))return true}for(const e of this.absolute){if(e.match(t)||e.match(r))return true}return false}childrenIgnored(e){const t=e.fullpath()+"/";const r=(e.relative()||".")+"/";for(const e of this.relativeChildren){if(e.match(r))return true}for(const e of this.absoluteChildren){if(e.match(t))return true}return false}}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){const r=e.fullpath();const i=this.store.get(r);if(i)i.add(t.globString());else this.store.set(r,new Set([t.globString()]))}}class MatchRecord{store=new Map;add(e,t,r){const i=(t?2:0)|(r?1:0);const n=this.store.get(e);this.store.set(e,n===undefined?i:i&n)}entries(){return[...this.store.entries()].map((([e,t])=>[e,!!(t&2),!!(t&1)]))}}class SubWalks{store=new Map;add(e,t){if(!e.canReaddir()){return}const r=this.store.get(e);if(r){if(!r.find((e=>e.globString()===t.globString()))){r.push(t)}}else this.store.set(e,[t])}get(e){const t=this.store.get(e);if(!t){throw new 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()))}}class Processor{hasWalkedCache;matches=new MatchRecord;subwalks=new SubWalks;patterns;follow;dot;opts;constructor(e,t){this.opts=e;this.follow=!!e.follow;this.dot=!!e.dot;this.hasWalkedCache=t?t.copy():new HasWalkedCache}processPatterns(e,t){this.patterns=t;const r=t.map((t=>[e,t]));for(let[e,t]of r){this.hasWalkedCache.storeWalked(e,t);const r=t.root();const i=t.isAbsolute()&&this.opts.absolute!==false;if(r){e=e.resolve(r==="/"&&this.opts.root!==undefined?this.opts.root:r);const i=t.rest();if(!i){this.matches.add(e,true,false);continue}else{t=i}}if(e.isENOENT())continue;let n;let s;let o=false;while(typeof(n=t.pattern())==="string"&&(s=t.rest())){const r=e.resolve(n);e=r;t=s;o=true}n=t.pattern();s=t.rest();if(o){if(this.hasWalkedCache.hasWalked(e,t))continue;this.hasWalkedCache.storeWalked(e,t)}if(typeof n==="string"){const t=n===".."||n===""||n===".";this.matches.add(e.resolve(n),i,t);continue}else if(n===ie){if(!e.isSymbolicLink()||this.follow||t.checkFollowGlobstar()){this.subwalks.add(e,t)}const r=s?.pattern();const n=s?.rest();if(!s||(r===""||r===".")&&!n){this.matches.add(e,i,r===""||r===".")}else{if(r===".."){const t=e.parent||e;if(!n)this.matches.add(t,i,true);else if(!this.hasWalkedCache.hasWalked(t,n)){this.subwalks.add(t,n)}}}}else if(n instanceof RegExp){this.subwalks.add(e,t)}}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new Processor(this.opts,this.hasWalkedCache)}filterEntries(e,t){const r=this.subwalks.get(e);const i=this.child();for(const e of t){for(const t of r){const r=t.isAbsolute();const n=t.pattern();const s=t.rest();if(n===ie){i.testGlobstar(e,t,s,r)}else if(n instanceof RegExp){i.testRegExp(e,n,s,r)}else{i.testString(e,n,s,r)}}}return i}testGlobstar(e,t,r,i){if(this.dot||!e.name.startsWith(".")){if(!t.hasMore()){this.matches.add(e,i,false)}if(e.canReaddir()){if(this.follow||!e.isSymbolicLink()){this.subwalks.add(e,t)}else if(e.isSymbolicLink()){if(r&&t.checkFollowGlobstar()){this.subwalks.add(e,r)}else if(t.markFollowGlobstar()){this.subwalks.add(e,t)}}}}if(r){const t=r.pattern();if(typeof t==="string"&&t!==".."&&t!==""&&t!=="."){this.testString(e,t,r.rest(),i)}else if(t===".."){const t=e.parent||e;this.subwalks.add(t,r)}else if(t instanceof RegExp){this.testRegExp(e,t,r.rest(),i)}}}testRegExp(e,t,r,i){if(!t.test(e.name))return;if(!r){this.matches.add(e,i,false)}else{this.subwalks.add(e,r)}}testString(e,t,r,i){if(!e.isNamed(t))return;if(!r){this.matches.add(e,i,false)}else{this.subwalks.add(e,r)}}}const makeIgnore=(e,t)=>typeof e==="string"?new Ignore([e],t):Array.isArray(e)?new Ignore(e,t):e;class GlobUtil{path;patterns;opts;seen=new Set;paused=false;aborted=false;#ft=[];#pt;#dt;signal;maxDepth;includeChildMatches;constructor(e,t,r){this.patterns=e;this.path=t;this.opts=r;this.#dt=!r.posix&&r.platform==="win32"?"\\":"/";this.includeChildMatches=r.includeChildMatches!==false;if(r.ignore||!this.includeChildMatches){this.#pt=makeIgnore(r.ignore??[],r);if(!this.includeChildMatches&&typeof this.#pt.add!=="function"){const e="cannot ignore child matches, ignore lacks add() method.";throw new Error(e)}}this.maxDepth=r.maxDepth||Infinity;if(r.signal){this.signal=r.signal;this.signal.addEventListener("abort",(()=>{this.#ft.length=0}))}}#mt(e){return this.seen.has(e)||!!this.#pt?.ignored?.(e)}#gt(e){return!!this.#pt?.childrenIgnored?.(e)}pause(){this.paused=true}resume(){if(this.signal?.aborted)return;this.paused=false;let e=undefined;while(!this.paused&&(e=this.#ft.shift())){e()}}onResume(e){if(this.signal?.aborted)return;if(!this.paused){e()}else{this.#ft.push(e)}}async matchCheck(e,t){if(t&&this.opts.nodir)return undefined;let r;if(this.opts.realpath){r=e.realpathCached()||await e.realpath();if(!r)return undefined;e=r}const i=e.isUnknown()||this.opts.stat;const n=i?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){const e=await n.realpath();if(e&&(e.isUnknown()||this.opts.stat)){await e.lstat()}}return this.matchCheckTest(n,t)}matchCheckTest(e,t){return e&&(this.maxDepth===Infinity||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#mt(e)?e:undefined}matchCheckSync(e,t){if(t&&this.opts.nodir)return undefined;let r;if(this.opts.realpath){r=e.realpathCached()||e.realpathSync();if(!r)return undefined;e=r}const i=e.isUnknown()||this.opts.stat;const n=i?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){const e=n.realpathSync();if(e&&(e?.isUnknown()||this.opts.stat)){e.lstatSync()}}return this.matchCheckTest(n,t)}matchFinish(e,t){if(this.#mt(e))return;if(!this.includeChildMatches&&this.#pt?.add){const t=`${e.relativePosix()}/**`;this.#pt.add(t)}const r=this.opts.absolute===undefined?t:this.opts.absolute;this.seen.add(e);const i=this.opts.mark&&e.isDirectory()?this.#dt:"";if(this.opts.withFileTypes){this.matchEmit(e)}else if(r){const t=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(t+i)}else{const t=this.opts.posix?e.relativePosix():e.relative();const r=this.opts.dotRelative&&!t.startsWith(".."+this.#dt)?"."+this.#dt:"";this.matchEmit(!t?"."+i:r+t+i)}}async match(e,t,r){const i=await this.matchCheck(e,r);if(i)this.matchFinish(i,t)}matchSync(e,t,r){const i=this.matchCheckSync(e,r);if(i)this.matchFinish(i,t)}walkCB(e,t,r){if(this.signal?.aborted)r();this.walkCB2(e,t,new Processor(this.opts),r)}walkCB2(e,t,r,i){if(this.#gt(e))return i();if(this.signal?.aborted)i();if(this.paused){this.onResume((()=>this.walkCB2(e,t,r,i)));return}r.processPatterns(e,t);let n=1;const next=()=>{if(--n===0)i()};for(const[e,t,i]of r.matches.entries()){if(this.#mt(e))continue;n++;this.match(e,t,i).then((()=>next()))}for(const e of r.subwalkTargets()){if(this.maxDepth!==Infinity&&e.depth()>=this.maxDepth){continue}n++;const t=e.readdirCached();if(e.calledReaddir())this.walkCB3(e,t,r,next);else{e.readdirCB(((t,i)=>this.walkCB3(e,i,r,next)),true)}}next()}walkCB3(e,t,r,i){r=r.filterEntries(e,t);let n=1;const next=()=>{if(--n===0)i()};for(const[e,t,i]of r.matches.entries()){if(this.#mt(e))continue;n++;this.match(e,t,i).then((()=>next()))}for(const[e,t]of r.subwalks.entries()){n++;this.walkCB2(e,t,r.child(),next)}next()}walkCBSync(e,t,r){if(this.signal?.aborted)r();this.walkCB2Sync(e,t,new Processor(this.opts),r)}walkCB2Sync(e,t,r,i){if(this.#gt(e))return i();if(this.signal?.aborted)i();if(this.paused){this.onResume((()=>this.walkCB2Sync(e,t,r,i)));return}r.processPatterns(e,t);let n=1;const next=()=>{if(--n===0)i()};for(const[e,t,i]of r.matches.entries()){if(this.#mt(e))continue;this.matchSync(e,t,i)}for(const e of r.subwalkTargets()){if(this.maxDepth!==Infinity&&e.depth()>=this.maxDepth){continue}n++;const t=e.readdirSync();this.walkCB3Sync(e,t,r,next)}next()}walkCB3Sync(e,t,r,i){r=r.filterEntries(e,t);let n=1;const next=()=>{if(--n===0)i()};for(const[e,t,i]of r.matches.entries()){if(this.#mt(e))continue;this.matchSync(e,t,i)}for(const[e,t]of r.subwalks.entries()){n++;this.walkCB2Sync(e,t,r.child(),next)}next()}}class GlobWalker extends GlobUtil{matches=new Set;constructor(e,t,r){super(e,t,r)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown()){await this.path.lstat()}await new Promise(((e,t)=>{this.walkCB(this.path,this.patterns,(()=>{if(this.signal?.aborted){t(this.signal.reason)}else{e(this.matches)}}))}));return this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown()){this.path.lstatSync()}this.walkCBSync(this.path,this.patterns,(()=>{if(this.signal?.aborted)throw this.signal.reason}));return this.matches}}class GlobStream extends GlobUtil{results;constructor(e,t,r){super(e,t,r);this.results=new Minipass({signal:this.signal,objectMode:true});this.results.on("drain",(()=>this.resume()));this.results.on("resume",(()=>this.resume()))}matchEmit(e){this.results.write(e);if(!this.results.flowing)this.pause()}stream(){const e=this.path;if(e.isUnknown()){e.lstat().then((()=>{this.walkCB(e,this.patterns,(()=>this.results.end()))}))}else{this.walkCB(e,this.patterns,(()=>this.results.end()))}return this.results}streamSync(){if(this.path.isUnknown()){this.path.lstatSync()}this.walkCBSync(this.path,this.patterns,(()=>this.results.end()));return this.results}}const Rt=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(e,t){if(!t)throw new TypeError("glob options required");this.withFileTypes=!!t.withFileTypes;this.signal=t.signal;this.follow=!!t.follow;this.dot=!!t.dot;this.dotRelative=!!t.dotRelative;this.nodir=!!t.nodir;this.mark=!!t.mark;if(!t.cwd){this.cwd=""}else if(t.cwd instanceof URL||t.cwd.startsWith("file://")){t.cwd=(0,ue.fileURLToPath)(t.cwd)}this.cwd=t.cwd||"";this.root=t.root;this.magicalBraces=!!t.magicalBraces;this.nobrace=!!t.nobrace;this.noext=!!t.noext;this.realpath=!!t.realpath;this.absolute=t.absolute;this.includeChildMatches=t.includeChildMatches!==false;this.noglobstar=!!t.noglobstar;this.matchBase=!!t.matchBase;this.maxDepth=typeof t.maxDepth==="number"?t.maxDepth:Infinity;this.stat=!!t.stat;this.ignore=t.ignore;if(this.withFileTypes&&this.absolute!==undefined){throw new Error("cannot set absolute and withFileTypes:true")}if(typeof e==="string"){e=[e]}this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===false;if(this.windowsPathsNoEscape){e=e.map((e=>e.replace(/\\/g,"/")))}if(this.matchBase){if(t.noglobstar){throw new TypeError("base matching requires globstar")}e=e.map((e=>e.includes("/")?e:`./**/${e}`))}this.pattern=e;this.platform=t.platform||Rt;this.opts={...t,platform:this.platform};if(t.scurry){this.scurry=t.scurry;if(t.nocase!==undefined&&t.nocase!==t.scurry.nocase){throw new Error("nocase option contradicts provided scurry option")}}else{const e=t.platform==="win32"?PathScurryWin32:t.platform==="darwin"?PathScurryDarwin:t.platform?PathScurryPosix:Pt;this.scurry=new e(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;const r=this.platform==="darwin"||this.platform==="win32";const i={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:r,nocomment:true,noext:this.noext,nonegate:true,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug};const n=this.pattern.map((e=>new Minimatch(e,i)));const[s,o]=n.reduce(((e,t)=>{e[0].push(...t.set);e[1].push(...t.globParts);return e}),[[],[]]);this.patterns=s.map(((e,t)=>{const r=o[t];if(!r)throw new Error("invalid pattern object");return new Pattern(e,r,0,this.platform)}))}async walk(){return[...await new GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}const hasMagic=(e,t={})=>{if(!Array.isArray(e)){e=[e]}for(const r of e){if(new Minimatch(r,t).hasMagic())return true}return false};function globStreamSync(e,t={}){return new Glob(e,t).streamSync()}function globStream(e,t={}){return new Glob(e,t).stream()}function globSync(e,t={}){return new Glob(e,t).walkSync()}async function glob_(e,t={}){return new Glob(e,t).walk()}function globIterateSync(e,t={}){return new Glob(e,t).iterateSync()}function globIterate(e,t={}){return new Glob(e,t).iterate()}const jt=globStreamSync;const Tt=Object.assign(globStream,{sync:globStreamSync});const Nt=globIterateSync;const Ft=Object.assign(globIterate,{sync:globIterateSync});const It=Object.assign(globSync,{stream:globStreamSync,iterate:globIterateSync});const Lt=Object.assign(glob_,{glob:glob_,globSync:globSync,sync:It,globStream:globStream,stream:Tt,globStreamSync:globStreamSync,streamSync:jt,globIterate:globIterate,iterate:Ft,globIterateSync:globIterateSync,iterateSync:Nt,Glob:Glob,hasMagic:hasMagic,escape:escape_escape,unescape:unescape_unescape});Lt.glob=Lt;const typeOrUndef=(e,t)=>typeof e==="undefined"||typeof e===t;const isRimrafOptions=e=>!!e&&typeof e==="object"&&typeOrUndef(e.preserveRoot,"boolean")&&typeOrUndef(e.tmp,"string")&&typeOrUndef(e.maxRetries,"number")&&typeOrUndef(e.retryDelay,"number")&&typeOrUndef(e.backoff,"number")&&typeOrUndef(e.maxBackoff,"number")&&(typeOrUndef(e.glob,"boolean")||e.glob&&typeof e.glob==="object")&&typeOrUndef(e.filter,"function");const assertRimrafOptions=e=>{if(!isRimrafOptions(e)){throw new Error("invalid rimraf options")}};const optArgT=e=>{assertRimrafOptions(e);const{glob:t,...r}=e;if(!t){return r}const i=t===true?e.signal?{signal:e.signal}:{}:e.signal?{signal:e.signal,...t}:t;return{...r,glob:{...i,absolute:true,withFileTypes:false}}};const optArg=(e={})=>optArgT(e);const optArgSync=(e={})=>optArgT(e);var $t=__nccwpck_require__(3837);const pathArg=(e,t={})=>{const r=typeof e;if(r!=="string"){const t=e&&r==="object"&&e.constructor;const i=t&&t.name?`an instance of ${t.name}`:r==="object"?(0,$t.inspect)(e):`type ${r} ${e}`;const n='The "path" argument must be of type string. '+`Received ${i}`;throw Object.assign(new TypeError(n),{path:e,code:"ERR_INVALID_ARG_TYPE"})}if(/\0/.test(e)){const t="path must be a string without null bytes";throw Object.assign(new TypeError(t),{path:e,code:"ERR_INVALID_ARG_VALUE"})}e=(0,o.resolve)(e);const{root:i}=(0,o.parse)(e);if(e===i&&t.preserveRoot!==false){const t="refusing to remove root directory without preserveRoot:false";throw Object.assign(new Error(t),{path:e,code:"ERR_PRESERVE_ROOT"})}if(process.platform==="win32"){const t=/[*|"<>?:]/;const{root:r}=(0,o.parse)(e);if(t.test(e.substring(r.length))){throw Object.assign(new Error("Illegal characters in path."),{path:e,code:"EINVAL"})}}return e};const Dt=pathArg;const Bt=require("fs/promises");const readdirSync=e=>(0,g.readdirSync)(e,{withFileTypes:true});const Gt={chmod:Bt.chmod,mkdir:Bt.mkdir,readdir:e=>Bt.readdir(e,{withFileTypes:true}),rename:Bt.rename,rm:Bt.rm,rmdir:Bt.rmdir,stat:Bt.stat,lstat:Bt.lstat,unlink:Bt.unlink};const{readdir:zt}=Gt;const readdirOrError=e=>zt(e).catch((e=>e));const readdirOrErrorSync=e=>{try{return readdirSync(e)}catch(e){return e}};const isRecord=e=>!!e&&typeof e==="object";const hasString=(e,t)=>t in e&&typeof e[t]==="string";const isFsError=e=>isRecord(e)&&hasString(e,"code")&&hasString(e,"path");const errorCode=e=>isRecord(e)&&hasString(e,"code")?e.code:null;const ignoreENOENT=async(e,t)=>e.catch((e=>{if(errorCode(e)==="ENOENT"){return}throw t??e}));const ignoreENOENTSync=(e,t)=>{try{return e()}catch(e){if(errorCode(e)==="ENOENT"){return}throw t??e}};const{lstat:Wt,rmdir:qt,unlink:Ut}=Gt;const rimrafPosix=async(e,t)=>{t?.signal?.throwIfAborted();return await ignoreENOENT(Wt(e).then((r=>rimrafPosixDir(e,t,r))))??true};const rimrafPosixSync=(e,t)=>{t?.signal?.throwIfAborted();return ignoreENOENTSync((()=>rimrafPosixDirSync(e,t,(0,g.lstatSync)(e))))??true};const rimrafPosixDir=async(e,t,r)=>{t?.signal?.throwIfAborted();const i=r.isDirectory()?await readdirOrError(e):null;if(!Array.isArray(i)){if(i){if(errorCode(i)==="ENOENT"){return true}if(errorCode(i)!=="ENOTDIR"){throw i}}if(t.filter&&!await t.filter(e,r)){return false}await ignoreENOENT(Ut(e));return true}const n=(await Promise.all(i.map((r=>rimrafPosixDir((0,o.resolve)(e,r.name),t,r))))).every((e=>e===true));if(!n){return false}if(t.preserveRoot===false&&e===(0,o.parse)(e).root){return false}if(t.filter&&!await t.filter(e,r)){return false}await ignoreENOENT(qt(e));return true};const rimrafPosixDirSync=(e,t,r)=>{t?.signal?.throwIfAborted();const i=r.isDirectory()?readdirOrErrorSync(e):null;if(!Array.isArray(i)){if(i){if(errorCode(i)==="ENOENT"){return true}if(errorCode(i)!=="ENOTDIR"){throw i}}if(t.filter&&!t.filter(e,r)){return false}ignoreENOENTSync((()=>(0,g.unlinkSync)(e)));return true}let n=true;for(const r of i){const i=(0,o.resolve)(e,r.name);n=rimrafPosixDirSync(i,t,r)&&n}if(t.preserveRoot===false&&e===(0,o.parse)(e).root){return false}if(!n){return false}if(t.filter&&!t.filter(e,r)){return false}ignoreENOENTSync((()=>(0,g.rmdirSync)(e)));return true};const{chmod:Vt}=Gt;const fixEPERM=e=>async t=>{try{return void await ignoreENOENT(e(t))}catch(r){if(errorCode(r)==="EPERM"){if(!await ignoreENOENT(Vt(t,438).then((()=>true)),r)){return}return void await e(t)}throw r}};const fixEPERMSync=e=>t=>{try{return void ignoreENOENTSync((()=>e(t)))}catch(r){if(errorCode(r)==="EPERM"){if(!ignoreENOENTSync((()=>((0,g.chmodSync)(t,438),true)),r)){return}return void e(t)}throw r}};const Ht=require("timers/promises");const Yt=200;const Qt=1.2;const Jt=10;const Kt=new Set(["EMFILE","ENFILE","EBUSY"]);const retryBusy=e=>{const method=async(t,r,i=1,n=0)=>{const s=r.maxBackoff||Yt;const o=r.backoff||Qt;const a=r.maxRetries||Jt;let c=0;while(true){try{return await e(t)}catch(e){if(isFsError(e)&&e.path===t&&Kt.has(e.code)){i=Math.ceil(i*o);n=i+n;if(n<s){await(0,Ht.setTimeout)(i);return method(t,r,i,n)}if(c<a){c++;continue}}throw e}}};return method};const retryBusySync=e=>{const method=(t,r)=>{const i=r.maxRetries||Jt;let n=0;while(true){try{return e(t)}catch(e){if(isFsError(e)&&e.path===t&&Kt.has(e.code)&&n<i){n++;continue}throw e}}};return method};const{stat:Zt}=Gt;const isDirSync=e=>{try{return(0,g.statSync)(e).isDirectory()}catch{return false}};const isDir=e=>Zt(e).then((e=>e.isDirectory()),(()=>false));const win32DefaultTmp=async e=>{const{root:t}=(0,o.parse)(e);const r=(0,y.tmpdir)();const{root:i}=(0,o.parse)(r);if(t.toLowerCase()===i.toLowerCase()){return r}const n=(0,o.resolve)(t,"/temp");if(await isDir(n)){return n}return t};const win32DefaultTmpSync=e=>{const{root:t}=(0,o.parse)(e);const r=(0,y.tmpdir)();const{root:i}=(0,o.parse)(r);if(t.toLowerCase()===i.toLowerCase()){return r}const n=(0,o.resolve)(t,"/temp");if(isDirSync(n)){return n}return t};const posixDefaultTmp=async()=>(0,y.tmpdir)();const posixDefaultTmpSync=()=>(0,y.tmpdir)();const Xt=process.platform==="win32"?win32DefaultTmp:posixDefaultTmp;const er=process.platform==="win32"?win32DefaultTmpSync:posixDefaultTmpSync;const{lstat:tr,rename:rr,unlink:ir,rmdir:nr}=Gt;const uniqueFilename=e=>`.${(0,o.basename)(e)}.${Math.random()}`;const sr=fixEPERM(ir);const or=fixEPERMSync(g.unlinkSync);const rimrafMoveRemove=async(e,t)=>{t?.signal?.throwIfAborted();return await ignoreENOENT(tr(e).then((r=>rimrafMoveRemoveDir(e,t,r))))??true};const rimrafMoveRemoveDir=async(e,t,r)=>{t?.signal?.throwIfAborted();if(!t.tmp){return rimrafMoveRemoveDir(e,{...t,tmp:await Xt(e)},r)}if(e===t.tmp&&(0,o.parse)(e).root!==e){throw new Error("cannot delete temp directory used for deletion")}const i=r.isDirectory()?await readdirOrError(e):null;if(!Array.isArray(i)){if(i){if(errorCode(i)==="ENOENT"){return true}if(errorCode(i)!=="ENOTDIR"){throw i}}if(t.filter&&!await t.filter(e,r)){return false}await ignoreENOENT(tmpUnlink(e,t.tmp,sr));return true}const n=(await Promise.all(i.map((r=>rimrafMoveRemoveDir((0,o.resolve)(e,r.name),t,r))))).every((e=>e===true));if(!n){return false}if(t.preserveRoot===false&&e===(0,o.parse)(e).root){return false}if(t.filter&&!await t.filter(e,r)){return false}await ignoreENOENT(tmpUnlink(e,t.tmp,nr));return true};const tmpUnlink=async(e,t,r)=>{const i=(0,o.resolve)(t,uniqueFilename(e));await rr(e,i);return await r(i)};const rimrafMoveRemoveSync=(e,t)=>{t?.signal?.throwIfAborted();return ignoreENOENTSync((()=>rimrafMoveRemoveDirSync(e,t,(0,g.lstatSync)(e))))??true};const rimrafMoveRemoveDirSync=(e,t,r)=>{t?.signal?.throwIfAborted();if(!t.tmp){return rimrafMoveRemoveDirSync(e,{...t,tmp:er(e)},r)}const i=t.tmp;if(e===t.tmp&&(0,o.parse)(e).root!==e){throw new Error("cannot delete temp directory used for deletion")}const n=r.isDirectory()?readdirOrErrorSync(e):null;if(!Array.isArray(n)){if(n){if(errorCode(n)==="ENOENT"){return true}if(errorCode(n)!=="ENOTDIR"){throw n}}if(t.filter&&!t.filter(e,r)){return false}ignoreENOENTSync((()=>tmpUnlinkSync(e,i,or)));return true}let s=true;for(const r of n){const i=(0,o.resolve)(e,r.name);s=rimrafMoveRemoveDirSync(i,t,r)&&s}if(!s){return false}if(t.preserveRoot===false&&e===(0,o.parse)(e).root){return false}if(t.filter&&!t.filter(e,r)){return false}ignoreENOENTSync((()=>tmpUnlinkSync(e,i,g.rmdirSync)));return true};const tmpUnlinkSync=(e,t,r)=>{const i=(0,o.resolve)(t,uniqueFilename(e));(0,g.renameSync)(e,i);return r(i)};const{unlink:ar,rmdir:cr,lstat:ur}=Gt;const lr=retryBusy(fixEPERM(ar));const hr=retryBusySync(fixEPERMSync(g.unlinkSync));const fr=retryBusy(fixEPERM(cr));const pr=retryBusySync(fixEPERMSync(g.rmdirSync));const rimrafWindowsDirMoveRemoveFallback=async(e,{filter:t,...r})=>{r?.signal?.throwIfAborted();try{await fr(e,r);return true}catch(t){if(errorCode(t)==="ENOTEMPTY"){return rimrafMoveRemove(e,r)}throw t}};const rimrafWindowsDirMoveRemoveFallbackSync=(e,{filter:t,...r})=>{r?.signal?.throwIfAborted();try{pr(e,r);return true}catch(t){if(errorCode(t)==="ENOTEMPTY"){return rimrafMoveRemoveSync(e,r)}throw t}};const dr=Symbol("start");const mr=Symbol("child");const gr=Symbol("finish");const rimrafWindows=async(e,t)=>{t?.signal?.throwIfAborted();return await ignoreENOENT(ur(e).then((r=>rimrafWindowsDir(e,t,r,dr))))??true};const rimrafWindowsSync=(e,t)=>{t?.signal?.throwIfAborted();return ignoreENOENTSync((()=>rimrafWindowsDirSync(e,t,(0,g.lstatSync)(e),dr)))??true};const rimrafWindowsDir=async(e,t,r,i=dr)=>{t?.signal?.throwIfAborted();const n=r.isDirectory()?await readdirOrError(e):null;if(!Array.isArray(n)){if(n){if(errorCode(n)==="ENOENT"){return true}if(errorCode(n)!=="ENOTDIR"){throw n}}if(t.filter&&!await t.filter(e,r)){return false}await ignoreENOENT(lr(e,t));return true}const s=i===dr?mr:i;const a=(await Promise.all(n.map((r=>rimrafWindowsDir((0,o.resolve)(e,r.name),t,r,s))))).every((e=>e===true));if(i===dr){return rimrafWindowsDir(e,t,r,gr)}else if(i===gr){if(t.preserveRoot===false&&e===(0,o.parse)(e).root){return false}if(!a){return false}if(t.filter&&!await t.filter(e,r)){return false}await ignoreENOENT(rimrafWindowsDirMoveRemoveFallback(e,t))}return true};const rimrafWindowsDirSync=(e,t,r,i=dr)=>{const n=r.isDirectory()?readdirOrErrorSync(e):null;if(!Array.isArray(n)){if(n){if(errorCode(n)==="ENOENT"){return true}if(errorCode(n)!=="ENOTDIR"){throw n}}if(t.filter&&!t.filter(e,r)){return false}ignoreENOENTSync((()=>hr(e,t)));return true}let s=true;for(const r of n){const n=i===dr?mr:i;const a=(0,o.resolve)(e,r.name);s=rimrafWindowsDirSync(a,t,r,n)&&s}if(i===dr){return rimrafWindowsDirSync(e,t,r,gr)}else if(i===gr){if(t.preserveRoot===false&&e===(0,o.parse)(e).root){return false}if(!s){return false}if(t.filter&&!t.filter(e,r)){return false}ignoreENOENTSync((()=>rimrafWindowsDirMoveRemoveFallbackSync(e,t)))}return true};const vr=process.platform==="win32"?rimrafWindows:rimrafPosix;const yr=process.platform==="win32"?rimrafWindowsSync:rimrafPosixSync;const{rm:br}=Gt;const rimrafNative=async(e,t)=>{await br(e,{...t,force:true,recursive:true});return true};const rimrafNativeSync=(e,t)=>{(0,g.rmSync)(e,{...t,force:true,recursive:true});return true};const[wr=0,Sr=0]=process.version.replace(/^v/,"").split(".").map((e=>parseInt(e,10)));const xr=wr>14||wr===14&&Sr>=14;const _r=!xr||process.platform==="win32"?()=>false:e=>!e?.signal&&!e?.filter;const kr=!xr||process.platform==="win32"?()=>false:e=>!e?.signal&&!e?.filter;const wrap=e=>async(t,r)=>{const i=optArg(r);if(i.glob){t=await Lt(t,i.glob)}if(Array.isArray(t)){return!!(await Promise.all(t.map((t=>e(Dt(t,i),i))))).reduce(((e,t)=>e&&t),true)}else{return!!await e(Dt(t,i),i)}};const wrapSync=e=>(t,r)=>{const i=optArgSync(r);if(i.glob){t=globSync(t,i.glob)}if(Array.isArray(t)){return!!t.map((t=>e(Dt(t,i),i))).reduce(((e,t)=>e&&t),true)}else{return!!e(Dt(t,i),i)}};const Er=wrapSync(rimrafNativeSync);const Or=Object.assign(wrap(rimrafNative),{sync:Er});const Ar=wrapSync(yr);const Cr=Object.assign(wrap(vr),{sync:Ar});const Pr=wrapSync(rimrafWindowsSync);const Mr=Object.assign(wrap(rimrafWindows),{sync:Pr});const Rr=wrapSync(rimrafPosixSync);const jr=Object.assign(wrap(rimrafPosix),{sync:Rr});const Tr=wrapSync(rimrafMoveRemoveSync);const Nr=Object.assign(wrap(rimrafMoveRemove),{sync:Tr});const Fr=wrapSync(((e,t)=>kr(t)?rimrafNativeSync(e,t):yr(e,t)));const Ir=null&&Fr;const Lr=wrap(((e,t)=>_r(t)?rimrafNative(e,t):vr(e,t)));const $r=Object.assign(Lr,{rimraf:Lr,sync:Fr,rimrafSync:Fr,manual:Cr,manualSync:Ar,native:Or,nativeSync:Er,posix:jr,posixSync:Rr,windows:Mr,windowsSync:Pr,moveRemove:Nr,moveRemoveSync:Tr});$r.rimraf=$r;function isInGitRepository(){try{(0,w.execSync)("git rev-parse --is-inside-work-tree",{stdio:"ignore"});return true}catch(e){}return false}function isInMercurialRepository(){try{(0,w.execSync)("hg --cwd . root",{stdio:"ignore"});return true}catch(e){}return false}function tryGitInit(t){let r=false;try{(0,w.execSync)("git --version",{stdio:"ignore"});if(isInGitRepository()||isInMercurialRepository()){return false}(0,w.execSync)("git init",{stdio:"ignore"});r=true;(0,w.execSync)("git checkout -b main",{stdio:"ignore"});(0,w.execSync)("git add -A",{stdio:"ignore"});(0,w.execSync)('git commit -m "Initial commit from Create Flink App"',{stdio:"ignore"});return true}catch(i){if(r){try{e["default"].sync(a().join(t,".git"))}catch(e){}}return false}}var Dr=__nccwpck_require__(1484);var Br=__nccwpck_require__.n(Dr);function install(e,t){return new Promise(((r,i)=>{let n;let s;n="npm";s=["install",e&&`--${t?"save-dev":"save"}`,e&&"--save-exact","--loglevel","error"].filter(Boolean).concat(e||[]);const o=Br()(n,s,{stdio:"inherit",env:Object.assign(Object.assign({},process.env),{ADBLOCK:"1",DISABLE_OPENCOLLECTIVE:"1"})});o.on("close",(e=>{if(e!==0){i({command:`${n} ${s.join(" ")}`});return}r()}))}))}function isFolderEmpty(e,t){const r=[".DS_Store",".git",".gitattributes",".gitignore",".gitlab-ci.yml",".hg",".hgcheck",".hgignore",".idea",".npmignore",".travis.yml","LICENSE","Thumbs.db","docs","mkdocs.yml","npm-debug.log","yarn-debug.log","yarn-error.log"];const n=v().readdirSync(e).filter((e=>!r.includes(e))).filter((e=>!/\.iml$/.test(e)));if(n.length>0){console.log(`The directory ${i().green(t)} contains files that could conflict:`);console.log();for(const t of n){try{const r=v().lstatSync(a().join(e,t));if(r.isDirectory()){console.log(` ${i().blue(t)}/`)}else{console.log(` ${t}`)}}catch(e){console.log(` ${t}`)}}console.log();console.log("Either try using a new directory name, or remove the files listed above.");console.log();return false}return true}var Gr=undefined&&undefined.__awaiter||function(e,t,r,i){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(i.next(e))}catch(e){n(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())}))};function isWriteable(e){return Gr(this,void 0,void 0,(function*(){try{yield v().promises.access(e,(v().constants||v()).W_OK);return true}catch(e){return false}}))}function makeDir(e,t={recursive:true}){return v().promises.mkdir(e,t)}var zr=undefined&&undefined.__awaiter||function(e,t,r,i){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(i.next(e))}catch(e){n(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())}))};class DownloadError extends Error{}function createApp(e){return zr(this,arguments,void 0,(function*({appPath:e}){const t=a().resolve(e);if(!(yield isWriteable(a().dirname(t)))){console.error("The application path is not writable, please check folder permissions and try again.");console.error("It is likely you do not have write permissions for this folder.");process.exit(1)}const r=a().basename(t);yield makeDir(t);if(!isFolderEmpty(t,r)){process.exit(1)}const n=process.cwd();console.log(`Creating a new Flink app in ${i().green(t)}.`);console.log();yield makeDir(t);process.chdir(t);const s={name:r,version:"0.1.0",private:true,scripts:{dev:'nodemon --exec "flink run"',test:"flink run --entry spec/support/runner.ts","test:watch":'nodemon --exec "flink run --entry spec/support/runner.ts"',start:"flink run",build:"flink build",clean:"flink clean && rimraf dist"}};v().writeFileSync(a().join(t,"package.json"),JSON.stringify(s,null,2)+b().EOL);console.log(`Installing dependencies using npm...`);console.log();yield install(["@flink-app/flink"]);yield install(["typescript@5.6.2","nodemon","jasmine","@types/jasmine","jasmine-spec-reporter","@flink-app/test-utils","rimraf"],true);console.log();yield d()("**",t,{parents:true,cwd:__nccwpck_require__.ab+"default",rename:e=>{switch(e){case"gitignore":{return".".concat(e)}case"README-template.md":{return"README.md"}default:{return e}}}});if(tryGitInit(t)){console.log("Initialized a git repository.");console.log()}let o;if(a().join(n,r)===e){o=r}else{o=e}console.log(`${i().green("Success!")} Created ${r} at ${e}`);console.log("Inside that directory, you can run several commands:");console.log();console.log(i().cyan(` npm run dev`));console.log(" Starts the development server.");console.log();console.log(i().cyan(` npm start`));console.log(" Runs the built app in production mode.");console.log();console.log("We suggest that you begin by typing:");console.log();console.log(i().cyan(" cd"),o);console.log(` ${i().cyan(`npm run dev`)}`);console.log()}))}var Wr=__nccwpck_require__(238);var qr=__nccwpck_require__.n(Wr);function validateNpmName(e){const t=qr()(e);if(t.validForNewPackages){return{valid:true}}return{valid:false,problems:[...t.errors||[],...t.warnings||[]]}}const Ur=JSON.parse('{"name":"create-flink-app","version":"0.13.1","keywords":["flinkapp","flink"],"description":"Create a Flink app with one command","repository":{"type":"git","url":"https://github.com/FrostDigital/flink","directory":"packages/create-flink-app"},"license":"MIT","bin":{"create-flink-app":"./dist/index.js"},"files":["dist"],"scripts":{"dev":"ncc build ./index.ts -w -o dist/","prepare":"npm run build","build":"rimraf ./dist/ && ncc build ./index.ts -o ./dist/ --minify --no-cache --no-source-map-register","clean":"rimraf dist .flink"},"devDependencies":{"@flink-app/flink":"workspace:*","@flink-app/test-utils":"workspace:*","@types/async-retry":"1.4.2","@types/cross-spawn":"^6.0.2","@types/jasmine":"3.8.1","@types/node":"22.13.10","@types/prompts":"2.0.1","@types/rimraf":"3.0.0","@types/tar":"4.0.3","@types/validate-npm-package-name":"3.0.0","@vercel/ncc":"0.36.1","async-retry":"1.3.1","chalk":"2.4.2","commander":"2.20.0","cpy":"7.3.0","cross-spawn":"6.0.5","got":"10.7.0","prompts":"2.1.0","tar":"4.4.10","update-check":"1.5.4","validate-npm-package-name":"3.0.0"},"engines":{"node":">=10.13.0"},"gitHead":"4243e3b3cd6d4e1ca001a61baa8436bf2bbe4113"}');var Vr=undefined&&undefined.__awaiter||function(e,t,r,i){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(i.next(e))}catch(e){n(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())}))};let Hr="";const Yr=new(s().Command)(Ur.name).version(Ur.version).arguments("<project-directory>").usage(`${i().green("<project-directory>")} [options]`).action((e=>{Hr=e})).allowUnknownOption().parse(process.argv);function run(){return Vr(this,void 0,void 0,(function*(){if(typeof Hr==="string"){Hr=Hr.trim()}if(!Hr){const e=yield u()({type:"text",name:"path",message:"What is your project named?",initial:"my-app",validate:e=>{const t=validateNpmName(a().basename(a().resolve(e)));if(t.valid){return true}return"Invalid project name: "+t.problems[0]}});if(typeof e.path==="string"){Hr=e.path.trim()}}if(!Hr){console.log();console.log("Please specify the project directory:");console.log(` ${i().cyan(Yr.name())} ${i().green("<project-directory>")}`);console.log();console.log("For example:");console.log(` ${i().cyan(Yr.name())} ${i().green("my-flink-app")}`);console.log();console.log(`Run ${i().cyan(`${Yr.name()} --help`)} to see all options.`);process.exit(1)}const e=a().resolve(Hr);const t=a().basename(e);const{valid:r,problems:n}=validateNpmName(t);if(!r){console.error(`Could not create a project called ${i().red(`"${t}"`)} because of npm naming restrictions:`);n.forEach((e=>console.error(` ${i().red.bold("*")} ${e}`)));process.exit(1)}try{yield createApp({appPath:e})}catch(e){if(!(e instanceof DownloadError)){throw e}}}))}const Qr=h()(Ur).catch((()=>null));function notifyUpdate(){return Vr(this,void 0,void 0,(function*(){try{const e=yield Qr;if(e===null||e===void 0?void 0:e.latest){console.log();console.log(i().yellow.bold("A new version of `create-flink-app` is available!"));console.log("You can update by running: "+i().cyan("npm i -g create-flink-app"));console.log()}process.exit()}catch(e){}}))}run().then(notifyUpdate).catch((e=>Vr(void 0,void 0,void 0,(function*(){console.log();console.log("Aborting installation.");if(e.command){console.log(` ${i().cyan(e.command)} has failed.`)}else{console.log(i().red("Unexpected error. Please report it as a bug:"));console.log(e)}console.log();yield notifyUpdate();process.exit(1)}))))})();module.exports=r})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-flink-app",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"flinkapp",
|
|
6
6
|
"flink"
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"tar": "4.4.10",
|
|
39
39
|
"update-check": "1.5.4",
|
|
40
40
|
"validate-npm-package-name": "3.0.0",
|
|
41
|
-
"@flink-app/flink": "0.13.
|
|
42
|
-
"@flink-app/test-utils": "0.13.
|
|
41
|
+
"@flink-app/flink": "0.13.1",
|
|
42
|
+
"@flink-app/test-utils": "0.13.1"
|
|
43
43
|
},
|
|
44
44
|
"engines": {
|
|
45
45
|
"node": ">=10.13.0"
|