create-zuplo-api 6.67.22 → 6.67.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -69,4 +69,4 @@ var m=p(181);var g=m.Buffer;function copyProps(t,u){for(var p in t){u[p]=t[p]}}i
|
|
|
69
69
|
*
|
|
70
70
|
* Copyright (c) 2015-present, Jon Schlinkert.
|
|
71
71
|
* Released under the MIT License.
|
|
72
|
-
*/const m=p(7311);const toRegexRange=(t,u,p)=>{if(m(t)===false){throw new TypeError("toRegexRange: expected the first argument to be a number")}if(u===void 0||t===u){return String(t)}if(m(u)===false){throw new TypeError("toRegexRange: expected the second argument to be a number.")}let g={relaxZeros:true,...p};if(typeof g.strictZeros==="boolean"){g.relaxZeros=g.strictZeros===false}let y=String(g.relaxZeros);let v=String(g.shorthand);let b=String(g.capture);let w=String(g.wrap);let E=t+":"+u+"="+y+v+b+w;if(toRegexRange.cache.hasOwnProperty(E)){return toRegexRange.cache[E].result}let $=Math.min(t,u);let R=Math.max(t,u);if(Math.abs($-R)===1){let p=t+"|"+u;if(g.capture){return`(${p})`}if(g.wrap===false){return p}return`(?:${p})`}let O=hasPadding(t)||hasPadding(u);let P={min:t,max:u,a:$,b:R};let x=[];let A=[];if(O){P.isPadded=O;P.maxLen=String(P.max).length}if($<0){let t=R<0?Math.abs(R):1;A=splitToPatterns(t,Math.abs($),P,g);$=P.a=0}if(R>=0){x=splitToPatterns($,R,P,g)}P.negatives=A;P.positives=x;P.result=collatePatterns(A,x,g);if(g.capture===true){P.result=`(${P.result})`}else if(g.wrap!==false&&x.length+A.length>1){P.result=`(?:${P.result})`}toRegexRange.cache[E]=P;return P.result};function collatePatterns(t,u,p){let m=filterPatterns(t,u,"-",false,p)||[];let g=filterPatterns(u,t,"",false,p)||[];let y=filterPatterns(t,u,"-?",true,p)||[];let v=m.concat(y).concat(g);return v.join("|")}function splitToRanges(t,u){let p=1;let m=1;let g=countNines(t,p);let y=new Set([u]);while(t<=g&&g<=u){y.add(g);p+=1;g=countNines(t,p)}g=countZeros(u+1,m)-1;while(t<g&&g<=u){y.add(g);m+=1;g=countZeros(u+1,m)-1}y=[...y];y.sort(compare);return y}function rangeToPattern(t,u,p){if(t===u){return{pattern:t,count:[],digits:0}}let m=zip(t,u);let g=m.length;let y="";let v=0;for(let t=0;t<g;t++){let[u,g]=m[t];if(u===g){y+=u}else if(u!=="0"||g!=="9"){y+=toCharacterClass(u,g,p)}else{v++}}if(v){y+=p.shorthand===true?"\\d":"[0-9]"}return{pattern:y,count:[v],digits:g}}function splitToPatterns(t,u,p,m){let g=splitToRanges(t,u);let y=[];let v=t;let b;for(let t=0;t<g.length;t++){let u=g[t];let w=rangeToPattern(String(v),String(u),m);let E="";if(!p.isPadded&&b&&b.pattern===w.pattern){if(b.count.length>1){b.count.pop()}b.count.push(w.count[0]);b.string=b.pattern+toQuantifier(b.count);v=u+1;continue}if(p.isPadded){E=padZeros(u,p,m)}w.string=E+w.pattern+toQuantifier(w.count);y.push(w);v=u+1;b=w}return y}function filterPatterns(t,u,p,m,g){let y=[];for(let g of t){let{string:t}=g;if(!m&&!contains(u,"string",t)){y.push(p+t)}if(m&&contains(u,"string",t)){y.push(p+t)}}return y}function zip(t,u){let p=[];for(let m=0;m<t.length;m++)p.push([t[m],u[m]]);return p}function compare(t,u){return t>u?1:u>t?-1:0}function contains(t,u,p){return t.some((t=>t[u]===p))}function countNines(t,u){return Number(String(t).slice(0,-u)+"9".repeat(u))}function countZeros(t,u){return t-t%Math.pow(10,u)}function toQuantifier(t){let[u=0,p=""]=t;if(p||u>1){return`{${u+(p?","+p:"")}}`}return""}function toCharacterClass(t,u,p){return`[${t}${u-t===1?"":"-"}${u}]`}function hasPadding(t){return/^-?(0+)\d/.test(t)}function padZeros(t,u,p){if(!u.isPadded){return t}let m=Math.abs(u.maxLen-String(t).length);let g=p.relaxZeros!==false;switch(m){case 0:return"";case 1:return g?"0?":"0";case 2:return g?"0{0,2}":"00";default:{return g?`0{0,${m}}`:`0{${m}}`}}}toRegexRange.cache={};toRegexRange.clearCache=()=>toRegexRange.cache={};t.exports=toRegexRange},1083:(t,u,p)=>{const{URL:m}=p(7016);const{join:g}=p(6928);const y=p(9896);const{promisify:v}=p(9023);const{tmpdir:b}=p(857);const w=p(2804);const E=v(y.writeFile);const $=v(y.mkdir);const R=v(y.readFile);const compareVersions=(t,u)=>t.localeCompare(u,"en-US",{numeric:true});const encode=t=>encodeURIComponent(t).replace(/^%40/,"@");const getFile=async(t,u)=>{const p=b();const m=g(p,"update-check");if(!y.existsSync(m)){await $(m)}let v=`${t.name}-${u}.json`;if(t.scope){v=`${t.scope}-${v}`}return g(m,v)};const evaluateCache=async(t,u,p)=>{if(y.existsSync(t)){const m=await R(t,"utf8");const{lastUpdate:g,latest:y}=JSON.parse(m);const v=g+p;if(v>u){return{shouldCheck:false,latest:y}}}return{shouldCheck:true,latest:null}};const updateCache=async(t,u,p)=>{const m=JSON.stringify({latest:u,lastUpdate:p});await E(t,m,"utf8")};const loadPackage=(t,u)=>new Promise(((m,g)=>{const y={host:t.hostname,path:t.pathname,port:t.port,headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"},timeout:2e3};if(u){y.headers.authorization=`${u.type} ${u.token}`}const{get:v}=p(t.protocol==="https:"?5692:8611);v(y,(t=>{const{statusCode:u}=t;if(u!==200){const p=new Error(`Request failed with code ${u}`);p.code=u;g(p);t.resume();return}let p="";t.setEncoding("utf8");t.on("data",(t=>{p+=t}));t.on("end",(()=>{try{const t=JSON.parse(p);m(t)}catch(t){g(t)}}))})).on("error",g).on("timeout",g)}));const getMostRecent=async({full:t,scope:u},g)=>{const y=w(u);const v=new m(t,y);let b=null;try{b=await loadPackage(v)}catch(t){if(t.code&&String(t.code).startsWith(4)){const t=p(373);const u=t(y,{recursive:true});b=await loadPackage(v,u)}else{throw t}}const E=b["dist-tags"][g];if(!E){throw new Error(`Distribution tag ${g} is not available`)}return E};const O={interval:36e5,distTag:"latest"};const getDetails=t=>{const u={full:encode(t)};if(t.includes("/")){const p=t.split("/");u.scope=p[0];u.name=p[1]}else{u.scope=null;u.name=t}return u};t.exports=async(t,u)=>{if(typeof t!=="object"){throw new Error("The first parameter should be your package.json file content")}const p=getDetails(t.name);const m=Date.now();const{distTag:g,interval:y}=Object.assign({},O,u);const v=await getFile(p,g);let b=null;let w=true;({shouldCheck:w,latest:b}=await evaluateCache(v,m,y));if(w){b=await getMostRecent(p,g);await updateCache(v,b,m)}const E=compareVersions(t.version,b);if(E===-1){return{latest:b,fromCache:!w}}return null}},3969:(t,u,p)=>{const m=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys";const g=p(6928);const y=m?";":":";const v=p(6173);const getNotFoundError=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"});const getPathInfo=(t,u)=>{const p=u.colon||y;const g=t.match(/\//)||m&&t.match(/\\/)?[""]:[...m?[process.cwd()]:[],...(u.path||process.env.PATH||"").split(p)];const v=m?u.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"";const b=m?v.split(p):[""];if(m){if(t.indexOf(".")!==-1&&b[0]!=="")b.unshift("")}return{pathEnv:g,pathExt:b,pathExtExe:v}};const which=(t,u,p)=>{if(typeof u==="function"){p=u;u={}}if(!u)u={};const{pathEnv:m,pathExt:y,pathExtExe:b}=getPathInfo(t,u);const w=[];const step=p=>new Promise(((y,v)=>{if(p===m.length)return u.all&&w.length?y(w):v(getNotFoundError(t));const b=m[p];const E=/^".*"$/.test(b)?b.slice(1,-1):b;const $=g.join(E,t);const R=!E&&/^\.[\\\/]/.test(t)?t.slice(0,2)+$:$;y(subStep(R,p,0))}));const subStep=(t,p,m)=>new Promise(((g,E)=>{if(m===y.length)return g(step(p+1));const $=y[m];v(t+$,{pathExt:b},((y,v)=>{if(!y&&v){if(u.all)w.push(t+$);else return g(t+$)}return g(subStep(t,p,m+1))}))}));return p?step(0).then((t=>p(null,t)),p):step(0)};const whichSync=(t,u)=>{u=u||{};const{pathEnv:p,pathExt:m,pathExtExe:y}=getPathInfo(t,u);const b=[];for(let w=0;w<p.length;w++){const E=p[w];const $=/^".*"$/.test(E)?E.slice(1,-1):E;const R=g.join($,t);const O=!$&&/^\.[\\\/]/.test(t)?t.slice(0,2)+R:R;for(let t=0;t<m.length;t++){const p=O+m[t];try{const t=v.sync(p,{pathExt:y});if(t){if(u.all)b.push(p);else return p}}catch(t){}}}if(u.all&&b.length)return b;if(u.nothrow)return null;throw getNotFoundError(t)};t.exports=which;which.sync=whichSync},779:(t,u)=>{"use strict";Object.defineProperty(u,"__esModule",{value:true});u.formatNames=u.fastFormats=u.fullFormats=void 0;function fmtDef(t,u){return{validate:t,compare:u}}u.fullFormats={date:fmtDef(date,compareDate),time:fmtDef(getTime(true),compareTime),"date-time":fmtDef(getDateTime(true),compareDateTime),"iso-time":fmtDef(getTime(),compareIsoTime),"iso-date-time":fmtDef(getDateTime(),compareIsoDateTime),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:uri,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:regex,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:byte,int32:{type:"number",validate:validateInt32},int64:{type:"number",validate:validateInt64},float:{type:"number",validate:validateNumber},double:{type:"number",validate:validateNumber},password:true,binary:true};u.fastFormats={...u.fullFormats,date:fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,compareDate),time:fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,compareTime),"date-time":fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,compareDateTime),"iso-time":fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,compareIsoTime),"iso-date-time":fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,compareIsoDateTime),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};u.formatNames=Object.keys(u.fullFormats);function isLeapYear(t){return t%4===0&&(t%100!==0||t%400===0)}const p=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;const m=[0,31,28,31,30,31,30,31,31,30,31,30,31];function date(t){const u=p.exec(t);if(!u)return false;const g=+u[1];const y=+u[2];const v=+u[3];return y>=1&&y<=12&&v>=1&&v<=(y===2&&isLeapYear(g)?29:m[y])}function compareDate(t,u){if(!(t&&u))return undefined;if(t>u)return 1;if(t<u)return-1;return 0}const g=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function getTime(t){return function time(u){const p=g.exec(u);if(!p)return false;const m=+p[1];const y=+p[2];const v=+p[3];const b=p[4];const w=p[5]==="-"?-1:1;const E=+(p[6]||0);const $=+(p[7]||0);if(E>23||$>59||t&&!b)return false;if(m<=23&&y<=59&&v<60)return true;const R=y-$*w;const O=m-E*w-(R<0?1:0);return(O===23||O===-1)&&(R===59||R===-1)&&v<61}}function compareTime(t,u){if(!(t&&u))return undefined;const p=new Date("2020-01-01T"+t).valueOf();const m=new Date("2020-01-01T"+u).valueOf();if(!(p&&m))return undefined;return p-m}function compareIsoTime(t,u){if(!(t&&u))return undefined;const p=g.exec(t);const m=g.exec(u);if(!(p&&m))return undefined;t=p[1]+p[2]+p[3];u=m[1]+m[2]+m[3];if(t>u)return 1;if(t<u)return-1;return 0}const y=/t|\s/i;function getDateTime(t){const u=getTime(t);return function date_time(t){const p=t.split(y);return p.length===2&&date(p[0])&&u(p[1])}}function compareDateTime(t,u){if(!(t&&u))return undefined;const p=new Date(t).valueOf();const m=new Date(u).valueOf();if(!(p&&m))return undefined;return p-m}function compareIsoDateTime(t,u){if(!(t&&u))return undefined;const[p,m]=t.split(y);const[g,v]=u.split(y);const b=compareDate(p,g);if(b===undefined)return undefined;return b||compareTime(m,v)}const v=/\/|:/;const b=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function uri(t){return v.test(t)&&b.test(t)}const w=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function byte(t){w.lastIndex=0;return w.test(t)}const E=-(2**31);const $=2**31-1;function validateInt32(t){return Number.isInteger(t)&&t<=$&&t>=E}function validateInt64(t){return Number.isInteger(t)}function validateNumber(){return true}const R=/[^\\]\\Z/;function regex(t){if(R.test(t))return false;try{new RegExp(t);return true}catch(t){return false}}},2815:(t,u,p)=>{"use strict";Object.defineProperty(u,"__esModule",{value:true});const m=p(779);const g=p(1284);const y=p(4671);const v=new y.Name("fullFormats");const b=new y.Name("fastFormats");const formatsPlugin=(t,u={keywords:true})=>{if(Array.isArray(u)){addFormats(t,u,m.fullFormats,v);return t}const[p,y]=u.mode==="fast"?[m.fastFormats,b]:[m.fullFormats,v];const w=u.formats||m.formatNames;addFormats(t,w,p,y);if(u.keywords)(0,g.default)(t);return t};formatsPlugin.get=(t,u="full")=>{const p=u==="fast"?m.fastFormats:m.fullFormats;const g=p[t];if(!g)throw new Error(`Unknown format "${t}"`);return g};function addFormats(t,u,p,m){var g;var v;(g=(v=t.opts.code).formats)!==null&&g!==void 0?g:v.formats=(0,y._)`require("ajv-formats/dist/formats").${m}`;for(const m of u)t.addFormat(m,p[m])}t.exports=u=formatsPlugin;Object.defineProperty(u,"__esModule",{value:true});u["default"]=formatsPlugin},1284:(t,u,p)=>{"use strict";Object.defineProperty(u,"__esModule",{value:true});u.formatLimitDefinition=void 0;const m=p(5984);const g=p(4671);const y=g.operators;const v={formatMaximum:{okStr:"<=",ok:y.LTE,fail:y.GT},formatMinimum:{okStr:">=",ok:y.GTE,fail:y.LT},formatExclusiveMaximum:{okStr:"<",ok:y.LT,fail:y.GTE},formatExclusiveMinimum:{okStr:">",ok:y.GT,fail:y.LTE}};const b={message:({keyword:t,schemaCode:u})=>(0,g.str)`should be ${v[t].okStr} ${u}`,params:({keyword:t,schemaCode:u})=>(0,g._)`{comparison: ${v[t].okStr}, limit: ${u}}`};u.formatLimitDefinition={keyword:Object.keys(v),type:"string",schemaType:"string",$data:true,error:b,code(t){const{gen:u,data:p,schemaCode:y,keyword:b,it:w}=t;const{opts:E,self:$}=w;if(!E.validateFormats)return;const R=new m.KeywordCxt(w,$.RULES.all.format.definition,"format");if(R.$data)validate$DataFormat();else validateFormat();function validate$DataFormat(){const p=u.scopeValue("formats",{ref:$.formats,code:E.code.formats});const m=u.const("fmt",(0,g._)`${p}[${R.schemaCode}]`);t.fail$data((0,g.or)((0,g._)`typeof ${m} != "object"`,(0,g._)`${m} instanceof RegExp`,(0,g._)`typeof ${m}.compare != "function"`,compareCode(m)))}function validateFormat(){const p=R.schema;const m=$.formats[p];if(!m||m===true)return;if(typeof m!="object"||m instanceof RegExp||typeof m.compare!="function"){throw new Error(`"${b}": format "${p}" does not define "compare" function`)}const y=u.scopeValue("formats",{key:p,ref:m,code:E.code.formats?(0,g._)`${E.code.formats}${(0,g.getProperty)(p)}`:undefined});t.fail$data(compareCode(y))}function compareCode(t){return(0,g._)`${t}.compare(${p}, ${y}) ${v[b].fail} 0`}},dependencies:["format"]};const formatLimitPlugin=t=>{t.addKeyword(u.formatLimitDefinition);return t};u["default"]=formatLimitPlugin},6395:(t,u,p)=>{"use strict";const m=p(2040);const g=process.env;Object.defineProperty(u,"_vendors",{value:m.map((function(t){return t.constant}))});u.name=null;u.isPR=null;m.forEach((function(t){const p=Array.isArray(t.env)?t.env:[t.env];const m=p.every((function(t){return checkEnv(t)}));u[t.constant]=m;if(!m){return}u.name=t.name;switch(typeof t.pr){case"string":u.isPR=!!g[t.pr];break;case"object":if("env"in t.pr){u.isPR=t.pr.env in g&&g[t.pr.env]!==t.pr.ne}else if("any"in t.pr){u.isPR=t.pr.any.some((function(t){return!!g[t]}))}else{u.isPR=checkEnv(t.pr)}break;default:u.isPR=null}}));u.isCI=!!(g.CI!=="false"&&(g.BUILD_ID||g.BUILD_NUMBER||g.CI||g.CI_APP_ID||g.CI_BUILD_ID||g.CI_BUILD_NUMBER||g.CI_NAME||g.CONTINUOUS_INTEGRATION||g.RUN_ID||u.name||false));function checkEnv(t){if(typeof t==="string")return!!g[t];if("env"in t){return g[t.env]&&g[t.env].includes(t.includes)}if("any"in t){return t.any.some((function(t){return!!g[t]}))}return Object.keys(t).every((function(u){return g[u]===t[u]}))}},7825:(t,u,p)=>{"use strict";const{builtinModules:m}=p(3339);var g=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$");var y=["node_modules","favicon.ico"];function validate(t){var u=[];var p=[];if(t===null){p.push("name cannot be null");return done(u,p)}if(t===undefined){p.push("name cannot be undefined");return done(u,p)}if(typeof t!=="string"){p.push("name must be a string");return done(u,p)}if(!t.length){p.push("name length must be greater than zero")}if(t.match(/^\./)){p.push("name cannot start with a period")}if(t.match(/^_/)){p.push("name cannot start with an underscore")}if(t.trim()!==t){p.push("name cannot contain leading or trailing spaces")}y.forEach((function(u){if(t.toLowerCase()===u){p.push(u+" is a blacklisted name")}}));if(m.includes(t.toLowerCase())){u.push(t+" is a core module name")}if(t.length>214){u.push("name can no longer contain more than 214 characters")}if(t.toLowerCase()!==t){u.push("name can no longer contain capital letters")}if(/[~'!()*]/.test(t.split("/").slice(-1)[0])){u.push('name can no longer contain special characters ("~\'!()*")')}if(encodeURIComponent(t)!==t){var v=t.match(g);if(v){var b=v[1];var w=v[2];if(encodeURIComponent(b)===b&&encodeURIComponent(w)===w){return done(u,p)}}p.push("name can only contain URL-friendly characters")}return done(u,p)}var done=function(t,u){var p={validForNewPackages:u.length===0&&t.length===0,validForOldPackages:u.length===0,warnings:t,errors:u};if(!p.warnings.length){delete p.warnings}if(!p.errors.length){delete p.errors}return p};t.exports=validate},181:t=>{"use strict";t.exports=require("buffer")},5317:t=>{"use strict";t.exports=require("child_process")},4434:t=>{"use strict";t.exports=require("events")},9896:t=>{"use strict";t.exports=require("fs")},8611:t=>{"use strict";t.exports=require("http")},5692:t=>{"use strict";t.exports=require("https")},3339:t=>{"use strict";t.exports=require("module")},1421:t=>{"use strict";t.exports=require("node:child_process")},8474:t=>{"use strict";t.exports=require("node:events")},3024:t=>{"use strict";t.exports=require("node:fs")},6760:t=>{"use strict";t.exports=require("node:path")},1708:t=>{"use strict";t.exports=require("node:process")},857:t=>{"use strict";t.exports=require("os")},6928:t=>{"use strict";t.exports=require("path")},3785:t=>{"use strict";t.exports=require("readline")},2203:t=>{"use strict";t.exports=require("stream")},2018:t=>{"use strict";t.exports=require("tty")},7016:t=>{"use strict";t.exports=require("url")},9023:t=>{"use strict";t.exports=require("util")},3996:(t,u,p)=>{"use strict";const{normalizeIPv6:m,removeDotSegments:g,recomposeAuthority:y,normalizeComponentEncoding:v,isIPv4:b,nonSimpleDomain:w}=p(9073);const{SCHEMES:E,getSchemeHandler:$}=p(2e3);function normalize(t,u){if(typeof t==="string"){t=serialize(parse(t,u),u)}else if(typeof t==="object"){t=parse(serialize(t,u),u)}return t}function resolve(t,u,p){const m=p?Object.assign({scheme:"null"},p):{scheme:"null"};const g=resolveComponent(parse(t,m),parse(u,m),m,true);m.skipEscape=true;return serialize(g,m)}function resolveComponent(t,u,p,m){const y={};if(!m){t=parse(serialize(t,p),p);u=parse(serialize(u,p),p)}p=p||{};if(!p.tolerant&&u.scheme){y.scheme=u.scheme;y.userinfo=u.userinfo;y.host=u.host;y.port=u.port;y.path=g(u.path||"");y.query=u.query}else{if(u.userinfo!==undefined||u.host!==undefined||u.port!==undefined){y.userinfo=u.userinfo;y.host=u.host;y.port=u.port;y.path=g(u.path||"");y.query=u.query}else{if(!u.path){y.path=t.path;if(u.query!==undefined){y.query=u.query}else{y.query=t.query}}else{if(u.path[0]==="/"){y.path=g(u.path)}else{if((t.userinfo!==undefined||t.host!==undefined||t.port!==undefined)&&!t.path){y.path="/"+u.path}else if(!t.path){y.path=u.path}else{y.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+u.path}y.path=g(y.path)}y.query=u.query}y.userinfo=t.userinfo;y.host=t.host;y.port=t.port}y.scheme=t.scheme}y.fragment=u.fragment;return y}function equal(t,u,p){if(typeof t==="string"){t=unescape(t);t=serialize(v(parse(t,p),true),{...p,skipEscape:true})}else if(typeof t==="object"){t=serialize(v(t,true),{...p,skipEscape:true})}if(typeof u==="string"){u=unescape(u);u=serialize(v(parse(u,p),true),{...p,skipEscape:true})}else if(typeof u==="object"){u=serialize(v(u,true),{...p,skipEscape:true})}return t.toLowerCase()===u.toLowerCase()}function serialize(t,u){const p={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""};const m=Object.assign({},u);const v=[];const b=$(m.scheme||p.scheme);if(b&&b.serialize)b.serialize(p,m);if(p.path!==undefined){if(!m.skipEscape){p.path=escape(p.path);if(p.scheme!==undefined){p.path=p.path.split("%3A").join(":")}}else{p.path=unescape(p.path)}}if(m.reference!=="suffix"&&p.scheme){v.push(p.scheme,":")}const w=y(p);if(w!==undefined){if(m.reference!=="suffix"){v.push("//")}v.push(w);if(p.path&&p.path[0]!=="/"){v.push("/")}}if(p.path!==undefined){let t=p.path;if(!m.absolutePath&&(!b||!b.absolutePath)){t=g(t)}if(w===undefined&&t[0]==="/"&&t[1]==="/"){t="/%2F"+t.slice(2)}v.push(t)}if(p.query!==undefined){v.push("?",p.query)}if(p.fragment!==undefined){v.push("#",p.fragment)}return v.join("")}const R=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function parse(t,u){const p=Object.assign({},u);const g={scheme:undefined,userinfo:undefined,host:"",port:undefined,path:"",query:undefined,fragment:undefined};let y=false;if(p.reference==="suffix"){if(p.scheme){t=p.scheme+":"+t}else{t="//"+t}}const v=t.match(R);if(v){g.scheme=v[1];g.userinfo=v[3];g.host=v[4];g.port=parseInt(v[5],10);g.path=v[6]||"";g.query=v[7];g.fragment=v[8];if(isNaN(g.port)){g.port=v[5]}if(g.host){const t=b(g.host);if(t===false){const t=m(g.host);g.host=t.host.toLowerCase();y=t.isIPV6}else{y=true}}if(g.scheme===undefined&&g.userinfo===undefined&&g.host===undefined&&g.port===undefined&&g.query===undefined&&!g.path){g.reference="same-document"}else if(g.scheme===undefined){g.reference="relative"}else if(g.fragment===undefined){g.reference="absolute"}else{g.reference="uri"}if(p.reference&&p.reference!=="suffix"&&p.reference!==g.reference){g.error=g.error||"URI is not a "+p.reference+" reference."}const u=$(p.scheme||g.scheme);if(!p.unicodeSupport&&(!u||!u.unicodeSupport)){if(g.host&&(p.domainHost||u&&u.domainHost)&&y===false&&w(g.host)){try{g.host=URL.domainToASCII(g.host.toLowerCase())}catch(t){g.error=g.error||"Host's domain name can not be converted to ASCII: "+t}}}if(!u||u&&!u.skipNormalize){if(t.indexOf("%")!==-1){if(g.scheme!==undefined){g.scheme=unescape(g.scheme)}if(g.host!==undefined){g.host=unescape(g.host)}}if(g.path){g.path=escape(unescape(g.path))}if(g.fragment){g.fragment=encodeURI(decodeURIComponent(g.fragment))}}if(u&&u.parse){u.parse(g,p)}}else{g.error=g.error||"URI can not be parsed."}return g}const O={SCHEMES:E,normalize:normalize,resolve:resolve,resolveComponent:resolveComponent,equal:equal,serialize:serialize,parse:parse};t.exports=O;t.exports["default"]=O;t.exports.fastUri=O},2e3:(t,u,p)=>{"use strict";const{isUUID:m}=p(9073);const g=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;const y=["http","https","ws","wss","urn","urn:uuid"];function isValidSchemeName(t){return y.indexOf(t)!==-1}function wsIsSecure(t){if(t.secure===true){return true}else if(t.secure===false){return false}else if(t.scheme){return t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S")}else{return false}}function httpParse(t){if(!t.host){t.error=t.error||"HTTP URIs must have a host."}return t}function httpSerialize(t){const u=String(t.scheme).toLowerCase()==="https";if(t.port===(u?443:80)||t.port===""){t.port=undefined}if(!t.path){t.path="/"}return t}function wsParse(t){t.secure=wsIsSecure(t);t.resourceName=(t.path||"/")+(t.query?"?"+t.query:"");t.path=undefined;t.query=undefined;return t}function wsSerialize(t){if(t.port===(wsIsSecure(t)?443:80)||t.port===""){t.port=undefined}if(typeof t.secure==="boolean"){t.scheme=t.secure?"wss":"ws";t.secure=undefined}if(t.resourceName){const[u,p]=t.resourceName.split("?");t.path=u&&u!=="/"?u:undefined;t.query=p;t.resourceName=undefined}t.fragment=undefined;return t}function urnParse(t,u){if(!t.path){t.error="URN can not be parsed";return t}const p=t.path.match(g);if(p){const m=u.scheme||t.scheme||"urn";t.nid=p[1].toLowerCase();t.nss=p[2];const g=`${m}:${u.nid||t.nid}`;const y=getSchemeHandler(g);t.path=undefined;if(y){t=y.parse(t,u)}}else{t.error=t.error||"URN can not be parsed."}return t}function urnSerialize(t,u){if(t.nid===undefined){throw new Error("URN without nid cannot be serialized")}const p=u.scheme||t.scheme||"urn";const m=t.nid.toLowerCase();const g=`${p}:${u.nid||m}`;const y=getSchemeHandler(g);if(y){t=y.serialize(t,u)}const v=t;const b=t.nss;v.path=`${m||u.nid}:${b}`;u.skipEscape=true;return v}function urnuuidParse(t,u){const p=t;p.uuid=p.nss;p.nss=undefined;if(!u.tolerant&&(!p.uuid||!m(p.uuid))){p.error=p.error||"UUID is not valid."}return p}function urnuuidSerialize(t){const u=t;u.nss=(t.uuid||"").toLowerCase();return u}const v={scheme:"http",domainHost:true,parse:httpParse,serialize:httpSerialize};const b={scheme:"https",domainHost:v.domainHost,parse:httpParse,serialize:httpSerialize};const w={scheme:"ws",domainHost:true,parse:wsParse,serialize:wsSerialize};const E={scheme:"wss",domainHost:w.domainHost,parse:w.parse,serialize:w.serialize};const $={scheme:"urn",parse:urnParse,serialize:urnSerialize,skipNormalize:true};const R={scheme:"urn:uuid",parse:urnuuidParse,serialize:urnuuidSerialize,skipNormalize:true};const O={http:v,https:b,ws:w,wss:E,urn:$,"urn:uuid":R};Object.setPrototypeOf(O,null);function getSchemeHandler(t){return t&&(O[t]||O[t.toLowerCase()])||undefined}t.exports={wsIsSecure:wsIsSecure,SCHEMES:O,isValidSchemeName:isValidSchemeName,getSchemeHandler:getSchemeHandler}},9073:t=>{"use strict";const u=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);const p=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function stringArrayToHexStripped(t){let u="";let p=0;let m=0;for(m=0;m<t.length;m++){p=t[m].charCodeAt(0);if(p===48){continue}if(!(p>=48&&p<=57||p>=65&&p<=70||p>=97&&p<=102)){return""}u+=t[m];break}for(m+=1;m<t.length;m++){p=t[m].charCodeAt(0);if(!(p>=48&&p<=57||p>=65&&p<=70||p>=97&&p<=102)){return""}u+=t[m]}return u}const m=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function consumeIsZone(t){t.length=0;return true}function consumeHextets(t,u,p){if(t.length){const m=stringArrayToHexStripped(t);if(m!==""){u.push(m)}else{p.error=true;return false}t.length=0}return true}function getIPV6(t){let u=0;const p={error:false,address:"",zone:""};const m=[];const g=[];let y=false;let v=false;let b=consumeHextets;for(let w=0;w<t.length;w++){const E=t[w];if(E==="["||E==="]"){continue}if(E===":"){if(y===true){v=true}if(!b(g,m,p)){break}if(++u>7){p.error=true;break}if(w>0&&t[w-1]===":"){y=true}m.push(":");continue}else if(E==="%"){if(!b(g,m,p)){break}b=consumeIsZone}else{g.push(E);continue}}if(g.length){if(b===consumeIsZone){p.zone=g.join("")}else if(v){m.push(g.join(""))}else{m.push(stringArrayToHexStripped(g))}}p.address=m.join("");return p}function normalizeIPv6(t){if(findToken(t,":")<2){return{host:t,isIPV6:false}}const u=getIPV6(t);if(!u.error){let t=u.address;let p=u.address;if(u.zone){t+="%"+u.zone;p+="%25"+u.zone}return{host:t,isIPV6:true,escapedHost:p}}else{return{host:t,isIPV6:false}}}function findToken(t,u){let p=0;for(let m=0;m<t.length;m++){if(t[m]===u)p++}return p}function removeDotSegments(t){let u=t;const p=[];let m=-1;let g=0;while(g=u.length){if(g===1){if(u==="."){break}else if(u==="/"){p.push("/");break}else{p.push(u);break}}else if(g===2){if(u[0]==="."){if(u[1]==="."){break}else if(u[1]==="/"){u=u.slice(2);continue}}else if(u[0]==="/"){if(u[1]==="."||u[1]==="/"){p.push("/");break}}}else if(g===3){if(u==="/.."){if(p.length!==0){p.pop()}p.push("/");break}}if(u[0]==="."){if(u[1]==="."){if(u[2]==="/"){u=u.slice(3);continue}}else if(u[1]==="/"){u=u.slice(2);continue}}else if(u[0]==="/"){if(u[1]==="."){if(u[2]==="/"){u=u.slice(2);continue}else if(u[2]==="."){if(u[3]==="/"){u=u.slice(3);if(p.length!==0){p.pop()}continue}}}}if((m=u.indexOf("/",1))===-1){p.push(u);break}else{p.push(u.slice(0,m));u=u.slice(m)}}return p.join("")}function normalizeComponentEncoding(t,u){const p=u!==true?escape:unescape;if(t.scheme!==undefined){t.scheme=p(t.scheme)}if(t.userinfo!==undefined){t.userinfo=p(t.userinfo)}if(t.host!==undefined){t.host=p(t.host)}if(t.path!==undefined){t.path=p(t.path)}if(t.query!==undefined){t.query=p(t.query)}if(t.fragment!==undefined){t.fragment=p(t.fragment)}return t}function recomposeAuthority(t){const u=[];if(t.userinfo!==undefined){u.push(t.userinfo);u.push("@")}if(t.host!==undefined){let m=unescape(t.host);if(!p(m)){const u=normalizeIPv6(m);if(u.isIPV6===true){m=`[${u.escapedHost}]`}else{m=t.host}}u.push(m)}if(typeof t.port==="number"||typeof t.port==="string"){u.push(":");u.push(String(t.port))}return u.length?u.join(""):undefined}t.exports={nonSimpleDomain:m,recomposeAuthority:recomposeAuthority,normalizeComponentEncoding:normalizeComponentEncoding,removeDotSegments:removeDotSegments,isIPv4:p,isUUID:u,normalizeIPv6:normalizeIPv6,stringArrayToHexStripped:stringArrayToHexStripped}},8909:(t,u,p)=>{const{Argument:m}=p(9154);const{Command:g}=p(4348);const{CommanderError:y,InvalidArgumentError:v}=p(1135);const{Help:b}=p(9754);const{Option:w}=p(5240);u.DM=new g;u.gu=t=>new g(t);u.Ww=(t,u)=>new w(t,u);u.er=(t,u)=>new m(t,u);u.uB=g;u.c$=w;u.ef=m;u._V=b;u.b7=y;u.Di=v;u.a2=v},9154:(t,u,p)=>{const{InvalidArgumentError:m}=p(1135);class Argument{constructor(t,u){this.description=u||"";this.variadic=false;this.parseArg=undefined;this.defaultValue=undefined;this.defaultValueDescription=undefined;this.argChoices=undefined;switch(t[0]){case"<":this.required=true;this._name=t.slice(1,-1);break;case"[":this.required=false;this._name=t.slice(1,-1);break;default:this.required=true;this._name=t;break}if(this._name.length>3&&this._name.slice(-3)==="..."){this.variadic=true;this._name=this._name.slice(0,-3)}}name(){return this._name}_concatValue(t,u){if(u===this.defaultValue||!Array.isArray(u)){return[t]}return u.concat(t)}default(t,u){this.defaultValue=t;this.defaultValueDescription=u;return this}argParser(t){this.parseArg=t;return this}choices(t){this.argChoices=t.slice();this.parseArg=(t,u)=>{if(!this.argChoices.includes(t)){throw new m(`Allowed choices are ${this.argChoices.join(", ")}.`)}if(this.variadic){return this._concatValue(t,u)}return t};return this}argRequired(){this.required=true;return this}argOptional(){this.required=false;return this}}function humanReadableArgName(t){const u=t.name()+(t.variadic===true?"...":"");return t.required?"<"+u+">":"["+u+"]"}u.Argument=Argument;u.humanReadableArgName=humanReadableArgName},4348:(t,u,p)=>{const m=p(8474).EventEmitter;const g=p(1421);const y=p(6760);const v=p(3024);const b=p(1708);const{Argument:w,humanReadableArgName:E}=p(9154);const{CommanderError:$}=p(1135);const{Help:R}=p(9754);const{Option:O,DualOptions:P}=p(5240);const{suggestSimilar:x}=p(5030);class Command extends m{constructor(t){super();this.commands=[];this.options=[];this.parent=null;this._allowUnknownOption=false;this._allowExcessArguments=true;this.registeredArguments=[];this._args=this.registeredArguments;this.args=[];this.rawArgs=[];this.processedArgs=[];this._scriptPath=null;this._name=t||"";this._optionValues={};this._optionValueSources={};this._storeOptionsAsProperties=false;this._actionHandler=null;this._executableHandler=false;this._executableFile=null;this._executableDir=null;this._defaultCommandName=null;this._exitCallback=null;this._aliases=[];this._combineFlagAndOptionalValue=true;this._description="";this._summary="";this._argsDescription=undefined;this._enablePositionalOptions=false;this._passThroughOptions=false;this._lifeCycleHooks={};this._showHelpAfterError=false;this._showSuggestionAfterError=true;this._outputConfiguration={writeOut:t=>b.stdout.write(t),writeErr:t=>b.stderr.write(t),getOutHelpWidth:()=>b.stdout.isTTY?b.stdout.columns:undefined,getErrHelpWidth:()=>b.stderr.isTTY?b.stderr.columns:undefined,outputError:(t,u)=>u(t)};this._hidden=false;this._helpOption=undefined;this._addImplicitHelpCommand=undefined;this._helpCommand=undefined;this._helpConfiguration={}}copyInheritedSettings(t){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;return this}_getCommandAndAncestors(){const t=[];for(let u=this;u;u=u.parent){t.push(u)}return t}command(t,u,p){let m=u;let g=p;if(typeof m==="object"&&m!==null){g=m;m=null}g=g||{};const[,y,v]=t.match(/([^ ]+) *(.*)/);const b=this.createCommand(y);if(m){b.description(m);b._executableHandler=true}if(g.isDefault)this._defaultCommandName=b._name;b._hidden=!!(g.noHelp||g.hidden);b._executableFile=g.executableFile||null;if(v)b.arguments(v);this._registerCommand(b);b.parent=this;b.copyInheritedSettings(this);if(m)return this;return b}createCommand(t){return new Command(t)}createHelp(){return Object.assign(new R,this.configureHelp())}configureHelp(t){if(t===undefined)return this._helpConfiguration;this._helpConfiguration=t;return this}configureOutput(t){if(t===undefined)return this._outputConfiguration;Object.assign(this._outputConfiguration,t);return this}showHelpAfterError(t=true){if(typeof t!=="string")t=!!t;this._showHelpAfterError=t;return this}showSuggestionAfterError(t=true){this._showSuggestionAfterError=!!t;return this}addCommand(t,u){if(!t._name){throw new Error(`Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()`)}u=u||{};if(u.isDefault)this._defaultCommandName=t._name;if(u.noHelp||u.hidden)t._hidden=true;this._registerCommand(t);t.parent=this;t._checkForBrokenPassThrough();return this}createArgument(t,u){return new w(t,u)}argument(t,u,p,m){const g=this.createArgument(t,u);if(typeof p==="function"){g.default(m).argParser(p)}else{g.default(p)}this.addArgument(g);return this}arguments(t){t.trim().split(/ +/).forEach((t=>{this.argument(t)}));return this}addArgument(t){const u=this.registeredArguments.slice(-1)[0];if(u&&u.variadic){throw new Error(`only the last argument can be variadic '${u.name()}'`)}if(t.required&&t.defaultValue!==undefined&&t.parseArg===undefined){throw new Error(`a default value for a required argument is never used: '${t.name()}'`)}this.registeredArguments.push(t);return this}helpCommand(t,u){if(typeof t==="boolean"){this._addImplicitHelpCommand=t;return this}t=t??"help [command]";const[,p,m]=t.match(/([^ ]+) *(.*)/);const g=u??"display help for command";const y=this.createCommand(p);y.helpOption(false);if(m)y.arguments(m);if(g)y.description(g);this._addImplicitHelpCommand=true;this._helpCommand=y;return this}addHelpCommand(t,u){if(typeof t!=="object"){this.helpCommand(t,u);return this}this._addImplicitHelpCommand=true;this._helpCommand=t;return this}_getHelpCommand(){const t=this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"));if(t){if(this._helpCommand===undefined){this.helpCommand(undefined,undefined)}return this._helpCommand}return null}hook(t,u){const p=["preSubcommand","preAction","postAction"];if(!p.includes(t)){throw new Error(`Unexpected value for event passed to hook : '${t}'.\nExpecting one of '${p.join("', '")}'`)}if(this._lifeCycleHooks[t]){this._lifeCycleHooks[t].push(u)}else{this._lifeCycleHooks[t]=[u]}return this}exitOverride(t){if(t){this._exitCallback=t}else{this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync"){throw t}else{}}}return this}_exit(t,u,p){if(this._exitCallback){this._exitCallback(new $(t,u,p))}b.exit(t)}action(t){const listener=u=>{const p=this.registeredArguments.length;const m=u.slice(0,p);if(this._storeOptionsAsProperties){m[p]=this}else{m[p]=this.opts()}m.push(this);return t.apply(this,m)};this._actionHandler=listener;return this}createOption(t,u){return new O(t,u)}_callParseArg(t,u,p,m){try{return t.parseArg(u,p)}catch(t){if(t.code==="commander.invalidArgument"){const u=`${m} ${t.message}`;this.error(u,{exitCode:t.exitCode,code:t.code})}throw t}}_registerOption(t){const u=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(u){const p=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 '${p}'\n- already used by option '${u.flags}'`)}this.options.push(t)}_registerCommand(t){const knownBy=t=>[t.name()].concat(t.aliases());const u=knownBy(t).find((t=>this._findCommand(t)));if(u){const p=knownBy(this._findCommand(u)).join("|");const m=knownBy(t).join("|");throw new Error(`cannot add command '${m}' as already have command '${p}'`)}this.commands.push(t)}addOption(t){this._registerOption(t);const u=t.name();const p=t.attributeName();if(t.negate){const u=t.long.replace(/^--no-/,"--");if(!this._findOption(u)){this.setOptionValueWithSource(p,t.defaultValue===undefined?true:t.defaultValue,"default")}}else if(t.defaultValue!==undefined){this.setOptionValueWithSource(p,t.defaultValue,"default")}const handleOptionValue=(u,m,g)=>{if(u==null&&t.presetArg!==undefined){u=t.presetArg}const y=this.getOptionValue(p);if(u!==null&&t.parseArg){u=this._callParseArg(t,u,y,m)}else if(u!==null&&t.variadic){u=t._concatValue(u,y)}if(u==null){if(t.negate){u=false}else if(t.isBoolean()||t.optional){u=true}else{u=""}}this.setOptionValueWithSource(p,u,g)};this.on("option:"+u,(u=>{const p=`error: option '${t.flags}' argument '${u}' is invalid.`;handleOptionValue(u,p,"cli")}));if(t.envVar){this.on("optionEnv:"+u,(u=>{const p=`error: option '${t.flags}' value '${u}' from env '${t.envVar}' is invalid.`;handleOptionValue(u,p,"env")}))}return this}_optionEx(t,u,p,m,g){if(typeof u==="object"&&u instanceof O){throw new Error("To add an Option object use addOption() instead of option() or requiredOption()")}const y=this.createOption(u,p);y.makeOptionMandatory(!!t.mandatory);if(typeof m==="function"){y.default(g).argParser(m)}else if(m instanceof RegExp){const t=m;m=(u,p)=>{const m=t.exec(u);return m?m[0]:p};y.default(g).argParser(m)}else{y.default(m)}return this.addOption(y)}option(t,u,p,m){return this._optionEx({},t,u,p,m)}requiredOption(t,u,p,m){return this._optionEx({mandatory:true},t,u,p,m)}combineFlagAndOptionalValue(t=true){this._combineFlagAndOptionalValue=!!t;return this}allowUnknownOption(t=true){this._allowUnknownOption=!!t;return this}allowExcessArguments(t=true){this._allowExcessArguments=!!t;return this}enablePositionalOptions(t=true){this._enablePositionalOptions=!!t;return this}passThroughOptions(t=true){this._passThroughOptions=!!t;this._checkForBrokenPassThrough();return 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=true){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")}this._storeOptionsAsProperties=!!t;return this}getOptionValue(t){if(this._storeOptionsAsProperties){return this[t]}return this._optionValues[t]}setOptionValue(t,u){return this.setOptionValueWithSource(t,u,undefined)}setOptionValueWithSource(t,u,p){if(this._storeOptionsAsProperties){this[t]=u}else{this._optionValues[t]=u}this._optionValueSources[t]=p;return this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let u;this._getCommandAndAncestors().forEach((p=>{if(p.getOptionValueSource(t)!==undefined){u=p.getOptionValueSource(t)}}));return u}_prepareUserArgs(t,u){if(t!==undefined&&!Array.isArray(t)){throw new Error("first parameter to parse must be array or undefined")}u=u||{};if(t===undefined&&u.from===undefined){if(b.versions?.electron){u.from="electron"}const t=b.execArgv??[];if(t.includes("-e")||t.includes("--eval")||t.includes("-p")||t.includes("--print")){u.from="eval"}}if(t===undefined){t=b.argv}this.rawArgs=t.slice();let p;switch(u.from){case undefined:case"node":this._scriptPath=t[1];p=t.slice(2);break;case"electron":if(b.defaultApp){this._scriptPath=t[1];p=t.slice(2)}else{p=t.slice(1)}break;case"user":p=t.slice(0);break;case"eval":p=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${u.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);this._name=this._name||"program";return p}parse(t,u){const p=this._prepareUserArgs(t,u);this._parseCommand([],p);return this}async parseAsync(t,u){const p=this._prepareUserArgs(t,u);await this._parseCommand([],p);return this}_executeSubCommand(t,u){u=u.slice();let p=false;const m=[".js",".ts",".tsx",".mjs",".cjs"];function findFile(t,u){const p=y.resolve(t,u);if(v.existsSync(p))return p;if(m.includes(y.extname(u)))return undefined;const g=m.find((t=>v.existsSync(`${p}${t}`)));if(g)return`${p}${g}`;return undefined}this._checkForMissingMandatoryOptions();this._checkForConflictingOptions();let w=t._executableFile||`${this._name}-${t._name}`;let E=this._executableDir||"";if(this._scriptPath){let t;try{t=v.realpathSync(this._scriptPath)}catch(u){t=this._scriptPath}E=y.resolve(y.dirname(t),E)}if(E){let u=findFile(E,w);if(!u&&!t._executableFile&&this._scriptPath){const p=y.basename(this._scriptPath,y.extname(this._scriptPath));if(p!==this._name){u=findFile(E,`${p}-${t._name}`)}}w=u||w}p=m.includes(y.extname(w));let R;if(b.platform!=="win32"){if(p){u.unshift(w);u=incrementNodeInspectorPort(b.execArgv).concat(u);R=g.spawn(b.argv[0],u,{stdio:"inherit"})}else{R=g.spawn(w,u,{stdio:"inherit"})}}else{u.unshift(w);u=incrementNodeInspectorPort(b.execArgv).concat(u);R=g.spawn(b.execPath,u,{stdio:"inherit"})}if(!R.killed){const t=["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"];t.forEach((t=>{b.on(t,(()=>{if(R.killed===false&&R.exitCode===null){R.kill(t)}}))}))}const O=this._exitCallback;R.on("close",(t=>{t=t??1;if(!O){b.exit(t)}else{O(new $(t,"commander.executeSubCommandAsync","(close)"))}}));R.on("error",(u=>{if(u.code==="ENOENT"){const u=E?`searched for local subcommand relative to directory '${E}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory";const p=`'${w}' does not exist\n - if '${t._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${u}`;throw new Error(p)}else if(u.code==="EACCES"){throw new Error(`'${w}' not executable`)}if(!O){b.exit(1)}else{const t=new $(1,"commander.executeSubCommandAsync","(error)");t.nestedError=u;O(t)}}));this.runningCommand=R}_dispatchSubcommand(t,u,p){const m=this._findCommand(t);if(!m)this.help({error:true});let g;g=this._chainOrCallSubCommandHook(g,m,"preSubcommand");g=this._chainOrCall(g,(()=>{if(m._executableHandler){this._executeSubCommand(m,u.concat(p))}else{return m._parseCommand(u,p)}}));return g}_dispatchHelpCommand(t){if(!t){this.help()}const u=this._findCommand(t);if(u&&!u._executableHandler){u.help()}return this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach(((t,u)=>{if(t.required&&this.args[u]==null){this.missingArgument(t.name())}}));if(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic){return}if(this.args.length>this.registeredArguments.length){this._excessArguments(this.args)}}_processArguments(){const myParseArg=(t,u,p)=>{let m=u;if(u!==null&&t.parseArg){const g=`error: command-argument value '${u}' is invalid for argument '${t.name()}'.`;m=this._callParseArg(t,u,p,g)}return m};this._checkNumberOfArguments();const t=[];this.registeredArguments.forEach(((u,p)=>{let m=u.defaultValue;if(u.variadic){if(p<this.args.length){m=this.args.slice(p);if(u.parseArg){m=m.reduce(((t,p)=>myParseArg(u,p,t)),u.defaultValue)}}else if(m===undefined){m=[]}}else if(p<this.args.length){m=this.args[p];if(u.parseArg){m=myParseArg(u,m,u.defaultValue)}}t[p]=m}));this.processedArgs=t}_chainOrCall(t,u){if(t&&t.then&&typeof t.then==="function"){return t.then((()=>u()))}return u()}_chainOrCallHooks(t,u){let p=t;const m=[];this._getCommandAndAncestors().reverse().filter((t=>t._lifeCycleHooks[u]!==undefined)).forEach((t=>{t._lifeCycleHooks[u].forEach((u=>{m.push({hookedCommand:t,callback:u})}))}));if(u==="postAction"){m.reverse()}m.forEach((t=>{p=this._chainOrCall(p,(()=>t.callback(t.hookedCommand,this)))}));return p}_chainOrCallSubCommandHook(t,u,p){let m=t;if(this._lifeCycleHooks[p]!==undefined){this._lifeCycleHooks[p].forEach((t=>{m=this._chainOrCall(m,(()=>t(this,u)))}))}return m}_parseCommand(t,u){const p=this.parseOptions(u);this._parseOptionsEnv();this._parseOptionsImplied();t=t.concat(p.operands);u=p.unknown;this.args=t.concat(u);if(t&&this._findCommand(t[0])){return this._dispatchSubcommand(t[0],t.slice(1),u)}if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name()){return this._dispatchHelpCommand(t[1])}if(this._defaultCommandName){this._outputHelpIfRequested(u);return this._dispatchSubcommand(this._defaultCommandName,t,u)}if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName){this.help({error:true})}this._outputHelpIfRequested(p.unknown);this._checkForMissingMandatoryOptions();this._checkForConflictingOptions();const checkForUnknownOptions=()=>{if(p.unknown.length>0){this.unknownOption(p.unknown[0])}};const m=`command:${this.name()}`;if(this._actionHandler){checkForUnknownOptions();this._processArguments();let p;p=this._chainOrCallHooks(p,"preAction");p=this._chainOrCall(p,(()=>this._actionHandler(this.processedArgs)));if(this.parent){p=this._chainOrCall(p,(()=>{this.parent.emit(m,t,u)}))}p=this._chainOrCallHooks(p,"postAction");return p}if(this.parent&&this.parent.listenerCount(m)){checkForUnknownOptions();this._processArguments();this.parent.emit(m,t,u)}else if(t.length){if(this._findCommand("*")){return this._dispatchSubcommand("*",t,u)}if(this.listenerCount("command:*")){this.emit("command:*",t,u)}else if(this.commands.length){this.unknownCommand()}else{checkForUnknownOptions();this._processArguments()}}else if(this.commands.length){checkForUnknownOptions();this.help({error:true})}else{checkForUnknownOptions();this._processArguments()}}_findCommand(t){if(!t)return undefined;return this.commands.find((u=>u._name===t||u._aliases.includes(t)))}_findOption(t){return this.options.find((u=>u.is(t)))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((t=>{t.options.forEach((u=>{if(u.mandatory&&t.getOptionValue(u.attributeName())===undefined){t.missingMandatoryOptionValue(u)}}))}))}_checkForConflictingLocalOptions(){const t=this.options.filter((t=>{const u=t.attributeName();if(this.getOptionValue(u)===undefined){return false}return this.getOptionValueSource(u)!=="default"}));const u=t.filter((t=>t.conflictsWith.length>0));u.forEach((u=>{const p=t.find((t=>u.conflictsWith.includes(t.attributeName())));if(p){this._conflictingOption(u,p)}}))}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((t=>{t._checkForConflictingLocalOptions()}))}parseOptions(t){const u=[];const p=[];let m=u;const g=t.slice();function maybeOption(t){return t.length>1&&t[0]==="-"}let y=null;while(g.length){const t=g.shift();if(t==="--"){if(m===p)m.push(t);m.push(...g);break}if(y&&!maybeOption(t)){this.emit(`option:${y.name()}`,t);continue}y=null;if(maybeOption(t)){const u=this._findOption(t);if(u){if(u.required){const t=g.shift();if(t===undefined)this.optionMissingArgument(u);this.emit(`option:${u.name()}`,t)}else if(u.optional){let t=null;if(g.length>0&&!maybeOption(g[0])){t=g.shift()}this.emit(`option:${u.name()}`,t)}else{this.emit(`option:${u.name()}`)}y=u.variadic?u:null;continue}}if(t.length>2&&t[0]==="-"&&t[1]!=="-"){const u=this._findOption(`-${t[1]}`);if(u){if(u.required||u.optional&&this._combineFlagAndOptionalValue){this.emit(`option:${u.name()}`,t.slice(2))}else{this.emit(`option:${u.name()}`);g.unshift(`-${t.slice(2)}`)}continue}}if(/^--[^=]+=/.test(t)){const u=t.indexOf("=");const p=this._findOption(t.slice(0,u));if(p&&(p.required||p.optional)){this.emit(`option:${p.name()}`,t.slice(u+1));continue}}if(maybeOption(t)){m=p}if((this._enablePositionalOptions||this._passThroughOptions)&&u.length===0&&p.length===0){if(this._findCommand(t)){u.push(t);if(g.length>0)p.push(...g);break}else if(this._getHelpCommand()&&t===this._getHelpCommand().name()){u.push(t);if(g.length>0)u.push(...g);break}else if(this._defaultCommandName){p.push(t);if(g.length>0)p.push(...g);break}}if(this._passThroughOptions){m.push(t);if(g.length>0)m.push(...g);break}m.push(t)}return{operands:u,unknown:p}}opts(){if(this._storeOptionsAsProperties){const t={};const u=this.options.length;for(let p=0;p<u;p++){const u=this.options[p].attributeName();t[u]=u===this._versionOptionName?this._version:this[u]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce(((t,u)=>Object.assign(t,u.opts())),{})}error(t,u){this._outputConfiguration.outputError(`${t}\n`,this._outputConfiguration.writeErr);if(typeof this._showHelpAfterError==="string"){this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`)}else if(this._showHelpAfterError){this._outputConfiguration.writeErr("\n");this.outputHelp({error:true})}const p=u||{};const m=p.exitCode||1;const g=p.code||"commander.error";this._exit(m,g,t)}_parseOptionsEnv(){this.options.forEach((t=>{if(t.envVar&&t.envVar in b.env){const u=t.attributeName();if(this.getOptionValue(u)===undefined||["default","config","env"].includes(this.getOptionValueSource(u))){if(t.required||t.optional){this.emit(`optionEnv:${t.name()}`,b.env[t.envVar])}else{this.emit(`optionEnv:${t.name()}`)}}}}))}_parseOptionsImplied(){const t=new P(this.options);const hasCustomOptionValue=t=>this.getOptionValue(t)!==undefined&&!["default","implied"].includes(this.getOptionValueSource(t));this.options.filter((u=>u.implied!==undefined&&hasCustomOptionValue(u.attributeName())&&t.valueFromOption(this.getOptionValue(u.attributeName()),u))).forEach((t=>{Object.keys(t.implied).filter((t=>!hasCustomOptionValue(t))).forEach((u=>{this.setOptionValueWithSource(u,t.implied[u],"implied")}))}))}missingArgument(t){const u=`error: missing required argument '${t}'`;this.error(u,{code:"commander.missingArgument"})}optionMissingArgument(t){const u=`error: option '${t.flags}' argument missing`;this.error(u,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){const u=`error: required option '${t.flags}' not specified`;this.error(u,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,u){const findBestOptionFromValue=t=>{const u=t.attributeName();const p=this.getOptionValue(u);const m=this.options.find((t=>t.negate&&u===t.attributeName()));const g=this.options.find((t=>!t.negate&&u===t.attributeName()));if(m&&(m.presetArg===undefined&&p===false||m.presetArg!==undefined&&p===m.presetArg)){return m}return g||t};const getErrorMessage=t=>{const u=findBestOptionFromValue(t);const p=u.attributeName();const m=this.getOptionValueSource(p);if(m==="env"){return`environment variable '${u.envVar}'`}return`option '${u.flags}'`};const p=`error: ${getErrorMessage(t)} cannot be used with ${getErrorMessage(u)}`;this.error(p,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let u="";if(t.startsWith("--")&&this._showSuggestionAfterError){let p=[];let m=this;do{const t=m.createHelp().visibleOptions(m).filter((t=>t.long)).map((t=>t.long));p=p.concat(t);m=m.parent}while(m&&!m._enablePositionalOptions);u=x(t,p)}const p=`error: unknown option '${t}'${u}`;this.error(p,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;const u=this.registeredArguments.length;const p=u===1?"":"s";const m=this.parent?` for '${this.name()}'`:"";const g=`error: too many arguments${m}. Expected ${u} argument${p} but got ${t.length}.`;this.error(g,{code:"commander.excessArguments"})}unknownCommand(){const t=this.args[0];let u="";if(this._showSuggestionAfterError){const p=[];this.createHelp().visibleCommands(this).forEach((t=>{p.push(t.name());if(t.alias())p.push(t.alias())}));u=x(t,p)}const p=`error: unknown command '${t}'${u}`;this.error(p,{code:"commander.unknownCommand"})}version(t,u,p){if(t===undefined)return this._version;this._version=t;u=u||"-V, --version";p=p||"output the version number";const m=this.createOption(u,p);this._versionOptionName=m.attributeName();this._registerOption(m);this.on("option:"+m.name(),(()=>{this._outputConfiguration.writeOut(`${t}\n`);this._exit(0,"commander.version",t)}));return this}description(t,u){if(t===undefined&&u===undefined)return this._description;this._description=t;if(u){this._argsDescription=u}return this}summary(t){if(t===undefined)return this._summary;this._summary=t;return this}alias(t){if(t===undefined)return this._aliases[0];let u=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler){u=this.commands[this.commands.length-1]}if(t===u._name)throw new Error("Command alias can't be the same as its name");const p=this.parent?._findCommand(t);if(p){const u=[p.name()].concat(p.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${u}'`)}u._aliases.push(t);return this}aliases(t){if(t===undefined)return this._aliases;t.forEach((t=>this.alias(t)));return this}usage(t){if(t===undefined){if(this._usage)return this._usage;const t=this.registeredArguments.map((t=>E(t)));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")}this._usage=t;return this}name(t){if(t===undefined)return this._name;this._name=t;return this}nameFromFilename(t){this._name=y.basename(t,y.extname(t));return this}executableDir(t){if(t===undefined)return this._executableDir;this._executableDir=t;return this}helpInformation(t){const u=this.createHelp();if(u.helpWidth===undefined){u.helpWidth=t&&t.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()}return u.formatHelp(this,u)}_getHelpContext(t){t=t||{};const u={error:!!t.error};let p;if(u.error){p=t=>this._outputConfiguration.writeErr(t)}else{p=t=>this._outputConfiguration.writeOut(t)}u.write=t.write||p;u.command=this;return u}outputHelp(t){let u;if(typeof t==="function"){u=t;t=undefined}const p=this._getHelpContext(t);this._getCommandAndAncestors().reverse().forEach((t=>t.emit("beforeAllHelp",p)));this.emit("beforeHelp",p);let m=this.helpInformation(p);if(u){m=u(m);if(typeof m!=="string"&&!Buffer.isBuffer(m)){throw new Error("outputHelp callback must return a string or a Buffer")}}p.write(m);if(this._getHelpOption()?.long){this.emit(this._getHelpOption().long)}this.emit("afterHelp",p);this._getCommandAndAncestors().forEach((t=>t.emit("afterAllHelp",p)))}helpOption(t,u){if(typeof t==="boolean"){if(t){this._helpOption=this._helpOption??undefined}else{this._helpOption=null}return this}t=t??"-h, --help";u=u??"display help for command";this._helpOption=this.createOption(t,u);return this}_getHelpOption(){if(this._helpOption===undefined){this.helpOption(undefined,undefined)}return this._helpOption}addHelpOption(t){this._helpOption=t;return this}help(t){this.outputHelp(t);let u=b.exitCode||0;if(u===0&&t&&typeof t!=="function"&&t.error){u=1}this._exit(u,"commander.help","(outputHelp)")}addHelpText(t,u){const p=["beforeAll","before","after","afterAll"];if(!p.includes(t)){throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${p.join("', '")}'`)}const m=`${t}Help`;this.on(m,(t=>{let p;if(typeof u==="function"){p=u({error:t.error,command:t.command})}else{p=u}if(p){t.write(`${p}\n`)}}));return this}_outputHelpIfRequested(t){const u=this._getHelpOption();const p=u&&t.find((t=>u.is(t)));if(p){this.outputHelp();this._exit(0,"commander.helpDisplayed","(outputHelp)")}}}function incrementNodeInspectorPort(t){return t.map((t=>{if(!t.startsWith("--inspect")){return t}let u;let p="127.0.0.1";let m="9229";let g;if((g=t.match(/^(--inspect(-brk)?)$/))!==null){u=g[1]}else if((g=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null){u=g[1];if(/^\d+$/.test(g[3])){m=g[3]}else{p=g[3]}}else if((g=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null){u=g[1];p=g[3];m=g[4]}if(u&&m!=="0"){return`${u}=${p}:${parseInt(m)+1}`}return t}))}u.Command=Command},1135:(t,u)=>{class CommanderError extends Error{constructor(t,u,p){super(p);Error.captureStackTrace(this,this.constructor);this.name=this.constructor.name;this.code=u;this.exitCode=t;this.nestedError=undefined}}class InvalidArgumentError extends CommanderError{constructor(t){super(1,"commander.invalidArgument",t);Error.captureStackTrace(this,this.constructor);this.name=this.constructor.name}}u.CommanderError=CommanderError;u.InvalidArgumentError=InvalidArgumentError},9754:(t,u,p)=>{const{humanReadableArgName:m}=p(9154);class Help{constructor(){this.helpWidth=undefined;this.sortSubcommands=false;this.sortOptions=false;this.showGlobalOptions=false}visibleCommands(t){const u=t.commands.filter((t=>!t._hidden));const p=t._getHelpCommand();if(p&&!p._hidden){u.push(p)}if(this.sortSubcommands){u.sort(((t,u)=>t.name().localeCompare(u.name())))}return u}compareOptions(t,u){const getSortKey=t=>t.short?t.short.replace(/^-/,""):t.long.replace(/^--/,"");return getSortKey(t).localeCompare(getSortKey(u))}visibleOptions(t){const u=t.options.filter((t=>!t.hidden));const p=t._getHelpOption();if(p&&!p.hidden){const m=p.short&&t._findOption(p.short);const g=p.long&&t._findOption(p.long);if(!m&&!g){u.push(p)}else if(p.long&&!g){u.push(t.createOption(p.long,p.description))}else if(p.short&&!m){u.push(t.createOption(p.short,p.description))}}if(this.sortOptions){u.sort(this.compareOptions)}return u}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];const u=[];for(let p=t.parent;p;p=p.parent){const t=p.options.filter((t=>!t.hidden));u.push(...t)}if(this.sortOptions){u.sort(this.compareOptions)}return u}visibleArguments(t){if(t._argsDescription){t.registeredArguments.forEach((u=>{u.description=u.description||t._argsDescription[u.name()]||""}))}if(t.registeredArguments.find((t=>t.description))){return t.registeredArguments}return[]}subcommandTerm(t){const u=t.registeredArguments.map((t=>m(t))).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(u?" "+u:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,u){return u.visibleCommands(t).reduce(((t,p)=>Math.max(t,u.subcommandTerm(p).length)),0)}longestOptionTermLength(t,u){return u.visibleOptions(t).reduce(((t,p)=>Math.max(t,u.optionTerm(p).length)),0)}longestGlobalOptionTermLength(t,u){return u.visibleGlobalOptions(t).reduce(((t,p)=>Math.max(t,u.optionTerm(p).length)),0)}longestArgumentTermLength(t,u){return u.visibleArguments(t).reduce(((t,p)=>Math.max(t,u.argumentTerm(p).length)),0)}commandUsage(t){let u=t._name;if(t._aliases[0]){u=u+"|"+t._aliases[0]}let p="";for(let u=t.parent;u;u=u.parent){p=u.name()+" "+p}return p+u+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){const u=[];if(t.argChoices){u.push(`choices: ${t.argChoices.map((t=>JSON.stringify(t))).join(", ")}`)}if(t.defaultValue!==undefined){const p=t.required||t.optional||t.isBoolean()&&typeof t.defaultValue==="boolean";if(p){u.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`)}}if(t.presetArg!==undefined&&t.optional){u.push(`preset: ${JSON.stringify(t.presetArg)}`)}if(t.envVar!==undefined){u.push(`env: ${t.envVar}`)}if(u.length>0){return`${t.description} (${u.join(", ")})`}return t.description}argumentDescription(t){const u=[];if(t.argChoices){u.push(`choices: ${t.argChoices.map((t=>JSON.stringify(t))).join(", ")}`)}if(t.defaultValue!==undefined){u.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`)}if(u.length>0){const p=`(${u.join(", ")})`;if(t.description){return`${t.description} ${p}`}return p}return t.description}formatHelp(t,u){const p=u.padWidth(t,u);const m=u.helpWidth||80;const g=2;const y=2;function formatItem(t,v){if(v){const b=`${t.padEnd(p+y)}${v}`;return u.wrap(b,m-g,p+y)}return t}function formatList(t){return t.join("\n").replace(/^/gm," ".repeat(g))}let v=[`Usage: ${u.commandUsage(t)}`,""];const b=u.commandDescription(t);if(b.length>0){v=v.concat([u.wrap(b,m,0),""])}const w=u.visibleArguments(t).map((t=>formatItem(u.argumentTerm(t),u.argumentDescription(t))));if(w.length>0){v=v.concat(["Arguments:",formatList(w),""])}const E=u.visibleOptions(t).map((t=>formatItem(u.optionTerm(t),u.optionDescription(t))));if(E.length>0){v=v.concat(["Options:",formatList(E),""])}if(this.showGlobalOptions){const p=u.visibleGlobalOptions(t).map((t=>formatItem(u.optionTerm(t),u.optionDescription(t))));if(p.length>0){v=v.concat(["Global Options:",formatList(p),""])}}const $=u.visibleCommands(t).map((t=>formatItem(u.subcommandTerm(t),u.subcommandDescription(t))));if($.length>0){v=v.concat(["Commands:",formatList($),""])}return v.join("\n")}padWidth(t,u){return Math.max(u.longestOptionTermLength(t,u),u.longestGlobalOptionTermLength(t,u),u.longestSubcommandTermLength(t,u),u.longestArgumentTermLength(t,u))}wrap(t,u,p,m=40){const g=" \\f\\t\\v - \ufeff";const y=new RegExp(`[\\n][${g}]+`);if(t.match(y))return t;const v=u-p;if(v<m)return t;const b=t.slice(0,p);const w=t.slice(p).replace("\r\n","\n");const E=" ".repeat(p);const $="";const R=`\\s${$}`;const O=new RegExp(`\n|.{1,${v-1}}([${R}]|$)|[^${R}]+?([${R}]|$)`,"g");const P=w.match(O)||[];return b+P.map(((t,u)=>{if(t==="\n")return"";return(u>0?E:"")+t.trimEnd()})).join("\n")}}u.Help=Help},5240:(t,u,p)=>{const{InvalidArgumentError:m}=p(1135);class Option{constructor(t,u){this.flags=t;this.description=u||"";this.required=t.includes("<");this.optional=t.includes("[");this.variadic=/\w\.\.\.[>\]]$/.test(t);this.mandatory=false;const p=splitOptionFlags(t);this.short=p.shortFlag;this.long=p.longFlag;this.negate=false;if(this.long){this.negate=this.long.startsWith("--no-")}this.defaultValue=undefined;this.defaultValueDescription=undefined;this.presetArg=undefined;this.envVar=undefined;this.parseArg=undefined;this.hidden=false;this.argChoices=undefined;this.conflictsWith=[];this.implied=undefined}default(t,u){this.defaultValue=t;this.defaultValueDescription=u;return this}preset(t){this.presetArg=t;return this}conflicts(t){this.conflictsWith=this.conflictsWith.concat(t);return this}implies(t){let u=t;if(typeof t==="string"){u={[t]:true}}this.implied=Object.assign(this.implied||{},u);return this}env(t){this.envVar=t;return this}argParser(t){this.parseArg=t;return this}makeOptionMandatory(t=true){this.mandatory=!!t;return this}hideHelp(t=true){this.hidden=!!t;return this}_concatValue(t,u){if(u===this.defaultValue||!Array.isArray(u)){return[t]}return u.concat(t)}choices(t){this.argChoices=t.slice();this.parseArg=(t,u)=>{if(!this.argChoices.includes(t)){throw new m(`Allowed choices are ${this.argChoices.join(", ")}.`)}if(this.variadic){return this._concatValue(t,u)}return t};return this}name(){if(this.long){return this.long.replace(/^--/,"")}return this.short.replace(/^-/,"")}attributeName(){return camelcase(this.name().replace(/^no-/,""))}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class DualOptions{constructor(t){this.positiveOptions=new Map;this.negativeOptions=new Map;this.dualOptions=new Set;t.forEach((t=>{if(t.negate){this.negativeOptions.set(t.attributeName(),t)}else{this.positiveOptions.set(t.attributeName(),t)}}));this.negativeOptions.forEach(((t,u)=>{if(this.positiveOptions.has(u)){this.dualOptions.add(u)}}))}valueFromOption(t,u){const p=u.attributeName();if(!this.dualOptions.has(p))return true;const m=this.negativeOptions.get(p).presetArg;const g=m!==undefined?m:false;return u.negate===(g===t)}}function camelcase(t){return t.split("-").reduce(((t,u)=>t+u[0].toUpperCase()+u.slice(1)))}function splitOptionFlags(t){let u;let p;const m=t.split(/[ |,]+/);if(m.length>1&&!/^[[<]/.test(m[1]))u=m.shift();p=m.shift();if(!u&&/^-[^-]$/.test(p)){u=p;p=undefined}return{shortFlag:u,longFlag:p}}u.Option=Option;u.DualOptions=DualOptions},5030:(t,u)=>{const p=3;function editDistance(t,u){if(Math.abs(t.length-u.length)>p)return Math.max(t.length,u.length);const m=[];for(let u=0;u<=t.length;u++){m[u]=[u]}for(let t=0;t<=u.length;t++){m[0][t]=t}for(let p=1;p<=u.length;p++){for(let g=1;g<=t.length;g++){let y=1;if(t[g-1]===u[p-1]){y=0}else{y=1}m[g][p]=Math.min(m[g-1][p]+1,m[g][p-1]+1,m[g-1][p-1]+y);if(g>1&&p>1&&t[g-1]===u[p-2]&&t[g-2]===u[p-1]){m[g][p]=Math.min(m[g][p],m[g-2][p-2]+1)}}}return m[t.length][u.length]}function suggestSimilar(t,u){if(!u||u.length===0)return"";u=Array.from(new Set(u));const m=t.startsWith("--");if(m){t=t.slice(2);u=u.map((t=>t.slice(2)))}let g=[];let y=p;const v=.4;u.forEach((u=>{if(u.length<=1)return;const p=editDistance(t,u);const m=Math.max(t.length,u.length);const b=(m-p)/m;if(b>v){if(p<y){y=p;g=[u]}else if(p===y){g.push(u)}}}));g.sort(((t,u)=>t.localeCompare(u)));if(m){g=g.map((t=>`--${t}`))}if(g.length>1){return`\n(Did you mean one of ${g.join(", ")}?)`}if(g.length===1){return`\n(Did you mean ${g[0]}?)`}return""}u.suggestSimilar=suggestSimilar},3770:t=>{"use strict";t.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},13:t=>{"use strict";t.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/applicator","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/applicator":true},"$dynamicAnchor":"meta","title":"Applicator vocabulary meta-schema","type":["object","boolean"],"properties":{"prefixItems":{"$ref":"#/$defs/schemaArray"},"items":{"$dynamicRef":"#meta"},"contains":{"$dynamicRef":"#meta"},"additionalProperties":{"$dynamicRef":"#meta"},"properties":{"type":"object","additionalProperties":{"$dynamicRef":"#meta"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$dynamicRef":"#meta"},"propertyNames":{"format":"regex"},"default":{}},"dependentSchemas":{"type":"object","additionalProperties":{"$dynamicRef":"#meta"},"default":{}},"propertyNames":{"$dynamicRef":"#meta"},"if":{"$dynamicRef":"#meta"},"then":{"$dynamicRef":"#meta"},"else":{"$dynamicRef":"#meta"},"allOf":{"$ref":"#/$defs/schemaArray"},"anyOf":{"$ref":"#/$defs/schemaArray"},"oneOf":{"$ref":"#/$defs/schemaArray"},"not":{"$dynamicRef":"#meta"}},"$defs":{"schemaArray":{"type":"array","minItems":1,"items":{"$dynamicRef":"#meta"}}}}')},2394:t=>{"use strict";t.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/content","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/content":true},"$dynamicAnchor":"meta","title":"Content vocabulary meta-schema","type":["object","boolean"],"properties":{"contentEncoding":{"type":"string"},"contentMediaType":{"type":"string"},"contentSchema":{"$dynamicRef":"#meta"}}}')},4771:t=>{"use strict";t.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/core","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/core":true},"$dynamicAnchor":"meta","title":"Core vocabulary meta-schema","type":["object","boolean"],"properties":{"$id":{"$ref":"#/$defs/uriReferenceString","$comment":"Non-empty fragments not allowed.","pattern":"^[^#]*#?$"},"$schema":{"$ref":"#/$defs/uriString"},"$ref":{"$ref":"#/$defs/uriReferenceString"},"$anchor":{"$ref":"#/$defs/anchorString"},"$dynamicRef":{"$ref":"#/$defs/uriReferenceString"},"$dynamicAnchor":{"$ref":"#/$defs/anchorString"},"$vocabulary":{"type":"object","propertyNames":{"$ref":"#/$defs/uriString"},"additionalProperties":{"type":"boolean"}},"$comment":{"type":"string"},"$defs":{"type":"object","additionalProperties":{"$dynamicRef":"#meta"}}},"$defs":{"anchorString":{"type":"string","pattern":"^[A-Za-z_][-A-Za-z0-9._]*$"},"uriString":{"type":"string","format":"uri"},"uriReferenceString":{"type":"string","format":"uri-reference"}}}')},9567:t=>{"use strict";t.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/format-annotation","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/format-annotation":true},"$dynamicAnchor":"meta","title":"Format vocabulary meta-schema for annotation results","type":["object","boolean"],"properties":{"format":{"type":"string"}}}')},8364:t=>{"use strict";t.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/meta-data","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/meta-data":true},"$dynamicAnchor":"meta","title":"Meta-data vocabulary meta-schema","type":["object","boolean"],"properties":{"title":{"type":"string"},"description":{"type":"string"},"default":true,"deprecated":{"type":"boolean","default":false},"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true}}}')},7388:t=>{"use strict";t.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/unevaluated","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/unevaluated":true},"$dynamicAnchor":"meta","title":"Unevaluated applicator vocabulary meta-schema","type":["object","boolean"],"properties":{"unevaluatedItems":{"$dynamicRef":"#meta"},"unevaluatedProperties":{"$dynamicRef":"#meta"}}}')},2943:t=>{"use strict";t.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/validation","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/validation":true},"$dynamicAnchor":"meta","title":"Validation vocabulary meta-schema","type":["object","boolean"],"properties":{"type":{"anyOf":[{"$ref":"#/$defs/simpleTypes"},{"type":"array","items":{"$ref":"#/$defs/simpleTypes"},"minItems":1,"uniqueItems":true}]},"const":true,"enum":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/$defs/nonNegativeInteger"},"minLength":{"$ref":"#/$defs/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"maxItems":{"$ref":"#/$defs/nonNegativeInteger"},"minItems":{"$ref":"#/$defs/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"maxContains":{"$ref":"#/$defs/nonNegativeInteger"},"minContains":{"$ref":"#/$defs/nonNegativeInteger","default":1},"maxProperties":{"$ref":"#/$defs/nonNegativeInteger"},"minProperties":{"$ref":"#/$defs/nonNegativeIntegerDefault0"},"required":{"$ref":"#/$defs/stringArray"},"dependentRequired":{"type":"object","additionalProperties":{"$ref":"#/$defs/stringArray"}}},"$defs":{"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"$ref":"#/$defs/nonNegativeInteger","default":0},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}}}')},6261:t=>{"use strict";t.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/schema","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/core":true,"https://json-schema.org/draft/2020-12/vocab/applicator":true,"https://json-schema.org/draft/2020-12/vocab/unevaluated":true,"https://json-schema.org/draft/2020-12/vocab/validation":true,"https://json-schema.org/draft/2020-12/vocab/meta-data":true,"https://json-schema.org/draft/2020-12/vocab/format-annotation":true,"https://json-schema.org/draft/2020-12/vocab/content":true},"$dynamicAnchor":"meta","title":"Core and Validation specifications meta-schema","allOf":[{"$ref":"meta/core"},{"$ref":"meta/applicator"},{"$ref":"meta/unevaluated"},{"$ref":"meta/validation"},{"$ref":"meta/meta-data"},{"$ref":"meta/format-annotation"},{"$ref":"meta/content"}],"type":["object","boolean"],"$comment":"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.","properties":{"definitions":{"$comment":"\\"definitions\\" has been replaced by \\"$defs\\".","type":"object","additionalProperties":{"$dynamicRef":"#meta"},"deprecated":true,"default":{}},"dependencies":{"$comment":"\\"dependencies\\" has been split and replaced by \\"dependentSchemas\\" and \\"dependentRequired\\" in order to serve their differing semantics.","type":"object","additionalProperties":{"anyOf":[{"$dynamicRef":"#meta"},{"$ref":"meta/validation#/$defs/stringArray"}]},"deprecated":true,"default":{}},"$recursiveAnchor":{"$comment":"\\"$recursiveAnchor\\" has been replaced by \\"$dynamicAnchor\\".","$ref":"meta/core#/$defs/anchorString","deprecated":true},"$recursiveRef":{"$comment":"\\"$recursiveRef\\" has been replaced by \\"$dynamicRef\\".","$ref":"meta/core#/$defs/uriReferenceString","deprecated":true}}}')},3928:t=>{"use strict";t.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},2040:t=>{"use strict";t.exports=JSON.parse('[{"name":"Agola CI","constant":"AGOLA","env":"AGOLA_GIT_REF","pr":"AGOLA_PULL_REQUEST_ID"},{"name":"Appcircle","constant":"APPCIRCLE","env":"AC_APPCIRCLE"},{"name":"AppVeyor","constant":"APPVEYOR","env":"APPVEYOR","pr":"APPVEYOR_PULL_REQUEST_NUMBER"},{"name":"AWS CodeBuild","constant":"CODEBUILD","env":"CODEBUILD_BUILD_ARN"},{"name":"Azure Pipelines","constant":"AZURE_PIPELINES","env":"TF_BUILD","pr":{"BUILD_REASON":"PullRequest"}},{"name":"Bamboo","constant":"BAMBOO","env":"bamboo_planKey"},{"name":"Bitbucket Pipelines","constant":"BITBUCKET","env":"BITBUCKET_COMMIT","pr":"BITBUCKET_PR_ID"},{"name":"Bitrise","constant":"BITRISE","env":"BITRISE_IO","pr":"BITRISE_PULL_REQUEST"},{"name":"Buddy","constant":"BUDDY","env":"BUDDY_WORKSPACE_ID","pr":"BUDDY_EXECUTION_PULL_REQUEST_ID"},{"name":"Buildkite","constant":"BUILDKITE","env":"BUILDKITE","pr":{"env":"BUILDKITE_PULL_REQUEST","ne":"false"}},{"name":"CircleCI","constant":"CIRCLE","env":"CIRCLECI","pr":"CIRCLE_PULL_REQUEST"},{"name":"Cirrus CI","constant":"CIRRUS","env":"CIRRUS_CI","pr":"CIRRUS_PR"},{"name":"Codefresh","constant":"CODEFRESH","env":"CF_BUILD_ID","pr":{"any":["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{"name":"Codemagic","constant":"CODEMAGIC","env":"CM_BUILD_ID","pr":"CM_PULL_REQUEST"},{"name":"Codeship","constant":"CODESHIP","env":{"CI_NAME":"codeship"}},{"name":"Drone","constant":"DRONE","env":"DRONE","pr":{"DRONE_BUILD_EVENT":"pull_request"}},{"name":"dsari","constant":"DSARI","env":"DSARI"},{"name":"Earthly","constant":"EARTHLY","env":"EARTHLY_CI"},{"name":"Expo Application Services","constant":"EAS","env":"EAS_BUILD"},{"name":"Gerrit","constant":"GERRIT","env":"GERRIT_PROJECT"},{"name":"Gitea Actions","constant":"GITEA_ACTIONS","env":"GITEA_ACTIONS"},{"name":"GitHub Actions","constant":"GITHUB_ACTIONS","env":"GITHUB_ACTIONS","pr":{"GITHUB_EVENT_NAME":"pull_request"}},{"name":"GitLab CI","constant":"GITLAB","env":"GITLAB_CI","pr":"CI_MERGE_REQUEST_ID"},{"name":"GoCD","constant":"GOCD","env":"GO_PIPELINE_LABEL"},{"name":"Google Cloud Build","constant":"GOOGLE_CLOUD_BUILD","env":"BUILDER_OUTPUT"},{"name":"Harness CI","constant":"HARNESS","env":"HARNESS_BUILD_ID"},{"name":"Heroku","constant":"HEROKU","env":{"env":"NODE","includes":"/app/.heroku/node/bin/node"}},{"name":"Hudson","constant":"HUDSON","env":"HUDSON_URL"},{"name":"Jenkins","constant":"JENKINS","env":["JENKINS_URL","BUILD_ID"],"pr":{"any":["ghprbPullId","CHANGE_ID"]}},{"name":"LayerCI","constant":"LAYERCI","env":"LAYERCI","pr":"LAYERCI_PULL_REQUEST"},{"name":"Magnum CI","constant":"MAGNUM","env":"MAGNUM"},{"name":"Netlify CI","constant":"NETLIFY","env":"NETLIFY","pr":{"env":"PULL_REQUEST","ne":"false"}},{"name":"Nevercode","constant":"NEVERCODE","env":"NEVERCODE","pr":{"env":"NEVERCODE_PULL_REQUEST","ne":"false"}},{"name":"Prow","constant":"PROW","env":"PROW_JOB_ID"},{"name":"ReleaseHub","constant":"RELEASEHUB","env":"RELEASE_BUILD_ID"},{"name":"Render","constant":"RENDER","env":"RENDER","pr":{"IS_PULL_REQUEST":"true"}},{"name":"Sail CI","constant":"SAIL","env":"SAILCI","pr":"SAIL_PULL_REQUEST_NUMBER"},{"name":"Screwdriver","constant":"SCREWDRIVER","env":"SCREWDRIVER","pr":{"env":"SD_PULL_REQUEST","ne":"false"}},{"name":"Semaphore","constant":"SEMAPHORE","env":"SEMAPHORE","pr":"PULL_REQUEST_NUMBER"},{"name":"Sourcehut","constant":"SOURCEHUT","env":{"CI_NAME":"sourcehut"}},{"name":"Strider CD","constant":"STRIDER","env":"STRIDER"},{"name":"TaskCluster","constant":"TASKCLUSTER","env":["TASK_ID","RUN_ID"]},{"name":"TeamCity","constant":"TEAMCITY","env":"TEAMCITY_VERSION"},{"name":"Travis CI","constant":"TRAVIS","env":"TRAVIS","pr":{"env":"TRAVIS_PULL_REQUEST","ne":"false"}},{"name":"Vela","constant":"VELA","env":"VELA","pr":{"VELA_PULL_REQUEST":"1"}},{"name":"Vercel","constant":"VERCEL","env":{"any":["NOW_BUILDER","VERCEL"]},"pr":"VERCEL_GIT_PULL_REQUEST_ID"},{"name":"Visual Studio App Center","constant":"APPCENTER","env":"APPCENTER_BUILD_ID"},{"name":"Woodpecker","constant":"WOODPECKER","env":{"CI":"woodpecker"},"pr":{"CI_BUILD_EVENT":"pull_request"}},{"name":"Xcode Cloud","constant":"XCODE_CLOUD","env":"CI_XCODE_PROJECT","pr":"CI_PULL_REQUEST_NUMBER"},{"name":"Xcode Server","constant":"XCODE_SERVER","env":"XCS"}]')}};var u={};function __nccwpck_require__(p){var m=u[p];if(m!==undefined){return m.exports}var g=u[p]={exports:{}};var y=true;try{t[p](g,g.exports,__nccwpck_require__);y=false}finally{if(y)delete u[p]}return g.exports}(()=>{__nccwpck_require__.n=t=>{var u=t&&t.__esModule?()=>t["default"]:()=>t;__nccwpck_require__.d(u,{a:u});return u}})();(()=>{var t=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__;var u;__nccwpck_require__.t=function(p,m){if(m&1)p=this(p);if(m&8)return p;if(typeof p==="object"&&p){if(m&4&&p.__esModule)return p;if(m&16&&typeof p.then==="function")return p}var g=Object.create(null);__nccwpck_require__.r(g);var y={};u=u||[null,t({}),t([]),t(t)];for(var v=m&2&&p;typeof v=="object"&&!~u.indexOf(v);v=t(v)){Object.getOwnPropertyNames(v).forEach((t=>y[t]=()=>p[t]))}y["default"]=()=>p;__nccwpck_require__.d(g,y);return g}})();(()=>{__nccwpck_require__.d=(t,u)=>{for(var p in u){if(__nccwpck_require__.o(u,p)&&!__nccwpck_require__.o(t,p)){Object.defineProperty(t,p,{enumerable:true,get:u[p]})}}}})();(()=>{__nccwpck_require__.o=(t,u)=>Object.prototype.hasOwnProperty.call(t,u)})();(()=>{__nccwpck_require__.r=t=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(t,"__esModule",{value:true})}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var p={};(()=>{"use strict";var t=__nccwpck_require__(6395);var u=__nccwpck_require__.n(t);var p=__nccwpck_require__(8909);const{DM:m,gu:g,er:y,Ww:v,b7:b,Di:w,a2:E,uB:$,ef:R,c$:O,_V:P}=p;const x=require("node:util");var A=__nccwpck_require__(1708);var T=__nccwpck_require__(3024);var k=__nccwpck_require__(6760);const C=require("node:crypto");const I=require("node:assert");const isObject=t=>{const u=typeof t;return t!==null&&(u==="object"||u==="function")};const isEmptyObject=t=>isObject(t)&&Object.keys(t).length===0;const N=new Set(["__proto__","prototype","constructor"]);const D=new Set("0123456789");function getPathSegments(t){const u=[];let p="";let m="start";let g=false;for(const y of t){switch(y){case"\\":{if(m==="index"){throw new Error("Invalid character in an index")}if(m==="indexEnd"){throw new Error("Invalid character after an index")}if(g){p+=y}m="property";g=!g;break}case".":{if(m==="index"){throw new Error("Invalid character in an index")}if(m==="indexEnd"){m="property";break}if(g){g=false;p+=y;break}if(N.has(p)){return[]}u.push(p);p="";m="property";break}case"[":{if(m==="index"){throw new Error("Invalid character in an index")}if(m==="indexEnd"){m="index";break}if(g){g=false;p+=y;break}if(m==="property"){if(N.has(p)){return[]}u.push(p);p=""}m="index";break}case"]":{if(m==="index"){u.push(Number.parseInt(p,10));p="";m="indexEnd";break}if(m==="indexEnd"){throw new Error("Invalid character after an index")}}default:{if(m==="index"&&!D.has(y)){throw new Error("Invalid character in an index")}if(m==="indexEnd"){throw new Error("Invalid character after an index")}if(m==="start"){m="property"}if(g){g=false;p+="\\"}p+=y}}}if(g){p+="\\"}switch(m){case"property":{if(N.has(p)){return[]}u.push(p);break}case"index":{throw new Error("Index was not closed")}case"start":{u.push("");break}}return u}function isStringIndex(t,u){if(typeof u!=="number"&&Array.isArray(t)){const p=Number.parseInt(u,10);return Number.isInteger(p)&&t[p]===t[u]}return false}function assertNotStringIndex(t,u){if(isStringIndex(t,u)){throw new Error("Cannot use string index")}}function getProperty(t,u,p){if(!isObject(t)||typeof u!=="string"){return p===undefined?t:p}const m=getPathSegments(u);if(m.length===0){return p}for(let u=0;u<m.length;u++){const g=m[u];if(isStringIndex(t,g)){t=u===m.length-1?undefined:null}else{t=t[g]}if(t===undefined||t===null){if(u!==m.length-1){return p}break}}return t===undefined?p:t}function setProperty(t,u,p){if(!isObject(t)||typeof u!=="string"){return t}const m=t;const g=getPathSegments(u);for(let u=0;u<g.length;u++){const m=g[u];assertNotStringIndex(t,m);if(u===g.length-1){t[m]=p}else if(!isObject(t[m])){t[m]=typeof g[u+1]==="number"?[]:{}}t=t[m]}return m}function deleteProperty(t,u){if(!isObject(t)||typeof u!=="string"){return false}const p=getPathSegments(u);for(let u=0;u<p.length;u++){const m=p[u];assertNotStringIndex(t,m);if(u===p.length-1){delete t[m];return true}t=t[m];if(!isObject(t)){return false}}}function hasProperty(t,u){if(!isObject(t)||typeof u!=="string"){return false}const p=getPathSegments(u);if(p.length===0){return false}for(const u of p){if(!isObject(t)||!(u in t)||isStringIndex(t,u)){return false}t=t[u]}return true}function escapePath(t){if(typeof t!=="string"){throw new TypeError("Expected a string")}return t.replaceAll(/[\\.[]/g,"\\$&")}function entries(t){const u=Object.entries(t);if(Array.isArray(t)){return u.map((([t,u])=>[Number(t),u]))}return u}function stringifyPath(t){let u="";for(let[p,m]of entries(t)){if(typeof m==="number"){u+=`[${m}]`}else{m=escapePath(m);u+=p===0?m:`.${m}`}}return u}function*deepKeysIterator(t,u=[]){if(!isObject(t)||isEmptyObject(t)){if(u.length>0){yield stringifyPath(u)}return}for(const[p,m]of entries(t)){yield*deepKeysIterator(m,[...u,p])}}function deepKeys(t){return[...deepKeysIterator(t)]}const L=require("node:os");const M=L.homedir();const j=L.tmpdir();const{env:U}=A;const macos=t=>{const u=k.join(M,"Library");return{data:k.join(u,"Application Support",t),config:k.join(u,"Preferences",t),cache:k.join(u,"Caches",t),log:k.join(u,"Logs",t),temp:k.join(j,t)}};const windows=t=>{const u=U.APPDATA||k.join(M,"AppData","Roaming");const p=U.LOCALAPPDATA||k.join(M,"AppData","Local");return{data:k.join(p,t,"Data"),config:k.join(u,t,"Config"),cache:k.join(p,t,"Cache"),log:k.join(p,t,"Log"),temp:k.join(j,t)}};const linux=t=>{const u=k.basename(M);return{data:k.join(U.XDG_DATA_HOME||k.join(M,".local","share"),t),config:k.join(U.XDG_CONFIG_HOME||k.join(M,".config"),t),cache:k.join(U.XDG_CACHE_HOME||k.join(M,".cache"),t),log:k.join(U.XDG_STATE_HOME||k.join(M,".local","state"),t),temp:k.join(j,u,t)}};function envPaths(t,{suffix:u="nodejs"}={}){if(typeof t!=="string"){throw new TypeError(`Expected a string, got ${typeof t}`)}if(u){t+=`-${u}`}if(A.platform==="darwin"){return macos(t)}if(A.platform==="win32"){return windows(t)}return linux(t)}const attemptifyAsync=(t,u)=>function attemptified(...p){return t.apply(undefined,p).catch(u)};const attemptifySync=(t,u)=>function attemptified(...p){try{return t.apply(undefined,p)}catch(t){return u(t)}};const B=A.getuid?!A.getuid():false;const H=1e4;const NOOP=()=>undefined;const V={isChangeErrorOk:t=>{if(!V.isNodeError(t))return false;const{code:u}=t;if(u==="ENOSYS")return true;if(!B&&(u==="EINVAL"||u==="EPERM"))return true;return false},isNodeError:t=>t instanceof Error,isRetriableError:t=>{if(!V.isNodeError(t))return false;const{code:u}=t;if(u==="EMFILE"||u==="ENFILE"||u==="EAGAIN"||u==="EBUSY"||u==="EACCESS"||u==="EACCES"||u==="EACCS"||u==="EPERM")return true;return false},onChangeError:t=>{if(!V.isNodeError(t))throw t;if(V.isChangeErrorOk(t))return;throw t}};const z=V;class RetryfyQueue{constructor(){this.interval=25;this.intervalId=undefined;this.limit=H;this.queueActive=new Set;this.queueWaiting=new Set;this.init=()=>{if(this.intervalId)return;this.intervalId=setInterval(this.tick,this.interval)};this.reset=()=>{if(!this.intervalId)return;clearInterval(this.intervalId);delete this.intervalId};this.add=t=>{this.queueWaiting.add(t);if(this.queueActive.size<this.limit/2){this.tick()}else{this.init()}};this.remove=t=>{this.queueWaiting.delete(t);this.queueActive.delete(t)};this.schedule=()=>new Promise((t=>{const cleanup=()=>this.remove(resolver);const resolver=()=>t(cleanup);this.add(resolver)}));this.tick=()=>{if(this.queueActive.size>=this.limit)return;if(!this.queueWaiting.size)return this.reset();for(const t of this.queueWaiting){if(this.queueActive.size>=this.limit)break;this.queueWaiting.delete(t);this.queueActive.add(t);t()}}}}const G=new RetryfyQueue;const retryifyAsync=(t,u)=>function retrified(p){return function attempt(...m){return G.schedule().then((g=>{const onResolve=t=>{g();return t};const onReject=t=>{g();if(Date.now()>=p)throw t;if(u(t)){const t=Math.round(100*Math.random());const u=new Promise((u=>setTimeout(u,t)));return u.then((()=>attempt.apply(undefined,m)))}throw t};return t.apply(undefined,m).then(onResolve,onReject)}))}};const retryifySync=(t,u)=>function retrified(p){return function attempt(...m){try{return t.apply(undefined,m)}catch(t){if(Date.now()>p)throw t;if(u(t))return attempt.apply(undefined,m);throw t}}};const q={attempt:{chmod:attemptifyAsync((0,x.promisify)(T.chmod),z.onChangeError),chown:attemptifyAsync((0,x.promisify)(T.chown),z.onChangeError),close:attemptifyAsync((0,x.promisify)(T.close),NOOP),fsync:attemptifyAsync((0,x.promisify)(T.fsync),NOOP),mkdir:attemptifyAsync((0,x.promisify)(T.mkdir),NOOP),realpath:attemptifyAsync((0,x.promisify)(T.realpath),NOOP),stat:attemptifyAsync((0,x.promisify)(T.stat),NOOP),unlink:attemptifyAsync((0,x.promisify)(T.unlink),NOOP),chmodSync:attemptifySync(T.chmodSync,z.onChangeError),chownSync:attemptifySync(T.chownSync,z.onChangeError),closeSync:attemptifySync(T.closeSync,NOOP),existsSync:attemptifySync(T.existsSync,NOOP),fsyncSync:attemptifySync(T.fsync,NOOP),mkdirSync:attemptifySync(T.mkdirSync,NOOP),realpathSync:attemptifySync(T.realpathSync,NOOP),statSync:attemptifySync(T.statSync,NOOP),unlinkSync:attemptifySync(T.unlinkSync,NOOP)},retry:{close:retryifyAsync((0,x.promisify)(T.close),z.isRetriableError),fsync:retryifyAsync((0,x.promisify)(T.fsync),z.isRetriableError),open:retryifyAsync((0,x.promisify)(T.open),z.isRetriableError),readFile:retryifyAsync((0,x.promisify)(T.readFile),z.isRetriableError),rename:retryifyAsync((0,x.promisify)(T.rename),z.isRetriableError),stat:retryifyAsync((0,x.promisify)(T.stat),z.isRetriableError),write:retryifyAsync((0,x.promisify)(T.write),z.isRetriableError),writeFile:retryifyAsync((0,x.promisify)(T.writeFile),z.isRetriableError),closeSync:retryifySync(T.closeSync,z.isRetriableError),fsyncSync:retryifySync(T.fsyncSync,z.isRetriableError),openSync:retryifySync(T.openSync,z.isRetriableError),readFileSync:retryifySync(T.readFileSync,z.isRetriableError),renameSync:retryifySync(T.renameSync,z.isRetriableError),statSync:retryifySync(T.statSync,z.isRetriableError),writeSync:retryifySync(T.writeSync,z.isRetriableError),writeFileSync:retryifySync(T.writeFileSync,z.isRetriableError)}};const W=q;const Y="utf8";const Z=438;const X=511;const J={};const Q={};const ee=L.userInfo().uid;const se=L.userInfo().gid;const ie=7500;const ne=1e3;const ae=!!A.getuid;const le=A.getuid?!A.getuid():false;const ue=128;const he=1e4;const constants_NOOP=()=>{};const lang_isException=t=>t instanceof Error&&"code"in t;const lang_isFunction=t=>typeof t==="function";const lang_isString=t=>typeof t==="string";const lang_isUndefined=t=>t===undefined;const de={};const fe={next:t=>{const u=de[t];if(!u)return;u.shift();const p=u[0];if(p){p((()=>fe.next(t)))}else{delete de[t]}},schedule:t=>new Promise((u=>{let p=de[t];if(!p)p=de[t]=[];p.push(u);if(p.length>1)return;u((()=>fe.next(t)))}))};const pe=null&&fe;const me=A.platform==="linux";const ge=A.platform==="win32";const ye=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(!ge){ye.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT")}if(me){ye.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}const ve=ye;class Interceptor{constructor(){this.callbacks=new Set;this.exited=false;this.exit=t=>{if(this.exited)return;this.exited=true;for(const t of this.callbacks){t()}if(t){if(ge&&(t!=="SIGINT"&&t!=="SIGTERM"&&t!=="SIGKILL")){A.kill(A.pid,"SIGTERM")}else{A.kill(A.pid,t)}}};this.hook=()=>{A.once("exit",(()=>this.exit()));for(const t of ve){try{A.once(t,(()=>this.exit(t)))}catch{}}};this.register=t=>{this.callbacks.add(t);return()=>{this.callbacks.delete(t)}};this.hook()}}const _e=new Interceptor;const be=_e.register;const we=be;const Ee={store:{},create:t=>{const u=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6);const p=Date.now().toString().slice(-10);const m="tmp-";const g=`.${m}${p}${u}`;const y=`${t}${g}`;return y},get:(t,u,p=true)=>{const m=Ee.truncate(u(t));if(m in Ee.store)return Ee.get(t,u,p);Ee.store[m]=p;const disposer=()=>delete Ee.store[m];return[m,disposer]},purge:t=>{if(!Ee.store[t])return;delete Ee.store[t];W.attempt.unlink(t)},purgeSync:t=>{if(!Ee.store[t])return;delete Ee.store[t];W.attempt.unlinkSync(t)},purgeSyncAll:()=>{for(const t in Ee.store){Ee.purgeSync(t)}},truncate:t=>{const u=k.basename(t);if(u.length<=ue)return t;const p=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(u);if(!p)return t;const m=u.length-ue;return`${t.slice(0,-u.length)}${p[1]}${p[2].slice(0,-m)}${p[3]}`}};we(Ee.purgeSyncAll);const $e=Ee;function readFile(t,u=DEFAULT_READ_OPTIONS){if(isString(u))return readFile(t,{encoding:u});const p=Date.now()+((u.timeout??DEFAULT_TIMEOUT_ASYNC)||-1);return fs.retry.readFile(p)(t,u)}function readFileSync(t,u=DEFAULT_READ_OPTIONS){if(isString(u))return readFileSync(t,{encoding:u});const p=Date.now()+((u.timeout??DEFAULT_TIMEOUT_SYNC)||-1);return fs.retry.readFileSync(p)(t,u)}function writeFile(t,u,p,m){if(isFunction(p))return writeFile(t,u,DEFAULT_WRITE_OPTIONS,p);const g=writeFileAsync(t,u,p);if(m)g.then(m,m);return g}async function writeFileAsync(t,u,p=DEFAULT_WRITE_OPTIONS){if(isString(p))return writeFileAsync(t,u,{encoding:p});const m=Date.now()+((p.timeout??DEFAULT_TIMEOUT_ASYNC)||-1);let g=null;let y=null;let v=null;let b=null;let w=null;try{if(p.schedule)g=await p.schedule(t);y=await Scheduler.schedule(t);const E=await fs.attempt.realpath(t);const $=!!E;t=E||t;[b,v]=Temp.get(t,p.tmpCreate||Temp.create,!(p.tmpPurge===false));const R=IS_POSIX&&isUndefined(p.chown);const O=isUndefined(p.mode);if($&&(R||O)){const u=await fs.attempt.stat(t);if(u){p={...p};if(R){p.chown={uid:u.uid,gid:u.gid}}if(O){p.mode=u.mode}}}if(!$){const u=path.dirname(t);await fs.attempt.mkdir(u,{mode:DEFAULT_FOLDER_MODE,recursive:true})}w=await fs.retry.open(m)(b,"w",p.mode||DEFAULT_FILE_MODE);if(p.tmpCreated){p.tmpCreated(b)}if(isString(u)){await fs.retry.write(m)(w,u,0,p.encoding||DEFAULT_ENCODING)}else if(!isUndefined(u)){await fs.retry.write(m)(w,u,0,u.length,0)}if(p.fsync!==false){if(p.fsyncWait!==false){await fs.retry.fsync(m)(w)}else{fs.attempt.fsync(w)}}await fs.retry.close(m)(w);w=null;if(p.chown&&(p.chown.uid!==DEFAULT_USER_UID||p.chown.gid!==DEFAULT_USER_GID)){await fs.attempt.chown(b,p.chown.uid,p.chown.gid)}if(p.mode&&p.mode!==DEFAULT_FILE_MODE){await fs.attempt.chmod(b,p.mode)}try{await fs.retry.rename(m)(b,t)}catch(u){if(!isException(u))throw u;if(u.code!=="ENAMETOOLONG")throw u;await fs.retry.rename(m)(b,Temp.truncate(t))}v();b=null}finally{if(w)await fs.attempt.close(w);if(b)Temp.purge(b);if(g)g();if(y)y()}}function writeFileSync(t,u,p=Q){if(lang_isString(p))return writeFileSync(t,u,{encoding:p});const m=Date.now()+((p.timeout??ne)||-1);let g=null;let y=null;let v=null;try{const b=W.attempt.realpathSync(t);const w=!!b;t=b||t;[y,g]=$e.get(t,p.tmpCreate||$e.create,!(p.tmpPurge===false));const E=ae&&lang_isUndefined(p.chown);const $=lang_isUndefined(p.mode);if(w&&(E||$)){const u=W.attempt.statSync(t);if(u){p={...p};if(E){p.chown={uid:u.uid,gid:u.gid}}if($){p.mode=u.mode}}}if(!w){const u=k.dirname(t);W.attempt.mkdirSync(u,{mode:X,recursive:true})}v=W.retry.openSync(m)(y,"w",p.mode||Z);if(p.tmpCreated){p.tmpCreated(y)}if(lang_isString(u)){W.retry.writeSync(m)(v,u,0,p.encoding||Y)}else if(!lang_isUndefined(u)){W.retry.writeSync(m)(v,u,0,u.length,0)}if(p.fsync!==false){if(p.fsyncWait!==false){W.retry.fsyncSync(m)(v)}else{W.attempt.fsync(v)}}W.retry.closeSync(m)(v);v=null;if(p.chown&&(p.chown.uid!==ee||p.chown.gid!==se)){W.attempt.chownSync(y,p.chown.uid,p.chown.gid)}if(p.mode&&p.mode!==Z){W.attempt.chmodSync(y,p.mode)}try{W.retry.renameSync(m)(y,t)}catch(u){if(!lang_isException(u))throw u;if(u.code!=="ENAMETOOLONG")throw u;W.retry.renameSync(m)(y,$e.truncate(t))}g();y=null}finally{if(v)W.attempt.closeSync(v);if(y)$e.purge(y)}}var Re=__nccwpck_require__(939);var Oe=__nccwpck_require__(2815);const copyProperty=(t,u,p,m)=>{if(p==="length"||p==="prototype"){return}if(p==="arguments"||p==="caller"){return}const g=Object.getOwnPropertyDescriptor(t,p);const y=Object.getOwnPropertyDescriptor(u,p);if(!canCopyProperty(g,y)&&m){return}Object.defineProperty(t,p,y)};const canCopyProperty=function(t,u){return t===undefined||t.configurable||t.writable===u.writable&&t.enumerable===u.enumerable&&t.configurable===u.configurable&&(t.writable||t.value===u.value)};const changePrototype=(t,u)=>{const p=Object.getPrototypeOf(u);if(p===Object.getPrototypeOf(t)){return}Object.setPrototypeOf(t,p)};const wrappedToString=(t,u)=>`/* Wrapped ${t}*/\n${u}`;const Pe=Object.getOwnPropertyDescriptor(Function.prototype,"toString");const xe=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name");const changeToString=(t,u,p)=>{const m=p===""?"":`with ${p.trim()}() `;const g=wrappedToString.bind(null,m,u.toString());Object.defineProperty(g,"name",xe);const{writable:y,enumerable:v,configurable:b}=Pe;Object.defineProperty(t,"toString",{value:g,writable:y,enumerable:v,configurable:b})};function mimicFunction(t,u,{ignoreNonConfigurable:p=false}={}){const{name:m}=t;for(const m of Reflect.ownKeys(u)){copyProperty(t,u,m,p)}changePrototype(t,u);changeToString(t,u,m);return t}const debounceFunction=(t,u={})=>{if(typeof t!=="function"){throw new TypeError(`Expected the first argument to be a function, got \`${typeof t}\``)}const{wait:p=0,maxWait:m=Number.POSITIVE_INFINITY,before:g=false,after:y=true}=u;if(p<0||m<0){throw new RangeError("`wait` and `maxWait` must not be negative.")}if(!g&&!y){throw new Error("Both `before` and `after` are false, function wouldn't be called.")}let v;let b;let w;const debouncedFunction=function(...u){const E=this;const later=()=>{v=undefined;if(b){clearTimeout(b);b=undefined}if(y){w=t.apply(E,u)}};const maxLater=()=>{b=undefined;if(v){clearTimeout(v);v=undefined}if(y){w=t.apply(E,u)}};const $=g&&!v;clearTimeout(v);v=setTimeout(later,p);if(m>0&&m!==Number.POSITIVE_INFINITY&&!b){b=setTimeout(maxLater,m)}if($){w=t.apply(E,u)}return w};mimicFunction(debouncedFunction,t);debouncedFunction.cancel=()=>{if(v){clearTimeout(v);v=undefined}if(b){clearTimeout(b);b=undefined}};return debouncedFunction};const Ae=debounceFunction;var Te=__nccwpck_require__(6723);const ke=Object.prototype.toString;const Ce="[object Uint8Array]";const Ie="[object ArrayBuffer]";function isType(t,u,p){if(!t){return false}if(t.constructor===u){return true}return ke.call(t)===p}function isUint8Array(t){return isType(t,Uint8Array,Ce)}function isArrayBuffer(t){return isType(t,ArrayBuffer,Ie)}function isUint8ArrayOrArrayBuffer(t){return isUint8Array(t)||isArrayBuffer(t)}function assertUint8Array(t){if(!isUint8Array(t)){throw new TypeError(`Expected \`Uint8Array\`, got \`${typeof t}\``)}}function assertUint8ArrayOrArrayBuffer(t){if(!isUint8ArrayOrArrayBuffer(t)){throw new TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof t}\``)}}function toUint8Array(t){if(t instanceof ArrayBuffer){return new Uint8Array(t)}if(ArrayBuffer.isView(t)){return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}throw new TypeError(`Unsupported value, got \`${typeof t}\`.`)}function concatUint8Arrays(t,u){if(t.length===0){return new Uint8Array(0)}u??=t.reduce(((t,u)=>t+u.length),0);const p=new Uint8Array(u);let m=0;for(const u of t){assertUint8Array(u);p.set(u,m);m+=u.length}return p}function areUint8ArraysEqual(t,u){assertUint8Array(t);assertUint8Array(u);if(t===u){return true}if(t.length!==u.length){return false}for(let p=0;p<t.length;p++){if(t[p]!==u[p]){return false}}return true}function compareUint8Arrays(t,u){assertUint8Array(t);assertUint8Array(u);const p=Math.min(t.length,u.length);for(let m=0;m<p;m++){const p=t[m]-u[m];if(p!==0){return Math.sign(p)}}return Math.sign(t.length-u.length)}const Ne={utf8:new globalThis.TextDecoder("utf8")};function uint8ArrayToString(t,u="utf8"){assertUint8ArrayOrArrayBuffer(t);Ne[u]??=new globalThis.TextDecoder(u);return Ne[u].decode(t)}function assertString(t){if(typeof t!=="string"){throw new TypeError(`Expected \`string\`, got \`${typeof t}\``)}}const De=new globalThis.TextEncoder;function stringToUint8Array(t){assertString(t);return De.encode(t)}function base64ToBase64Url(t){return t.replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}function base64UrlToBase64(t){return t.replaceAll("-","+").replaceAll("_","/")}const Le=65535;function uint8ArrayToBase64(t,{urlSafe:u=false}={}){assertUint8Array(t);let p;if(t.length<Le){p=globalThis.btoa(String.fromCodePoint.apply(this,t))}else{p="";for(const u of t){p+=String.fromCodePoint(u)}p=globalThis.btoa(p)}return u?base64ToBase64Url(p):p}function base64ToUint8Array(t){assertString(t);return Uint8Array.from(globalThis.atob(base64UrlToBase64(t)),(t=>t.codePointAt(0)))}function stringToBase64(t,{urlSafe:u=false}={}){assertString(t);return uint8ArrayToBase64(stringToUint8Array(t),{urlSafe:u})}function base64ToString(t){assertString(t);return uint8ArrayToString(base64ToUint8Array(t))}const Me=Array.from({length:256},((t,u)=>u.toString(16).padStart(2,"0")));function uint8ArrayToHex(t){assertUint8Array(t);let u="";for(let p=0;p<t.length;p++){u+=Me[t[p]]}return u}const je={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,b:11,c:12,d:13,e:14,f:15,A:10,B:11,C:12,D:13,E:14,F:15};function hexToUint8Array(t){assertString(t);if(t.length%2!==0){throw new Error("Invalid Hex string length.")}const u=t.length/2;const p=new Uint8Array(u);for(let m=0;m<u;m++){const u=je[t[m*2]];const g=je[t[m*2+1]];if(u===undefined||g===undefined){throw new Error(`Invalid Hex character encountered at position ${m*2}`)}p[m]=u<<4|g}return p}function getUintBE(t){const{byteLength:u}=t;if(u===6){return t.getUint16(0)*2**32+t.getUint32(2)}if(u===5){return t.getUint8(0)*2**32+t.getUint32(1)}if(u===4){return t.getUint32(0)}if(u===3){return t.getUint8(0)*2**16+t.getUint16(1)}if(u===2){return t.getUint16(0)}if(u===1){return t.getUint8(0)}}function indexOf(t,u){const p=t.length;const m=u.length;if(m===0){return-1}if(m>p){return-1}const g=p-m;for(let p=0;p<=g;p++){let g=true;for(let y=0;y<m;y++){if(t[p+y]!==u[y]){g=false;break}}if(g){return p}}return-1}function includes(t,u){return indexOf(t,u)!==-1}const Fe=Oe["default"];const Ue="aes-256-cbc";const createPlainObject=()=>Object.create(null);const isExist=t=>t!==undefined&&t!==null;const checkValueType=(t,u)=>{const p=new Set(["undefined","symbol","function"]);const m=typeof u;if(p.has(m)){throw new TypeError(`Setting a value of type \`${m}\` for key \`${t}\` is not allowed as it's not supported by JSON`)}};const Be="__internal__";const He=`${Be}.migrations.version`;class Conf{path;events;#e;#t;#r;#s={};constructor(t={}){const u={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:false,accessPropertiesByDotNotation:true,configFileMode:438,...t};if(!u.cwd){if(!u.projectName){throw new Error("Please specify the `projectName` option.")}u.cwd=envPaths(u.projectName,{suffix:u.projectSuffix}).config}this.#r=u;if(u.schema){if(typeof u.schema!=="object"){throw new TypeError("The `schema` option must be an object.")}const t=new Re.Ajv2020({allErrors:true,useDefaults:true});Fe(t);const p={type:"object",properties:u.schema};this.#e=t.compile(p);for(const[t,p]of Object.entries(u.schema)){if(p?.default){this.#s[t]=p.default}}}if(u.defaults){this.#s={...this.#s,...u.defaults}}if(u.serialize){this._serialize=u.serialize}if(u.deserialize){this._deserialize=u.deserialize}this.events=new EventTarget;this.#t=u.encryptionKey;const p=u.fileExtension?`.${u.fileExtension}`:"";this.path=k.resolve(u.cwd,`${u.configName??"config"}${p}`);const m=this.store;const g=Object.assign(createPlainObject(),u.defaults,m);if(u.migrations){if(!u.projectVersion){throw new Error("Please specify the `projectVersion` option.")}this._migrate(u.migrations,u.projectVersion,u.beforeEachMigration)}this._validate(g);try{I.deepEqual(m,g)}catch{this.store=g}if(u.watch){this._watch()}}get(t,u){if(this.#r.accessPropertiesByDotNotation){return this._get(t,u)}const{store:p}=this;return t in p?p[t]:u}set(t,u){if(typeof t!=="string"&&typeof t!=="object"){throw new TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof t}`)}if(typeof t!=="object"&&u===undefined){throw new TypeError("Use `delete()` to clear values")}if(this._containsReservedKey(t)){throw new TypeError(`Please don't use the ${Be} key, as it's used to manage this module internal operations.`)}const{store:p}=this;const set=(t,u)=>{checkValueType(t,u);if(this.#r.accessPropertiesByDotNotation){setProperty(p,t,u)}else{p[t]=u}};if(typeof t==="object"){const u=t;for(const[t,p]of Object.entries(u)){set(t,p)}}else{set(t,u)}this.store=p}has(t){if(this.#r.accessPropertiesByDotNotation){return hasProperty(this.store,t)}return t in this.store}reset(...t){for(const u of t){if(isExist(this.#s[u])){this.set(u,this.#s[u])}}}delete(t){const{store:u}=this;if(this.#r.accessPropertiesByDotNotation){deleteProperty(u,t)}else{delete u[t]}this.store=u}clear(){this.store=createPlainObject();for(const t of Object.keys(this.#s)){this.reset(t)}}onDidChange(t,u){if(typeof t!=="string"){throw new TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof t}`)}if(typeof u!=="function"){throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof u}`)}return this._handleChange((()=>this.get(t)),u)}onDidAnyChange(t){if(typeof t!=="function"){throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof t}`)}return this._handleChange((()=>this.store),t)}get size(){return Object.keys(this.store).length}get store(){try{const t=T.readFileSync(this.path,this.#t?null:"utf8");const u=this._encryptData(t);const p=this._deserialize(u);this._validate(p);return Object.assign(createPlainObject(),p)}catch(t){if(t?.code==="ENOENT"){this._ensureDirectory();return createPlainObject()}if(this.#r.clearInvalidConfig&&t.name==="SyntaxError"){return createPlainObject()}throw t}}set store(t){this._ensureDirectory();this._validate(t);this._write(t);this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(const[t,u]of Object.entries(this.store)){yield[t,u]}}_encryptData(t){if(!this.#t){return typeof t==="string"?t:uint8ArrayToString(t)}try{const u=t.slice(0,16);const p=C.pbkdf2Sync(this.#t,u.toString(),1e4,32,"sha512");const m=C.createDecipheriv(Ue,p,u);const g=t.slice(17);const y=typeof g==="string"?stringToUint8Array(g):g;return uint8ArrayToString(concatUint8Arrays([m.update(y),m.final()]))}catch{}return t.toString()}_handleChange(t,u){let p=t();const onChange=()=>{const m=p;const g=t();if((0,x.isDeepStrictEqual)(g,m)){return}p=g;u.call(this,g,m)};this.events.addEventListener("change",onChange);return()=>{this.events.removeEventListener("change",onChange)}}_deserialize=t=>JSON.parse(t);_serialize=t=>JSON.stringify(t,undefined,"\t");_validate(t){if(!this.#e){return}const u=this.#e(t);if(u||!this.#e.errors){return}const p=this.#e.errors.map((({instancePath:t,message:u=""})=>`\`${t.slice(1)}\` ${u}`));throw new Error("Config schema violation: "+p.join("; "))}_ensureDirectory(){T.mkdirSync(k.dirname(this.path),{recursive:true})}_write(t){let u=this._serialize(t);if(this.#t){const t=C.randomBytes(16);const p=C.pbkdf2Sync(this.#t,t.toString(),1e4,32,"sha512");const m=C.createCipheriv(Ue,p,t);u=concatUint8Arrays([t,stringToUint8Array(":"),m.update(stringToUint8Array(u)),m.final()])}if(A.env.SNAP){T.writeFileSync(this.path,u,{mode:this.#r.configFileMode})}else{try{writeFileSync(this.path,u,{mode:this.#r.configFileMode})}catch(t){if(t?.code==="EXDEV"){T.writeFileSync(this.path,u,{mode:this.#r.configFileMode});return}throw t}}}_watch(){this._ensureDirectory();if(!T.existsSync(this.path)){this._write(createPlainObject())}if(A.platform==="win32"){T.watch(this.path,{persistent:false},Ae((()=>{this.events.dispatchEvent(new Event("change"))}),{wait:100}))}else{T.watchFile(this.path,{persistent:false},Ae((()=>{this.events.dispatchEvent(new Event("change"))}),{wait:5e3}))}}_migrate(t,u,p){let m=this._get(He,"0.0.0");const g=Object.keys(t).filter((t=>this._shouldPerformMigration(t,m,u)));let y={...this.store};for(const v of g){try{if(p){p(this,{fromVersion:m,toVersion:v,finalVersion:u,versions:g})}const b=t[v];b?.(this);this._set(He,v);m=v;y={...this.store}}catch(t){this.store=y;throw new Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${t}`)}}if(this._isVersionInRangeFormat(m)||!Te.eq(m,u)){this._set(He,u)}}_containsReservedKey(t){if(typeof t==="object"){const u=Object.keys(t)[0];if(u===Be){return true}}if(typeof t!=="string"){return false}if(this.#r.accessPropertiesByDotNotation){if(t.startsWith(`${Be}.`)){return true}return false}return false}_isVersionInRangeFormat(t){return Te.clean(t)===null}_shouldPerformMigration(t,u,p){if(this._isVersionInRangeFormat(t)){if(u!=="0.0.0"&&Te.satisfies(u,t)){return false}return Te.satisfies(p,t)}if(Te.lte(t,u)){return false}if(Te.gt(t,p)){return false}return true}_get(t,u){return getProperty(this.store,t,u)}_set(t,u){const{store:p}=this;setProperty(p,t,u);this.store=p}}var Ve=__nccwpck_require__(9896);var ze=__nccwpck_require__(6928);var Ge=__nccwpck_require__.n(ze);var qe=__nccwpck_require__(9033);var We=__nccwpck_require__(7298);var Ke=__nccwpck_require__.n(We);var Ye=__nccwpck_require__(1083);var Ze=__nccwpck_require__.n(Ye);var Xe=__nccwpck_require__(9850);var Je=__nccwpck_require__.n(Xe);var Qe=__nccwpck_require__(5317);var et=__nccwpck_require__(2203);const tt=require("stream/promises");var rt=__nccwpck_require__(4434);var st=__nccwpck_require__(8474);const it=require("node:stream");const nt=require("node:string_decoder");const ot=require("assert");var ct=__nccwpck_require__(181);const ut=require("zlib");var ht=__nccwpck_require__.t(ut,2);const dt=require("node:fs/promises");var ft=Object.defineProperty;var Ar=(t,u)=>{for(var p in u)ft(t,p,{get:u[p],enumerable:!0})};var pt=typeof process=="object"&&process?process:{stdout:null,stderr:null},Cr=t=>!!t&&typeof t=="object"&&(t instanceof Qt||t instanceof it||Fr(t)||kr(t)),Fr=t=>!!t&&typeof t=="object"&&t instanceof st.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==it.Writable.prototype.pipe,kr=t=>!!t&&typeof t=="object"&&t instanceof st.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function",yt=Symbol("EOF"),vt=Symbol("maybeEmitEnd"),_t=Symbol("emittedEnd"),bt=Symbol("emittingEnd"),wt=Symbol("emittedError"),Et=Symbol("closed"),St=Symbol("read"),$t=Symbol("flush"),Rt=Symbol("flushChunk"),Ot=Symbol("encoding"),Pt=Symbol("decoder"),At=Symbol("flowing"),kt=Symbol("paused"),Ct=Symbol("resume"),It=Symbol("buffer"),Nt=Symbol("pipes"),Dt=Symbol("bufferLength"),Mt=Symbol("bufferPush"),jt=Symbol("bufferShift"),Ft=Symbol("objectMode"),Ut=Symbol("destroyed"),Bt=Symbol("error"),Ht=Symbol("emitData"),Vt=Symbol("emitEnd"),zt=Symbol("emitEnd2"),Gt=Symbol("async"),qt=Symbol("abort"),Wt=Symbol("aborted"),Kt=Symbol("signal"),Yt=Symbol("dataListeners"),Zt=Symbol("discarded"),te=t=>Promise.resolve().then(t),vr=t=>t(),Mr=t=>t==="end"||t==="finish"||t==="prefinish",Br=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,Pr=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),Xt=class{src;dest;opts;ondrain;constructor(t,u,p){this.src=t,this.dest=u,this.opts=p,this.ondrain=()=>t[Ct](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Jt=class extends Xt{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,u,p){super(t,u,p),this.proxyErrors=t=>this.dest.emit("error",t),t.on("error",this.proxyErrors)}},zr=t=>!!t.objectMode,Ur=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",Qt=class extends st.EventEmitter{[At]=!1;[kt]=!1;[Nt]=[];[It]=[];[Ft];[Ot];[Gt];[Pt];[yt]=!1;[_t]=!1;[bt]=!1;[Et]=!1;[wt]=null;[Dt]=0;[Ut]=!1;[Kt];[Wt]=!1;[Yt]=0;[Zt]=!1;writable=!0;readable=!0;constructor(...t){let u=t[0]||{};if(super(),u.objectMode&&typeof u.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");zr(u)?(this[Ft]=!0,this[Ot]=null):Ur(u)?(this[Ot]=u.encoding,this[Ft]=!1):(this[Ft]=!1,this[Ot]=null),this[Gt]=!!u.async,this[Pt]=this[Ot]?new nt.StringDecoder(this[Ot]):null,u&&u.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[It]}),u&&u.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[Nt]});let{signal:p}=u;p&&(this[Kt]=p,p.aborted?this[qt]():p.addEventListener("abort",(()=>this[qt]())))}get bufferLength(){return this[Dt]}get encoding(){return this[Ot]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[Ft]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Gt]}set async(t){this[Gt]=this[Gt]||!!t}[qt](){this[Wt]=!0,this.emit("abort",this[Kt]?.reason),this.destroy(this[Kt]?.reason)}get aborted(){return this[Wt]}set aborted(t){}write(t,u,p){if(this[Wt])return!1;if(this[yt])throw new Error("write after end");if(this[Ut])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof u=="function"&&(p=u,u="utf8"),u||(u="utf8");let m=this[Gt]?te:vr;if(!this[Ft]&&!Buffer.isBuffer(t)){if(Pr(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(Br(t))t=Buffer.from(t);else if(typeof t!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[Ft]?(this[At]&&this[Dt]!==0&&this[$t](!0),this[At]?this.emit("data",t):this[Mt](t),this[Dt]!==0&&this.emit("readable"),p&&m(p),this[At]):t.length?(typeof t=="string"&&!(u===this[Ot]&&!this[Pt]?.lastNeed)&&(t=Buffer.from(t,u)),Buffer.isBuffer(t)&&this[Ot]&&(t=this[Pt].write(t)),this[At]&&this[Dt]!==0&&this[$t](!0),this[At]?this.emit("data",t):this[Mt](t),this[Dt]!==0&&this.emit("readable"),p&&m(p),this[At]):(this[Dt]!==0&&this.emit("readable"),p&&m(p),this[At])}read(t){if(this[Ut])return null;if(this[Zt]=!1,this[Dt]===0||t===0||t&&t>this[Dt])return this[vt](),null;this[Ft]&&(t=null),this[It].length>1&&!this[Ft]&&(this[It]=[this[Ot]?this[It].join(""):Buffer.concat(this[It],this[Dt])]);let u=this[St](t||null,this[It][0]);return this[vt](),u}[St](t,u){if(this[Ft])this[jt]();else{let p=u;t===p.length||t===null?this[jt]():typeof p=="string"?(this[It][0]=p.slice(t),u=p.slice(0,t),this[Dt]-=t):(this[It][0]=p.subarray(t),u=p.subarray(0,t),this[Dt]-=t)}return this.emit("data",u),!this[It].length&&!this[yt]&&this.emit("drain"),u}end(t,u,p){return typeof t=="function"&&(p=t,t=void 0),typeof u=="function"&&(p=u,u="utf8"),t!==void 0&&this.write(t,u),p&&this.once("end",p),this[yt]=!0,this.writable=!1,(this[At]||!this[kt])&&this[vt](),this}[Ct](){this[Ut]||(!this[Yt]&&!this[Nt].length&&(this[Zt]=!0),this[kt]=!1,this[At]=!0,this.emit("resume"),this[It].length?this[$t]():this[yt]?this[vt]():this.emit("drain"))}resume(){return this[Ct]()}pause(){this[At]=!1,this[kt]=!0,this[Zt]=!1}get destroyed(){return this[Ut]}get flowing(){return this[At]}get paused(){return this[kt]}[Mt](t){this[Ft]?this[Dt]+=1:this[Dt]+=t.length,this[It].push(t)}[jt](){return this[Ft]?this[Dt]-=1:this[Dt]-=this[It][0].length,this[It].shift()}[$t](t=!1){do{}while(this[Rt](this[jt]())&&this[It].length);!t&&!this[It].length&&!this[yt]&&this.emit("drain")}[Rt](t){return this.emit("data",t),this[At]}pipe(t,u){if(this[Ut])return t;this[Zt]=!1;let p=this[_t];return u=u||{},t===pt.stdout||t===pt.stderr?u.end=!1:u.end=u.end!==!1,u.proxyErrors=!!u.proxyErrors,p?u.end&&t.end():(this[Nt].push(u.proxyErrors?new Jt(this,t,u):new Xt(this,t,u)),this[Gt]?te((()=>this[Ct]())):this[Ct]()),t}unpipe(t){let u=this[Nt].find((u=>u.dest===t));u&&(this[Nt].length===1?(this[At]&&this[Yt]===0&&(this[At]=!1),this[Nt]=[]):this[Nt].splice(this[Nt].indexOf(u),1),u.unpipe())}addListener(t,u){return this.on(t,u)}on(t,u){let p=super.on(t,u);if(t==="data")this[Zt]=!1,this[Yt]++,!this[Nt].length&&!this[At]&&this[Ct]();else if(t==="readable"&&this[Dt]!==0)super.emit("readable");else if(Mr(t)&&this[_t])super.emit(t),this.removeAllListeners(t);else if(t==="error"&&this[wt]){let t=u;this[Gt]?te((()=>t.call(this,this[wt]))):t.call(this,this[wt])}return p}removeListener(t,u){return this.off(t,u)}off(t,u){let p=super.off(t,u);return t==="data"&&(this[Yt]=this.listeners("data").length,this[Yt]===0&&!this[Zt]&&!this[Nt].length&&(this[At]=!1)),p}removeAllListeners(t){let u=super.removeAllListeners(t);return(t==="data"||t===void 0)&&(this[Yt]=0,!this[Zt]&&!this[Nt].length&&(this[At]=!1)),u}get emittedEnd(){return this[_t]}[vt](){!this[bt]&&!this[_t]&&!this[Ut]&&this[It].length===0&&this[yt]&&(this[bt]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Et]&&this.emit("close"),this[bt]=!1)}emit(t,...u){let p=u[0];if(t!=="error"&&t!=="close"&&t!==Ut&&this[Ut])return!1;if(t==="data")return!this[Ft]&&!p?!1:this[Gt]?(te((()=>this[Ht](p))),!0):this[Ht](p);if(t==="end")return this[Vt]();if(t==="close"){if(this[Et]=!0,!this[_t]&&!this[Ut])return!1;let t=super.emit("close");return this.removeAllListeners("close"),t}else if(t==="error"){this[wt]=p,super.emit(Bt,p);let t=!this[Kt]||this.listeners("error").length?super.emit("error",p):!1;return this[vt](),t}else if(t==="resume"){let t=super.emit("resume");return this[vt](),t}else if(t==="finish"||t==="prefinish"){let u=super.emit(t);return this.removeAllListeners(t),u}let m=super.emit(t,...u);return this[vt](),m}[Ht](t){for(let u of this[Nt])u.dest.write(t)===!1&&this.pause();let u=this[Zt]?!1:super.emit("data",t);return this[vt](),u}[Vt](){return this[_t]?!1:(this[_t]=!0,this.readable=!1,this[Gt]?(te((()=>this[zt]())),!0):this[zt]())}[zt](){if(this[Pt]){let t=this[Pt].end();if(t){for(let u of this[Nt])u.dest.write(t);this[Zt]||super.emit("data",t)}}for(let t of this[Nt])t.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[Ft]||(t.dataLength=0);let u=this.promise();return this.on("data",(u=>{t.push(u),this[Ft]||(t.dataLength+=u.length)})),await u,t}async concat(){if(this[Ft])throw new Error("cannot concat in objectMode");let t=await this.collect();return this[Ot]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise(((t,u)=>{this.on(Ut,(()=>u(new Error("stream destroyed")))),this.on("error",(t=>u(t))),this.on("end",(()=>t()))}))}[Symbol.asyncIterator](){this[Zt]=!1;let t=!1,e=async()=>(this.pause(),t=!0,{value:void 0,done:!0});return{next:()=>{if(t)return e();let u=this.read();if(u!==null)return Promise.resolve({done:!1,value:u});if(this[yt])return e();let p,m,h=t=>{this.off("data",a),this.off("end",l),this.off(Ut,c),e(),m(t)},a=t=>{this.off("error",h),this.off("end",l),this.off(Ut,c),this.pause(),p({value:t,done:!!this[yt]})},l=()=>{this.off("error",h),this.off("data",a),this.off(Ut,c),e(),p({done:!0,value:void 0})},c=()=>h(new Error("stream destroyed"));return new Promise(((t,u)=>{m=u,p=t,this.once(Ut,c),this.once("error",h),this.once("end",l),this.once("data",a)}))},throw:e,return:e,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[Zt]=!1;let t=!1,e=()=>(this.pause(),this.off(Bt,e),this.off(Ut,e),this.off("end",e),t=!0,{done:!0,value:void 0}),i=()=>{if(t)return e();let u=this.read();return u===null?e():{done:!1,value:u}};return this.once("end",e),this.once(Bt,e),this.once(Ut,e),{next:i,throw:e,return:e,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(t){if(this[Ut])return t?this.emit("error",t):this.emit(Ut),this;this[Ut]=!0,this[Zt]=!0,this[It].length=0,this[Dt]=0;let u=this;return typeof u.close=="function"&&!this[Et]&&u.close(),t?this.emit("error",t):this.emit(Ut),this}static get isStream(){return Cr}};var er=Ve.writev,rr=Symbol("_autoClose"),sr=Symbol("_close"),ir=Symbol("_ended"),nr=Symbol("_fd"),cr=Symbol("_finished"),lr=Symbol("_flags"),mr=Symbol("_flush"),gr=Symbol("_handleChunk"),yr=Symbol("_makeBuf"),_r=Symbol("_mode"),br=Symbol("_needDrain"),Er=Symbol("_onerror"),Sr=Symbol("_onopen"),Rr=Symbol("_onread"),Or=Symbol("_onwrite"),xr=Symbol("_open"),Ir=Symbol("_path"),Nr=Symbol("_pos"),Dr=Symbol("_queue"),Lr=Symbol("_read"),Hr=Symbol("_readSize"),Vr=Symbol("_reading"),Gr=Symbol("_remain"),Wr=Symbol("_size"),Kr=Symbol("_write"),Yr=Symbol("_writing"),Xr=Symbol("_defaultFlag"),es=Symbol("_errored"),ts=class extends Qt{[es]=!1;[nr];[Ir];[Hr];[Vr]=!1;[Wr];[Gr];[rr];constructor(t,u){if(u=u||{},super(u),this.readable=!0,this.writable=!1,typeof t!="string")throw new TypeError("path must be a string");this[es]=!1,this[nr]=typeof u.fd=="number"?u.fd:void 0,this[Ir]=t,this[Hr]=u.readSize||16*1024*1024,this[Vr]=!1,this[Wr]=typeof u.size=="number"?u.size:1/0,this[Gr]=this[Wr],this[rr]=typeof u.autoClose=="boolean"?u.autoClose:!0,typeof this[nr]=="number"?this[Lr]():this[xr]()}get fd(){return this[nr]}get path(){return this[Ir]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[xr](){Ve.open(this[Ir],"r",((t,u)=>this[Sr](t,u)))}[Sr](t,u){t?this[Er](t):(this[nr]=u,this.emit("open",u),this[Lr]())}[yr](){return Buffer.allocUnsafe(Math.min(this[Hr],this[Gr]))}[Lr](){if(!this[Vr]){this[Vr]=!0;let t=this[yr]();if(t.length===0)return process.nextTick((()=>this[Rr](null,0,t)));Ve.read(this[nr],t,0,t.length,null,((t,u,p)=>this[Rr](t,u,p)))}}[Rr](t,u,p){this[Vr]=!1,t?this[Er](t):this[gr](u,p)&&this[Lr]()}[sr](){if(this[rr]&&typeof this[nr]=="number"){let t=this[nr];this[nr]=void 0,Ve.close(t,(t=>t?this.emit("error",t):this.emit("close")))}}[Er](t){this[Vr]=!0,this[sr](),this.emit("error",t)}[gr](t,u){let p=!1;return this[Gr]-=t,t>0&&(p=super.write(t<u.length?u.subarray(0,t):u)),(t===0||this[Gr]<=0)&&(p=!1,this[sr](),super.end()),p}emit(t,...u){switch(t){case"prefinish":case"finish":return!1;case"drain":return typeof this[nr]=="number"&&this[Lr](),!1;case"error":return this[es]?!1:(this[es]=!0,super.emit(t,...u));default:return super.emit(t,...u)}}},rs=class extends ts{[xr](){let t=!0;try{this[Sr](null,Ve.openSync(this[Ir],"r")),t=!1}finally{t&&this[sr]()}}[Lr](){let t=!0;try{if(!this[Vr]){this[Vr]=!0;do{let t=this[yr](),u=t.length===0?0:Ve.readSync(this[nr],t,0,t.length,null);if(!this[gr](u,t))break}while(!0);this[Vr]=!1}t=!1}finally{t&&this[sr]()}}[sr](){if(this[rr]&&typeof this[nr]=="number"){let t=this[nr];this[nr]=void 0,Ve.closeSync(t),this.emit("close")}}},ss=class extends rt{readable=!1;writable=!0;[es]=!1;[Yr]=!1;[ir]=!1;[Dr]=[];[br]=!1;[Ir];[_r];[rr];[nr];[Xr];[lr];[cr]=!1;[Nr];constructor(t,u){u=u||{},super(u),this[Ir]=t,this[nr]=typeof u.fd=="number"?u.fd:void 0,this[_r]=u.mode===void 0?438:u.mode,this[Nr]=typeof u.start=="number"?u.start:void 0,this[rr]=typeof u.autoClose=="boolean"?u.autoClose:!0;let p=this[Nr]!==void 0?"r+":"w";this[Xr]=u.flags===void 0,this[lr]=u.flags===void 0?p:u.flags,this[nr]===void 0&&this[xr]()}emit(t,...u){if(t==="error"){if(this[es])return!1;this[es]=!0}return super.emit(t,...u)}get fd(){return this[nr]}get path(){return this[Ir]}[Er](t){this[sr](),this[Yr]=!0,this.emit("error",t)}[xr](){Ve.open(this[Ir],this[lr],this[_r],((t,u)=>this[Sr](t,u)))}[Sr](t,u){this[Xr]&&this[lr]==="r+"&&t&&t.code==="ENOENT"?(this[lr]="w",this[xr]()):t?this[Er](t):(this[nr]=u,this.emit("open",u),this[Yr]||this[mr]())}end(t,u){return t&&this.write(t,u),this[ir]=!0,!this[Yr]&&!this[Dr].length&&typeof this[nr]=="number"&&this[Or](null,0),this}write(t,u){return typeof t=="string"&&(t=Buffer.from(t,u)),this[ir]?(this.emit("error",new Error("write() after end()")),!1):this[nr]===void 0||this[Yr]||this[Dr].length?(this[Dr].push(t),this[br]=!0,!1):(this[Yr]=!0,this[Kr](t),!0)}[Kr](t){Ve.write(this[nr],t,0,t.length,this[Nr],((t,u)=>this[Or](t,u)))}[Or](t,u){t?this[Er](t):(this[Nr]!==void 0&&typeof u=="number"&&(this[Nr]+=u),this[Dr].length?this[mr]():(this[Yr]=!1,this[ir]&&!this[cr]?(this[cr]=!0,this[sr](),this.emit("finish")):this[br]&&(this[br]=!1,this.emit("drain"))))}[mr](){if(this[Dr].length===0)this[ir]&&this[Or](null,0);else if(this[Dr].length===1)this[Kr](this[Dr].pop());else{let t=this[Dr];this[Dr]=[],er(this[nr],t,this[Nr],((t,u)=>this[Or](t,u)))}}[sr](){if(this[rr]&&typeof this[nr]=="number"){let t=this[nr];this[nr]=void 0,Ve.close(t,(t=>t?this.emit("error",t):this.emit("close")))}}},is=class extends ss{[xr](){let t;if(this[Xr]&&this[lr]==="r+")try{t=Ve.openSync(this[Ir],this[lr],this[_r])}catch(t){if(t?.code==="ENOENT")return this[lr]="w",this[xr]();throw t}else t=Ve.openSync(this[Ir],this[lr],this[_r]);this[Sr](null,t)}[sr](){if(this[rr]&&typeof this[nr]=="number"){let t=this[nr];this[nr]=void 0,Ve.closeSync(t),this.emit("close")}}[Kr](t){let u=!0;try{this[Or](null,Ve.writeSync(this[nr],t,0,t.length,this[Nr])),u=!1}finally{if(u)try{this[sr]()}catch{}}}};var ns=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"]]),As=t=>!!t.sync&&!!t.file,Is=t=>!t.sync&&!!t.file,Cs=t=>!!t.sync&&!t.file,Fs=t=>!t.sync&&!t.file;var ks=t=>!!t.file;var Zr=t=>{let u=ns.get(t);return u||t},re=(t={})=>{if(!t)return{};let u={};for(let[p,m]of Object.entries(t)){let t=Zr(p);u[t]=m}return u.chmod===void 0&&u.noChmod===!1&&(u.chmod=!0),delete u.noChmod,u};var K=(t,u,p,m,g)=>Object.assign(((y=[],v,b)=>{Array.isArray(y)&&(v=y,y={}),typeof v=="function"&&(b=v,v=void 0),v?v=Array.from(v):v=[];let w=re(y);if(g?.(w,v),As(w)){if(typeof b=="function")throw new TypeError("callback not supported for sync tar functions");return t(w,v)}else if(Is(w)){let t=u(w,v),p=b||void 0;return p?t.then((()=>p()),p):t}else if(Cs(w)){if(typeof b=="function")throw new TypeError("callback not supported for sync tar functions");return p(w,v)}else if(Fs(w)){if(typeof b=="function")throw new TypeError("callback only supported with file option");return m(w,v)}else throw new Error("impossible options??")}),{syncFile:t,asyncFile:u,syncNoFile:p,asyncNoFile:m,validate:g});var os=ut.constants||{ZLIB_VERNUM:4736},as=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},os));var ls=ct.Buffer.concat,hs=Object.getOwnPropertyDescriptor(ct.Buffer,"concat"),$r=t=>t,ps=hs?.writable===!0||hs?.set!==void 0?t=>{ct.Buffer.concat=t?$r:ls}:t=>{},ms=Symbol("_superWrite"),gs=class extends Error{code;errno;constructor(t,u){super("zlib: "+t.message,{cause:t}),this.code=t.code,this.errno=t.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+t.message,Error.captureStackTrace(this,u??this.constructor)}get name(){return"ZlibError"}},ys=Symbol("flushFlag"),vs=class extends Qt{#i=!1;#n=!1;#o;#a;#c;#l;#u;get sawError(){return this.#i}get handle(){return this.#l}get flushFlag(){return this.#o}constructor(t,u){if(!t||typeof t!="object")throw new TypeError("invalid options for ZlibBase constructor");if(super(t),this.#o=t.flush??0,this.#a=t.finishFlush??0,this.#c=t.fullFlushFlag??0,typeof ht[u]!="function")throw new TypeError("Compression method not supported: "+u);try{this.#l=new ht[u](t)}catch(t){throw new gs(t,this.constructor)}this.#u=t=>{this.#i||(this.#i=!0,this.close(),this.emit("error",t))},this.#l?.on("error",(t=>this.#u(new gs(t)))),this.once("end",(()=>this.close))}close(){this.#l&&(this.#l.close(),this.#l=void 0,this.emit("close"))}reset(){if(!this.#i)return ot(this.#l,"zlib binding closed"),this.#l.reset?.()}flush(t){this.ended||(typeof t!="number"&&(t=this.#c),this.write(Object.assign(ct.Buffer.alloc(0),{[ys]:t})))}end(t,u,p){return typeof t=="function"&&(p=t,u=void 0,t=void 0),typeof u=="function"&&(p=u,u=void 0),t&&(u?this.write(t,u):this.write(t)),this.flush(this.#a),this.#n=!0,super.end(p)}get ended(){return this.#n}[ms](t){return super.write(t)}write(t,u,p){if(typeof u=="function"&&(p=u,u="utf8"),typeof t=="string"&&(t=ct.Buffer.from(t,u)),this.#i)return;ot(this.#l,"zlib binding closed");let m=this.#l._handle,g=m.close;m.close=()=>{};let y=this.#l.close;this.#l.close=()=>{},ps(!0);let v;try{let u=typeof t[ys]=="number"?t[ys]:this.#o;v=this.#l._processChunk(t,u),ps(!1)}catch(t){ps(!1),this.#u(new gs(t,this.write))}finally{this.#l&&(this.#l._handle=m,m.close=g,this.#l.close=y,this.#l.removeAllListeners("error"))}this.#l&&this.#l.on("error",(t=>this.#u(new gs(t,this.write))));let b;if(v)if(Array.isArray(v)&&v.length>0){let t=v[0];b=this[ms](ct.Buffer.from(t));for(let t=1;t<v.length;t++)b=this[ms](v[t])}else b=this[ms](ct.Buffer.from(v));return p&&p(),b}},_s=class extends vs{#i;#n;constructor(t,u){t=t||{},t.flush=t.flush||as.Z_NO_FLUSH,t.finishFlush=t.finishFlush||as.Z_FINISH,t.fullFlushFlag=as.Z_FULL_FLUSH,super(t,u),this.#i=t.level,this.#n=t.strategy}params(t,u){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.#i!==t||this.#n!==u){this.flush(as.Z_SYNC_FLUSH),ot(this.handle,"zlib binding closed");let p=this.handle.flush;this.handle.flush=(t,u)=>{typeof t=="function"&&(u=t,t=this.flushFlag),this.flush(t),u?.()};try{this.handle.params(t,u)}finally{this.handle.flush=p}this.handle&&(this.#i=t,this.#n=u)}}}};var bs=class extends _s{#i;constructor(t){super(t,"Gzip"),this.#i=t&&!!t.portable}[ms](t){return this.#i?(this.#i=!1,t[9]=255,super[ms](t)):super[ms](t)}};var ws=class extends _s{constructor(t){super(t,"Unzip")}},Es=class extends vs{constructor(t,u){t=t||{},t.flush=t.flush||as.BROTLI_OPERATION_PROCESS,t.finishFlush=t.finishFlush||as.BROTLI_OPERATION_FINISH,t.fullFlushFlag=as.BROTLI_OPERATION_FLUSH,super(t,u)}},Ss=class extends Es{constructor(t){super(t,"BrotliCompress")}},$s=class extends Es{constructor(t){super(t,"BrotliDecompress")}},Rs=class extends vs{constructor(t,u){t=t||{},t.flush=t.flush||as.ZSTD_e_continue,t.finishFlush=t.finishFlush||as.ZSTD_e_end,t.fullFlushFlag=as.ZSTD_e_flush,super(t,u)}},Os=class extends Rs{constructor(t){super(t,"ZstdCompress")}},xs=class extends Rs{constructor(t){super(t,"ZstdDecompress")}};var Bs=(t,u)=>{if(Number.isSafeInteger(t))t<0?jr(t,u):qr(t,u);else throw Error("cannot encode number outside of javascript safe integer range");return u},qr=(t,u)=>{u[0]=128;for(var p=u.length;p>1;p--)u[p-1]=t&255,t=Math.floor(t/256)},jr=(t,u)=>{u[0]=255;var p=!1;t=t*-1;for(var m=u.length;m>1;m--){var g=t&255;t=Math.floor(t/256),p?u[m-1]=zs(g):g===0?u[m-1]=0:(p=!0,u[m-1]=Us(g))}},Ps=t=>{let u=t[0],p=u===128?Jr(t.subarray(1,t.length)):u===255?Qr(t):null;if(p===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(p))throw Error("parsed number outside of javascript safe integer range");return p},Qr=t=>{for(var u=t.length,p=0,m=!1,g=u-1;g>-1;g--){var y=Number(t[g]),v;m?v=zs(y):y===0?v=y:(m=!0,v=Us(y)),v!==0&&(p-=v*Math.pow(256,u-g-1))}return p},Jr=t=>{for(var u=t.length,p=0,m=u-1;m>-1;m--){var g=Number(t[m]);g!==0&&(p+=g*Math.pow(256,u-m-1))}return p},zs=t=>(255^t)&255,Us=t=>(255^t)+1&255;var Ts={};Ar(Ts,{code:()=>Ds,isCode:()=>oe,isName:()=>en,name:()=>Ns});var oe=t=>Ns.has(t),en=t=>Ds.has(t),Ns=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"]]),Ds=new Map(Array.from(Ns).map((t=>[t[1],t[0]])));var Ls=class{cksumValid=!1;needPax=!1;nullBlock=!1;block;path;mode;uid;gid;size;cksum;#i="Unsupported";linkpath;uname;gname;devmaj=0;devmin=0;atime;ctime;mtime;charset;comment;constructor(t,u=0,p,m){Buffer.isBuffer(t)?this.decode(t,u||0,p,m):t&&this.#n(t)}decode(t,u,p,m){if(u||(u=0),!t||!(t.length>=u+512))throw new Error("need 512 bytes for header");this.path=p?.path??Tt(t,u,100),this.mode=p?.mode??m?.mode??at(t,u+100,8),this.uid=p?.uid??m?.uid??at(t,u+108,8),this.gid=p?.gid??m?.gid??at(t,u+116,8),this.size=p?.size??m?.size??at(t,u+124,12),this.mtime=p?.mtime??m?.mtime??Bi(t,u+136,12),this.cksum=at(t,u+148,12),m&&this.#n(m,!0),p&&this.#n(p);let g=Tt(t,u+156,1);if(oe(g)&&(this.#i=g||"0"),this.#i==="0"&&this.path.slice(-1)==="/"&&(this.#i="5"),this.#i==="5"&&(this.size=0),this.linkpath=Tt(t,u+157,100),t.subarray(u+257,u+265).toString()==="ustar\x0000")if(this.uname=p?.uname??m?.uname??Tt(t,u+265,32),this.gname=p?.gname??m?.gname??Tt(t,u+297,32),this.devmaj=p?.devmaj??m?.devmaj??at(t,u+329,8)??0,this.devmin=p?.devmin??m?.devmin??at(t,u+337,8)??0,t[u+475]!==0){let p=Tt(t,u+345,155);this.path=p+"/"+this.path}else{let g=Tt(t,u+345,130);g&&(this.path=g+"/"+this.path),this.atime=p?.atime??m?.atime??Bi(t,u+476,12),this.ctime=p?.ctime??m?.ctime??Bi(t,u+488,12)}let y=256;for(let p=u;p<u+148;p++)y+=t[p];for(let p=u+156;p<u+512;p++)y+=t[p];this.cksumValid=y===this.cksum,this.cksum===void 0&&y===256&&(this.nullBlock=!0)}#n(t,u=!1){Object.assign(this,Object.fromEntries(Object.entries(t).filter((([t,p])=>!(p==null||t==="path"&&u||t==="linkpath"&&u||t==="global")))))}encode(t,u=0){if(t||(t=this.block=Buffer.alloc(512)),this.#i==="Unsupported"&&(this.#i="0"),!(t.length>=u+512))throw new Error("need 512 bytes for header");let p=this.ctime||this.atime?130:155,m=sn(this.path||"",p),g=m[0],y=m[1];this.needPax=!!m[2],this.needPax=xt(t,u,100,g)||this.needPax,this.needPax=lt(t,u+100,8,this.mode)||this.needPax,this.needPax=lt(t,u+108,8,this.uid)||this.needPax,this.needPax=lt(t,u+116,8,this.gid)||this.needPax,this.needPax=lt(t,u+124,12,this.size)||this.needPax,this.needPax=Pi(t,u+136,12,this.mtime)||this.needPax,t[u+156]=this.#i.charCodeAt(0),this.needPax=xt(t,u+157,100,this.linkpath)||this.needPax,t.write("ustar\x0000",u+257,8),this.needPax=xt(t,u+265,32,this.uname)||this.needPax,this.needPax=xt(t,u+297,32,this.gname)||this.needPax,this.needPax=lt(t,u+329,8,this.devmaj)||this.needPax,this.needPax=lt(t,u+337,8,this.devmin)||this.needPax,this.needPax=xt(t,u+345,p,y)||this.needPax,t[u+475]!==0?this.needPax=xt(t,u+345,155,y)||this.needPax:(this.needPax=xt(t,u+345,130,y)||this.needPax,this.needPax=Pi(t,u+476,12,this.atime)||this.needPax,this.needPax=Pi(t,u+488,12,this.ctime)||this.needPax);let v=256;for(let p=u;p<u+148;p++)v+=t[p];for(let p=u+156;p<u+512;p++)v+=t[p];return this.cksum=v,lt(t,u+148,8,this.cksum),this.cksumValid=!0,this.needPax}get type(){return this.#i==="Unsupported"?this.#i:Ns.get(this.#i)}get typeKey(){return this.#i}set type(t){let u=String(Ds.get(t));if(oe(u)||u==="Unsupported")this.#i=u;else if(oe(t))this.#i=t;else throw new TypeError("invalid entry type: "+t)}},sn=(t,u)=>{let p=t,m="",g,y=k.posix.parse(t).root||".";if(Buffer.byteLength(p)<100)g=[p,m,!1];else{m=k.posix.dirname(p),p=k.posix.basename(p);do{Buffer.byteLength(p)<=100&&Buffer.byteLength(m)<=u?g=[p,m,!1]:Buffer.byteLength(p)>100&&Buffer.byteLength(m)<=u?g=[p.slice(0,99),m,!0]:(p=k.posix.join(k.posix.basename(m),p),m=k.posix.dirname(m))}while(m!==y&&g===void 0);g||(g=[t.slice(0,99),"",!0])}return g},Tt=(t,u,p)=>t.subarray(u,u+p).toString("utf8").replace(/\0.*/,""),Bi=(t,u,p)=>rn(at(t,u,p)),rn=t=>t===void 0?void 0:new Date(t*1e3),at=(t,u,p)=>Number(t[u])&128?Ps(t.subarray(u,u+p)):on(t,u,p),nn=t=>isNaN(t)?void 0:t,on=(t,u,p)=>nn(parseInt(t.subarray(u,u+p).toString("utf8").replace(/\0.*$/,"").trim(),8)),Ms={12:8589934591,8:2097151},lt=(t,u,p,m)=>m===void 0?!1:m>Ms[p]||m<0?(Bs(m,t.subarray(u,u+p)),!0):(an(t,u,p,m),!1),an=(t,u,p,m)=>t.write(ln(m,p),u,p,"ascii"),ln=(t,u)=>cn(Math.floor(t).toString(8),u),cn=(t,u)=>(t.length===u-1?t:new Array(u-t.length-1).join("0")+t+" ")+"\0",Pi=(t,u,p,m)=>m===void 0?!1:lt(t,u,p,m.getTime()/1e3),js=new Array(156).join("\0"),xt=(t,u,p,m)=>m===void 0?!1:(t.write(m+js,u,p,"utf8"),m.length!==Buffer.byteLength(m)||m.length>p);var Hs=class s{atime;mtime;ctime;charset;comment;gid;uid;gname;uname;linkpath;dev;ino;nlink;path;size;mode;global;constructor(t,u=!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=u,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 u=Buffer.byteLength(t),p=512*Math.ceil(1+u/512),m=Buffer.allocUnsafe(p);for(let t=0;t<512;t++)m[t]=0;new Ls({path:("PaxHeader/"+(0,k.basename)(this.path??"")).slice(0,99),mode:this.mode||420,uid:this.uid,gid:this.gid,size:u,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(m),m.write(t,512,u,"utf8");for(let t=u+512;t<m.length;t++)m[t]=0;return m}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 u=this[t],p=u instanceof Date?u.getTime()/1e3:u,m=" "+(t==="dev"||t==="ino"||t==="nlink"?"SCHILY.":"")+t+"="+p+`\n`,g=Buffer.byteLength(m),y=Math.floor(Math.log(g)/Math.log(10))+1;return g+y>=Math.pow(10,y)&&(y+=1),y+g+m}static parse(t,u,p=!1){return new s(un(mn(t),u),p)}},un=(t,u)=>u?Object.assign({},u,t):t,mn=t=>t.replace(/\n$/,"").split(`\n`).reduce(pn,Object.create(null)),pn=(t,u)=>{let p=parseInt(u,10);if(p!==Buffer.byteLength(u)+1)return t;u=u.slice((p+" ").length);let m=u.split("="),g=m.shift();if(!g)return t;let y=g.replace(/^SCHILY\.(dev|ino|nlink)/,"$1"),v=m.join("=");return t[y]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(y)?new Date(Number(v)*1e3):/^[0-9]+$/.test(v)?+v:v,t};var Gs=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,qs=Gs!=="win32"?t=>t:t=>t&&t.replace(/\\/g,"/");var Ws=class extends Qt{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(t,u,p){switch(super({}),this.pause(),this.extended=u,this.globalExtended=p,this.header=t,this.remain=t.size??0,this.startBlockSize=512*Math.ceil(this.remain/512),this.blockRemain=this.startBlockSize,this.type=t.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(!t.path)throw new Error("no path provided for tar.ReadEntry");this.path=qs(t.path),this.mode=t.mode,this.mode&&(this.mode=this.mode&4095),this.uid=t.uid,this.gid=t.gid,this.uname=t.uname,this.gname=t.gname,this.size=this.remain,this.mtime=t.mtime,this.atime=t.atime,this.ctime=t.ctime,this.linkpath=t.linkpath?qs(t.linkpath):void 0,this.uname=t.uname,this.gname=t.gname,u&&this.#i(u),p&&this.#i(p,!0)}write(t){let u=t.length;if(u>this.blockRemain)throw new Error("writing more to entry than is appropriate");let p=this.remain,m=this.blockRemain;return this.remain=Math.max(0,p-u),this.blockRemain=Math.max(0,m-u),this.ignore?!0:p>=u?super.write(t):super.write(t.subarray(0,p))}#i(t,u=!1){t.path&&(t.path=qs(t.path)),t.linkpath&&(t.linkpath=qs(t.linkpath)),Object.assign(this,Object.fromEntries(Object.entries(t).filter((([t,p])=>!(p==null||t==="path"&&u)))))}};var Lt=(t,u,p,m={})=>{t.file&&(m.file=t.file),t.cwd&&(m.cwd=t.cwd),m.code=p instanceof Error&&p.code||u,m.tarCode=u,!t.strict&&m.recoverable!==!1?(p instanceof Error&&(m=Object.assign(p,m),p=p.message),t.emit("warn",u,p,m)):p instanceof Error?t.emit("error",Object.assign(p,m)):t.emit("error",Object.assign(new Error(`${u}: ${p}`),m))};var Ks=1024*1024,Ys=Buffer.from([31,139]),Zs=Buffer.from([40,181,47,253]),Xs=Math.max(Ys.length,Zs.length),Js=Symbol("state"),Qs=Symbol("writeEntry"),ei=Symbol("readEntry"),ti=Symbol("nextEntry"),ri=Symbol("processEntry"),si=Symbol("extendedHeader"),ii=Symbol("globalExtendedHeader"),ni=Symbol("meta"),oi=Symbol("emitMeta"),ai=Symbol("buffer"),ci=Symbol("queue"),li=Symbol("ended"),ui=Symbol("emittedEnd"),hi=Symbol("emit"),fi=Symbol("unzip"),pi=Symbol("consumeChunk"),mi=Symbol("consumeChunkSub"),gi=Symbol("consumeBody"),yi=Symbol("consumeMeta"),vi=Symbol("consumeHeader"),_i=Symbol("consuming"),bi=Symbol("bufferConcat"),wi=Symbol("maybeEnd"),Ei=Symbol("writing"),Si=Symbol("aborted"),Ri=Symbol("onDone"),Oi=Symbol("sawValidEntry"),xi=Symbol("sawNullBlock"),Ai=Symbol("sawEOF"),Ti=Symbol("closeStream"),Rn=()=>!0,ki=class extends rt.EventEmitter{file;strict;maxMetaEntrySize;filter;brotli;zstd;writable=!0;readable=!1;[ci]=[];[ai];[ei];[Qs];[Js]="begin";[ni]="";[si];[ii];[li]=!1;[fi];[Si]=!1;[Oi];[xi]=!1;[Ai]=!1;[Ei]=!1;[_i]=!1;[ui]=!1;constructor(t={}){super(),this.file=t.file||"",this.on(Ri,(()=>{(this[Js]==="begin"||this[Oi]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")})),t.ondone?this.on(Ri,t.ondone):this.on(Ri,(()=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")})),this.strict=!!t.strict,this.maxMetaEntrySize=t.maxMetaEntrySize||Ks,this.filter=typeof t.filter=="function"?t.filter:Rn;let u=t.file&&(t.file.endsWith(".tar.br")||t.file.endsWith(".tbr"));this.brotli=!(t.gzip||t.zstd)&&t.brotli!==void 0?t.brotli:u?void 0:!1;let p=t.file&&(t.file.endsWith(".tar.zst")||t.file.endsWith(".tzst"));this.zstd=!(t.gzip||t.brotli)&&t.zstd!==void 0?t.zstd:p?!0:void 0,this.on("end",(()=>this[Ti]())),typeof t.onwarn=="function"&&this.on("warn",t.onwarn),typeof t.onReadEntry=="function"&&this.on("entry",t.onReadEntry)}warn(t,u,p={}){Lt(this,t,u,p)}[vi](t,u){this[Oi]===void 0&&(this[Oi]=!1);let p;try{p=new Ls(t,u,this[si],this[ii])}catch(t){return this.warn("TAR_ENTRY_INVALID",t)}if(p.nullBlock)this[xi]?(this[Ai]=!0,this[Js]==="begin"&&(this[Js]="header"),this[hi]("eof")):(this[xi]=!0,this[hi]("nullBlock"));else if(this[xi]=!1,!p.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:p});else if(!p.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:p});else{let t=p.type;if(/^(Symbolic)?Link$/.test(t)&&!p.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:p});else if(!/^(Symbolic)?Link$/.test(t)&&!/^(Global)?ExtendedHeader$/.test(t)&&p.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:p});else{let t=this[Qs]=new Ws(p,this[si],this[ii]);if(!this[Oi])if(t.remain){let o=()=>{t.invalid||(this[Oi]=!0)};t.on("end",o)}else this[Oi]=!0;t.meta?t.size>this.maxMetaEntrySize?(t.ignore=!0,this[hi]("ignoredEntry",t),this[Js]="ignore",t.resume()):t.size>0&&(this[ni]="",t.on("data",(t=>this[ni]+=t)),this[Js]="meta"):(this[si]=void 0,t.ignore=t.ignore||!this.filter(t.path,t),t.ignore?(this[hi]("ignoredEntry",t),this[Js]=t.remain?"ignore":"header",t.resume()):(t.remain?this[Js]="body":(this[Js]="header",t.end()),this[ei]?this[ci].push(t):(this[ci].push(t),this[ti]())))}}}[Ti](){queueMicrotask((()=>this.emit("close")))}[ri](t){let u=!0;if(!t)this[ei]=void 0,u=!1;else if(Array.isArray(t)){let[u,...p]=t;this.emit(u,...p)}else this[ei]=t,this.emit("entry",t),t.emittedEnd||(t.on("end",(()=>this[ti]())),u=!1);return u}[ti](){do{}while(this[ri](this[ci].shift()));if(!this[ci].length){let t=this[ei];!t||t.flowing||t.size===t.remain?this[Ei]||this.emit("drain"):t.once("drain",(()=>this.emit("drain")))}}[gi](t,u){let p=this[Qs];if(!p)throw new Error("attempt to consume body without entry??");let m=p.blockRemain??0,g=m>=t.length&&u===0?t:t.subarray(u,u+m);return p.write(g),p.blockRemain||(this[Js]="header",this[Qs]=void 0,p.end()),g.length}[yi](t,u){let p=this[Qs],m=this[gi](t,u);return!this[Qs]&&p&&this[oi](p),m}[hi](t,u,p){!this[ci].length&&!this[ei]?this.emit(t,u,p):this[ci].push([t,u,p])}[oi](t){switch(this[hi]("meta",this[ni]),t.type){case"ExtendedHeader":case"OldExtendedHeader":this[si]=Hs.parse(this[ni],this[si],!1);break;case"GlobalExtendedHeader":this[ii]=Hs.parse(this[ni],this[ii],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":{let t=this[si]??Object.create(null);this[si]=t,t.path=this[ni].replace(/\0.*/,"");break}case"NextFileHasLongLinkpath":{let t=this[si]||Object.create(null);this[si]=t,t.linkpath=this[ni].replace(/\0.*/,"");break}default:throw new Error("unknown meta: "+t.type)}}abort(t){this[Si]=!0,this.emit("abort",t),this.warn("TAR_ABORT",t,{recoverable:!1})}write(t,u,p){if(typeof u=="function"&&(p=u,u=void 0),typeof t=="string"&&(t=Buffer.from(t,typeof u=="string"?u:"utf8")),this[Si])return p?.(),!1;if((this[fi]===void 0||this.brotli===void 0&&this[fi]===!1)&&t){if(this[ai]&&(t=Buffer.concat([this[ai],t]),this[ai]=void 0),t.length<Xs)return this[ai]=t,p?.(),!0;for(let u=0;this[fi]===void 0&&u<Ys.length;u++)t[u]!==Ys[u]&&(this[fi]=!1);let u=!1;if(this[fi]===!1&&this.zstd!==!1){u=!0;for(let p=0;p<Zs.length;p++)if(t[p]!==Zs[p]){u=!1;break}}let m=this.brotli===void 0&&!u;if(this[fi]===!1&&m)if(t.length<512)if(this[li])this.brotli=!0;else return this[ai]=t,p?.(),!0;else try{new Ls(t.subarray(0,512)),this.brotli=!1}catch{this.brotli=!0}if(this[fi]===void 0||this[fi]===!1&&(this.brotli||u)){let m=this[li];this[li]=!1,this[fi]=this[fi]===void 0?new ws({}):u?new xs({}):new $s({}),this[fi].on("data",(t=>this[pi](t))),this[fi].on("error",(t=>this.abort(t))),this[fi].on("end",(()=>{this[li]=!0,this[pi]()})),this[Ei]=!0;let g=!!this[fi][m?"end":"write"](t);return this[Ei]=!1,p?.(),g}}this[Ei]=!0,this[fi]?this[fi].write(t):this[pi](t),this[Ei]=!1;let m=this[ci].length?!1:this[ei]?this[ei].flowing:!0;return!m&&!this[ci].length&&this[ei]?.once("drain",(()=>this.emit("drain"))),p?.(),m}[bi](t){t&&!this[Si]&&(this[ai]=this[ai]?Buffer.concat([this[ai],t]):t)}[wi](){if(this[li]&&!this[ui]&&!this[Si]&&!this[_i]){this[ui]=!0;let t=this[Qs];if(t&&t.blockRemain){let u=this[ai]?this[ai].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${t.blockRemain} more bytes, only ${u} available)`,{entry:t}),this[ai]&&t.write(this[ai]),t.end()}this[hi](Ri)}}[pi](t){if(this[_i]&&t)this[bi](t);else if(!t&&!this[ai])this[wi]();else if(t){if(this[_i]=!0,this[ai]){this[bi](t);let u=this[ai];this[ai]=void 0,this[mi](u)}else this[mi](t);for(;this[ai]&&this[ai]?.length>=512&&!this[Si]&&!this[Ai];){let t=this[ai];this[ai]=void 0,this[mi](t)}this[_i]=!1}(!this[ai]||this[li])&&this[wi]()}[mi](t){let u=0,p=t.length;for(;u+512<=p&&!this[Si]&&!this[Ai];)switch(this[Js]){case"begin":case"header":this[vi](t,u),u+=512;break;case"ignore":case"body":u+=this[gi](t,u);break;case"meta":u+=this[yi](t,u);break;default:throw new Error("invalid state: "+this[Js])}u<p&&(this[ai]?this[ai]=Buffer.concat([t.subarray(u),this[ai]]):this[ai]=t.subarray(u))}end(t,u,p){return typeof t=="function"&&(p=t,u=void 0,t=void 0),typeof u=="function"&&(p=u,u=void 0),typeof t=="string"&&(t=Buffer.from(t,u)),p&&this.once("finish",p),this[Si]||(this[fi]?(t&&this[fi].write(t),this[fi].end()):(this[li]=!0,(this.brotli===void 0||this.zstd===void 0)&&(t=t||Buffer.alloc(0)),t&&this.write(t),this[wi]())),this}};var mt=t=>{let u=t.length-1,p=-1;for(;u>-1&&t.charAt(u)==="/";)p=u,u--;return p===-1?t:t.slice(0,p)};var _n=t=>{let u=t.onReadEntry;t.onReadEntry=u?t=>{u(t),t.resume()}:t=>t.resume()},Yi=(t,u)=>{let p=new Map(u.map((t=>[mt(t),!0]))),m=t.filter,r=(t,u="")=>{let m=u||(0,ze.parse)(t).root||".",g;if(t===m)g=!1;else{let u=p.get(t);u!==void 0?g=u:g=r((0,ze.dirname)(t),m)}return p.set(t,g),g};t.filter=m?(t,u)=>m(t,u)&&r(mt(t)):t=>r(mt(t))},On=t=>{let u=new ki(t),p=t.file,m;try{m=T.openSync(p,"r");let g=T.fstatSync(m),y=t.maxReadSize||16*1024*1024;if(g.size<y){let t=Buffer.allocUnsafe(g.size),p=T.readSync(m,t,0,g.size,0);u.end(p===t.byteLength?t:t.subarray(0,p))}else{let t=0,p=Buffer.allocUnsafe(y);for(;t<g.size;){let g=T.readSync(m,p,0,y,t);if(g===0)break;t+=g,u.write(p.subarray(0,g))}u.end()}}finally{if(typeof m=="number")try{T.closeSync(m)}catch{}}},Tn=(t,u)=>{let p=new ki(t),m=t.maxReadSize||16*1024*1024,g=t.file;return new Promise(((t,u)=>{p.on("error",u),p.on("end",t),T.stat(g,((t,y)=>{if(t)u(t);else{let t=new ts(g,{readSize:m,size:y.size});t.on("error",u),t.pipe(p)}}))}))},Ci=K(On,Tn,(t=>new ki(t)),(t=>new ki(t)),((t,u)=>{u?.length&&Yi(t,u),t.noResume||_n(t)}));var Ki=(t,u,p)=>(t&=4095,p&&(t=(t|384)&-19),u&&(t&256&&(t|=64),t&32&&(t|=8),t&4&&(t|=1)),t);var{isAbsolute:Ii,parse:Ni}=k.win32,ce=t=>{let u="",p=Ni(t);for(;Ii(t)||p.root;){let m=t.charAt(0)==="/"&&t.slice(0,4)!=="//?/"?"/":p.root;t=t.slice(m.length),u+=m,p=Ni(t)}return[u,t]};var Di=["|","<",">","?",":"],Li=Di.map((t=>String.fromCharCode(61440+t.charCodeAt(0)))),Mi=new Map(Di.map(((t,u)=>[t,Li[u]]))),ji=new Map(Li.map(((t,u)=>[t,Di[u]]))),$i=t=>Di.reduce(((t,u)=>t.split(u).join(Mi.get(u))),t),Vs=t=>Li.reduce(((t,u)=>t.split(u).join(ji.get(u))),t);var tr=(t,u)=>u?(t=qs(t).replace(/^\.(\/|$)/,""),mt(u)+"/"+t):qs(t),Fi=16*1024*1024,Ui=Symbol("process"),Hi=Symbol("file"),Vi=Symbol("directory"),zi=Symbol("symlink"),Gi=Symbol("hardlink"),qi=Symbol("header"),Wi=Symbol("read"),Zi=Symbol("lstat"),Xi=Symbol("onlstat"),Ji=Symbol("onread"),Qi=Symbol("onreadlink"),tn=Symbol("openfile"),hn=Symbol("onopenfile"),dn=Symbol("close"),fn=Symbol("mode"),gn=Symbol("awaitDrain"),yn=Symbol("ondrain"),bn=Symbol("prefix"),wn=class extends Qt{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;#i=!1;constructor(t,u={}){let p=re(u);super(),this.path=qs(t),this.portable=!!p.portable,this.maxReadSize=p.maxReadSize||Fi,this.linkCache=p.linkCache||new Map,this.statCache=p.statCache||new Map,this.preservePaths=!!p.preservePaths,this.cwd=qs(p.cwd||process.cwd()),this.strict=!!p.strict,this.noPax=!!p.noPax,this.noMtime=!!p.noMtime,this.mtime=p.mtime,this.prefix=p.prefix?qs(p.prefix):void 0,this.onWriteEntry=p.onWriteEntry,typeof p.onwarn=="function"&&this.on("warn",p.onwarn);let m=!1;if(!this.preservePaths){let[t,u]=ce(this.path);t&&typeof u=="string"&&(this.path=u,m=t)}this.win32=!!p.win32||process.platform==="win32",this.win32&&(this.path=Vs(this.path.replace(/\\/g,"/")),t=t.replace(/\\/g,"/")),this.absolute=qs(p.absolute||ze.resolve(this.cwd,t)),this.path===""&&(this.path="./"),m&&this.warn("TAR_ENTRY_INFO",`stripping ${m} from absolute path`,{entry:this,path:m+this.path});let g=this.statCache.get(this.absolute);g?this[Xi](g):this[Zi]()}warn(t,u,p={}){return Lt(this,t,u,p)}emit(t,...u){return t==="error"&&(this.#i=!0),super.emit(t,...u)}[Zi](){Ve.lstat(this.absolute,((t,u)=>{if(t)return this.emit("error",t);this[Xi](u)}))}[Xi](t){this.statCache.set(this.absolute,t),this.stat=t,t.isFile()||(t.size=0),this.type=In(t),this.emit("stat",t),this[Ui]()}[Ui](){switch(this.type){case"File":return this[Hi]();case"Directory":return this[Vi]();case"SymbolicLink":return this[zi]();default:return this.end()}}[fn](t){return Ki(t,this.type==="Directory",this.portable)}[bn](t){return tr(t,this.prefix)}[qi](){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 Ls({path:this[bn](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[bn](this.linkpath):this.linkpath,mode:this[fn](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 Hs({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[bn](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[bn](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 t=this.header?.block;if(!t)throw new Error("failed to encode header");super.write(t)}[Vi](){if(!this.stat)throw new Error("cannot create directory entry without stat");this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[qi](),this.end()}[zi](){Ve.readlink(this.absolute,((t,u)=>{if(t)return this.emit("error",t);this[Qi](u)}))}[Qi](t){this.linkpath=qs(t),this[qi](),this.end()}[Gi](t){if(!this.stat)throw new Error("cannot create link entry without stat");this.type="Link",this.linkpath=qs(ze.relative(this.cwd,t)),this.stat.size=0,this[qi](),this.end()}[Hi](){if(!this.stat)throw new Error("cannot create file entry without stat");if(this.stat.nlink>1){let t=`${this.stat.dev}:${this.stat.ino}`,u=this.linkCache.get(t);if(u?.indexOf(this.cwd)===0)return this[Gi](u);this.linkCache.set(t,this.absolute)}if(this[qi](),this.stat.size===0)return this.end();this[tn]()}[tn](){Ve.open(this.absolute,"r",((t,u)=>{if(t)return this.emit("error",t);this[hn](u)}))}[hn](t){if(this.fd=t,this.#i)return this[dn]();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 u=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(u),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[Wi]()}[Wi](){let{fd:t,buf:u,offset:p,length:m,pos:g}=this;if(t===void 0||u===void 0)throw new Error("cannot read file without first opening");Ve.read(t,u,p,m,g,((t,u)=>{if(t)return this[dn]((()=>this.emit("error",t)));this[Ji](u)}))}[dn](t=()=>{}){this.fd!==void 0&&Ve.close(this.fd,t)}[Ji](t){if(t<=0&&this.remain>0){let t=Object.assign(new Error("encountered unexpected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[dn]((()=>this.emit("error",t)))}if(t>this.remain){let t=Object.assign(new Error("did not encounter expected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[dn]((()=>this.emit("error",t)))}if(!this.buf)throw new Error("should have created buffer prior to reading");if(t===this.remain)for(let u=t;u<this.length&&t<this.blockRemain;u++)this.buf[u+this.offset]=0,t++,this.remain++;let u=this.offset===0&&t===this.buf.length?this.buf:this.buf.subarray(this.offset,this.offset+t);this.write(u)?this[yn]():this[gn]((()=>this[yn]()))}[gn](t){this.once("drain",t)}write(t,u,p){if(typeof u=="function"&&(p=u,u=void 0),typeof t=="string"&&(t=Buffer.from(t,typeof u=="string"?u:"utf8")),this.blockRemain<t.length){let t=Object.assign(new Error("writing more data than expected"),{path:this.absolute});return this.emit("error",t)}return this.remain-=t.length,this.blockRemain-=t.length,this.pos+=t.length,this.offset+=t.length,super.write(t,null,p)}[yn](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[dn]((t=>t?this.emit("error",t):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[Wi]()}},En=class extends wn{sync=!0;[Zi](){this[Xi](Ve.lstatSync(this.absolute))}[zi](){this[Qi](Ve.readlinkSync(this.absolute))}[tn](){this[hn](Ve.openSync(this.absolute,"r"))}[Wi](){let t=!0;try{let{fd:u,buf:p,offset:m,length:g,pos:y}=this;if(u===void 0||p===void 0)throw new Error("fd and buf must be set in READ method");let v=Ve.readSync(u,p,m,g,y);this[Ji](v),t=!1}finally{if(t)try{this[dn]((()=>{}))}catch{}}}[gn](t){t()}[dn](t=()=>{}){this.fd!==void 0&&Ve.closeSync(this.fd),t()}},Sn=class extends Qt{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(t,u,p={}){return Lt(this,t,u,p)}constructor(t,u={}){let p=re(u);super(),this.preservePaths=!!p.preservePaths,this.portable=!!p.portable,this.strict=!!p.strict,this.noPax=!!p.noPax,this.noMtime=!!p.noMtime,this.onWriteEntry=p.onWriteEntry,this.readEntry=t;let{type:m}=t;if(m==="Unsupported")throw new Error("writing entry that should be ignored");this.type=m,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=p.prefix,this.path=qs(t.path),this.mode=t.mode!==void 0?this[fn](t.mode):void 0,this.uid=this.portable?void 0:t.uid,this.gid=this.portable?void 0:t.gid,this.uname=this.portable?void 0:t.uname,this.gname=this.portable?void 0:t.gname,this.size=t.size,this.mtime=this.noMtime?void 0:p.mtime||t.mtime,this.atime=this.portable?void 0:t.atime,this.ctime=this.portable?void 0:t.ctime,this.linkpath=t.linkpath!==void 0?qs(t.linkpath):void 0,typeof p.onwarn=="function"&&this.on("warn",p.onwarn);let g=!1;if(!this.preservePaths){let[t,u]=ce(this.path);t&&typeof u=="string"&&(this.path=u,g=t)}this.remain=t.size,this.blockRemain=t.startBlockSize,this.onWriteEntry?.(this),this.header=new Ls({path:this[bn](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[bn](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}),g&&this.warn("TAR_ENTRY_INFO",`stripping ${g} from absolute path`,{entry:this,path:g+this.path}),this.header.encode()&&!this.noPax&&super.write(new Hs({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[bn](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[bn](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 y=this.header?.block;if(!y)throw new Error("failed to encode header");super.write(y),t.pipe(this)}[bn](t){return tr(t,this.prefix)}[fn](t){return Ki(t,this.type==="Directory",this.portable)}write(t,u,p){typeof u=="function"&&(p=u,u=void 0),typeof t=="string"&&(t=Buffer.from(t,typeof u=="string"?u:"utf8"));let m=t.length;if(m>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=m,super.write(t,p)}end(t,u,p){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),typeof t=="function"&&(p=t,u=void 0,t=void 0),typeof u=="function"&&(p=u,u=void 0),typeof t=="string"&&(t=Buffer.from(t,u??"utf8")),p&&this.once("finish",p),t?super.end(t,p):super.end(p),this}},In=t=>t.isFile()?"File":t.isDirectory()?"Directory":t.isSymbolicLink()?"SymbolicLink":"Unsupported";var xn=class s{tail;head;length=0;static create(t=[]){return new s(t)}constructor(t=[]){for(let u of t)this.push(u)}*[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 u=t.next,p=t.prev;return u&&(u.prev=p),p&&(p.next=u),t===this.head&&(this.head=u),t===this.tail&&(this.tail=p),this.length--,t.next=void 0,t.prev=void 0,t.list=void 0,u}unshiftNode(t){if(t===this.head)return;t.list&&t.list.removeNode(t);let u=this.head;t.list=this,t.next=u,u&&(u.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 u=this.tail;t.list=this,t.prev=u,u&&(u.next=t),this.tail=t,this.head||(this.head=t),this.length++}push(...t){for(let u=0,p=t.length;u<p;u++)Fn(this,t[u]);return this.length}unshift(...t){for(var u=0,p=t.length;u<p;u++)kn(this,t[u]);return this.length}pop(){if(!this.tail)return;let t=this.tail.value,u=this.tail;return this.tail=this.tail.prev,this.tail?this.tail.next=void 0:this.head=void 0,u.list=void 0,this.length--,t}shift(){if(!this.head)return;let t=this.head.value,u=this.head;return this.head=this.head.next,this.head?this.head.prev=void 0:this.tail=void 0,u.list=void 0,this.length--,t}forEach(t,u){u=u||this;for(let p=this.head,m=0;p;m++)t.call(u,p.value,m,this),p=p.next}forEachReverse(t,u){u=u||this;for(let p=this.tail,m=this.length-1;p;m--)t.call(u,p.value,m,this),p=p.prev}get(t){let u=0,p=this.head;for(;p&&u<t;u++)p=p.next;if(u===t&&p)return p.value}getReverse(t){let u=0,p=this.tail;for(;p&&u<t;u++)p=p.prev;if(u===t&&p)return p.value}map(t,u){u=u||this;let p=new s;for(let m=this.head;m;)p.push(t.call(u,m.value,this)),m=m.next;return p}mapReverse(t,u){u=u||this;var p=new s;for(let m=this.tail;m;)p.push(t.call(u,m.value,this)),m=m.prev;return p}reduce(t,u){let p,m=this.head;if(arguments.length>1)p=u;else if(this.head)m=this.head.next,p=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var g=0;m;g++)p=t(p,m.value,g),m=m.next;return p}reduceReverse(t,u){let p,m=this.tail;if(arguments.length>1)p=u;else if(this.tail)m=this.tail.prev,p=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(let u=this.length-1;m;u--)p=t(p,m.value,u),m=m.prev;return p}toArray(){let t=new Array(this.length);for(let u=0,p=this.head;p;u++)t[u]=p.value,p=p.next;return t}toArrayReverse(){let t=new Array(this.length);for(let u=0,p=this.tail;p;u++)t[u]=p.value,p=p.prev;return t}slice(t=0,u=this.length){u<0&&(u+=this.length),t<0&&(t+=this.length);let p=new s;if(u<t||u<0)return p;t<0&&(t=0),u>this.length&&(u=this.length);let m=this.head,g=0;for(g=0;m&&g<t;g++)m=m.next;for(;m&&g<u;g++,m=m.next)p.push(m.value);return p}sliceReverse(t=0,u=this.length){u<0&&(u+=this.length),t<0&&(t+=this.length);let p=new s;if(u<t||u<0)return p;t<0&&(t=0),u>this.length&&(u=this.length);let m=this.length,g=this.tail;for(;g&&m>u;m--)g=g.prev;for(;g&&m>t;m--,g=g.prev)p.push(g.value);return p}splice(t,u=0,...p){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);let m=this.head;for(let u=0;m&&u<t;u++)m=m.next;let g=[];for(let t=0;m&&t<u;t++)g.push(m.value),m=this.removeNode(m);m?m!==this.tail&&(m=m.prev):m=this.tail;for(let t of p)m=Cn(this,m,t);return g}reverse(){let t=this.head,u=this.tail;for(let u=t;u;u=u.prev){let t=u.prev;u.prev=u.next,u.next=t}return this.head=u,this.tail=t,this}};function Cn(t,u,p){let m=u,g=u?u.next:t.head,y=new An(p,m,g,t);return y.next===void 0&&(t.tail=y),y.prev===void 0&&(t.head=y),t.length++,y}function Fn(t,u){t.tail=new An(u,t.tail,void 0,t),t.head||(t.head=t.tail),t.length++}function kn(t,u){t.head=new An(u,void 0,t.head,t),t.tail||(t.tail=t.head),t.length++}var An=class{list;next;prev;value;constructor(t,u,p,m){this.list=m,this.value=t,u?(u.next=this,this.prev=u):this.prev=void 0,p?(p.prev=this,this.next=p):this.next=void 0}};var Nn=class{path;absolute;entry;stat;readdir;pending=!1;ignore=!1;piped=!1;constructor(t,u){this.path=t||"./",this.absolute=u}},Dn=Buffer.alloc(1024),Ln=Symbol("onStat"),Un=Symbol("ended"),Hn=Symbol("queue"),Vn=Symbol("current"),zn=Symbol("process"),Gn=Symbol("processing"),qn=Symbol("processJob"),Wn=Symbol("jobs"),Kn=Symbol("jobDone"),Yn=Symbol("addFSEntry"),Zn=Symbol("addTarEntry"),Jn=Symbol("stat"),to=Symbol("readdir"),ro=Symbol("onreaddir"),so=Symbol("pipe"),io=Symbol("entry"),lo=Symbol("entryOpt"),go=Symbol("writeEntryClass"),yo=Symbol("write"),vo=Symbol("ondrain"),_o=class extends Qt{sync=!1;opt;cwd;maxReadSize;preservePaths;strict;noPax;prefix;linkCache;statCache;file;portable;zip;readdirCache;noDirRecurse;follow;noMtime;mtime;filter;jobs;[go];onWriteEntry;[Hn];[Wn]=0;[Gn]=!1;[Un]=!1;constructor(t={}){if(super(),this.opt=t,this.file=t.file||"",this.cwd=t.cwd||process.cwd(),this.maxReadSize=t.maxReadSize,this.preservePaths=!!t.preservePaths,this.strict=!!t.strict,this.noPax=!!t.noPax,this.prefix=qs(t.prefix||""),this.linkCache=t.linkCache||new Map,this.statCache=t.statCache||new Map,this.readdirCache=t.readdirCache||new Map,this.onWriteEntry=t.onWriteEntry,this[go]=wn,typeof t.onwarn=="function"&&this.on("warn",t.onwarn),this.portable=!!t.portable,t.gzip||t.brotli||t.zstd){if((t.gzip?1:0)+(t.brotli?1:0)+(t.zstd?1:0)>1)throw new TypeError("gzip, brotli, zstd are mutually exclusive");if(t.gzip&&(typeof t.gzip!="object"&&(t.gzip={}),this.portable&&(t.gzip.portable=!0),this.zip=new bs(t.gzip)),t.brotli&&(typeof t.brotli!="object"&&(t.brotli={}),this.zip=new Ss(t.brotli)),t.zstd&&(typeof t.zstd!="object"&&(t.zstd={}),this.zip=new Os(t.zstd)),!this.zip)throw new Error("impossible");let u=this.zip;u.on("data",(t=>super.write(t))),u.on("end",(()=>super.end())),u.on("drain",(()=>this[vo]())),this.on("resume",(()=>u.resume()))}else this.on("drain",this[vo]);this.noDirRecurse=!!t.noDirRecurse,this.follow=!!t.follow,this.noMtime=!!t.noMtime,t.mtime&&(this.mtime=t.mtime),this.filter=typeof t.filter=="function"?t.filter:()=>!0,this[Hn]=new xn,this[Wn]=0,this.jobs=Number(t.jobs)||4,this[Gn]=!1,this[Un]=!1}[yo](t){return super.write(t)}add(t){return this.write(t),this}end(t,u,p){return typeof t=="function"&&(p=t,t=void 0),typeof u=="function"&&(p=u,u=void 0),t&&this.add(t),this[Un]=!0,this[zn](),p&&p(),this}write(t){if(this[Un])throw new Error("write after end");return t instanceof Ws?this[Zn](t):this[Yn](t),this.flowing}[Zn](t){let u=qs(ze.resolve(this.cwd,t.path));if(!this.filter(t.path,t))t.resume();else{let p=new Nn(t.path,u);p.entry=new Sn(t,this[lo](p)),p.entry.on("end",(()=>this[Kn](p))),this[Wn]+=1,this[Hn].push(p)}this[zn]()}[Yn](t){let u=qs(ze.resolve(this.cwd,t));this[Hn].push(new Nn(t,u)),this[zn]()}[Jn](t){t.pending=!0,this[Wn]+=1;let u=this.follow?"stat":"lstat";Ve[u](t.absolute,((u,p)=>{t.pending=!1,this[Wn]-=1,u?this.emit("error",u):this[Ln](t,p)}))}[Ln](t,u){this.statCache.set(t.absolute,u),t.stat=u,this.filter(t.path,u)?u.isFile()&&u.nlink>1&&t===this[Vn]&&!this.linkCache.get(`${u.dev}:${u.ino}`)&&!this.sync&&this[qn](t):t.ignore=!0,this[zn]()}[to](t){t.pending=!0,this[Wn]+=1,Ve.readdir(t.absolute,((u,p)=>{if(t.pending=!1,this[Wn]-=1,u)return this.emit("error",u);this[ro](t,p)}))}[ro](t,u){this.readdirCache.set(t.absolute,u),t.readdir=u,this[zn]()}[zn](){if(!this[Gn]){this[Gn]=!0;for(let t=this[Hn].head;t&&this[Wn]<this.jobs;t=t.next)if(this[qn](t.value),t.value.ignore){let u=t.next;this[Hn].removeNode(t),t.next=u}this[Gn]=!1,this[Un]&&!this[Hn].length&&this[Wn]===0&&(this.zip?this.zip.end(Dn):(super.write(Dn),super.end()))}}get[Vn](){return this[Hn]&&this[Hn].head&&this[Hn].head.value}[Kn](t){this[Hn].shift(),this[Wn]-=1,this[zn]()}[qn](t){if(!t.pending){if(t.entry){t===this[Vn]&&!t.piped&&this[so](t);return}if(!t.stat){let u=this.statCache.get(t.absolute);u?this[Ln](t,u):this[Jn](t)}if(t.stat&&!t.ignore){if(!this.noDirRecurse&&t.stat.isDirectory()&&!t.readdir){let u=this.readdirCache.get(t.absolute);if(u?this[ro](t,u):this[to](t),!t.readdir)return}if(t.entry=this[io](t),!t.entry){t.ignore=!0;return}t===this[Vn]&&!t.piped&&this[so](t)}}}[lo](t){return{onwarn:(t,u,p)=>this.warn(t,u,p),noPax:this.noPax,cwd:this.cwd,absolute:t.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}}[io](t){this[Wn]+=1;try{return new this[go](t.path,this[lo](t)).on("end",(()=>this[Kn](t))).on("error",(t=>this.emit("error",t)))}catch(t){this.emit("error",t)}}[vo](){this[Vn]&&this[Vn].entry&&this[Vn].entry.resume()}[so](t){t.piped=!0,t.readdir&&t.readdir.forEach((u=>{let p=t.path,m=p==="./"?"":p.replace(/\/*$/,"/");this[Yn](m+u)}));let u=t.entry,p=this.zip;if(!u)throw new Error("cannot pipe without source");p?u.on("data",(t=>{p.write(t)||u.pause()})):u.on("data",(t=>{super.write(t)||u.pause()}))}pause(){return this.zip&&this.zip.pause(),super.pause()}warn(t,u,p={}){Lt(this,t,u,p)}},bo=class extends _o{sync=!0;constructor(t){super(t),this[go]=En}pause(){}resume(){}[Jn](t){let u=this.follow?"statSync":"lstatSync";this[Ln](t,Ve[u](t.absolute))}[to](t){this[ro](t,Ve.readdirSync(t.absolute))}[so](t){let u=t.entry,p=this.zip;if(t.readdir&&t.readdir.forEach((u=>{let p=t.path,m=p==="./"?"":p.replace(/\/*$/,"/");this[Yn](m+u)})),!u)throw new Error("Cannot pipe without source");p?u.on("data",(t=>{p.write(t)})):u.on("data",(t=>{super[yo](t)}))}};var vn=(t,u)=>{let p=new bo(t),m=new is(t.file,{mode:t.mode||438});p.pipe(m),hr(p,u)},Mn=(t,u)=>{let p=new _o(t),m=new ss(t.file,{mode:t.mode||438});p.pipe(m);let g=new Promise(((t,u)=>{m.on("error",u),m.on("close",t),p.on("error",u)}));return ar(p,u),g},hr=(t,u)=>{u.forEach((u=>{u.charAt(0)==="@"?Ci({file:k.resolve(t.cwd,u.slice(1)),sync:!0,noResume:!0,onReadEntry:u=>t.add(u)}):t.add(u)})),t.end()},ar=async(t,u)=>{for(let p=0;p<u.length;p++){let m=String(u[p]);m.charAt(0)==="@"?await Ci({file:k.resolve(String(t.cwd),m.slice(1)),noResume:!0,onReadEntry:u=>{t.add(u)}}):t.add(m)}t.end()},Bn=(t,u)=>{let p=new bo(t);return hr(p,u),p},Pn=(t,u)=>{let p=new _o(t);return ar(p,u),p},Eo=K(vn,Mn,Bn,Pn,((t,u)=>{if(!u?.length)throw new TypeError("no paths specified to add to archive")}));var So=process.env.__FAKE_PLATFORM__||process.platform,$o=So==="win32",{O_CREAT:Ro,O_TRUNC:Oo,O_WRONLY:Po}=Ve.constants,xo=Number(process.env.__FAKE_FS_O_FILENAME__)||Ve.constants.UV_FS_O_FILEMAP||0,Ao=$o&&!!xo,To=512*1024,ko=xo|Oo|Ro|Po,Co=Ao?t=>t<To?ko:"w":()=>"w";var cs=(t,u,p)=>{try{return T.lchownSync(t,u,p)}catch(t){if(t?.code!=="ENOENT")throw t}},di=(t,u,p,m)=>{T.lchown(t,u,p,(t=>{m(t&&t?.code!=="ENOENT"?t:null)}))},$n=(t,u,p,m,g)=>{if(u.isDirectory())index_min_fs(k.resolve(t,u.name),p,m,(y=>{if(y)return g(y);let v=k.resolve(t,u.name);di(v,p,m,g)}));else{let y=k.resolve(t,u.name);di(y,p,m,g)}},index_min_fs=(t,u,p,m)=>{T.readdir(t,{withFileTypes:!0},((g,y)=>{if(g){if(g.code==="ENOENT")return m();if(g.code!=="ENOTDIR"&&g.code!=="ENOTSUP")return m(g)}if(g||!y.length)return di(t,u,p,m);let v=y.length,b=null,a=g=>{if(!b){if(g)return m(b=g);if(--v===0)return di(t,u,p,m)}};for(let m of y)$n(t,m,u,p,a)}))},Xn=(t,u,p,m)=>{u.isDirectory()&&ds(k.resolve(t,u.name),p,m),cs(k.resolve(t,u.name),p,m)},ds=(t,u,p)=>{let m;try{m=T.readdirSync(t,{withFileTypes:!0})}catch(m){let g=m;if(g?.code==="ENOENT")return;if(g?.code==="ENOTDIR"||g?.code==="ENOTSUP")return cs(t,u,p);throw g}for(let g of m)Xn(t,g,u,p);return cs(t,u,p)};var Io=class extends Error{path;code;syscall="chdir";constructor(t,u){super(`${u}: Cannot cd into '${t}'`),this.path=t,this.code=u}get name(){return"CwdError"}};var No=class extends Error{path;symlink;syscall="symlink";code="TAR_SYMLINK_ERROR";constructor(t,u){super("TAR_SYMLINK_ERROR: Cannot extract through symbolic link"),this.symlink=t,this.path=u}get name(){return"SymlinkError"}};var jn=(t,u)=>{T.stat(t,((p,m)=>{(p||!m.isDirectory())&&(p=new Io(t,p?.code||"ENOTDIR")),u(p)}))},fr=(t,u,p)=>{t=qs(t);let m=u.umask??18,g=u.mode|448,y=(g&m)!==0,v=u.uid,b=u.gid,w=typeof v=="number"&&typeof b=="number"&&(v!==u.processUid||b!==u.processGid),E=u.preserve,$=u.unlink,R=qs(u.cwd),S=(u,m)=>{u?p(u):m&&w?index_min_fs(m,v,b,(t=>S(t))):y?T.chmod(t,g,p):p()};if(t===R)return jn(t,S);if(E)return dt.mkdir(t,{mode:g,recursive:!0}).then((t=>S(null,t??void 0)),S);let O=qs(k.relative(R,t)).split("/");us(R,O,g,$,R,void 0,S)},us=(t,u,p,m,g,y,v)=>{if(!u.length)return v(null,y);let b=u.shift(),w=qs(k.resolve(t+"/"+b));T.mkdir(w,p,dr(w,u,p,m,g,y,v))},dr=(t,u,p,m,g,y,v)=>b=>{b?T.lstat(t,((w,E)=>{if(w)w.path=w.path&&qs(w.path),v(w);else if(E.isDirectory())us(t,u,p,m,g,y,v);else if(m)T.unlink(t,(b=>{if(b)return v(b);T.mkdir(t,p,dr(t,u,p,m,g,y,v))}));else{if(E.isSymbolicLink())return v(new No(t,t+"/"+u.join("/")));v(b)}})):(y=y||t,us(t,u,p,m,g,y,v))},Qn=t=>{let u=!1,p;try{u=T.statSync(t).isDirectory()}catch(t){p=t?.code}finally{if(!u)throw new Io(t,p??"ENOTDIR")}},ur=(t,u)=>{t=qs(t);let p=u.umask??18,m=u.mode|448,g=(m&p)!==0,y=u.uid,v=u.gid,b=typeof y=="number"&&typeof v=="number"&&(y!==u.processUid||v!==u.processGid),w=u.preserve,E=u.unlink,$=qs(u.cwd),d=u=>{u&&b&&ds(u,y,v),g&&T.chmodSync(t,m)};if(t===$)return Qn($),d();if(w)return d(T.mkdirSync(t,{mode:m,recursive:!0})??void 0);let R=qs(k.relative($,t)).split("/"),O;for(let t=R.shift(),u=$;t&&(u+="/"+t);t=R.shift()){u=qs(k.resolve(u));try{T.mkdirSync(u,m),O=O||u}catch{let t=T.lstatSync(u);if(t.isDirectory())continue;if(E){T.unlinkSync(u),T.mkdirSync(u,m),O=O||u;continue}else if(t.isSymbolicLink())return new No(u,u+"/"+R.join("/"))}}return d(O)};var Do=Object.create(null),Lo=1e4,Mo=new Set,pr=t=>{Mo.has(t)?Mo.delete(t):Do[t]=t.normalize("NFD").toLocaleLowerCase("en").toLocaleUpperCase("en"),Mo.add(t);let u=Do[t],p=Mo.size-Lo;if(p>Lo/10){for(let t of Mo)if(Mo.delete(t),delete Do[t],--p<=0)break}return u};var jo=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Fo=jo==="win32",eo=t=>t.split("/").slice(0,-1).reduce(((t,u)=>{let p=t[t.length-1];return p!==void 0&&(u=(0,k.join)(p,u)),t.push(u||"/"),t}),[]),Uo=class{#i=new Map;#n=new Map;#o=new Set;reserve(t,u){t=Fo?["win32 parallelization disabled"]:t.map((t=>mt((0,k.join)(pr(t)))));let p=new Set(t.map((t=>eo(t))).reduce(((t,u)=>t.concat(u))));this.#n.set(u,{dirs:p,paths:t});for(let p of t){let t=this.#i.get(p);t?t.push(u):this.#i.set(p,[u])}for(let t of p){let p=this.#i.get(t);if(!p)this.#i.set(t,[new Set([u])]);else{let t=p[p.length-1];t instanceof Set?t.add(u):p.push(new Set([u]))}}return this.#c(u)}#a(t){let u=this.#n.get(t);if(!u)throw new Error("function does not have any path reservations");return{paths:u.paths.map((t=>this.#i.get(t))),dirs:[...u.dirs].map((t=>this.#i.get(t)))}}check(t){let{paths:u,dirs:p}=this.#a(t);return u.every((u=>u&&u[0]===t))&&p.every((u=>u&&u[0]instanceof Set&&u[0].has(t)))}#c(t){return this.#o.has(t)||!this.check(t)?!1:(this.#o.add(t),t((()=>this.#l(t))),!0)}#l(t){if(!this.#o.has(t))return!1;let u=this.#n.get(t);if(!u)throw new Error("invalid reservation");let{paths:p,dirs:m}=u,g=new Set;for(let u of p){let p=this.#i.get(u);if(!p||p?.[0]!==t)continue;let m=p[1];if(!m){this.#i.delete(u);continue}if(p.shift(),typeof m=="function")g.add(m);else for(let t of m)g.add(t)}for(let u of m){let p=this.#i.get(u),m=p?.[0];if(!(!p||!(m instanceof Set)))if(m.size===1&&p.length===1){this.#i.delete(u);continue}else if(m.size===1){p.shift();let t=p[0];typeof t=="function"&&g.add(t)}else m.delete(t)}return this.#o.delete(t),g.forEach((t=>this.#c(t))),!0}};var wr=()=>process.umask();var Bo=Symbol("onEntry"),Ho=Symbol("checkFs"),Vo=Symbol("checkFs2"),zo=Symbol("isReusable"),Go=Symbol("makeFs"),qo=Symbol("file"),Wo=Symbol("directory"),Ko=Symbol("link"),Yo=Symbol("symlink"),Zo=Symbol("hardlink"),Xo=Symbol("ensureNoSymlink"),Jo=Symbol("unsupported"),Qo=Symbol("checkPath"),ea=Symbol("stripAbsolutePath"),ta=Symbol("mkdir"),ra=Symbol("onError"),sa=Symbol("pending"),ia=Symbol("pend"),na=Symbol("unpend"),oa=Symbol("ended"),aa=Symbol("maybeClose"),ca=Symbol("skip"),la=Symbol("doChown"),ua=Symbol("uid"),ha=Symbol("gid"),da=Symbol("checkedCwd"),fa=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,pa=fa==="win32",ma=1024,no=(t,u)=>{if(!pa)return T.unlink(t,u);let p=t+".DELETE."+(0,C.randomBytes)(16).toString("hex");T.rename(t,p,(t=>{if(t)return u(t);T.unlink(p,u)}))},oo=t=>{if(!pa)return T.unlinkSync(t);let u=t+".DELETE."+(0,C.randomBytes)(16).toString("hex");T.renameSync(t,u),T.unlinkSync(u)},Tr=(t,u,p)=>t!==void 0&&t===t>>>0?t:u!==void 0&&u===u>>>0?u:p,ga=class extends ki{[oa]=!1;[da]=!1;[sa]=0;reservations=new Uo;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(t={}){if(t.ondone=()=>{this[oa]=!0,this[aa]()},super(t),this.transform=t.transform,this.chmod=!!t.chmod,typeof t.uid=="number"||typeof t.gid=="number"){if(typeof t.uid!="number"||typeof t.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(t.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=t.uid,this.gid=t.gid,this.setOwner=!0}else this.uid=void 0,this.gid=void 0,this.setOwner=!1;t.preserveOwner===void 0&&typeof t.uid!="number"?this.preserveOwner=!!(process.getuid&&process.getuid()===0):this.preserveOwner=!!t.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 t.maxDepth=="number"?t.maxDepth:ma,this.forceChown=t.forceChown===!0,this.win32=!!t.win32||pa,this.newer=!!t.newer,this.keep=!!t.keep,this.noMtime=!!t.noMtime,this.preservePaths=!!t.preservePaths,this.unlink=!!t.unlink,this.cwd=qs(k.resolve(t.cwd||process.cwd())),this.strip=Number(t.strip)||0,this.processUmask=this.chmod?typeof t.processUmask=="number"?t.processUmask:wr():0,this.umask=typeof t.umask=="number"?t.umask:this.processUmask,this.dmode=t.dmode||511&~this.umask,this.fmode=t.fmode||438&~this.umask,this.on("entry",(t=>this[Bo](t)))}warn(t,u,p={}){return(t==="TAR_BAD_ARCHIVE"||t==="TAR_ABORT")&&(p.recoverable=!1),super.warn(t,u,p)}[aa](){this[oa]&&this[sa]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[ea](t,u){let p=t[u],{type:m}=t;if(!p||this.preservePaths)return!0;let[g,y]=ce(p),v=y.replace(/\\/g,"/").split("/");if(v.includes("..")||pa&&/^[a-z]:\.\.$/i.test(v[0]??"")){if(u==="path"||m==="Link")return this.warn("TAR_ENTRY_ERROR",`${u} contains '..'`,{entry:t,[u]:p}),!1;{let m=k.posix.dirname(t.path),g=k.posix.normalize(k.posix.join(m,v.join("/")));if(g.startsWith("../")||g==="..")return this.warn("TAR_ENTRY_ERROR",`${u} escapes extraction directory`,{entry:t,[u]:p}),!1}}return g&&(t[u]=String(y),this.warn("TAR_ENTRY_INFO",`stripping ${g} from absolute ${u}`,{entry:t,[u]:p})),!0}[Qo](t){let u=qs(t.path),p=u.split("/");if(this.strip){if(p.length<this.strip)return!1;if(t.type==="Link"){let u=qs(String(t.linkpath)).split("/");if(u.length>=this.strip)t.linkpath=u.slice(this.strip).join("/");else return!1}p.splice(0,this.strip),t.path=p.join("/")}if(isFinite(this.maxDepth)&&p.length>this.maxDepth)return this.warn("TAR_ENTRY_ERROR","path excessively deep",{entry:t,path:u,depth:p.length,maxDepth:this.maxDepth}),!1;if(!this[ea](t,"path")||!this[ea](t,"linkpath"))return!1;if(k.isAbsolute(t.path)?t.absolute=qs(k.resolve(t.path)):t.absolute=qs(k.resolve(this.cwd,t.path)),!this.preservePaths&&typeof t.absolute=="string"&&t.absolute.indexOf(this.cwd+"/")!==0&&t.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:t,path:qs(t.path),resolvedPath:t.absolute,cwd:this.cwd}),!1;if(t.absolute===this.cwd&&t.type!=="Directory"&&t.type!=="GNUDumpDir")return!1;if(this.win32){let{root:u}=k.win32.parse(String(t.absolute));t.absolute=u+$i(String(t.absolute).slice(u.length));let{root:p}=k.win32.parse(t.path);t.path=p+$i(t.path.slice(p.length))}return!0}[Bo](t){if(!this[Qo](t))return t.resume();switch(I.equal(typeof t.absolute,"string"),t.type){case"Directory":case"GNUDumpDir":t.mode&&(t.mode=t.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[Ho](t);default:return this[Jo](t)}}[ra](t,u){t.name==="CwdError"?this.emit("error",t):(this.warn("TAR_ENTRY_ERROR",t,{entry:u}),this[na](),u.resume())}[ta](t,u,p){fr(qs(t),{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:u},p)}[la](t){return this.forceChown||this.preserveOwner&&(typeof t.uid=="number"&&t.uid!==this.processUid||typeof t.gid=="number"&&t.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[ua](t){return Tr(this.uid,t.uid,this.processUid)}[ha](t){return Tr(this.gid,t.gid,this.processGid)}[qo](t,u){let p=typeof t.mode=="number"?t.mode&4095:this.fmode,m=new ss(String(t.absolute),{flags:Co(t.size),mode:p,autoClose:!1});m.on("error",(p=>{m.fd&&T.close(m.fd,(()=>{})),m.write=()=>!0,this[ra](p,t),u()}));let g=1,o=p=>{if(p){m.fd&&T.close(m.fd,(()=>{})),this[ra](p,t),u();return}--g===0&&m.fd!==void 0&&T.close(m.fd,(p=>{p?this[ra](p,t):this[na](),u()}))};m.on("finish",(()=>{let u=String(t.absolute),p=m.fd;if(typeof p=="number"&&t.mtime&&!this.noMtime){g++;let m=t.atime||new Date,y=t.mtime;T.futimes(p,m,y,(t=>t?T.utimes(u,m,y,(u=>o(u&&t))):o()))}if(typeof p=="number"&&this[la](t)){g++;let m=this[ua](t),y=this[ha](t);typeof m=="number"&&typeof y=="number"&&T.fchown(p,m,y,(t=>t?T.chown(u,m,y,(u=>o(u&&t))):o()))}o()}));let y=this.transform&&this.transform(t)||t;y!==t&&(y.on("error",(p=>{this[ra](p,t),u()})),t.pipe(y)),y.pipe(m)}[Wo](t,u){let p=typeof t.mode=="number"?t.mode&4095:this.dmode;this[ta](String(t.absolute),p,(p=>{if(p){this[ra](p,t),u();return}let m=1,o=()=>{--m===0&&(u(),this[na](),t.resume())};t.mtime&&!this.noMtime&&(m++,T.utimes(String(t.absolute),t.atime||new Date,t.mtime,o)),this[la](t)&&(m++,T.chown(String(t.absolute),Number(this[ua](t)),Number(this[ha](t)),o)),o()}))}[Jo](t){t.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${t.type}`,{entry:t}),t.resume()}[Yo](t,u){let p=qs(k.relative(this.cwd,k.resolve(k.dirname(String(t.absolute)),String(t.linkpath)))).split("/");this[Xo](t,this.cwd,p,(()=>this[Ko](t,String(t.linkpath),"symlink",u)),(p=>{this[ra](p,t),u()}))}[Zo](t,u){let p=qs(k.resolve(this.cwd,String(t.linkpath))),m=qs(String(t.linkpath)).split("/");this[Xo](t,this.cwd,m,(()=>this[Ko](t,p,"link",u)),(p=>{this[ra](p,t),u()}))}[Xo](t,u,p,m,g){let y=p.shift();if(this.preservePaths||y===void 0)return m();let v=k.resolve(u,y);T.lstat(v,((u,y)=>{if(u)return m();if(y?.isSymbolicLink())return g(new No(v,k.resolve(v,p.join("/"))));this[Xo](t,v,p,m,g)}))}[ia](){this[sa]++}[na](){this[sa]--,this[aa]()}[ca](t){this[na](),t.resume()}[zo](t,u){return t.type==="File"&&!this.unlink&&u.isFile()&&u.nlink<=1&&!pa}[Ho](t){this[ia]();let u=[t.path];t.linkpath&&u.push(t.linkpath),this.reservations.reserve(u,(u=>this[Vo](t,u)))}[Vo](t,u){let i=t=>{u(t)},r=()=>{this[ta](this.cwd,this.dmode,(u=>{if(u){this[ra](u,t),i();return}this[da]=!0,n()}))},n=()=>{if(t.absolute!==this.cwd){let u=qs(k.dirname(String(t.absolute)));if(u!==this.cwd)return this[ta](u,this.dmode,(u=>{if(u){this[ra](u,t),i();return}o()}))}o()},o=()=>{T.lstat(String(t.absolute),((u,p)=>{if(p&&(this.keep||this.newer&&p.mtime>(t.mtime??p.mtime))){this[ca](t),i();return}if(u||this[zo](t,p))return this[Go](null,t,i);if(p.isDirectory()){if(t.type==="Directory"){let u=this.chmod&&t.mode&&(p.mode&4095)!==t.mode,c=u=>this[Go](u??null,t,i);return u?T.chmod(String(t.absolute),Number(t.mode),c):c()}if(t.absolute!==this.cwd)return T.rmdir(String(t.absolute),(u=>this[Go](u??null,t,i)))}if(t.absolute===this.cwd)return this[Go](null,t,i);no(String(t.absolute),(u=>this[Go](u??null,t,i)))}))};this[da]?n():r()}[Go](t,u,p){if(t){this[ra](t,u),p();return}switch(u.type){case"File":case"OldFile":case"ContiguousFile":return this[qo](u,p);case"Link":return this[Zo](u,p);case"SymbolicLink":return this[Yo](u,p);case"Directory":case"GNUDumpDir":return this[Wo](u,p)}}[Ko](t,u,p,m){T[p](u,String(t.absolute),(u=>{u?this[ra](u,t):(this[na](),t.resume()),m()}))}},Se=t=>{try{return[null,t()]}catch(t){return[t,null]}},ya=class extends ga{sync=!0;[Go](t,u){return super[Go](t,u,(()=>{}))}[Ho](t){if(!this[da]){let u=this[ta](this.cwd,this.dmode);if(u)return this[ra](u,t);this[da]=!0}if(t.absolute!==this.cwd){let u=qs(k.dirname(String(t.absolute)));if(u!==this.cwd){let p=this[ta](u,this.dmode);if(p)return this[ra](p,t)}}let[u,p]=Se((()=>T.lstatSync(String(t.absolute))));if(p&&(this.keep||this.newer&&p.mtime>(t.mtime??p.mtime)))return this[ca](t);if(u||this[zo](t,p))return this[Go](null,t);if(p.isDirectory()){if(t.type==="Directory"){let u=this.chmod&&t.mode&&(p.mode&4095)!==t.mode,[m]=u?Se((()=>{T.chmodSync(String(t.absolute),Number(t.mode))})):[];return this[Go](m,t)}let[u]=Se((()=>T.rmdirSync(String(t.absolute))));this[Go](u,t)}let[m]=t.absolute===this.cwd?[]:Se((()=>oo(String(t.absolute))));this[Go](m,t)}[qo](t,u){let p=typeof t.mode=="number"?t.mode&4095:this.fmode,r=p=>{let g;try{T.closeSync(m)}catch(t){g=t}(p||g)&&this[ra](p||g,t),u()},m;try{m=T.openSync(String(t.absolute),Co(t.size),p)}catch(t){return r(t)}let g=this.transform&&this.transform(t)||t;g!==t&&(g.on("error",(u=>this[ra](u,t))),t.pipe(g)),g.on("data",(t=>{try{T.writeSync(m,t,0,t.length)}catch(t){r(t)}})),g.on("end",(()=>{let u=null;if(t.mtime&&!this.noMtime){let p=t.atime||new Date,g=t.mtime;try{T.futimesSync(m,p,g)}catch(m){try{T.utimesSync(String(t.absolute),p,g)}catch{u=m}}}if(this[la](t)){let p=this[ua](t),g=this[ha](t);try{T.fchownSync(m,Number(p),Number(g))}catch(m){try{T.chownSync(String(t.absolute),Number(p),Number(g))}catch{u=u||m}}}r(u)}))}[Wo](t,u){let p=typeof t.mode=="number"?t.mode&4095:this.dmode,m=this[ta](String(t.absolute),p);if(m){this[ra](m,t),u();return}if(t.mtime&&!this.noMtime)try{T.utimesSync(String(t.absolute),t.atime||new Date,t.mtime)}catch{}if(this[la](t))try{T.chownSync(String(t.absolute),Number(this[ua](t)),Number(this[ha](t)))}catch{}u(),t.resume()}[ta](t,u){try{return ur(qs(t),{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:u})}catch(t){return t}}[Xo](t,u,p,m,g){if(this.preservePaths||!p.length)return m();let y=u;for(let t of p){y=k.resolve(y,t);let[v,b]=Se((()=>T.lstatSync(y)));if(v)return m();if(b.isSymbolicLink())return g(new No(y,k.resolve(u,p.join("/"))))}m()}[Ko](t,u,p,m){let g=`${p}Sync`;try{T[g](u,String(t.absolute)),m(),t.resume()}catch(u){return this[ra](u,t)}}};var ho=t=>{let u=new ya(t),p=t.file,m=T.statSync(p),g=t.maxReadSize||16*1024*1024;new rs(p,{readSize:g,size:m.size}).pipe(u)},ao=(t,u)=>{let p=new ga(t),m=t.maxReadSize||16*1024*1024,g=t.file;return new Promise(((t,u)=>{p.on("error",u),p.on("close",t),T.stat(g,((t,y)=>{if(t)u(t);else{let t=new ts(g,{readSize:m,size:y.size});t.on("error",u),t.pipe(p)}}))}))},va=K(ho,ao,(t=>new ya(t)),(t=>new ga(t)),((t,u)=>{u?.length&&Yi(t,u)}));var co=(t,u)=>{let p=new bo(t),m=!0,g,y;try{try{g=T.openSync(t.file,"r+")}catch(u){if(u?.code==="ENOENT")g=T.openSync(t.file,"w+");else throw u}let v=T.fstatSync(g),b=Buffer.alloc(512);e:for(y=0;y<v.size;y+=512){for(let t=0,u=0;t<512;t+=u){if(u=T.readSync(g,b,t,b.length-t,y+t),y===0&&b[0]===31&&b[1]===139)throw new Error("cannot append to compressed archives");if(!u)break e}let u=new Ls(b);if(!u.cksumValid)break;let p=512*Math.ceil((u.size||0)/512);if(y+p+512>v.size)break;y+=p,t.mtimeCache&&u.mtime&&t.mtimeCache.set(String(u.path),u.mtime)}m=!1,fo(t,p,y,g,u)}finally{if(m)try{T.closeSync(g)}catch{}}},fo=(t,u,p,m,g)=>{let y=new is(t.file,{fd:m,start:p});u.pipe(y),mo(u,g)},uo=(t,u)=>{u=Array.from(u);let p=new _o(t),i=(u,p,m)=>{let a=(t,p)=>{t?T.close(u,(u=>m(t))):m(null,p)},g=0;if(p===0)return a(null,0);let y=0,v=Buffer.alloc(512),S=(m,b)=>{if(m||typeof b>"u")return a(m);if(y+=b,y<512&&b)return T.read(u,v,y,v.length-y,g+y,S);if(g===0&&v[0]===31&&v[1]===139)return a(new Error("cannot append to compressed archives"));if(y<512)return a(null,g);let w=new Ls(v);if(!w.cksumValid)return a(null,g);let E=512*Math.ceil((w.size??0)/512);if(g+E+512>p||(g+=E+512,g>=p))return a(null,g);t.mtimeCache&&w.mtime&&t.mtimeCache.set(String(w.path),w.mtime),y=0,T.read(u,v,0,512,g,S)};T.read(u,v,0,512,g,S)};return new Promise(((m,g)=>{p.on("error",g);let y="r+",a=(v,b)=>{if(v&&v.code==="ENOENT"&&y==="r+")return y="w+",T.open(t.file,y,a);if(v||!b)return g(v);T.fstat(b,((y,v)=>{if(y)return T.close(b,(()=>g(y)));i(b,v.size,((y,v)=>{if(y)return g(y);let w=new ss(t.file,{fd:b,start:v});p.pipe(w),w.on("error",g),w.on("close",m),po(p,u)}))}))};T.open(t.file,y,a)}))},mo=(t,u)=>{u.forEach((u=>{u.charAt(0)==="@"?Ci({file:k.resolve(t.cwd,u.slice(1)),sync:!0,noResume:!0,onReadEntry:u=>t.add(u)}):t.add(u)})),t.end()},po=async(t,u)=>{for(let p=0;p<u.length;p++){let m=String(u[p]);m.charAt(0)==="@"?await Ci({file:k.resolve(String(t.cwd),m.slice(1)),noResume:!0,onReadEntry:u=>t.add(u)}):t.add(m)}t.end()},_a=K(co,uo,(()=>{throw new TypeError("file is required")}),(()=>{throw new TypeError("file is required")}),((t,u)=>{if(!ks(t))throw new TypeError("file is required");if(t.gzip||t.brotli||t.zstd||t.file.endsWith(".br")||t.file.endsWith(".tbr"))throw new TypeError("cannot append to compressed archives");if(!u?.length)throw new TypeError("no paths specified to add/replace")}));var ba=K(_a.syncFile,_a.asyncFile,_a.syncNoFile,_a.asyncNoFile,((t,u=[])=>{_a.validate?.(t,u),wo(t)})),wo=t=>{let u=t.filter;t.mtimeCache||(t.mtimeCache=new Map),t.filter=u?(p,m)=>u(p,m)&&!((t.mtimeCache?.get(p)??m.mtime??0)>(m.mtime??0)):(u,p)=>!((t.mtimeCache?.get(u)??p.mtime??0)>(p.mtime??0))};async function isUrlOk(t){try{const u=await fetch(t,{method:"HEAD"});return u.status===200}catch{return false}}async function getRepoInfo(t,u){const[,p,m,g,y,...v]=t.pathname.split("/");const b=u?u.replace(/^\//,""):v.join("/");if(g===undefined||g===""&&y===undefined){try{const t=await fetch(`https://api.github.com/repos/${p}/${m}`);if(t.status!==200){return}const u=await t.json();return{username:p,name:m,branch:u["default_branch"],filePath:b}}catch{return}}const w=u?`${y}/${v.join("/")}`.replace(new RegExp(`/${b}|/$`),""):y;if(p&&m&&w&&g==="tree"){return{username:p,name:m,branch:w,filePath:b}}}function hasRepo({username:t,name:u,branch:p,filePath:m}){const g=`https://api.github.com/repos/${t}/${u}/contents`;const y=`${m?`/${m}`:""}/package.json`;return isUrlOk(`${g+y}?ref=${p}`)}function existsInRepo(t){try{const u=new URL(t);return isUrlOk(u.href)}catch{return isUrlOk(`https://api.github.com/repos/zuplo/zuplo/contents/examples/${encodeURIComponent(t)}`)}}async function downloadTarStream(t,u=50*1024*1024){const p=await fetch(t);if(!p.body){throw new Error(`Failed to download: ${t}`)}const m=p.headers.get("content-length");if(m&&parseInt(m,10)>u){throw new Error(`File too large! ${m} bytes exceeds limit of ${u} bytes`)}const g=p.body;const y=et.Readable.fromWeb(g);let v=0;const b=new et.Transform({transform(t,p,m){v+=t.length;if(v>u){return m(new Error(`Download aborted! File size exceeded ${u} bytes`))}m(null,t)}});return y.pipe(b)}async function downloadAndExtractRepo(t,{username:u,name:p,branch:m,filePath:g},y){const v=`https://codeload.github.com/${u}/${p}/tar.gz/${m}`;if(y){console.log(`Downloading repo from ${v}`)}let b=null;await(0,tt.pipeline)(await downloadTarStream(v),va({cwd:t,strip:g?g.split("/").length+1:1,filter:t=>{if(b===null){const u=t.split(ze.sep);b=u.length?u[0]:null}return t.startsWith(`${b}${g?`/${g}/`:"/"}`)}}))}async function downloadAndExtractExample(t,u,p){if(u==="__internal-testing-retry"){throw new Error("This is an internal example for testing the CLI.")}const m="https://codeload.github.com/zuplo/zuplo/tar.gz/main";if(p){console.log(`Downloading example from ${m}`)}await(0,tt.pipeline)(await downloadTarStream(m),va({cwd:t,strip:2+u.split("/").length,filter:t=>t.includes(`zuplo-main/examples/${u}/`)}))}function isInGitRepository(){try{(0,Qe.execSync)("git rev-parse --is-inside-work-tree",{stdio:"ignore"});return true}catch{}return false}function isInMercurialRepository(){try{(0,Qe.execSync)("hg --cwd . root",{stdio:"ignore"});return true}catch{}return false}function isDefaultBranchSet(){try{(0,Qe.execSync)("git config init.defaultBranch",{stdio:"ignore"});return true}catch{}return false}function tryGitInit(t,u){let p=false;const m=u?"inherit":"ignore";try{(0,Qe.execSync)("git --version",{stdio:m});if(isInGitRepository()||isInMercurialRepository()){return false}(0,Qe.execSync)("git init",{stdio:m});p=true;if(!isDefaultBranchSet()){(0,Qe.execSync)("git checkout -b main",{stdio:m})}(0,Qe.execSync)("git add -A",{stdio:m});(0,Qe.execSync)('git commit -m "Initial commit from Create Next App"',{stdio:m});return true}catch(m){if(u){console.error("Git init failed:",m)}if(p){try{(0,Ve.rmSync)((0,ze.join)(t,".git"),{recursive:true,force:true})}catch{}}return false}}var wa=__nccwpck_require__(4791);var Ea=__nccwpck_require__.n(wa);async function install(t,u,p){const m=["install"];if(!u){console.log((0,qe.yellow)("You appear to be offline.\nFalling back to the local cache."));m.push("--offline")}else if(t==="npm"){m.push("--prefer-offline");m.push("--no-audit");m.push("--no-fund")}if(p){m.push("--verbose")}return new Promise(((u,p)=>{const g=Ea()(t,m,{stdio:"inherit",env:{...process.env,ADBLOCK:"1",NODE_ENV:"development",DISABLE_OPENCOLLECTIVE:"1"}});g.on("close",(g=>{if(g!==0){p({command:`${t} ${m.join(" ")}`});return}u()}))}))}function isFolderEmpty(t,u){const p=[".DS_Store",".git",".gitattributes",".gitignore",".gitlab-ci.yml",".hg",".hgcheck",".hgignore",".idea",".npmignore",".travis.yml","LICENSE","Thumbs.db","docs","mkdocs.yml","npm-debug.log","yarn-debug.log","yarn-error.log","yarnrc.yml",".yarn"];const m=(0,Ve.readdirSync)(t).filter((t=>!p.includes(t)&&!/\.iml$/.test(t)));if(m.length>0){console.log(`The directory ${(0,qe.green)(u)} contains files that could conflict:`);console.log();for(const u of m){try{const p=(0,Ve.lstatSync)((0,ze.join)(t,u));if(p.isDirectory()){console.log(` ${(0,qe.blue)(u)}/`)}else{console.log(` ${u}`)}}catch{console.log(` ${u}`)}}console.log();console.log("Either try using a new directory name, or remove the files listed above.");console.log();return false}return true}const Sa=require("dns/promises");var $a=__nccwpck_require__(7016);var Ra=__nccwpck_require__.n($a);function getProxy(){if(process.env.https_proxy){return process.env.https_proxy}try{const t=(0,Qe.execSync)("npm config get https-proxy").toString().trim();return t!=="null"?t:undefined}catch{return}}async function getOnline(){try{await(0,Sa.lookup)("registry.yarnpkg.com");return true}catch{const t=getProxy();if(!t){return false}const{hostname:u}=Ra().parse(t);if(!u){return false}try{await(0,Sa.lookup)(u);return true}catch{return false}}}const Oa=require("constants");const Pa=require("fs/promises");var xa=__nccwpck_require__.n(Pa);async function isWriteable(t){try{await(0,Pa.access)(t,Oa.W_OK);return true}catch{return false}}var Aa=__nccwpck_require__(857);var Ta=__nccwpck_require__.n(Aa);var ka=__nccwpck_require__(4761);const identity=t=>t;const copy=async(t,u,{cwd:p,rename:m=identity,parents:g=true,verbose:y=false}={})=>{const v=typeof t==="string"?[t]:t;if(v.length===0||!u){throw new TypeError("`src` and `dest` are required")}const b=await(0,ka.async)(v,{cwd:p,dot:true,absolute:false,stats:false});const w=p?(0,ze.resolve)(p,u):u;return Promise.all(b.map((async t=>{const u=(0,ze.dirname)(t);const v=m((0,ze.basename)(t),t);const b=p?(0,ze.resolve)(p,t):t;const E=g?(0,ze.join)(w,u,v):(0,ze.join)(w,v);await(0,Pa.mkdir)((0,ze.dirname)(E),{recursive:true});if(y){console.log(`Copying ${b} to ${E}`)}return(0,Pa.copyFile)(b,E)})))};const getTemplateFile=({template:t,file:u})=>__nccwpck_require__.ab+"templates/"+t+"/"+u;const installTemplate=async({appName:t,root:u,packageManager:p,isOnline:m,template:g,eslint:y,prettier:v,installPackages:b,verbose:w,zuploVersion:E})=>{var $;console.log((0,qe.bold)(`Using ${p}.`));console.log("\nInitializing project with template:",g,"\n");const R=__nccwpck_require__.ab+"templates/"+g;const O=["**","!vscode/**"];if(!y)O.push("!eslintrc.json");if(!v)O.push("!prettierrc.json");await copy(O,u,{parents:true,cwd:R,verbose:w,rename(t){switch(t){case"gitignore":case"eslintrc.json":case"prettierrc.json":{return`.${t}`}case"README-template.md":{return"README.md"}default:{return t}}}});const P=["settings.json","launch.json"];for(const t of P){const p=Ge().join(R,"vscode",t);const m=Ge().join(u,".vscode",t);if((0,Ve.existsSync)(p)){await xa().mkdir(Ge().join(u,".vscode"),{recursive:true});await xa().copyFile(p,m)}}const x=($=process.env.ZUPLO_PRIVATE_TEST_VERSION)!==null&&$!==void 0?$:E;const A=new Te.SemVer(x);const T={name:t,version:"0.1.0",type:"module",private:true,scripts:{dev:`zuplo dev`,test:"zuplo test",docs:"zuplo docs",...y?{lint:"eslint"}:{}},dependencies:{zuplo:`^${A.major}`},devDependencies:{typescript:"^5","@types/node":"^22"}};if(y){T.devDependencies={...T.devDependencies,eslint:"^8","@typescript-eslint/eslint-plugin":"^8","@typescript-eslint/parser":"^8"}}if(v){T.devDependencies={...T.devDependencies,prettier:"^3"}}if(y&&v){T.devDependencies={...T.devDependencies,"eslint-config-prettier":"^9"};const t=Ge().join(u,".eslintrc.json");const p=await xa().readFile(t,"utf-8").then(JSON.parse);p.extends.push("prettier");await xa().writeFile(t,JSON.stringify(p,null,2)+Ta().EOL,"utf-8")}T.workspaces=["docs"];const sortObjectKeys=t=>Object.keys(t).sort().reduce(((u,p)=>{u[p]=t[p];return u}),{});if(T.dependencies){T.dependencies=sortObjectKeys(T.dependencies)}if(T.devDependencies){T.devDependencies=sortObjectKeys(T.devDependencies)}const k=Object.keys(T.devDependencies).length;if(!k)delete T.devDependencies;await xa().writeFile(Ge().join(u,"package.json"),JSON.stringify(T,null,2)+Ta().EOL);let C="^0.53";if(m){try{const t=await fetch("https://api.github.com/repos/zuplo/zudoku/releases/latest");const u=await t.json();const p=u.tag_name.replace("v","");const m=new Te.SemVer(p);C=`^${m.major}.${m.minor}`}catch{console.warn("\nFailed to determine the latest dev portal version. Using the default version.")}}let I="latest";if(m){try{const t=await fetch("https://registry.npmjs.org/@zuplo/zudoku-plugin-monetization/latest");const u=await t.json();const p=new Te.SemVer(u.version);I=`^${p.major}.${p.minor}`}catch{console.warn("\nFailed to determine the latest monetization plugin version. Using the default version.")}}const N={name:"docs",version:"0.1.0",type:"module",private:true,scripts:{dev:"zudoku dev --zuplo",build:"zudoku build --zuplo",...y?{lint:"eslint"}:{}},dependencies:{react:"^19","react-dom":"^19","@mdx-js/react":"3.0.1","@zuplo/zudoku-plugin-monetization":I,zudoku:C},devDependencies:{"@types/node":"^22","@types/react":"^19","@types/react-dom":"^19",typescript:"^5"}};await xa().writeFile(Ge().join(u,"docs","package.json"),JSON.stringify(N,null,2)+Ta().EOL);if(!b)return;console.log("\nInstalling dependencies:");for(const t in T.dependencies)console.log(`- ${(0,qe.cyan)(t)}`);if(k){console.log("\nInstalling devDependencies:");for(const t in T.devDependencies)console.log(`- ${(0,qe.cyan)(t)}`)}console.log();await install(p,m,w)};class DownloadError extends Error{}async function runZuploInit(t,u){return new Promise(((p,m)=>{const g=["zuplo","init",t];if(u){g.push("--yes")}console.log();console.log("Initializing Zuplo platform resources...");console.log();const y=process.platform==="win32"?"npx.cmd":"npx";const v=(0,Qe.spawn)(y,g,{stdio:"inherit"});v.on("close",((t,u)=>{if(t===0){p();return}let g;if(t!==null&&t!==undefined){g=`exited with code ${t}`}else if(u){g=`was terminated by signal ${u}`}else{g="exited unsuccessfully"}m(new Error(`Failed to initialize Zuplo platform resources: "zuplo init" ${g}. See the output above for details.`))}));v.on("error",(t=>{m(t)}))}))}async function createApp({appPath:t,packageManager:u,example:p,examplePath:m,eslint:g,prettier:y,installPackages:v,empty:b,initGit:w,verbose:E,zuploVersion:$,runInit:R,skipPrompts:O}){let P;const x=`default${b?"-empty":""}`;if(p){let M;try{M=new URL(p)}catch(j){const U=j;if(U.code!=="ERR_INVALID_URL"){console.error(j);process.exit(1)}}if(M){if(M.origin!=="https://github.com"){console.error(`Invalid URL: ${(0,qe.red)(`"${p}"`)}. Only GitHub repositories are supported. Please use a GitHub URL and try again.`);process.exit(1)}P=await getRepoInfo(M,m);if(!P){console.error(`Found invalid GitHub URL: ${(0,qe.red)(`"${p}"`)}. Please fix the URL and try again.`);process.exit(1)}const B=await hasRepo(P);if(!B){console.error(`Could not locate the repository for ${(0,qe.red)(`"${p}"`)}. Please check that the repository exists and try again.`);process.exit(1)}}else if(p!=="__internal-testing-retry"){const H=await existsInRepo(p);if(!H){console.error(`Could not locate an example named ${(0,qe.red)(`"${p}"`)}. It could be due to the following:\n`,`1. Your spelling of example ${(0,qe.red)(`"${p}"`)} might be incorrect.\n`,`2. You might not be connected to the internet or you are behind a proxy.`);process.exit(1)}}}const A=(0,ze.resolve)(t);if(!await isWriteable((0,ze.dirname)(A))){console.error("The application path is not writable, please check folder permissions and try again.");console.error("It is likely you do not have write permissions for this folder.");process.exit(1)}const T=(0,ze.basename)(A);(0,Ve.mkdirSync)(A,{recursive:true});if(!isFolderEmpty(A,T)){process.exit(1)}const k=u==="yarn";const C=!k||await getOnline();const I=process.cwd();console.log(`Creating a new Zuplo API in ${(0,qe.green)(A)}.`);console.log();process.chdir(A);const N=(0,ze.join)(A,"package.json");let D=false;if(p){try{if(P){const z=P;console.log(`Downloading files from repo ${(0,qe.cyan)(p)}. This might take a moment.`);console.log();await Je()((()=>downloadAndExtractRepo(A,z,E)),{retries:3})}else{console.log(`Downloading files for example ${(0,qe.cyan)(p)}. This might take a moment.`);console.log();await Je()((()=>downloadAndExtractExample(A,p,E)),{retries:3})}}catch(G){function isErrorLike(t){return typeof t==="object"&&t!==null&&typeof t.message==="string"}throw new DownloadError(isErrorLike(G)?G.message:`${G}`)}const V=(0,ze.join)(A,".gitignore");if(!(0,Ve.existsSync)(V)){(0,Ve.copyFileSync)(getTemplateFile({template:x,file:"gitignore"}),V)}D=(0,Ve.existsSync)(N);if(v&&D){console.log("Installing packages. This might take a couple of minutes.");console.log();await install(u,C,E);console.log()}}else{await installTemplate({appName:T,root:A,template:x,packageManager:u,isOnline:C,eslint:g,prettier:y,installPackages:v,verbose:E,zuploVersion:$})}if(w){if(tryGitInit(A,E)){console.log("Initialized a git repository.");console.log()}}let L;if((0,ze.join)(I,T)===t){L=T}else{L=t}console.log(`${(0,qe.green)("Success!")} Created ${T} at ${t}`);if(R){try{await runZuploInit(A,O)}catch(q){console.log();console.log(`${(0,qe.red)("Note:")} Failed to initialize Zuplo platform resources.`);console.log("You can run 'zuplo init' later to set up your project on the platform.");console.log()}}if(D){console.log("Inside that directory, you can run several commands:");console.log();console.log((0,qe.cyan)(` ${u} ${k?"":"run "}dev`));console.log(" Starts the development server.");console.log();console.log((0,qe.cyan)(` ${u} ${k?"":"run "}build`));console.log(" Builds the app for production.");console.log();console.log((0,qe.cyan)(` ${u} start`));console.log(" Runs the built app in production mode.");console.log();console.log("We suggest that you begin by typing:");console.log();console.log((0,qe.cyan)(" cd"),L);console.log(` ${(0,qe.cyan)(`${u} ${k?"":"run "}dev`)}`)}console.log()}function getPkgManager(){var t;const u=(t=process.env.npm_config_user_agent)!==null&&t!==void 0?t:"";if(u.startsWith("yarn")){return"yarn"}if(u.startsWith("pnpm")){return"pnpm"}if(u.startsWith("bun")){return"bun"}return"npm"}var Ca=__nccwpck_require__(7825);var Ia=__nccwpck_require__.n(Ca);function validateNpmName(t){const u=Ia()(t);if(u.validForNewPackages){return{valid:true}}return{valid:false,problems:[...u.errors||[],...u.warnings||[]]}}let Na="";const handleSigTerm=()=>process.exit(0);process.on("SIGINT",handleSigTerm);process.on("SIGTERM",handleSigTerm);const onPromptState=t=>{if(t.aborted){process.stdout.write("[?25h");process.stdout.write("\n");process.exit(1)}};const Da=JSON.parse((0,Ve.readFileSync)(Ge().resolve(__dirname,Ge().join("..","package.json")),"utf-8"));const La=new $(Da.name).version(Da.version,"-v, --version","Output the current version of create-zuplo-api.").argument("[directory]").usage("[directory] [options]").helpOption("-h, --help","Display this help message.").option("--eslint","Initialize with ESLint config.").option("--prettier","Initialize with Prettier config.").option("--empty","Initialize an empty project.").option("--use-npm","Explicitly tell the CLI to bootstrap the application using npm.").option("--use-pnpm","Explicitly tell the CLI to bootstrap the application using pnpm.").option("--use-yarn","Explicitly tell the CLI to bootstrap the application using Yarn.").option("--use-bun","Explicitly tell the CLI to bootstrap the application using Bun.").option("--reset, --reset-preferences","Reset the preferences saved for create-zuplo-api.").option("--git","Whether or not to initialize the project as a git repo.").option("--version-check","Whether or not to check for an outdated version.").option("--install","Whether or not to install packages.").option("--verbose","Enable verbose logging.",false).option("--yes","Use saved preferences or defaults for unprovided options.").option("--init","Run Zuplo platform initialization after scaffolding (create project and link environment).").option("-e, --example <example-name|github-url>",`\n\n An example to bootstrap the api with. You can use an example name\n from the official Zuplo repo or a public GitHub URL. The URL can use\n any branch and/or subdirectory.\n`).option("--example-path <path-to-example>",`\n\n In a rare case, your GitHub URL might contain a branch name with\n a slash (e.g. bug/fix-1) and the path to the example (e.g. foo/bar).\n In this case, you must specify the path to the example separately:\n --example-path foo/bar\n`).action((t=>{if(t&&!t.startsWith("--no-")){Na=t}})).allowUnknownOption().parse(process.argv);const Ma=La.opts();const{args:ja}=La;const Fa=Ma.useNpm?"npm":Ma.usePnpm?"pnpm":Ma.useYarn?"yarn":Ma.useBun?"bun":getPkgManager();async function run(){var t,p,m,g,y;const v=new Conf({projectName:"create-zuplo-api"});if(Ma.resetPreferences){const{resetPreferences:t}=await Ke()({onState:onPromptState,type:"toggle",name:"resetPreferences",message:"Would you like to reset the saved preferences?",initial:false,active:"Yes",inactive:"No"});if(t){v.clear();console.log("The preferences have been reset successfully!")}process.exit(0)}if(typeof Na==="string"){Na=Na.trim()}if(!Na){const t=await Ke()({onState:onPromptState,type:"text",name:"path",message:"What is your project named?",initial:"my-api",validate:t=>{const u=validateNpmName((0,ze.basename)((0,ze.resolve)(t)));if(u.valid){return true}return`Invalid project name: ${u.problems[0]}`}});if(typeof t.path==="string"){Na=t.path.trim()}}if(!Na){console.log("\nPlease specify the project directory:\n"+` ${(0,qe.cyan)(Ma.name())} ${(0,qe.green)("<project-directory>")}\n`+"For example:\n"+` ${(0,qe.cyan)(Ma.name())} ${(0,qe.green)("my-zuplo-api")}\n\n`+`Run ${(0,qe.cyan)(`${Ma.name()} --help`)} to see all options.`);process.exit(1)}const b=(0,ze.resolve)(Na);const w=(0,ze.basename)(b);const E=validateNpmName(w);if(!E.valid){console.error(`Could not create a project called ${(0,qe.red)(`"${w}"`)} because of npm naming restrictions:`);E.problems.forEach((t=>console.error(` ${(0,qe.red)((0,qe.bold)("*"))} ${t}`)));process.exit(1)}if(Ma.example===true){console.error("Please provide an example name or url, otherwise remove the example option.");process.exit(1)}if((0,Ve.existsSync)(b)&&!isFolderEmpty(b,w)){process.exit(1)}const $=typeof Ma.example==="string"&&Ma.example.trim();const R=v.get("preferences")||{};const O=u().isCI||Ma.yes;if(!$){const t={eslint:true,prettier:true,git:true,install:true,versionCheck:true,empty:false,zudoku:false};const getPrefOrDefault=u=>{var p;return(p=R[u])!==null&&p!==void 0?p:t[u]};if(!Ma.eslint&&!ja.includes("--no-eslint")){if(O){Ma.eslint=getPrefOrDefault("eslint")}else{const t=(0,qe.blue)("ESLint");const{eslint:u}=await Ke()({onState:onPromptState,type:"toggle",name:"eslint",message:`Would you like to use ${t}?`,initial:getPrefOrDefault("eslint"),active:"Yes",inactive:"No"});Ma.eslint=Boolean(u);R.eslint=Boolean(u)}}if(!Ma.prettier&&!ja.includes("--no-prettier")){if(O){Ma.prettier=getPrefOrDefault("prettier")}else{const t=(0,qe.blue)("Prettier");const{prettier:u}=await Ke()({onState:onPromptState,type:"toggle",name:"prettier",message:`Would you like to use ${t}?`,initial:getPrefOrDefault("prettier"),active:"Yes",inactive:"No"});Ma.prettier=Boolean(u);R.prettier=Boolean(u)}}}Ma.git=(t=Ma.git)!==null&&t!==void 0?t:!ja.includes("--no-git");Ma.install=(p=Ma.install)!==null&&p!==void 0?p:!ja.includes("--no-install");Ma.versionCheck=(m=Ma.versionCheck)!==null&&m!==void 0?m:!ja.includes("--no-version-check");try{await createApp({appPath:b,packageManager:Fa,example:$&&$!=="default"?$:undefined,examplePath:Ma.examplePath,eslint:Ma.eslint,prettier:Ma.prettier,installPackages:Ma.install,empty:Ma.empty,initGit:Ma.git,verbose:Ma.verbose,zuploVersion:Da.version,runInit:(g=Ma.init)!==null&&g!==void 0?g:false,skipPrompts:O})}catch(t){if(!(t instanceof DownloadError)){throw t}const u=await Ke()({onState:onPromptState,type:"confirm",name:"builtin",message:`Could not download "${$}" because of a connectivity issue between your machine and GitHub.\n`+`Do you want to use the default template instead?`,initial:true});if(!u.builtin){throw t}await createApp({appPath:b,packageManager:Fa,eslint:Ma.eslint,prettier:Ma.prettier,installPackages:Ma.install,empty:Ma.empty,initGit:Ma.git,verbose:Ma.verbose,zuploVersion:Da.version,runInit:(y=Ma.init)!==null&&y!==void 0?y:false,skipPrompts:O})}v.set("preferences",R);if(Ma.versionCheck){console.log();await notifyUpdate()}}const Ua=Ze()(Da).catch((()=>null));async function notifyUpdate(){var t;try{if((t=await Ua)===null||t===void 0?void 0:t.latest){const t={npm:"npm i -g",yarn:"yarn global add",pnpm:"pnpm add -g",bun:"bun add -g"};const u=`${t[Fa]} create-zuplo-api`;console.log((0,qe.yellow)((0,qe.bold)("A new version of `create-zuplo-api` is available!"))+"\n"+"You can update by running: "+(0,qe.cyan)(u)+"\n")}process.exit(0)}catch{}}async function exit(t){console.log();console.log("Aborting installation.");if(t.command){console.log(` ${(0,qe.cyan)(t.command)} has failed.`)}else{console.log(`${(0,qe.red)("Unexpected error. Please report it as a bug:")}\n`,t)}process.exit(1)}run().catch(exit)})();module.exports=p})();
|
|
72
|
+
*/const m=p(7311);const toRegexRange=(t,u,p)=>{if(m(t)===false){throw new TypeError("toRegexRange: expected the first argument to be a number")}if(u===void 0||t===u){return String(t)}if(m(u)===false){throw new TypeError("toRegexRange: expected the second argument to be a number.")}let g={relaxZeros:true,...p};if(typeof g.strictZeros==="boolean"){g.relaxZeros=g.strictZeros===false}let y=String(g.relaxZeros);let v=String(g.shorthand);let b=String(g.capture);let w=String(g.wrap);let E=t+":"+u+"="+y+v+b+w;if(toRegexRange.cache.hasOwnProperty(E)){return toRegexRange.cache[E].result}let $=Math.min(t,u);let R=Math.max(t,u);if(Math.abs($-R)===1){let p=t+"|"+u;if(g.capture){return`(${p})`}if(g.wrap===false){return p}return`(?:${p})`}let O=hasPadding(t)||hasPadding(u);let P={min:t,max:u,a:$,b:R};let x=[];let A=[];if(O){P.isPadded=O;P.maxLen=String(P.max).length}if($<0){let t=R<0?Math.abs(R):1;A=splitToPatterns(t,Math.abs($),P,g);$=P.a=0}if(R>=0){x=splitToPatterns($,R,P,g)}P.negatives=A;P.positives=x;P.result=collatePatterns(A,x,g);if(g.capture===true){P.result=`(${P.result})`}else if(g.wrap!==false&&x.length+A.length>1){P.result=`(?:${P.result})`}toRegexRange.cache[E]=P;return P.result};function collatePatterns(t,u,p){let m=filterPatterns(t,u,"-",false,p)||[];let g=filterPatterns(u,t,"",false,p)||[];let y=filterPatterns(t,u,"-?",true,p)||[];let v=m.concat(y).concat(g);return v.join("|")}function splitToRanges(t,u){let p=1;let m=1;let g=countNines(t,p);let y=new Set([u]);while(t<=g&&g<=u){y.add(g);p+=1;g=countNines(t,p)}g=countZeros(u+1,m)-1;while(t<g&&g<=u){y.add(g);m+=1;g=countZeros(u+1,m)-1}y=[...y];y.sort(compare);return y}function rangeToPattern(t,u,p){if(t===u){return{pattern:t,count:[],digits:0}}let m=zip(t,u);let g=m.length;let y="";let v=0;for(let t=0;t<g;t++){let[u,g]=m[t];if(u===g){y+=u}else if(u!=="0"||g!=="9"){y+=toCharacterClass(u,g,p)}else{v++}}if(v){y+=p.shorthand===true?"\\d":"[0-9]"}return{pattern:y,count:[v],digits:g}}function splitToPatterns(t,u,p,m){let g=splitToRanges(t,u);let y=[];let v=t;let b;for(let t=0;t<g.length;t++){let u=g[t];let w=rangeToPattern(String(v),String(u),m);let E="";if(!p.isPadded&&b&&b.pattern===w.pattern){if(b.count.length>1){b.count.pop()}b.count.push(w.count[0]);b.string=b.pattern+toQuantifier(b.count);v=u+1;continue}if(p.isPadded){E=padZeros(u,p,m)}w.string=E+w.pattern+toQuantifier(w.count);y.push(w);v=u+1;b=w}return y}function filterPatterns(t,u,p,m,g){let y=[];for(let g of t){let{string:t}=g;if(!m&&!contains(u,"string",t)){y.push(p+t)}if(m&&contains(u,"string",t)){y.push(p+t)}}return y}function zip(t,u){let p=[];for(let m=0;m<t.length;m++)p.push([t[m],u[m]]);return p}function compare(t,u){return t>u?1:u>t?-1:0}function contains(t,u,p){return t.some((t=>t[u]===p))}function countNines(t,u){return Number(String(t).slice(0,-u)+"9".repeat(u))}function countZeros(t,u){return t-t%Math.pow(10,u)}function toQuantifier(t){let[u=0,p=""]=t;if(p||u>1){return`{${u+(p?","+p:"")}}`}return""}function toCharacterClass(t,u,p){return`[${t}${u-t===1?"":"-"}${u}]`}function hasPadding(t){return/^-?(0+)\d/.test(t)}function padZeros(t,u,p){if(!u.isPadded){return t}let m=Math.abs(u.maxLen-String(t).length);let g=p.relaxZeros!==false;switch(m){case 0:return"";case 1:return g?"0?":"0";case 2:return g?"0{0,2}":"00";default:{return g?`0{0,${m}}`:`0{${m}}`}}}toRegexRange.cache={};toRegexRange.clearCache=()=>toRegexRange.cache={};t.exports=toRegexRange},1083:(t,u,p)=>{const{URL:m}=p(7016);const{join:g}=p(6928);const y=p(9896);const{promisify:v}=p(9023);const{tmpdir:b}=p(857);const w=p(2804);const E=v(y.writeFile);const $=v(y.mkdir);const R=v(y.readFile);const compareVersions=(t,u)=>t.localeCompare(u,"en-US",{numeric:true});const encode=t=>encodeURIComponent(t).replace(/^%40/,"@");const getFile=async(t,u)=>{const p=b();const m=g(p,"update-check");if(!y.existsSync(m)){await $(m)}let v=`${t.name}-${u}.json`;if(t.scope){v=`${t.scope}-${v}`}return g(m,v)};const evaluateCache=async(t,u,p)=>{if(y.existsSync(t)){const m=await R(t,"utf8");const{lastUpdate:g,latest:y}=JSON.parse(m);const v=g+p;if(v>u){return{shouldCheck:false,latest:y}}}return{shouldCheck:true,latest:null}};const updateCache=async(t,u,p)=>{const m=JSON.stringify({latest:u,lastUpdate:p});await E(t,m,"utf8")};const loadPackage=(t,u)=>new Promise(((m,g)=>{const y={host:t.hostname,path:t.pathname,port:t.port,headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"},timeout:2e3};if(u){y.headers.authorization=`${u.type} ${u.token}`}const{get:v}=p(t.protocol==="https:"?5692:8611);v(y,(t=>{const{statusCode:u}=t;if(u!==200){const p=new Error(`Request failed with code ${u}`);p.code=u;g(p);t.resume();return}let p="";t.setEncoding("utf8");t.on("data",(t=>{p+=t}));t.on("end",(()=>{try{const t=JSON.parse(p);m(t)}catch(t){g(t)}}))})).on("error",g).on("timeout",g)}));const getMostRecent=async({full:t,scope:u},g)=>{const y=w(u);const v=new m(t,y);let b=null;try{b=await loadPackage(v)}catch(t){if(t.code&&String(t.code).startsWith(4)){const t=p(373);const u=t(y,{recursive:true});b=await loadPackage(v,u)}else{throw t}}const E=b["dist-tags"][g];if(!E){throw new Error(`Distribution tag ${g} is not available`)}return E};const O={interval:36e5,distTag:"latest"};const getDetails=t=>{const u={full:encode(t)};if(t.includes("/")){const p=t.split("/");u.scope=p[0];u.name=p[1]}else{u.scope=null;u.name=t}return u};t.exports=async(t,u)=>{if(typeof t!=="object"){throw new Error("The first parameter should be your package.json file content")}const p=getDetails(t.name);const m=Date.now();const{distTag:g,interval:y}=Object.assign({},O,u);const v=await getFile(p,g);let b=null;let w=true;({shouldCheck:w,latest:b}=await evaluateCache(v,m,y));if(w){b=await getMostRecent(p,g);await updateCache(v,b,m)}const E=compareVersions(t.version,b);if(E===-1){return{latest:b,fromCache:!w}}return null}},3969:(t,u,p)=>{const m=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys";const g=p(6928);const y=m?";":":";const v=p(6173);const getNotFoundError=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"});const getPathInfo=(t,u)=>{const p=u.colon||y;const g=t.match(/\//)||m&&t.match(/\\/)?[""]:[...m?[process.cwd()]:[],...(u.path||process.env.PATH||"").split(p)];const v=m?u.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"";const b=m?v.split(p):[""];if(m){if(t.indexOf(".")!==-1&&b[0]!=="")b.unshift("")}return{pathEnv:g,pathExt:b,pathExtExe:v}};const which=(t,u,p)=>{if(typeof u==="function"){p=u;u={}}if(!u)u={};const{pathEnv:m,pathExt:y,pathExtExe:b}=getPathInfo(t,u);const w=[];const step=p=>new Promise(((y,v)=>{if(p===m.length)return u.all&&w.length?y(w):v(getNotFoundError(t));const b=m[p];const E=/^".*"$/.test(b)?b.slice(1,-1):b;const $=g.join(E,t);const R=!E&&/^\.[\\\/]/.test(t)?t.slice(0,2)+$:$;y(subStep(R,p,0))}));const subStep=(t,p,m)=>new Promise(((g,E)=>{if(m===y.length)return g(step(p+1));const $=y[m];v(t+$,{pathExt:b},((y,v)=>{if(!y&&v){if(u.all)w.push(t+$);else return g(t+$)}return g(subStep(t,p,m+1))}))}));return p?step(0).then((t=>p(null,t)),p):step(0)};const whichSync=(t,u)=>{u=u||{};const{pathEnv:p,pathExt:m,pathExtExe:y}=getPathInfo(t,u);const b=[];for(let w=0;w<p.length;w++){const E=p[w];const $=/^".*"$/.test(E)?E.slice(1,-1):E;const R=g.join($,t);const O=!$&&/^\.[\\\/]/.test(t)?t.slice(0,2)+R:R;for(let t=0;t<m.length;t++){const p=O+m[t];try{const t=v.sync(p,{pathExt:y});if(t){if(u.all)b.push(p);else return p}}catch(t){}}}if(u.all&&b.length)return b;if(u.nothrow)return null;throw getNotFoundError(t)};t.exports=which;which.sync=whichSync},779:(t,u)=>{"use strict";Object.defineProperty(u,"__esModule",{value:true});u.formatNames=u.fastFormats=u.fullFormats=void 0;function fmtDef(t,u){return{validate:t,compare:u}}u.fullFormats={date:fmtDef(date,compareDate),time:fmtDef(getTime(true),compareTime),"date-time":fmtDef(getDateTime(true),compareDateTime),"iso-time":fmtDef(getTime(),compareIsoTime),"iso-date-time":fmtDef(getDateTime(),compareIsoDateTime),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:uri,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:regex,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:byte,int32:{type:"number",validate:validateInt32},int64:{type:"number",validate:validateInt64},float:{type:"number",validate:validateNumber},double:{type:"number",validate:validateNumber},password:true,binary:true};u.fastFormats={...u.fullFormats,date:fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,compareDate),time:fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,compareTime),"date-time":fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,compareDateTime),"iso-time":fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,compareIsoTime),"iso-date-time":fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,compareIsoDateTime),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};u.formatNames=Object.keys(u.fullFormats);function isLeapYear(t){return t%4===0&&(t%100!==0||t%400===0)}const p=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;const m=[0,31,28,31,30,31,30,31,31,30,31,30,31];function date(t){const u=p.exec(t);if(!u)return false;const g=+u[1];const y=+u[2];const v=+u[3];return y>=1&&y<=12&&v>=1&&v<=(y===2&&isLeapYear(g)?29:m[y])}function compareDate(t,u){if(!(t&&u))return undefined;if(t>u)return 1;if(t<u)return-1;return 0}const g=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function getTime(t){return function time(u){const p=g.exec(u);if(!p)return false;const m=+p[1];const y=+p[2];const v=+p[3];const b=p[4];const w=p[5]==="-"?-1:1;const E=+(p[6]||0);const $=+(p[7]||0);if(E>23||$>59||t&&!b)return false;if(m<=23&&y<=59&&v<60)return true;const R=y-$*w;const O=m-E*w-(R<0?1:0);return(O===23||O===-1)&&(R===59||R===-1)&&v<61}}function compareTime(t,u){if(!(t&&u))return undefined;const p=new Date("2020-01-01T"+t).valueOf();const m=new Date("2020-01-01T"+u).valueOf();if(!(p&&m))return undefined;return p-m}function compareIsoTime(t,u){if(!(t&&u))return undefined;const p=g.exec(t);const m=g.exec(u);if(!(p&&m))return undefined;t=p[1]+p[2]+p[3];u=m[1]+m[2]+m[3];if(t>u)return 1;if(t<u)return-1;return 0}const y=/t|\s/i;function getDateTime(t){const u=getTime(t);return function date_time(t){const p=t.split(y);return p.length===2&&date(p[0])&&u(p[1])}}function compareDateTime(t,u){if(!(t&&u))return undefined;const p=new Date(t).valueOf();const m=new Date(u).valueOf();if(!(p&&m))return undefined;return p-m}function compareIsoDateTime(t,u){if(!(t&&u))return undefined;const[p,m]=t.split(y);const[g,v]=u.split(y);const b=compareDate(p,g);if(b===undefined)return undefined;return b||compareTime(m,v)}const v=/\/|:/;const b=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function uri(t){return v.test(t)&&b.test(t)}const w=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function byte(t){w.lastIndex=0;return w.test(t)}const E=-(2**31);const $=2**31-1;function validateInt32(t){return Number.isInteger(t)&&t<=$&&t>=E}function validateInt64(t){return Number.isInteger(t)}function validateNumber(){return true}const R=/[^\\]\\Z/;function regex(t){if(R.test(t))return false;try{new RegExp(t);return true}catch(t){return false}}},2815:(t,u,p)=>{"use strict";Object.defineProperty(u,"__esModule",{value:true});const m=p(779);const g=p(1284);const y=p(4671);const v=new y.Name("fullFormats");const b=new y.Name("fastFormats");const formatsPlugin=(t,u={keywords:true})=>{if(Array.isArray(u)){addFormats(t,u,m.fullFormats,v);return t}const[p,y]=u.mode==="fast"?[m.fastFormats,b]:[m.fullFormats,v];const w=u.formats||m.formatNames;addFormats(t,w,p,y);if(u.keywords)(0,g.default)(t);return t};formatsPlugin.get=(t,u="full")=>{const p=u==="fast"?m.fastFormats:m.fullFormats;const g=p[t];if(!g)throw new Error(`Unknown format "${t}"`);return g};function addFormats(t,u,p,m){var g;var v;(g=(v=t.opts.code).formats)!==null&&g!==void 0?g:v.formats=(0,y._)`require("ajv-formats/dist/formats").${m}`;for(const m of u)t.addFormat(m,p[m])}t.exports=u=formatsPlugin;Object.defineProperty(u,"__esModule",{value:true});u["default"]=formatsPlugin},1284:(t,u,p)=>{"use strict";Object.defineProperty(u,"__esModule",{value:true});u.formatLimitDefinition=void 0;const m=p(5984);const g=p(4671);const y=g.operators;const v={formatMaximum:{okStr:"<=",ok:y.LTE,fail:y.GT},formatMinimum:{okStr:">=",ok:y.GTE,fail:y.LT},formatExclusiveMaximum:{okStr:"<",ok:y.LT,fail:y.GTE},formatExclusiveMinimum:{okStr:">",ok:y.GT,fail:y.LTE}};const b={message:({keyword:t,schemaCode:u})=>(0,g.str)`should be ${v[t].okStr} ${u}`,params:({keyword:t,schemaCode:u})=>(0,g._)`{comparison: ${v[t].okStr}, limit: ${u}}`};u.formatLimitDefinition={keyword:Object.keys(v),type:"string",schemaType:"string",$data:true,error:b,code(t){const{gen:u,data:p,schemaCode:y,keyword:b,it:w}=t;const{opts:E,self:$}=w;if(!E.validateFormats)return;const R=new m.KeywordCxt(w,$.RULES.all.format.definition,"format");if(R.$data)validate$DataFormat();else validateFormat();function validate$DataFormat(){const p=u.scopeValue("formats",{ref:$.formats,code:E.code.formats});const m=u.const("fmt",(0,g._)`${p}[${R.schemaCode}]`);t.fail$data((0,g.or)((0,g._)`typeof ${m} != "object"`,(0,g._)`${m} instanceof RegExp`,(0,g._)`typeof ${m}.compare != "function"`,compareCode(m)))}function validateFormat(){const p=R.schema;const m=$.formats[p];if(!m||m===true)return;if(typeof m!="object"||m instanceof RegExp||typeof m.compare!="function"){throw new Error(`"${b}": format "${p}" does not define "compare" function`)}const y=u.scopeValue("formats",{key:p,ref:m,code:E.code.formats?(0,g._)`${E.code.formats}${(0,g.getProperty)(p)}`:undefined});t.fail$data(compareCode(y))}function compareCode(t){return(0,g._)`${t}.compare(${p}, ${y}) ${v[b].fail} 0`}},dependencies:["format"]};const formatLimitPlugin=t=>{t.addKeyword(u.formatLimitDefinition);return t};u["default"]=formatLimitPlugin},6395:(t,u,p)=>{"use strict";const m=p(2040);const g=process.env;Object.defineProperty(u,"_vendors",{value:m.map((function(t){return t.constant}))});u.name=null;u.isPR=null;m.forEach((function(t){const p=Array.isArray(t.env)?t.env:[t.env];const m=p.every((function(t){return checkEnv(t)}));u[t.constant]=m;if(!m){return}u.name=t.name;switch(typeof t.pr){case"string":u.isPR=!!g[t.pr];break;case"object":if("env"in t.pr){u.isPR=t.pr.env in g&&g[t.pr.env]!==t.pr.ne}else if("any"in t.pr){u.isPR=t.pr.any.some((function(t){return!!g[t]}))}else{u.isPR=checkEnv(t.pr)}break;default:u.isPR=null}}));u.isCI=!!(g.CI!=="false"&&(g.BUILD_ID||g.BUILD_NUMBER||g.CI||g.CI_APP_ID||g.CI_BUILD_ID||g.CI_BUILD_NUMBER||g.CI_NAME||g.CONTINUOUS_INTEGRATION||g.RUN_ID||u.name||false));function checkEnv(t){if(typeof t==="string")return!!g[t];if("env"in t){return g[t.env]&&g[t.env].includes(t.includes)}if("any"in t){return t.any.some((function(t){return!!g[t]}))}return Object.keys(t).every((function(u){return g[u]===t[u]}))}},7825:(t,u,p)=>{"use strict";const{builtinModules:m}=p(3339);var g=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$");var y=["node_modules","favicon.ico"];function validate(t){var u=[];var p=[];if(t===null){p.push("name cannot be null");return done(u,p)}if(t===undefined){p.push("name cannot be undefined");return done(u,p)}if(typeof t!=="string"){p.push("name must be a string");return done(u,p)}if(!t.length){p.push("name length must be greater than zero")}if(t.match(/^\./)){p.push("name cannot start with a period")}if(t.match(/^_/)){p.push("name cannot start with an underscore")}if(t.trim()!==t){p.push("name cannot contain leading or trailing spaces")}y.forEach((function(u){if(t.toLowerCase()===u){p.push(u+" is a blacklisted name")}}));if(m.includes(t.toLowerCase())){u.push(t+" is a core module name")}if(t.length>214){u.push("name can no longer contain more than 214 characters")}if(t.toLowerCase()!==t){u.push("name can no longer contain capital letters")}if(/[~'!()*]/.test(t.split("/").slice(-1)[0])){u.push('name can no longer contain special characters ("~\'!()*")')}if(encodeURIComponent(t)!==t){var v=t.match(g);if(v){var b=v[1];var w=v[2];if(encodeURIComponent(b)===b&&encodeURIComponent(w)===w){return done(u,p)}}p.push("name can only contain URL-friendly characters")}return done(u,p)}var done=function(t,u){var p={validForNewPackages:u.length===0&&t.length===0,validForOldPackages:u.length===0,warnings:t,errors:u};if(!p.warnings.length){delete p.warnings}if(!p.errors.length){delete p.errors}return p};t.exports=validate},181:t=>{"use strict";t.exports=require("buffer")},5317:t=>{"use strict";t.exports=require("child_process")},4434:t=>{"use strict";t.exports=require("events")},9896:t=>{"use strict";t.exports=require("fs")},8611:t=>{"use strict";t.exports=require("http")},5692:t=>{"use strict";t.exports=require("https")},3339:t=>{"use strict";t.exports=require("module")},1421:t=>{"use strict";t.exports=require("node:child_process")},8474:t=>{"use strict";t.exports=require("node:events")},3024:t=>{"use strict";t.exports=require("node:fs")},6760:t=>{"use strict";t.exports=require("node:path")},1708:t=>{"use strict";t.exports=require("node:process")},857:t=>{"use strict";t.exports=require("os")},6928:t=>{"use strict";t.exports=require("path")},3785:t=>{"use strict";t.exports=require("readline")},2203:t=>{"use strict";t.exports=require("stream")},2018:t=>{"use strict";t.exports=require("tty")},7016:t=>{"use strict";t.exports=require("url")},9023:t=>{"use strict";t.exports=require("util")},3996:(t,u,p)=>{"use strict";const{normalizeIPv6:m,removeDotSegments:g,recomposeAuthority:y,normalizeComponentEncoding:v,isIPv4:b,nonSimpleDomain:w}=p(9073);const{SCHEMES:E,getSchemeHandler:$}=p(2e3);function normalize(t,u){if(typeof t==="string"){t=serialize(parse(t,u),u)}else if(typeof t==="object"){t=parse(serialize(t,u),u)}return t}function resolve(t,u,p){const m=p?Object.assign({scheme:"null"},p):{scheme:"null"};const g=resolveComponent(parse(t,m),parse(u,m),m,true);m.skipEscape=true;return serialize(g,m)}function resolveComponent(t,u,p,m){const y={};if(!m){t=parse(serialize(t,p),p);u=parse(serialize(u,p),p)}p=p||{};if(!p.tolerant&&u.scheme){y.scheme=u.scheme;y.userinfo=u.userinfo;y.host=u.host;y.port=u.port;y.path=g(u.path||"");y.query=u.query}else{if(u.userinfo!==undefined||u.host!==undefined||u.port!==undefined){y.userinfo=u.userinfo;y.host=u.host;y.port=u.port;y.path=g(u.path||"");y.query=u.query}else{if(!u.path){y.path=t.path;if(u.query!==undefined){y.query=u.query}else{y.query=t.query}}else{if(u.path[0]==="/"){y.path=g(u.path)}else{if((t.userinfo!==undefined||t.host!==undefined||t.port!==undefined)&&!t.path){y.path="/"+u.path}else if(!t.path){y.path=u.path}else{y.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+u.path}y.path=g(y.path)}y.query=u.query}y.userinfo=t.userinfo;y.host=t.host;y.port=t.port}y.scheme=t.scheme}y.fragment=u.fragment;return y}function equal(t,u,p){if(typeof t==="string"){t=unescape(t);t=serialize(v(parse(t,p),true),{...p,skipEscape:true})}else if(typeof t==="object"){t=serialize(v(t,true),{...p,skipEscape:true})}if(typeof u==="string"){u=unescape(u);u=serialize(v(parse(u,p),true),{...p,skipEscape:true})}else if(typeof u==="object"){u=serialize(v(u,true),{...p,skipEscape:true})}return t.toLowerCase()===u.toLowerCase()}function serialize(t,u){const p={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""};const m=Object.assign({},u);const v=[];const b=$(m.scheme||p.scheme);if(b&&b.serialize)b.serialize(p,m);if(p.path!==undefined){if(!m.skipEscape){p.path=escape(p.path);if(p.scheme!==undefined){p.path=p.path.split("%3A").join(":")}}else{p.path=unescape(p.path)}}if(m.reference!=="suffix"&&p.scheme){v.push(p.scheme,":")}const w=y(p);if(w!==undefined){if(m.reference!=="suffix"){v.push("//")}v.push(w);if(p.path&&p.path[0]!=="/"){v.push("/")}}if(p.path!==undefined){let t=p.path;if(!m.absolutePath&&(!b||!b.absolutePath)){t=g(t)}if(w===undefined&&t[0]==="/"&&t[1]==="/"){t="/%2F"+t.slice(2)}v.push(t)}if(p.query!==undefined){v.push("?",p.query)}if(p.fragment!==undefined){v.push("#",p.fragment)}return v.join("")}const R=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function parse(t,u){const p=Object.assign({},u);const g={scheme:undefined,userinfo:undefined,host:"",port:undefined,path:"",query:undefined,fragment:undefined};let y=false;if(p.reference==="suffix"){if(p.scheme){t=p.scheme+":"+t}else{t="//"+t}}const v=t.match(R);if(v){g.scheme=v[1];g.userinfo=v[3];g.host=v[4];g.port=parseInt(v[5],10);g.path=v[6]||"";g.query=v[7];g.fragment=v[8];if(isNaN(g.port)){g.port=v[5]}if(g.host){const t=b(g.host);if(t===false){const t=m(g.host);g.host=t.host.toLowerCase();y=t.isIPV6}else{y=true}}if(g.scheme===undefined&&g.userinfo===undefined&&g.host===undefined&&g.port===undefined&&g.query===undefined&&!g.path){g.reference="same-document"}else if(g.scheme===undefined){g.reference="relative"}else if(g.fragment===undefined){g.reference="absolute"}else{g.reference="uri"}if(p.reference&&p.reference!=="suffix"&&p.reference!==g.reference){g.error=g.error||"URI is not a "+p.reference+" reference."}const u=$(p.scheme||g.scheme);if(!p.unicodeSupport&&(!u||!u.unicodeSupport)){if(g.host&&(p.domainHost||u&&u.domainHost)&&y===false&&w(g.host)){try{g.host=URL.domainToASCII(g.host.toLowerCase())}catch(t){g.error=g.error||"Host's domain name can not be converted to ASCII: "+t}}}if(!u||u&&!u.skipNormalize){if(t.indexOf("%")!==-1){if(g.scheme!==undefined){g.scheme=unescape(g.scheme)}if(g.host!==undefined){g.host=unescape(g.host)}}if(g.path){g.path=escape(unescape(g.path))}if(g.fragment){g.fragment=encodeURI(decodeURIComponent(g.fragment))}}if(u&&u.parse){u.parse(g,p)}}else{g.error=g.error||"URI can not be parsed."}return g}const O={SCHEMES:E,normalize:normalize,resolve:resolve,resolveComponent:resolveComponent,equal:equal,serialize:serialize,parse:parse};t.exports=O;t.exports["default"]=O;t.exports.fastUri=O},2e3:(t,u,p)=>{"use strict";const{isUUID:m}=p(9073);const g=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;const y=["http","https","ws","wss","urn","urn:uuid"];function isValidSchemeName(t){return y.indexOf(t)!==-1}function wsIsSecure(t){if(t.secure===true){return true}else if(t.secure===false){return false}else if(t.scheme){return t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S")}else{return false}}function httpParse(t){if(!t.host){t.error=t.error||"HTTP URIs must have a host."}return t}function httpSerialize(t){const u=String(t.scheme).toLowerCase()==="https";if(t.port===(u?443:80)||t.port===""){t.port=undefined}if(!t.path){t.path="/"}return t}function wsParse(t){t.secure=wsIsSecure(t);t.resourceName=(t.path||"/")+(t.query?"?"+t.query:"");t.path=undefined;t.query=undefined;return t}function wsSerialize(t){if(t.port===(wsIsSecure(t)?443:80)||t.port===""){t.port=undefined}if(typeof t.secure==="boolean"){t.scheme=t.secure?"wss":"ws";t.secure=undefined}if(t.resourceName){const[u,p]=t.resourceName.split("?");t.path=u&&u!=="/"?u:undefined;t.query=p;t.resourceName=undefined}t.fragment=undefined;return t}function urnParse(t,u){if(!t.path){t.error="URN can not be parsed";return t}const p=t.path.match(g);if(p){const m=u.scheme||t.scheme||"urn";t.nid=p[1].toLowerCase();t.nss=p[2];const g=`${m}:${u.nid||t.nid}`;const y=getSchemeHandler(g);t.path=undefined;if(y){t=y.parse(t,u)}}else{t.error=t.error||"URN can not be parsed."}return t}function urnSerialize(t,u){if(t.nid===undefined){throw new Error("URN without nid cannot be serialized")}const p=u.scheme||t.scheme||"urn";const m=t.nid.toLowerCase();const g=`${p}:${u.nid||m}`;const y=getSchemeHandler(g);if(y){t=y.serialize(t,u)}const v=t;const b=t.nss;v.path=`${m||u.nid}:${b}`;u.skipEscape=true;return v}function urnuuidParse(t,u){const p=t;p.uuid=p.nss;p.nss=undefined;if(!u.tolerant&&(!p.uuid||!m(p.uuid))){p.error=p.error||"UUID is not valid."}return p}function urnuuidSerialize(t){const u=t;u.nss=(t.uuid||"").toLowerCase();return u}const v={scheme:"http",domainHost:true,parse:httpParse,serialize:httpSerialize};const b={scheme:"https",domainHost:v.domainHost,parse:httpParse,serialize:httpSerialize};const w={scheme:"ws",domainHost:true,parse:wsParse,serialize:wsSerialize};const E={scheme:"wss",domainHost:w.domainHost,parse:w.parse,serialize:w.serialize};const $={scheme:"urn",parse:urnParse,serialize:urnSerialize,skipNormalize:true};const R={scheme:"urn:uuid",parse:urnuuidParse,serialize:urnuuidSerialize,skipNormalize:true};const O={http:v,https:b,ws:w,wss:E,urn:$,"urn:uuid":R};Object.setPrototypeOf(O,null);function getSchemeHandler(t){return t&&(O[t]||O[t.toLowerCase()])||undefined}t.exports={wsIsSecure:wsIsSecure,SCHEMES:O,isValidSchemeName:isValidSchemeName,getSchemeHandler:getSchemeHandler}},9073:t=>{"use strict";const u=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);const p=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function stringArrayToHexStripped(t){let u="";let p=0;let m=0;for(m=0;m<t.length;m++){p=t[m].charCodeAt(0);if(p===48){continue}if(!(p>=48&&p<=57||p>=65&&p<=70||p>=97&&p<=102)){return""}u+=t[m];break}for(m+=1;m<t.length;m++){p=t[m].charCodeAt(0);if(!(p>=48&&p<=57||p>=65&&p<=70||p>=97&&p<=102)){return""}u+=t[m]}return u}const m=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function consumeIsZone(t){t.length=0;return true}function consumeHextets(t,u,p){if(t.length){const m=stringArrayToHexStripped(t);if(m!==""){u.push(m)}else{p.error=true;return false}t.length=0}return true}function getIPV6(t){let u=0;const p={error:false,address:"",zone:""};const m=[];const g=[];let y=false;let v=false;let b=consumeHextets;for(let w=0;w<t.length;w++){const E=t[w];if(E==="["||E==="]"){continue}if(E===":"){if(y===true){v=true}if(!b(g,m,p)){break}if(++u>7){p.error=true;break}if(w>0&&t[w-1]===":"){y=true}m.push(":");continue}else if(E==="%"){if(!b(g,m,p)){break}b=consumeIsZone}else{g.push(E);continue}}if(g.length){if(b===consumeIsZone){p.zone=g.join("")}else if(v){m.push(g.join(""))}else{m.push(stringArrayToHexStripped(g))}}p.address=m.join("");return p}function normalizeIPv6(t){if(findToken(t,":")<2){return{host:t,isIPV6:false}}const u=getIPV6(t);if(!u.error){let t=u.address;let p=u.address;if(u.zone){t+="%"+u.zone;p+="%25"+u.zone}return{host:t,isIPV6:true,escapedHost:p}}else{return{host:t,isIPV6:false}}}function findToken(t,u){let p=0;for(let m=0;m<t.length;m++){if(t[m]===u)p++}return p}function removeDotSegments(t){let u=t;const p=[];let m=-1;let g=0;while(g=u.length){if(g===1){if(u==="."){break}else if(u==="/"){p.push("/");break}else{p.push(u);break}}else if(g===2){if(u[0]==="."){if(u[1]==="."){break}else if(u[1]==="/"){u=u.slice(2);continue}}else if(u[0]==="/"){if(u[1]==="."||u[1]==="/"){p.push("/");break}}}else if(g===3){if(u==="/.."){if(p.length!==0){p.pop()}p.push("/");break}}if(u[0]==="."){if(u[1]==="."){if(u[2]==="/"){u=u.slice(3);continue}}else if(u[1]==="/"){u=u.slice(2);continue}}else if(u[0]==="/"){if(u[1]==="."){if(u[2]==="/"){u=u.slice(2);continue}else if(u[2]==="."){if(u[3]==="/"){u=u.slice(3);if(p.length!==0){p.pop()}continue}}}}if((m=u.indexOf("/",1))===-1){p.push(u);break}else{p.push(u.slice(0,m));u=u.slice(m)}}return p.join("")}function normalizeComponentEncoding(t,u){const p=u!==true?escape:unescape;if(t.scheme!==undefined){t.scheme=p(t.scheme)}if(t.userinfo!==undefined){t.userinfo=p(t.userinfo)}if(t.host!==undefined){t.host=p(t.host)}if(t.path!==undefined){t.path=p(t.path)}if(t.query!==undefined){t.query=p(t.query)}if(t.fragment!==undefined){t.fragment=p(t.fragment)}return t}function recomposeAuthority(t){const u=[];if(t.userinfo!==undefined){u.push(t.userinfo);u.push("@")}if(t.host!==undefined){let m=unescape(t.host);if(!p(m)){const u=normalizeIPv6(m);if(u.isIPV6===true){m=`[${u.escapedHost}]`}else{m=t.host}}u.push(m)}if(typeof t.port==="number"||typeof t.port==="string"){u.push(":");u.push(String(t.port))}return u.length?u.join(""):undefined}t.exports={nonSimpleDomain:m,recomposeAuthority:recomposeAuthority,normalizeComponentEncoding:normalizeComponentEncoding,removeDotSegments:removeDotSegments,isIPv4:p,isUUID:u,normalizeIPv6:normalizeIPv6,stringArrayToHexStripped:stringArrayToHexStripped}},8909:(t,u,p)=>{const{Argument:m}=p(9154);const{Command:g}=p(4348);const{CommanderError:y,InvalidArgumentError:v}=p(1135);const{Help:b}=p(9754);const{Option:w}=p(5240);u.DM=new g;u.gu=t=>new g(t);u.Ww=(t,u)=>new w(t,u);u.er=(t,u)=>new m(t,u);u.uB=g;u.c$=w;u.ef=m;u._V=b;u.b7=y;u.Di=v;u.a2=v},9154:(t,u,p)=>{const{InvalidArgumentError:m}=p(1135);class Argument{constructor(t,u){this.description=u||"";this.variadic=false;this.parseArg=undefined;this.defaultValue=undefined;this.defaultValueDescription=undefined;this.argChoices=undefined;switch(t[0]){case"<":this.required=true;this._name=t.slice(1,-1);break;case"[":this.required=false;this._name=t.slice(1,-1);break;default:this.required=true;this._name=t;break}if(this._name.length>3&&this._name.slice(-3)==="..."){this.variadic=true;this._name=this._name.slice(0,-3)}}name(){return this._name}_concatValue(t,u){if(u===this.defaultValue||!Array.isArray(u)){return[t]}return u.concat(t)}default(t,u){this.defaultValue=t;this.defaultValueDescription=u;return this}argParser(t){this.parseArg=t;return this}choices(t){this.argChoices=t.slice();this.parseArg=(t,u)=>{if(!this.argChoices.includes(t)){throw new m(`Allowed choices are ${this.argChoices.join(", ")}.`)}if(this.variadic){return this._concatValue(t,u)}return t};return this}argRequired(){this.required=true;return this}argOptional(){this.required=false;return this}}function humanReadableArgName(t){const u=t.name()+(t.variadic===true?"...":"");return t.required?"<"+u+">":"["+u+"]"}u.Argument=Argument;u.humanReadableArgName=humanReadableArgName},4348:(t,u,p)=>{const m=p(8474).EventEmitter;const g=p(1421);const y=p(6760);const v=p(3024);const b=p(1708);const{Argument:w,humanReadableArgName:E}=p(9154);const{CommanderError:$}=p(1135);const{Help:R}=p(9754);const{Option:O,DualOptions:P}=p(5240);const{suggestSimilar:x}=p(5030);class Command extends m{constructor(t){super();this.commands=[];this.options=[];this.parent=null;this._allowUnknownOption=false;this._allowExcessArguments=true;this.registeredArguments=[];this._args=this.registeredArguments;this.args=[];this.rawArgs=[];this.processedArgs=[];this._scriptPath=null;this._name=t||"";this._optionValues={};this._optionValueSources={};this._storeOptionsAsProperties=false;this._actionHandler=null;this._executableHandler=false;this._executableFile=null;this._executableDir=null;this._defaultCommandName=null;this._exitCallback=null;this._aliases=[];this._combineFlagAndOptionalValue=true;this._description="";this._summary="";this._argsDescription=undefined;this._enablePositionalOptions=false;this._passThroughOptions=false;this._lifeCycleHooks={};this._showHelpAfterError=false;this._showSuggestionAfterError=true;this._outputConfiguration={writeOut:t=>b.stdout.write(t),writeErr:t=>b.stderr.write(t),getOutHelpWidth:()=>b.stdout.isTTY?b.stdout.columns:undefined,getErrHelpWidth:()=>b.stderr.isTTY?b.stderr.columns:undefined,outputError:(t,u)=>u(t)};this._hidden=false;this._helpOption=undefined;this._addImplicitHelpCommand=undefined;this._helpCommand=undefined;this._helpConfiguration={}}copyInheritedSettings(t){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;return this}_getCommandAndAncestors(){const t=[];for(let u=this;u;u=u.parent){t.push(u)}return t}command(t,u,p){let m=u;let g=p;if(typeof m==="object"&&m!==null){g=m;m=null}g=g||{};const[,y,v]=t.match(/([^ ]+) *(.*)/);const b=this.createCommand(y);if(m){b.description(m);b._executableHandler=true}if(g.isDefault)this._defaultCommandName=b._name;b._hidden=!!(g.noHelp||g.hidden);b._executableFile=g.executableFile||null;if(v)b.arguments(v);this._registerCommand(b);b.parent=this;b.copyInheritedSettings(this);if(m)return this;return b}createCommand(t){return new Command(t)}createHelp(){return Object.assign(new R,this.configureHelp())}configureHelp(t){if(t===undefined)return this._helpConfiguration;this._helpConfiguration=t;return this}configureOutput(t){if(t===undefined)return this._outputConfiguration;Object.assign(this._outputConfiguration,t);return this}showHelpAfterError(t=true){if(typeof t!=="string")t=!!t;this._showHelpAfterError=t;return this}showSuggestionAfterError(t=true){this._showSuggestionAfterError=!!t;return this}addCommand(t,u){if(!t._name){throw new Error(`Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()`)}u=u||{};if(u.isDefault)this._defaultCommandName=t._name;if(u.noHelp||u.hidden)t._hidden=true;this._registerCommand(t);t.parent=this;t._checkForBrokenPassThrough();return this}createArgument(t,u){return new w(t,u)}argument(t,u,p,m){const g=this.createArgument(t,u);if(typeof p==="function"){g.default(m).argParser(p)}else{g.default(p)}this.addArgument(g);return this}arguments(t){t.trim().split(/ +/).forEach((t=>{this.argument(t)}));return this}addArgument(t){const u=this.registeredArguments.slice(-1)[0];if(u&&u.variadic){throw new Error(`only the last argument can be variadic '${u.name()}'`)}if(t.required&&t.defaultValue!==undefined&&t.parseArg===undefined){throw new Error(`a default value for a required argument is never used: '${t.name()}'`)}this.registeredArguments.push(t);return this}helpCommand(t,u){if(typeof t==="boolean"){this._addImplicitHelpCommand=t;return this}t=t??"help [command]";const[,p,m]=t.match(/([^ ]+) *(.*)/);const g=u??"display help for command";const y=this.createCommand(p);y.helpOption(false);if(m)y.arguments(m);if(g)y.description(g);this._addImplicitHelpCommand=true;this._helpCommand=y;return this}addHelpCommand(t,u){if(typeof t!=="object"){this.helpCommand(t,u);return this}this._addImplicitHelpCommand=true;this._helpCommand=t;return this}_getHelpCommand(){const t=this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"));if(t){if(this._helpCommand===undefined){this.helpCommand(undefined,undefined)}return this._helpCommand}return null}hook(t,u){const p=["preSubcommand","preAction","postAction"];if(!p.includes(t)){throw new Error(`Unexpected value for event passed to hook : '${t}'.\nExpecting one of '${p.join("', '")}'`)}if(this._lifeCycleHooks[t]){this._lifeCycleHooks[t].push(u)}else{this._lifeCycleHooks[t]=[u]}return this}exitOverride(t){if(t){this._exitCallback=t}else{this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync"){throw t}else{}}}return this}_exit(t,u,p){if(this._exitCallback){this._exitCallback(new $(t,u,p))}b.exit(t)}action(t){const listener=u=>{const p=this.registeredArguments.length;const m=u.slice(0,p);if(this._storeOptionsAsProperties){m[p]=this}else{m[p]=this.opts()}m.push(this);return t.apply(this,m)};this._actionHandler=listener;return this}createOption(t,u){return new O(t,u)}_callParseArg(t,u,p,m){try{return t.parseArg(u,p)}catch(t){if(t.code==="commander.invalidArgument"){const u=`${m} ${t.message}`;this.error(u,{exitCode:t.exitCode,code:t.code})}throw t}}_registerOption(t){const u=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(u){const p=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 '${p}'\n- already used by option '${u.flags}'`)}this.options.push(t)}_registerCommand(t){const knownBy=t=>[t.name()].concat(t.aliases());const u=knownBy(t).find((t=>this._findCommand(t)));if(u){const p=knownBy(this._findCommand(u)).join("|");const m=knownBy(t).join("|");throw new Error(`cannot add command '${m}' as already have command '${p}'`)}this.commands.push(t)}addOption(t){this._registerOption(t);const u=t.name();const p=t.attributeName();if(t.negate){const u=t.long.replace(/^--no-/,"--");if(!this._findOption(u)){this.setOptionValueWithSource(p,t.defaultValue===undefined?true:t.defaultValue,"default")}}else if(t.defaultValue!==undefined){this.setOptionValueWithSource(p,t.defaultValue,"default")}const handleOptionValue=(u,m,g)=>{if(u==null&&t.presetArg!==undefined){u=t.presetArg}const y=this.getOptionValue(p);if(u!==null&&t.parseArg){u=this._callParseArg(t,u,y,m)}else if(u!==null&&t.variadic){u=t._concatValue(u,y)}if(u==null){if(t.negate){u=false}else if(t.isBoolean()||t.optional){u=true}else{u=""}}this.setOptionValueWithSource(p,u,g)};this.on("option:"+u,(u=>{const p=`error: option '${t.flags}' argument '${u}' is invalid.`;handleOptionValue(u,p,"cli")}));if(t.envVar){this.on("optionEnv:"+u,(u=>{const p=`error: option '${t.flags}' value '${u}' from env '${t.envVar}' is invalid.`;handleOptionValue(u,p,"env")}))}return this}_optionEx(t,u,p,m,g){if(typeof u==="object"&&u instanceof O){throw new Error("To add an Option object use addOption() instead of option() or requiredOption()")}const y=this.createOption(u,p);y.makeOptionMandatory(!!t.mandatory);if(typeof m==="function"){y.default(g).argParser(m)}else if(m instanceof RegExp){const t=m;m=(u,p)=>{const m=t.exec(u);return m?m[0]:p};y.default(g).argParser(m)}else{y.default(m)}return this.addOption(y)}option(t,u,p,m){return this._optionEx({},t,u,p,m)}requiredOption(t,u,p,m){return this._optionEx({mandatory:true},t,u,p,m)}combineFlagAndOptionalValue(t=true){this._combineFlagAndOptionalValue=!!t;return this}allowUnknownOption(t=true){this._allowUnknownOption=!!t;return this}allowExcessArguments(t=true){this._allowExcessArguments=!!t;return this}enablePositionalOptions(t=true){this._enablePositionalOptions=!!t;return this}passThroughOptions(t=true){this._passThroughOptions=!!t;this._checkForBrokenPassThrough();return 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=true){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")}this._storeOptionsAsProperties=!!t;return this}getOptionValue(t){if(this._storeOptionsAsProperties){return this[t]}return this._optionValues[t]}setOptionValue(t,u){return this.setOptionValueWithSource(t,u,undefined)}setOptionValueWithSource(t,u,p){if(this._storeOptionsAsProperties){this[t]=u}else{this._optionValues[t]=u}this._optionValueSources[t]=p;return this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let u;this._getCommandAndAncestors().forEach((p=>{if(p.getOptionValueSource(t)!==undefined){u=p.getOptionValueSource(t)}}));return u}_prepareUserArgs(t,u){if(t!==undefined&&!Array.isArray(t)){throw new Error("first parameter to parse must be array or undefined")}u=u||{};if(t===undefined&&u.from===undefined){if(b.versions?.electron){u.from="electron"}const t=b.execArgv??[];if(t.includes("-e")||t.includes("--eval")||t.includes("-p")||t.includes("--print")){u.from="eval"}}if(t===undefined){t=b.argv}this.rawArgs=t.slice();let p;switch(u.from){case undefined:case"node":this._scriptPath=t[1];p=t.slice(2);break;case"electron":if(b.defaultApp){this._scriptPath=t[1];p=t.slice(2)}else{p=t.slice(1)}break;case"user":p=t.slice(0);break;case"eval":p=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${u.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);this._name=this._name||"program";return p}parse(t,u){const p=this._prepareUserArgs(t,u);this._parseCommand([],p);return this}async parseAsync(t,u){const p=this._prepareUserArgs(t,u);await this._parseCommand([],p);return this}_executeSubCommand(t,u){u=u.slice();let p=false;const m=[".js",".ts",".tsx",".mjs",".cjs"];function findFile(t,u){const p=y.resolve(t,u);if(v.existsSync(p))return p;if(m.includes(y.extname(u)))return undefined;const g=m.find((t=>v.existsSync(`${p}${t}`)));if(g)return`${p}${g}`;return undefined}this._checkForMissingMandatoryOptions();this._checkForConflictingOptions();let w=t._executableFile||`${this._name}-${t._name}`;let E=this._executableDir||"";if(this._scriptPath){let t;try{t=v.realpathSync(this._scriptPath)}catch(u){t=this._scriptPath}E=y.resolve(y.dirname(t),E)}if(E){let u=findFile(E,w);if(!u&&!t._executableFile&&this._scriptPath){const p=y.basename(this._scriptPath,y.extname(this._scriptPath));if(p!==this._name){u=findFile(E,`${p}-${t._name}`)}}w=u||w}p=m.includes(y.extname(w));let R;if(b.platform!=="win32"){if(p){u.unshift(w);u=incrementNodeInspectorPort(b.execArgv).concat(u);R=g.spawn(b.argv[0],u,{stdio:"inherit"})}else{R=g.spawn(w,u,{stdio:"inherit"})}}else{u.unshift(w);u=incrementNodeInspectorPort(b.execArgv).concat(u);R=g.spawn(b.execPath,u,{stdio:"inherit"})}if(!R.killed){const t=["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"];t.forEach((t=>{b.on(t,(()=>{if(R.killed===false&&R.exitCode===null){R.kill(t)}}))}))}const O=this._exitCallback;R.on("close",(t=>{t=t??1;if(!O){b.exit(t)}else{O(new $(t,"commander.executeSubCommandAsync","(close)"))}}));R.on("error",(u=>{if(u.code==="ENOENT"){const u=E?`searched for local subcommand relative to directory '${E}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory";const p=`'${w}' does not exist\n - if '${t._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${u}`;throw new Error(p)}else if(u.code==="EACCES"){throw new Error(`'${w}' not executable`)}if(!O){b.exit(1)}else{const t=new $(1,"commander.executeSubCommandAsync","(error)");t.nestedError=u;O(t)}}));this.runningCommand=R}_dispatchSubcommand(t,u,p){const m=this._findCommand(t);if(!m)this.help({error:true});let g;g=this._chainOrCallSubCommandHook(g,m,"preSubcommand");g=this._chainOrCall(g,(()=>{if(m._executableHandler){this._executeSubCommand(m,u.concat(p))}else{return m._parseCommand(u,p)}}));return g}_dispatchHelpCommand(t){if(!t){this.help()}const u=this._findCommand(t);if(u&&!u._executableHandler){u.help()}return this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach(((t,u)=>{if(t.required&&this.args[u]==null){this.missingArgument(t.name())}}));if(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic){return}if(this.args.length>this.registeredArguments.length){this._excessArguments(this.args)}}_processArguments(){const myParseArg=(t,u,p)=>{let m=u;if(u!==null&&t.parseArg){const g=`error: command-argument value '${u}' is invalid for argument '${t.name()}'.`;m=this._callParseArg(t,u,p,g)}return m};this._checkNumberOfArguments();const t=[];this.registeredArguments.forEach(((u,p)=>{let m=u.defaultValue;if(u.variadic){if(p<this.args.length){m=this.args.slice(p);if(u.parseArg){m=m.reduce(((t,p)=>myParseArg(u,p,t)),u.defaultValue)}}else if(m===undefined){m=[]}}else if(p<this.args.length){m=this.args[p];if(u.parseArg){m=myParseArg(u,m,u.defaultValue)}}t[p]=m}));this.processedArgs=t}_chainOrCall(t,u){if(t&&t.then&&typeof t.then==="function"){return t.then((()=>u()))}return u()}_chainOrCallHooks(t,u){let p=t;const m=[];this._getCommandAndAncestors().reverse().filter((t=>t._lifeCycleHooks[u]!==undefined)).forEach((t=>{t._lifeCycleHooks[u].forEach((u=>{m.push({hookedCommand:t,callback:u})}))}));if(u==="postAction"){m.reverse()}m.forEach((t=>{p=this._chainOrCall(p,(()=>t.callback(t.hookedCommand,this)))}));return p}_chainOrCallSubCommandHook(t,u,p){let m=t;if(this._lifeCycleHooks[p]!==undefined){this._lifeCycleHooks[p].forEach((t=>{m=this._chainOrCall(m,(()=>t(this,u)))}))}return m}_parseCommand(t,u){const p=this.parseOptions(u);this._parseOptionsEnv();this._parseOptionsImplied();t=t.concat(p.operands);u=p.unknown;this.args=t.concat(u);if(t&&this._findCommand(t[0])){return this._dispatchSubcommand(t[0],t.slice(1),u)}if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name()){return this._dispatchHelpCommand(t[1])}if(this._defaultCommandName){this._outputHelpIfRequested(u);return this._dispatchSubcommand(this._defaultCommandName,t,u)}if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName){this.help({error:true})}this._outputHelpIfRequested(p.unknown);this._checkForMissingMandatoryOptions();this._checkForConflictingOptions();const checkForUnknownOptions=()=>{if(p.unknown.length>0){this.unknownOption(p.unknown[0])}};const m=`command:${this.name()}`;if(this._actionHandler){checkForUnknownOptions();this._processArguments();let p;p=this._chainOrCallHooks(p,"preAction");p=this._chainOrCall(p,(()=>this._actionHandler(this.processedArgs)));if(this.parent){p=this._chainOrCall(p,(()=>{this.parent.emit(m,t,u)}))}p=this._chainOrCallHooks(p,"postAction");return p}if(this.parent&&this.parent.listenerCount(m)){checkForUnknownOptions();this._processArguments();this.parent.emit(m,t,u)}else if(t.length){if(this._findCommand("*")){return this._dispatchSubcommand("*",t,u)}if(this.listenerCount("command:*")){this.emit("command:*",t,u)}else if(this.commands.length){this.unknownCommand()}else{checkForUnknownOptions();this._processArguments()}}else if(this.commands.length){checkForUnknownOptions();this.help({error:true})}else{checkForUnknownOptions();this._processArguments()}}_findCommand(t){if(!t)return undefined;return this.commands.find((u=>u._name===t||u._aliases.includes(t)))}_findOption(t){return this.options.find((u=>u.is(t)))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((t=>{t.options.forEach((u=>{if(u.mandatory&&t.getOptionValue(u.attributeName())===undefined){t.missingMandatoryOptionValue(u)}}))}))}_checkForConflictingLocalOptions(){const t=this.options.filter((t=>{const u=t.attributeName();if(this.getOptionValue(u)===undefined){return false}return this.getOptionValueSource(u)!=="default"}));const u=t.filter((t=>t.conflictsWith.length>0));u.forEach((u=>{const p=t.find((t=>u.conflictsWith.includes(t.attributeName())));if(p){this._conflictingOption(u,p)}}))}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((t=>{t._checkForConflictingLocalOptions()}))}parseOptions(t){const u=[];const p=[];let m=u;const g=t.slice();function maybeOption(t){return t.length>1&&t[0]==="-"}let y=null;while(g.length){const t=g.shift();if(t==="--"){if(m===p)m.push(t);m.push(...g);break}if(y&&!maybeOption(t)){this.emit(`option:${y.name()}`,t);continue}y=null;if(maybeOption(t)){const u=this._findOption(t);if(u){if(u.required){const t=g.shift();if(t===undefined)this.optionMissingArgument(u);this.emit(`option:${u.name()}`,t)}else if(u.optional){let t=null;if(g.length>0&&!maybeOption(g[0])){t=g.shift()}this.emit(`option:${u.name()}`,t)}else{this.emit(`option:${u.name()}`)}y=u.variadic?u:null;continue}}if(t.length>2&&t[0]==="-"&&t[1]!=="-"){const u=this._findOption(`-${t[1]}`);if(u){if(u.required||u.optional&&this._combineFlagAndOptionalValue){this.emit(`option:${u.name()}`,t.slice(2))}else{this.emit(`option:${u.name()}`);g.unshift(`-${t.slice(2)}`)}continue}}if(/^--[^=]+=/.test(t)){const u=t.indexOf("=");const p=this._findOption(t.slice(0,u));if(p&&(p.required||p.optional)){this.emit(`option:${p.name()}`,t.slice(u+1));continue}}if(maybeOption(t)){m=p}if((this._enablePositionalOptions||this._passThroughOptions)&&u.length===0&&p.length===0){if(this._findCommand(t)){u.push(t);if(g.length>0)p.push(...g);break}else if(this._getHelpCommand()&&t===this._getHelpCommand().name()){u.push(t);if(g.length>0)u.push(...g);break}else if(this._defaultCommandName){p.push(t);if(g.length>0)p.push(...g);break}}if(this._passThroughOptions){m.push(t);if(g.length>0)m.push(...g);break}m.push(t)}return{operands:u,unknown:p}}opts(){if(this._storeOptionsAsProperties){const t={};const u=this.options.length;for(let p=0;p<u;p++){const u=this.options[p].attributeName();t[u]=u===this._versionOptionName?this._version:this[u]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce(((t,u)=>Object.assign(t,u.opts())),{})}error(t,u){this._outputConfiguration.outputError(`${t}\n`,this._outputConfiguration.writeErr);if(typeof this._showHelpAfterError==="string"){this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`)}else if(this._showHelpAfterError){this._outputConfiguration.writeErr("\n");this.outputHelp({error:true})}const p=u||{};const m=p.exitCode||1;const g=p.code||"commander.error";this._exit(m,g,t)}_parseOptionsEnv(){this.options.forEach((t=>{if(t.envVar&&t.envVar in b.env){const u=t.attributeName();if(this.getOptionValue(u)===undefined||["default","config","env"].includes(this.getOptionValueSource(u))){if(t.required||t.optional){this.emit(`optionEnv:${t.name()}`,b.env[t.envVar])}else{this.emit(`optionEnv:${t.name()}`)}}}}))}_parseOptionsImplied(){const t=new P(this.options);const hasCustomOptionValue=t=>this.getOptionValue(t)!==undefined&&!["default","implied"].includes(this.getOptionValueSource(t));this.options.filter((u=>u.implied!==undefined&&hasCustomOptionValue(u.attributeName())&&t.valueFromOption(this.getOptionValue(u.attributeName()),u))).forEach((t=>{Object.keys(t.implied).filter((t=>!hasCustomOptionValue(t))).forEach((u=>{this.setOptionValueWithSource(u,t.implied[u],"implied")}))}))}missingArgument(t){const u=`error: missing required argument '${t}'`;this.error(u,{code:"commander.missingArgument"})}optionMissingArgument(t){const u=`error: option '${t.flags}' argument missing`;this.error(u,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){const u=`error: required option '${t.flags}' not specified`;this.error(u,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,u){const findBestOptionFromValue=t=>{const u=t.attributeName();const p=this.getOptionValue(u);const m=this.options.find((t=>t.negate&&u===t.attributeName()));const g=this.options.find((t=>!t.negate&&u===t.attributeName()));if(m&&(m.presetArg===undefined&&p===false||m.presetArg!==undefined&&p===m.presetArg)){return m}return g||t};const getErrorMessage=t=>{const u=findBestOptionFromValue(t);const p=u.attributeName();const m=this.getOptionValueSource(p);if(m==="env"){return`environment variable '${u.envVar}'`}return`option '${u.flags}'`};const p=`error: ${getErrorMessage(t)} cannot be used with ${getErrorMessage(u)}`;this.error(p,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let u="";if(t.startsWith("--")&&this._showSuggestionAfterError){let p=[];let m=this;do{const t=m.createHelp().visibleOptions(m).filter((t=>t.long)).map((t=>t.long));p=p.concat(t);m=m.parent}while(m&&!m._enablePositionalOptions);u=x(t,p)}const p=`error: unknown option '${t}'${u}`;this.error(p,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;const u=this.registeredArguments.length;const p=u===1?"":"s";const m=this.parent?` for '${this.name()}'`:"";const g=`error: too many arguments${m}. Expected ${u} argument${p} but got ${t.length}.`;this.error(g,{code:"commander.excessArguments"})}unknownCommand(){const t=this.args[0];let u="";if(this._showSuggestionAfterError){const p=[];this.createHelp().visibleCommands(this).forEach((t=>{p.push(t.name());if(t.alias())p.push(t.alias())}));u=x(t,p)}const p=`error: unknown command '${t}'${u}`;this.error(p,{code:"commander.unknownCommand"})}version(t,u,p){if(t===undefined)return this._version;this._version=t;u=u||"-V, --version";p=p||"output the version number";const m=this.createOption(u,p);this._versionOptionName=m.attributeName();this._registerOption(m);this.on("option:"+m.name(),(()=>{this._outputConfiguration.writeOut(`${t}\n`);this._exit(0,"commander.version",t)}));return this}description(t,u){if(t===undefined&&u===undefined)return this._description;this._description=t;if(u){this._argsDescription=u}return this}summary(t){if(t===undefined)return this._summary;this._summary=t;return this}alias(t){if(t===undefined)return this._aliases[0];let u=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler){u=this.commands[this.commands.length-1]}if(t===u._name)throw new Error("Command alias can't be the same as its name");const p=this.parent?._findCommand(t);if(p){const u=[p.name()].concat(p.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${u}'`)}u._aliases.push(t);return this}aliases(t){if(t===undefined)return this._aliases;t.forEach((t=>this.alias(t)));return this}usage(t){if(t===undefined){if(this._usage)return this._usage;const t=this.registeredArguments.map((t=>E(t)));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")}this._usage=t;return this}name(t){if(t===undefined)return this._name;this._name=t;return this}nameFromFilename(t){this._name=y.basename(t,y.extname(t));return this}executableDir(t){if(t===undefined)return this._executableDir;this._executableDir=t;return this}helpInformation(t){const u=this.createHelp();if(u.helpWidth===undefined){u.helpWidth=t&&t.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()}return u.formatHelp(this,u)}_getHelpContext(t){t=t||{};const u={error:!!t.error};let p;if(u.error){p=t=>this._outputConfiguration.writeErr(t)}else{p=t=>this._outputConfiguration.writeOut(t)}u.write=t.write||p;u.command=this;return u}outputHelp(t){let u;if(typeof t==="function"){u=t;t=undefined}const p=this._getHelpContext(t);this._getCommandAndAncestors().reverse().forEach((t=>t.emit("beforeAllHelp",p)));this.emit("beforeHelp",p);let m=this.helpInformation(p);if(u){m=u(m);if(typeof m!=="string"&&!Buffer.isBuffer(m)){throw new Error("outputHelp callback must return a string or a Buffer")}}p.write(m);if(this._getHelpOption()?.long){this.emit(this._getHelpOption().long)}this.emit("afterHelp",p);this._getCommandAndAncestors().forEach((t=>t.emit("afterAllHelp",p)))}helpOption(t,u){if(typeof t==="boolean"){if(t){this._helpOption=this._helpOption??undefined}else{this._helpOption=null}return this}t=t??"-h, --help";u=u??"display help for command";this._helpOption=this.createOption(t,u);return this}_getHelpOption(){if(this._helpOption===undefined){this.helpOption(undefined,undefined)}return this._helpOption}addHelpOption(t){this._helpOption=t;return this}help(t){this.outputHelp(t);let u=b.exitCode||0;if(u===0&&t&&typeof t!=="function"&&t.error){u=1}this._exit(u,"commander.help","(outputHelp)")}addHelpText(t,u){const p=["beforeAll","before","after","afterAll"];if(!p.includes(t)){throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${p.join("', '")}'`)}const m=`${t}Help`;this.on(m,(t=>{let p;if(typeof u==="function"){p=u({error:t.error,command:t.command})}else{p=u}if(p){t.write(`${p}\n`)}}));return this}_outputHelpIfRequested(t){const u=this._getHelpOption();const p=u&&t.find((t=>u.is(t)));if(p){this.outputHelp();this._exit(0,"commander.helpDisplayed","(outputHelp)")}}}function incrementNodeInspectorPort(t){return t.map((t=>{if(!t.startsWith("--inspect")){return t}let u;let p="127.0.0.1";let m="9229";let g;if((g=t.match(/^(--inspect(-brk)?)$/))!==null){u=g[1]}else if((g=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null){u=g[1];if(/^\d+$/.test(g[3])){m=g[3]}else{p=g[3]}}else if((g=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null){u=g[1];p=g[3];m=g[4]}if(u&&m!=="0"){return`${u}=${p}:${parseInt(m)+1}`}return t}))}u.Command=Command},1135:(t,u)=>{class CommanderError extends Error{constructor(t,u,p){super(p);Error.captureStackTrace(this,this.constructor);this.name=this.constructor.name;this.code=u;this.exitCode=t;this.nestedError=undefined}}class InvalidArgumentError extends CommanderError{constructor(t){super(1,"commander.invalidArgument",t);Error.captureStackTrace(this,this.constructor);this.name=this.constructor.name}}u.CommanderError=CommanderError;u.InvalidArgumentError=InvalidArgumentError},9754:(t,u,p)=>{const{humanReadableArgName:m}=p(9154);class Help{constructor(){this.helpWidth=undefined;this.sortSubcommands=false;this.sortOptions=false;this.showGlobalOptions=false}visibleCommands(t){const u=t.commands.filter((t=>!t._hidden));const p=t._getHelpCommand();if(p&&!p._hidden){u.push(p)}if(this.sortSubcommands){u.sort(((t,u)=>t.name().localeCompare(u.name())))}return u}compareOptions(t,u){const getSortKey=t=>t.short?t.short.replace(/^-/,""):t.long.replace(/^--/,"");return getSortKey(t).localeCompare(getSortKey(u))}visibleOptions(t){const u=t.options.filter((t=>!t.hidden));const p=t._getHelpOption();if(p&&!p.hidden){const m=p.short&&t._findOption(p.short);const g=p.long&&t._findOption(p.long);if(!m&&!g){u.push(p)}else if(p.long&&!g){u.push(t.createOption(p.long,p.description))}else if(p.short&&!m){u.push(t.createOption(p.short,p.description))}}if(this.sortOptions){u.sort(this.compareOptions)}return u}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];const u=[];for(let p=t.parent;p;p=p.parent){const t=p.options.filter((t=>!t.hidden));u.push(...t)}if(this.sortOptions){u.sort(this.compareOptions)}return u}visibleArguments(t){if(t._argsDescription){t.registeredArguments.forEach((u=>{u.description=u.description||t._argsDescription[u.name()]||""}))}if(t.registeredArguments.find((t=>t.description))){return t.registeredArguments}return[]}subcommandTerm(t){const u=t.registeredArguments.map((t=>m(t))).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(u?" "+u:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,u){return u.visibleCommands(t).reduce(((t,p)=>Math.max(t,u.subcommandTerm(p).length)),0)}longestOptionTermLength(t,u){return u.visibleOptions(t).reduce(((t,p)=>Math.max(t,u.optionTerm(p).length)),0)}longestGlobalOptionTermLength(t,u){return u.visibleGlobalOptions(t).reduce(((t,p)=>Math.max(t,u.optionTerm(p).length)),0)}longestArgumentTermLength(t,u){return u.visibleArguments(t).reduce(((t,p)=>Math.max(t,u.argumentTerm(p).length)),0)}commandUsage(t){let u=t._name;if(t._aliases[0]){u=u+"|"+t._aliases[0]}let p="";for(let u=t.parent;u;u=u.parent){p=u.name()+" "+p}return p+u+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){const u=[];if(t.argChoices){u.push(`choices: ${t.argChoices.map((t=>JSON.stringify(t))).join(", ")}`)}if(t.defaultValue!==undefined){const p=t.required||t.optional||t.isBoolean()&&typeof t.defaultValue==="boolean";if(p){u.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`)}}if(t.presetArg!==undefined&&t.optional){u.push(`preset: ${JSON.stringify(t.presetArg)}`)}if(t.envVar!==undefined){u.push(`env: ${t.envVar}`)}if(u.length>0){return`${t.description} (${u.join(", ")})`}return t.description}argumentDescription(t){const u=[];if(t.argChoices){u.push(`choices: ${t.argChoices.map((t=>JSON.stringify(t))).join(", ")}`)}if(t.defaultValue!==undefined){u.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`)}if(u.length>0){const p=`(${u.join(", ")})`;if(t.description){return`${t.description} ${p}`}return p}return t.description}formatHelp(t,u){const p=u.padWidth(t,u);const m=u.helpWidth||80;const g=2;const y=2;function formatItem(t,v){if(v){const b=`${t.padEnd(p+y)}${v}`;return u.wrap(b,m-g,p+y)}return t}function formatList(t){return t.join("\n").replace(/^/gm," ".repeat(g))}let v=[`Usage: ${u.commandUsage(t)}`,""];const b=u.commandDescription(t);if(b.length>0){v=v.concat([u.wrap(b,m,0),""])}const w=u.visibleArguments(t).map((t=>formatItem(u.argumentTerm(t),u.argumentDescription(t))));if(w.length>0){v=v.concat(["Arguments:",formatList(w),""])}const E=u.visibleOptions(t).map((t=>formatItem(u.optionTerm(t),u.optionDescription(t))));if(E.length>0){v=v.concat(["Options:",formatList(E),""])}if(this.showGlobalOptions){const p=u.visibleGlobalOptions(t).map((t=>formatItem(u.optionTerm(t),u.optionDescription(t))));if(p.length>0){v=v.concat(["Global Options:",formatList(p),""])}}const $=u.visibleCommands(t).map((t=>formatItem(u.subcommandTerm(t),u.subcommandDescription(t))));if($.length>0){v=v.concat(["Commands:",formatList($),""])}return v.join("\n")}padWidth(t,u){return Math.max(u.longestOptionTermLength(t,u),u.longestGlobalOptionTermLength(t,u),u.longestSubcommandTermLength(t,u),u.longestArgumentTermLength(t,u))}wrap(t,u,p,m=40){const g=" \\f\\t\\v - \ufeff";const y=new RegExp(`[\\n][${g}]+`);if(t.match(y))return t;const v=u-p;if(v<m)return t;const b=t.slice(0,p);const w=t.slice(p).replace("\r\n","\n");const E=" ".repeat(p);const $="";const R=`\\s${$}`;const O=new RegExp(`\n|.{1,${v-1}}([${R}]|$)|[^${R}]+?([${R}]|$)`,"g");const P=w.match(O)||[];return b+P.map(((t,u)=>{if(t==="\n")return"";return(u>0?E:"")+t.trimEnd()})).join("\n")}}u.Help=Help},5240:(t,u,p)=>{const{InvalidArgumentError:m}=p(1135);class Option{constructor(t,u){this.flags=t;this.description=u||"";this.required=t.includes("<");this.optional=t.includes("[");this.variadic=/\w\.\.\.[>\]]$/.test(t);this.mandatory=false;const p=splitOptionFlags(t);this.short=p.shortFlag;this.long=p.longFlag;this.negate=false;if(this.long){this.negate=this.long.startsWith("--no-")}this.defaultValue=undefined;this.defaultValueDescription=undefined;this.presetArg=undefined;this.envVar=undefined;this.parseArg=undefined;this.hidden=false;this.argChoices=undefined;this.conflictsWith=[];this.implied=undefined}default(t,u){this.defaultValue=t;this.defaultValueDescription=u;return this}preset(t){this.presetArg=t;return this}conflicts(t){this.conflictsWith=this.conflictsWith.concat(t);return this}implies(t){let u=t;if(typeof t==="string"){u={[t]:true}}this.implied=Object.assign(this.implied||{},u);return this}env(t){this.envVar=t;return this}argParser(t){this.parseArg=t;return this}makeOptionMandatory(t=true){this.mandatory=!!t;return this}hideHelp(t=true){this.hidden=!!t;return this}_concatValue(t,u){if(u===this.defaultValue||!Array.isArray(u)){return[t]}return u.concat(t)}choices(t){this.argChoices=t.slice();this.parseArg=(t,u)=>{if(!this.argChoices.includes(t)){throw new m(`Allowed choices are ${this.argChoices.join(", ")}.`)}if(this.variadic){return this._concatValue(t,u)}return t};return this}name(){if(this.long){return this.long.replace(/^--/,"")}return this.short.replace(/^-/,"")}attributeName(){return camelcase(this.name().replace(/^no-/,""))}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class DualOptions{constructor(t){this.positiveOptions=new Map;this.negativeOptions=new Map;this.dualOptions=new Set;t.forEach((t=>{if(t.negate){this.negativeOptions.set(t.attributeName(),t)}else{this.positiveOptions.set(t.attributeName(),t)}}));this.negativeOptions.forEach(((t,u)=>{if(this.positiveOptions.has(u)){this.dualOptions.add(u)}}))}valueFromOption(t,u){const p=u.attributeName();if(!this.dualOptions.has(p))return true;const m=this.negativeOptions.get(p).presetArg;const g=m!==undefined?m:false;return u.negate===(g===t)}}function camelcase(t){return t.split("-").reduce(((t,u)=>t+u[0].toUpperCase()+u.slice(1)))}function splitOptionFlags(t){let u;let p;const m=t.split(/[ |,]+/);if(m.length>1&&!/^[[<]/.test(m[1]))u=m.shift();p=m.shift();if(!u&&/^-[^-]$/.test(p)){u=p;p=undefined}return{shortFlag:u,longFlag:p}}u.Option=Option;u.DualOptions=DualOptions},5030:(t,u)=>{const p=3;function editDistance(t,u){if(Math.abs(t.length-u.length)>p)return Math.max(t.length,u.length);const m=[];for(let u=0;u<=t.length;u++){m[u]=[u]}for(let t=0;t<=u.length;t++){m[0][t]=t}for(let p=1;p<=u.length;p++){for(let g=1;g<=t.length;g++){let y=1;if(t[g-1]===u[p-1]){y=0}else{y=1}m[g][p]=Math.min(m[g-1][p]+1,m[g][p-1]+1,m[g-1][p-1]+y);if(g>1&&p>1&&t[g-1]===u[p-2]&&t[g-2]===u[p-1]){m[g][p]=Math.min(m[g][p],m[g-2][p-2]+1)}}}return m[t.length][u.length]}function suggestSimilar(t,u){if(!u||u.length===0)return"";u=Array.from(new Set(u));const m=t.startsWith("--");if(m){t=t.slice(2);u=u.map((t=>t.slice(2)))}let g=[];let y=p;const v=.4;u.forEach((u=>{if(u.length<=1)return;const p=editDistance(t,u);const m=Math.max(t.length,u.length);const b=(m-p)/m;if(b>v){if(p<y){y=p;g=[u]}else if(p===y){g.push(u)}}}));g.sort(((t,u)=>t.localeCompare(u)));if(m){g=g.map((t=>`--${t}`))}if(g.length>1){return`\n(Did you mean one of ${g.join(", ")}?)`}if(g.length===1){return`\n(Did you mean ${g[0]}?)`}return""}u.suggestSimilar=suggestSimilar},3770:t=>{"use strict";t.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},13:t=>{"use strict";t.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/applicator","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/applicator":true},"$dynamicAnchor":"meta","title":"Applicator vocabulary meta-schema","type":["object","boolean"],"properties":{"prefixItems":{"$ref":"#/$defs/schemaArray"},"items":{"$dynamicRef":"#meta"},"contains":{"$dynamicRef":"#meta"},"additionalProperties":{"$dynamicRef":"#meta"},"properties":{"type":"object","additionalProperties":{"$dynamicRef":"#meta"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$dynamicRef":"#meta"},"propertyNames":{"format":"regex"},"default":{}},"dependentSchemas":{"type":"object","additionalProperties":{"$dynamicRef":"#meta"},"default":{}},"propertyNames":{"$dynamicRef":"#meta"},"if":{"$dynamicRef":"#meta"},"then":{"$dynamicRef":"#meta"},"else":{"$dynamicRef":"#meta"},"allOf":{"$ref":"#/$defs/schemaArray"},"anyOf":{"$ref":"#/$defs/schemaArray"},"oneOf":{"$ref":"#/$defs/schemaArray"},"not":{"$dynamicRef":"#meta"}},"$defs":{"schemaArray":{"type":"array","minItems":1,"items":{"$dynamicRef":"#meta"}}}}')},2394:t=>{"use strict";t.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/content","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/content":true},"$dynamicAnchor":"meta","title":"Content vocabulary meta-schema","type":["object","boolean"],"properties":{"contentEncoding":{"type":"string"},"contentMediaType":{"type":"string"},"contentSchema":{"$dynamicRef":"#meta"}}}')},4771:t=>{"use strict";t.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/core","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/core":true},"$dynamicAnchor":"meta","title":"Core vocabulary meta-schema","type":["object","boolean"],"properties":{"$id":{"$ref":"#/$defs/uriReferenceString","$comment":"Non-empty fragments not allowed.","pattern":"^[^#]*#?$"},"$schema":{"$ref":"#/$defs/uriString"},"$ref":{"$ref":"#/$defs/uriReferenceString"},"$anchor":{"$ref":"#/$defs/anchorString"},"$dynamicRef":{"$ref":"#/$defs/uriReferenceString"},"$dynamicAnchor":{"$ref":"#/$defs/anchorString"},"$vocabulary":{"type":"object","propertyNames":{"$ref":"#/$defs/uriString"},"additionalProperties":{"type":"boolean"}},"$comment":{"type":"string"},"$defs":{"type":"object","additionalProperties":{"$dynamicRef":"#meta"}}},"$defs":{"anchorString":{"type":"string","pattern":"^[A-Za-z_][-A-Za-z0-9._]*$"},"uriString":{"type":"string","format":"uri"},"uriReferenceString":{"type":"string","format":"uri-reference"}}}')},9567:t=>{"use strict";t.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/format-annotation","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/format-annotation":true},"$dynamicAnchor":"meta","title":"Format vocabulary meta-schema for annotation results","type":["object","boolean"],"properties":{"format":{"type":"string"}}}')},8364:t=>{"use strict";t.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/meta-data","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/meta-data":true},"$dynamicAnchor":"meta","title":"Meta-data vocabulary meta-schema","type":["object","boolean"],"properties":{"title":{"type":"string"},"description":{"type":"string"},"default":true,"deprecated":{"type":"boolean","default":false},"readOnly":{"type":"boolean","default":false},"writeOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true}}}')},7388:t=>{"use strict";t.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/unevaluated","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/unevaluated":true},"$dynamicAnchor":"meta","title":"Unevaluated applicator vocabulary meta-schema","type":["object","boolean"],"properties":{"unevaluatedItems":{"$dynamicRef":"#meta"},"unevaluatedProperties":{"$dynamicRef":"#meta"}}}')},2943:t=>{"use strict";t.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/meta/validation","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/validation":true},"$dynamicAnchor":"meta","title":"Validation vocabulary meta-schema","type":["object","boolean"],"properties":{"type":{"anyOf":[{"$ref":"#/$defs/simpleTypes"},{"type":"array","items":{"$ref":"#/$defs/simpleTypes"},"minItems":1,"uniqueItems":true}]},"const":true,"enum":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/$defs/nonNegativeInteger"},"minLength":{"$ref":"#/$defs/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"maxItems":{"$ref":"#/$defs/nonNegativeInteger"},"minItems":{"$ref":"#/$defs/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"maxContains":{"$ref":"#/$defs/nonNegativeInteger"},"minContains":{"$ref":"#/$defs/nonNegativeInteger","default":1},"maxProperties":{"$ref":"#/$defs/nonNegativeInteger"},"minProperties":{"$ref":"#/$defs/nonNegativeIntegerDefault0"},"required":{"$ref":"#/$defs/stringArray"},"dependentRequired":{"type":"object","additionalProperties":{"$ref":"#/$defs/stringArray"}}},"$defs":{"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"$ref":"#/$defs/nonNegativeInteger","default":0},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}}}')},6261:t=>{"use strict";t.exports=JSON.parse('{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://json-schema.org/draft/2020-12/schema","$vocabulary":{"https://json-schema.org/draft/2020-12/vocab/core":true,"https://json-schema.org/draft/2020-12/vocab/applicator":true,"https://json-schema.org/draft/2020-12/vocab/unevaluated":true,"https://json-schema.org/draft/2020-12/vocab/validation":true,"https://json-schema.org/draft/2020-12/vocab/meta-data":true,"https://json-schema.org/draft/2020-12/vocab/format-annotation":true,"https://json-schema.org/draft/2020-12/vocab/content":true},"$dynamicAnchor":"meta","title":"Core and Validation specifications meta-schema","allOf":[{"$ref":"meta/core"},{"$ref":"meta/applicator"},{"$ref":"meta/unevaluated"},{"$ref":"meta/validation"},{"$ref":"meta/meta-data"},{"$ref":"meta/format-annotation"},{"$ref":"meta/content"}],"type":["object","boolean"],"$comment":"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.","properties":{"definitions":{"$comment":"\\"definitions\\" has been replaced by \\"$defs\\".","type":"object","additionalProperties":{"$dynamicRef":"#meta"},"deprecated":true,"default":{}},"dependencies":{"$comment":"\\"dependencies\\" has been split and replaced by \\"dependentSchemas\\" and \\"dependentRequired\\" in order to serve their differing semantics.","type":"object","additionalProperties":{"anyOf":[{"$dynamicRef":"#meta"},{"$ref":"meta/validation#/$defs/stringArray"}]},"deprecated":true,"default":{}},"$recursiveAnchor":{"$comment":"\\"$recursiveAnchor\\" has been replaced by \\"$dynamicAnchor\\".","$ref":"meta/core#/$defs/anchorString","deprecated":true},"$recursiveRef":{"$comment":"\\"$recursiveRef\\" has been replaced by \\"$dynamicRef\\".","$ref":"meta/core#/$defs/uriReferenceString","deprecated":true}}}')},3928:t=>{"use strict";t.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},2040:t=>{"use strict";t.exports=JSON.parse('[{"name":"Agola CI","constant":"AGOLA","env":"AGOLA_GIT_REF","pr":"AGOLA_PULL_REQUEST_ID"},{"name":"Appcircle","constant":"APPCIRCLE","env":"AC_APPCIRCLE"},{"name":"AppVeyor","constant":"APPVEYOR","env":"APPVEYOR","pr":"APPVEYOR_PULL_REQUEST_NUMBER"},{"name":"AWS CodeBuild","constant":"CODEBUILD","env":"CODEBUILD_BUILD_ARN"},{"name":"Azure Pipelines","constant":"AZURE_PIPELINES","env":"TF_BUILD","pr":{"BUILD_REASON":"PullRequest"}},{"name":"Bamboo","constant":"BAMBOO","env":"bamboo_planKey"},{"name":"Bitbucket Pipelines","constant":"BITBUCKET","env":"BITBUCKET_COMMIT","pr":"BITBUCKET_PR_ID"},{"name":"Bitrise","constant":"BITRISE","env":"BITRISE_IO","pr":"BITRISE_PULL_REQUEST"},{"name":"Buddy","constant":"BUDDY","env":"BUDDY_WORKSPACE_ID","pr":"BUDDY_EXECUTION_PULL_REQUEST_ID"},{"name":"Buildkite","constant":"BUILDKITE","env":"BUILDKITE","pr":{"env":"BUILDKITE_PULL_REQUEST","ne":"false"}},{"name":"CircleCI","constant":"CIRCLE","env":"CIRCLECI","pr":"CIRCLE_PULL_REQUEST"},{"name":"Cirrus CI","constant":"CIRRUS","env":"CIRRUS_CI","pr":"CIRRUS_PR"},{"name":"Codefresh","constant":"CODEFRESH","env":"CF_BUILD_ID","pr":{"any":["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{"name":"Codemagic","constant":"CODEMAGIC","env":"CM_BUILD_ID","pr":"CM_PULL_REQUEST"},{"name":"Codeship","constant":"CODESHIP","env":{"CI_NAME":"codeship"}},{"name":"Drone","constant":"DRONE","env":"DRONE","pr":{"DRONE_BUILD_EVENT":"pull_request"}},{"name":"dsari","constant":"DSARI","env":"DSARI"},{"name":"Earthly","constant":"EARTHLY","env":"EARTHLY_CI"},{"name":"Expo Application Services","constant":"EAS","env":"EAS_BUILD"},{"name":"Gerrit","constant":"GERRIT","env":"GERRIT_PROJECT"},{"name":"Gitea Actions","constant":"GITEA_ACTIONS","env":"GITEA_ACTIONS"},{"name":"GitHub Actions","constant":"GITHUB_ACTIONS","env":"GITHUB_ACTIONS","pr":{"GITHUB_EVENT_NAME":"pull_request"}},{"name":"GitLab CI","constant":"GITLAB","env":"GITLAB_CI","pr":"CI_MERGE_REQUEST_ID"},{"name":"GoCD","constant":"GOCD","env":"GO_PIPELINE_LABEL"},{"name":"Google Cloud Build","constant":"GOOGLE_CLOUD_BUILD","env":"BUILDER_OUTPUT"},{"name":"Harness CI","constant":"HARNESS","env":"HARNESS_BUILD_ID"},{"name":"Heroku","constant":"HEROKU","env":{"env":"NODE","includes":"/app/.heroku/node/bin/node"}},{"name":"Hudson","constant":"HUDSON","env":"HUDSON_URL"},{"name":"Jenkins","constant":"JENKINS","env":["JENKINS_URL","BUILD_ID"],"pr":{"any":["ghprbPullId","CHANGE_ID"]}},{"name":"LayerCI","constant":"LAYERCI","env":"LAYERCI","pr":"LAYERCI_PULL_REQUEST"},{"name":"Magnum CI","constant":"MAGNUM","env":"MAGNUM"},{"name":"Netlify CI","constant":"NETLIFY","env":"NETLIFY","pr":{"env":"PULL_REQUEST","ne":"false"}},{"name":"Nevercode","constant":"NEVERCODE","env":"NEVERCODE","pr":{"env":"NEVERCODE_PULL_REQUEST","ne":"false"}},{"name":"Prow","constant":"PROW","env":"PROW_JOB_ID"},{"name":"ReleaseHub","constant":"RELEASEHUB","env":"RELEASE_BUILD_ID"},{"name":"Render","constant":"RENDER","env":"RENDER","pr":{"IS_PULL_REQUEST":"true"}},{"name":"Sail CI","constant":"SAIL","env":"SAILCI","pr":"SAIL_PULL_REQUEST_NUMBER"},{"name":"Screwdriver","constant":"SCREWDRIVER","env":"SCREWDRIVER","pr":{"env":"SD_PULL_REQUEST","ne":"false"}},{"name":"Semaphore","constant":"SEMAPHORE","env":"SEMAPHORE","pr":"PULL_REQUEST_NUMBER"},{"name":"Sourcehut","constant":"SOURCEHUT","env":{"CI_NAME":"sourcehut"}},{"name":"Strider CD","constant":"STRIDER","env":"STRIDER"},{"name":"TaskCluster","constant":"TASKCLUSTER","env":["TASK_ID","RUN_ID"]},{"name":"TeamCity","constant":"TEAMCITY","env":"TEAMCITY_VERSION"},{"name":"Travis CI","constant":"TRAVIS","env":"TRAVIS","pr":{"env":"TRAVIS_PULL_REQUEST","ne":"false"}},{"name":"Vela","constant":"VELA","env":"VELA","pr":{"VELA_PULL_REQUEST":"1"}},{"name":"Vercel","constant":"VERCEL","env":{"any":["NOW_BUILDER","VERCEL"]},"pr":"VERCEL_GIT_PULL_REQUEST_ID"},{"name":"Visual Studio App Center","constant":"APPCENTER","env":"APPCENTER_BUILD_ID"},{"name":"Woodpecker","constant":"WOODPECKER","env":{"CI":"woodpecker"},"pr":{"CI_BUILD_EVENT":"pull_request"}},{"name":"Xcode Cloud","constant":"XCODE_CLOUD","env":"CI_XCODE_PROJECT","pr":"CI_PULL_REQUEST_NUMBER"},{"name":"Xcode Server","constant":"XCODE_SERVER","env":"XCS"}]')}};var u={};function __nccwpck_require__(p){var m=u[p];if(m!==undefined){return m.exports}var g=u[p]={exports:{}};var y=true;try{t[p](g,g.exports,__nccwpck_require__);y=false}finally{if(y)delete u[p]}return g.exports}(()=>{__nccwpck_require__.n=t=>{var u=t&&t.__esModule?()=>t["default"]:()=>t;__nccwpck_require__.d(u,{a:u});return u}})();(()=>{var t=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__;var u;__nccwpck_require__.t=function(p,m){if(m&1)p=this(p);if(m&8)return p;if(typeof p==="object"&&p){if(m&4&&p.__esModule)return p;if(m&16&&typeof p.then==="function")return p}var g=Object.create(null);__nccwpck_require__.r(g);var y={};u=u||[null,t({}),t([]),t(t)];for(var v=m&2&&p;typeof v=="object"&&!~u.indexOf(v);v=t(v)){Object.getOwnPropertyNames(v).forEach((t=>y[t]=()=>p[t]))}y["default"]=()=>p;__nccwpck_require__.d(g,y);return g}})();(()=>{__nccwpck_require__.d=(t,u)=>{for(var p in u){if(__nccwpck_require__.o(u,p)&&!__nccwpck_require__.o(t,p)){Object.defineProperty(t,p,{enumerable:true,get:u[p]})}}}})();(()=>{__nccwpck_require__.o=(t,u)=>Object.prototype.hasOwnProperty.call(t,u)})();(()=>{__nccwpck_require__.r=t=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(t,"__esModule",{value:true})}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var p={};(()=>{"use strict";var t=__nccwpck_require__(6395);var u=__nccwpck_require__.n(t);var p=__nccwpck_require__(8909);const{DM:m,gu:g,er:y,Ww:v,b7:b,Di:w,a2:E,uB:$,ef:R,c$:O,_V:P}=p;const x=require("node:util");var A=__nccwpck_require__(1708);var T=__nccwpck_require__(3024);var k=__nccwpck_require__(6760);const C=require("node:crypto");const I=require("node:assert");const isObject=t=>{const u=typeof t;return t!==null&&(u==="object"||u==="function")};const isEmptyObject=t=>isObject(t)&&Object.keys(t).length===0;const N=new Set(["__proto__","prototype","constructor"]);const D=new Set("0123456789");function getPathSegments(t){const u=[];let p="";let m="start";let g=false;for(const y of t){switch(y){case"\\":{if(m==="index"){throw new Error("Invalid character in an index")}if(m==="indexEnd"){throw new Error("Invalid character after an index")}if(g){p+=y}m="property";g=!g;break}case".":{if(m==="index"){throw new Error("Invalid character in an index")}if(m==="indexEnd"){m="property";break}if(g){g=false;p+=y;break}if(N.has(p)){return[]}u.push(p);p="";m="property";break}case"[":{if(m==="index"){throw new Error("Invalid character in an index")}if(m==="indexEnd"){m="index";break}if(g){g=false;p+=y;break}if(m==="property"){if(N.has(p)){return[]}u.push(p);p=""}m="index";break}case"]":{if(m==="index"){u.push(Number.parseInt(p,10));p="";m="indexEnd";break}if(m==="indexEnd"){throw new Error("Invalid character after an index")}}default:{if(m==="index"&&!D.has(y)){throw new Error("Invalid character in an index")}if(m==="indexEnd"){throw new Error("Invalid character after an index")}if(m==="start"){m="property"}if(g){g=false;p+="\\"}p+=y}}}if(g){p+="\\"}switch(m){case"property":{if(N.has(p)){return[]}u.push(p);break}case"index":{throw new Error("Index was not closed")}case"start":{u.push("");break}}return u}function isStringIndex(t,u){if(typeof u!=="number"&&Array.isArray(t)){const p=Number.parseInt(u,10);return Number.isInteger(p)&&t[p]===t[u]}return false}function assertNotStringIndex(t,u){if(isStringIndex(t,u)){throw new Error("Cannot use string index")}}function getProperty(t,u,p){if(!isObject(t)||typeof u!=="string"){return p===undefined?t:p}const m=getPathSegments(u);if(m.length===0){return p}for(let u=0;u<m.length;u++){const g=m[u];if(isStringIndex(t,g)){t=u===m.length-1?undefined:null}else{t=t[g]}if(t===undefined||t===null){if(u!==m.length-1){return p}break}}return t===undefined?p:t}function setProperty(t,u,p){if(!isObject(t)||typeof u!=="string"){return t}const m=t;const g=getPathSegments(u);for(let u=0;u<g.length;u++){const m=g[u];assertNotStringIndex(t,m);if(u===g.length-1){t[m]=p}else if(!isObject(t[m])){t[m]=typeof g[u+1]==="number"?[]:{}}t=t[m]}return m}function deleteProperty(t,u){if(!isObject(t)||typeof u!=="string"){return false}const p=getPathSegments(u);for(let u=0;u<p.length;u++){const m=p[u];assertNotStringIndex(t,m);if(u===p.length-1){delete t[m];return true}t=t[m];if(!isObject(t)){return false}}}function hasProperty(t,u){if(!isObject(t)||typeof u!=="string"){return false}const p=getPathSegments(u);if(p.length===0){return false}for(const u of p){if(!isObject(t)||!(u in t)||isStringIndex(t,u)){return false}t=t[u]}return true}function escapePath(t){if(typeof t!=="string"){throw new TypeError("Expected a string")}return t.replaceAll(/[\\.[]/g,"\\$&")}function entries(t){const u=Object.entries(t);if(Array.isArray(t)){return u.map((([t,u])=>[Number(t),u]))}return u}function stringifyPath(t){let u="";for(let[p,m]of entries(t)){if(typeof m==="number"){u+=`[${m}]`}else{m=escapePath(m);u+=p===0?m:`.${m}`}}return u}function*deepKeysIterator(t,u=[]){if(!isObject(t)||isEmptyObject(t)){if(u.length>0){yield stringifyPath(u)}return}for(const[p,m]of entries(t)){yield*deepKeysIterator(m,[...u,p])}}function deepKeys(t){return[...deepKeysIterator(t)]}const L=require("node:os");const M=L.homedir();const j=L.tmpdir();const{env:U}=A;const macos=t=>{const u=k.join(M,"Library");return{data:k.join(u,"Application Support",t),config:k.join(u,"Preferences",t),cache:k.join(u,"Caches",t),log:k.join(u,"Logs",t),temp:k.join(j,t)}};const windows=t=>{const u=U.APPDATA||k.join(M,"AppData","Roaming");const p=U.LOCALAPPDATA||k.join(M,"AppData","Local");return{data:k.join(p,t,"Data"),config:k.join(u,t,"Config"),cache:k.join(p,t,"Cache"),log:k.join(p,t,"Log"),temp:k.join(j,t)}};const linux=t=>{const u=k.basename(M);return{data:k.join(U.XDG_DATA_HOME||k.join(M,".local","share"),t),config:k.join(U.XDG_CONFIG_HOME||k.join(M,".config"),t),cache:k.join(U.XDG_CACHE_HOME||k.join(M,".cache"),t),log:k.join(U.XDG_STATE_HOME||k.join(M,".local","state"),t),temp:k.join(j,u,t)}};function envPaths(t,{suffix:u="nodejs"}={}){if(typeof t!=="string"){throw new TypeError(`Expected a string, got ${typeof t}`)}if(u){t+=`-${u}`}if(A.platform==="darwin"){return macos(t)}if(A.platform==="win32"){return windows(t)}return linux(t)}const attemptifyAsync=(t,u)=>function attemptified(...p){return t.apply(undefined,p).catch(u)};const attemptifySync=(t,u)=>function attemptified(...p){try{return t.apply(undefined,p)}catch(t){return u(t)}};const B=A.getuid?!A.getuid():false;const H=1e4;const NOOP=()=>undefined;const V={isChangeErrorOk:t=>{if(!V.isNodeError(t))return false;const{code:u}=t;if(u==="ENOSYS")return true;if(!B&&(u==="EINVAL"||u==="EPERM"))return true;return false},isNodeError:t=>t instanceof Error,isRetriableError:t=>{if(!V.isNodeError(t))return false;const{code:u}=t;if(u==="EMFILE"||u==="ENFILE"||u==="EAGAIN"||u==="EBUSY"||u==="EACCESS"||u==="EACCES"||u==="EACCS"||u==="EPERM")return true;return false},onChangeError:t=>{if(!V.isNodeError(t))throw t;if(V.isChangeErrorOk(t))return;throw t}};const z=V;class RetryfyQueue{constructor(){this.interval=25;this.intervalId=undefined;this.limit=H;this.queueActive=new Set;this.queueWaiting=new Set;this.init=()=>{if(this.intervalId)return;this.intervalId=setInterval(this.tick,this.interval)};this.reset=()=>{if(!this.intervalId)return;clearInterval(this.intervalId);delete this.intervalId};this.add=t=>{this.queueWaiting.add(t);if(this.queueActive.size<this.limit/2){this.tick()}else{this.init()}};this.remove=t=>{this.queueWaiting.delete(t);this.queueActive.delete(t)};this.schedule=()=>new Promise((t=>{const cleanup=()=>this.remove(resolver);const resolver=()=>t(cleanup);this.add(resolver)}));this.tick=()=>{if(this.queueActive.size>=this.limit)return;if(!this.queueWaiting.size)return this.reset();for(const t of this.queueWaiting){if(this.queueActive.size>=this.limit)break;this.queueWaiting.delete(t);this.queueActive.add(t);t()}}}}const G=new RetryfyQueue;const retryifyAsync=(t,u)=>function retrified(p){return function attempt(...m){return G.schedule().then((g=>{const onResolve=t=>{g();return t};const onReject=t=>{g();if(Date.now()>=p)throw t;if(u(t)){const t=Math.round(100*Math.random());const u=new Promise((u=>setTimeout(u,t)));return u.then((()=>attempt.apply(undefined,m)))}throw t};return t.apply(undefined,m).then(onResolve,onReject)}))}};const retryifySync=(t,u)=>function retrified(p){return function attempt(...m){try{return t.apply(undefined,m)}catch(t){if(Date.now()>p)throw t;if(u(t))return attempt.apply(undefined,m);throw t}}};const q={attempt:{chmod:attemptifyAsync((0,x.promisify)(T.chmod),z.onChangeError),chown:attemptifyAsync((0,x.promisify)(T.chown),z.onChangeError),close:attemptifyAsync((0,x.promisify)(T.close),NOOP),fsync:attemptifyAsync((0,x.promisify)(T.fsync),NOOP),mkdir:attemptifyAsync((0,x.promisify)(T.mkdir),NOOP),realpath:attemptifyAsync((0,x.promisify)(T.realpath),NOOP),stat:attemptifyAsync((0,x.promisify)(T.stat),NOOP),unlink:attemptifyAsync((0,x.promisify)(T.unlink),NOOP),chmodSync:attemptifySync(T.chmodSync,z.onChangeError),chownSync:attemptifySync(T.chownSync,z.onChangeError),closeSync:attemptifySync(T.closeSync,NOOP),existsSync:attemptifySync(T.existsSync,NOOP),fsyncSync:attemptifySync(T.fsync,NOOP),mkdirSync:attemptifySync(T.mkdirSync,NOOP),realpathSync:attemptifySync(T.realpathSync,NOOP),statSync:attemptifySync(T.statSync,NOOP),unlinkSync:attemptifySync(T.unlinkSync,NOOP)},retry:{close:retryifyAsync((0,x.promisify)(T.close),z.isRetriableError),fsync:retryifyAsync((0,x.promisify)(T.fsync),z.isRetriableError),open:retryifyAsync((0,x.promisify)(T.open),z.isRetriableError),readFile:retryifyAsync((0,x.promisify)(T.readFile),z.isRetriableError),rename:retryifyAsync((0,x.promisify)(T.rename),z.isRetriableError),stat:retryifyAsync((0,x.promisify)(T.stat),z.isRetriableError),write:retryifyAsync((0,x.promisify)(T.write),z.isRetriableError),writeFile:retryifyAsync((0,x.promisify)(T.writeFile),z.isRetriableError),closeSync:retryifySync(T.closeSync,z.isRetriableError),fsyncSync:retryifySync(T.fsyncSync,z.isRetriableError),openSync:retryifySync(T.openSync,z.isRetriableError),readFileSync:retryifySync(T.readFileSync,z.isRetriableError),renameSync:retryifySync(T.renameSync,z.isRetriableError),statSync:retryifySync(T.statSync,z.isRetriableError),writeSync:retryifySync(T.writeSync,z.isRetriableError),writeFileSync:retryifySync(T.writeFileSync,z.isRetriableError)}};const W=q;const Y="utf8";const Z=438;const X=511;const J={};const Q={};const ee=L.userInfo().uid;const se=L.userInfo().gid;const ie=7500;const ne=1e3;const ae=!!A.getuid;const le=A.getuid?!A.getuid():false;const ue=128;const he=1e4;const constants_NOOP=()=>{};const lang_isException=t=>t instanceof Error&&"code"in t;const lang_isFunction=t=>typeof t==="function";const lang_isString=t=>typeof t==="string";const lang_isUndefined=t=>t===undefined;const de={};const fe={next:t=>{const u=de[t];if(!u)return;u.shift();const p=u[0];if(p){p((()=>fe.next(t)))}else{delete de[t]}},schedule:t=>new Promise((u=>{let p=de[t];if(!p)p=de[t]=[];p.push(u);if(p.length>1)return;u((()=>fe.next(t)))}))};const pe=null&&fe;const me=A.platform==="linux";const ge=A.platform==="win32";const ye=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(!ge){ye.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT")}if(me){ye.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}const ve=ye;class Interceptor{constructor(){this.callbacks=new Set;this.exited=false;this.exit=t=>{if(this.exited)return;this.exited=true;for(const t of this.callbacks){t()}if(t){if(ge&&(t!=="SIGINT"&&t!=="SIGTERM"&&t!=="SIGKILL")){A.kill(A.pid,"SIGTERM")}else{A.kill(A.pid,t)}}};this.hook=()=>{A.once("exit",(()=>this.exit()));for(const t of ve){try{A.once(t,(()=>this.exit(t)))}catch{}}};this.register=t=>{this.callbacks.add(t);return()=>{this.callbacks.delete(t)}};this.hook()}}const _e=new Interceptor;const be=_e.register;const we=be;const Ee={store:{},create:t=>{const u=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6);const p=Date.now().toString().slice(-10);const m="tmp-";const g=`.${m}${p}${u}`;const y=`${t}${g}`;return y},get:(t,u,p=true)=>{const m=Ee.truncate(u(t));if(m in Ee.store)return Ee.get(t,u,p);Ee.store[m]=p;const disposer=()=>delete Ee.store[m];return[m,disposer]},purge:t=>{if(!Ee.store[t])return;delete Ee.store[t];W.attempt.unlink(t)},purgeSync:t=>{if(!Ee.store[t])return;delete Ee.store[t];W.attempt.unlinkSync(t)},purgeSyncAll:()=>{for(const t in Ee.store){Ee.purgeSync(t)}},truncate:t=>{const u=k.basename(t);if(u.length<=ue)return t;const p=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(u);if(!p)return t;const m=u.length-ue;return`${t.slice(0,-u.length)}${p[1]}${p[2].slice(0,-m)}${p[3]}`}};we(Ee.purgeSyncAll);const $e=Ee;function readFile(t,u=DEFAULT_READ_OPTIONS){if(isString(u))return readFile(t,{encoding:u});const p=Date.now()+((u.timeout??DEFAULT_TIMEOUT_ASYNC)||-1);return fs.retry.readFile(p)(t,u)}function readFileSync(t,u=DEFAULT_READ_OPTIONS){if(isString(u))return readFileSync(t,{encoding:u});const p=Date.now()+((u.timeout??DEFAULT_TIMEOUT_SYNC)||-1);return fs.retry.readFileSync(p)(t,u)}function writeFile(t,u,p,m){if(isFunction(p))return writeFile(t,u,DEFAULT_WRITE_OPTIONS,p);const g=writeFileAsync(t,u,p);if(m)g.then(m,m);return g}async function writeFileAsync(t,u,p=DEFAULT_WRITE_OPTIONS){if(isString(p))return writeFileAsync(t,u,{encoding:p});const m=Date.now()+((p.timeout??DEFAULT_TIMEOUT_ASYNC)||-1);let g=null;let y=null;let v=null;let b=null;let w=null;try{if(p.schedule)g=await p.schedule(t);y=await Scheduler.schedule(t);const E=await fs.attempt.realpath(t);const $=!!E;t=E||t;[b,v]=Temp.get(t,p.tmpCreate||Temp.create,!(p.tmpPurge===false));const R=IS_POSIX&&isUndefined(p.chown);const O=isUndefined(p.mode);if($&&(R||O)){const u=await fs.attempt.stat(t);if(u){p={...p};if(R){p.chown={uid:u.uid,gid:u.gid}}if(O){p.mode=u.mode}}}if(!$){const u=path.dirname(t);await fs.attempt.mkdir(u,{mode:DEFAULT_FOLDER_MODE,recursive:true})}w=await fs.retry.open(m)(b,"w",p.mode||DEFAULT_FILE_MODE);if(p.tmpCreated){p.tmpCreated(b)}if(isString(u)){await fs.retry.write(m)(w,u,0,p.encoding||DEFAULT_ENCODING)}else if(!isUndefined(u)){await fs.retry.write(m)(w,u,0,u.length,0)}if(p.fsync!==false){if(p.fsyncWait!==false){await fs.retry.fsync(m)(w)}else{fs.attempt.fsync(w)}}await fs.retry.close(m)(w);w=null;if(p.chown&&(p.chown.uid!==DEFAULT_USER_UID||p.chown.gid!==DEFAULT_USER_GID)){await fs.attempt.chown(b,p.chown.uid,p.chown.gid)}if(p.mode&&p.mode!==DEFAULT_FILE_MODE){await fs.attempt.chmod(b,p.mode)}try{await fs.retry.rename(m)(b,t)}catch(u){if(!isException(u))throw u;if(u.code!=="ENAMETOOLONG")throw u;await fs.retry.rename(m)(b,Temp.truncate(t))}v();b=null}finally{if(w)await fs.attempt.close(w);if(b)Temp.purge(b);if(g)g();if(y)y()}}function writeFileSync(t,u,p=Q){if(lang_isString(p))return writeFileSync(t,u,{encoding:p});const m=Date.now()+((p.timeout??ne)||-1);let g=null;let y=null;let v=null;try{const b=W.attempt.realpathSync(t);const w=!!b;t=b||t;[y,g]=$e.get(t,p.tmpCreate||$e.create,!(p.tmpPurge===false));const E=ae&&lang_isUndefined(p.chown);const $=lang_isUndefined(p.mode);if(w&&(E||$)){const u=W.attempt.statSync(t);if(u){p={...p};if(E){p.chown={uid:u.uid,gid:u.gid}}if($){p.mode=u.mode}}}if(!w){const u=k.dirname(t);W.attempt.mkdirSync(u,{mode:X,recursive:true})}v=W.retry.openSync(m)(y,"w",p.mode||Z);if(p.tmpCreated){p.tmpCreated(y)}if(lang_isString(u)){W.retry.writeSync(m)(v,u,0,p.encoding||Y)}else if(!lang_isUndefined(u)){W.retry.writeSync(m)(v,u,0,u.length,0)}if(p.fsync!==false){if(p.fsyncWait!==false){W.retry.fsyncSync(m)(v)}else{W.attempt.fsync(v)}}W.retry.closeSync(m)(v);v=null;if(p.chown&&(p.chown.uid!==ee||p.chown.gid!==se)){W.attempt.chownSync(y,p.chown.uid,p.chown.gid)}if(p.mode&&p.mode!==Z){W.attempt.chmodSync(y,p.mode)}try{W.retry.renameSync(m)(y,t)}catch(u){if(!lang_isException(u))throw u;if(u.code!=="ENAMETOOLONG")throw u;W.retry.renameSync(m)(y,$e.truncate(t))}g();y=null}finally{if(v)W.attempt.closeSync(v);if(y)$e.purge(y)}}var Re=__nccwpck_require__(939);var Oe=__nccwpck_require__(2815);const copyProperty=(t,u,p,m)=>{if(p==="length"||p==="prototype"){return}if(p==="arguments"||p==="caller"){return}const g=Object.getOwnPropertyDescriptor(t,p);const y=Object.getOwnPropertyDescriptor(u,p);if(!canCopyProperty(g,y)&&m){return}Object.defineProperty(t,p,y)};const canCopyProperty=function(t,u){return t===undefined||t.configurable||t.writable===u.writable&&t.enumerable===u.enumerable&&t.configurable===u.configurable&&(t.writable||t.value===u.value)};const changePrototype=(t,u)=>{const p=Object.getPrototypeOf(u);if(p===Object.getPrototypeOf(t)){return}Object.setPrototypeOf(t,p)};const wrappedToString=(t,u)=>`/* Wrapped ${t}*/\n${u}`;const Pe=Object.getOwnPropertyDescriptor(Function.prototype,"toString");const xe=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name");const changeToString=(t,u,p)=>{const m=p===""?"":`with ${p.trim()}() `;const g=wrappedToString.bind(null,m,u.toString());Object.defineProperty(g,"name",xe);const{writable:y,enumerable:v,configurable:b}=Pe;Object.defineProperty(t,"toString",{value:g,writable:y,enumerable:v,configurable:b})};function mimicFunction(t,u,{ignoreNonConfigurable:p=false}={}){const{name:m}=t;for(const m of Reflect.ownKeys(u)){copyProperty(t,u,m,p)}changePrototype(t,u);changeToString(t,u,m);return t}const debounceFunction=(t,u={})=>{if(typeof t!=="function"){throw new TypeError(`Expected the first argument to be a function, got \`${typeof t}\``)}const{wait:p=0,maxWait:m=Number.POSITIVE_INFINITY,before:g=false,after:y=true}=u;if(p<0||m<0){throw new RangeError("`wait` and `maxWait` must not be negative.")}if(!g&&!y){throw new Error("Both `before` and `after` are false, function wouldn't be called.")}let v;let b;let w;const debouncedFunction=function(...u){const E=this;const later=()=>{v=undefined;if(b){clearTimeout(b);b=undefined}if(y){w=t.apply(E,u)}};const maxLater=()=>{b=undefined;if(v){clearTimeout(v);v=undefined}if(y){w=t.apply(E,u)}};const $=g&&!v;clearTimeout(v);v=setTimeout(later,p);if(m>0&&m!==Number.POSITIVE_INFINITY&&!b){b=setTimeout(maxLater,m)}if($){w=t.apply(E,u)}return w};mimicFunction(debouncedFunction,t);debouncedFunction.cancel=()=>{if(v){clearTimeout(v);v=undefined}if(b){clearTimeout(b);b=undefined}};return debouncedFunction};const Ae=debounceFunction;var Te=__nccwpck_require__(6723);const ke=Object.prototype.toString;const Ce="[object Uint8Array]";const Ie="[object ArrayBuffer]";function isType(t,u,p){if(!t){return false}if(t.constructor===u){return true}return ke.call(t)===p}function isUint8Array(t){return isType(t,Uint8Array,Ce)}function isArrayBuffer(t){return isType(t,ArrayBuffer,Ie)}function isUint8ArrayOrArrayBuffer(t){return isUint8Array(t)||isArrayBuffer(t)}function assertUint8Array(t){if(!isUint8Array(t)){throw new TypeError(`Expected \`Uint8Array\`, got \`${typeof t}\``)}}function assertUint8ArrayOrArrayBuffer(t){if(!isUint8ArrayOrArrayBuffer(t)){throw new TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof t}\``)}}function toUint8Array(t){if(t instanceof ArrayBuffer){return new Uint8Array(t)}if(ArrayBuffer.isView(t)){return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}throw new TypeError(`Unsupported value, got \`${typeof t}\`.`)}function concatUint8Arrays(t,u){if(t.length===0){return new Uint8Array(0)}u??=t.reduce(((t,u)=>t+u.length),0);const p=new Uint8Array(u);let m=0;for(const u of t){assertUint8Array(u);p.set(u,m);m+=u.length}return p}function areUint8ArraysEqual(t,u){assertUint8Array(t);assertUint8Array(u);if(t===u){return true}if(t.length!==u.length){return false}for(let p=0;p<t.length;p++){if(t[p]!==u[p]){return false}}return true}function compareUint8Arrays(t,u){assertUint8Array(t);assertUint8Array(u);const p=Math.min(t.length,u.length);for(let m=0;m<p;m++){const p=t[m]-u[m];if(p!==0){return Math.sign(p)}}return Math.sign(t.length-u.length)}const Ne={utf8:new globalThis.TextDecoder("utf8")};function uint8ArrayToString(t,u="utf8"){assertUint8ArrayOrArrayBuffer(t);Ne[u]??=new globalThis.TextDecoder(u);return Ne[u].decode(t)}function assertString(t){if(typeof t!=="string"){throw new TypeError(`Expected \`string\`, got \`${typeof t}\``)}}const De=new globalThis.TextEncoder;function stringToUint8Array(t){assertString(t);return De.encode(t)}function base64ToBase64Url(t){return t.replaceAll("+","-").replaceAll("/","_").replace(/=+$/,"")}function base64UrlToBase64(t){return t.replaceAll("-","+").replaceAll("_","/")}const Le=65535;function uint8ArrayToBase64(t,{urlSafe:u=false}={}){assertUint8Array(t);let p;if(t.length<Le){p=globalThis.btoa(String.fromCodePoint.apply(this,t))}else{p="";for(const u of t){p+=String.fromCodePoint(u)}p=globalThis.btoa(p)}return u?base64ToBase64Url(p):p}function base64ToUint8Array(t){assertString(t);return Uint8Array.from(globalThis.atob(base64UrlToBase64(t)),(t=>t.codePointAt(0)))}function stringToBase64(t,{urlSafe:u=false}={}){assertString(t);return uint8ArrayToBase64(stringToUint8Array(t),{urlSafe:u})}function base64ToString(t){assertString(t);return uint8ArrayToString(base64ToUint8Array(t))}const Me=Array.from({length:256},((t,u)=>u.toString(16).padStart(2,"0")));function uint8ArrayToHex(t){assertUint8Array(t);let u="";for(let p=0;p<t.length;p++){u+=Me[t[p]]}return u}const je={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,b:11,c:12,d:13,e:14,f:15,A:10,B:11,C:12,D:13,E:14,F:15};function hexToUint8Array(t){assertString(t);if(t.length%2!==0){throw new Error("Invalid Hex string length.")}const u=t.length/2;const p=new Uint8Array(u);for(let m=0;m<u;m++){const u=je[t[m*2]];const g=je[t[m*2+1]];if(u===undefined||g===undefined){throw new Error(`Invalid Hex character encountered at position ${m*2}`)}p[m]=u<<4|g}return p}function getUintBE(t){const{byteLength:u}=t;if(u===6){return t.getUint16(0)*2**32+t.getUint32(2)}if(u===5){return t.getUint8(0)*2**32+t.getUint32(1)}if(u===4){return t.getUint32(0)}if(u===3){return t.getUint8(0)*2**16+t.getUint16(1)}if(u===2){return t.getUint16(0)}if(u===1){return t.getUint8(0)}}function indexOf(t,u){const p=t.length;const m=u.length;if(m===0){return-1}if(m>p){return-1}const g=p-m;for(let p=0;p<=g;p++){let g=true;for(let y=0;y<m;y++){if(t[p+y]!==u[y]){g=false;break}}if(g){return p}}return-1}function includes(t,u){return indexOf(t,u)!==-1}const Fe=Oe["default"];const Ue="aes-256-cbc";const createPlainObject=()=>Object.create(null);const isExist=t=>t!==undefined&&t!==null;const checkValueType=(t,u)=>{const p=new Set(["undefined","symbol","function"]);const m=typeof u;if(p.has(m)){throw new TypeError(`Setting a value of type \`${m}\` for key \`${t}\` is not allowed as it's not supported by JSON`)}};const Be="__internal__";const He=`${Be}.migrations.version`;class Conf{path;events;#e;#t;#r;#s={};constructor(t={}){const u={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:false,accessPropertiesByDotNotation:true,configFileMode:438,...t};if(!u.cwd){if(!u.projectName){throw new Error("Please specify the `projectName` option.")}u.cwd=envPaths(u.projectName,{suffix:u.projectSuffix}).config}this.#r=u;if(u.schema){if(typeof u.schema!=="object"){throw new TypeError("The `schema` option must be an object.")}const t=new Re.Ajv2020({allErrors:true,useDefaults:true});Fe(t);const p={type:"object",properties:u.schema};this.#e=t.compile(p);for(const[t,p]of Object.entries(u.schema)){if(p?.default){this.#s[t]=p.default}}}if(u.defaults){this.#s={...this.#s,...u.defaults}}if(u.serialize){this._serialize=u.serialize}if(u.deserialize){this._deserialize=u.deserialize}this.events=new EventTarget;this.#t=u.encryptionKey;const p=u.fileExtension?`.${u.fileExtension}`:"";this.path=k.resolve(u.cwd,`${u.configName??"config"}${p}`);const m=this.store;const g=Object.assign(createPlainObject(),u.defaults,m);if(u.migrations){if(!u.projectVersion){throw new Error("Please specify the `projectVersion` option.")}this._migrate(u.migrations,u.projectVersion,u.beforeEachMigration)}this._validate(g);try{I.deepEqual(m,g)}catch{this.store=g}if(u.watch){this._watch()}}get(t,u){if(this.#r.accessPropertiesByDotNotation){return this._get(t,u)}const{store:p}=this;return t in p?p[t]:u}set(t,u){if(typeof t!=="string"&&typeof t!=="object"){throw new TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof t}`)}if(typeof t!=="object"&&u===undefined){throw new TypeError("Use `delete()` to clear values")}if(this._containsReservedKey(t)){throw new TypeError(`Please don't use the ${Be} key, as it's used to manage this module internal operations.`)}const{store:p}=this;const set=(t,u)=>{checkValueType(t,u);if(this.#r.accessPropertiesByDotNotation){setProperty(p,t,u)}else{p[t]=u}};if(typeof t==="object"){const u=t;for(const[t,p]of Object.entries(u)){set(t,p)}}else{set(t,u)}this.store=p}has(t){if(this.#r.accessPropertiesByDotNotation){return hasProperty(this.store,t)}return t in this.store}reset(...t){for(const u of t){if(isExist(this.#s[u])){this.set(u,this.#s[u])}}}delete(t){const{store:u}=this;if(this.#r.accessPropertiesByDotNotation){deleteProperty(u,t)}else{delete u[t]}this.store=u}clear(){this.store=createPlainObject();for(const t of Object.keys(this.#s)){this.reset(t)}}onDidChange(t,u){if(typeof t!=="string"){throw new TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof t}`)}if(typeof u!=="function"){throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof u}`)}return this._handleChange((()=>this.get(t)),u)}onDidAnyChange(t){if(typeof t!=="function"){throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof t}`)}return this._handleChange((()=>this.store),t)}get size(){return Object.keys(this.store).length}get store(){try{const t=T.readFileSync(this.path,this.#t?null:"utf8");const u=this._encryptData(t);const p=this._deserialize(u);this._validate(p);return Object.assign(createPlainObject(),p)}catch(t){if(t?.code==="ENOENT"){this._ensureDirectory();return createPlainObject()}if(this.#r.clearInvalidConfig&&t.name==="SyntaxError"){return createPlainObject()}throw t}}set store(t){this._ensureDirectory();this._validate(t);this._write(t);this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(const[t,u]of Object.entries(this.store)){yield[t,u]}}_encryptData(t){if(!this.#t){return typeof t==="string"?t:uint8ArrayToString(t)}try{const u=t.slice(0,16);const p=C.pbkdf2Sync(this.#t,u.toString(),1e4,32,"sha512");const m=C.createDecipheriv(Ue,p,u);const g=t.slice(17);const y=typeof g==="string"?stringToUint8Array(g):g;return uint8ArrayToString(concatUint8Arrays([m.update(y),m.final()]))}catch{}return t.toString()}_handleChange(t,u){let p=t();const onChange=()=>{const m=p;const g=t();if((0,x.isDeepStrictEqual)(g,m)){return}p=g;u.call(this,g,m)};this.events.addEventListener("change",onChange);return()=>{this.events.removeEventListener("change",onChange)}}_deserialize=t=>JSON.parse(t);_serialize=t=>JSON.stringify(t,undefined,"\t");_validate(t){if(!this.#e){return}const u=this.#e(t);if(u||!this.#e.errors){return}const p=this.#e.errors.map((({instancePath:t,message:u=""})=>`\`${t.slice(1)}\` ${u}`));throw new Error("Config schema violation: "+p.join("; "))}_ensureDirectory(){T.mkdirSync(k.dirname(this.path),{recursive:true})}_write(t){let u=this._serialize(t);if(this.#t){const t=C.randomBytes(16);const p=C.pbkdf2Sync(this.#t,t.toString(),1e4,32,"sha512");const m=C.createCipheriv(Ue,p,t);u=concatUint8Arrays([t,stringToUint8Array(":"),m.update(stringToUint8Array(u)),m.final()])}if(A.env.SNAP){T.writeFileSync(this.path,u,{mode:this.#r.configFileMode})}else{try{writeFileSync(this.path,u,{mode:this.#r.configFileMode})}catch(t){if(t?.code==="EXDEV"){T.writeFileSync(this.path,u,{mode:this.#r.configFileMode});return}throw t}}}_watch(){this._ensureDirectory();if(!T.existsSync(this.path)){this._write(createPlainObject())}if(A.platform==="win32"){T.watch(this.path,{persistent:false},Ae((()=>{this.events.dispatchEvent(new Event("change"))}),{wait:100}))}else{T.watchFile(this.path,{persistent:false},Ae((()=>{this.events.dispatchEvent(new Event("change"))}),{wait:5e3}))}}_migrate(t,u,p){let m=this._get(He,"0.0.0");const g=Object.keys(t).filter((t=>this._shouldPerformMigration(t,m,u)));let y={...this.store};for(const v of g){try{if(p){p(this,{fromVersion:m,toVersion:v,finalVersion:u,versions:g})}const b=t[v];b?.(this);this._set(He,v);m=v;y={...this.store}}catch(t){this.store=y;throw new Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${t}`)}}if(this._isVersionInRangeFormat(m)||!Te.eq(m,u)){this._set(He,u)}}_containsReservedKey(t){if(typeof t==="object"){const u=Object.keys(t)[0];if(u===Be){return true}}if(typeof t!=="string"){return false}if(this.#r.accessPropertiesByDotNotation){if(t.startsWith(`${Be}.`)){return true}return false}return false}_isVersionInRangeFormat(t){return Te.clean(t)===null}_shouldPerformMigration(t,u,p){if(this._isVersionInRangeFormat(t)){if(u!=="0.0.0"&&Te.satisfies(u,t)){return false}return Te.satisfies(p,t)}if(Te.lte(t,u)){return false}if(Te.gt(t,p)){return false}return true}_get(t,u){return getProperty(this.store,t,u)}_set(t,u){const{store:p}=this;setProperty(p,t,u);this.store=p}}var Ve=__nccwpck_require__(9896);var ze=__nccwpck_require__(6928);var Ge=__nccwpck_require__.n(ze);var qe=__nccwpck_require__(9033);var We=__nccwpck_require__(7298);var Ke=__nccwpck_require__.n(We);var Ye=__nccwpck_require__(1083);var Ze=__nccwpck_require__.n(Ye);var Xe=__nccwpck_require__(9850);var Je=__nccwpck_require__.n(Xe);var Qe=__nccwpck_require__(5317);var et=__nccwpck_require__(2203);const tt=require("stream/promises");var rt=__nccwpck_require__(4434);var st=__nccwpck_require__(8474);const it=require("node:stream");const nt=require("node:string_decoder");const ot=require("assert");var ct=__nccwpck_require__(181);const ut=require("zlib");var ht=__nccwpck_require__.t(ut,2);const dt=require("node:fs/promises");var ft=Object.defineProperty;var Ar=(t,u)=>{for(var p in u)ft(t,p,{get:u[p],enumerable:!0})};var pt=typeof process=="object"&&process?process:{stdout:null,stderr:null},Cr=t=>!!t&&typeof t=="object"&&(t instanceof Qt||t instanceof it||Fr(t)||kr(t)),Fr=t=>!!t&&typeof t=="object"&&t instanceof st.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==it.Writable.prototype.pipe,kr=t=>!!t&&typeof t=="object"&&t instanceof st.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function",yt=Symbol("EOF"),vt=Symbol("maybeEmitEnd"),_t=Symbol("emittedEnd"),bt=Symbol("emittingEnd"),wt=Symbol("emittedError"),Et=Symbol("closed"),St=Symbol("read"),$t=Symbol("flush"),Rt=Symbol("flushChunk"),Ot=Symbol("encoding"),Pt=Symbol("decoder"),At=Symbol("flowing"),kt=Symbol("paused"),Ct=Symbol("resume"),It=Symbol("buffer"),Nt=Symbol("pipes"),Dt=Symbol("bufferLength"),Mt=Symbol("bufferPush"),jt=Symbol("bufferShift"),Ft=Symbol("objectMode"),Ut=Symbol("destroyed"),Bt=Symbol("error"),Ht=Symbol("emitData"),Vt=Symbol("emitEnd"),zt=Symbol("emitEnd2"),Gt=Symbol("async"),qt=Symbol("abort"),Wt=Symbol("aborted"),Kt=Symbol("signal"),Yt=Symbol("dataListeners"),Zt=Symbol("discarded"),te=t=>Promise.resolve().then(t),vr=t=>t(),Mr=t=>t==="end"||t==="finish"||t==="prefinish",Br=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,Pr=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),Xt=class{src;dest;opts;ondrain;constructor(t,u,p){this.src=t,this.dest=u,this.opts=p,this.ondrain=()=>t[Ct](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Jt=class extends Xt{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,u,p){super(t,u,p),this.proxyErrors=t=>this.dest.emit("error",t),t.on("error",this.proxyErrors)}},zr=t=>!!t.objectMode,Ur=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",Qt=class extends st.EventEmitter{[At]=!1;[kt]=!1;[Nt]=[];[It]=[];[Ft];[Ot];[Gt];[Pt];[yt]=!1;[_t]=!1;[bt]=!1;[Et]=!1;[wt]=null;[Dt]=0;[Ut]=!1;[Kt];[Wt]=!1;[Yt]=0;[Zt]=!1;writable=!0;readable=!0;constructor(...t){let u=t[0]||{};if(super(),u.objectMode&&typeof u.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");zr(u)?(this[Ft]=!0,this[Ot]=null):Ur(u)?(this[Ot]=u.encoding,this[Ft]=!1):(this[Ft]=!1,this[Ot]=null),this[Gt]=!!u.async,this[Pt]=this[Ot]?new nt.StringDecoder(this[Ot]):null,u&&u.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[It]}),u&&u.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[Nt]});let{signal:p}=u;p&&(this[Kt]=p,p.aborted?this[qt]():p.addEventListener("abort",(()=>this[qt]())))}get bufferLength(){return this[Dt]}get encoding(){return this[Ot]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[Ft]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Gt]}set async(t){this[Gt]=this[Gt]||!!t}[qt](){this[Wt]=!0,this.emit("abort",this[Kt]?.reason),this.destroy(this[Kt]?.reason)}get aborted(){return this[Wt]}set aborted(t){}write(t,u,p){if(this[Wt])return!1;if(this[yt])throw new Error("write after end");if(this[Ut])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof u=="function"&&(p=u,u="utf8"),u||(u="utf8");let m=this[Gt]?te:vr;if(!this[Ft]&&!Buffer.isBuffer(t)){if(Pr(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(Br(t))t=Buffer.from(t);else if(typeof t!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[Ft]?(this[At]&&this[Dt]!==0&&this[$t](!0),this[At]?this.emit("data",t):this[Mt](t),this[Dt]!==0&&this.emit("readable"),p&&m(p),this[At]):t.length?(typeof t=="string"&&!(u===this[Ot]&&!this[Pt]?.lastNeed)&&(t=Buffer.from(t,u)),Buffer.isBuffer(t)&&this[Ot]&&(t=this[Pt].write(t)),this[At]&&this[Dt]!==0&&this[$t](!0),this[At]?this.emit("data",t):this[Mt](t),this[Dt]!==0&&this.emit("readable"),p&&m(p),this[At]):(this[Dt]!==0&&this.emit("readable"),p&&m(p),this[At])}read(t){if(this[Ut])return null;if(this[Zt]=!1,this[Dt]===0||t===0||t&&t>this[Dt])return this[vt](),null;this[Ft]&&(t=null),this[It].length>1&&!this[Ft]&&(this[It]=[this[Ot]?this[It].join(""):Buffer.concat(this[It],this[Dt])]);let u=this[St](t||null,this[It][0]);return this[vt](),u}[St](t,u){if(this[Ft])this[jt]();else{let p=u;t===p.length||t===null?this[jt]():typeof p=="string"?(this[It][0]=p.slice(t),u=p.slice(0,t),this[Dt]-=t):(this[It][0]=p.subarray(t),u=p.subarray(0,t),this[Dt]-=t)}return this.emit("data",u),!this[It].length&&!this[yt]&&this.emit("drain"),u}end(t,u,p){return typeof t=="function"&&(p=t,t=void 0),typeof u=="function"&&(p=u,u="utf8"),t!==void 0&&this.write(t,u),p&&this.once("end",p),this[yt]=!0,this.writable=!1,(this[At]||!this[kt])&&this[vt](),this}[Ct](){this[Ut]||(!this[Yt]&&!this[Nt].length&&(this[Zt]=!0),this[kt]=!1,this[At]=!0,this.emit("resume"),this[It].length?this[$t]():this[yt]?this[vt]():this.emit("drain"))}resume(){return this[Ct]()}pause(){this[At]=!1,this[kt]=!0,this[Zt]=!1}get destroyed(){return this[Ut]}get flowing(){return this[At]}get paused(){return this[kt]}[Mt](t){this[Ft]?this[Dt]+=1:this[Dt]+=t.length,this[It].push(t)}[jt](){return this[Ft]?this[Dt]-=1:this[Dt]-=this[It][0].length,this[It].shift()}[$t](t=!1){do{}while(this[Rt](this[jt]())&&this[It].length);!t&&!this[It].length&&!this[yt]&&this.emit("drain")}[Rt](t){return this.emit("data",t),this[At]}pipe(t,u){if(this[Ut])return t;this[Zt]=!1;let p=this[_t];return u=u||{},t===pt.stdout||t===pt.stderr?u.end=!1:u.end=u.end!==!1,u.proxyErrors=!!u.proxyErrors,p?u.end&&t.end():(this[Nt].push(u.proxyErrors?new Jt(this,t,u):new Xt(this,t,u)),this[Gt]?te((()=>this[Ct]())):this[Ct]()),t}unpipe(t){let u=this[Nt].find((u=>u.dest===t));u&&(this[Nt].length===1?(this[At]&&this[Yt]===0&&(this[At]=!1),this[Nt]=[]):this[Nt].splice(this[Nt].indexOf(u),1),u.unpipe())}addListener(t,u){return this.on(t,u)}on(t,u){let p=super.on(t,u);if(t==="data")this[Zt]=!1,this[Yt]++,!this[Nt].length&&!this[At]&&this[Ct]();else if(t==="readable"&&this[Dt]!==0)super.emit("readable");else if(Mr(t)&&this[_t])super.emit(t),this.removeAllListeners(t);else if(t==="error"&&this[wt]){let t=u;this[Gt]?te((()=>t.call(this,this[wt]))):t.call(this,this[wt])}return p}removeListener(t,u){return this.off(t,u)}off(t,u){let p=super.off(t,u);return t==="data"&&(this[Yt]=this.listeners("data").length,this[Yt]===0&&!this[Zt]&&!this[Nt].length&&(this[At]=!1)),p}removeAllListeners(t){let u=super.removeAllListeners(t);return(t==="data"||t===void 0)&&(this[Yt]=0,!this[Zt]&&!this[Nt].length&&(this[At]=!1)),u}get emittedEnd(){return this[_t]}[vt](){!this[bt]&&!this[_t]&&!this[Ut]&&this[It].length===0&&this[yt]&&(this[bt]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Et]&&this.emit("close"),this[bt]=!1)}emit(t,...u){let p=u[0];if(t!=="error"&&t!=="close"&&t!==Ut&&this[Ut])return!1;if(t==="data")return!this[Ft]&&!p?!1:this[Gt]?(te((()=>this[Ht](p))),!0):this[Ht](p);if(t==="end")return this[Vt]();if(t==="close"){if(this[Et]=!0,!this[_t]&&!this[Ut])return!1;let t=super.emit("close");return this.removeAllListeners("close"),t}else if(t==="error"){this[wt]=p,super.emit(Bt,p);let t=!this[Kt]||this.listeners("error").length?super.emit("error",p):!1;return this[vt](),t}else if(t==="resume"){let t=super.emit("resume");return this[vt](),t}else if(t==="finish"||t==="prefinish"){let u=super.emit(t);return this.removeAllListeners(t),u}let m=super.emit(t,...u);return this[vt](),m}[Ht](t){for(let u of this[Nt])u.dest.write(t)===!1&&this.pause();let u=this[Zt]?!1:super.emit("data",t);return this[vt](),u}[Vt](){return this[_t]?!1:(this[_t]=!0,this.readable=!1,this[Gt]?(te((()=>this[zt]())),!0):this[zt]())}[zt](){if(this[Pt]){let t=this[Pt].end();if(t){for(let u of this[Nt])u.dest.write(t);this[Zt]||super.emit("data",t)}}for(let t of this[Nt])t.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[Ft]||(t.dataLength=0);let u=this.promise();return this.on("data",(u=>{t.push(u),this[Ft]||(t.dataLength+=u.length)})),await u,t}async concat(){if(this[Ft])throw new Error("cannot concat in objectMode");let t=await this.collect();return this[Ot]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise(((t,u)=>{this.on(Ut,(()=>u(new Error("stream destroyed")))),this.on("error",(t=>u(t))),this.on("end",(()=>t()))}))}[Symbol.asyncIterator](){this[Zt]=!1;let t=!1,e=async()=>(this.pause(),t=!0,{value:void 0,done:!0});return{next:()=>{if(t)return e();let u=this.read();if(u!==null)return Promise.resolve({done:!1,value:u});if(this[yt])return e();let p,m,h=t=>{this.off("data",a),this.off("end",l),this.off(Ut,c),e(),m(t)},a=t=>{this.off("error",h),this.off("end",l),this.off(Ut,c),this.pause(),p({value:t,done:!!this[yt]})},l=()=>{this.off("error",h),this.off("data",a),this.off(Ut,c),e(),p({done:!0,value:void 0})},c=()=>h(new Error("stream destroyed"));return new Promise(((t,u)=>{m=u,p=t,this.once(Ut,c),this.once("error",h),this.once("end",l),this.once("data",a)}))},throw:e,return:e,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[Zt]=!1;let t=!1,e=()=>(this.pause(),this.off(Bt,e),this.off(Ut,e),this.off("end",e),t=!0,{done:!0,value:void 0}),i=()=>{if(t)return e();let u=this.read();return u===null?e():{done:!1,value:u}};return this.once("end",e),this.once(Bt,e),this.once(Ut,e),{next:i,throw:e,return:e,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(t){if(this[Ut])return t?this.emit("error",t):this.emit(Ut),this;this[Ut]=!0,this[Zt]=!0,this[It].length=0,this[Dt]=0;let u=this;return typeof u.close=="function"&&!this[Et]&&u.close(),t?this.emit("error",t):this.emit(Ut),this}static get isStream(){return Cr}};var er=Ve.writev,rr=Symbol("_autoClose"),sr=Symbol("_close"),ir=Symbol("_ended"),nr=Symbol("_fd"),cr=Symbol("_finished"),lr=Symbol("_flags"),mr=Symbol("_flush"),gr=Symbol("_handleChunk"),yr=Symbol("_makeBuf"),_r=Symbol("_mode"),br=Symbol("_needDrain"),Er=Symbol("_onerror"),Sr=Symbol("_onopen"),Rr=Symbol("_onread"),Or=Symbol("_onwrite"),xr=Symbol("_open"),Ir=Symbol("_path"),Nr=Symbol("_pos"),Dr=Symbol("_queue"),Lr=Symbol("_read"),Hr=Symbol("_readSize"),Vr=Symbol("_reading"),Gr=Symbol("_remain"),Wr=Symbol("_size"),Kr=Symbol("_write"),Yr=Symbol("_writing"),Xr=Symbol("_defaultFlag"),es=Symbol("_errored"),ts=class extends Qt{[es]=!1;[nr];[Ir];[Hr];[Vr]=!1;[Wr];[Gr];[rr];constructor(t,u){if(u=u||{},super(u),this.readable=!0,this.writable=!1,typeof t!="string")throw new TypeError("path must be a string");this[es]=!1,this[nr]=typeof u.fd=="number"?u.fd:void 0,this[Ir]=t,this[Hr]=u.readSize||16*1024*1024,this[Vr]=!1,this[Wr]=typeof u.size=="number"?u.size:1/0,this[Gr]=this[Wr],this[rr]=typeof u.autoClose=="boolean"?u.autoClose:!0,typeof this[nr]=="number"?this[Lr]():this[xr]()}get fd(){return this[nr]}get path(){return this[Ir]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[xr](){Ve.open(this[Ir],"r",((t,u)=>this[Sr](t,u)))}[Sr](t,u){t?this[Er](t):(this[nr]=u,this.emit("open",u),this[Lr]())}[yr](){return Buffer.allocUnsafe(Math.min(this[Hr],this[Gr]))}[Lr](){if(!this[Vr]){this[Vr]=!0;let t=this[yr]();if(t.length===0)return process.nextTick((()=>this[Rr](null,0,t)));Ve.read(this[nr],t,0,t.length,null,((t,u,p)=>this[Rr](t,u,p)))}}[Rr](t,u,p){this[Vr]=!1,t?this[Er](t):this[gr](u,p)&&this[Lr]()}[sr](){if(this[rr]&&typeof this[nr]=="number"){let t=this[nr];this[nr]=void 0,Ve.close(t,(t=>t?this.emit("error",t):this.emit("close")))}}[Er](t){this[Vr]=!0,this[sr](),this.emit("error",t)}[gr](t,u){let p=!1;return this[Gr]-=t,t>0&&(p=super.write(t<u.length?u.subarray(0,t):u)),(t===0||this[Gr]<=0)&&(p=!1,this[sr](),super.end()),p}emit(t,...u){switch(t){case"prefinish":case"finish":return!1;case"drain":return typeof this[nr]=="number"&&this[Lr](),!1;case"error":return this[es]?!1:(this[es]=!0,super.emit(t,...u));default:return super.emit(t,...u)}}},rs=class extends ts{[xr](){let t=!0;try{this[Sr](null,Ve.openSync(this[Ir],"r")),t=!1}finally{t&&this[sr]()}}[Lr](){let t=!0;try{if(!this[Vr]){this[Vr]=!0;do{let t=this[yr](),u=t.length===0?0:Ve.readSync(this[nr],t,0,t.length,null);if(!this[gr](u,t))break}while(!0);this[Vr]=!1}t=!1}finally{t&&this[sr]()}}[sr](){if(this[rr]&&typeof this[nr]=="number"){let t=this[nr];this[nr]=void 0,Ve.closeSync(t),this.emit("close")}}},ss=class extends rt{readable=!1;writable=!0;[es]=!1;[Yr]=!1;[ir]=!1;[Dr]=[];[br]=!1;[Ir];[_r];[rr];[nr];[Xr];[lr];[cr]=!1;[Nr];constructor(t,u){u=u||{},super(u),this[Ir]=t,this[nr]=typeof u.fd=="number"?u.fd:void 0,this[_r]=u.mode===void 0?438:u.mode,this[Nr]=typeof u.start=="number"?u.start:void 0,this[rr]=typeof u.autoClose=="boolean"?u.autoClose:!0;let p=this[Nr]!==void 0?"r+":"w";this[Xr]=u.flags===void 0,this[lr]=u.flags===void 0?p:u.flags,this[nr]===void 0&&this[xr]()}emit(t,...u){if(t==="error"){if(this[es])return!1;this[es]=!0}return super.emit(t,...u)}get fd(){return this[nr]}get path(){return this[Ir]}[Er](t){this[sr](),this[Yr]=!0,this.emit("error",t)}[xr](){Ve.open(this[Ir],this[lr],this[_r],((t,u)=>this[Sr](t,u)))}[Sr](t,u){this[Xr]&&this[lr]==="r+"&&t&&t.code==="ENOENT"?(this[lr]="w",this[xr]()):t?this[Er](t):(this[nr]=u,this.emit("open",u),this[Yr]||this[mr]())}end(t,u){return t&&this.write(t,u),this[ir]=!0,!this[Yr]&&!this[Dr].length&&typeof this[nr]=="number"&&this[Or](null,0),this}write(t,u){return typeof t=="string"&&(t=Buffer.from(t,u)),this[ir]?(this.emit("error",new Error("write() after end()")),!1):this[nr]===void 0||this[Yr]||this[Dr].length?(this[Dr].push(t),this[br]=!0,!1):(this[Yr]=!0,this[Kr](t),!0)}[Kr](t){Ve.write(this[nr],t,0,t.length,this[Nr],((t,u)=>this[Or](t,u)))}[Or](t,u){t?this[Er](t):(this[Nr]!==void 0&&typeof u=="number"&&(this[Nr]+=u),this[Dr].length?this[mr]():(this[Yr]=!1,this[ir]&&!this[cr]?(this[cr]=!0,this[sr](),this.emit("finish")):this[br]&&(this[br]=!1,this.emit("drain"))))}[mr](){if(this[Dr].length===0)this[ir]&&this[Or](null,0);else if(this[Dr].length===1)this[Kr](this[Dr].pop());else{let t=this[Dr];this[Dr]=[],er(this[nr],t,this[Nr],((t,u)=>this[Or](t,u)))}}[sr](){if(this[rr]&&typeof this[nr]=="number"){let t=this[nr];this[nr]=void 0,Ve.close(t,(t=>t?this.emit("error",t):this.emit("close")))}}},is=class extends ss{[xr](){let t;if(this[Xr]&&this[lr]==="r+")try{t=Ve.openSync(this[Ir],this[lr],this[_r])}catch(t){if(t?.code==="ENOENT")return this[lr]="w",this[xr]();throw t}else t=Ve.openSync(this[Ir],this[lr],this[_r]);this[Sr](null,t)}[sr](){if(this[rr]&&typeof this[nr]=="number"){let t=this[nr];this[nr]=void 0,Ve.closeSync(t),this.emit("close")}}[Kr](t){let u=!0;try{this[Or](null,Ve.writeSync(this[nr],t,0,t.length,this[Nr])),u=!1}finally{if(u)try{this[sr]()}catch{}}}};var ns=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"]]),As=t=>!!t.sync&&!!t.file,Is=t=>!t.sync&&!!t.file,Cs=t=>!!t.sync&&!t.file,Fs=t=>!t.sync&&!t.file;var ks=t=>!!t.file;var Zr=t=>{let u=ns.get(t);return u||t},re=(t={})=>{if(!t)return{};let u={};for(let[p,m]of Object.entries(t)){let t=Zr(p);u[t]=m}return u.chmod===void 0&&u.noChmod===!1&&(u.chmod=!0),delete u.noChmod,u};var K=(t,u,p,m,g)=>Object.assign(((y=[],v,b)=>{Array.isArray(y)&&(v=y,y={}),typeof v=="function"&&(b=v,v=void 0),v?v=Array.from(v):v=[];let w=re(y);if(g?.(w,v),As(w)){if(typeof b=="function")throw new TypeError("callback not supported for sync tar functions");return t(w,v)}else if(Is(w)){let t=u(w,v),p=b||void 0;return p?t.then((()=>p()),p):t}else if(Cs(w)){if(typeof b=="function")throw new TypeError("callback not supported for sync tar functions");return p(w,v)}else if(Fs(w)){if(typeof b=="function")throw new TypeError("callback only supported with file option");return m(w,v)}else throw new Error("impossible options??")}),{syncFile:t,asyncFile:u,syncNoFile:p,asyncNoFile:m,validate:g});var os=ut.constants||{ZLIB_VERNUM:4736},as=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},os));var ls=ct.Buffer.concat,hs=Object.getOwnPropertyDescriptor(ct.Buffer,"concat"),$r=t=>t,ps=hs?.writable===!0||hs?.set!==void 0?t=>{ct.Buffer.concat=t?$r:ls}:t=>{},ms=Symbol("_superWrite"),gs=class extends Error{code;errno;constructor(t,u){super("zlib: "+t.message,{cause:t}),this.code=t.code,this.errno=t.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+t.message,Error.captureStackTrace(this,u??this.constructor)}get name(){return"ZlibError"}},ys=Symbol("flushFlag"),vs=class extends Qt{#i=!1;#n=!1;#o;#a;#c;#l;#u;get sawError(){return this.#i}get handle(){return this.#l}get flushFlag(){return this.#o}constructor(t,u){if(!t||typeof t!="object")throw new TypeError("invalid options for ZlibBase constructor");if(super(t),this.#o=t.flush??0,this.#a=t.finishFlush??0,this.#c=t.fullFlushFlag??0,typeof ht[u]!="function")throw new TypeError("Compression method not supported: "+u);try{this.#l=new ht[u](t)}catch(t){throw new gs(t,this.constructor)}this.#u=t=>{this.#i||(this.#i=!0,this.close(),this.emit("error",t))},this.#l?.on("error",(t=>this.#u(new gs(t)))),this.once("end",(()=>this.close))}close(){this.#l&&(this.#l.close(),this.#l=void 0,this.emit("close"))}reset(){if(!this.#i)return ot(this.#l,"zlib binding closed"),this.#l.reset?.()}flush(t){this.ended||(typeof t!="number"&&(t=this.#c),this.write(Object.assign(ct.Buffer.alloc(0),{[ys]:t})))}end(t,u,p){return typeof t=="function"&&(p=t,u=void 0,t=void 0),typeof u=="function"&&(p=u,u=void 0),t&&(u?this.write(t,u):this.write(t)),this.flush(this.#a),this.#n=!0,super.end(p)}get ended(){return this.#n}[ms](t){return super.write(t)}write(t,u,p){if(typeof u=="function"&&(p=u,u="utf8"),typeof t=="string"&&(t=ct.Buffer.from(t,u)),this.#i)return;ot(this.#l,"zlib binding closed");let m=this.#l._handle,g=m.close;m.close=()=>{};let y=this.#l.close;this.#l.close=()=>{},ps(!0);let v;try{let u=typeof t[ys]=="number"?t[ys]:this.#o;v=this.#l._processChunk(t,u),ps(!1)}catch(t){ps(!1),this.#u(new gs(t,this.write))}finally{this.#l&&(this.#l._handle=m,m.close=g,this.#l.close=y,this.#l.removeAllListeners("error"))}this.#l&&this.#l.on("error",(t=>this.#u(new gs(t,this.write))));let b;if(v)if(Array.isArray(v)&&v.length>0){let t=v[0];b=this[ms](ct.Buffer.from(t));for(let t=1;t<v.length;t++)b=this[ms](v[t])}else b=this[ms](ct.Buffer.from(v));return p&&p(),b}},_s=class extends vs{#i;#n;constructor(t,u){t=t||{},t.flush=t.flush||as.Z_NO_FLUSH,t.finishFlush=t.finishFlush||as.Z_FINISH,t.fullFlushFlag=as.Z_FULL_FLUSH,super(t,u),this.#i=t.level,this.#n=t.strategy}params(t,u){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.#i!==t||this.#n!==u){this.flush(as.Z_SYNC_FLUSH),ot(this.handle,"zlib binding closed");let p=this.handle.flush;this.handle.flush=(t,u)=>{typeof t=="function"&&(u=t,t=this.flushFlag),this.flush(t),u?.()};try{this.handle.params(t,u)}finally{this.handle.flush=p}this.handle&&(this.#i=t,this.#n=u)}}}};var bs=class extends _s{#i;constructor(t){super(t,"Gzip"),this.#i=t&&!!t.portable}[ms](t){return this.#i?(this.#i=!1,t[9]=255,super[ms](t)):super[ms](t)}};var ws=class extends _s{constructor(t){super(t,"Unzip")}},Es=class extends vs{constructor(t,u){t=t||{},t.flush=t.flush||as.BROTLI_OPERATION_PROCESS,t.finishFlush=t.finishFlush||as.BROTLI_OPERATION_FINISH,t.fullFlushFlag=as.BROTLI_OPERATION_FLUSH,super(t,u)}},Ss=class extends Es{constructor(t){super(t,"BrotliCompress")}},$s=class extends Es{constructor(t){super(t,"BrotliDecompress")}},Rs=class extends vs{constructor(t,u){t=t||{},t.flush=t.flush||as.ZSTD_e_continue,t.finishFlush=t.finishFlush||as.ZSTD_e_end,t.fullFlushFlag=as.ZSTD_e_flush,super(t,u)}},Os=class extends Rs{constructor(t){super(t,"ZstdCompress")}},xs=class extends Rs{constructor(t){super(t,"ZstdDecompress")}};var Bs=(t,u)=>{if(Number.isSafeInteger(t))t<0?jr(t,u):qr(t,u);else throw Error("cannot encode number outside of javascript safe integer range");return u},qr=(t,u)=>{u[0]=128;for(var p=u.length;p>1;p--)u[p-1]=t&255,t=Math.floor(t/256)},jr=(t,u)=>{u[0]=255;var p=!1;t=t*-1;for(var m=u.length;m>1;m--){var g=t&255;t=Math.floor(t/256),p?u[m-1]=zs(g):g===0?u[m-1]=0:(p=!0,u[m-1]=Us(g))}},Ps=t=>{let u=t[0],p=u===128?Jr(t.subarray(1,t.length)):u===255?Qr(t):null;if(p===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(p))throw Error("parsed number outside of javascript safe integer range");return p},Qr=t=>{for(var u=t.length,p=0,m=!1,g=u-1;g>-1;g--){var y=Number(t[g]),v;m?v=zs(y):y===0?v=y:(m=!0,v=Us(y)),v!==0&&(p-=v*Math.pow(256,u-g-1))}return p},Jr=t=>{for(var u=t.length,p=0,m=u-1;m>-1;m--){var g=Number(t[m]);g!==0&&(p+=g*Math.pow(256,u-m-1))}return p},zs=t=>(255^t)&255,Us=t=>(255^t)+1&255;var Ts={};Ar(Ts,{code:()=>Ds,isCode:()=>oe,isName:()=>en,name:()=>Ns});var oe=t=>Ns.has(t),en=t=>Ds.has(t),Ns=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"]]),Ds=new Map(Array.from(Ns).map((t=>[t[1],t[0]])));var Ls=class{cksumValid=!1;needPax=!1;nullBlock=!1;block;path;mode;uid;gid;size;cksum;#i="Unsupported";linkpath;uname;gname;devmaj=0;devmin=0;atime;ctime;mtime;charset;comment;constructor(t,u=0,p,m){Buffer.isBuffer(t)?this.decode(t,u||0,p,m):t&&this.#n(t)}decode(t,u,p,m){if(u||(u=0),!t||!(t.length>=u+512))throw new Error("need 512 bytes for header");this.path=p?.path??Tt(t,u,100),this.mode=p?.mode??m?.mode??at(t,u+100,8),this.uid=p?.uid??m?.uid??at(t,u+108,8),this.gid=p?.gid??m?.gid??at(t,u+116,8),this.size=p?.size??m?.size??at(t,u+124,12),this.mtime=p?.mtime??m?.mtime??Bi(t,u+136,12),this.cksum=at(t,u+148,12),m&&this.#n(m,!0),p&&this.#n(p);let g=Tt(t,u+156,1);if(oe(g)&&(this.#i=g||"0"),this.#i==="0"&&this.path.slice(-1)==="/"&&(this.#i="5"),this.#i==="5"&&(this.size=0),this.linkpath=Tt(t,u+157,100),t.subarray(u+257,u+265).toString()==="ustar\x0000")if(this.uname=p?.uname??m?.uname??Tt(t,u+265,32),this.gname=p?.gname??m?.gname??Tt(t,u+297,32),this.devmaj=p?.devmaj??m?.devmaj??at(t,u+329,8)??0,this.devmin=p?.devmin??m?.devmin??at(t,u+337,8)??0,t[u+475]!==0){let p=Tt(t,u+345,155);this.path=p+"/"+this.path}else{let g=Tt(t,u+345,130);g&&(this.path=g+"/"+this.path),this.atime=p?.atime??m?.atime??Bi(t,u+476,12),this.ctime=p?.ctime??m?.ctime??Bi(t,u+488,12)}let y=256;for(let p=u;p<u+148;p++)y+=t[p];for(let p=u+156;p<u+512;p++)y+=t[p];this.cksumValid=y===this.cksum,this.cksum===void 0&&y===256&&(this.nullBlock=!0)}#n(t,u=!1){Object.assign(this,Object.fromEntries(Object.entries(t).filter((([t,p])=>!(p==null||t==="path"&&u||t==="linkpath"&&u||t==="global")))))}encode(t,u=0){if(t||(t=this.block=Buffer.alloc(512)),this.#i==="Unsupported"&&(this.#i="0"),!(t.length>=u+512))throw new Error("need 512 bytes for header");let p=this.ctime||this.atime?130:155,m=sn(this.path||"",p),g=m[0],y=m[1];this.needPax=!!m[2],this.needPax=xt(t,u,100,g)||this.needPax,this.needPax=lt(t,u+100,8,this.mode)||this.needPax,this.needPax=lt(t,u+108,8,this.uid)||this.needPax,this.needPax=lt(t,u+116,8,this.gid)||this.needPax,this.needPax=lt(t,u+124,12,this.size)||this.needPax,this.needPax=Pi(t,u+136,12,this.mtime)||this.needPax,t[u+156]=this.#i.charCodeAt(0),this.needPax=xt(t,u+157,100,this.linkpath)||this.needPax,t.write("ustar\x0000",u+257,8),this.needPax=xt(t,u+265,32,this.uname)||this.needPax,this.needPax=xt(t,u+297,32,this.gname)||this.needPax,this.needPax=lt(t,u+329,8,this.devmaj)||this.needPax,this.needPax=lt(t,u+337,8,this.devmin)||this.needPax,this.needPax=xt(t,u+345,p,y)||this.needPax,t[u+475]!==0?this.needPax=xt(t,u+345,155,y)||this.needPax:(this.needPax=xt(t,u+345,130,y)||this.needPax,this.needPax=Pi(t,u+476,12,this.atime)||this.needPax,this.needPax=Pi(t,u+488,12,this.ctime)||this.needPax);let v=256;for(let p=u;p<u+148;p++)v+=t[p];for(let p=u+156;p<u+512;p++)v+=t[p];return this.cksum=v,lt(t,u+148,8,this.cksum),this.cksumValid=!0,this.needPax}get type(){return this.#i==="Unsupported"?this.#i:Ns.get(this.#i)}get typeKey(){return this.#i}set type(t){let u=String(Ds.get(t));if(oe(u)||u==="Unsupported")this.#i=u;else if(oe(t))this.#i=t;else throw new TypeError("invalid entry type: "+t)}},sn=(t,u)=>{let p=t,m="",g,y=k.posix.parse(t).root||".";if(Buffer.byteLength(p)<100)g=[p,m,!1];else{m=k.posix.dirname(p),p=k.posix.basename(p);do{Buffer.byteLength(p)<=100&&Buffer.byteLength(m)<=u?g=[p,m,!1]:Buffer.byteLength(p)>100&&Buffer.byteLength(m)<=u?g=[p.slice(0,99),m,!0]:(p=k.posix.join(k.posix.basename(m),p),m=k.posix.dirname(m))}while(m!==y&&g===void 0);g||(g=[t.slice(0,99),"",!0])}return g},Tt=(t,u,p)=>t.subarray(u,u+p).toString("utf8").replace(/\0.*/,""),Bi=(t,u,p)=>rn(at(t,u,p)),rn=t=>t===void 0?void 0:new Date(t*1e3),at=(t,u,p)=>Number(t[u])&128?Ps(t.subarray(u,u+p)):on(t,u,p),nn=t=>isNaN(t)?void 0:t,on=(t,u,p)=>nn(parseInt(t.subarray(u,u+p).toString("utf8").replace(/\0.*$/,"").trim(),8)),Ms={12:8589934591,8:2097151},lt=(t,u,p,m)=>m===void 0?!1:m>Ms[p]||m<0?(Bs(m,t.subarray(u,u+p)),!0):(an(t,u,p,m),!1),an=(t,u,p,m)=>t.write(ln(m,p),u,p,"ascii"),ln=(t,u)=>cn(Math.floor(t).toString(8),u),cn=(t,u)=>(t.length===u-1?t:new Array(u-t.length-1).join("0")+t+" ")+"\0",Pi=(t,u,p,m)=>m===void 0?!1:lt(t,u,p,m.getTime()/1e3),js=new Array(156).join("\0"),xt=(t,u,p,m)=>m===void 0?!1:(t.write(m+js,u,p,"utf8"),m.length!==Buffer.byteLength(m)||m.length>p);var Hs=class s{atime;mtime;ctime;charset;comment;gid;uid;gname;uname;linkpath;dev;ino;nlink;path;size;mode;global;constructor(t,u=!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=u,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 u=Buffer.byteLength(t),p=512*Math.ceil(1+u/512),m=Buffer.allocUnsafe(p);for(let t=0;t<512;t++)m[t]=0;new Ls({path:("PaxHeader/"+(0,k.basename)(this.path??"")).slice(0,99),mode:this.mode||420,uid:this.uid,gid:this.gid,size:u,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(m),m.write(t,512,u,"utf8");for(let t=u+512;t<m.length;t++)m[t]=0;return m}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 u=this[t],p=u instanceof Date?u.getTime()/1e3:u,m=" "+(t==="dev"||t==="ino"||t==="nlink"?"SCHILY.":"")+t+"="+p+`\n`,g=Buffer.byteLength(m),y=Math.floor(Math.log(g)/Math.log(10))+1;return g+y>=Math.pow(10,y)&&(y+=1),y+g+m}static parse(t,u,p=!1){return new s(un(mn(t),u),p)}},un=(t,u)=>u?Object.assign({},u,t):t,mn=t=>t.replace(/\n$/,"").split(`\n`).reduce(pn,Object.create(null)),pn=(t,u)=>{let p=parseInt(u,10);if(p!==Buffer.byteLength(u)+1)return t;u=u.slice((p+" ").length);let m=u.split("="),g=m.shift();if(!g)return t;let y=g.replace(/^SCHILY\.(dev|ino|nlink)/,"$1"),v=m.join("=");return t[y]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(y)?new Date(Number(v)*1e3):/^[0-9]+$/.test(v)?+v:v,t};var Gs=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,qs=Gs!=="win32"?t=>t:t=>t&&t.replace(/\\/g,"/");var Ws=class extends Qt{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(t,u,p){switch(super({}),this.pause(),this.extended=u,this.globalExtended=p,this.header=t,this.remain=t.size??0,this.startBlockSize=512*Math.ceil(this.remain/512),this.blockRemain=this.startBlockSize,this.type=t.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(!t.path)throw new Error("no path provided for tar.ReadEntry");this.path=qs(t.path),this.mode=t.mode,this.mode&&(this.mode=this.mode&4095),this.uid=t.uid,this.gid=t.gid,this.uname=t.uname,this.gname=t.gname,this.size=this.remain,this.mtime=t.mtime,this.atime=t.atime,this.ctime=t.ctime,this.linkpath=t.linkpath?qs(t.linkpath):void 0,this.uname=t.uname,this.gname=t.gname,u&&this.#i(u),p&&this.#i(p,!0)}write(t){let u=t.length;if(u>this.blockRemain)throw new Error("writing more to entry than is appropriate");let p=this.remain,m=this.blockRemain;return this.remain=Math.max(0,p-u),this.blockRemain=Math.max(0,m-u),this.ignore?!0:p>=u?super.write(t):super.write(t.subarray(0,p))}#i(t,u=!1){t.path&&(t.path=qs(t.path)),t.linkpath&&(t.linkpath=qs(t.linkpath)),Object.assign(this,Object.fromEntries(Object.entries(t).filter((([t,p])=>!(p==null||t==="path"&&u)))))}};var Lt=(t,u,p,m={})=>{t.file&&(m.file=t.file),t.cwd&&(m.cwd=t.cwd),m.code=p instanceof Error&&p.code||u,m.tarCode=u,!t.strict&&m.recoverable!==!1?(p instanceof Error&&(m=Object.assign(p,m),p=p.message),t.emit("warn",u,p,m)):p instanceof Error?t.emit("error",Object.assign(p,m)):t.emit("error",Object.assign(new Error(`${u}: ${p}`),m))};var Ks=1024*1024,Ys=Buffer.from([31,139]),Zs=Buffer.from([40,181,47,253]),Xs=Math.max(Ys.length,Zs.length),Js=Symbol("state"),Qs=Symbol("writeEntry"),ei=Symbol("readEntry"),ti=Symbol("nextEntry"),ri=Symbol("processEntry"),si=Symbol("extendedHeader"),ii=Symbol("globalExtendedHeader"),ni=Symbol("meta"),oi=Symbol("emitMeta"),ai=Symbol("buffer"),ci=Symbol("queue"),li=Symbol("ended"),ui=Symbol("emittedEnd"),hi=Symbol("emit"),fi=Symbol("unzip"),pi=Symbol("consumeChunk"),mi=Symbol("consumeChunkSub"),gi=Symbol("consumeBody"),yi=Symbol("consumeMeta"),vi=Symbol("consumeHeader"),_i=Symbol("consuming"),bi=Symbol("bufferConcat"),wi=Symbol("maybeEnd"),Ei=Symbol("writing"),Si=Symbol("aborted"),Ri=Symbol("onDone"),Oi=Symbol("sawValidEntry"),xi=Symbol("sawNullBlock"),Ai=Symbol("sawEOF"),Ti=Symbol("closeStream"),Rn=()=>!0,ki=class extends rt.EventEmitter{file;strict;maxMetaEntrySize;filter;brotli;zstd;writable=!0;readable=!1;[ci]=[];[ai];[ei];[Qs];[Js]="begin";[ni]="";[si];[ii];[li]=!1;[fi];[Si]=!1;[Oi];[xi]=!1;[Ai]=!1;[Ei]=!1;[_i]=!1;[ui]=!1;constructor(t={}){super(),this.file=t.file||"",this.on(Ri,(()=>{(this[Js]==="begin"||this[Oi]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")})),t.ondone?this.on(Ri,t.ondone):this.on(Ri,(()=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")})),this.strict=!!t.strict,this.maxMetaEntrySize=t.maxMetaEntrySize||Ks,this.filter=typeof t.filter=="function"?t.filter:Rn;let u=t.file&&(t.file.endsWith(".tar.br")||t.file.endsWith(".tbr"));this.brotli=!(t.gzip||t.zstd)&&t.brotli!==void 0?t.brotli:u?void 0:!1;let p=t.file&&(t.file.endsWith(".tar.zst")||t.file.endsWith(".tzst"));this.zstd=!(t.gzip||t.brotli)&&t.zstd!==void 0?t.zstd:p?!0:void 0,this.on("end",(()=>this[Ti]())),typeof t.onwarn=="function"&&this.on("warn",t.onwarn),typeof t.onReadEntry=="function"&&this.on("entry",t.onReadEntry)}warn(t,u,p={}){Lt(this,t,u,p)}[vi](t,u){this[Oi]===void 0&&(this[Oi]=!1);let p;try{p=new Ls(t,u,this[si],this[ii])}catch(t){return this.warn("TAR_ENTRY_INVALID",t)}if(p.nullBlock)this[xi]?(this[Ai]=!0,this[Js]==="begin"&&(this[Js]="header"),this[hi]("eof")):(this[xi]=!0,this[hi]("nullBlock"));else if(this[xi]=!1,!p.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:p});else if(!p.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:p});else{let t=p.type;if(/^(Symbolic)?Link$/.test(t)&&!p.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:p});else if(!/^(Symbolic)?Link$/.test(t)&&!/^(Global)?ExtendedHeader$/.test(t)&&p.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:p});else{let t=this[Qs]=new Ws(p,this[si],this[ii]);if(!this[Oi])if(t.remain){let o=()=>{t.invalid||(this[Oi]=!0)};t.on("end",o)}else this[Oi]=!0;t.meta?t.size>this.maxMetaEntrySize?(t.ignore=!0,this[hi]("ignoredEntry",t),this[Js]="ignore",t.resume()):t.size>0&&(this[ni]="",t.on("data",(t=>this[ni]+=t)),this[Js]="meta"):(this[si]=void 0,t.ignore=t.ignore||!this.filter(t.path,t),t.ignore?(this[hi]("ignoredEntry",t),this[Js]=t.remain?"ignore":"header",t.resume()):(t.remain?this[Js]="body":(this[Js]="header",t.end()),this[ei]?this[ci].push(t):(this[ci].push(t),this[ti]())))}}}[Ti](){queueMicrotask((()=>this.emit("close")))}[ri](t){let u=!0;if(!t)this[ei]=void 0,u=!1;else if(Array.isArray(t)){let[u,...p]=t;this.emit(u,...p)}else this[ei]=t,this.emit("entry",t),t.emittedEnd||(t.on("end",(()=>this[ti]())),u=!1);return u}[ti](){do{}while(this[ri](this[ci].shift()));if(!this[ci].length){let t=this[ei];!t||t.flowing||t.size===t.remain?this[Ei]||this.emit("drain"):t.once("drain",(()=>this.emit("drain")))}}[gi](t,u){let p=this[Qs];if(!p)throw new Error("attempt to consume body without entry??");let m=p.blockRemain??0,g=m>=t.length&&u===0?t:t.subarray(u,u+m);return p.write(g),p.blockRemain||(this[Js]="header",this[Qs]=void 0,p.end()),g.length}[yi](t,u){let p=this[Qs],m=this[gi](t,u);return!this[Qs]&&p&&this[oi](p),m}[hi](t,u,p){!this[ci].length&&!this[ei]?this.emit(t,u,p):this[ci].push([t,u,p])}[oi](t){switch(this[hi]("meta",this[ni]),t.type){case"ExtendedHeader":case"OldExtendedHeader":this[si]=Hs.parse(this[ni],this[si],!1);break;case"GlobalExtendedHeader":this[ii]=Hs.parse(this[ni],this[ii],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":{let t=this[si]??Object.create(null);this[si]=t,t.path=this[ni].replace(/\0.*/,"");break}case"NextFileHasLongLinkpath":{let t=this[si]||Object.create(null);this[si]=t,t.linkpath=this[ni].replace(/\0.*/,"");break}default:throw new Error("unknown meta: "+t.type)}}abort(t){this[Si]=!0,this.emit("abort",t),this.warn("TAR_ABORT",t,{recoverable:!1})}write(t,u,p){if(typeof u=="function"&&(p=u,u=void 0),typeof t=="string"&&(t=Buffer.from(t,typeof u=="string"?u:"utf8")),this[Si])return p?.(),!1;if((this[fi]===void 0||this.brotli===void 0&&this[fi]===!1)&&t){if(this[ai]&&(t=Buffer.concat([this[ai],t]),this[ai]=void 0),t.length<Xs)return this[ai]=t,p?.(),!0;for(let u=0;this[fi]===void 0&&u<Ys.length;u++)t[u]!==Ys[u]&&(this[fi]=!1);let u=!1;if(this[fi]===!1&&this.zstd!==!1){u=!0;for(let p=0;p<Zs.length;p++)if(t[p]!==Zs[p]){u=!1;break}}let m=this.brotli===void 0&&!u;if(this[fi]===!1&&m)if(t.length<512)if(this[li])this.brotli=!0;else return this[ai]=t,p?.(),!0;else try{new Ls(t.subarray(0,512)),this.brotli=!1}catch{this.brotli=!0}if(this[fi]===void 0||this[fi]===!1&&(this.brotli||u)){let m=this[li];this[li]=!1,this[fi]=this[fi]===void 0?new ws({}):u?new xs({}):new $s({}),this[fi].on("data",(t=>this[pi](t))),this[fi].on("error",(t=>this.abort(t))),this[fi].on("end",(()=>{this[li]=!0,this[pi]()})),this[Ei]=!0;let g=!!this[fi][m?"end":"write"](t);return this[Ei]=!1,p?.(),g}}this[Ei]=!0,this[fi]?this[fi].write(t):this[pi](t),this[Ei]=!1;let m=this[ci].length?!1:this[ei]?this[ei].flowing:!0;return!m&&!this[ci].length&&this[ei]?.once("drain",(()=>this.emit("drain"))),p?.(),m}[bi](t){t&&!this[Si]&&(this[ai]=this[ai]?Buffer.concat([this[ai],t]):t)}[wi](){if(this[li]&&!this[ui]&&!this[Si]&&!this[_i]){this[ui]=!0;let t=this[Qs];if(t&&t.blockRemain){let u=this[ai]?this[ai].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${t.blockRemain} more bytes, only ${u} available)`,{entry:t}),this[ai]&&t.write(this[ai]),t.end()}this[hi](Ri)}}[pi](t){if(this[_i]&&t)this[bi](t);else if(!t&&!this[ai])this[wi]();else if(t){if(this[_i]=!0,this[ai]){this[bi](t);let u=this[ai];this[ai]=void 0,this[mi](u)}else this[mi](t);for(;this[ai]&&this[ai]?.length>=512&&!this[Si]&&!this[Ai];){let t=this[ai];this[ai]=void 0,this[mi](t)}this[_i]=!1}(!this[ai]||this[li])&&this[wi]()}[mi](t){let u=0,p=t.length;for(;u+512<=p&&!this[Si]&&!this[Ai];)switch(this[Js]){case"begin":case"header":this[vi](t,u),u+=512;break;case"ignore":case"body":u+=this[gi](t,u);break;case"meta":u+=this[yi](t,u);break;default:throw new Error("invalid state: "+this[Js])}u<p&&(this[ai]?this[ai]=Buffer.concat([t.subarray(u),this[ai]]):this[ai]=t.subarray(u))}end(t,u,p){return typeof t=="function"&&(p=t,u=void 0,t=void 0),typeof u=="function"&&(p=u,u=void 0),typeof t=="string"&&(t=Buffer.from(t,u)),p&&this.once("finish",p),this[Si]||(this[fi]?(t&&this[fi].write(t),this[fi].end()):(this[li]=!0,(this.brotli===void 0||this.zstd===void 0)&&(t=t||Buffer.alloc(0)),t&&this.write(t),this[wi]())),this}};var mt=t=>{let u=t.length-1,p=-1;for(;u>-1&&t.charAt(u)==="/";)p=u,u--;return p===-1?t:t.slice(0,p)};var _n=t=>{let u=t.onReadEntry;t.onReadEntry=u?t=>{u(t),t.resume()}:t=>t.resume()},Yi=(t,u)=>{let p=new Map(u.map((t=>[mt(t),!0]))),m=t.filter,r=(t,u="")=>{let m=u||(0,ze.parse)(t).root||".",g;if(t===m)g=!1;else{let u=p.get(t);u!==void 0?g=u:g=r((0,ze.dirname)(t),m)}return p.set(t,g),g};t.filter=m?(t,u)=>m(t,u)&&r(mt(t)):t=>r(mt(t))},On=t=>{let u=new ki(t),p=t.file,m;try{m=T.openSync(p,"r");let g=T.fstatSync(m),y=t.maxReadSize||16*1024*1024;if(g.size<y){let t=Buffer.allocUnsafe(g.size),p=T.readSync(m,t,0,g.size,0);u.end(p===t.byteLength?t:t.subarray(0,p))}else{let t=0,p=Buffer.allocUnsafe(y);for(;t<g.size;){let g=T.readSync(m,p,0,y,t);if(g===0)break;t+=g,u.write(p.subarray(0,g))}u.end()}}finally{if(typeof m=="number")try{T.closeSync(m)}catch{}}},Tn=(t,u)=>{let p=new ki(t),m=t.maxReadSize||16*1024*1024,g=t.file;return new Promise(((t,u)=>{p.on("error",u),p.on("end",t),T.stat(g,((t,y)=>{if(t)u(t);else{let t=new ts(g,{readSize:m,size:y.size});t.on("error",u),t.pipe(p)}}))}))},Ci=K(On,Tn,(t=>new ki(t)),(t=>new ki(t)),((t,u)=>{u?.length&&Yi(t,u),t.noResume||_n(t)}));var Ki=(t,u,p)=>(t&=4095,p&&(t=(t|384)&-19),u&&(t&256&&(t|=64),t&32&&(t|=8),t&4&&(t|=1)),t);var{isAbsolute:Ii,parse:Ni}=k.win32,ce=t=>{let u="",p=Ni(t);for(;Ii(t)||p.root;){let m=t.charAt(0)==="/"&&t.slice(0,4)!=="//?/"?"/":p.root;t=t.slice(m.length),u+=m,p=Ni(t)}return[u,t]};var Di=["|","<",">","?",":"],Li=Di.map((t=>String.fromCharCode(61440+t.charCodeAt(0)))),Mi=new Map(Di.map(((t,u)=>[t,Li[u]]))),ji=new Map(Li.map(((t,u)=>[t,Di[u]]))),$i=t=>Di.reduce(((t,u)=>t.split(u).join(Mi.get(u))),t),Vs=t=>Li.reduce(((t,u)=>t.split(u).join(ji.get(u))),t);var tr=(t,u)=>u?(t=qs(t).replace(/^\.(\/|$)/,""),mt(u)+"/"+t):qs(t),Fi=16*1024*1024,Ui=Symbol("process"),Hi=Symbol("file"),Vi=Symbol("directory"),zi=Symbol("symlink"),Gi=Symbol("hardlink"),qi=Symbol("header"),Wi=Symbol("read"),Zi=Symbol("lstat"),Xi=Symbol("onlstat"),Ji=Symbol("onread"),Qi=Symbol("onreadlink"),tn=Symbol("openfile"),hn=Symbol("onopenfile"),dn=Symbol("close"),fn=Symbol("mode"),gn=Symbol("awaitDrain"),yn=Symbol("ondrain"),bn=Symbol("prefix"),wn=class extends Qt{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;#i=!1;constructor(t,u={}){let p=re(u);super(),this.path=qs(t),this.portable=!!p.portable,this.maxReadSize=p.maxReadSize||Fi,this.linkCache=p.linkCache||new Map,this.statCache=p.statCache||new Map,this.preservePaths=!!p.preservePaths,this.cwd=qs(p.cwd||process.cwd()),this.strict=!!p.strict,this.noPax=!!p.noPax,this.noMtime=!!p.noMtime,this.mtime=p.mtime,this.prefix=p.prefix?qs(p.prefix):void 0,this.onWriteEntry=p.onWriteEntry,typeof p.onwarn=="function"&&this.on("warn",p.onwarn);let m=!1;if(!this.preservePaths){let[t,u]=ce(this.path);t&&typeof u=="string"&&(this.path=u,m=t)}this.win32=!!p.win32||process.platform==="win32",this.win32&&(this.path=Vs(this.path.replace(/\\/g,"/")),t=t.replace(/\\/g,"/")),this.absolute=qs(p.absolute||ze.resolve(this.cwd,t)),this.path===""&&(this.path="./"),m&&this.warn("TAR_ENTRY_INFO",`stripping ${m} from absolute path`,{entry:this,path:m+this.path});let g=this.statCache.get(this.absolute);g?this[Xi](g):this[Zi]()}warn(t,u,p={}){return Lt(this,t,u,p)}emit(t,...u){return t==="error"&&(this.#i=!0),super.emit(t,...u)}[Zi](){Ve.lstat(this.absolute,((t,u)=>{if(t)return this.emit("error",t);this[Xi](u)}))}[Xi](t){this.statCache.set(this.absolute,t),this.stat=t,t.isFile()||(t.size=0),this.type=In(t),this.emit("stat",t),this[Ui]()}[Ui](){switch(this.type){case"File":return this[Hi]();case"Directory":return this[Vi]();case"SymbolicLink":return this[zi]();default:return this.end()}}[fn](t){return Ki(t,this.type==="Directory",this.portable)}[bn](t){return tr(t,this.prefix)}[qi](){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 Ls({path:this[bn](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[bn](this.linkpath):this.linkpath,mode:this[fn](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 Hs({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[bn](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[bn](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 t=this.header?.block;if(!t)throw new Error("failed to encode header");super.write(t)}[Vi](){if(!this.stat)throw new Error("cannot create directory entry without stat");this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[qi](),this.end()}[zi](){Ve.readlink(this.absolute,((t,u)=>{if(t)return this.emit("error",t);this[Qi](u)}))}[Qi](t){this.linkpath=qs(t),this[qi](),this.end()}[Gi](t){if(!this.stat)throw new Error("cannot create link entry without stat");this.type="Link",this.linkpath=qs(ze.relative(this.cwd,t)),this.stat.size=0,this[qi](),this.end()}[Hi](){if(!this.stat)throw new Error("cannot create file entry without stat");if(this.stat.nlink>1){let t=`${this.stat.dev}:${this.stat.ino}`,u=this.linkCache.get(t);if(u?.indexOf(this.cwd)===0)return this[Gi](u);this.linkCache.set(t,this.absolute)}if(this[qi](),this.stat.size===0)return this.end();this[tn]()}[tn](){Ve.open(this.absolute,"r",((t,u)=>{if(t)return this.emit("error",t);this[hn](u)}))}[hn](t){if(this.fd=t,this.#i)return this[dn]();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 u=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(u),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[Wi]()}[Wi](){let{fd:t,buf:u,offset:p,length:m,pos:g}=this;if(t===void 0||u===void 0)throw new Error("cannot read file without first opening");Ve.read(t,u,p,m,g,((t,u)=>{if(t)return this[dn]((()=>this.emit("error",t)));this[Ji](u)}))}[dn](t=()=>{}){this.fd!==void 0&&Ve.close(this.fd,t)}[Ji](t){if(t<=0&&this.remain>0){let t=Object.assign(new Error("encountered unexpected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[dn]((()=>this.emit("error",t)))}if(t>this.remain){let t=Object.assign(new Error("did not encounter expected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[dn]((()=>this.emit("error",t)))}if(!this.buf)throw new Error("should have created buffer prior to reading");if(t===this.remain)for(let u=t;u<this.length&&t<this.blockRemain;u++)this.buf[u+this.offset]=0,t++,this.remain++;let u=this.offset===0&&t===this.buf.length?this.buf:this.buf.subarray(this.offset,this.offset+t);this.write(u)?this[yn]():this[gn]((()=>this[yn]()))}[gn](t){this.once("drain",t)}write(t,u,p){if(typeof u=="function"&&(p=u,u=void 0),typeof t=="string"&&(t=Buffer.from(t,typeof u=="string"?u:"utf8")),this.blockRemain<t.length){let t=Object.assign(new Error("writing more data than expected"),{path:this.absolute});return this.emit("error",t)}return this.remain-=t.length,this.blockRemain-=t.length,this.pos+=t.length,this.offset+=t.length,super.write(t,null,p)}[yn](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[dn]((t=>t?this.emit("error",t):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[Wi]()}},En=class extends wn{sync=!0;[Zi](){this[Xi](Ve.lstatSync(this.absolute))}[zi](){this[Qi](Ve.readlinkSync(this.absolute))}[tn](){this[hn](Ve.openSync(this.absolute,"r"))}[Wi](){let t=!0;try{let{fd:u,buf:p,offset:m,length:g,pos:y}=this;if(u===void 0||p===void 0)throw new Error("fd and buf must be set in READ method");let v=Ve.readSync(u,p,m,g,y);this[Ji](v),t=!1}finally{if(t)try{this[dn]((()=>{}))}catch{}}}[gn](t){t()}[dn](t=()=>{}){this.fd!==void 0&&Ve.closeSync(this.fd),t()}},Sn=class extends Qt{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(t,u,p={}){return Lt(this,t,u,p)}constructor(t,u={}){let p=re(u);super(),this.preservePaths=!!p.preservePaths,this.portable=!!p.portable,this.strict=!!p.strict,this.noPax=!!p.noPax,this.noMtime=!!p.noMtime,this.onWriteEntry=p.onWriteEntry,this.readEntry=t;let{type:m}=t;if(m==="Unsupported")throw new Error("writing entry that should be ignored");this.type=m,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=p.prefix,this.path=qs(t.path),this.mode=t.mode!==void 0?this[fn](t.mode):void 0,this.uid=this.portable?void 0:t.uid,this.gid=this.portable?void 0:t.gid,this.uname=this.portable?void 0:t.uname,this.gname=this.portable?void 0:t.gname,this.size=t.size,this.mtime=this.noMtime?void 0:p.mtime||t.mtime,this.atime=this.portable?void 0:t.atime,this.ctime=this.portable?void 0:t.ctime,this.linkpath=t.linkpath!==void 0?qs(t.linkpath):void 0,typeof p.onwarn=="function"&&this.on("warn",p.onwarn);let g=!1;if(!this.preservePaths){let[t,u]=ce(this.path);t&&typeof u=="string"&&(this.path=u,g=t)}this.remain=t.size,this.blockRemain=t.startBlockSize,this.onWriteEntry?.(this),this.header=new Ls({path:this[bn](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[bn](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}),g&&this.warn("TAR_ENTRY_INFO",`stripping ${g} from absolute path`,{entry:this,path:g+this.path}),this.header.encode()&&!this.noPax&&super.write(new Hs({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[bn](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[bn](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 y=this.header?.block;if(!y)throw new Error("failed to encode header");super.write(y),t.pipe(this)}[bn](t){return tr(t,this.prefix)}[fn](t){return Ki(t,this.type==="Directory",this.portable)}write(t,u,p){typeof u=="function"&&(p=u,u=void 0),typeof t=="string"&&(t=Buffer.from(t,typeof u=="string"?u:"utf8"));let m=t.length;if(m>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=m,super.write(t,p)}end(t,u,p){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),typeof t=="function"&&(p=t,u=void 0,t=void 0),typeof u=="function"&&(p=u,u=void 0),typeof t=="string"&&(t=Buffer.from(t,u??"utf8")),p&&this.once("finish",p),t?super.end(t,p):super.end(p),this}},In=t=>t.isFile()?"File":t.isDirectory()?"Directory":t.isSymbolicLink()?"SymbolicLink":"Unsupported";var xn=class s{tail;head;length=0;static create(t=[]){return new s(t)}constructor(t=[]){for(let u of t)this.push(u)}*[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 u=t.next,p=t.prev;return u&&(u.prev=p),p&&(p.next=u),t===this.head&&(this.head=u),t===this.tail&&(this.tail=p),this.length--,t.next=void 0,t.prev=void 0,t.list=void 0,u}unshiftNode(t){if(t===this.head)return;t.list&&t.list.removeNode(t);let u=this.head;t.list=this,t.next=u,u&&(u.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 u=this.tail;t.list=this,t.prev=u,u&&(u.next=t),this.tail=t,this.head||(this.head=t),this.length++}push(...t){for(let u=0,p=t.length;u<p;u++)Fn(this,t[u]);return this.length}unshift(...t){for(var u=0,p=t.length;u<p;u++)kn(this,t[u]);return this.length}pop(){if(!this.tail)return;let t=this.tail.value,u=this.tail;return this.tail=this.tail.prev,this.tail?this.tail.next=void 0:this.head=void 0,u.list=void 0,this.length--,t}shift(){if(!this.head)return;let t=this.head.value,u=this.head;return this.head=this.head.next,this.head?this.head.prev=void 0:this.tail=void 0,u.list=void 0,this.length--,t}forEach(t,u){u=u||this;for(let p=this.head,m=0;p;m++)t.call(u,p.value,m,this),p=p.next}forEachReverse(t,u){u=u||this;for(let p=this.tail,m=this.length-1;p;m--)t.call(u,p.value,m,this),p=p.prev}get(t){let u=0,p=this.head;for(;p&&u<t;u++)p=p.next;if(u===t&&p)return p.value}getReverse(t){let u=0,p=this.tail;for(;p&&u<t;u++)p=p.prev;if(u===t&&p)return p.value}map(t,u){u=u||this;let p=new s;for(let m=this.head;m;)p.push(t.call(u,m.value,this)),m=m.next;return p}mapReverse(t,u){u=u||this;var p=new s;for(let m=this.tail;m;)p.push(t.call(u,m.value,this)),m=m.prev;return p}reduce(t,u){let p,m=this.head;if(arguments.length>1)p=u;else if(this.head)m=this.head.next,p=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var g=0;m;g++)p=t(p,m.value,g),m=m.next;return p}reduceReverse(t,u){let p,m=this.tail;if(arguments.length>1)p=u;else if(this.tail)m=this.tail.prev,p=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(let u=this.length-1;m;u--)p=t(p,m.value,u),m=m.prev;return p}toArray(){let t=new Array(this.length);for(let u=0,p=this.head;p;u++)t[u]=p.value,p=p.next;return t}toArrayReverse(){let t=new Array(this.length);for(let u=0,p=this.tail;p;u++)t[u]=p.value,p=p.prev;return t}slice(t=0,u=this.length){u<0&&(u+=this.length),t<0&&(t+=this.length);let p=new s;if(u<t||u<0)return p;t<0&&(t=0),u>this.length&&(u=this.length);let m=this.head,g=0;for(g=0;m&&g<t;g++)m=m.next;for(;m&&g<u;g++,m=m.next)p.push(m.value);return p}sliceReverse(t=0,u=this.length){u<0&&(u+=this.length),t<0&&(t+=this.length);let p=new s;if(u<t||u<0)return p;t<0&&(t=0),u>this.length&&(u=this.length);let m=this.length,g=this.tail;for(;g&&m>u;m--)g=g.prev;for(;g&&m>t;m--,g=g.prev)p.push(g.value);return p}splice(t,u=0,...p){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);let m=this.head;for(let u=0;m&&u<t;u++)m=m.next;let g=[];for(let t=0;m&&t<u;t++)g.push(m.value),m=this.removeNode(m);m?m!==this.tail&&(m=m.prev):m=this.tail;for(let t of p)m=Cn(this,m,t);return g}reverse(){let t=this.head,u=this.tail;for(let u=t;u;u=u.prev){let t=u.prev;u.prev=u.next,u.next=t}return this.head=u,this.tail=t,this}};function Cn(t,u,p){let m=u,g=u?u.next:t.head,y=new An(p,m,g,t);return y.next===void 0&&(t.tail=y),y.prev===void 0&&(t.head=y),t.length++,y}function Fn(t,u){t.tail=new An(u,t.tail,void 0,t),t.head||(t.head=t.tail),t.length++}function kn(t,u){t.head=new An(u,void 0,t.head,t),t.tail||(t.tail=t.head),t.length++}var An=class{list;next;prev;value;constructor(t,u,p,m){this.list=m,this.value=t,u?(u.next=this,this.prev=u):this.prev=void 0,p?(p.prev=this,this.next=p):this.next=void 0}};var Nn=class{path;absolute;entry;stat;readdir;pending=!1;ignore=!1;piped=!1;constructor(t,u){this.path=t||"./",this.absolute=u}},Dn=Buffer.alloc(1024),Ln=Symbol("onStat"),Un=Symbol("ended"),Hn=Symbol("queue"),Vn=Symbol("current"),zn=Symbol("process"),Gn=Symbol("processing"),qn=Symbol("processJob"),Wn=Symbol("jobs"),Kn=Symbol("jobDone"),Yn=Symbol("addFSEntry"),Zn=Symbol("addTarEntry"),Jn=Symbol("stat"),to=Symbol("readdir"),ro=Symbol("onreaddir"),so=Symbol("pipe"),io=Symbol("entry"),lo=Symbol("entryOpt"),go=Symbol("writeEntryClass"),yo=Symbol("write"),vo=Symbol("ondrain"),_o=class extends Qt{sync=!1;opt;cwd;maxReadSize;preservePaths;strict;noPax;prefix;linkCache;statCache;file;portable;zip;readdirCache;noDirRecurse;follow;noMtime;mtime;filter;jobs;[go];onWriteEntry;[Hn];[Wn]=0;[Gn]=!1;[Un]=!1;constructor(t={}){if(super(),this.opt=t,this.file=t.file||"",this.cwd=t.cwd||process.cwd(),this.maxReadSize=t.maxReadSize,this.preservePaths=!!t.preservePaths,this.strict=!!t.strict,this.noPax=!!t.noPax,this.prefix=qs(t.prefix||""),this.linkCache=t.linkCache||new Map,this.statCache=t.statCache||new Map,this.readdirCache=t.readdirCache||new Map,this.onWriteEntry=t.onWriteEntry,this[go]=wn,typeof t.onwarn=="function"&&this.on("warn",t.onwarn),this.portable=!!t.portable,t.gzip||t.brotli||t.zstd){if((t.gzip?1:0)+(t.brotli?1:0)+(t.zstd?1:0)>1)throw new TypeError("gzip, brotli, zstd are mutually exclusive");if(t.gzip&&(typeof t.gzip!="object"&&(t.gzip={}),this.portable&&(t.gzip.portable=!0),this.zip=new bs(t.gzip)),t.brotli&&(typeof t.brotli!="object"&&(t.brotli={}),this.zip=new Ss(t.brotli)),t.zstd&&(typeof t.zstd!="object"&&(t.zstd={}),this.zip=new Os(t.zstd)),!this.zip)throw new Error("impossible");let u=this.zip;u.on("data",(t=>super.write(t))),u.on("end",(()=>super.end())),u.on("drain",(()=>this[vo]())),this.on("resume",(()=>u.resume()))}else this.on("drain",this[vo]);this.noDirRecurse=!!t.noDirRecurse,this.follow=!!t.follow,this.noMtime=!!t.noMtime,t.mtime&&(this.mtime=t.mtime),this.filter=typeof t.filter=="function"?t.filter:()=>!0,this[Hn]=new xn,this[Wn]=0,this.jobs=Number(t.jobs)||4,this[Gn]=!1,this[Un]=!1}[yo](t){return super.write(t)}add(t){return this.write(t),this}end(t,u,p){return typeof t=="function"&&(p=t,t=void 0),typeof u=="function"&&(p=u,u=void 0),t&&this.add(t),this[Un]=!0,this[zn](),p&&p(),this}write(t){if(this[Un])throw new Error("write after end");return t instanceof Ws?this[Zn](t):this[Yn](t),this.flowing}[Zn](t){let u=qs(ze.resolve(this.cwd,t.path));if(!this.filter(t.path,t))t.resume();else{let p=new Nn(t.path,u);p.entry=new Sn(t,this[lo](p)),p.entry.on("end",(()=>this[Kn](p))),this[Wn]+=1,this[Hn].push(p)}this[zn]()}[Yn](t){let u=qs(ze.resolve(this.cwd,t));this[Hn].push(new Nn(t,u)),this[zn]()}[Jn](t){t.pending=!0,this[Wn]+=1;let u=this.follow?"stat":"lstat";Ve[u](t.absolute,((u,p)=>{t.pending=!1,this[Wn]-=1,u?this.emit("error",u):this[Ln](t,p)}))}[Ln](t,u){this.statCache.set(t.absolute,u),t.stat=u,this.filter(t.path,u)?u.isFile()&&u.nlink>1&&t===this[Vn]&&!this.linkCache.get(`${u.dev}:${u.ino}`)&&!this.sync&&this[qn](t):t.ignore=!0,this[zn]()}[to](t){t.pending=!0,this[Wn]+=1,Ve.readdir(t.absolute,((u,p)=>{if(t.pending=!1,this[Wn]-=1,u)return this.emit("error",u);this[ro](t,p)}))}[ro](t,u){this.readdirCache.set(t.absolute,u),t.readdir=u,this[zn]()}[zn](){if(!this[Gn]){this[Gn]=!0;for(let t=this[Hn].head;t&&this[Wn]<this.jobs;t=t.next)if(this[qn](t.value),t.value.ignore){let u=t.next;this[Hn].removeNode(t),t.next=u}this[Gn]=!1,this[Un]&&!this[Hn].length&&this[Wn]===0&&(this.zip?this.zip.end(Dn):(super.write(Dn),super.end()))}}get[Vn](){return this[Hn]&&this[Hn].head&&this[Hn].head.value}[Kn](t){this[Hn].shift(),this[Wn]-=1,this[zn]()}[qn](t){if(!t.pending){if(t.entry){t===this[Vn]&&!t.piped&&this[so](t);return}if(!t.stat){let u=this.statCache.get(t.absolute);u?this[Ln](t,u):this[Jn](t)}if(t.stat&&!t.ignore){if(!this.noDirRecurse&&t.stat.isDirectory()&&!t.readdir){let u=this.readdirCache.get(t.absolute);if(u?this[ro](t,u):this[to](t),!t.readdir)return}if(t.entry=this[io](t),!t.entry){t.ignore=!0;return}t===this[Vn]&&!t.piped&&this[so](t)}}}[lo](t){return{onwarn:(t,u,p)=>this.warn(t,u,p),noPax:this.noPax,cwd:this.cwd,absolute:t.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}}[io](t){this[Wn]+=1;try{return new this[go](t.path,this[lo](t)).on("end",(()=>this[Kn](t))).on("error",(t=>this.emit("error",t)))}catch(t){this.emit("error",t)}}[vo](){this[Vn]&&this[Vn].entry&&this[Vn].entry.resume()}[so](t){t.piped=!0,t.readdir&&t.readdir.forEach((u=>{let p=t.path,m=p==="./"?"":p.replace(/\/*$/,"/");this[Yn](m+u)}));let u=t.entry,p=this.zip;if(!u)throw new Error("cannot pipe without source");p?u.on("data",(t=>{p.write(t)||u.pause()})):u.on("data",(t=>{super.write(t)||u.pause()}))}pause(){return this.zip&&this.zip.pause(),super.pause()}warn(t,u,p={}){Lt(this,t,u,p)}},bo=class extends _o{sync=!0;constructor(t){super(t),this[go]=En}pause(){}resume(){}[Jn](t){let u=this.follow?"statSync":"lstatSync";this[Ln](t,Ve[u](t.absolute))}[to](t){this[ro](t,Ve.readdirSync(t.absolute))}[so](t){let u=t.entry,p=this.zip;if(t.readdir&&t.readdir.forEach((u=>{let p=t.path,m=p==="./"?"":p.replace(/\/*$/,"/");this[Yn](m+u)})),!u)throw new Error("Cannot pipe without source");p?u.on("data",(t=>{p.write(t)})):u.on("data",(t=>{super[yo](t)}))}};var vn=(t,u)=>{let p=new bo(t),m=new is(t.file,{mode:t.mode||438});p.pipe(m),hr(p,u)},Mn=(t,u)=>{let p=new _o(t),m=new ss(t.file,{mode:t.mode||438});p.pipe(m);let g=new Promise(((t,u)=>{m.on("error",u),m.on("close",t),p.on("error",u)}));return ar(p,u),g},hr=(t,u)=>{u.forEach((u=>{u.charAt(0)==="@"?Ci({file:k.resolve(t.cwd,u.slice(1)),sync:!0,noResume:!0,onReadEntry:u=>t.add(u)}):t.add(u)})),t.end()},ar=async(t,u)=>{for(let p=0;p<u.length;p++){let m=String(u[p]);m.charAt(0)==="@"?await Ci({file:k.resolve(String(t.cwd),m.slice(1)),noResume:!0,onReadEntry:u=>{t.add(u)}}):t.add(m)}t.end()},Bn=(t,u)=>{let p=new bo(t);return hr(p,u),p},Pn=(t,u)=>{let p=new _o(t);return ar(p,u),p},Eo=K(vn,Mn,Bn,Pn,((t,u)=>{if(!u?.length)throw new TypeError("no paths specified to add to archive")}));var So=process.env.__FAKE_PLATFORM__||process.platform,$o=So==="win32",{O_CREAT:Ro,O_TRUNC:Oo,O_WRONLY:Po}=Ve.constants,xo=Number(process.env.__FAKE_FS_O_FILENAME__)||Ve.constants.UV_FS_O_FILEMAP||0,Ao=$o&&!!xo,To=512*1024,ko=xo|Oo|Ro|Po,Co=Ao?t=>t<To?ko:"w":()=>"w";var cs=(t,u,p)=>{try{return T.lchownSync(t,u,p)}catch(t){if(t?.code!=="ENOENT")throw t}},di=(t,u,p,m)=>{T.lchown(t,u,p,(t=>{m(t&&t?.code!=="ENOENT"?t:null)}))},$n=(t,u,p,m,g)=>{if(u.isDirectory())index_min_fs(k.resolve(t,u.name),p,m,(y=>{if(y)return g(y);let v=k.resolve(t,u.name);di(v,p,m,g)}));else{let y=k.resolve(t,u.name);di(y,p,m,g)}},index_min_fs=(t,u,p,m)=>{T.readdir(t,{withFileTypes:!0},((g,y)=>{if(g){if(g.code==="ENOENT")return m();if(g.code!=="ENOTDIR"&&g.code!=="ENOTSUP")return m(g)}if(g||!y.length)return di(t,u,p,m);let v=y.length,b=null,a=g=>{if(!b){if(g)return m(b=g);if(--v===0)return di(t,u,p,m)}};for(let m of y)$n(t,m,u,p,a)}))},Xn=(t,u,p,m)=>{u.isDirectory()&&ds(k.resolve(t,u.name),p,m),cs(k.resolve(t,u.name),p,m)},ds=(t,u,p)=>{let m;try{m=T.readdirSync(t,{withFileTypes:!0})}catch(m){let g=m;if(g?.code==="ENOENT")return;if(g?.code==="ENOTDIR"||g?.code==="ENOTSUP")return cs(t,u,p);throw g}for(let g of m)Xn(t,g,u,p);return cs(t,u,p)};var Io=class extends Error{path;code;syscall="chdir";constructor(t,u){super(`${u}: Cannot cd into '${t}'`),this.path=t,this.code=u}get name(){return"CwdError"}};var No=class extends Error{path;symlink;syscall="symlink";code="TAR_SYMLINK_ERROR";constructor(t,u){super("TAR_SYMLINK_ERROR: Cannot extract through symbolic link"),this.symlink=t,this.path=u}get name(){return"SymlinkError"}};var jn=(t,u)=>{T.stat(t,((p,m)=>{(p||!m.isDirectory())&&(p=new Io(t,p?.code||"ENOTDIR")),u(p)}))},fr=(t,u,p)=>{t=qs(t);let m=u.umask??18,g=u.mode|448,y=(g&m)!==0,v=u.uid,b=u.gid,w=typeof v=="number"&&typeof b=="number"&&(v!==u.processUid||b!==u.processGid),E=u.preserve,$=u.unlink,R=qs(u.cwd),S=(u,m)=>{u?p(u):m&&w?index_min_fs(m,v,b,(t=>S(t))):y?T.chmod(t,g,p):p()};if(t===R)return jn(t,S);if(E)return dt.mkdir(t,{mode:g,recursive:!0}).then((t=>S(null,t??void 0)),S);let O=qs(k.relative(R,t)).split("/");us(R,O,g,$,R,void 0,S)},us=(t,u,p,m,g,y,v)=>{if(!u.length)return v(null,y);let b=u.shift(),w=qs(k.resolve(t+"/"+b));T.mkdir(w,p,dr(w,u,p,m,g,y,v))},dr=(t,u,p,m,g,y,v)=>b=>{b?T.lstat(t,((w,E)=>{if(w)w.path=w.path&&qs(w.path),v(w);else if(E.isDirectory())us(t,u,p,m,g,y,v);else if(m)T.unlink(t,(b=>{if(b)return v(b);T.mkdir(t,p,dr(t,u,p,m,g,y,v))}));else{if(E.isSymbolicLink())return v(new No(t,t+"/"+u.join("/")));v(b)}})):(y=y||t,us(t,u,p,m,g,y,v))},Qn=t=>{let u=!1,p;try{u=T.statSync(t).isDirectory()}catch(t){p=t?.code}finally{if(!u)throw new Io(t,p??"ENOTDIR")}},ur=(t,u)=>{t=qs(t);let p=u.umask??18,m=u.mode|448,g=(m&p)!==0,y=u.uid,v=u.gid,b=typeof y=="number"&&typeof v=="number"&&(y!==u.processUid||v!==u.processGid),w=u.preserve,E=u.unlink,$=qs(u.cwd),d=u=>{u&&b&&ds(u,y,v),g&&T.chmodSync(t,m)};if(t===$)return Qn($),d();if(w)return d(T.mkdirSync(t,{mode:m,recursive:!0})??void 0);let R=qs(k.relative($,t)).split("/"),O;for(let t=R.shift(),u=$;t&&(u+="/"+t);t=R.shift()){u=qs(k.resolve(u));try{T.mkdirSync(u,m),O=O||u}catch{let t=T.lstatSync(u);if(t.isDirectory())continue;if(E){T.unlinkSync(u),T.mkdirSync(u,m),O=O||u;continue}else if(t.isSymbolicLink())return new No(u,u+"/"+R.join("/"))}}return d(O)};var Do=Object.create(null),Lo=1e4,Mo=new Set,pr=t=>{Mo.has(t)?Mo.delete(t):Do[t]=t.normalize("NFD").toLocaleLowerCase("en").toLocaleUpperCase("en"),Mo.add(t);let u=Do[t],p=Mo.size-Lo;if(p>Lo/10){for(let t of Mo)if(Mo.delete(t),delete Do[t],--p<=0)break}return u};var jo=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,Fo=jo==="win32",eo=t=>t.split("/").slice(0,-1).reduce(((t,u)=>{let p=t[t.length-1];return p!==void 0&&(u=(0,k.join)(p,u)),t.push(u||"/"),t}),[]),Uo=class{#i=new Map;#n=new Map;#o=new Set;reserve(t,u){t=Fo?["win32 parallelization disabled"]:t.map((t=>mt((0,k.join)(pr(t)))));let p=new Set(t.map((t=>eo(t))).reduce(((t,u)=>t.concat(u))));this.#n.set(u,{dirs:p,paths:t});for(let p of t){let t=this.#i.get(p);t?t.push(u):this.#i.set(p,[u])}for(let t of p){let p=this.#i.get(t);if(!p)this.#i.set(t,[new Set([u])]);else{let t=p[p.length-1];t instanceof Set?t.add(u):p.push(new Set([u]))}}return this.#c(u)}#a(t){let u=this.#n.get(t);if(!u)throw new Error("function does not have any path reservations");return{paths:u.paths.map((t=>this.#i.get(t))),dirs:[...u.dirs].map((t=>this.#i.get(t)))}}check(t){let{paths:u,dirs:p}=this.#a(t);return u.every((u=>u&&u[0]===t))&&p.every((u=>u&&u[0]instanceof Set&&u[0].has(t)))}#c(t){return this.#o.has(t)||!this.check(t)?!1:(this.#o.add(t),t((()=>this.#l(t))),!0)}#l(t){if(!this.#o.has(t))return!1;let u=this.#n.get(t);if(!u)throw new Error("invalid reservation");let{paths:p,dirs:m}=u,g=new Set;for(let u of p){let p=this.#i.get(u);if(!p||p?.[0]!==t)continue;let m=p[1];if(!m){this.#i.delete(u);continue}if(p.shift(),typeof m=="function")g.add(m);else for(let t of m)g.add(t)}for(let u of m){let p=this.#i.get(u),m=p?.[0];if(!(!p||!(m instanceof Set)))if(m.size===1&&p.length===1){this.#i.delete(u);continue}else if(m.size===1){p.shift();let t=p[0];typeof t=="function"&&g.add(t)}else m.delete(t)}return this.#o.delete(t),g.forEach((t=>this.#c(t))),!0}};var wr=()=>process.umask();var Bo=Symbol("onEntry"),Ho=Symbol("checkFs"),Vo=Symbol("checkFs2"),zo=Symbol("isReusable"),Go=Symbol("makeFs"),qo=Symbol("file"),Wo=Symbol("directory"),Ko=Symbol("link"),Yo=Symbol("symlink"),Zo=Symbol("hardlink"),Xo=Symbol("ensureNoSymlink"),Jo=Symbol("unsupported"),Qo=Symbol("checkPath"),ea=Symbol("stripAbsolutePath"),ta=Symbol("mkdir"),ra=Symbol("onError"),sa=Symbol("pending"),ia=Symbol("pend"),na=Symbol("unpend"),oa=Symbol("ended"),aa=Symbol("maybeClose"),ca=Symbol("skip"),la=Symbol("doChown"),ua=Symbol("uid"),ha=Symbol("gid"),da=Symbol("checkedCwd"),fa=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,pa=fa==="win32",ma=1024,no=(t,u)=>{if(!pa)return T.unlink(t,u);let p=t+".DELETE."+(0,C.randomBytes)(16).toString("hex");T.rename(t,p,(t=>{if(t)return u(t);T.unlink(p,u)}))},oo=t=>{if(!pa)return T.unlinkSync(t);let u=t+".DELETE."+(0,C.randomBytes)(16).toString("hex");T.renameSync(t,u),T.unlinkSync(u)},Tr=(t,u,p)=>t!==void 0&&t===t>>>0?t:u!==void 0&&u===u>>>0?u:p,ga=class extends ki{[oa]=!1;[da]=!1;[sa]=0;reservations=new Uo;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(t={}){if(t.ondone=()=>{this[oa]=!0,this[aa]()},super(t),this.transform=t.transform,this.chmod=!!t.chmod,typeof t.uid=="number"||typeof t.gid=="number"){if(typeof t.uid!="number"||typeof t.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(t.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=t.uid,this.gid=t.gid,this.setOwner=!0}else this.uid=void 0,this.gid=void 0,this.setOwner=!1;t.preserveOwner===void 0&&typeof t.uid!="number"?this.preserveOwner=!!(process.getuid&&process.getuid()===0):this.preserveOwner=!!t.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 t.maxDepth=="number"?t.maxDepth:ma,this.forceChown=t.forceChown===!0,this.win32=!!t.win32||pa,this.newer=!!t.newer,this.keep=!!t.keep,this.noMtime=!!t.noMtime,this.preservePaths=!!t.preservePaths,this.unlink=!!t.unlink,this.cwd=qs(k.resolve(t.cwd||process.cwd())),this.strip=Number(t.strip)||0,this.processUmask=this.chmod?typeof t.processUmask=="number"?t.processUmask:wr():0,this.umask=typeof t.umask=="number"?t.umask:this.processUmask,this.dmode=t.dmode||511&~this.umask,this.fmode=t.fmode||438&~this.umask,this.on("entry",(t=>this[Bo](t)))}warn(t,u,p={}){return(t==="TAR_BAD_ARCHIVE"||t==="TAR_ABORT")&&(p.recoverable=!1),super.warn(t,u,p)}[aa](){this[oa]&&this[sa]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[ea](t,u){let p=t[u],{type:m}=t;if(!p||this.preservePaths)return!0;let[g,y]=ce(p),v=y.replace(/\\/g,"/").split("/");if(v.includes("..")||pa&&/^[a-z]:\.\.$/i.test(v[0]??"")){if(u==="path"||m==="Link")return this.warn("TAR_ENTRY_ERROR",`${u} contains '..'`,{entry:t,[u]:p}),!1;{let m=k.posix.dirname(t.path),g=k.posix.normalize(k.posix.join(m,v.join("/")));if(g.startsWith("../")||g==="..")return this.warn("TAR_ENTRY_ERROR",`${u} escapes extraction directory`,{entry:t,[u]:p}),!1}}return g&&(t[u]=String(y),this.warn("TAR_ENTRY_INFO",`stripping ${g} from absolute ${u}`,{entry:t,[u]:p})),!0}[Qo](t){let u=qs(t.path),p=u.split("/");if(this.strip){if(p.length<this.strip)return!1;if(t.type==="Link"){let u=qs(String(t.linkpath)).split("/");if(u.length>=this.strip)t.linkpath=u.slice(this.strip).join("/");else return!1}p.splice(0,this.strip),t.path=p.join("/")}if(isFinite(this.maxDepth)&&p.length>this.maxDepth)return this.warn("TAR_ENTRY_ERROR","path excessively deep",{entry:t,path:u,depth:p.length,maxDepth:this.maxDepth}),!1;if(!this[ea](t,"path")||!this[ea](t,"linkpath"))return!1;if(k.isAbsolute(t.path)?t.absolute=qs(k.resolve(t.path)):t.absolute=qs(k.resolve(this.cwd,t.path)),!this.preservePaths&&typeof t.absolute=="string"&&t.absolute.indexOf(this.cwd+"/")!==0&&t.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:t,path:qs(t.path),resolvedPath:t.absolute,cwd:this.cwd}),!1;if(t.absolute===this.cwd&&t.type!=="Directory"&&t.type!=="GNUDumpDir")return!1;if(this.win32){let{root:u}=k.win32.parse(String(t.absolute));t.absolute=u+$i(String(t.absolute).slice(u.length));let{root:p}=k.win32.parse(t.path);t.path=p+$i(t.path.slice(p.length))}return!0}[Bo](t){if(!this[Qo](t))return t.resume();switch(I.equal(typeof t.absolute,"string"),t.type){case"Directory":case"GNUDumpDir":t.mode&&(t.mode=t.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[Ho](t);default:return this[Jo](t)}}[ra](t,u){t.name==="CwdError"?this.emit("error",t):(this.warn("TAR_ENTRY_ERROR",t,{entry:u}),this[na](),u.resume())}[ta](t,u,p){fr(qs(t),{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:u},p)}[la](t){return this.forceChown||this.preserveOwner&&(typeof t.uid=="number"&&t.uid!==this.processUid||typeof t.gid=="number"&&t.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[ua](t){return Tr(this.uid,t.uid,this.processUid)}[ha](t){return Tr(this.gid,t.gid,this.processGid)}[qo](t,u){let p=typeof t.mode=="number"?t.mode&4095:this.fmode,m=new ss(String(t.absolute),{flags:Co(t.size),mode:p,autoClose:!1});m.on("error",(p=>{m.fd&&T.close(m.fd,(()=>{})),m.write=()=>!0,this[ra](p,t),u()}));let g=1,o=p=>{if(p){m.fd&&T.close(m.fd,(()=>{})),this[ra](p,t),u();return}--g===0&&m.fd!==void 0&&T.close(m.fd,(p=>{p?this[ra](p,t):this[na](),u()}))};m.on("finish",(()=>{let u=String(t.absolute),p=m.fd;if(typeof p=="number"&&t.mtime&&!this.noMtime){g++;let m=t.atime||new Date,y=t.mtime;T.futimes(p,m,y,(t=>t?T.utimes(u,m,y,(u=>o(u&&t))):o()))}if(typeof p=="number"&&this[la](t)){g++;let m=this[ua](t),y=this[ha](t);typeof m=="number"&&typeof y=="number"&&T.fchown(p,m,y,(t=>t?T.chown(u,m,y,(u=>o(u&&t))):o()))}o()}));let y=this.transform&&this.transform(t)||t;y!==t&&(y.on("error",(p=>{this[ra](p,t),u()})),t.pipe(y)),y.pipe(m)}[Wo](t,u){let p=typeof t.mode=="number"?t.mode&4095:this.dmode;this[ta](String(t.absolute),p,(p=>{if(p){this[ra](p,t),u();return}let m=1,o=()=>{--m===0&&(u(),this[na](),t.resume())};t.mtime&&!this.noMtime&&(m++,T.utimes(String(t.absolute),t.atime||new Date,t.mtime,o)),this[la](t)&&(m++,T.chown(String(t.absolute),Number(this[ua](t)),Number(this[ha](t)),o)),o()}))}[Jo](t){t.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${t.type}`,{entry:t}),t.resume()}[Yo](t,u){let p=qs(k.relative(this.cwd,k.resolve(k.dirname(String(t.absolute)),String(t.linkpath)))).split("/");this[Xo](t,this.cwd,p,(()=>this[Ko](t,String(t.linkpath),"symlink",u)),(p=>{this[ra](p,t),u()}))}[Zo](t,u){let p=qs(k.resolve(this.cwd,String(t.linkpath))),m=qs(String(t.linkpath)).split("/");this[Xo](t,this.cwd,m,(()=>this[Ko](t,p,"link",u)),(p=>{this[ra](p,t),u()}))}[Xo](t,u,p,m,g){let y=p.shift();if(this.preservePaths||y===void 0)return m();let v=k.resolve(u,y);T.lstat(v,((u,y)=>{if(u)return m();if(y?.isSymbolicLink())return g(new No(v,k.resolve(v,p.join("/"))));this[Xo](t,v,p,m,g)}))}[ia](){this[sa]++}[na](){this[sa]--,this[aa]()}[ca](t){this[na](),t.resume()}[zo](t,u){return t.type==="File"&&!this.unlink&&u.isFile()&&u.nlink<=1&&!pa}[Ho](t){this[ia]();let u=[t.path];t.linkpath&&u.push(t.linkpath),this.reservations.reserve(u,(u=>this[Vo](t,u)))}[Vo](t,u){let i=t=>{u(t)},r=()=>{this[ta](this.cwd,this.dmode,(u=>{if(u){this[ra](u,t),i();return}this[da]=!0,n()}))},n=()=>{if(t.absolute!==this.cwd){let u=qs(k.dirname(String(t.absolute)));if(u!==this.cwd)return this[ta](u,this.dmode,(u=>{if(u){this[ra](u,t),i();return}o()}))}o()},o=()=>{T.lstat(String(t.absolute),((u,p)=>{if(p&&(this.keep||this.newer&&p.mtime>(t.mtime??p.mtime))){this[ca](t),i();return}if(u||this[zo](t,p))return this[Go](null,t,i);if(p.isDirectory()){if(t.type==="Directory"){let u=this.chmod&&t.mode&&(p.mode&4095)!==t.mode,c=u=>this[Go](u??null,t,i);return u?T.chmod(String(t.absolute),Number(t.mode),c):c()}if(t.absolute!==this.cwd)return T.rmdir(String(t.absolute),(u=>this[Go](u??null,t,i)))}if(t.absolute===this.cwd)return this[Go](null,t,i);no(String(t.absolute),(u=>this[Go](u??null,t,i)))}))};this[da]?n():r()}[Go](t,u,p){if(t){this[ra](t,u),p();return}switch(u.type){case"File":case"OldFile":case"ContiguousFile":return this[qo](u,p);case"Link":return this[Zo](u,p);case"SymbolicLink":return this[Yo](u,p);case"Directory":case"GNUDumpDir":return this[Wo](u,p)}}[Ko](t,u,p,m){T[p](u,String(t.absolute),(u=>{u?this[ra](u,t):(this[na](),t.resume()),m()}))}},Se=t=>{try{return[null,t()]}catch(t){return[t,null]}},ya=class extends ga{sync=!0;[Go](t,u){return super[Go](t,u,(()=>{}))}[Ho](t){if(!this[da]){let u=this[ta](this.cwd,this.dmode);if(u)return this[ra](u,t);this[da]=!0}if(t.absolute!==this.cwd){let u=qs(k.dirname(String(t.absolute)));if(u!==this.cwd){let p=this[ta](u,this.dmode);if(p)return this[ra](p,t)}}let[u,p]=Se((()=>T.lstatSync(String(t.absolute))));if(p&&(this.keep||this.newer&&p.mtime>(t.mtime??p.mtime)))return this[ca](t);if(u||this[zo](t,p))return this[Go](null,t);if(p.isDirectory()){if(t.type==="Directory"){let u=this.chmod&&t.mode&&(p.mode&4095)!==t.mode,[m]=u?Se((()=>{T.chmodSync(String(t.absolute),Number(t.mode))})):[];return this[Go](m,t)}let[u]=Se((()=>T.rmdirSync(String(t.absolute))));this[Go](u,t)}let[m]=t.absolute===this.cwd?[]:Se((()=>oo(String(t.absolute))));this[Go](m,t)}[qo](t,u){let p=typeof t.mode=="number"?t.mode&4095:this.fmode,r=p=>{let g;try{T.closeSync(m)}catch(t){g=t}(p||g)&&this[ra](p||g,t),u()},m;try{m=T.openSync(String(t.absolute),Co(t.size),p)}catch(t){return r(t)}let g=this.transform&&this.transform(t)||t;g!==t&&(g.on("error",(u=>this[ra](u,t))),t.pipe(g)),g.on("data",(t=>{try{T.writeSync(m,t,0,t.length)}catch(t){r(t)}})),g.on("end",(()=>{let u=null;if(t.mtime&&!this.noMtime){let p=t.atime||new Date,g=t.mtime;try{T.futimesSync(m,p,g)}catch(m){try{T.utimesSync(String(t.absolute),p,g)}catch{u=m}}}if(this[la](t)){let p=this[ua](t),g=this[ha](t);try{T.fchownSync(m,Number(p),Number(g))}catch(m){try{T.chownSync(String(t.absolute),Number(p),Number(g))}catch{u=u||m}}}r(u)}))}[Wo](t,u){let p=typeof t.mode=="number"?t.mode&4095:this.dmode,m=this[ta](String(t.absolute),p);if(m){this[ra](m,t),u();return}if(t.mtime&&!this.noMtime)try{T.utimesSync(String(t.absolute),t.atime||new Date,t.mtime)}catch{}if(this[la](t))try{T.chownSync(String(t.absolute),Number(this[ua](t)),Number(this[ha](t)))}catch{}u(),t.resume()}[ta](t,u){try{return ur(qs(t),{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:u})}catch(t){return t}}[Xo](t,u,p,m,g){if(this.preservePaths||!p.length)return m();let y=u;for(let t of p){y=k.resolve(y,t);let[v,b]=Se((()=>T.lstatSync(y)));if(v)return m();if(b.isSymbolicLink())return g(new No(y,k.resolve(u,p.join("/"))))}m()}[Ko](t,u,p,m){let g=`${p}Sync`;try{T[g](u,String(t.absolute)),m(),t.resume()}catch(u){return this[ra](u,t)}}};var ho=t=>{let u=new ya(t),p=t.file,m=T.statSync(p),g=t.maxReadSize||16*1024*1024;new rs(p,{readSize:g,size:m.size}).pipe(u)},ao=(t,u)=>{let p=new ga(t),m=t.maxReadSize||16*1024*1024,g=t.file;return new Promise(((t,u)=>{p.on("error",u),p.on("close",t),T.stat(g,((t,y)=>{if(t)u(t);else{let t=new ts(g,{readSize:m,size:y.size});t.on("error",u),t.pipe(p)}}))}))},va=K(ho,ao,(t=>new ya(t)),(t=>new ga(t)),((t,u)=>{u?.length&&Yi(t,u)}));var co=(t,u)=>{let p=new bo(t),m=!0,g,y;try{try{g=T.openSync(t.file,"r+")}catch(u){if(u?.code==="ENOENT")g=T.openSync(t.file,"w+");else throw u}let v=T.fstatSync(g),b=Buffer.alloc(512);e:for(y=0;y<v.size;y+=512){for(let t=0,u=0;t<512;t+=u){if(u=T.readSync(g,b,t,b.length-t,y+t),y===0&&b[0]===31&&b[1]===139)throw new Error("cannot append to compressed archives");if(!u)break e}let u=new Ls(b);if(!u.cksumValid)break;let p=512*Math.ceil((u.size||0)/512);if(y+p+512>v.size)break;y+=p,t.mtimeCache&&u.mtime&&t.mtimeCache.set(String(u.path),u.mtime)}m=!1,fo(t,p,y,g,u)}finally{if(m)try{T.closeSync(g)}catch{}}},fo=(t,u,p,m,g)=>{let y=new is(t.file,{fd:m,start:p});u.pipe(y),mo(u,g)},uo=(t,u)=>{u=Array.from(u);let p=new _o(t),i=(u,p,m)=>{let a=(t,p)=>{t?T.close(u,(u=>m(t))):m(null,p)},g=0;if(p===0)return a(null,0);let y=0,v=Buffer.alloc(512),S=(m,b)=>{if(m||typeof b>"u")return a(m);if(y+=b,y<512&&b)return T.read(u,v,y,v.length-y,g+y,S);if(g===0&&v[0]===31&&v[1]===139)return a(new Error("cannot append to compressed archives"));if(y<512)return a(null,g);let w=new Ls(v);if(!w.cksumValid)return a(null,g);let E=512*Math.ceil((w.size??0)/512);if(g+E+512>p||(g+=E+512,g>=p))return a(null,g);t.mtimeCache&&w.mtime&&t.mtimeCache.set(String(w.path),w.mtime),y=0,T.read(u,v,0,512,g,S)};T.read(u,v,0,512,g,S)};return new Promise(((m,g)=>{p.on("error",g);let y="r+",a=(v,b)=>{if(v&&v.code==="ENOENT"&&y==="r+")return y="w+",T.open(t.file,y,a);if(v||!b)return g(v);T.fstat(b,((y,v)=>{if(y)return T.close(b,(()=>g(y)));i(b,v.size,((y,v)=>{if(y)return g(y);let w=new ss(t.file,{fd:b,start:v});p.pipe(w),w.on("error",g),w.on("close",m),po(p,u)}))}))};T.open(t.file,y,a)}))},mo=(t,u)=>{u.forEach((u=>{u.charAt(0)==="@"?Ci({file:k.resolve(t.cwd,u.slice(1)),sync:!0,noResume:!0,onReadEntry:u=>t.add(u)}):t.add(u)})),t.end()},po=async(t,u)=>{for(let p=0;p<u.length;p++){let m=String(u[p]);m.charAt(0)==="@"?await Ci({file:k.resolve(String(t.cwd),m.slice(1)),noResume:!0,onReadEntry:u=>t.add(u)}):t.add(m)}t.end()},_a=K(co,uo,(()=>{throw new TypeError("file is required")}),(()=>{throw new TypeError("file is required")}),((t,u)=>{if(!ks(t))throw new TypeError("file is required");if(t.gzip||t.brotli||t.zstd||t.file.endsWith(".br")||t.file.endsWith(".tbr"))throw new TypeError("cannot append to compressed archives");if(!u?.length)throw new TypeError("no paths specified to add/replace")}));var ba=K(_a.syncFile,_a.asyncFile,_a.syncNoFile,_a.asyncNoFile,((t,u=[])=>{_a.validate?.(t,u),wo(t)})),wo=t=>{let u=t.filter;t.mtimeCache||(t.mtimeCache=new Map),t.filter=u?(p,m)=>u(p,m)&&!((t.mtimeCache?.get(p)??m.mtime??0)>(m.mtime??0)):(u,p)=>!((t.mtimeCache?.get(u)??p.mtime??0)>(p.mtime??0))};async function isUrlOk(t){try{const u=await fetch(t,{method:"HEAD"});return u.status===200}catch{return false}}async function getRepoInfo(t,u){const[,p,m,g,y,...v]=t.pathname.split("/");const b=u?u.replace(/^\//,""):v.join("/");if(g===undefined||g===""&&y===undefined){try{const t=await fetch(`https://api.github.com/repos/${p}/${m}`);if(t.status!==200){return}const u=await t.json();return{username:p,name:m,branch:u["default_branch"],filePath:b}}catch{return}}const w=u?`${y}/${v.join("/")}`.replace(new RegExp(`/${b}|/$`),""):y;if(p&&m&&w&&g==="tree"){return{username:p,name:m,branch:w,filePath:b}}}function hasRepo({username:t,name:u,branch:p,filePath:m}){const g=`https://api.github.com/repos/${t}/${u}/contents`;const y=`${m?`/${m}`:""}/package.json`;return isUrlOk(`${g+y}?ref=${p}`)}function existsInRepo(t){try{const u=new URL(t);return isUrlOk(u.href)}catch{return isUrlOk(`https://api.github.com/repos/zuplo/zuplo/contents/examples/${encodeURIComponent(t)}`)}}async function downloadTarStream(t,u=50*1024*1024){const p=await fetch(t);if(!p.body){throw new Error(`Failed to download: ${t}`)}const m=p.headers.get("content-length");if(m&&parseInt(m,10)>u){throw new Error(`File too large! ${m} bytes exceeds limit of ${u} bytes`)}const g=p.body;const y=et.Readable.fromWeb(g);let v=0;const b=new et.Transform({transform(t,p,m){v+=t.length;if(v>u){return m(new Error(`Download aborted! File size exceeded ${u} bytes`))}m(null,t)}});return y.pipe(b)}async function downloadAndExtractRepo(t,{username:u,name:p,branch:m,filePath:g},y){const v=`https://codeload.github.com/${u}/${p}/tar.gz/${m}`;if(y){console.log(`Downloading repo from ${v}`)}let b=null;await(0,tt.pipeline)(await downloadTarStream(v),va({cwd:t,strip:g?g.split("/").length+1:1,filter:t=>{if(b===null){const u=t.split(ze.sep);b=u.length?u[0]:null}return t.startsWith(`${b}${g?`/${g}/`:"/"}`)}}))}async function downloadAndExtractExample(t,u,p){if(u==="__internal-testing-retry"){throw new Error("This is an internal example for testing the CLI.")}const m="https://codeload.github.com/zuplo/zuplo/tar.gz/main";if(p){console.log(`Downloading example from ${m}`)}await(0,tt.pipeline)(await downloadTarStream(m),va({cwd:t,strip:2+u.split("/").length,filter:t=>t.includes(`zuplo-main/examples/${u}/`)}))}function isInGitRepository(){try{(0,Qe.execSync)("git rev-parse --is-inside-work-tree",{stdio:"ignore"});return true}catch{}return false}function isInMercurialRepository(){try{(0,Qe.execSync)("hg --cwd . root",{stdio:"ignore"});return true}catch{}return false}function isDefaultBranchSet(){try{(0,Qe.execSync)("git config init.defaultBranch",{stdio:"ignore"});return true}catch{}return false}function tryGitInit(t,u){let p=false;const m=u?"inherit":"ignore";try{(0,Qe.execSync)("git --version",{stdio:m});if(isInGitRepository()||isInMercurialRepository()){return false}(0,Qe.execSync)("git init",{stdio:m});p=true;if(!isDefaultBranchSet()){(0,Qe.execSync)("git checkout -b main",{stdio:m})}(0,Qe.execSync)("git add -A",{stdio:m});(0,Qe.execSync)('git commit -m "Initial commit from Create Next App"',{stdio:m});return true}catch(m){if(u){console.error("Git init failed:",m)}if(p){try{(0,Ve.rmSync)((0,ze.join)(t,".git"),{recursive:true,force:true})}catch{}}return false}}var wa=__nccwpck_require__(4791);var Ea=__nccwpck_require__.n(wa);async function install(t,u,p){const m=["install"];if(!u){console.log((0,qe.yellow)("You appear to be offline.\nFalling back to the local cache."));m.push("--offline")}else if(t==="npm"){m.push("--no-audit");m.push("--no-fund")}if(p){m.push("--verbose")}return new Promise(((u,p)=>{const g=Ea()(t,m,{stdio:"inherit",env:{...process.env,ADBLOCK:"1",NODE_ENV:"development",DISABLE_OPENCOLLECTIVE:"1"}});g.on("close",(g=>{if(g!==0){p({command:`${t} ${m.join(" ")}`});return}u()}))}))}function isFolderEmpty(t,u){const p=[".DS_Store",".git",".gitattributes",".gitignore",".gitlab-ci.yml",".hg",".hgcheck",".hgignore",".idea",".npmignore",".travis.yml","LICENSE","Thumbs.db","docs","mkdocs.yml","npm-debug.log","yarn-debug.log","yarn-error.log","yarnrc.yml",".yarn"];const m=(0,Ve.readdirSync)(t).filter((t=>!p.includes(t)&&!/\.iml$/.test(t)));if(m.length>0){console.log(`The directory ${(0,qe.green)(u)} contains files that could conflict:`);console.log();for(const u of m){try{const p=(0,Ve.lstatSync)((0,ze.join)(t,u));if(p.isDirectory()){console.log(` ${(0,qe.blue)(u)}/`)}else{console.log(` ${u}`)}}catch{console.log(` ${u}`)}}console.log();console.log("Either try using a new directory name, or remove the files listed above.");console.log();return false}return true}const Sa=require("dns/promises");var $a=__nccwpck_require__(7016);var Ra=__nccwpck_require__.n($a);function getProxy(){if(process.env.https_proxy){return process.env.https_proxy}try{const t=(0,Qe.execSync)("npm config get https-proxy").toString().trim();return t!=="null"?t:undefined}catch{return}}async function getOnline(){try{await(0,Sa.lookup)("registry.yarnpkg.com");return true}catch{const t=getProxy();if(!t){return false}const{hostname:u}=Ra().parse(t);if(!u){return false}try{await(0,Sa.lookup)(u);return true}catch{return false}}}const Oa=require("constants");const Pa=require("fs/promises");var xa=__nccwpck_require__.n(Pa);async function isWriteable(t){try{await(0,Pa.access)(t,Oa.W_OK);return true}catch{return false}}var Aa=__nccwpck_require__(857);var Ta=__nccwpck_require__.n(Aa);var ka=__nccwpck_require__(4761);const identity=t=>t;const copy=async(t,u,{cwd:p,rename:m=identity,parents:g=true,verbose:y=false}={})=>{const v=typeof t==="string"?[t]:t;if(v.length===0||!u){throw new TypeError("`src` and `dest` are required")}const b=await(0,ka.async)(v,{cwd:p,dot:true,absolute:false,stats:false});const w=p?(0,ze.resolve)(p,u):u;return Promise.all(b.map((async t=>{const u=(0,ze.dirname)(t);const v=m((0,ze.basename)(t),t);const b=p?(0,ze.resolve)(p,t):t;const E=g?(0,ze.join)(w,u,v):(0,ze.join)(w,v);await(0,Pa.mkdir)((0,ze.dirname)(E),{recursive:true});if(y){console.log(`Copying ${b} to ${E}`)}return(0,Pa.copyFile)(b,E)})))};const getTemplateFile=({template:t,file:u})=>__nccwpck_require__.ab+"templates/"+t+"/"+u;const installTemplate=async({appName:t,root:u,packageManager:p,isOnline:m,template:g,eslint:y,prettier:v,installPackages:b,verbose:w,zuploVersion:E})=>{var $;console.log((0,qe.bold)(`Using ${p}.`));console.log("\nInitializing project with template:",g,"\n");const R=__nccwpck_require__.ab+"templates/"+g;const O=["**","!vscode/**"];if(!y)O.push("!eslintrc.json");if(!v)O.push("!prettierrc.json");await copy(O,u,{parents:true,cwd:R,verbose:w,rename(t){switch(t){case"gitignore":case"eslintrc.json":case"prettierrc.json":{return`.${t}`}case"README-template.md":{return"README.md"}default:{return t}}}});const P=["settings.json","launch.json"];for(const t of P){const p=Ge().join(R,"vscode",t);const m=Ge().join(u,".vscode",t);if((0,Ve.existsSync)(p)){await xa().mkdir(Ge().join(u,".vscode"),{recursive:true});await xa().copyFile(p,m)}}const x=($=process.env.ZUPLO_PRIVATE_TEST_VERSION)!==null&&$!==void 0?$:E;const A=new Te.SemVer(x);const T={name:t,version:"0.1.0",type:"module",private:true,scripts:{dev:`zuplo dev`,test:"zuplo test",docs:"zuplo docs",...y?{lint:"eslint"}:{}},dependencies:{zuplo:`^${A.major}`},devDependencies:{typescript:"^5","@types/node":"^22"}};if(y){T.devDependencies={...T.devDependencies,eslint:"^8","@typescript-eslint/eslint-plugin":"^8","@typescript-eslint/parser":"^8"}}if(v){T.devDependencies={...T.devDependencies,prettier:"^3"}}if(y&&v){T.devDependencies={...T.devDependencies,"eslint-config-prettier":"^9"};const t=Ge().join(u,".eslintrc.json");const p=await xa().readFile(t,"utf-8").then(JSON.parse);p.extends.push("prettier");await xa().writeFile(t,JSON.stringify(p,null,2)+Ta().EOL,"utf-8")}T.workspaces=["docs"];const sortObjectKeys=t=>Object.keys(t).sort().reduce(((u,p)=>{u[p]=t[p];return u}),{});if(T.dependencies){T.dependencies=sortObjectKeys(T.dependencies)}if(T.devDependencies){T.devDependencies=sortObjectKeys(T.devDependencies)}const k=Object.keys(T.devDependencies).length;if(!k)delete T.devDependencies;await xa().writeFile(Ge().join(u,"package.json"),JSON.stringify(T,null,2)+Ta().EOL);let C="^0.53";if(m){try{const t=await fetch("https://api.github.com/repos/zuplo/zudoku/releases/latest");const u=await t.json();const p=u.tag_name.replace("v","");const m=new Te.SemVer(p);C=`^${m.major}.${m.minor}`}catch{console.warn("\nFailed to determine the latest dev portal version. Using the default version.")}}let I="latest";if(m){try{const t=await fetch("https://registry.npmjs.org/@zuplo/zudoku-plugin-monetization/latest");const u=await t.json();const p=new Te.SemVer(u.version);I=`^${p.major}.${p.minor}`}catch{console.warn("\nFailed to determine the latest monetization plugin version. Using the default version.")}}const N={name:"docs",version:"0.1.0",type:"module",private:true,scripts:{dev:"zudoku dev --zuplo",build:"zudoku build --zuplo",...y?{lint:"eslint"}:{}},dependencies:{react:"^19","react-dom":"^19","@mdx-js/react":"3.0.1","@zuplo/zudoku-plugin-monetization":I,zudoku:C},devDependencies:{"@types/node":"^22","@types/react":"^19","@types/react-dom":"^19",typescript:"^5"}};await xa().writeFile(Ge().join(u,"docs","package.json"),JSON.stringify(N,null,2)+Ta().EOL);if(!b)return;console.log("\nInstalling dependencies:");for(const t in T.dependencies)console.log(`- ${(0,qe.cyan)(t)}`);if(k){console.log("\nInstalling devDependencies:");for(const t in T.devDependencies)console.log(`- ${(0,qe.cyan)(t)}`)}console.log();await install(p,m,w)};class DownloadError extends Error{}async function runZuploInit(t,u){return new Promise(((p,m)=>{const g=["zuplo","init",t];if(u){g.push("--yes")}console.log();console.log("Initializing Zuplo platform resources...");console.log();const y=process.platform==="win32"?"npx.cmd":"npx";const v=(0,Qe.spawn)(y,g,{stdio:"inherit"});v.on("close",((t,u)=>{if(t===0){p();return}let g;if(t!==null&&t!==undefined){g=`exited with code ${t}`}else if(u){g=`was terminated by signal ${u}`}else{g="exited unsuccessfully"}m(new Error(`Failed to initialize Zuplo platform resources: "zuplo init" ${g}. See the output above for details.`))}));v.on("error",(t=>{m(t)}))}))}async function createApp({appPath:t,packageManager:u,example:p,examplePath:m,eslint:g,prettier:y,installPackages:v,empty:b,initGit:w,verbose:E,zuploVersion:$,runInit:R,skipPrompts:O}){let P;const x=`default${b?"-empty":""}`;if(p){let M;try{M=new URL(p)}catch(j){const U=j;if(U.code!=="ERR_INVALID_URL"){console.error(j);process.exit(1)}}if(M){if(M.origin!=="https://github.com"){console.error(`Invalid URL: ${(0,qe.red)(`"${p}"`)}. Only GitHub repositories are supported. Please use a GitHub URL and try again.`);process.exit(1)}P=await getRepoInfo(M,m);if(!P){console.error(`Found invalid GitHub URL: ${(0,qe.red)(`"${p}"`)}. Please fix the URL and try again.`);process.exit(1)}const B=await hasRepo(P);if(!B){console.error(`Could not locate the repository for ${(0,qe.red)(`"${p}"`)}. Please check that the repository exists and try again.`);process.exit(1)}}else if(p!=="__internal-testing-retry"){const H=await existsInRepo(p);if(!H){console.error(`Could not locate an example named ${(0,qe.red)(`"${p}"`)}. It could be due to the following:\n`,`1. Your spelling of example ${(0,qe.red)(`"${p}"`)} might be incorrect.\n`,`2. You might not be connected to the internet or you are behind a proxy.`);process.exit(1)}}}const A=(0,ze.resolve)(t);if(!await isWriteable((0,ze.dirname)(A))){console.error("The application path is not writable, please check folder permissions and try again.");console.error("It is likely you do not have write permissions for this folder.");process.exit(1)}const T=(0,ze.basename)(A);(0,Ve.mkdirSync)(A,{recursive:true});if(!isFolderEmpty(A,T)){process.exit(1)}const k=u==="yarn";const C=!k||await getOnline();const I=process.cwd();console.log(`Creating a new Zuplo API in ${(0,qe.green)(A)}.`);console.log();process.chdir(A);const N=(0,ze.join)(A,"package.json");let D=false;if(p){try{if(P){const z=P;console.log(`Downloading files from repo ${(0,qe.cyan)(p)}. This might take a moment.`);console.log();await Je()((()=>downloadAndExtractRepo(A,z,E)),{retries:3})}else{console.log(`Downloading files for example ${(0,qe.cyan)(p)}. This might take a moment.`);console.log();await Je()((()=>downloadAndExtractExample(A,p,E)),{retries:3})}}catch(G){function isErrorLike(t){return typeof t==="object"&&t!==null&&typeof t.message==="string"}throw new DownloadError(isErrorLike(G)?G.message:`${G}`)}const V=(0,ze.join)(A,".gitignore");if(!(0,Ve.existsSync)(V)){(0,Ve.copyFileSync)(getTemplateFile({template:x,file:"gitignore"}),V)}D=(0,Ve.existsSync)(N);if(v&&D){console.log("Installing packages. This might take a couple of minutes.");console.log();await install(u,C,E);console.log()}}else{await installTemplate({appName:T,root:A,template:x,packageManager:u,isOnline:C,eslint:g,prettier:y,installPackages:v,verbose:E,zuploVersion:$})}if(w){if(tryGitInit(A,E)){console.log("Initialized a git repository.");console.log()}}let L;if((0,ze.join)(I,T)===t){L=T}else{L=t}console.log(`${(0,qe.green)("Success!")} Created ${T} at ${t}`);if(R){try{await runZuploInit(A,O)}catch(q){console.log();console.log(`${(0,qe.red)("Note:")} Failed to initialize Zuplo platform resources.`);console.log("You can run 'zuplo init' later to set up your project on the platform.");console.log()}}if(D){console.log("Inside that directory, you can run several commands:");console.log();console.log((0,qe.cyan)(` ${u} ${k?"":"run "}dev`));console.log(" Starts the development server.");console.log();console.log((0,qe.cyan)(` ${u} ${k?"":"run "}build`));console.log(" Builds the app for production.");console.log();console.log((0,qe.cyan)(` ${u} start`));console.log(" Runs the built app in production mode.");console.log();console.log("We suggest that you begin by typing:");console.log();console.log((0,qe.cyan)(" cd"),L);console.log(` ${(0,qe.cyan)(`${u} ${k?"":"run "}dev`)}`)}console.log()}function getPkgManager(){var t;const u=(t=process.env.npm_config_user_agent)!==null&&t!==void 0?t:"";if(u.startsWith("yarn")){return"yarn"}if(u.startsWith("pnpm")){return"pnpm"}if(u.startsWith("bun")){return"bun"}return"npm"}var Ca=__nccwpck_require__(7825);var Ia=__nccwpck_require__.n(Ca);function validateNpmName(t){const u=Ia()(t);if(u.validForNewPackages){return{valid:true}}return{valid:false,problems:[...u.errors||[],...u.warnings||[]]}}let Na="";const handleSigTerm=()=>process.exit(0);process.on("SIGINT",handleSigTerm);process.on("SIGTERM",handleSigTerm);const onPromptState=t=>{if(t.aborted){process.stdout.write("[?25h");process.stdout.write("\n");process.exit(1)}};const Da=JSON.parse((0,Ve.readFileSync)(Ge().resolve(__dirname,Ge().join("..","package.json")),"utf-8"));const La=new $(Da.name).version(Da.version,"-v, --version","Output the current version of create-zuplo-api.").argument("[directory]").usage("[directory] [options]").helpOption("-h, --help","Display this help message.").option("--eslint","Initialize with ESLint config.").option("--prettier","Initialize with Prettier config.").option("--empty","Initialize an empty project.").option("--use-npm","Explicitly tell the CLI to bootstrap the application using npm.").option("--use-pnpm","Explicitly tell the CLI to bootstrap the application using pnpm.").option("--use-yarn","Explicitly tell the CLI to bootstrap the application using Yarn.").option("--use-bun","Explicitly tell the CLI to bootstrap the application using Bun.").option("--reset, --reset-preferences","Reset the preferences saved for create-zuplo-api.").option("--git","Whether or not to initialize the project as a git repo.").option("--version-check","Whether or not to check for an outdated version.").option("--install","Whether or not to install packages.").option("--verbose","Enable verbose logging.",false).option("--yes","Use saved preferences or defaults for unprovided options.").option("--init","Run Zuplo platform initialization after scaffolding (create project and link environment).").option("-e, --example <example-name|github-url>",`\n\n An example to bootstrap the api with. You can use an example name\n from the official Zuplo repo or a public GitHub URL. The URL can use\n any branch and/or subdirectory.\n`).option("--example-path <path-to-example>",`\n\n In a rare case, your GitHub URL might contain a branch name with\n a slash (e.g. bug/fix-1) and the path to the example (e.g. foo/bar).\n In this case, you must specify the path to the example separately:\n --example-path foo/bar\n`).action((t=>{if(t&&!t.startsWith("--no-")){Na=t}})).allowUnknownOption().parse(process.argv);const Ma=La.opts();const{args:ja}=La;const Fa=Ma.useNpm?"npm":Ma.usePnpm?"pnpm":Ma.useYarn?"yarn":Ma.useBun?"bun":getPkgManager();async function run(){var t,p,m,g,y;const v=new Conf({projectName:"create-zuplo-api"});if(Ma.resetPreferences){const{resetPreferences:t}=await Ke()({onState:onPromptState,type:"toggle",name:"resetPreferences",message:"Would you like to reset the saved preferences?",initial:false,active:"Yes",inactive:"No"});if(t){v.clear();console.log("The preferences have been reset successfully!")}process.exit(0)}if(typeof Na==="string"){Na=Na.trim()}if(!Na){const t=await Ke()({onState:onPromptState,type:"text",name:"path",message:"What is your project named?",initial:"my-api",validate:t=>{const u=validateNpmName((0,ze.basename)((0,ze.resolve)(t)));if(u.valid){return true}return`Invalid project name: ${u.problems[0]}`}});if(typeof t.path==="string"){Na=t.path.trim()}}if(!Na){console.log("\nPlease specify the project directory:\n"+` ${(0,qe.cyan)(Ma.name())} ${(0,qe.green)("<project-directory>")}\n`+"For example:\n"+` ${(0,qe.cyan)(Ma.name())} ${(0,qe.green)("my-zuplo-api")}\n\n`+`Run ${(0,qe.cyan)(`${Ma.name()} --help`)} to see all options.`);process.exit(1)}const b=(0,ze.resolve)(Na);const w=(0,ze.basename)(b);const E=validateNpmName(w);if(!E.valid){console.error(`Could not create a project called ${(0,qe.red)(`"${w}"`)} because of npm naming restrictions:`);E.problems.forEach((t=>console.error(` ${(0,qe.red)((0,qe.bold)("*"))} ${t}`)));process.exit(1)}if(Ma.example===true){console.error("Please provide an example name or url, otherwise remove the example option.");process.exit(1)}if((0,Ve.existsSync)(b)&&!isFolderEmpty(b,w)){process.exit(1)}const $=typeof Ma.example==="string"&&Ma.example.trim();const R=v.get("preferences")||{};const O=u().isCI||Ma.yes;if(!$){const t={eslint:true,prettier:true,git:true,install:true,versionCheck:true,empty:false,zudoku:false};const getPrefOrDefault=u=>{var p;return(p=R[u])!==null&&p!==void 0?p:t[u]};if(!Ma.eslint&&!ja.includes("--no-eslint")){if(O){Ma.eslint=getPrefOrDefault("eslint")}else{const t=(0,qe.blue)("ESLint");const{eslint:u}=await Ke()({onState:onPromptState,type:"toggle",name:"eslint",message:`Would you like to use ${t}?`,initial:getPrefOrDefault("eslint"),active:"Yes",inactive:"No"});Ma.eslint=Boolean(u);R.eslint=Boolean(u)}}if(!Ma.prettier&&!ja.includes("--no-prettier")){if(O){Ma.prettier=getPrefOrDefault("prettier")}else{const t=(0,qe.blue)("Prettier");const{prettier:u}=await Ke()({onState:onPromptState,type:"toggle",name:"prettier",message:`Would you like to use ${t}?`,initial:getPrefOrDefault("prettier"),active:"Yes",inactive:"No"});Ma.prettier=Boolean(u);R.prettier=Boolean(u)}}}Ma.git=(t=Ma.git)!==null&&t!==void 0?t:!ja.includes("--no-git");Ma.install=(p=Ma.install)!==null&&p!==void 0?p:!ja.includes("--no-install");Ma.versionCheck=(m=Ma.versionCheck)!==null&&m!==void 0?m:!ja.includes("--no-version-check");try{await createApp({appPath:b,packageManager:Fa,example:$&&$!=="default"?$:undefined,examplePath:Ma.examplePath,eslint:Ma.eslint,prettier:Ma.prettier,installPackages:Ma.install,empty:Ma.empty,initGit:Ma.git,verbose:Ma.verbose,zuploVersion:Da.version,runInit:(g=Ma.init)!==null&&g!==void 0?g:false,skipPrompts:O})}catch(t){if(!(t instanceof DownloadError)){throw t}const u=await Ke()({onState:onPromptState,type:"confirm",name:"builtin",message:`Could not download "${$}" because of a connectivity issue between your machine and GitHub.\n`+`Do you want to use the default template instead?`,initial:true});if(!u.builtin){throw t}await createApp({appPath:b,packageManager:Fa,eslint:Ma.eslint,prettier:Ma.prettier,installPackages:Ma.install,empty:Ma.empty,initGit:Ma.git,verbose:Ma.verbose,zuploVersion:Da.version,runInit:(y=Ma.init)!==null&&y!==void 0?y:false,skipPrompts:O})}v.set("preferences",R);if(Ma.versionCheck){console.log();await notifyUpdate()}}const Ua=Ze()(Da).catch((()=>null));async function notifyUpdate(){var t;try{if((t=await Ua)===null||t===void 0?void 0:t.latest){const t={npm:"npm i -g",yarn:"yarn global add",pnpm:"pnpm add -g",bun:"bun add -g"};const u=`${t[Fa]} create-zuplo-api`;console.log((0,qe.yellow)((0,qe.bold)("A new version of `create-zuplo-api` is available!"))+"\n"+"You can update by running: "+(0,qe.cyan)(u)+"\n")}process.exit(0)}catch{}}async function exit(t){console.log();console.log("Aborting installation.");if(t.command){console.log(` ${(0,qe.cyan)(t.command)} has failed.`)}else{console.log(`${(0,qe.red)("Unexpected error. Please report it as a bug:")}\n`,t)}process.exit(1)}run().catch(exit)})();module.exports=p})();
|