create-amagaki 0.0.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +28 -3
  2. package/package.json +15 -23
package/dist/index.js CHANGED
@@ -1,4 +1,29 @@
1
1
  #!/usr/bin/env node
2
- (()=>{var e={7678:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const{toString:r}=Object.prototype;const isOfType=e=>t=>typeof t===e;const getObjectType=e=>{const t=r.call(e).slice(8,-1);if(t){return t}return undefined};const isObjectOfType=e=>t=>getObjectType(t)===e;function is(e){switch(e){case null:return"null";case true:case false:return"boolean";default:}switch(typeof e){case"undefined":return"undefined";case"string":return"string";case"number":return"number";case"bigint":return"bigint";case"symbol":return"symbol";default:}if(is.function_(e)){return"Function"}if(is.observable(e)){return"Observable"}if(is.array(e)){return"Array"}if(is.buffer(e)){return"Buffer"}const t=getObjectType(e);if(t){return t}if(e instanceof String||e instanceof Boolean||e instanceof Number){throw new TypeError("Please don't use object wrappers for primitive types")}return"Object"}is.undefined=isOfType("undefined");is.string=isOfType("string");const s=isOfType("number");is.number=e=>s(e)&&!is.nan(e);is.bigint=isOfType("bigint");is.function_=isOfType("function");is.null_=e=>e===null;is.class_=e=>is.function_(e)&&e.toString().startsWith("class ");is.boolean=e=>e===true||e===false;is.symbol=isOfType("symbol");is.numericString=e=>is.string(e)&&!is.emptyStringOrWhitespace(e)&&!Number.isNaN(Number(e));is.array=Array.isArray;is.buffer=e=>{var t,r,s,i;return(i=(s=(r=(t=e)===null||t===void 0?void 0:t.constructor)===null||r===void 0?void 0:r.isBuffer)===null||s===void 0?void 0:s.call(r,e))!==null&&i!==void 0?i:false};is.nullOrUndefined=e=>is.null_(e)||is.undefined(e);is.object=e=>!is.null_(e)&&(typeof e==="object"||is.function_(e));is.iterable=e=>{var t;return is.function_((t=e)===null||t===void 0?void 0:t[Symbol.iterator])};is.asyncIterable=e=>{var t;return is.function_((t=e)===null||t===void 0?void 0:t[Symbol.asyncIterator])};is.generator=e=>is.iterable(e)&&is.function_(e.next)&&is.function_(e.throw);is.asyncGenerator=e=>is.asyncIterable(e)&&is.function_(e.next)&&is.function_(e.throw);is.nativePromise=e=>isObjectOfType("Promise")(e);const hasPromiseAPI=e=>{var t,r;return is.function_((t=e)===null||t===void 0?void 0:t.then)&&is.function_((r=e)===null||r===void 0?void 0:r.catch)};is.promise=e=>is.nativePromise(e)||hasPromiseAPI(e);is.generatorFunction=isObjectOfType("GeneratorFunction");is.asyncGeneratorFunction=e=>getObjectType(e)==="AsyncGeneratorFunction";is.asyncFunction=e=>getObjectType(e)==="AsyncFunction";is.boundFunction=e=>is.function_(e)&&!e.hasOwnProperty("prototype");is.regExp=isObjectOfType("RegExp");is.date=isObjectOfType("Date");is.error=isObjectOfType("Error");is.map=e=>isObjectOfType("Map")(e);is.set=e=>isObjectOfType("Set")(e);is.weakMap=e=>isObjectOfType("WeakMap")(e);is.weakSet=e=>isObjectOfType("WeakSet")(e);is.int8Array=isObjectOfType("Int8Array");is.uint8Array=isObjectOfType("Uint8Array");is.uint8ClampedArray=isObjectOfType("Uint8ClampedArray");is.int16Array=isObjectOfType("Int16Array");is.uint16Array=isObjectOfType("Uint16Array");is.int32Array=isObjectOfType("Int32Array");is.uint32Array=isObjectOfType("Uint32Array");is.float32Array=isObjectOfType("Float32Array");is.float64Array=isObjectOfType("Float64Array");is.bigInt64Array=isObjectOfType("BigInt64Array");is.bigUint64Array=isObjectOfType("BigUint64Array");is.arrayBuffer=isObjectOfType("ArrayBuffer");is.sharedArrayBuffer=isObjectOfType("SharedArrayBuffer");is.dataView=isObjectOfType("DataView");is.directInstanceOf=(e,t)=>Object.getPrototypeOf(e)===t.prototype;is.urlInstance=e=>isObjectOfType("URL")(e);is.urlString=e=>{if(!is.string(e)){return false}try{new URL(e);return true}catch(e){return false}};is.truthy=e=>Boolean(e);is.falsy=e=>!e;is.nan=e=>Number.isNaN(e);const i=new Set(["undefined","string","number","bigint","boolean","symbol"]);is.primitive=e=>is.null_(e)||i.has(typeof e);is.integer=e=>Number.isInteger(e);is.safeInteger=e=>Number.isSafeInteger(e);is.plainObject=e=>{if(getObjectType(e)!=="Object"){return false}const t=Object.getPrototypeOf(e);return t===null||t===Object.getPrototypeOf({})};const n=new Set(["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"]);is.typedArray=e=>{const t=getObjectType(e);if(t===undefined){return false}return n.has(t)};const isValidLength=e=>is.safeInteger(e)&&e>=0;is.arrayLike=e=>!is.nullOrUndefined(e)&&!is.function_(e)&&isValidLength(e.length);is.inRange=(e,t)=>{if(is.number(t)){return e>=Math.min(0,t)&&e<=Math.max(t,0)}if(is.array(t)&&t.length===2){return e>=Math.min(...t)&&e<=Math.max(...t)}throw new TypeError(`Invalid range: ${JSON.stringify(t)}`)};const o=1;const a=["innerHTML","ownerDocument","style","attributes","nodeValue"];is.domElement=e=>is.object(e)&&e.nodeType===o&&is.string(e.nodeName)&&!is.plainObject(e)&&a.every((t=>t in e));is.observable=e=>{var t,r,s,i;if(!e){return false}if(e===((r=(t=e)[Symbol.observable])===null||r===void 0?void 0:r.call(t))){return true}if(e===((i=(s=e)["@@observable"])===null||i===void 0?void 0:i.call(s))){return true}return false};is.nodeStream=e=>is.object(e)&&is.function_(e.pipe)&&!is.observable(e);is.infinite=e=>e===Infinity||e===-Infinity;const isAbsoluteMod2=e=>t=>is.integer(t)&&Math.abs(t%2)===e;is.evenInteger=isAbsoluteMod2(0);is.oddInteger=isAbsoluteMod2(1);is.emptyArray=e=>is.array(e)&&e.length===0;is.nonEmptyArray=e=>is.array(e)&&e.length>0;is.emptyString=e=>is.string(e)&&e.length===0;is.nonEmptyString=e=>is.string(e)&&e.length>0;const isWhiteSpaceString=e=>is.string(e)&&!/\S/.test(e);is.emptyStringOrWhitespace=e=>is.emptyString(e)||isWhiteSpaceString(e);is.emptyObject=e=>is.object(e)&&!is.map(e)&&!is.set(e)&&Object.keys(e).length===0;is.nonEmptyObject=e=>is.object(e)&&!is.map(e)&&!is.set(e)&&Object.keys(e).length>0;is.emptySet=e=>is.set(e)&&e.size===0;is.nonEmptySet=e=>is.set(e)&&e.size>0;is.emptyMap=e=>is.map(e)&&e.size===0;is.nonEmptyMap=e=>is.map(e)&&e.size>0;const predicateOnArray=(e,t,r)=>{if(!is.function_(t)){throw new TypeError(`Invalid predicate: ${JSON.stringify(t)}`)}if(r.length===0){throw new TypeError("Invalid number of values")}return e.call(r,t)};is.any=(e,...t)=>{const r=is.array(e)?e:[e];return r.some((e=>predicateOnArray(Array.prototype.some,e,t)))};is.all=(e,...t)=>predicateOnArray(Array.prototype.every,e,t);const assertType=(e,t,r)=>{if(!e){throw new TypeError(`Expected value which is \`${t}\`, received value of type \`${is(r)}\`.`)}};t.assert={undefined:e=>assertType(is.undefined(e),"undefined",e),string:e=>assertType(is.string(e),"string",e),number:e=>assertType(is.number(e),"number",e),bigint:e=>assertType(is.bigint(e),"bigint",e),function_:e=>assertType(is.function_(e),"Function",e),null_:e=>assertType(is.null_(e),"null",e),class_:e=>assertType(is.class_(e),"Class",e),boolean:e=>assertType(is.boolean(e),"boolean",e),symbol:e=>assertType(is.symbol(e),"symbol",e),numericString:e=>assertType(is.numericString(e),"string with a number",e),array:e=>assertType(is.array(e),"Array",e),buffer:e=>assertType(is.buffer(e),"Buffer",e),nullOrUndefined:e=>assertType(is.nullOrUndefined(e),"null or undefined",e),object:e=>assertType(is.object(e),"Object",e),iterable:e=>assertType(is.iterable(e),"Iterable",e),asyncIterable:e=>assertType(is.asyncIterable(e),"AsyncIterable",e),generator:e=>assertType(is.generator(e),"Generator",e),asyncGenerator:e=>assertType(is.asyncGenerator(e),"AsyncGenerator",e),nativePromise:e=>assertType(is.nativePromise(e),"native Promise",e),promise:e=>assertType(is.promise(e),"Promise",e),generatorFunction:e=>assertType(is.generatorFunction(e),"GeneratorFunction",e),asyncGeneratorFunction:e=>assertType(is.asyncGeneratorFunction(e),"AsyncGeneratorFunction",e),asyncFunction:e=>assertType(is.asyncFunction(e),"AsyncFunction",e),boundFunction:e=>assertType(is.boundFunction(e),"Function",e),regExp:e=>assertType(is.regExp(e),"RegExp",e),date:e=>assertType(is.date(e),"Date",e),error:e=>assertType(is.error(e),"Error",e),map:e=>assertType(is.map(e),"Map",e),set:e=>assertType(is.set(e),"Set",e),weakMap:e=>assertType(is.weakMap(e),"WeakMap",e),weakSet:e=>assertType(is.weakSet(e),"WeakSet",e),int8Array:e=>assertType(is.int8Array(e),"Int8Array",e),uint8Array:e=>assertType(is.uint8Array(e),"Uint8Array",e),uint8ClampedArray:e=>assertType(is.uint8ClampedArray(e),"Uint8ClampedArray",e),int16Array:e=>assertType(is.int16Array(e),"Int16Array",e),uint16Array:e=>assertType(is.uint16Array(e),"Uint16Array",e),int32Array:e=>assertType(is.int32Array(e),"Int32Array",e),uint32Array:e=>assertType(is.uint32Array(e),"Uint32Array",e),float32Array:e=>assertType(is.float32Array(e),"Float32Array",e),float64Array:e=>assertType(is.float64Array(e),"Float64Array",e),bigInt64Array:e=>assertType(is.bigInt64Array(e),"BigInt64Array",e),bigUint64Array:e=>assertType(is.bigUint64Array(e),"BigUint64Array",e),arrayBuffer:e=>assertType(is.arrayBuffer(e),"ArrayBuffer",e),sharedArrayBuffer:e=>assertType(is.sharedArrayBuffer(e),"SharedArrayBuffer",e),dataView:e=>assertType(is.dataView(e),"DataView",e),urlInstance:e=>assertType(is.urlInstance(e),"URL",e),urlString:e=>assertType(is.urlString(e),"string with a URL",e),truthy:e=>assertType(is.truthy(e),"truthy",e),falsy:e=>assertType(is.falsy(e),"falsy",e),nan:e=>assertType(is.nan(e),"NaN",e),primitive:e=>assertType(is.primitive(e),"primitive",e),integer:e=>assertType(is.integer(e),"integer",e),safeInteger:e=>assertType(is.safeInteger(e),"integer",e),plainObject:e=>assertType(is.plainObject(e),"plain object",e),typedArray:e=>assertType(is.typedArray(e),"TypedArray",e),arrayLike:e=>assertType(is.arrayLike(e),"array-like",e),domElement:e=>assertType(is.domElement(e),"Element",e),observable:e=>assertType(is.observable(e),"Observable",e),nodeStream:e=>assertType(is.nodeStream(e),"Node.js Stream",e),infinite:e=>assertType(is.infinite(e),"infinite number",e),emptyArray:e=>assertType(is.emptyArray(e),"empty array",e),nonEmptyArray:e=>assertType(is.nonEmptyArray(e),"non-empty array",e),emptyString:e=>assertType(is.emptyString(e),"empty string",e),nonEmptyString:e=>assertType(is.nonEmptyString(e),"non-empty string",e),emptyStringOrWhitespace:e=>assertType(is.emptyStringOrWhitespace(e),"empty string or whitespace",e),emptyObject:e=>assertType(is.emptyObject(e),"empty object",e),nonEmptyObject:e=>assertType(is.nonEmptyObject(e),"non-empty object",e),emptySet:e=>assertType(is.emptySet(e),"empty set",e),nonEmptySet:e=>assertType(is.nonEmptySet(e),"non-empty set",e),emptyMap:e=>assertType(is.emptyMap(e),"empty map",e),nonEmptyMap:e=>assertType(is.nonEmptyMap(e),"non-empty map",e),evenInteger:e=>assertType(is.evenInteger(e),"even integer",e),oddInteger:e=>assertType(is.oddInteger(e),"odd integer",e),directInstanceOf:(e,t)=>assertType(is.directInstanceOf(e,t),"T",e),inRange:(e,t)=>assertType(is.inRange(e,t),"in range",e),any:(e,...t)=>assertType(is.any(e,...t),"predicate returns truthy for any value",t),all:(e,...t)=>assertType(is.all(e,...t),"predicate returns truthy for all values",t)};Object.defineProperties(is,{class:{value:is.class_},function:{value:is.function_},null:{value:is.null_}});Object.defineProperties(t.assert,{class:{value:t.assert.class_},function:{value:t.assert.function_},null:{value:t.assert.null_}});t["default"]=is;e.exports=is;e.exports["default"]=is;e.exports.assert=t.assert},8097:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(6214);const i=r(3837);const n=Number(process.versions.node.split(".")[0]);const timer=e=>{if(e.timings){return e.timings}const t={start:Date.now(),socket:undefined,lookup:undefined,connect:undefined,secureConnect:undefined,upload:undefined,response:undefined,end:undefined,error:undefined,abort:undefined,phases:{wait:undefined,dns:undefined,tcp:undefined,tls:undefined,request:undefined,firstByte:undefined,download:undefined,total:undefined}};e.timings=t;const handleError=e=>{const r=e.emit.bind(e);e.emit=(s,...i)=>{if(s==="error"){t.error=Date.now();t.phases.total=t.error-t.start;e.emit=r}return r(s,...i)}};handleError(e);const onAbort=()=>{t.abort=Date.now();if(!t.response||n>=13){t.phases.total=Date.now()-t.start}};e.prependOnceListener("abort",onAbort);const onSocket=e=>{t.socket=Date.now();t.phases.wait=t.socket-t.start;if(i.types.isProxy(e)){return}const lookupListener=()=>{t.lookup=Date.now();t.phases.dns=t.lookup-t.socket};e.prependOnceListener("lookup",lookupListener);s.default(e,{connect:()=>{t.connect=Date.now();if(t.lookup===undefined){e.removeListener("lookup",lookupListener);t.lookup=t.connect;t.phases.dns=t.lookup-t.socket}t.phases.tcp=t.connect-t.lookup},secureConnect:()=>{t.secureConnect=Date.now();t.phases.tls=t.secureConnect-t.connect}})};if(e.socket){onSocket(e.socket)}else{e.prependOnceListener("socket",onSocket)}const onUpload=()=>{var e;t.upload=Date.now();t.phases.request=t.upload-((e=t.secureConnect)!==null&&e!==void 0?e:t.connect)};const writableFinished=()=>{if(typeof e.writableFinished==="boolean"){return e.writableFinished}return e.finished&&e.outputSize===0&&(!e.socket||e.socket.writableLength===0)};if(writableFinished()){onUpload()}else{e.prependOnceListener("finish",onUpload)}e.prependOnceListener("response",(e=>{t.response=Date.now();t.phases.firstByte=t.response-t.upload;e.timings=t;handleError(e);e.prependOnceListener("end",(()=>{t.end=Date.now();t.phases.download=t.end-t.response;t.phases.total=t.end-t.start}));e.prependOnceListener("aborted",onAbort)}));return t};t["default"]=timer;e.exports=timer;e.exports["default"]=timer},2068:(e,t,r)=>{"use strict";e=r.nmd(e);const s=r(6931);const wrapAnsi16=(e,t)=>function(){const r=e.apply(s,arguments);return`[${r+t}m`};const wrapAnsi256=(e,t)=>function(){const r=e.apply(s,arguments);return`[${38+t};5;${r}m`};const wrapAnsi16m=(e,t)=>function(){const r=e.apply(s,arguments);return`[${38+t};2;${r[0]};${r[1]};${r[2]}m`};function assembleStyles(){const e=new Map;const t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.grey=t.color.gray;for(const r of Object.keys(t)){const s=t[r];for(const r of Object.keys(s)){const i=s[r];t[r]={open:`[${i[0]}m`,close:`[${i[1]}m`};s[r]=t[r];e.set(i[0],i[1])}Object.defineProperty(t,r,{value:s,enumerable:false});Object.defineProperty(t,"codes",{value:e,enumerable:false})}const ansi2ansi=e=>e;const rgb2rgb=(e,t,r)=>[e,t,r];t.color.close="";t.bgColor.close="";t.color.ansi={ansi:wrapAnsi16(ansi2ansi,0)};t.color.ansi256={ansi256:wrapAnsi256(ansi2ansi,0)};t.color.ansi16m={rgb:wrapAnsi16m(rgb2rgb,0)};t.bgColor.ansi={ansi:wrapAnsi16(ansi2ansi,10)};t.bgColor.ansi256={ansi256:wrapAnsi256(ansi2ansi,10)};t.bgColor.ansi16m={rgb:wrapAnsi16m(rgb2rgb,10)};for(let e of Object.keys(s)){if(typeof s[e]!=="object"){continue}const r=s[e];if(e==="ansi16"){e="ansi"}if("ansi16"in r){t.color.ansi[e]=wrapAnsi16(r.ansi16,0);t.bgColor.ansi[e]=wrapAnsi16(r.ansi16,10)}if("ansi256"in r){t.color.ansi256[e]=wrapAnsi256(r.ansi256,0);t.bgColor.ansi256[e]=wrapAnsi256(r.ansi256,10)}if("rgb"in r){t.color.ansi16m[e]=wrapAnsi16m(r.rgb,0);t.bgColor.ansi16m[e]=wrapAnsi16m(r.rgb,10)}}return t}Object.defineProperty(e,"exports",{enumerable:true,get:assembleStyles})},3415:(e,t,r)=>{var s=r(4347);function retry(e,t){function run(r,i){var n=t||{};if(!("randomize"in n)){n.randomize=true}var o=s.operation(n);function bail(e){i(e||new Error("Aborted"))}function onError(e,t){if(e.bail){bail(e);return}if(!o.retry(e)){i(o.mainError())}else if(n.onRetry){n.onRetry(e,t)}}function runAttempt(t){var s;try{s=e(bail,t)}catch(e){onError(e,t);return}Promise.resolve(s).then(r).catch((function catchIt(e){onError(e,t)}))}o.attempt(runAttempt)}return new Promise(run)}e.exports=retry},9417:e=>{"use strict";e.exports=balanced;function balanced(e,t,r){if(e instanceof RegExp)e=maybeMatch(e,r);if(t instanceof RegExp)t=maybeMatch(t,r);var s=range(e,t,r);return s&&{start:s[0],end:s[1],pre:r.slice(0,s[0]),body:r.slice(s[0]+e.length,s[1]),post:r.slice(s[1]+t.length)}}function maybeMatch(e,t){var r=t.match(e);return r?r[0]:null}balanced.range=range;function range(e,t,r){var s,i,n,o,a;var l=r.indexOf(e);var h=r.indexOf(t,l+1);var c=l;if(l>=0&&h>0){if(e===t){return[l,h]}s=[];n=r.length;while(c>=0&&!a){if(c==l){s.push(c);l=r.indexOf(e,c+1)}else if(s.length==1){a=[s.pop(),h]}else{i=s.pop();if(i<n){n=i;o=h}h=r.indexOf(t,c+1)}c=l<h&&l>=0?l:h}if(s.length){a=[n,o]}}return a}},3717:(e,t,r)=>{var s=r(6891);var i=r(9417);e.exports=expandTop;var n="\0SLASH"+Math.random()+"\0";var o="\0OPEN"+Math.random()+"\0";var a="\0CLOSE"+Math.random()+"\0";var l="\0COMMA"+Math.random()+"\0";var h="\0PERIOD"+Math.random()+"\0";function numeric(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function escapeBraces(e){return e.split("\\\\").join(n).split("\\{").join(o).split("\\}").join(a).split("\\,").join(l).split("\\.").join(h)}function unescapeBraces(e){return e.split(n).join("\\").split(o).join("{").split(a).join("}").split(l).join(",").split(h).join(".")}function parseCommaParts(e){if(!e)return[""];var t=[];var r=i("{","}",e);if(!r)return e.split(",");var s=r.pre;var n=r.body;var o=r.post;var a=s.split(",");a[a.length-1]+="{"+n+"}";var l=parseCommaParts(o);if(o.length){a[a.length-1]+=l.shift();a.push.apply(a,l)}t.push.apply(t,a);return t}function expandTop(e){if(!e)return[];if(e.substr(0,2)==="{}"){e="\\{\\}"+e.substr(2)}return expand(escapeBraces(e),true).map(unescapeBraces)}function identity(e){return e}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){var r=[];var n=i("{","}",e);if(!n||/\$$/.test(n.pre))return[e];var o=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body);var l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body);var h=o||l;var c=n.body.indexOf(",")>=0;if(!h&&!c){if(n.post.match(/,.*\}/)){e=n.pre+"{"+n.body+a+n.post;return expand(e)}return[e]}var u;if(h){u=n.body.split(/\.\./)}else{u=parseCommaParts(n.body);if(u.length===1){u=expand(u[0],false).map(embrace);if(u.length===1){var d=n.post.length?expand(n.post,false):[""];return d.map((function(e){return n.pre+u[0]+e}))}}}var p=n.pre;var d=n.post.length?expand(n.post,false):[""];var m;if(h){var g=numeric(u[0]);var y=numeric(u[1]);var b=Math.max(u[0].length,u[1].length);var v=u.length==3?Math.abs(numeric(u[2])):1;var w=lte;var _=y<g;if(_){v*=-1;w=gte}var E=u.some(isPadded);m=[];for(var S=g;w(S,y);S+=v){var x;if(l){x=String.fromCharCode(S);if(x==="\\")x=""}else{x=String(S);if(E){var O=b-x.length;if(O>0){var k=new Array(O+1).join("0");if(S<0)x="-"+k+x.slice(1);else x=k+x}}}m.push(x)}}else{m=s(u,(function(e){return expand(e,false)}))}for(var R=0;R<m.length;R++){for(var T=0;T<d.length;T++){var C=p+m[R]+d[T];if(!t||h||C)r.push(C)}}return r}},134:(e,t,r)=>{"use strict";const{Resolver:s,V4MAPPED:i,ADDRCONFIG:n}=r(9523);const{promisify:o}=r(3837);const a=r(2037);const l=r(1531);const h=Symbol("cacheableLookupData");const c=Symbol("cacheableLookupInstance");const verifyAgent=e=>{if(!(e&&typeof e.createConnection==="function")){throw new Error("Expected an Agent instance as the first argument")}};const map4to6=e=>{for(const t of e){t.address=`::ffff:${t.address}`;t.family=6}};const getIfaceInfo=()=>{let e=false;let t=false;for(const r of Object.values(a.networkInterfaces())){for(const s of r){if(s.internal){continue}if(s.family==="IPv6"){t=true}else{e=true}if(e&&t){break}}}return{has4:e,has6:t}};class CacheableLookup{constructor({cacheAdapter:e,maxTtl:t=Infinity,resolver:r}={}){this.cache=new l({uri:typeof e==="string"&&e,store:typeof e!=="string"&&e,namespace:"cached-lookup"});this.maxTtl=t;this._resolver=r||new s;this._resolve4=o(this._resolver.resolve4.bind(this._resolver));this._resolve6=o(this._resolver.resolve6.bind(this._resolver));this._iface=getIfaceInfo();this.lookup=this.lookup.bind(this);this.lookupAsync=this.lookupAsync.bind(this)}set servers(e){this._resolver.setServers(e)}get servers(){return this._resolver.getServers()}lookup(e,t,r){if(typeof t==="function"){r=t;t={}}this.lookupAsync(e,{...t,throwNotFound:true}).then((e=>{if(t.all){r(null,e)}else{r(null,e.address,e.family,e.expires,e.ttl)}})).catch(r)}async lookupAsync(e,t={}){let r;if(!t.family&&t.all){const[t,s]=await Promise.all([this.lookupAsync(e,{all:true,family:4}),this.lookupAsync(e,{all:true,family:6})]);r=[...t,...s]}else{r=await this.query(e,t.family||4);if(r.length===0&&t.family===6&&t.hints&i){r=await this.query(e,4);map4to6(r)}}if(t.hints&n){const{_iface:e}=this;r=r.filter((t=>t.family===6?e.has6:e.has4))}if(r.length===0&&t.throwNotFound){const t=new Error(`ENOTFOUND ${e}`);t.code="ENOTFOUND";t.hostname=e;throw t}const s=Date.now();r=r.filter((e=>e.ttl===0||s<e.expires));if(t.all){return r}if(r.length===1){return r[0]}if(r.length===0){return undefined}return this._getEntry(r)}async query(e,t){let r=await this.cache.get(`${e}:${t}`);if(!r){r=await this.queryAndCache(e,t)}return r}async queryAndCache(e,t){const r=t===4?this._resolve4:this._resolve6;const s=await r(e,{ttl:true});if(s===undefined){return[]}const i=Date.now();let n=0;for(const e of s){n=Math.max(n,e.ttl);e.family=t;e.expires=i+e.ttl*1e3}n=Math.min(this.maxTtl,n)*1e3;if(this.maxTtl!==0&&n!==0){await this.cache.set(`${e}:${t}`,s,n)}return s}_getEntry(e){return e[Math.floor(Math.random()*e.length)]}install(e){verifyAgent(e);if(h in e){throw new Error("CacheableLookup has been already installed")}e[h]=e.createConnection;e[c]=this;e.createConnection=(t,r)=>{if(!("lookup"in t)){t.lookup=this.lookup}return e[h](t,r)}}uninstall(e){verifyAgent(e);if(e[h]){if(e[c]!==this){throw new Error("The agent is not owned by this CacheableLookup instance")}e.createConnection=e[h];delete e[h];delete e[c]}}updateInterfaceInfo(){this._iface=getIfaceInfo()}}e.exports=CacheableLookup;e.exports["default"]=CacheableLookup},1472:(e,t,r)=>{"use strict";const s=r(2361);const i=r(7310);const n=r(7952);const o=r(1766);const a=r(1002);const l=r(9004);const h=r(9662);const c=r(1312);const u=r(1531);class CacheableRequest{constructor(e,t){if(typeof e!=="function"){throw new TypeError("Parameter `request` must be a function")}this.cache=new u({uri:typeof t==="string"&&t,store:typeof t!=="string"&&t,namespace:"cacheable-request"});return this.createCacheableRequest(e)}createCacheableRequest(e){return(t,r)=>{let u;if(typeof t==="string"){u=normalizeUrlObject(i.parse(t));t={}}else if(t instanceof i.URL){u=normalizeUrlObject(i.parse(t.toString()));t={}}else{const[e,...r]=(t.path||"").split("?");const s=r.length>0?`?${r.join("?")}`:"";u=normalizeUrlObject({...t,pathname:e,search:s})}t={headers:{},method:"GET",cache:true,strictTtl:false,automaticFailover:false,...t,...urlObjectToRequestOptions(u)};t.headers=h(t.headers);const d=new s;const p=n(i.format(u),{stripWWW:false,removeTrailingSlash:false,stripAuthentication:false});const m=`${t.method}:${p}`;let g=false;let y=false;const makeRequest=t=>{y=true;let s=false;let i;const n=new Promise((e=>{i=()=>{if(!s){s=true;e()}}}));const handler=e=>{if(g&&!t.forceRefresh){e.status=e.statusCode;const r=a.fromObject(g.cachePolicy).revalidatedPolicy(t,e);if(!r.modified){const t=r.policy.responseHeaders();e=new l(g.statusCode,t,g.body,g.url);e.cachePolicy=r.policy;e.fromCache=true}}if(!e.fromCache){e.cachePolicy=new a(t,e,t);e.fromCache=false}let i;if(t.cache&&e.cachePolicy.storable()){i=c(e);(async()=>{try{const r=o.buffer(e);await Promise.race([n,new Promise((t=>e.once("end",t)))]);if(s){return}const i=await r;const a={cachePolicy:e.cachePolicy.toObject(),url:e.url,statusCode:e.fromCache?g.statusCode:e.statusCode,body:i};let l=t.strictTtl?e.cachePolicy.timeToLive():undefined;if(t.maxTtl){l=l?Math.min(l,t.maxTtl):t.maxTtl}await this.cache.set(m,a,l)}catch(e){d.emit("error",new CacheableRequest.CacheError(e))}})()}else if(t.cache&&g){(async()=>{try{await this.cache.delete(m)}catch(e){d.emit("error",new CacheableRequest.CacheError(e))}})()}d.emit("response",i||e);if(typeof r==="function"){r(i||e)}};try{const r=e(t,handler);r.once("error",i);r.once("abort",i);d.emit("request",r)}catch(e){d.emit("error",new CacheableRequest.RequestError(e))}};(async()=>{const get=async e=>{await Promise.resolve();const t=e.cache?await this.cache.get(m):undefined;if(typeof t==="undefined"){return makeRequest(e)}const s=a.fromObject(t.cachePolicy);if(s.satisfiesWithoutRevalidation(e)&&!e.forceRefresh){const e=s.responseHeaders();const i=new l(t.statusCode,e,t.body,t.url);i.cachePolicy=s;i.fromCache=true;d.emit("response",i);if(typeof r==="function"){r(i)}}else{g=t;e.headers=s.revalidationHeaders(e);makeRequest(e)}};const errorHandler=e=>d.emit("error",new CacheableRequest.CacheError(e));this.cache.once("error",errorHandler);d.on("response",(()=>this.cache.removeListener("error",errorHandler)));try{await get(t)}catch(e){if(t.automaticFailover&&!y){makeRequest(t)}d.emit("error",new CacheableRequest.CacheError(e))}})();return d}}}function urlObjectToRequestOptions(e){const t={...e};t.path=`${e.pathname||"/"}${e.search||""}`;delete t.pathname;delete t.search;return t}function normalizeUrlObject(e){return{protocol:e.protocol,auth:e.auth,hostname:e.hostname||e.host||"localhost",port:e.port,pathname:e.pathname,search:e.search}}CacheableRequest.RequestError=class extends Error{constructor(e){super(e.message);this.name="RequestError";Object.assign(this,e)}};CacheableRequest.CacheError=class extends Error{constructor(e){super(e.message);this.name="CacheError";Object.assign(this,e)}};e.exports=CacheableRequest},8707:(e,t,r)=>{"use strict";const s=r(8691);const i=r(2068);const n=r(9318).stdout;const o=r(2138);const a=process.platform==="win32"&&!(process.env.TERM||"").toLowerCase().startsWith("xterm");const l=["ansi","ansi","ansi256","ansi16m"];const h=new Set(["gray"]);const c=Object.create(null);function applyOptions(e,t){t=t||{};const r=n?n.level:0;e.level=t.level===undefined?r:t.level;e.enabled="enabled"in t?t.enabled:e.level>0}function Chalk(e){if(!this||!(this instanceof Chalk)||this.template){const t={};applyOptions(t,e);t.template=function(){const e=[].slice.call(arguments);return chalkTag.apply(null,[t.template].concat(e))};Object.setPrototypeOf(t,Chalk.prototype);Object.setPrototypeOf(t.template,t);t.template.constructor=Chalk;return t.template}applyOptions(this,e)}if(a){i.blue.open=""}for(const e of Object.keys(i)){i[e].closeRe=new RegExp(s(i[e].close),"g");c[e]={get(){const t=i[e];return build.call(this,this._styles?this._styles.concat(t):[t],this._empty,e)}}}c.visible={get(){return build.call(this,this._styles||[],true,"visible")}};i.color.closeRe=new RegExp(s(i.color.close),"g");for(const e of Object.keys(i.color.ansi)){if(h.has(e)){continue}c[e]={get(){const t=this.level;return function(){const r=i.color[l[t]][e].apply(null,arguments);const s={open:r,close:i.color.close,closeRe:i.color.closeRe};return build.call(this,this._styles?this._styles.concat(s):[s],this._empty,e)}}}}i.bgColor.closeRe=new RegExp(s(i.bgColor.close),"g");for(const e of Object.keys(i.bgColor.ansi)){if(h.has(e)){continue}const t="bg"+e[0].toUpperCase()+e.slice(1);c[t]={get(){const t=this.level;return function(){const r=i.bgColor[l[t]][e].apply(null,arguments);const s={open:r,close:i.bgColor.close,closeRe:i.bgColor.closeRe};return build.call(this,this._styles?this._styles.concat(s):[s],this._empty,e)}}}}const u=Object.defineProperties((()=>{}),c);function build(e,t,r){const builder=function(){return applyStyle.apply(builder,arguments)};builder._styles=e;builder._empty=t;const s=this;Object.defineProperty(builder,"level",{enumerable:true,get(){return s.level},set(e){s.level=e}});Object.defineProperty(builder,"enabled",{enumerable:true,get(){return s.enabled},set(e){s.enabled=e}});builder.hasGrey=this.hasGrey||r==="gray"||r==="grey";builder.__proto__=u;return builder}function applyStyle(){const e=arguments;const t=e.length;let r=String(arguments[0]);if(t===0){return""}if(t>1){for(let s=1;s<t;s++){r+=" "+e[s]}}if(!this.enabled||this.level<=0||!r){return this._empty?"":r}const s=i.dim.open;if(a&&this.hasGrey){i.dim.open=""}for(const e of this._styles.slice().reverse()){r=e.open+r.replace(e.closeRe,e.open)+e.close;r=r.replace(/\r?\n/g,`${e.close}$&${e.open}`)}i.dim.open=s;return r}function chalkTag(e,t){if(!Array.isArray(t)){return[].slice.call(arguments,1).join(" ")}const r=[].slice.call(arguments,2);const s=[t.raw[0]];for(let e=1;e<t.length;e++){s.push(String(r[e-1]).replace(/[{}\\]/g,"\\$&"));s.push(String(t.raw[e]))}return o(e,s.join(""))}Object.defineProperties(Chalk.prototype,c);e.exports=Chalk();e.exports.supportsColor=n;e.exports["default"]=e.exports},2138:e=>{"use strict";const t=/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;const r=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;const s=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;const i=/\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi;const n=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function unescape(e){if(e[0]==="u"&&e.length===5||e[0]==="x"&&e.length===3){return String.fromCharCode(parseInt(e.slice(1),16))}return n.get(e)||e}function parseArguments(e,t){const r=[];const n=t.trim().split(/\s*,\s*/g);let o;for(const t of n){if(!isNaN(t)){r.push(Number(t))}else if(o=t.match(s)){r.push(o[2].replace(i,((e,t,r)=>t?unescape(t):r)))}else{throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`)}}return r}function parseStyle(e){r.lastIndex=0;const t=[];let s;while((s=r.exec(e))!==null){const e=s[1];if(s[2]){const r=parseArguments(e,s[2]);t.push([e].concat(r))}else{t.push([e])}}return t}function buildStyle(e,t){const r={};for(const e of t){for(const t of e.styles){r[t[0]]=e.inverse?null:t.slice(1)}}let s=e;for(const e of Object.keys(r)){if(Array.isArray(r[e])){if(!(e in s)){throw new Error(`Unknown Chalk style: ${e}`)}if(r[e].length>0){s=s[e].apply(s,r[e])}else{s=s[e]}}}return s}e.exports=(e,r)=>{const s=[];const i=[];let n=[];r.replace(t,((t,r,o,a,l,h)=>{if(r){n.push(unescape(r))}else if(a){const t=n.join("");n=[];i.push(s.length===0?t:buildStyle(e,s)(t));s.push({inverse:o,styles:parseStyle(a)})}else if(l){if(s.length===0){throw new Error("Found extraneous } in Chalk template literal")}i.push(buildStyle(e,s)(n.join("")));n=[];s.pop()}else{n.push(h)}}));i.push(n.join(""));if(s.length>0){const e=`Chalk template literal is missing ${s.length} closing bracket${s.length===1?"":"s"} (\`}\`)`;throw new Error(e)}return i.join("")}},9051:(e,t,r)=>{"use strict";const s=r(7147);const i=r(1017);const n=s.lchown?"lchown":"chown";const o=s.lchownSync?"lchownSync":"chownSync";const a=s.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/);const lchownSync=(e,t,r)=>{try{return s[o](e,t,r)}catch(e){if(e.code!=="ENOENT")throw e}};const chownSync=(e,t,r)=>{try{return s.chownSync(e,t,r)}catch(e){if(e.code!=="ENOENT")throw e}};const l=a?(e,t,r,i)=>n=>{if(!n||n.code!=="EISDIR")i(n);else s.chown(e,t,r,i)}:(e,t,r,s)=>s;const h=a?(e,t,r)=>{try{return lchownSync(e,t,r)}catch(s){if(s.code!=="EISDIR")throw s;chownSync(e,t,r)}}:(e,t,r)=>lchownSync(e,t,r);const c=process.version;let readdir=(e,t,r)=>s.readdir(e,t,r);let readdirSync=(e,t)=>s.readdirSync(e,t);if(/^v4\./.test(c))readdir=(e,t,r)=>s.readdir(e,r);const chown=(e,t,r,i)=>{s[n](e,t,r,l(e,t,r,(e=>{i(e&&e.code!=="ENOENT"?e:null)})))};const chownrKid=(e,t,r,n,o)=>{if(typeof t==="string")return s.lstat(i.resolve(e,t),((s,i)=>{if(s)return o(s.code!=="ENOENT"?s:null);i.name=t;chownrKid(e,i,r,n,o)}));if(t.isDirectory()){chownr(i.resolve(e,t.name),r,n,(s=>{if(s)return o(s);const a=i.resolve(e,t.name);chown(a,r,n,o)}))}else{const s=i.resolve(e,t.name);chown(s,r,n,o)}};const chownr=(e,t,r,s)=>{readdir(e,{withFileTypes:true},((i,n)=>{if(i){if(i.code==="ENOENT")return s();else if(i.code!=="ENOTDIR"&&i.code!=="ENOTSUP")return s(i)}if(i||!n.length)return chown(e,t,r,s);let o=n.length;let a=null;const then=i=>{if(a)return;if(i)return s(a=i);if(--o===0)return chown(e,t,r,s)};n.forEach((s=>chownrKid(e,s,t,r,then)))}))};const chownrKidSync=(e,t,r,n)=>{if(typeof t==="string"){try{const r=s.lstatSync(i.resolve(e,t));r.name=t;t=r}catch(e){if(e.code==="ENOENT")return;else throw e}}if(t.isDirectory())chownrSync(i.resolve(e,t.name),r,n);h(i.resolve(e,t.name),r,n)};const chownrSync=(e,t,r)=>{let s;try{s=readdirSync(e,{withFileTypes:true})}catch(s){if(s.code==="ENOENT")return;else if(s.code==="ENOTDIR"||s.code==="ENOTSUP")return h(e,t,r);else throw s}if(s&&s.length)s.forEach((s=>chownrKidSync(e,s,t,r)));return h(e,t,r)};e.exports=chownr;chownr.sync=chownrSync},9372:e=>{"use strict";const t=["destroy","setTimeout","socket","headers","trailers","rawHeaders","statusCode","httpVersion","httpVersionMinor","httpVersionMajor","rawTrailers","statusMessage"];e.exports=(e,r)=>{const s=new Set(Object.keys(e).concat(t));for(const t of s){if(t in r){continue}r[t]=typeof e[t]==="function"?e[t].bind(e):e[t]}}},1312:(e,t,r)=>{"use strict";const s=r(2781).PassThrough;const i=r(9372);const cloneResponse=e=>{if(!(e&&e.pipe)){throw new TypeError("Parameter `response` must be a response stream.")}const t=new s;i(e,t);return e.pipe(t)};e.exports=cloneResponse},7391:(e,t,r)=>{var s=r(8510);var i={};for(var n in s){if(s.hasOwnProperty(n)){i[s[n]]=n}}var o=e.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var a in o){if(o.hasOwnProperty(a)){if(!("channels"in o[a])){throw new Error("missing channels property: "+a)}if(!("labels"in o[a])){throw new Error("missing channel labels property: "+a)}if(o[a].labels.length!==o[a].channels){throw new Error("channel and label counts mismatch: "+a)}var l=o[a].channels;var h=o[a].labels;delete o[a].channels;delete o[a].labels;Object.defineProperty(o[a],"channels",{value:l});Object.defineProperty(o[a],"labels",{value:h})}}o.rgb.hsl=function(e){var t=e[0]/255;var r=e[1]/255;var s=e[2]/255;var i=Math.min(t,r,s);var n=Math.max(t,r,s);var o=n-i;var a;var l;var h;if(n===i){a=0}else if(t===n){a=(r-s)/o}else if(r===n){a=2+(s-t)/o}else if(s===n){a=4+(t-r)/o}a=Math.min(a*60,360);if(a<0){a+=360}h=(i+n)/2;if(n===i){l=0}else if(h<=.5){l=o/(n+i)}else{l=o/(2-n-i)}return[a,l*100,h*100]};o.rgb.hsv=function(e){var t;var r;var s;var i;var n;var o=e[0]/255;var a=e[1]/255;var l=e[2]/255;var h=Math.max(o,a,l);var c=h-Math.min(o,a,l);var diffc=function(e){return(h-e)/6/c+1/2};if(c===0){i=n=0}else{n=c/h;t=diffc(o);r=diffc(a);s=diffc(l);if(o===h){i=s-r}else if(a===h){i=1/3+t-s}else if(l===h){i=2/3+r-t}if(i<0){i+=1}else if(i>1){i-=1}}return[i*360,n*100,h*100]};o.rgb.hwb=function(e){var t=e[0];var r=e[1];var s=e[2];var i=o.rgb.hsl(e)[0];var n=1/255*Math.min(t,Math.min(r,s));s=1-1/255*Math.max(t,Math.max(r,s));return[i,n*100,s*100]};o.rgb.cmyk=function(e){var t=e[0]/255;var r=e[1]/255;var s=e[2]/255;var i;var n;var o;var a;a=Math.min(1-t,1-r,1-s);i=(1-t-a)/(1-a)||0;n=(1-r-a)/(1-a)||0;o=(1-s-a)/(1-a)||0;return[i*100,n*100,o*100,a*100]};function comparativeDistance(e,t){return Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2)}o.rgb.keyword=function(e){var t=i[e];if(t){return t}var r=Infinity;var n;for(var o in s){if(s.hasOwnProperty(o)){var a=s[o];var l=comparativeDistance(e,a);if(l<r){r=l;n=o}}}return n};o.keyword.rgb=function(e){return s[e]};o.rgb.xyz=function(e){var t=e[0]/255;var r=e[1]/255;var s=e[2]/255;t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92;r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92;s=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92;var i=t*.4124+r*.3576+s*.1805;var n=t*.2126+r*.7152+s*.0722;var o=t*.0193+r*.1192+s*.9505;return[i*100,n*100,o*100]};o.rgb.lab=function(e){var t=o.rgb.xyz(e);var r=t[0];var s=t[1];var i=t[2];var n;var a;var l;r/=95.047;s/=100;i/=108.883;r=r>.008856?Math.pow(r,1/3):7.787*r+16/116;s=s>.008856?Math.pow(s,1/3):7.787*s+16/116;i=i>.008856?Math.pow(i,1/3):7.787*i+16/116;n=116*s-16;a=500*(r-s);l=200*(s-i);return[n,a,l]};o.hsl.rgb=function(e){var t=e[0]/360;var r=e[1]/100;var s=e[2]/100;var i;var n;var o;var a;var l;if(r===0){l=s*255;return[l,l,l]}if(s<.5){n=s*(1+r)}else{n=s+r-s*r}i=2*s-n;a=[0,0,0];for(var h=0;h<3;h++){o=t+1/3*-(h-1);if(o<0){o++}if(o>1){o--}if(6*o<1){l=i+(n-i)*6*o}else if(2*o<1){l=n}else if(3*o<2){l=i+(n-i)*(2/3-o)*6}else{l=i}a[h]=l*255}return a};o.hsl.hsv=function(e){var t=e[0];var r=e[1]/100;var s=e[2]/100;var i=r;var n=Math.max(s,.01);var o;var a;s*=2;r*=s<=1?s:2-s;i*=n<=1?n:2-n;a=(s+r)/2;o=s===0?2*i/(n+i):2*r/(s+r);return[t,o*100,a*100]};o.hsv.rgb=function(e){var t=e[0]/60;var r=e[1]/100;var s=e[2]/100;var i=Math.floor(t)%6;var n=t-Math.floor(t);var o=255*s*(1-r);var a=255*s*(1-r*n);var l=255*s*(1-r*(1-n));s*=255;switch(i){case 0:return[s,l,o];case 1:return[a,s,o];case 2:return[o,s,l];case 3:return[o,a,s];case 4:return[l,o,s];case 5:return[s,o,a]}};o.hsv.hsl=function(e){var t=e[0];var r=e[1]/100;var s=e[2]/100;var i=Math.max(s,.01);var n;var o;var a;a=(2-r)*s;n=(2-r)*i;o=r*i;o/=n<=1?n:2-n;o=o||0;a/=2;return[t,o*100,a*100]};o.hwb.rgb=function(e){var t=e[0]/360;var r=e[1]/100;var s=e[2]/100;var i=r+s;var n;var o;var a;var l;if(i>1){r/=i;s/=i}n=Math.floor(6*t);o=1-s;a=6*t-n;if((n&1)!==0){a=1-a}l=r+a*(o-r);var h;var c;var u;switch(n){default:case 6:case 0:h=o;c=l;u=r;break;case 1:h=l;c=o;u=r;break;case 2:h=r;c=o;u=l;break;case 3:h=r;c=l;u=o;break;case 4:h=l;c=r;u=o;break;case 5:h=o;c=r;u=l;break}return[h*255,c*255,u*255]};o.cmyk.rgb=function(e){var t=e[0]/100;var r=e[1]/100;var s=e[2]/100;var i=e[3]/100;var n;var o;var a;n=1-Math.min(1,t*(1-i)+i);o=1-Math.min(1,r*(1-i)+i);a=1-Math.min(1,s*(1-i)+i);return[n*255,o*255,a*255]};o.xyz.rgb=function(e){var t=e[0]/100;var r=e[1]/100;var s=e[2]/100;var i;var n;var o;i=t*3.2406+r*-1.5372+s*-.4986;n=t*-.9689+r*1.8758+s*.0415;o=t*.0557+r*-.204+s*1.057;i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*12.92;n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n*12.92;o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*12.92;i=Math.min(Math.max(0,i),1);n=Math.min(Math.max(0,n),1);o=Math.min(Math.max(0,o),1);return[i*255,n*255,o*255]};o.xyz.lab=function(e){var t=e[0];var r=e[1];var s=e[2];var i;var n;var o;t/=95.047;r/=100;s/=108.883;t=t>.008856?Math.pow(t,1/3):7.787*t+16/116;r=r>.008856?Math.pow(r,1/3):7.787*r+16/116;s=s>.008856?Math.pow(s,1/3):7.787*s+16/116;i=116*r-16;n=500*(t-r);o=200*(r-s);return[i,n,o]};o.lab.xyz=function(e){var t=e[0];var r=e[1];var s=e[2];var i;var n;var o;n=(t+16)/116;i=r/500+n;o=n-s/200;var a=Math.pow(n,3);var l=Math.pow(i,3);var h=Math.pow(o,3);n=a>.008856?a:(n-16/116)/7.787;i=l>.008856?l:(i-16/116)/7.787;o=h>.008856?h:(o-16/116)/7.787;i*=95.047;n*=100;o*=108.883;return[i,n,o]};o.lab.lch=function(e){var t=e[0];var r=e[1];var s=e[2];var i;var n;var o;i=Math.atan2(s,r);n=i*360/2/Math.PI;if(n<0){n+=360}o=Math.sqrt(r*r+s*s);return[t,o,n]};o.lch.lab=function(e){var t=e[0];var r=e[1];var s=e[2];var i;var n;var o;o=s/360*2*Math.PI;i=r*Math.cos(o);n=r*Math.sin(o);return[t,i,n]};o.rgb.ansi16=function(e){var t=e[0];var r=e[1];var s=e[2];var i=1 in arguments?arguments[1]:o.rgb.hsv(e)[2];i=Math.round(i/50);if(i===0){return 30}var n=30+(Math.round(s/255)<<2|Math.round(r/255)<<1|Math.round(t/255));if(i===2){n+=60}return n};o.hsv.ansi16=function(e){return o.rgb.ansi16(o.hsv.rgb(e),e[2])};o.rgb.ansi256=function(e){var t=e[0];var r=e[1];var s=e[2];if(t===r&&r===s){if(t<8){return 16}if(t>248){return 231}return Math.round((t-8)/247*24)+232}var i=16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(s/255*5);return i};o.ansi16.rgb=function(e){var t=e%10;if(t===0||t===7){if(e>50){t+=3.5}t=t/10.5*255;return[t,t,t]}var r=(~~(e>50)+1)*.5;var s=(t&1)*r*255;var i=(t>>1&1)*r*255;var n=(t>>2&1)*r*255;return[s,i,n]};o.ansi256.rgb=function(e){if(e>=232){var t=(e-232)*10+8;return[t,t,t]}e-=16;var r;var s=Math.floor(e/36)/5*255;var i=Math.floor((r=e%36)/6)/5*255;var n=r%6/5*255;return[s,i,n]};o.rgb.hex=function(e){var t=((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255);var r=t.toString(16).toUpperCase();return"000000".substring(r.length)+r};o.hex.rgb=function(e){var t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t){return[0,0,0]}var r=t[0];if(t[0].length===3){r=r.split("").map((function(e){return e+e})).join("")}var s=parseInt(r,16);var i=s>>16&255;var n=s>>8&255;var o=s&255;return[i,n,o]};o.rgb.hcg=function(e){var t=e[0]/255;var r=e[1]/255;var s=e[2]/255;var i=Math.max(Math.max(t,r),s);var n=Math.min(Math.min(t,r),s);var o=i-n;var a;var l;if(o<1){a=n/(1-o)}else{a=0}if(o<=0){l=0}else if(i===t){l=(r-s)/o%6}else if(i===r){l=2+(s-t)/o}else{l=4+(t-r)/o+4}l/=6;l%=1;return[l*360,o*100,a*100]};o.hsl.hcg=function(e){var t=e[1]/100;var r=e[2]/100;var s=1;var i=0;if(r<.5){s=2*t*r}else{s=2*t*(1-r)}if(s<1){i=(r-.5*s)/(1-s)}return[e[0],s*100,i*100]};o.hsv.hcg=function(e){var t=e[1]/100;var r=e[2]/100;var s=t*r;var i=0;if(s<1){i=(r-s)/(1-s)}return[e[0],s*100,i*100]};o.hcg.rgb=function(e){var t=e[0]/360;var r=e[1]/100;var s=e[2]/100;if(r===0){return[s*255,s*255,s*255]}var i=[0,0,0];var n=t%1*6;var o=n%1;var a=1-o;var l=0;switch(Math.floor(n)){case 0:i[0]=1;i[1]=o;i[2]=0;break;case 1:i[0]=a;i[1]=1;i[2]=0;break;case 2:i[0]=0;i[1]=1;i[2]=o;break;case 3:i[0]=0;i[1]=a;i[2]=1;break;case 4:i[0]=o;i[1]=0;i[2]=1;break;default:i[0]=1;i[1]=0;i[2]=a}l=(1-r)*s;return[(r*i[0]+l)*255,(r*i[1]+l)*255,(r*i[2]+l)*255]};o.hcg.hsv=function(e){var t=e[1]/100;var r=e[2]/100;var s=t+r*(1-t);var i=0;if(s>0){i=t/s}return[e[0],i*100,s*100]};o.hcg.hsl=function(e){var t=e[1]/100;var r=e[2]/100;var s=r*(1-t)+.5*t;var i=0;if(s>0&&s<.5){i=t/(2*s)}else if(s>=.5&&s<1){i=t/(2*(1-s))}return[e[0],i*100,s*100]};o.hcg.hwb=function(e){var t=e[1]/100;var r=e[2]/100;var s=t+r*(1-t);return[e[0],(s-t)*100,(1-s)*100]};o.hwb.hcg=function(e){var t=e[1]/100;var r=e[2]/100;var s=1-r;var i=s-t;var n=0;if(i<1){n=(s-i)/(1-i)}return[e[0],i*100,n*100]};o.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};o.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};o.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};o.gray.hsl=o.gray.hsv=function(e){return[0,0,e[0]]};o.gray.hwb=function(e){return[0,100,e[0]]};o.gray.cmyk=function(e){return[0,0,0,e[0]]};o.gray.lab=function(e){return[e[0],0,0]};o.gray.hex=function(e){var t=Math.round(e[0]/100*255)&255;var r=(t<<16)+(t<<8)+t;var s=r.toString(16).toUpperCase();return"000000".substring(s.length)+s};o.rgb.gray=function(e){var t=(e[0]+e[1]+e[2])/3;return[t/255*100]}},6931:(e,t,r)=>{var s=r(7391);var i=r(880);var n={};var o=Object.keys(s);function wrapRaw(e){var wrappedFn=function(t){if(t===undefined||t===null){return t}if(arguments.length>1){t=Array.prototype.slice.call(arguments)}return e(t)};if("conversion"in e){wrappedFn.conversion=e.conversion}return wrappedFn}function wrapRounded(e){var wrappedFn=function(t){if(t===undefined||t===null){return t}if(arguments.length>1){t=Array.prototype.slice.call(arguments)}var r=e(t);if(typeof r==="object"){for(var s=r.length,i=0;i<s;i++){r[i]=Math.round(r[i])}}return r};if("conversion"in e){wrappedFn.conversion=e.conversion}return wrappedFn}o.forEach((function(e){n[e]={};Object.defineProperty(n[e],"channels",{value:s[e].channels});Object.defineProperty(n[e],"labels",{value:s[e].labels});var t=i(e);var r=Object.keys(t);r.forEach((function(r){var s=t[r];n[e][r]=wrapRounded(s);n[e][r].raw=wrapRaw(s)}))}));e.exports=n},880:(e,t,r)=>{var s=r(7391);function buildGraph(){var e={};var t=Object.keys(s);for(var r=t.length,i=0;i<r;i++){e[t[i]]={distance:-1,parent:null}}return e}function deriveBFS(e){var t=buildGraph();var r=[e];t[e].distance=0;while(r.length){var i=r.pop();var n=Object.keys(s[i]);for(var o=n.length,a=0;a<o;a++){var l=n[a];var h=t[l];if(h.distance===-1){h.distance=t[i].distance+1;h.parent=i;r.unshift(l)}}}return t}function link(e,t){return function(r){return t(e(r))}}function wrapConversion(e,t){var r=[t[e].parent,e];var i=s[t[e].parent][e];var n=t[e].parent;while(t[n].parent){r.unshift(t[n].parent);i=link(s[t[n].parent][n],i);n=t[n].parent}i.conversion=r;return i}e.exports=function(e){var t=deriveBFS(e);var r={};var s=Object.keys(t);for(var i=s.length,n=0;n<i;n++){var o=s[n];var a=t[o];if(a.parent===null){continue}r[o]=wrapConversion(o,t)}return r}},8510:e=>{"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},1904:(e,t,r)=>{var s=r(2361).EventEmitter;var i=r(2081).spawn;var n=r(1017);var o=n.dirname;var a=n.basename;var l=r(7147);r(3837).inherits(Command,s);t=e.exports=new Command;t.Command=Command;t.Option=Option;function Option(e,t){this.flags=e;this.required=e.indexOf("<")>=0;this.optional=e.indexOf("[")>=0;this.bool=e.indexOf("-no-")===-1;e=e.split(/[ ,|]+/);if(e.length>1&&!/^[[<]/.test(e[1]))this.short=e.shift();this.long=e.shift();this.description=t||""}Option.prototype.name=function(){return this.long.replace("--","").replace("no-","")};Option.prototype.attributeName=function(){return camelcase(this.name())};Option.prototype.is=function(e){return this.short===e||this.long===e};function Command(e){this.commands=[];this.options=[];this._execs={};this._allowUnknownOption=false;this._args=[];this._name=e||""}Command.prototype.command=function(e,t,r){if(typeof t==="object"&&t!==null){r=t;t=null}r=r||{};var s=e.split(/ +/);var i=new Command(s.shift());if(t){i.description(t);this.executables=true;this._execs[i._name]=true;if(r.isDefault)this.defaultExecutable=i._name}i._noHelp=!!r.noHelp;this.commands.push(i);i.parseExpectedArgs(s);i.parent=this;if(t)return this;return i};Command.prototype.arguments=function(e){return this.parseExpectedArgs(e.split(/ +/))};Command.prototype.addImplicitHelpCommand=function(){this.command("help [cmd]","display help for [cmd]")};Command.prototype.parseExpectedArgs=function(e){if(!e.length)return;var t=this;e.forEach((function(e){var r={required:false,name:"",variadic:false};switch(e[0]){case"<":r.required=true;r.name=e.slice(1,-1);break;case"[":r.name=e.slice(1,-1);break}if(r.name.length>3&&r.name.slice(-3)==="..."){r.variadic=true;r.name=r.name.slice(0,-3)}if(r.name){t._args.push(r)}}));return this};Command.prototype.action=function(e){var t=this;var listener=function(r,s){r=r||[];s=s||[];var i=t.parseOptions(s);outputHelpIfNecessary(t,i.unknown);if(i.unknown.length>0){t.unknownOption(i.unknown[0])}if(i.args.length)r=i.args.concat(r);t._args.forEach((function(e,s){if(e.required&&r[s]==null){t.missingArgument(e.name)}else if(e.variadic){if(s!==t._args.length-1){t.variadicArgNotLast(e.name)}r[s]=r.splice(s)}}));if(t._args.length){r[t._args.length]=t}else{r.push(t)}e.apply(t,r)};var r=this.parent||this;var s=r===this?"*":this._name;r.on("command:"+s,listener);if(this._alias)r.on("command:"+this._alias,listener);return this};Command.prototype.option=function(e,t,r,s){var i=this,n=new Option(e,t),o=n.name(),a=n.attributeName();if(typeof r!=="function"){if(r instanceof RegExp){var l=r;r=function(e,t){var r=l.exec(e);return r?r[0]:t}}else{s=r;r=null}}if(!n.bool||n.optional||n.required){if(!n.bool)s=true;if(s!==undefined){i[a]=s;n.defaultValue=s}}this.options.push(n);this.on("option:"+o,(function(e){if(e!==null&&r){e=r(e,i[a]===undefined?s:i[a])}if(typeof i[a]==="boolean"||typeof i[a]==="undefined"){if(e==null){i[a]=n.bool?s||true:false}else{i[a]=e}}else if(e!==null){i[a]=e}}));return this};Command.prototype.allowUnknownOption=function(e){this._allowUnknownOption=arguments.length===0||e;return this};Command.prototype.parse=function(e){if(this.executables)this.addImplicitHelpCommand();this.rawArgs=e;this._name=this._name||a(e[1],".js");if(this.executables&&e.length<3&&!this.defaultExecutable){e.push("--help")}var t=this.parseOptions(this.normalize(e.slice(2)));var r=this.args=t.args;var s=this.parseArgs(this.args,t.unknown);var i=s.args[0];var n=null;if(i){n=this.commands.filter((function(e){return e.alias()===i}))[0]}if(this._execs[i]&&typeof this._execs[i]!=="function"){return this.executeSubCommand(e,r,t.unknown)}else if(n){r[0]=n._name;return this.executeSubCommand(e,r,t.unknown)}else if(this.defaultExecutable){r.unshift(this.defaultExecutable);return this.executeSubCommand(e,r,t.unknown)}return s};Command.prototype.executeSubCommand=function(e,t,r){t=t.concat(r);if(!t.length)this.help();if(t[0]==="help"&&t.length===1)this.help();if(t[0]==="help"){t[0]=t[1];t[1]="--help"}var s=e[1];var h=a(s,n.extname(s))+"-"+t[0];var c;var u=l.realpathSync(s);c=o(u);var d=n.join(c,h);var p=false;if(exists(d+".js")){h=d+".js";p=true}else if(exists(d+".ts")){h=d+".ts";p=true}else if(exists(d)){h=d}t=t.slice(1);var m;if(process.platform!=="win32"){if(p){t.unshift(h);t=(process.execArgv||[]).concat(t);m=i(process.argv[0],t,{stdio:"inherit",customFds:[0,1,2]})}else{m=i(h,t,{stdio:"inherit",customFds:[0,1,2]})}}else{t.unshift(h);m=i(process.execPath,t,{stdio:"inherit"})}var g=["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"];g.forEach((function(e){process.on(e,(function(){if(m.killed===false&&m.exitCode===null){m.kill(e)}}))}));m.on("close",process.exit.bind(process));m.on("error",(function(e){if(e.code==="ENOENT"){console.error("error: %s(1) does not exist, try --help",h)}else if(e.code==="EACCES"){console.error("error: %s(1) not executable. try chmod or run with root",h)}process.exit(1)}));this.runningCommand=m};Command.prototype.normalize=function(e){var t=[],r,s,i;for(var n=0,o=e.length;n<o;++n){r=e[n];if(n>0){s=this.optionFor(e[n-1])}if(r==="--"){t=t.concat(e.slice(n));break}else if(s&&s.required){t.push(r)}else if(r.length>1&&r[0]==="-"&&r[1]!=="-"){r.slice(1).split("").forEach((function(e){t.push("-"+e)}))}else if(/^--/.test(r)&&~(i=r.indexOf("="))){t.push(r.slice(0,i),r.slice(i+1))}else{t.push(r)}}return t};Command.prototype.parseArgs=function(e,t){var r;if(e.length){r=e[0];if(this.listeners("command:"+r).length){this.emit("command:"+e.shift(),e,t)}else{this.emit("command:*",e)}}else{outputHelpIfNecessary(this,t);if(t.length>0){this.unknownOption(t[0])}if(this.commands.length===0&&this._args.filter((function(e){return e.required})).length===0){this.emit("command:*")}}return this};Command.prototype.optionFor=function(e){for(var t=0,r=this.options.length;t<r;++t){if(this.options[t].is(e)){return this.options[t]}}};Command.prototype.parseOptions=function(e){var t=[],r=e.length,s,i,n;var o=[];for(var a=0;a<r;++a){n=e[a];if(s){t.push(n);continue}if(n==="--"){s=true;continue}i=this.optionFor(n);if(i){if(i.required){n=e[++a];if(n==null)return this.optionMissingArgument(i);this.emit("option:"+i.name(),n)}else if(i.optional){n=e[a+1];if(n==null||n[0]==="-"&&n!=="-"){n=null}else{++a}this.emit("option:"+i.name(),n)}else{this.emit("option:"+i.name())}continue}if(n.length>1&&n[0]==="-"){o.push(n);if(a+1<e.length&&e[a+1][0]!=="-"){o.push(e[++a])}continue}t.push(n)}return{args:t,unknown:o}};Command.prototype.opts=function(){var e={},t=this.options.length;for(var r=0;r<t;r++){var s=this.options[r].attributeName();e[s]=s===this._versionOptionName?this._version:this[s]}return e};Command.prototype.missingArgument=function(e){console.error("error: missing required argument `%s'",e);process.exit(1)};Command.prototype.optionMissingArgument=function(e,t){if(t){console.error("error: option `%s' argument missing, got `%s'",e.flags,t)}else{console.error("error: option `%s' argument missing",e.flags)}process.exit(1)};Command.prototype.unknownOption=function(e){if(this._allowUnknownOption)return;console.error("error: unknown option `%s'",e);process.exit(1)};Command.prototype.variadicArgNotLast=function(e){console.error("error: variadic arguments must be last `%s'",e);process.exit(1)};Command.prototype.version=function(e,t){if(arguments.length===0)return this._version;this._version=e;t=t||"-V, --version";var r=new Option(t,"output the version number");this._versionOptionName=r.long.substr(2)||"version";this.options.push(r);this.on("option:"+this._versionOptionName,(function(){process.stdout.write(e+"\n");process.exit(0)}));return this};Command.prototype.description=function(e,t){if(arguments.length===0)return this._description;this._description=e;this._argsDescription=t;return this};Command.prototype.alias=function(e){var t=this;if(this.commands.length!==0){t=this.commands[this.commands.length-1]}if(arguments.length===0)return t._alias;if(e===t._name)throw new Error("Command alias can't be the same as its name");t._alias=e;return this};Command.prototype.usage=function(e){var t=this._args.map((function(e){return humanReadableArgName(e)}));var r="[options]"+(this.commands.length?" [command]":"")+(this._args.length?" "+t.join(" "):"");if(arguments.length===0)return this._usage||r;this._usage=e;return this};Command.prototype.name=function(e){if(arguments.length===0)return this._name;this._name=e;return this};Command.prototype.prepareCommands=function(){return this.commands.filter((function(e){return!e._noHelp})).map((function(e){var t=e._args.map((function(e){return humanReadableArgName(e)})).join(" ");return[e._name+(e._alias?"|"+e._alias:"")+(e.options.length?" [options]":"")+(t?" "+t:""),e._description]}))};Command.prototype.largestCommandLength=function(){var e=this.prepareCommands();return e.reduce((function(e,t){return Math.max(e,t[0].length)}),0)};Command.prototype.largestOptionLength=function(){var e=[].slice.call(this.options);e.push({flags:"-h, --help"});return e.reduce((function(e,t){return Math.max(e,t.flags.length)}),0)};Command.prototype.largestArgLength=function(){return this._args.reduce((function(e,t){return Math.max(e,t.name.length)}),0)};Command.prototype.padWidth=function(){var e=this.largestOptionLength();if(this._argsDescription&&this._args.length){if(this.largestArgLength()>e){e=this.largestArgLength()}}if(this.commands&&this.commands.length){if(this.largestCommandLength()>e){e=this.largestCommandLength()}}return e};Command.prototype.optionHelp=function(){var e=this.padWidth();return this.options.map((function(t){return pad(t.flags,e)+" "+t.description+(t.bool&&t.defaultValue!==undefined?" (default: "+JSON.stringify(t.defaultValue)+")":"")})).concat([pad("-h, --help",e)+" "+"output usage information"]).join("\n")};Command.prototype.commandHelp=function(){if(!this.commands.length)return"";var e=this.prepareCommands();var t=this.padWidth();return["Commands:",e.map((function(e){var r=e[1]?" "+e[1]:"";return(r?pad(e[0],t):e[0])+r})).join("\n").replace(/^/gm," "),""].join("\n")};Command.prototype.helpInformation=function(){var e=[];if(this._description){e=[this._description,""];var t=this._argsDescription;if(t&&this._args.length){var r=this.padWidth();e.push("Arguments:");e.push("");this._args.forEach((function(s){e.push(" "+pad(s.name,r)+" "+t[s.name])}));e.push("")}}var s=this._name;if(this._alias){s=s+"|"+this._alias}var i=["Usage: "+s+" "+this.usage(),""];var n=[];var o=this.commandHelp();if(o)n=[o];var a=["Options:",""+this.optionHelp().replace(/^/gm," "),""];return i.concat(e).concat(a).concat(n).join("\n")};Command.prototype.outputHelp=function(e){if(!e){e=function(e){return e}}process.stdout.write(e(this.helpInformation()));this.emit("--help")};Command.prototype.help=function(e){this.outputHelp(e);process.exit()};function camelcase(e){return e.split("-").reduce((function(e,t){return e+t[0].toUpperCase()+t.slice(1)}))}function pad(e,t){var r=Math.max(0,t-e.length);return e+Array(r+1).join(" ")}function outputHelpIfNecessary(e,t){t=t||[];for(var r=0;r<t.length;r++){if(t[r]==="--help"||t[r]==="-h"){e.outputHelp();process.exit(0)}}}function humanReadableArgName(e){var t=e.name+(e.variadic===true?"...":"");return e.required?"<"+t+">":"["+t+"]"}function exists(e){try{if(l.statSync(e).isFile()){return true}}catch(e){return false}}},6891:e=>{e.exports=function(e,r){var s=[];for(var i=0;i<e.length;i++){var n=r(e[i],i);if(t(n))s.push.apply(s,n);else s.push(n)}return s};var t=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}},2391:(e,t,r)=>{"use strict";const{pipeline:s,PassThrough:i}=r(2781);const n=r(9796);const o=r(2610);const decompressResponse=e=>{const t=(e.headers["content-encoding"]||"").toLowerCase();if(!["gzip","deflate","br"].includes(t)){return e}const r=t==="br";if(r&&typeof n.createBrotliDecompress!=="function"){return e}const a=r?n.createBrotliDecompress():n.createUnzip();const l=new i;a.on("error",(e=>{if(e.code==="Z_BUF_ERROR"){l.end();return}l.emit("error",e)}));const h=s(e,a,l,(()=>{}));o(e,h);return h};e.exports=decompressResponse},6214:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});function isTLSSocket(e){return e.encrypted}const deferToConnect=(e,t)=>{let r;if(typeof t==="function"){const e=t;r={connect:e}}else{r=t}const s=typeof r.connect==="function";const i=typeof r.secureConnect==="function";const n=typeof r.close==="function";const onConnect=()=>{if(s){r.connect()}if(isTLSSocket(e)&&i){if(e.authorized){r.secureConnect()}else if(!e.authorizationError){e.once("secureConnect",r.secureConnect)}}if(n){e.once("close",r.close)}};if(e.writable&&!e.connecting){onConnect()}else if(e.connecting){e.once("connect",onConnect)}else if(e.destroyed&&n){r.close(e._hadError)}};t["default"]=deferToConnect;e.exports=deferToConnect;e.exports["default"]=deferToConnect},7994:(e,t,r)=>{"use strict";var s=r(2781);function DuplexWrapper(e,t,r){if(typeof r==="undefined"){r=t;t=e;e=null}s.Duplex.call(this,e);if(typeof r.read!=="function"){r=new s.Readable(e).wrap(r)}this._writable=t;this._readable=r;this._waiting=false;var i=this;t.once("finish",(function(){i.end()}));this.once("finish",(function(){t.end()}));r.on("readable",(function(){if(i._waiting){i._waiting=false;i._read()}}));r.once("end",(function(){i.push(null)}));if(!e||typeof e.bubbleErrors==="undefined"||e.bubbleErrors){t.on("error",(function(e){i.emit("error",e)}));r.on("error",(function(e){i.emit("error",e)}))}}DuplexWrapper.prototype=Object.create(s.Duplex.prototype,{constructor:{value:DuplexWrapper}});DuplexWrapper.prototype._write=function _write(e,t,r){this._writable.write(e,t,r)};DuplexWrapper.prototype._read=function _read(){var e;var t=0;while((e=this._readable.read())!==null){this.push(e);t++}if(t===0){this._waiting=true}};e.exports=function duplex2(e,t,r){return new DuplexWrapper(e,t,r)};e.exports.DuplexWrapper=DuplexWrapper},1205:(e,t,r)=>{var s=r(1223);var noop=function(){};var isRequest=function(e){return e.setHeader&&typeof e.abort==="function"};var isChildProcess=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3};var eos=function(e,t,r){if(typeof t==="function")return eos(e,null,t);if(!t)t={};r=s(r||noop);var i=e._writableState;var n=e._readableState;var o=t.readable||t.readable!==false&&e.readable;var a=t.writable||t.writable!==false&&e.writable;var l=false;var onlegacyfinish=function(){if(!e.writable)onfinish()};var onfinish=function(){a=false;if(!o)r.call(e)};var onend=function(){o=false;if(!a)r.call(e)};var onexit=function(t){r.call(e,t?new Error("exited with error code: "+t):null)};var onerror=function(t){r.call(e,t)};var onclose=function(){process.nextTick(onclosenexttick)};var onclosenexttick=function(){if(l)return;if(o&&!(n&&(n.ended&&!n.destroyed)))return r.call(e,new Error("premature close"));if(a&&!(i&&(i.ended&&!i.destroyed)))return r.call(e,new Error("premature close"))};var onrequest=function(){e.req.on("finish",onfinish)};if(isRequest(e)){e.on("complete",onfinish);e.on("abort",onclose);if(e.req)onrequest();else e.on("request",onrequest)}else if(a&&!i){e.on("end",onlegacyfinish);e.on("close",onlegacyfinish)}if(isChildProcess(e))e.on("exit",onexit);e.on("end",onend);e.on("finish",onfinish);if(t.error!==false)e.on("error",onerror);e.on("close",onclose);return function(){l=true;e.removeListener("complete",onfinish);e.removeListener("abort",onclose);e.removeListener("request",onrequest);if(e.req)e.req.removeListener("finish",onfinish);e.removeListener("end",onlegacyfinish);e.removeListener("close",onlegacyfinish);e.removeListener("finish",onfinish);e.removeListener("exit",onexit);e.removeListener("end",onend);e.removeListener("error",onerror);e.removeListener("close",onclose)}};e.exports=eos},8691:e=>{"use strict";var t=/[|\\{}()[\]^$+*?.]/g;e.exports=function(e){if(typeof e!=="string"){throw new TypeError("Expected a string")}return e.replace(t,"\\$&")}},7714:(e,t,r)=>{"use strict";const s=r(1077);const i=r(2361).EventEmitter;const n=r(7147);const o=process.binding("fs");const a=o.writeBuffers;const l=o.FSReqWrap||o.FSReqCallback;const h=Symbol("_autoClose");const c=Symbol("_close");const u=Symbol("_ended");const d=Symbol("_fd");const p=Symbol("_finished");const m=Symbol("_flags");const g=Symbol("_flush");const y=Symbol("_handleChunk");const b=Symbol("_makeBuf");const v=Symbol("_mode");const w=Symbol("_needDrain");const _=Symbol("_onerror");const E=Symbol("_onopen");const S=Symbol("_onread");const x=Symbol("_onwrite");const O=Symbol("_open");const k=Symbol("_path");const R=Symbol("_pos");const T=Symbol("_queue");const C=Symbol("_read");const P=Symbol("_readSize");const M=Symbol("_reading");const A=Symbol("_remain");const I=Symbol("_size");const j=Symbol("_write");const L=Symbol("_writing");const D=Symbol("_defaultFlag");class ReadStream extends s{constructor(e,t){t=t||{};super(t);this.writable=false;if(typeof e!=="string")throw new TypeError("path must be a string");this[d]=typeof t.fd==="number"?t.fd:null;this[k]=e;this[P]=t.readSize||16*1024*1024;this[M]=false;this[I]=typeof t.size==="number"?t.size:Infinity;this[A]=this[I];this[h]=typeof t.autoClose==="boolean"?t.autoClose:true;if(typeof this[d]==="number")this[C]();else this[O]()}get fd(){return this[d]}get path(){return this[k]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[O](){n.open(this[k],"r",((e,t)=>this[E](e,t)))}[E](e,t){if(e)this[_](e);else{this[d]=t;this.emit("open",t);this[C]()}}[b](){return Buffer.allocUnsafe(Math.min(this[P],this[A]))}[C](){if(!this[M]){this[M]=true;const e=this[b]();if(e.length===0)return process.nextTick((()=>this[S](null,0,e)));n.read(this[d],e,0,e.length,null,((e,t,r)=>this[S](e,t,r)))}}[S](e,t,r){this[M]=false;if(e)this[_](e);else if(this[y](t,r))this[C]()}[c](){if(this[h]&&typeof this[d]==="number"){n.close(this[d],(e=>this.emit("close")));this[d]=null}}[_](e){this[M]=true;this[c]();this.emit("error",e)}[y](e,t){let r=false;this[A]-=e;if(e>0)r=super.write(e<t.length?t.slice(0,e):t);if(e===0||this[A]<=0){r=false;this[c]();super.end()}return r}emit(e,t){switch(e){case"prefinish":case"finish":break;case"drain":if(typeof this[d]==="number")this[C]();break;default:return super.emit(e,t)}}}class ReadStreamSync extends ReadStream{[O](){let e=true;try{this[E](null,n.openSync(this[k],"r"));e=false}finally{if(e)this[c]()}}[C](){let e=true;try{if(!this[M]){this[M]=true;do{const e=this[b]();const t=e.length===0?0:n.readSync(this[d],e,0,e.length,null);if(!this[y](t,e))break}while(true);this[M]=false}e=false}finally{if(e)this[c]()}}[c](){if(this[h]&&typeof this[d]==="number"){try{n.closeSync(this[d])}catch(e){}this[d]=null;this.emit("close")}}}class WriteStream extends i{constructor(e,t){t=t||{};super(t);this.readable=false;this[L]=false;this[u]=false;this[w]=false;this[T]=[];this[k]=e;this[d]=typeof t.fd==="number"?t.fd:null;this[v]=t.mode===undefined?438:t.mode;this[R]=typeof t.start==="number"?t.start:null;this[h]=typeof t.autoClose==="boolean"?t.autoClose:true;const r=this[R]!==null?"r+":"w";this[D]=t.flags===undefined;this[m]=this[D]?r:t.flags;if(this[d]===null)this[O]()}get fd(){return this[d]}get path(){return this[k]}[_](e){this[c]();this[L]=true;this.emit("error",e)}[O](){n.open(this[k],this[m],this[v],((e,t)=>this[E](e,t)))}[E](e,t){if(this[D]&&this[m]==="r+"&&e&&e.code==="ENOENT"){this[m]="w";this[O]()}else if(e)this[_](e);else{this[d]=t;this.emit("open",t);this[g]()}}end(e,t){if(e)this.write(e,t);this[u]=true;if(!this[L]&&!this[T].length&&typeof this[d]==="number")this[x](null,0)}write(e,t){if(typeof e==="string")e=new Buffer(e,t);if(this[u]){this.emit("error",new Error("write() after end()"));return false}if(this[d]===null||this[L]||this[T].length){this[T].push(e);this[w]=true;return false}this[L]=true;this[j](e);return true}[j](e){n.write(this[d],e,0,e.length,this[R],((e,t)=>this[x](e,t)))}[x](e,t){if(e)this[_](e);else{if(this[R]!==null)this[R]+=t;if(this[T].length)this[g]();else{this[L]=false;if(this[u]&&!this[p]){this[p]=true;this[c]();this.emit("finish")}else if(this[w]){this[w]=false;this.emit("drain")}}}}[g](){if(this[T].length===0){if(this[u])this[x](null,0)}else if(this[T].length===1)this[j](this[T].pop());else{const e=this[T];this[T]=[];writev(this[d],e,this[R],((e,t)=>this[x](e,t)))}}[c](){if(this[h]&&typeof this[d]==="number"){n.close(this[d],(e=>this.emit("close")));this[d]=null}}}class WriteStreamSync extends WriteStream{[O](){let e;try{e=n.openSync(this[k],this[m],this[v])}catch(e){if(this[D]&&this[m]==="r+"&&e&&e.code==="ENOENT"){this[m]="w";return this[O]()}else throw e}this[E](null,e)}[c](){if(this[h]&&typeof this[d]==="number"){try{n.closeSync(this[d])}catch(e){}this[d]=null;this.emit("close")}}[j](e){try{this[x](null,n.writeSync(this[d],e,0,e.length,this[R]))}catch(e){this[x](e,0)}}}const writev=(e,t,r,s)=>{const done=(e,r)=>s(e,r,t);const i=new l;i.oncomplete=done;o.writeBuffers(e,t,r,i)};t.ReadStream=ReadStream;t.ReadStreamSync=ReadStreamSync;t.WriteStream=WriteStream;t.WriteStreamSync=WriteStreamSync},6863:(e,t,r)=>{e.exports=realpath;realpath.realpath=realpath;realpath.sync=realpathSync;realpath.realpathSync=realpathSync;realpath.monkeypatch=monkeypatch;realpath.unmonkeypatch=unmonkeypatch;var s=r(7147);var i=s.realpath;var n=s.realpathSync;var o=process.version;var a=/^v[0-5]\./.test(o);var l=r(1734);function newError(e){return e&&e.syscall==="realpath"&&(e.code==="ELOOP"||e.code==="ENOMEM"||e.code==="ENAMETOOLONG")}function realpath(e,t,r){if(a){return i(e,t,r)}if(typeof t==="function"){r=t;t=null}i(e,t,(function(s,i){if(newError(s)){l.realpath(e,t,r)}else{r(s,i)}}))}function realpathSync(e,t){if(a){return n(e,t)}try{return n(e,t)}catch(r){if(newError(r)){return l.realpathSync(e,t)}else{throw r}}}function monkeypatch(){s.realpath=realpath;s.realpathSync=realpathSync}function unmonkeypatch(){s.realpath=i;s.realpathSync=n}},1734:(e,t,r)=>{var s=r(1017);var i=process.platform==="win32";var n=r(7147);var o=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);function rethrow(){var e;if(o){var t=new Error;e=debugCallback}else e=missingCallback;return e;function debugCallback(e){if(e){t.message=e.message;e=t;missingCallback(e)}}function missingCallback(e){if(e){if(process.throwDeprecation)throw e;else if(!process.noDeprecation){var t="fs: missing callback "+(e.stack||e.message);if(process.traceDeprecation)console.trace(t);else console.error(t)}}}}function maybeCallback(e){return typeof e==="function"?e:rethrow()}var a=s.normalize;if(i){var l=/(.*?)(?:[\/\\]+|$)/g}else{var l=/(.*?)(?:[\/]+|$)/g}if(i){var h=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/}else{var h=/^[\/]*/}t.realpathSync=function realpathSync(e,t){e=s.resolve(e);if(t&&Object.prototype.hasOwnProperty.call(t,e)){return t[e]}var r=e,o={},a={};var c;var u;var d;var p;start();function start(){var t=h.exec(e);c=t[0].length;u=t[0];d=t[0];p="";if(i&&!a[d]){n.lstatSync(d);a[d]=true}}while(c<e.length){l.lastIndex=c;var m=l.exec(e);p=u;u+=m[0];d=p+m[1];c=l.lastIndex;if(a[d]||t&&t[d]===d){continue}var g;if(t&&Object.prototype.hasOwnProperty.call(t,d)){g=t[d]}else{var y=n.lstatSync(d);if(!y.isSymbolicLink()){a[d]=true;if(t)t[d]=d;continue}var b=null;if(!i){var v=y.dev.toString(32)+":"+y.ino.toString(32);if(o.hasOwnProperty(v)){b=o[v]}}if(b===null){n.statSync(d);b=n.readlinkSync(d)}g=s.resolve(p,b);if(t)t[d]=g;if(!i)o[v]=b}e=s.resolve(g,e.slice(c));start()}if(t)t[r]=e;return e};t.realpath=function realpath(e,t,r){if(typeof r!=="function"){r=maybeCallback(t);t=null}e=s.resolve(e);if(t&&Object.prototype.hasOwnProperty.call(t,e)){return process.nextTick(r.bind(null,null,t[e]))}var o=e,a={},c={};var u;var d;var p;var m;start();function start(){var t=h.exec(e);u=t[0].length;d=t[0];p=t[0];m="";if(i&&!c[p]){n.lstat(p,(function(e){if(e)return r(e);c[p]=true;LOOP()}))}else{process.nextTick(LOOP)}}function LOOP(){if(u>=e.length){if(t)t[o]=e;return r(null,e)}l.lastIndex=u;var s=l.exec(e);m=d;d+=s[0];p=m+s[1];u=l.lastIndex;if(c[p]||t&&t[p]===p){return process.nextTick(LOOP)}if(t&&Object.prototype.hasOwnProperty.call(t,p)){return gotResolvedLink(t[p])}return n.lstat(p,gotStat)}function gotStat(e,s){if(e)return r(e);if(!s.isSymbolicLink()){c[p]=true;if(t)t[p]=p;return process.nextTick(LOOP)}if(!i){var o=s.dev.toString(32)+":"+s.ino.toString(32);if(a.hasOwnProperty(o)){return gotTarget(null,a[o],p)}}n.stat(p,(function(e){if(e)return r(e);n.readlink(p,(function(e,t){if(!i)a[o]=t;gotTarget(e,t)}))}))}function gotTarget(e,i,n){if(e)return r(e);var o=s.resolve(m,i);if(t)t[n]=o;gotResolvedLink(o)}function gotResolvedLink(t){e=s.resolve(t,e.slice(u));start()}}},1585:(e,t,r)=>{"use strict";const{PassThrough:s}=r(2781);e.exports=e=>{e={...e};const{array:t}=e;let{encoding:r}=e;const i=r==="buffer";let n=false;if(t){n=!(r||i)}else{r=r||"utf8"}if(i){r=null}const o=new s({objectMode:n});if(r){o.setEncoding(r)}let a=0;const l=[];o.on("data",(e=>{l.push(e);if(n){a=l.length}else{a+=e.length}}));o.getBufferedValue=()=>{if(t){return l}return i?Buffer.concat(l,a):l.join("")};o.getBufferedLength=()=>a;return o}},1766:(e,t,r)=>{"use strict";const{constants:s}=r(4300);const i=r(8341);const n=r(1585);class MaxBufferError extends Error{constructor(){super("maxBuffer exceeded");this.name="MaxBufferError"}}async function getStream(e,t){if(!e){return Promise.reject(new Error("Expected a stream"))}t={maxBuffer:Infinity,...t};const{maxBuffer:r}=t;let o;await new Promise(((a,l)=>{const rejectPromise=e=>{if(e&&o.getBufferedLength()<=s.MAX_LENGTH){e.bufferedData=o.getBufferedValue()}l(e)};o=i(e,n(t),(e=>{if(e){rejectPromise(e);return}a()}));o.on("data",(()=>{if(o.getBufferedLength()>r){rejectPromise(new MaxBufferError)}}))}));return o.getBufferedValue()}e.exports=getStream;e.exports["default"]=getStream;e.exports.buffer=(e,t)=>getStream(e,{...t,encoding:"buffer"});e.exports.array=(e,t)=>getStream(e,{...t,array:true});e.exports.MaxBufferError=MaxBufferError},7625:(e,t,r)=>{t.setopts=setopts;t.ownProp=ownProp;t.makeAbs=makeAbs;t.finish=finish;t.mark=mark;t.isIgnored=isIgnored;t.childrenIgnored=childrenIgnored;function ownProp(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var s=r(7147);var i=r(1017);var n=r(3973);var o=r(8714);var a=n.Minimatch;function alphasort(e,t){return e.localeCompare(t,"en")}function setupIgnores(e,t){e.ignore=t.ignore||[];if(!Array.isArray(e.ignore))e.ignore=[e.ignore];if(e.ignore.length){e.ignore=e.ignore.map(ignoreMap)}}function ignoreMap(e){var t=null;if(e.slice(-3)==="/**"){var r=e.replace(/(\/\*\*)+$/,"");t=new a(r,{dot:true})}return{matcher:new a(e,{dot:true}),gmatcher:t}}function setopts(e,t,r){if(!r)r={};if(r.matchBase&&-1===t.indexOf("/")){if(r.noglobstar){throw new Error("base matching requires globstar")}t="**/"+t}e.silent=!!r.silent;e.pattern=t;e.strict=r.strict!==false;e.realpath=!!r.realpath;e.realpathCache=r.realpathCache||Object.create(null);e.follow=!!r.follow;e.dot=!!r.dot;e.mark=!!r.mark;e.nodir=!!r.nodir;if(e.nodir)e.mark=true;e.sync=!!r.sync;e.nounique=!!r.nounique;e.nonull=!!r.nonull;e.nosort=!!r.nosort;e.nocase=!!r.nocase;e.stat=!!r.stat;e.noprocess=!!r.noprocess;e.absolute=!!r.absolute;e.fs=r.fs||s;e.maxLength=r.maxLength||Infinity;e.cache=r.cache||Object.create(null);e.statCache=r.statCache||Object.create(null);e.symlinks=r.symlinks||Object.create(null);setupIgnores(e,r);e.changedCwd=false;var n=process.cwd();if(!ownProp(r,"cwd"))e.cwd=n;else{e.cwd=i.resolve(r.cwd);e.changedCwd=e.cwd!==n}e.root=r.root||i.resolve(e.cwd,"/");e.root=i.resolve(e.root);if(process.platform==="win32")e.root=e.root.replace(/\\/g,"/");e.cwdAbs=o(e.cwd)?e.cwd:makeAbs(e,e.cwd);if(process.platform==="win32")e.cwdAbs=e.cwdAbs.replace(/\\/g,"/");e.nomount=!!r.nomount;r.nonegate=true;r.nocomment=true;e.minimatch=new a(t,r);e.options=e.minimatch.options}function finish(e){var t=e.nounique;var r=t?[]:Object.create(null);for(var s=0,i=e.matches.length;s<i;s++){var n=e.matches[s];if(!n||Object.keys(n).length===0){if(e.nonull){var o=e.minimatch.globSet[s];if(t)r.push(o);else r[o]=true}}else{var a=Object.keys(n);if(t)r.push.apply(r,a);else a.forEach((function(e){r[e]=true}))}}if(!t)r=Object.keys(r);if(!e.nosort)r=r.sort(alphasort);if(e.mark){for(var s=0;s<r.length;s++){r[s]=e._mark(r[s])}if(e.nodir){r=r.filter((function(t){var r=!/\/$/.test(t);var s=e.cache[t]||e.cache[makeAbs(e,t)];if(r&&s)r=s!=="DIR"&&!Array.isArray(s);return r}))}}if(e.ignore.length)r=r.filter((function(t){return!isIgnored(e,t)}));e.found=r}function mark(e,t){var r=makeAbs(e,t);var s=e.cache[r];var i=t;if(s){var n=s==="DIR"||Array.isArray(s);var o=t.slice(-1)==="/";if(n&&!o)i+="/";else if(!n&&o)i=i.slice(0,-1);if(i!==t){var a=makeAbs(e,i);e.statCache[a]=e.statCache[r];e.cache[a]=e.cache[r]}}return i}function makeAbs(e,t){var r=t;if(t.charAt(0)==="/"){r=i.join(e.root,t)}else if(o(t)||t===""){r=t}else if(e.changedCwd){r=i.resolve(e.cwd,t)}else{r=i.resolve(t)}if(process.platform==="win32")r=r.replace(/\\/g,"/");return r}function isIgnored(e,t){if(!e.ignore.length)return false;return e.ignore.some((function(e){return e.matcher.match(t)||!!(e.gmatcher&&e.gmatcher.match(t))}))}function childrenIgnored(e,t){if(!e.ignore.length)return false;return e.ignore.some((function(e){return!!(e.gmatcher&&e.gmatcher.match(t))}))}},1957:(e,t,r)=>{e.exports=glob;var s=r(6863);var i=r(3973);var n=i.Minimatch;var o=r(4124);var a=r(2361).EventEmitter;var l=r(1017);var h=r(9491);var c=r(8714);var u=r(9010);var d=r(7625);var p=d.setopts;var m=d.ownProp;var g=r(2492);var y=r(3837);var b=d.childrenIgnored;var v=d.isIgnored;var w=r(1223);function glob(e,t,r){if(typeof t==="function")r=t,t={};if(!t)t={};if(t.sync){if(r)throw new TypeError("callback provided to sync glob");return u(e,t)}return new Glob(e,t,r)}glob.sync=u;var _=glob.GlobSync=u.GlobSync;glob.glob=glob;function extend(e,t){if(t===null||typeof t!=="object"){return e}var r=Object.keys(t);var s=r.length;while(s--){e[r[s]]=t[r[s]]}return e}glob.hasMagic=function(e,t){var r=extend({},t);r.noprocess=true;var s=new Glob(e,r);var i=s.minimatch.set;if(!e)return false;if(i.length>1)return true;for(var n=0;n<i[0].length;n++){if(typeof i[0][n]!=="string")return true}return false};glob.Glob=Glob;o(Glob,a);function Glob(e,t,r){if(typeof t==="function"){r=t;t=null}if(t&&t.sync){if(r)throw new TypeError("callback provided to sync glob");return new _(e,t)}if(!(this instanceof Glob))return new Glob(e,t,r);p(this,e,t);this._didRealPath=false;var s=this.minimatch.set.length;this.matches=new Array(s);if(typeof r==="function"){r=w(r);this.on("error",r);this.on("end",(function(e){r(null,e)}))}var i=this;this._processing=0;this._emitQueue=[];this._processQueue=[];this.paused=false;if(this.noprocess)return this;if(s===0)return done();var n=true;for(var o=0;o<s;o++){this._process(this.minimatch.set[o],o,false,done)}n=false;function done(){--i._processing;if(i._processing<=0){if(n){process.nextTick((function(){i._finish()}))}else{i._finish()}}}}Glob.prototype._finish=function(){h(this instanceof Glob);if(this.aborted)return;if(this.realpath&&!this._didRealpath)return this._realpath();d.finish(this);this.emit("end",this.found)};Glob.prototype._realpath=function(){if(this._didRealpath)return;this._didRealpath=true;var e=this.matches.length;if(e===0)return this._finish();var t=this;for(var r=0;r<this.matches.length;r++)this._realpathSet(r,next);function next(){if(--e===0)t._finish()}};Glob.prototype._realpathSet=function(e,t){var r=this.matches[e];if(!r)return t();var i=Object.keys(r);var n=this;var o=i.length;if(o===0)return t();var a=this.matches[e]=Object.create(null);i.forEach((function(r,i){r=n._makeAbs(r);s.realpath(r,n.realpathCache,(function(s,i){if(!s)a[i]=true;else if(s.syscall==="stat")a[r]=true;else n.emit("error",s);if(--o===0){n.matches[e]=a;t()}}))}))};Glob.prototype._mark=function(e){return d.mark(this,e)};Glob.prototype._makeAbs=function(e){return d.makeAbs(this,e)};Glob.prototype.abort=function(){this.aborted=true;this.emit("abort")};Glob.prototype.pause=function(){if(!this.paused){this.paused=true;this.emit("pause")}};Glob.prototype.resume=function(){if(this.paused){this.emit("resume");this.paused=false;if(this._emitQueue.length){var e=this._emitQueue.slice(0);this._emitQueue.length=0;for(var t=0;t<e.length;t++){var r=e[t];this._emitMatch(r[0],r[1])}}if(this._processQueue.length){var s=this._processQueue.slice(0);this._processQueue.length=0;for(var t=0;t<s.length;t++){var i=s[t];this._processing--;this._process(i[0],i[1],i[2],i[3])}}}};Glob.prototype._process=function(e,t,r,s){h(this instanceof Glob);h(typeof s==="function");if(this.aborted)return;this._processing++;if(this.paused){this._processQueue.push([e,t,r,s]);return}var n=0;while(typeof e[n]==="string"){n++}var o;switch(n){case e.length:this._processSimple(e.join("/"),t,s);return;case 0:o=null;break;default:o=e.slice(0,n).join("/");break}var a=e.slice(n);var l;if(o===null)l=".";else if(c(o)||c(e.join("/"))){if(!o||!c(o))o="/"+o;l=o}else l=o;var u=this._makeAbs(l);if(b(this,l))return s();var d=a[0]===i.GLOBSTAR;if(d)this._processGlobStar(o,l,u,a,t,r,s);else this._processReaddir(o,l,u,a,t,r,s)};Glob.prototype._processReaddir=function(e,t,r,s,i,n,o){var a=this;this._readdir(r,n,(function(l,h){return a._processReaddir2(e,t,r,s,i,n,h,o)}))};Glob.prototype._processReaddir2=function(e,t,r,s,i,n,o,a){if(!o)return a();var h=s[0];var c=!!this.minimatch.negate;var u=h._glob;var d=this.dot||u.charAt(0)===".";var p=[];for(var m=0;m<o.length;m++){var g=o[m];if(g.charAt(0)!=="."||d){var y;if(c&&!e){y=!g.match(h)}else{y=g.match(h)}if(y)p.push(g)}}var b=p.length;if(b===0)return a();if(s.length===1&&!this.mark&&!this.stat){if(!this.matches[i])this.matches[i]=Object.create(null);for(var m=0;m<b;m++){var g=p[m];if(e){if(e!=="/")g=e+"/"+g;else g=e+g}if(g.charAt(0)==="/"&&!this.nomount){g=l.join(this.root,g)}this._emitMatch(i,g)}return a()}s.shift();for(var m=0;m<b;m++){var g=p[m];var v;if(e){if(e!=="/")g=e+"/"+g;else g=e+g}this._process([g].concat(s),i,n,a)}a()};Glob.prototype._emitMatch=function(e,t){if(this.aborted)return;if(v(this,t))return;if(this.paused){this._emitQueue.push([e,t]);return}var r=c(t)?t:this._makeAbs(t);if(this.mark)t=this._mark(t);if(this.absolute)t=r;if(this.matches[e][t])return;if(this.nodir){var s=this.cache[r];if(s==="DIR"||Array.isArray(s))return}this.matches[e][t]=true;var i=this.statCache[r];if(i)this.emit("stat",t,i);this.emit("match",t)};Glob.prototype._readdirInGlobStar=function(e,t){if(this.aborted)return;if(this.follow)return this._readdir(e,false,t);var r="lstat\0"+e;var s=this;var i=g(r,lstatcb_);if(i)s.fs.lstat(e,i);function lstatcb_(r,i){if(r&&r.code==="ENOENT")return t();var n=i&&i.isSymbolicLink();s.symlinks[e]=n;if(!n&&i&&!i.isDirectory()){s.cache[e]="FILE";t()}else s._readdir(e,false,t)}};Glob.prototype._readdir=function(e,t,r){if(this.aborted)return;r=g("readdir\0"+e+"\0"+t,r);if(!r)return;if(t&&!m(this.symlinks,e))return this._readdirInGlobStar(e,r);if(m(this.cache,e)){var s=this.cache[e];if(!s||s==="FILE")return r();if(Array.isArray(s))return r(null,s)}var i=this;i.fs.readdir(e,readdirCb(this,e,r))};function readdirCb(e,t,r){return function(s,i){if(s)e._readdirError(t,s,r);else e._readdirEntries(t,i,r)}}Glob.prototype._readdirEntries=function(e,t,r){if(this.aborted)return;if(!this.mark&&!this.stat){for(var s=0;s<t.length;s++){var i=t[s];if(e==="/")i=e+i;else i=e+"/"+i;this.cache[i]=true}}this.cache[e]=t;return r(null,t)};Glob.prototype._readdirError=function(e,t,r){if(this.aborted)return;switch(t.code){case"ENOTSUP":case"ENOTDIR":var s=this._makeAbs(e);this.cache[s]="FILE";if(s===this.cwdAbs){var i=new Error(t.code+" invalid cwd "+this.cwd);i.path=this.cwd;i.code=t.code;this.emit("error",i);this.abort()}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=false;break;default:this.cache[this._makeAbs(e)]=false;if(this.strict){this.emit("error",t);this.abort()}if(!this.silent)console.error("glob error",t);break}return r()};Glob.prototype._processGlobStar=function(e,t,r,s,i,n,o){var a=this;this._readdir(r,n,(function(l,h){a._processGlobStar2(e,t,r,s,i,n,h,o)}))};Glob.prototype._processGlobStar2=function(e,t,r,s,i,n,o,a){if(!o)return a();var l=s.slice(1);var h=e?[e]:[];var c=h.concat(l);this._process(c,i,false,a);var u=this.symlinks[r];var d=o.length;if(u&&n)return a();for(var p=0;p<d;p++){var m=o[p];if(m.charAt(0)==="."&&!this.dot)continue;var g=h.concat(o[p],l);this._process(g,i,true,a);var y=h.concat(o[p],s);this._process(y,i,true,a)}a()};Glob.prototype._processSimple=function(e,t,r){var s=this;this._stat(e,(function(i,n){s._processSimple2(e,t,i,n,r)}))};Glob.prototype._processSimple2=function(e,t,r,s,i){if(!this.matches[t])this.matches[t]=Object.create(null);if(!s)return i();if(e&&c(e)&&!this.nomount){var n=/[\/\\]$/.test(e);if(e.charAt(0)==="/"){e=l.join(this.root,e)}else{e=l.resolve(this.root,e);if(n)e+="/"}}if(process.platform==="win32")e=e.replace(/\\/g,"/");this._emitMatch(t,e);i()};Glob.prototype._stat=function(e,t){var r=this._makeAbs(e);var s=e.slice(-1)==="/";if(e.length>this.maxLength)return t();if(!this.stat&&m(this.cache,r)){var i=this.cache[r];if(Array.isArray(i))i="DIR";if(!s||i==="DIR")return t(null,i);if(s&&i==="FILE")return t()}var n;var o=this.statCache[r];if(o!==undefined){if(o===false)return t(null,o);else{var a=o.isDirectory()?"DIR":"FILE";if(s&&a==="FILE")return t();else return t(null,a,o)}}var l=this;var h=g("stat\0"+r,lstatcb_);if(h)l.fs.lstat(r,h);function lstatcb_(s,i){if(i&&i.isSymbolicLink()){return l.fs.stat(r,(function(s,n){if(s)l._stat2(e,r,null,i,t);else l._stat2(e,r,s,n,t)}))}else{l._stat2(e,r,s,i,t)}}};Glob.prototype._stat2=function(e,t,r,s,i){if(r&&(r.code==="ENOENT"||r.code==="ENOTDIR")){this.statCache[t]=false;return i()}var n=e.slice(-1)==="/";this.statCache[t]=s;if(t.slice(-1)==="/"&&s&&!s.isDirectory())return i(null,false,s);var o=true;if(s)o=s.isDirectory()?"DIR":"FILE";this.cache[t]=this.cache[t]||o;if(n&&o==="FILE")return i();return i(null,o,s)}},9010:(e,t,r)=>{e.exports=globSync;globSync.GlobSync=GlobSync;var s=r(6863);var i=r(3973);var n=i.Minimatch;var o=r(1957).Glob;var a=r(3837);var l=r(1017);var h=r(9491);var c=r(8714);var u=r(7625);var d=u.setopts;var p=u.ownProp;var m=u.childrenIgnored;var g=u.isIgnored;function globSync(e,t){if(typeof t==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob\n"+"See: https://github.com/isaacs/node-glob/issues/167");return new GlobSync(e,t).found}function GlobSync(e,t){if(!e)throw new Error("must provide pattern");if(typeof t==="function"||arguments.length===3)throw new TypeError("callback provided to sync glob\n"+"See: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof GlobSync))return new GlobSync(e,t);d(this,e,t);if(this.noprocess)return this;var r=this.minimatch.set.length;this.matches=new Array(r);for(var s=0;s<r;s++){this._process(this.minimatch.set[s],s,false)}this._finish()}GlobSync.prototype._finish=function(){h(this instanceof GlobSync);if(this.realpath){var e=this;this.matches.forEach((function(t,r){var i=e.matches[r]=Object.create(null);for(var n in t){try{n=e._makeAbs(n);var o=s.realpathSync(n,e.realpathCache);i[o]=true}catch(t){if(t.syscall==="stat")i[e._makeAbs(n)]=true;else throw t}}}))}u.finish(this)};GlobSync.prototype._process=function(e,t,r){h(this instanceof GlobSync);var s=0;while(typeof e[s]==="string"){s++}var n;switch(s){case e.length:this._processSimple(e.join("/"),t);return;case 0:n=null;break;default:n=e.slice(0,s).join("/");break}var o=e.slice(s);var a;if(n===null)a=".";else if(c(n)||c(e.join("/"))){if(!n||!c(n))n="/"+n;a=n}else a=n;var l=this._makeAbs(a);if(m(this,a))return;var u=o[0]===i.GLOBSTAR;if(u)this._processGlobStar(n,a,l,o,t,r);else this._processReaddir(n,a,l,o,t,r)};GlobSync.prototype._processReaddir=function(e,t,r,s,i,n){var o=this._readdir(r,n);if(!o)return;var a=s[0];var h=!!this.minimatch.negate;var c=a._glob;var u=this.dot||c.charAt(0)===".";var d=[];for(var p=0;p<o.length;p++){var m=o[p];if(m.charAt(0)!=="."||u){var g;if(h&&!e){g=!m.match(a)}else{g=m.match(a)}if(g)d.push(m)}}var y=d.length;if(y===0)return;if(s.length===1&&!this.mark&&!this.stat){if(!this.matches[i])this.matches[i]=Object.create(null);for(var p=0;p<y;p++){var m=d[p];if(e){if(e.slice(-1)!=="/")m=e+"/"+m;else m=e+m}if(m.charAt(0)==="/"&&!this.nomount){m=l.join(this.root,m)}this._emitMatch(i,m)}return}s.shift();for(var p=0;p<y;p++){var m=d[p];var b;if(e)b=[e,m];else b=[m];this._process(b.concat(s),i,n)}};GlobSync.prototype._emitMatch=function(e,t){if(g(this,t))return;var r=this._makeAbs(t);if(this.mark)t=this._mark(t);if(this.absolute){t=r}if(this.matches[e][t])return;if(this.nodir){var s=this.cache[r];if(s==="DIR"||Array.isArray(s))return}this.matches[e][t]=true;if(this.stat)this._stat(t)};GlobSync.prototype._readdirInGlobStar=function(e){if(this.follow)return this._readdir(e,false);var t;var r;var s;try{r=this.fs.lstatSync(e)}catch(e){if(e.code==="ENOENT"){return null}}var i=r&&r.isSymbolicLink();this.symlinks[e]=i;if(!i&&r&&!r.isDirectory())this.cache[e]="FILE";else t=this._readdir(e,false);return t};GlobSync.prototype._readdir=function(e,t){var r;if(t&&!p(this.symlinks,e))return this._readdirInGlobStar(e);if(p(this.cache,e)){var s=this.cache[e];if(!s||s==="FILE")return null;if(Array.isArray(s))return s}try{return this._readdirEntries(e,this.fs.readdirSync(e))}catch(t){this._readdirError(e,t);return null}};GlobSync.prototype._readdirEntries=function(e,t){if(!this.mark&&!this.stat){for(var r=0;r<t.length;r++){var s=t[r];if(e==="/")s=e+s;else s=e+"/"+s;this.cache[s]=true}}this.cache[e]=t;return t};GlobSync.prototype._readdirError=function(e,t){switch(t.code){case"ENOTSUP":case"ENOTDIR":var r=this._makeAbs(e);this.cache[r]="FILE";if(r===this.cwdAbs){var s=new Error(t.code+" invalid cwd "+this.cwd);s.path=this.cwd;s.code=t.code;throw s}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=false;break;default:this.cache[this._makeAbs(e)]=false;if(this.strict)throw t;if(!this.silent)console.error("glob error",t);break}};GlobSync.prototype._processGlobStar=function(e,t,r,s,i,n){var o=this._readdir(r,n);if(!o)return;var a=s.slice(1);var l=e?[e]:[];var h=l.concat(a);this._process(h,i,false);var c=o.length;var u=this.symlinks[r];if(u&&n)return;for(var d=0;d<c;d++){var p=o[d];if(p.charAt(0)==="."&&!this.dot)continue;var m=l.concat(o[d],a);this._process(m,i,true);var g=l.concat(o[d],s);this._process(g,i,true)}};GlobSync.prototype._processSimple=function(e,t){var r=this._stat(e);if(!this.matches[t])this.matches[t]=Object.create(null);if(!r)return;if(e&&c(e)&&!this.nomount){var s=/[\/\\]$/.test(e);if(e.charAt(0)==="/"){e=l.join(this.root,e)}else{e=l.resolve(this.root,e);if(s)e+="/"}}if(process.platform==="win32")e=e.replace(/\\/g,"/");this._emitMatch(t,e)};GlobSync.prototype._stat=function(e){var t=this._makeAbs(e);var r=e.slice(-1)==="/";if(e.length>this.maxLength)return false;if(!this.stat&&p(this.cache,t)){var s=this.cache[t];if(Array.isArray(s))s="DIR";if(!r||s==="DIR")return s;if(r&&s==="FILE")return false}var i;var n=this.statCache[t];if(!n){var o;try{o=this.fs.lstatSync(t)}catch(e){if(e&&(e.code==="ENOENT"||e.code==="ENOTDIR")){this.statCache[t]=false;return false}}if(o&&o.isSymbolicLink()){try{n=this.fs.statSync(t)}catch(e){n=o}}else{n=o}}this.statCache[t]=n;var s=true;if(n)s=n.isDirectory()?"DIR":"FILE";this.cache[t]=this.cache[t]||s;if(r&&s==="FILE")return false;return s};GlobSync.prototype._mark=function(e){return u.mark(this,e)};GlobSync.prototype._makeAbs=function(e){return u.makeAbs(this,e)}},5436:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(2361);const i=r(1766);const n=r(9072);const o=r(7678);const a=r(6312);const l=r(6210);const h=r(1569);const parseBody=(e,t,r)=>{if(t==="json"){return e.length===0?"":JSON.parse(e.toString())}if(t==="buffer"){return Buffer.from(e)}if(t==="text"){return e.toString(r)}throw new TypeError(`Unknown body type '${t}'`)};function createRejection(e){const t=Promise.reject(e);const returnPromise=()=>t;t.json=returnPromise;t.text=returnPromise;t.buffer=returnPromise;t.on=returnPromise;return t}t.createRejection=createRejection;function asPromise(e){const t=new s;let r;const c=new n(((s,n,o)=>{const c=h.default(e);o(c.abort);const emitError=async t=>{try{for(const r of e.hooks.beforeError){t=await r(t)}n(t)}catch(e){n(e)}};c.on("response",(async n=>{var h;t.emit("response",n);try{r=await i.buffer(n,{encoding:"binary"})}catch(t){emitError(new a.ReadError(t,e));return}if((h=n.req)===null||h===void 0?void 0:h.aborted){return}const isOk=()=>{const{statusCode:t}=n;const r=e.followRedirect?299:399;return t>=200&&t<=r||t===304};try{n.body=parseBody(r,e.responseType,e.encoding)}catch(t){n.body=r.toString();if(isOk()){const r=new a.ParseError(t,n,e);emitError(r);return}}try{for(const[t,r]of e.hooks.afterResponse.entries()){n=await r(n,(async r=>{const s=l.normalizeArguments(l.mergeOptions(e,{...r,retry:{calculateDelay:()=>0},throwHttpErrors:false,resolveBodyOnly:false}));s.hooks.afterResponse=e.hooks.afterResponse.slice(0,t);for(const t of e.hooks.beforeRetry){await t(s)}const i=asPromise(s);o((()=>{i.catch((()=>{}));i.cancel()}));return i}))}}catch(e){emitError(e);return}if(!isOk()){const t=new a.HTTPError(n,e);if(c.retry(t)){return}if(e.throwHttpErrors){emitError(t);return}}s(e.resolveBodyOnly?n.body:n)}));c.once("error",n);h.proxyEvents(t,c)}));c.on=(e,r)=>{t.on(e,r);return c};const shortcut=t=>{const s=c.then((()=>parseBody(r,t,e.encoding)));Object.defineProperties(s,Object.getOwnPropertyDescriptors(c));return s};c.json=()=>{if(o.default.undefined(r)&&o.default.undefined(e.headers.accept)){e.headers.accept="application/json"}return shortcut("json")};c.buffer=()=>shortcut("buffer");c.text=()=>shortcut("text");return c}t["default"]=asPromise},4736:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(7994);const i=r(3685);const n=r(2781);const o=r(6312);const a=r(1569);class ProxyStream extends n.Duplex{}t.ProxyStream=ProxyStream;function asStream(e){const t=new n.PassThrough;const r=new n.PassThrough;const l=s(t,r);const h=new Set;let c=false;e.retry.calculateDelay=()=>0;if(e.body||e.json||e.form){l.write=()=>{l.destroy();throw new Error("Got's stream is not writable when the `body`, `json` or `form` option is used")}}else if(e.method==="POST"||e.method==="PUT"||e.method==="PATCH"||e.allowGetBody&&e.method==="GET"){e.body=t}else{l.write=()=>{l.destroy();throw new TypeError(`The \`${e.method}\` method cannot be used with a body`)}}const u=a.default(e);const emitError=async t=>{try{for(const r of e.hooks.beforeError){t=await r(t)}l.emit("error",t)}catch(e){l.emit("error",e)}};l._destroy=(e,t)=>{t(e);u.abort()};u.on("response",(t=>{const{statusCode:s,isFromCache:i}=t;l.isFromCache=i;if(e.throwHttpErrors&&s!==304&&(s<200||s>299)){emitError(new o.HTTPError(t,e));return}{const e=l._read;l._read=(...t)=>{c=true;l._read=e;return e.apply(l,t)}}if(e.encoding){l.setEncoding(e.encoding)}t.pipe(r);t.once("error",(t=>{emitError(new o.ReadError(t,e))}));for(const r of h){if(r.headersSent){continue}for(const[s,i]of Object.entries(t.headers)){const t=e.decompress?s!=="content-encoding":true;if(t){r.setHeader(s,i)}}r.statusCode=t.statusCode}l.emit("response",t)}));a.proxyEvents(l,u);u.on("error",(e=>l.emit("error",e)));const d=l.pipe.bind(l);const p=l.unpipe.bind(l);l.pipe=(e,t)=>{if(c){throw new Error("Failed to pipe. The response has been emitted already.")}d(e,t);if(e instanceof i.ServerResponse){h.add(e)}return e};l.unpipe=e=>{h.delete(e);return p(e)};l.on("pipe",(t=>{if(t instanceof i.IncomingMessage){e.headers={...t.headers,...e.headers}}}));l.isFromCache=undefined;return l}t["default"]=asStream},75:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(7678);const i=r(6312);const n=new Set([413,429,503]);const isErrorWithResponse=e=>e instanceof i.HTTPError||e instanceof i.ParseError||e instanceof i.MaxRedirectsError;const calculateRetryDelay=({attemptCount:e,retryOptions:t,error:r})=>{if(e>t.limit){return 0}const i=t.methods.includes(r.options.method);const o=Reflect.has(r,"code")&&t.errorCodes.includes(r.code);const a=isErrorWithResponse(r)&&t.statusCodes.includes(r.response.statusCode);if(!i||!o&&!a){return 0}if(isErrorWithResponse(r)){const{response:e}=r;if(e&&Reflect.has(e.headers,"retry-after")&&n.has(e.statusCode)){let r=Number(e.headers["retry-after"]);if(s.default.nan(r)){r=Date.parse(e.headers["retry-after"])-Date.now()}else{r*=1e3}if(r>t.maxRetryAfter){return 0}return r}if(e.statusCode===413){return 0}}const l=Math.random()*100;return 2**(e-1)*1e3+l};t["default"]=calculateRetryDelay},4337:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(7678);const i=r(5436);const n=r(4736);const o=r(6312);const a=r(6210);const l=r(285);const getPromiseOrStream=e=>e.isStream?n.default(e):i.default(e);const isGotInstance=e=>Reflect.has(e,"defaults")&&Reflect.has(e.defaults,"options");const h=["get","post","put","patch","head","delete"];t.defaultHandler=(e,t)=>t(e);const create=e=>{e._rawHandlers=e.handlers;e.handlers=e.handlers.map((e=>(t,r)=>{let s;const i=e(t,(e=>{s=r(e);return s}));if(i!==s&&!t.isStream&&s){const e=i;const{then:t,catch:r,finally:n}=e;Object.setPrototypeOf(e,Object.getPrototypeOf(s));Object.defineProperties(e,Object.getOwnPropertyDescriptors(s));e.then=t;e.catch=r;e.finally=n}return i}));const got=(t,r)=>{var s;let n=0;const iterateHandlers=t=>e.handlers[n++](t,n===e.handlers.length?getPromiseOrStream:iterateHandlers);try{return iterateHandlers(a.normalizeArguments(t,r,e))}catch(e){if((s=r)===null||s===void 0?void 0:s.isStream){throw e}else{return i.createRejection(e)}}};got.extend=(...r)=>{const s=[e.options];let i=[...e._rawHandlers];let n;for(const e of r){if(isGotInstance(e)){s.push(e.defaults.options);i.push(...e.defaults._rawHandlers);n=e.defaults.mutableDefaults}else{s.push(e);if(Reflect.has(e,"handlers")){i.push(...e.handlers)}n=e.mutableDefaults}}i=i.filter((e=>e!==t.defaultHandler));if(i.length===0){i.push(t.defaultHandler)}return create({options:a.mergeOptions(...s),handlers:i,mutableDefaults:Boolean(n)})};got.stream=(e,t)=>got(e,{...t,isStream:true});for(const e of h){got[e]=(t,r)=>got(t,{...r,method:e});got.stream[e]=(t,r)=>got.stream(t,{...r,method:e})}got.paginate=async function*(t,r){let i=a.normalizeArguments(t,r,e);const n=i._pagination;if(!s.default.object(n)){throw new Error("`options._pagination` must be implemented")}const o=[];while(true){const e=await got(i);const t=await n.transform(e);const r=[];for(const e of t){if(n.filter(e,o,r)){if(!n.shouldContinue(e,o,r)){return}yield e;o.push(e);r.push(e);if(o.length===n.countLimit){return}}}const s=n.paginate(e,o,r);if(s===false){return}if(s!==undefined){i=a.normalizeArguments(i,s)}}};got.paginate.all=async(e,t)=>{const r=[];for await(const s of got.paginate(e,t)){r.push(s)}return r};Object.assign(got,{...o,mergeOptions:a.mergeOptions});Object.defineProperty(got,"defaults",{value:e.mutableDefaults?e:l.default(e),writable:e.mutableDefaults,configurable:e.mutableDefaults,enumerable:true});return got};t["default"]=create},6312:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(7678);class GotError extends Error{constructor(e,t,r){super(e);Error.captureStackTrace(this,this.constructor);this.name="GotError";if(!s.default.undefined(t.code)){this.code=t.code}Object.defineProperty(this,"options",{enumerable:false,value:r});if(!s.default.undefined(t.stack)){const e=this.stack.indexOf(this.message)+this.message.length;const r=this.stack.slice(e).split("\n").reverse();const s=t.stack.slice(t.stack.indexOf(t.message)+t.message.length).split("\n").reverse();while(s.length!==0&&s[0]===r[0]){r.shift()}this.stack=`${this.stack.slice(0,e)}${r.reverse().join("\n")}${s.reverse().join("\n")}`}}}t.GotError=GotError;class CacheError extends GotError{constructor(e,t){super(e.message,e,t);this.name="CacheError"}}t.CacheError=CacheError;class RequestError extends GotError{constructor(e,t){super(e.message,e,t);this.name="RequestError"}}t.RequestError=RequestError;class ReadError extends GotError{constructor(e,t){super(e.message,e,t);this.name="ReadError"}}t.ReadError=ReadError;class ParseError extends GotError{constructor(e,t,r){super(`${e.message} in "${r.url.toString()}"`,e,r);this.name="ParseError";Object.defineProperty(this,"response",{enumerable:false,value:t})}}t.ParseError=ParseError;class HTTPError extends GotError{constructor(e,t){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},t);this.name="HTTPError";Object.defineProperty(this,"response",{enumerable:false,value:e})}}t.HTTPError=HTTPError;class MaxRedirectsError extends GotError{constructor(e,t,r){super(`Redirected ${t} times. Aborting.`,{},r);this.name="MaxRedirectsError";Object.defineProperty(this,"response",{enumerable:false,value:e})}}t.MaxRedirectsError=MaxRedirectsError;class UnsupportedProtocolError extends GotError{constructor(e){super(`Unsupported protocol "${e.url.protocol}"`,{},e);this.name="UnsupportedProtocolError"}}t.UnsupportedProtocolError=UnsupportedProtocolError;class TimeoutError extends GotError{constructor(e,t,r){super(e.message,e,r);this.name="TimeoutError";this.event=e.event;this.timings=t}}t.TimeoutError=TimeoutError;var i=r(9072);t.CancelError=i.CancelError},4247:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(2391);const i=r(2610);const n=r(2781);const o=r(3837);const a=r(8983);const l=o.promisify(n.pipeline);t["default"]=async(e,t,r)=>{var n;const o=Number(e.headers["content-length"])||undefined;const h=a.createProgressStream("downloadProgress",r,o);i(e,h);const c=t.decompress&&t.method!=="HEAD"?s(h):h;if(!t.decompress&&["gzip","deflate","br"].includes((n=c.headers["content-encoding"],n!==null&&n!==void 0?n:""))){t.responseType="buffer"}r.emit("response",c);return l(e,h).catch((e=>{if(e.code!=="ERR_STREAM_PREMATURE_CLOSE"){throw e}}))}},3061:(e,t,r)=>{"use strict";function __export(e){for(var r in e)if(!t.hasOwnProperty(r))t[r]=e[r]}Object.defineProperty(t,"__esModule",{value:true});const s=r(7310);const i=r(4337);const n={options:{method:"GET",retry:{limit:2,methods:["GET","PUT","HEAD","DELETE","OPTIONS","TRACE"],statusCodes:[408,413,429,500,502,503,504,521,522,524],errorCodes:["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"],maxRetryAfter:undefined,calculateDelay:({computedValue:e})=>e},timeout:{},headers:{"user-agent":"got (https://github.com/sindresorhus/got)"},hooks:{init:[],beforeRequest:[],beforeRedirect:[],beforeRetry:[],beforeError:[],afterResponse:[]},decompress:true,throwHttpErrors:true,followRedirect:true,isStream:false,cache:false,dnsCache:false,useElectronNet:false,responseType:"text",resolveBodyOnly:false,maxRedirects:10,prefixUrl:"",methodRewriting:true,allowGetBody:false,ignoreInvalidCookies:false,context:{},_pagination:{transform:e=>{if(e.request.options.responseType==="json"){return e.body}return JSON.parse(e.body)},paginate:e=>{if(!Reflect.has(e.headers,"link")){return false}const t=e.headers.link.split(",");let r;for(const e of t){const t=e.split(";");if(t[1].includes("next")){r=t[0].trimStart().trim();r=r.slice(1,-1);break}}if(r){const e={url:new s.URL(r)};return e}return false},filter:()=>true,shouldContinue:()=>true,countLimit:Infinity}},handlers:[i.defaultHandler],mutableDefaults:false};const o=i.default(n);t["default"]=o;e.exports=o;e.exports["default"]=o;__export(r(2613));var a=r(4736);t.ResponseStream=a.ProxyStream;var l=r(6312);t.GotError=l.GotError;t.CacheError=l.CacheError;t.RequestError=l.RequestError;t.ReadError=l.ReadError;t.ParseError=l.ParseError;t.HTTPError=l.HTTPError;t.MaxRedirectsError=l.MaxRedirectsError;t.UnsupportedProtocolError=l.UnsupportedProtocolError;t.TimeoutError=l.TimeoutError;t.CancelError=l.CancelError},2744:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=["beforeError","init","beforeRequest","beforeRedirect","beforeRetry","afterResponse"];t["default"]=r},6210:(e,t,r)=>{"use strict";e=r.nmd(e);Object.defineProperty(t,"__esModule",{value:true});const s=r(7310);const i=r(3837);const n=r(1472);const o=r(3685);const a=r(5687);const l=r(9662);const h=r(3158);const c=r(7678);const u=r(134);const d=r(6312);const p=r(2744);const m=r(7616);const g=r(5938);const y=r(9630);const b=r(8359);const v=r(1760);const w=r(7681);const _=r(2613);const E=["context","body","json","form"];const isAgentByProtocol=e=>c.default.object(e);t.preNormalizeArguments=(e,t)=>{var r,s,o,a,h,d;if(c.default.undefined(e.headers)){e.headers={}}else{e.headers=l(e.headers)}for(const[t,r]of Object.entries(e.headers)){if(c.default.null_(r)){throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${t}\` header`)}}if(c.default.urlInstance(e.prefixUrl)||c.default.string(e.prefixUrl)){e.prefixUrl=e.prefixUrl.toString();if(e.prefixUrl.length!==0&&!e.prefixUrl.endsWith("/")){e.prefixUrl+="/"}}else{e.prefixUrl=t?t.prefixUrl:""}if(c.default.undefined(e.hooks)){e.hooks={}}if(c.default.object(e.hooks)){for(const t of p.default){if(Reflect.has(e.hooks,t)){if(!c.default.array(e.hooks[t])){throw new TypeError(`Parameter \`${t}\` must be an Array, not ${c.default(e.hooks[t])}`)}}else{e.hooks[t]=[]}}}else{throw new TypeError(`Parameter \`hooks\` must be an Object, not ${c.default(e.hooks)}`)}if(t){for(const r of p.default){if(!(Reflect.has(e.hooks,r)&&c.default.undefined(e.hooks[r]))){e.hooks[r]=[...t.hooks[r],...e.hooks[r]]}}}if(c.default.number(e.timeout)){e.timeout={request:e.timeout}}else if(!c.default.object(e.timeout)){e.timeout={}}const{retry:m}=e;if(t){e.retry={...t.retry}}else{e.retry={calculateDelay:e=>e.computedValue,limit:0,methods:[],statusCodes:[],errorCodes:[],maxRetryAfter:undefined}}if(c.default.object(m)){e.retry={...e.retry,...m}}else if(c.default.number(m)){e.retry.limit=m}if(e.retry.maxRetryAfter===undefined){e.retry.maxRetryAfter=Math.min(...[e.timeout.request,e.timeout.connect].filter((e=>!c.default.nullOrUndefined(e))))}e.retry.methods=[...new Set(e.retry.methods.map((e=>e.toUpperCase())))];e.retry.statusCodes=[...new Set(e.retry.statusCodes)];e.retry.errorCodes=[...new Set(e.retry.errorCodes)];if(e.dnsCache&&!(e.dnsCache instanceof u.default)){e.dnsCache=new u.default({cacheAdapter:e.dnsCache})}if(c.default.string(e.method)){e.method=e.method.toUpperCase()}else{e.method=(s=(r=t)===null||r===void 0?void 0:r.method,s!==null&&s!==void 0?s:"GET")}if(e.cache){e.cacheableRequest=new n(((e,t)=>e[_.requestSymbol](e,t)),e.cache)}if(c.default.object(e.cookieJar)){let{setCookie:t,getCookieString:r}=e.cookieJar;if(t.length===4&&r.length===0){if(!Reflect.has(t,i.promisify.custom)){t=i.promisify(t.bind(e.cookieJar));r=i.promisify(r.bind(e.cookieJar))}}else if(t.length!==2){throw new TypeError("`options.cookieJar.setCookie` needs to be an async function with 2 arguments")}else if(r.length!==1){throw new TypeError("`options.cookieJar.getCookieString` needs to be an async function with 1 argument")}e.cookieJar={setCookie:t,getCookieString:r}}if(c.default.null_(e.encoding)){throw new TypeError("To get a Buffer, set `options.responseType` to `buffer` instead")}if(!Reflect.has(e,"maxRedirects")&&!(t&&Reflect.has(t,"maxRedirects"))){e.maxRedirects=0}if(t){e=b.default({},t,e)}if(c.default.object(e._pagination)){const{_pagination:t}=e;if(!c.default.function_(t.transform)){throw new TypeError("`options._pagination.transform` must be implemented")}if(!c.default.function_(t.shouldContinue)){throw new TypeError("`options._pagination.shouldContinue` must be implemented")}if(!c.default.function_(t.filter)){throw new TypeError("`options._pagination.filter` must be implemented")}if(!c.default.function_(t.paginate)){throw new TypeError("`options._pagination.paginate` must be implemented")}}e.decompress=Boolean(e.decompress);e.isStream=Boolean(e.isStream);e.throwHttpErrors=Boolean(e.throwHttpErrors);e.ignoreInvalidCookies=Boolean(e.ignoreInvalidCookies);e.cache=(o=e.cache,o!==null&&o!==void 0?o:false);e.responseType=(a=e.responseType,a!==null&&a!==void 0?a:"text");e.resolveBodyOnly=Boolean(e.resolveBodyOnly);e.followRedirect=Boolean(e.followRedirect);e.dnsCache=(h=e.dnsCache,h!==null&&h!==void 0?h:false);e.useElectronNet=Boolean(e.useElectronNet);e.methodRewriting=Boolean(e.methodRewriting);e.allowGetBody=Boolean(e.allowGetBody);e.context=(d=e.context,d!==null&&d!==void 0?d:{});return e};t.mergeOptions=(...e)=>{let r=t.preNormalizeArguments({});const s={};for(const i of e){r=t.preNormalizeArguments(b.default({},i),r);for(const e of E){if(!Reflect.has(i,e)){continue}s[e]={writable:true,configurable:true,enumerable:false,value:i[e]}}}Object.defineProperties(r,s);return r};t.normalizeArguments=(e,r,i)=>{var n,o,a,l,h,u,d,p,m,g;if(typeof e==="undefined"){throw new TypeError("Missing `url` argument")}const runInitHooks=(e,t)=>{if(e&&t){for(const r of e){const e=r(t);if(c.default.promise(e)){throw new TypeError("The `init` hook must be a synchronous function")}}}};const y=c.default.urlInstance(e)||c.default.string(e);if(y){if(r){if(Reflect.has(r,"url")){throw new TypeError("The `url` option cannot be used if the input is a valid URL.")}}else{r={}}r.url=e;runInitHooks((n=i)===null||n===void 0?void 0:n.options.hooks.init,r);runInitHooks((o=r.hooks)===null||o===void 0?void 0:o.init,r)}else if(Reflect.has(e,"resolve")){throw new Error("The legacy `url.Url` is deprecated. Use `URL` instead.")}else{runInitHooks((a=i)===null||a===void 0?void 0:a.options.hooks.init,e);runInitHooks((l=e.hooks)===null||l===void 0?void 0:l.init,e);if(r){runInitHooks((h=i)===null||h===void 0?void 0:h.options.hooks.init,r);runInitHooks((u=r.hooks)===null||u===void 0?void 0:u.init,r)}}if(y){r=t.mergeOptions((p=(d=i)===null||d===void 0?void 0:d.options,p!==null&&p!==void 0?p:{}),r!==null&&r!==void 0?r:{})}else{r=t.mergeOptions((g=(m=i)===null||m===void 0?void 0:m.options,g!==null&&g!==void 0?g:{}),e,r!==null&&r!==void 0?r:{})}if(c.default.string(r.url)){r.url=r.prefixUrl+r.url;r.url=r.url.replace(/^unix:/,"http://$&");if(r.searchParams||r.search){r.url=r.url.split("?")[0]}r.url=v.default({origin:r.url,...r})}else if(!c.default.urlInstance(r.url)){r.url=v.default({origin:r.prefixUrl,...r})}const b=r;let w=r.prefixUrl;Object.defineProperty(b,"prefixUrl",{set:e=>{if(!b.url.href.startsWith(e)){throw new Error(`Cannot change \`prefixUrl\` from ${w} to ${e}: ${b.url.href}`)}b.url=new s.URL(e+b.url.href.slice(w.length));w=e},get:()=>w});for(const[e,t]of Object.entries(b.headers)){if(c.default.undefined(t)){delete b.headers[e]}}return b};const S=new Set(["HEAD"]);const x="GET";t.normalizeRequestArguments=async r=>{var n,l,u;r=t.mergeOptions(r);const{headers:p}=r;const b=c.default.undefined(p["content-type"]);{const e=!c.default.undefined(r.form);const t=!c.default.undefined(r.json);const s=!c.default.undefined(r.body);if((s||e||t)&&S.has(r.method)){throw new TypeError(`The \`${r.method}\` method cannot be used with a body`)}if(!r.allowGetBody&&(s||e||t)&&x===r.method){throw new TypeError(`The \`${r.method}\` method cannot be used with a body`)}if([s,e,t].filter((e=>e)).length>1){throw new TypeError("The `body`, `json` and `form` options are mutually exclusive")}if(s&&!c.default.nodeStream(r.body)&&!c.default.string(r.body)&&!c.default.buffer(r.body)&&!(c.default.object(r.body)&&y.default(r.body))){throw new TypeError("The `body` option must be a stream.Readable, string or Buffer")}if(e&&!c.default.object(r.form)){throw new TypeError("The `form` option must be an Object")}}if(r.body){if(c.default.object(r.body)&&y.default(r.body)&&b){p["content-type"]=`multipart/form-data; boundary=${r.body.getBoundary()}`}}else if(r.form){if(b){p["content-type"]="application/x-www-form-urlencoded"}r.body=new s.URLSearchParams(r.form).toString()}else if(r.json){if(b){p["content-type"]="application/json"}r.body=JSON.stringify(r.json)}const v=await g.default(r);if(!c.default.nodeStream(r.body)){r.body=h(r.body)}if(c.default.undefined(p["content-length"])&&c.default.undefined(p["transfer-encoding"])){if((r.method==="POST"||r.method==="PUT"||r.method==="PATCH"||r.method==="DELETE"||r.allowGetBody&&r.method==="GET")&&!c.default.undefined(v)){p["content-length"]=String(v)}}if(!r.isStream&&r.responseType==="json"&&c.default.undefined(p.accept)){p.accept="application/json"}if(r.decompress&&c.default.undefined(p["accept-encoding"])){p["accept-encoding"]=w.default?"gzip, deflate, br":"gzip, deflate"}if(r.url.protocol!=="http:"&&r.url.protocol!=="https:"){throw new d.UnsupportedProtocolError(r)}decodeURI(r.url.toString());if(c.default.function_(r.request)){r[_.requestSymbol]=r.request;delete r.request}else{r[_.requestSymbol]=r.url.protocol==="https:"?a.request:o.request}if(r.url.hostname==="unix"){const e=/(?<socketPath>.+?):(?<path>.+)/.exec(r.url.pathname);if((n=e)===null||n===void 0?void 0:n.groups){const{socketPath:t,path:s}=e.groups;r={...r,socketPath:t,path:s,host:""}}}if(isAgentByProtocol(r.agent)){r.agent=(l=r.agent[r.url.protocol.slice(0,-1)],l!==null&&l!==void 0?l:r.agent)}if(r.dnsCache){r.lookup=r.dnsCache.lookup}if(r.useElectronNet&&process.versions.electron){const t=m.default(e,"electron");r.request=i.deprecate((u=t.net.request,u!==null&&u!==void 0?u:t.remote.net.request),"Electron support has been deprecated and will be removed in Got 11.\n"+"See https://github.com/sindresorhus/got/issues/899 for further information.","GOT_ELECTRON")}delete r.timeout;if(r.cookieJar){const e=await r.cookieJar.getCookieString(r.url.toString());if(c.default.nonEmptyString(e)){r.headers.cookie=e}else{delete r.headers.cookie}}delete r.url;return r}},8983:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(2781);const i=r(7678);function createProgressStream(e,t,r){let n=0;if(i.default.string(r)){r=Number(r)}const o=new s.Transform({transform(s,i,o){n+=s.length;const a=r?n/r:0;if(a<1){t.emit(e,{percent:a,transferred:n,total:r})}o(undefined,s)},flush(s){t.emit(e,{percent:1,transferred:n,total:r});s()}});t.emit(e,{percent:0,transferred:0,total:r});return o}t.createProgressStream=createProgressStream},1569:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(7147);const i=r(1472);const n=r(2361);const o=r(3685);const a=r(2781);const l=r(7310);const h=r(3837);const c=r(7678);const u=r(8097);const d=r(75);const p=r(6312);const m=r(4247);const g=r(6210);const y=r(8983);const b=r(1489);const v=r(2613);const w=r(8184);const _=r(4568);const setImmediateAsync=async()=>new Promise((e=>setImmediate(e)));const E=h.promisify(a.pipeline);const S=new Set([300,301,302,303,304,307,308]);t["default"]=e=>{const t=new n;const r=e.url.toString();const a=[];let h=0;let x;const isAborted=()=>typeof x.aborted==="number"||x.aborted;const emitError=async r=>{try{for(const t of e.hooks.beforeError){r=await t(r)}t.emit("error",r)}catch(e){t.emit("error",e)}};const get=async()=>{let s=await g.normalizeRequestArguments(e);const handleResponse=async s=>{var i;try{if(e.useElectronNet){s=new Proxy(s,{get:(e,t)=>{if(t==="trailers"||t==="rawTrailers"){return[]}const r=e[t];return c.default.function_(r)?r.bind(e):r}})}const n=s;const{statusCode:u}=n;n.statusMessage=c.default.nonEmptyString(n.statusMessage)?n.statusMessage:o.STATUS_CODES[u];n.url=e.url.toString();n.requestUrl=r;n.retryCount=h;n.redirectUrls=a;n.request={options:e};n.isFromCache=(i=n.fromCache,i!==null&&i!==void 0?i:false);delete n.fromCache;if(!n.isFromCache){n.ip=s.socket.remoteAddress}const d=n.headers["set-cookie"];if(Reflect.has(e,"cookieJar")&&d){let t=d.map((async t=>e.cookieJar.setCookie(t,n.url)));if(e.ignoreInvalidCookies){t=t.map((async e=>e.catch((()=>{}))))}await Promise.all(t)}if(e.followRedirect&&Reflect.has(n.headers,"location")&&S.has(u)){n.resume();if(u===303||e.methodRewriting===false){if(e.method!=="GET"&&e.method!=="HEAD"){e.method="GET"}if(Reflect.has(e,"body")){delete e.body}if(Reflect.has(e,"json")){delete e.json}if(Reflect.has(e,"form")){delete e.form}}if(a.length>=e.maxRedirects){throw new p.MaxRedirectsError(n,e.maxRedirects,e)}const r=Buffer.from(n.headers.location,"binary").toString();const i=new l.URL(r,e.url);if(i.hostname!==e.url.hostname&&Reflect.has(e.headers,"cookie")){delete e.headers.cookie}a.push(i.toString());e.url=i;for(const t of e.hooks.beforeRedirect){await t(e,n)}t.emit("redirect",s,e);await get();return}await m.default(n,e,t)}catch(e){emitError(e)}};const handleRequest=async r=>{let i=false;let n=false;r.once("finish",(()=>{n=true}));x=r;const onError=s=>{if(s instanceof b.TimeoutError){s=new p.TimeoutError(s,r.timings,e)}else{s=new p.RequestError(s,e)}if(!t.retry(s)){emitError(s)}};r.on("error",(e=>{if(i){if(!n){return}if(isAborted()&&!(e instanceof b.TimeoutError)){return}}onError(e)}));try{u.default(r);b.default(r,e.timeout,e.url);t.emit("request",r);const n=y.createProgressStream("uploadProgress",t,s.headers["content-length"]);i=true;await E(s.body,n,r);r.emit("upload-complete")}catch(e){if(isAborted()&&e.message==="Premature close"){return}onError(e)}};if(e.cache){s={...s,...w.default(e.url)};const t=e.cacheableRequest(s,handleResponse);t.once("error",(t=>{if(t instanceof i.RequestError){emitError(new p.RequestError(t,e))}else{emitError(new p.CacheError(t,e))}}));t.once("request",handleRequest)}else{try{handleRequest(s[v.requestSymbol](e.url,s,handleResponse))}catch(t){emitError(new p.RequestError(t,e))}}};t.retry=t=>{let r;h++;try{r=e.retry.calculateDelay({attemptCount:h,retryOptions:e.retry,error:t,computedValue:d.default({attemptCount:h,retryOptions:e.retry,error:t,computedValue:0})})}catch(e){emitError(e);return false}if(r){const retry=async e=>{try{for(const r of e.hooks.beforeRetry){await r(e,t,h)}await get()}catch(e){emitError(e)}};setTimeout(retry,r,{...e,forceRefresh:true});return true}return false};t.abort=()=>{t.prependListener("request",(e=>{e.abort()}));if(x){x.abort()}};(async()=>{try{if(e.body instanceof s.ReadStream){await _(e.body,"open")}await setImmediateAsync();for(const t of e.hooks.beforeRequest){await t(e)}await get()}catch(e){emitError(e)}})();return t};t.proxyEvents=(e,t)=>{const r=["request","redirect","uploadProgress","downloadProgress"];for(const s of r){t.on(s,((...t)=>{e.emit(s,...t)}))}}},2613:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.requestSymbol=Symbol("request")},285:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(7678);function deepFreeze(e){for(const t of Object.values(e)){if(s.default.plainObject(t)||s.default.array(t)){deepFreeze(t)}}return Object.freeze(e)}t["default"]=deepFreeze},7616:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=(e,t)=>e.require(t)},5938:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(7147);const i=r(3837);const n=r(7678);const o=r(9630);const a=i.promisify(s.stat);t["default"]=async e=>{const{body:t,headers:r}=e;if(r&&"content-length"in r){return Number(r["content-length"])}if(!t){return 0}if(n.default.string(t)){return Buffer.byteLength(t)}if(n.default.buffer(t)){return t.length}if(o.default(t)){return i.promisify(t.getLength.bind(t))()}if(t instanceof s.ReadStream){const{size:e}=await a(t.path);return e}return undefined}},9630:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(7678);t["default"]=e=>s.default.nodeStream(e)&&s.default.function_(e.getBoundary)},8359:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(7310);const i=r(7678);function merge(e,...t){for(const r of t){for(const[t,n]of Object.entries(r)){const r=e[t];if(i.default.urlInstance(r)&&i.default.string(n)){e[t]=new s.URL(n,r)}else if(i.default.plainObject(n)){if(i.default.plainObject(r)){e[t]=merge({},r,n)}else{e[t]=merge({},n)}}else if(i.default.array(n)){e[t]=n.slice()}else{e[t]=n}}}return e}t["default"]=merge},1760:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(7310);function validateSearchParams(e){for(const t of Object.values(e)){if(typeof t!=="string"&&typeof t!=="number"&&typeof t!=="boolean"&&t!==null){throw new TypeError(`The \`searchParams\` value '${String(t)}' must be a string, number, boolean or null`)}}}const i=["protocol","username","password","host","hostname","port","pathname","search","hash"];t["default"]=e=>{var t,r;let n;if(e.path){if(e.pathname){throw new TypeError("Parameters `path` and `pathname` are mutually exclusive.")}if(e.search){throw new TypeError("Parameters `path` and `search` are mutually exclusive.")}if(e.searchParams){throw new TypeError("Parameters `path` and `searchParams` are mutually exclusive.")}}if(Reflect.has(e,"auth")){throw new TypeError("Parameter `auth` is deprecated. Use `username` / `password` instead.")}if(e.search&&e.searchParams){throw new TypeError("Parameters `search` and `searchParams` are mutually exclusive.")}if(e.href){return new s.URL(e.href)}if(e.origin){n=e.origin}else{if(!e.protocol){throw new TypeError("No URL protocol specified")}n=`${e.protocol}//${r=(t=e.hostname,t!==null&&t!==void 0?t:e.host),r!==null&&r!==void 0?r:""}`}const o=new s.URL(n);if(e.path){const t=e.path.indexOf("?");if(t===-1){e.pathname=e.path}else{e.pathname=e.path.slice(0,t);e.search=e.path.slice(t+1)}}if(Reflect.has(e,"path")){delete e.path}for(const t of i){if(Reflect.has(e,t)){o[t]=e[t].toString()}}if(e.searchParams){if(typeof e.searchParams!=="string"&&!(e.searchParams instanceof s.URLSearchParams)){validateSearchParams(e.searchParams)}new s.URLSearchParams(e.searchParams).forEach(((e,t)=>{o.searchParams.append(t,e)}))}return o}},7681:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(9796);t["default"]=typeof s.createBrotliDecompress==="function"},1489:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(1808);const i=r(3174);const n=Symbol("reentry");const noop=()=>{};class TimeoutError extends Error{constructor(e,t){super(`Timeout awaiting '${t}' for ${e}ms`);this.event=t;this.name="TimeoutError";this.code="ETIMEDOUT"}}t.TimeoutError=TimeoutError;t["default"]=(e,t,r)=>{if(Reflect.has(e,n)){return noop}e[n]=true;const o=[];const{once:a,unhandleAll:l}=i.default();const addTimeout=(e,t,r)=>{var s,i;const n=setTimeout(t,e,e,r);(i=(s=n).unref)===null||i===void 0?void 0:i.call(s);const cancel=()=>{clearTimeout(n)};o.push(cancel);return cancel};const{host:h,hostname:c}=r;const timeoutHandler=(t,r)=>{if(e.socket){e.socket._hadError=true}e.abort();e.emit("error",new TimeoutError(t,r))};const cancelTimeouts=()=>{for(const e of o){e()}l()};e.once("error",(t=>{cancelTimeouts();if(e.listenerCount("error")===0){throw t}}));e.once("abort",cancelTimeouts);a(e,"response",(e=>{a(e,"end",cancelTimeouts)}));if(typeof t.request!=="undefined"){addTimeout(t.request,timeoutHandler,"request")}if(typeof t.socket!=="undefined"){const socketTimeoutHandler=()=>{timeoutHandler(t.socket,"socket")};e.setTimeout(t.socket,socketTimeoutHandler);o.push((()=>{e.removeListener("timeout",socketTimeoutHandler)}))}a(e,"socket",(i=>{var n;const{socketPath:o}=e;if(i.connecting){const e=Boolean(o!==null&&o!==void 0?o:s.isIP((n=c!==null&&c!==void 0?c:h,n!==null&&n!==void 0?n:""))!==0);if(typeof t.lookup!=="undefined"&&!e&&typeof i.address().address==="undefined"){const e=addTimeout(t.lookup,timeoutHandler,"lookup");a(i,"lookup",e)}if(typeof t.connect!=="undefined"){const timeConnect=()=>addTimeout(t.connect,timeoutHandler,"connect");if(e){a(i,"connect",timeConnect())}else{a(i,"lookup",(e=>{if(e===null){a(i,"connect",timeConnect())}}))}}if(typeof t.secureConnect!=="undefined"&&r.protocol==="https:"){a(i,"connect",(()=>{const e=addTimeout(t.secureConnect,timeoutHandler,"secureConnect");a(i,"secureConnect",e)}))}}if(typeof t.send!=="undefined"){const timeRequest=()=>addTimeout(t.send,timeoutHandler,"send");if(i.connecting){a(i,"connect",(()=>{a(e,"upload-complete",timeRequest())}))}else{a(e,"upload-complete",timeRequest())}}}));if(typeof t.response!=="undefined"){a(e,"upload-complete",(()=>{const r=addTimeout(t.response,timeoutHandler,"response");a(e,"response",r)}))}return cancelTimeouts}},3174:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=()=>{const e=[];return{once(t,r,s){t.once(r,s);e.push({origin:t,event:r,fn:s})},unhandleAll(){for(const t of e){const{origin:e,event:r,fn:s}=t;e.removeListener(r,s)}e.length=0}}}},8184:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const s=r(7678);t["default"]=e=>{e=e;const t={protocol:e.protocol,hostname:s.default.string(e.hostname)&&e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,host:e.host,hash:e.hash,search:e.search,pathname:e.pathname,href:e.href,path:`${e.pathname||""}${e.search||""}`};if(s.default.string(e.port)&&e.port.length!==0){t.port=Number(e.port)}if(e.username||e.password){t.auth=`${e.username||""}:${e.password||""}`}return t}},1621:e=>{"use strict";e.exports=(e,t)=>{t=t||process.argv;const r=e.startsWith("-")?"":e.length===1?"-":"--";const s=t.indexOf(r+e);const i=t.indexOf("--");return s!==-1&&(i===-1?true:s<i)}},1002:e=>{"use strict";const t=new Set([200,203,204,206,300,301,404,405,410,414,501]);const r=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]);const s=new Set([500,502,503,504]);const i={date:true,connection:true,"keep-alive":true,"proxy-authenticate":true,"proxy-authorization":true,te:true,trailer:true,"transfer-encoding":true,upgrade:true};const n={"content-length":true,"content-encoding":true,"transfer-encoding":true,"content-range":true};function toNumberOrZero(e){const t=parseInt(e,10);return isFinite(t)?t:0}function isErrorResponse(e){if(!e){return true}return s.has(e.status)}function parseCacheControl(e){const t={};if(!e)return t;const r=e.trim().split(/\s*,\s*/);for(const e of r){const[r,s]=e.split(/\s*=\s*/,2);t[r]=s===undefined?true:s.replace(/^"|"$/g,"")}return t}function formatCacheControl(e){let t=[];for(const r in e){const s=e[r];t.push(s===true?r:r+"="+s)}if(!t.length){return undefined}return t.join(", ")}e.exports=class CachePolicy{constructor(e,t,{shared:r,cacheHeuristic:s,immutableMinTimeToLive:i,ignoreCargoCult:n,_fromObject:o}={}){if(o){this._fromObject(o);return}if(!t||!t.headers){throw Error("Response headers missing")}this._assertRequestHasHeaders(e);this._responseTime=this.now();this._isShared=r!==false;this._cacheHeuristic=undefined!==s?s:.1;this._immutableMinTtl=undefined!==i?i:24*3600*1e3;this._status="status"in t?t.status:200;this._resHeaders=t.headers;this._rescc=parseCacheControl(t.headers["cache-control"]);this._method="method"in e?e.method:"GET";this._url=e.url;this._host=e.headers.host;this._noAuthorization=!e.headers.authorization;this._reqHeaders=t.headers.vary?e.headers:null;this._reqcc=parseCacheControl(e.headers["cache-control"]);if(n&&"pre-check"in this._rescc&&"post-check"in this._rescc){delete this._rescc["pre-check"];delete this._rescc["post-check"];delete this._rescc["no-cache"];delete this._rescc["no-store"];delete this._rescc["must-revalidate"];this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":formatCacheControl(this._rescc)});delete this._resHeaders.expires;delete this._resHeaders.pragma}if(t.headers["cache-control"]==null&&/no-cache/.test(t.headers.pragma)){this._rescc["no-cache"]=true}}now(){return Date.now()}storable(){return!!(!this._reqcc["no-store"]&&("GET"===this._method||"HEAD"===this._method||"POST"===this._method&&this._hasExplicitExpiration())&&r.has(this._status)&&!this._rescc["no-store"]&&(!this._isShared||!this._rescc.private)&&(!this._isShared||this._noAuthorization||this._allowsStoringAuthenticated())&&(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||t.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(e){if(!e||!e.headers){throw Error("Request headers missing")}}satisfiesWithoutRevalidation(e){this._assertRequestHasHeaders(e);const t=parseCacheControl(e.headers["cache-control"]);if(t["no-cache"]||/no-cache/.test(e.headers.pragma)){return false}if(t["max-age"]&&this.age()>t["max-age"]){return false}if(t["min-fresh"]&&this.timeToLive()<1e3*t["min-fresh"]){return false}if(this.stale()){const e=t["max-stale"]&&!this._rescc["must-revalidate"]&&(true===t["max-stale"]||t["max-stale"]>this.age()-this.maxAge());if(!e){return false}}return this._requestMatches(e,false)}_requestMatches(e,t){return(!this._url||this._url===e.url)&&this._host===e.headers.host&&(!e.method||this._method===e.method||t&&"HEAD"===e.method)&&this._varyMatches(e)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(e){if(!this._resHeaders.vary){return true}if(this._resHeaders.vary==="*"){return false}const t=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(const r of t){if(e.headers[r]!==this._reqHeaders[r])return false}return true}_copyWithoutHopByHopHeaders(e){const t={};for(const r in e){if(i[r])continue;t[r]=e[r]}if(e.connection){const r=e.connection.trim().split(/\s*,\s*/);for(const e of r){delete t[e]}}if(t.warning){const e=t.warning.split(/,/).filter((e=>!/^\s*1[0-9][0-9]/.test(e)));if(!e.length){delete t.warning}else{t.warning=e.join(",").trim()}}return t}responseHeaders(){const e=this._copyWithoutHopByHopHeaders(this._resHeaders);const t=this.age();if(t>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24){e.warning=(e.warning?`${e.warning}, `:"")+'113 - "rfc7234 5.5.4"'}e.age=`${Math.round(t)}`;e.date=new Date(this.now()).toUTCString();return e}date(){const e=Date.parse(this._resHeaders.date);if(isFinite(e)){return e}return this._responseTime}age(){let e=this._ageValue();const t=(this.now()-this._responseTime)/1e3;return e+t}_ageValue(){return toNumberOrZero(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"]){return 0}if(this._isShared&&(this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable)){return 0}if(this._resHeaders.vary==="*"){return 0}if(this._isShared){if(this._rescc["proxy-revalidate"]){return 0}if(this._rescc["s-maxage"]){return toNumberOrZero(this._rescc["s-maxage"])}}if(this._rescc["max-age"]){return toNumberOrZero(this._rescc["max-age"])}const e=this._rescc.immutable?this._immutableMinTtl:0;const t=this.date();if(this._resHeaders.expires){const r=Date.parse(this._resHeaders.expires);if(Number.isNaN(r)||r<t){return 0}return Math.max(e,(r-t)/1e3)}if(this._resHeaders["last-modified"]){const r=Date.parse(this._resHeaders["last-modified"]);if(isFinite(r)&&t>r){return Math.max(e,(t-r)/1e3*this._cacheHeuristic)}}return e}timeToLive(){const e=this.maxAge()-this.age();const t=e+toNumberOrZero(this._rescc["stale-if-error"]);const r=e+toNumberOrZero(this._rescc["stale-while-revalidate"]);return Math.max(0,e,t,r)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+toNumberOrZero(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+toNumberOrZero(this._rescc["stale-while-revalidate"])>this.age()}static fromObject(e){return new this(undefined,undefined,{_fromObject:e})}_fromObject(e){if(this._responseTime)throw Error("Reinitialized");if(!e||e.v!==1)throw Error("Invalid serialization");this._responseTime=e.t;this._isShared=e.sh;this._cacheHeuristic=e.ch;this._immutableMinTtl=e.imm!==undefined?e.imm:24*3600*1e3;this._status=e.st;this._resHeaders=e.resh;this._rescc=e.rescc;this._method=e.m;this._url=e.u;this._host=e.h;this._noAuthorization=e.a;this._reqHeaders=e.reqh;this._reqcc=e.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(e){this._assertRequestHasHeaders(e);const t=this._copyWithoutHopByHopHeaders(e.headers);delete t["if-range"];if(!this._requestMatches(e,true)||!this.storable()){delete t["if-none-match"];delete t["if-modified-since"];return t}if(this._resHeaders.etag){t["if-none-match"]=t["if-none-match"]?`${t["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag}const r=t["accept-ranges"]||t["if-match"]||t["if-unmodified-since"]||this._method&&this._method!="GET";if(r){delete t["if-modified-since"];if(t["if-none-match"]){const e=t["if-none-match"].split(/,/).filter((e=>!/^\s*W\//.test(e)));if(!e.length){delete t["if-none-match"]}else{t["if-none-match"]=e.join(",").trim()}}}else if(this._resHeaders["last-modified"]&&!t["if-modified-since"]){t["if-modified-since"]=this._resHeaders["last-modified"]}return t}revalidatedPolicy(e,t){this._assertRequestHasHeaders(e);if(this._useStaleIfError()&&isErrorResponse(t)){return{modified:false,matches:false,policy:this}}if(!t||!t.headers){throw Error("Response headers missing")}let r=false;if(t.status!==undefined&&t.status!=304){r=false}else if(t.headers.etag&&!/^\s*W\//.test(t.headers.etag)){r=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag}else if(this._resHeaders.etag&&t.headers.etag){r=this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag.replace(/^\s*W\//,"")}else if(this._resHeaders["last-modified"]){r=this._resHeaders["last-modified"]===t.headers["last-modified"]}else{if(!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!t.headers.etag&&!t.headers["last-modified"]){r=true}}if(!r){return{policy:new this.constructor(e,t),modified:t.status!=304,matches:false}}const s={};for(const e in this._resHeaders){s[e]=e in t.headers&&!n[e]?t.headers[e]:this._resHeaders[e]}const i=Object.assign({},t,{status:this._status,method:this._method,headers:s});return{policy:new this.constructor(e,i,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:false,matches:true}}}},2492:(e,t,r)=>{var s=r(2940);var i=Object.create(null);var n=r(1223);e.exports=s(inflight);function inflight(e,t){if(i[e]){i[e].push(t);return null}else{i[e]=[t];return makeres(e)}}function makeres(e){return n((function RES(){var t=i[e];var r=t.length;var s=slice(arguments);try{for(var n=0;n<r;n++){t[n].apply(null,s)}}finally{if(t.length>r){t.splice(0,r);process.nextTick((function(){RES.apply(null,s)}))}else{delete i[e]}}}))}function slice(e){var t=e.length;var r=[];for(var s=0;s<t;s++)r[s]=e[s];return r}},4124:(e,t,r)=>{try{var s=r(3837);if(typeof s.inherits!=="function")throw"";e.exports=s.inherits}catch(t){e.exports=r(8544)}},8544:e=>{if(typeof Object.create==="function"){e.exports=function inherits(e,t){if(t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}}else{e.exports=function inherits(e,t){if(t){e.super_=t;var TempCtor=function(){};TempCtor.prototype=t.prototype;e.prototype=new TempCtor;e.prototype.constructor=e}}}},2820:(e,t)=>{t.stringify=function stringify(e){if("undefined"==typeof e)return e;if(e&&Buffer.isBuffer(e))return JSON.stringify(":base64:"+e.toString("base64"));if(e&&e.toJSON)e=e.toJSON();if(e&&"object"===typeof e){var t="";var r=Array.isArray(e);t=r?"[":"{";var s=true;for(var i in e){var n="function"==typeof e[i]||!r&&"undefined"===typeof e[i];if(Object.hasOwnProperty.call(e,i)&&!n){if(!s)t+=",";s=false;if(r){if(e[i]==undefined)t+="null";else t+=stringify(e[i])}else if(e[i]!==void 0){t+=stringify(i)+":"+stringify(e[i])}}}t+=r?"]":"}";return t}else if("string"===typeof e){return JSON.stringify(/^:/.test(e)?":"+e:e)}else if("undefined"===typeof e){return"null"}else return JSON.stringify(e)};t.parse=function(e){return JSON.parse(e,(function(e,t){if("string"===typeof t){if(/^:base64:/.test(t))return Buffer.from(t.substring(8),"base64");else return/^:/.test(t)?t.substring(1):t}return t}))}},1531:(e,t,r)=>{"use strict";const s=r(2361);const i=r(2820);const loadStore=e=>{const t={redis:"@keyv/redis",mongodb:"@keyv/mongo",mongo:"@keyv/mongo",sqlite:"@keyv/sqlite",postgresql:"@keyv/postgres",postgres:"@keyv/postgres",mysql:"@keyv/mysql"};if(e.adapter||e.uri){const r=e.adapter||/^[^:]*/.exec(e.uri)[0];return new(require(t[r]))(e)}return new Map};class Keyv extends s{constructor(e,t){super();this.opts=Object.assign({namespace:"keyv",serialize:i.stringify,deserialize:i.parse},typeof e==="string"?{uri:e}:e,t);if(!this.opts.store){const e=Object.assign({},this.opts);this.opts.store=loadStore(e)}if(typeof this.opts.store.on==="function"){this.opts.store.on("error",(e=>this.emit("error",e)))}this.opts.store.namespace=this.opts.namespace}_getKeyPrefix(e){return`${this.opts.namespace}:${e}`}get(e,t){const r=this._getKeyPrefix(e);const{store:s}=this.opts;return Promise.resolve().then((()=>s.get(r))).then((e=>typeof e==="string"?this.opts.deserialize(e):e)).then((r=>{if(r===undefined){return undefined}if(typeof r.expires==="number"&&Date.now()>r.expires){this.delete(e);return undefined}return t&&t.raw?r:r.value}))}set(e,t,r){const s=this._getKeyPrefix(e);if(typeof r==="undefined"){r=this.opts.ttl}if(r===0){r=undefined}const{store:i}=this.opts;return Promise.resolve().then((()=>{const e=typeof r==="number"?Date.now()+r:null;t={value:t,expires:e};return this.opts.serialize(t)})).then((e=>i.set(s,e,r))).then((()=>true))}delete(e){const t=this._getKeyPrefix(e);const{store:r}=this.opts;return Promise.resolve().then((()=>r.delete(t)))}clear(){const{store:e}=this.opts;return Promise.resolve().then((()=>e.clear()))}}e.exports=Keyv},5215:e=>{"use strict";const{FORCE_COLOR:t,NODE_DISABLE_COLORS:r,TERM:s}=process.env;const i={enabled:!r&&s!=="dumb"&&t!=="0",reset:init(0,0),bold:init(1,22),dim:init(2,22),italic:init(3,23),underline:init(4,24),inverse:init(7,27),hidden:init(8,28),strikethrough:init(9,29),black:init(30,39),red:init(31,39),green:init(32,39),yellow:init(33,39),blue:init(34,39),magenta:init(35,39),cyan:init(36,39),white:init(37,39),gray:init(90,39),grey:init(90,39),bgBlack:init(40,49),bgRed:init(41,49),bgGreen:init(42,49),bgYellow:init(43,49),bgBlue:init(44,49),bgMagenta:init(45,49),bgCyan:init(46,49),bgWhite:init(47,49)};function run(e,t){let r=0,s,i="",n="";for(;r<e.length;r++){s=e[r];i+=s.open;n+=s.close;if(t.includes(s.close)){t=t.replace(s.rgx,s.close+s.open)}}return i+t+n}function chain(e,t){let r={has:e,keys:t};r.reset=i.reset.bind(r);r.bold=i.bold.bind(r);r.dim=i.dim.bind(r);r.italic=i.italic.bind(r);r.underline=i.underline.bind(r);r.inverse=i.inverse.bind(r);r.hidden=i.hidden.bind(r);r.strikethrough=i.strikethrough.bind(r);r.black=i.black.bind(r);r.red=i.red.bind(r);r.green=i.green.bind(r);r.yellow=i.yellow.bind(r);r.blue=i.blue.bind(r);r.magenta=i.magenta.bind(r);r.cyan=i.cyan.bind(r);r.white=i.white.bind(r);r.gray=i.gray.bind(r);r.grey=i.grey.bind(r);r.bgBlack=i.bgBlack.bind(r);r.bgRed=i.bgRed.bind(r);r.bgGreen=i.bgGreen.bind(r);r.bgYellow=i.bgYellow.bind(r);r.bgBlue=i.bgBlue.bind(r);r.bgMagenta=i.bgMagenta.bind(r);r.bgCyan=i.bgCyan.bind(r);r.bgWhite=i.bgWhite.bind(r);return r}function init(e,t){let r={open:`[${e}m`,close:`[${t}m`,rgx:new RegExp(`\\x1b\\[${t}m`,"g")};return function(t){if(this!==void 0&&this.has!==void 0){this.has.includes(e)||(this.has.push(e),this.keys.push(r));return t===void 0?this:i.enabled?run(this.keys,t+""):t+""}return t===void 0?chain([e],[r]):i.enabled?run([r],t+""):t+""}}e.exports=i},9662:e=>{"use strict";e.exports=e=>{const t={};for(const[r,s]of Object.entries(e)){t[r.toLowerCase()]=s}return t}},2610:e=>{"use strict";const t=["aborted","complete","destroy","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];e.exports=(e,r)=>{const s=new Set(Object.keys(e).concat(t));for(const t of s){if(t in r){continue}r[t]=typeof e[t]==="function"?e[t].bind(e):e[t]}return r}},3973:(e,t,r)=>{e.exports=minimatch;minimatch.Minimatch=Minimatch;var s={sep:"/"};try{s=r(1017)}catch(e){}var i=minimatch.GLOBSTAR=Minimatch.GLOBSTAR={};var n=r(3717);var o={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}};var a="[^/]";var l=a+"*?";var h="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";var c="(?:(?!(?:\\/|^)\\.).)*?";var u=charSet("().*{}+?[]^$\\!");function charSet(e){return e.split("").reduce((function(e,t){e[t]=true;return e}),{})}var d=/\/+/;minimatch.filter=filter;function filter(e,t){t=t||{};return function(r,s,i){return minimatch(r,e,t)}}function ext(e,t){e=e||{};t=t||{};var r={};Object.keys(t).forEach((function(e){r[e]=t[e]}));Object.keys(e).forEach((function(t){r[t]=e[t]}));return r}minimatch.defaults=function(e){if(!e||!Object.keys(e).length)return minimatch;var t=minimatch;var r=function minimatch(r,s,i){return t.minimatch(r,s,ext(e,i))};r.Minimatch=function Minimatch(r,s){return new t.Minimatch(r,ext(e,s))};return r};Minimatch.defaults=function(e){if(!e||!Object.keys(e).length)return Minimatch;return minimatch.defaults(e).Minimatch};function minimatch(e,t,r){if(typeof t!=="string"){throw new TypeError("glob pattern string required")}if(!r)r={};if(!r.nocomment&&t.charAt(0)==="#"){return false}if(t.trim()==="")return e==="";return new Minimatch(t,r).match(e)}function Minimatch(e,t){if(!(this instanceof Minimatch)){return new Minimatch(e,t)}if(typeof e!=="string"){throw new TypeError("glob pattern string required")}if(!t)t={};e=e.trim();if(s.sep!=="/"){e=e.split(s.sep).join("/")}this.options=t;this.set=[];this.pattern=e;this.regexp=null;this.negate=false;this.comment=false;this.empty=false;this.make()}Minimatch.prototype.debug=function(){};Minimatch.prototype.make=make;function make(){if(this._made)return;var e=this.pattern;var t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=true;return}if(!e){this.empty=true;return}this.parseNegate();var r=this.globSet=this.braceExpand();if(t.debug)this.debug=console.error;this.debug(this.pattern,r);r=this.globParts=r.map((function(e){return e.split(d)}));this.debug(this.pattern,r);r=r.map((function(e,t,r){return e.map(this.parse,this)}),this);this.debug(this.pattern,r);r=r.filter((function(e){return e.indexOf(false)===-1}));this.debug(this.pattern,r);this.set=r}Minimatch.prototype.parseNegate=parseNegate;function parseNegate(){var e=this.pattern;var t=false;var r=this.options;var s=0;if(r.nonegate)return;for(var i=0,n=e.length;i<n&&e.charAt(i)==="!";i++){t=!t;s++}if(s)this.pattern=e.substr(s);this.negate=t}minimatch.braceExpand=function(e,t){return braceExpand(e,t)};Minimatch.prototype.braceExpand=braceExpand;function braceExpand(e,t){if(!t){if(this instanceof Minimatch){t=this.options}else{t={}}}e=typeof e==="undefined"?this.pattern:e;if(typeof e==="undefined"){throw new TypeError("undefined pattern")}if(t.nobrace||!e.match(/\{.*\}/)){return[e]}return n(e)}Minimatch.prototype.parse=parse;var p={};function parse(e,t){if(e.length>1024*64){throw new TypeError("pattern is too long")}var r=this.options;if(!r.noglobstar&&e==="**")return i;if(e==="")return"";var s="";var n=!!r.nocase;var h=false;var c=[];var d=[];var m;var g=false;var y=-1;var b=-1;var v=e.charAt(0)==="."?"":r.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)";var w=this;function clearStateChar(){if(m){switch(m){case"*":s+=l;n=true;break;case"?":s+=a;n=true;break;default:s+="\\"+m;break}w.debug("clearStateChar %j %j",m,s);m=false}}for(var _=0,E=e.length,S;_<E&&(S=e.charAt(_));_++){this.debug("%s\t%s %s %j",e,_,s,S);if(h&&u[S]){s+="\\"+S;h=false;continue}switch(S){case"/":return false;case"\\":clearStateChar();h=true;continue;case"?":case"*":case"+":case"@":case"!":this.debug("%s\t%s %s %j <-- stateChar",e,_,s,S);if(g){this.debug(" in class");if(S==="!"&&_===b+1)S="^";s+=S;continue}w.debug("call clearStateChar %j",m);clearStateChar();m=S;if(r.noext)clearStateChar();continue;case"(":if(g){s+="(";continue}if(!m){s+="\\(";continue}c.push({type:m,start:_-1,reStart:s.length,open:o[m].open,close:o[m].close});s+=m==="!"?"(?:(?!(?:":"(?:";this.debug("plType %j %j",m,s);m=false;continue;case")":if(g||!c.length){s+="\\)";continue}clearStateChar();n=true;var x=c.pop();s+=x.close;if(x.type==="!"){d.push(x)}x.reEnd=s.length;continue;case"|":if(g||!c.length||h){s+="\\|";h=false;continue}clearStateChar();s+="|";continue;case"[":clearStateChar();if(g){s+="\\"+S;continue}g=true;b=_;y=s.length;s+=S;continue;case"]":if(_===b+1||!g){s+="\\"+S;h=false;continue}if(g){var O=e.substring(b+1,_);try{RegExp("["+O+"]")}catch(e){var k=this.parse(O,p);s=s.substr(0,y)+"\\["+k[0]+"\\]";n=n||k[1];g=false;continue}}n=true;g=false;s+=S;continue;default:clearStateChar();if(h){h=false}else if(u[S]&&!(S==="^"&&g)){s+="\\"}s+=S}}if(g){O=e.substr(b+1);k=this.parse(O,p);s=s.substr(0,y)+"\\["+k[0];n=n||k[1]}for(x=c.pop();x;x=c.pop()){var R=s.slice(x.reStart+x.open.length);this.debug("setting tail",s,x);R=R.replace(/((?:\\{2}){0,64})(\\?)\|/g,(function(e,t,r){if(!r){r="\\"}return t+t+r+"|"}));this.debug("tail=%j\n %s",R,R,x,s);var T=x.type==="*"?l:x.type==="?"?a:"\\"+x.type;n=true;s=s.slice(0,x.reStart)+T+"\\("+R}clearStateChar();if(h){s+="\\\\"}var C=false;switch(s.charAt(0)){case".":case"[":case"(":C=true}for(var P=d.length-1;P>-1;P--){var M=d[P];var A=s.slice(0,M.reStart);var I=s.slice(M.reStart,M.reEnd-8);var j=s.slice(M.reEnd-8,M.reEnd);var L=s.slice(M.reEnd);j+=L;var D=A.split("(").length-1;var N=L;for(_=0;_<D;_++){N=N.replace(/\)[+*?]?/,"")}L=N;var $="";if(L===""&&t!==p){$="$"}var B=A+I+L+$+j;s=B}if(s!==""&&n){s="(?=.)"+s}if(C){s=v+s}if(t===p){return[s,n]}if(!n){return globUnescape(e)}var F=r.nocase?"i":"";try{var U=new RegExp("^"+s+"$",F)}catch(e){return new RegExp("$.")}U._glob=e;U._src=s;return U}minimatch.makeRe=function(e,t){return new Minimatch(e,t||{}).makeRe()};Minimatch.prototype.makeRe=makeRe;function makeRe(){if(this.regexp||this.regexp===false)return this.regexp;var e=this.set;if(!e.length){this.regexp=false;return this.regexp}var t=this.options;var r=t.noglobstar?l:t.dot?h:c;var s=t.nocase?"i":"";var n=e.map((function(e){return e.map((function(e){return e===i?r:typeof e==="string"?regExpEscape(e):e._src})).join("\\/")})).join("|");n="^(?:"+n+")$";if(this.negate)n="^(?!"+n+").*$";try{this.regexp=new RegExp(n,s)}catch(e){this.regexp=false}return this.regexp}minimatch.match=function(e,t,r){r=r||{};var s=new Minimatch(t,r);e=e.filter((function(e){return s.match(e)}));if(s.options.nonull&&!e.length){e.push(t)}return e};Minimatch.prototype.match=match;function match(e,t){this.debug("match",e,this.pattern);if(this.comment)return false;if(this.empty)return e==="";if(e==="/"&&t)return true;var r=this.options;if(s.sep!=="/"){e=e.split(s.sep).join("/")}e=e.split(d);this.debug(this.pattern,"split",e);var i=this.set;this.debug(this.pattern,"set",i);var n;var o;for(o=e.length-1;o>=0;o--){n=e[o];if(n)break}for(o=0;o<i.length;o++){var a=i[o];var l=e;if(r.matchBase&&a.length===1){l=[n]}var h=this.matchOne(l,a,t);if(h){if(r.flipNegate)return true;return!this.negate}}if(r.flipNegate)return false;return this.negate}Minimatch.prototype.matchOne=function(e,t,r){var s=this.options;this.debug("matchOne",{this:this,file:e,pattern:t});this.debug("matchOne",e.length,t.length);for(var n=0,o=0,a=e.length,l=t.length;n<a&&o<l;n++,o++){this.debug("matchOne loop");var h=t[o];var c=e[n];this.debug(t,h,c);if(h===false)return false;if(h===i){this.debug("GLOBSTAR",[t,h,c]);var u=n;var d=o+1;if(d===l){this.debug("** at the end");for(;n<a;n++){if(e[n]==="."||e[n]===".."||!s.dot&&e[n].charAt(0)===".")return false}return true}while(u<a){var p=e[u];this.debug("\nglobstar while",e,u,t,d,p);if(this.matchOne(e.slice(u),t.slice(d),r)){this.debug("globstar found match!",u,a,p);return true}else{if(p==="."||p===".."||!s.dot&&p.charAt(0)==="."){this.debug("dot detected!",e,u,t,d);break}this.debug("globstar swallow a segment, and continue");u++}}if(r){this.debug("\n>>> no match, partial?",e,u,t,d);if(u===a)return true}return false}var m;if(typeof h==="string"){if(s.nocase){m=c.toLowerCase()===h.toLowerCase()}else{m=c===h}this.debug("string match",h,c,m)}else{m=c.match(h);this.debug("pattern match",h,c,m)}if(!m)return false}if(n===a&&o===l){return true}else if(n===a){return r}else if(o===l){var g=n===a-1&&e[n]==="";return g}throw new Error("wtf?")};function globUnescape(e){return e.replace(/\\(.)/g,"$1")}function regExpEscape(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}},1077:(e,t,r)=>{"use strict";const s=r(2361);const i=r(665);const n=r(1576).StringDecoder;const o=Symbol("EOF");const a=Symbol("maybeEmitEnd");const l=Symbol("emittedEnd");const h=Symbol("emittingEnd");const c=Symbol("closed");const u=Symbol("read");const d=Symbol("flush");const p=Symbol("flushChunk");const m=Symbol("encoding");const g=Symbol("decoder");const y=Symbol("flowing");const b=Symbol("paused");const v=Symbol("resume");const w=Symbol("bufferLength");const _=Symbol("bufferPush");const E=Symbol("bufferShift");const S=Symbol("objectMode");const x=Symbol("destroyed");const O=global._MP_NO_ITERATOR_SYMBOLS_!=="1";const k=O&&Symbol.asyncIterator||Symbol("asyncIterator not implemented");const R=O&&Symbol.iterator||Symbol("iterator not implemented");const T=Buffer.alloc?Buffer:r(1867).Buffer;const isEndish=e=>e==="end"||e==="finish"||e==="prefinish";const isArrayBuffer=e=>e instanceof ArrayBuffer||typeof e==="object"&&e.constructor&&e.constructor.name==="ArrayBuffer"&&e.byteLength>=0;const isArrayBufferView=e=>!T.isBuffer(e)&&ArrayBuffer.isView(e);e.exports=class Minipass extends s{constructor(e){super();this[y]=false;this[b]=false;this.pipes=new i;this.buffer=new i;this[S]=e&&e.objectMode||false;if(this[S])this[m]=null;else this[m]=e&&e.encoding||null;if(this[m]==="buffer")this[m]=null;this[g]=this[m]?new n(this[m]):null;this[o]=false;this[l]=false;this[h]=false;this[c]=false;this.writable=true;this.readable=true;this[w]=0;this[x]=false}get bufferLength(){return this[w]}get encoding(){return this[m]}set encoding(e){if(this[S])throw new Error("cannot set encoding in objectMode");if(this[m]&&e!==this[m]&&(this[g]&&this[g].lastNeed||this[w]))throw new Error("cannot change encoding");if(this[m]!==e){this[g]=e?new n(e):null;if(this.buffer.length)this.buffer=this.buffer.map((e=>this[g].write(e)))}this[m]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[S]}set objectMode(e){this[S]=this[S]||!!e}write(e,t,r){if(this[o])throw new Error("write after end");if(this[x]){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";if(!this[S]&&!T.isBuffer(e)){if(isArrayBufferView(e))e=T.from(e.buffer,e.byteOffset,e.byteLength);else if(isArrayBuffer(e))e=T.from(e);else if(typeof e!=="string")this.objectMode=true}if(!this.objectMode&&!e.length){const e=this.flowing;if(this[w]!==0)this.emit("readable");if(r)r();return e}if(typeof e==="string"&&!this[S]&&!(t===this[m]&&!this[g].lastNeed)){e=T.from(e,t)}if(T.isBuffer(e)&&this[m])e=this[g].write(e);try{return this.flowing?(this.emit("data",e),this.flowing):(this[_](e),false)}finally{if(this[w]!==0)this.emit("readable");if(r)r()}}read(e){if(this[x])return null;try{if(this[w]===0||e===0||e>this[w])return null;if(this[S])e=null;if(this.buffer.length>1&&!this[S]){if(this.encoding)this.buffer=new i([Array.from(this.buffer).join("")]);else this.buffer=new i([T.concat(Array.from(this.buffer),this[w])])}return this[u](e||null,this.buffer.head.value)}finally{this[a]()}}[u](e,t){if(e===t.length||e===null)this[E]();else{this.buffer.head.value=t.slice(e);t=t.slice(0,e);this[w]-=e}this.emit("data",t);if(!this.buffer.length&&!this[o])this.emit("drain");return t}end(e,t,r){if(typeof e==="function")r=e,e=null;if(typeof t==="function")r=t,t="utf8";if(e)this.write(e,t);if(r)this.once("end",r);this[o]=true;this.writable=false;if(this.flowing||!this[b])this[a]();return this}[v](){if(this[x])return;this[b]=false;this[y]=true;this.emit("resume");if(this.buffer.length)this[d]();else if(this[o])this[a]();else this.emit("drain")}resume(){return this[v]()}pause(){this[y]=false;this[b]=true}get destroyed(){return this[x]}get flowing(){return this[y]}get paused(){return this[b]}[_](e){if(this[S])this[w]+=1;else this[w]+=e.length;return this.buffer.push(e)}[E](){if(this.buffer.length){if(this[S])this[w]-=1;else this[w]-=this.buffer.head.value.length}return this.buffer.shift()}[d](){do{}while(this[p](this[E]()));if(!this.buffer.length&&!this[o])this.emit("drain")}[p](e){return e?(this.emit("data",e),this.flowing):false}pipe(e,t){if(this[x])return;const r=this[l];t=t||{};if(e===process.stdout||e===process.stderr)t.end=false;else t.end=t.end!==false;const s={dest:e,opts:t,ondrain:e=>this[v]()};this.pipes.push(s);e.on("drain",s.ondrain);this[v]();if(r&&s.opts.end)s.dest.end();return e}addListener(e,t){return this.on(e,t)}on(e,t){try{return super.on(e,t)}finally{if(e==="data"&&!this.pipes.length&&!this.flowing)this[v]();else if(isEndish(e)&&this[l]){super.emit(e);this.removeAllListeners(e)}}}get emittedEnd(){return this[l]}[a](){if(!this[h]&&!this[l]&&!this[x]&&this.buffer.length===0&&this[o]){this[h]=true;this.emit("end");this.emit("prefinish");this.emit("finish");if(this[c])this.emit("close");this[h]=false}}emit(e,t){if(e!=="error"&&e!=="close"&&e!==x&&this[x])return;else if(e==="data"){if(!t)return;if(this.pipes.length)this.pipes.forEach((e=>e.dest.write(t)===false&&this.pause()))}else if(e==="end"){if(this[l]===true)return;this[l]=true;this.readable=false;if(this[g]){t=this[g].end();if(t){this.pipes.forEach((e=>e.dest.write(t)));super.emit("data",t)}}this.pipes.forEach((e=>{e.dest.removeListener("drain",e.ondrain);if(e.opts.end)e.dest.end()}))}else if(e==="close"){this[c]=true;if(!this[l]&&!this[x])return}const r=new Array(arguments.length);r[0]=e;r[1]=t;if(arguments.length>2){for(let e=2;e<arguments.length;e++){r[e]=arguments[e]}}try{return super.emit.apply(this,r)}finally{if(!isEndish(e))this[a]();else this.removeAllListeners(e)}}collect(){const e=[];e.dataLength=0;this.on("data",(t=>{e.push(t);e.dataLength+=t.length}));return this.promise().then((()=>e))}concat(){return this[S]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then((e=>this[S]?Promise.reject(new Error("cannot concat in objectMode")):this[m]?e.join(""):T.concat(e,e.dataLength)))}promise(){return new Promise(((e,t)=>{this.on(x,(()=>t(new Error("stream destroyed"))));this.on("end",(()=>e()));this.on("error",(e=>t(e)))}))}[k](){const next=()=>{const e=this.read();if(e!==null)return Promise.resolve({done:false,value:e});if(this[o])return Promise.resolve({done:true});let t=null;let r=null;const onerr=e=>{this.removeListener("data",ondata);this.removeListener("end",onend);r(e)};const ondata=e=>{this.removeListener("error",onerr);this.removeListener("end",onend);this.pause();t({value:e,done:!!this[o]})};const onend=()=>{this.removeListener("error",onerr);this.removeListener("data",ondata);t({done:true})};const ondestroy=()=>onerr(new Error("stream destroyed"));return new Promise(((e,s)=>{r=s;t=e;this.once(x,ondestroy);this.once("error",onerr);this.once("end",onend);this.once("data",ondata)}))};return{next:next}}[R](){const next=()=>{const e=this.read();const t=e===null;return{value:e,done:t}};return{next:next}}destroy(e){if(this[x]){if(e)this.emit("error",e);else this.emit(x);return this}this[x]=true;this.buffer=new i;this[w]=0;if(typeof this.close==="function"&&!this[c])this.close();if(e)this.emit("error",e);else this.emit(x);return this}static isStream(e){return!!e&&(e instanceof Minipass||e instanceof s&&(typeof e.pipe==="function"||typeof e.write==="function"&&typeof e.end==="function"))}}},6769:(e,t,r)=>{const s=r(9796).constants||{ZLIB_VERNUM:4736};e.exports=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:Infinity,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},s))},3486:(e,t,r)=>{"use strict";const s=r(9491);const i=r(4300).Buffer;const n=r(9796);const o=t.constants=r(6769);const a=r(1077);const l=i.concat;class ZlibError extends Error{constructor(e){super("zlib: "+e.message);this.code=e.code;this.errno=e.errno;if(!this.code)this.code="ZLIB_ERROR";this.message="zlib: "+e.message;Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}}const h=Symbol("opts");const c=Symbol("flushFlag");const u=Symbol("finishFlushFlag");const d=Symbol("fullFlushFlag");const p=Symbol("handle");const m=Symbol("onError");const g=Symbol("sawError");const y=Symbol("level");const b=Symbol("strategy");const v=Symbol("ended");const w=Symbol("_defaultFullFlush");class ZlibBase extends a{constructor(e,t){if(!e||typeof e!=="object")throw new TypeError("invalid options for ZlibBase constructor");super(e);this[v]=false;this[h]=e;this[c]=e.flush;this[u]=e.finishFlush;try{this[p]=new n[t](e)}catch(e){throw new ZlibError(e)}this[m]=e=>{this[g]=true;this.close();this.emit("error",e)};this[p].on("error",(e=>this[m](new ZlibError(e))));this.once("end",(()=>this.close))}close(){if(this[p]){this[p].close();this[p]=null;this.emit("close")}}reset(){if(!this[g]){s(this[p],"zlib binding closed");return this[p].reset()}}flush(e){if(this.ended)return;if(typeof e!=="number")e=this[d];this.write(Object.assign(i.alloc(0),{[c]:e}))}end(e,t,r){if(e)this.write(e,t);this.flush(this[u]);this[v]=true;return super.end(null,null,r)}get ended(){return this[v]}write(e,t,r){if(typeof t==="function")r=t,t="utf8";if(typeof e==="string")e=i.from(e,t);if(this[g])return;s(this[p],"zlib binding closed");const n=this[p]._handle;const o=n.close;n.close=()=>{};const a=this[p].close;this[p].close=()=>{};i.concat=e=>e;let h;try{const t=typeof e[c]==="number"?e[c]:this[c];h=this[p]._processChunk(e,t);i.concat=l}catch(e){i.concat=l;this[m](new ZlibError(e))}finally{if(this[p]){this[p]._handle=n;n.close=o;this[p].close=a;this[p].removeAllListeners("error")}}let u;if(h){if(Array.isArray(h)&&h.length>0){u=super.write(i.from(h[0]));for(let e=1;e<h.length;e++){u=super.write(h[e])}}else{u=super.write(i.from(h))}}if(r)r();return u}}class Zlib extends ZlibBase{constructor(e,t){e=e||{};e.flush=e.flush||o.Z_NO_FLUSH;e.finishFlush=e.finishFlush||o.Z_FINISH;super(e,t);this[d]=o.Z_FULL_FLUSH;this[y]=e.level;this[b]=e.strategy}params(e,t){if(this[g])return;if(!this[p])throw new Error("cannot switch params when binding is closed");if(!this[p].params)throw new Error("not supported in this implementation");if(this[y]!==e||this[b]!==t){this.flush(o.Z_SYNC_FLUSH);s(this[p],"zlib binding closed");const r=this[p].flush;this[p].flush=(e,t)=>{this.flush(e);t()};try{this[p].params(e,t)}finally{this[p].flush=r}if(this[p]){this[y]=e;this[b]=t}}}}class Deflate extends Zlib{constructor(e){super(e,"Deflate")}}class Inflate extends Zlib{constructor(e){super(e,"Inflate")}}class Gzip extends Zlib{constructor(e){super(e,"Gzip")}}class Gunzip extends Zlib{constructor(e){super(e,"Gunzip")}}class DeflateRaw extends Zlib{constructor(e){super(e,"DeflateRaw")}}class InflateRaw extends Zlib{constructor(e){super(e,"InflateRaw")}}class Unzip extends Zlib{constructor(e){super(e,"Unzip")}}class Brotli extends ZlibBase{constructor(e,t){e=e||{};e.flush=e.flush||o.BROTLI_OPERATION_PROCESS;e.finishFlush=e.finishFlush||o.BROTLI_OPERATION_FINISH;super(e,t);this[d]=o.BROTLI_OPERATION_FLUSH}}class BrotliCompress extends Brotli{constructor(e){super(e,"BrotliCompress")}}class BrotliDecompress extends Brotli{constructor(e){super(e,"BrotliDecompress")}}t.Deflate=Deflate;t.Inflate=Inflate;t.Gzip=Gzip;t.Gunzip=Gunzip;t.DeflateRaw=DeflateRaw;t.InflateRaw=InflateRaw;t.Unzip=Unzip;if(typeof n.BrotliCompress==="function"){t.BrotliCompress=BrotliCompress;t.BrotliDecompress=BrotliDecompress}else{t.BrotliCompress=t.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}}},6186:(e,t,r)=>{var s=r(1017);var i=r(7147);var n=parseInt("0777",8);e.exports=mkdirP.mkdirp=mkdirP.mkdirP=mkdirP;function mkdirP(e,t,r,o){if(typeof t==="function"){r=t;t={}}else if(!t||typeof t!=="object"){t={mode:t}}var a=t.mode;var l=t.fs||i;if(a===undefined){a=n}if(!o)o=null;var h=r||function(){};e=s.resolve(e);l.mkdir(e,a,(function(r){if(!r){o=o||e;return h(null,o)}switch(r.code){case"ENOENT":if(s.dirname(e)===e)return h(r);mkdirP(s.dirname(e),t,(function(r,s){if(r)h(r,s);else mkdirP(e,t,h,s)}));break;default:l.stat(e,(function(e,t){if(e||!t.isDirectory())h(r,o);else h(null,o)}));break}}))}mkdirP.sync=function sync(e,t,r){if(!t||typeof t!=="object"){t={mode:t}}var o=t.mode;var a=t.fs||i;if(o===undefined){o=n}if(!r)r=null;e=s.resolve(e);try{a.mkdirSync(e,o);r=r||e}catch(i){switch(i.code){case"ENOENT":r=sync(s.dirname(e),t,r);sync(e,t,r);break;default:var l;try{l=a.statSync(e)}catch(e){throw i}if(!l.isDirectory())throw i;break}}return r}},7952:e=>{"use strict";const t="text/plain";const r="us-ascii";const testParameter=(e,t)=>t.some((t=>t instanceof RegExp?t.test(e):t===e));const normalizeDataURL=(e,{stripHash:s})=>{const i=/^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(e);if(!i){throw new Error(`Invalid URL: ${e}`)}let{type:n,data:o,hash:a}=i.groups;const l=n.split(";");a=s?"":a;let h=false;if(l[l.length-1]==="base64"){l.pop();h=true}const c=(l.shift()||"").toLowerCase();const u=l.map((e=>{let[t,s=""]=e.split("=").map((e=>e.trim()));if(t==="charset"){s=s.toLowerCase();if(s===r){return""}}return`${t}${s?`=${s}`:""}`})).filter(Boolean);const d=[...u];if(h){d.push("base64")}if(d.length!==0||c&&c!==t){d.unshift(c)}return`data:${d.join(";")},${h?o.trim():o}${a?`#${a}`:""}`};const normalizeUrl=(e,t)=>{t={defaultProtocol:"http:",normalizeProtocol:true,forceHttp:false,forceHttps:false,stripAuthentication:true,stripHash:false,stripTextFragment:true,stripWWW:true,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:true,removeSingleSlash:true,removeDirectoryIndex:false,sortQueryParameters:true,...t};e=e.trim();if(/^data:/i.test(e)){return normalizeDataURL(e,t)}if(/^view-source:/i.test(e)){throw new Error("`view-source:` is not supported as it is a non-standard protocol")}const r=e.startsWith("//");const s=!r&&/^\.*\//.test(e);if(!s){e=e.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,t.defaultProtocol)}const i=new URL(e);if(t.forceHttp&&t.forceHttps){throw new Error("The `forceHttp` and `forceHttps` options cannot be used together")}if(t.forceHttp&&i.protocol==="https:"){i.protocol="http:"}if(t.forceHttps&&i.protocol==="http:"){i.protocol="https:"}if(t.stripAuthentication){i.username="";i.password=""}if(t.stripHash){i.hash=""}else if(t.stripTextFragment){i.hash=i.hash.replace(/#?:~:text.*?$/i,"")}if(i.pathname){i.pathname=i.pathname.replace(/(?<!\b(?:[a-z][a-z\d+\-.]{1,50}:))\/{2,}/g,"/")}if(i.pathname){try{i.pathname=decodeURI(i.pathname)}catch(e){}}if(t.removeDirectoryIndex===true){t.removeDirectoryIndex=[/^index\.[a-z]+$/]}if(Array.isArray(t.removeDirectoryIndex)&&t.removeDirectoryIndex.length>0){let e=i.pathname.split("/");const r=e[e.length-1];if(testParameter(r,t.removeDirectoryIndex)){e=e.slice(0,e.length-1);i.pathname=e.slice(1).join("/")+"/"}}if(i.hostname){i.hostname=i.hostname.replace(/\.$/,"");if(t.stripWWW&&/^www\.(?!www\.)(?:[a-z\-\d]{1,63})\.(?:[a-z.\-\d]{2,63})$/.test(i.hostname)){i.hostname=i.hostname.replace(/^www\./,"")}}if(Array.isArray(t.removeQueryParameters)){for(const e of[...i.searchParams.keys()]){if(testParameter(e,t.removeQueryParameters)){i.searchParams.delete(e)}}}if(t.removeQueryParameters===true){i.search=""}if(t.sortQueryParameters){i.searchParams.sort()}if(t.removeTrailingSlash){i.pathname=i.pathname.replace(/\/$/,"")}const n=e;e=i.toString();if(!t.removeSingleSlash&&i.pathname==="/"&&!n.endsWith("/")&&i.hash===""){e=e.replace(/\/$/,"")}if((t.removeTrailingSlash||i.pathname==="/")&&i.hash===""&&t.removeSingleSlash){e=e.replace(/\/$/,"")}if(r&&!t.normalizeProtocol){e=e.replace(/^http:\/\//,"//")}if(t.stripProtocol){e=e.replace(/^(?:https?:)?\/\//,"")}return e};e.exports=normalizeUrl},1223:(e,t,r)=>{var s=r(2940);e.exports=s(once);e.exports.strict=s(onceStrict);once.proto=once((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return once(this)},configurable:true});Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return onceStrict(this)},configurable:true})}));function once(e){var f=function(){if(f.called)return f.value;f.called=true;return f.value=e.apply(this,arguments)};f.called=false;return f}function onceStrict(e){var f=function(){if(f.called)throw new Error(f.onceError);f.called=true;return f.value=e.apply(this,arguments)};var t=e.name||"Function wrapped with `once`";f.onceError=t+" shouldn't be called more than once";f.called=false;return f}},9072:e=>{"use strict";class CancelError extends Error{constructor(e){super(e||"Promise was canceled");this.name="CancelError"}get isCanceled(){return true}}class PCancelable{static fn(e){return(...t)=>new PCancelable(((r,s,i)=>{t.push(i);e(...t).then(r,s)}))}constructor(e){this._cancelHandlers=[];this._isPending=true;this._isCanceled=false;this._rejectOnCancel=true;this._promise=new Promise(((t,r)=>{this._reject=r;const onResolve=e=>{if(!this._isCanceled||!onCancel.shouldReject){this._isPending=false;t(e)}};const onReject=e=>{this._isPending=false;r(e)};const onCancel=e=>{if(!this._isPending){throw new Error("The `onCancel` handler was attached after the promise settled.")}this._cancelHandlers.push(e)};Object.defineProperties(onCancel,{shouldReject:{get:()=>this._rejectOnCancel,set:e=>{this._rejectOnCancel=e}}});return e(onResolve,onReject,onCancel)}))}then(e,t){return this._promise.then(e,t)}catch(e){return this._promise.catch(e)}finally(e){return this._promise.finally(e)}cancel(e){if(!this._isPending||this._isCanceled){return}this._isCanceled=true;if(this._cancelHandlers.length>0){try{for(const e of this._cancelHandlers){e()}}catch(e){this._reject(e);return}}if(this._rejectOnCancel){this._reject(new CancelError(e))}}get isCanceled(){return this._isCanceled}}Object.setPrototypeOf(PCancelable.prototype,Promise.prototype);e.exports=PCancelable;e.exports.CancelError=CancelError},4568:(e,t,r)=>{"use strict";const s=r(6424);const i=Symbol.asyncIterator||"@@asyncIterator";const normalizeEmitter=e=>{const t=e.on||e.addListener||e.addEventListener;const r=e.off||e.removeListener||e.removeEventListener;if(!t||!r){throw new TypeError("Emitter is not compatible")}return{addListener:t.bind(e),removeListener:r.bind(e)}};const toArray=e=>Array.isArray(e)?e:[e];const multiple=(e,t,r)=>{let i;const n=new Promise(((s,n)=>{r={rejectionEvents:["error"],multiArgs:false,resolveImmediately:false,...r};if(!(r.count>=0&&(r.count===Infinity||Number.isInteger(r.count)))){throw new TypeError("The `count` option should be at least 0 or more")}const o=toArray(t);const a=[];const{addListener:l,removeListener:h}=normalizeEmitter(e);const onItem=(...e)=>{const t=r.multiArgs?e:e[0];if(r.filter&&!r.filter(t)){return}a.push(t);if(r.count===a.length){i();s(a)}};const rejectHandler=e=>{i();n(e)};i=()=>{for(const e of o){h(e,onItem)}for(const e of r.rejectionEvents){h(e,rejectHandler)}};for(const e of o){l(e,onItem)}for(const e of r.rejectionEvents){l(e,rejectHandler)}if(r.resolveImmediately){s(a)}}));n.cancel=i;if(typeof r.timeout==="number"){const e=s(n,r.timeout);e.cancel=i;return e}return n};const pEvent=(e,t,r)=>{if(typeof r==="function"){r={filter:r}}r={...r,count:1,resolveImmediately:false};const s=multiple(e,t,r);const i=s.then((e=>e[0]));i.cancel=s.cancel;return i};e.exports=pEvent;e.exports["default"]=pEvent;e.exports.multiple=multiple;e.exports.iterator=(e,t,r)=>{if(typeof r==="function"){r={filter:r}}const s=toArray(t);r={rejectionEvents:["error"],resolutionEvents:[],limit:Infinity,multiArgs:false,...r};const{limit:n}=r;const o=n>=0&&(n===Infinity||Number.isInteger(n));if(!o){throw new TypeError("The `limit` option should be a non-negative integer or Infinity")}if(n===0){return{[Symbol.asyncIterator](){return this},async next(){return{done:true,value:undefined}}}}const{addListener:a,removeListener:l}=normalizeEmitter(e);let h=false;let c;let u=false;const d=[];const p=[];let m=0;let g=false;const valueHandler=(...e)=>{m++;g=m===n;const t=r.multiArgs?e:e[0];if(d.length>0){const{resolve:e}=d.shift();e({done:false,value:t});if(g){cancel()}return}p.push(t);if(g){cancel()}};const cancel=()=>{h=true;for(const e of s){l(e,valueHandler)}for(const e of r.rejectionEvents){l(e,rejectHandler)}for(const e of r.resolutionEvents){l(e,resolveHandler)}while(d.length>0){const{resolve:e}=d.shift();e({done:true,value:undefined})}};const rejectHandler=(...e)=>{c=r.multiArgs?e:e[0];if(d.length>0){const{reject:e}=d.shift();e(c)}else{u=true}cancel()};const resolveHandler=(...e)=>{const t=r.multiArgs?e:e[0];if(r.filter&&!r.filter(t)){return}if(d.length>0){const{resolve:e}=d.shift();e({done:true,value:t})}else{p.push(t)}cancel()};for(const e of s){a(e,valueHandler)}for(const e of r.rejectionEvents){a(e,rejectHandler)}for(const e of r.resolutionEvents){a(e,resolveHandler)}return{[i](){return this},async next(){if(p.length>0){const e=p.shift();return{done:h&&p.length===0&&!g,value:e}}if(u){u=false;throw c}if(h){return{done:true,value:undefined}}return new Promise(((e,t)=>d.push({resolve:e,reject:t})))},async return(e){cancel();return{done:h,value:e}}}};e.exports.TimeoutError=s.TimeoutError},1330:e=>{"use strict";e.exports=(e,t)=>{t=t||(()=>{});return e.then((e=>new Promise((e=>{e(t())})).then((()=>e))),(e=>new Promise((e=>{e(t())})).then((()=>{throw e}))))}},6424:(e,t,r)=>{"use strict";const s=r(1330);class TimeoutError extends Error{constructor(e){super(e);this.name="TimeoutError"}}const pTimeout=(e,t,r)=>new Promise(((i,n)=>{if(typeof t!=="number"||t<0){throw new TypeError("Expected `milliseconds` to be a positive number")}if(t===Infinity){i(e);return}const o=setTimeout((()=>{if(typeof r==="function"){try{i(r())}catch(e){n(e)}return}const s=typeof r==="string"?r:`Promise timed out after ${t} milliseconds`;const o=r instanceof Error?r:new TimeoutError(s);if(typeof e.cancel==="function"){e.cancel()}n(o)}),t);s(e.then(i,n),(()=>{clearTimeout(o)}))}));e.exports=pTimeout;e.exports["default"]=pTimeout;e.exports.TimeoutError=TimeoutError},3396:(e,t,r)=>{var s=r(7310).parse;e.exports=function(e){var t=/^([\w-.]+)\/([\w-.]+)((?:#|@).+)?$/.exec(e);if(t)return format(t);e=e.replace("//www.","//");e=e.replace(/^git@/,"https://");e=e.replace(/^https:git@/,"https://");e=e.replace(".com:",".com/");if(!~e.indexOf("://")){return false}var r=s(e);var i=r.pathname.replace(/\.git$/,"");var t=/^\/([\w-.]+)\/([\w-.]+)$/.exec(i);if(t)return t.slice(1,3).concat((r.hash||"").slice(1));var t=/^\/repos\/([\w-.]+)\/([\w-.]+)\/(?:tarball|zipball)(\/.+)?$/.exec(i);if(t)return format(t);var t=/^\/([\w-.]+)\/([\w-.]+)\/(?:legacy\.(?:zip|tar\.gz))(\/.+)?$/.exec(i);if(t)return format(t);var t=/^\/([\w-]+)\/([\w-.]+)\/archive\/(.+)\.tar\.gz?$/.exec(i);if(t)return t.slice(1,4);if(~r.host.indexOf("gitlab")){var t=/^\/((?:[\w-.]+\/)+)([\w-.]+)$/.exec(i);if(t){t=t.slice(1,3);t[0]=t[0].slice(0,-1);return t.concat((r.hash||"").slice(1))}}return false};function format(e){var t=(e[3]||"").slice(1);if(/^['"]/.test(t))t=t.slice(1,-1);return[e[1],e[2],t]}},8714:e=>{"use strict";function posix(e){return e.charAt(0)==="/"}function win32(e){var t=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;var r=t.exec(e);var s=r[1]||"";var i=Boolean(s&&s.charAt(1)!==":");return Boolean(r[2]||i)}e.exports=process.platform==="win32"?win32:posix;e.exports.posix=posix;e.exports.win32=win32},7280:e=>{"use strict";class DatePart{constructor({token:e,date:t,parts:r,locales:s}){this.token=e;this.date=t||new Date;this.parts=r||[this];this.locales=s||{}}up(){}down(){}next(){const e=this.parts.indexOf(this);return this.parts.find(((t,r)=>r>e&&t instanceof DatePart))}setTo(e){}prev(){let e=[].concat(this.parts).reverse();const t=e.indexOf(this);return e.find(((e,r)=>r>t&&e instanceof DatePart))}toString(){return String(this.date)}}e.exports=DatePart},4203:(e,t,r)=>{"use strict";const s=r(7280);const pos=e=>{e=e%10;return e===1?"st":e===2?"nd":e===3?"rd":"th"};class Day extends s{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate();let t=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+pos(e):this.token==="d"?t+1:this.token==="ddd"?this.locales.weekdaysShort[t]:this.token==="dddd"?this.locales.weekdays[t]:e}}e.exports=Day},2574:(e,t,r)=>{"use strict";const s=r(7280);class Hours extends s{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();if(/h/.test(this.token))e=e%12||12;return this.token.length>1?String(e).padStart(2,"0"):e}}e.exports=Hours},2408:(e,t,r)=>{"use strict";e.exports={DatePart:r(7280),Meridiem:r(4853),Day:r(4203),Hours:r(2574),Milliseconds:r(4909),Minutes:r(5876),Month:r(9461),Seconds:r(5884),Year:r(359)}},4853:(e,t,r)=>{"use strict";const s=r(7280);class Meridiem extends s{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}}e.exports=Meridiem},4909:(e,t,r)=>{"use strict";const s=r(7280);class Milliseconds extends s{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}e.exports=Milliseconds},5876:(e,t,r)=>{"use strict";const s=r(7280);class Minutes extends s{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}}e.exports=Minutes},9461:(e,t,r)=>{"use strict";const s=r(7280);class Month extends s{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1;this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth();let t=this.token.length;return t===2?String(e+1).padStart(2,"0"):t===3?this.locales.monthsShort[e]:t===4?this.locales.months[e]:String(e+1)}}e.exports=Month},5884:(e,t,r)=>{"use strict";const s=r(7280);class Seconds extends s{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}}e.exports=Seconds},359:(e,t,r)=>{"use strict";const s=r(7280);class Year extends s{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}}e.exports=Year},2257:(e,t,r)=>{"use strict";function asyncGeneratorStep(e,t,r,s,i,n,o){try{var a=e[n](o);var l=a.value}catch(e){r(e);return}if(a.done){t(l)}else{Promise.resolve(l).then(s,i)}}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(s,i){var n=e.apply(t,r);function _next(e){asyncGeneratorStep(n,s,i,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(n,s,i,_next,_throw,"throw",e)}_next(undefined)}))}}const s=r(5215);const i=r(461);const n=r(9571),o=n.cursor;const a=r(8091),l=a.style,h=a.clear,c=a.figures,u=a.strip;const getVal=(e,t)=>e[t]&&(e[t].value||e[t].title||e[t]);const getTitle=(e,t)=>e[t]&&(e[t].title||e[t].value||e[t]);const getIndex=(e,t)=>{const r=e.findIndex((e=>e.value===t||e.title===t));return r>-1?r:undefined};class AutocompletePrompt extends i{constructor(e={}){super(e);this.msg=e.message;this.suggest=e.suggest;this.choices=e.choices;this.initial=typeof e.initial==="number"?e.initial:getIndex(e.choices,e.initial);this.select=this.initial||e.cursor||0;this.fallback=e.fallback||(e.initial!==undefined?`${c.pointerSmall} ${getTitle(this.choices,this.initial)}`:`${c.pointerSmall} ${e.noMatches||"no matches found"}`);this.suggestions=[[]];this.page=0;this.input="";this.limit=e.limit||10;this.cursor=0;this.transform=l.render(e.style);this.scale=this.transform.scale;this.render=this.render.bind(this);this.complete=this.complete.bind(this);this.clear=h("");this.complete(this.render);this.render()}moveSelect(e){this.select=e;if(this.suggestions[this.page].length>0){this.value=getVal(this.suggestions[this.page],e)}else{this.value=this.initial!==undefined?getVal(this.choices,this.initial):null}this.fire()}complete(e){var t=this;return _asyncToGenerator((function*(){const r=t.completing=t.suggest(t.input,t.choices);const s=yield r;if(t.completing!==r)return;t.suggestions=s.map(((e,t,r)=>({title:getTitle(r,t),value:getVal(r,t)}))).reduce(((e,r)=>{if(e[e.length-1].length<t.limit)e[e.length-1].push(r);else e.push([r]);return e}),[[]]);t.isFallback=false;t.completing=false;if(!t.suggestions[t.page])t.page=0;if(!t.suggestions.length&&t.fallback){const e=getIndex(t.choices,t.fallback);t.suggestions=[[]];if(e!==undefined)t.suggestions[0].push({title:getTitle(t.choices,e),value:getVal(t.choices,e)});t.isFallback=true}const i=Math.max(s.length-1,0);t.moveSelect(Math.min(i,t.select));e&&e()}))()}reset(){this.input="";this.complete((()=>{this.moveSelect(this.initial!==void 0?this.initial:0);this.render()}));this.render()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}_(e,t){let r=this.input.slice(0,this.cursor);let s=this.input.slice(this.cursor);this.input=`${r}${e}${s}`;this.cursor=r.length+1;this.complete(this.render);this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1);let t=this.input.slice(this.cursor);this.input=`${e}${t}`;this.complete(this.render);this.cursor=this.cursor-1;this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor);let t=this.input.slice(this.cursor+1);this.input=`${e}${t}`;this.complete(this.render);this.render()}first(){this.moveSelect(0);this.render()}last(){this.moveSelect(this.suggestions[this.page].length-1);this.render()}up(){if(this.select<=0)return this.bell();this.moveSelect(this.select-1);this.render()}down(){if(this.select>=this.suggestions[this.page].length-1)return this.bell();this.moveSelect(this.select+1);this.render()}next(){if(this.select===this.suggestions[this.page].length-1){this.page=(this.page+1)%this.suggestions.length;this.moveSelect(0)}else this.moveSelect(this.select+1);this.render()}nextPage(){if(this.page>=this.suggestions.length-1)return this.bell();this.page++;this.moveSelect(0);this.render()}prevPage(){if(this.page<=0)return this.bell();this.page--;this.moveSelect(0);this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1;this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1;this.render()}render(){if(this.closed)return;super.render();if(this.lineCount)this.out.write(o.down(this.lineCount));let e=s.bold(`${l.symbol(this.done,this.aborted)} ${this.msg} `)+`${l.delimiter(this.completing)} `;let t=u(e).length;if(this.done&&this.suggestions[this.page][this.select]){e+=`${this.suggestions[this.page][this.select].title}`}else{this.rendered=`${this.transform.render(this.input)}`;t+=this.rendered.length;e+=this.rendered}if(!this.done){this.lineCount=this.suggestions[this.page].length;let t=this.suggestions[this.page].reduce(((e,t,r)=>e+`\n${r===this.select?s.cyan(t.title):t.title}`),"");if(t&&!this.isFallback){e+=t;if(this.suggestions.length>1){this.lineCount++;e+=s.blue(`\nPage ${this.page+1}/${this.suggestions.length}`)}}else{const t=getIndex(this.choices,this.fallback);const r=t!==undefined?getTitle(this.choices,t):this.fallback;e+=`\n${s.gray(r)}`;this.lineCount++}}this.out.write(this.clear+e);this.clear=h(e);if(this.lineCount&&!this.done){let e=o.up(this.lineCount);e+=o.left+o.to(t);e+=o.move(-this.rendered.length+this.cursor*this.scale);this.out.write(e)}}}e.exports=AutocompletePrompt},5441:(e,t,r)=>{"use strict";const s=r(5215);const i=r(9571),n=i.cursor;const o=r(4140);const a=r(8091),l=a.clear,h=a.style,c=a.figures;class AutocompleteMultiselectPrompt extends o{constructor(e={}){e.overrideRender=true;super(e);this.inputValue="";this.clear=l("");this.filteredOptions=this.value;this.render()}last(){this.cursor=this.filteredOptions.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length;this.render()}up(){if(this.cursor===0){this.cursor=this.filteredOptions.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.filteredOptions.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.filteredOptions[this.cursor].selected=false;this.render()}right(){if(this.value.filter((e=>e.selected)).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=true;this.render()}delete(){if(this.inputValue.length){this.inputValue=this.inputValue.substr(0,this.inputValue.length-1);this.updateFilteredOptions()}}updateFilteredOptions(){const e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((e=>{if(this.inputValue){if(typeof e.title==="string"){if(e.title.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}if(typeof e.value==="string"){if(e.value.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}return false}return true}));const t=this.filteredOptions.findIndex((t=>t===e));this.cursor=t<0?0:t;this.render()}handleSpaceToggle(){const e=this.filteredOptions[this.cursor];if(e.selected){e.selected=false;this.render()}else if(e.disabled||this.value.filter((e=>e.selected)).length>=this.maxChoices){return this.bell()}else{e.selected=true;this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e;this.updateFilteredOptions()}_(e,t){if(e===" "){this.handleSpaceToggle()}else{this.handleInputChange(e)}}renderInstructions(){return`\nInstructions:\n ${c.arrowUp}/${c.arrowDown}: Highlight option\n ${c.arrowLeft}/${c.arrowRight}/[space]: Toggle selection\n [a,b,c]/delete: Filter choices\n enter/return: Complete answer\n `}renderCurrentInput(){return`\nFiltered results for: ${this.inputValue?this.inputValue:s.gray("Enter something to filter")}\n`}renderOption(e,t,r){let i;if(t.disabled)i=e===r?s.gray().underline(t.title):s.strikethrough().gray(t.title);else i=e===r?s.cyan().underline(t.title):t.title;return(t.selected?s.green(c.radioOn):c.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done){const e=this.value.filter((e=>e.selected)).map((e=>e.title)).join(", ");return e}const e=[s.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];if(this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled){e.push(s.yellow(this.warn))}return e.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(n.hide);super.render();let e=[h.symbol(this.done,this.aborted),s.bold(this.msg),h.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){e+=s.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}e+=this.renderOptions(this.filteredOptions);this.out.write(this.clear+e);this.clear=l(e)}}e.exports=AutocompleteMultiselectPrompt},9486:(e,t,r)=>{"use strict";const s=r(5215);const i=r(461);const n=r(8091),o=n.style;const a=r(9571),l=a.erase,h=a.cursor;class ConfirmPrompt extends i{constructor(e={}){super(e);this.msg=e.message;this.value=e.initial;this.initialValue=!!e.initial;this.yesMsg=e.yes||"yes";this.yesOption=e.yesOption||"(Y/n)";this.noMsg=e.no||"no";this.noOption=e.noOption||"(y/N)";this.render()}reset(){this.value=this.initialValue;this.fire();this.render()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.value=this.value||false;this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}_(e,t){if(e.toLowerCase()==="y"){this.value=true;return this.submit()}if(e.toLowerCase()==="n"){this.value=false;return this.submit()}return this.bell()}render(){if(this.closed)return;if(this.firstRender)this.out.write(h.hide);super.render();this.out.write(l.line+h.to(0)+[o.symbol(this.done,this.aborted),s.bold(this.msg),o.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:s.gray(this.initialValue?this.yesOption:this.noOption)].join(" "))}}e.exports=ConfirmPrompt},4177:(e,t,r)=>{"use strict";function asyncGeneratorStep(e,t,r,s,i,n,o){try{var a=e[n](o);var l=a.value}catch(e){r(e);return}if(a.done){t(l)}else{Promise.resolve(l).then(s,i)}}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(s,i){var n=e.apply(t,r);function _next(e){asyncGeneratorStep(n,s,i,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(n,s,i,_next,_throw,"throw",e)}_next(undefined)}))}}const s=r(5215);const i=r(461);const n=r(8091),o=n.style,a=n.clear,l=n.figures,h=n.strip;const c=r(9571),u=c.erase,d=c.cursor;const p=r(2408),m=p.DatePart,g=p.Meridiem,y=p.Day,b=p.Hours,v=p.Milliseconds,w=p.Minutes,_=p.Month,E=p.Seconds,S=p.Year;const x=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g;const O={1:({token:e})=>e.replace(/\\(.)/g,"$1"),2:e=>new y(e),3:e=>new _(e),4:e=>new S(e),5:e=>new g(e),6:e=>new b(e),7:e=>new w(e),8:e=>new E(e),9:e=>new v(e)};const k={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class DatePrompt extends i{constructor(e={}){super(e);this.msg=e.message;this.cursor=0;this.typed="";this.locales=Object.assign(k,e.locales);this._date=e.initial||new Date;this.errorMsg=e.error||"Please Enter A Valid Value";this.validator=e.validate||(()=>true);this.mask=e.mask||"YYYY-MM-DD HH:mm:ss";this.clear=a("");this.render()}get value(){return this.date}get date(){return this._date}set date(e){if(e)this._date.setTime(e.getTime())}set mask(e){let t;this.parts=[];while(t=x.exec(e)){let e=t.shift();let r=t.findIndex((e=>e!=null));this.parts.push(r in O?O[r]({token:t[r]||e,date:this.date,parts:this.parts,locales:this.locales}):t[r]||e)}let r=this.parts.reduce(((e,t)=>{if(typeof t==="string"&&typeof e[e.length-1]==="string")e[e.length-1]+=t;else e.push(t);return e}),[]);this.parts.splice(0);this.parts.push(...r);this.reset()}moveCursor(e){this.typed="";this.cursor=e;this.fire()}reset(){this.moveCursor(this.parts.findIndex((e=>e instanceof m)));this.fire();this.render()}abort(){this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write("\n");this.close()}validate(){var e=this;return _asyncToGenerator((function*(){let t=yield e.validator(e.value);if(typeof t==="string"){e.errorMsg=t;t=false}e.error=!t}))()}submit(){var e=this;return _asyncToGenerator((function*(){yield e.validate();if(e.error){e.color="red";e.fire();e.render();return}e.done=true;e.aborted=false;e.fire();e.render();e.out.write("\n");e.close()}))()}up(){this.typed="";this.parts[this.cursor].up();this.render()}down(){this.typed="";this.parts[this.cursor].down();this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e));this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e));this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex((e=>e instanceof m)));this.render()}_(e){if(/\d/.test(e)){this.typed+=e;this.parts[this.cursor].setTo(this.typed);this.render()}}render(){if(this.closed)return;if(this.firstRender)this.out.write(d.hide);else this.out.write(u.lines(1));super.render();let e=u.line+(this.lines?u.down(this.lines):"")+d.to(0);this.lines=0;let t="";if(this.error){let e=this.errorMsg.split("\n");t=e.reduce(((e,t,r)=>e+`\n${r?` `:l.pointerSmall} ${s.red().italic(t)}`),``);this.lines=e.length}let r=[o.symbol(this.done,this.aborted),s.bold(this.msg),o.delimiter(false),this.parts.reduce(((e,t,r)=>e.concat(r===this.cursor&&!this.done?s.cyan().underline(t.toString()):t)),[]).join("")].join(" ");let i="";if(this.lines){i+=d.up(this.lines);i+=d.left+d.to(h(r).length)}this.out.write(e+r+t+i)}}e.exports=DatePrompt},2838:(e,t,r)=>{"use strict";e.exports={TextPrompt:r(16),SelectPrompt:r(8614),TogglePrompt:r(8001),DatePrompt:r(4177),NumberPrompt:r(7072),MultiselectPrompt:r(4140),AutocompletePrompt:r(2257),AutocompleteMultiselectPrompt:r(5441),ConfirmPrompt:r(9486)}},4140:(e,t,r)=>{"use strict";const s=r(5215);const i=r(9571),n=i.cursor;const o=r(461);const a=r(8091),l=a.clear,h=a.figures,c=a.style;class MultiselectPrompt extends o{constructor(e={}){super(e);this.msg=e.message;this.cursor=e.cursor||0;this.scrollIndex=e.cursor||0;this.hint=e.hint||"";this.warn=e.warn||"- This option is disabled -";this.minSelected=e.min;this.showMinError=false;this.maxChoices=e.max;this.value=e.choices.map(((e,t)=>{if(typeof e==="string")e={title:e,value:t};return{title:e&&(e.title||e.value||e),value:e&&(e.value||t),selected:e&&e.selected,disabled:e&&e.disabled}}));this.clear=l("");if(!e.overrideRender){this.render()}}reset(){this.value.map((e=>!e.selected));this.cursor=0;this.fire();this.render()}selected(){return this.value.filter((e=>e.selected))}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){const e=this.value.filter((e=>e.selected));if(this.minSelected&&e.length<this.minSelected){this.showMinError=true;this.render()}else{this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}}first(){this.cursor=0;this.render()}last(){this.cursor=this.value.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.value.length;this.render()}up(){if(this.cursor===0){this.cursor=this.value.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.value.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.value[this.cursor].selected=false;this.render()}right(){if(this.value.filter((e=>e.selected)).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=true;this.render()}handleSpaceToggle(){const e=this.value[this.cursor];if(e.selected){e.selected=false;this.render()}else if(e.disabled||this.value.filter((e=>e.selected)).length>=this.maxChoices){return this.bell()}else{e.selected=true;this.render()}}_(e,t){if(e===" "){this.handleSpaceToggle()}else{return this.bell()}}renderInstructions(){return`\nInstructions:\n ${h.arrowUp}/${h.arrowDown}: Highlight option\n ${h.arrowLeft}/${h.arrowRight}/[space]: Toggle selection\n enter/return: Complete answer\n `}renderOption(e,t,r){let i;if(t.disabled)i=e===r?s.gray().underline(t.title):s.strikethrough().gray(t.title);else i=e===r?s.cyan().underline(t.title):t.title;return(t.selected?s.green(h.radioOn):h.radioOff)+" "+i}paginateOptions(e){const t=this.cursor;let r=e.map(((e,r)=>this.renderOption(t,e,r)));const i=10;let n=r;let o="";if(r.length===0){return s.red("No matches for this query.")}else if(r.length>i){let a=t-i/2;let l=t+i/2;if(a<0){a=0;l=i}else if(l>e.length){l=e.length;a=l-i}n=r.slice(a,l);o=s.dim("(Move up and down to reveal more choices)")}return"\n"+n.join("\n")+"\n"+o}renderOptions(e){if(!this.done){return this.paginateOptions(e)}return""}renderDoneOrInstructions(){if(this.done){const e=this.value.filter((e=>e.selected)).map((e=>e.title)).join(", ");return e}const e=[s.gray(this.hint),this.renderInstructions()];if(this.value[this.cursor].disabled){e.push(s.yellow(this.warn))}return e.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(n.hide);super.render();let e=[c.symbol(this.done,this.aborted),s.bold(this.msg),c.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){e+=s.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}e+=this.renderOptions(this.value);this.out.write(this.clear+e);this.clear=l(e)}}e.exports=MultiselectPrompt},7072:(e,t,r)=>{"use strict";function asyncGeneratorStep(e,t,r,s,i,n,o){try{var a=e[n](o);var l=a.value}catch(e){r(e);return}if(a.done){t(l)}else{Promise.resolve(l).then(s,i)}}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(s,i){var n=e.apply(t,r);function _next(e){asyncGeneratorStep(n,s,i,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(n,s,i,_next,_throw,"throw",e)}_next(undefined)}))}}const s=r(5215);const i=r(461);const n=r(9571),o=n.cursor,a=n.erase;const l=r(8091),h=l.style,c=l.clear,u=l.figures,d=l.strip;const p=/[0-9]/;const isDef=e=>e!==undefined;const round=(e,t)=>{let r=Math.pow(10,t);return Math.round(e*r)/r};class NumberPrompt extends i{constructor(e={}){super(e);this.transform=h.render(e.style);this.msg=e.message;this.initial=isDef(e.initial)?e.initial:"";this.float=!!e.float;this.round=e.round||2;this.inc=e.increment||1;this.min=isDef(e.min)?e.min:-Infinity;this.max=isDef(e.max)?e.max:Infinity;this.errorMsg=e.error||`Please Enter A Valid Value`;this.validator=e.validate||(()=>true);this.color=`cyan`;this.value=``;this.typed=``;this.lastHit=0;this.render()}set value(e){if(!e&&e!==0){this.placeholder=true;this.rendered=s.gray(this.transform.render(`${this.initial}`));this._value=``}else{this.placeholder=false;this.rendered=this.transform.render(`${round(e,this.round)}`);this._value=round(e,this.round)}this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e===`-`||e===`.`&&this.float||p.test(e)}reset(){this.typed=``;this.value=``;this.fire();this.render()}abort(){let e=this.value;this.value=e!==``?e:this.initial;this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write(`\n`);this.close()}validate(){var e=this;return _asyncToGenerator((function*(){let t=yield e.validator(e.value);if(typeof t===`string`){e.errorMsg=t;t=false}e.error=!t}))()}submit(){var e=this;return _asyncToGenerator((function*(){yield e.validate();if(e.error){e.color=`red`;e.fire();e.render();return}let t=e.value;e.value=t!==``?t:e.initial;e.done=true;e.aborted=false;e.error=false;e.fire();e.render();e.out.write(`\n`);e.close()}))()}up(){this.typed=``;if(this.value>=this.max)return this.bell();this.value+=this.inc;this.color=`cyan`;this.fire();this.render()}down(){this.typed=``;if(this.value<=this.min)return this.bell();this.value-=this.inc;this.color=`cyan`;this.fire();this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||``;this.color=`cyan`;this.fire();this.render()}next(){this.value=this.initial;this.fire();this.render()}_(e,t){if(!this.valid(e))return this.bell();const r=Date.now();if(r-this.lastHit>1e3)this.typed=``;this.typed+=e;this.lastHit=r;this.color=`cyan`;if(e===`.`)return this.fire();this.value=Math.min(this.parse(this.typed),this.max);if(this.value>this.max)this.value=this.max;if(this.value<this.min)this.value=this.min;this.fire();this.render()}render(){if(this.closed)return;super.render();let e=a.line+(this.lines?a.down(this.lines):``)+o.to(0);this.lines=0;let t=``;if(this.error){let e=this.errorMsg.split(`\n`);t+=e.reduce(((e,t,r)=>e+`\n${r?` `:u.pointerSmall} ${s.red().italic(t)}`),``);this.lines=e.length}let r=!this.done||!this.done&&!this.placeholder;let i=[h.symbol(this.done,this.aborted),s.bold(this.msg),h.delimiter(this.done),r?s[this.color]().underline(this.rendered):this.rendered].join(` `);let n=``;if(this.lines){n+=o.up(this.lines);n+=o.left+o.to(d(i).length)}this.out.write(e+i+t+n)}}e.exports=NumberPrompt},461:(e,t,r)=>{"use strict";const s=r(4521);const i=r(8091),n=i.action;const o=r(2361);const a=r(9571),l=a.beep,h=a.cursor;const c=r(5215);class Prompt extends o{constructor(e={}){super();this.firstRender=true;this.in=e.in||process.stdin;this.out=e.out||process.stdout;this.onRender=(e.onRender||(()=>void 0)).bind(this);const t=s.createInterface(this.in);s.emitKeypressEvents(this.in,t);if(this.in.isTTY)this.in.setRawMode(true);const keypress=(e,t)=>{let r=n(t);if(r===false){this._&&this._(e,t)}else if(typeof this[r]==="function"){this[r](t)}else{this.bell()}};this.close=()=>{this.out.write(h.show);this.in.removeListener("keypress",keypress);if(this.in.isTTY)this.in.setRawMode(false);t.close();this.emit(this.aborted?"abort":"submit",this.value);this.closed=true};this.in.on("keypress",keypress)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted})}bell(){this.out.write(l)}render(){this.onRender(c);if(this.firstRender)this.firstRender=false}}e.exports=Prompt},8614:(e,t,r)=>{"use strict";const s=r(5215);const i=r(461);const n=r(8091),o=n.style,a=n.clear,l=n.figures;const h=r(9571),c=h.erase,u=h.cursor;class SelectPrompt extends i{constructor(e={}){super(e);this.msg=e.message;this.hint=e.hint||"- Use arrow-keys. Return to submit.";this.warn=e.warn||"- This option is disabled";this.cursor=e.initial||0;this.choices=e.choices.map(((e,t)=>{if(typeof e==="string")e={title:e,value:t};return{title:e&&(e.title||e.value||e),value:e&&(e.value||t),selected:e&&e.selected,disabled:e&&e.disabled}}));this.value=(this.choices[this.cursor]||{}).value;this.clear=a("");this.render()}moveCursor(e){this.cursor=e;this.value=this.choices[e].value;this.fire()}reset(){this.moveCursor(0);this.fire();this.render()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){if(!this.selection.disabled){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}else this.bell()}first(){this.moveCursor(0);this.render()}last(){this.moveCursor(this.choices.length-1);this.render()}up(){if(this.cursor===0)return this.bell();this.moveCursor(this.cursor-1);this.render()}down(){if(this.cursor===this.choices.length-1)return this.bell();this.moveCursor(this.cursor+1);this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length);this.render()}_(e,t){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;if(this.firstRender)this.out.write(u.hide);else this.out.write(c.lines(this.choices.length+1));super.render();this.out.write([o.symbol(this.done,this.aborted),s.bold(this.msg),o.delimiter(false),this.done?this.selection.title:this.selection.disabled?s.yellow(this.warn):s.gray(this.hint)].join(" "));if(!this.done){this.out.write("\n"+this.choices.map(((e,t)=>{let r,i;if(e.disabled){r=this.cursor===t?s.gray().underline(e.title):s.strikethrough().gray(e.title);i=this.cursor===t?s.bold().gray(l.pointer)+" ":" "}else{r=this.cursor===t?s.cyan().underline(e.title):e.title;i=this.cursor===t?s.cyan(l.pointer)+" ":" "}return`${i} ${r}`})).join("\n"))}}}e.exports=SelectPrompt},16:(e,t,r)=>{"use strict";function asyncGeneratorStep(e,t,r,s,i,n,o){try{var a=e[n](o);var l=a.value}catch(e){r(e);return}if(a.done){t(l)}else{Promise.resolve(l).then(s,i)}}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(s,i){var n=e.apply(t,r);function _next(e){asyncGeneratorStep(n,s,i,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(n,s,i,_next,_throw,"throw",e)}_next(undefined)}))}}const s=r(5215);const i=r(461);const n=r(9571),o=n.cursor;const a=r(8091),l=a.style,h=a.clear,c=a.strip,u=a.figures;class TextPrompt extends i{constructor(e={}){super(e);this.transform=l.render(e.style);this.scale=this.transform.scale;this.msg=e.message;this.initial=e.initial||``;this.validator=e.validate||(()=>true);this.value=``;this.errorMsg=e.error||`Please Enter A Valid Value`;this.cursor=Number(!!this.initial);this.clear=h(``);this.render()}set value(e){if(!e&&this.initial){this.placeholder=true;this.rendered=s.gray(this.transform.render(this.initial))}else{this.placeholder=false;this.rendered=this.transform.render(e)}this._value=e;this.fire()}get value(){return this._value}reset(){this.value=``;this.cursor=Number(!!this.initial);this.fire();this.render()}abort(){this.value=this.value||this.initial;this.done=this.aborted=true;this.error=false;this.red=false;this.fire();this.render();this.out.write("\n");this.close()}validate(){var e=this;return _asyncToGenerator((function*(){let t=yield e.validator(e.value);if(typeof t===`string`){e.errorMsg=t;t=false}e.error=!t}))()}submit(){var e=this;return _asyncToGenerator((function*(){e.value=e.value||e.initial;yield e.validate();if(e.error){e.red=true;e.fire();e.render();return}e.done=true;e.aborted=false;e.fire();e.render();e.out.write("\n");e.close()}))()}next(){if(!this.placeholder)return this.bell();this.value=this.initial;this.cursor=this.rendered.length;this.fire();this.render()}moveCursor(e){if(this.placeholder)return;this.cursor=this.cursor+e}_(e,t){let r=this.value.slice(0,this.cursor);let s=this.value.slice(this.cursor);this.value=`${r}${e}${s}`;this.red=false;this.cursor=this.placeholder?0:r.length+1;this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.value.slice(0,this.cursor-1);let t=this.value.slice(this.cursor);this.value=`${e}${t}`;this.red=false;this.moveCursor(-1);this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor);let t=this.value.slice(this.cursor+1);this.value=`${e}${t}`;this.red=false;this.render()}first(){this.cursor=0;this.render()}last(){this.cursor=this.value.length;this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1);this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1);this.render()}render(){if(this.closed)return;super.render();let e=(this.lines?o.down(this.lines):``)+this.clear;this.lines=0;let t=[l.symbol(this.done,this.aborted),s.bold(this.msg),l.delimiter(this.done),this.red?s.red(this.rendered):this.rendered].join(` `);let r=``;if(this.error){let e=this.errorMsg.split(`\n`);r+=e.reduce(((e,t,r)=>e+=`\n${r?" ":u.pointerSmall} ${s.red().italic(t)}`),``);this.lines=e.length}let i=``;if(this.lines){i+=o.up(this.lines);i+=o.left+o.to(c(t).length)}i+=o.move(this.placeholder?-this.initial.length*this.scale:-this.rendered.length+this.cursor*this.scale);this.out.write(e+t+r+i);this.clear=h(t+r)}}e.exports=TextPrompt},8001:(e,t,r)=>{"use strict";const s=r(5215);const i=r(461);const n=r(8091),o=n.style,a=n.clear;const l=r(9571),h=l.cursor,c=l.erase;class TogglePrompt extends i{constructor(e={}){super(e);this.msg=e.message;this.value=!!e.initial;this.active=e.active||"on";this.inactive=e.inactive||"off";this.initialValue=this.value;this.render()}reset(){this.value=this.initialValue;this.fire();this.render()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}deactivate(){if(this.value===false)return this.bell();this.value=false;this.render()}activate(){if(this.value===true)return this.bell();this.value=true;this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value;this.fire();this.render()}_(e,t){if(e===" "){this.value=!this.value}else if(e==="1"){this.value=true}else if(e==="0"){this.value=false}else return this.bell();this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(h.hide);super.render();this.out.write(c.lines(this.first?1:this.msg.split(/\n/g).length)+h.to(0)+[o.symbol(this.done,this.aborted),s.bold(this.msg),o.delimiter(this.done),this.value?this.inactive:s.cyan().underline(this.inactive),s.gray("/"),this.value?s.cyan().underline(this.active):this.active].join(" "))}}e.exports=TogglePrompt},5357:(e,t,r)=>{"use strict";function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};var s=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){s=s.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))}s.forEach((function(t){_defineProperty(e,t,r[t])}))}return e}function _defineProperty(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function asyncGeneratorStep(e,t,r,s,i,n,o){try{var a=e[n](o);var l=a.value}catch(e){r(e);return}if(a.done){t(l)}else{Promise.resolve(l).then(s,i)}}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(s,i){var n=e.apply(t,r);function _next(e){asyncGeneratorStep(n,s,i,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(n,s,i,_next,_throw,"throw",e)}_next(undefined)}))}}const s=r(7627);const i=["suggest","format","onState","validate","onRender"];const noop=()=>{};function prompt(){return _prompt.apply(this,arguments)}function _prompt(){_prompt=_asyncToGenerator((function*(e=[],{onSubmit:t=noop,onCancel:r=noop}={}){const n={};const o=prompt._override||{};e=[].concat(e);let a,l,h,c,u;const d=function(){var e=_asyncToGenerator((function*(e,t,r=false){if(!r&&e.validate&&e.validate(t)!==true){return}return e.format?yield e.format(t,n):t}));return function getFormattedAnswer(t,r){return e.apply(this,arguments)}}();var p=true;var m=false;var g=undefined;try{for(var y=e[Symbol.iterator](),b;!(p=(b=y.next()).done);p=true){l=b.value;var v=l;c=v.name;u=v.type;for(let e in l){if(i.includes(e))continue;let t=l[e];l[e]=typeof t==="function"?yield t(a,_objectSpread({},n),l):t}if(typeof l.message!=="string"){throw new Error("prompt message is required")}var w=l;c=w.name;u=w.type;if(!u)continue;if(s[u]===void 0){throw new Error(`prompt type (${u}) is not defined`)}if(o[l.name]!==undefined){a=yield d(l,o[l.name]);if(a!==undefined){n[c]=a;continue}}try{a=prompt._injected?getInjectedAnswer(prompt._injected):yield s[u](l);n[c]=a=yield d(l,a,true);h=yield t(l,a,n)}catch(e){h=!(yield r(l,n))}if(h)return n}}catch(e){m=true;g=e}finally{try{if(!p&&y.return!=null){y.return()}}finally{if(m){throw g}}}return n}));return _prompt.apply(this,arguments)}function getInjectedAnswer(e){const t=e.shift();if(t instanceof Error){throw t}return t}function inject(e){prompt._injected=(prompt._injected||[]).concat(e)}function override(e){prompt._override=Object.assign({},e)}e.exports=Object.assign(prompt,{prompt:prompt,prompts:s,inject:inject,override:override})},7627:(e,t,r)=>{"use strict";const s=t;const i=r(2838);const noop=e=>e;function toPrompt(e,t,r={}){return new Promise(((s,n)=>{const o=new i[e](t);const a=r.onAbort||noop;const l=r.onSubmit||noop;o.on("state",t.onState||noop);o.on("submit",(e=>s(l(e))));o.on("abort",(e=>n(a(e))))}))}s.text=e=>toPrompt("TextPrompt",e);s.password=e=>{e.style="password";return s.text(e)};s.invisible=e=>{e.style="invisible";return s.text(e)};s.number=e=>toPrompt("NumberPrompt",e);s.date=e=>toPrompt("DatePrompt",e);s.confirm=e=>toPrompt("ConfirmPrompt",e);s.list=e=>{const t=e.separator||",";return toPrompt("TextPrompt",e,{onSubmit:e=>e.split(t).map((e=>e.trim()))})};s.toggle=e=>toPrompt("TogglePrompt",e);s.select=e=>toPrompt("SelectPrompt",e);s.multiselect=e=>{e.choices=[].concat(e.choices||[]);const toSelected=e=>e.filter((e=>e.selected)).map((e=>e.value));return toPrompt("MultiselectPrompt",e,{onAbort:toSelected,onSubmit:toSelected})};s.autocompleteMultiselect=e=>{e.choices=[].concat(e.choices||[]);const toSelected=e=>e.filter((e=>e.selected)).map((e=>e.value));return toPrompt("AutocompleteMultiselectPrompt",e,{onAbort:toSelected,onSubmit:toSelected})};const byTitle=(e,t)=>Promise.resolve(t.filter((t=>t.title.slice(0,e.length).toLowerCase()===e.toLowerCase())));s.autocomplete=e=>{e.suggest=e.suggest||byTitle;e.choices=[].concat(e.choices||[]);return toPrompt("AutocompletePrompt",e)}},9001:e=>{"use strict";e.exports=e=>{if(e.ctrl){if(e.name==="a")return"first";if(e.name==="c")return"abort";if(e.name==="d")return"abort";if(e.name==="e")return"last";if(e.name==="g")return"reset"}if(e.name==="return")return"submit";if(e.name==="enter")return"submit";if(e.name==="backspace")return"delete";if(e.name==="delete")return"deleteForward";if(e.name==="abort")return"abort";if(e.name==="escape")return"abort";if(e.name==="tab")return"next";if(e.name==="pagedown")return"nextPage";if(e.name==="pageup")return"prevPage";if(e.name==="up")return"up";if(e.name==="down")return"down";if(e.name==="right")return"right";if(e.name==="left")return"left";return false}},3952:(e,t,r)=>{"use strict";const s=r(8007);const i=r(9571),n=i.erase,o=i.cursor;const width=e=>[...s(e)].length;e.exports=function(e,t=process.stdout.columns){if(!t)return n.line+o.to(0);let r=0;const s=e.split(/\r?\n/);var i=true;var a=false;var l=undefined;try{for(var h=s[Symbol.iterator](),c;!(i=(c=h.next()).done);i=true){let e=c.value;r+=1+Math.floor(Math.max(width(e)-1,0)/t)}}catch(e){a=true;l=e}finally{try{if(!i&&h.return!=null){h.return()}}finally{if(a){throw l}}}return(n.line+o.prevLine()).repeat(r-1)+n.line+o.to(0)}},8845:e=>{"use strict";const t={arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",radioOn:"◉",radioOff:"◯",tick:"✔",cross:"✖",ellipsis:"…",pointerSmall:"›",line:"─",pointer:"❯"};const r={arrowUp:t.arrowUp,arrowDown:t.arrowDown,arrowLeft:t.arrowLeft,arrowRight:t.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"√",cross:"×",ellipsis:"...",pointerSmall:"»",line:"─",pointer:">"};const s=process.platform==="win32"?r:t;e.exports=s},8091:(e,t,r)=>{"use strict";e.exports={action:r(9001),clear:r(3952),style:r(8295),strip:r(8007),figures:r(8845)}},8007:e=>{"use strict";e.exports=e=>{const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|");const r=new RegExp(t,"g");return typeof e==="string"?e.replace(r,""):e}},8295:(e,t,r)=>{"use strict";const s=r(5215);const i=r(8845);const n=Object.freeze({password:{scale:1,render:e=>"*".repeat(e.length)},emoji:{scale:2,render:e=>"😃".repeat(e.length)},invisible:{scale:0,render:e=>""},default:{scale:1,render:e=>`${e}`}});const render=e=>n[e]||n.default;const o=Object.freeze({aborted:s.red(i.cross),done:s.green(i.tick),default:s.cyan("?")});const symbol=(e,t)=>t?o.aborted:e?o.done:o.default;const delimiter=e=>s.gray(e?i.ellipsis:i.pointerSmall);const item=(e,t)=>s.gray(e?t?i.pointerSmall:"+":i.line);e.exports={styles:n,render:render,symbols:o,symbol:symbol,delimiter:delimiter,item:item}},9646:(e,t,r)=>{function isNodeLT(e){e=(Array.isArray(e)?e:e.split(".")).map(Number);let t=0,r=process.versions.node.split(".").map(Number);for(;t<e.length;t++){if(r[t]>e[t])return false;if(e[t]>r[t])return true}return false}e.exports=isNodeLT("8.6.0")?r(5357):r(5379)},8377:e=>{"use strict";class DatePart{constructor({token:e,date:t,parts:r,locales:s}){this.token=e;this.date=t||new Date;this.parts=r||[this];this.locales=s||{}}up(){}down(){}next(){const e=this.parts.indexOf(this);return this.parts.find(((t,r)=>r>e&&t instanceof DatePart))}setTo(e){}prev(){let e=[].concat(this.parts).reverse();const t=e.indexOf(this);return e.find(((e,r)=>r>t&&e instanceof DatePart))}toString(){return String(this.date)}}e.exports=DatePart},6784:(e,t,r)=>{"use strict";const s=r(8377);const pos=e=>{e=e%10;return e===1?"st":e===2?"nd":e===3?"rd":"th"};class Day extends s{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate();let t=this.date.getDay();return this.token==="DD"?String(e).padStart(2,"0"):this.token==="Do"?e+pos(e):this.token==="d"?t+1:this.token==="ddd"?this.locales.weekdaysShort[t]:this.token==="dddd"?this.locales.weekdays[t]:e}}e.exports=Day},754:(e,t,r)=>{"use strict";const s=r(8377);class Hours extends s{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();if(/h/.test(this.token))e=e%12||12;return this.token.length>1?String(e).padStart(2,"0"):e}}e.exports=Hours},8108:(e,t,r)=>{"use strict";e.exports={DatePart:r(8377),Meridiem:r(2616),Day:r(6784),Hours:r(754),Milliseconds:r(4316),Minutes:r(1770),Month:r(8086),Seconds:r(1823),Year:r(9208)}},2616:(e,t,r)=>{"use strict";const s=r(8377);class Meridiem extends s{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}}e.exports=Meridiem},4316:(e,t,r)=>{"use strict";const s=r(8377);class Milliseconds extends s{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}e.exports=Milliseconds},1770:(e,t,r)=>{"use strict";const s=r(8377);class Minutes extends s{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}}e.exports=Minutes},8086:(e,t,r)=>{"use strict";const s=r(8377);class Month extends s{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1;this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth();let t=this.token.length;return t===2?String(e+1).padStart(2,"0"):t===3?this.locales.monthsShort[e]:t===4?this.locales.months[e]:String(e+1)}}e.exports=Month},1823:(e,t,r)=>{"use strict";const s=r(8377);class Seconds extends s{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}}e.exports=Seconds},9208:(e,t,r)=>{"use strict";const s=r(8377);class Year extends s{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?e.substr(-2):e}}e.exports=Year},1098:(e,t,r)=>{"use strict";const s=r(5215);const i=r(4185);const{cursor:n}=r(9571);const{style:o,clear:a,figures:l,strip:h}=r(9501);const getVal=(e,t)=>e[t]&&(e[t].value||e[t].title||e[t]);const getTitle=(e,t)=>e[t]&&(e[t].title||e[t].value||e[t]);const getIndex=(e,t)=>{const r=e.findIndex((e=>e.value===t||e.title===t));return r>-1?r:undefined};class AutocompletePrompt extends i{constructor(e={}){super(e);this.msg=e.message;this.suggest=e.suggest;this.choices=e.choices;this.initial=typeof e.initial==="number"?e.initial:getIndex(e.choices,e.initial);this.select=this.initial||e.cursor||0;this.fallback=e.fallback||(e.initial!==undefined?`${l.pointerSmall} ${getTitle(this.choices,this.initial)}`:`${l.pointerSmall} ${e.noMatches||"no matches found"}`);this.suggestions=[[]];this.page=0;this.input="";this.limit=e.limit||10;this.cursor=0;this.transform=o.render(e.style);this.scale=this.transform.scale;this.render=this.render.bind(this);this.complete=this.complete.bind(this);this.clear=a("");this.complete(this.render);this.render()}moveSelect(e){this.select=e;if(this.suggestions[this.page].length>0){this.value=getVal(this.suggestions[this.page],e)}else{this.value=this.initial!==undefined?getVal(this.choices,this.initial):null}this.fire()}async complete(e){const t=this.completing=this.suggest(this.input,this.choices);const r=await t;if(this.completing!==t)return;this.suggestions=r.map(((e,t,r)=>({title:getTitle(r,t),value:getVal(r,t)}))).reduce(((e,t)=>{if(e[e.length-1].length<this.limit)e[e.length-1].push(t);else e.push([t]);return e}),[[]]);this.isFallback=false;this.completing=false;if(!this.suggestions[this.page])this.page=0;if(!this.suggestions.length&&this.fallback){const e=getIndex(this.choices,this.fallback);this.suggestions=[[]];if(e!==undefined)this.suggestions[0].push({title:getTitle(this.choices,e),value:getVal(this.choices,e)});this.isFallback=true}const s=Math.max(r.length-1,0);this.moveSelect(Math.min(s,this.select));e&&e()}reset(){this.input="";this.complete((()=>{this.moveSelect(this.initial!==void 0?this.initial:0);this.render()}));this.render()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}_(e,t){let r=this.input.slice(0,this.cursor);let s=this.input.slice(this.cursor);this.input=`${r}${e}${s}`;this.cursor=r.length+1;this.complete(this.render);this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.input.slice(0,this.cursor-1);let t=this.input.slice(this.cursor);this.input=`${e}${t}`;this.complete(this.render);this.cursor=this.cursor-1;this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor);let t=this.input.slice(this.cursor+1);this.input=`${e}${t}`;this.complete(this.render);this.render()}first(){this.moveSelect(0);this.render()}last(){this.moveSelect(this.suggestions[this.page].length-1);this.render()}up(){if(this.select<=0)return this.bell();this.moveSelect(this.select-1);this.render()}down(){if(this.select>=this.suggestions[this.page].length-1)return this.bell();this.moveSelect(this.select+1);this.render()}next(){if(this.select===this.suggestions[this.page].length-1){this.page=(this.page+1)%this.suggestions.length;this.moveSelect(0)}else this.moveSelect(this.select+1);this.render()}nextPage(){if(this.page>=this.suggestions.length-1)return this.bell();this.page++;this.moveSelect(0);this.render()}prevPage(){if(this.page<=0)return this.bell();this.page--;this.moveSelect(0);this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1;this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1;this.render()}render(){if(this.closed)return;super.render();if(this.lineCount)this.out.write(n.down(this.lineCount));let e=s.bold(`${o.symbol(this.done,this.aborted)} ${this.msg} `)+`${o.delimiter(this.completing)} `;let t=h(e).length;if(this.done&&this.suggestions[this.page][this.select]){e+=`${this.suggestions[this.page][this.select].title}`}else{this.rendered=`${this.transform.render(this.input)}`;t+=this.rendered.length;e+=this.rendered}if(!this.done){this.lineCount=this.suggestions[this.page].length;let t=this.suggestions[this.page].reduce(((e,t,r)=>e+`\n${r===this.select?s.cyan(t.title):t.title}`),"");if(t&&!this.isFallback){e+=t;if(this.suggestions.length>1){this.lineCount++;e+=s.blue(`\nPage ${this.page+1}/${this.suggestions.length}`)}}else{const t=getIndex(this.choices,this.fallback);const r=t!==undefined?getTitle(this.choices,t):this.fallback;e+=`\n${s.gray(r)}`;this.lineCount++}}this.out.write(this.clear+e);this.clear=a(e);if(this.lineCount&&!this.done){let e=n.up(this.lineCount);e+=n.left+n.to(t);e+=n.move(-this.rendered.length+this.cursor*this.scale);this.out.write(e)}}}e.exports=AutocompletePrompt},8178:(e,t,r)=>{"use strict";const s=r(5215);const{cursor:i}=r(9571);const n=r(1944);const{clear:o,style:a,figures:l}=r(9501);class AutocompleteMultiselectPrompt extends n{constructor(e={}){e.overrideRender=true;super(e);this.inputValue="";this.clear=o("");this.filteredOptions=this.value;this.render()}last(){this.cursor=this.filteredOptions.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length;this.render()}up(){if(this.cursor===0){this.cursor=this.filteredOptions.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.filteredOptions.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.filteredOptions[this.cursor].selected=false;this.render()}right(){if(this.value.filter((e=>e.selected)).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=true;this.render()}delete(){if(this.inputValue.length){this.inputValue=this.inputValue.substr(0,this.inputValue.length-1);this.updateFilteredOptions()}}updateFilteredOptions(){const e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((e=>{if(this.inputValue){if(typeof e.title==="string"){if(e.title.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}if(typeof e.value==="string"){if(e.value.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}return false}return true}));const t=this.filteredOptions.findIndex((t=>t===e));this.cursor=t<0?0:t;this.render()}handleSpaceToggle(){const e=this.filteredOptions[this.cursor];if(e.selected){e.selected=false;this.render()}else if(e.disabled||this.value.filter((e=>e.selected)).length>=this.maxChoices){return this.bell()}else{e.selected=true;this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e;this.updateFilteredOptions()}_(e,t){if(e===" "){this.handleSpaceToggle()}else{this.handleInputChange(e)}}renderInstructions(){return`\nInstructions:\n ${l.arrowUp}/${l.arrowDown}: Highlight option\n ${l.arrowLeft}/${l.arrowRight}/[space]: Toggle selection\n [a,b,c]/delete: Filter choices\n enter/return: Complete answer\n `}renderCurrentInput(){return`\nFiltered results for: ${this.inputValue?this.inputValue:s.gray("Enter something to filter")}\n`}renderOption(e,t,r){let i;if(t.disabled)i=e===r?s.gray().underline(t.title):s.strikethrough().gray(t.title);else i=e===r?s.cyan().underline(t.title):t.title;return(t.selected?s.green(l.radioOn):l.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done){const e=this.value.filter((e=>e.selected)).map((e=>e.title)).join(", ");return e}const e=[s.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];if(this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled){e.push(s.yellow(this.warn))}return e.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(i.hide);super.render();let e=[a.symbol(this.done,this.aborted),s.bold(this.msg),a.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){e+=s.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}e+=this.renderOptions(this.filteredOptions);this.out.write(this.clear+e);this.clear=o(e)}}e.exports=AutocompleteMultiselectPrompt},1491:(e,t,r)=>{const s=r(5215);const i=r(4185);const{style:n}=r(9501);const{erase:o,cursor:a}=r(9571);class ConfirmPrompt extends i{constructor(e={}){super(e);this.msg=e.message;this.value=e.initial;this.initialValue=!!e.initial;this.yesMsg=e.yes||"yes";this.yesOption=e.yesOption||"(Y/n)";this.noMsg=e.no||"no";this.noOption=e.noOption||"(y/N)";this.render()}reset(){this.value=this.initialValue;this.fire();this.render()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.value=this.value||false;this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}_(e,t){if(e.toLowerCase()==="y"){this.value=true;return this.submit()}if(e.toLowerCase()==="n"){this.value=false;return this.submit()}return this.bell()}render(){if(this.closed)return;if(this.firstRender)this.out.write(a.hide);super.render();this.out.write(o.line+a.to(0)+[n.symbol(this.done,this.aborted),s.bold(this.msg),n.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:s.gray(this.initialValue?this.yesOption:this.noOption)].join(" "))}}e.exports=ConfirmPrompt},5667:(e,t,r)=>{"use strict";const s=r(5215);const i=r(4185);const{style:n,clear:o,figures:a,strip:l}=r(9501);const{erase:h,cursor:c}=r(9571);const{DatePart:u,Meridiem:d,Day:p,Hours:m,Milliseconds:g,Minutes:y,Month:b,Seconds:v,Year:w}=r(8108);const _=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g;const E={1:({token:e})=>e.replace(/\\(.)/g,"$1"),2:e=>new p(e),3:e=>new b(e),4:e=>new w(e),5:e=>new d(e),6:e=>new m(e),7:e=>new y(e),8:e=>new v(e),9:e=>new g(e)};const S={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class DatePrompt extends i{constructor(e={}){super(e);this.msg=e.message;this.cursor=0;this.typed="";this.locales=Object.assign(S,e.locales);this._date=e.initial||new Date;this.errorMsg=e.error||"Please Enter A Valid Value";this.validator=e.validate||(()=>true);this.mask=e.mask||"YYYY-MM-DD HH:mm:ss";this.clear=o("");this.render()}get value(){return this.date}get date(){return this._date}set date(e){if(e)this._date.setTime(e.getTime())}set mask(e){let t;this.parts=[];while(t=_.exec(e)){let e=t.shift();let r=t.findIndex((e=>e!=null));this.parts.push(r in E?E[r]({token:t[r]||e,date:this.date,parts:this.parts,locales:this.locales}):t[r]||e)}let r=this.parts.reduce(((e,t)=>{if(typeof t==="string"&&typeof e[e.length-1]==="string")e[e.length-1]+=t;else e.push(t);return e}),[]);this.parts.splice(0);this.parts.push(...r);this.reset()}moveCursor(e){this.typed="";this.cursor=e;this.fire()}reset(){this.moveCursor(this.parts.findIndex((e=>e instanceof u)));this.fire();this.render()}abort(){this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write("\n");this.close()}async validate(){let e=await this.validator(this.value);if(typeof e==="string"){this.errorMsg=e;e=false}this.error=!e}async submit(){await this.validate();if(this.error){this.color="red";this.fire();this.render();return}this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}up(){this.typed="";this.parts[this.cursor].up();this.render()}down(){this.typed="";this.parts[this.cursor].down();this.render()}left(){let e=this.parts[this.cursor].prev();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e));this.render()}right(){let e=this.parts[this.cursor].next();if(e==null)return this.bell();this.moveCursor(this.parts.indexOf(e));this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex((e=>e instanceof u)));this.render()}_(e){if(/\d/.test(e)){this.typed+=e;this.parts[this.cursor].setTo(this.typed);this.render()}}render(){if(this.closed)return;if(this.firstRender)this.out.write(c.hide);else this.out.write(h.lines(1));super.render();let e=h.line+(this.lines?h.down(this.lines):"")+c.to(0);this.lines=0;let t="";if(this.error){let e=this.errorMsg.split("\n");t=e.reduce(((e,t,r)=>e+`\n${r?` `:a.pointerSmall} ${s.red().italic(t)}`),``);this.lines=e.length}let r=[n.symbol(this.done,this.aborted),s.bold(this.msg),n.delimiter(false),this.parts.reduce(((e,t,r)=>e.concat(r===this.cursor&&!this.done?s.cyan().underline(t.toString()):t)),[]).join("")].join(" ");let i="";if(this.lines){i+=c.up(this.lines);i+=c.left+c.to(l(r).length)}this.out.write(e+r+t+i)}}e.exports=DatePrompt},9098:(e,t,r)=>{"use strict";e.exports={TextPrompt:r(5387),SelectPrompt:r(6514),TogglePrompt:r(2093),DatePrompt:r(5667),NumberPrompt:r(2952),MultiselectPrompt:r(1944),AutocompletePrompt:r(1098),AutocompleteMultiselectPrompt:r(8178),ConfirmPrompt:r(1491)}},1944:(e,t,r)=>{"use strict";const s=r(5215);const{cursor:i}=r(9571);const n=r(4185);const{clear:o,figures:a,style:l}=r(9501);class MultiselectPrompt extends n{constructor(e={}){super(e);this.msg=e.message;this.cursor=e.cursor||0;this.scrollIndex=e.cursor||0;this.hint=e.hint||"";this.warn=e.warn||"- This option is disabled -";this.minSelected=e.min;this.showMinError=false;this.maxChoices=e.max;this.value=e.choices.map(((e,t)=>{if(typeof e==="string")e={title:e,value:t};return{title:e&&(e.title||e.value||e),value:e&&(e.value||t),selected:e&&e.selected,disabled:e&&e.disabled}}));this.clear=o("");if(!e.overrideRender){this.render()}}reset(){this.value.map((e=>!e.selected));this.cursor=0;this.fire();this.render()}selected(){return this.value.filter((e=>e.selected))}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){const e=this.value.filter((e=>e.selected));if(this.minSelected&&e.length<this.minSelected){this.showMinError=true;this.render()}else{this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}}first(){this.cursor=0;this.render()}last(){this.cursor=this.value.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.value.length;this.render()}up(){if(this.cursor===0){this.cursor=this.value.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.value.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.value[this.cursor].selected=false;this.render()}right(){if(this.value.filter((e=>e.selected)).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=true;this.render()}handleSpaceToggle(){const e=this.value[this.cursor];if(e.selected){e.selected=false;this.render()}else if(e.disabled||this.value.filter((e=>e.selected)).length>=this.maxChoices){return this.bell()}else{e.selected=true;this.render()}}_(e,t){if(e===" "){this.handleSpaceToggle()}else{return this.bell()}}renderInstructions(){return`\nInstructions:\n ${a.arrowUp}/${a.arrowDown}: Highlight option\n ${a.arrowLeft}/${a.arrowRight}/[space]: Toggle selection\n enter/return: Complete answer\n `}renderOption(e,t,r){let i;if(t.disabled)i=e===r?s.gray().underline(t.title):s.strikethrough().gray(t.title);else i=e===r?s.cyan().underline(t.title):t.title;return(t.selected?s.green(a.radioOn):a.radioOff)+" "+i}paginateOptions(e){const t=this.cursor;let r=e.map(((e,r)=>this.renderOption(t,e,r)));const i=10;let n=r;let o="";if(r.length===0){return s.red("No matches for this query.")}else if(r.length>i){let a=t-i/2;let l=t+i/2;if(a<0){a=0;l=i}else if(l>e.length){l=e.length;a=l-i}n=r.slice(a,l);o=s.dim("(Move up and down to reveal more choices)")}return"\n"+n.join("\n")+"\n"+o}renderOptions(e){if(!this.done){return this.paginateOptions(e)}return""}renderDoneOrInstructions(){if(this.done){const e=this.value.filter((e=>e.selected)).map((e=>e.title)).join(", ");return e}const e=[s.gray(this.hint),this.renderInstructions()];if(this.value[this.cursor].disabled){e.push(s.yellow(this.warn))}return e.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(i.hide);super.render();let e=[l.symbol(this.done,this.aborted),s.bold(this.msg),l.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){e+=s.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}e+=this.renderOptions(this.value);this.out.write(this.clear+e);this.clear=o(e)}}e.exports=MultiselectPrompt},2952:(e,t,r)=>{const s=r(5215);const i=r(4185);const{cursor:n,erase:o}=r(9571);const{style:a,clear:l,figures:h,strip:c}=r(9501);const u=/[0-9]/;const isDef=e=>e!==undefined;const round=(e,t)=>{let r=Math.pow(10,t);return Math.round(e*r)/r};class NumberPrompt extends i{constructor(e={}){super(e);this.transform=a.render(e.style);this.msg=e.message;this.initial=isDef(e.initial)?e.initial:"";this.float=!!e.float;this.round=e.round||2;this.inc=e.increment||1;this.min=isDef(e.min)?e.min:-Infinity;this.max=isDef(e.max)?e.max:Infinity;this.errorMsg=e.error||`Please Enter A Valid Value`;this.validator=e.validate||(()=>true);this.color=`cyan`;this.value=``;this.typed=``;this.lastHit=0;this.render()}set value(e){if(!e&&e!==0){this.placeholder=true;this.rendered=s.gray(this.transform.render(`${this.initial}`));this._value=``}else{this.placeholder=false;this.rendered=this.transform.render(`${round(e,this.round)}`);this._value=round(e,this.round)}this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return e===`-`||e===`.`&&this.float||u.test(e)}reset(){this.typed=``;this.value=``;this.fire();this.render()}abort(){let e=this.value;this.value=e!==``?e:this.initial;this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write(`\n`);this.close()}async validate(){let e=await this.validator(this.value);if(typeof e===`string`){this.errorMsg=e;e=false}this.error=!e}async submit(){await this.validate();if(this.error){this.color=`red`;this.fire();this.render();return}let e=this.value;this.value=e!==``?e:this.initial;this.done=true;this.aborted=false;this.error=false;this.fire();this.render();this.out.write(`\n`);this.close()}up(){this.typed=``;if(this.value>=this.max)return this.bell();this.value+=this.inc;this.color=`cyan`;this.fire();this.render()}down(){this.typed=``;if(this.value<=this.min)return this.bell();this.value-=this.inc;this.color=`cyan`;this.fire();this.render()}delete(){let e=this.value.toString();if(e.length===0)return this.bell();this.value=this.parse(e=e.slice(0,-1))||``;this.color=`cyan`;this.fire();this.render()}next(){this.value=this.initial;this.fire();this.render()}_(e,t){if(!this.valid(e))return this.bell();const r=Date.now();if(r-this.lastHit>1e3)this.typed=``;this.typed+=e;this.lastHit=r;this.color=`cyan`;if(e===`.`)return this.fire();this.value=Math.min(this.parse(this.typed),this.max);if(this.value>this.max)this.value=this.max;if(this.value<this.min)this.value=this.min;this.fire();this.render()}render(){if(this.closed)return;super.render();let e=o.line+(this.lines?o.down(this.lines):``)+n.to(0);this.lines=0;let t=``;if(this.error){let e=this.errorMsg.split(`\n`);t+=e.reduce(((e,t,r)=>e+`\n${r?` `:h.pointerSmall} ${s.red().italic(t)}`),``);this.lines=e.length}let r=!this.done||!this.done&&!this.placeholder;let i=[a.symbol(this.done,this.aborted),s.bold(this.msg),a.delimiter(this.done),r?s[this.color]().underline(this.rendered):this.rendered].join(` `);let l=``;if(this.lines){l+=n.up(this.lines);l+=n.left+n.to(c(i).length)}this.out.write(e+i+t+l)}}e.exports=NumberPrompt},4185:(e,t,r)=>{"use strict";const s=r(4521);const{action:i}=r(9501);const n=r(2361);const{beep:o,cursor:a}=r(9571);const l=r(5215);class Prompt extends n{constructor(e={}){super();this.firstRender=true;this.in=e.in||process.stdin;this.out=e.out||process.stdout;this.onRender=(e.onRender||(()=>void 0)).bind(this);const t=s.createInterface(this.in);s.emitKeypressEvents(this.in,t);if(this.in.isTTY)this.in.setRawMode(true);const keypress=(e,t)=>{let r=i(t);if(r===false){this._&&this._(e,t)}else if(typeof this[r]==="function"){this[r](t)}else{this.bell()}};this.close=()=>{this.out.write(a.show);this.in.removeListener("keypress",keypress);if(this.in.isTTY)this.in.setRawMode(false);t.close();this.emit(this.aborted?"abort":"submit",this.value);this.closed=true};this.in.on("keypress",keypress)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted})}bell(){this.out.write(o)}render(){this.onRender(l);if(this.firstRender)this.firstRender=false}}e.exports=Prompt},6514:(e,t,r)=>{"use strict";const s=r(5215);const i=r(4185);const{style:n,clear:o,figures:a}=r(9501);const{erase:l,cursor:h}=r(9571);class SelectPrompt extends i{constructor(e={}){super(e);this.msg=e.message;this.hint=e.hint||"- Use arrow-keys. Return to submit.";this.warn=e.warn||"- This option is disabled";this.cursor=e.initial||0;this.choices=e.choices.map(((e,t)=>{if(typeof e==="string")e={title:e,value:t};return{title:e&&(e.title||e.value||e),value:e&&(e.value||t),selected:e&&e.selected,disabled:e&&e.disabled}}));this.value=(this.choices[this.cursor]||{}).value;this.clear=o("");this.render()}moveCursor(e){this.cursor=e;this.value=this.choices[e].value;this.fire()}reset(){this.moveCursor(0);this.fire();this.render()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){if(!this.selection.disabled){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}else this.bell()}first(){this.moveCursor(0);this.render()}last(){this.moveCursor(this.choices.length-1);this.render()}up(){if(this.cursor===0)return this.bell();this.moveCursor(this.cursor-1);this.render()}down(){if(this.cursor===this.choices.length-1)return this.bell();this.moveCursor(this.cursor+1);this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length);this.render()}_(e,t){if(e===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;if(this.firstRender)this.out.write(h.hide);else this.out.write(l.lines(this.choices.length+1));super.render();this.out.write([n.symbol(this.done,this.aborted),s.bold(this.msg),n.delimiter(false),this.done?this.selection.title:this.selection.disabled?s.yellow(this.warn):s.gray(this.hint)].join(" "));if(!this.done){this.out.write("\n"+this.choices.map(((e,t)=>{let r,i;if(e.disabled){r=this.cursor===t?s.gray().underline(e.title):s.strikethrough().gray(e.title);i=this.cursor===t?s.bold().gray(a.pointer)+" ":" "}else{r=this.cursor===t?s.cyan().underline(e.title):e.title;i=this.cursor===t?s.cyan(a.pointer)+" ":" "}return`${i} ${r}`})).join("\n"))}}}e.exports=SelectPrompt},5387:(e,t,r)=>{const s=r(5215);const i=r(4185);const{cursor:n}=r(9571);const{style:o,clear:a,strip:l,figures:h}=r(9501);class TextPrompt extends i{constructor(e={}){super(e);this.transform=o.render(e.style);this.scale=this.transform.scale;this.msg=e.message;this.initial=e.initial||``;this.validator=e.validate||(()=>true);this.value=``;this.errorMsg=e.error||`Please Enter A Valid Value`;this.cursor=Number(!!this.initial);this.clear=a(``);this.render()}set value(e){if(!e&&this.initial){this.placeholder=true;this.rendered=s.gray(this.transform.render(this.initial))}else{this.placeholder=false;this.rendered=this.transform.render(e)}this._value=e;this.fire()}get value(){return this._value}reset(){this.value=``;this.cursor=Number(!!this.initial);this.fire();this.render()}abort(){this.value=this.value||this.initial;this.done=this.aborted=true;this.error=false;this.red=false;this.fire();this.render();this.out.write("\n");this.close()}async validate(){let e=await this.validator(this.value);if(typeof e===`string`){this.errorMsg=e;e=false}this.error=!e}async submit(){this.value=this.value||this.initial;await this.validate();if(this.error){this.red=true;this.fire();this.render();return}this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial;this.cursor=this.rendered.length;this.fire();this.render()}moveCursor(e){if(this.placeholder)return;this.cursor=this.cursor+e}_(e,t){let r=this.value.slice(0,this.cursor);let s=this.value.slice(this.cursor);this.value=`${r}${e}${s}`;this.red=false;this.cursor=this.placeholder?0:r.length+1;this.render()}delete(){if(this.cursor===0)return this.bell();let e=this.value.slice(0,this.cursor-1);let t=this.value.slice(this.cursor);this.value=`${e}${t}`;this.red=false;this.moveCursor(-1);this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor);let t=this.value.slice(this.cursor+1);this.value=`${e}${t}`;this.red=false;this.render()}first(){this.cursor=0;this.render()}last(){this.cursor=this.value.length;this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1);this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1);this.render()}render(){if(this.closed)return;super.render();let e=(this.lines?n.down(this.lines):``)+this.clear;this.lines=0;let t=[o.symbol(this.done,this.aborted),s.bold(this.msg),o.delimiter(this.done),this.red?s.red(this.rendered):this.rendered].join(` `);let r=``;if(this.error){let e=this.errorMsg.split(`\n`);r+=e.reduce(((e,t,r)=>e+=`\n${r?" ":h.pointerSmall} ${s.red().italic(t)}`),``);this.lines=e.length}let i=``;if(this.lines){i+=n.up(this.lines);i+=n.left+n.to(l(t).length)}i+=n.move(this.placeholder?-this.initial.length*this.scale:-this.rendered.length+this.cursor*this.scale);this.out.write(e+t+r+i);this.clear=a(t+r)}}e.exports=TextPrompt},2093:(e,t,r)=>{const s=r(5215);const i=r(4185);const{style:n,clear:o}=r(9501);const{cursor:a,erase:l}=r(9571);class TogglePrompt extends i{constructor(e={}){super(e);this.msg=e.message;this.value=!!e.initial;this.active=e.active||"on";this.inactive=e.inactive||"off";this.initialValue=this.value;this.render()}reset(){this.value=this.initialValue;this.fire();this.render()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}deactivate(){if(this.value===false)return this.bell();this.value=false;this.render()}activate(){if(this.value===true)return this.bell();this.value=true;this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value;this.fire();this.render()}_(e,t){if(e===" "){this.value=!this.value}else if(e==="1"){this.value=true}else if(e==="0"){this.value=false}else return this.bell();this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(a.hide);super.render();this.out.write(l.lines(this.first?1:this.msg.split(/\n/g).length)+a.to(0)+[n.symbol(this.done,this.aborted),s.bold(this.msg),n.delimiter(this.done),this.value?this.inactive:s.cyan().underline(this.inactive),s.gray("/"),this.value?s.cyan().underline(this.active):this.active].join(" "))}}e.exports=TogglePrompt},5379:(e,t,r)=>{"use strict";const s=r(1558);const i=["suggest","format","onState","validate","onRender"];const noop=()=>{};async function prompt(e=[],{onSubmit:t=noop,onCancel:r=noop}={}){const n={};const o=prompt._override||{};e=[].concat(e);let a,l,h,c,u;const getFormattedAnswer=async(e,t,r=false)=>{if(!r&&e.validate&&e.validate(t)!==true){return}return e.format?await e.format(t,n):t};for(l of e){({name:c,type:u}=l);for(let e in l){if(i.includes(e))continue;let t=l[e];l[e]=typeof t==="function"?await t(a,{...n},l):t}if(typeof l.message!=="string"){throw new Error("prompt message is required")}({name:c,type:u}=l);if(!u)continue;if(s[u]===void 0){throw new Error(`prompt type (${u}) is not defined`)}if(o[l.name]!==undefined){a=await getFormattedAnswer(l,o[l.name]);if(a!==undefined){n[c]=a;continue}}try{a=prompt._injected?getInjectedAnswer(prompt._injected):await s[u](l);n[c]=a=await getFormattedAnswer(l,a,true);h=await t(l,a,n)}catch(e){h=!await r(l,n)}if(h)return n}return n}function getInjectedAnswer(e){const t=e.shift();if(t instanceof Error){throw t}return t}function inject(e){prompt._injected=(prompt._injected||[]).concat(e)}function override(e){prompt._override=Object.assign({},e)}e.exports=Object.assign(prompt,{prompt:prompt,prompts:s,inject:inject,override:override})},1558:(e,t,r)=>{"use strict";const s=t;const i=r(9098);const noop=e=>e;function toPrompt(e,t,r={}){return new Promise(((s,n)=>{const o=new i[e](t);const a=r.onAbort||noop;const l=r.onSubmit||noop;o.on("state",t.onState||noop);o.on("submit",(e=>s(l(e))));o.on("abort",(e=>n(a(e))))}))}s.text=e=>toPrompt("TextPrompt",e);s.password=e=>{e.style="password";return s.text(e)};s.invisible=e=>{e.style="invisible";return s.text(e)};s.number=e=>toPrompt("NumberPrompt",e);s.date=e=>toPrompt("DatePrompt",e);s.confirm=e=>toPrompt("ConfirmPrompt",e);s.list=e=>{const t=e.separator||",";return toPrompt("TextPrompt",e,{onSubmit:e=>e.split(t).map((e=>e.trim()))})};s.toggle=e=>toPrompt("TogglePrompt",e);s.select=e=>toPrompt("SelectPrompt",e);s.multiselect=e=>{e.choices=[].concat(e.choices||[]);const toSelected=e=>e.filter((e=>e.selected)).map((e=>e.value));return toPrompt("MultiselectPrompt",e,{onAbort:toSelected,onSubmit:toSelected})};s.autocompleteMultiselect=e=>{e.choices=[].concat(e.choices||[]);const toSelected=e=>e.filter((e=>e.selected)).map((e=>e.value));return toPrompt("AutocompleteMultiselectPrompt",e,{onAbort:toSelected,onSubmit:toSelected})};const byTitle=(e,t)=>Promise.resolve(t.filter((t=>t.title.slice(0,e.length).toLowerCase()===e.toLowerCase())));s.autocomplete=e=>{e.suggest=e.suggest||byTitle;e.choices=[].concat(e.choices||[]);return toPrompt("AutocompletePrompt",e)}},2337:e=>{"use strict";e.exports=e=>{if(e.ctrl){if(e.name==="a")return"first";if(e.name==="c")return"abort";if(e.name==="d")return"abort";if(e.name==="e")return"last";if(e.name==="g")return"reset"}if(e.name==="return")return"submit";if(e.name==="enter")return"submit";if(e.name==="backspace")return"delete";if(e.name==="delete")return"deleteForward";if(e.name==="abort")return"abort";if(e.name==="escape")return"abort";if(e.name==="tab")return"next";if(e.name==="pagedown")return"nextPage";if(e.name==="pageup")return"prevPage";if(e.name==="up")return"up";if(e.name==="down")return"down";if(e.name==="right")return"right";if(e.name==="left")return"left";return false}},4679:(e,t,r)=>{"use strict";const s=r(6439);const{erase:i,cursor:n}=r(9571);const width=e=>[...s(e)].length;e.exports=function(e,t=process.stdout.columns){if(!t)return i.line+n.to(0);let r=0;const s=e.split(/\r?\n/);for(let e of s){r+=1+Math.floor(Math.max(width(e)-1,0)/t)}return(i.line+n.prevLine()).repeat(r-1)+i.line+n.to(0)}},1918:e=>{"use strict";const t={arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",radioOn:"◉",radioOff:"◯",tick:"✔",cross:"✖",ellipsis:"…",pointerSmall:"›",line:"─",pointer:"❯"};const r={arrowUp:t.arrowUp,arrowDown:t.arrowDown,arrowLeft:t.arrowLeft,arrowRight:t.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"√",cross:"×",ellipsis:"...",pointerSmall:"»",line:"─",pointer:">"};const s=process.platform==="win32"?r:t;e.exports=s},9501:(e,t,r)=>{"use strict";e.exports={action:r(2337),clear:r(4679),style:r(5290),strip:r(6439),figures:r(1918)}},6439:e=>{"use strict";e.exports=e=>{const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|");const r=new RegExp(t,"g");return typeof e==="string"?e.replace(r,""):e}},5290:(e,t,r)=>{"use strict";const s=r(5215);const i=r(1918);const n=Object.freeze({password:{scale:1,render:e=>"*".repeat(e.length)},emoji:{scale:2,render:e=>"😃".repeat(e.length)},invisible:{scale:0,render:e=>""},default:{scale:1,render:e=>`${e}`}});const render=e=>n[e]||n.default;const o=Object.freeze({aborted:s.red(i.cross),done:s.green(i.tick),default:s.cyan("?")});const symbol=(e,t)=>t?o.aborted:e?o.done:o.default;const delimiter=e=>s.gray(e?i.ellipsis:i.pointerSmall);const item=(e,t)=>s.gray(e?t?i.pointerSmall:"+":i.line);e.exports={styles:n,render:render,symbols:o,symbol:symbol,delimiter:delimiter,item:item}},8341:(e,t,r)=>{var s=r(1223);var i=r(1205);var n=r(7147);var noop=function(){};var o=/^v?\.0/.test(process.version);var isFn=function(e){return typeof e==="function"};var isFS=function(e){if(!o)return false;if(!n)return false;return(e instanceof(n.ReadStream||noop)||e instanceof(n.WriteStream||noop))&&isFn(e.close)};var isRequest=function(e){return e.setHeader&&isFn(e.abort)};var destroyer=function(e,t,r,n){n=s(n);var o=false;e.on("close",(function(){o=true}));i(e,{readable:t,writable:r},(function(e){if(e)return n(e);o=true;n()}));var a=false;return function(t){if(o)return;if(a)return;a=true;if(isFS(e))return e.close(noop);if(isRequest(e))return e.abort();if(isFn(e.destroy))return e.destroy();n(t||new Error("stream was destroyed"))}};var call=function(e){e()};var pipe=function(e,t){return e.pipe(t)};var pump=function(){var e=Array.prototype.slice.call(arguments);var t=isFn(e[e.length-1]||noop)&&e.pop()||noop;if(Array.isArray(e[0]))e=e[0];if(e.length<2)throw new Error("pump requires two streams per minimum");var r;var s=e.map((function(i,n){var o=n<e.length-1;var a=n>0;return destroyer(i,o,a,(function(e){if(!r)r=e;if(e)s.forEach(call);if(o)return;s.forEach(call);t(r)}))}));return e.reduce(pipe)};e.exports=pump},9004:(e,t,r)=>{"use strict";const s=r(2781).Readable;const i=r(9662);class Response extends s{constructor(e,t,r,s){if(typeof e!=="number"){throw new TypeError("Argument `statusCode` should be a number")}if(typeof t!=="object"){throw new TypeError("Argument `headers` should be an object")}if(!(r instanceof Buffer)){throw new TypeError("Argument `body` should be a buffer")}if(typeof s!=="string"){throw new TypeError("Argument `url` should be a string")}super();this.statusCode=e;this.headers=i(t);this.body=r;this.url=s}_read(){this.push(this.body);this.push(null)}}e.exports=Response},4347:(e,t,r)=>{e.exports=r(6244)},6244:(e,t,r)=>{var s=r(5369);t.operation=function(e){var r=t.timeouts(e);return new s(r,{forever:e&&e.forever,unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})};t.timeouts=function(e){if(e instanceof Array){return[].concat(e)}var t={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:Infinity,randomize:false};for(var r in e){t[r]=e[r]}if(t.minTimeout>t.maxTimeout){throw new Error("minTimeout is greater than maxTimeout")}var s=[];for(var i=0;i<t.retries;i++){s.push(this.createTimeout(i,t))}if(e&&e.forever&&!s.length){s.push(this.createTimeout(i,t))}s.sort((function(e,t){return e-t}));return s};t.createTimeout=function(e,t){var r=t.randomize?Math.random()+1:1;var s=Math.round(r*t.minTimeout*Math.pow(t.factor,e));s=Math.min(s,t.maxTimeout);return s};t.wrap=function(e,r,s){if(r instanceof Array){s=r;r=null}if(!s){s=[];for(var i in e){if(typeof e[i]==="function"){s.push(i)}}}for(var n=0;n<s.length;n++){var o=s[n];var a=e[o];e[o]=function retryWrapper(s){var i=t.operation(r);var n=Array.prototype.slice.call(arguments,1);var o=n.pop();n.push((function(e){if(i.retry(e)){return}if(e){arguments[0]=i.mainError()}o.apply(this,arguments)}));i.attempt((function(){s.apply(e,n)}))}.bind(e,a);e[o].options=r}}},5369:e=>{function RetryOperation(e,t){if(typeof t==="boolean"){t={forever:t}}this._originalTimeouts=JSON.parse(JSON.stringify(e));this._timeouts=e;this._options=t||{};this._maxRetryTime=t&&t.maxRetryTime||Infinity;this._fn=null;this._errors=[];this._attempts=1;this._operationTimeout=null;this._operationTimeoutCb=null;this._timeout=null;this._operationStart=null;if(this._options.forever){this._cachedTimeouts=this._timeouts.slice(0)}}e.exports=RetryOperation;RetryOperation.prototype.reset=function(){this._attempts=1;this._timeouts=this._originalTimeouts};RetryOperation.prototype.stop=function(){if(this._timeout){clearTimeout(this._timeout)}this._timeouts=[];this._cachedTimeouts=null};RetryOperation.prototype.retry=function(e){if(this._timeout){clearTimeout(this._timeout)}if(!e){return false}var t=(new Date).getTime();if(e&&t-this._operationStart>=this._maxRetryTime){this._errors.unshift(new Error("RetryOperation timeout occurred"));return false}this._errors.push(e);var r=this._timeouts.shift();if(r===undefined){if(this._cachedTimeouts){this._errors.splice(this._errors.length-1,this._errors.length);this._timeouts=this._cachedTimeouts.slice(0);r=this._timeouts.shift()}else{return false}}var s=this;var i=setTimeout((function(){s._attempts++;if(s._operationTimeoutCb){s._timeout=setTimeout((function(){s._operationTimeoutCb(s._attempts)}),s._operationTimeout);if(s._options.unref){s._timeout.unref()}}s._fn(s._attempts)}),r);if(this._options.unref){i.unref()}return true};RetryOperation.prototype.attempt=function(e,t){this._fn=e;if(t){if(t.timeout){this._operationTimeout=t.timeout}if(t.cb){this._operationTimeoutCb=t.cb}}var r=this;if(this._operationTimeoutCb){this._timeout=setTimeout((function(){r._operationTimeoutCb()}),r._operationTimeout)}this._operationStart=(new Date).getTime();this._fn(this._attempts)};RetryOperation.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated");this.attempt(e)};RetryOperation.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated");this.attempt(e)};RetryOperation.prototype.start=RetryOperation.prototype.try;RetryOperation.prototype.errors=function(){return this._errors};RetryOperation.prototype.attempts=function(){return this._attempts};RetryOperation.prototype.mainError=function(){if(this._errors.length===0){return null}var e={};var t=null;var r=0;for(var s=0;s<this._errors.length;s++){var i=this._errors[s];var n=i.message;var o=(e[n]||0)+1;e[n]=o;if(o>=r){t=i;r=o}}return t}},4959:(e,t,r)=>{const s=r(9491);const i=r(1017);const n=r(7147);let o=undefined;try{o=r(1957)}catch(e){}const a={nosort:true,silent:true};let l=0;const h=process.platform==="win32";const defaults=e=>{const t=["unlink","chmod","stat","lstat","rmdir","readdir"];t.forEach((t=>{e[t]=e[t]||n[t];t=t+"Sync";e[t]=e[t]||n[t]}));e.maxBusyTries=e.maxBusyTries||3;e.emfileWait=e.emfileWait||1e3;if(e.glob===false){e.disableGlob=true}if(e.disableGlob!==true&&o===undefined){throw Error("glob dependency not found, set `options.disableGlob = true` if intentional")}e.disableGlob=e.disableGlob||false;e.glob=e.glob||a};const rimraf=(e,t,r)=>{if(typeof t==="function"){r=t;t={}}s(e,"rimraf: missing path");s.equal(typeof e,"string","rimraf: path should be a string");s.equal(typeof r,"function","rimraf: callback function required");s(t,"rimraf: invalid options argument provided");s.equal(typeof t,"object","rimraf: options should be object");defaults(t);let i=0;let n=null;let a=0;const next=e=>{n=n||e;if(--a===0)r(n)};const afterGlob=(e,s)=>{if(e)return r(e);a=s.length;if(a===0)return r();s.forEach((e=>{const CB=r=>{if(r){if((r.code==="EBUSY"||r.code==="ENOTEMPTY"||r.code==="EPERM")&&i<t.maxBusyTries){i++;return setTimeout((()=>rimraf_(e,t,CB)),i*100)}if(r.code==="EMFILE"&&l<t.emfileWait){return setTimeout((()=>rimraf_(e,t,CB)),l++)}if(r.code==="ENOENT")r=null}l=0;next(r)};rimraf_(e,t,CB)}))};if(t.disableGlob||!o.hasMagic(e))return afterGlob(null,[e]);t.lstat(e,((r,s)=>{if(!r)return afterGlob(null,[e]);o(e,t.glob,afterGlob)}))};const rimraf_=(e,t,r)=>{s(e);s(t);s(typeof r==="function");t.lstat(e,((s,i)=>{if(s&&s.code==="ENOENT")return r(null);if(s&&s.code==="EPERM"&&h)fixWinEPERM(e,t,s,r);if(i&&i.isDirectory())return rmdir(e,t,s,r);t.unlink(e,(s=>{if(s){if(s.code==="ENOENT")return r(null);if(s.code==="EPERM")return h?fixWinEPERM(e,t,s,r):rmdir(e,t,s,r);if(s.code==="EISDIR")return rmdir(e,t,s,r)}return r(s)}))}))};const fixWinEPERM=(e,t,r,i)=>{s(e);s(t);s(typeof i==="function");if(r)s(r instanceof Error);t.chmod(e,438,(s=>{if(s)i(s.code==="ENOENT"?null:r);else t.stat(e,((s,n)=>{if(s)i(s.code==="ENOENT"?null:r);else if(n.isDirectory())rmdir(e,t,r,i);else t.unlink(e,i)}))}))};const fixWinEPERMSync=(e,t,r)=>{s(e);s(t);if(r)s(r instanceof Error);try{t.chmodSync(e,438)}catch(e){if(e.code==="ENOENT")return;else throw r}let i;try{i=t.statSync(e)}catch(e){if(e.code==="ENOENT")return;else throw r}if(i.isDirectory())rmdirSync(e,t,r);else t.unlinkSync(e)};const rmdir=(e,t,r,i)=>{s(e);s(t);if(r)s(r instanceof Error);s(typeof i==="function");t.rmdir(e,(s=>{if(s&&(s.code==="ENOTEMPTY"||s.code==="EEXIST"||s.code==="EPERM"))rmkids(e,t,i);else if(s&&s.code==="ENOTDIR")i(r);else i(s)}))};const rmkids=(e,t,r)=>{s(e);s(t);s(typeof r==="function");t.readdir(e,((s,n)=>{if(s)return r(s);let o=n.length;if(o===0)return t.rmdir(e,r);let a;n.forEach((s=>{rimraf(i.join(e,s),t,(s=>{if(a)return;if(s)return r(a=s);if(--o===0)t.rmdir(e,r)}))}))}))};const rimrafSync=(e,t)=>{t=t||{};defaults(t);s(e,"rimraf: missing path");s.equal(typeof e,"string","rimraf: path should be a string");s(t,"rimraf: missing options");s.equal(typeof t,"object","rimraf: options should be object");let r;if(t.disableGlob||!o.hasMagic(e)){r=[e]}else{try{t.lstatSync(e);r=[e]}catch(s){r=o.sync(e,t.glob)}}if(!r.length)return;for(let e=0;e<r.length;e++){const s=r[e];let i;try{i=t.lstatSync(s)}catch(e){if(e.code==="ENOENT")return;if(e.code==="EPERM"&&h)fixWinEPERMSync(s,t,e)}try{if(i&&i.isDirectory())rmdirSync(s,t,null);else t.unlinkSync(s)}catch(e){if(e.code==="ENOENT")return;if(e.code==="EPERM")return h?fixWinEPERMSync(s,t,e):rmdirSync(s,t,e);if(e.code!=="EISDIR")throw e;rmdirSync(s,t,e)}}};const rmdirSync=(e,t,r)=>{s(e);s(t);if(r)s(r instanceof Error);try{t.rmdirSync(e)}catch(s){if(s.code==="ENOENT")return;if(s.code==="ENOTDIR")throw r;if(s.code==="ENOTEMPTY"||s.code==="EEXIST"||s.code==="EPERM")rmkidsSync(e,t)}};const rmkidsSync=(e,t)=>{s(e);s(t);t.readdirSync(e).forEach((r=>rimrafSync(i.join(e,r),t)));const r=h?100:1;let n=0;do{let s=true;try{const i=t.rmdirSync(e,t);s=false;return i}finally{if(++n<r&&s)continue}}while(true)};e.exports=rimraf;rimraf.sync=rimrafSync},1867:(e,t,r)=>{
3
- /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
4
- var s=r(4300);var i=s.Buffer;function copyProps(e,t){for(var r in e){t[r]=e[r]}}if(i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow){e.exports=s}else{copyProps(s,t);t.Buffer=SafeBuffer}function SafeBuffer(e,t,r){return i(e,t,r)}SafeBuffer.prototype=Object.create(i.prototype);copyProps(i,SafeBuffer);SafeBuffer.from=function(e,t,r){if(typeof e==="number"){throw new TypeError("Argument must not be a number")}return i(e,t,r)};SafeBuffer.alloc=function(e,t,r){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}var s=i(e);if(t!==undefined){if(typeof r==="string"){s.fill(t,r)}else{s.fill(t)}}else{s.fill(0)}return s};SafeBuffer.allocUnsafe=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return i(e)};SafeBuffer.allocUnsafeSlow=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return s.SlowBuffer(e)}},9571:e=>{"use strict";const t="";const r=`${t}[`;const s="";const i={to(e,t){if(!t)return`${r}${e+1}G`;return`${r}${t+1};${e+1}H`},move(e,t){let s="";if(e<0)s+=`${r}${-e}D`;else if(e>0)s+=`${r}${e}C`;if(t<0)s+=`${r}${-t}A`;else if(t>0)s+=`${r}${t}B`;return s},up:(e=1)=>`${r}${e}A`,down:(e=1)=>`${r}${e}B`,forward:(e=1)=>`${r}${e}C`,backward:(e=1)=>`${r}${e}D`,nextLine:(e=1)=>`${r}E`.repeat(e),prevLine:(e=1)=>`${r}F`.repeat(e),left:`${r}G`,hide:`${r}?25l`,show:`${r}?25h`,save:`${t}7`,restore:`${t}8`};const n={up:(e=1)=>`${r}S`.repeat(e),down:(e=1)=>`${r}T`.repeat(e)};const o={screen:`${r}2J`,up:(e=1)=>`${r}1J`.repeat(e),down:(e=1)=>`${r}J`.repeat(e),line:`${r}2K`,lineEnd:`${r}K`,lineStart:`${r}1K`,lines(e){let t="";for(let r=0;r<e;r++)t+=this.line+(r<e-1?i.up():"");if(e)t+=i.left;return t}};e.exports={cursor:i,scroll:n,erase:o,beep:s}},9318:(e,t,r)=>{"use strict";const s=r(2037);const i=r(1621);const n=process.env;let o;if(i("no-color")||i("no-colors")||i("color=false")){o=false}else if(i("color")||i("colors")||i("color=true")||i("color=always")){o=true}if("FORCE_COLOR"in n){o=n.FORCE_COLOR.length===0||parseInt(n.FORCE_COLOR,10)!==0}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e){if(o===false){return 0}if(i("color=16m")||i("color=full")||i("color=truecolor")){return 3}if(i("color=256")){return 2}if(e&&!e.isTTY&&o!==true){return 0}const t=o?1:0;if(process.platform==="win32"){const e=s.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in n){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in n))||n.CI_NAME==="codeship"){return 1}return t}if("TEAMCITY_VERSION"in n){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(n.TEAMCITY_VERSION)?1:0}if(n.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in n){const e=parseInt((n.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(n.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(n.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(n.TERM)){return 1}if("COLORTERM"in n){return 1}if(n.TERM==="dumb"){return t}return t}function getSupportLevel(e){const t=supportsColor(e);return translateLevel(t)}e.exports={supportsColor:getSupportLevel,stdout:getSupportLevel(process.stdout),stderr:getSupportLevel(process.stderr)}},4674:(e,t,r)=>{"use strict";t.c=t.create=r(4016);t.r=t.replace=r(5923);t.t=t.list=r(1525);t.u=t.update=r(4404);t.x=t.extract=r(5317);t.Pack=r(7900);t.Unpack=r(7628);t.Parse=r(8917);t.ReadEntry=r(8116);t.WriteEntry=r(5450);t.Header=r(6043);t.Pax=r(7996);t.types=r(4173)},6707:(e,t,r)=>{"use strict";let s=Buffer;if(!s.alloc){s=r(1867).Buffer}e.exports=s},4016:(e,t,r)=>{"use strict";const s=r(5274);const i=r(7900);const n=r(7147);const o=r(7714);const a=r(1525);const l=r(1017);const h=e.exports=(e,t,r)=>{if(typeof t==="function")r=t;if(Array.isArray(e))t=e,e={};if(!t||!Array.isArray(t)||!t.length)throw new TypeError("no files or directories specified");t=Array.from(t);const i=s(e);if(i.sync&&typeof r==="function")throw new TypeError("callback not supported for sync tar functions");if(!i.file&&typeof r==="function")throw new TypeError("callback only supported with file option");return i.file&&i.sync?createFileSync(i,t):i.file?createFile(i,t,r):i.sync?createSync(i,t):create(i,t)};const createFileSync=(e,t)=>{const r=new i.Sync(e);const s=new o.WriteStreamSync(e.file,{mode:e.mode||438});r.pipe(s);addFilesSync(r,t)};const createFile=(e,t,r)=>{const s=new i(e);const n=new o.WriteStream(e.file,{mode:e.mode||438});s.pipe(n);const a=new Promise(((e,t)=>{n.on("error",t);n.on("close",e);s.on("error",t)}));addFilesAsync(s,t);return r?a.then(r,r):a};const addFilesSync=(e,t)=>{t.forEach((t=>{if(t.charAt(0)==="@")a({file:l.resolve(e.cwd,t.substr(1)),sync:true,noResume:true,onentry:t=>e.add(t)});else e.add(t)}));e.end()};const addFilesAsync=(e,t)=>{while(t.length){const r=t.shift();if(r.charAt(0)==="@")return a({file:l.resolve(e.cwd,r.substr(1)),noResume:true,onentry:t=>e.add(t)}).then((r=>addFilesAsync(e,t)));else e.add(r)}e.end()};const createSync=(e,t)=>{const r=new i.Sync(e);addFilesSync(r,t);return r};const create=(e,t)=>{const r=new i(e);addFilesAsync(r,t);return r}},5317:(e,t,r)=>{"use strict";const s=r(5274);const i=r(7628);const n=r(7147);const o=r(7714);const a=r(1017);const l=e.exports=(e,t,r)=>{if(typeof e==="function")r=e,t=null,e={};else if(Array.isArray(e))t=e,e={};if(typeof t==="function")r=t,t=null;if(!t)t=[];else t=Array.from(t);const i=s(e);if(i.sync&&typeof r==="function")throw new TypeError("callback not supported for sync tar functions");if(!i.file&&typeof r==="function")throw new TypeError("callback only supported with file option");if(t.length)filesFilter(i,t);return i.file&&i.sync?extractFileSync(i):i.file?extractFile(i,r):i.sync?extractSync(i):extract(i)};const filesFilter=(e,t)=>{const r=new Map(t.map((e=>[e.replace(/\/+$/,""),true])));const s=e.filter;const mapHas=(e,t)=>{const s=t||a.parse(e).root||".";const i=e===s?false:r.has(e)?r.get(e):mapHas(a.dirname(e),s);r.set(e,i);return i};e.filter=s?(e,t)=>s(e,t)&&mapHas(e.replace(/\/+$/,"")):e=>mapHas(e.replace(/\/+$/,""))};const extractFileSync=e=>{const t=new i.Sync(e);const r=e.file;let s=true;let a;const l=n.statSync(r);const h=e.maxReadSize||16*1024*1024;const c=new o.ReadStreamSync(r,{readSize:h,size:l.size});c.pipe(t)};const extractFile=(e,t)=>{const r=new i(e);const s=e.maxReadSize||16*1024*1024;const a=e.file;const l=new Promise(((e,t)=>{r.on("error",t);r.on("close",e);n.stat(a,((e,i)=>{if(e)t(e);else{const e=new o.ReadStream(a,{readSize:s,size:i.size});e.on("error",t);e.pipe(r)}}))}));return t?l.then(t,t):l};const extractSync=e=>new i.Sync(e);const extract=e=>new i(e)},6043:(e,t,r)=>{"use strict";const s=r(6707);const i=r(4173);const n=r(1017).posix;const o=r(2370);const a=Symbol("slurp");const l=Symbol("type");class Header{constructor(e,t,r,i){this.cksumValid=false;this.needPax=false;this.nullBlock=false;this.block=null;this.path=null;this.mode=null;this.uid=null;this.gid=null;this.size=null;this.mtime=null;this.cksum=null;this[l]="0";this.linkpath=null;this.uname=null;this.gname=null;this.devmaj=0;this.devmin=0;this.atime=null;this.ctime=null;if(s.isBuffer(e))this.decode(e,t||0,r,i);else if(e)this.set(e)}decode(e,t,r,s){if(!t)t=0;if(!e||!(e.length>=t+512))throw new Error("need 512 bytes for header");this.path=decString(e,t,100);this.mode=decNumber(e,t+100,8);this.uid=decNumber(e,t+108,8);this.gid=decNumber(e,t+116,8);this.size=decNumber(e,t+124,12);this.mtime=decDate(e,t+136,12);this.cksum=decNumber(e,t+148,12);this[a](r);this[a](s,true);this[l]=decString(e,t+156,1);if(this[l]==="")this[l]="0";if(this[l]==="0"&&this.path.substr(-1)==="/")this[l]="5";if(this[l]==="5")this.size=0;this.linkpath=decString(e,t+157,100);if(e.slice(t+257,t+265).toString()==="ustar\x0000"){this.uname=decString(e,t+265,32);this.gname=decString(e,t+297,32);this.devmaj=decNumber(e,t+329,8);this.devmin=decNumber(e,t+337,8);if(e[t+475]!==0){const r=decString(e,t+345,155);this.path=r+"/"+this.path}else{const r=decString(e,t+345,130);if(r)this.path=r+"/"+this.path;this.atime=decDate(e,t+476,12);this.ctime=decDate(e,t+488,12)}}let i=8*32;for(let r=t;r<t+148;r++){i+=e[r]}for(let r=t+156;r<t+512;r++){i+=e[r]}this.cksumValid=i===this.cksum;if(this.cksum===null&&i===8*32)this.nullBlock=true}[a](e,t){for(let r in e){if(e[r]!==null&&e[r]!==undefined&&!(t&&r==="path"))this[r]=e[r]}}encode(e,t){if(!e){e=this.block=s.alloc(512);t=0}if(!t)t=0;if(!(e.length>=t+512))throw new Error("need 512 bytes for header");const r=this.ctime||this.atime?130:155;const i=splitPrefix(this.path||"",r);const n=i[0];const o=i[1];this.needPax=i[2];this.needPax=encString(e,t,100,n)||this.needPax;this.needPax=encNumber(e,t+100,8,this.mode)||this.needPax;this.needPax=encNumber(e,t+108,8,this.uid)||this.needPax;this.needPax=encNumber(e,t+116,8,this.gid)||this.needPax;this.needPax=encNumber(e,t+124,12,this.size)||this.needPax;this.needPax=encDate(e,t+136,12,this.mtime)||this.needPax;e[t+156]=this[l].charCodeAt(0);this.needPax=encString(e,t+157,100,this.linkpath)||this.needPax;e.write("ustar\x0000",t+257,8);this.needPax=encString(e,t+265,32,this.uname)||this.needPax;this.needPax=encString(e,t+297,32,this.gname)||this.needPax;this.needPax=encNumber(e,t+329,8,this.devmaj)||this.needPax;this.needPax=encNumber(e,t+337,8,this.devmin)||this.needPax;this.needPax=encString(e,t+345,r,o)||this.needPax;if(e[t+475]!==0)this.needPax=encString(e,t+345,155,o)||this.needPax;else{this.needPax=encString(e,t+345,130,o)||this.needPax;this.needPax=encDate(e,t+476,12,this.atime)||this.needPax;this.needPax=encDate(e,t+488,12,this.ctime)||this.needPax}let a=8*32;for(let r=t;r<t+148;r++){a+=e[r]}for(let r=t+156;r<t+512;r++){a+=e[r]}this.cksum=a;encNumber(e,t+148,8,this.cksum);this.cksumValid=true;return this.needPax}set(e){for(let t in e){if(e[t]!==null&&e[t]!==undefined)this[t]=e[t]}}get type(){return i.name.get(this[l])||this[l]}get typeKey(){return this[l]}set type(e){if(i.code.has(e))this[l]=i.code.get(e);else this[l]=e}}const splitPrefix=(e,t)=>{const r=100;let i=e;let o="";let a;const l=n.parse(e).root||".";if(s.byteLength(i)<r)a=[i,o,false];else{o=n.dirname(i);i=n.basename(i);do{if(s.byteLength(i)<=r&&s.byteLength(o)<=t)a=[i,o,false];else if(s.byteLength(i)>r&&s.byteLength(o)<=t)a=[i.substr(0,r-1),o,true];else{i=n.join(n.basename(o),i);o=n.dirname(o)}}while(o!==l&&!a);if(!a)a=[e.substr(0,r-1),"",true]}return a};const decString=(e,t,r)=>e.slice(t,t+r).toString("utf8").replace(/\0.*/,"");const decDate=(e,t,r)=>numToDate(decNumber(e,t,r));const numToDate=e=>e===null?null:new Date(e*1e3);const decNumber=(e,t,r)=>e[t]&128?o.parse(e.slice(t,t+r)):decSmallNumber(e,t,r);const nanNull=e=>isNaN(e)?null:e;const decSmallNumber=(e,t,r)=>nanNull(parseInt(e.slice(t,t+r).toString("utf8").replace(/\0.*$/,"").trim(),8));const h={12:8589934591,8:2097151};const encNumber=(e,t,r,s)=>s===null?false:s>h[r]||s<0?(o.encode(s,e.slice(t,t+r)),true):(encSmallNumber(e,t,r,s),false);const encSmallNumber=(e,t,r,s)=>e.write(octalString(s,r),t,r,"ascii");const octalString=(e,t)=>padOctal(Math.floor(e).toString(8),t);const padOctal=(e,t)=>(e.length===t-1?e:new Array(t-e.length-1).join("0")+e+" ")+"\0";const encDate=(e,t,r,s)=>s===null?false:encNumber(e,t,r,s.getTime()/1e3);const c=new Array(156).join("\0");const encString=(e,t,r,i)=>i===null?false:(e.write(i+c,t,r,"utf8"),i.length!==s.byteLength(i)||i.length>r);e.exports=Header},5274:e=>{"use strict";const t=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"]]);const r=e.exports=e=>e?Object.keys(e).map((r=>[t.has(r)?t.get(r):r,e[r]])).reduce(((e,t)=>(e[t[0]]=t[1],e)),Object.create(null)):{}},2370:(e,t)=>{"use strict";const r=t.encode=(e,t)=>{if(!Number.isSafeInteger(e))throw TypeError("cannot encode number outside of javascript safe integer range");else if(e<0)encodeNegative(e,t);else encodePositive(e,t);return t};const encodePositive=(e,t)=>{t[0]=128;for(var r=t.length;r>1;r--){t[r-1]=e&255;e=Math.floor(e/256)}};const encodeNegative=(e,t)=>{t[0]=255;var r=false;e=e*-1;for(var s=t.length;s>1;s--){var i=e&255;e=Math.floor(e/256);if(r)t[s-1]=onesComp(i);else if(i===0)t[s-1]=0;else{r=true;t[s-1]=twosComp(i)}}};const s=t.parse=e=>{var t=e[e.length-1];var r=e[0];var s;if(r===128)s=pos(e.slice(1,e.length));else if(r===255)s=twos(e);else throw TypeError("invalid base256 encoding");if(!Number.isSafeInteger(s))throw TypeError("parsed number outside of javascript safe integer range");return s};const twos=e=>{var t=e.length;var r=0;var s=false;for(var i=t-1;i>-1;i--){var n=e[i];var o;if(s)o=onesComp(n);else if(n===0)o=n;else{s=true;o=twosComp(n)}if(o!==0)r-=o*Math.pow(256,t-i-1)}return r};const pos=e=>{var t=e.length;var r=0;for(var s=t-1;s>-1;s--){var i=e[s];if(i!==0)r+=i*Math.pow(256,t-s-1)}return r};const onesComp=e=>(255^e)&255;const twosComp=e=>(255^e)+1&255},1525:(e,t,r)=>{"use strict";const s=r(6707);const i=r(5274);const n=r(8917);const o=r(7147);const a=r(7714);const l=r(1017);const h=e.exports=(e,t,r)=>{if(typeof e==="function")r=e,t=null,e={};else if(Array.isArray(e))t=e,e={};if(typeof t==="function")r=t,t=null;if(!t)t=[];else t=Array.from(t);const s=i(e);if(s.sync&&typeof r==="function")throw new TypeError("callback not supported for sync tar functions");if(!s.file&&typeof r==="function")throw new TypeError("callback only supported with file option");if(t.length)filesFilter(s,t);if(!s.noResume)onentryFunction(s);return s.file&&s.sync?listFileSync(s):s.file?listFile(s,r):list(s)};const onentryFunction=e=>{const t=e.onentry;e.onentry=t?e=>{t(e);e.resume()}:e=>e.resume()};const filesFilter=(e,t)=>{const r=new Map(t.map((e=>[e.replace(/\/+$/,""),true])));const s=e.filter;const mapHas=(e,t)=>{const s=t||l.parse(e).root||".";const i=e===s?false:r.has(e)?r.get(e):mapHas(l.dirname(e),s);r.set(e,i);return i};e.filter=s?(e,t)=>s(e,t)&&mapHas(e.replace(/\/+$/,"")):e=>mapHas(e.replace(/\/+$/,""))};const listFileSync=e=>{const t=list(e);const r=e.file;let i=true;let n;try{const a=o.statSync(r);const l=e.maxReadSize||16*1024*1024;if(a.size<l){t.end(o.readFileSync(r))}else{let e=0;const i=s.allocUnsafe(l);n=o.openSync(r,"r");while(e<a.size){let r=o.readSync(n,i,0,l,e);e+=r;t.write(i.slice(0,r))}t.end()}i=false}finally{if(i&&n)try{o.closeSync(n)}catch(e){}}};const listFile=(e,t)=>{const r=new n(e);const s=e.maxReadSize||16*1024*1024;const i=e.file;const l=new Promise(((e,t)=>{r.on("error",t);r.on("end",e);o.stat(i,((e,n)=>{if(e)t(e);else{const e=new a.ReadStream(i,{readSize:s,size:n.size});e.on("error",t);e.pipe(r)}}))}));return t?l.then(t,t):l};const list=e=>new n(e)},9624:(e,t,r)=>{"use strict";const s=r(6186);const i=r(7147);const n=r(1017);const o=r(9051);class SymlinkError extends Error{constructor(e,t){super("Cannot extract through symbolic link");this.path=t;this.symlink=e}get name(){return"SylinkError"}}class CwdError extends Error{constructor(e,t){super(t+": Cannot cd into '"+e+"'");this.path=e;this.code=t}get name(){return"CwdError"}}const a=e.exports=(e,t,r)=>{const a=t.umask;const l=t.mode|448;const h=(l&a)!==0;const c=t.uid;const u=t.gid;const d=typeof c==="number"&&typeof u==="number"&&(c!==t.processUid||u!==t.processGid);const p=t.preserve;const m=t.unlink;const g=t.cache;const y=t.cwd;const done=(t,s)=>{if(t)r(t);else{g.set(e,true);if(s&&d)o(s,c,u,(e=>done(e)));else if(h)i.chmod(e,l,r);else r()}};if(g&&g.get(e)===true)return done();if(e===y)return i.stat(e,((t,r)=>{if(t||!r.isDirectory())t=new CwdError(e,t&&t.code||"ENOTDIR");done(t)}));if(p)return s(e,l,done);const b=n.relative(y,e);const v=b.split(/\/|\\/);mkdir_(y,v,l,g,m,y,null,done)};const mkdir_=(e,t,r,s,n,o,a,l)=>{if(!t.length)return l(null,a);const h=t.shift();const c=e+"/"+h;if(s.get(c))return mkdir_(c,t,r,s,n,o,a,l);i.mkdir(c,r,onmkdir(c,t,r,s,n,o,a,l))};const onmkdir=(e,t,r,s,o,a,l,h)=>c=>{if(c){if(c.path&&n.dirname(c.path)===a&&(c.code==="ENOTDIR"||c.code==="ENOENT"))return h(new CwdError(a,c.code));i.lstat(e,((n,u)=>{if(n)h(n);else if(u.isDirectory())mkdir_(e,t,r,s,o,a,l,h);else if(o)i.unlink(e,(n=>{if(n)return h(n);i.mkdir(e,r,onmkdir(e,t,r,s,o,a,l,h))}));else if(u.isSymbolicLink())return h(new SymlinkError(e,e+"/"+t.join("/")));else h(c)}))}else{l=l||e;mkdir_(e,t,r,s,o,a,l,h)}};const l=e.exports.sync=(e,t)=>{const r=t.umask;const a=t.mode|448;const l=(a&r)!==0;const h=t.uid;const c=t.gid;const u=typeof h==="number"&&typeof c==="number"&&(h!==t.processUid||c!==t.processGid);const d=t.preserve;const p=t.unlink;const m=t.cache;const g=t.cwd;const done=t=>{m.set(e,true);if(t&&u)o.sync(t,h,c);if(l)i.chmodSync(e,a)};if(m&&m.get(e)===true)return done();if(e===g){let t=false;let r="ENOTDIR";try{t=i.statSync(e).isDirectory()}catch(e){r=e.code}finally{if(!t)throw new CwdError(e,r)}done();return}if(d)return done(s.sync(e,a));const y=n.relative(g,e);const b=y.split(/\/|\\/);let v=null;for(let e=b.shift(),t=g;e&&(t+="/"+e);e=b.shift()){if(m.get(t))continue;try{i.mkdirSync(t,a);v=v||t;m.set(t,true)}catch(e){if(e.path&&n.dirname(e.path)===g&&(e.code==="ENOTDIR"||e.code==="ENOENT"))return new CwdError(g,e.code);const r=i.lstatSync(t);if(r.isDirectory()){m.set(t,true);continue}else if(p){i.unlinkSync(t);i.mkdirSync(t,a);v=v||t;m.set(t,true);continue}else if(r.isSymbolicLink())return new SymlinkError(t,t+"/"+b.join("/"))}}return done(v)}},8371:e=>{"use strict";e.exports=(e,t)=>{e&=4095;if(t){if(e&256)e|=64;if(e&32)e|=8;if(e&4)e|=1}return e}},7900:(e,t,r)=>{"use strict";const s=r(6707);class PackJob{constructor(e,t){this.path=e||"./";this.absolute=t;this.entry=null;this.stat=null;this.readdir=null;this.pending=false;this.ignore=false;this.piped=false}}const i=r(1077);const n=r(3486);const o=r(8116);const a=r(5450);const l=a.Sync;const h=a.Tar;const c=r(665);const u=s.alloc(1024);const d=Symbol("onStat");const p=Symbol("ended");const m=Symbol("queue");const g=Symbol("current");const y=Symbol("process");const b=Symbol("processing");const v=Symbol("processJob");const w=Symbol("jobs");const _=Symbol("jobDone");const E=Symbol("addFSEntry");const S=Symbol("addTarEntry");const x=Symbol("stat");const O=Symbol("readdir");const k=Symbol("onreaddir");const R=Symbol("pipe");const T=Symbol("entry");const C=Symbol("entryOpt");const P=Symbol("writeEntryClass");const M=Symbol("write");const A=Symbol("ondrain");const I=r(7147);const j=r(1017);const L=r(5899);const D=L(class Pack extends i{constructor(e){super(e);e=e||Object.create(null);this.opt=e;this.cwd=e.cwd||process.cwd();this.maxReadSize=e.maxReadSize;this.preservePaths=!!e.preservePaths;this.strict=!!e.strict;this.noPax=!!e.noPax;this.prefix=(e.prefix||"").replace(/(\\|\/)+$/,"");this.linkCache=e.linkCache||new Map;this.statCache=e.statCache||new Map;this.readdirCache=e.readdirCache||new Map;this[P]=a;if(typeof e.onwarn==="function")this.on("warn",e.onwarn);this.zip=null;if(e.gzip){if(typeof e.gzip!=="object")e.gzip={};this.zip=new n.Gzip(e.gzip);this.zip.on("data",(e=>super.write(e)));this.zip.on("end",(e=>super.end()));this.zip.on("drain",(e=>this[A]()));this.on("resume",(e=>this.zip.resume()))}else this.on("drain",this[A]);this.portable=!!e.portable;this.noDirRecurse=!!e.noDirRecurse;this.follow=!!e.follow;this.noMtime=!!e.noMtime;this.mtime=e.mtime||null;this.filter=typeof e.filter==="function"?e.filter:e=>true;this[m]=new c;this[w]=0;this.jobs=+e.jobs||4;this[b]=false;this[p]=false}[M](e){return super.write(e)}add(e){this.write(e);return this}end(e){if(e)this.write(e);this[p]=true;this[y]();return this}write(e){if(this[p])throw new Error("write after end");if(e instanceof o)this[S](e);else this[E](e);return this.flowing}[S](e){const t=j.resolve(this.cwd,e.path);if(this.prefix)e.path=this.prefix+"/"+e.path.replace(/^\.(\/+|$)/,"");if(!this.filter(e.path,e))e.resume();else{const r=new PackJob(e.path,t,false);r.entry=new h(e,this[C](r));r.entry.on("end",(e=>this[_](r)));this[w]+=1;this[m].push(r)}this[y]()}[E](e){const t=j.resolve(this.cwd,e);if(this.prefix)e=this.prefix+"/"+e.replace(/^\.(\/+|$)/,"");this[m].push(new PackJob(e,t));this[y]()}[x](e){e.pending=true;this[w]+=1;const t=this.follow?"stat":"lstat";I[t](e.absolute,((t,r)=>{e.pending=false;this[w]-=1;if(t)this.emit("error",t);else this[d](e,r)}))}[d](e,t){this.statCache.set(e.absolute,t);e.stat=t;if(!this.filter(e.path,t))e.ignore=true;this[y]()}[O](e){e.pending=true;this[w]+=1;I.readdir(e.absolute,((t,r)=>{e.pending=false;this[w]-=1;if(t)return this.emit("error",t);this[k](e,r)}))}[k](e,t){this.readdirCache.set(e.absolute,t);e.readdir=t;this[y]()}[y](){if(this[b])return;this[b]=true;for(let e=this[m].head;e!==null&&this[w]<this.jobs;e=e.next){this[v](e.value);if(e.value.ignore){const t=e.next;this[m].removeNode(e);e.next=t}}this[b]=false;if(this[p]&&!this[m].length&&this[w]===0){if(this.zip)this.zip.end(u);else{super.write(u);super.end()}}}get[g](){return this[m]&&this[m].head&&this[m].head.value}[_](e){this[m].shift();this[w]-=1;this[y]()}[v](e){if(e.pending)return;if(e.entry){if(e===this[g]&&!e.piped)this[R](e);return}if(!e.stat){if(this.statCache.has(e.absolute))this[d](e,this.statCache.get(e.absolute));else this[x](e)}if(!e.stat)return;if(e.ignore)return;if(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir){if(this.readdirCache.has(e.absolute))this[k](e,this.readdirCache.get(e.absolute));else this[O](e);if(!e.readdir)return}e.entry=this[T](e);if(!e.entry){e.ignore=true;return}if(e===this[g]&&!e.piped)this[R](e)}[C](e){return{onwarn:(e,t)=>{this.warn(e,t)},noPax:this.noPax,cwd:this.cwd,absolute:e.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime}}[T](e){this[w]+=1;try{return new this[P](e.path,this[C](e)).on("end",(()=>this[_](e))).on("error",(e=>this.emit("error",e)))}catch(e){this.emit("error",e)}}[A](){if(this[g]&&this[g].entry)this[g].entry.resume()}[R](e){e.piped=true;if(e.readdir)e.readdir.forEach((t=>{const r=this.prefix?e.path.slice(this.prefix.length+1)||"./":e.path;const s=r==="./"?"":r.replace(/\/*$/,"/");this[E](s+t)}));const t=e.entry;const r=this.zip;if(r)t.on("data",(e=>{if(!r.write(e))t.pause()}));else t.on("data",(e=>{if(!super.write(e))t.pause()}))}pause(){if(this.zip)this.zip.pause();return super.pause()}});class PackSync extends D{constructor(e){super(e);this[P]=l}pause(){}resume(){}[x](e){const t=this.follow?"statSync":"lstatSync";this[d](e,I[t](e.absolute))}[O](e,t){this[k](e,I.readdirSync(e.absolute))}[R](e){const t=e.entry;const r=this.zip;if(e.readdir)e.readdir.forEach((t=>{const r=this.prefix?e.path.slice(this.prefix.length+1)||"./":e.path;const s=r==="./"?"":r.replace(/\/*$/,"/");this[E](s+t)}));if(r)t.on("data",(e=>{r.write(e)}));else t.on("data",(e=>{super[M](e)}))}}D.Sync=PackSync;e.exports=D},8917:(e,t,r)=>{"use strict";const s=r(5899);const i=r(1017);const n=r(6043);const o=r(2361);const a=r(665);const l=1024*1024;const h=r(8116);const c=r(7996);const u=r(3486);const d=r(6707);const p=d.from([31,139]);const m=Symbol("state");const g=Symbol("writeEntry");const y=Symbol("readEntry");const b=Symbol("nextEntry");const v=Symbol("processEntry");const w=Symbol("extendedHeader");const _=Symbol("globalExtendedHeader");const E=Symbol("meta");const S=Symbol("emitMeta");const x=Symbol("buffer");const O=Symbol("queue");const k=Symbol("ended");const R=Symbol("emittedEnd");const T=Symbol("emit");const C=Symbol("unzip");const P=Symbol("consumeChunk");const M=Symbol("consumeChunkSub");const A=Symbol("consumeBody");const I=Symbol("consumeMeta");const j=Symbol("consumeHeader");const L=Symbol("consuming");const D=Symbol("bufferConcat");const N=Symbol("maybeEnd");const $=Symbol("writing");const B=Symbol("aborted");const F=Symbol("onDone");const noop=e=>true;e.exports=s(class Parser extends o{constructor(e){e=e||{};super(e);if(e.ondone)this.on(F,e.ondone);else this.on(F,(e=>{this.emit("prefinish");this.emit("finish");this.emit("end");this.emit("close")}));this.strict=!!e.strict;this.maxMetaEntrySize=e.maxMetaEntrySize||l;this.filter=typeof e.filter==="function"?e.filter:noop;this.writable=true;this.readable=false;this[O]=new a;this[x]=null;this[y]=null;this[g]=null;this[m]="begin";this[E]="";this[w]=null;this[_]=null;this[k]=false;this[C]=null;this[B]=false;if(typeof e.onwarn==="function")this.on("warn",e.onwarn);if(typeof e.onentry==="function")this.on("entry",e.onentry)}[j](e,t){const r=new n(e,t,this[w],this[_]);if(r.nullBlock)this[T]("nullBlock");else if(!r.cksumValid)this.warn("invalid entry",r);else if(!r.path)this.warn("invalid: path is required",r);else{const e=r.type;if(/^(Symbolic)?Link$/.test(e)&&!r.linkpath)this.warn("invalid: linkpath required",r);else if(!/^(Symbolic)?Link$/.test(e)&&r.linkpath)this.warn("invalid: linkpath forbidden",r);else{const e=this[g]=new h(r,this[w],this[_]);if(e.meta){if(e.size>this.maxMetaEntrySize){e.ignore=true;this[T]("ignoredEntry",e);this[m]="ignore"}else if(e.size>0){this[E]="";e.on("data",(e=>this[E]+=e));this[m]="meta"}}else{this[w]=null;e.ignore=e.ignore||!this.filter(e.path,e);if(e.ignore){this[T]("ignoredEntry",e);this[m]=e.remain?"ignore":"begin"}else{if(e.remain)this[m]="body";else{this[m]="begin";e.end()}if(!this[y]){this[O].push(e);this[b]()}else this[O].push(e)}}}}}[v](e){let t=true;if(!e){this[y]=null;t=false}else if(Array.isArray(e))this.emit.apply(this,e);else{this[y]=e;this.emit("entry",e);if(!e.emittedEnd){e.on("end",(e=>this[b]()));t=false}}return t}[b](){do{}while(this[v](this[O].shift()));if(!this[O].length){const e=this[y];const t=!e||e.flowing||e.size===e.remain;if(t){if(!this[$])this.emit("drain")}else e.once("drain",(e=>this.emit("drain")))}}[A](e,t){const r=this[g];const s=r.blockRemain;const i=s>=e.length&&t===0?e:e.slice(t,t+s);r.write(i);if(!r.blockRemain){this[m]="begin";this[g]=null;r.end()}return i.length}[I](e,t){const r=this[g];const s=this[A](e,t);if(!this[g])this[S](r);return s}[T](e,t,r){if(!this[O].length&&!this[y])this.emit(e,t,r);else this[O].push([e,t,r])}[S](e){this[T]("meta",this[E]);switch(e.type){case"ExtendedHeader":case"OldExtendedHeader":this[w]=c.parse(this[E],this[w],false);break;case"GlobalExtendedHeader":this[_]=c.parse(this[E],this[_],true);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[w]=this[w]||Object.create(null);this[w].path=this[E].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[w]=this[w]||Object.create(null);this[w].linkpath=this[E].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+e.type)}}abort(e,t){this[B]=true;this.warn(e,t);this.emit("abort",t);this.emit("error",t)}write(e){if(this[B])return;if(this[C]===null&&e){if(this[x]){e=d.concat([this[x],e]);this[x]=null}if(e.length<p.length){this[x]=e;return true}for(let t=0;this[C]===null&&t<p.length;t++){if(e[t]!==p[t])this[C]=false}if(this[C]===null){const t=this[k];this[k]=false;this[C]=new u.Unzip;this[C].on("data",(e=>this[P](e)));this[C].on("error",(e=>this.abort(e.message,e)));this[C].on("end",(e=>{this[k]=true;this[P]()}));this[$]=true;const r=this[C][t?"end":"write"](e);this[$]=false;return r}}this[$]=true;if(this[C])this[C].write(e);else this[P](e);this[$]=false;const t=this[O].length?false:this[y]?this[y].flowing:true;if(!t&&!this[O].length)this[y].once("drain",(e=>this.emit("drain")));return t}[D](e){if(e&&!this[B])this[x]=this[x]?d.concat([this[x],e]):e}[N](){if(this[k]&&!this[R]&&!this[B]&&!this[L]){this[R]=true;const e=this[g];if(e&&e.blockRemain){const t=this[x]?this[x].length:0;this.warn("Truncated input (needed "+e.blockRemain+" more bytes, only "+t+" available)",e);if(this[x])e.write(this[x]);e.end()}this[T](F)}}[P](e){if(this[L]){this[D](e)}else if(!e&&!this[x]){this[N]()}else{this[L]=true;if(this[x]){this[D](e);const t=this[x];this[x]=null;this[M](t)}else{this[M](e)}while(this[x]&&this[x].length>=512&&!this[B]){const e=this[x];this[x]=null;this[M](e)}this[L]=false}if(!this[x]||this[k])this[N]()}[M](e){let t=0;let r=e.length;while(t+512<=r&&!this[B]){switch(this[m]){case"begin":this[j](e,t);t+=512;break;case"ignore":case"body":t+=this[A](e,t);break;case"meta":t+=this[I](e,t);break;default:throw new Error("invalid state: "+this[m])}}if(t<r){if(this[x])this[x]=d.concat([e.slice(t),this[x]]);else this[x]=e.slice(t)}}end(e){if(!this[B]){if(this[C])this[C].end(e);else{this[k]=true;this.write(e)}}}})},7996:(e,t,r)=>{"use strict";const s=r(6707);const i=r(6043);const n=r(1017);class Pax{constructor(e,t){this.atime=e.atime||null;this.charset=e.charset||null;this.comment=e.comment||null;this.ctime=e.ctime||null;this.gid=e.gid||null;this.gname=e.gname||null;this.linkpath=e.linkpath||null;this.mtime=e.mtime||null;this.path=e.path||null;this.size=e.size||null;this.uid=e.uid||null;this.uname=e.uname||null;this.dev=e.dev||null;this.ino=e.ino||null;this.nlink=e.nlink||null;this.global=t||false}encode(){const e=this.encodeBody();if(e==="")return null;const t=s.byteLength(e);const r=512*Math.ceil(1+t/512);const o=s.allocUnsafe(r);for(let e=0;e<512;e++){o[e]=0}new i({path:("PaxHeader/"+n.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:t,mtime:this.mtime||null,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime||null,ctime:this.ctime||null}).encode(o);o.write(e,512,t,"utf8");for(let e=t+512;e<o.length;e++){o[e]=0}return o}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(e){if(this[e]===null||this[e]===undefined)return"";const t=this[e]instanceof Date?this[e].getTime()/1e3:this[e];const r=" "+(e==="dev"||e==="ino"||e==="nlink"?"SCHILY.":"")+e+"="+t+"\n";const i=s.byteLength(r);let n=Math.floor(Math.log(i)/Math.log(10))+1;if(i+n>=Math.pow(10,n))n+=1;const o=n+i;return o+r}}Pax.parse=(e,t,r)=>new Pax(merge(parseKV(e),t),r);const merge=(e,t)=>t?Object.keys(e).reduce(((t,r)=>(t[r]=e[r],t)),t):e;const parseKV=e=>e.replace(/\n$/,"").split("\n").reduce(parseKVLine,Object.create(null));const parseKVLine=(e,t)=>{const r=parseInt(t,10);if(r!==s.byteLength(t)+1)return e;t=t.substr((r+" ").length);const i=t.split("=");const n=i.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!n)return e;const o=i.join("=");e[n]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(n)?new Date(o*1e3):/^[0-9]+$/.test(o)?+o:o;return e};e.exports=Pax},8116:(e,t,r)=>{"use strict";const s=r(4173);const i=r(1077);const n=Symbol("slurp");e.exports=class ReadEntry extends i{constructor(e,t,r){super();this.extended=t;this.globalExtended=r;this.header=e;this.startBlockSize=512*Math.ceil(e.size/512);this.blockRemain=this.startBlockSize;this.remain=e.size;this.type=e.type;this.meta=false;this.ignore=false;switch(this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=true;break;default:this.ignore=true}this.path=e.path;this.mode=e.mode;if(this.mode)this.mode=this.mode&4095;this.uid=e.uid;this.gid=e.gid;this.uname=e.uname;this.gname=e.gname;this.size=e.size;this.mtime=e.mtime;this.atime=e.atime;this.ctime=e.ctime;this.linkpath=e.linkpath;this.uname=e.uname;this.gname=e.gname;if(t)this[n](t);if(r)this[n](r,true)}write(e){const t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");const r=this.remain;const s=this.blockRemain;this.remain=Math.max(0,r-t);this.blockRemain=Math.max(0,s-t);if(this.ignore)return true;if(r>=t)return super.write(e);return super.write(e.slice(0,r))}[n](e,t){for(let r in e){if(e[r]!==null&&e[r]!==undefined&&!(t&&r==="path"))this[r]=e[r]}}}},5923:(e,t,r)=>{"use strict";const s=r(6707);const i=r(5274);const n=r(7900);const o=r(8917);const a=r(7147);const l=r(7714);const h=r(1525);const c=r(1017);const u=r(6043);const d=e.exports=(e,t,r)=>{const s=i(e);if(!s.file)throw new TypeError("file is required");if(s.gzip)throw new TypeError("cannot append to compressed archives");if(!t||!Array.isArray(t)||!t.length)throw new TypeError("no files or directories specified");t=Array.from(t);return s.sync?replaceSync(s,t):replace(s,t,r)};const replaceSync=(e,t)=>{const r=new n.Sync(e);let i=true;let o;let l;try{try{o=a.openSync(e.file,"r+")}catch(t){if(t.code==="ENOENT")o=a.openSync(e.file,"w+");else throw t}const n=a.fstatSync(o);const h=s.alloc(512);e:for(l=0;l<n.size;l+=512){for(let e=0,t=0;e<512;e+=t){t=a.readSync(o,h,e,h.length-e,l+e);if(l===0&&h[0]===31&&h[1]===139)throw new Error("cannot append to compressed archives");if(!t)break e}let t=new u(h);if(!t.cksumValid)break;let r=512*Math.ceil(t.size/512);if(l+r+512>n.size)break;l+=r;if(e.mtimeCache)e.mtimeCache.set(t.path,t.mtime)}i=false;streamSync(e,r,l,o,t)}finally{if(i)try{a.closeSync(o)}catch(e){}}};const streamSync=(e,t,r,s,i)=>{const n=new l.WriteStreamSync(e.file,{fd:s,start:r});t.pipe(n);addFilesSync(t,i)};const replace=(e,t,r)=>{t=Array.from(t);const i=new n(e);const getPos=(t,r,i)=>{const cb=(e,r)=>{if(e)a.close(t,(t=>i(e)));else i(null,r)};let n=0;if(r===0)return cb(null,0);let o=0;const l=s.alloc(512);const onread=(s,i)=>{if(s)return cb(s);o+=i;if(o<512&&i)return a.read(t,l,o,l.length-o,n+o,onread);if(n===0&&l[0]===31&&l[1]===139)return cb(new Error("cannot append to compressed archives"));if(o<512)return cb(null,n);const h=new u(l);if(!h.cksumValid)return cb(null,n);const c=512*Math.ceil(h.size/512);if(n+c+512>r)return cb(null,n);n+=c+512;if(n>=r)return cb(null,n);if(e.mtimeCache)e.mtimeCache.set(h.path,h.mtime);o=0;a.read(t,l,0,512,n,onread)};a.read(t,l,0,512,n,onread)};const o=new Promise(((r,s)=>{i.on("error",s);let n="r+";const onopen=(o,h)=>{if(o&&o.code==="ENOENT"&&n==="r+"){n="w+";return a.open(e.file,n,onopen)}if(o)return s(o);a.fstat(h,((n,o)=>{if(n)return s(n);getPos(h,o.size,((n,o)=>{if(n)return s(n);const a=new l.WriteStream(e.file,{fd:h,start:o});i.pipe(a);a.on("error",s);a.on("close",r);addFilesAsync(i,t)}))}))};a.open(e.file,n,onopen)}));return r?o.then(r,r):o};const addFilesSync=(e,t)=>{t.forEach((t=>{if(t.charAt(0)==="@")h({file:c.resolve(e.cwd,t.substr(1)),sync:true,noResume:true,onentry:t=>e.add(t)});else e.add(t)}));e.end()};const addFilesAsync=(e,t)=>{while(t.length){const r=t.shift();if(r.charAt(0)==="@")return h({file:c.resolve(e.cwd,r.substr(1)),noResume:true,onentry:t=>e.add(t)}).then((r=>addFilesAsync(e,t)));else e.add(r)}e.end()}},4173:(e,t)=>{"use strict";t.name=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]);t.code=new Map(Array.from(t.name).map((e=>[e[1],e[0]])))},7628:(e,t,r)=>{"use strict";const s=r(9491);const i=r(2361).EventEmitter;const n=r(8917);const o=r(7147);const a=r(7714);const l=r(1017);const h=r(9624);const c=h.sync;const u=r(4808);const d=Symbol("onEntry");const p=Symbol("checkFs");const m=Symbol("isReusable");const g=Symbol("makeFs");const y=Symbol("file");const b=Symbol("directory");const v=Symbol("link");const w=Symbol("symlink");const _=Symbol("hardlink");const E=Symbol("unsupported");const S=Symbol("unknown");const x=Symbol("checkPath");const O=Symbol("mkdir");const k=Symbol("onError");const R=Symbol("pending");const T=Symbol("pend");const C=Symbol("unpend");const P=Symbol("ended");const M=Symbol("maybeClose");const A=Symbol("skip");const I=Symbol("doChown");const j=Symbol("uid");const L=Symbol("gid");const D=r(6113);const unlinkFile=(e,t)=>{if(process.platform!=="win32")return o.unlink(e,t);const r=e+".DELETE."+D.randomBytes(16).toString("hex");o.rename(e,r,(e=>{if(e)return t(e);o.unlink(r,t)}))};const unlinkFileSync=e=>{if(process.platform!=="win32")return o.unlinkSync(e);const t=e+".DELETE."+D.randomBytes(16).toString("hex");o.renameSync(e,t);o.unlinkSync(t)};const uint32=(e,t,r)=>e===e>>>0?e:t===t>>>0?t:r;class Unpack extends n{constructor(e){if(!e)e={};e.ondone=e=>{this[P]=true;this[M]()};super(e);this.transform=typeof e.transform==="function"?e.transform:null;this.writable=true;this.readable=false;this[R]=0;this[P]=false;this.dirCache=e.dirCache||new Map;if(typeof e.uid==="number"||typeof e.gid==="number"){if(typeof e.uid!=="number"||typeof e.gid!=="number")throw new TypeError("cannot set owner without number uid and gid");if(e.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=e.uid;this.gid=e.gid;this.setOwner=true}else{this.uid=null;this.gid=null;this.setOwner=false}if(e.preserveOwner===undefined&&typeof e.uid!=="number")this.preserveOwner=process.getuid&&process.getuid()===0;else this.preserveOwner=!!e.preserveOwner;this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():null;this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():null;this.forceChown=e.forceChown===true;this.win32=!!e.win32||process.platform==="win32";this.newer=!!e.newer;this.keep=!!e.keep;this.noMtime=!!e.noMtime;this.preservePaths=!!e.preservePaths;this.unlink=!!e.unlink;this.cwd=l.resolve(e.cwd||process.cwd());this.strip=+e.strip||0;this.processUmask=process.umask();this.umask=typeof e.umask==="number"?e.umask:this.processUmask;this.dmode=e.dmode||511&~this.umask;this.fmode=e.fmode||438&~this.umask;this.on("entry",(e=>this[d](e)))}[M](){if(this[P]&&this[R]===0){this.emit("prefinish");this.emit("finish");this.emit("end");this.emit("close")}}[x](e){if(this.strip){const t=e.path.split(/\/|\\/);if(t.length<this.strip)return false;e.path=t.slice(this.strip).join("/");if(e.type==="Link"){const t=e.linkpath.split(/\/|\\/);if(t.length>=this.strip)e.linkpath=t.slice(this.strip).join("/")}}if(!this.preservePaths){const t=e.path;if(t.match(/(^|\/|\\)\.\.(\\|\/|$)/)){this.warn("path contains '..'",t);return false}if(l.win32.isAbsolute(t)){const r=l.win32.parse(t);this.warn("stripping "+r.root+" from absolute path",t);e.path=t.substr(r.root.length)}}if(this.win32){const t=l.win32.parse(e.path);e.path=t.root===""?u.encode(e.path):t.root+u.encode(e.path.substr(t.root.length))}if(l.isAbsolute(e.path))e.absolute=e.path;else e.absolute=l.resolve(this.cwd,e.path);return true}[d](e){if(!this[x](e))return e.resume();s.equal(typeof e.absolute,"string");switch(e.type){case"Directory":case"GNUDumpDir":if(e.mode)e.mode=e.mode|448;case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[p](e);case"CharacterDevice":case"BlockDevice":case"FIFO":return this[E](e)}}[k](e,t){if(e.name==="CwdError")this.emit("error",e);else{this.warn(e.message,e);this[C]();t.resume()}}[O](e,t,r){h(e,{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:t},r)}[I](e){return this.forceChown||this.preserveOwner&&(typeof e.uid==="number"&&e.uid!==this.processUid||typeof e.gid==="number"&&e.gid!==this.processGid)||(typeof this.uid==="number"&&this.uid!==this.processUid||typeof this.gid==="number"&&this.gid!==this.processGid)}[j](e){return uint32(this.uid,e.uid,this.processUid)}[L](e){return uint32(this.gid,e.gid,this.processGid)}[y](e){const t=e.mode&4095||this.fmode;const r=new a.WriteStream(e.absolute,{mode:t,autoClose:false});r.on("error",(t=>this[k](t,e)));let s=1;const done=t=>{if(t)return this[k](t,e);if(--s===0)o.close(r.fd,(e=>this[C]()))};r.on("finish",(t=>{const i=e.absolute;const n=r.fd;if(e.mtime&&!this.noMtime){s++;const t=e.atime||new Date;const r=e.mtime;o.futimes(n,t,r,(e=>e?o.utimes(i,t,r,(t=>done(t&&e))):done()))}if(this[I](e)){s++;const t=this[j](e);const r=this[L](e);o.fchown(n,t,r,(e=>e?o.chown(i,t,r,(t=>done(t&&e))):done()))}done()}));const i=this.transform?this.transform(e)||e:e;if(i!==e){i.on("error",(t=>this[k](t,e)));e.pipe(i)}i.pipe(r)}[b](e){const t=e.mode&4095||this.dmode;this[O](e.absolute,t,(t=>{if(t)return this[k](t,e);let r=1;const done=t=>{if(--r===0){this[C]();e.resume()}};if(e.mtime&&!this.noMtime){r++;o.utimes(e.absolute,e.atime||new Date,e.mtime,done)}if(this[I](e)){r++;o.chown(e.absolute,this[j](e),this[L](e),done)}done()}))}[E](e){this.warn("unsupported entry type: "+e.type,e);e.resume()}[w](e){this[v](e,e.linkpath,"symlink")}[_](e){this[v](e,l.resolve(this.cwd,e.linkpath),"link")}[T](){this[R]++}[C](){this[R]--;this[M]()}[A](e){this[C]();e.resume()}[m](e,t){return e.type==="File"&&!this.unlink&&t.isFile()&&t.nlink<=1&&process.platform!=="win32"}[p](e){this[T]();this[O](l.dirname(e.absolute),this.dmode,(t=>{if(t)return this[k](t,e);o.lstat(e.absolute,((t,r)=>{if(r&&(this.keep||this.newer&&r.mtime>e.mtime))this[A](e);else if(t||this[m](e,r))this[g](null,e);else if(r.isDirectory()){if(e.type==="Directory"){if(!e.mode||(r.mode&4095)===e.mode)this[g](null,e);else o.chmod(e.absolute,e.mode,(t=>this[g](t,e)))}else o.rmdir(e.absolute,(t=>this[g](t,e)))}else unlinkFile(e.absolute,(t=>this[g](t,e)))}))}))}[g](e,t){if(e)return this[k](e,t);switch(t.type){case"File":case"OldFile":case"ContiguousFile":return this[y](t);case"Link":return this[_](t);case"SymbolicLink":return this[w](t);case"Directory":case"GNUDumpDir":return this[b](t)}}[v](e,t,r){o[r](t,e.absolute,(t=>{if(t)return this[k](t,e);this[C]();e.resume()}))}}class UnpackSync extends Unpack{constructor(e){super(e)}[p](e){const t=this[O](l.dirname(e.absolute),this.dmode);if(t)return this[k](t,e);try{const r=o.lstatSync(e.absolute);if(this.keep||this.newer&&r.mtime>e.mtime)return this[A](e);else if(this[m](e,r))return this[g](null,e);else{try{if(r.isDirectory()){if(e.type==="Directory"){if(e.mode&&(r.mode&4095)!==e.mode)o.chmodSync(e.absolute,e.mode)}else o.rmdirSync(e.absolute)}else unlinkFileSync(e.absolute);return this[g](null,e)}catch(t){return this[k](t,e)}}}catch(t){return this[g](null,e)}}[y](e){const t=e.mode&4095||this.fmode;const oner=t=>{try{o.closeSync(s)}catch(e){}if(t)this[k](t,e)};let r;let s;try{s=o.openSync(e.absolute,"w",t)}catch(e){return oner(e)}const i=this.transform?this.transform(e)||e:e;if(i!==e){i.on("error",(t=>this[k](t,e)));e.pipe(i)}i.on("data",(e=>{try{o.writeSync(s,e,0,e.length)}catch(e){oner(e)}}));i.on("end",(t=>{let r=null;if(e.mtime&&!this.noMtime){const t=e.atime||new Date;const i=e.mtime;try{o.futimesSync(s,t,i)}catch(s){try{o.utimesSync(e.absolute,t,i)}catch(e){r=s}}}if(this[I](e)){const t=this[j](e);const i=this[L](e);try{o.fchownSync(s,t,i)}catch(s){try{o.chownSync(e.absolute,t,i)}catch(e){r=r||s}}}oner(r)}))}[b](e){const t=e.mode&4095||this.dmode;const r=this[O](e.absolute,t);if(r)return this[k](r,e);if(e.mtime&&!this.noMtime){try{o.utimesSync(e.absolute,e.atime||new Date,e.mtime)}catch(r){}}if(this[I](e)){try{o.chownSync(e.absolute,this[j](e),this[L](e))}catch(r){}}e.resume()}[O](e,t){try{return h.sync(e,{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:t})}catch(e){return e}}[v](e,t,r){try{o[r+"Sync"](t,e.absolute);e.resume()}catch(t){return this[k](t,e)}}}Unpack.Sync=UnpackSync;e.exports=Unpack},4404:(e,t,r)=>{"use strict";const s=r(5274);const i=r(5923);const n=e.exports=(e,t,r)=>{const n=s(e);if(!n.file)throw new TypeError("file is required");if(n.gzip)throw new TypeError("cannot append to compressed archives");if(!t||!Array.isArray(t)||!t.length)throw new TypeError("no files or directories specified");t=Array.from(t);mtimeFilter(n);return i(n,t,r)};const mtimeFilter=e=>{const t=e.filter;if(!e.mtimeCache)e.mtimeCache=new Map;e.filter=t?(r,s)=>t(r,s)&&!(e.mtimeCache.get(r)>s.mtime):(t,r)=>!(e.mtimeCache.get(t)>r.mtime)}},5899:e=>{"use strict";e.exports=e=>class extends e{warn(e,t){if(!this.strict)this.emit("warn",e,t);else if(t instanceof Error)this.emit("error",t);else{const r=new Error(e);r.data=t;this.emit("error",r)}}}},4808:e=>{"use strict";const t=["|","<",">","?",":"];const r=t.map((e=>String.fromCharCode(61440+e.charCodeAt(0))));const s=new Map(t.map(((e,t)=>[e,r[t]])));const i=new Map(r.map(((e,r)=>[e,t[r]])));e.exports={encode:e=>t.reduce(((e,t)=>e.split(t).join(s.get(t))),e),decode:e=>r.reduce(((e,t)=>e.split(t).join(i.get(t))),e)}},5450:(e,t,r)=>{"use strict";const s=r(6707);const i=r(1077);const n=r(7996);const o=r(6043);const a=r(8116);const l=r(7147);const h=r(1017);const c=r(4173);const u=16*1024*1024;const d=Symbol("process");const p=Symbol("file");const m=Symbol("directory");const g=Symbol("symlink");const y=Symbol("hardlink");const b=Symbol("header");const v=Symbol("read");const w=Symbol("lstat");const _=Symbol("onlstat");const E=Symbol("onread");const S=Symbol("onreadlink");const x=Symbol("openfile");const O=Symbol("onopenfile");const k=Symbol("close");const R=Symbol("mode");const T=r(5899);const C=r(4808);const P=r(8371);const M=T(class WriteEntry extends i{constructor(e,t){t=t||{};super(t);if(typeof e!=="string")throw new TypeError("path is required");this.path=e;this.portable=!!t.portable;this.myuid=process.getuid&&process.getuid();this.myuser=process.env.USER||"";this.maxReadSize=t.maxReadSize||u;this.linkCache=t.linkCache||new Map;this.statCache=t.statCache||new Map;this.preservePaths=!!t.preservePaths;this.cwd=t.cwd||process.cwd();this.strict=!!t.strict;this.noPax=!!t.noPax;this.noMtime=!!t.noMtime;this.mtime=t.mtime||null;if(typeof t.onwarn==="function")this.on("warn",t.onwarn);if(!this.preservePaths&&h.win32.isAbsolute(e)){const t=h.win32.parse(e);this.warn("stripping "+t.root+" from absolute path",e);this.path=e.substr(t.root.length)}this.win32=!!t.win32||process.platform==="win32";if(this.win32){this.path=C.decode(this.path.replace(/\\/g,"/"));e=e.replace(/\\/g,"/")}this.absolute=t.absolute||h.resolve(this.cwd,e);if(this.path==="")this.path="./";if(this.statCache.has(this.absolute))this[_](this.statCache.get(this.absolute));else this[w]()}[w](){l.lstat(this.absolute,((e,t)=>{if(e)return this.emit("error",e);this[_](t)}))}[_](e){this.statCache.set(this.absolute,e);this.stat=e;if(!e.isFile())e.size=0;this.type=getType(e);this.emit("stat",e);this[d]()}[d](){switch(this.type){case"File":return this[p]();case"Directory":return this[m]();case"SymbolicLink":return this[g]();default:return this.end()}}[R](e){return P(e,this.type==="Directory")}[b](){if(this.type==="Directory"&&this.portable)this.noMtime=true;this.header=new o({path:this.path,linkpath:this.linkpath,mode:this[R](this.stat.mode),uid:this.portable?null:this.stat.uid,gid:this.portable?null:this.stat.gid,size:this.stat.size,mtime:this.noMtime?null:this.mtime||this.stat.mtime,type:this.type,uname:this.portable?null:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?null:this.stat.atime,ctime:this.portable?null:this.stat.ctime});if(this.header.encode()&&!this.noPax)this.write(new n({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this.path,linkpath:this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.dev,ino:this.portable?null:this.stat.ino,nlink:this.portable?null:this.stat.nlink}).encode());this.write(this.header.block)}[m](){if(this.path.substr(-1)!=="/")this.path+="/";this.stat.size=0;this[b]();this.end()}[g](){l.readlink(this.absolute,((e,t)=>{if(e)return this.emit("error",e);this[S](t)}))}[S](e){this.linkpath=e;this[b]();this.end()}[y](e){this.type="Link";this.linkpath=h.relative(this.cwd,e);this.stat.size=0;this[b]();this.end()}[p](){if(this.stat.nlink>1){const e=this.stat.dev+":"+this.stat.ino;if(this.linkCache.has(e)){const t=this.linkCache.get(e);if(t.indexOf(this.cwd)===0)return this[y](t)}this.linkCache.set(e,this.absolute)}this[b]();if(this.stat.size===0)return this.end();this[x]()}[x](){l.open(this.absolute,"r",((e,t)=>{if(e)return this.emit("error",e);this[O](t)}))}[O](e){const t=512*Math.ceil(this.stat.size/512);const r=Math.min(t,this.maxReadSize);const i=s.allocUnsafe(r);this[v](e,i,0,i.length,0,this.stat.size,t)}[v](e,t,r,s,i,n,o){l.read(e,t,r,s,i,((a,l)=>{if(a)return this[k](e,(e=>this.emit("error",a)));this[E](e,t,r,s,i,n,o,l)}))}[k](e,t){l.close(e,t)}[E](e,t,r,i,n,o,a,l){if(l<=0&&o>0){const t=new Error("encountered unexpected EOF");t.path=this.absolute;t.syscall="read";t.code="EOF";this[k](e);return this.emit("error",t)}if(l>o){const t=new Error("did not encounter expected EOF");t.path=this.absolute;t.syscall="read";t.code="EOF";this[k](e);return this.emit("error",t)}if(l===o){for(let e=l;e<i&&l<a;e++){t[e+r]=0;l++;o++}}const h=r===0&&l===t.length?t:t.slice(r,r+l);o-=l;a-=l;n+=l;r+=l;this.write(h);if(!o){if(a)this.write(s.alloc(a));this.end();this[k](e,(e=>e));return}if(r>=i){t=s.allocUnsafe(i);r=0}i=t.length-r;this[v](e,t,r,i,n,o,a)}});class WriteEntrySync extends M{constructor(e,t){super(e,t)}[w](){this[_](l.lstatSync(this.absolute))}[g](){this[S](l.readlinkSync(this.absolute))}[x](){this[O](l.openSync(this.absolute,"r"))}[v](e,t,r,s,i,n,o){let a=true;try{const h=l.readSync(e,t,r,s,i);this[E](e,t,r,s,i,n,o,h);a=false}finally{if(a)try{this[k](e)}catch(e){}}}[k](e){l.closeSync(e)}}const A=T(class WriteEntryTar extends i{constructor(e,t){t=t||{};super(t);this.preservePaths=!!t.preservePaths;this.portable=!!t.portable;this.strict=!!t.strict;this.noPax=!!t.noPax;this.noMtime=!!t.noMtime;this.readEntry=e;this.type=e.type;if(this.type==="Directory"&&this.portable)this.noMtime=true;this.path=e.path;this.mode=this[R](e.mode);this.uid=this.portable?null:e.uid;this.gid=this.portable?null:e.gid;this.uname=this.portable?null:e.uname;this.gname=this.portable?null:e.gname;this.size=e.size;this.mtime=this.noMtime?null:t.mtime||e.mtime;this.atime=this.portable?null:e.atime;this.ctime=this.portable?null:e.ctime;this.linkpath=e.linkpath;if(typeof t.onwarn==="function")this.on("warn",t.onwarn);if(h.isAbsolute(this.path)&&!this.preservePaths){const e=h.parse(this.path);this.warn("stripping "+e.root+" from absolute path",this.path);this.path=this.path.substr(e.root.length)}this.remain=e.size;this.blockRemain=e.startBlockSize;this.header=new o({path:this.path,linkpath:this.linkpath,mode:this.mode,uid:this.portable?null:this.uid,gid:this.portable?null:this.gid,size:this.size,mtime:this.noMtime?null:this.mtime,type:this.type,uname:this.portable?null:this.uname,atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime});if(this.header.encode()&&!this.noPax)super.write(new n({atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime,gid:this.portable?null:this.gid,mtime:this.noMtime?null:this.mtime,path:this.path,linkpath:this.linkpath,size:this.size,uid:this.portable?null:this.uid,uname:this.portable?null:this.uname,dev:this.portable?null:this.readEntry.dev,ino:this.portable?null:this.readEntry.ino,nlink:this.portable?null:this.readEntry.nlink}).encode());super.write(this.header.block);e.pipe(this)}[R](e){return P(e,this.type==="Directory")}write(e){const t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");this.blockRemain-=t;return super.write(e)}end(){if(this.blockRemain)this.write(s.alloc(this.blockRemain));return super.end()}});M.Sync=WriteEntrySync;M.Tar=A;const getType=e=>e.isFile()?"File":e.isDirectory()?"Directory":e.isSymbolicLink()?"SymbolicLink":"Unsupported";e.exports=M},3158:(e,t,r)=>{"use strict";const{Readable:s}=r(2781);const toReadableStream=e=>new s({read(){this.push(e);this.push(null)}});e.exports=toReadableStream;e.exports["default"]=toReadableStream},4150:(e,t,r)=>{"use strict";var s=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$");var i=r(2587);var n=["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")}n.forEach((function(t){if(e.toLowerCase()===t){r.push(t+" is a blacklisted name")}}));i.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(s);if(o){var a=o[1];var l=o[2];if(encodeURIComponent(a)===a&&encodeURIComponent(l)===l){return done(t,r)}}r.push("name can only contain URL-friendly characters")}return done(t,r)};o.scopedPackagePattern=s;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}},2940: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 s=e.apply(this,t);var i=t[t.length-1];if(typeof s==="function"&&s!==i){Object.keys(i).forEach((function(e){s[e]=i[e]}))}return s}}},4091:e=>{"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next){yield e.value}}}},665:(e,t,r)=>{"use strict";e.exports=Yallist;Yallist.Node=Node;Yallist.create=Yallist;function Yallist(e){var t=this;if(!(t instanceof Yallist)){t=new Yallist}t.tail=null;t.head=null;t.length=0;if(e&&typeof e.forEach==="function"){e.forEach((function(e){t.push(e)}))}else if(arguments.length>0){for(var r=0,s=arguments.length;r<s;r++){t.push(arguments[r])}}return t}Yallist.prototype.removeNode=function(e){if(e.list!==this){throw new Error("removing node which does not belong to this list")}var t=e.next;var r=e.prev;if(t){t.prev=r}if(r){r.next=t}if(e===this.head){this.head=t}if(e===this.tail){this.tail=r}e.list.length--;e.next=null;e.prev=null;e.list=null;return t};Yallist.prototype.unshiftNode=function(e){if(e===this.head){return}if(e.list){e.list.removeNode(e)}var t=this.head;e.list=this;e.next=t;if(t){t.prev=e}this.head=e;if(!this.tail){this.tail=e}this.length++};Yallist.prototype.pushNode=function(e){if(e===this.tail){return}if(e.list){e.list.removeNode(e)}var t=this.tail;e.list=this;e.prev=t;if(t){t.next=e}this.tail=e;if(!this.head){this.head=e}this.length++};Yallist.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++){push(this,arguments[e])}return this.length};Yallist.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++){unshift(this,arguments[e])}return this.length};Yallist.prototype.pop=function(){if(!this.tail){return undefined}var e=this.tail.value;this.tail=this.tail.prev;if(this.tail){this.tail.next=null}else{this.head=null}this.length--;return e};Yallist.prototype.shift=function(){if(!this.head){return undefined}var e=this.head.value;this.head=this.head.next;if(this.head){this.head.prev=null}else{this.tail=null}this.length--;return e};Yallist.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,s=0;r!==null;s++){e.call(t,r.value,s,this);r=r.next}};Yallist.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,s=this.length-1;r!==null;s--){e.call(t,r.value,s,this);r=r.prev}};Yallist.prototype.get=function(e){for(var t=0,r=this.head;r!==null&&t<e;t++){r=r.next}if(t===e&&r!==null){return r.value}};Yallist.prototype.getReverse=function(e){for(var t=0,r=this.tail;r!==null&&t<e;t++){r=r.prev}if(t===e&&r!==null){return r.value}};Yallist.prototype.map=function(e,t){t=t||this;var r=new Yallist;for(var s=this.head;s!==null;){r.push(e.call(t,s.value,this));s=s.next}return r};Yallist.prototype.mapReverse=function(e,t){t=t||this;var r=new Yallist;for(var s=this.tail;s!==null;){r.push(e.call(t,s.value,this));s=s.prev}return r};Yallist.prototype.reduce=function(e,t){var r;var s=this.head;if(arguments.length>1){r=t}else if(this.head){s=this.head.next;r=this.head.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var i=0;s!==null;i++){r=e(r,s.value,i);s=s.next}return r};Yallist.prototype.reduceReverse=function(e,t){var r;var s=this.tail;if(arguments.length>1){r=t}else if(this.tail){s=this.tail.prev;r=this.tail.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var i=this.length-1;s!==null;i--){r=e(r,s.value,i);s=s.prev}return r};Yallist.prototype.toArray=function(){var e=new Array(this.length);for(var t=0,r=this.head;r!==null;t++){e[t]=r.value;r=r.next}return e};Yallist.prototype.toArrayReverse=function(){var e=new Array(this.length);for(var t=0,r=this.tail;r!==null;t++){e[t]=r.value;r=r.prev}return e};Yallist.prototype.slice=function(e,t){t=t||this.length;if(t<0){t+=this.length}e=e||0;if(e<0){e+=this.length}var r=new Yallist;if(t<e||t<0){return r}if(e<0){e=0}if(t>this.length){t=this.length}for(var s=0,i=this.head;i!==null&&s<e;s++){i=i.next}for(;i!==null&&s<t;s++,i=i.next){r.push(i.value)}return r};Yallist.prototype.sliceReverse=function(e,t){t=t||this.length;if(t<0){t+=this.length}e=e||0;if(e<0){e+=this.length}var r=new Yallist;if(t<e||t<0){return r}if(e<0){e=0}if(t>this.length){t=this.length}for(var s=this.length,i=this.tail;i!==null&&s>t;s--){i=i.prev}for(;i!==null&&s>e;s--,i=i.prev){r.push(i.value)}return r};Yallist.prototype.splice=function(e,t){if(e>this.length){e=this.length-1}if(e<0){e=this.length+e}for(var r=0,s=this.head;s!==null&&r<e;r++){s=s.next}var i=[];for(var r=0;s&&r<t;r++){i.push(s.value);s=this.removeNode(s)}if(s===null){s=this.tail}if(s!==this.head&&s!==this.tail){s=s.prev}for(var r=2;r<arguments.length;r++){s=insert(this,s,arguments[r])}return i};Yallist.prototype.reverse=function(){var e=this.head;var t=this.tail;for(var r=e;r!==null;r=r.prev){var s=r.prev;r.prev=r.next;r.next=s}this.head=t;this.tail=e;return this};function insert(e,t,r){var s=t===e.head?new Node(r,null,t,e):new Node(r,t,t.next,e);if(s.next===null){e.tail=s}if(s.prev===null){e.head=s}e.length++;return s}function push(e,t){e.tail=new Node(t,e.tail,null,e);if(!e.head){e.head=e.tail}e.length++}function unshift(e,t){e.head=new Node(t,null,e.head,e);if(!e.tail){e.tail=e.head}e.length++}function Node(e,t,r,s){if(!(this instanceof Node)){return new Node(e,t,r,s)}this.list=s;this.value=e;if(t){t.next=this;this.prev=t}else{this.prev=null}if(r){r.prev=this;this.next=r}else{this.next=null}}try{r(4091)(Yallist)}catch(e){}},9709:(e,t,r)=>{"use strict";r.r(t);var s=r(1904);var i=r.n(s);var n=r(8707);var o=r.n(n);var a=r(7147);var l=r(2781);var h=r(2081);var c=r(3061);var u=r.n(c);var d=r(3396);var p=r.n(d);var m=r(1017);var g=r.n(m);var y=r(3837);var b=r(4959);var v=r.n(b);var w=r(4674);var _=r(4150);var E=r.n(_);const S=(0,y.promisify)(l.Stream.pipeline);function downloadAndExtractRepo(e,t){return S(u().stream(`https://codeload.github.com/${t.owner}/${t.project}/tar.gz/${t.branch||"main"}`),w.extract({cwd:e,strip:1}))}function validateName(e){const t=E()(e);if(t.validForNewPackages){return{valid:true}}return{valid:false,problems:[...t.errors||[],...t.warnings||[]]}}async function isDirectoryEmpty(e){try{const t=a.readdirSync(e);return t.length===0}catch(e){if(e){console.log(e);return false}}}async function isWritable(e){try{await a.promises.access(e,(a.constants||a).W_OK);return true}catch(e){return false}}function makeDir(e,t={recursive:true}){return a.promises.mkdir(e,t)}function installSync(e){const t="npm install --also=dev --no-fund --loglevel error";return(0,h.execSync)(t,{stdio:"inherit",cwd:e})}function isInGitRepository(){try{(0,h.execSync)("git rev-parse --is-inside-work-tree",{stdio:"ignore"});return true}catch(e){}return false}function gitInit(e){let t=false;try{(0,h.execSync)("git --version",{stdio:"ignore"});if(isInGitRepository()){return false}(0,h.execSync)("git init -b main",{stdio:"ignore"});t=true;(0,h.execSync)("git add -A",{stdio:"ignore"});(0,h.execSync)('git commit -m "Initial commit from Create Amagaki"',{stdio:"ignore"});return true}catch(r){if(t){try{v().sync(g().join(e,".git"))}catch(e){}}return false}}function getRepo(e){const t=new URL(e);if(t.origin!=="https://github.com"){throw new Error(`Invalid URL: ${o().red(`"${e}"`)}. Only GitHub repositories are supported. Please use a GitHub URL starting and try again.`)}const r=p()(t.toString());if(!r){throw new Error(`Unable to parse GitHub details from URL: ${t}`)}return{owner:r[0],project:r[1],branch:r[2]}}async function cleanInstalledStarter(e,t){const r=g().join(e,"package.json");const s=JSON.parse(a.readFileSync(r,"utf8"));delete s.repository;s.name=t;await a.writeFileSync(r,JSON.stringify(s,null,2))}var x=r(3415);var O=r.n(x);async function createSite({sitePath:e,starter:t}){var r,s;const i=g().resolve(e);if(!await isWritable(g().dirname(i))){console.error(`Unable to write to "${i}". Check permissions and try again.`);process.exit(1)}const n=g().basename(i);await makeDir(i);if(!await isDirectoryEmpty(i)){console.error(`The directory "${i}" already exists and is not empty.`);process.exit(1)}const a=process.cwd();console.log(`Creating a new 🍊 Amagaki site in ${o().green(i)}.`);await makeDir(i);process.chdir(i);try{const e=getRepo(t);console.log(`Downloading from ${o().cyan(t)}. This might take a few seconds...`);await O()((()=>downloadAndExtractRepo(i,e)),{retries:3})}catch(e){throw new Error((s=(r=e)===null||r===void 0?void 0:r.message)!==null&&s!==void 0?s:e+"")}console.log("Installing dependencies. This might take a few minutes...");installSync(i);cleanInstalledStarter(i,n);console.log();if(gitInit(i)){console.log("Initialized a Git repository.");console.log()}const l=g().join(a,n)===e?n:e;console.log(`${o().green("🍊 Success!")} Created ${n} at ${e}`);console.log("From that directory, you can run:");console.log();console.log(o().cyan(" npm run dev"));console.log(" Starts the development server.");console.log();console.log(o().cyan(" npm run build"));console.log(" Builds the static site for production.");console.log();console.log("Get started by typing:");console.log();console.log(o().cyan(" cd"),l);console.log(o().cyan(" npm run dev"));console.log()}const k=JSON.parse('{"u2":"create-amagaki","i8":"0.0.1"}');var R=r(9646);var T=r.n(R);let C="";const P=new(i().Command)(k.u2).version(k.i8).arguments("<project-directory>").usage(`${o().green("<project-directory>")} [options]`).action((e=>{C=e})).option("-s, --starter [github-url]","the starter to use for the project","https://github.com/blinkk/amagaki-starter").allowUnknownOption().parse(process.argv);async function run(){if(typeof C==="string"){C=C.trim()}if(!C){const e=await T()({type:"text",name:"path",message:"What is the project named?",initial:"my-site",validate:e=>{const t=validateName(g().basename(g().resolve(e)));if(t.valid){return true}return`Specify another project name. Yours was invalid: ${t.problems[0]}`}});C=typeof e.path==="string"?e.path.trim():e.path}if(!C){console.log();console.log("Specify the project directory:");console.log(` ${o().cyan(P.name())} ${o().green("<project-directory>")}`);console.log();console.log("Example:");console.log(` ${o().cyan(P.name())} ${o().green("my-site")}`);console.log();console.log(`Use ${o().cyan(`${P.name()} --help`)} to see all options.`);process.exit(1)}await createSite({sitePath:g().resolve(C),starter:P.starter})}run().catch((async e=>{console.log();console.log("Aborting.");if(e.command){console.log(` ${o().cyan(e.command)} has failed.`)}else{console.log(o().red("Unexpected error. Please report it at https://github.com/blinkk/amagaki/issues."));console.log(e)}console.log();process.exit(1)}))},9491:e=>{"use strict";e.exports=require("assert")},4300:e=>{"use strict";e.exports=require("buffer")},2081:e=>{"use strict";e.exports=require("child_process")},6113:e=>{"use strict";e.exports=require("crypto")},9523:e=>{"use strict";e.exports=require("dns")},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")},1576:e=>{"use strict";e.exports=require("string_decoder")},7310:e=>{"use strict";e.exports=require("url")},3837:e=>{"use strict";e.exports=require("util")},9796:e=>{"use strict";e.exports=require("zlib")},2587: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 s=t[r];if(s!==undefined){return s.exports}var i=t[r]={id:r,loaded:false,exports:{}};var n=true;try{e[r](i,i.exports,__nccwpck_require__);n=false}finally{if(n)delete t[r]}i.loaded=true;return i.exports}(()=>{__nccwpck_require__.n=e=>{var t=e&&e.__esModule?()=>e["default"]:()=>e;__nccwpck_require__.d(t,{a:t});return t}})();(()=>{__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=__nccwpck_require__(9709);module.exports=r})();
2
+ "use strict";var wn=Object.create;var Is=Object.defineProperty;var En=Object.getOwnPropertyDescriptor;var On=Object.getOwnPropertyNames;var vn=Object.getPrototypeOf,Sn=Object.prototype.hasOwnProperty;var Ns=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(i){throw t=0,i}};var Rn=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of On(t))!Sn.call(e,r)&&r!==i&&Is(e,r,{get:()=>t[r],enumerable:!(s=En(t,r))||s.enumerable});return e};var f=(e,t,i)=>(i=e!=null?wn(vn(e)):{},Rn(t||!e||!e.__esModule?Is(i,"default",{value:e,enumerable:!0}):i,e));var sn=Ns(($a,Ch)=>{Ch.exports=["_http_agent","_http_client","_http_common","_http_incoming","_http_outgoing","_http_server","_stream_duplex","_stream_passthrough","_stream_readable","_stream_transform","_stream_wrap","_stream_writable","_tls_common","_tls_wrap","assert","assert/strict","async_hooks","buffer","child_process","cluster","console","constants","crypto","dgram","diagnostics_channel","dns","dns/promises","domain","events","fs","fs/promises","http","http2","https","inspector","inspector/promises","module","net","os","path","path/posix","path/win32","perf_hooks","process","punycode","querystring","readline","readline/promises","repl","stream","stream/consumers","stream/promises","stream/web","string_decoder","sys","timers","timers/promises","tls","trace_events","tty","url","util","util/types","v8","vm","wasi","worker_threads","zlib","node:sea","node:sqlite","node:test","node:test/reporters"]});var nn=Ns((Ha,rn)=>{"use strict";var kh=sn(),xh=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),Ah=["node_modules","favicon.ico"];function Th(e){var t=[],i=[];if(e===null)return i.push("name cannot be null"),St(t,i);if(e===void 0)return i.push("name cannot be undefined"),St(t,i);if(typeof e!="string")return i.push("name must be a string"),St(t,i);if(e.length||i.push("name length must be greater than zero"),e.startsWith(".")&&i.push("name cannot start with a period"),e.startsWith("-")&&i.push("name cannot start with a hyphen"),e.match(/^_/)&&i.push("name cannot start with an underscore"),e.trim()!==e&&i.push("name cannot contain leading or trailing spaces"),Ah.forEach(function(o){e.toLowerCase()===o&&i.push(o+" is not a valid package name")}),kh.includes(e.toLowerCase())&&t.push(e+" is a core module name"),e.length>214&&t.push("name can no longer contain more than 214 characters"),e.toLowerCase()!==e&&t.push("name can no longer contain capital letters"),/[~'!()*]/.test(e.split("/").slice(-1)[0])&&t.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(e)!==e){var s=e.match(xh);if(s){var r=s[1],n=s[2];if(n.startsWith(".")&&i.push("name cannot start with a period"),encodeURIComponent(r)===r&&encodeURIComponent(n)===n)return St(t,i)}i.push("name can only contain URL-friendly characters")}return St(t,i)}var St=function(e,t){var i={validForNewPackages:t.length===0&&e.length===0,validForOldPackages:t.length===0,warnings:e,errors:t};return i.warnings.length||delete i.warnings,i.errors.length||delete i.errors,i};rn.exports=Th});var ne=class extends Error{constructor(t,i,s){super(s),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=i,this.exitCode=t,this.nestedError=void 0}},be=class extends ne{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};var Ze=class{constructor(t,i){switch(this.description=i||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(t,i){return i===this.defaultValue||!Array.isArray(i)?[t]:(i.push(t),i)}default(t,i){return this.defaultValue=t,this.defaultValueDescription=i,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(i,s)=>{if(!this.argChoices.includes(i))throw new be(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(i,s):i},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function kt(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}var $s=require("node:events"),At=f(require("node:child_process"),1),W=f(require("node:path"),1),Ye=f(require("node:fs"),1),g=f(require("node:process"),1),Hs=require("node:util");var Ps=require("node:util"),qe=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let i=t.commands.filter(r=>!r._hidden),s=t._getHelpCommand();return s&&!s._hidden&&i.push(s),this.sortSubcommands&&i.sort((r,n)=>r.name().localeCompare(n.name())),i}compareOptions(t,i){let s=r=>r.short?r.short.replace(/^-/,""):r.long.replace(/^--/,"");return s(t).localeCompare(s(i))}visibleOptions(t){let i=t.options.filter(r=>!r.hidden),s=t._getHelpOption();if(s&&!s.hidden){let r=s.short&&t._findOption(s.short),n=s.long&&t._findOption(s.long);!r&&!n?i.push(s):s.long&&!n?i.push(t.createOption(s.long,s.description).helpGroup(s.helpGroupHeading)):s.short&&!r&&i.push(t.createOption(s.short,s.description).helpGroup(s.helpGroupHeading))}return this.sortOptions&&i.sort(this.compareOptions),i}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let i=[];for(let s=t.parent;s;s=s.parent){let r=s.options.filter(n=>!n.hidden);i.push(...r)}return this.sortOptions&&i.sort(this.compareOptions),i}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(i=>{i.description=i.description||t._argsDescription[i.name()]||""}),t.registeredArguments.find(i=>i.description)?t.registeredArguments:[]}subcommandTerm(t){let i=t.registeredArguments.map(s=>kt(s)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(i?" "+i:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,i){return i.visibleCommands(t).reduce((s,r)=>Math.max(s,this.displayWidth(i.styleSubcommandTerm(i.subcommandTerm(r)))),0)}longestOptionTermLength(t,i){return i.visibleOptions(t).reduce((s,r)=>Math.max(s,this.displayWidth(i.styleOptionTerm(i.optionTerm(r)))),0)}longestGlobalOptionTermLength(t,i){return i.visibleGlobalOptions(t).reduce((s,r)=>Math.max(s,this.displayWidth(i.styleOptionTerm(i.optionTerm(r)))),0)}longestArgumentTermLength(t,i){return i.visibleArguments(t).reduce((s,r)=>Math.max(s,this.displayWidth(i.styleArgumentTerm(i.argumentTerm(r)))),0)}commandUsage(t){let i=t._name;t._aliases[0]&&(i=i+"|"+t._aliases[0]);let s="";for(let r=t.parent;r;r=r.parent)s=r.name()+" "+s;return s+i+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let i=[];if(t.argChoices&&i.push(`choices: ${t.argChoices.map(s=>JSON.stringify(s)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&i.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&i.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&i.push(`env: ${t.envVar}`),i.length>0){let s=`(${i.join(", ")})`;return t.description?`${t.description} ${s}`:s}return t.description}argumentDescription(t){let i=[];if(t.argChoices&&i.push(`choices: ${t.argChoices.map(s=>JSON.stringify(s)).join(", ")}`),t.defaultValue!==void 0&&i.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),i.length>0){let s=`(${i.join(", ")})`;return t.description?`${t.description} ${s}`:s}return t.description}formatItemList(t,i,s){return i.length===0?[]:[s.styleTitle(t),...i,""]}groupItems(t,i,s){let r=new Map;return t.forEach(n=>{let o=s(n);r.has(o)||r.set(o,[])}),i.forEach(n=>{let o=s(n);r.has(o)||r.set(o,[]),r.get(o).push(n)}),r}formatHelp(t,i){let s=i.padWidth(t,i),r=i.helpWidth??80;function n(d,c){return i.formatItem(d,s,c,i)}let o=[`${i.styleTitle("Usage:")} ${i.styleUsage(i.commandUsage(t))}`,""],h=i.commandDescription(t);h.length>0&&(o=o.concat([i.boxWrap(i.styleCommandDescription(h),r),""]));let a=i.visibleArguments(t).map(d=>n(i.styleArgumentTerm(i.argumentTerm(d)),i.styleArgumentDescription(i.argumentDescription(d))));if(o=o.concat(this.formatItemList("Arguments:",a,i)),this.groupItems(t.options,i.visibleOptions(t),d=>d.helpGroupHeading??"Options:").forEach((d,c)=>{let w=d.map(y=>n(i.styleOptionTerm(i.optionTerm(y)),i.styleOptionDescription(i.optionDescription(y))));o=o.concat(this.formatItemList(c,w,i))}),i.showGlobalOptions){let d=i.visibleGlobalOptions(t).map(c=>n(i.styleOptionTerm(i.optionTerm(c)),i.styleOptionDescription(i.optionDescription(c))));o=o.concat(this.formatItemList("Global Options:",d,i))}return this.groupItems(t.commands,i.visibleCommands(t),d=>d.helpGroup()||"Commands:").forEach((d,c)=>{let w=d.map(y=>n(i.styleSubcommandTerm(i.subcommandTerm(y)),i.styleSubcommandDescription(i.subcommandDescription(y))));o=o.concat(this.formatItemList(c,w,i))}),o.join(`
3
+ `)}displayWidth(t){return(0,Ps.stripVTControlCharacters)(t).length}styleTitle(t){return t}styleUsage(t){return t.split(" ").map(i=>i==="[options]"?this.styleOptionText(i):i==="[command]"?this.styleSubcommandText(i):i[0]==="["||i[0]==="<"?this.styleArgumentText(i):this.styleCommandText(i)).join(" ")}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){return this.styleDescriptionText(t)}styleSubcommandDescription(t){return this.styleDescriptionText(t)}styleArgumentDescription(t){return this.styleDescriptionText(t)}styleDescriptionText(t){return t}styleOptionTerm(t){return this.styleOptionText(t)}styleSubcommandTerm(t){return t.split(" ").map(i=>i==="[options]"?this.styleOptionText(i):i[0]==="["||i[0]==="<"?this.styleArgumentText(i):this.styleSubcommandText(i)).join(" ")}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,i){return Math.max(i.longestOptionTermLength(t,i),i.longestGlobalOptionTermLength(t,i),i.longestSubcommandTermLength(t,i),i.longestArgumentTermLength(t,i))}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,i,s,r){let o=" ".repeat(2);if(!s)return o+t;let h=t.padEnd(i+t.length-r.displayWidth(t)),a=2,u=(this.helpWidth??80)-i-a-2,d;return u<this.minWidthToWrap||r.preformatted(s)?d=s:d=r.boxWrap(s,u).replace(/\n/g,`
4
+ `+" ".repeat(i+a)),o+h+" ".repeat(a)+d.replace(/\n/g,`
5
+ ${o}`)}boxWrap(t,i){if(i<this.minWidthToWrap)return t;let s=t.split(/\r\n|\n/),r=/[\s]*[^\s]+/g,n=[];return s.forEach(o=>{let h=o.match(r);if(h===null){n.push("");return}let a=[h.shift()],l=this.displayWidth(a[0]);h.forEach(u=>{let d=this.displayWidth(u);if(l+d<=i){a.push(u),l+=d;return}n.push(a.join(""));let c=u.trimStart();a=[c],l=this.displayWidth(c)}),n.push(a.join(""))}),n.join(`
6
+ `)}};var Ne=class{constructor(t,i){this.flags=t,this.description=i||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=new RegExp("\\p{ID_Continue}\\.\\.\\.[>\\]]$","u").test(t),this.mandatory=!1;let s=Cn(t);this.short=s.shortFlag,this.long=s.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(t,i){return this.defaultValue=t,this.defaultValueDescription=i,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let i=t;return typeof t=="string"&&(i={[t]:!0}),this.implied=Object.assign(this.implied||{},i),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_collectValue(t,i){return i===this.defaultValue||!Array.isArray(i)?[t]:(i.push(t),i)}choices(t){return this.argChoices=t.slice(),this.parseArg=(i,s)=>{if(!this.argChoices.includes(i))throw new be(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(i,s):i},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Fs(this.name().replace(/^no-/,"")):Fs(this.name())}helpGroup(t){return this.helpGroupHeading=t,this}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},xt=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(i=>{i.negate?this.negativeOptions.set(i.attributeName(),i):this.positiveOptions.set(i.attributeName(),i)}),this.negativeOptions.forEach((i,s)=>{this.positiveOptions.has(s)&&this.dualOptions.add(s)})}valueFromOption(t,i){let s=i.attributeName();if(!this.dualOptions.has(s))return!0;let r=this.negativeOptions.get(s).presetArg,n=r!==void 0?r:!1;return i.negate===(n===t)}};function Fs(e){return e.split("-").reduce((t,i)=>t+i[0].toUpperCase()+i.slice(1))}function Cn(e){let t,i,s=/^-[^-]$/,r=/^--[^-]/,n=e.split(/[ |,]+/).concat("guard");if(s.test(n[0])&&(t=n.shift()),r.test(n[0])&&(i=n.shift()),!t&&s.test(n[0])&&(t=n.shift()),!t&&r.test(n[0])&&(t=i,i=n.shift()),n[0].startsWith("-")){let o=n[0],h=`option creation failed due to '${o}' in option flags '${e}'`;throw/^-[^-][^-]/.test(o)?new Error(`${h}
7
+ - a short flag is a single dash and a single character
8
+ - either use a single dash and a single character (for a short flag)
9
+ - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):s.test(o)?new Error(`${h}
10
+ - too many short flags`):r.test(o)?new Error(`${h}
11
+ - too many long flags`):new Error(`${h}
12
+ - unrecognised flag format`)}if(t===void 0&&i===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:i}}function kn(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let i=[];for(let s=0;s<=e.length;s++)i[s]=[s];for(let s=0;s<=t.length;s++)i[0][s]=s;for(let s=1;s<=t.length;s++)for(let r=1;r<=e.length;r++){let n;e[r-1]===t[s-1]?n=0:n=1,i[r][s]=Math.min(i[r-1][s]+1,i[r][s-1]+1,i[r-1][s-1]+n),r>1&&s>1&&e[r-1]===t[s-2]&&e[r-2]===t[s-1]&&(i[r][s]=Math.min(i[r][s],i[r-2][s-2]+1))}return i[e.length][t.length]}function yi(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let i=e.startsWith("--");i&&(e=e.slice(2),t=t.map(o=>o.slice(2)));let s=[],r=3,n=.4;return t.forEach(o=>{if(o.length<=1)return;let h=kn(e,o),a=Math.max(e.length,o.length);(a-h)/a>n&&(h<r?(r=h,s=[o]):h===r&&s.push(o))}),s.sort((o,h)=>o.localeCompare(h)),i&&(s=s.map(o=>`--${o}`)),s.length>1?`
13
+ (Did you mean one of ${s.join(", ")}?)`:s.length===1?`
14
+ (Did you mean ${s[0]}?)`:""}var Pe=class e extends $s.EventEmitter{constructor(t){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=t||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:i=>g.default.stdout.write(i),writeErr:i=>g.default.stderr.write(i),outputError:(i,s)=>s(i),getOutHelpWidth:()=>g.default.stdout.isTTY?g.default.stdout.columns:void 0,getErrHelpWidth:()=>g.default.stderr.isTTY?g.default.stderr.columns:void 0,getOutHasColors:()=>Bs()??(g.default.stdout.isTTY&&g.default.stdout.hasColors?.()),getErrHasColors:()=>Bs()??(g.default.stderr.isTTY&&g.default.stderr.hasColors?.()),stripColor:i=>(0,Hs.stripVTControlCharacters)(i)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let i=this;i;i=i.parent)t.push(i);return t}command(t,i,s){let r=i,n=s;typeof r=="object"&&r!==null&&(n=r,r=null),n=n||{};let[,o,h]=t.match(/([^ ]+) *(.*)/),a=this.createCommand(o);return r&&(a.description(r),a._executableHandler=!0),n.isDefault&&(this._defaultCommandName=a._name),a._hidden=!!(n.noHelp||n.hidden),a._executableFile=n.executableFile||null,h&&a.arguments(h),this._registerCommand(a),a.parent=this,a.copyInheritedSettings(this),r?this:a}createCommand(t){return new e(t)}createHelp(){return Object.assign(new qe,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...t},this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,i){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
15
+ - specify the name in Command constructor or using .name()`);return i=i||{},i.isDefault&&(this._defaultCommandName=t._name),(i.noHelp||i.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,i){return new Ze(t,i)}argument(t,i,s,r){let n=this.createArgument(t,i);return typeof s=="function"?n.default(r).argParser(s):n.default(s),this.addArgument(n),this}arguments(t){return t.trim().split(/ +/).forEach(i=>{this.argument(i)}),this}addArgument(t){let i=this.registeredArguments.slice(-1)[0];if(i?.variadic)throw new Error(`only the last argument can be variadic '${i.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,i){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,t&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let s=t??"help [command]",[,r,n]=s.match(/([^ ]+) *(.*)/),o=i??"display help for command",h=this.createCommand(r);return h.helpOption(!1),n&&h.arguments(n),o&&h.description(o),this._addImplicitHelpCommand=!0,this._helpCommand=h,(t||i)&&this._initCommandGroup(h),this}addHelpCommand(t,i){return typeof t!="object"?(this.helpCommand(t,i),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this._initCommandGroup(t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(t,i){let s=["preSubcommand","preAction","postAction"];if(!s.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
16
+ Expecting one of '${s.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(i):this._lifeCycleHooks[t]=[i],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=i=>{if(i.code!=="commander.executeSubCommandAsync")throw i},this}_exit(t,i,s){this._exitCallback&&this._exitCallback(new ne(t,i,s)),g.default.exit(t)}action(t){let i=s=>{let r=this.registeredArguments.length,n=s.slice(0,r);return this._storeOptionsAsProperties?n[r]=this:n[r]=this.opts(),n.push(this),t.apply(this,n)};return this._actionHandler=i,this}createOption(t,i){return new Ne(t,i)}_callParseArg(t,i,s,r){try{return t.parseArg(i,s)}catch(n){if(n.code==="commander.invalidArgument"){let o=`${r} ${n.message}`;this.error(o,{exitCode:n.exitCode,code:n.code})}throw n}}_registerOption(t){let i=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(i){let s=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${s}'
17
+ - already used by option '${i.flags}'`)}this._initOptionGroup(t),this.options.push(t)}_registerCommand(t){let i=r=>[r.name()].concat(r.aliases()),s=i(t).find(r=>this._findCommand(r));if(s){let r=i(this._findCommand(s)).join("|"),n=i(t).join("|");throw new Error(`cannot add command '${n}' as already have command '${r}'`)}this._initCommandGroup(t),this.commands.push(t)}addOption(t){this._registerOption(t);let i=t.name(),s=t.attributeName();t.defaultValue!==void 0&&this.setOptionValueWithSource(s,t.defaultValue,"default");let r=(n,o,h)=>{n==null&&t.presetArg!==void 0&&(n=t.presetArg);let a=this.getOptionValue(s);n!==null&&t.parseArg?n=this._callParseArg(t,n,a,o):n!==null&&t.variadic&&(n=t._collectValue(n,a)),n==null&&(t.negate?n=!1:t.isBoolean()||t.optional?n=!0:n=""),this.setOptionValueWithSource(s,n,h)};return this.on("option:"+i,n=>{let o=`error: option '${t.flags}' argument '${n}' is invalid.`;r(n,o,"cli")}),t.envVar&&this.on("optionEnv:"+i,n=>{let o=`error: option '${t.flags}' value '${n}' from env '${t.envVar}' is invalid.`;r(n,o,"env")}),this}_optionEx(t,i,s,r,n){if(typeof i=="object"&&i instanceof Ne)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let o=this.createOption(i,s);if(o.makeOptionMandatory(!!t.mandatory),typeof r=="function")o.default(n).argParser(r);else if(r instanceof RegExp){let h=r;r=(a,l)=>{let u=h.exec(a);return u?u[0]:l},o.default(n).argParser(r)}else o.default(r);return this.addOption(o)}option(t,i,s,r){return this._optionEx({},t,i,s,r)}requiredOption(t,i,s,r){return this._optionEx({mandatory:!0},t,i,s,r)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(t=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!t,this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,i){return this.setOptionValueWithSource(t,i,void 0)}setOptionValueWithSource(t,i,s){return this._storeOptionsAsProperties?this[t]=i:this._optionValues[t]=i,this._optionValueSources[t]=s,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let i;return this._getCommandAndAncestors().forEach(s=>{Object.hasOwn(s._optionValueSources,t)&&(i=s.getOptionValueSource(t))}),i}_prepareUserArgs(t,i){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(i=i||{},t===void 0&&i.from===void 0){g.default.versions?.electron&&(i.from="electron");let r=g.default.execArgv??[];(r.includes("-e")||r.includes("--eval")||r.includes("-p")||r.includes("--print"))&&(i.from="eval")}t===void 0&&(t=g.default.argv),this.rawArgs=t.slice();let s;switch(i.from){case void 0:case"node":this._scriptPath=t[1],s=t.slice(2);break;case"electron":g.default.defaultApp?(this._scriptPath=t[1],s=t.slice(2)):s=t.slice(1);break;case"user":s=t.slice(0);break;case"eval":s=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${i.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",s}parse(t,i){this._prepareForParse();let s=this._prepareUserArgs(t,i);return this._parseCommand([],s),this}async parseAsync(t,i){this._prepareForParse();let s=this._prepareUserArgs(t,i);return await this._parseCommand([],s),this}_prepareForParse(){this._savedState===null?(this.options.filter(t=>t.negate&&t.defaultValue===void 0&&this.getOptionValue(t.attributeName())===void 0).forEach(t=>{let i=t.long.replace(/^--no-/,"--");this._findOption(i)||this.setOptionValueWithSource(t.attributeName(),!0,"default")}),this.saveStateBeforeParse()):this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
18
+ - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(t,i,s){if(Ye.default.existsSync(t))return;let r=i?`searched for local subcommand relative to directory '${i}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",n=`'${t}' does not exist
19
+ - if '${s}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
20
+ - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
21
+ - ${r}`;throw new Error(n)}_executeSubCommand(t,i){i=i.slice();let s=[".js",".ts",".tsx",".mjs",".cjs"];function r(u,d){let c=W.default.resolve(u,d);if(Ye.default.existsSync(c))return c;if(s.includes(W.default.extname(d)))return;let w=s.find(y=>Ye.default.existsSync(`${c}${y}`));if(w)return`${c}${w}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let n=t._executableFile||`${this._name}-${t._name}`,o=this._executableDir||"";if(this._scriptPath){let u;try{u=Ye.default.realpathSync(this._scriptPath)}catch{u=this._scriptPath}o=W.default.resolve(W.default.dirname(u),o)}if(o){let u=r(o,n);if(!u&&!t._executableFile&&this._scriptPath){let d=W.default.basename(this._scriptPath,W.default.extname(this._scriptPath));d!==this._name&&(u=r(o,`${d}-${t._name}`))}n=u||n}let h=s.includes(W.default.extname(n)),a;g.default.platform!=="win32"?h?(i.unshift(n),i=Ms(g.default.execArgv).concat(i),a=At.default.spawn(g.default.argv[0],i,{stdio:"inherit"})):a=At.default.spawn(n,i,{stdio:"inherit"}):(this._checkForMissingExecutable(n,o,t._name),i.unshift(n),i=Ms(g.default.execArgv).concat(i),a=At.default.spawn(g.default.execPath,i,{stdio:"inherit"})),a.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(d=>{g.default.on(d,()=>{a.killed===!1&&a.exitCode===null&&a.kill(d)})});let l=this._exitCallback;a.on("close",u=>{u=u??1,l?l(new ne(u,"commander.executeSubCommandAsync","(close)")):g.default.exit(u)}),a.on("error",u=>{if(u.code==="ENOENT")this._checkForMissingExecutable(n,o,t._name);else if(u.code==="EACCES")throw new Error(`'${n}' not executable`);if(!l)g.default.exit(1);else{let d=new ne(1,"commander.executeSubCommandAsync","(error)");d.nestedError=u,l(d)}}),this.runningCommand=a}_dispatchSubcommand(t,i,s){let r=this._findCommand(t);r||this.help({error:!0}),r._prepareForParse();let n;return n=this._chainOrCallSubCommandHook(n,r,"preSubcommand"),n=this._chainOrCall(n,()=>{if(r._executableHandler)this._executeSubCommand(r,i.concat(s));else return r._parseCommand(i,s)}),n}_dispatchHelpCommand(t){t||this.help();let i=this._findCommand(t);return i&&!i._executableHandler&&i.help(),this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((t,i)=>{t.required&&this.args[i]==null&&this.missingArgument(t.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let t=(s,r,n)=>{let o=r;if(r!==null&&s.parseArg){let h=`error: command-argument value '${r}' is invalid for argument '${s.name()}'.`;o=this._callParseArg(s,r,n,h)}return o};this._checkNumberOfArguments();let i=[];this.registeredArguments.forEach((s,r)=>{let n=s.defaultValue;s.variadic?r<this.args.length?(n=this.args.slice(r),s.parseArg&&(n=n.reduce((o,h)=>t(s,h,o),s.defaultValue))):n===void 0&&(n=[]):r<this.args.length&&(n=this.args[r],s.parseArg&&(n=t(s,n,s.defaultValue))),i[r]=n}),this.processedArgs=i}_chainOrCall(t,i){return t?.then&&typeof t.then=="function"?t.then(()=>i()):i()}_chainOrCallHooks(t,i){let s=t,r=[];return this._getCommandAndAncestors().reverse().filter(n=>n._lifeCycleHooks[i]!==void 0).forEach(n=>{n._lifeCycleHooks[i].forEach(o=>{r.push({hookedCommand:n,callback:o})})}),i==="postAction"&&r.reverse(),r.forEach(n=>{s=this._chainOrCall(s,()=>n.callback(n.hookedCommand,this))}),s}_chainOrCallSubCommandHook(t,i,s){let r=t;return this._lifeCycleHooks[s]!==void 0&&this._lifeCycleHooks[s].forEach(n=>{r=this._chainOrCall(r,()=>n(this,i))}),r}_parseCommand(t,i){let s=this.parseOptions(i);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(s.operands),i=s.unknown,this.args=t.concat(i),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),i);if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(t[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(i),this._dispatchSubcommand(this._defaultCommandName,t,i);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(s.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let r=()=>{s.unknown.length>0&&this.unknownOption(s.unknown[0])},n=`command:${this.name()}`;if(this._actionHandler){r(),this._processArguments();let o;return o=this._chainOrCallHooks(o,"preAction"),o=this._chainOrCall(o,()=>this._actionHandler(this.processedArgs)),this.parent&&(o=this._chainOrCall(o,()=>{this.parent.emit(n,t,i)})),o=this._chainOrCallHooks(o,"postAction"),o}if(this.parent?.listenerCount(n))r(),this._processArguments(),this.parent.emit(n,t,i);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,i);this.listenerCount("command:*")?this.emit("command:*",t,i):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(t){if(t)return this.commands.find(i=>i._name===t||i._aliases.includes(t))}_findOption(t){return this.options.find(i=>i.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{t.options.forEach(i=>{i.mandatory&&t.getOptionValue(i.attributeName())===void 0&&t.missingMandatoryOptionValue(i)})})}_checkForConflictingLocalOptions(){let t=this.options.filter(s=>{let r=s.attributeName();return this.getOptionValue(r)===void 0?!1:this.getOptionValueSource(r)!=="default"});t.filter(s=>s.conflictsWith.length>0).forEach(s=>{let r=t.find(n=>s.conflictsWith.includes(n.attributeName()));r&&this._conflictingOption(s,r)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let i=[],s=[],r=i;function n(u){return u.length>1&&u[0]==="-"}let o=u=>/^-(\d+|\d*\.\d+)([eE][+-]?\d+)?$/.test(u)?!this._getCommandAndAncestors().some(d=>d.options.map(c=>c.short).some(c=>/^-\d$/.test(c))):!1,h=null,a=null,l=0;for(;l<t.length||a;){let u=a??t[l++];if(a=null,u==="--"){r===s&&r.push(u),r.push(...t.slice(l));break}if(h&&(!n(u)||o(u))){this.emit(`option:${h.name()}`,u);continue}if(h=null,n(u)){let d=this._findOption(u);if(d){if(d.required){let c=t[l++];c===void 0&&this.optionMissingArgument(d),this.emit(`option:${d.name()}`,c)}else if(d.optional){let c=null;l<t.length&&(!n(t[l])||o(t[l]))&&(c=t[l++]),this.emit(`option:${d.name()}`,c)}else this.emit(`option:${d.name()}`);h=d.variadic?d:null;continue}}if(u.length>2&&u[0]==="-"&&u[1]!=="-"){let d=this._findOption(`-${u[1]}`);if(d){d.required||d.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${d.name()}`,u.slice(2)):(this.emit(`option:${d.name()}`),a=`-${u.slice(2)}`);continue}}if(/^--[^=]+=/.test(u)){let d=u.indexOf("="),c=this._findOption(u.slice(0,d));if(c&&(c.required||c.optional)){this.emit(`option:${c.name()}`,u.slice(d+1));continue}}if(r===i&&n(u)&&!(this.commands.length===0&&o(u))&&(r=s),(this._enablePositionalOptions||this._passThroughOptions)&&i.length===0&&s.length===0){if(this._findCommand(u)){i.push(u),s.push(...t.slice(l));break}else if(this._getHelpCommand()&&u===this._getHelpCommand().name()){i.push(u,...t.slice(l));break}else if(this._defaultCommandName){s.push(u,...t.slice(l));break}}if(this._passThroughOptions){r.push(u,...t.slice(l));break}r.push(u)}return{operands:i,unknown:s}}opts(){if(this._storeOptionsAsProperties){let t={},i=this.options.length;for(let s=0;s<i;s++){let r=this.options[s].attributeName();t[r]=r===this._versionOptionName?this._version:this[r]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((t,i)=>Object.assign(t,i.opts()),{})}error(t,i){this._outputConfiguration.outputError(`${t}
22
+ `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
23
+ `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
24
+ `),this.outputHelp({error:!0}));let s=i||{},r=s.exitCode||1,n=s.code||"commander.error";this._exit(r,n,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in g.default.env){let i=t.attributeName();(this.getOptionValue(i)===void 0||["default","config","env"].includes(this.getOptionValueSource(i)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,g.default.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new xt(this.options),i=s=>this.getOptionValue(s)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(s));this.options.filter(s=>s.implied!==void 0&&i(s.attributeName())&&t.valueFromOption(this.getOptionValue(s.attributeName()),s)).forEach(s=>{Object.keys(s.implied).filter(r=>!i(r)).forEach(r=>{this.setOptionValueWithSource(r,s.implied[r],"implied")})})}missingArgument(t){let i=`error: missing required argument '${t}'`;this.error(i,{code:"commander.missingArgument"})}optionMissingArgument(t){let i=`error: option '${t.flags}' argument missing`;this.error(i,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let i=`error: required option '${t.flags}' not specified`;this.error(i,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,i){let s=o=>{let h=o.attributeName(),a=this.getOptionValue(h),l=this.options.find(d=>d.negate&&h===d.attributeName()),u=this.options.find(d=>!d.negate&&h===d.attributeName());return l&&(l.presetArg===void 0&&a===!1||l.presetArg!==void 0&&a===l.presetArg)?l:u||o},r=o=>{let h=s(o),a=h.attributeName();return this.getOptionValueSource(a)==="env"?`environment variable '${h.envVar}'`:`option '${h.flags}'`},n=`error: ${r(t)} cannot be used with ${r(i)}`;this.error(n,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let i="";if(t.startsWith("--")&&this._showSuggestionAfterError){let r=[],n=this;do{let o=n.createHelp().visibleOptions(n).filter(h=>h.long).map(h=>h.long);r=r.concat(o),n=n.parent}while(n&&!n._enablePositionalOptions);i=yi(t,r)}let s=`error: unknown option '${t}'${i}`;this.error(s,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let i=this.registeredArguments.length,s=i===1?"":"s",r=t.length,n=this.parent?` for '${this.name()}'`:"",o=t.join(", "),h=`error: too many arguments${n}. Expected ${i} argument${s} but got ${r}: ${o}.`;this.error(h,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],i="";if(this._showSuggestionAfterError){let r=[];this.createHelp().visibleCommands(this).forEach(n=>{r.push(n.name()),n.alias()&&r.push(n.alias())}),i=yi(t,r)}let s=`error: unknown command '${t}'${i}`;this.error(s,{code:"commander.unknownCommand"})}version(t,i,s){if(t===void 0)return this._version;this._version=t,i=i||"-V, --version",s=s||"output the version number";let r=this.createOption(i,s);return this._versionOptionName=r.attributeName(),this._registerOption(r),this.on("option:"+r.name(),()=>{this._outputConfiguration.writeOut(`${t}
25
+ `),this._exit(0,"commander.version",t)}),this}description(t,i){return t===void 0&&i===void 0?this._description:(this._description=t,i&&(this._argsDescription=i),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let i=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(i=this.commands[this.commands.length-1]),t===i._name)throw new Error("Command alias can't be the same as its name");let s=this.parent?._findCommand(t);if(s){let r=[s.name()].concat(s.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${r}'`)}return i._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(i=>this.alias(i)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let i=this.registeredArguments.map(s=>kt(s));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?i:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}helpGroup(t){return t===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=t,this)}commandsGroup(t){return t===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=t,this)}optionsGroup(t){return t===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=t,this)}_initOptionGroup(t){this._defaultOptionGroup&&!t.helpGroupHeading&&t.helpGroup(this._defaultOptionGroup)}_initCommandGroup(t){this._defaultCommandGroup&&!t.helpGroup()&&t.helpGroup(this._defaultCommandGroup)}nameFromFilename(t){return this._name=W.default.basename(t,W.default.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let i=this.createHelp(),s=this._getOutputContext(t);i.prepareContext({error:s.error,helpWidth:s.helpWidth,outputHasColors:s.hasColors});let r=i.formatHelp(this,i);return s.hasColors?r:this._outputConfiguration.stripColor(r)}_getOutputContext(t){t=t||{};let i=!!t.error,s,r,n;return i?(s=h=>this._outputConfiguration.writeErr(h),r=this._outputConfiguration.getErrHasColors(),n=this._outputConfiguration.getErrHelpWidth()):(s=h=>this._outputConfiguration.writeOut(h),r=this._outputConfiguration.getOutHasColors(),n=this._outputConfiguration.getOutHelpWidth()),{error:i,write:h=>(r||(h=this._outputConfiguration.stripColor(h)),s(h)),hasColors:r,helpWidth:n}}outputHelp(t){let i;typeof t=="function"&&(i=t,t=void 0);let s=this._getOutputContext(t),r={error:s.error,write:s.write,command:this};this._getCommandAndAncestors().reverse().forEach(o=>o.emit("beforeAllHelp",r)),this.emit("beforeHelp",r);let n=this.helpInformation({error:s.error});if(i&&(n=i(n),typeof n!="string"&&!Buffer.isBuffer(n)))throw new Error("outputHelp callback must return a string or a Buffer");s.write(n),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",r),this._getCommandAndAncestors().forEach(o=>o.emit("afterAllHelp",r))}helpOption(t,i){return typeof t=="boolean"?(t?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(t??"-h, --help",i??"display help for command"),(t||i)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this._initOptionGroup(t),this}help(t){this.outputHelp(t);let i=Number(g.default.exitCode??0);i===0&&t&&typeof t!="function"&&t.error&&(i=1),this._exit(i,"commander.help","(outputHelp)")}addHelpText(t,i){let s=["beforeAll","before","after","afterAll"];if(!s.includes(t))throw new Error(`Unexpected value for position to addHelpText.
26
+ Expecting one of '${s.join("', '")}'`);let r=`${t}Help`;return this.on(r,n=>{let o;typeof i=="function"?o=i({error:n.error,command:n.command}):o=i,o&&n.write(`${o}
27
+ `)}),this}_outputHelpIfRequested(t){let i=this._getHelpOption();i&&t.find(r=>i.is(r))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Ms(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let i,s="127.0.0.1",r="9229",n;return(n=t.match(/^(--inspect(-brk|-wait)?)$/))!==null?i=n[1]:(n=t.match(/^(--inspect(-brk|-port|-wait)?)=(\[[^\]]+\]|[^:]+)$/))!==null?(i=n[1],/^\d+$/.test(n[3])?r=n[3]:s=n[3]):(n=t.match(/^(--inspect(-brk|-port|-wait)?)=(\[[^\]]+\]|[^:]+):(\d+)$/))!==null&&(i=n[1],s=n[3],r=n[4]),i&&r!=="0"?`${i}=${s}:${parseInt(r)+1}`:t})}function Bs(){if(g.default.env.NO_COLOR||g.default.env.FORCE_COLOR==="0"||g.default.env.FORCE_COLOR==="false")return!1;if(g.default.env.FORCE_COLOR||g.default.env.CLICOLOR_FORCE!==void 0)return!0}var ia=new Pe;var P=f(require("fs")),on=require("stream"),hn=require("stream/promises"),Ie=require("child_process"),Ts=f(require("path"));var wr=f(require("events"),1),D=f(require("fs"),1),oi=require("node:events"),ms=f(require("node:stream"),1),Er=require("node:string_decoder"),fs=f(require("node:path"),1),xe=f(require("node:fs"),1),ai=require("path"),Sr=require("events"),ii=f(require("assert"),1),pe=require("buffer"),Ws=f(require("zlib"),1),Rr=f(require("zlib"),1),ke=require("node:path"),Dr=require("node:path"),wt=f(require("fs"),1),U=f(require("fs"),1),Yi=f(require("path"),1),Fr=require("node:path"),ss=f(require("path"),1),vs=f(require("node:fs"),1),Ur=f(require("node:assert"),1),Ss=require("node:crypto"),p=f(require("node:fs"),1),v=f(require("node:path"),1),Rs=f(require("fs"),1),vt=f(require("node:fs"),1),We=f(require("node:path"),1),N=f(require("node:fs"),1),Xr=f(require("node:fs/promises"),1),Et=f(require("node:path"),1),Cs=require("node:path"),I=f(require("node:fs"),1),xs=f(require("node:path"),1),xn=Object.defineProperty,An=(e,t)=>{for(var i in t)xn(e,i,{get:t[i],enumerable:!0})},zs=typeof process=="object"&&process?process:{stdout:null,stderr:null},Tn=e=>!!e&&typeof e=="object"&&(e instanceof De||e instanceof ms.default||Ln(e)||Dn(e)),Ln=e=>!!e&&typeof e=="object"&&e instanceof oi.EventEmitter&&typeof e.pipe=="function"&&e.pipe!==ms.default.Writable.prototype.pipe,Dn=e=>!!e&&typeof e=="object"&&e instanceof oi.EventEmitter&&typeof e.write=="function"&&typeof e.end=="function",J=Symbol("EOF"),Q=Symbol("maybeEmitEnd"),oe=Symbol("emittedEnd"),Tt=Symbol("emittingEnd"),Ke=Symbol("emittedError"),Lt=Symbol("closed"),Us=Symbol("read"),Dt=Symbol("flush"),js=Symbol("flushChunk"),$=Symbol("encoding"),Fe=Symbol("decoder"),S=Symbol("flowing"),Xe=Symbol("paused"),He=Symbol("resume"),R=Symbol("buffer"),L=Symbol("pipes"),C=Symbol("bufferLength"),bi=Symbol("bufferPush"),It=Symbol("bufferShift"),T=Symbol("objectMode"),O=Symbol("destroyed"),_i=Symbol("error"),wi=Symbol("emitData"),Vs=Symbol("emitEnd"),Ei=Symbol("emitEnd2"),G=Symbol("async"),Oi=Symbol("abort"),Nt=Symbol("aborted"),Je=Symbol("signal"),_e=Symbol("dataListeners"),F=Symbol("discarded"),Qe=e=>Promise.resolve().then(e),In=e=>e(),Nn=e=>e==="end"||e==="finish"||e==="prefinish",Pn=e=>e instanceof ArrayBuffer||!!e&&typeof e=="object"&&e.constructor&&e.constructor.name==="ArrayBuffer"&&e.byteLength>=0,Fn=e=>!Buffer.isBuffer(e)&&ArrayBuffer.isView(e),Or=class{src;dest;opts;ondrain;constructor(e,t,i){this.src=e,this.dest=t,this.opts=i,this.ondrain=()=>e[He](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Mn=class extends Or{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,i){super(e,t,i),this.proxyErrors=s=>this.dest.emit("error",s),e.on("error",this.proxyErrors)}},Bn=e=>!!e.objectMode,$n=e=>!e.objectMode&&!!e.encoding&&e.encoding!=="buffer",De=class extends oi.EventEmitter{[S]=!1;[Xe]=!1;[L]=[];[R]=[];[T];[$];[G];[Fe];[J]=!1;[oe]=!1;[Tt]=!1;[Lt]=!1;[Ke]=null;[C]=0;[O]=!1;[Je];[Nt]=!1;[_e]=0;[F]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");Bn(t)?(this[T]=!0,this[$]=null):$n(t)?(this[$]=t.encoding,this[T]=!1):(this[T]=!1,this[$]=null),this[G]=!!t.async,this[Fe]=this[$]?new Er.StringDecoder(this[$]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[R]}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[L]});let{signal:i}=t;i&&(this[Je]=i,i.aborted?this[Oi]():i.addEventListener("abort",()=>this[Oi]()))}get bufferLength(){return this[C]}get encoding(){return this[$]}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[T]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[G]}set async(e){this[G]=this[G]||!!e}[Oi](){this[Nt]=!0,this.emit("abort",this[Je]?.reason),this.destroy(this[Je]?.reason)}get aborted(){return this[Nt]}set aborted(e){}write(e,t,i){if(this[Nt])return!1;if(this[J])throw new Error("write after end");if(this[O])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(i=t,t="utf8"),t||(t="utf8");let s=this[G]?Qe:In;if(!this[T]&&!Buffer.isBuffer(e)){if(Fn(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(Pn(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[T]?(this[S]&&this[C]!==0&&this[Dt](!0),this[S]?this.emit("data",e):this[bi](e),this[C]!==0&&this.emit("readable"),i&&s(i),this[S]):e.length?(typeof e=="string"&&!(t===this[$]&&!this[Fe]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[$]&&(e=this[Fe].write(e)),this[S]&&this[C]!==0&&this[Dt](!0),this[S]?this.emit("data",e):this[bi](e),this[C]!==0&&this.emit("readable"),i&&s(i),this[S]):(this[C]!==0&&this.emit("readable"),i&&s(i),this[S])}read(e){if(this[O])return null;if(this[F]=!1,this[C]===0||e===0||e&&e>this[C])return this[Q](),null;this[T]&&(e=null),this[R].length>1&&!this[T]&&(this[R]=[this[$]?this[R].join(""):Buffer.concat(this[R],this[C])]);let t=this[Us](e||null,this[R][0]);return this[Q](),t}[Us](e,t){if(this[T])this[It]();else{let i=t;e===i.length||e===null?this[It]():typeof i=="string"?(this[R][0]=i.slice(e),t=i.slice(0,e),this[C]-=e):(this[R][0]=i.subarray(e),t=i.subarray(0,e),this[C]-=e)}return this.emit("data",t),!this[R].length&&!this[J]&&this.emit("drain"),t}end(e,t,i){return typeof e=="function"&&(i=e,e=void 0),typeof t=="function"&&(i=t,t="utf8"),e!==void 0&&this.write(e,t),i&&this.once("end",i),this[J]=!0,this.writable=!1,(this[S]||!this[Xe])&&this[Q](),this}[He](){this[O]||(!this[_e]&&!this[L].length&&(this[F]=!0),this[Xe]=!1,this[S]=!0,this.emit("resume"),this[R].length?this[Dt]():this[J]?this[Q]():this.emit("drain"))}resume(){return this[He]()}pause(){this[S]=!1,this[Xe]=!0,this[F]=!1}get destroyed(){return this[O]}get flowing(){return this[S]}get paused(){return this[Xe]}[bi](e){this[T]?this[C]+=1:this[C]+=e.length,this[R].push(e)}[It](){return this[T]?this[C]-=1:this[C]-=this[R][0].length,this[R].shift()}[Dt](e=!1){do;while(this[js](this[It]())&&this[R].length);!e&&!this[R].length&&!this[J]&&this.emit("drain")}[js](e){return this.emit("data",e),this[S]}pipe(e,t){if(this[O])return e;this[F]=!1;let i=this[oe];return t=t||{},e===zs.stdout||e===zs.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,i?t.end&&e.end():(this[L].push(t.proxyErrors?new Mn(this,e,t):new Or(this,e,t)),this[G]?Qe(()=>this[He]()):this[He]()),e}unpipe(e){let t=this[L].find(i=>i.dest===e);t&&(this[L].length===1?(this[S]&&this[_e]===0&&(this[S]=!1),this[L]=[]):this[L].splice(this[L].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let i=super.on(e,t);if(e==="data")this[F]=!1,this[_e]++,!this[L].length&&!this[S]&&this[He]();else if(e==="readable"&&this[C]!==0)super.emit("readable");else if(Nn(e)&&this[oe])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Ke]){let s=t;this[G]?Qe(()=>s.call(this,this[Ke])):s.call(this,this[Ke])}return i}removeListener(e,t){return this.off(e,t)}off(e,t){let i=super.off(e,t);return e==="data"&&(this[_e]=this.listeners("data").length,this[_e]===0&&!this[F]&&!this[L].length&&(this[S]=!1)),i}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[_e]=0,!this[F]&&!this[L].length&&(this[S]=!1)),t}get emittedEnd(){return this[oe]}[Q](){!this[Tt]&&!this[oe]&&!this[O]&&this[R].length===0&&this[J]&&(this[Tt]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Lt]&&this.emit("close"),this[Tt]=!1)}emit(e,...t){let i=t[0];if(e!=="error"&&e!=="close"&&e!==O&&this[O])return!1;if(e==="data")return!this[T]&&!i?!1:this[G]?(Qe(()=>this[wi](i)),!0):this[wi](i);if(e==="end")return this[Vs]();if(e==="close"){if(this[Lt]=!0,!this[oe]&&!this[O])return!1;let r=super.emit("close");return this.removeAllListeners("close"),r}else if(e==="error"){this[Ke]=i,super.emit(_i,i);let r=!this[Je]||this.listeners("error").length?super.emit("error",i):!1;return this[Q](),r}else if(e==="resume"){let r=super.emit("resume");return this[Q](),r}else if(e==="finish"||e==="prefinish"){let r=super.emit(e);return this.removeAllListeners(e),r}let s=super.emit(e,...t);return this[Q](),s}[wi](e){for(let i of this[L])i.dest.write(e)===!1&&this.pause();let t=this[F]?!1:super.emit("data",e);return this[Q](),t}[Vs](){return this[oe]?!1:(this[oe]=!0,this.readable=!1,this[G]?(Qe(()=>this[Ei]()),!0):this[Ei]())}[Ei](){if(this[Fe]){let t=this[Fe].end();if(t){for(let i of this[L])i.dest.write(t);this[F]||super.emit("data",t)}}for(let t of this[L])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[T]||(e.dataLength=0);let t=this.promise();return this.on("data",i=>{e.push(i),this[T]||(e.dataLength+=i.length)}),await t,e}async concat(){if(this[T])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[$]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(O,()=>t(new Error("stream destroyed"))),this.on("error",i=>t(i)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[F]=!1;let e=!1,t=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return t();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[J])return t();let s,r,n=l=>{this.off("data",o),this.off("end",h),this.off(O,a),t(),r(l)},o=l=>{this.off("error",n),this.off("end",h),this.off(O,a),this.pause(),s({value:l,done:!!this[J]})},h=()=>{this.off("error",n),this.off("data",o),this.off(O,a),t(),s({done:!0,value:void 0})},a=()=>n(new Error("stream destroyed"));return new Promise((l,u)=>{r=u,s=l,this.once(O,a),this.once("error",n),this.once("end",h),this.once("data",o)})},throw:t,return:t,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[F]=!1;let e=!1,t=()=>(this.pause(),this.off(_i,t),this.off(O,t),this.off("end",t),e=!0,{done:!0,value:void 0}),i=()=>{if(e)return t();let s=this.read();return s===null?t():{done:!1,value:s}};return this.once("end",t),this.once(_i,t),this.once(O,t),{next:i,throw:t,return:t,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(e){if(this[O])return e?this.emit("error",e):this.emit(O),this;this[O]=!0,this[F]=!0,this[R].length=0,this[C]=0;let t=this;return typeof t.close=="function"&&!this[Lt]&&t.close(),e?this.emit("error",e):this.emit(O),this}static get isStream(){return Tn}},Hn=D.default.writev,ge=Symbol("_autoClose"),V=Symbol("_close"),et=Symbol("_ended"),b=Symbol("_fd"),vi=Symbol("_finished"),se=Symbol("_flags"),Si=Symbol("_flush"),Wi=Symbol("_handleChunk"),Gi=Symbol("_makeBuf"),ct=Symbol("_mode"),Pt=Symbol("_needDrain"),Ve=Symbol("_onerror"),Ge=Symbol("_onopen"),Ri=Symbol("_onread"),ze=Symbol("_onwrite"),ye=Symbol("_open"),j=Symbol("_path"),ue=Symbol("_pos"),Z=Symbol("_queue"),Ue=Symbol("_read"),Ci=Symbol("_readSize"),ie=Symbol("_reading"),tt=Symbol("_remain"),ki=Symbol("_size"),Wt=Symbol("_write"),we=Symbol("_writing"),Gt=Symbol("_defaultFlag"),Ae=Symbol("_errored"),ps=class extends De{[Ae]=!1;[b];[j];[Ci];[ie]=!1;[ki];[tt];[ge];constructor(e,t){if(t=t||{},super(t),this.readable=!0,this.writable=!1,typeof e!="string")throw new TypeError("path must be a string");this[Ae]=!1,this[b]=typeof t.fd=="number"?t.fd:void 0,this[j]=e,this[Ci]=t.readSize||16*1024*1024,this[ie]=!1,this[ki]=typeof t.size=="number"?t.size:1/0,this[tt]=this[ki],this[ge]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[b]=="number"?this[Ue]():this[ye]()}get fd(){return this[b]}get path(){return this[j]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[ye](){D.default.open(this[j],"r",(e,t)=>this[Ge](e,t))}[Ge](e,t){e?this[Ve](e):(this[b]=t,this.emit("open",t),this[Ue]())}[Gi](){return Buffer.allocUnsafe(Math.min(this[Ci],this[tt]))}[Ue](){if(!this[ie]){this[ie]=!0;let e=this[Gi]();if(e.length===0)return process.nextTick(()=>this[Ri](null,0,e));D.default.read(this[b],e,0,e.length,null,(t,i,s)=>this[Ri](t,i,s))}}[Ri](e,t,i){this[ie]=!1,e?this[Ve](e):this[Wi](t,i)&&this[Ue]()}[V](){if(this[ge]&&typeof this[b]=="number"){let e=this[b];this[b]=void 0,D.default.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[Ve](e){this[ie]=!0,this[V](),this.emit("error",e)}[Wi](e,t){let i=!1;return this[tt]-=e,e>0&&(i=super.write(e<t.length?t.subarray(0,e):t)),(e===0||this[tt]<=0)&&(i=!1,this[V](),super.end()),i}emit(e,...t){switch(e){case"prefinish":case"finish":return!1;case"drain":return typeof this[b]=="number"&&this[Ue](),!1;case"error":return this[Ae]?!1:(this[Ae]=!0,super.emit(e,...t));default:return super.emit(e,...t)}}},zn=class extends ps{[ye](){let e=!0;try{this[Ge](null,D.default.openSync(this[j],"r")),e=!1}finally{e&&this[V]()}}[Ue](){let e=!0;try{if(!this[ie]){this[ie]=!0;do{let t=this[Gi](),i=t.length===0?0:D.default.readSync(this[b],t,0,t.length,null);if(!this[Wi](i,t))break}while(!0);this[ie]=!1}e=!1}finally{e&&this[V]()}}[V](){if(this[ge]&&typeof this[b]=="number"){let e=this[b];this[b]=void 0,D.default.closeSync(e),this.emit("close")}}},hi=class extends wr.default{readable=!1;writable=!0;[Ae]=!1;[we]=!1;[et]=!1;[Z]=[];[Pt]=!1;[j];[ct];[ge];[b];[Gt];[se];[vi]=!1;[ue];constructor(e,t){t=t||{},super(t),this[j]=e,this[b]=typeof t.fd=="number"?t.fd:void 0,this[ct]=t.mode===void 0?438:t.mode,this[ue]=typeof t.start=="number"?t.start:void 0,this[ge]=typeof t.autoClose=="boolean"?t.autoClose:!0;let i=this[ue]!==void 0?"r+":"w";this[Gt]=t.flags===void 0,this[se]=t.flags===void 0?i:t.flags,this[b]===void 0&&this[ye]()}emit(e,...t){if(e==="error"){if(this[Ae])return!1;this[Ae]=!0}return super.emit(e,...t)}get fd(){return this[b]}get path(){return this[j]}[Ve](e){this[V](),this[we]=!0,this.emit("error",e)}[ye](){D.default.open(this[j],this[se],this[ct],(e,t)=>this[Ge](e,t))}[Ge](e,t){this[Gt]&&this[se]==="r+"&&e&&e.code==="ENOENT"?(this[se]="w",this[ye]()):e?this[Ve](e):(this[b]=t,this.emit("open",t),this[we]||this[Si]())}end(e,t){return e&&this.write(e,t),this[et]=!0,!this[we]&&!this[Z].length&&typeof this[b]=="number"&&this[ze](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[et]?(this.emit("error",new Error("write() after end()")),!1):this[b]===void 0||this[we]||this[Z].length?(this[Z].push(e),this[Pt]=!0,!1):(this[we]=!0,this[Wt](e),!0)}[Wt](e){D.default.write(this[b],e,0,e.length,this[ue],(t,i)=>this[ze](t,i))}[ze](e,t){e?this[Ve](e):(this[ue]!==void 0&&typeof t=="number"&&(this[ue]+=t),this[Z].length?this[Si]():(this[we]=!1,this[et]&&!this[vi]?(this[vi]=!0,this[V](),this.emit("finish")):this[Pt]&&(this[Pt]=!1,this.emit("drain"))))}[Si](){if(this[Z].length===0)this[et]&&this[ze](null,0);else if(this[Z].length===1)this[Wt](this[Z].pop());else{let e=this[Z];this[Z]=[],Hn(this[b],e,this[ue],(t,i)=>this[ze](t,i))}}[V](){if(this[ge]&&typeof this[b]=="number"){let e=this[b];this[b]=void 0,D.default.close(e,t=>t?this.emit("error",t):this.emit("close"))}}},vr=class extends hi{[ye](){let e;if(this[Gt]&&this[se]==="r+")try{e=D.default.openSync(this[j],this[se],this[ct])}catch(t){if(t?.code==="ENOENT")return this[se]="w",this[ye]();throw t}else e=D.default.openSync(this[j],this[se],this[ct]);this[Ge](null,e)}[V](){if(this[ge]&&typeof this[b]=="number"){let e=this[b];this[b]=void 0,D.default.closeSync(e),this.emit("close")}}[Wt](e){let t=!0;try{this[ze](null,D.default.writeSync(this[b],e,0,e.length,this[ue])),t=!1}finally{if(t)try{this[V]()}catch{}}}},Un=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"],["onentry","onReadEntry"]]),jn=e=>!!e.sync&&!!e.file,Vn=e=>!e.sync&&!!e.file,Wn=e=>!!e.sync&&!e.file,Gn=e=>!e.sync&&!e.file,Zn=e=>!!e.file,qn=e=>Un.get(e)||e,gs=(e={})=>{if(!e)return{};let t={};for(let[i,s]of Object.entries(e)){let r=qn(i);t[r]=s}return t.chmod===void 0&&t.noChmod===!1&&(t.chmod=!0),delete t.noChmod,t},Ot=(e,t,i,s,r)=>Object.assign((n=[],o,h)=>{Array.isArray(n)&&(o=n,n={}),typeof o=="function"&&(h=o,o=void 0),o=o?Array.from(o):[];let a=gs(n);if(r?.(a,o),jn(a)){if(typeof h=="function")throw new TypeError("callback not supported for sync tar functions");return e(a,o)}else if(Vn(a)){let l=t(a,o);return h?l.then(()=>h(),h):l}else if(Wn(a)){if(typeof h=="function")throw new TypeError("callback not supported for sync tar functions");return i(a,o)}else if(Gn(a)){if(typeof h=="function")throw new TypeError("callback only supported with file option");return s(a,o)}throw new Error("impossible options??")},{syncFile:e,asyncFile:t,syncNoFile:i,asyncNoFile:s,validate:r}),Yn=Rr.default.constants||{ZLIB_VERNUM:4736},X=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},Yn)),Kn=pe.Buffer.concat,Gs=Object.getOwnPropertyDescriptor(pe.Buffer,"concat"),Xn=e=>e,xi=Gs?.writable===!0||Gs?.set!==void 0?e=>{pe.Buffer.concat=e?Xn:Kn}:e=>{},Te=Symbol("_superWrite"),Ft=class extends Error{code;errno;constructor(e,t){super("zlib: "+e.message,{cause:e}),this.code=e.code,this.errno=e.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+e.message,Error.captureStackTrace(this,t??this.constructor)}get name(){return"ZlibError"}},Ai=Symbol("flushFlag"),ys=class extends De{#e=!1;#i=!1;#s;#n;#r;#t;#o;get sawError(){return this.#e}get handle(){return this.#t}get flushFlag(){return this.#s}constructor(e,t){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");if(super(e),this.#s=e.flush??0,this.#n=e.finishFlush??0,this.#r=e.fullFlushFlag??0,typeof Ws[t]!="function")throw new TypeError("Compression method not supported: "+t);try{this.#t=new Ws[t](e)}catch(i){throw new Ft(i,this.constructor)}this.#o=i=>{this.#e||(this.#e=!0,this.close(),this.emit("error",i))},this.#t?.on("error",i=>this.#o(new Ft(i))),this.once("end",()=>this.close)}close(){this.#t&&(this.#t.close(),this.#t=void 0,this.emit("close"))}reset(){if(!this.#e)return(0,ii.default)(this.#t,"zlib binding closed"),this.#t.reset?.()}flush(e){this.ended||(typeof e!="number"&&(e=this.#r),this.write(Object.assign(pe.Buffer.alloc(0),{[Ai]:e})))}end(e,t,i){return typeof e=="function"&&(i=e,t=void 0,e=void 0),typeof t=="function"&&(i=t,t=void 0),e&&(t?this.write(e,t):this.write(e)),this.flush(this.#n),this.#i=!0,super.end(i)}get ended(){return this.#i}[Te](e){return super.write(e)}write(e,t,i){if(typeof t=="function"&&(i=t,t="utf8"),typeof e=="string"&&(e=pe.Buffer.from(e,t)),this.#e)return;(0,ii.default)(this.#t,"zlib binding closed");let s=this.#t._handle,r=s.close;s.close=()=>{};let n=this.#t.close;this.#t.close=()=>{},xi(!0);let o;try{let a=typeof e[Ai]=="number"?e[Ai]:this.#s;o=this.#t._processChunk(e,a),xi(!1)}catch(a){xi(!1),this.#o(new Ft(a,this.write))}finally{this.#t&&(this.#t._handle=s,s.close=r,this.#t.close=n,this.#t.removeAllListeners("error"))}this.#t&&this.#t.on("error",a=>this.#o(new Ft(a,this.write)));let h;if(o)if(Array.isArray(o)&&o.length>0){let a=o[0];h=this[Te](pe.Buffer.from(a));for(let l=1;l<o.length;l++)h=this[Te](o[l])}else h=this[Te](pe.Buffer.from(o));return i&&i(),h}},Cr=class extends ys{#e;#i;constructor(e,t){e=e||{},e.flush=e.flush||X.Z_NO_FLUSH,e.finishFlush=e.finishFlush||X.Z_FINISH,e.fullFlushFlag=X.Z_FULL_FLUSH,super(e,t),this.#e=e.level,this.#i=e.strategy}params(e,t){if(!this.sawError){if(!this.handle)throw new Error("cannot switch params when binding is closed");if(!this.handle.params)throw new Error("not supported in this implementation");if(this.#e!==e||this.#i!==t){this.flush(X.Z_SYNC_FLUSH),(0,ii.default)(this.handle,"zlib binding closed");let i=this.handle.flush;this.handle.flush=(s,r)=>{typeof s=="function"&&(r=s,s=this.flushFlag),this.flush(s),r?.()};try{this.handle.params(e,t)}finally{this.handle.flush=i}this.handle&&(this.#e=e,this.#i=t)}}}},Jn=class extends Cr{#e;constructor(e){super(e,"Gzip"),this.#e=e&&!!e.portable}[Te](e){return this.#e?(this.#e=!1,e[9]=255,super[Te](e)):super[Te](e)}},Qn=class extends Cr{constructor(e){super(e,"Unzip")}},kr=class extends ys{constructor(e,t){e=e||{},e.flush=e.flush||X.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||X.BROTLI_OPERATION_FINISH,e.fullFlushFlag=X.BROTLI_OPERATION_FLUSH,super(e,t)}},eo=class extends kr{constructor(e){super(e,"BrotliCompress")}},to=class extends kr{constructor(e){super(e,"BrotliDecompress")}},xr=class extends ys{constructor(e,t){e=e||{},e.flush=e.flush||X.ZSTD_e_continue,e.finishFlush=e.finishFlush||X.ZSTD_e_end,e.fullFlushFlag=X.ZSTD_e_flush,super(e,t)}},io=class extends xr{constructor(e){super(e,"ZstdCompress")}},so=class extends xr{constructor(e){super(e,"ZstdDecompress")}},ro=(e,t)=>{if(Number.isSafeInteger(e))e<0?oo(e,t):no(e,t);else throw Error("cannot encode number outside of javascript safe integer range");return t},no=(e,t)=>{t[0]=128;for(var i=t.length;i>1;i--)t[i-1]=e&255,e=Math.floor(e/256)},oo=(e,t)=>{t[0]=255;var i=!1;e=e*-1;for(var s=t.length;s>1;s--){var r=e&255;e=Math.floor(e/256),i?t[s-1]=Ar(r):r===0?t[s-1]=0:(i=!0,t[s-1]=Tr(r))}},ho=e=>{let t=e[0],i=t===128?lo(e.subarray(1,e.length)):t===255?ao(e):null;if(i===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(i))throw Error("parsed number outside of javascript safe integer range");return i},ao=e=>{for(var t=e.length,i=0,s=!1,r=t-1;r>-1;r--){var n=Number(e[r]),o;s?o=Ar(n):n===0?o=n:(s=!0,o=Tr(n)),o!==0&&(i-=o*Math.pow(256,t-r-1))}return i},lo=e=>{for(var t=e.length,i=0,s=t-1;s>-1;s--){var r=Number(e[s]);r!==0&&(i+=r*Math.pow(256,t-s-1))}return i},Ar=e=>(255^e)&255,Tr=e=>(255^e)+1&255,uo={};An(uo,{code:()=>bs,isCode:()=>Zt,isName:()=>co,name:()=>li,normalFsTypes:()=>Lr});var Zt=e=>li.has(e),co=e=>bs.has(e),Lr=new Set(["0","","1","2","3","4","5","6","7","D"]),li=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]),bs=new Map(Array.from(li).map(e=>[e[1],e[0]])),mo=e=>e===void 0||e<0?void 0:e,Le=class{cksumValid=!1;needPax=!1;nullBlock=!1;block;path;mode;uid;gid;size;cksum;#e="Unsupported";linkpath;uname;gname;devmaj=0;devmin=0;atime;ctime;mtime;charset;comment;constructor(e,t=0,i,s){Buffer.isBuffer(e)?this.decode(e,t||0,i,s):e&&this.#i(e)}decode(e,t,i,s){if(t||(t=0),!e||!(e.length>=t+512))throw new Error("need 512 bytes for header");let r=Ee(e,t+156,1),n=Lr.has(r),o=n?i:void 0,h=n?s:void 0;if(this.path=o?.path??Ee(e,t,100),this.mode=o?.mode??h?.mode??de(e,t+100,8),this.uid=o?.uid??h?.uid??de(e,t+108,8),this.gid=o?.gid??h?.gid??de(e,t+116,8),this.size=mo(o?.size??h?.size??de(e,t+124,12)),this.mtime=o?.mtime??h?.mtime??Ti(e,t+136,12),this.cksum=de(e,t+148,12),h&&this.#i(h,!0),o&&this.#i(o),Zt(r)&&(this.#e=r||"0"),this.#e==="0"&&this.path.slice(-1)==="/"&&(this.#e="5"),this.#e==="5"&&(this.size=0),this.linkpath=Ee(e,t+157,100),e.subarray(t+257,t+265).toString()==="ustar\x0000")if(this.uname=o?.uname??h?.uname??Ee(e,t+265,32),this.gname=o?.gname??h?.gname??Ee(e,t+297,32),this.devmaj=o?.devmaj??h?.devmaj??de(e,t+329,8)??0,this.devmin=o?.devmin??h?.devmin??de(e,t+337,8)??0,e[t+475]!==0){let l=Ee(e,t+345,155);this.path=l+"/"+this.path}else{let l=Ee(e,t+345,130);l&&(this.path=l+"/"+this.path),this.atime=i?.atime??s?.atime??Ti(e,t+476,12),this.ctime=i?.ctime??s?.ctime??Ti(e,t+488,12)}let a=256;for(let l=t;l<t+148;l++)a+=e[l];for(let l=t+156;l<t+512;l++)a+=e[l];this.cksumValid=a===this.cksum,this.cksum===void 0&&a===256&&(this.nullBlock=!0)}#i(e,t=!1){Object.assign(this,Object.fromEntries(Object.entries(e).filter(([i,s])=>!(s==null||i==="size"&&Number(s)<0||i==="path"&&t||i==="linkpath"&&t||i==="global"))))}encode(e,t=0){if(e||(e=this.block=Buffer.alloc(512)),this.#e==="Unsupported"&&(this.#e="0"),!(e.length>=t+512))throw new Error("need 512 bytes for header");let i=this.ctime||this.atime?130:155,s=po(this.path||"",i),r=s[0],n=s[1];this.needPax=!!s[2],this.needPax=Oe(e,t,100,r)||this.needPax,this.needPax=ce(e,t+100,8,this.mode)||this.needPax,this.needPax=ce(e,t+108,8,this.uid)||this.needPax,this.needPax=ce(e,t+116,8,this.gid)||this.needPax,this.needPax=ce(e,t+124,12,this.size)||this.needPax,this.needPax=Li(e,t+136,12,this.mtime)||this.needPax,e[t+156]=Number(this.#e.codePointAt(0)),this.needPax=Oe(e,t+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",t+257,8),this.needPax=Oe(e,t+265,32,this.uname)||this.needPax,this.needPax=Oe(e,t+297,32,this.gname)||this.needPax,this.needPax=ce(e,t+329,8,this.devmaj)||this.needPax,this.needPax=ce(e,t+337,8,this.devmin)||this.needPax,this.needPax=Oe(e,t+345,i,n)||this.needPax,e[t+475]!==0?this.needPax=Oe(e,t+345,155,n)||this.needPax:(this.needPax=Oe(e,t+345,130,n)||this.needPax,this.needPax=Li(e,t+476,12,this.atime)||this.needPax,this.needPax=Li(e,t+488,12,this.ctime)||this.needPax);let o=256;for(let h=t;h<t+148;h++)o+=e[h];for(let h=t+156;h<t+512;h++)o+=e[h];return this.cksum=o,ce(e,t+148,8,this.cksum),this.cksumValid=!0,this.needPax}get type(){return this.#e==="Unsupported"?this.#e:li.get(this.#e)}get typeKey(){return this.#e}set type(e){let t=String(bs.get(e));if(Zt(t)||t==="Unsupported")this.#e=t;else if(Zt(e))this.#e=e;else throw new TypeError("invalid entry type: "+e)}},po=(e,t)=>{let i=e,s="",r,n=ke.posix.parse(e).root||".";if(Buffer.byteLength(i)<100)r=[i,s,!1];else{s=ke.posix.dirname(i),i=ke.posix.basename(i);do Buffer.byteLength(i)<=100&&Buffer.byteLength(s)<=t?r=[i,s,!1]:Buffer.byteLength(i)>100&&Buffer.byteLength(s)<=t?r=[i.slice(0,99),s,!0]:(i=ke.posix.join(ke.posix.basename(s),i),s=ke.posix.dirname(s));while(s!==n&&r===void 0);r||(r=[e.slice(0,99),"",!0])}return r},Ee=(e,t,i)=>e.subarray(t,t+i).toString("utf8").replace(/\0.*/,""),Ti=(e,t,i)=>fo(de(e,t,i)),fo=e=>e===void 0?void 0:new Date(e*1e3),de=(e,t,i)=>Number(e[t])&128?ho(e.subarray(t,t+i)):yo(e,t,i),go=e=>isNaN(e)?void 0:e,yo=(e,t,i)=>go(parseInt(e.subarray(t,t+i).toString("utf8").replace(/\0.*$/,"").trim(),8)),bo={12:8589934591,8:2097151},ce=(e,t,i,s)=>s===void 0?!1:s>bo[i]||s<0?(ro(s,e.subarray(t,t+i)),!0):(_o(e,t,i,s),!1),_o=(e,t,i,s)=>e.write(wo(s,i),t,i,"ascii"),wo=(e,t)=>Eo(Math.floor(e).toString(8),t),Eo=(e,t)=>(e.length===t-1?e:new Array(t-e.length-1).join("0")+e+" ")+"\0",Li=(e,t,i,s)=>s===void 0?!1:ce(e,t,i,s.getTime()/1e3),Oo=new Array(156).join("\0"),Oe=(e,t,i,s)=>s===void 0?!1:(e.write(s+Oo,t,i,"utf8"),s.length!==Buffer.byteLength(s)||s.length>i),si=class Ir{atime;mtime;ctime;charset;comment;gid;uid;gname;uname;linkpath;dev;ino;nlink;path;size;mode;global;constructor(t,i=!1){this.atime=t.atime,this.charset=t.charset,this.comment=t.comment,this.ctime=t.ctime,this.dev=t.dev,this.gid=t.gid,this.global=i,this.gname=t.gname,this.ino=t.ino,this.linkpath=t.linkpath,this.mtime=t.mtime,this.nlink=t.nlink,this.path=t.path,this.size=t.size,this.uid=t.uid,this.uname=t.uname}encode(){let t=this.encodeBody();if(t==="")return Buffer.allocUnsafe(0);let i=Buffer.byteLength(t),s=512*Math.ceil(1+i/512),r=Buffer.allocUnsafe(s);for(let n=0;n<512;n++)r[n]=0;new Le({path:("PaxHeader/"+(0,Dr.basename)(this.path??"")).slice(0,99),mode:this.mode||420,uid:this.uid,gid:this.gid,size:i,mtime:this.mtime,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime,ctime:this.ctime}).encode(r),r.write(t,512,i,"utf8");for(let n=i+512;n<r.length;n++)r[n]=0;return r}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(t){if(this[t]===void 0)return"";let i=this[t],s=i instanceof Date?i.getTime()/1e3:i,r=" "+(t==="dev"||t==="ino"||t==="nlink"?"SCHILY.":"")+t+"="+s+`
28
+ `,n=Buffer.byteLength(r),o=Math.floor(Math.log(n)/Math.log(10))+1;return n+o>=Math.pow(10,o)&&(o+=1),o+n+r}static parse(t,i,s=!1){return new Ir(vo(So(t),i),s)}},vo=(e,t)=>t?Object.assign({},t,e):e,So=e=>e.replace(/\n$/,"").split(`
29
+ `).reduce(Ro,Object.create(null)),Ro=(e,t)=>{let i=parseInt(t,10);if(i!==Buffer.byteLength(t)+1)return e;t=t.slice((i+" ").length);let s=t.split("="),r=s.shift();if(!r)return e;let n=r.replace(/^SCHILY\.(dev|ino|nlink)/,"$1"),o=s.join("=").replace(/\0.*/,"");switch(n){case"path":case"linkpath":case"type":case"charset":case"comment":case"gname":case"uname":e[n]=o;break;case"ctime":case"atime":case"mtime":e[n]=new Date(Number(o)*1e3);break;case"size":let h=+o;h>=0&&(e[n]=h);break;case"gid":case"uid":case"dev":case"ino":case"nlink":case"mode":e[n]=+o;break}return e},Co=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,m=Co!=="win32"?e=>String(e):e=>String(e).replaceAll(/\\/g,"/"),ko=class extends De{extended;globalExtended;header;startBlockSize;blockRemain;remain;type;meta=!1;ignore=!1;path;mode;uid;gid;uname;gname;size=0;mtime;atime;ctime;linkpath;dev;ino;nlink;invalid=!1;absolute;unsupported=!1;constructor(e,t,i){switch(super({}),this.pause(),this.extended=t,this.globalExtended=i,this.header=e,this.remain=e.size??0,this.startBlockSize=512*Math.ceil(this.remain/512),this.blockRemain=this.startBlockSize,this.type=e.type,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}if(!e.path)throw new Error("no path provided for tar.ReadEntry");this.path=m(e.path),this.mode=e.mode,this.mode&&(this.mode=this.mode&4095),this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,this.size=this.remain,this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime,this.linkpath=e.linkpath?m(e.linkpath):void 0,this.uname=e.uname,this.gname=e.gname,t&&this.#e(t),i&&this.#e(i,!0)}write(e){let t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");let i=this.remain,s=this.blockRemain;return this.remain=Math.max(0,i-t),this.blockRemain=Math.max(0,s-t),this.ignore?!0:i>=t?super.write(e):super.write(e.subarray(0,i))}#e(e,t=!1){e.path&&(e.path=m(e.path)),e.linkpath&&(e.linkpath=m(e.linkpath)),Object.assign(this,Object.fromEntries(Object.entries(e).filter(([i,s])=>!(s==null||i==="path"&&t))))}},ui=(e,t,i,s={})=>{e.file&&(s.file=e.file),e.cwd&&(s.cwd=e.cwd),s.code=i instanceof Error&&i.code||t,s.tarCode=t,!e.strict&&s.recoverable!==!1?(i instanceof Error&&(s=Object.assign(i,s),i=i.message),e.emit("warn",t,i,s)):i instanceof Error?e.emit("error",Object.assign(i,s)):e.emit("error",Object.assign(new Error(`${t}: ${i}`),s))},xo=1024*1024,Zi=Buffer.from([31,139]),qi=Buffer.from([40,181,47,253]),Ao=Math.max(Zi.length,qi.length),M=Symbol("state"),ve=Symbol("writeEntry"),ee=Symbol("readEntry"),Di=Symbol("nextEntry"),Zs=Symbol("processEntry"),q=Symbol("extendedHeader"),it=Symbol("globalExtendedHeader"),he=Symbol("meta"),qs=Symbol("emitMeta"),_=Symbol("buffer"),te=Symbol("queue"),ae=Symbol("ended"),Ii=Symbol("emittedEnd"),Se=Symbol("emit"),E=Symbol("unzip"),Mt=Symbol("consumeChunk"),Bt=Symbol("consumeChunkSub"),Ni=Symbol("consumeBody"),Ys=Symbol("consumeMeta"),Ks=Symbol("consumeHeader"),st=Symbol("consuming"),Pi=Symbol("bufferConcat"),$t=Symbol("maybeEnd"),Me=Symbol("writing"),Y=Symbol("aborted"),Ht=Symbol("onDone"),Re=Symbol("sawValidEntry"),zt=Symbol("sawNullBlock"),Ut=Symbol("sawEOF"),Xs=Symbol("closeStream"),To=1e3,rt=Symbol("compressedBytesRead"),Fi=Symbol("decompressedBytesRead"),Js=Symbol("checkDecompressionRatio"),Lo=()=>!0,_t=class extends Sr.EventEmitter{file;strict;maxMetaEntrySize;filter;brotli;zstd;maxDecompressionRatio;writable=!0;readable=!1;[te]=[];[_];[ee];[ve];[M]="begin";[he]="";[q];[it];[ae]=!1;[E];[Y]=!1;[Re];[zt]=!1;[Ut]=!1;[Me]=!1;[st]=!1;[Ii]=!1;[rt]=0;[Fi]=0;constructor(e={}){super(),this.file=e.file||"",this.on(Ht,()=>{(this[M]==="begin"||this[Re]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(Ht,e.ondone):this.on(Ht,()=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxDecompressionRatio=typeof e.maxDecompressionRatio=="number"?e.maxDecompressionRatio:To,this.maxMetaEntrySize=e.maxMetaEntrySize||xo,this.filter=typeof e.filter=="function"?e.filter:Lo;let t=e.file&&(e.file.endsWith(".tar.br")||e.file.endsWith(".tbr"));this.brotli=!(e.gzip||e.zstd)&&e.brotli!==void 0?e.brotli:t?void 0:!1;let i=e.file&&(e.file.endsWith(".tar.zst")||e.file.endsWith(".tzst"));this.zstd=!(e.gzip||e.brotli)&&e.zstd!==void 0?e.zstd:i?!0:void 0,this.on("end",()=>this[Xs]()),typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onReadEntry=="function"&&this.on("entry",e.onReadEntry)}warn(e,t,i={}){ui(this,e,t,i)}[Ks](e,t){this[Re]===void 0&&(this[Re]=!1);let i;try{i=new Le(e,t,this[q],this[it])}catch(s){return this.warn("TAR_ENTRY_INVALID",s)}if(i.nullBlock)this[zt]?(this[Ut]=!0,this[M]==="begin"&&(this[M]="header"),this[Se]("eof")):(this[zt]=!0,this[Se]("nullBlock"));else if(this[zt]=!1,!i.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:i});else if(!i.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:i});else{let s=i.type;if(/^(Symbolic)?Link$/.test(s)&&!i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:i});else if(!/^(Symbolic)?Link$/.test(s)&&!/^(Global)?ExtendedHeader$/.test(s)&&i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:i});else{let r=this[ve]=new ko(i,this[q],this[it]);if(!this[Re])if(r.remain){let n=()=>{r.invalid||(this[Re]=!0)};r.on("end",n)}else this[Re]=!0;r.meta?r.size>this.maxMetaEntrySize?(r.ignore=!0,this[Se]("ignoredEntry",r),this[M]="ignore",r.resume()):r.size>0&&(this[he]="",r.on("data",n=>this[he]+=n),this[M]="meta"):(this[q]=void 0,r.ignore=r.ignore||!this.filter(r.path,r),r.ignore?(this[Se]("ignoredEntry",r),this[M]=r.remain?"ignore":"header",r.resume()):(r.remain?this[M]="body":(this[M]="header",r.end()),this[ee]?this[te].push(r):(this[te].push(r),this[Di]())))}}}[Xs](){queueMicrotask(()=>this.emit("close"))}[Zs](e){let t=!0;if(!e)this[ee]=void 0,t=!1;else if(Array.isArray(e)){let[i,...s]=e;this.emit(i,...s)}else this[ee]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",()=>this[Di]()),t=!1);return t}[Di](){do;while(this[Zs](this[te].shift()));if(this[te].length===0){let e=this[ee];!e||e.flowing||e.size===e.remain?this[Me]||this.emit("drain"):e.once("drain",()=>this.emit("drain"))}}[Ni](e,t){let i=this[ve];if(!i)throw new Error("attempt to consume body without entry??");let s=i.blockRemain??0,r=s>=e.length&&t===0?e:e.subarray(t,t+s);return i.write(r),i.blockRemain||(this[M]="header",this[ve]=void 0,i.end()),r.length}[Ys](e,t){let i=this[ve],s=this[Ni](e,t);return!this[ve]&&i&&this[qs](i),s}[Se](e,t,i){this[te].length===0&&!this[ee]?this.emit(e,t,i):this[te].push([e,t,i])}[qs](e){switch(this[Se]("meta",this[he]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[q]=si.parse(this[he],this[q],!1);break;case"GlobalExtendedHeader":this[it]=si.parse(this[he],this[it],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":{let t=this[q]??Object.create(null);this[q]=t,t.path=this[he].replace(/\0.*/,"");break}case"NextFileHasLongLinkpath":{let t=this[q]||Object.create(null);this[q]=t,t.linkpath=this[he].replace(/\0.*/,"");break}default:throw new Error("unknown meta: "+e.type)}}abort(e){if(!this[Y]){if(this[E]){let t=this[E];t.write=()=>!0,t.end=()=>t,t.emit=()=>!1,t.destroy?.()}this[Y]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}}[Js](e){this[Fi]+=e.length;let t=this[Fi]/this[rt];return t>this.maxDecompressionRatio?(this.abort(new Error(`max decompression ratio exceeded: ${t.toFixed(2)} > ${this.maxDecompressionRatio}`)),!1):!0}write(e,t,i){if(typeof t=="function"&&(i=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof t=="string"?t:"utf8")),this[Y])return i?.(),!1;if((this[E]===void 0||this.brotli===void 0&&this[E]===!1)&&e){if(this[_]&&(e=Buffer.concat([this[_],e]),this[_]=void 0),e.length<Ao)return this[_]=e,i?.(),!0;for(let o=0;this[E]===void 0&&o<Zi.length;o++)e[o]!==Zi[o]&&(this[E]=!1);let r=!1;if(this[E]===!1&&this.zstd!==!1){r=!0;for(let o=0;o<qi.length;o++)if(e[o]!==qi[o]){r=!1;break}}let n=this.brotli===void 0&&!r;if(this[E]===!1&&n)if(e.length<512)if(this[ae])this.brotli=!0;else return this[_]=e,i?.(),!0;else try{new Le(e.subarray(0,512)),this.brotli=!1}catch{this.brotli=!0}if(this[E]===void 0||this[E]===!1&&(this.brotli||r)){let o=this[ae];this[ae]=!1,this[E]=this[E]===void 0?new Qn({}):r?new so({}):new to({}),this[E].on("data",a=>{this[Js](a)&&this[Mt](a)}),this[E].on("error",a=>{this[Y]||this.abort(a)}),this[E].on("end",()=>{this[ae]=!0,this[Mt]()}),this[Me]=!0,this[rt]+=e.length;let h=!!this[E][o?"end":"write"](e);return this[Me]=!1,i?.(),h}}this[Me]=!0,this[E]?(this[rt]+=e.length,this[E].write(e)):this[Mt](e),this[Me]=!1;let s=this[te].length>0?!1:this[ee]?this[ee].flowing:!0;return!s&&this[te].length===0&&this[ee]?.once("drain",()=>this.emit("drain")),i?.(),s}[Pi](e){e&&!this[Y]&&(this[_]=this[_]?Buffer.concat([this[_],e]):e)}[$t](){if(this[ae]&&!this[Ii]&&!this[Y]&&!this[st]){this[Ii]=!0;let e=this[ve];if(e?.blockRemain){let t=this[_]?this[_].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${t} available)`,{entry:e}),this[_]&&e.write(this[_]),e.end()}this[Se](Ht)}}[Mt](e){if(this[st]&&e)this[Pi](e);else if(!e&&!this[_])this[$t]();else if(e){if(this[st]=!0,this[_]){this[Pi](e);let t=this[_];this[_]=void 0,this[Bt](t)}else this[Bt](e);for(;this[_]&&this[_]?.length>=512&&!this[Y]&&!this[Ut];){let t=this[_];this[_]=void 0,this[Bt](t)}this[st]=!1}(!this[_]||this[ae])&&this[$t]()}[Bt](e){let t=0,i=e.length;for(;t+512<=i&&!this[Y]&&!this[Ut];)switch(this[M]){case"begin":case"header":this[Ks](e,t),t+=512;break;case"ignore":case"body":t+=this[Ni](e,t);break;case"meta":t+=this[Ys](e,t);break;default:throw new Error("invalid state: "+this[M])}t<i&&(this[_]=this[_]?Buffer.concat([e.subarray(t),this[_]]):e.subarray(t))}end(e,t,i){return typeof e=="function"&&(i=e,t=void 0,e=void 0),typeof t=="function"&&(i=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,t)),i&&this.once("finish",i),this[Y]||(this[E]?(e&&(this[rt]+=e.length,this[E].write(e)),this[E].end()):(this[ae]=!0,(this.brotli===void 0||this.zstd===void 0)&&(e=e||Buffer.alloc(0)),e&&this.write(e),this[$t]())),this}},mt=e=>{let t=e.length-1,i=-1;for(;t>-1&&e.charAt(t)==="/";)i=t,t--;return i===-1?e:e.slice(0,i)},Do=e=>{let t=e.onReadEntry;e.onReadEntry=t?i=>{t(i),i.resume()}:i=>i.resume()},Nr=(e,t)=>{let i=new Map(t.map(o=>[mt(o),!0])),s=e.filter,r=100,n=(o,h="",a=0)=>{if(a>=r)return i.set(o,!1),!1;let l=h||(0,ai.parse)(o).root||".",u;if(o===l)u=!1;else{let d=i.get(o);u=d!==void 0?d:n((0,ai.dirname)(o),l,a+1)}return i.set(o,u),u};e.filter=s?(o,h)=>s(o,h)&&n(mt(o)):o=>n(mt(o))},Io=e=>{let t=new _t(e),i=e.file,s;try{s=xe.default.openSync(i,"r");let r=xe.default.fstatSync(s),n=e.maxReadSize||16*1024*1024;if(r.size<n){let o=Buffer.allocUnsafe(r.size),h=xe.default.readSync(s,o,0,r.size,0);t.end(h===o.byteLength?o:o.subarray(0,h))}else{let o=0,h=Buffer.allocUnsafe(n);for(;o<r.size;){let a=xe.default.readSync(s,h,0,n,o);if(a===0)break;o+=a,t.write(h.subarray(0,a))}t.end()}}finally{if(typeof s=="number")try{xe.default.closeSync(s)}catch{}}},No=(e,t)=>{let i=new _t(e),s=e.maxReadSize||16*1024*1024,r=e.file;return new Promise((n,o)=>{i.on("error",o),i.on("end",n),xe.default.stat(r,(h,a)=>{if(h)o(h);else{let l=new ps(r,{readSize:s,size:a.size});l.on("error",o),l.pipe(i)}})})},di=Ot(Io,No,e=>new _t(e),e=>new _t(e),(e,t)=>{t?.length&&Nr(e,t),e.noResume||Do(e)}),Pr=(e,t,i)=>(e&=4095,i&&(e=(e|384)&-19),t&&(e&256&&(e|=64),e&32&&(e|=8),e&4&&(e|=1)),e),{isAbsolute:Po,parse:Qs}=Fr.win32,_s=e=>{let t="",i=Qs(e);for(;Po(e)||i.root;){let s=e.charAt(0)==="/"&&e.slice(0,4)!=="//?/"?"/":i.root;e=e.slice(s.length),t+=s,i=Qs(e)}return[t,e]},ci=["|","<",">","?",":"],ws=ci.map(e=>String.fromCodePoint(61440+Number(e.codePointAt(0)))),Fo=new Map(ci.map((e,t)=>[e,ws[t]])),Mo=new Map(ws.map((e,t)=>[e,ci[t]])),er=e=>ci.reduce((t,i)=>t.split(i).join(Fo.get(i)),e),Bo=e=>ws.reduce((t,i)=>t.split(i).join(Mo.get(i)),e),Mr=(e,t)=>t?(e=m(e).replace(/^\.(\/|$)/,""),mt(t)+"/"+e):m(e),$o=16*1024*1024,tr=Symbol("process"),ir=Symbol("file"),sr=Symbol("directory"),Ki=Symbol("symlink"),rr=Symbol("hardlink"),nt=Symbol("header"),qt=Symbol("read"),Xi=Symbol("lstat"),Yt=Symbol("onlstat"),Ji=Symbol("onread"),Qi=Symbol("onreadlink"),es=Symbol("openfile"),ts=Symbol("onopenfile"),me=Symbol("close"),ri=Symbol("mode"),is=Symbol("awaitDrain"),Mi=Symbol("ondrain"),K=Symbol("prefix"),Br=class extends De{path;portable;myuid=process.getuid&&process.getuid()||0;myuser=process.env.USER||"";maxReadSize;linkCache;statCache;preservePaths;cwd;strict;mtime;noPax;noMtime;prefix;fd;blockLen=0;blockRemain=0;buf;pos=0;remain=0;length=0;offset=0;win32;absolute;header;type;linkpath;stat;onWriteEntry;#e=!1;constructor(e,t={}){let i=gs(t);super(),this.path=m(e),this.portable=!!i.portable,this.maxReadSize=i.maxReadSize||$o,this.linkCache=i.linkCache||new Map,this.statCache=i.statCache||new Map,this.preservePaths=!!i.preservePaths,this.cwd=m(i.cwd||process.cwd()),this.strict=!!i.strict,this.noPax=!!i.noPax,this.noMtime=!!i.noMtime,this.mtime=i.mtime,this.prefix=i.prefix?m(i.prefix):void 0,this.onWriteEntry=i.onWriteEntry,typeof i.onwarn=="function"&&this.on("warn",i.onwarn);let s=!1;if(!this.preservePaths){let[n,o]=_s(this.path);n&&typeof o=="string"&&(this.path=o,s=n)}this.win32=!!i.win32||process.platform==="win32",this.win32&&(this.path=Bo(this.path.replaceAll(/\\/g,"/")),e=e.replaceAll(/\\/g,"/")),this.absolute=m(i.absolute||Yi.default.resolve(this.cwd,e)),this.path===""&&(this.path="./"),s&&this.warn("TAR_ENTRY_INFO",`stripping ${s} from absolute path`,{entry:this,path:s+this.path});let r=this.statCache.get(this.absolute);r?this[Yt](r):this[Xi]()}warn(e,t,i={}){return ui(this,e,t,i)}emit(e,...t){return e==="error"&&(this.#e=!0),super.emit(e,...t)}[Xi](){U.default.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[Yt](t)})}[Yt](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=Uo(e),this.emit("stat",e),this[tr]()}[tr](){switch(this.type){case"File":return this[ir]();case"Directory":return this[sr]();case"SymbolicLink":return this[Ki]();default:return this.end()}}[ri](e){return Pr(e,this.type==="Directory",this.portable)}[K](e){return Mr(e,this.prefix)}[nt](){if(!this.stat)throw new Error("cannot write header before stat");this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.onWriteEntry?.(this),this.header=new Le({path:this[K](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[K](this.linkpath):this.linkpath,mode:this[ri](this.stat.mode),uid:this.portable?void 0:this.stat.uid,gid:this.portable?void 0:this.stat.gid,size:this.stat.size,mtime:this.noMtime?void 0:this.mtime||this.stat.mtime,type:this.type==="Unsupported"?void 0:this.type,uname:this.portable?void 0:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?void 0:this.stat.atime,ctime:this.portable?void 0:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new si({atime:this.portable?void 0:this.header.atime,ctime:this.portable?void 0:this.header.ctime,gid:this.portable?void 0:this.header.gid,mtime:this.noMtime?void 0:this.mtime||this.header.mtime,path:this[K](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[K](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?void 0:this.header.uid,uname:this.portable?void 0:this.header.uname,dev:this.portable?void 0:this.stat.dev,ino:this.portable?void 0:this.stat.ino,nlink:this.portable?void 0:this.stat.nlink}).encode());let e=this.header?.block;if(!e)throw new Error("failed to encode header");super.write(e)}[sr](){if(!this.stat)throw new Error("cannot create directory entry without stat");this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[nt](),this.end()}[Ki](){U.default.readlink(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[Qi](t)})}[Qi](e){this.linkpath=m(e),this[nt](),this.end()}[rr](e){if(!this.stat)throw new Error("cannot create link entry without stat");this.type="Link",this.linkpath=m(Yi.default.relative(this.cwd,e)),this.stat.size=0,this[nt](),this.end()}[ir](){if(!this.stat)throw new Error("cannot create file entry without stat");if(this.stat.nlink>1){let e=`${this.stat.dev}:${this.stat.ino}`,t=this.linkCache.get(e);if(t?.indexOf(this.cwd)===0)return this[rr](t);this.linkCache.set(e,this.absolute)}if(this[nt](),this.stat.size===0)return this.end();this[es]()}[es](){U.default.open(this.absolute,"r",(e,t)=>{if(e)return this.emit("error",e);this[ts](t)})}[ts](e){if(this.fd=e,this.#e)return this[me]();if(!this.stat)throw new Error("should stat before calling onopenfile");this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let t=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(t),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[qt]()}[qt](){let{fd:e,buf:t,offset:i,length:s,pos:r}=this;if(e===void 0||t===void 0)throw new Error("cannot read file without first opening");U.default.read(e,t,i,s,r,(n,o)=>{if(n)return this[me](()=>this.emit("error",n));this[Ji](o)})}[me](e=()=>{}){this.fd!==void 0&&U.default.close(this.fd,e)}[Ji](e){if(e<=0&&this.remain>0){let i=Object.assign(new Error("encountered unexpected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[me](()=>this.emit("error",i))}if(e>this.remain){let i=Object.assign(new Error("did not encounter expected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[me](()=>this.emit("error",i))}if(!this.buf)throw new Error("should have created buffer prior to reading");if(e===this.remain)for(let i=e;i<this.length&&e<this.blockRemain;i++)this.buf[i+this.offset]=0,e++,this.remain++;let t=this.offset===0&&e===this.buf.length?this.buf:this.buf.subarray(this.offset,this.offset+e);this.write(t)?this[Mi]():this[is](()=>this[Mi]())}[is](e){this.once("drain",e)}write(e,t,i){if(typeof t=="function"&&(i=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof t=="string"?t:"utf8")),this.blockRemain<e.length){let s=Object.assign(new Error("writing more data than expected"),{path:this.absolute});return this.emit("error",s)}return this.remain-=e.length,this.blockRemain-=e.length,this.pos+=e.length,this.offset+=e.length,super.write(e,null,i)}[Mi](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[me](e=>e?this.emit("error",e):this.end());if(!this.buf)throw new Error("buffer lost somehow in ONDRAIN");this.offset>=this.length&&(this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0),this.length=this.buf.length-this.offset,this[qt]()}},Ho=class extends Br{sync=!0;[Xi](){this[Yt](U.default.lstatSync(this.absolute))}[Ki](){this[Qi](U.default.readlinkSync(this.absolute))}[es](){this[ts](U.default.openSync(this.absolute,"r"))}[qt](){let e=!0;try{let{fd:t,buf:i,offset:s,length:r,pos:n}=this;if(t===void 0||i===void 0)throw new Error("fd and buf must be set in READ method");let o=U.default.readSync(t,i,s,r,n);this[Ji](o),e=!1}finally{if(e)try{this[me](()=>{})}catch{}}}[is](e){e()}[me](e=()=>{}){this.fd!==void 0&&U.default.closeSync(this.fd),e()}},zo=class extends De{blockLen=0;blockRemain=0;buf=0;pos=0;remain=0;length=0;preservePaths;portable;strict;noPax;noMtime;readEntry;type;prefix;path;mode;uid;gid;uname;gname;header;mtime;atime;ctime;linkpath;size;onWriteEntry;warn(e,t,i={}){return ui(this,e,t,i)}constructor(e,t={}){let i=gs(t);super(),this.preservePaths=!!i.preservePaths,this.portable=!!i.portable,this.strict=!!i.strict,this.noPax=!!i.noPax,this.noMtime=!!i.noMtime,this.onWriteEntry=i.onWriteEntry,this.readEntry=e;let{type:s}=e;if(s==="Unsupported")throw new Error("writing entry that should be ignored");this.type=s,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=i.prefix,this.path=m(e.path),this.mode=e.mode!==void 0?this[ri](e.mode):void 0,this.uid=this.portable?void 0:e.uid,this.gid=this.portable?void 0:e.gid,this.uname=this.portable?void 0:e.uname,this.gname=this.portable?void 0:e.gname,this.size=e.size,this.mtime=this.noMtime?void 0:i.mtime||e.mtime,this.atime=this.portable?void 0:e.atime,this.ctime=this.portable?void 0:e.ctime,this.linkpath=e.linkpath!==void 0?m(e.linkpath):void 0,typeof i.onwarn=="function"&&this.on("warn",i.onwarn);let r=!1;if(!this.preservePaths){let[o,h]=_s(this.path);o&&typeof h=="string"&&(this.path=h,r=o)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.onWriteEntry?.(this),this.header=new Le({path:this[K](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[K](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?void 0:this.uid,gid:this.portable?void 0:this.gid,size:this.size,mtime:this.noMtime?void 0:this.mtime,type:this.type,uname:this.portable?void 0:this.uname,atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime}),r&&this.warn("TAR_ENTRY_INFO",`stripping ${r} from absolute path`,{entry:this,path:r+this.path}),this.header.encode()&&!this.noPax&&super.write(new si({atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime,gid:this.portable?void 0:this.gid,mtime:this.noMtime?void 0:this.mtime,path:this[K](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[K](this.linkpath):this.linkpath,size:this.size,uid:this.portable?void 0:this.uid,uname:this.portable?void 0:this.uname,dev:this.portable?void 0:this.readEntry.dev,ino:this.portable?void 0:this.readEntry.ino,nlink:this.portable?void 0:this.readEntry.nlink}).encode());let n=this.header?.block;if(!n)throw new Error("failed to encode header");super.write(n),e.pipe(this)}[K](e){return Mr(e,this.prefix)}[ri](e){return Pr(e,this.type==="Directory",this.portable)}write(e,t,i){typeof t=="function"&&(i=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof t=="string"?t:"utf8"));let s=e.length;if(s>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=s,super.write(e,i)}end(e,t,i){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),typeof e=="function"&&(i=e,t=void 0,e=void 0),typeof t=="function"&&(i=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,t??"utf8")),i&&this.once("finish",i),e?super.end(e,i):super.end(i),this}},Uo=e=>e.isFile()?"File":e.isDirectory()?"Directory":e.isSymbolicLink()?"SymbolicLink":"Unsupported",jo=class je{tail;head;length=0;static create(t=[]){return new je(t)}constructor(t=[]){for(let i of t)this.push(i)}*[Symbol.iterator](){for(let t=this.head;t;t=t.next)yield t.value}removeNode(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");let i=t.next,s=t.prev;return i&&(i.prev=s),s&&(s.next=i),t===this.head&&(this.head=i),t===this.tail&&(this.tail=s),this.length--,t.next=void 0,t.prev=void 0,t.list=void 0,i}unshiftNode(t){if(t===this.head)return;t.list&&t.list.removeNode(t);let i=this.head;t.list=this,t.next=i,i&&(i.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}pushNode(t){if(t===this.tail)return;t.list&&t.list.removeNode(t);let i=this.tail;t.list=this,t.prev=i,i&&(i.next=t),this.tail=t,this.head||(this.head=t),this.length++}push(...t){for(let i=0,s=t.length;i<s;i++)Wo(this,t[i]);return this.length}unshift(...t){for(var i=0,s=t.length;i<s;i++)Go(this,t[i]);return this.length}pop(){if(!this.tail)return;let t=this.tail.value,i=this.tail;return this.tail=this.tail.prev,this.tail?this.tail.next=void 0:this.head=void 0,i.list=void 0,this.length--,t}shift(){if(!this.head)return;let t=this.head.value,i=this.head;return this.head=this.head.next,this.head?this.head.prev=void 0:this.tail=void 0,i.list=void 0,this.length--,t}forEach(t,i){i=i||this;for(let s=this.head,r=0;s;r++)t.call(i,s.value,r,this),s=s.next}forEachReverse(t,i){i=i||this;for(let s=this.tail,r=this.length-1;s;r--)t.call(i,s.value,r,this),s=s.prev}get(t){let i=0,s=this.head;for(;s&&i<t;i++)s=s.next;if(i===t&&s)return s.value}getReverse(t){let i=0,s=this.tail;for(;s&&i<t;i++)s=s.prev;if(i===t&&s)return s.value}map(t,i){i=i||this;let s=new je;for(let r=this.head;r;)s.push(t.call(i,r.value,this)),r=r.next;return s}mapReverse(t,i){i=i||this;var s=new je;for(let r=this.tail;r;)s.push(t.call(i,r.value,this)),r=r.prev;return s}reduce(t,i){let s,r=this.head;if(arguments.length>1)s=i;else if(this.head)r=this.head.next,s=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=0;r;n++)s=t(s,r.value,n),r=r.next;return s}reduceReverse(t,i){let s,r=this.tail;if(arguments.length>1)s=i;else if(this.tail)r=this.tail.prev,s=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(let n=this.length-1;r;n--)s=t(s,r.value,n),r=r.prev;return s}toArray(){let t=new Array(this.length);for(let i=0,s=this.head;s;i++)t[i]=s.value,s=s.next;return t}toArrayReverse(){let t=new Array(this.length);for(let i=0,s=this.tail;s;i++)t[i]=s.value,s=s.prev;return t}slice(t=0,i=this.length){i<0&&(i+=this.length),t<0&&(t+=this.length);let s=new je;if(i<t||i<0)return s;t<0&&(t=0),i>this.length&&(i=this.length);let r=this.head,n=0;for(n=0;r&&n<t;n++)r=r.next;for(;r&&n<i;n++,r=r.next)s.push(r.value);return s}sliceReverse(t=0,i=this.length){i<0&&(i+=this.length),t<0&&(t+=this.length);let s=new je;if(i<t||i<0)return s;t<0&&(t=0),i>this.length&&(i=this.length);let r=this.length,n=this.tail;for(;n&&r>i;r--)n=n.prev;for(;n&&r>t;r--,n=n.prev)s.push(n.value);return s}splice(t,i=0,...s){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);let r=this.head;for(let o=0;r&&o<t;o++)r=r.next;let n=[];for(let o=0;r&&o<i;o++)n.push(r.value),r=this.removeNode(r);r?r!==this.tail&&(r=r.prev):r=this.tail;for(let o of s)r=Vo(this,r,o);return n}reverse(){let t=this.head,i=this.tail;for(let s=t;s;s=s.prev){let r=s.prev;s.prev=s.next,s.next=r}return this.head=i,this.tail=t,this}};function Vo(e,t,i){let s=t,r=t?t.next:e.head,n=new Es(i,s,r,e);return n.next===void 0&&(e.tail=n),n.prev===void 0&&(e.head=n),e.length++,n}function Wo(e,t){e.tail=new Es(t,e.tail,void 0,e),e.head||(e.head=e.tail),e.length++}function Go(e,t){e.head=new Es(t,void 0,e.head,e),e.tail||(e.tail=e.head),e.length++}var Es=class{list;next;prev;value;constructor(e,t,i,s){this.list=s,this.value=e,t?(t.next=this,this.prev=t):this.prev=void 0,i?(i.prev=this,this.next=i):this.next=void 0}},nr=class{path;absolute;entry;stat;readdir;pending=!1;pendingLink=!1;ignore=!1;piped=!1;constructor(e,t){this.path=e||"./",this.absolute=t}},or=Buffer.alloc(1024),Kt=Symbol("onStat"),ot=Symbol("ended"),H=Symbol("queue"),ht=Symbol("pendingLinks"),le=Symbol("current"),Ce=Symbol("process"),at=Symbol("processing"),jt=Symbol("processJob"),z=Symbol("jobs"),Bi=Symbol("jobDone"),Xt=Symbol("addFSEntry"),hr=Symbol("addTarEntry"),rs=Symbol("stat"),ns=Symbol("readdir"),Jt=Symbol("onreaddir"),Qt=Symbol("pipe"),ar=Symbol("entry"),$i=Symbol("entryOpt"),ei=Symbol("writeEntryClass"),$r=Symbol("write"),Hi=Symbol("ondrain"),mi=class extends De{sync=!1;opt;cwd;maxReadSize;preservePaths;strict;noPax;prefix;linkCache;statCache;file;portable;zip;readdirCache;noDirRecurse;follow;noMtime;mtime;filter;jobs;[ei];onWriteEntry;[H];[ht]=new Map;[z]=0;[at]=!1;[ot]=!1;constructor(e={}){if(super(),this.opt=e,this.file=e.file||"",this.cwd=e.cwd||process.cwd(),this.maxReadSize=e.maxReadSize,this.preservePaths=!!e.preservePaths,this.strict=!!e.strict,this.noPax=!!e.noPax,this.prefix=m(e.prefix||""),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this.onWriteEntry=e.onWriteEntry,this[ei]=Br,typeof e.onwarn=="function"&&this.on("warn",e.onwarn),this.portable=!!e.portable,e.gzip||e.brotli||e.zstd){if((e.gzip?1:0)+(e.brotli?1:0)+(e.zstd?1:0)>1)throw new TypeError("gzip, brotli, zstd are mutually exclusive");if(e.gzip&&(typeof e.gzip!="object"&&(e.gzip={}),this.portable&&(e.gzip.portable=!0),this.zip=new Jn(e.gzip)),e.brotli&&(typeof e.brotli!="object"&&(e.brotli={}),this.zip=new eo(e.brotli)),e.zstd&&(typeof e.zstd!="object"&&(e.zstd={}),this.zip=new io(e.zstd)),!this.zip)throw new Error("impossible");let t=this.zip;t.on("data",i=>super.write(i)),t.on("end",()=>super.end()),t.on("drain",()=>this[Hi]()),this.on("resume",()=>t.resume())}else this.on("drain",this[Hi]);this.noDirRecurse=!!e.noDirRecurse,this.follow=!!e.follow,this.noMtime=!!e.noMtime,e.mtime&&(this.mtime=e.mtime),this.filter=typeof e.filter=="function"?e.filter:()=>!0,this[H]=new jo,this[z]=0,this.jobs=Number(e.jobs)||4,this[at]=!1,this[ot]=!1}[$r](e){return super.write(e)}add(e){return this.write(e),this}end(e,t,i){return typeof e=="function"&&(i=e,e=void 0),typeof t=="function"&&(i=t,t=void 0),e&&this.add(e),this[ot]=!0,this[Ce](),i&&i(),this}write(e){if(this[ot])throw new Error("write after end");return typeof e=="string"?this[Xt](e):this[hr](e),this.flowing}[hr](e){let t=m(ss.default.resolve(this.cwd,e.path));if(!this.filter(e.path,e))e.resume();else{let i=new nr(e.path,t);i.entry=new zo(e,this[$i](i)),i.entry.on("end",()=>this[Bi](i)),this[z]+=1,this[H].push(i)}this[Ce]()}[Xt](e){let t=m(ss.default.resolve(this.cwd,e));this[H].push(new nr(e,t)),this[Ce]()}[rs](e){e.pending=!0,this[z]+=1;let t=this.follow?"stat":"lstat";wt.default[t](e.absolute,(i,s)=>{e.pending=!1,this[z]-=1,i?this.emit("error",i):this[Kt](e,s)})}[Kt](e,t){if(this.statCache.set(e.absolute,t),e.stat=t,!this.filter(e.path,t))e.ignore=!0;else if(t.isFile()&&t.nlink>1&&!this.linkCache.get(`${t.dev}:${t.ino}`)&&!this.sync)if(e===this[le])this[jt](e);else{let i=`${t.dev}:${t.ino}`,s=this[ht].get(i);s?s.push(e):this[ht].set(i,[e]),e.pendingLink=!0,e.pending=!0}this[Ce]()}[ns](e){e.pending=!0,this[z]+=1,wt.default.readdir(e.absolute,(t,i)=>{if(e.pending=!1,this[z]-=1,t)return this.emit("error",t);this[Jt](e,i)})}[Jt](e,t){this.readdirCache.set(e.absolute,t),e.readdir=t,this[Ce]()}[Ce](){if(!this[at]){this[at]=!0;for(let e=this[H].head;e&&this[z]<this.jobs;e=e.next)if(this[jt](e.value),e.value.ignore){let t=e.next;this[H].removeNode(e),e.next=t}this[at]=!1,this[ot]&&this[H].length===0&&this[z]===0&&(this.zip?this.zip.end(or):(super.write(or),super.end()))}}get[le](){return this[H]&&this[H].head&&this[H].head.value}[Bi](e){this[H].shift(),this[z]-=1;let{stat:t}=e;if(t&&t.isFile()&&t.nlink>1){let i=`${t.dev}:${t.ino}`,s=this[ht].get(i);if(s){this[ht].delete(i);for(let r of s)r.pending=!1,this[jt](r)}}this[Ce]()}[jt](e){if(e.pending&&e.pendingLink&&e===this[le]&&(e.pending=!1,e.pendingLink=!1),!e.pending){if(e.entry){e===this[le]&&!e.piped&&this[Qt](e);return}if(!e.stat){let t=this.statCache.get(e.absolute);t?this[Kt](e,t):this[rs](e)}if(e.stat&&!e.ignore){if(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir){let t=this.readdirCache.get(e.absolute);if(t?this[Jt](e,t):this[ns](e),!e.readdir)return}if(e.entry=this[ar](e),!e.entry){e.ignore=!0;return}e===this[le]&&!e.piped&&this[Qt](e)}}}[$i](e){return{onwarn:(t,i,s)=>this.warn(t,i,s),noPax:this.noPax,cwd:this.cwd,absolute:e.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix,onWriteEntry:this.onWriteEntry}}[ar](e){this[z]+=1;try{return new this[ei](e.path,this[$i](e)).on("end",()=>this[Bi](e)).on("error",t=>this.emit("error",t))}catch(t){this.emit("error",t)}}[Hi](){this[le]&&this[le].entry&&this[le].entry.resume()}[Qt](e){e.piped=!0,e.readdir&&e.readdir.forEach(s=>{let r=e.path,n=r==="./"?"":r.replace(/\/*$/,"/");this[Xt](n+s)});let t=e.entry,i=this.zip;if(!t)throw new Error("cannot pipe without source");i?t.on("data",s=>{i.write(s)||t.pause()}):t.on("data",s=>{super.write(s)||t.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}warn(e,t,i={}){ui(this,e,t,i)}},Os=class extends mi{sync=!0;constructor(e){super(e),this[ei]=Ho}pause(){}resume(){}[rs](e){let t=this.follow?"statSync":"lstatSync";this[Kt](e,wt.default[t](e.absolute))}[ns](e){this[Jt](e,wt.default.readdirSync(e.absolute))}[Qt](e){let t=e.entry,i=this.zip;if(e.readdir&&e.readdir.forEach(s=>{let r=e.path,n=r==="./"?"":r.replace(/\/*$/,"/");this[Xt](n+s)}),!t)throw new Error("Cannot pipe without source");i?t.on("data",s=>{i.write(s)}):t.on("data",s=>{super[$r](s)})}},Zo=(e,t)=>{let i=new Os(e),s=new vr(e.file,{mode:e.mode||438});i.pipe(s),Hr(i,t)},qo=(e,t)=>{let i=new mi(e),s=new hi(e.file,{mode:e.mode||438});i.pipe(s);let r=new Promise((n,o)=>{s.on("error",o),s.on("close",n),i.on("error",o)});return zr(i,t).catch(n=>i.emit("error",n)),r},Hr=(e,t)=>{t.forEach(i=>{i.charAt(0)==="@"?di({file:fs.default.resolve(e.cwd,i.slice(1)),sync:!0,noResume:!0,onReadEntry:s=>e.add(s)}):e.add(i)}),e.end()},zr=async(e,t)=>{for(let i of t)i.charAt(0)==="@"?await di({file:fs.default.resolve(String(e.cwd),i.slice(1)),noResume:!0,onReadEntry:s=>{e.add(s)}}):e.add(i);e.end()},Yo=(e,t)=>{let i=new Os(e);return Hr(i,t),i},Ko=(e,t)=>{let i=new mi(e);return zr(i,t).catch(s=>i.emit("error",s)),i},ra=Ot(Zo,qo,Yo,Ko,(e,t)=>{if(!t?.length)throw new TypeError("no paths specified to add to archive")}),Xo=process.env.__FAKE_PLATFORM__||process.platform,jr=Xo==="win32",{O_CREAT:Vr,O_NOFOLLOW:lr,O_TRUNC:Wr,O_WRONLY:Gr}=Rs.default.constants,Zr=Number(process.env.__FAKE_FS_O_FILENAME__)||Rs.default.constants.UV_FS_O_FILEMAP||0,Jo=jr&&!!Zr,Qo=512*1024,eh=Zr|Wr|Vr|Gr,ur=!jr&&typeof lr=="number"?lr|Wr|Vr|Gr:null,qr=ur!==null?()=>ur:Jo?e=>e<Qo?eh:"w":()=>"w",os=(e,t,i)=>{try{return vt.default.lchownSync(e,t,i)}catch(s){if(s?.code!=="ENOENT")throw s}},ni=(e,t,i,s)=>{vt.default.lchown(e,t,i,r=>{s(r&&r?.code!=="ENOENT"?r:null)})},th=(e,t,i,s,r)=>{if(t.isDirectory())Yr(We.default.resolve(e,t.name),i,s,n=>{if(n)return r(n);let o=We.default.resolve(e,t.name);ni(o,i,s,r)});else{let n=We.default.resolve(e,t.name);ni(n,i,s,r)}},Yr=(e,t,i,s)=>{vt.default.readdir(e,{withFileTypes:!0},(r,n)=>{if(r){if(r.code==="ENOENT")return s();if(r.code!=="ENOTDIR"&&r.code!=="ENOTSUP")return s(r)}if(r||!n.length)return ni(e,t,i,s);let o=n.length,h=null,a=l=>{if(!h){if(l)return s(h=l);if(--o===0)return ni(e,t,i,s)}};for(let l of n)th(e,l,t,i,a)})},ih=(e,t,i,s)=>{t.isDirectory()&&Kr(We.default.resolve(e,t.name),i,s),os(We.default.resolve(e,t.name),i,s)},Kr=(e,t,i)=>{let s;try{s=vt.default.readdirSync(e,{withFileTypes:!0})}catch(r){let n=r;if(n?.code==="ENOENT")return;if(n?.code==="ENOTDIR"||n?.code==="ENOTSUP")return os(e,t,i);throw n}for(let r of s)ih(e,r,t,i);return os(e,t,i)},Jr=class extends Error{path;code;syscall="chdir";constructor(e,t){super(`${t}: Cannot cd into '${e}'`),this.path=e,this.code=t}get name(){return"CwdError"}},pi=class extends Error{path;symlink;syscall="symlink";code="TAR_SYMLINK_ERROR";constructor(e,t){super("TAR_SYMLINK_ERROR: Cannot extract through symbolic link"),this.symlink=e,this.path=t}get name(){return"SymlinkError"}},sh=(e,t)=>{N.default.stat(e,(i,s)=>{(i||!s.isDirectory())&&(i=new Jr(e,i?.code||"ENOTDIR")),t(i)})},rh=(e,t,i)=>{e=m(e);let s=t.umask??18,r=t.mode|448,n=(r&s)!==0,o=t.uid,h=t.gid,a=typeof o=="number"&&typeof h=="number"&&(o!==t.processUid||h!==t.processGid),l=t.preserve,u=t.unlink,d=m(t.cwd),c=(y,A)=>{y?i(y):A&&a?Yr(A,o,h,Ct=>c(Ct)):n?N.default.chmod(e,r,i):i()};if(e===d)return sh(e,c);if(l)return Xr.default.mkdir(e,{mode:r,recursive:!0}).then(y=>c(null,y??void 0),c);let w=m(Et.default.relative(d,e)).split("/");hs(d,w,r,u,d,void 0,c)},hs=(e,t,i,s,r,n,o)=>{if(t.length===0)return o(null,n);let h=t.shift(),a=m(Et.default.resolve(e+"/"+h));N.default.mkdir(a,i,Qr(a,t,i,s,r,n,o))},Qr=(e,t,i,s,r,n,o)=>h=>{h?N.default.lstat(e,(a,l)=>{if(a)a.path=a.path&&m(a.path),o(a);else if(l.isDirectory())hs(e,t,i,s,r,n,o);else if(s)N.default.unlink(e,u=>{if(u)return o(u);N.default.mkdir(e,i,Qr(e,t,i,s,r,n,o))});else{if(l.isSymbolicLink())return o(new pi(e,e+"/"+t.join("/")));o(h)}}):(n=n||e,hs(e,t,i,s,r,n,o))},nh=e=>{let t=!1,i;try{t=N.default.statSync(e).isDirectory()}catch(s){i=s?.code}finally{if(!t)throw new Jr(e,i??"ENOTDIR")}},oh=(e,t)=>{e=m(e);let i=t.umask??18,s=t.mode|448,r=(s&i)!==0,n=t.uid,o=t.gid,h=typeof n=="number"&&typeof o=="number"&&(n!==t.processUid||o!==t.processGid),a=t.preserve,l=t.unlink,u=m(t.cwd),d=y=>{y&&h&&Kr(y,n,o),r&&N.default.chmodSync(e,s)};if(e===u)return nh(u),d();if(a)return d(N.default.mkdirSync(e,{mode:s,recursive:!0})??void 0);let c=m(Et.default.relative(u,e)).split("/"),w;for(let y=c.shift(),A=u;y&&(A+="/"+y);y=c.shift()){A=m(Et.default.resolve(A));try{N.default.mkdirSync(A,s),w=w||A}catch{let Ct=N.default.lstatSync(A);if(Ct.isDirectory())continue;if(l){N.default.unlinkSync(A),N.default.mkdirSync(A,s),w=w||A;continue}else if(Ct.isSymbolicLink())return new pi(A,A+"/"+c.join("/"))}}return d(w)},zi=Object.create(null),dr=1e4,Be=new Set,hh=e=>{Be.has(e)?Be.delete(e):zi[e]=e.normalize("NFD").toLocaleLowerCase("en").toLocaleUpperCase("en"),Be.add(e);let t=zi[e],i=Be.size-dr;if(i>dr/10){for(let s of Be)if(Be.delete(s),delete zi[s],--i<=0)break}return t},ah=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,lh=ah==="win32",uh=e=>e.split("/").slice(0,-1).reduce((t,i)=>{let s=t.at(-1);return s!==void 0&&(i=(0,Cs.join)(s,i)),t.push(i||"/"),t},[]),dh=class{#e=new Map;#i=new Map;#s=new Set;reserve(e,t){e=lh?["win32 parallelization disabled"]:e.map(s=>mt((0,Cs.join)(hh(s))));let i=new Set(e.map(s=>uh(s)).reduce((s,r)=>s.concat(r)));this.#i.set(t,{dirs:i,paths:e});for(let s of e){let r=this.#e.get(s);r?r.push(t):this.#e.set(s,[t])}for(let s of i){let r=this.#e.get(s);if(!r)this.#e.set(s,[new Set([t])]);else{let n=r.at(-1);n instanceof Set?n.add(t):r.push(new Set([t]))}}return this.#r(t)}#n(e){let t=this.#i.get(e);if(!t)throw new Error("function does not have any path reservations");return{paths:t.paths.map(i=>this.#e.get(i)),dirs:[...t.dirs].map(i=>this.#e.get(i))}}check(e){let{paths:t,dirs:i}=this.#n(e);return t.every(s=>s&&s[0]===e)&&i.every(s=>s&&s[0]instanceof Set&&s[0].has(e))}#r(e){return this.#s.has(e)||!this.check(e)?!1:(this.#s.add(e),e(()=>this.#t(e)),!0)}#t(e){if(!this.#s.has(e))return!1;let t=this.#i.get(e);if(!t)throw new Error("invalid reservation");let{paths:i,dirs:s}=t,r=new Set;for(let n of i){let o=this.#e.get(n);if(!o||o?.[0]!==e)continue;let h=o[1];if(!h){this.#e.delete(n);continue}if(o.shift(),typeof h=="function")r.add(h);else for(let a of h)r.add(a)}for(let n of s){let o=this.#e.get(n),h=o?.[0];if(!(!o||!(h instanceof Set)))if(h.size===1&&o.length===1){this.#e.delete(n);continue}else if(h.size===1){o.shift();let a=o[0];typeof a=="function"&&r.add(a)}else h.delete(e)}return this.#s.delete(e),r.forEach(n=>this.#r(n)),!0}},ch=()=>process.umask(),cr=Symbol("onEntry"),as=Symbol("checkFs"),mr=Symbol("checkFs2"),ls=Symbol("isReusable"),B=Symbol("makeFs"),us=Symbol("file"),ds=Symbol("directory"),ti=Symbol("link"),pr=Symbol("symlink"),fr=Symbol("hardlink"),dt=Symbol("ensureNoSymlink"),gr=Symbol("unsupported"),yr=Symbol("checkPath"),Ui=Symbol("stripAbsolutePath"),fe=Symbol("mkdir"),k=Symbol("onError"),Vt=Symbol("pending"),br=Symbol("pend"),$e=Symbol("unpend"),ji=Symbol("ended"),Vi=Symbol("maybeClose"),cs=Symbol("skip"),pt=Symbol("doChown"),ft=Symbol("uid"),gt=Symbol("gid"),yt=Symbol("checkedCwd"),mh=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,bt=mh==="win32",ph=1024,fh=(e,t)=>{if(!bt)return p.default.unlink(e,t);let i=e+".DELETE."+(0,Ss.randomBytes)(16).toString("hex");p.default.rename(e,i,s=>{if(s)return t(s);p.default.unlink(i,t)})},gh=e=>{if(!bt)return p.default.unlinkSync(e);let t=e+".DELETE."+(0,Ss.randomBytes)(16).toString("hex");p.default.renameSync(e,t),p.default.unlinkSync(t)},_r=(e,t,i)=>e!==void 0&&e===e>>>0?e:t!==void 0&&t===t>>>0?t:i,ks=class extends _t{[ji]=!1;[yt]=!1;[Vt]=0;reservations=new dh;transform;writable=!0;readable=!1;uid;gid;setOwner;preserveOwner;processGid;processUid;maxDepth;forceChown;win32;newer;keep;noMtime;preservePaths;unlink;cwd;strip;processUmask;umask;dmode;fmode;chmod;constructor(e={}){if(e.ondone=()=>{this[ji]=!0,this[Vi]()},super(e),this.transform=e.transform,this.chmod=!!e.chmod,typeof e.uid=="number"||typeof e.gid=="number"){if(typeof e.uid!="number"||typeof e.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(e.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=e.uid,this.gid=e.gid,this.setOwner=!0}else this.uid=void 0,this.gid=void 0,this.setOwner=!1;this.preserveOwner=e.preserveOwner===void 0&&typeof e.uid!="number"?process.getuid?.()===0:!!e.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():void 0,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():void 0,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:ph,this.forceChown=e.forceChown===!0,this.win32=!!e.win32||bt,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=m(v.default.resolve(e.cwd||process.cwd())),this.strip=Number(e.strip)||0,this.processUmask=this.chmod?typeof e.processUmask=="number"?e.processUmask:ch():0,this.umask=typeof e.umask=="number"?e.umask:this.processUmask,this.dmode=e.dmode||511&~this.umask,this.fmode=e.fmode||438&~this.umask,this.on("entry",t=>this[cr](t))}warn(e,t,i={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(i.recoverable=!1),super.warn(e,t,i)}[Vi](){this[ji]&&this[Vt]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[Ui](e,t){let i=e[t],{type:s}=e;if(!i||this.preservePaths)return!0;let[r,n]=_s(i),o=n.replaceAll(/\\/g,"/").split("/");if(o.includes("..")||bt&&/^[a-z]:\.\.$/i.test(o[0]??"")){if(t==="path"||s==="Link")return this.warn("TAR_ENTRY_ERROR",`${t} contains '..'`,{entry:e,[t]:i}),!1;let h=v.default.posix.dirname(e.path),a=v.default.posix.normalize(v.default.posix.join(h,o.join("/")));if(a.startsWith("../")||a==="..")return this.warn("TAR_ENTRY_ERROR",`${t} escapes extraction directory`,{entry:e,[t]:i}),!1}return r&&(e[t]=String(n),this.warn("TAR_ENTRY_INFO",`stripping ${r} from absolute ${t}`,{entry:e,[t]:i})),!0}[yr](e){let t=m(e.path),i=t.split("/");if(this.strip){if(i.length<this.strip)return!1;if(e.type==="Link"){let s=m(String(e.linkpath)).split("/");if(s.length>=this.strip)e.linkpath=s.slice(this.strip).join("/");else return!1}i.splice(0,this.strip),e.path=i.join("/")}if(isFinite(this.maxDepth)&&i.length>this.maxDepth)return this.warn("TAR_ENTRY_ERROR","path excessively deep",{entry:e,path:t,depth:i.length,maxDepth:this.maxDepth}),!1;if(!this[Ui](e,"path")||!this[Ui](e,"linkpath"))return!1;if(e.absolute=v.default.isAbsolute(e.path)?m(v.default.resolve(e.path)):m(v.default.resolve(this.cwd,e.path)),!this.preservePaths&&typeof e.absolute=="string"&&e.absolute.indexOf(this.cwd+"/")!==0&&e.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:e,path:m(e.path),resolvedPath:e.absolute,cwd:this.cwd}),!1;if(e.absolute===this.cwd&&e.type!=="Directory"&&e.type!=="GNUDumpDir")return!1;if(this.win32){let{root:s}=v.default.win32.parse(String(e.absolute));e.absolute=s+er(String(e.absolute).slice(s.length));let{root:r}=v.default.win32.parse(e.path);e.path=r+er(e.path.slice(r.length))}return!0}[cr](e){if(!this[yr](e))return e.resume();switch(Ur.default.equal(typeof e.absolute,"string"),e.type){case"Directory":case"GNUDumpDir":e.mode&&(e.mode=e.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[as](e);default:return this[gr](e)}}[k](e,t){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:t}),this[$e](),t.resume())}[fe](e,t,i){rh(m(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cwd:this.cwd,mode:t},i)}[pt](e){return this.forceChown||this.preserveOwner&&(typeof e.uid=="number"&&e.uid!==this.processUid||typeof e.gid=="number"&&e.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[ft](e){return _r(this.uid,e.uid,this.processUid)}[gt](e){return _r(this.gid,e.gid,this.processGid)}[us](e,t){let i=typeof e.mode=="number"?e.mode&4095:this.fmode,s=new hi(String(e.absolute),{flags:qr(e.size),mode:i,autoClose:!1});s.on("error",h=>{s.fd&&p.default.close(s.fd,()=>{}),s.write=()=>!0,this[k](h,e),t()});let r=1,n=h=>{if(h){s.fd&&p.default.close(s.fd,()=>{}),this[k](h,e),t();return}--r===0&&s.fd!==void 0&&p.default.close(s.fd,a=>{a?this[k](a,e):this[$e](),t()})};s.on("finish",()=>{let h=String(e.absolute),a=s.fd;if(typeof a=="number"&&e.mtime&&!this.noMtime){r++;let l=e.atime||new Date,u=e.mtime;p.default.futimes(a,l,u,d=>d?p.default.utimes(h,l,u,c=>n(c&&d)):n())}if(typeof a=="number"&&this[pt](e)){r++;let l=this[ft](e),u=this[gt](e);typeof l=="number"&&typeof u=="number"&&p.default.fchown(a,l,u,d=>d?p.default.chown(h,l,u,c=>n(c&&d)):n())}n()});let o=this.transform&&this.transform(e)||e;o!==e&&(o.on("error",h=>{this[k](h,e),t()}),e.pipe(o)),o.pipe(s)}[ds](e,t){let i=typeof e.mode=="number"?e.mode&4095:this.dmode;this[fe](String(e.absolute),i,s=>{if(s){this[k](s,e),t();return}let r=1,n=()=>{--r===0&&(t(),this[$e](),e.resume())};e.mtime&&!this.noMtime&&(r++,p.default.utimes(String(e.absolute),e.atime||new Date,e.mtime,n)),this[pt](e)&&(r++,p.default.chown(String(e.absolute),Number(this[ft](e)),Number(this[gt](e)),n)),n()})}[gr](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[pr](e,t){let i=m(v.default.relative(this.cwd,v.default.resolve(v.default.dirname(String(e.absolute)),String(e.linkpath)))).split("/");this[dt](e,this.cwd,i,()=>this[ti](e,String(e.linkpath),"symlink",t),s=>{this[k](s,e),t()})}[fr](e,t){let i=m(v.default.resolve(this.cwd,String(e.linkpath))),s=m(String(e.linkpath)).split("/");this[dt](e,this.cwd,s,()=>this[ti](e,i,"link",t),r=>{this[k](r,e),t()})}[dt](e,t,i,s,r){let n=i.shift();if(this.preservePaths||n===void 0)return s();let o=v.default.resolve(t,n);p.default.lstat(o,(h,a)=>{if(h)return s();if(a?.isSymbolicLink())return r(new pi(o,v.default.resolve(o,i.join("/"))));this[dt](e,o,i,s,r)})}[br](){this[Vt]++}[$e](){this[Vt]--,this[Vi]()}[cs](e){this[$e](),e.resume()}[ls](e,t){return e.type==="File"&&!this.unlink&&t.isFile()&&t.nlink<=1&&!bt}[as](e){this[br]();let t=[e.path];e.linkpath&&t.push(e.linkpath),this.reservations.reserve(t,i=>this[mr](e,i))}[mr](e,t){let i=o=>{t(o)},s=()=>{this[fe](this.cwd,this.dmode,o=>{if(o){this[k](o,e),i();return}this[yt]=!0,r()})},r=()=>{if(e.absolute!==this.cwd){let o=m(v.default.dirname(String(e.absolute)));if(o!==this.cwd)return this[fe](o,this.dmode,h=>{if(h){this[k](h,e),i();return}n()})}n()},n=()=>{p.default.lstat(String(e.absolute),(o,h)=>{if(h&&(this.keep||this.newer&&h.mtime>(e.mtime??h.mtime))){this[cs](e),i();return}if(o||this[ls](e,h))return this[B](null,e,i);if(h.isDirectory()){if(e.type==="Directory"){let a=this.chmod&&e.mode&&(h.mode&4095)!==e.mode,l=u=>this[B](u??null,e,i);return a?p.default.chmod(String(e.absolute),Number(e.mode),l):l()}if(e.absolute!==this.cwd)return p.default.rmdir(String(e.absolute),a=>this[B](a??null,e,i))}if(e.absolute===this.cwd)return this[B](null,e,i);fh(String(e.absolute),a=>this[B](a??null,e,i))})};this[yt]?r():s()}[B](e,t,i){if(e){this[k](e,t),i();return}switch(t.type){case"File":case"OldFile":case"ContiguousFile":return this[us](t,i);case"Link":return this[fr](t,i);case"SymbolicLink":return this[pr](t,i);case"Directory":case"GNUDumpDir":return this[ds](t,i)}}[ti](e,t,i,s){p.default[i](t,String(e.absolute),r=>{r?this[k](r,e):(this[$e](),e.resume()),s()})}},lt=e=>{try{return[null,e()]}catch(t){return[t,null]}},en=class extends ks{sync=!0;[B](e,t){return super[B](e,t,()=>{})}[as](e){if(!this[yt]){let r=this[fe](this.cwd,this.dmode);if(r)return this[k](r,e);this[yt]=!0}if(e.absolute!==this.cwd){let r=m(v.default.dirname(String(e.absolute)));if(r!==this.cwd){let n=this[fe](r,this.dmode);if(n)return this[k](n,e)}}let[t,i]=lt(()=>p.default.lstatSync(String(e.absolute)));if(i&&(this.keep||this.newer&&i.mtime>(e.mtime??i.mtime)))return this[cs](e);if(t||this[ls](e,i))return this[B](null,e);if(i.isDirectory()){if(e.type==="Directory"){let n=this.chmod&&e.mode&&(i.mode&4095)!==e.mode,[o]=n?lt(()=>{p.default.chmodSync(String(e.absolute),Number(e.mode))}):[];return this[B](o,e)}let[r]=lt(()=>p.default.rmdirSync(String(e.absolute)));this[B](r,e)}let[s]=e.absolute===this.cwd?[]:lt(()=>gh(String(e.absolute)));this[B](s,e)}[us](e,t){let i=typeof e.mode=="number"?e.mode&4095:this.fmode,s=o=>{let h;try{p.default.closeSync(r)}catch(a){h=a}(o||h)&&this[k](o||h,e),t()},r;try{r=p.default.openSync(String(e.absolute),qr(e.size),i)}catch(o){return s(o)}let n=this.transform&&this.transform(e)||e;n!==e&&(n.on("error",o=>this[k](o,e)),e.pipe(n)),n.on("data",o=>{try{p.default.writeSync(r,o,0,o.length)}catch(h){s(h)}}),n.on("end",()=>{let o=null;if(e.mtime&&!this.noMtime){let h=e.atime||new Date,a=e.mtime;try{p.default.futimesSync(r,h,a)}catch(l){try{p.default.utimesSync(String(e.absolute),h,a)}catch{o=l}}}if(this[pt](e)){let h=this[ft](e),a=this[gt](e);try{p.default.fchownSync(r,Number(h),Number(a))}catch(l){try{p.default.chownSync(String(e.absolute),Number(h),Number(a))}catch{o=o||l}}}s(o)})}[ds](e,t){let i=typeof e.mode=="number"?e.mode&4095:this.dmode,s=this[fe](String(e.absolute),i);if(s){this[k](s,e),t();return}if(e.mtime&&!this.noMtime)try{p.default.utimesSync(String(e.absolute),e.atime||new Date,e.mtime)}catch{}if(this[pt](e))try{p.default.chownSync(String(e.absolute),Number(this[ft](e)),Number(this[gt](e)))}catch{}t(),e.resume()}[fe](e,t){try{return oh(m(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cwd:this.cwd,mode:t})}catch(i){return i}}[dt](e,t,i,s,r){if(this.preservePaths||i.length===0)return s();let n=t;for(let o of i){n=v.default.resolve(n,o);let[h,a]=lt(()=>p.default.lstatSync(n));if(h)return s();if(a.isSymbolicLink())return r(new pi(n,v.default.resolve(t,i.join("/"))))}s()}[ti](e,t,i,s){let r=`${i}Sync`;try{p.default[r](t,String(e.absolute)),s(),e.resume()}catch(n){return this[k](n,e)}}},yh=e=>{let t=new en(e),i=e.file,s=vs.default.statSync(i),r=e.maxReadSize||16*1024*1024;new zn(i,{readSize:r,size:s.size}).pipe(t)},bh=(e,t)=>{let i=new ks(e),s=e.maxReadSize||16*1024*1024,r=e.file;return new Promise((n,o)=>{i.on("error",o),i.on("close",n),vs.default.stat(r,(h,a)=>{if(h)o(h);else{let l=new ps(r,{readSize:s,size:a.size});l.on("error",o),l.pipe(i)}})})},tn=Ot(yh,bh,e=>new en(e),e=>new ks(e),(e,t)=>{t?.length&&Nr(e,t)}),_h=(e,t)=>{let i=new Os(e),s=!0,r,n;try{try{r=I.default.openSync(e.file,"r+")}catch(a){if(a?.code==="ENOENT")r=I.default.openSync(e.file,"w+");else throw a}let o=I.default.fstatSync(r),h=Buffer.alloc(512);e:for(n=0;n<o.size;n+=512){for(let u=0,d=0;u<512;u+=d){if(d=I.default.readSync(r,h,u,h.length-u,n+u),n===0&&h[0]===31&&h[1]===139)throw new Error("cannot append to compressed archives");if(!d)break e}let a=new Le(h);if(!a.cksumValid)break;let l=512*Math.ceil((a.size||0)/512);if(n+l+512>o.size)break;n+=l,e.mtimeCache&&a.mtime&&e.mtimeCache.set(String(a.path),a.mtime)}s=!1,wh(e,i,n,r,t)}finally{if(s)try{I.default.closeSync(r)}catch{}}},wh=(e,t,i,s,r)=>{let n=new vr(e.file,{fd:s,start:i});t.pipe(n),Oh(t,r)},Eh=(e,t)=>{t=Array.from(t);let i=new mi(e),s=(r,n,o)=>{let h=(c,w)=>{c?I.default.close(r,y=>o(c)):o(null,w)},a=0;if(n===0)return h(null,0);let l=0,u=Buffer.alloc(512),d=(c,w)=>{if(c||w===void 0)return h(c);if(l+=w,l<512&&w)return I.default.read(r,u,l,u.length-l,a+l,d);if(a===0&&u[0]===31&&u[1]===139)return h(new Error("cannot append to compressed archives"));if(l<512)return h(null,a);let y=new Le(u);if(!y.cksumValid)return h(null,a);let A=512*Math.ceil((y.size??0)/512);if(a+A+512>n||(a+=A+512,a>=n))return h(null,a);e.mtimeCache&&y.mtime&&e.mtimeCache.set(String(y.path),y.mtime),l=0,I.default.read(r,u,0,512,a,d)};I.default.read(r,u,0,512,a,d)};return new Promise((r,n)=>{i.on("error",n);let o="r+",h=(a,l)=>{if(a&&a.code==="ENOENT"&&o==="r+")return o="w+",I.default.open(e.file,o,h);if(a||!l)return n(a);I.default.fstat(l,(u,d)=>{if(u)return I.default.close(l,()=>n(u));s(l,d.size,(c,w)=>{if(c)return n(c);let y=new hi(e.file,{fd:l,start:w});i.pipe(y),y.on("error",n),y.on("close",r),vh(i,t)})})};I.default.open(e.file,o,h)})},Oh=(e,t)=>{t.forEach(i=>{i.charAt(0)==="@"?di({file:xs.default.resolve(e.cwd,i.slice(1)),sync:!0,noResume:!0,onReadEntry:s=>e.add(s)}):e.add(i)}),e.end()},vh=async(e,t)=>{for(let i of t)i.charAt(0)==="@"?await di({file:xs.default.resolve(String(e.cwd),i.slice(1)),noResume:!0,onReadEntry:s=>e.add(s)}):e.add(i);e.end()},ut=Ot(_h,Eh,()=>{throw new TypeError("file is required")},()=>{throw new TypeError("file is required")},(e,t)=>{if(!Zn(e))throw new TypeError("file is required");if(e.gzip||e.brotli||e.zstd||e.file.endsWith(".br")||e.file.endsWith(".tbr"))throw new TypeError("cannot append to compressed archives");if(!t?.length)throw new TypeError("no paths specified to add/replace")}),na=Ot(ut.syncFile,ut.asyncFile,ut.syncNoFile,ut.asyncNoFile,(e,t=[])=>{ut.validate?.(e,t),Sh(e)}),Sh=e=>{let t=e.filter;e.mtimeCache||(e.mtimeCache=new Map),e.filter=t?(i,s)=>t(i,s)&&!((e.mtimeCache?.get(i)??s.mtime??0)>(s.mtime??0)):(i,s)=>!((e.mtimeCache?.get(i)??s.mtime??0)>(s.mtime??0))};var an=f(nn()),Lh=!!process.stdout.isTTY&&!("NO_COLOR"in process.env),As=e=>t=>Lh?`\x1B[${e}m${t}\x1B[39m`:t,x={cyan:As(36),green:As(32),red:As(31)};async function ln(e,t=3){let i;for(let s=0;s<=t;s++)try{return await e()}catch(r){i=r,s<t&&await new Promise(n=>setTimeout(n,500*(s+1)))}throw i}async function un(e,t){let i=`https://codeload.github.com/${t.owner}/${t.project}/tar.gz/${t.branch||"main"}`,s=await fetch(i);if(!s.ok||!s.body)throw new Error(`Failed to download ${i}: HTTP ${s.status}`);let r=t.subdir?t.subdir.replace(/^\/+|\/+$/g,"").split("/").filter(Boolean):[],n=r.length?`${r.join("/")}/`:"";await(0,hn.pipeline)(on.Readable.fromWeb(s.body),tn({cwd:e,strip:1+r.length,filter:n?o=>{let h=o.indexOf("/");if(h===-1)return!1;let a=o.slice(h+1);return a.startsWith(n)&&a.length>n.length}:void 0}))}function dn(e){let t=(0,an.default)(e);return t.validForNewPackages?{valid:!0}:{valid:!1,problems:[...t.errors||[],...t.warnings||[]]}}async function cn(e){try{return P.readdirSync(e).length===0}catch(t){if(t)return console.log(t),!1}}async function mn(e){try{return await P.promises.access(e,(P.constants||P).W_OK),!0}catch{return!1}}function Ls(e,t={recursive:!0}){return P.promises.mkdir(e,t)}function pn(e){return(0,Ie.execSync)("npm install --no-fund --loglevel error",{stdio:"inherit",cwd:e})}function Dh(){try{return(0,Ie.execSync)("git rev-parse --is-inside-work-tree",{stdio:"ignore"}),!0}catch{}return!1}function fn(e){let t=!1;try{return(0,Ie.execSync)("git --version",{stdio:"ignore"}),Dh()?!1:((0,Ie.execSync)("git init -b main",{stdio:"ignore"}),t=!0,(0,Ie.execSync)("git add -A",{stdio:"ignore"}),(0,Ie.execSync)('git commit -m "Initial commit from Create Amagaki"',{stdio:"ignore"}),!0)}catch{if(t)try{P.rmSync(Ts.default.join(e,".git"),{recursive:!0,force:!0})}catch{}return!1}}function gn(e){let t=new URL(e);if(t.origin!=="https://github.com")throw new Error(`Invalid URL: ${x.red(`"${e}"`)}. Only GitHub repositories are supported. Please use a GitHub URL and try again.`);let i=t.pathname.replace(/^\/+|\/+$/g,"").replace(/\.git$/,"").split("/");if(i.length<2||!i[0]||!i[1])throw new Error(`Unable to parse GitHub details from URL: ${t}`);let s=i[2]==="tree"&&i[3]?i[3]:void 0,r=i[2]==="tree"&&i.length>4?i.slice(4).join("/"):void 0;return{owner:i[0],project:i[1],branch:s,subdir:r}}async function yn(e,t){let i=Ts.default.join(e,"package.json"),s=JSON.parse(P.readFileSync(i,"utf8"));delete s.repository,s.name=t,P.writeFileSync(i,JSON.stringify(s,null,2))}var Rt=f(require("path"));async function bn({sitePath:e,starter:t}){let i=Rt.default.resolve(e);await mn(Rt.default.dirname(i))||(console.error(`Unable to write to "${i}". Check permissions and try again.`),process.exit(1));let s=Rt.default.basename(i);await Ls(i),await cn(i)||(console.error(`The directory "${i}" already exists and is not empty.`),process.exit(1));let r=process.cwd();console.log(`Creating a new \u{1F34A} Amagaki site in ${x.green(i)}.`),await Ls(i),process.chdir(i);try{let o=gn(t);console.log(`Downloading from ${x.cyan(t)}. This might take a few seconds...`),await ln(()=>un(i,o),3)}catch(o){throw new Error(o?.message??o+"")}console.log("Installing dependencies. This might take a few minutes..."),pn(i),yn(i,s),console.log(),fn(i)&&(console.log("Initialized a Git repository."),console.log());let n=Rt.default.join(r,s)===e?s:e;console.log(`${x.green("\u{1F34A} Success!")} Created ${s} at ${e}`),console.log("From that directory, you can run:"),console.log(),console.log(x.cyan(" npm run dev")),console.log(" Starts the development server."),console.log(),console.log(x.cyan(" npm run build")),console.log(" Builds the static site for production."),console.log(),console.log("Get started by typing:"),console.log(),console.log(x.cyan(" cd"),n),console.log(x.cyan(" npm run dev")),console.log()}var Ds={name:"create-amagaki",version:"0.2.0",keywords:["amagaki"],description:"Create Amagaki sites with one command",repository:{type:"git",url:"https://github.com/blinkk/amagaki",directory:"packages/create-amagaki"},license:"MIT",bin:{"create-amagaki":"./dist/index.js"},files:["dist"],scripts:{clean:"rm -rf dist",release:"esbuild ./src/index.ts --bundle --platform=node --target=node22 --minify --outfile=./dist/index.js",build:"npm run release",prepack:"npm run release",prepublish:"npm run release",test:""},devDependencies:{"@types/node":"^22.10.0","@types/validate-npm-package-name":"^4.0.2",commander:"^15.1.0",esbuild:"^0.28.2",tar:"^7.5.23",typescript:"^5.9.3","validate-npm-package-name":"^8.0.0"},engines:{node:">=22.0.0"}};var gi=f(require("path")),_n=f(require("readline"));var re="",fi=new Pe(Ds.name).version(Ds.version).arguments("[project-directory]").usage(`${x.green("<project-directory>")} [options]`).action(e=>{e&&(re=e)}).option("-s, --starter [github-url]","the starter to use for the project","https://github.com/blinkk/amagaki/tree/main/examples/starter").allowUnknownOption().parse(process.argv);function Nh(e){let t=_n.default.createInterface({input:process.stdin,output:process.stdout});return new Promise(i=>{t.question(e,s=>{t.close(),i(s)})})}async function Ph(){if(typeof re=="string"&&(re=re.trim()),!re)for(;!re;){let i=(await Nh("What is the project named? (my-site) ")).trim()||"my-site",s=dn(gi.default.basename(gi.default.resolve(i)));s.valid?re=i:console.error(`Specify another project name. Yours was invalid: ${s.problems[0]}`)}re||(console.log(),console.log("Specify the project directory:"),console.log(` ${x.cyan(fi.name())} ${x.green("<project-directory>")}`),console.log(),console.log("Example:"),console.log(` ${x.cyan(fi.name())} ${x.green("my-site")}`),console.log(),console.log(`Use ${x.cyan(`${fi.name()} --help`)} to see all options.`),process.exit(1));let e=fi.opts();await bn({sitePath:gi.default.resolve(re),starter:e.starter})}Ph().catch(async e=>{console.log(),console.log("Aborting."),e.command?console.log(` ${x.cyan(e.command)} has failed.`):(console.log(x.red("Unexpected error. Please report it at https://github.com/blinkk/amagaki/issues.")),console.log(e)),console.log(),process.exit(1)});