@crossdelta/platform-sdk 0.3.6 → 0.3.8
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/bin/cli.js
CHANGED
|
@@ -114,11 +114,11 @@ Expecting `+J.join(", ")+", got '"+(this.terminals_[C]||C)+"'":w="Parse error on
|
|
|
114
114
|
}
|
|
115
115
|
`.trim()},blockValue:function(e){var r=this.aliasable("container.hooks.blockHelperMissing"),n=[this.contextName(0)];this.setupHelperArgs(e,0,n);var i=this.popStack();n.splice(1,0,i),this.push(this.source.functionCall(r,"call",n))},ambiguousBlockValue:function(){var e=this.aliasable("container.hooks.blockHelperMissing"),r=[this.contextName(0)];this.setupHelperArgs("",0,r,!0),this.flushInline();var n=this.topStack();r.splice(1,0,n),this.pushSource(["if (!",this.lastHelper,") { ",n," = ",this.source.functionCall(e,"call",r),"}"])},appendContent:function(e){this.pendingContent?e=this.pendingContent+e:this.pendingLocation=this.source.currentLocation,this.pendingContent=e},append:function(){if(this.isInline())this.replaceStack(function(r){return[" != null ? ",r,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var e=this.popStack();this.pushSource(["if (",e," != null) { ",this.appendToBuffer(e,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(e){this.lastContext=e},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(e,r,n,i){var s=0;!i&&this.options.compat&&!this.lastContext?this.push(this.depthedLookup(e[s++])):this.pushContext(),this.resolvePath("context",e,s,r,n)},lookupBlockParam:function(e,r){this.useBlockParams=!0,this.push(["blockParams[",e[0],"][",e[1],"]"]),this.resolvePath("context",r,1)},lookupData:function(e,r,n){e?this.pushStackLiteral("container.data(data, "+e+")"):this.pushStackLiteral("data"),this.resolvePath("data",r,0,!0,n)},resolvePath:function(e,r,n,i,s){var o=this;if(this.options.strict||this.options.assumeObjects){this.push(iae(this.options.strict&&s,this,r,n,e));return}for(var a=r.length;n<a;n++)this.replaceStack(function(u){var c=o.nameLookup(u,r[n],e);return i?[" && ",c]:[" != null ? ",c," : ",u]})},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(e,r){this.pushContext(),this.pushString(r),r!=="SubExpression"&&(typeof e=="string"?this.pushString(e):this.pushStackLiteral(e))},emptyHash:function(e){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(e?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function(){var e=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(e.ids)),this.stringParams&&(this.push(this.objectLiteral(e.contexts)),this.push(this.objectLiteral(e.types))),this.push(this.objectLiteral(e.values))},pushString:function(e){this.pushStackLiteral(this.quotedString(e))},pushLiteral:function(e){this.pushStackLiteral(e)},pushProgram:function(e){e!=null?this.pushStackLiteral(this.programExpression(e)):this.pushStackLiteral(null)},registerDecorator:function(e,r){var n=this.nameLookup("decorators",r,"decorator"),i=this.setupHelperArgs(r,e);this.decorators.push(["fn = ",this.decorators.functionCall(n,"",["fn","props","container",i])," || fn;"])},invokeHelper:function(e,r,n){var i=this.popStack(),s=this.setupHelper(e,r),o=[];n&&o.push(s.name),o.push(i),this.options.strict||o.push(this.aliasable("container.hooks.helperMissing"));var a=["(",this.itemsSeparatedBy(o,"||"),")"],u=this.source.functionCall(a,"call",s.callParams);this.push(u)},itemsSeparatedBy:function(e,r){var n=[];n.push(e[0]);for(var i=1;i<e.length;i++)n.push(r,e[i]);return n},invokeKnownHelper:function(e,r){var n=this.setupHelper(e,r);this.push(this.source.functionCall(n.name,"call",n.callParams))},invokeAmbiguous:function(e,r){this.useRegister("helper");var n=this.popStack();this.emptyHash();var i=this.setupHelper(0,e,r),s=this.lastHelper=this.nameLookup("helpers",e,"helper"),o=["(","(helper = ",s," || ",n,")"];this.options.strict||(o[0]="(helper = ",o.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"))),this.push(["(",o,i.paramsInit?["),(",i.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",i.callParams)," : helper))"])},invokePartial:function(e,r,n){var i=[],s=this.setupParams(r,1,i);e&&(r=this.popStack(),delete s.name),n&&(s.indent=JSON.stringify(n)),s.helpers="helpers",s.partials="partials",s.decorators="container.decorators",e?i.unshift(r):i.unshift(this.nameLookup("partials",r,"partial")),this.options.compat&&(s.depths="depths"),s=this.objectLiteral(s),i.push(s),this.push(this.source.functionCall("container.invokePartial","",i))},assignToHash:function(e){var r=this.popStack(),n=void 0,i=void 0,s=void 0;this.trackIds&&(s=this.popStack()),this.stringParams&&(i=this.popStack(),n=this.popStack());var o=this.hash;n&&(o.contexts[e]=n),i&&(o.types[e]=i),s&&(o.ids[e]=s),o.values[e]=r},pushId:function(e,r,n){e==="BlockParam"?this.pushStackLiteral("blockParams["+r[0]+"].path["+r[1]+"]"+(n?" + "+JSON.stringify("."+n):"")):e==="PathExpression"?this.pushString(r):e==="SubExpression"?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:Ka,compileChildren:function(e,r){for(var n=e.children,i=void 0,s=void 0,o=0,a=n.length;o<a;o++){i=n[o],s=new this.compiler;var u=this.matchExistingProgram(i);if(u==null){this.context.programs.push("");var c=this.context.programs.length;i.index=c,i.name="program"+c,this.context.programs[c]=s.compile(i,r,this.context,!this.precompile),this.context.decorators[c]=s.decorators,this.context.environments[c]=i,this.useDepths=this.useDepths||s.useDepths,this.useBlockParams=this.useBlockParams||s.useBlockParams,i.useDepths=this.useDepths,i.useBlockParams=this.useBlockParams}else i.index=u.index,i.name="program"+u.index,this.useDepths=this.useDepths||u.useDepths,this.useBlockParams=this.useBlockParams||u.useBlockParams}},matchExistingProgram:function(e){for(var r=0,n=this.context.environments.length;r<n;r++){var i=this.context.environments[r];if(i&&i.equals(e))return i}},programExpression:function(e){var r=this.environment.children[e],n=[r.index,"data",r.blockParams];return(this.useBlockParams||this.useDepths)&&n.push("blockParams"),this.useDepths&&n.push("depths"),"container.program("+n.join(", ")+")"},useRegister:function(e){this.registers[e]||(this.registers[e]=!0,this.registers.list.push(e))},push:function(e){return e instanceof za||(e=this.source.wrap(e)),this.inlineStack.push(e),e},pushStackLiteral:function(e){this.push(new za(e))},pushSource:function(e){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),e&&this.source.push(e)},replaceStack:function(e){var r=["("],n=void 0,i=void 0,s=void 0;if(!this.isInline())throw new Fb.default("replaceStack on non-inline");var o=this.popStack(!0);if(o instanceof za)n=[o.value],r=["(",n],s=!0;else{i=!0;var a=this.incrStack();r=["((",this.push(a)," = ",o,")"],n=this.topStack()}var u=e.call(this,n);s||this.popStack(),i&&this.stackSlot--,this.push(r.concat(u,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var e=this.inlineStack;this.inlineStack=[];for(var r=0,n=e.length;r<n;r++){var i=e[r];if(i instanceof za)this.compileStack.push(i);else{var s=this.incrStack();this.pushSource([s," = ",i,";"]),this.compileStack.push(s)}}},isInline:function(){return this.inlineStack.length},popStack:function(e){var r=this.isInline(),n=(r?this.inlineStack:this.compileStack).pop();if(!e&&n instanceof za)return n.value;if(!r){if(!this.stackSlot)throw new Fb.default("Invalid stack pop");this.stackSlot--}return n},topStack:function(){var e=this.isInline()?this.inlineStack:this.compileStack,r=e[e.length-1];return r instanceof za?r.value:r},contextName:function(e){return this.useDepths&&e?"depths["+e+"]":"depth"+e},quotedString:function(e){return this.source.quotedString(e)},objectLiteral:function(e){return this.source.objectLiteral(e)},aliasable:function(e){var r=this.aliases[e];return r?(r.referenceCount++,r):(r=this.aliases[e]=this.source.wrap(e),r.aliasable=!0,r.referenceCount=1,r)},setupHelper:function(e,r,n){var i=[],s=this.setupHelperArgs(r,e,i,n),o=this.nameLookup("helpers",r,"helper"),a=this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})");return{params:i,paramsInit:s,name:o,callParams:[a].concat(i)}},setupParams:function(e,r,n){var i={},s=[],o=[],a=[],u=!n,c=void 0;u&&(n=[]),i.name=this.quotedString(e),i.hash=this.popStack(),this.trackIds&&(i.hashIds=this.popStack()),this.stringParams&&(i.hashTypes=this.popStack(),i.hashContexts=this.popStack());var l=this.popStack(),f=this.popStack();(f||l)&&(i.fn=f||"container.noop",i.inverse=l||"container.noop");for(var h=r;h--;)c=this.popStack(),n[h]=c,this.trackIds&&(a[h]=this.popStack()),this.stringParams&&(o[h]=this.popStack(),s[h]=this.popStack());return u&&(i.args=this.source.generateArray(n)),this.trackIds&&(i.ids=this.source.generateArray(a)),this.stringParams&&(i.types=this.source.generateArray(o),i.contexts=this.source.generateArray(s)),this.options.data&&(i.data="data"),this.useBlockParams&&(i.blockParams="blockParams"),i},setupHelperArgs:function(e,r,n,i){var s=this.setupParams(e,r,n);return s.loc=JSON.stringify(this.source.currentLocation),s=this.objectLiteral(s),i?(this.useRegister("options"),n.push("options"),["options=",s]):n?(n.push(s),""):s}};(function(){for(var t="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),e=Ka.RESERVED_WORDS={},r=0,n=t.length;r<n;r++)e[t[r]]=!0})();Ka.isValidJavaScriptVariableName=function(t){return!Ka.RESERVED_WORDS[t]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(t)};function iae(t,e,r,n,i){var s=e.popStack(),o=r.length;for(t&&o--;n<o;n++)s=e.nameLookup(s,r[n],i);return t?[e.aliasable("container.strict"),"(",s,", ",e.quotedString(r[n]),", ",JSON.stringify(e.source.currentLocation)," )"]:s}Yd.default=Ka;WR.exports=Yd.default});var KR=g((Zd,zR)=>{"use strict";Zd.__esModule=!0;function ml(t){return t&&t.__esModule?t:{default:t}}var sae=YP(),oae=ml(sae),aae=Xy(),uae=ml(aae),Eb=uR(),Cb=hR(),cae=GR(),lae=ml(cae),fae=jd(),hae=ml(fae),dae=Ky(),pae=ml(dae),mae=oae.default.create;function VR(){var t=mae();return t.compile=function(e,r){return Cb.compile(e,r,t)},t.precompile=function(e,r){return Cb.precompile(e,r,t)},t.AST=uae.default,t.Compiler=Cb.Compiler,t.JavaScriptCompiler=lae.default,t.Parser=Eb.parser,t.parse=Eb.parse,t.parseWithoutProcessing=Eb.parseWithoutProcessing,t}var Ya=VR();Ya.create=VR;pae.default(Ya);Ya.Visitor=hae.default;Ya.default=Ya;Zd.default=Ya;zR.exports=Zd.default});var YR=g(Jd=>{"use strict";Jd.__esModule=!0;Jd.print=yae;Jd.PrintVisitor=Re;function Dae(t){return t&&t.__esModule?t:{default:t}}var gae=jd(),xae=Dae(gae);function yae(t){return new Re().accept(t)}function Re(){this.padding=0}Re.prototype=new xae.default;Re.prototype.pad=function(t){for(var e="",r=0,n=this.padding;r<n;r++)e+=" ";return e+=t+`
|
|
116
116
|
`,e};Re.prototype.Program=function(t){var e="",r=t.body,n=void 0,i=void 0;if(t.blockParams){var s="BLOCK PARAMS: [";for(n=0,i=t.blockParams.length;n<i;n++)s+=" "+t.blockParams[n];s+=" ]",e+=this.pad(s)}for(n=0,i=r.length;n<i;n++)e+=this.accept(r[n]);return this.padding--,e};Re.prototype.MustacheStatement=function(t){return this.pad("{{ "+this.SubExpression(t)+" }}")};Re.prototype.Decorator=function(t){return this.pad("{{ DIRECTIVE "+this.SubExpression(t)+" }}")};Re.prototype.BlockStatement=Re.prototype.DecoratorBlock=function(t){var e="";return e+=this.pad((t.type==="DecoratorBlock"?"DIRECTIVE ":"")+"BLOCK:"),this.padding++,e+=this.pad(this.SubExpression(t)),t.program&&(e+=this.pad("PROGRAM:"),this.padding++,e+=this.accept(t.program),this.padding--),t.inverse&&(t.program&&this.padding++,e+=this.pad("{{^}}"),this.padding++,e+=this.accept(t.inverse),this.padding--,t.program&&this.padding--),this.padding--,e};Re.prototype.PartialStatement=function(t){var e="PARTIAL:"+t.name.original;return t.params[0]&&(e+=" "+this.accept(t.params[0])),t.hash&&(e+=" "+this.accept(t.hash)),this.pad("{{> "+e+" }}")};Re.prototype.PartialBlockStatement=function(t){var e="PARTIAL BLOCK:"+t.name.original;return t.params[0]&&(e+=" "+this.accept(t.params[0])),t.hash&&(e+=" "+this.accept(t.hash)),e+=" "+this.pad("PROGRAM:"),this.padding++,e+=this.accept(t.program),this.padding--,this.pad("{{> "+e+" }}")};Re.prototype.ContentStatement=function(t){return this.pad("CONTENT[ '"+t.value+"' ]")};Re.prototype.CommentStatement=function(t){return this.pad("{{! '"+t.value+"' }}")};Re.prototype.SubExpression=function(t){for(var e=t.params,r=[],n=void 0,i=0,s=e.length;i<s;i++)r.push(this.accept(e[i]));return e="["+r.join(", ")+"]",n=t.hash?" "+this.accept(t.hash):"",this.accept(t.path)+" "+e+n};Re.prototype.PathExpression=function(t){var e=t.parts.join("/");return(t.data?"@":"")+"PATH:"+e};Re.prototype.StringLiteral=function(t){return'"'+t.value+'"'};Re.prototype.NumberLiteral=function(t){return"NUMBER{"+t.value+"}"};Re.prototype.BooleanLiteral=function(t){return"BOOLEAN{"+t.value+"}"};Re.prototype.UndefinedLiteral=function(){return"UNDEFINED"};Re.prototype.NullLiteral=function(){return"NULL"};Re.prototype.Hash=function(t){for(var e=t.pairs,r=[],n=0,i=e.length;n<i;n++)r.push(this.accept(e[n]));return"HASH{"+r.join(", ")+"}"};Re.prototype.HashPair=function(t){return t.key+"="+this.accept(t.value)}});var Qd=g((b7e,XR)=>{var Xd=KR().default,JR=YR();Xd.PrintVisitor=JR.PrintVisitor;Xd.print=JR.print;XR.exports=Xd;function ZR(t,e){var r=require("fs"),n=r.readFileSync(e,"utf8");t.exports=Xd.compile(n)}typeof require<"u"&&require.extensions&&(require.extensions[".handlebars"]=ZR,require.extensions[".hbs"]=ZR)});var LI=g(Ja=>{"use strict";Object.defineProperty(Ja,"__esModule",{value:!0});Ja.splitWhen=Ja.flatten=void 0;function Kae(t){return t.reduce((e,r)=>[].concat(e,r),[])}Ja.flatten=Kae;function Yae(t,e){let r=[[]],n=0;for(let i of t)e(i)?(n++,r[n]=[]):r[n].push(i);return r}Ja.splitWhen=Yae});var NI=g(cp=>{"use strict";Object.defineProperty(cp,"__esModule",{value:!0});cp.isEnoentCodeError=void 0;function Zae(t){return t.code==="ENOENT"}cp.isEnoentCodeError=Zae});var $I=g(lp=>{"use strict";Object.defineProperty(lp,"__esModule",{value:!0});lp.createDirentFromStats=void 0;var Tb=class{constructor(e,r){this.name=e,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function Jae(t,e){return new Tb(t,e)}lp.createDirentFromStats=Jae});var HI=g(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.convertPosixPathToPattern=We.convertWindowsPathToPattern=We.convertPathToPattern=We.escapePosixPath=We.escapeWindowsPath=We.escape=We.removeLeadingDotSegment=We.makeAbsolute=We.unixify=void 0;var Xae=require("os"),Qae=require("path"),jI=Xae.platform()==="win32",eue=2,tue=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,rue=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,nue=/^\\\\([.?])/,iue=/\\(?![!()+@[\]{}])/g;function sue(t){return t.replace(/\\/g,"/")}We.unixify=sue;function oue(t,e){return Qae.resolve(t,e)}We.makeAbsolute=oue;function aue(t){if(t.charAt(0)==="."){let e=t.charAt(1);if(e==="/"||e==="\\")return t.slice(eue)}return t}We.removeLeadingDotSegment=aue;We.escape=jI?kb:Ob;function kb(t){return t.replace(rue,"\\$2")}We.escapeWindowsPath=kb;function Ob(t){return t.replace(tue,"\\$2")}We.escapePosixPath=Ob;We.convertPathToPattern=jI?UI:qI;function UI(t){return kb(t).replace(nue,"//$1").replace(iue,"/")}We.convertWindowsPathToPattern=UI;function qI(t){return Ob(t)}We.convertPosixPathToPattern=qI});var GI=g((m9e,WI)=>{WI.exports=function(e){if(typeof e!="string"||e==="")return!1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(r[2])return!0;e=e.slice(r.index+r[0].length)}return!1}});var KI=g((D9e,zI)=>{var uue=GI(),VI={"{":"}","(":")","[":"]"},cue=function(t){if(t[0]==="!")return!0;for(var e=0,r=-2,n=-2,i=-2,s=-2,o=-2;e<t.length;){if(t[e]==="*"||t[e+1]==="?"&&/[\].+)]/.test(t[e])||n!==-1&&t[e]==="["&&t[e+1]!=="]"&&(n<e&&(n=t.indexOf("]",e)),n>e&&(o===-1||o>n||(o=t.indexOf("\\",e),o===-1||o>n)))||i!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(i=t.indexOf("}",e),i>e&&(o=t.indexOf("\\",e),o===-1||o>i))||s!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(s=t.indexOf(")",e),s>e&&(o=t.indexOf("\\",e),o===-1||o>s))||r!==-1&&t[e]==="("&&t[e+1]!=="|"&&(r<e&&(r=t.indexOf("|",e)),r!==-1&&t[r+1]!==")"&&(s=t.indexOf(")",r),s>r&&(o=t.indexOf("\\",r),o===-1||o>s))))return!0;if(t[e]==="\\"){var a=t[e+1];e+=2;var u=VI[a];if(u){var c=t.indexOf(u,e);c!==-1&&(e=c+1)}if(t[e]==="!")return!0}else e++}return!1},lue=function(t){if(t[0]==="!")return!0;for(var e=0;e<t.length;){if(/[*?{}()[\]]/.test(t[e]))return!0;if(t[e]==="\\"){var r=t[e+1];e+=2;var n=VI[r];if(n){var i=t.indexOf(n,e);i!==-1&&(e=i+1)}if(t[e]==="!")return!0}else e++}return!1};zI.exports=function(e,r){if(typeof e!="string"||e==="")return!1;if(uue(e))return!0;var n=cue;return r&&r.strict===!1&&(n=lue),n(e)}});var ZI=g((g9e,YI)=>{"use strict";var fue=KI(),hue=require("path").posix.dirname,due=require("os").platform()==="win32",Pb="/",pue=/\\/g,mue=/[\{\[].*[\}\]]$/,Due=/(^|[^\\])([\{\[]|\([^\)]+$)/,gue=/\\([\!\*\?\|\[\]\(\)\{\}])/g;YI.exports=function(e,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&due&&e.indexOf(Pb)<0&&(e=e.replace(pue,Pb)),mue.test(e)&&(e+=Pb),e+="a";do e=hue(e);while(fue(e)||Due.test(e));return e.replace(gue,"$1")}});var fp=g(vr=>{"use strict";vr.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;vr.find=(t,e)=>t.nodes.find(r=>r.type===e);vr.exceedsLimit=(t,e,r=1,n)=>n===!1||!vr.isInteger(t)||!vr.isInteger(e)?!1:(Number(e)-Number(t))/Number(r)>=n;vr.escapeNode=(t,e=0,r)=>{let n=t.nodes[e];n&&(r&&n.type===r||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)};vr.encloseBrace=t=>t.type!=="brace"?!1:t.commas>>0+t.ranges>>0===0?(t.invalid=!0,!0):!1;vr.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:t.commas>>0+t.ranges>>0===0||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1;vr.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0;vr.reduce=t=>t.reduce((e,r)=>(r.type==="text"&&e.push(r.value),r.type==="range"&&(r.type="text"),e),[]);vr.flatten=(...t)=>{let e=[],r=n=>{for(let i=0;i<n.length;i++){let s=n[i];if(Array.isArray(s)){r(s);continue}s!==void 0&&e.push(s)}return e};return r(t),e}});var hp=g((y9e,XI)=>{"use strict";var JI=fp();XI.exports=(t,e={})=>{let r=(n,i={})=>{let s=e.escapeInvalid&&JI.isInvalidBrace(i),o=n.invalid===!0&&e.escapeInvalid===!0,a="";if(n.value)return(s||o)&&JI.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let u of n.nodes)a+=r(u);return a};return r(t)}});var eM=g((b9e,QI)=>{"use strict";QI.exports=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1}});var cM=g((F9e,uM)=>{"use strict";var tM=eM(),Ys=(t,e,r)=>{if(tM(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(tM(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...r};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let i=String(n.relaxZeros),s=String(n.shorthand),o=String(n.capture),a=String(n.wrap),u=t+":"+e+"="+i+s+o+a;if(Ys.cache.hasOwnProperty(u))return Ys.cache[u].result;let c=Math.min(t,e),l=Math.max(t,e);if(Math.abs(c-l)===1){let m=t+"|"+e;return n.capture?`(${m})`:n.wrap===!1?m:`(?:${m})`}let f=aM(t)||aM(e),h={min:t,max:e,a:c,b:l},d=[],p=[];if(f&&(h.isPadded=f,h.maxLen=String(h.max).length),c<0){let m=l<0?Math.abs(l):1;p=rM(m,Math.abs(c),h,n),c=h.a=0}return l>=0&&(d=rM(c,l,h,n)),h.negatives=p,h.positives=d,h.result=xue(p,d,n),n.capture===!0?h.result=`(${h.result})`:n.wrap!==!1&&d.length+p.length>1&&(h.result=`(?:${h.result})`),Ys.cache[u]=h,h.result};function xue(t,e,r){let n=Rb(t,e,"-",!1,r)||[],i=Rb(e,t,"",!1,r)||[],s=Rb(t,e,"-?",!0,r)||[];return n.concat(s).concat(i).join("|")}function yue(t,e){let r=1,n=1,i=iM(t,r),s=new Set([e]);for(;t<=i&&i<=e;)s.add(i),r+=1,i=iM(t,r);for(i=sM(e+1,n)-1;t<i&&i<=e;)s.add(i),n+=1,i=sM(e+1,n)-1;return s=[...s],s.sort(Eue),s}function bue(t,e,r){if(t===e)return{pattern:t,count:[],digits:0};let n=Fue(t,e),i=n.length,s="",o=0;for(let a=0;a<i;a++){let[u,c]=n[a];u===c?s+=u:u!=="0"||c!=="9"?s+=Cue(u,c,r):o++}return o&&(s+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:s,count:[o],digits:i}}function rM(t,e,r,n){let i=yue(t,e),s=[],o=t,a;for(let u=0;u<i.length;u++){let c=i[u],l=bue(String(o),String(c),n),f="";if(!r.isPadded&&a&&a.pattern===l.pattern){a.count.length>1&&a.count.pop(),a.count.push(l.count[0]),a.string=a.pattern+oM(a.count),o=c+1;continue}r.isPadded&&(f=wue(c,r,n)),l.string=f+l.pattern+oM(l.count),s.push(l),o=c+1,a=l}return s}function Rb(t,e,r,n,i){let s=[];for(let o of t){let{string:a}=o;!n&&!nM(e,"string",a)&&s.push(r+a),n&&nM(e,"string",a)&&s.push(r+a)}return s}function Fue(t,e){let r=[];for(let n=0;n<t.length;n++)r.push([t[n],e[n]]);return r}function Eue(t,e){return t>e?1:e>t?-1:0}function nM(t,e,r){return t.some(n=>n[e]===r)}function iM(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function sM(t,e){return t-t%Math.pow(10,e)}function oM(t){let[e=0,r=""]=t;return r||e>1?`{${e+(r?","+r:"")}}`:""}function Cue(t,e,r){return`[${t}${e-t===1?"":"-"}${e}]`}function aM(t){return/^-?(0+)\d/.test(t)}function wue(t,e,r){if(!e.isPadded)return t;let n=Math.abs(e.maxLen-String(t).length),i=r.relaxZeros!==!1;switch(n){case 0:return"";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:return i?`0{0,${n}}`:`0{${n}}`}}Ys.cache={};Ys.clearCache=()=>Ys.cache={};uM.exports=Ys});var Lb=g((E9e,DM)=>{"use strict";var Sue=require("util"),fM=cM(),lM=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),vue=t=>e=>t===!0?Number(e):String(e),Ib=t=>typeof t=="number"||typeof t=="string"&&t!=="",yl=t=>Number.isInteger(+t),Mb=t=>{let e=`${t}`,r=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++r]==="0";);return r>0},_ue=(t,e,r)=>typeof t=="string"||typeof e=="string"?!0:r.stringify===!0,Aue=(t,e,r)=>{if(e>0){let n=t[0]==="-"?"-":"";n&&(t=t.slice(1)),t=n+t.padStart(n?e-1:e,"0")}return r===!1?String(t):t},pp=(t,e)=>{let r=t[0]==="-"?"-":"";for(r&&(t=t.slice(1),e--);t.length<e;)t="0"+t;return r?"-"+t:t},Bue=(t,e,r)=>{t.negatives.sort((a,u)=>a<u?-1:a>u?1:0),t.positives.sort((a,u)=>a<u?-1:a>u?1:0);let n=e.capture?"":"?:",i="",s="",o;return t.positives.length&&(i=t.positives.map(a=>pp(String(a),r)).join("|")),t.negatives.length&&(s=`-(${n}${t.negatives.map(a=>pp(String(a),r)).join("|")})`),i&&s?o=`${i}|${s}`:o=i||s,e.wrap?`(${n}${o})`:o},hM=(t,e,r,n)=>{if(r)return fM(t,e,{wrap:!1,...n});let i=String.fromCharCode(t);if(t===e)return i;let s=String.fromCharCode(e);return`[${i}-${s}]`},dM=(t,e,r)=>{if(Array.isArray(t)){let n=r.wrap===!0,i=r.capture?"":"?:";return n?`(${i}${t.join("|")})`:t.join("|")}return fM(t,e,r)},pM=(...t)=>new RangeError("Invalid range arguments: "+Sue.inspect(...t)),mM=(t,e,r)=>{if(r.strictRanges===!0)throw pM([t,e]);return[]},Tue=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return[]},kue=(t,e,r=1,n={})=>{let i=Number(t),s=Number(e);if(!Number.isInteger(i)||!Number.isInteger(s)){if(n.strictRanges===!0)throw pM([t,e]);return[]}i===0&&(i=0),s===0&&(s=0);let o=i>s,a=String(t),u=String(e),c=String(r);r=Math.max(Math.abs(r),1);let l=Mb(a)||Mb(u)||Mb(c),f=l?Math.max(a.length,u.length,c.length):0,h=l===!1&&_ue(t,e,n)===!1,d=n.transform||vue(h);if(n.toRegex&&r===1)return hM(pp(t,f),pp(e,f),!0,n);let p={negatives:[],positives:[]},m=y=>p[y<0?"negatives":"positives"].push(Math.abs(y)),x=[],D=0;for(;o?i>=s:i<=s;)n.toRegex===!0&&r>1?m(i):x.push(Aue(d(i,D),f,h)),i=o?i-r:i+r,D++;return n.toRegex===!0?r>1?Bue(p,n,f):dM(x,null,{wrap:!1,...n}):x},Oue=(t,e,r=1,n={})=>{if(!yl(t)&&t.length>1||!yl(e)&&e.length>1)return mM(t,e,n);let i=n.transform||(h=>String.fromCharCode(h)),s=`${t}`.charCodeAt(0),o=`${e}`.charCodeAt(0),a=s>o,u=Math.min(s,o),c=Math.max(s,o);if(n.toRegex&&r===1)return hM(u,c,!1,n);let l=[],f=0;for(;a?s>=o:s<=o;)l.push(i(s,f)),s=a?s-r:s+r,f++;return n.toRegex===!0?dM(l,null,{wrap:!1,options:n}):l},dp=(t,e,r,n={})=>{if(e==null&&Ib(t))return[t];if(!Ib(t)||!Ib(e))return mM(t,e,n);if(typeof r=="function")return dp(t,e,1,{transform:r});if(lM(r))return dp(t,e,0,r);let i={...n};return i.capture===!0&&(i.wrap=!0),r=r||i.step||1,yl(r)?yl(t)&&yl(e)?kue(t,e,r,i):Oue(t,e,Math.max(Math.abs(r),1),i):r!=null&&!lM(r)?Tue(r,i):dp(t,e,1,r)};DM.exports=dp});var yM=g((C9e,xM)=>{"use strict";var Pue=Lb(),gM=fp(),Rue=(t,e={})=>{let r=(n,i={})=>{let s=gM.isInvalidBrace(i),o=n.invalid===!0&&e.escapeInvalid===!0,a=s===!0||o===!0,u=e.escapeInvalid===!0?"\\":"",c="";if(n.isOpen===!0)return u+n.value;if(n.isClose===!0)return console.log("node.isClose",u,n.value),u+n.value;if(n.type==="open")return a?u+n.value:"(";if(n.type==="close")return a?u+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":a?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let l=gM.reduce(n.nodes),f=Pue(...l,{...e,wrap:!1,toRegex:!0,strictZeros:!0});if(f.length!==0)return l.length>1&&f.length>1?`(${f})`:f}if(n.nodes)for(let l of n.nodes)c+=r(l,n);return c};return r(t)};xM.exports=Rue});var EM=g((w9e,FM)=>{"use strict";var Iue=Lb(),bM=hp(),Xa=fp(),Zs=(t="",e="",r=!1)=>{let n=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return r?Xa.flatten(e).map(i=>`{${i}}`):e;for(let i of t)if(Array.isArray(i))for(let s of i)n.push(Zs(s,e,r));else for(let s of e)r===!0&&typeof s=="string"&&(s=`{${s}}`),n.push(Array.isArray(s)?Zs(i,s,r):i+s);return Xa.flatten(n)},Mue=(t,e={})=>{let r=e.rangeLimit===void 0?1e3:e.rangeLimit,n=(i,s={})=>{i.queue=[];let o=s,a=s.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,a=o.queue;if(i.invalid||i.dollar){a.push(Zs(a.pop(),bM(i,e)));return}if(i.type==="brace"&&i.invalid!==!0&&i.nodes.length===2){a.push(Zs(a.pop(),["{}"]));return}if(i.nodes&&i.ranges>0){let f=Xa.reduce(i.nodes);if(Xa.exceedsLimit(...f,e.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let h=Iue(...f,e);h.length===0&&(h=bM(i,e)),a.push(Zs(a.pop(),h)),i.nodes=[];return}let u=Xa.encloseBrace(i),c=i.queue,l=i;for(;l.type!=="brace"&&l.type!=="root"&&l.parent;)l=l.parent,c=l.queue;for(let f=0;f<i.nodes.length;f++){let h=i.nodes[f];if(h.type==="comma"&&i.type==="brace"){f===1&&c.push(""),c.push("");continue}if(h.type==="close"){a.push(Zs(a.pop(),c,u));continue}if(h.value&&h.type!=="open"){c.push(Zs(c.pop(),h.value));continue}h.nodes&&n(h,i)}return c};return Xa.flatten(n(t))};FM.exports=Mue});var wM=g((S9e,CM)=>{"use strict";CM.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
|
|
117
|
-
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var BM=g((v9e,AM)=>{"use strict";var Lue=hp(),{MAX_LENGTH:SM,CHAR_BACKSLASH:Nb,CHAR_BACKTICK:Nue,CHAR_COMMA:$ue,CHAR_DOT:jue,CHAR_LEFT_PARENTHESES:Uue,CHAR_RIGHT_PARENTHESES:que,CHAR_LEFT_CURLY_BRACE:Hue,CHAR_RIGHT_CURLY_BRACE:Wue,CHAR_LEFT_SQUARE_BRACKET:vM,CHAR_RIGHT_SQUARE_BRACKET:_M,CHAR_DOUBLE_QUOTE:Gue,CHAR_SINGLE_QUOTE:Vue,CHAR_NO_BREAK_SPACE:zue,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Kue}=wM(),Yue=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},n=typeof r.maxLength=="number"?Math.min(SM,r.maxLength):SM;if(t.length>n)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${n})`);let i={type:"root",input:t,nodes:[]},s=[i],o=i,a=i,u=0,c=t.length,l=0,f=0,h,d=()=>t[l++],p=m=>{if(m.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&m.type==="text"){a.value+=m.value;return}return o.nodes.push(m),m.parent=o,m.prev=a,a=m,m};for(p({type:"bos"});l<c;)if(o=s[s.length-1],h=d(),!(h===Kue||h===zue)){if(h===Nb){p({type:"text",value:(e.keepEscaping?h:"")+d()});continue}if(h===_M){p({type:"text",value:"\\"+h});continue}if(h===vM){u++;let m;for(;l<c&&(m=d());){if(h+=m,m===vM){u++;continue}if(m===Nb){h+=d();continue}if(m===_M&&(u--,u===0))break}p({type:"text",value:h});continue}if(h===Uue){o=p({type:"paren",nodes:[]}),s.push(o),p({type:"text",value:h});continue}if(h===que){if(o.type!=="paren"){p({type:"text",value:h});continue}o=s.pop(),p({type:"text",value:h}),o=s[s.length-1];continue}if(h===Gue||h===Vue||h===Nue){let m=h,x;for(e.keepQuotes!==!0&&(h="");l<c&&(x=d());){if(x===Nb){h+=x+d();continue}if(x===m){e.keepQuotes===!0&&(h+=x);break}h+=x}p({type:"text",value:h});continue}if(h===Hue){f++;let x={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||o.dollar===!0,depth:f,commas:0,ranges:0,nodes:[]};o=p(x),s.push(o),p({type:"open",value:h});continue}if(h===Wue){if(o.type!=="brace"){p({type:"text",value:h});continue}let m="close";o=s.pop(),o.close=!0,p({type:m,value:h}),f--,o=s[s.length-1];continue}if(h===$ue&&f>0){if(o.ranges>0){o.ranges=0;let m=o.nodes.shift();o.nodes=[m,{type:"text",value:Lue(o)}]}p({type:"comma",value:h}),o.commas++;continue}if(h===jue&&f>0&&o.commas===0){let m=o.nodes;if(f===0||m.length===0){p({type:"text",value:h});continue}if(a.type==="dot"){if(o.range=[],a.value+=h,a.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,a.type="text";continue}o.ranges++,o.args=[];continue}if(a.type==="range"){m.pop();let x=m[m.length-1];x.value+=a.value+h,a=x,o.ranges--;continue}p({type:"dot",value:h});continue}p({type:"text",value:h})}do if(o=s.pop(),o.type!=="root"){o.nodes.forEach(D=>{D.nodes||(D.type==="open"&&(D.isOpen=!0),D.type==="close"&&(D.isClose=!0),D.nodes||(D.type="text"),D.invalid=!0)});let m=s[s.length-1],x=m.nodes.indexOf(o);m.nodes.splice(x,1,...o.nodes)}while(s.length>0);return p({type:"eos"}),i};AM.exports=Yue});var OM=g((_9e,kM)=>{"use strict";var TM=hp(),Zue=yM(),Jue=EM(),Xue=BM(),Qt=(t,e={})=>{let r=[];if(Array.isArray(t))for(let n of t){let i=Qt.create(n,e);Array.isArray(i)?r.push(...i):r.push(i)}else r=[].concat(Qt.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};Qt.parse=(t,e={})=>Xue(t,e);Qt.stringify=(t,e={})=>TM(typeof t=="string"?Qt.parse(t,e):t,e);Qt.compile=(t,e={})=>(typeof t=="string"&&(t=Qt.parse(t,e)),Zue(t,e));Qt.expand=(t,e={})=>{typeof t=="string"&&(t=Qt.parse(t,e));let r=Jue(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};Qt.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?Qt.compile(t,e):Qt.expand(t,e);kM.exports=Qt});var bl=g((A9e,LM)=>{"use strict";var Que=require("path"),Fn="\\\\/",PM=`[^${Fn}]`,Jn="\\.",ece="\\+",tce="\\?",mp="\\/",rce="(?=.)",RM="[^/]",$b=`(?:${mp}|$)`,IM=`(?:^|${mp})`,jb=`${Jn}{1,2}${$b}`,nce=`(?!${Jn})`,ice=`(?!${IM}${jb})`,sce=`(?!${Jn}{0,1}${$b})`,oce=`(?!${jb})`,ace=`[^.${mp}]`,uce=`${RM}*?`,MM={DOT_LITERAL:Jn,PLUS_LITERAL:ece,QMARK_LITERAL:tce,SLASH_LITERAL:mp,ONE_CHAR:rce,QMARK:RM,END_ANCHOR:$b,DOTS_SLASH:jb,NO_DOT:nce,NO_DOTS:ice,NO_DOT_SLASH:sce,NO_DOTS_SLASH:oce,QMARK_NO_DOT:ace,STAR:uce,START_ANCHOR:IM},cce={...MM,SLASH_LITERAL:`[${Fn}]`,QMARK:PM,STAR:`${PM}*?`,DOTS_SLASH:`${Jn}{1,2}(?:[${Fn}]|$)`,NO_DOT:`(?!${Jn})`,NO_DOTS:`(?!(?:^|[${Fn}])${Jn}{1,2}(?:[${Fn}]|$))`,NO_DOT_SLASH:`(?!${Jn}{0,1}(?:[${Fn}]|$))`,NO_DOTS_SLASH:`(?!${Jn}{1,2}(?:[${Fn}]|$))`,QMARK_NO_DOT:`[^.${Fn}]`,START_ANCHOR:`(?:^|[${Fn}])`,END_ANCHOR:`(?:[${Fn}]|$)`},lce={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};LM.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:lce,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:Que.sep,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?cce:MM}}});var Fl=g(Ht=>{"use strict";var fce=require("path"),hce=process.platform==="win32",{REGEX_BACKSLASH:dce,REGEX_REMOVE_BACKSLASH:pce,REGEX_SPECIAL_CHARS:mce,REGEX_SPECIAL_CHARS_GLOBAL:Dce}=bl();Ht.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Ht.hasRegexChars=t=>mce.test(t);Ht.isRegexChar=t=>t.length===1&&Ht.hasRegexChars(t);Ht.escapeRegex=t=>t.replace(Dce,"\\$1");Ht.toPosixSlashes=t=>t.replace(dce,"/");Ht.removeBackslashes=t=>t.replace(pce,e=>e==="\\"?"":e);Ht.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};Ht.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:hce===!0||fce.sep==="\\";Ht.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?Ht.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};Ht.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};Ht.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",s=`${n}(?:${t})${i}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s}});var GM=g((T9e,WM)=>{"use strict";var NM=Fl(),{CHAR_ASTERISK:Ub,CHAR_AT:gce,CHAR_BACKWARD_SLASH:El,CHAR_COMMA:xce,CHAR_DOT:qb,CHAR_EXCLAMATION_MARK:Hb,CHAR_FORWARD_SLASH:HM,CHAR_LEFT_CURLY_BRACE:Wb,CHAR_LEFT_PARENTHESES:Gb,CHAR_LEFT_SQUARE_BRACKET:yce,CHAR_PLUS:bce,CHAR_QUESTION_MARK:$M,CHAR_RIGHT_CURLY_BRACE:Fce,CHAR_RIGHT_PARENTHESES:jM,CHAR_RIGHT_SQUARE_BRACKET:Ece}=bl(),UM=t=>t===HM||t===El,qM=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},Cce=(t,e)=>{let r=e||{},n=t.length-1,i=r.parts===!0||r.scanToEnd===!0,s=[],o=[],a=[],u=t,c=-1,l=0,f=0,h=!1,d=!1,p=!1,m=!1,x=!1,D=!1,y=!1,b=!1,C=!1,_=!1,T=0,B,O,v={value:"",depth:0,isGlob:!1},A=()=>c>=n,F=()=>u.charCodeAt(c+1),I=()=>(B=O,u.charCodeAt(++c));for(;c<n;){O=I();let X;if(O===El){y=v.backslashes=!0,O=I(),O===Wb&&(D=!0);continue}if(D===!0||O===Wb){for(T++;A()!==!0&&(O=I());){if(O===El){y=v.backslashes=!0,I();continue}if(O===Wb){T++;continue}if(D!==!0&&O===qb&&(O=I())===qb){if(h=v.isBrace=!0,p=v.isGlob=!0,_=!0,i===!0)continue;break}if(D!==!0&&O===xce){if(h=v.isBrace=!0,p=v.isGlob=!0,_=!0,i===!0)continue;break}if(O===Fce&&(T--,T===0)){D=!1,h=v.isBrace=!0,_=!0;break}}if(i===!0)continue;break}if(O===HM){if(s.push(c),o.push(v),v={value:"",depth:0,isGlob:!1},_===!0)continue;if(B===qb&&c===l+1){l+=2;continue}f=c+1;continue}if(r.noext!==!0&&(O===bce||O===gce||O===Ub||O===$M||O===Hb)===!0&&F()===Gb){if(p=v.isGlob=!0,m=v.isExtglob=!0,_=!0,O===Hb&&c===l&&(C=!0),i===!0){for(;A()!==!0&&(O=I());){if(O===El){y=v.backslashes=!0,O=I();continue}if(O===jM){p=v.isGlob=!0,_=!0;break}}continue}break}if(O===Ub){if(B===Ub&&(x=v.isGlobstar=!0),p=v.isGlob=!0,_=!0,i===!0)continue;break}if(O===$M){if(p=v.isGlob=!0,_=!0,i===!0)continue;break}if(O===yce){for(;A()!==!0&&(X=I());){if(X===El){y=v.backslashes=!0,I();continue}if(X===Ece){d=v.isBracket=!0,p=v.isGlob=!0,_=!0;break}}if(i===!0)continue;break}if(r.nonegate!==!0&&O===Hb&&c===l){b=v.negated=!0,l++;continue}if(r.noparen!==!0&&O===Gb){if(p=v.isGlob=!0,i===!0){for(;A()!==!0&&(O=I());){if(O===Gb){y=v.backslashes=!0,O=I();continue}if(O===jM){_=!0;break}}continue}break}if(p===!0){if(_=!0,i===!0)continue;break}}r.noext===!0&&(m=!1,p=!1);let $=u,J="",w="";l>0&&(J=u.slice(0,l),u=u.slice(l),f-=l),$&&p===!0&&f>0?($=u.slice(0,f),w=u.slice(f)):p===!0?($="",w=u):$=u,$&&$!==""&&$!=="/"&&$!==u&&UM($.charCodeAt($.length-1))&&($=$.slice(0,-1)),r.unescape===!0&&(w&&(w=NM.removeBackslashes(w)),$&&y===!0&&($=NM.removeBackslashes($)));let S={prefix:J,input:t,start:l,base:$,glob:w,isBrace:h,isBracket:d,isGlob:p,isExtglob:m,isGlobstar:x,negated:b,negatedExtglob:C};if(r.tokens===!0&&(S.maxDepth=0,UM(O)||o.push(v),S.tokens=o),r.parts===!0||r.tokens===!0){let X;for(let V=0;V<s.length;V++){let le=X?X+1:l,Br=s[V],Wt=t.slice(le,Br);r.tokens&&(V===0&&l!==0?(o[V].isPrefix=!0,o[V].value=J):o[V].value=Wt,qM(o[V]),S.maxDepth+=o[V].depth),(V!==0||Wt!=="")&&a.push(Wt),X=Br}if(X&&X+1<t.length){let V=t.slice(X+1);a.push(V),r.tokens&&(o[o.length-1].value=V,qM(o[o.length-1]),S.maxDepth+=o[o.length-1].depth)}S.slashes=s,S.parts=a}return S};WM.exports=Cce});var KM=g((k9e,zM)=>{"use strict";var Dp=bl(),er=Fl(),{MAX_LENGTH:gp,POSIX_REGEX_SOURCE:wce,REGEX_NON_SPECIAL_CHARS:Sce,REGEX_SPECIAL_CHARS_BACKREF:vce,REPLACEMENTS:VM}=Dp,_ce=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(i=>er.escapeRegex(i)).join("..")}return r},Qa=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,Vb=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=VM[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(gp,r.maxLength):gp,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let s={type:"bos",value:"",output:r.prepend||""},o=[s],a=r.capture?"":"?:",u=er.isWindows(e),c=Dp.globChars(u),l=Dp.extglobChars(c),{DOT_LITERAL:f,PLUS_LITERAL:h,SLASH_LITERAL:d,ONE_CHAR:p,DOTS_SLASH:m,NO_DOT:x,NO_DOT_SLASH:D,NO_DOTS_SLASH:y,QMARK:b,QMARK_NO_DOT:C,STAR:_,START_ANCHOR:T}=c,B=N=>`(${a}(?:(?!${T}${N.dot?m:f}).)*?)`,O=r.dot?"":x,v=r.dot?b:C,A=r.bash===!0?B(r):_;r.capture&&(A=`(${A})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let F={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};t=er.removePrefix(t,F),i=t.length;let I=[],$=[],J=[],w=s,S,X=()=>F.index===i-1,V=F.peek=(N=1)=>t[F.index+N],le=F.advance=()=>t[++F.index]||"",Br=()=>t.slice(F.index+1),Wt=(N="",ye=0)=>{F.consumed+=N,F.index+=ye},vl=N=>{F.output+=N.output!=null?N.output:N.value,Wt(N.value)},E$=()=>{let N=1;for(;V()==="!"&&(V(2)!=="("||V(3)==="?");)le(),F.start++,N++;return N%2===0?!1:(F.negated=!0,F.start++,!0)},_l=N=>{F[N]++,J.push(N)},Gi=N=>{F[N]--,J.pop()},ue=N=>{if(w.type==="globstar"){let ye=F.braces>0&&(N.type==="comma"||N.type==="brace"),R=N.extglob===!0||I.length&&(N.type==="pipe"||N.type==="paren");N.type!=="slash"&&N.type!=="paren"&&!ye&&!R&&(F.output=F.output.slice(0,-w.output.length),w.type="star",w.value="*",w.output=A,F.output+=w.output)}if(I.length&&N.type!=="paren"&&(I[I.length-1].inner+=N.value),(N.value||N.output)&&vl(N),w&&w.type==="text"&&N.type==="text"){w.value+=N.value,w.output=(w.output||"")+N.value;return}N.prev=w,o.push(N),w=N},Al=(N,ye)=>{let R={...l[ye],conditions:1,inner:""};R.prev=w,R.parens=F.parens,R.output=F.output;let se=(r.capture?"(":"")+R.open;_l("parens"),ue({type:N,value:ye,output:F.output?"":p}),ue({type:"paren",extglob:!0,value:le(),output:se}),I.push(R)},C$=N=>{let ye=N.close+(r.capture?")":""),R;if(N.type==="negate"){let se=A;if(N.inner&&N.inner.length>1&&N.inner.includes("/")&&(se=B(r)),(se!==A||X()||/^\)+$/.test(Br()))&&(ye=N.close=`)$))${se}`),N.inner.includes("*")&&(R=Br())&&/^\.[^\\/.]+$/.test(R)){let Be=Vb(R,{...e,fastpaths:!1}).output;ye=N.close=`)${Be})${se})`}N.prev.type==="bos"&&(F.negatedExtglob=!0)}ue({type:"paren",extglob:!0,value:S,output:ye}),Gi("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let N=!1,ye=t.replace(vce,(R,se,Be,Et,Ge,Hp)=>Et==="\\"?(N=!0,R):Et==="?"?se?se+Et+(Ge?b.repeat(Ge.length):""):Hp===0?v+(Ge?b.repeat(Ge.length):""):b.repeat(Be.length):Et==="."?f.repeat(Be.length):Et==="*"?se?se+Et+(Ge?A:""):A:se?R:`\\${R}`);return N===!0&&(r.unescape===!0?ye=ye.replace(/\\/g,""):ye=ye.replace(/\\+/g,R=>R.length%2===0?"\\\\":R?"\\":"")),ye===t&&r.contains===!0?(F.output=t,F):(F.output=er.wrapOutput(ye,F,e),F)}for(;!X();){if(S=le(),S==="\0")continue;if(S==="\\"){let R=V();if(R==="/"&&r.bash!==!0||R==="."||R===";")continue;if(!R){S+="\\",ue({type:"text",value:S});continue}let se=/^\\+/.exec(Br()),Be=0;if(se&&se[0].length>2&&(Be=se[0].length,F.index+=Be,Be%2!==0&&(S+="\\")),r.unescape===!0?S=le():S+=le(),F.brackets===0){ue({type:"text",value:S});continue}}if(F.brackets>0&&(S!=="]"||w.value==="["||w.value==="[^")){if(r.posix!==!1&&S===":"){let R=w.value.slice(1);if(R.includes("[")&&(w.posix=!0,R.includes(":"))){let se=w.value.lastIndexOf("["),Be=w.value.slice(0,se),Et=w.value.slice(se+2),Ge=wce[Et];if(Ge){w.value=Be+Ge,F.backtrack=!0,le(),!s.output&&o.indexOf(w)===1&&(s.output=p);continue}}}(S==="["&&V()!==":"||S==="-"&&V()==="]")&&(S=`\\${S}`),S==="]"&&(w.value==="["||w.value==="[^")&&(S=`\\${S}`),r.posix===!0&&S==="!"&&w.value==="["&&(S="^"),w.value+=S,vl({value:S});continue}if(F.quotes===1&&S!=='"'){S=er.escapeRegex(S),w.value+=S,vl({value:S});continue}if(S==='"'){F.quotes=F.quotes===1?0:1,r.keepQuotes===!0&&ue({type:"text",value:S});continue}if(S==="("){_l("parens"),ue({type:"paren",value:S});continue}if(S===")"){if(F.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Qa("opening","("));let R=I[I.length-1];if(R&&F.parens===R.parens+1){C$(I.pop());continue}ue({type:"paren",value:S,output:F.parens?")":"\\)"}),Gi("parens");continue}if(S==="["){if(r.nobracket===!0||!Br().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Qa("closing","]"));S=`\\${S}`}else _l("brackets");ue({type:"bracket",value:S});continue}if(S==="]"){if(r.nobracket===!0||w&&w.type==="bracket"&&w.value.length===1){ue({type:"text",value:S,output:`\\${S}`});continue}if(F.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Qa("opening","["));ue({type:"text",value:S,output:`\\${S}`});continue}Gi("brackets");let R=w.value.slice(1);if(w.posix!==!0&&R[0]==="^"&&!R.includes("/")&&(S=`/${S}`),w.value+=S,vl({value:S}),r.literalBrackets===!1||er.hasRegexChars(R))continue;let se=er.escapeRegex(w.value);if(F.output=F.output.slice(0,-w.value.length),r.literalBrackets===!0){F.output+=se,w.value=se;continue}w.value=`(${a}${se}|${w.value})`,F.output+=w.value;continue}if(S==="{"&&r.nobrace!==!0){_l("braces");let R={type:"brace",value:S,output:"(",outputIndex:F.output.length,tokensIndex:F.tokens.length};$.push(R),ue(R);continue}if(S==="}"){let R=$[$.length-1];if(r.nobrace===!0||!R){ue({type:"text",value:S,output:S});continue}let se=")";if(R.dots===!0){let Be=o.slice(),Et=[];for(let Ge=Be.length-1;Ge>=0&&(o.pop(),Be[Ge].type!=="brace");Ge--)Be[Ge].type!=="dots"&&Et.unshift(Be[Ge].value);se=_ce(Et,r),F.backtrack=!0}if(R.comma!==!0&&R.dots!==!0){let Be=F.output.slice(0,R.outputIndex),Et=F.tokens.slice(R.tokensIndex);R.value=R.output="\\{",S=se="\\}",F.output=Be;for(let Ge of Et)F.output+=Ge.output||Ge.value}ue({type:"brace",value:S,output:se}),Gi("braces"),$.pop();continue}if(S==="|"){I.length>0&&I[I.length-1].conditions++,ue({type:"text",value:S});continue}if(S===","){let R=S,se=$[$.length-1];se&&J[J.length-1]==="braces"&&(se.comma=!0,R="|"),ue({type:"comma",value:S,output:R});continue}if(S==="/"){if(w.type==="dot"&&F.index===F.start+1){F.start=F.index+1,F.consumed="",F.output="",o.pop(),w=s;continue}ue({type:"slash",value:S,output:d});continue}if(S==="."){if(F.braces>0&&w.type==="dot"){w.value==="."&&(w.output=f);let R=$[$.length-1];w.type="dots",w.output+=S,w.value+=S,R.dots=!0;continue}if(F.braces+F.parens===0&&w.type!=="bos"&&w.type!=="slash"){ue({type:"text",value:S,output:f});continue}ue({type:"dot",value:S,output:f});continue}if(S==="?"){if(!(w&&w.value==="(")&&r.noextglob!==!0&&V()==="("&&V(2)!=="?"){Al("qmark",S);continue}if(w&&w.type==="paren"){let se=V(),Be=S;if(se==="<"&&!er.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(w.value==="("&&!/[!=<:]/.test(se)||se==="<"&&!/<([!=]|\w+>)/.test(Br()))&&(Be=`\\${S}`),ue({type:"text",value:S,output:Be});continue}if(r.dot!==!0&&(w.type==="slash"||w.type==="bos")){ue({type:"qmark",value:S,output:C});continue}ue({type:"qmark",value:S,output:b});continue}if(S==="!"){if(r.noextglob!==!0&&V()==="("&&(V(2)!=="?"||!/[!=<:]/.test(V(3)))){Al("negate",S);continue}if(r.nonegate!==!0&&F.index===0){E$();continue}}if(S==="+"){if(r.noextglob!==!0&&V()==="("&&V(2)!=="?"){Al("plus",S);continue}if(w&&w.value==="("||r.regex===!1){ue({type:"plus",value:S,output:h});continue}if(w&&(w.type==="bracket"||w.type==="paren"||w.type==="brace")||F.parens>0){ue({type:"plus",value:S});continue}ue({type:"plus",value:h});continue}if(S==="@"){if(r.noextglob!==!0&&V()==="("&&V(2)!=="?"){ue({type:"at",extglob:!0,value:S,output:""});continue}ue({type:"text",value:S});continue}if(S!=="*"){(S==="$"||S==="^")&&(S=`\\${S}`);let R=Sce.exec(Br());R&&(S+=R[0],F.index+=R[0].length),ue({type:"text",value:S});continue}if(w&&(w.type==="globstar"||w.star===!0)){w.type="star",w.star=!0,w.value+=S,w.output=A,F.backtrack=!0,F.globstar=!0,Wt(S);continue}let N=Br();if(r.noextglob!==!0&&/^\([^?]/.test(N)){Al("star",S);continue}if(w.type==="star"){if(r.noglobstar===!0){Wt(S);continue}let R=w.prev,se=R.prev,Be=R.type==="slash"||R.type==="bos",Et=se&&(se.type==="star"||se.type==="globstar");if(r.bash===!0&&(!Be||N[0]&&N[0]!=="/")){ue({type:"star",value:S,output:""});continue}let Ge=F.braces>0&&(R.type==="comma"||R.type==="brace"),Hp=I.length&&(R.type==="pipe"||R.type==="paren");if(!Be&&R.type!=="paren"&&!Ge&&!Hp){ue({type:"star",value:S,output:""});continue}for(;N.slice(0,3)==="/**";){let Bl=t[F.index+4];if(Bl&&Bl!=="/")break;N=N.slice(3),Wt("/**",3)}if(R.type==="bos"&&X()){w.type="globstar",w.value+=S,w.output=B(r),F.output=w.output,F.globstar=!0,Wt(S);continue}if(R.type==="slash"&&R.prev.type!=="bos"&&!Et&&X()){F.output=F.output.slice(0,-(R.output+w.output).length),R.output=`(?:${R.output}`,w.type="globstar",w.output=B(r)+(r.strictSlashes?")":"|$)"),w.value+=S,F.globstar=!0,F.output+=R.output+w.output,Wt(S);continue}if(R.type==="slash"&&R.prev.type!=="bos"&&N[0]==="/"){let Bl=N[1]!==void 0?"|$":"";F.output=F.output.slice(0,-(R.output+w.output).length),R.output=`(?:${R.output}`,w.type="globstar",w.output=`${B(r)}${d}|${d}${Bl})`,w.value+=S,F.output+=R.output+w.output,F.globstar=!0,Wt(S+le()),ue({type:"slash",value:"/",output:""});continue}if(R.type==="bos"&&N[0]==="/"){w.type="globstar",w.value+=S,w.output=`(?:^|${d}|${B(r)}${d})`,F.output=w.output,F.globstar=!0,Wt(S+le()),ue({type:"slash",value:"/",output:""});continue}F.output=F.output.slice(0,-w.output.length),w.type="globstar",w.output=B(r),w.value+=S,F.output+=w.output,F.globstar=!0,Wt(S);continue}let ye={type:"star",value:S,output:A};if(r.bash===!0){ye.output=".*?",(w.type==="bos"||w.type==="slash")&&(ye.output=O+ye.output),ue(ye);continue}if(w&&(w.type==="bracket"||w.type==="paren")&&r.regex===!0){ye.output=S,ue(ye);continue}(F.index===F.start||w.type==="slash"||w.type==="dot")&&(w.type==="dot"?(F.output+=D,w.output+=D):r.dot===!0?(F.output+=y,w.output+=y):(F.output+=O,w.output+=O),V()!=="*"&&(F.output+=p,w.output+=p)),ue(ye)}for(;F.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Qa("closing","]"));F.output=er.escapeLast(F.output,"["),Gi("brackets")}for(;F.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Qa("closing",")"));F.output=er.escapeLast(F.output,"("),Gi("parens")}for(;F.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Qa("closing","}"));F.output=er.escapeLast(F.output,"{"),Gi("braces")}if(r.strictSlashes!==!0&&(w.type==="star"||w.type==="bracket")&&ue({type:"maybe_slash",value:"",output:`${d}?`}),F.backtrack===!0){F.output="";for(let N of F.tokens)F.output+=N.output!=null?N.output:N.value,N.suffix&&(F.output+=N.suffix)}return F};Vb.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(gp,r.maxLength):gp,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);t=VM[t]||t;let s=er.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:u,DOTS_SLASH:c,NO_DOT:l,NO_DOTS:f,NO_DOTS_SLASH:h,STAR:d,START_ANCHOR:p}=Dp.globChars(s),m=r.dot?f:l,x=r.dot?h:l,D=r.capture?"":"?:",y={negated:!1,prefix:""},b=r.bash===!0?".*?":d;r.capture&&(b=`(${b})`);let C=O=>O.noglobstar===!0?b:`(${D}(?:(?!${p}${O.dot?c:o}).)*?)`,_=O=>{switch(O){case"*":return`${m}${u}${b}`;case".*":return`${o}${u}${b}`;case"*.*":return`${m}${b}${o}${u}${b}`;case"*/*":return`${m}${b}${a}${u}${x}${b}`;case"**":return m+C(r);case"**/*":return`(?:${m}${C(r)}${a})?${x}${u}${b}`;case"**/*.*":return`(?:${m}${C(r)}${a})?${x}${b}${o}${u}${b}`;case"**/.*":return`(?:${m}${C(r)}${a})?${o}${u}${b}`;default:{let v=/^(.*?)\.(\w+)$/.exec(O);if(!v)return;let A=_(v[1]);return A?A+o+v[2]:void 0}}},T=er.removePrefix(t,y),B=_(T);return B&&r.strictSlashes!==!0&&(B+=`${a}?`),B};zM.exports=Vb});var ZM=g((O9e,YM)=>{"use strict";var Ace=require("path"),Bce=GM(),zb=KM(),Kb=Fl(),Tce=bl(),kce=t=>t&&typeof t=="object"&&!Array.isArray(t),Ue=(t,e,r=!1)=>{if(Array.isArray(t)){let l=t.map(h=>Ue(h,e,r));return h=>{for(let d of l){let p=d(h);if(p)return p}return!1}}let n=kce(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},s=Kb.isWindows(e),o=n?Ue.compileRe(t,e):Ue.makeRe(t,e,!1,!0),a=o.state;delete o.state;let u=()=>!1;if(i.ignore){let l={...e,ignore:null,onMatch:null,onResult:null};u=Ue(i.ignore,l,r)}let c=(l,f=!1)=>{let{isMatch:h,match:d,output:p}=Ue.test(l,o,e,{glob:t,posix:s}),m={glob:t,state:a,regex:o,posix:s,input:l,output:p,match:d,isMatch:h};return typeof i.onResult=="function"&&i.onResult(m),h===!1?(m.isMatch=!1,f?m:!1):u(l)?(typeof i.onIgnore=="function"&&i.onIgnore(m),m.isMatch=!1,f?m:!1):(typeof i.onMatch=="function"&&i.onMatch(m),f?m:!0)};return r&&(c.state=a),c};Ue.test=(t,e,r,{glob:n,posix:i}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let s=r||{},o=s.format||(i?Kb.toPosixSlashes:null),a=t===n,u=a&&o?o(t):t;return a===!1&&(u=o?o(t):t,a=u===n),(a===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?a=Ue.matchBase(t,e,r,i):a=e.exec(u)),{isMatch:!!a,match:a,output:u}};Ue.matchBase=(t,e,r,n=Kb.isWindows(r))=>(e instanceof RegExp?e:Ue.makeRe(e,r)).test(Ace.basename(t));Ue.isMatch=(t,e,r)=>Ue(e,r)(t);Ue.parse=(t,e)=>Array.isArray(t)?t.map(r=>Ue.parse(r,e)):zb(t,{...e,fastpaths:!1});Ue.scan=(t,e)=>Bce(t,e);Ue.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let i=e||{},s=i.contains?"":"^",o=i.contains?"":"$",a=`${s}(?:${t.output})${o}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let u=Ue.toRegex(a,e);return n===!0&&(u.state=t),u};Ue.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(i.output=zb.fastpaths(t,e)),i.output||(i=zb(t,e)),Ue.compileRe(i,e,r,n)};Ue.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};Ue.constants=Tce;YM.exports=Ue});var XM=g((P9e,JM)=>{"use strict";JM.exports=ZM()});var iL=g((R9e,nL)=>{"use strict";var eL=require("util"),tL=OM(),En=XM(),Yb=Fl(),QM=t=>t===""||t==="./",rL=t=>{let e=t.indexOf("{");return e>-1&&t.indexOf("}",e)>-1},Fe=(t,e,r)=>{e=[].concat(e),t=[].concat(t);let n=new Set,i=new Set,s=new Set,o=0,a=l=>{s.add(l.output),r&&r.onResult&&r.onResult(l)};for(let l=0;l<e.length;l++){let f=En(String(e[l]),{...r,onResult:a},!0),h=f.state.negated||f.state.negatedExtglob;h&&o++;for(let d of t){let p=f(d,!0);(h?!p.isMatch:p.isMatch)&&(h?n.add(p.output):(n.delete(p.output),i.add(p.output)))}}let c=(o===e.length?[...s]:[...i]).filter(l=>!n.has(l));if(r&&c.length===0){if(r.failglob===!0)throw new Error(`No matches found for "${e.join(", ")}"`);if(r.nonull===!0||r.nullglob===!0)return r.unescape?e.map(l=>l.replace(/\\/g,"")):e}return c};Fe.match=Fe;Fe.matcher=(t,e)=>En(t,e);Fe.isMatch=(t,e,r)=>En(e,r)(t);Fe.any=Fe.isMatch;Fe.not=(t,e,r={})=>{e=[].concat(e).map(String);let n=new Set,i=[],s=a=>{r.onResult&&r.onResult(a),i.push(a.output)},o=new Set(Fe(t,e,{...r,onResult:s}));for(let a of i)o.has(a)||n.add(a);return[...n]};Fe.contains=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${eL.inspect(t)}"`);if(Array.isArray(e))return e.some(n=>Fe.contains(t,n,r));if(typeof e=="string"){if(QM(t)||QM(e))return!1;if(t.includes(e)||t.startsWith("./")&&t.slice(2).includes(e))return!0}return Fe.isMatch(t,e,{...r,contains:!0})};Fe.matchKeys=(t,e,r)=>{if(!Yb.isObject(t))throw new TypeError("Expected the first argument to be an object");let n=Fe(Object.keys(t),e,r),i={};for(let s of n)i[s]=t[s];return i};Fe.some=(t,e,r)=>{let n=[].concat(t);for(let i of[].concat(e)){let s=En(String(i),r);if(n.some(o=>s(o)))return!0}return!1};Fe.every=(t,e,r)=>{let n=[].concat(t);for(let i of[].concat(e)){let s=En(String(i),r);if(!n.every(o=>s(o)))return!1}return!0};Fe.all=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${eL.inspect(t)}"`);return[].concat(e).every(n=>En(n,r)(t))};Fe.capture=(t,e,r)=>{let n=Yb.isWindows(r),s=En.makeRe(String(t),{...r,capture:!0}).exec(n?Yb.toPosixSlashes(e):e);if(s)return s.slice(1).map(o=>o===void 0?"":o)};Fe.makeRe=(...t)=>En.makeRe(...t);Fe.scan=(...t)=>En.scan(...t);Fe.parse=(t,e)=>{let r=[];for(let n of[].concat(t||[]))for(let i of tL(String(n),e))r.push(En.parse(i,e));return r};Fe.braces=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return e&&e.nobrace===!0||!rL(t)?[t]:tL(t,e)};Fe.braceExpand=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return Fe.braces(t,{...e,expand:!0})};Fe.hasBraces=rL;nL.exports=Fe});var pL=g(K=>{"use strict";Object.defineProperty(K,"__esModule",{value:!0});K.isAbsolute=K.partitionAbsoluteAndRelative=K.removeDuplicateSlashes=K.matchAny=K.convertPatternsToRe=K.makeRe=K.getPatternParts=K.expandBraceExpansion=K.expandPatternsWithBraceExpansion=K.isAffectDepthOfReadingPattern=K.endsWithSlashGlobStar=K.hasGlobStar=K.getBaseDirectory=K.isPatternRelatedToParentDirectory=K.getPatternsOutsideCurrentDirectory=K.getPatternsInsideCurrentDirectory=K.getPositivePatterns=K.getNegativePatterns=K.isPositivePattern=K.isNegativePattern=K.convertToNegativePattern=K.convertToPositivePattern=K.isDynamicPattern=K.isStaticPattern=void 0;var sL=require("path"),Oce=ZI(),Zb=iL(),oL="**",Pce="\\",Rce=/[*?]|^!/,Ice=/\[[^[]*]/,Mce=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,Lce=/[!*+?@]\([^(]*\)/,Nce=/,|\.\./,$ce=/(?!^)\/{2,}/g;function aL(t,e={}){return!uL(t,e)}K.isStaticPattern=aL;function uL(t,e={}){return t===""?!1:!!(e.caseSensitiveMatch===!1||t.includes(Pce)||Rce.test(t)||Ice.test(t)||Mce.test(t)||e.extglob!==!1&&Lce.test(t)||e.braceExpansion!==!1&&jce(t))}K.isDynamicPattern=uL;function jce(t){let e=t.indexOf("{");if(e===-1)return!1;let r=t.indexOf("}",e+1);if(r===-1)return!1;let n=t.slice(e,r);return Nce.test(n)}function Uce(t){return xp(t)?t.slice(1):t}K.convertToPositivePattern=Uce;function qce(t){return"!"+t}K.convertToNegativePattern=qce;function xp(t){return t.startsWith("!")&&t[1]!=="("}K.isNegativePattern=xp;function cL(t){return!xp(t)}K.isPositivePattern=cL;function Hce(t){return t.filter(xp)}K.getNegativePatterns=Hce;function Wce(t){return t.filter(cL)}K.getPositivePatterns=Wce;function Gce(t){return t.filter(e=>!Jb(e))}K.getPatternsInsideCurrentDirectory=Gce;function Vce(t){return t.filter(Jb)}K.getPatternsOutsideCurrentDirectory=Vce;function Jb(t){return t.startsWith("..")||t.startsWith("./..")}K.isPatternRelatedToParentDirectory=Jb;function zce(t){return Oce(t,{flipBackslashes:!1})}K.getBaseDirectory=zce;function Kce(t){return t.includes(oL)}K.hasGlobStar=Kce;function lL(t){return t.endsWith("/"+oL)}K.endsWithSlashGlobStar=lL;function Yce(t){let e=sL.basename(t);return lL(t)||aL(e)}K.isAffectDepthOfReadingPattern=Yce;function Zce(t){return t.reduce((e,r)=>e.concat(fL(r)),[])}K.expandPatternsWithBraceExpansion=Zce;function fL(t){let e=Zb.braces(t,{expand:!0,nodupes:!0,keepEscaping:!0});return e.sort((r,n)=>r.length-n.length),e.filter(r=>r!=="")}K.expandBraceExpansion=fL;function Jce(t,e){let{parts:r}=Zb.scan(t,Object.assign(Object.assign({},e),{parts:!0}));return r.length===0&&(r=[t]),r[0].startsWith("/")&&(r[0]=r[0].slice(1),r.unshift("")),r}K.getPatternParts=Jce;function hL(t,e){return Zb.makeRe(t,e)}K.makeRe=hL;function Xce(t,e){return t.map(r=>hL(r,e))}K.convertPatternsToRe=Xce;function Qce(t,e){return e.some(r=>r.test(t))}K.matchAny=Qce;function ele(t){return t.replace($ce,"/")}K.removeDuplicateSlashes=ele;function tle(t){let e=[],r=[];for(let n of t)dL(n)?e.push(n):r.push(n);return[e,r]}K.partitionAbsoluteAndRelative=tle;function dL(t){return sL.isAbsolute(t)}K.isAbsolute=dL});var xL=g((M9e,gL)=>{"use strict";var rle=require("stream"),mL=rle.PassThrough,nle=Array.prototype.slice;gL.exports=ile;function ile(){let t=[],e=nle.call(arguments),r=!1,n=e[e.length-1];n&&!Array.isArray(n)&&n.pipe==null?e.pop():n={};let i=n.end!==!1,s=n.pipeError===!0;n.objectMode==null&&(n.objectMode=!0),n.highWaterMark==null&&(n.highWaterMark=64*1024);let o=mL(n);function a(){for(let l=0,f=arguments.length;l<f;l++)t.push(DL(arguments[l],n));return u(),this}function u(){if(r)return;r=!0;let l=t.shift();if(!l){process.nextTick(c);return}Array.isArray(l)||(l=[l]);let f=l.length+1;function h(){--f>0||(r=!1,u())}function d(p){function m(){p.removeListener("merge2UnpipeEnd",m),p.removeListener("end",m),s&&p.removeListener("error",x),h()}function x(D){o.emit("error",D)}if(p._readableState.endEmitted)return h();p.on("merge2UnpipeEnd",m),p.on("end",m),s&&p.on("error",x),p.pipe(o,{end:!1}),p.resume()}for(let p=0;p<l.length;p++)d(l[p]);h()}function c(){r=!1,o.emit("queueDrain"),i&&o.end()}return o.setMaxListeners(0),o.add=a,o.on("unpipe",function(l){l.emit("merge2UnpipeEnd")}),e.length&&a.apply(null,e),o}function DL(t,e){if(Array.isArray(t))for(let r=0,n=t.length;r<n;r++)t[r]=DL(t[r],e);else{if(!t._readableState&&t.pipe&&(t=t.pipe(mL(e))),!t._readableState||!t.pause||!t.pipe)throw new Error("Only readable stream can be merged.");t.pause()}return t}});var bL=g(yp=>{"use strict";Object.defineProperty(yp,"__esModule",{value:!0});yp.merge=void 0;var sle=xL();function ole(t){let e=sle(t);return t.forEach(r=>{r.once("error",n=>e.emit("error",n))}),e.once("close",()=>yL(t)),e.once("end",()=>yL(t)),e}yp.merge=ole;function yL(t){t.forEach(e=>e.emit("close"))}});var FL=g(eu=>{"use strict";Object.defineProperty(eu,"__esModule",{value:!0});eu.isEmpty=eu.isString=void 0;function ale(t){return typeof t=="string"}eu.isString=ale;function ule(t){return t===""}eu.isEmpty=ule});var Xn=g(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.string=bt.stream=bt.pattern=bt.path=bt.fs=bt.errno=bt.array=void 0;var cle=LI();bt.array=cle;var lle=NI();bt.errno=lle;var fle=$I();bt.fs=fle;var hle=HI();bt.path=hle;var dle=pL();bt.pattern=dle;var ple=bL();bt.stream=ple;var mle=FL();bt.string=mle});var SL=g(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.convertPatternGroupToTask=Ft.convertPatternGroupsToTasks=Ft.groupPatternsByBaseDirectory=Ft.getNegativePatternsAsPositive=Ft.getPositivePatterns=Ft.convertPatternsToTasks=Ft.generate=void 0;var zr=Xn();function Dle(t,e){let r=EL(t,e),n=EL(e.ignore,e),i=CL(r),s=wL(r,n),o=i.filter(l=>zr.pattern.isStaticPattern(l,e)),a=i.filter(l=>zr.pattern.isDynamicPattern(l,e)),u=Xb(o,s,!1),c=Xb(a,s,!0);return u.concat(c)}Ft.generate=Dle;function EL(t,e){let r=t;return e.braceExpansion&&(r=zr.pattern.expandPatternsWithBraceExpansion(r)),e.baseNameMatch&&(r=r.map(n=>n.includes("/")?n:`**/${n}`)),r.map(n=>zr.pattern.removeDuplicateSlashes(n))}function Xb(t,e,r){let n=[],i=zr.pattern.getPatternsOutsideCurrentDirectory(t),s=zr.pattern.getPatternsInsideCurrentDirectory(t),o=Qb(i),a=Qb(s);return n.push(...eF(o,e,r)),"."in a?n.push(tF(".",s,e,r)):n.push(...eF(a,e,r)),n}Ft.convertPatternsToTasks=Xb;function CL(t){return zr.pattern.getPositivePatterns(t)}Ft.getPositivePatterns=CL;function wL(t,e){return zr.pattern.getNegativePatterns(t).concat(e).map(zr.pattern.convertToPositivePattern)}Ft.getNegativePatternsAsPositive=wL;function Qb(t){let e={};return t.reduce((r,n)=>{let i=zr.pattern.getBaseDirectory(n);return i in r?r[i].push(n):r[i]=[n],r},e)}Ft.groupPatternsByBaseDirectory=Qb;function eF(t,e,r){return Object.keys(t).map(n=>tF(n,t[n],e,r))}Ft.convertPatternGroupsToTasks=eF;function tF(t,e,r,n){return{dynamic:n,positive:e,negative:r,base:t,patterns:[].concat(e,r.map(zr.pattern.convertToNegativePattern))}}Ft.convertPatternGroupToTask=tF});var _L=g(bp=>{"use strict";Object.defineProperty(bp,"__esModule",{value:!0});bp.read=void 0;function gle(t,e,r){e.fs.lstat(t,(n,i)=>{if(n!==null){vL(r,n);return}if(!i.isSymbolicLink()||!e.followSymbolicLink){rF(r,i);return}e.fs.stat(t,(s,o)=>{if(s!==null){if(e.throwErrorOnBrokenSymbolicLink){vL(r,s);return}rF(r,i);return}e.markSymbolicLink&&(o.isSymbolicLink=()=>!0),rF(r,o)})})}bp.read=gle;function vL(t,e){t(e)}function rF(t,e){t(null,e)}});var AL=g(Fp=>{"use strict";Object.defineProperty(Fp,"__esModule",{value:!0});Fp.read=void 0;function xle(t,e){let r=e.fs.lstatSync(t);if(!r.isSymbolicLink()||!e.followSymbolicLink)return r;try{let n=e.fs.statSync(t);return e.markSymbolicLink&&(n.isSymbolicLink=()=>!0),n}catch(n){if(!e.throwErrorOnBrokenSymbolicLink)return r;throw n}}Fp.read=xle});var BL=g(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.createFileSystemAdapter=Ni.FILE_SYSTEM_ADAPTER=void 0;var Ep=require("fs");Ni.FILE_SYSTEM_ADAPTER={lstat:Ep.lstat,stat:Ep.stat,lstatSync:Ep.lstatSync,statSync:Ep.statSync};function yle(t){return t===void 0?Ni.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},Ni.FILE_SYSTEM_ADAPTER),t)}Ni.createFileSystemAdapter=yle});var TL=g(iF=>{"use strict";Object.defineProperty(iF,"__esModule",{value:!0});var ble=BL(),nF=class{constructor(e={}){this._options=e,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=ble.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(e,r){return e??r}};iF.default=nF});var Js=g($i=>{"use strict";Object.defineProperty($i,"__esModule",{value:!0});$i.statSync=$i.stat=$i.Settings=void 0;var kL=_L(),Fle=AL(),sF=TL();$i.Settings=sF.default;function Ele(t,e,r){if(typeof e=="function"){kL.read(t,oF(),e);return}kL.read(t,oF(e),r)}$i.stat=Ele;function Cle(t,e){let r=oF(e);return Fle.read(t,r)}$i.statSync=Cle;function oF(t={}){return t instanceof sF.default?t:new sF.default(t)}});var RL=g((V9e,PL)=>{var OL;PL.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:global):t=>(OL||(OL=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))});var ML=g((z9e,IL)=>{IL.exports=Sle;var wle=RL();function Sle(t,e){let r,n,i,s=!0;Array.isArray(t)?(r=[],n=t.length):(i=Object.keys(t),r={},n=i.length);function o(u){function c(){e&&e(u,r),e=null}s?wle(c):c()}function a(u,c,l){r[u]=l,(--n===0||c)&&o(c)}n?i?i.forEach(function(u){t[u](function(c,l){a(u,c,l)})}):t.forEach(function(u,c){u(function(l,f){a(c,l,f)})}):o(null),s=!1}});var aF=g(wp=>{"use strict";Object.defineProperty(wp,"__esModule",{value:!0});wp.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var Cp=process.versions.node.split(".");if(Cp[0]===void 0||Cp[1]===void 0)throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);var LL=Number.parseInt(Cp[0],10),vle=Number.parseInt(Cp[1],10),NL=10,_le=10,Ale=LL>NL,Ble=LL===NL&&vle>=_le;wp.IS_SUPPORT_READDIR_WITH_FILE_TYPES=Ale||Ble});var $L=g(Sp=>{"use strict";Object.defineProperty(Sp,"__esModule",{value:!0});Sp.createDirentFromStats=void 0;var uF=class{constructor(e,r){this.name=e,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function Tle(t,e){return new uF(t,e)}Sp.createDirentFromStats=Tle});var cF=g(vp=>{"use strict";Object.defineProperty(vp,"__esModule",{value:!0});vp.fs=void 0;var kle=$L();vp.fs=kle});var lF=g(_p=>{"use strict";Object.defineProperty(_p,"__esModule",{value:!0});_p.joinPathSegments=void 0;function Ole(t,e,r){return t.endsWith(r)?t+e:t+r+e}_p.joinPathSegments=Ole});var GL=g(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.readdir=ji.readdirWithFileTypes=ji.read=void 0;var Ple=Js(),jL=ML(),Rle=aF(),UL=cF(),qL=lF();function Ile(t,e,r){if(!e.stats&&Rle.IS_SUPPORT_READDIR_WITH_FILE_TYPES){HL(t,e,r);return}WL(t,e,r)}ji.read=Ile;function HL(t,e,r){e.fs.readdir(t,{withFileTypes:!0},(n,i)=>{if(n!==null){Ap(r,n);return}let s=i.map(a=>({dirent:a,name:a.name,path:qL.joinPathSegments(t,a.name,e.pathSegmentSeparator)}));if(!e.followSymbolicLinks){fF(r,s);return}let o=s.map(a=>Mle(a,e));jL(o,(a,u)=>{if(a!==null){Ap(r,a);return}fF(r,u)})})}ji.readdirWithFileTypes=HL;function Mle(t,e){return r=>{if(!t.dirent.isSymbolicLink()){r(null,t);return}e.fs.stat(t.path,(n,i)=>{if(n!==null){if(e.throwErrorOnBrokenSymbolicLink){r(n);return}r(null,t);return}t.dirent=UL.fs.createDirentFromStats(t.name,i),r(null,t)})}}function WL(t,e,r){e.fs.readdir(t,(n,i)=>{if(n!==null){Ap(r,n);return}let s=i.map(o=>{let a=qL.joinPathSegments(t,o,e.pathSegmentSeparator);return u=>{Ple.stat(a,e.fsStatSettings,(c,l)=>{if(c!==null){u(c);return}let f={name:o,path:a,dirent:UL.fs.createDirentFromStats(o,l)};e.stats&&(f.stats=l),u(null,f)})}});jL(s,(o,a)=>{if(o!==null){Ap(r,o);return}fF(r,a)})})}ji.readdir=WL;function Ap(t,e){t(e)}function fF(t,e){t(null,e)}});var ZL=g(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.readdir=Ui.readdirWithFileTypes=Ui.read=void 0;var Lle=Js(),Nle=aF(),VL=cF(),zL=lF();function $le(t,e){return!e.stats&&Nle.IS_SUPPORT_READDIR_WITH_FILE_TYPES?KL(t,e):YL(t,e)}Ui.read=$le;function KL(t,e){return e.fs.readdirSync(t,{withFileTypes:!0}).map(n=>{let i={dirent:n,name:n.name,path:zL.joinPathSegments(t,n.name,e.pathSegmentSeparator)};if(i.dirent.isSymbolicLink()&&e.followSymbolicLinks)try{let s=e.fs.statSync(i.path);i.dirent=VL.fs.createDirentFromStats(i.name,s)}catch(s){if(e.throwErrorOnBrokenSymbolicLink)throw s}return i})}Ui.readdirWithFileTypes=KL;function YL(t,e){return e.fs.readdirSync(t).map(n=>{let i=zL.joinPathSegments(t,n,e.pathSegmentSeparator),s=Lle.statSync(i,e.fsStatSettings),o={name:n,path:i,dirent:VL.fs.createDirentFromStats(n,s)};return e.stats&&(o.stats=s),o})}Ui.readdir=YL});var JL=g(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.createFileSystemAdapter=qi.FILE_SYSTEM_ADAPTER=void 0;var tu=require("fs");qi.FILE_SYSTEM_ADAPTER={lstat:tu.lstat,stat:tu.stat,lstatSync:tu.lstatSync,statSync:tu.statSync,readdir:tu.readdir,readdirSync:tu.readdirSync};function jle(t){return t===void 0?qi.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},qi.FILE_SYSTEM_ADAPTER),t)}qi.createFileSystemAdapter=jle});var XL=g(dF=>{"use strict";Object.defineProperty(dF,"__esModule",{value:!0});var Ule=require("path"),qle=Js(),Hle=JL(),hF=class{constructor(e={}){this._options=e,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=Hle.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,Ule.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new qle.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e??r}};dF.default=hF});var Bp=g(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});Hi.Settings=Hi.scandirSync=Hi.scandir=void 0;var QL=GL(),Wle=ZL(),pF=XL();Hi.Settings=pF.default;function Gle(t,e,r){if(typeof e=="function"){QL.read(t,mF(),e);return}QL.read(t,mF(e),r)}Hi.scandir=Gle;function Vle(t,e){let r=mF(e);return Wle.read(t,r)}Hi.scandirSync=Vle;function mF(t={}){return t instanceof pF.default?t:new pF.default(t)}});var tN=g((nBe,eN)=>{"use strict";function zle(t){var e=new t,r=e;function n(){var s=e;return s.next?e=s.next:(e=new t,r=e),s.next=null,s}function i(s){r.next=s,r=s}return{get:n,release:i}}eN.exports=zle});var nN=g((iBe,DF)=>{"use strict";var Kle=tN();function rN(t,e,r){if(typeof t=="function"&&(r=e,e=t,t=null),!(r>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var n=Kle(Yle),i=null,s=null,o=0,a=null,u={push:m,drain:_r,saturated:_r,pause:l,paused:!1,get concurrency(){return r},set concurrency(_){if(!(_>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(r=_,!u.paused)for(;i&&o<r;)o++,D()},running:c,resume:d,idle:p,length:f,getQueue:h,unshift:x,empty:_r,kill:y,killAndDrain:b,error:C};return u;function c(){return o}function l(){u.paused=!0}function f(){for(var _=i,T=0;_;)_=_.next,T++;return T}function h(){for(var _=i,T=[];_;)T.push(_.value),_=_.next;return T}function d(){if(u.paused){if(u.paused=!1,i===null){o++,D();return}for(;i&&o<r;)o++,D()}}function p(){return o===0&&u.length()===0}function m(_,T){var B=n.get();B.context=t,B.release=D,B.value=_,B.callback=T||_r,B.errorHandler=a,o>=r||u.paused?s?(s.next=B,s=B):(i=B,s=B,u.saturated()):(o++,e.call(t,B.value,B.worked))}function x(_,T){var B=n.get();B.context=t,B.release=D,B.value=_,B.callback=T||_r,B.errorHandler=a,o>=r||u.paused?i?(B.next=i,i=B):(i=B,s=B,u.saturated()):(o++,e.call(t,B.value,B.worked))}function D(_){_&&n.release(_);var T=i;T&&o<=r?u.paused?o--:(s===i&&(s=null),i=T.next,T.next=null,e.call(t,T.value,T.worked),s===null&&u.empty()):--o===0&&u.drain()}function y(){i=null,s=null,u.drain=_r}function b(){i=null,s=null,u.drain(),u.drain=_r}function C(_){a=_}}function _r(){}function Yle(){this.value=null,this.callback=_r,this.next=null,this.release=_r,this.context=null,this.errorHandler=null;var t=this;this.worked=function(r,n){var i=t.callback,s=t.errorHandler,o=t.value;t.value=null,t.callback=_r,t.errorHandler&&s(r,o),i.call(t.context,r,n),t.release(t)}}function Zle(t,e,r){typeof t=="function"&&(r=e,e=t,t=null);function n(l,f){e.call(this,l).then(function(h){f(null,h)},f)}var i=rN(t,n,r),s=i.push,o=i.unshift;return i.push=a,i.unshift=u,i.drained=c,i;function a(l){var f=new Promise(function(h,d){s(l,function(p,m){if(p){d(p);return}h(m)})});return f.catch(_r),f}function u(l){var f=new Promise(function(h,d){o(l,function(p,m){if(p){d(p);return}h(m)})});return f.catch(_r),f}function c(){var l=new Promise(function(f){process.nextTick(function(){if(i.idle())f();else{var h=i.drain;i.drain=function(){typeof h=="function"&&h(),f(),i.drain=h}}})});return l}}DF.exports=rN;DF.exports.promise=Zle});var Tp=g(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.joinPathSegments=Cn.replacePathSegmentSeparator=Cn.isAppliedFilter=Cn.isFatalError=void 0;function Jle(t,e){return t.errorFilter===null?!0:!t.errorFilter(e)}Cn.isFatalError=Jle;function Xle(t,e){return t===null||t(e)}Cn.isAppliedFilter=Xle;function Qle(t,e){return t.split(/[/\\]/).join(e)}Cn.replacePathSegmentSeparator=Qle;function efe(t,e,r){return t===""?e:t.endsWith(r)?t+e:t+r+e}Cn.joinPathSegments=efe});var yF=g(xF=>{"use strict";Object.defineProperty(xF,"__esModule",{value:!0});var tfe=Tp(),gF=class{constructor(e,r){this._root=e,this._settings=r,this._root=tfe.replacePathSegmentSeparator(e,r.pathSegmentSeparator)}};xF.default=gF});var EF=g(FF=>{"use strict";Object.defineProperty(FF,"__esModule",{value:!0});var rfe=require("events"),nfe=Bp(),ife=nN(),kp=Tp(),sfe=yF(),bF=class extends sfe.default{constructor(e,r){super(e,r),this._settings=r,this._scandir=nfe.scandir,this._emitter=new rfe.EventEmitter,this._queue=ife(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit("end")}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw new Error("The reader is already destroyed");this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(e){this._emitter.on("entry",e)}onError(e){this._emitter.once("error",e)}onEnd(e){this._emitter.once("end",e)}_pushToQueue(e,r){let n={directory:e,base:r};this._queue.push(n,i=>{i!==null&&this._handleError(i)})}_worker(e,r){this._scandir(e.directory,this._settings.fsScandirSettings,(n,i)=>{if(n!==null){r(n,void 0);return}for(let s of i)this._handleEntry(s,e.base);r(null,void 0)})}_handleError(e){this._isDestroyed||!kp.isFatalError(this._settings,e)||(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit("error",e))}_handleEntry(e,r){if(this._isDestroyed||this._isFatalError)return;let n=e.path;r!==void 0&&(e.path=kp.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),kp.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&kp.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,r===void 0?void 0:e.path)}_emitEntry(e){this._emitter.emit("entry",e)}};FF.default=bF});var iN=g(wF=>{"use strict";Object.defineProperty(wF,"__esModule",{value:!0});var ofe=EF(),CF=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new ofe.default(this._root,this._settings),this._storage=[]}read(e){this._reader.onError(r=>{afe(e,r)}),this._reader.onEntry(r=>{this._storage.push(r)}),this._reader.onEnd(()=>{ufe(e,this._storage)}),this._reader.read()}};wF.default=CF;function afe(t,e){t(e)}function ufe(t,e){t(null,e)}});var sN=g(vF=>{"use strict";Object.defineProperty(vF,"__esModule",{value:!0});var cfe=require("stream"),lfe=EF(),SF=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new lfe.default(this._root,this._settings),this._stream=new cfe.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(e=>{this._stream.emit("error",e)}),this._reader.onEntry(e=>{this._stream.push(e)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}};vF.default=SF});var oN=g(AF=>{"use strict";Object.defineProperty(AF,"__esModule",{value:!0});var ffe=Bp(),Op=Tp(),hfe=yF(),_F=class extends hfe.default{constructor(){super(...arguments),this._scandir=ffe.scandirSync,this._storage=[],this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(e,r){this._queue.add({directory:e,base:r})}_handleQueue(){for(let e of this._queue.values())this._handleDirectory(e.directory,e.base)}_handleDirectory(e,r){try{let n=this._scandir(e,this._settings.fsScandirSettings);for(let i of n)this._handleEntry(i,r)}catch(n){this._handleError(n)}}_handleError(e){if(Op.isFatalError(this._settings,e))throw e}_handleEntry(e,r){let n=e.path;r!==void 0&&(e.path=Op.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),Op.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&Op.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,r===void 0?void 0:e.path)}_pushToStorage(e){this._storage.push(e)}};AF.default=_F});var aN=g(TF=>{"use strict";Object.defineProperty(TF,"__esModule",{value:!0});var dfe=oN(),BF=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new dfe.default(this._root,this._settings)}read(){return this._reader.read()}};TF.default=BF});var uN=g(OF=>{"use strict";Object.defineProperty(OF,"__esModule",{value:!0});var pfe=require("path"),mfe=Bp(),kF=class{constructor(e={}){this._options=e,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,pfe.sep),this.fsScandirSettings=new mfe.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e??r}};OF.default=kF});var Rp=g(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.Settings=wn.walkStream=wn.walkSync=wn.walk=void 0;var cN=iN(),Dfe=sN(),gfe=aN(),PF=uN();wn.Settings=PF.default;function xfe(t,e,r){if(typeof e=="function"){new cN.default(t,Pp()).read(e);return}new cN.default(t,Pp(e)).read(r)}wn.walk=xfe;function yfe(t,e){let r=Pp(e);return new gfe.default(t,r).read()}wn.walkSync=yfe;function bfe(t,e){let r=Pp(e);return new Dfe.default(t,r).read()}wn.walkStream=bfe;function Pp(t={}){return t instanceof PF.default?t:new PF.default(t)}});var Ip=g(IF=>{"use strict";Object.defineProperty(IF,"__esModule",{value:!0});var Ffe=require("path"),Efe=Js(),lN=Xn(),RF=class{constructor(e){this._settings=e,this._fsStatSettings=new Efe.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return Ffe.resolve(this._settings.cwd,e)}_makeEntry(e,r){let n={name:r,path:r,dirent:lN.fs.createDirentFromStats(r,e)};return this._settings.stats&&(n.stats=e),n}_isFatalError(e){return!lN.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}};IF.default=RF});var NF=g(LF=>{"use strict";Object.defineProperty(LF,"__esModule",{value:!0});var Cfe=require("stream"),wfe=Js(),Sfe=Rp(),vfe=Ip(),MF=class extends vfe.default{constructor(){super(...arguments),this._walkStream=Sfe.walkStream,this._stat=wfe.stat}dynamic(e,r){return this._walkStream(e,r)}static(e,r){let n=e.map(this._getFullEntryPath,this),i=new Cfe.PassThrough({objectMode:!0});i._write=(s,o,a)=>this._getEntry(n[s],e[s],r).then(u=>{u!==null&&r.entryFilter(u)&&i.push(u),s===n.length-1&&i.end(),a()}).catch(a);for(let s=0;s<n.length;s++)i.write(s);return i}_getEntry(e,r,n){return this._getStat(e).then(i=>this._makeEntry(i,r)).catch(i=>{if(n.errorFilter(i))return null;throw i})}_getStat(e){return new Promise((r,n)=>{this._stat(e,this._fsStatSettings,(i,s)=>i===null?r(s):n(i))})}};LF.default=MF});var fN=g(jF=>{"use strict";Object.defineProperty(jF,"__esModule",{value:!0});var _fe=Rp(),Afe=Ip(),Bfe=NF(),$F=class extends Afe.default{constructor(){super(...arguments),this._walkAsync=_fe.walk,this._readerStream=new Bfe.default(this._settings)}dynamic(e,r){return new Promise((n,i)=>{this._walkAsync(e,r,(s,o)=>{s===null?n(o):i(s)})})}async static(e,r){let n=[],i=this._readerStream.static(e,r);return new Promise((s,o)=>{i.once("error",o),i.on("data",a=>n.push(a)),i.once("end",()=>s(n))})}};jF.default=$F});var hN=g(qF=>{"use strict";Object.defineProperty(qF,"__esModule",{value:!0});var Cl=Xn(),UF=class{constructor(e,r,n){this._patterns=e,this._settings=r,this._micromatchOptions=n,this._storage=[],this._fillStorage()}_fillStorage(){for(let e of this._patterns){let r=this._getPatternSegments(e),n=this._splitSegmentsIntoSections(r);this._storage.push({complete:n.length<=1,pattern:e,segments:r,sections:n})}}_getPatternSegments(e){return Cl.pattern.getPatternParts(e,this._micromatchOptions).map(n=>Cl.pattern.isDynamicPattern(n,this._settings)?{dynamic:!0,pattern:n,patternRe:Cl.pattern.makeRe(n,this._micromatchOptions)}:{dynamic:!1,pattern:n})}_splitSegmentsIntoSections(e){return Cl.array.splitWhen(e,r=>r.dynamic&&Cl.pattern.hasGlobStar(r.pattern))}};qF.default=UF});var dN=g(WF=>{"use strict";Object.defineProperty(WF,"__esModule",{value:!0});var Tfe=hN(),HF=class extends Tfe.default{match(e){let r=e.split("/"),n=r.length,i=this._storage.filter(s=>!s.complete||s.segments.length>n);for(let s of i){let o=s.sections[0];if(!s.complete&&n>o.length||r.every((u,c)=>{let l=s.segments[c];return!!(l.dynamic&&l.patternRe.test(u)||!l.dynamic&&l.pattern===u)}))return!0}return!1}};WF.default=HF});var pN=g(VF=>{"use strict";Object.defineProperty(VF,"__esModule",{value:!0});var Mp=Xn(),kfe=dN(),GF=class{constructor(e,r){this._settings=e,this._micromatchOptions=r}getFilter(e,r,n){let i=this._getMatcher(r),s=this._getNegativePatternsRe(n);return o=>this._filter(e,o,i,s)}_getMatcher(e){return new kfe.default(e,this._settings,this._micromatchOptions)}_getNegativePatternsRe(e){let r=e.filter(Mp.pattern.isAffectDepthOfReadingPattern);return Mp.pattern.convertPatternsToRe(r,this._micromatchOptions)}_filter(e,r,n,i){if(this._isSkippedByDeep(e,r.path)||this._isSkippedSymbolicLink(r))return!1;let s=Mp.path.removeLeadingDotSegment(r.path);return this._isSkippedByPositivePatterns(s,n)?!1:this._isSkippedByNegativePatterns(s,i)}_isSkippedByDeep(e,r){return this._settings.deep===1/0?!1:this._getEntryLevel(e,r)>=this._settings.deep}_getEntryLevel(e,r){let n=r.split("/").length;if(e==="")return n;let i=e.split("/").length;return n-i}_isSkippedSymbolicLink(e){return!this._settings.followSymbolicLinks&&e.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(e,r){return!this._settings.baseNameMatch&&!r.match(e)}_isSkippedByNegativePatterns(e,r){return!Mp.pattern.matchAny(e,r)}};VF.default=GF});var mN=g(KF=>{"use strict";Object.defineProperty(KF,"__esModule",{value:!0});var Wi=Xn(),zF=class{constructor(e,r){this._settings=e,this._micromatchOptions=r,this.index=new Map}getFilter(e,r){let[n,i]=Wi.pattern.partitionAbsoluteAndRelative(r),s={positive:{all:Wi.pattern.convertPatternsToRe(e,this._micromatchOptions)},negative:{absolute:Wi.pattern.convertPatternsToRe(n,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:Wi.pattern.convertPatternsToRe(i,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return o=>this._filter(o,s)}_filter(e,r){let n=Wi.path.removeLeadingDotSegment(e.path);if(this._settings.unique&&this._isDuplicateEntry(n)||this._onlyFileFilter(e)||this._onlyDirectoryFilter(e))return!1;let i=this._isMatchToPatternsSet(n,r,e.dirent.isDirectory());return this._settings.unique&&i&&this._createIndexRecord(n),i}_isDuplicateEntry(e){return this.index.has(e)}_createIndexRecord(e){this.index.set(e,void 0)}_onlyFileFilter(e){return this._settings.onlyFiles&&!e.dirent.isFile()}_onlyDirectoryFilter(e){return this._settings.onlyDirectories&&!e.dirent.isDirectory()}_isMatchToPatternsSet(e,r,n){return!(!this._isMatchToPatterns(e,r.positive.all,n)||this._isMatchToPatterns(e,r.negative.relative,n)||this._isMatchToAbsoluteNegative(e,r.negative.absolute,n))}_isMatchToAbsoluteNegative(e,r,n){if(r.length===0)return!1;let i=Wi.path.makeAbsolute(this._settings.cwd,e);return this._isMatchToPatterns(i,r,n)}_isMatchToPatterns(e,r,n){if(r.length===0)return!1;let i=Wi.pattern.matchAny(e,r);return!i&&n?Wi.pattern.matchAny(e+"/",r):i}};KF.default=zF});var DN=g(ZF=>{"use strict";Object.defineProperty(ZF,"__esModule",{value:!0});var Ofe=Xn(),YF=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(e){return Ofe.errno.isEnoentCodeError(e)||this._settings.suppressErrors}};ZF.default=YF});var xN=g(XF=>{"use strict";Object.defineProperty(XF,"__esModule",{value:!0});var gN=Xn(),JF=class{constructor(e){this._settings=e}getTransformer(){return e=>this._transform(e)}_transform(e){let r=e.path;return this._settings.absolute&&(r=gN.path.makeAbsolute(this._settings.cwd,r),r=gN.path.unixify(r)),this._settings.markDirectories&&e.dirent.isDirectory()&&(r+="/"),this._settings.objectMode?Object.assign(Object.assign({},e),{path:r}):r}};XF.default=JF});var Lp=g(eE=>{"use strict";Object.defineProperty(eE,"__esModule",{value:!0});var Pfe=require("path"),Rfe=pN(),Ife=mN(),Mfe=DN(),Lfe=xN(),QF=class{constructor(e){this._settings=e,this.errorFilter=new Mfe.default(this._settings),this.entryFilter=new Ife.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new Rfe.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new Lfe.default(this._settings)}_getRootDirectory(e){return Pfe.resolve(this._settings.cwd,e.base)}_getReaderOptions(e){let r=e.base==="."?"":e.base;return{basePath:r,pathSegmentSeparator:"/",concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(r,e.positive,e.negative),entryFilter:this.entryFilter.getFilter(e.positive,e.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}};eE.default=QF});var yN=g(rE=>{"use strict";Object.defineProperty(rE,"__esModule",{value:!0});var Nfe=fN(),$fe=Lp(),tE=class extends $fe.default{constructor(){super(...arguments),this._reader=new Nfe.default(this._settings)}async read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e);return(await this.api(r,e,n)).map(s=>n.transform(s))}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}};rE.default=tE});var bN=g(iE=>{"use strict";Object.defineProperty(iE,"__esModule",{value:!0});var jfe=require("stream"),Ufe=NF(),qfe=Lp(),nE=class extends qfe.default{constructor(){super(...arguments),this._reader=new Ufe.default(this._settings)}read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e),i=this.api(r,e,n),s=new jfe.Readable({objectMode:!0,read:()=>{}});return i.once("error",o=>s.emit("error",o)).on("data",o=>s.emit("data",n.transform(o))).once("end",()=>s.emit("end")),s.once("close",()=>i.destroy()),s}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}};iE.default=nE});var FN=g(oE=>{"use strict";Object.defineProperty(oE,"__esModule",{value:!0});var Hfe=Js(),Wfe=Rp(),Gfe=Ip(),sE=class extends Gfe.default{constructor(){super(...arguments),this._walkSync=Wfe.walkSync,this._statSync=Hfe.statSync}dynamic(e,r){return this._walkSync(e,r)}static(e,r){let n=[];for(let i of e){let s=this._getFullEntryPath(i),o=this._getEntry(s,i,r);o===null||!r.entryFilter(o)||n.push(o)}return n}_getEntry(e,r,n){try{let i=this._getStat(e);return this._makeEntry(i,r)}catch(i){if(n.errorFilter(i))return null;throw i}}_getStat(e){return this._statSync(e,this._fsStatSettings)}};oE.default=sE});var EN=g(uE=>{"use strict";Object.defineProperty(uE,"__esModule",{value:!0});var Vfe=FN(),zfe=Lp(),aE=class extends zfe.default{constructor(){super(...arguments),this._reader=new Vfe.default(this._settings)}read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e);return this.api(r,e,n).map(n.transform)}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}};uE.default=aE});var CN=g(nu=>{"use strict";Object.defineProperty(nu,"__esModule",{value:!0});nu.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;var ru=require("fs"),Kfe=require("os"),Yfe=Math.max(Kfe.cpus().length,1);nu.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:ru.lstat,lstatSync:ru.lstatSync,stat:ru.stat,statSync:ru.statSync,readdir:ru.readdir,readdirSync:ru.readdirSync};var cE=class{constructor(e={}){this._options=e,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,Yfe),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),this.ignore=[].concat(this.ignore)}_getValue(e,r){return e===void 0?r:e}_getFileSystemMethods(e={}){return Object.assign(Object.assign({},nu.DEFAULT_FILE_SYSTEM_ADAPTER),e)}};nu.default=cE});var dE=g((BBe,SN)=>{"use strict";var wN=SL(),Zfe=yN(),Jfe=bN(),Xfe=EN(),lE=CN(),Ar=Xn();async function fE(t,e){Kr(t);let r=hE(t,Zfe.default,e),n=await Promise.all(r);return Ar.array.flatten(n)}(function(t){t.glob=t,t.globSync=e,t.globStream=r,t.async=t;function e(c,l){Kr(c);let f=hE(c,Xfe.default,l);return Ar.array.flatten(f)}t.sync=e;function r(c,l){Kr(c);let f=hE(c,Jfe.default,l);return Ar.stream.merge(f)}t.stream=r;function n(c,l){Kr(c);let f=[].concat(c),h=new lE.default(l);return wN.generate(f,h)}t.generateTasks=n;function i(c,l){Kr(c);let f=new lE.default(l);return Ar.pattern.isDynamicPattern(c,f)}t.isDynamicPattern=i;function s(c){return Kr(c),Ar.path.escape(c)}t.escapePath=s;function o(c){return Kr(c),Ar.path.convertPathToPattern(c)}t.convertPathToPattern=o;let a;(function(c){function l(h){return Kr(h),Ar.path.escapePosixPath(h)}c.escapePath=l;function f(h){return Kr(h),Ar.path.convertPosixPathToPattern(h)}c.convertPathToPattern=f})(a=t.posix||(t.posix={}));let u;(function(c){function l(h){return Kr(h),Ar.path.escapeWindowsPath(h)}c.escapePath=l;function f(h){return Kr(h),Ar.path.convertWindowsPathToPattern(h)}c.convertPathToPattern=f})(u=t.win32||(t.win32={}))})(fE||(fE={}));function hE(t,e,r){let n=[].concat(t),i=new lE.default(r),s=wN.generate(n,i),o=new e(i);return s.map(o.read,o)}function Kr(t){if(![].concat(t).every(n=>Ar.string.isString(n)&&!Ar.string.isEmpty(n)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}SN.exports=fE});var NN=g((IBe,jp)=>{function ON(t){return Array.isArray(t)?t:[t]}var Qfe=void 0,gE="",TN=" ",DE="\\",ehe=/^\s+$/,the=/(?:[^\\]|^)\\$/,rhe=/^\\!/,nhe=/^\\#/,ihe=/\r?\n/g,she=/^\.{0,2}\/|^\.{1,2}$/,ohe=/\/$/,iu="/",PN="node-ignore";typeof Symbol<"u"&&(PN=Symbol.for("node-ignore"));var RN=PN,su=(t,e,r)=>(Object.defineProperty(t,e,{value:r}),r),ahe=/([0-z])-([0-z])/g,IN=()=>!1,uhe=t=>t.replace(ahe,(e,r,n)=>r.charCodeAt(0)<=n.charCodeAt(0)?e:gE),che=t=>{let{length:e}=t;return t.slice(0,e-e%2)},lhe=[[/^\uFEFF/,()=>gE],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,r)=>e+(r.indexOf("\\")===0?TN:gE)],[/(\\+?)\s/g,(t,e)=>{let{length:r}=e;return e.slice(0,r-r%2)+TN}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,r)=>e+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(t,e,r)=>{let n=r.replace(/\\\*/g,"[^\\/]*");return e+n}],[/\\\\\\(?=[$.|*+(){^])/g,()=>DE],[/\\\\/g,()=>DE],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,n,i)=>e===DE?`\\[${r}${che(n)}${i}`:i==="]"&&n.length%2===0?`[${uhe(r)}${n}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`]],fhe=/(^|\\\/)?\\\*$/,wl="regex",Np="checkRegex",kN="_",hhe={[wl](t,e){return`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`},[Np](t,e){return`${e?`${e}[^/]*`:"[^/]*"}(?=$|\\/$)`}},dhe=t=>lhe.reduce((e,[r,n])=>e.replace(r,n.bind(t)),t),$p=t=>typeof t=="string",phe=t=>t&&$p(t)&&!ehe.test(t)&&!the.test(t)&&t.indexOf("#")!==0,mhe=t=>t.split(ihe).filter(Boolean),xE=class{constructor(e,r,n,i,s,o){this.pattern=e,this.mark=r,this.negative=s,su(this,"body",n),su(this,"ignoreCase",i),su(this,"regexPrefix",o)}get regex(){let e=kN+wl;return this[e]?this[e]:this._make(wl,e)}get checkRegex(){let e=kN+Np;return this[e]?this[e]:this._make(Np,e)}_make(e,r){let n=this.regexPrefix.replace(fhe,hhe[e]),i=this.ignoreCase?new RegExp(n,"i"):new RegExp(n);return su(this,r,i)}},Dhe=({pattern:t,mark:e},r)=>{let n=!1,i=t;i.indexOf("!")===0&&(n=!0,i=i.substr(1)),i=i.replace(rhe,"!").replace(nhe,"#");let s=dhe(i);return new xE(t,e,i,r,n,s)},yE=class{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){if(e&&e[RN]){this._rules=this._rules.concat(e._rules._rules),this._added=!0;return}if($p(e)&&(e={pattern:e}),phe(e.pattern)){let r=Dhe(e,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(e){return this._added=!1,ON($p(e)?mhe(e):e).forEach(this._add,this),this._added}test(e,r,n){let i=!1,s=!1,o;this._rules.forEach(u=>{let{negative:c}=u;s===c&&i!==s||c&&!i&&!s&&!r||!u[n].test(e)||(i=!c,s=c,o=c?Qfe:u)});let a={ignored:i,unignored:s};return o&&(a.rule=o),a}},ghe=(t,e)=>{throw new e(t)},Qn=(t,e,r)=>$p(t)?t?Qn.isNotRelative(t)?r(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${e}\``,TypeError),MN=t=>she.test(t);Qn.isNotRelative=MN;Qn.convert=t=>t;var bE=class{constructor({ignorecase:e=!0,ignoreCase:r=e,allowRelativePaths:n=!1}={}){su(this,RN,!0),this._rules=new yE(r),this._strictPathCheck=!n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,r,n,i){let s=e&&Qn.convert(e);return Qn(s,e,this._strictPathCheck?ghe:IN),this._t(s,r,n,i)}checkIgnore(e){if(!ohe.test(e))return this.test(e);let r=e.split(iu).filter(Boolean);if(r.pop(),r.length){let n=this._t(r.join(iu)+iu,this._testCache,!0,r);if(n.ignored)return n}return this._rules.test(e,!1,Np)}_t(e,r,n,i){if(e in r)return r[e];if(i||(i=e.split(iu).filter(Boolean)),i.pop(),!i.length)return r[e]=this._rules.test(e,n,wl);let s=this._t(i.join(iu)+iu,r,n,i);return r[e]=s.ignored?s:this._rules.test(e,n,wl)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return ON(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},FE=t=>new bE(t),xhe=t=>Qn(t&&Qn.convert(t),t,IN),LN=()=>{let t=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");Qn.convert=t;let e=/^[a-z]:\//i;Qn.isNotRelative=r=>e.test(r)||MN(r)};typeof process<"u"&&process.platform==="win32"&&LN();jp.exports=FE;FE.default=FE;jp.exports.isPathValid=xhe;su(jp.exports,Symbol.for("setupWindows"),LN)});var F$=require("node:process");var kE=(t=0)=>e=>`\x1B[${e+t}m`,OE=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,PE=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,Ee={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},t0e=Object.keys(Ee.modifier),T$=Object.keys(Ee.color),k$=Object.keys(Ee.bgColor),r0e=[...T$,...k$];function O$(){let t=new Map;for(let[e,r]of Object.entries(Ee)){for(let[n,i]of Object.entries(r))Ee[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=Ee[n],t.set(i[0],i[1]);Object.defineProperty(Ee,e,{value:r,enumerable:!1})}return Object.defineProperty(Ee,"codes",{value:t,enumerable:!1}),Ee.color.close="\x1B[39m",Ee.bgColor.close="\x1B[49m",Ee.color.ansi=kE(),Ee.color.ansi256=OE(),Ee.color.ansi16m=PE(),Ee.bgColor.ansi=kE(10),Ee.bgColor.ansi256=OE(10),Ee.bgColor.ansi16m=PE(10),Object.defineProperties(Ee,{rgbToAnsi256:{value(e,r,n){return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(s=>s+s).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>Ee.rgbToAnsi256(...Ee.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,i;if(e>=232)r=((e-232)*10+8)/255,n=r,i=r;else{e-=16;let a=e%36;r=Math.floor(e/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let s=Math.max(r,n,i)*2;if(s===0)return 30;let o=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>Ee.ansi256ToAnsi(Ee.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>Ee.ansi256ToAnsi(Ee.hexToAnsi256(e)),enumerable:!1}}),Ee}var P$=O$(),Tr=P$;var kl=P(require("node:process"),1),IE=P(require("node:os"),1),Gp=P(require("node:tty"),1);function tr(t,e=globalThis.Deno?globalThis.Deno.args:kl.default.argv){let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}var{env:Ce}=kl.default,Tl;tr("no-color")||tr("no-colors")||tr("color=false")||tr("color=never")?Tl=0:(tr("color")||tr("colors")||tr("color=true")||tr("color=always"))&&(Tl=1);function R$(){if("FORCE_COLOR"in Ce)return Ce.FORCE_COLOR==="true"?1:Ce.FORCE_COLOR==="false"?0:Ce.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Ce.FORCE_COLOR,10),3)}function I$(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function M$(t,{streamIsTTY:e,sniffFlags:r=!0}={}){let n=R$();n!==void 0&&(Tl=n);let i=r?Tl:n;if(i===0)return 0;if(r){if(tr("color=16m")||tr("color=full")||tr("color=truecolor"))return 3;if(tr("color=256"))return 2}if("TF_BUILD"in Ce&&"AGENT_NAME"in Ce)return 1;if(t&&!e&&i===void 0)return 0;let s=i||0;if(Ce.TERM==="dumb")return s;if(kl.default.platform==="win32"){let o=IE.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in Ce)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(o=>o in Ce)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in Ce)||Ce.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in Ce)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ce.TEAMCITY_VERSION)?1:0;if(Ce.COLORTERM==="truecolor"||Ce.TERM==="xterm-kitty"||Ce.TERM==="xterm-ghostty"||Ce.TERM==="wezterm")return 3;if("TERM_PROGRAM"in Ce){let o=Number.parseInt((Ce.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ce.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ce.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ce.TERM)||"COLORTERM"in Ce?1:s}function RE(t,e={}){let r=M$(t,{streamIsTTY:t&&t.isTTY,...e});return I$(r)}var L$={stdout:RE({isTTY:Gp.default.isatty(1)}),stderr:RE({isTTY:Gp.default.isatty(2)})},ME=L$;function LE(t,e,r){let n=t.indexOf(e);if(n===-1)return t;let i=e.length,s=0,o="";do o+=t.slice(s,n)+e+r,s=n+i,n=t.indexOf(e,s);while(n!==-1);return o+=t.slice(s),o}function NE(t,e,r,n){let i=0,s="";do{let o=t[n-1]==="\r";s+=t.slice(i,o?n-1:n)+e+(o?`\r
|
|
117
|
+
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var BM=g((v9e,AM)=>{"use strict";var Lue=hp(),{MAX_LENGTH:SM,CHAR_BACKSLASH:Nb,CHAR_BACKTICK:Nue,CHAR_COMMA:$ue,CHAR_DOT:jue,CHAR_LEFT_PARENTHESES:Uue,CHAR_RIGHT_PARENTHESES:que,CHAR_LEFT_CURLY_BRACE:Hue,CHAR_RIGHT_CURLY_BRACE:Wue,CHAR_LEFT_SQUARE_BRACKET:vM,CHAR_RIGHT_SQUARE_BRACKET:_M,CHAR_DOUBLE_QUOTE:Gue,CHAR_SINGLE_QUOTE:Vue,CHAR_NO_BREAK_SPACE:zue,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Kue}=wM(),Yue=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},n=typeof r.maxLength=="number"?Math.min(SM,r.maxLength):SM;if(t.length>n)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${n})`);let i={type:"root",input:t,nodes:[]},s=[i],o=i,a=i,u=0,c=t.length,l=0,f=0,h,d=()=>t[l++],p=m=>{if(m.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&m.type==="text"){a.value+=m.value;return}return o.nodes.push(m),m.parent=o,m.prev=a,a=m,m};for(p({type:"bos"});l<c;)if(o=s[s.length-1],h=d(),!(h===Kue||h===zue)){if(h===Nb){p({type:"text",value:(e.keepEscaping?h:"")+d()});continue}if(h===_M){p({type:"text",value:"\\"+h});continue}if(h===vM){u++;let m;for(;l<c&&(m=d());){if(h+=m,m===vM){u++;continue}if(m===Nb){h+=d();continue}if(m===_M&&(u--,u===0))break}p({type:"text",value:h});continue}if(h===Uue){o=p({type:"paren",nodes:[]}),s.push(o),p({type:"text",value:h});continue}if(h===que){if(o.type!=="paren"){p({type:"text",value:h});continue}o=s.pop(),p({type:"text",value:h}),o=s[s.length-1];continue}if(h===Gue||h===Vue||h===Nue){let m=h,x;for(e.keepQuotes!==!0&&(h="");l<c&&(x=d());){if(x===Nb){h+=x+d();continue}if(x===m){e.keepQuotes===!0&&(h+=x);break}h+=x}p({type:"text",value:h});continue}if(h===Hue){f++;let x={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||o.dollar===!0,depth:f,commas:0,ranges:0,nodes:[]};o=p(x),s.push(o),p({type:"open",value:h});continue}if(h===Wue){if(o.type!=="brace"){p({type:"text",value:h});continue}let m="close";o=s.pop(),o.close=!0,p({type:m,value:h}),f--,o=s[s.length-1];continue}if(h===$ue&&f>0){if(o.ranges>0){o.ranges=0;let m=o.nodes.shift();o.nodes=[m,{type:"text",value:Lue(o)}]}p({type:"comma",value:h}),o.commas++;continue}if(h===jue&&f>0&&o.commas===0){let m=o.nodes;if(f===0||m.length===0){p({type:"text",value:h});continue}if(a.type==="dot"){if(o.range=[],a.value+=h,a.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,a.type="text";continue}o.ranges++,o.args=[];continue}if(a.type==="range"){m.pop();let x=m[m.length-1];x.value+=a.value+h,a=x,o.ranges--;continue}p({type:"dot",value:h});continue}p({type:"text",value:h})}do if(o=s.pop(),o.type!=="root"){o.nodes.forEach(D=>{D.nodes||(D.type==="open"&&(D.isOpen=!0),D.type==="close"&&(D.isClose=!0),D.nodes||(D.type="text"),D.invalid=!0)});let m=s[s.length-1],x=m.nodes.indexOf(o);m.nodes.splice(x,1,...o.nodes)}while(s.length>0);return p({type:"eos"}),i};AM.exports=Yue});var OM=g((_9e,kM)=>{"use strict";var TM=hp(),Zue=yM(),Jue=EM(),Xue=BM(),Qt=(t,e={})=>{let r=[];if(Array.isArray(t))for(let n of t){let i=Qt.create(n,e);Array.isArray(i)?r.push(...i):r.push(i)}else r=[].concat(Qt.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};Qt.parse=(t,e={})=>Xue(t,e);Qt.stringify=(t,e={})=>TM(typeof t=="string"?Qt.parse(t,e):t,e);Qt.compile=(t,e={})=>(typeof t=="string"&&(t=Qt.parse(t,e)),Zue(t,e));Qt.expand=(t,e={})=>{typeof t=="string"&&(t=Qt.parse(t,e));let r=Jue(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};Qt.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?Qt.compile(t,e):Qt.expand(t,e);kM.exports=Qt});var bl=g((A9e,LM)=>{"use strict";var Que=require("path"),Fn="\\\\/",PM=`[^${Fn}]`,Jn="\\.",ece="\\+",tce="\\?",mp="\\/",rce="(?=.)",RM="[^/]",$b=`(?:${mp}|$)`,IM=`(?:^|${mp})`,jb=`${Jn}{1,2}${$b}`,nce=`(?!${Jn})`,ice=`(?!${IM}${jb})`,sce=`(?!${Jn}{0,1}${$b})`,oce=`(?!${jb})`,ace=`[^.${mp}]`,uce=`${RM}*?`,MM={DOT_LITERAL:Jn,PLUS_LITERAL:ece,QMARK_LITERAL:tce,SLASH_LITERAL:mp,ONE_CHAR:rce,QMARK:RM,END_ANCHOR:$b,DOTS_SLASH:jb,NO_DOT:nce,NO_DOTS:ice,NO_DOT_SLASH:sce,NO_DOTS_SLASH:oce,QMARK_NO_DOT:ace,STAR:uce,START_ANCHOR:IM},cce={...MM,SLASH_LITERAL:`[${Fn}]`,QMARK:PM,STAR:`${PM}*?`,DOTS_SLASH:`${Jn}{1,2}(?:[${Fn}]|$)`,NO_DOT:`(?!${Jn})`,NO_DOTS:`(?!(?:^|[${Fn}])${Jn}{1,2}(?:[${Fn}]|$))`,NO_DOT_SLASH:`(?!${Jn}{0,1}(?:[${Fn}]|$))`,NO_DOTS_SLASH:`(?!${Jn}{1,2}(?:[${Fn}]|$))`,QMARK_NO_DOT:`[^.${Fn}]`,START_ANCHOR:`(?:^|[${Fn}])`,END_ANCHOR:`(?:[${Fn}]|$)`},lce={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};LM.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:lce,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:Que.sep,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?cce:MM}}});var Fl=g(Ht=>{"use strict";var fce=require("path"),hce=process.platform==="win32",{REGEX_BACKSLASH:dce,REGEX_REMOVE_BACKSLASH:pce,REGEX_SPECIAL_CHARS:mce,REGEX_SPECIAL_CHARS_GLOBAL:Dce}=bl();Ht.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Ht.hasRegexChars=t=>mce.test(t);Ht.isRegexChar=t=>t.length===1&&Ht.hasRegexChars(t);Ht.escapeRegex=t=>t.replace(Dce,"\\$1");Ht.toPosixSlashes=t=>t.replace(dce,"/");Ht.removeBackslashes=t=>t.replace(pce,e=>e==="\\"?"":e);Ht.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};Ht.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:hce===!0||fce.sep==="\\";Ht.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?Ht.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};Ht.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};Ht.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",s=`${n}(?:${t})${i}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s}});var GM=g((T9e,WM)=>{"use strict";var NM=Fl(),{CHAR_ASTERISK:Ub,CHAR_AT:gce,CHAR_BACKWARD_SLASH:El,CHAR_COMMA:xce,CHAR_DOT:qb,CHAR_EXCLAMATION_MARK:Hb,CHAR_FORWARD_SLASH:HM,CHAR_LEFT_CURLY_BRACE:Wb,CHAR_LEFT_PARENTHESES:Gb,CHAR_LEFT_SQUARE_BRACKET:yce,CHAR_PLUS:bce,CHAR_QUESTION_MARK:$M,CHAR_RIGHT_CURLY_BRACE:Fce,CHAR_RIGHT_PARENTHESES:jM,CHAR_RIGHT_SQUARE_BRACKET:Ece}=bl(),UM=t=>t===HM||t===El,qM=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},Cce=(t,e)=>{let r=e||{},n=t.length-1,i=r.parts===!0||r.scanToEnd===!0,s=[],o=[],a=[],u=t,c=-1,l=0,f=0,h=!1,d=!1,p=!1,m=!1,x=!1,D=!1,y=!1,b=!1,C=!1,_=!1,T=0,B,O,v={value:"",depth:0,isGlob:!1},A=()=>c>=n,F=()=>u.charCodeAt(c+1),I=()=>(B=O,u.charCodeAt(++c));for(;c<n;){O=I();let X;if(O===El){y=v.backslashes=!0,O=I(),O===Wb&&(D=!0);continue}if(D===!0||O===Wb){for(T++;A()!==!0&&(O=I());){if(O===El){y=v.backslashes=!0,I();continue}if(O===Wb){T++;continue}if(D!==!0&&O===qb&&(O=I())===qb){if(h=v.isBrace=!0,p=v.isGlob=!0,_=!0,i===!0)continue;break}if(D!==!0&&O===xce){if(h=v.isBrace=!0,p=v.isGlob=!0,_=!0,i===!0)continue;break}if(O===Fce&&(T--,T===0)){D=!1,h=v.isBrace=!0,_=!0;break}}if(i===!0)continue;break}if(O===HM){if(s.push(c),o.push(v),v={value:"",depth:0,isGlob:!1},_===!0)continue;if(B===qb&&c===l+1){l+=2;continue}f=c+1;continue}if(r.noext!==!0&&(O===bce||O===gce||O===Ub||O===$M||O===Hb)===!0&&F()===Gb){if(p=v.isGlob=!0,m=v.isExtglob=!0,_=!0,O===Hb&&c===l&&(C=!0),i===!0){for(;A()!==!0&&(O=I());){if(O===El){y=v.backslashes=!0,O=I();continue}if(O===jM){p=v.isGlob=!0,_=!0;break}}continue}break}if(O===Ub){if(B===Ub&&(x=v.isGlobstar=!0),p=v.isGlob=!0,_=!0,i===!0)continue;break}if(O===$M){if(p=v.isGlob=!0,_=!0,i===!0)continue;break}if(O===yce){for(;A()!==!0&&(X=I());){if(X===El){y=v.backslashes=!0,I();continue}if(X===Ece){d=v.isBracket=!0,p=v.isGlob=!0,_=!0;break}}if(i===!0)continue;break}if(r.nonegate!==!0&&O===Hb&&c===l){b=v.negated=!0,l++;continue}if(r.noparen!==!0&&O===Gb){if(p=v.isGlob=!0,i===!0){for(;A()!==!0&&(O=I());){if(O===Gb){y=v.backslashes=!0,O=I();continue}if(O===jM){_=!0;break}}continue}break}if(p===!0){if(_=!0,i===!0)continue;break}}r.noext===!0&&(m=!1,p=!1);let $=u,J="",w="";l>0&&(J=u.slice(0,l),u=u.slice(l),f-=l),$&&p===!0&&f>0?($=u.slice(0,f),w=u.slice(f)):p===!0?($="",w=u):$=u,$&&$!==""&&$!=="/"&&$!==u&&UM($.charCodeAt($.length-1))&&($=$.slice(0,-1)),r.unescape===!0&&(w&&(w=NM.removeBackslashes(w)),$&&y===!0&&($=NM.removeBackslashes($)));let S={prefix:J,input:t,start:l,base:$,glob:w,isBrace:h,isBracket:d,isGlob:p,isExtglob:m,isGlobstar:x,negated:b,negatedExtglob:C};if(r.tokens===!0&&(S.maxDepth=0,UM(O)||o.push(v),S.tokens=o),r.parts===!0||r.tokens===!0){let X;for(let V=0;V<s.length;V++){let le=X?X+1:l,Br=s[V],Wt=t.slice(le,Br);r.tokens&&(V===0&&l!==0?(o[V].isPrefix=!0,o[V].value=J):o[V].value=Wt,qM(o[V]),S.maxDepth+=o[V].depth),(V!==0||Wt!=="")&&a.push(Wt),X=Br}if(X&&X+1<t.length){let V=t.slice(X+1);a.push(V),r.tokens&&(o[o.length-1].value=V,qM(o[o.length-1]),S.maxDepth+=o[o.length-1].depth)}S.slashes=s,S.parts=a}return S};WM.exports=Cce});var KM=g((k9e,zM)=>{"use strict";var Dp=bl(),er=Fl(),{MAX_LENGTH:gp,POSIX_REGEX_SOURCE:wce,REGEX_NON_SPECIAL_CHARS:Sce,REGEX_SPECIAL_CHARS_BACKREF:vce,REPLACEMENTS:VM}=Dp,_ce=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(i=>er.escapeRegex(i)).join("..")}return r},Qa=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,Vb=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=VM[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(gp,r.maxLength):gp,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let s={type:"bos",value:"",output:r.prepend||""},o=[s],a=r.capture?"":"?:",u=er.isWindows(e),c=Dp.globChars(u),l=Dp.extglobChars(c),{DOT_LITERAL:f,PLUS_LITERAL:h,SLASH_LITERAL:d,ONE_CHAR:p,DOTS_SLASH:m,NO_DOT:x,NO_DOT_SLASH:D,NO_DOTS_SLASH:y,QMARK:b,QMARK_NO_DOT:C,STAR:_,START_ANCHOR:T}=c,B=N=>`(${a}(?:(?!${T}${N.dot?m:f}).)*?)`,O=r.dot?"":x,v=r.dot?b:C,A=r.bash===!0?B(r):_;r.capture&&(A=`(${A})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let F={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};t=er.removePrefix(t,F),i=t.length;let I=[],$=[],J=[],w=s,S,X=()=>F.index===i-1,V=F.peek=(N=1)=>t[F.index+N],le=F.advance=()=>t[++F.index]||"",Br=()=>t.slice(F.index+1),Wt=(N="",ye=0)=>{F.consumed+=N,F.index+=ye},vl=N=>{F.output+=N.output!=null?N.output:N.value,Wt(N.value)},E$=()=>{let N=1;for(;V()==="!"&&(V(2)!=="("||V(3)==="?");)le(),F.start++,N++;return N%2===0?!1:(F.negated=!0,F.start++,!0)},_l=N=>{F[N]++,J.push(N)},Gi=N=>{F[N]--,J.pop()},ue=N=>{if(w.type==="globstar"){let ye=F.braces>0&&(N.type==="comma"||N.type==="brace"),R=N.extglob===!0||I.length&&(N.type==="pipe"||N.type==="paren");N.type!=="slash"&&N.type!=="paren"&&!ye&&!R&&(F.output=F.output.slice(0,-w.output.length),w.type="star",w.value="*",w.output=A,F.output+=w.output)}if(I.length&&N.type!=="paren"&&(I[I.length-1].inner+=N.value),(N.value||N.output)&&vl(N),w&&w.type==="text"&&N.type==="text"){w.value+=N.value,w.output=(w.output||"")+N.value;return}N.prev=w,o.push(N),w=N},Al=(N,ye)=>{let R={...l[ye],conditions:1,inner:""};R.prev=w,R.parens=F.parens,R.output=F.output;let se=(r.capture?"(":"")+R.open;_l("parens"),ue({type:N,value:ye,output:F.output?"":p}),ue({type:"paren",extglob:!0,value:le(),output:se}),I.push(R)},C$=N=>{let ye=N.close+(r.capture?")":""),R;if(N.type==="negate"){let se=A;if(N.inner&&N.inner.length>1&&N.inner.includes("/")&&(se=B(r)),(se!==A||X()||/^\)+$/.test(Br()))&&(ye=N.close=`)$))${se}`),N.inner.includes("*")&&(R=Br())&&/^\.[^\\/.]+$/.test(R)){let Be=Vb(R,{...e,fastpaths:!1}).output;ye=N.close=`)${Be})${se})`}N.prev.type==="bos"&&(F.negatedExtglob=!0)}ue({type:"paren",extglob:!0,value:S,output:ye}),Gi("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let N=!1,ye=t.replace(vce,(R,se,Be,Et,Ge,Hp)=>Et==="\\"?(N=!0,R):Et==="?"?se?se+Et+(Ge?b.repeat(Ge.length):""):Hp===0?v+(Ge?b.repeat(Ge.length):""):b.repeat(Be.length):Et==="."?f.repeat(Be.length):Et==="*"?se?se+Et+(Ge?A:""):A:se?R:`\\${R}`);return N===!0&&(r.unescape===!0?ye=ye.replace(/\\/g,""):ye=ye.replace(/\\+/g,R=>R.length%2===0?"\\\\":R?"\\":"")),ye===t&&r.contains===!0?(F.output=t,F):(F.output=er.wrapOutput(ye,F,e),F)}for(;!X();){if(S=le(),S==="\0")continue;if(S==="\\"){let R=V();if(R==="/"&&r.bash!==!0||R==="."||R===";")continue;if(!R){S+="\\",ue({type:"text",value:S});continue}let se=/^\\+/.exec(Br()),Be=0;if(se&&se[0].length>2&&(Be=se[0].length,F.index+=Be,Be%2!==0&&(S+="\\")),r.unescape===!0?S=le():S+=le(),F.brackets===0){ue({type:"text",value:S});continue}}if(F.brackets>0&&(S!=="]"||w.value==="["||w.value==="[^")){if(r.posix!==!1&&S===":"){let R=w.value.slice(1);if(R.includes("[")&&(w.posix=!0,R.includes(":"))){let se=w.value.lastIndexOf("["),Be=w.value.slice(0,se),Et=w.value.slice(se+2),Ge=wce[Et];if(Ge){w.value=Be+Ge,F.backtrack=!0,le(),!s.output&&o.indexOf(w)===1&&(s.output=p);continue}}}(S==="["&&V()!==":"||S==="-"&&V()==="]")&&(S=`\\${S}`),S==="]"&&(w.value==="["||w.value==="[^")&&(S=`\\${S}`),r.posix===!0&&S==="!"&&w.value==="["&&(S="^"),w.value+=S,vl({value:S});continue}if(F.quotes===1&&S!=='"'){S=er.escapeRegex(S),w.value+=S,vl({value:S});continue}if(S==='"'){F.quotes=F.quotes===1?0:1,r.keepQuotes===!0&&ue({type:"text",value:S});continue}if(S==="("){_l("parens"),ue({type:"paren",value:S});continue}if(S===")"){if(F.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Qa("opening","("));let R=I[I.length-1];if(R&&F.parens===R.parens+1){C$(I.pop());continue}ue({type:"paren",value:S,output:F.parens?")":"\\)"}),Gi("parens");continue}if(S==="["){if(r.nobracket===!0||!Br().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Qa("closing","]"));S=`\\${S}`}else _l("brackets");ue({type:"bracket",value:S});continue}if(S==="]"){if(r.nobracket===!0||w&&w.type==="bracket"&&w.value.length===1){ue({type:"text",value:S,output:`\\${S}`});continue}if(F.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Qa("opening","["));ue({type:"text",value:S,output:`\\${S}`});continue}Gi("brackets");let R=w.value.slice(1);if(w.posix!==!0&&R[0]==="^"&&!R.includes("/")&&(S=`/${S}`),w.value+=S,vl({value:S}),r.literalBrackets===!1||er.hasRegexChars(R))continue;let se=er.escapeRegex(w.value);if(F.output=F.output.slice(0,-w.value.length),r.literalBrackets===!0){F.output+=se,w.value=se;continue}w.value=`(${a}${se}|${w.value})`,F.output+=w.value;continue}if(S==="{"&&r.nobrace!==!0){_l("braces");let R={type:"brace",value:S,output:"(",outputIndex:F.output.length,tokensIndex:F.tokens.length};$.push(R),ue(R);continue}if(S==="}"){let R=$[$.length-1];if(r.nobrace===!0||!R){ue({type:"text",value:S,output:S});continue}let se=")";if(R.dots===!0){let Be=o.slice(),Et=[];for(let Ge=Be.length-1;Ge>=0&&(o.pop(),Be[Ge].type!=="brace");Ge--)Be[Ge].type!=="dots"&&Et.unshift(Be[Ge].value);se=_ce(Et,r),F.backtrack=!0}if(R.comma!==!0&&R.dots!==!0){let Be=F.output.slice(0,R.outputIndex),Et=F.tokens.slice(R.tokensIndex);R.value=R.output="\\{",S=se="\\}",F.output=Be;for(let Ge of Et)F.output+=Ge.output||Ge.value}ue({type:"brace",value:S,output:se}),Gi("braces"),$.pop();continue}if(S==="|"){I.length>0&&I[I.length-1].conditions++,ue({type:"text",value:S});continue}if(S===","){let R=S,se=$[$.length-1];se&&J[J.length-1]==="braces"&&(se.comma=!0,R="|"),ue({type:"comma",value:S,output:R});continue}if(S==="/"){if(w.type==="dot"&&F.index===F.start+1){F.start=F.index+1,F.consumed="",F.output="",o.pop(),w=s;continue}ue({type:"slash",value:S,output:d});continue}if(S==="."){if(F.braces>0&&w.type==="dot"){w.value==="."&&(w.output=f);let R=$[$.length-1];w.type="dots",w.output+=S,w.value+=S,R.dots=!0;continue}if(F.braces+F.parens===0&&w.type!=="bos"&&w.type!=="slash"){ue({type:"text",value:S,output:f});continue}ue({type:"dot",value:S,output:f});continue}if(S==="?"){if(!(w&&w.value==="(")&&r.noextglob!==!0&&V()==="("&&V(2)!=="?"){Al("qmark",S);continue}if(w&&w.type==="paren"){let se=V(),Be=S;if(se==="<"&&!er.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(w.value==="("&&!/[!=<:]/.test(se)||se==="<"&&!/<([!=]|\w+>)/.test(Br()))&&(Be=`\\${S}`),ue({type:"text",value:S,output:Be});continue}if(r.dot!==!0&&(w.type==="slash"||w.type==="bos")){ue({type:"qmark",value:S,output:C});continue}ue({type:"qmark",value:S,output:b});continue}if(S==="!"){if(r.noextglob!==!0&&V()==="("&&(V(2)!=="?"||!/[!=<:]/.test(V(3)))){Al("negate",S);continue}if(r.nonegate!==!0&&F.index===0){E$();continue}}if(S==="+"){if(r.noextglob!==!0&&V()==="("&&V(2)!=="?"){Al("plus",S);continue}if(w&&w.value==="("||r.regex===!1){ue({type:"plus",value:S,output:h});continue}if(w&&(w.type==="bracket"||w.type==="paren"||w.type==="brace")||F.parens>0){ue({type:"plus",value:S});continue}ue({type:"plus",value:h});continue}if(S==="@"){if(r.noextglob!==!0&&V()==="("&&V(2)!=="?"){ue({type:"at",extglob:!0,value:S,output:""});continue}ue({type:"text",value:S});continue}if(S!=="*"){(S==="$"||S==="^")&&(S=`\\${S}`);let R=Sce.exec(Br());R&&(S+=R[0],F.index+=R[0].length),ue({type:"text",value:S});continue}if(w&&(w.type==="globstar"||w.star===!0)){w.type="star",w.star=!0,w.value+=S,w.output=A,F.backtrack=!0,F.globstar=!0,Wt(S);continue}let N=Br();if(r.noextglob!==!0&&/^\([^?]/.test(N)){Al("star",S);continue}if(w.type==="star"){if(r.noglobstar===!0){Wt(S);continue}let R=w.prev,se=R.prev,Be=R.type==="slash"||R.type==="bos",Et=se&&(se.type==="star"||se.type==="globstar");if(r.bash===!0&&(!Be||N[0]&&N[0]!=="/")){ue({type:"star",value:S,output:""});continue}let Ge=F.braces>0&&(R.type==="comma"||R.type==="brace"),Hp=I.length&&(R.type==="pipe"||R.type==="paren");if(!Be&&R.type!=="paren"&&!Ge&&!Hp){ue({type:"star",value:S,output:""});continue}for(;N.slice(0,3)==="/**";){let Bl=t[F.index+4];if(Bl&&Bl!=="/")break;N=N.slice(3),Wt("/**",3)}if(R.type==="bos"&&X()){w.type="globstar",w.value+=S,w.output=B(r),F.output=w.output,F.globstar=!0,Wt(S);continue}if(R.type==="slash"&&R.prev.type!=="bos"&&!Et&&X()){F.output=F.output.slice(0,-(R.output+w.output).length),R.output=`(?:${R.output}`,w.type="globstar",w.output=B(r)+(r.strictSlashes?")":"|$)"),w.value+=S,F.globstar=!0,F.output+=R.output+w.output,Wt(S);continue}if(R.type==="slash"&&R.prev.type!=="bos"&&N[0]==="/"){let Bl=N[1]!==void 0?"|$":"";F.output=F.output.slice(0,-(R.output+w.output).length),R.output=`(?:${R.output}`,w.type="globstar",w.output=`${B(r)}${d}|${d}${Bl})`,w.value+=S,F.output+=R.output+w.output,F.globstar=!0,Wt(S+le()),ue({type:"slash",value:"/",output:""});continue}if(R.type==="bos"&&N[0]==="/"){w.type="globstar",w.value+=S,w.output=`(?:^|${d}|${B(r)}${d})`,F.output=w.output,F.globstar=!0,Wt(S+le()),ue({type:"slash",value:"/",output:""});continue}F.output=F.output.slice(0,-w.output.length),w.type="globstar",w.output=B(r),w.value+=S,F.output+=w.output,F.globstar=!0,Wt(S);continue}let ye={type:"star",value:S,output:A};if(r.bash===!0){ye.output=".*?",(w.type==="bos"||w.type==="slash")&&(ye.output=O+ye.output),ue(ye);continue}if(w&&(w.type==="bracket"||w.type==="paren")&&r.regex===!0){ye.output=S,ue(ye);continue}(F.index===F.start||w.type==="slash"||w.type==="dot")&&(w.type==="dot"?(F.output+=D,w.output+=D):r.dot===!0?(F.output+=y,w.output+=y):(F.output+=O,w.output+=O),V()!=="*"&&(F.output+=p,w.output+=p)),ue(ye)}for(;F.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Qa("closing","]"));F.output=er.escapeLast(F.output,"["),Gi("brackets")}for(;F.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Qa("closing",")"));F.output=er.escapeLast(F.output,"("),Gi("parens")}for(;F.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Qa("closing","}"));F.output=er.escapeLast(F.output,"{"),Gi("braces")}if(r.strictSlashes!==!0&&(w.type==="star"||w.type==="bracket")&&ue({type:"maybe_slash",value:"",output:`${d}?`}),F.backtrack===!0){F.output="";for(let N of F.tokens)F.output+=N.output!=null?N.output:N.value,N.suffix&&(F.output+=N.suffix)}return F};Vb.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(gp,r.maxLength):gp,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);t=VM[t]||t;let s=er.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:u,DOTS_SLASH:c,NO_DOT:l,NO_DOTS:f,NO_DOTS_SLASH:h,STAR:d,START_ANCHOR:p}=Dp.globChars(s),m=r.dot?f:l,x=r.dot?h:l,D=r.capture?"":"?:",y={negated:!1,prefix:""},b=r.bash===!0?".*?":d;r.capture&&(b=`(${b})`);let C=O=>O.noglobstar===!0?b:`(${D}(?:(?!${p}${O.dot?c:o}).)*?)`,_=O=>{switch(O){case"*":return`${m}${u}${b}`;case".*":return`${o}${u}${b}`;case"*.*":return`${m}${b}${o}${u}${b}`;case"*/*":return`${m}${b}${a}${u}${x}${b}`;case"**":return m+C(r);case"**/*":return`(?:${m}${C(r)}${a})?${x}${u}${b}`;case"**/*.*":return`(?:${m}${C(r)}${a})?${x}${b}${o}${u}${b}`;case"**/.*":return`(?:${m}${C(r)}${a})?${o}${u}${b}`;default:{let v=/^(.*?)\.(\w+)$/.exec(O);if(!v)return;let A=_(v[1]);return A?A+o+v[2]:void 0}}},T=er.removePrefix(t,y),B=_(T);return B&&r.strictSlashes!==!0&&(B+=`${a}?`),B};zM.exports=Vb});var ZM=g((O9e,YM)=>{"use strict";var Ace=require("path"),Bce=GM(),zb=KM(),Kb=Fl(),Tce=bl(),kce=t=>t&&typeof t=="object"&&!Array.isArray(t),qe=(t,e,r=!1)=>{if(Array.isArray(t)){let l=t.map(h=>qe(h,e,r));return h=>{for(let d of l){let p=d(h);if(p)return p}return!1}}let n=kce(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},s=Kb.isWindows(e),o=n?qe.compileRe(t,e):qe.makeRe(t,e,!1,!0),a=o.state;delete o.state;let u=()=>!1;if(i.ignore){let l={...e,ignore:null,onMatch:null,onResult:null};u=qe(i.ignore,l,r)}let c=(l,f=!1)=>{let{isMatch:h,match:d,output:p}=qe.test(l,o,e,{glob:t,posix:s}),m={glob:t,state:a,regex:o,posix:s,input:l,output:p,match:d,isMatch:h};return typeof i.onResult=="function"&&i.onResult(m),h===!1?(m.isMatch=!1,f?m:!1):u(l)?(typeof i.onIgnore=="function"&&i.onIgnore(m),m.isMatch=!1,f?m:!1):(typeof i.onMatch=="function"&&i.onMatch(m),f?m:!0)};return r&&(c.state=a),c};qe.test=(t,e,r,{glob:n,posix:i}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let s=r||{},o=s.format||(i?Kb.toPosixSlashes:null),a=t===n,u=a&&o?o(t):t;return a===!1&&(u=o?o(t):t,a=u===n),(a===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?a=qe.matchBase(t,e,r,i):a=e.exec(u)),{isMatch:!!a,match:a,output:u}};qe.matchBase=(t,e,r,n=Kb.isWindows(r))=>(e instanceof RegExp?e:qe.makeRe(e,r)).test(Ace.basename(t));qe.isMatch=(t,e,r)=>qe(e,r)(t);qe.parse=(t,e)=>Array.isArray(t)?t.map(r=>qe.parse(r,e)):zb(t,{...e,fastpaths:!1});qe.scan=(t,e)=>Bce(t,e);qe.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let i=e||{},s=i.contains?"":"^",o=i.contains?"":"$",a=`${s}(?:${t.output})${o}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let u=qe.toRegex(a,e);return n===!0&&(u.state=t),u};qe.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(i.output=zb.fastpaths(t,e)),i.output||(i=zb(t,e)),qe.compileRe(i,e,r,n)};qe.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};qe.constants=Tce;YM.exports=qe});var XM=g((P9e,JM)=>{"use strict";JM.exports=ZM()});var iL=g((R9e,nL)=>{"use strict";var eL=require("util"),tL=OM(),En=XM(),Yb=Fl(),QM=t=>t===""||t==="./",rL=t=>{let e=t.indexOf("{");return e>-1&&t.indexOf("}",e)>-1},Fe=(t,e,r)=>{e=[].concat(e),t=[].concat(t);let n=new Set,i=new Set,s=new Set,o=0,a=l=>{s.add(l.output),r&&r.onResult&&r.onResult(l)};for(let l=0;l<e.length;l++){let f=En(String(e[l]),{...r,onResult:a},!0),h=f.state.negated||f.state.negatedExtglob;h&&o++;for(let d of t){let p=f(d,!0);(h?!p.isMatch:p.isMatch)&&(h?n.add(p.output):(n.delete(p.output),i.add(p.output)))}}let c=(o===e.length?[...s]:[...i]).filter(l=>!n.has(l));if(r&&c.length===0){if(r.failglob===!0)throw new Error(`No matches found for "${e.join(", ")}"`);if(r.nonull===!0||r.nullglob===!0)return r.unescape?e.map(l=>l.replace(/\\/g,"")):e}return c};Fe.match=Fe;Fe.matcher=(t,e)=>En(t,e);Fe.isMatch=(t,e,r)=>En(e,r)(t);Fe.any=Fe.isMatch;Fe.not=(t,e,r={})=>{e=[].concat(e).map(String);let n=new Set,i=[],s=a=>{r.onResult&&r.onResult(a),i.push(a.output)},o=new Set(Fe(t,e,{...r,onResult:s}));for(let a of i)o.has(a)||n.add(a);return[...n]};Fe.contains=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${eL.inspect(t)}"`);if(Array.isArray(e))return e.some(n=>Fe.contains(t,n,r));if(typeof e=="string"){if(QM(t)||QM(e))return!1;if(t.includes(e)||t.startsWith("./")&&t.slice(2).includes(e))return!0}return Fe.isMatch(t,e,{...r,contains:!0})};Fe.matchKeys=(t,e,r)=>{if(!Yb.isObject(t))throw new TypeError("Expected the first argument to be an object");let n=Fe(Object.keys(t),e,r),i={};for(let s of n)i[s]=t[s];return i};Fe.some=(t,e,r)=>{let n=[].concat(t);for(let i of[].concat(e)){let s=En(String(i),r);if(n.some(o=>s(o)))return!0}return!1};Fe.every=(t,e,r)=>{let n=[].concat(t);for(let i of[].concat(e)){let s=En(String(i),r);if(!n.every(o=>s(o)))return!1}return!0};Fe.all=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${eL.inspect(t)}"`);return[].concat(e).every(n=>En(n,r)(t))};Fe.capture=(t,e,r)=>{let n=Yb.isWindows(r),s=En.makeRe(String(t),{...r,capture:!0}).exec(n?Yb.toPosixSlashes(e):e);if(s)return s.slice(1).map(o=>o===void 0?"":o)};Fe.makeRe=(...t)=>En.makeRe(...t);Fe.scan=(...t)=>En.scan(...t);Fe.parse=(t,e)=>{let r=[];for(let n of[].concat(t||[]))for(let i of tL(String(n),e))r.push(En.parse(i,e));return r};Fe.braces=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return e&&e.nobrace===!0||!rL(t)?[t]:tL(t,e)};Fe.braceExpand=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return Fe.braces(t,{...e,expand:!0})};Fe.hasBraces=rL;nL.exports=Fe});var pL=g(K=>{"use strict";Object.defineProperty(K,"__esModule",{value:!0});K.isAbsolute=K.partitionAbsoluteAndRelative=K.removeDuplicateSlashes=K.matchAny=K.convertPatternsToRe=K.makeRe=K.getPatternParts=K.expandBraceExpansion=K.expandPatternsWithBraceExpansion=K.isAffectDepthOfReadingPattern=K.endsWithSlashGlobStar=K.hasGlobStar=K.getBaseDirectory=K.isPatternRelatedToParentDirectory=K.getPatternsOutsideCurrentDirectory=K.getPatternsInsideCurrentDirectory=K.getPositivePatterns=K.getNegativePatterns=K.isPositivePattern=K.isNegativePattern=K.convertToNegativePattern=K.convertToPositivePattern=K.isDynamicPattern=K.isStaticPattern=void 0;var sL=require("path"),Oce=ZI(),Zb=iL(),oL="**",Pce="\\",Rce=/[*?]|^!/,Ice=/\[[^[]*]/,Mce=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,Lce=/[!*+?@]\([^(]*\)/,Nce=/,|\.\./,$ce=/(?!^)\/{2,}/g;function aL(t,e={}){return!uL(t,e)}K.isStaticPattern=aL;function uL(t,e={}){return t===""?!1:!!(e.caseSensitiveMatch===!1||t.includes(Pce)||Rce.test(t)||Ice.test(t)||Mce.test(t)||e.extglob!==!1&&Lce.test(t)||e.braceExpansion!==!1&&jce(t))}K.isDynamicPattern=uL;function jce(t){let e=t.indexOf("{");if(e===-1)return!1;let r=t.indexOf("}",e+1);if(r===-1)return!1;let n=t.slice(e,r);return Nce.test(n)}function Uce(t){return xp(t)?t.slice(1):t}K.convertToPositivePattern=Uce;function qce(t){return"!"+t}K.convertToNegativePattern=qce;function xp(t){return t.startsWith("!")&&t[1]!=="("}K.isNegativePattern=xp;function cL(t){return!xp(t)}K.isPositivePattern=cL;function Hce(t){return t.filter(xp)}K.getNegativePatterns=Hce;function Wce(t){return t.filter(cL)}K.getPositivePatterns=Wce;function Gce(t){return t.filter(e=>!Jb(e))}K.getPatternsInsideCurrentDirectory=Gce;function Vce(t){return t.filter(Jb)}K.getPatternsOutsideCurrentDirectory=Vce;function Jb(t){return t.startsWith("..")||t.startsWith("./..")}K.isPatternRelatedToParentDirectory=Jb;function zce(t){return Oce(t,{flipBackslashes:!1})}K.getBaseDirectory=zce;function Kce(t){return t.includes(oL)}K.hasGlobStar=Kce;function lL(t){return t.endsWith("/"+oL)}K.endsWithSlashGlobStar=lL;function Yce(t){let e=sL.basename(t);return lL(t)||aL(e)}K.isAffectDepthOfReadingPattern=Yce;function Zce(t){return t.reduce((e,r)=>e.concat(fL(r)),[])}K.expandPatternsWithBraceExpansion=Zce;function fL(t){let e=Zb.braces(t,{expand:!0,nodupes:!0,keepEscaping:!0});return e.sort((r,n)=>r.length-n.length),e.filter(r=>r!=="")}K.expandBraceExpansion=fL;function Jce(t,e){let{parts:r}=Zb.scan(t,Object.assign(Object.assign({},e),{parts:!0}));return r.length===0&&(r=[t]),r[0].startsWith("/")&&(r[0]=r[0].slice(1),r.unshift("")),r}K.getPatternParts=Jce;function hL(t,e){return Zb.makeRe(t,e)}K.makeRe=hL;function Xce(t,e){return t.map(r=>hL(r,e))}K.convertPatternsToRe=Xce;function Qce(t,e){return e.some(r=>r.test(t))}K.matchAny=Qce;function ele(t){return t.replace($ce,"/")}K.removeDuplicateSlashes=ele;function tle(t){let e=[],r=[];for(let n of t)dL(n)?e.push(n):r.push(n);return[e,r]}K.partitionAbsoluteAndRelative=tle;function dL(t){return sL.isAbsolute(t)}K.isAbsolute=dL});var xL=g((M9e,gL)=>{"use strict";var rle=require("stream"),mL=rle.PassThrough,nle=Array.prototype.slice;gL.exports=ile;function ile(){let t=[],e=nle.call(arguments),r=!1,n=e[e.length-1];n&&!Array.isArray(n)&&n.pipe==null?e.pop():n={};let i=n.end!==!1,s=n.pipeError===!0;n.objectMode==null&&(n.objectMode=!0),n.highWaterMark==null&&(n.highWaterMark=64*1024);let o=mL(n);function a(){for(let l=0,f=arguments.length;l<f;l++)t.push(DL(arguments[l],n));return u(),this}function u(){if(r)return;r=!0;let l=t.shift();if(!l){process.nextTick(c);return}Array.isArray(l)||(l=[l]);let f=l.length+1;function h(){--f>0||(r=!1,u())}function d(p){function m(){p.removeListener("merge2UnpipeEnd",m),p.removeListener("end",m),s&&p.removeListener("error",x),h()}function x(D){o.emit("error",D)}if(p._readableState.endEmitted)return h();p.on("merge2UnpipeEnd",m),p.on("end",m),s&&p.on("error",x),p.pipe(o,{end:!1}),p.resume()}for(let p=0;p<l.length;p++)d(l[p]);h()}function c(){r=!1,o.emit("queueDrain"),i&&o.end()}return o.setMaxListeners(0),o.add=a,o.on("unpipe",function(l){l.emit("merge2UnpipeEnd")}),e.length&&a.apply(null,e),o}function DL(t,e){if(Array.isArray(t))for(let r=0,n=t.length;r<n;r++)t[r]=DL(t[r],e);else{if(!t._readableState&&t.pipe&&(t=t.pipe(mL(e))),!t._readableState||!t.pause||!t.pipe)throw new Error("Only readable stream can be merged.");t.pause()}return t}});var bL=g(yp=>{"use strict";Object.defineProperty(yp,"__esModule",{value:!0});yp.merge=void 0;var sle=xL();function ole(t){let e=sle(t);return t.forEach(r=>{r.once("error",n=>e.emit("error",n))}),e.once("close",()=>yL(t)),e.once("end",()=>yL(t)),e}yp.merge=ole;function yL(t){t.forEach(e=>e.emit("close"))}});var FL=g(eu=>{"use strict";Object.defineProperty(eu,"__esModule",{value:!0});eu.isEmpty=eu.isString=void 0;function ale(t){return typeof t=="string"}eu.isString=ale;function ule(t){return t===""}eu.isEmpty=ule});var Xn=g(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.string=bt.stream=bt.pattern=bt.path=bt.fs=bt.errno=bt.array=void 0;var cle=LI();bt.array=cle;var lle=NI();bt.errno=lle;var fle=$I();bt.fs=fle;var hle=HI();bt.path=hle;var dle=pL();bt.pattern=dle;var ple=bL();bt.stream=ple;var mle=FL();bt.string=mle});var SL=g(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.convertPatternGroupToTask=Ft.convertPatternGroupsToTasks=Ft.groupPatternsByBaseDirectory=Ft.getNegativePatternsAsPositive=Ft.getPositivePatterns=Ft.convertPatternsToTasks=Ft.generate=void 0;var zr=Xn();function Dle(t,e){let r=EL(t,e),n=EL(e.ignore,e),i=CL(r),s=wL(r,n),o=i.filter(l=>zr.pattern.isStaticPattern(l,e)),a=i.filter(l=>zr.pattern.isDynamicPattern(l,e)),u=Xb(o,s,!1),c=Xb(a,s,!0);return u.concat(c)}Ft.generate=Dle;function EL(t,e){let r=t;return e.braceExpansion&&(r=zr.pattern.expandPatternsWithBraceExpansion(r)),e.baseNameMatch&&(r=r.map(n=>n.includes("/")?n:`**/${n}`)),r.map(n=>zr.pattern.removeDuplicateSlashes(n))}function Xb(t,e,r){let n=[],i=zr.pattern.getPatternsOutsideCurrentDirectory(t),s=zr.pattern.getPatternsInsideCurrentDirectory(t),o=Qb(i),a=Qb(s);return n.push(...eF(o,e,r)),"."in a?n.push(tF(".",s,e,r)):n.push(...eF(a,e,r)),n}Ft.convertPatternsToTasks=Xb;function CL(t){return zr.pattern.getPositivePatterns(t)}Ft.getPositivePatterns=CL;function wL(t,e){return zr.pattern.getNegativePatterns(t).concat(e).map(zr.pattern.convertToPositivePattern)}Ft.getNegativePatternsAsPositive=wL;function Qb(t){let e={};return t.reduce((r,n)=>{let i=zr.pattern.getBaseDirectory(n);return i in r?r[i].push(n):r[i]=[n],r},e)}Ft.groupPatternsByBaseDirectory=Qb;function eF(t,e,r){return Object.keys(t).map(n=>tF(n,t[n],e,r))}Ft.convertPatternGroupsToTasks=eF;function tF(t,e,r,n){return{dynamic:n,positive:e,negative:r,base:t,patterns:[].concat(e,r.map(zr.pattern.convertToNegativePattern))}}Ft.convertPatternGroupToTask=tF});var _L=g(bp=>{"use strict";Object.defineProperty(bp,"__esModule",{value:!0});bp.read=void 0;function gle(t,e,r){e.fs.lstat(t,(n,i)=>{if(n!==null){vL(r,n);return}if(!i.isSymbolicLink()||!e.followSymbolicLink){rF(r,i);return}e.fs.stat(t,(s,o)=>{if(s!==null){if(e.throwErrorOnBrokenSymbolicLink){vL(r,s);return}rF(r,i);return}e.markSymbolicLink&&(o.isSymbolicLink=()=>!0),rF(r,o)})})}bp.read=gle;function vL(t,e){t(e)}function rF(t,e){t(null,e)}});var AL=g(Fp=>{"use strict";Object.defineProperty(Fp,"__esModule",{value:!0});Fp.read=void 0;function xle(t,e){let r=e.fs.lstatSync(t);if(!r.isSymbolicLink()||!e.followSymbolicLink)return r;try{let n=e.fs.statSync(t);return e.markSymbolicLink&&(n.isSymbolicLink=()=>!0),n}catch(n){if(!e.throwErrorOnBrokenSymbolicLink)return r;throw n}}Fp.read=xle});var BL=g(Ni=>{"use strict";Object.defineProperty(Ni,"__esModule",{value:!0});Ni.createFileSystemAdapter=Ni.FILE_SYSTEM_ADAPTER=void 0;var Ep=require("fs");Ni.FILE_SYSTEM_ADAPTER={lstat:Ep.lstat,stat:Ep.stat,lstatSync:Ep.lstatSync,statSync:Ep.statSync};function yle(t){return t===void 0?Ni.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},Ni.FILE_SYSTEM_ADAPTER),t)}Ni.createFileSystemAdapter=yle});var TL=g(iF=>{"use strict";Object.defineProperty(iF,"__esModule",{value:!0});var ble=BL(),nF=class{constructor(e={}){this._options=e,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=ble.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(e,r){return e??r}};iF.default=nF});var Js=g($i=>{"use strict";Object.defineProperty($i,"__esModule",{value:!0});$i.statSync=$i.stat=$i.Settings=void 0;var kL=_L(),Fle=AL(),sF=TL();$i.Settings=sF.default;function Ele(t,e,r){if(typeof e=="function"){kL.read(t,oF(),e);return}kL.read(t,oF(e),r)}$i.stat=Ele;function Cle(t,e){let r=oF(e);return Fle.read(t,r)}$i.statSync=Cle;function oF(t={}){return t instanceof sF.default?t:new sF.default(t)}});var RL=g((V9e,PL)=>{var OL;PL.exports=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:global):t=>(OL||(OL=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0))});var ML=g((z9e,IL)=>{IL.exports=Sle;var wle=RL();function Sle(t,e){let r,n,i,s=!0;Array.isArray(t)?(r=[],n=t.length):(i=Object.keys(t),r={},n=i.length);function o(u){function c(){e&&e(u,r),e=null}s?wle(c):c()}function a(u,c,l){r[u]=l,(--n===0||c)&&o(c)}n?i?i.forEach(function(u){t[u](function(c,l){a(u,c,l)})}):t.forEach(function(u,c){u(function(l,f){a(c,l,f)})}):o(null),s=!1}});var aF=g(wp=>{"use strict";Object.defineProperty(wp,"__esModule",{value:!0});wp.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;var Cp=process.versions.node.split(".");if(Cp[0]===void 0||Cp[1]===void 0)throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);var LL=Number.parseInt(Cp[0],10),vle=Number.parseInt(Cp[1],10),NL=10,_le=10,Ale=LL>NL,Ble=LL===NL&&vle>=_le;wp.IS_SUPPORT_READDIR_WITH_FILE_TYPES=Ale||Ble});var $L=g(Sp=>{"use strict";Object.defineProperty(Sp,"__esModule",{value:!0});Sp.createDirentFromStats=void 0;var uF=class{constructor(e,r){this.name=e,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function Tle(t,e){return new uF(t,e)}Sp.createDirentFromStats=Tle});var cF=g(vp=>{"use strict";Object.defineProperty(vp,"__esModule",{value:!0});vp.fs=void 0;var kle=$L();vp.fs=kle});var lF=g(_p=>{"use strict";Object.defineProperty(_p,"__esModule",{value:!0});_p.joinPathSegments=void 0;function Ole(t,e,r){return t.endsWith(r)?t+e:t+r+e}_p.joinPathSegments=Ole});var GL=g(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.readdir=ji.readdirWithFileTypes=ji.read=void 0;var Ple=Js(),jL=ML(),Rle=aF(),UL=cF(),qL=lF();function Ile(t,e,r){if(!e.stats&&Rle.IS_SUPPORT_READDIR_WITH_FILE_TYPES){HL(t,e,r);return}WL(t,e,r)}ji.read=Ile;function HL(t,e,r){e.fs.readdir(t,{withFileTypes:!0},(n,i)=>{if(n!==null){Ap(r,n);return}let s=i.map(a=>({dirent:a,name:a.name,path:qL.joinPathSegments(t,a.name,e.pathSegmentSeparator)}));if(!e.followSymbolicLinks){fF(r,s);return}let o=s.map(a=>Mle(a,e));jL(o,(a,u)=>{if(a!==null){Ap(r,a);return}fF(r,u)})})}ji.readdirWithFileTypes=HL;function Mle(t,e){return r=>{if(!t.dirent.isSymbolicLink()){r(null,t);return}e.fs.stat(t.path,(n,i)=>{if(n!==null){if(e.throwErrorOnBrokenSymbolicLink){r(n);return}r(null,t);return}t.dirent=UL.fs.createDirentFromStats(t.name,i),r(null,t)})}}function WL(t,e,r){e.fs.readdir(t,(n,i)=>{if(n!==null){Ap(r,n);return}let s=i.map(o=>{let a=qL.joinPathSegments(t,o,e.pathSegmentSeparator);return u=>{Ple.stat(a,e.fsStatSettings,(c,l)=>{if(c!==null){u(c);return}let f={name:o,path:a,dirent:UL.fs.createDirentFromStats(o,l)};e.stats&&(f.stats=l),u(null,f)})}});jL(s,(o,a)=>{if(o!==null){Ap(r,o);return}fF(r,a)})})}ji.readdir=WL;function Ap(t,e){t(e)}function fF(t,e){t(null,e)}});var ZL=g(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.readdir=Ui.readdirWithFileTypes=Ui.read=void 0;var Lle=Js(),Nle=aF(),VL=cF(),zL=lF();function $le(t,e){return!e.stats&&Nle.IS_SUPPORT_READDIR_WITH_FILE_TYPES?KL(t,e):YL(t,e)}Ui.read=$le;function KL(t,e){return e.fs.readdirSync(t,{withFileTypes:!0}).map(n=>{let i={dirent:n,name:n.name,path:zL.joinPathSegments(t,n.name,e.pathSegmentSeparator)};if(i.dirent.isSymbolicLink()&&e.followSymbolicLinks)try{let s=e.fs.statSync(i.path);i.dirent=VL.fs.createDirentFromStats(i.name,s)}catch(s){if(e.throwErrorOnBrokenSymbolicLink)throw s}return i})}Ui.readdirWithFileTypes=KL;function YL(t,e){return e.fs.readdirSync(t).map(n=>{let i=zL.joinPathSegments(t,n,e.pathSegmentSeparator),s=Lle.statSync(i,e.fsStatSettings),o={name:n,path:i,dirent:VL.fs.createDirentFromStats(n,s)};return e.stats&&(o.stats=s),o})}Ui.readdir=YL});var JL=g(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.createFileSystemAdapter=qi.FILE_SYSTEM_ADAPTER=void 0;var tu=require("fs");qi.FILE_SYSTEM_ADAPTER={lstat:tu.lstat,stat:tu.stat,lstatSync:tu.lstatSync,statSync:tu.statSync,readdir:tu.readdir,readdirSync:tu.readdirSync};function jle(t){return t===void 0?qi.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},qi.FILE_SYSTEM_ADAPTER),t)}qi.createFileSystemAdapter=jle});var XL=g(dF=>{"use strict";Object.defineProperty(dF,"__esModule",{value:!0});var Ule=require("path"),qle=Js(),Hle=JL(),hF=class{constructor(e={}){this._options=e,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=Hle.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,Ule.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new qle.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e??r}};dF.default=hF});var Bp=g(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});Hi.Settings=Hi.scandirSync=Hi.scandir=void 0;var QL=GL(),Wle=ZL(),pF=XL();Hi.Settings=pF.default;function Gle(t,e,r){if(typeof e=="function"){QL.read(t,mF(),e);return}QL.read(t,mF(e),r)}Hi.scandir=Gle;function Vle(t,e){let r=mF(e);return Wle.read(t,r)}Hi.scandirSync=Vle;function mF(t={}){return t instanceof pF.default?t:new pF.default(t)}});var tN=g((nBe,eN)=>{"use strict";function zle(t){var e=new t,r=e;function n(){var s=e;return s.next?e=s.next:(e=new t,r=e),s.next=null,s}function i(s){r.next=s,r=s}return{get:n,release:i}}eN.exports=zle});var nN=g((iBe,DF)=>{"use strict";var Kle=tN();function rN(t,e,r){if(typeof t=="function"&&(r=e,e=t,t=null),!(r>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var n=Kle(Yle),i=null,s=null,o=0,a=null,u={push:m,drain:_r,saturated:_r,pause:l,paused:!1,get concurrency(){return r},set concurrency(_){if(!(_>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(r=_,!u.paused)for(;i&&o<r;)o++,D()},running:c,resume:d,idle:p,length:f,getQueue:h,unshift:x,empty:_r,kill:y,killAndDrain:b,error:C};return u;function c(){return o}function l(){u.paused=!0}function f(){for(var _=i,T=0;_;)_=_.next,T++;return T}function h(){for(var _=i,T=[];_;)T.push(_.value),_=_.next;return T}function d(){if(u.paused){if(u.paused=!1,i===null){o++,D();return}for(;i&&o<r;)o++,D()}}function p(){return o===0&&u.length()===0}function m(_,T){var B=n.get();B.context=t,B.release=D,B.value=_,B.callback=T||_r,B.errorHandler=a,o>=r||u.paused?s?(s.next=B,s=B):(i=B,s=B,u.saturated()):(o++,e.call(t,B.value,B.worked))}function x(_,T){var B=n.get();B.context=t,B.release=D,B.value=_,B.callback=T||_r,B.errorHandler=a,o>=r||u.paused?i?(B.next=i,i=B):(i=B,s=B,u.saturated()):(o++,e.call(t,B.value,B.worked))}function D(_){_&&n.release(_);var T=i;T&&o<=r?u.paused?o--:(s===i&&(s=null),i=T.next,T.next=null,e.call(t,T.value,T.worked),s===null&&u.empty()):--o===0&&u.drain()}function y(){i=null,s=null,u.drain=_r}function b(){i=null,s=null,u.drain(),u.drain=_r}function C(_){a=_}}function _r(){}function Yle(){this.value=null,this.callback=_r,this.next=null,this.release=_r,this.context=null,this.errorHandler=null;var t=this;this.worked=function(r,n){var i=t.callback,s=t.errorHandler,o=t.value;t.value=null,t.callback=_r,t.errorHandler&&s(r,o),i.call(t.context,r,n),t.release(t)}}function Zle(t,e,r){typeof t=="function"&&(r=e,e=t,t=null);function n(l,f){e.call(this,l).then(function(h){f(null,h)},f)}var i=rN(t,n,r),s=i.push,o=i.unshift;return i.push=a,i.unshift=u,i.drained=c,i;function a(l){var f=new Promise(function(h,d){s(l,function(p,m){if(p){d(p);return}h(m)})});return f.catch(_r),f}function u(l){var f=new Promise(function(h,d){o(l,function(p,m){if(p){d(p);return}h(m)})});return f.catch(_r),f}function c(){var l=new Promise(function(f){process.nextTick(function(){if(i.idle())f();else{var h=i.drain;i.drain=function(){typeof h=="function"&&h(),f(),i.drain=h}}})});return l}}DF.exports=rN;DF.exports.promise=Zle});var Tp=g(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.joinPathSegments=Cn.replacePathSegmentSeparator=Cn.isAppliedFilter=Cn.isFatalError=void 0;function Jle(t,e){return t.errorFilter===null?!0:!t.errorFilter(e)}Cn.isFatalError=Jle;function Xle(t,e){return t===null||t(e)}Cn.isAppliedFilter=Xle;function Qle(t,e){return t.split(/[/\\]/).join(e)}Cn.replacePathSegmentSeparator=Qle;function efe(t,e,r){return t===""?e:t.endsWith(r)?t+e:t+r+e}Cn.joinPathSegments=efe});var yF=g(xF=>{"use strict";Object.defineProperty(xF,"__esModule",{value:!0});var tfe=Tp(),gF=class{constructor(e,r){this._root=e,this._settings=r,this._root=tfe.replacePathSegmentSeparator(e,r.pathSegmentSeparator)}};xF.default=gF});var EF=g(FF=>{"use strict";Object.defineProperty(FF,"__esModule",{value:!0});var rfe=require("events"),nfe=Bp(),ife=nN(),kp=Tp(),sfe=yF(),bF=class extends sfe.default{constructor(e,r){super(e,r),this._settings=r,this._scandir=nfe.scandir,this._emitter=new rfe.EventEmitter,this._queue=ife(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit("end")}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw new Error("The reader is already destroyed");this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(e){this._emitter.on("entry",e)}onError(e){this._emitter.once("error",e)}onEnd(e){this._emitter.once("end",e)}_pushToQueue(e,r){let n={directory:e,base:r};this._queue.push(n,i=>{i!==null&&this._handleError(i)})}_worker(e,r){this._scandir(e.directory,this._settings.fsScandirSettings,(n,i)=>{if(n!==null){r(n,void 0);return}for(let s of i)this._handleEntry(s,e.base);r(null,void 0)})}_handleError(e){this._isDestroyed||!kp.isFatalError(this._settings,e)||(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit("error",e))}_handleEntry(e,r){if(this._isDestroyed||this._isFatalError)return;let n=e.path;r!==void 0&&(e.path=kp.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),kp.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&kp.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,r===void 0?void 0:e.path)}_emitEntry(e){this._emitter.emit("entry",e)}};FF.default=bF});var iN=g(wF=>{"use strict";Object.defineProperty(wF,"__esModule",{value:!0});var ofe=EF(),CF=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new ofe.default(this._root,this._settings),this._storage=[]}read(e){this._reader.onError(r=>{afe(e,r)}),this._reader.onEntry(r=>{this._storage.push(r)}),this._reader.onEnd(()=>{ufe(e,this._storage)}),this._reader.read()}};wF.default=CF;function afe(t,e){t(e)}function ufe(t,e){t(null,e)}});var sN=g(vF=>{"use strict";Object.defineProperty(vF,"__esModule",{value:!0});var cfe=require("stream"),lfe=EF(),SF=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new lfe.default(this._root,this._settings),this._stream=new cfe.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(e=>{this._stream.emit("error",e)}),this._reader.onEntry(e=>{this._stream.push(e)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}};vF.default=SF});var oN=g(AF=>{"use strict";Object.defineProperty(AF,"__esModule",{value:!0});var ffe=Bp(),Op=Tp(),hfe=yF(),_F=class extends hfe.default{constructor(){super(...arguments),this._scandir=ffe.scandirSync,this._storage=[],this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(e,r){this._queue.add({directory:e,base:r})}_handleQueue(){for(let e of this._queue.values())this._handleDirectory(e.directory,e.base)}_handleDirectory(e,r){try{let n=this._scandir(e,this._settings.fsScandirSettings);for(let i of n)this._handleEntry(i,r)}catch(n){this._handleError(n)}}_handleError(e){if(Op.isFatalError(this._settings,e))throw e}_handleEntry(e,r){let n=e.path;r!==void 0&&(e.path=Op.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),Op.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&Op.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,r===void 0?void 0:e.path)}_pushToStorage(e){this._storage.push(e)}};AF.default=_F});var aN=g(TF=>{"use strict";Object.defineProperty(TF,"__esModule",{value:!0});var dfe=oN(),BF=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new dfe.default(this._root,this._settings)}read(){return this._reader.read()}};TF.default=BF});var uN=g(OF=>{"use strict";Object.defineProperty(OF,"__esModule",{value:!0});var pfe=require("path"),mfe=Bp(),kF=class{constructor(e={}){this._options=e,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,pfe.sep),this.fsScandirSettings=new mfe.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e??r}};OF.default=kF});var Rp=g(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.Settings=wn.walkStream=wn.walkSync=wn.walk=void 0;var cN=iN(),Dfe=sN(),gfe=aN(),PF=uN();wn.Settings=PF.default;function xfe(t,e,r){if(typeof e=="function"){new cN.default(t,Pp()).read(e);return}new cN.default(t,Pp(e)).read(r)}wn.walk=xfe;function yfe(t,e){let r=Pp(e);return new gfe.default(t,r).read()}wn.walkSync=yfe;function bfe(t,e){let r=Pp(e);return new Dfe.default(t,r).read()}wn.walkStream=bfe;function Pp(t={}){return t instanceof PF.default?t:new PF.default(t)}});var Ip=g(IF=>{"use strict";Object.defineProperty(IF,"__esModule",{value:!0});var Ffe=require("path"),Efe=Js(),lN=Xn(),RF=class{constructor(e){this._settings=e,this._fsStatSettings=new Efe.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return Ffe.resolve(this._settings.cwd,e)}_makeEntry(e,r){let n={name:r,path:r,dirent:lN.fs.createDirentFromStats(r,e)};return this._settings.stats&&(n.stats=e),n}_isFatalError(e){return!lN.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}};IF.default=RF});var NF=g(LF=>{"use strict";Object.defineProperty(LF,"__esModule",{value:!0});var Cfe=require("stream"),wfe=Js(),Sfe=Rp(),vfe=Ip(),MF=class extends vfe.default{constructor(){super(...arguments),this._walkStream=Sfe.walkStream,this._stat=wfe.stat}dynamic(e,r){return this._walkStream(e,r)}static(e,r){let n=e.map(this._getFullEntryPath,this),i=new Cfe.PassThrough({objectMode:!0});i._write=(s,o,a)=>this._getEntry(n[s],e[s],r).then(u=>{u!==null&&r.entryFilter(u)&&i.push(u),s===n.length-1&&i.end(),a()}).catch(a);for(let s=0;s<n.length;s++)i.write(s);return i}_getEntry(e,r,n){return this._getStat(e).then(i=>this._makeEntry(i,r)).catch(i=>{if(n.errorFilter(i))return null;throw i})}_getStat(e){return new Promise((r,n)=>{this._stat(e,this._fsStatSettings,(i,s)=>i===null?r(s):n(i))})}};LF.default=MF});var fN=g(jF=>{"use strict";Object.defineProperty(jF,"__esModule",{value:!0});var _fe=Rp(),Afe=Ip(),Bfe=NF(),$F=class extends Afe.default{constructor(){super(...arguments),this._walkAsync=_fe.walk,this._readerStream=new Bfe.default(this._settings)}dynamic(e,r){return new Promise((n,i)=>{this._walkAsync(e,r,(s,o)=>{s===null?n(o):i(s)})})}async static(e,r){let n=[],i=this._readerStream.static(e,r);return new Promise((s,o)=>{i.once("error",o),i.on("data",a=>n.push(a)),i.once("end",()=>s(n))})}};jF.default=$F});var hN=g(qF=>{"use strict";Object.defineProperty(qF,"__esModule",{value:!0});var Cl=Xn(),UF=class{constructor(e,r,n){this._patterns=e,this._settings=r,this._micromatchOptions=n,this._storage=[],this._fillStorage()}_fillStorage(){for(let e of this._patterns){let r=this._getPatternSegments(e),n=this._splitSegmentsIntoSections(r);this._storage.push({complete:n.length<=1,pattern:e,segments:r,sections:n})}}_getPatternSegments(e){return Cl.pattern.getPatternParts(e,this._micromatchOptions).map(n=>Cl.pattern.isDynamicPattern(n,this._settings)?{dynamic:!0,pattern:n,patternRe:Cl.pattern.makeRe(n,this._micromatchOptions)}:{dynamic:!1,pattern:n})}_splitSegmentsIntoSections(e){return Cl.array.splitWhen(e,r=>r.dynamic&&Cl.pattern.hasGlobStar(r.pattern))}};qF.default=UF});var dN=g(WF=>{"use strict";Object.defineProperty(WF,"__esModule",{value:!0});var Tfe=hN(),HF=class extends Tfe.default{match(e){let r=e.split("/"),n=r.length,i=this._storage.filter(s=>!s.complete||s.segments.length>n);for(let s of i){let o=s.sections[0];if(!s.complete&&n>o.length||r.every((u,c)=>{let l=s.segments[c];return!!(l.dynamic&&l.patternRe.test(u)||!l.dynamic&&l.pattern===u)}))return!0}return!1}};WF.default=HF});var pN=g(VF=>{"use strict";Object.defineProperty(VF,"__esModule",{value:!0});var Mp=Xn(),kfe=dN(),GF=class{constructor(e,r){this._settings=e,this._micromatchOptions=r}getFilter(e,r,n){let i=this._getMatcher(r),s=this._getNegativePatternsRe(n);return o=>this._filter(e,o,i,s)}_getMatcher(e){return new kfe.default(e,this._settings,this._micromatchOptions)}_getNegativePatternsRe(e){let r=e.filter(Mp.pattern.isAffectDepthOfReadingPattern);return Mp.pattern.convertPatternsToRe(r,this._micromatchOptions)}_filter(e,r,n,i){if(this._isSkippedByDeep(e,r.path)||this._isSkippedSymbolicLink(r))return!1;let s=Mp.path.removeLeadingDotSegment(r.path);return this._isSkippedByPositivePatterns(s,n)?!1:this._isSkippedByNegativePatterns(s,i)}_isSkippedByDeep(e,r){return this._settings.deep===1/0?!1:this._getEntryLevel(e,r)>=this._settings.deep}_getEntryLevel(e,r){let n=r.split("/").length;if(e==="")return n;let i=e.split("/").length;return n-i}_isSkippedSymbolicLink(e){return!this._settings.followSymbolicLinks&&e.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(e,r){return!this._settings.baseNameMatch&&!r.match(e)}_isSkippedByNegativePatterns(e,r){return!Mp.pattern.matchAny(e,r)}};VF.default=GF});var mN=g(KF=>{"use strict";Object.defineProperty(KF,"__esModule",{value:!0});var Wi=Xn(),zF=class{constructor(e,r){this._settings=e,this._micromatchOptions=r,this.index=new Map}getFilter(e,r){let[n,i]=Wi.pattern.partitionAbsoluteAndRelative(r),s={positive:{all:Wi.pattern.convertPatternsToRe(e,this._micromatchOptions)},negative:{absolute:Wi.pattern.convertPatternsToRe(n,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:Wi.pattern.convertPatternsToRe(i,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return o=>this._filter(o,s)}_filter(e,r){let n=Wi.path.removeLeadingDotSegment(e.path);if(this._settings.unique&&this._isDuplicateEntry(n)||this._onlyFileFilter(e)||this._onlyDirectoryFilter(e))return!1;let i=this._isMatchToPatternsSet(n,r,e.dirent.isDirectory());return this._settings.unique&&i&&this._createIndexRecord(n),i}_isDuplicateEntry(e){return this.index.has(e)}_createIndexRecord(e){this.index.set(e,void 0)}_onlyFileFilter(e){return this._settings.onlyFiles&&!e.dirent.isFile()}_onlyDirectoryFilter(e){return this._settings.onlyDirectories&&!e.dirent.isDirectory()}_isMatchToPatternsSet(e,r,n){return!(!this._isMatchToPatterns(e,r.positive.all,n)||this._isMatchToPatterns(e,r.negative.relative,n)||this._isMatchToAbsoluteNegative(e,r.negative.absolute,n))}_isMatchToAbsoluteNegative(e,r,n){if(r.length===0)return!1;let i=Wi.path.makeAbsolute(this._settings.cwd,e);return this._isMatchToPatterns(i,r,n)}_isMatchToPatterns(e,r,n){if(r.length===0)return!1;let i=Wi.pattern.matchAny(e,r);return!i&&n?Wi.pattern.matchAny(e+"/",r):i}};KF.default=zF});var DN=g(ZF=>{"use strict";Object.defineProperty(ZF,"__esModule",{value:!0});var Ofe=Xn(),YF=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(e){return Ofe.errno.isEnoentCodeError(e)||this._settings.suppressErrors}};ZF.default=YF});var xN=g(XF=>{"use strict";Object.defineProperty(XF,"__esModule",{value:!0});var gN=Xn(),JF=class{constructor(e){this._settings=e}getTransformer(){return e=>this._transform(e)}_transform(e){let r=e.path;return this._settings.absolute&&(r=gN.path.makeAbsolute(this._settings.cwd,r),r=gN.path.unixify(r)),this._settings.markDirectories&&e.dirent.isDirectory()&&(r+="/"),this._settings.objectMode?Object.assign(Object.assign({},e),{path:r}):r}};XF.default=JF});var Lp=g(eE=>{"use strict";Object.defineProperty(eE,"__esModule",{value:!0});var Pfe=require("path"),Rfe=pN(),Ife=mN(),Mfe=DN(),Lfe=xN(),QF=class{constructor(e){this._settings=e,this.errorFilter=new Mfe.default(this._settings),this.entryFilter=new Ife.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new Rfe.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new Lfe.default(this._settings)}_getRootDirectory(e){return Pfe.resolve(this._settings.cwd,e.base)}_getReaderOptions(e){let r=e.base==="."?"":e.base;return{basePath:r,pathSegmentSeparator:"/",concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(r,e.positive,e.negative),entryFilter:this.entryFilter.getFilter(e.positive,e.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}};eE.default=QF});var yN=g(rE=>{"use strict";Object.defineProperty(rE,"__esModule",{value:!0});var Nfe=fN(),$fe=Lp(),tE=class extends $fe.default{constructor(){super(...arguments),this._reader=new Nfe.default(this._settings)}async read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e);return(await this.api(r,e,n)).map(s=>n.transform(s))}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}};rE.default=tE});var bN=g(iE=>{"use strict";Object.defineProperty(iE,"__esModule",{value:!0});var jfe=require("stream"),Ufe=NF(),qfe=Lp(),nE=class extends qfe.default{constructor(){super(...arguments),this._reader=new Ufe.default(this._settings)}read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e),i=this.api(r,e,n),s=new jfe.Readable({objectMode:!0,read:()=>{}});return i.once("error",o=>s.emit("error",o)).on("data",o=>s.emit("data",n.transform(o))).once("end",()=>s.emit("end")),s.once("close",()=>i.destroy()),s}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}};iE.default=nE});var FN=g(oE=>{"use strict";Object.defineProperty(oE,"__esModule",{value:!0});var Hfe=Js(),Wfe=Rp(),Gfe=Ip(),sE=class extends Gfe.default{constructor(){super(...arguments),this._walkSync=Wfe.walkSync,this._statSync=Hfe.statSync}dynamic(e,r){return this._walkSync(e,r)}static(e,r){let n=[];for(let i of e){let s=this._getFullEntryPath(i),o=this._getEntry(s,i,r);o===null||!r.entryFilter(o)||n.push(o)}return n}_getEntry(e,r,n){try{let i=this._getStat(e);return this._makeEntry(i,r)}catch(i){if(n.errorFilter(i))return null;throw i}}_getStat(e){return this._statSync(e,this._fsStatSettings)}};oE.default=sE});var EN=g(uE=>{"use strict";Object.defineProperty(uE,"__esModule",{value:!0});var Vfe=FN(),zfe=Lp(),aE=class extends zfe.default{constructor(){super(...arguments),this._reader=new Vfe.default(this._settings)}read(e){let r=this._getRootDirectory(e),n=this._getReaderOptions(e);return this.api(r,e,n).map(n.transform)}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}};uE.default=aE});var CN=g(nu=>{"use strict";Object.defineProperty(nu,"__esModule",{value:!0});nu.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;var ru=require("fs"),Kfe=require("os"),Yfe=Math.max(Kfe.cpus().length,1);nu.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:ru.lstat,lstatSync:ru.lstatSync,stat:ru.stat,statSync:ru.statSync,readdir:ru.readdir,readdirSync:ru.readdirSync};var cE=class{constructor(e={}){this._options=e,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,Yfe),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),this.ignore=[].concat(this.ignore)}_getValue(e,r){return e===void 0?r:e}_getFileSystemMethods(e={}){return Object.assign(Object.assign({},nu.DEFAULT_FILE_SYSTEM_ADAPTER),e)}};nu.default=cE});var dE=g((BBe,SN)=>{"use strict";var wN=SL(),Zfe=yN(),Jfe=bN(),Xfe=EN(),lE=CN(),Ar=Xn();async function fE(t,e){Kr(t);let r=hE(t,Zfe.default,e),n=await Promise.all(r);return Ar.array.flatten(n)}(function(t){t.glob=t,t.globSync=e,t.globStream=r,t.async=t;function e(c,l){Kr(c);let f=hE(c,Xfe.default,l);return Ar.array.flatten(f)}t.sync=e;function r(c,l){Kr(c);let f=hE(c,Jfe.default,l);return Ar.stream.merge(f)}t.stream=r;function n(c,l){Kr(c);let f=[].concat(c),h=new lE.default(l);return wN.generate(f,h)}t.generateTasks=n;function i(c,l){Kr(c);let f=new lE.default(l);return Ar.pattern.isDynamicPattern(c,f)}t.isDynamicPattern=i;function s(c){return Kr(c),Ar.path.escape(c)}t.escapePath=s;function o(c){return Kr(c),Ar.path.convertPathToPattern(c)}t.convertPathToPattern=o;let a;(function(c){function l(h){return Kr(h),Ar.path.escapePosixPath(h)}c.escapePath=l;function f(h){return Kr(h),Ar.path.convertPosixPathToPattern(h)}c.convertPathToPattern=f})(a=t.posix||(t.posix={}));let u;(function(c){function l(h){return Kr(h),Ar.path.escapeWindowsPath(h)}c.escapePath=l;function f(h){return Kr(h),Ar.path.convertWindowsPathToPattern(h)}c.convertPathToPattern=f})(u=t.win32||(t.win32={}))})(fE||(fE={}));function hE(t,e,r){let n=[].concat(t),i=new lE.default(r),s=wN.generate(n,i),o=new e(i);return s.map(o.read,o)}function Kr(t){if(![].concat(t).every(n=>Ar.string.isString(n)&&!Ar.string.isEmpty(n)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}SN.exports=fE});var NN=g((IBe,jp)=>{function ON(t){return Array.isArray(t)?t:[t]}var Qfe=void 0,gE="",TN=" ",DE="\\",ehe=/^\s+$/,the=/(?:[^\\]|^)\\$/,rhe=/^\\!/,nhe=/^\\#/,ihe=/\r?\n/g,she=/^\.{0,2}\/|^\.{1,2}$/,ohe=/\/$/,iu="/",PN="node-ignore";typeof Symbol<"u"&&(PN=Symbol.for("node-ignore"));var RN=PN,su=(t,e,r)=>(Object.defineProperty(t,e,{value:r}),r),ahe=/([0-z])-([0-z])/g,IN=()=>!1,uhe=t=>t.replace(ahe,(e,r,n)=>r.charCodeAt(0)<=n.charCodeAt(0)?e:gE),che=t=>{let{length:e}=t;return t.slice(0,e-e%2)},lhe=[[/^\uFEFF/,()=>gE],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,r)=>e+(r.indexOf("\\")===0?TN:gE)],[/(\\+?)\s/g,(t,e)=>{let{length:r}=e;return e.slice(0,r-r%2)+TN}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,r)=>e+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(t,e,r)=>{let n=r.replace(/\\\*/g,"[^\\/]*");return e+n}],[/\\\\\\(?=[$.|*+(){^])/g,()=>DE],[/\\\\/g,()=>DE],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,n,i)=>e===DE?`\\[${r}${che(n)}${i}`:i==="]"&&n.length%2===0?`[${uhe(r)}${n}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`]],fhe=/(^|\\\/)?\\\*$/,wl="regex",Np="checkRegex",kN="_",hhe={[wl](t,e){return`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`},[Np](t,e){return`${e?`${e}[^/]*`:"[^/]*"}(?=$|\\/$)`}},dhe=t=>lhe.reduce((e,[r,n])=>e.replace(r,n.bind(t)),t),$p=t=>typeof t=="string",phe=t=>t&&$p(t)&&!ehe.test(t)&&!the.test(t)&&t.indexOf("#")!==0,mhe=t=>t.split(ihe).filter(Boolean),xE=class{constructor(e,r,n,i,s,o){this.pattern=e,this.mark=r,this.negative=s,su(this,"body",n),su(this,"ignoreCase",i),su(this,"regexPrefix",o)}get regex(){let e=kN+wl;return this[e]?this[e]:this._make(wl,e)}get checkRegex(){let e=kN+Np;return this[e]?this[e]:this._make(Np,e)}_make(e,r){let n=this.regexPrefix.replace(fhe,hhe[e]),i=this.ignoreCase?new RegExp(n,"i"):new RegExp(n);return su(this,r,i)}},Dhe=({pattern:t,mark:e},r)=>{let n=!1,i=t;i.indexOf("!")===0&&(n=!0,i=i.substr(1)),i=i.replace(rhe,"!").replace(nhe,"#");let s=dhe(i);return new xE(t,e,i,r,n,s)},yE=class{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){if(e&&e[RN]){this._rules=this._rules.concat(e._rules._rules),this._added=!0;return}if($p(e)&&(e={pattern:e}),phe(e.pattern)){let r=Dhe(e,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(e){return this._added=!1,ON($p(e)?mhe(e):e).forEach(this._add,this),this._added}test(e,r,n){let i=!1,s=!1,o;this._rules.forEach(u=>{let{negative:c}=u;s===c&&i!==s||c&&!i&&!s&&!r||!u[n].test(e)||(i=!c,s=c,o=c?Qfe:u)});let a={ignored:i,unignored:s};return o&&(a.rule=o),a}},ghe=(t,e)=>{throw new e(t)},Qn=(t,e,r)=>$p(t)?t?Qn.isNotRelative(t)?r(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${e}\``,TypeError),MN=t=>she.test(t);Qn.isNotRelative=MN;Qn.convert=t=>t;var bE=class{constructor({ignorecase:e=!0,ignoreCase:r=e,allowRelativePaths:n=!1}={}){su(this,RN,!0),this._rules=new yE(r),this._strictPathCheck=!n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,r,n,i){let s=e&&Qn.convert(e);return Qn(s,e,this._strictPathCheck?ghe:IN),this._t(s,r,n,i)}checkIgnore(e){if(!ohe.test(e))return this.test(e);let r=e.split(iu).filter(Boolean);if(r.pop(),r.length){let n=this._t(r.join(iu)+iu,this._testCache,!0,r);if(n.ignored)return n}return this._rules.test(e,!1,Np)}_t(e,r,n,i){if(e in r)return r[e];if(i||(i=e.split(iu).filter(Boolean)),i.pop(),!i.length)return r[e]=this._rules.test(e,n,wl);let s=this._t(i.join(iu)+iu,r,n,i);return r[e]=s.ignored?s:this._rules.test(e,n,wl)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return ON(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},FE=t=>new bE(t),xhe=t=>Qn(t&&Qn.convert(t),t,IN),LN=()=>{let t=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");Qn.convert=t;let e=/^[a-z]:\//i;Qn.isNotRelative=r=>e.test(r)||MN(r)};typeof process<"u"&&process.platform==="win32"&&LN();jp.exports=FE;FE.default=FE;jp.exports.isPathValid=xhe;su(jp.exports,Symbol.for("setupWindows"),LN)});var F$=require("node:process");var kE=(t=0)=>e=>`\x1B[${e+t}m`,OE=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,PE=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,Ee={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},t0e=Object.keys(Ee.modifier),T$=Object.keys(Ee.color),k$=Object.keys(Ee.bgColor),r0e=[...T$,...k$];function O$(){let t=new Map;for(let[e,r]of Object.entries(Ee)){for(let[n,i]of Object.entries(r))Ee[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=Ee[n],t.set(i[0],i[1]);Object.defineProperty(Ee,e,{value:r,enumerable:!1})}return Object.defineProperty(Ee,"codes",{value:t,enumerable:!1}),Ee.color.close="\x1B[39m",Ee.bgColor.close="\x1B[49m",Ee.color.ansi=kE(),Ee.color.ansi256=OE(),Ee.color.ansi16m=PE(),Ee.bgColor.ansi=kE(10),Ee.bgColor.ansi256=OE(10),Ee.bgColor.ansi16m=PE(10),Object.defineProperties(Ee,{rgbToAnsi256:{value(e,r,n){return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(s=>s+s).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>Ee.rgbToAnsi256(...Ee.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,i;if(e>=232)r=((e-232)*10+8)/255,n=r,i=r;else{e-=16;let a=e%36;r=Math.floor(e/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let s=Math.max(r,n,i)*2;if(s===0)return 30;let o=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>Ee.ansi256ToAnsi(Ee.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>Ee.ansi256ToAnsi(Ee.hexToAnsi256(e)),enumerable:!1}}),Ee}var P$=O$(),Tr=P$;var kl=P(require("node:process"),1),IE=P(require("node:os"),1),Gp=P(require("node:tty"),1);function tr(t,e=globalThis.Deno?globalThis.Deno.args:kl.default.argv){let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}var{env:Ce}=kl.default,Tl;tr("no-color")||tr("no-colors")||tr("color=false")||tr("color=never")?Tl=0:(tr("color")||tr("colors")||tr("color=true")||tr("color=always"))&&(Tl=1);function R$(){if("FORCE_COLOR"in Ce)return Ce.FORCE_COLOR==="true"?1:Ce.FORCE_COLOR==="false"?0:Ce.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Ce.FORCE_COLOR,10),3)}function I$(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function M$(t,{streamIsTTY:e,sniffFlags:r=!0}={}){let n=R$();n!==void 0&&(Tl=n);let i=r?Tl:n;if(i===0)return 0;if(r){if(tr("color=16m")||tr("color=full")||tr("color=truecolor"))return 3;if(tr("color=256"))return 2}if("TF_BUILD"in Ce&&"AGENT_NAME"in Ce)return 1;if(t&&!e&&i===void 0)return 0;let s=i||0;if(Ce.TERM==="dumb")return s;if(kl.default.platform==="win32"){let o=IE.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in Ce)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(o=>o in Ce)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in Ce)||Ce.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in Ce)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ce.TEAMCITY_VERSION)?1:0;if(Ce.COLORTERM==="truecolor"||Ce.TERM==="xterm-kitty"||Ce.TERM==="xterm-ghostty"||Ce.TERM==="wezterm")return 3;if("TERM_PROGRAM"in Ce){let o=Number.parseInt((Ce.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ce.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ce.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Ce.TERM)||"COLORTERM"in Ce?1:s}function RE(t,e={}){let r=M$(t,{streamIsTTY:t&&t.isTTY,...e});return I$(r)}var L$={stdout:RE({isTTY:Gp.default.isatty(1)}),stderr:RE({isTTY:Gp.default.isatty(2)})},ME=L$;function LE(t,e,r){let n=t.indexOf(e);if(n===-1)return t;let i=e.length,s=0,o="";do o+=t.slice(s,n)+e+r,s=n+i,n=t.indexOf(e,s);while(n!==-1);return o+=t.slice(s),o}function NE(t,e,r,n){let i=0,s="";do{let o=t[n-1]==="\r";s+=t.slice(i,o?n-1:n)+e+(o?`\r
|
|
118
118
|
`:`
|
|
119
119
|
`)+r,i=n+1,n=t.indexOf(`
|
|
120
120
|
`,i)}while(n!==-1);return s+=t.slice(i),s}var{stdout:$E,stderr:jE}=ME,Vp=Symbol("GENERATOR"),eo=Symbol("STYLER"),lu=Symbol("IS_EMPTY"),UE=["ansi","ansi","ansi256","ansi16m"],to=Object.create(null),N$=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=$E?$E.level:0;t.level=e.level===void 0?r:e.level};var $$=t=>{let e=(...r)=>r.join(" ");return N$(e,t),Object.setPrototypeOf(e,fu.prototype),e};function fu(t){return $$(t)}Object.setPrototypeOf(fu.prototype,Function.prototype);for(let[t,e]of Object.entries(Tr))to[t]={get(){let r=Ol(this,Kp(e.open,e.close,this[eo]),this[lu]);return Object.defineProperty(this,t,{value:r}),r}};to.visible={get(){let t=Ol(this,this[eo],!0);return Object.defineProperty(this,"visible",{value:t}),t}};var zp=(t,e,r,...n)=>t==="rgb"?e==="ansi16m"?Tr[r].ansi16m(...n):e==="ansi256"?Tr[r].ansi256(Tr.rgbToAnsi256(...n)):Tr[r].ansi(Tr.rgbToAnsi(...n)):t==="hex"?zp("rgb",e,r,...Tr.hexToRgb(...n)):Tr[r][t](...n),j$=["rgb","hex","ansi256"];for(let t of j$){to[t]={get(){let{level:r}=this;return function(...n){let i=Kp(zp(t,UE[r],"color",...n),Tr.color.close,this[eo]);return Ol(this,i,this[lu])}}};let e="bg"+t[0].toUpperCase()+t.slice(1);to[e]={get(){let{level:r}=this;return function(...n){let i=Kp(zp(t,UE[r],"bgColor",...n),Tr.bgColor.close,this[eo]);return Ol(this,i,this[lu])}}}}var U$=Object.defineProperties(()=>{},{...to,level:{enumerable:!0,get(){return this[Vp].level},set(t){this[Vp].level=t}}}),Kp=(t,e,r)=>{let n,i;return r===void 0?(n=t,i=e):(n=r.openAll+t,i=e+r.closeAll),{open:t,close:e,openAll:n,closeAll:i,parent:r}},Ol=(t,e,r)=>{let n=(...i)=>q$(n,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(n,U$),n[Vp]=t,n[eo]=e,n[lu]=r,n},q$=(t,e)=>{if(t.level<=0||!e)return t[lu]?"":e;let r=t[eo];if(r===void 0)return e;let{openAll:n,closeAll:i}=r;if(e.includes("\x1B"))for(;r!==void 0;)e=LE(e,r.close,r.open),r=r.parent;let s=e.indexOf(`
|
|
121
|
-
`);return s!==-1&&(e=NE(e,i,n,s)),n+e+i};Object.defineProperties(fu.prototype,to);var H$=fu(),c0e=fu({level:jE?jE.level:0});var E=H$;var e6=P(QE(),1),{program:x0e,createCommand:y0e,createArgument:b0e,createOption:F0e,CommanderError:E0e,InvalidArgumentError:C0e,InvalidOptionArgumentError:w0e,Command:ut,Argument:S0e,Option:v0e,Help:_0e}=e6.default;pm();var Ll=P(m6(),1);function vn(t,e,{target:r="stdout",...n}={}){return Ll.default[r]?Ki.link(t,e):n.fallback===!1?t:typeof n.fallback=="function"?n.fallback(t,e):`${t} (\u200B${e}\u200B)`}vn.isSupported=Ll.default.stdout;vn.stderr=(t,e,r={})=>vn(t,e,{target:"stderr",...r});vn.stderr.isSupported=Ll.default.stderr;var x6=P(g6(),1);var y6=x6.default;var $l=P(require("tty"),1),{env:ti={},argv:F6=[],platform:Uj=""}=typeof process>"u"?{}:process,qj="NO_COLOR"in ti||F6.includes("--no-color"),Hj="FORCE_COLOR"in ti||F6.includes("--color"),Wj=Uj==="win32",E6=ti.TERM==="dumb",Gj=$l&&$l.isatty&&$l.isatty(1)&&ti.TERM&&!E6,Vj="CI"in ti&&("GITHUB_ACTIONS"in ti||"GITLAB_CI"in ti||"CIRCLECI"in ti),zj=!qj&&(Hj||Wj&&!E6||Gj||Vj),C6=(t,e,r,n,i=e.substring(0,t)+n,s=e.substring(t+r.length),o=s.indexOf(r))=>i+(o<0?s:C6(o,s,r,n)),Kj=(t,e,r,n,i)=>t<0?r+e+n:r+C6(t,e,n,i)+n,Yj=(t,e,r=t,n=t.length+1)=>i=>i||!(i===""||i===void 0)?Kj((""+i).indexOf(e,n),i,t,e,r):"",te=(t,e,r)=>Yj(`\x1B[${t}m`,`\x1B[${e}m`,r),b6={reset:te(0,0),bold:te(1,22,"\x1B[22m\x1B[1m"),dim:te(2,22,"\x1B[22m\x1B[2m"),italic:te(3,23),underline:te(4,24),inverse:te(7,27),hidden:te(8,28),strikethrough:te(9,29),black:te(30,39),red:te(31,39),green:te(32,39),yellow:te(33,39),blue:te(34,39),magenta:te(35,39),cyan:te(36,39),white:te(37,39),gray:te(90,39),bgBlack:te(40,49),bgRed:te(41,49),bgGreen:te(42,49),bgYellow:te(43,49),bgBlue:te(44,49),bgMagenta:te(45,49),bgCyan:te(46,49),bgWhite:te(47,49),blackBright:te(90,39),redBright:te(91,39),greenBright:te(92,39),yellowBright:te(93,39),blueBright:te(94,39),magentaBright:te(95,39),cyanBright:te(96,39),whiteBright:te(97,39),bgBlackBright:te(100,49),bgRedBright:te(101,49),bgGreenBright:te(102,49),bgYellowBright:te(103,49),bgBlueBright:te(104,49),bgMagentaBright:te(105,49),bgCyanBright:te(106,49),bgWhiteBright:te(107,49)},bm=({useColor:t=zj}={})=>t?b6:Object.keys(b6).reduce((e,r)=>({...e,[r]:String}),{}),{reset:ede,bold:tde,dim:rde,italic:nde,underline:ide,inverse:sde,hidden:ode,strikethrough:ade,black:ude,red:cde,green:lde,yellow:fde,blue:hde,magenta:dde,cyan:pde,white:mde,gray:Dde,bgBlack:gde,bgRed:xde,bgGreen:yde,bgYellow:bde,bgBlue:Fde,bgMagenta:Ede,bgCyan:Cde,bgWhite:wde,blackBright:Sde,redBright:vde,greenBright:_de,yellowBright:Ade,blueBright:Bde,magentaBright:Tde,cyanBright:kde,whiteBright:Ode,bgBlackBright:Pde,bgRedBright:Rde,bgGreenBright:Ide,bgYellowBright:Mde,bgBlueBright:Lde,bgMagentaBright:Nde,bgCyanBright:$de,bgWhiteBright:jde}=bm();var RC=require("util"),Jm=require("os"),MC=require("string_decoder"),Fu=require("os"),LC=require("stream"),Eu=require("os"),WC=P(S6(),1),VC=require("crypto"),KU=Object.defineProperty,W=(t,e)=>KU(t,"name",{value:e,configurable:!0}),wC="\x1B[",SC={CURSOR_HIDE:wC+"?25l",CURSOR_SHOW:wC+"?25h"};var Jl=(t=>(t.TITLE="TITLE",t.STATE="STATE",t.ENABLED="ENABLED",t.SUBTASK="SUBTASK",t.PROMPT="PROMPT",t.OUTPUT="OUTPUT",t.MESSAGE="MESSAGE",t.CLOSED="CLOSED",t))(Jl||{}),Xl=(t=>(t.WAITING="WAITING",t.STARTED="STARTED",t.COMPLETED="COMPLETED",t.FAILED="FAILED",t.SKIPPED="SKIPPED",t.ROLLING_BACK="ROLLING_BACK",t.ROLLED_BACK="ROLLED_BACK",t.RETRY="RETRY",t.PAUSED="PAUSED",t.PROMPT="PROMPT",t.PROMPT_COMPLETED="PROMPT_COMPLETED",t.PROMPT_FAILED="PROMPT_FAILED",t))(Xl||{}),TC=class{static{W(this,"EventManager")}emitter=new y6;emit(t,e){this.emitter.emit(t,e)}on(t,e){this.emitter.addListener(t,e)}once(t,e){this.emitter.once(t,e)}off(t,e){this.emitter.off(t,e)}complete(){this.emitter.removeAllListeners()}},Qpe=class{static{W(this,"BaseEventMap")}};function kC(t){return!!t&&typeof t=="object"&&typeof t.subscribe=="function"}W(kC,"isObservable");function OC(t){return!!t&&typeof t=="object"&&t.readable===!0&&typeof t.read=="function"&&typeof t.on=="function"}W(OC,"isReadable");function nD(){return!!process.env.LISTR_FORCE_UNICODE||process.platform!=="win32"||!!process.env.CI||!!process.env.WT_SESSION||process.env.TERM_PROGRAM==="vscode"||process.env.TERM==="xterm-256color"||process.env.TERM==="alacritty"}W(nD,"isUnicodeSupported");var YU="(?:\\u001b|\\u009b)\\[[\\=><~/#&.:=?%@~_-]*[0-9]*[\\a-ln-tqyz=><~/#&.:=?%@~_-]+",ZU=/\u0007/;function po(t){return String(t).replace(new RegExp(YU,"gmi"),"").replace(new RegExp(ZU,"gmi"),"").trim()}W(po,"cleanseAnsi");var me=bm();function Zm(t,e){return t.replace(/^(?!\s*$)/gm," ".repeat(e))}W(Zm,"indent");var PC={warning:"\u26A0",cross:"\u2716",arrowDown:"\u2193",tick:"\u2714",arrowRight:"\u2192",pointer:"\u276F",checkboxOn:"\u2612",arrowLeft:"\u2190",squareSmallFilled:"\u25FC",pointerSmall:"\u203A"},JU={...PC,warning:"\u203C",cross:"\xD7",tick:"\u221A",pointer:">",checkboxOn:"[\xD7]",squareSmallFilled:"\u25A0"},_e=nD()?PC:JU;function ho(t,...e){return(0,RC.format)(String(t),...e)}W(ho,"splat");var Zl={icon:{STARTED:_e.pointer,FAILED:_e.cross,SKIPPED:_e.arrowDown,COMPLETED:_e.tick,OUTPUT:_e.pointerSmall,TITLE:_e.arrowRight,RETRY:_e.warning,ROLLBACK:_e.arrowLeft,PAUSED:_e.squareSmallFilled},color:{STARTED:me.yellow,FAILED:me.red,SKIPPED:me.yellow,COMPLETED:me.green,RETRY:me.yellowBright,ROLLBACK:me.redBright,PAUSED:me.yellowBright}},IC=["RETRY","ROLLBACK","FAILED"],Ql=class{constructor(t){this.options=t,this.options={useIcons:!0,toStderr:[],...t??{}},this.options.fields??={},this.options.fields.prefix??=[],this.options.fields.suffix??=[],this.process=this.options.processOutput??new XU}static{W(this,"ListrLogger")}process;log(t,e,r){let n=this.format(t,e,r);if(this.options.toStderr.includes(t)){this.process.toStderr(n);return}this.process.toStdout(n)}toStdout(t,e,r=!0){this.process.toStdout(this.format(null,t,e),r)}toStderr(t,e,r=!0){this.process.toStderr(this.format(null,t,e),r)}wrap(t,e){return t&&this.applyFormat(`[${t}]`,e)}splat(...t){let e=t.shift()??"";return t.length===0?e:ho(e,t)}suffix(t,...e){return e.filter(Boolean).forEach(r=>{if(t+=this.spacing(t),typeof r=="string")t+=this.wrap(r);else if(typeof r=="object"){if(r.args??=[],typeof r.condition=="function"?!r.condition(...r.args):!(r.condition??!0))return t;t+=this.wrap(typeof r.field=="function"?r.field(...r.args):r.field,{format:r?.format(...r.args)})}}),t}prefix(t,...e){return e.filter(Boolean).forEach(r=>{if(t=this.spacing(t)+t,typeof r=="string")t=this.wrap(r)+t;else if(typeof r=="object"){if(r.args??=[],typeof r.condition=="function"?!r.condition(...r.args):!(r.condition??!0))return t;t=this.wrap(typeof r.field=="function"?r.field(...r.args):r.field,{format:r?.format()})+t}}),t}fields(t,e){return this.options?.fields?.prefix&&(t=this.prefix(t,...this.options.fields.prefix)),e?.prefix&&(t=this.prefix(t,...e.prefix)),e?.suffix&&(t=this.suffix(t,...e.suffix)),this.options?.fields?.suffix&&(t=this.suffix(t,...this.options.fields.suffix)),t}icon(t,e){if(!t)return null;if(!e){let n=this.options.icon?.[t];e=typeof n=="function"?n():n}let r=this.options.color?.[t];return e&&r&&(e=r(e)),e}format(t,e,r){return Array.isArray(e)||(e=[e]),e=this.splat(e.shift(),...e).toString().split(Jm.EOL).filter(n=>!n||n.trim()!=="").map(n=>this.style(t,this.fields(n,{prefix:Array.isArray(r?.prefix)?r.prefix:[r?.prefix],suffix:Array.isArray(r?.suffix)?r.suffix:[r?.suffix]}))).join(Jm.EOL),e}style(t,e){if(!t||!e)return e;let r=this.icon(t,!this.options.useIcons&&this.wrap(t));return r&&(e=r+" "+e),e}applyFormat(t,e){return e?.format?e.format(t):t}spacing(t){return typeof t>"u"||t.trim()===""?"":" "}},Xm=class{constructor(t){this.options=t}static{W(this,"ProcessOutputBuffer")}buffer=[];decoder=new MC.StringDecoder;get all(){return this.buffer}get last(){return this.buffer.at(-1)}get length(){return this.buffer.length}write(t,...e){let r=e[e.length-1];return this.buffer.push({time:Date.now(),stream:this.options?.stream,entry:this.decoder.write(typeof t=="string"?Buffer.from(t,typeof e[0]=="string"?e[0]:void 0):Buffer.from(t))}),this.options?.limit&&(this.buffer=this.buffer.slice(-this.options.limit)),typeof r=="function"&&r(),!0}reset(){this.buffer=[]}},vC=class{constructor(t){this.stream=t,this.method=t.write,this.buffer=new Xm({stream:t})}static{W(this,"ProcessOutputStream")}method;buffer;get out(){return Object.assign({},this.stream,{write:this.write.bind(this)})}hijack(){this.stream.write=this.buffer.write.bind(this.buffer)}release(){this.stream.write=this.method;let t=[...this.buffer.all];return this.buffer.reset(),t}write(...t){return this.method.apply(this.stream,t)}},XU=class{constructor(t,e,r){this.options=r,this.stream={stdout:new vC(t??process.stdout),stderr:new vC(e??process.stderr)},this.options={dump:["stdout","stderr"],leaveEmptyLine:!0,...r}}static{W(this,"ProcessOutput")}stream;active;get stdout(){return this.stream.stdout.out}get stderr(){return this.stream.stderr.out}hijack(){if(this.active)throw new Error("ProcessOutput has been already hijacked!");this.stream.stdout.write(SC.CURSOR_HIDE),Object.values(this.stream).forEach(t=>t.hijack()),this.active=!0}release(){let t=Object.entries(this.stream).map(([e,r])=>({name:e,buffer:r.release()})).filter(e=>this.options.dump.includes(e.name)).flatMap(e=>e.buffer).sort((e,r)=>e.time-r.time).map(e=>({...e,entry:po(e.entry)})).filter(e=>e.entry);t.length>0&&(this.options.leaveEmptyLine&&this.stdout.write(Fu.EOL),t.forEach(e=>{(e.stream??this.stdout).write(e.entry+Fu.EOL)})),this.stream.stdout.write(SC.CURSOR_SHOW),this.active=!1}toStdout(t,e=!0){return e&&(t=t+Fu.EOL),this.stream.stdout.write(t)}toStderr(t,e=!0){return e&&(t=t+Fu.EOL),this.stream.stderr.write(t)}};function NC(t){let e=new LC.Writable;return e.rows=1/0,e.columns=1/0,e.write=r=>(t(r.toString()),!0),e}W(NC,"createWritable");var $C=class{constructor(t,e){this.task=t,this.wrapper=e}static{W(this,"ListrPromptAdapter")}state;reportStarted(){if(this.state=this.task.state,this.task.prompt)throw new wu("There is already an active prompt attached to this task which may not be cleaned up properly.");this.task.prompt=this,this.task.state$="PROMPT"}reportFailed(){this.task.state$="PROMPT_FAILED",this.restoreState()}reportCompleted(){this.task.state$="PROMPT_COMPLETED",this.restoreState()}restoreState(){this.task.prompt=void 0,this.state&&(this.task.state=this.state)}},QU=class{static{W(this,"Spinner")}spinner=nD()?["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]:["-","\\","|","/"];id;spinnerPosition=0;spin(){this.spinnerPosition=++this.spinnerPosition%this.spinner.length}fetch(){return this.spinner[this.spinnerPosition]}isRunning(){return!!this.id}start(t,e=100){this.id=setInterval(()=>{this.spin(),t&&t()},e)}stop(){clearInterval(this.id)}};var _C={icon:{SKIPPED_WITH_COLLAPSE:_e.arrowDown,SKIPPED_WITHOUT_COLLAPSE:_e.warning,OUTPUT:_e.pointerSmall,OUTPUT_WITH_BOTTOMBAR:_e.pointerSmall,PENDING:_e.pointer,COMPLETED:_e.tick,COMPLETED_WITH_FAILED_SUBTASKS:_e.warning,COMPLETED_WITH_SISTER_TASKS_FAILED:_e.squareSmallFilled,RETRY:_e.warning,ROLLING_BACK:_e.warning,ROLLED_BACK:_e.arrowLeft,FAILED:_e.cross,FAILED_WITH_SUBTASKS:_e.pointer,WAITING:_e.squareSmallFilled,PAUSED:_e.squareSmallFilled},color:{SKIPPED_WITH_COLLAPSE:me.yellow,SKIPPED_WITHOUT_COLLAPSE:me.yellow,PENDING:me.yellow,COMPLETED:me.green,COMPLETED_WITH_FAILED_SUBTASKS:me.yellow,COMPLETED_WITH_SISTER_TASKS_FAILED:me.red,RETRY:me.yellowBright,ROLLING_BACK:me.redBright,ROLLED_BACK:me.redBright,FAILED:me.red,FAILED_WITH_SUBTASKS:me.red,WAITING:me.dim,PAUSED:me.yellowBright}};function jC(t){let e=Math.floor(t/1e3),r=Math.floor(e/60),n;return e===0&&r===0&&(n=`0.${Math.floor(t/100)}s`),e>0&&(n=`${e%60}s`),r>0&&(n=`${r}m${n}`),n}W(jC,"parseTimer");var iD={condition:!0,field:jC,format:W(()=>me.dim,"format")};function eq(){let t=new Date;return String(t.getHours()).padStart(2,"0")+":"+String(t.getMinutes()).padStart(2,"0")+":"+String(t.getSeconds()).padStart(2,"0")}W(eq,"parseTimestamp");var tq=class Qm{constructor(e,r,n){this.tasks=e,this.options=r,this.events=n,this.options={...Qm.rendererOptions,...this.options,icon:{..._C.icon,...r?.icon??{}},color:{..._C.color,...r?.color??{}}},this.spinner=this.options.spinner??new QU,this.logger=this.options.logger??new Ql({useIcons:!0,toStderr:[]}),this.logger.options.icon=this.options.icon,this.logger.options.color=this.options.color}static{W(this,"DefaultRenderer")}static nonTTY=!1;static rendererOptions={indentation:2,clearOutput:!1,showSubtasks:!0,collapseSubtasks:!0,collapseSkips:!0,showSkipMessage:!0,suffixSkips:!1,collapseErrors:!0,showErrorMessage:!0,suffixRetries:!0,lazy:!1,removeEmptyLines:!0,formatOutput:"wrap",pausedTimer:{...iD,format:W(()=>me.yellowBright,"format")}};static rendererTaskOptions={outputBar:!0};prompt;activePrompt;spinner;logger;updater;truncate;wrap;buffer={output:new Map,bottom:new Map};cache={render:new Map,rendererOptions:new Map,rendererTaskOptions:new Map};async render(){let{createLogUpdate:e}=await Promise.resolve().then(()=>(oC(),sC)),{default:r}=await Promise.resolve().then(()=>(CC(),EC)),{default:n}=await Promise.resolve().then(()=>(Im(),Y6));this.updater=e(this.logger.process.stdout),this.truncate=r,this.wrap=n,this.logger.process.hijack(),this.options?.lazy||this.spinner.start(()=>{this.update()}),this.events.on("SHOUD_REFRESH_RENDER",()=>{this.update()})}update(){this.updater(this.create())}end(){this.spinner.stop(),this.updater.clear(),this.updater.done(),this.options.clearOutput||this.logger.process.toStdout(this.create({prompt:!1})),this.logger.process.release()}create(e){e={tasks:!0,bottomBar:!0,prompt:!0,...e};let r=[],n=this.renderer(this.tasks),i=this.renderBottomBar(),s=this.renderPrompt();return e.tasks&&n.length>0&&r.push(...n),e.bottomBar&&i.length>0&&(r.length>0&&r.push(""),r.push(...i)),e.prompt&&s.length>0&&(r.length>0&&r.push(""),r.push(...s)),r.join(Eu.EOL)}style(e,r=!1){let n=this.cache.rendererOptions.get(e.id);if(e.isSkipped()){if(r||n.collapseSkips)return this.logger.icon("SKIPPED_WITH_COLLAPSE");if(n.collapseSkips===!1)return this.logger.icon("SKIPPED_WITHOUT_COLLAPSE")}if(r)return this.shouldOutputToBottomBar(e)?this.logger.icon("OUTPUT_WITH_BOTTOMBAR"):this.logger.icon("OUTPUT");if(e.hasSubtasks()){if(e.isStarted()||e.isPrompt()&&n.showSubtasks!==!1&&!e.subtasks.every(i=>!i.hasTitle()))return this.logger.icon("PENDING");if(e.isCompleted()&&e.subtasks.some(i=>i.hasFailed()))return this.logger.icon("COMPLETED_WITH_FAILED_SUBTASKS");if(e.hasFailed())return this.logger.icon("FAILED_WITH_SUBTASKS")}return e.isStarted()||e.isPrompt()?this.logger.icon("PENDING",!this.options?.lazy&&this.spinner.fetch()):e.isCompleted()?this.logger.icon("COMPLETED"):e.isRetrying()?this.logger.icon("RETRY",!this.options?.lazy&&this.spinner.fetch()):e.isRollingBack()?this.logger.icon("ROLLING_BACK",!this.options?.lazy&&this.spinner.fetch()):e.hasRolledBack()?this.logger.icon("ROLLED_BACK"):e.hasFailed()?this.logger.icon("FAILED"):e.isPaused()?this.logger.icon("PAUSED"):this.logger.icon("WAITING")}format(e,r,n){if(e.trim()==="")return[];r&&(e=r+" "+e);let i,s=(process.stdout.columns??80)-n*this.options.indentation-2;switch(this.options.formatOutput){case"truncate":i=e.split(Eu.EOL).map((o,a)=>this.truncate(this.indent(o,a),s));break;case"wrap":i=this.wrap(e,s,{hard:!0,trim:!1}).split(Eu.EOL).map((o,a)=>this.indent(o,a));break;default:throw new AC("Format option for the renderer is wrong.")}return this.options.removeEmptyLines&&(i=i.filter(Boolean)),i.map(o=>Zm(o,n*this.options.indentation))}shouldOutputToOutputBar(e){let r=this.cache.rendererTaskOptions.get(e.id).outputBar;return typeof r=="number"&&r!==0||typeof r=="boolean"&&r!==!1}shouldOutputToBottomBar(e){let r=this.cache.rendererTaskOptions.get(e.id).bottomBar;return typeof r=="number"&&r!==0||typeof r=="boolean"&&r!==!1||!e.hasTitle()}renderer(e,r=0){return e.flatMap(n=>{if(!n.isEnabled())return[];if(this.cache.render.has(n.id))return this.cache.render.get(n.id);this.calculate(n),this.setupBuffer(n);let i=this.cache.rendererOptions.get(n.id),s=this.cache.rendererTaskOptions.get(n.id),o=[];if(n.isPrompt()){if(this.activePrompt&&this.activePrompt!==n.id)throw new AC("Only one prompt can be active at the given time, please re-evaluate your task design.");this.activePrompt||(n.on("PROMPT",a=>{let u=po(a);u&&(this.prompt=u)}),n.on("STATE",a=>{(a==="PROMPT_COMPLETED"||n.hasFinalized()||n.hasReset())&&(this.prompt=null,this.activePrompt=null,n.off("PROMPT"))}),this.activePrompt=n.id)}if(n.hasTitle()&&(e.some(a=>a.hasFailed())&&!n.hasFailed()&&n.options.exitOnError!==!1&&!(n.isCompleted()||n.isSkipped())?o.push(...this.format(n.title,this.logger.icon("COMPLETED_WITH_SISTER_TASKS_FAILED"),r)):n.hasFailed()&&i.collapseErrors?o.push(...this.format(!n.hasSubtasks()&&n.message.error&&i.showErrorMessage?n.message.error:n.title,this.style(n),r)):n.isSkipped()&&i.collapseSkips?o.push(...this.format(this.logger.suffix(n.message.skip&&i.showSkipMessage?n.message.skip:n.title,{field:"SKIPPED",condition:i.suffixSkips,format:W(()=>me.dim,"format")}),this.style(n),r)):n.isRetrying()?o.push(...this.format(this.logger.suffix(n.title,{field:`RETRY:${n.message.retry.count}`,format:W(()=>me.yellow,"format"),condition:i.suffixRetries}),this.style(n),r)):n.isCompleted()&&n.hasTitle()&&Ji(s.timer?.condition,n.message.duration)?o.push(...this.format(this.logger.suffix(n?.title,{...s.timer,args:[n.message.duration]}),this.style(n),r)):n.isPaused()?o.push(...this.format(this.logger.suffix(n.title,{...i.pausedTimer,args:[n.message.paused-Date.now()]}),this.style(n),r)):o.push(...this.format(n.title,this.style(n),r))),(!n.hasSubtasks()||!i.showSubtasks)&&(n.hasFailed()&&i.collapseErrors===!1&&(i.showErrorMessage||!i.showSubtasks)?o.push(...this.dump(n,r,"FAILED")):n.isSkipped()&&i.collapseSkips===!1&&(i.showSkipMessage||!i.showSubtasks)&&o.push(...this.dump(n,r,"SKIPPED"))),(n.isPending()||s.persistentOutput)&&o.push(...this.renderOutputBar(n,r)),i.showSubtasks!==!1&&n.hasSubtasks()&&(n.isPending()||n.hasFinalized()&&!n.hasTitle()||n.isCompleted()&&i.collapseSubtasks===!1&&!n.subtasks.some(a=>this.cache.rendererOptions.get(a.id)?.collapseSubtasks===!0)||n.subtasks.some(a=>this.cache.rendererOptions.get(a.id)?.collapseSubtasks===!1)||n.subtasks.some(a=>a.hasFailed())||n.subtasks.some(a=>a.hasRolledBack()))){let a=n.hasTitle()?r+1:r,u=this.renderer(n.subtasks,a);o.push(...u)}return n.hasFinalized()&&(s.persistentOutput||(this.buffer.bottom.delete(n.id),this.buffer.output.delete(n.id))),n.isClosed()&&(this.cache.render.set(n.id,o),this.reset(n)),o})}renderOutputBar(e,r){let n=this.buffer.output.get(e.id);return n?n.all.flatMap(i=>this.dump(e,r,"OUTPUT",i.entry)):[]}renderBottomBar(){return this.buffer.bottom.size===0?[]:Array.from(this.buffer.bottom.values()).flatMap(e=>e.all).sort((e,r)=>e.time-r.time).map(e=>e.entry)}renderPrompt(){return this.prompt?[this.prompt]:[]}calculate(e){if(this.cache.rendererOptions.has(e.id)&&this.cache.rendererTaskOptions.has(e.id))return;let r={...this.options,...e.rendererOptions};this.cache.rendererOptions.set(e.id,r),this.cache.rendererTaskOptions.set(e.id,{...Qm.rendererTaskOptions,timer:r.timer,...e.rendererTaskOptions})}setupBuffer(e){if(this.buffer.bottom.has(e.id)||this.buffer.output.has(e.id))return;let r=this.cache.rendererTaskOptions.get(e.id);this.shouldOutputToBottomBar(e)&&!this.buffer.bottom.has(e.id)?(this.buffer.bottom.set(e.id,new Xm({limit:typeof r.bottomBar=="number"?r.bottomBar:1})),e.on("OUTPUT",n=>{let i=this.dump(e,-1,"OUTPUT",n);this.buffer.bottom.get(e.id).write(i.join(Eu.EOL))}),e.on("STATE",n=>{switch(n){case"RETRY":this.buffer.bottom.delete(e.id);break}})):this.shouldOutputToOutputBar(e)&&!this.buffer.output.has(e.id)&&(this.buffer.output.set(e.id,new Xm({limit:typeof r.outputBar=="number"?r.outputBar:1})),e.on("OUTPUT",n=>{this.buffer.output.get(e.id).write(n)}),e.on("STATE",n=>{switch(n){case"RETRY":this.buffer.output.delete(e.id);break}}))}reset(e){this.cache.rendererOptions.delete(e.id),this.cache.rendererTaskOptions.delete(e.id),this.buffer.output.delete(e.id)}dump(e,r,n="OUTPUT",i){if(!i)switch(n){case"OUTPUT":i=e.output;break;case"SKIPPED":i=e.message.skip;break;case"FAILED":i=e.message.error;break}return e.hasTitle()&&n==="FAILED"&&i===e.title||typeof i!="string"?[]:(n==="OUTPUT"&&(i=po(i)),this.format(i,this.style(e,!0),r+1))}indent(e,r){return r>0?Zm(e.trimEnd(),this.options.indentation):e.trimEnd()}},rq=class{constructor(t,e){this.tasks=t,this.options=e}static{W(this,"SilentRenderer")}static nonTTY=!0;static rendererOptions;static rendererTaskOptions;render(){}end(){}},nq=class eD{constructor(e,r){this.tasks=e,this.options=r,this.options={...eD.rendererOptions,...r,icon:{...Zl.icon,...r?.icon??{}},color:{...Zl.color,...r?.color??{}}},this.logger=this.options.logger??new Ql({useIcons:!0,toStderr:IC}),this.logger.options.icon=this.options.icon,this.logger.options.color=this.options.color,this.options.timestamp&&this.logger.options.fields.prefix.unshift(this.options.timestamp)}static{W(this,"SimpleRenderer")}static nonTTY=!0;static rendererOptions={pausedTimer:{...iD,field:W(e=>`PAUSED:${e}`,"field"),format:W(()=>me.yellowBright,"format")}};static rendererTaskOptions={};logger;cache={rendererOptions:new Map,rendererTaskOptions:new Map};end(){}render(){this.renderer(this.tasks)}renderer(e){e.forEach(r=>{this.calculate(r),r.once("CLOSED",()=>{this.reset(r)});let n=this.cache.rendererOptions.get(r.id),i=this.cache.rendererTaskOptions.get(r.id);r.on("SUBTASK",s=>{this.renderer(s)}),r.on("STATE",s=>{if(r.hasTitle())if(s==="STARTED")this.logger.log("STARTED",r.title);else if(s==="COMPLETED"){let o=i?.timer;this.logger.log("COMPLETED",r.title,o&&{suffix:{...o,condition:!!r.message?.duration&&o.condition,args:[r.message.duration]}})}else s==="PROMPT"?(this.logger.process.hijack(),r.on("PROMPT",o=>{this.logger.process.toStderr(o,!1)})):s==="PROMPT_COMPLETED"&&(r.off("PROMPT"),this.logger.process.release())}),r.on("OUTPUT",s=>{this.logger.log("OUTPUT",s)}),r.on("MESSAGE",s=>{if(s.error)this.logger.log("FAILED",r.title,{suffix:{field:`FAILED: ${s.error}`,format:W(()=>me.red,"format")}});else if(s.skip)this.logger.log("SKIPPED",r.title,{suffix:{field:`SKIPPED: ${s.skip}`,format:W(()=>me.yellow,"format")}});else if(s.rollback)this.logger.log("ROLLBACK",r.title,{suffix:{field:`ROLLBACK: ${s.rollback}`,format:W(()=>me.red,"format")}});else if(s.retry)this.logger.log("RETRY",r.title,{suffix:{field:`RETRY:${s.retry.count}`,format:W(()=>me.red,"format")}});else if(s.paused){let o=n?.pausedTimer;this.logger.log("PAUSED",r.title,o&&{suffix:{...o,condition:!!s?.paused&&o.condition,args:[s.paused-Date.now()]}})}})})}calculate(e){if(this.cache.rendererOptions.has(e.id)&&this.cache.rendererTaskOptions.has(e.id))return;let r={...this.options,...e.rendererOptions};this.cache.rendererOptions.set(e.id,r),this.cache.rendererTaskOptions.set(e.id,{...eD.rendererTaskOptions,timer:r.timer,...e.rendererTaskOptions})}reset(e){this.cache.rendererOptions.delete(e.id),this.cache.rendererTaskOptions.delete(e.id)}},iq=class{constructor(t){this.options=t}static{W(this,"TestRendererSerializer")}serialize(t,e,r){return JSON.stringify(this.generate(t,e,r))}generate(t,e,r){let n={event:t,data:e};if(typeof this.options?.task!="boolean"){let i=Object.fromEntries(this.options.task.map(s=>{let o=r[s];return typeof o=="function"?[s,o.call(r)]:[s,o]}));Object.keys(r).length>0&&(n.task=i)}return n}},sq=class UC{constructor(e,r){this.tasks=e,this.options=r,this.options={...UC.rendererOptions,...this.options},this.logger=this.options.logger??new Ql({useIcons:!1}),this.serializer=new iq(this.options)}static{W(this,"TestRenderer")}static nonTTY=!0;static rendererOptions={subtasks:!0,state:Object.values(Xl),output:!0,prompt:!0,title:!0,messages:["skip","error","retry","rollback","paused"],messagesToStderr:["error","rollback","retry"],task:["hasRolledBack","isRollingBack","isCompleted","isSkipped","hasFinalized","hasSubtasks","title","hasReset","hasTitle","isPrompt","isPaused","isPending","isSkipped","isStarted","hasFailed","isEnabled","isRetrying","path"]};static rendererTaskOptions;logger;serializer;render(){this.renderer(this.tasks)}end(){}renderer(e){e.forEach(r=>{this.options.subtasks&&r.on("SUBTASK",n=>{this.renderer(n)}),this.options.state&&r.on("STATE",n=>{this.logger.toStdout(this.serializer.serialize("STATE",n,r))}),this.options.output&&r.on("OUTPUT",n=>{this.logger.toStdout(this.serializer.serialize("OUTPUT",n,r))}),this.options.prompt&&r.on("PROMPT",n=>{this.logger.toStdout(this.serializer.serialize("PROMPT",n,r))}),this.options.title&&r.on("TITLE",n=>{this.logger.toStdout(this.serializer.serialize("TITLE",n,r))}),r.on("MESSAGE",n=>{let i=Object.fromEntries(Object.entries(n).map(([s,o])=>{if(this.options.messages.includes(s))return[s,o]}).filter(Boolean));if(Object.keys(i).length>0){let s=this.serializer.serialize("MESSAGE",i,r);this.options.messagesToStderr.some(o=>Object.keys(i).includes(o))?this.logger.toStderr(s):this.logger.toStdout(s)}})})}},oq=class tD{constructor(e,r){this.tasks=e,this.options=r,this.options={...tD.rendererOptions,...this.options,icon:{...Zl.icon,...r?.icon??{}},color:{...Zl.color,...r?.color??{}}},this.logger=this.options.logger??new Ql({useIcons:!1,toStderr:IC}),this.logger.options.icon=this.options.icon,this.logger.options.color=this.options.color,this.options.timestamp&&this.logger.options.fields.prefix.unshift(this.options.timestamp)}static{W(this,"VerboseRenderer")}static nonTTY=!0;static rendererOptions={logTitleChange:!1,pausedTimer:{...iD,format:W(()=>me.yellowBright,"format")}};static rendererTaskOptions;logger;cache={rendererOptions:new Map,rendererTaskOptions:new Map};render(){this.renderer(this.tasks)}end(){}renderer(e){e.forEach(r=>{this.calculate(r),r.once("CLOSED",()=>{this.reset(r)});let n=this.cache.rendererOptions.get(r.id),i=this.cache.rendererTaskOptions.get(r.id);r.on("SUBTASK",s=>{this.renderer(s)}),r.on("STATE",s=>{if(r.hasTitle()){if(s==="STARTED")this.logger.log("STARTED",r.title);else if(s==="COMPLETED"){let o=i.timer;this.logger.log("COMPLETED",r.title,o&&{suffix:{...o,condition:!!r.message?.duration&&o.condition,args:[r.message.duration]}})}}}),r.on("OUTPUT",s=>{this.logger.log("OUTPUT",s)}),r.on("PROMPT",s=>{let o=po(s);o&&this.logger.log("PROMPT",o)}),this.options?.logTitleChange!==!1&&r.on("TITLE",s=>{this.logger.log("TITLE",s)}),r.on("MESSAGE",s=>{if(s?.error)this.logger.log("FAILED",s.error);else if(s?.skip)this.logger.log("SKIPPED",s.skip);else if(s?.rollback)this.logger.log("ROLLBACK",s.rollback);else if(s?.retry)this.logger.log("RETRY",r.title,{suffix:s.retry.count.toString()});else if(s?.paused){let o=n?.pausedTimer;this.logger.log("PAUSED",r.title,o&&{suffix:{...o,condition:!!s?.paused&&o.condition,args:[s.paused-Date.now()]}})}})})}calculate(e){if(this.cache.rendererOptions.has(e.id)&&this.cache.rendererTaskOptions.has(e.id))return;let r={...this.options,...e.rendererOptions};this.cache.rendererOptions.set(e.id,r),this.cache.rendererTaskOptions.set(e.id,{...tD.rendererTaskOptions,timer:r.timer,...e.rendererTaskOptions})}reset(e){this.cache.rendererOptions.delete(e.id),this.cache.rendererTaskOptions.delete(e.id)}},Ym={default:tq,simple:nq,verbose:oq,test:sq,silent:rq};function qC(t){return process.stdout.isTTY===!0||t.nonTTY===!0}W(qC,"isRendererSupported");function Cu(t){return typeof t=="string"?Ym[t]??Ym.default:typeof t=="function"?t:Ym.default}W(Cu,"getRendererClass");function HC(t){if(Ji(t?.silentRendererCondition))return{renderer:Cu("silent"),selection:"SILENT"};let e={renderer:Cu(t.renderer),options:t.rendererOptions,selection:"PRIMARY"};return!qC(e.renderer)||Ji(t?.fallbackRendererCondition)?{renderer:Cu(t.fallbackRenderer),options:t.fallbackRendererOptions,selection:"SECONDARY"}:e}W(HC,"getRenderer");function Ji(t,...e){return typeof t=="function"?t(...e):t}W(Ji,"assertFunctionOrSelf");var aq=(0,WC.default)({circles:!0});function rD(t){return aq(t)}W(rD,"cloneObject");var uq=class{static{W(this,"Concurrency")}concurrency;count;queue;constructor(t){this.concurrency=t.concurrency,this.count=0,this.queue=new Set}add(t){return this.count<this.concurrency?this.run(t):new Promise(e=>{let r=W(()=>e(this.run(t)),"callback");this.queue.add(r)})}flush(){for(let t of this.queue){if(this.count>=this.concurrency)break;this.queue.delete(t),t()}}run(t){this.count++;let e=t(),r=W(()=>{this.count--,this.flush()},"cleanup");return e.then(r,()=>{this.queue.clear()}),e}};function GC(t){return new Promise(e=>{setTimeout(e,t)})}W(GC,"delay");var cq=class extends Error{constructor(t,e,r){super(t.message),this.error=t,this.type=e,this.task=r,this.name="ListrError",this.path=r.path,r?.options.collectErrors==="full"&&(this.task=rD(r),this.ctx=rD(r.listr.ctx)),this.stack=t?.stack}static{W(this,"ListrError")}path;ctx},AC=class extends Error{static{W(this,"ListrRendererError")}},wu=class extends Error{static{W(this,"PromptError")}},lq=class{constructor(t){this.task=t}static{W(this,"TaskWrapper")}get title(){return this.task.title}set title(t){t=Array.isArray(t)?t:[t],this.task.title$=ho(t.shift(),...t)}get output(){return this.task.output}set output(t){t=Array.isArray(t)?t:[t],this.task.output$=ho(t.shift(),...t)}set promptOutput(t){this.task.promptOutput$=t}newListr(t,e){let r;return typeof t=="function"?r=t(this):r=t,new Su(r,e,this.task)}report(t,e){this.task.options.collectErrors!==!1&&this.task.listr.errors.push(new cq(t,e,this.task)),this.task.message$={error:t.message??this.task?.title}}skip(t,...e){this.task.state$="SKIPPED",t&&(this.task.message$={skip:t?ho(t,...e):this.task?.title})}isRetrying(){return this.task.isRetrying()?this.task.retry:{count:0}}prompt(t){return this.task.prompt?this.task.prompt:new t(this.task,this)}stdout(t){return NC(e=>{switch(t){case"PROMPT":this.promptOutput=e;break;default:this.output=e}})}run(t){return this.task.run(t,this)}},fq=class extends TC{static{W(this,"ListrTaskEventManager")}},hq=class extends fq{constructor(t,e,r,n,i){if(super(),this.listr=t,this.task=e,this.options=r,this.rendererOptions=n,this.rendererTaskOptions=i,e.title){let s=Array.isArray(e?.title)?e.title:[e.title];this.title=ho(s.shift(),...s),this.initialTitle=this.title}this.taskFn=e.task,this.parent=t.parentTask}static{W(this,"Task")}id=(0,VC.randomUUID)();state="WAITING";subtasks;title;initialTitle;output;retry;message={};prompt;parent;enabled;taskFn;closed;set state$(t){if(this.state=t,this.emit("STATE",t),this.hasSubtasks()&&this.hasFailed())for(let e of this.subtasks)e.state==="STARTED"&&(e.state$="FAILED");this.listr.events.emit("SHOUD_REFRESH_RENDER")}set output$(t){this.output=t,this.emit("OUTPUT",t),this.listr.events.emit("SHOUD_REFRESH_RENDER")}set promptOutput$(t){this.emit("PROMPT",t),po(t)&&this.listr.events.emit("SHOUD_REFRESH_RENDER")}set message$(t){this.message={...this.message,...t},this.emit("MESSAGE",t),this.listr.events.emit("SHOUD_REFRESH_RENDER")}set title$(t){this.title=t,this.emit("TITLE",t),this.listr.events.emit("SHOUD_REFRESH_RENDER")}get path(){return[...this.listr.path,this.initialTitle]}async check(t){return this.state==="WAITING"&&(this.enabled=await Ji(this.task?.enabled??!0,t),this.emit("ENABLED",this.enabled),this.listr.events.emit("SHOUD_REFRESH_RENDER")),this.enabled}hasSubtasks(){return this.subtasks?.length>0}hasFinalized(){return this.isCompleted()||this.hasFailed()||this.isSkipped()||this.hasRolledBack()}isPending(){return this.isStarted()||this.isPrompt()||this.hasReset()}isStarted(){return this.state==="STARTED"}isSkipped(){return this.state==="SKIPPED"}isCompleted(){return this.state==="COMPLETED"}hasFailed(){return this.state==="FAILED"}isRollingBack(){return this.state==="ROLLING_BACK"}hasRolledBack(){return this.state==="ROLLED_BACK"}isRetrying(){return this.state==="RETRY"}hasReset(){return this.state==="RETRY"||this.state==="ROLLING_BACK"}isEnabled(){return this.enabled}hasTitle(){return typeof this?.title=="string"}isPrompt(){return this.state==="PROMPT"||this.state==="PROMPT_COMPLETED"}isPaused(){return this.state==="PAUSED"}isClosed(){return this.closed}async pause(t){let e=this.state;this.state$="PAUSED",this.message$={paused:Date.now()+t},await GC(t),this.state$=e,this.message$={paused:null}}async run(t,e){let r=W(s=>(s instanceof Su?(s.options={...this.options,...s.options},s.rendererClass=Cu("silent"),this.subtasks=s.tasks,s.errors=this.listr.errors,this.emit("SUBTASK",this.subtasks),s=s.run(t)):s instanceof Promise?s=s.then(r):OC(s)?s=new Promise((o,a)=>{s.on("data",u=>{this.output$=u.toString()}),s.on("error",u=>a(u)),s.on("end",()=>o(null))}):kC(s)&&(s=new Promise((o,a)=>{s.subscribe({next:W(u=>{this.output$=u},"next"),error:a,complete:o})})),s),"handleResult"),n=Date.now();this.state$="STARTED";let i=await Ji(this.task?.skip??!1,t);if(i){typeof i=="string"?this.message$={skip:i}:this.hasTitle()?this.message$={skip:this.title}:this.message$={skip:"Skipped task without a title."},this.state$="SKIPPED";return}try{let s=typeof this.task?.retry=="number"&&this.task.retry>0?this.task.retry+1:typeof this.task?.retry=="object"&&this.task.retry.tries>0?this.task.retry.tries+1:1,o=typeof this.task.retry=="object"&&this.task.retry.delay;for(let a=1;a<=s;a++)try{await r(this.taskFn(t,e));break}catch(u){if(a!==s)this.retry={count:a,error:u},this.message$={retry:this.retry},this.title$=this.initialTitle,this.output=void 0,e.report(u,"WILL_RETRY"),this.state$="RETRY",o&&await this.pause(o);else throw u}(this.isStarted()||this.isRetrying())&&(this.message$={duration:Date.now()-n},this.state$="COMPLETED")}catch(s){if(this.prompt instanceof wu&&(s=this.prompt),this.task?.rollback){e.report(s,"WILL_ROLLBACK");try{this.state$="ROLLING_BACK",await this.task.rollback(t,e),this.message$={rollback:this.title},this.state$="ROLLED_BACK"}catch(o){throw this.state$="FAILED",e.report(o,"HAS_FAILED_TO_ROLLBACK"),this.close(),o}if(this.listr.options?.exitAfterRollback!==!1)throw this.close(),s}else{if(this.state$="FAILED",this.listr.options.exitOnError!==!1&&await Ji(this.task?.exitOnError,t)!==!1)throw e.report(s,"HAS_FAILED"),this.close(),s;this.hasSubtasks()||e.report(s,"HAS_FAILED_WITHOUT_ERROR")}}finally{this.close()}}close(){this.emit("CLOSED"),this.listr.events.emit("SHOUD_REFRESH_RENDER"),this.complete()}},BC=class extends TC{static{W(this,"ListrEventManager")}},Su=class{constructor(t,e,r){this.task=t,this.options=e,this.parentTask=r,this.options={concurrent:!1,renderer:"default",fallbackRenderer:"simple",exitOnError:!0,exitAfterRollback:!0,collectErrors:!1,registerSignalListeners:!0,...this.parentTask?.options??{},...e},this.options.concurrent===!0?this.options.concurrent=1/0:typeof this.options.concurrent!="number"&&(this.options.concurrent=1),this.concurrency=new uq({concurrency:this.options.concurrent}),r&&(this.path=[...r.listr.path,r.title],this.errors=r.listr.errors),this.parentTask?.listr.events instanceof BC?this.events=this.parentTask.listr.events:this.events=new BC,(this.options?.forceTTY||process.env.LISTR_FORCE_TTY)&&(process.stdout.isTTY=!0,process.stderr.isTTY=!0),this.options?.forceUnicode&&(process.env.LISTR_FORCE_UNICODE="1");let n=HC({renderer:this.options.renderer,rendererOptions:this.options.rendererOptions,fallbackRenderer:this.options.fallbackRenderer,fallbackRendererOptions:this.options.fallbackRendererOptions,fallbackRendererCondition:this.options?.fallbackRendererCondition,silentRendererCondition:this.options?.silentRendererCondition});this.rendererClass=n.renderer,this.rendererClassOptions=n.options,this.rendererSelection=n.selection,this.add(t??[]),this.options.registerSignalListeners&&(this.boundSignalHandler=this.signalHandler.bind(this),process.once("SIGINT",this.boundSignalHandler).setMaxListeners(0))}static{W(this,"Listr")}tasks=[];errors=[];ctx;events;path=[];rendererClass;rendererClassOptions;rendererSelection;boundSignalHandler;concurrency;renderer;isRoot(){return!this.parentTask}isSubtask(){return!!this.parentTask}add(t){this.tasks.push(...this.generate(t))}async run(t){this.renderer||(this.renderer=new this.rendererClass(this.tasks,this.rendererClassOptions,this.events)),await this.renderer.render(),this.ctx=this.options?.ctx??t??{},await Promise.all(this.tasks.map(e=>e.check(this.ctx)));try{await Promise.all(this.tasks.map(e=>this.concurrency.add(()=>this.runTask(e)))),this.renderer.end(),this.removeSignalHandler()}catch(e){if(this.options.exitOnError!==!1)throw this.renderer.end(e),this.removeSignalHandler(),e}return this.ctx}generate(t){return t=Array.isArray(t)?t:[t],t.map(e=>{let r;return this.rendererSelection==="PRIMARY"?r=e.rendererOptions:this.rendererSelection==="SECONDARY"&&(r=e.fallbackRendererOptions),new hq(this,e,this.options,this.rendererClassOptions,r)})}async runTask(t){if(await t.check(this.ctx))return new lq(t).run(this.ctx)}signalHandler(){this.tasks?.forEach(async t=>{t.isPending()&&(t.state$="FAILED")}),this.isRoot()&&(this.renderer?.end(new Error("Interrupted.")),process.exit(127))}removeSignalHandler(){this.boundSignalHandler&&process.removeListener("SIGINT",this.boundSignalHandler)}};var RH=Object.defineProperty,I8=(t,e)=>RH(t,"name",{value:e,configurable:!0}),qe=class extends $C{static{I8(this,"ListrEnquirerPromptAdapter")}error;prompt;get instance(){return this.prompt}async run(t,e){Array.isArray(t)?t.length===1&&(t=t.map(i=>({...i,name:"default"}))):t=[{...t,name:"default"}],t=t.map(i=>({onCancel:I8(()=>(this.error=new wu("Cancelled prompt."),!0),"onCancel"),...i,stdout:e?.stdout??this.wrapper.stdout(Jl.PROMPT)}));let r;if(e?.enquirer)r=e.enquirer;else try{r=await Promise.resolve().then(()=>P(R8(),1)).then(i=>i.default?new i.default:new i)}catch{throw this.reportFailed(),new wu("Enquirer is a optional peer dependency that must be installed separately.")}this.reportStarted(),this.task.on(Jl.STATE,i=>{i===Xl.SKIPPED&&this.prompt&&!this.error&&this.cancel({throw:!1})});let n;try{n=await r.once("prompt",i=>this.prompt=i).prompt(t)}catch(i){throw this.reportFailed(),this.error?this.error:i}return this.reportCompleted(),t.length===1?n.default:n}cancel(t){!this.prompt||this.error||(t?.throw?this.prompt.cancel():this.prompt.submit(),this.reportFailed())}};var yo=require("node:fs"),q8=require("node:os"),H8=require("node:path");var si=require("node:crypto"),xo=require("node:fs"),ts=require("node:os"),M8=require("node:path"),ZD=(0,M8.join)((0,ts.homedir)(),".platform-sdk-keys"),L8="aes-256-gcm";function N8(){let t=`${(0,ts.hostname)()}:${(0,ts.userInfo)().username}:${(0,ts.homedir)()}`;return(0,si.createHash)("sha256").update(t).digest()}function $8(){if(!(0,xo.existsSync)(ZD))return{};try{return JSON.parse((0,xo.readFileSync)(ZD,"utf-8"))}catch{return{}}}function IH(t){(0,xo.writeFileSync)(ZD,JSON.stringify(t,null,2),{mode:384})}function MH(t){let e=N8(),r=(0,si.randomBytes)(16),n=(0,si.createCipheriv)(L8,e,r),i=n.update(t,"utf8","hex");return i+=n.final("hex"),{iv:r.toString("hex"),tag:n.getAuthTag().toString("hex"),data:i}}function LH(t){let e=N8(),r=Buffer.from(t.iv,"hex"),n=Buffer.from(t.tag,"hex"),i=(0,si.createDecipheriv)(L8,e,r);i.setAuthTag(n);let s=i.update(t.data,"hex","utf8");return s+=i.final("utf8"),s}async function j8(t,e){let r=$8();r[t]=MH(e),IH(r)}async function cf(t){let r=$8()[t];if(!r)return null;try{return LH(r)}catch{return null}}var Tu={openai:{id:"openai",name:"OpenAI",defaultApiKeyEnvVar:"OPENAI_API_KEY",defaultModel:"gpt-4o-mini",modelsApiUrl:"https://api.openai.com/v1/models",apiKeyUrl:"https://platform.openai.com/api-keys",buildHeaders:t=>({Authorization:`Bearer ${t}`}),parseModelsResponse:t=>t.data??[],modelFilters:[/^gpt-4/,/^gpt-3\.5/,/^o1/,/^o3/]},anthropic:{id:"anthropic",name:"Anthropic (Claude)",defaultApiKeyEnvVar:"ANTHROPIC_API_KEY",defaultModel:"claude-sonnet-4-20250514",modelsApiUrl:"https://api.anthropic.com/v1/models",apiKeyUrl:"https://console.anthropic.com/settings/keys",buildHeaders:t=>({"x-api-key":t,"anthropic-version":"2023-06-01"}),parseModelsResponse:t=>(t.data??[]).map(r=>({id:r.id,created:new Date(r.created_at).getTime()})),modelFilters:[/^claude-/]}};function U8(){return Object.entries(Tu).map(([t,e])=>({name:e.name,value:t}))}function ku(t){let e=Tu[t];if(!e)throw new Error(`Unknown AI provider: ${t}`);return e}var rs=(0,H8.join)((0,q8.homedir)(),".platform-sdk-ai.json");function NH(){let t="anthropic",e=Tu[t];return{provider:t,model:e.defaultModel}}var JD=NH();function Ou(){return(0,yo.existsSync)(rs)}function lf(){if(!Ou())throw new Error("AI configuration not found. Please run 'pf ai:setup' to configure your AI provider.");try{let t=(0,yo.readFileSync)(rs,"utf-8"),e=JSON.parse(t);return{...JD,...e}}catch{throw new Error(`Failed to load AI configuration from ${rs}. Please run 'pf setup --ai' again.`)}}function W8(t){let e=JSON.stringify(t,null,2);(0,yo.writeFileSync)(rs,e,"utf-8")}async function G8(t,e){await j8(t,e)}async function V8(t){let e=await cf(t.provider);if(e)return e;let r=Tu[t.provider],n=process.env[r.defaultApiKeyEnvVar];if(n)return n;throw new Error("API key not found. Please run 'pf setup --ai' to configure your API key.")}async function $H(t,e,r,n){let{createOpenAI:i}=await import("@ai-sdk/openai"),s=i({apiKey:r});if(n.onToken){let{streamText:u}=await import("ai"),c=u({model:s(e),prompt:t,system:n.system,maxOutputTokens:n.maxTokens,temperature:n.temperature}),l="";for await(let f of(await c).textStream)l+=f,n.onToken(f);return l}let{generateText:o}=await import("ai"),{text:a}=await o({model:s(e),prompt:t,system:n.system,maxOutputTokens:n.maxTokens,temperature:n.temperature});return a}async function jH(t,e,r,n){let{createAnthropic:i}=await import("@ai-sdk/anthropic"),s=i({apiKey:r});if(n.onToken){let{streamText:u}=await import("ai"),c=u({model:s(e),prompt:t,system:n.system,maxOutputTokens:n.maxTokens,temperature:n.temperature}),l="";for await(let f of(await c).textStream)l+=f,n.onToken(f);return l}let{generateText:o}=await import("ai"),{text:a}=await o({model:s(e),prompt:t,system:n.system,maxOutputTokens:n.maxTokens,temperature:n.temperature});return a}async function z8(t,e,r={}){let{system:n,maxTokens:i=4096,temperature:s=.7,onToken:o}=r,a=await V8(t);switch(t.provider){case"openai":return $H(e,t.model,a,{system:n,maxTokens:i,temperature:s,onToken:o});case"anthropic":return jH(e,t.model,a,{system:n,maxTokens:i,temperature:s,onToken:o});default:throw new Error(`Unsupported AI provider: ${t.provider}`)}}var G0=require("node:fs"),Vc=require("node:path");var rt=(t,e=[])=>t.name==="up"||e.includes("vim")&&t.name==="k"||e.includes("emacs")&&t.ctrl&&t.name==="p",Mt=(t,e=[])=>t.name==="down"||e.includes("vim")&&t.name==="j"||e.includes("emacs")&&t.ctrl&&t.name==="n",XD=t=>t.name==="space",ns=t=>t.name==="backspace",Bn=t=>t.name==="tab",Pu=t=>"1234567890".includes(t.name),Ie=t=>t.name==="enter"||t.name==="return";var ff=class extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(e){super(),this.cause=e?.cause}},hf=class extends Error{name="CancelPromptError";message="Prompt was canceled"},Ru=class extends Error{name="ExitPromptError"},df=class extends Error{name="HookError"},Jr=class extends Error{name="ValidationError"};var J8=require("node:async_hooks");var pf=require("node:async_hooks");var K8=new pf.AsyncLocalStorage;function UH(t){return{rl:t,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function Y8(t,e){let r=UH(t);return K8.run(r,()=>{function n(i){r.handleChange=()=>{r.index=0,i()},r.handleChange()}return e(n)})}function is(){let t=K8.getStore();if(!t)throw new df("[Inquirer] Hook functions can only be called from within a prompt");return t}function QD(){return is().rl}function eg(t){let e=(...r)=>{let n=is(),i=!1,s=n.handleChange;n.handleChange=()=>{i=!0};let o=t(...r);return i&&s(),n.handleChange=s,o};return pf.AsyncResource.bind(e)}function bo(t){let e=is(),{index:r}=e,n={get(){return e.hooks[r]},set(s){e.hooks[r]=s},initialized:r in e.hooks},i=t(n);return e.index++,i}function Z8(){is().handleChange()}var ss={queue(t){let e=is(),{index:r}=e;e.hooksEffect.push(()=>{e.hooksCleanup[r]?.();let n=t(QD());if(n!=null&&typeof n!="function")throw new Jr("useEffect return value must be a cleanup function or nothing.");e.hooksCleanup[r]=n})},run(){let t=is();eg(()=>{t.hooksEffect.forEach(e=>{e()}),t.hooksEffect.length=0})()},clearAll(){let t=is();t.hooksCleanup.forEach(e=>{e?.()}),t.hooksEffect.length=0,t.hooksCleanup.length=0}};function z(t){return bo(e=>{let r=J8.AsyncResource.bind(function(s){e.get()!==s&&(e.set(s),Z8())});if(e.initialized)return[e.get(),r];let n=typeof t=="function"?t():t;return e.set(n),[n,r]})}function Gt(t,e){bo(r=>{let n=r.get();(!Array.isArray(n)||e.some((s,o)=>!Object.is(s,n[o])))&&ss.queue(t),r.set(e)})}var or=P(oi(),1);var Pr=P(require("node:process"),1);function WH(){return Pr.default.platform!=="win32"?Pr.default.env.TERM!=="linux":!!Pr.default.env.WT_SESSION||!!Pr.default.env.TERMINUS_SUBLIME||Pr.default.env.ConEmuTask==="{cmd::Cmder}"||Pr.default.env.TERM_PROGRAM==="Terminus-Sublime"||Pr.default.env.TERM_PROGRAM==="vscode"||Pr.default.env.TERM==="xterm-256color"||Pr.default.env.TERM==="alacritty"||Pr.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Q8={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},eS={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},GH={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},VH={...Q8,...eS},zH={...Q8,...GH},KH=WH(),YH=KH?VH:zH,sr=YH,PDe=Object.entries(eS);var tS={prefix:{idle:or.default.blue("?"),done:or.default.green(sr.tick)},spinner:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"].map(t=>or.default.yellow(t))},style:{answer:or.default.cyan,message:or.default.bold,error:t=>or.default.red(`> ${t}`),defaultAnswer:t=>or.default.dim(`(${t})`),help:or.default.dim,highlight:or.default.cyan,key:t=>or.default.cyan(or.default.bold(`<${t}>`))}};function rS(t){if(typeof t!="object"||t===null)return!1;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function nS(...t){let e={};for(let r of t)for(let[n,i]of Object.entries(r)){let s=e[n];e[n]=rS(s)&&rS(i)?nS(s,i):i}return e}function ke(...t){let e=[tS,...t.filter(r=>r!=null)];return nS(...e)}function Me({status:t="idle",theme:e}){let[r,n]=z(!1),[i,s]=z(0),{prefix:o,spinner:a}=ke(e);return Gt(()=>{if(t==="loading"){let c,l=-1,f=setTimeout(()=>{n(!0),c=setInterval(()=>{l=l+1,s(l%a.frames.length)},a.interval)},300);return()=>{clearTimeout(f),clearInterval(c)}}else n(!1)},[t]),r?a.frames[i]:typeof o=="string"?o:o[t==="loading"?"idle":t]??o.idle}function Lt(t,e){return bo(r=>{let n=r.get();if(!n||n.dependencies.length!==e.length||n.dependencies.some((i,s)=>i!==e[s])){let i=t();return r.set({value:i,dependencies:e}),i}return n.value})}function os(t){return z({current:t})[0]}function Le(t){let e=os(t);e.current=t,Gt(r=>{let n=!1,i=eg((s,o)=>{n||e.current(o,r)});return r.input.on("keypress",i),()=>{n=!0,r.input.removeListener("keypress",i)}},[])}var AS=P(sS(),1),BS=P(_S(),1);function Lu(t,e){return t.split(`
|
|
121
|
+
`);return s!==-1&&(e=NE(e,i,n,s)),n+e+i};Object.defineProperties(fu.prototype,to);var H$=fu(),c0e=fu({level:jE?jE.level:0});var E=H$;var e6=P(QE(),1),{program:x0e,createCommand:y0e,createArgument:b0e,createOption:F0e,CommanderError:E0e,InvalidArgumentError:C0e,InvalidOptionArgumentError:w0e,Command:ut,Argument:S0e,Option:v0e,Help:_0e}=e6.default;pm();var Ll=P(m6(),1);function vn(t,e,{target:r="stdout",...n}={}){return Ll.default[r]?Ki.link(t,e):n.fallback===!1?t:typeof n.fallback=="function"?n.fallback(t,e):`${t} (\u200B${e}\u200B)`}vn.isSupported=Ll.default.stdout;vn.stderr=(t,e,r={})=>vn(t,e,{target:"stderr",...r});vn.stderr.isSupported=Ll.default.stderr;var x6=P(g6(),1);var y6=x6.default;var $l=P(require("tty"),1),{env:ti={},argv:F6=[],platform:Uj=""}=typeof process>"u"?{}:process,qj="NO_COLOR"in ti||F6.includes("--no-color"),Hj="FORCE_COLOR"in ti||F6.includes("--color"),Wj=Uj==="win32",E6=ti.TERM==="dumb",Gj=$l&&$l.isatty&&$l.isatty(1)&&ti.TERM&&!E6,Vj="CI"in ti&&("GITHUB_ACTIONS"in ti||"GITLAB_CI"in ti||"CIRCLECI"in ti),zj=!qj&&(Hj||Wj&&!E6||Gj||Vj),C6=(t,e,r,n,i=e.substring(0,t)+n,s=e.substring(t+r.length),o=s.indexOf(r))=>i+(o<0?s:C6(o,s,r,n)),Kj=(t,e,r,n,i)=>t<0?r+e+n:r+C6(t,e,n,i)+n,Yj=(t,e,r=t,n=t.length+1)=>i=>i||!(i===""||i===void 0)?Kj((""+i).indexOf(e,n),i,t,e,r):"",te=(t,e,r)=>Yj(`\x1B[${t}m`,`\x1B[${e}m`,r),b6={reset:te(0,0),bold:te(1,22,"\x1B[22m\x1B[1m"),dim:te(2,22,"\x1B[22m\x1B[2m"),italic:te(3,23),underline:te(4,24),inverse:te(7,27),hidden:te(8,28),strikethrough:te(9,29),black:te(30,39),red:te(31,39),green:te(32,39),yellow:te(33,39),blue:te(34,39),magenta:te(35,39),cyan:te(36,39),white:te(37,39),gray:te(90,39),bgBlack:te(40,49),bgRed:te(41,49),bgGreen:te(42,49),bgYellow:te(43,49),bgBlue:te(44,49),bgMagenta:te(45,49),bgCyan:te(46,49),bgWhite:te(47,49),blackBright:te(90,39),redBright:te(91,39),greenBright:te(92,39),yellowBright:te(93,39),blueBright:te(94,39),magentaBright:te(95,39),cyanBright:te(96,39),whiteBright:te(97,39),bgBlackBright:te(100,49),bgRedBright:te(101,49),bgGreenBright:te(102,49),bgYellowBright:te(103,49),bgBlueBright:te(104,49),bgMagentaBright:te(105,49),bgCyanBright:te(106,49),bgWhiteBright:te(107,49)},bm=({useColor:t=zj}={})=>t?b6:Object.keys(b6).reduce((e,r)=>({...e,[r]:String}),{}),{reset:ede,bold:tde,dim:rde,italic:nde,underline:ide,inverse:sde,hidden:ode,strikethrough:ade,black:ude,red:cde,green:lde,yellow:fde,blue:hde,magenta:dde,cyan:pde,white:mde,gray:Dde,bgBlack:gde,bgRed:xde,bgGreen:yde,bgYellow:bde,bgBlue:Fde,bgMagenta:Ede,bgCyan:Cde,bgWhite:wde,blackBright:Sde,redBright:vde,greenBright:_de,yellowBright:Ade,blueBright:Bde,magentaBright:Tde,cyanBright:kde,whiteBright:Ode,bgBlackBright:Pde,bgRedBright:Rde,bgGreenBright:Ide,bgYellowBright:Mde,bgBlueBright:Lde,bgMagentaBright:Nde,bgCyanBright:$de,bgWhiteBright:jde}=bm();var RC=require("util"),Jm=require("os"),MC=require("string_decoder"),Fu=require("os"),LC=require("stream"),Eu=require("os"),WC=P(S6(),1),VC=require("crypto"),KU=Object.defineProperty,W=(t,e)=>KU(t,"name",{value:e,configurable:!0}),wC="\x1B[",SC={CURSOR_HIDE:wC+"?25l",CURSOR_SHOW:wC+"?25h"};var Jl=(t=>(t.TITLE="TITLE",t.STATE="STATE",t.ENABLED="ENABLED",t.SUBTASK="SUBTASK",t.PROMPT="PROMPT",t.OUTPUT="OUTPUT",t.MESSAGE="MESSAGE",t.CLOSED="CLOSED",t))(Jl||{}),Xl=(t=>(t.WAITING="WAITING",t.STARTED="STARTED",t.COMPLETED="COMPLETED",t.FAILED="FAILED",t.SKIPPED="SKIPPED",t.ROLLING_BACK="ROLLING_BACK",t.ROLLED_BACK="ROLLED_BACK",t.RETRY="RETRY",t.PAUSED="PAUSED",t.PROMPT="PROMPT",t.PROMPT_COMPLETED="PROMPT_COMPLETED",t.PROMPT_FAILED="PROMPT_FAILED",t))(Xl||{}),TC=class{static{W(this,"EventManager")}emitter=new y6;emit(t,e){this.emitter.emit(t,e)}on(t,e){this.emitter.addListener(t,e)}once(t,e){this.emitter.once(t,e)}off(t,e){this.emitter.off(t,e)}complete(){this.emitter.removeAllListeners()}},Qpe=class{static{W(this,"BaseEventMap")}};function kC(t){return!!t&&typeof t=="object"&&typeof t.subscribe=="function"}W(kC,"isObservable");function OC(t){return!!t&&typeof t=="object"&&t.readable===!0&&typeof t.read=="function"&&typeof t.on=="function"}W(OC,"isReadable");function nD(){return!!process.env.LISTR_FORCE_UNICODE||process.platform!=="win32"||!!process.env.CI||!!process.env.WT_SESSION||process.env.TERM_PROGRAM==="vscode"||process.env.TERM==="xterm-256color"||process.env.TERM==="alacritty"}W(nD,"isUnicodeSupported");var YU="(?:\\u001b|\\u009b)\\[[\\=><~/#&.:=?%@~_-]*[0-9]*[\\a-ln-tqyz=><~/#&.:=?%@~_-]+",ZU=/\u0007/;function po(t){return String(t).replace(new RegExp(YU,"gmi"),"").replace(new RegExp(ZU,"gmi"),"").trim()}W(po,"cleanseAnsi");var me=bm();function Zm(t,e){return t.replace(/^(?!\s*$)/gm," ".repeat(e))}W(Zm,"indent");var PC={warning:"\u26A0",cross:"\u2716",arrowDown:"\u2193",tick:"\u2714",arrowRight:"\u2192",pointer:"\u276F",checkboxOn:"\u2612",arrowLeft:"\u2190",squareSmallFilled:"\u25FC",pointerSmall:"\u203A"},JU={...PC,warning:"\u203C",cross:"\xD7",tick:"\u221A",pointer:">",checkboxOn:"[\xD7]",squareSmallFilled:"\u25A0"},_e=nD()?PC:JU;function ho(t,...e){return(0,RC.format)(String(t),...e)}W(ho,"splat");var Zl={icon:{STARTED:_e.pointer,FAILED:_e.cross,SKIPPED:_e.arrowDown,COMPLETED:_e.tick,OUTPUT:_e.pointerSmall,TITLE:_e.arrowRight,RETRY:_e.warning,ROLLBACK:_e.arrowLeft,PAUSED:_e.squareSmallFilled},color:{STARTED:me.yellow,FAILED:me.red,SKIPPED:me.yellow,COMPLETED:me.green,RETRY:me.yellowBright,ROLLBACK:me.redBright,PAUSED:me.yellowBright}},IC=["RETRY","ROLLBACK","FAILED"],Ql=class{constructor(t){this.options=t,this.options={useIcons:!0,toStderr:[],...t??{}},this.options.fields??={},this.options.fields.prefix??=[],this.options.fields.suffix??=[],this.process=this.options.processOutput??new XU}static{W(this,"ListrLogger")}process;log(t,e,r){let n=this.format(t,e,r);if(this.options.toStderr.includes(t)){this.process.toStderr(n);return}this.process.toStdout(n)}toStdout(t,e,r=!0){this.process.toStdout(this.format(null,t,e),r)}toStderr(t,e,r=!0){this.process.toStderr(this.format(null,t,e),r)}wrap(t,e){return t&&this.applyFormat(`[${t}]`,e)}splat(...t){let e=t.shift()??"";return t.length===0?e:ho(e,t)}suffix(t,...e){return e.filter(Boolean).forEach(r=>{if(t+=this.spacing(t),typeof r=="string")t+=this.wrap(r);else if(typeof r=="object"){if(r.args??=[],typeof r.condition=="function"?!r.condition(...r.args):!(r.condition??!0))return t;t+=this.wrap(typeof r.field=="function"?r.field(...r.args):r.field,{format:r?.format(...r.args)})}}),t}prefix(t,...e){return e.filter(Boolean).forEach(r=>{if(t=this.spacing(t)+t,typeof r=="string")t=this.wrap(r)+t;else if(typeof r=="object"){if(r.args??=[],typeof r.condition=="function"?!r.condition(...r.args):!(r.condition??!0))return t;t=this.wrap(typeof r.field=="function"?r.field(...r.args):r.field,{format:r?.format()})+t}}),t}fields(t,e){return this.options?.fields?.prefix&&(t=this.prefix(t,...this.options.fields.prefix)),e?.prefix&&(t=this.prefix(t,...e.prefix)),e?.suffix&&(t=this.suffix(t,...e.suffix)),this.options?.fields?.suffix&&(t=this.suffix(t,...this.options.fields.suffix)),t}icon(t,e){if(!t)return null;if(!e){let n=this.options.icon?.[t];e=typeof n=="function"?n():n}let r=this.options.color?.[t];return e&&r&&(e=r(e)),e}format(t,e,r){return Array.isArray(e)||(e=[e]),e=this.splat(e.shift(),...e).toString().split(Jm.EOL).filter(n=>!n||n.trim()!=="").map(n=>this.style(t,this.fields(n,{prefix:Array.isArray(r?.prefix)?r.prefix:[r?.prefix],suffix:Array.isArray(r?.suffix)?r.suffix:[r?.suffix]}))).join(Jm.EOL),e}style(t,e){if(!t||!e)return e;let r=this.icon(t,!this.options.useIcons&&this.wrap(t));return r&&(e=r+" "+e),e}applyFormat(t,e){return e?.format?e.format(t):t}spacing(t){return typeof t>"u"||t.trim()===""?"":" "}},Xm=class{constructor(t){this.options=t}static{W(this,"ProcessOutputBuffer")}buffer=[];decoder=new MC.StringDecoder;get all(){return this.buffer}get last(){return this.buffer.at(-1)}get length(){return this.buffer.length}write(t,...e){let r=e[e.length-1];return this.buffer.push({time:Date.now(),stream:this.options?.stream,entry:this.decoder.write(typeof t=="string"?Buffer.from(t,typeof e[0]=="string"?e[0]:void 0):Buffer.from(t))}),this.options?.limit&&(this.buffer=this.buffer.slice(-this.options.limit)),typeof r=="function"&&r(),!0}reset(){this.buffer=[]}},vC=class{constructor(t){this.stream=t,this.method=t.write,this.buffer=new Xm({stream:t})}static{W(this,"ProcessOutputStream")}method;buffer;get out(){return Object.assign({},this.stream,{write:this.write.bind(this)})}hijack(){this.stream.write=this.buffer.write.bind(this.buffer)}release(){this.stream.write=this.method;let t=[...this.buffer.all];return this.buffer.reset(),t}write(...t){return this.method.apply(this.stream,t)}},XU=class{constructor(t,e,r){this.options=r,this.stream={stdout:new vC(t??process.stdout),stderr:new vC(e??process.stderr)},this.options={dump:["stdout","stderr"],leaveEmptyLine:!0,...r}}static{W(this,"ProcessOutput")}stream;active;get stdout(){return this.stream.stdout.out}get stderr(){return this.stream.stderr.out}hijack(){if(this.active)throw new Error("ProcessOutput has been already hijacked!");this.stream.stdout.write(SC.CURSOR_HIDE),Object.values(this.stream).forEach(t=>t.hijack()),this.active=!0}release(){let t=Object.entries(this.stream).map(([e,r])=>({name:e,buffer:r.release()})).filter(e=>this.options.dump.includes(e.name)).flatMap(e=>e.buffer).sort((e,r)=>e.time-r.time).map(e=>({...e,entry:po(e.entry)})).filter(e=>e.entry);t.length>0&&(this.options.leaveEmptyLine&&this.stdout.write(Fu.EOL),t.forEach(e=>{(e.stream??this.stdout).write(e.entry+Fu.EOL)})),this.stream.stdout.write(SC.CURSOR_SHOW),this.active=!1}toStdout(t,e=!0){return e&&(t=t+Fu.EOL),this.stream.stdout.write(t)}toStderr(t,e=!0){return e&&(t=t+Fu.EOL),this.stream.stderr.write(t)}};function NC(t){let e=new LC.Writable;return e.rows=1/0,e.columns=1/0,e.write=r=>(t(r.toString()),!0),e}W(NC,"createWritable");var $C=class{constructor(t,e){this.task=t,this.wrapper=e}static{W(this,"ListrPromptAdapter")}state;reportStarted(){if(this.state=this.task.state,this.task.prompt)throw new wu("There is already an active prompt attached to this task which may not be cleaned up properly.");this.task.prompt=this,this.task.state$="PROMPT"}reportFailed(){this.task.state$="PROMPT_FAILED",this.restoreState()}reportCompleted(){this.task.state$="PROMPT_COMPLETED",this.restoreState()}restoreState(){this.task.prompt=void 0,this.state&&(this.task.state=this.state)}},QU=class{static{W(this,"Spinner")}spinner=nD()?["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]:["-","\\","|","/"];id;spinnerPosition=0;spin(){this.spinnerPosition=++this.spinnerPosition%this.spinner.length}fetch(){return this.spinner[this.spinnerPosition]}isRunning(){return!!this.id}start(t,e=100){this.id=setInterval(()=>{this.spin(),t&&t()},e)}stop(){clearInterval(this.id)}};var _C={icon:{SKIPPED_WITH_COLLAPSE:_e.arrowDown,SKIPPED_WITHOUT_COLLAPSE:_e.warning,OUTPUT:_e.pointerSmall,OUTPUT_WITH_BOTTOMBAR:_e.pointerSmall,PENDING:_e.pointer,COMPLETED:_e.tick,COMPLETED_WITH_FAILED_SUBTASKS:_e.warning,COMPLETED_WITH_SISTER_TASKS_FAILED:_e.squareSmallFilled,RETRY:_e.warning,ROLLING_BACK:_e.warning,ROLLED_BACK:_e.arrowLeft,FAILED:_e.cross,FAILED_WITH_SUBTASKS:_e.pointer,WAITING:_e.squareSmallFilled,PAUSED:_e.squareSmallFilled},color:{SKIPPED_WITH_COLLAPSE:me.yellow,SKIPPED_WITHOUT_COLLAPSE:me.yellow,PENDING:me.yellow,COMPLETED:me.green,COMPLETED_WITH_FAILED_SUBTASKS:me.yellow,COMPLETED_WITH_SISTER_TASKS_FAILED:me.red,RETRY:me.yellowBright,ROLLING_BACK:me.redBright,ROLLED_BACK:me.redBright,FAILED:me.red,FAILED_WITH_SUBTASKS:me.red,WAITING:me.dim,PAUSED:me.yellowBright}};function jC(t){let e=Math.floor(t/1e3),r=Math.floor(e/60),n;return e===0&&r===0&&(n=`0.${Math.floor(t/100)}s`),e>0&&(n=`${e%60}s`),r>0&&(n=`${r}m${n}`),n}W(jC,"parseTimer");var iD={condition:!0,field:jC,format:W(()=>me.dim,"format")};function eq(){let t=new Date;return String(t.getHours()).padStart(2,"0")+":"+String(t.getMinutes()).padStart(2,"0")+":"+String(t.getSeconds()).padStart(2,"0")}W(eq,"parseTimestamp");var tq=class Qm{constructor(e,r,n){this.tasks=e,this.options=r,this.events=n,this.options={...Qm.rendererOptions,...this.options,icon:{..._C.icon,...r?.icon??{}},color:{..._C.color,...r?.color??{}}},this.spinner=this.options.spinner??new QU,this.logger=this.options.logger??new Ql({useIcons:!0,toStderr:[]}),this.logger.options.icon=this.options.icon,this.logger.options.color=this.options.color}static{W(this,"DefaultRenderer")}static nonTTY=!1;static rendererOptions={indentation:2,clearOutput:!1,showSubtasks:!0,collapseSubtasks:!0,collapseSkips:!0,showSkipMessage:!0,suffixSkips:!1,collapseErrors:!0,showErrorMessage:!0,suffixRetries:!0,lazy:!1,removeEmptyLines:!0,formatOutput:"wrap",pausedTimer:{...iD,format:W(()=>me.yellowBright,"format")}};static rendererTaskOptions={outputBar:!0};prompt;activePrompt;spinner;logger;updater;truncate;wrap;buffer={output:new Map,bottom:new Map};cache={render:new Map,rendererOptions:new Map,rendererTaskOptions:new Map};async render(){let{createLogUpdate:e}=await Promise.resolve().then(()=>(oC(),sC)),{default:r}=await Promise.resolve().then(()=>(CC(),EC)),{default:n}=await Promise.resolve().then(()=>(Im(),Y6));this.updater=e(this.logger.process.stdout),this.truncate=r,this.wrap=n,this.logger.process.hijack(),this.options?.lazy||this.spinner.start(()=>{this.update()}),this.events.on("SHOUD_REFRESH_RENDER",()=>{this.update()})}update(){this.updater(this.create())}end(){this.spinner.stop(),this.updater.clear(),this.updater.done(),this.options.clearOutput||this.logger.process.toStdout(this.create({prompt:!1})),this.logger.process.release()}create(e){e={tasks:!0,bottomBar:!0,prompt:!0,...e};let r=[],n=this.renderer(this.tasks),i=this.renderBottomBar(),s=this.renderPrompt();return e.tasks&&n.length>0&&r.push(...n),e.bottomBar&&i.length>0&&(r.length>0&&r.push(""),r.push(...i)),e.prompt&&s.length>0&&(r.length>0&&r.push(""),r.push(...s)),r.join(Eu.EOL)}style(e,r=!1){let n=this.cache.rendererOptions.get(e.id);if(e.isSkipped()){if(r||n.collapseSkips)return this.logger.icon("SKIPPED_WITH_COLLAPSE");if(n.collapseSkips===!1)return this.logger.icon("SKIPPED_WITHOUT_COLLAPSE")}if(r)return this.shouldOutputToBottomBar(e)?this.logger.icon("OUTPUT_WITH_BOTTOMBAR"):this.logger.icon("OUTPUT");if(e.hasSubtasks()){if(e.isStarted()||e.isPrompt()&&n.showSubtasks!==!1&&!e.subtasks.every(i=>!i.hasTitle()))return this.logger.icon("PENDING");if(e.isCompleted()&&e.subtasks.some(i=>i.hasFailed()))return this.logger.icon("COMPLETED_WITH_FAILED_SUBTASKS");if(e.hasFailed())return this.logger.icon("FAILED_WITH_SUBTASKS")}return e.isStarted()||e.isPrompt()?this.logger.icon("PENDING",!this.options?.lazy&&this.spinner.fetch()):e.isCompleted()?this.logger.icon("COMPLETED"):e.isRetrying()?this.logger.icon("RETRY",!this.options?.lazy&&this.spinner.fetch()):e.isRollingBack()?this.logger.icon("ROLLING_BACK",!this.options?.lazy&&this.spinner.fetch()):e.hasRolledBack()?this.logger.icon("ROLLED_BACK"):e.hasFailed()?this.logger.icon("FAILED"):e.isPaused()?this.logger.icon("PAUSED"):this.logger.icon("WAITING")}format(e,r,n){if(e.trim()==="")return[];r&&(e=r+" "+e);let i,s=(process.stdout.columns??80)-n*this.options.indentation-2;switch(this.options.formatOutput){case"truncate":i=e.split(Eu.EOL).map((o,a)=>this.truncate(this.indent(o,a),s));break;case"wrap":i=this.wrap(e,s,{hard:!0,trim:!1}).split(Eu.EOL).map((o,a)=>this.indent(o,a));break;default:throw new AC("Format option for the renderer is wrong.")}return this.options.removeEmptyLines&&(i=i.filter(Boolean)),i.map(o=>Zm(o,n*this.options.indentation))}shouldOutputToOutputBar(e){let r=this.cache.rendererTaskOptions.get(e.id).outputBar;return typeof r=="number"&&r!==0||typeof r=="boolean"&&r!==!1}shouldOutputToBottomBar(e){let r=this.cache.rendererTaskOptions.get(e.id).bottomBar;return typeof r=="number"&&r!==0||typeof r=="boolean"&&r!==!1||!e.hasTitle()}renderer(e,r=0){return e.flatMap(n=>{if(!n.isEnabled())return[];if(this.cache.render.has(n.id))return this.cache.render.get(n.id);this.calculate(n),this.setupBuffer(n);let i=this.cache.rendererOptions.get(n.id),s=this.cache.rendererTaskOptions.get(n.id),o=[];if(n.isPrompt()){if(this.activePrompt&&this.activePrompt!==n.id)throw new AC("Only one prompt can be active at the given time, please re-evaluate your task design.");this.activePrompt||(n.on("PROMPT",a=>{let u=po(a);u&&(this.prompt=u)}),n.on("STATE",a=>{(a==="PROMPT_COMPLETED"||n.hasFinalized()||n.hasReset())&&(this.prompt=null,this.activePrompt=null,n.off("PROMPT"))}),this.activePrompt=n.id)}if(n.hasTitle()&&(e.some(a=>a.hasFailed())&&!n.hasFailed()&&n.options.exitOnError!==!1&&!(n.isCompleted()||n.isSkipped())?o.push(...this.format(n.title,this.logger.icon("COMPLETED_WITH_SISTER_TASKS_FAILED"),r)):n.hasFailed()&&i.collapseErrors?o.push(...this.format(!n.hasSubtasks()&&n.message.error&&i.showErrorMessage?n.message.error:n.title,this.style(n),r)):n.isSkipped()&&i.collapseSkips?o.push(...this.format(this.logger.suffix(n.message.skip&&i.showSkipMessage?n.message.skip:n.title,{field:"SKIPPED",condition:i.suffixSkips,format:W(()=>me.dim,"format")}),this.style(n),r)):n.isRetrying()?o.push(...this.format(this.logger.suffix(n.title,{field:`RETRY:${n.message.retry.count}`,format:W(()=>me.yellow,"format"),condition:i.suffixRetries}),this.style(n),r)):n.isCompleted()&&n.hasTitle()&&Ji(s.timer?.condition,n.message.duration)?o.push(...this.format(this.logger.suffix(n?.title,{...s.timer,args:[n.message.duration]}),this.style(n),r)):n.isPaused()?o.push(...this.format(this.logger.suffix(n.title,{...i.pausedTimer,args:[n.message.paused-Date.now()]}),this.style(n),r)):o.push(...this.format(n.title,this.style(n),r))),(!n.hasSubtasks()||!i.showSubtasks)&&(n.hasFailed()&&i.collapseErrors===!1&&(i.showErrorMessage||!i.showSubtasks)?o.push(...this.dump(n,r,"FAILED")):n.isSkipped()&&i.collapseSkips===!1&&(i.showSkipMessage||!i.showSubtasks)&&o.push(...this.dump(n,r,"SKIPPED"))),(n.isPending()||s.persistentOutput)&&o.push(...this.renderOutputBar(n,r)),i.showSubtasks!==!1&&n.hasSubtasks()&&(n.isPending()||n.hasFinalized()&&!n.hasTitle()||n.isCompleted()&&i.collapseSubtasks===!1&&!n.subtasks.some(a=>this.cache.rendererOptions.get(a.id)?.collapseSubtasks===!0)||n.subtasks.some(a=>this.cache.rendererOptions.get(a.id)?.collapseSubtasks===!1)||n.subtasks.some(a=>a.hasFailed())||n.subtasks.some(a=>a.hasRolledBack()))){let a=n.hasTitle()?r+1:r,u=this.renderer(n.subtasks,a);o.push(...u)}return n.hasFinalized()&&(s.persistentOutput||(this.buffer.bottom.delete(n.id),this.buffer.output.delete(n.id))),n.isClosed()&&(this.cache.render.set(n.id,o),this.reset(n)),o})}renderOutputBar(e,r){let n=this.buffer.output.get(e.id);return n?n.all.flatMap(i=>this.dump(e,r,"OUTPUT",i.entry)):[]}renderBottomBar(){return this.buffer.bottom.size===0?[]:Array.from(this.buffer.bottom.values()).flatMap(e=>e.all).sort((e,r)=>e.time-r.time).map(e=>e.entry)}renderPrompt(){return this.prompt?[this.prompt]:[]}calculate(e){if(this.cache.rendererOptions.has(e.id)&&this.cache.rendererTaskOptions.has(e.id))return;let r={...this.options,...e.rendererOptions};this.cache.rendererOptions.set(e.id,r),this.cache.rendererTaskOptions.set(e.id,{...Qm.rendererTaskOptions,timer:r.timer,...e.rendererTaskOptions})}setupBuffer(e){if(this.buffer.bottom.has(e.id)||this.buffer.output.has(e.id))return;let r=this.cache.rendererTaskOptions.get(e.id);this.shouldOutputToBottomBar(e)&&!this.buffer.bottom.has(e.id)?(this.buffer.bottom.set(e.id,new Xm({limit:typeof r.bottomBar=="number"?r.bottomBar:1})),e.on("OUTPUT",n=>{let i=this.dump(e,-1,"OUTPUT",n);this.buffer.bottom.get(e.id).write(i.join(Eu.EOL))}),e.on("STATE",n=>{switch(n){case"RETRY":this.buffer.bottom.delete(e.id);break}})):this.shouldOutputToOutputBar(e)&&!this.buffer.output.has(e.id)&&(this.buffer.output.set(e.id,new Xm({limit:typeof r.outputBar=="number"?r.outputBar:1})),e.on("OUTPUT",n=>{this.buffer.output.get(e.id).write(n)}),e.on("STATE",n=>{switch(n){case"RETRY":this.buffer.output.delete(e.id);break}}))}reset(e){this.cache.rendererOptions.delete(e.id),this.cache.rendererTaskOptions.delete(e.id),this.buffer.output.delete(e.id)}dump(e,r,n="OUTPUT",i){if(!i)switch(n){case"OUTPUT":i=e.output;break;case"SKIPPED":i=e.message.skip;break;case"FAILED":i=e.message.error;break}return e.hasTitle()&&n==="FAILED"&&i===e.title||typeof i!="string"?[]:(n==="OUTPUT"&&(i=po(i)),this.format(i,this.style(e,!0),r+1))}indent(e,r){return r>0?Zm(e.trimEnd(),this.options.indentation):e.trimEnd()}},rq=class{constructor(t,e){this.tasks=t,this.options=e}static{W(this,"SilentRenderer")}static nonTTY=!0;static rendererOptions;static rendererTaskOptions;render(){}end(){}},nq=class eD{constructor(e,r){this.tasks=e,this.options=r,this.options={...eD.rendererOptions,...r,icon:{...Zl.icon,...r?.icon??{}},color:{...Zl.color,...r?.color??{}}},this.logger=this.options.logger??new Ql({useIcons:!0,toStderr:IC}),this.logger.options.icon=this.options.icon,this.logger.options.color=this.options.color,this.options.timestamp&&this.logger.options.fields.prefix.unshift(this.options.timestamp)}static{W(this,"SimpleRenderer")}static nonTTY=!0;static rendererOptions={pausedTimer:{...iD,field:W(e=>`PAUSED:${e}`,"field"),format:W(()=>me.yellowBright,"format")}};static rendererTaskOptions={};logger;cache={rendererOptions:new Map,rendererTaskOptions:new Map};end(){}render(){this.renderer(this.tasks)}renderer(e){e.forEach(r=>{this.calculate(r),r.once("CLOSED",()=>{this.reset(r)});let n=this.cache.rendererOptions.get(r.id),i=this.cache.rendererTaskOptions.get(r.id);r.on("SUBTASK",s=>{this.renderer(s)}),r.on("STATE",s=>{if(r.hasTitle())if(s==="STARTED")this.logger.log("STARTED",r.title);else if(s==="COMPLETED"){let o=i?.timer;this.logger.log("COMPLETED",r.title,o&&{suffix:{...o,condition:!!r.message?.duration&&o.condition,args:[r.message.duration]}})}else s==="PROMPT"?(this.logger.process.hijack(),r.on("PROMPT",o=>{this.logger.process.toStderr(o,!1)})):s==="PROMPT_COMPLETED"&&(r.off("PROMPT"),this.logger.process.release())}),r.on("OUTPUT",s=>{this.logger.log("OUTPUT",s)}),r.on("MESSAGE",s=>{if(s.error)this.logger.log("FAILED",r.title,{suffix:{field:`FAILED: ${s.error}`,format:W(()=>me.red,"format")}});else if(s.skip)this.logger.log("SKIPPED",r.title,{suffix:{field:`SKIPPED: ${s.skip}`,format:W(()=>me.yellow,"format")}});else if(s.rollback)this.logger.log("ROLLBACK",r.title,{suffix:{field:`ROLLBACK: ${s.rollback}`,format:W(()=>me.red,"format")}});else if(s.retry)this.logger.log("RETRY",r.title,{suffix:{field:`RETRY:${s.retry.count}`,format:W(()=>me.red,"format")}});else if(s.paused){let o=n?.pausedTimer;this.logger.log("PAUSED",r.title,o&&{suffix:{...o,condition:!!s?.paused&&o.condition,args:[s.paused-Date.now()]}})}})})}calculate(e){if(this.cache.rendererOptions.has(e.id)&&this.cache.rendererTaskOptions.has(e.id))return;let r={...this.options,...e.rendererOptions};this.cache.rendererOptions.set(e.id,r),this.cache.rendererTaskOptions.set(e.id,{...eD.rendererTaskOptions,timer:r.timer,...e.rendererTaskOptions})}reset(e){this.cache.rendererOptions.delete(e.id),this.cache.rendererTaskOptions.delete(e.id)}},iq=class{constructor(t){this.options=t}static{W(this,"TestRendererSerializer")}serialize(t,e,r){return JSON.stringify(this.generate(t,e,r))}generate(t,e,r){let n={event:t,data:e};if(typeof this.options?.task!="boolean"){let i=Object.fromEntries(this.options.task.map(s=>{let o=r[s];return typeof o=="function"?[s,o.call(r)]:[s,o]}));Object.keys(r).length>0&&(n.task=i)}return n}},sq=class UC{constructor(e,r){this.tasks=e,this.options=r,this.options={...UC.rendererOptions,...this.options},this.logger=this.options.logger??new Ql({useIcons:!1}),this.serializer=new iq(this.options)}static{W(this,"TestRenderer")}static nonTTY=!0;static rendererOptions={subtasks:!0,state:Object.values(Xl),output:!0,prompt:!0,title:!0,messages:["skip","error","retry","rollback","paused"],messagesToStderr:["error","rollback","retry"],task:["hasRolledBack","isRollingBack","isCompleted","isSkipped","hasFinalized","hasSubtasks","title","hasReset","hasTitle","isPrompt","isPaused","isPending","isSkipped","isStarted","hasFailed","isEnabled","isRetrying","path"]};static rendererTaskOptions;logger;serializer;render(){this.renderer(this.tasks)}end(){}renderer(e){e.forEach(r=>{this.options.subtasks&&r.on("SUBTASK",n=>{this.renderer(n)}),this.options.state&&r.on("STATE",n=>{this.logger.toStdout(this.serializer.serialize("STATE",n,r))}),this.options.output&&r.on("OUTPUT",n=>{this.logger.toStdout(this.serializer.serialize("OUTPUT",n,r))}),this.options.prompt&&r.on("PROMPT",n=>{this.logger.toStdout(this.serializer.serialize("PROMPT",n,r))}),this.options.title&&r.on("TITLE",n=>{this.logger.toStdout(this.serializer.serialize("TITLE",n,r))}),r.on("MESSAGE",n=>{let i=Object.fromEntries(Object.entries(n).map(([s,o])=>{if(this.options.messages.includes(s))return[s,o]}).filter(Boolean));if(Object.keys(i).length>0){let s=this.serializer.serialize("MESSAGE",i,r);this.options.messagesToStderr.some(o=>Object.keys(i).includes(o))?this.logger.toStderr(s):this.logger.toStdout(s)}})})}},oq=class tD{constructor(e,r){this.tasks=e,this.options=r,this.options={...tD.rendererOptions,...this.options,icon:{...Zl.icon,...r?.icon??{}},color:{...Zl.color,...r?.color??{}}},this.logger=this.options.logger??new Ql({useIcons:!1,toStderr:IC}),this.logger.options.icon=this.options.icon,this.logger.options.color=this.options.color,this.options.timestamp&&this.logger.options.fields.prefix.unshift(this.options.timestamp)}static{W(this,"VerboseRenderer")}static nonTTY=!0;static rendererOptions={logTitleChange:!1,pausedTimer:{...iD,format:W(()=>me.yellowBright,"format")}};static rendererTaskOptions;logger;cache={rendererOptions:new Map,rendererTaskOptions:new Map};render(){this.renderer(this.tasks)}end(){}renderer(e){e.forEach(r=>{this.calculate(r),r.once("CLOSED",()=>{this.reset(r)});let n=this.cache.rendererOptions.get(r.id),i=this.cache.rendererTaskOptions.get(r.id);r.on("SUBTASK",s=>{this.renderer(s)}),r.on("STATE",s=>{if(r.hasTitle()){if(s==="STARTED")this.logger.log("STARTED",r.title);else if(s==="COMPLETED"){let o=i.timer;this.logger.log("COMPLETED",r.title,o&&{suffix:{...o,condition:!!r.message?.duration&&o.condition,args:[r.message.duration]}})}}}),r.on("OUTPUT",s=>{this.logger.log("OUTPUT",s)}),r.on("PROMPT",s=>{let o=po(s);o&&this.logger.log("PROMPT",o)}),this.options?.logTitleChange!==!1&&r.on("TITLE",s=>{this.logger.log("TITLE",s)}),r.on("MESSAGE",s=>{if(s?.error)this.logger.log("FAILED",s.error);else if(s?.skip)this.logger.log("SKIPPED",s.skip);else if(s?.rollback)this.logger.log("ROLLBACK",s.rollback);else if(s?.retry)this.logger.log("RETRY",r.title,{suffix:s.retry.count.toString()});else if(s?.paused){let o=n?.pausedTimer;this.logger.log("PAUSED",r.title,o&&{suffix:{...o,condition:!!s?.paused&&o.condition,args:[s.paused-Date.now()]}})}})})}calculate(e){if(this.cache.rendererOptions.has(e.id)&&this.cache.rendererTaskOptions.has(e.id))return;let r={...this.options,...e.rendererOptions};this.cache.rendererOptions.set(e.id,r),this.cache.rendererTaskOptions.set(e.id,{...tD.rendererTaskOptions,timer:r.timer,...e.rendererTaskOptions})}reset(e){this.cache.rendererOptions.delete(e.id),this.cache.rendererTaskOptions.delete(e.id)}},Ym={default:tq,simple:nq,verbose:oq,test:sq,silent:rq};function qC(t){return process.stdout.isTTY===!0||t.nonTTY===!0}W(qC,"isRendererSupported");function Cu(t){return typeof t=="string"?Ym[t]??Ym.default:typeof t=="function"?t:Ym.default}W(Cu,"getRendererClass");function HC(t){if(Ji(t?.silentRendererCondition))return{renderer:Cu("silent"),selection:"SILENT"};let e={renderer:Cu(t.renderer),options:t.rendererOptions,selection:"PRIMARY"};return!qC(e.renderer)||Ji(t?.fallbackRendererCondition)?{renderer:Cu(t.fallbackRenderer),options:t.fallbackRendererOptions,selection:"SECONDARY"}:e}W(HC,"getRenderer");function Ji(t,...e){return typeof t=="function"?t(...e):t}W(Ji,"assertFunctionOrSelf");var aq=(0,WC.default)({circles:!0});function rD(t){return aq(t)}W(rD,"cloneObject");var uq=class{static{W(this,"Concurrency")}concurrency;count;queue;constructor(t){this.concurrency=t.concurrency,this.count=0,this.queue=new Set}add(t){return this.count<this.concurrency?this.run(t):new Promise(e=>{let r=W(()=>e(this.run(t)),"callback");this.queue.add(r)})}flush(){for(let t of this.queue){if(this.count>=this.concurrency)break;this.queue.delete(t),t()}}run(t){this.count++;let e=t(),r=W(()=>{this.count--,this.flush()},"cleanup");return e.then(r,()=>{this.queue.clear()}),e}};function GC(t){return new Promise(e=>{setTimeout(e,t)})}W(GC,"delay");var cq=class extends Error{constructor(t,e,r){super(t.message),this.error=t,this.type=e,this.task=r,this.name="ListrError",this.path=r.path,r?.options.collectErrors==="full"&&(this.task=rD(r),this.ctx=rD(r.listr.ctx)),this.stack=t?.stack}static{W(this,"ListrError")}path;ctx},AC=class extends Error{static{W(this,"ListrRendererError")}},wu=class extends Error{static{W(this,"PromptError")}},lq=class{constructor(t){this.task=t}static{W(this,"TaskWrapper")}get title(){return this.task.title}set title(t){t=Array.isArray(t)?t:[t],this.task.title$=ho(t.shift(),...t)}get output(){return this.task.output}set output(t){t=Array.isArray(t)?t:[t],this.task.output$=ho(t.shift(),...t)}set promptOutput(t){this.task.promptOutput$=t}newListr(t,e){let r;return typeof t=="function"?r=t(this):r=t,new Su(r,e,this.task)}report(t,e){this.task.options.collectErrors!==!1&&this.task.listr.errors.push(new cq(t,e,this.task)),this.task.message$={error:t.message??this.task?.title}}skip(t,...e){this.task.state$="SKIPPED",t&&(this.task.message$={skip:t?ho(t,...e):this.task?.title})}isRetrying(){return this.task.isRetrying()?this.task.retry:{count:0}}prompt(t){return this.task.prompt?this.task.prompt:new t(this.task,this)}stdout(t){return NC(e=>{switch(t){case"PROMPT":this.promptOutput=e;break;default:this.output=e}})}run(t){return this.task.run(t,this)}},fq=class extends TC{static{W(this,"ListrTaskEventManager")}},hq=class extends fq{constructor(t,e,r,n,i){if(super(),this.listr=t,this.task=e,this.options=r,this.rendererOptions=n,this.rendererTaskOptions=i,e.title){let s=Array.isArray(e?.title)?e.title:[e.title];this.title=ho(s.shift(),...s),this.initialTitle=this.title}this.taskFn=e.task,this.parent=t.parentTask}static{W(this,"Task")}id=(0,VC.randomUUID)();state="WAITING";subtasks;title;initialTitle;output;retry;message={};prompt;parent;enabled;taskFn;closed;set state$(t){if(this.state=t,this.emit("STATE",t),this.hasSubtasks()&&this.hasFailed())for(let e of this.subtasks)e.state==="STARTED"&&(e.state$="FAILED");this.listr.events.emit("SHOUD_REFRESH_RENDER")}set output$(t){this.output=t,this.emit("OUTPUT",t),this.listr.events.emit("SHOUD_REFRESH_RENDER")}set promptOutput$(t){this.emit("PROMPT",t),po(t)&&this.listr.events.emit("SHOUD_REFRESH_RENDER")}set message$(t){this.message={...this.message,...t},this.emit("MESSAGE",t),this.listr.events.emit("SHOUD_REFRESH_RENDER")}set title$(t){this.title=t,this.emit("TITLE",t),this.listr.events.emit("SHOUD_REFRESH_RENDER")}get path(){return[...this.listr.path,this.initialTitle]}async check(t){return this.state==="WAITING"&&(this.enabled=await Ji(this.task?.enabled??!0,t),this.emit("ENABLED",this.enabled),this.listr.events.emit("SHOUD_REFRESH_RENDER")),this.enabled}hasSubtasks(){return this.subtasks?.length>0}hasFinalized(){return this.isCompleted()||this.hasFailed()||this.isSkipped()||this.hasRolledBack()}isPending(){return this.isStarted()||this.isPrompt()||this.hasReset()}isStarted(){return this.state==="STARTED"}isSkipped(){return this.state==="SKIPPED"}isCompleted(){return this.state==="COMPLETED"}hasFailed(){return this.state==="FAILED"}isRollingBack(){return this.state==="ROLLING_BACK"}hasRolledBack(){return this.state==="ROLLED_BACK"}isRetrying(){return this.state==="RETRY"}hasReset(){return this.state==="RETRY"||this.state==="ROLLING_BACK"}isEnabled(){return this.enabled}hasTitle(){return typeof this?.title=="string"}isPrompt(){return this.state==="PROMPT"||this.state==="PROMPT_COMPLETED"}isPaused(){return this.state==="PAUSED"}isClosed(){return this.closed}async pause(t){let e=this.state;this.state$="PAUSED",this.message$={paused:Date.now()+t},await GC(t),this.state$=e,this.message$={paused:null}}async run(t,e){let r=W(s=>(s instanceof Su?(s.options={...this.options,...s.options},s.rendererClass=Cu("silent"),this.subtasks=s.tasks,s.errors=this.listr.errors,this.emit("SUBTASK",this.subtasks),s=s.run(t)):s instanceof Promise?s=s.then(r):OC(s)?s=new Promise((o,a)=>{s.on("data",u=>{this.output$=u.toString()}),s.on("error",u=>a(u)),s.on("end",()=>o(null))}):kC(s)&&(s=new Promise((o,a)=>{s.subscribe({next:W(u=>{this.output$=u},"next"),error:a,complete:o})})),s),"handleResult"),n=Date.now();this.state$="STARTED";let i=await Ji(this.task?.skip??!1,t);if(i){typeof i=="string"?this.message$={skip:i}:this.hasTitle()?this.message$={skip:this.title}:this.message$={skip:"Skipped task without a title."},this.state$="SKIPPED";return}try{let s=typeof this.task?.retry=="number"&&this.task.retry>0?this.task.retry+1:typeof this.task?.retry=="object"&&this.task.retry.tries>0?this.task.retry.tries+1:1,o=typeof this.task.retry=="object"&&this.task.retry.delay;for(let a=1;a<=s;a++)try{await r(this.taskFn(t,e));break}catch(u){if(a!==s)this.retry={count:a,error:u},this.message$={retry:this.retry},this.title$=this.initialTitle,this.output=void 0,e.report(u,"WILL_RETRY"),this.state$="RETRY",o&&await this.pause(o);else throw u}(this.isStarted()||this.isRetrying())&&(this.message$={duration:Date.now()-n},this.state$="COMPLETED")}catch(s){if(this.prompt instanceof wu&&(s=this.prompt),this.task?.rollback){e.report(s,"WILL_ROLLBACK");try{this.state$="ROLLING_BACK",await this.task.rollback(t,e),this.message$={rollback:this.title},this.state$="ROLLED_BACK"}catch(o){throw this.state$="FAILED",e.report(o,"HAS_FAILED_TO_ROLLBACK"),this.close(),o}if(this.listr.options?.exitAfterRollback!==!1)throw this.close(),s}else{if(this.state$="FAILED",this.listr.options.exitOnError!==!1&&await Ji(this.task?.exitOnError,t)!==!1)throw e.report(s,"HAS_FAILED"),this.close(),s;this.hasSubtasks()||e.report(s,"HAS_FAILED_WITHOUT_ERROR")}}finally{this.close()}}close(){this.emit("CLOSED"),this.listr.events.emit("SHOUD_REFRESH_RENDER"),this.complete()}},BC=class extends TC{static{W(this,"ListrEventManager")}},Su=class{constructor(t,e,r){this.task=t,this.options=e,this.parentTask=r,this.options={concurrent:!1,renderer:"default",fallbackRenderer:"simple",exitOnError:!0,exitAfterRollback:!0,collectErrors:!1,registerSignalListeners:!0,...this.parentTask?.options??{},...e},this.options.concurrent===!0?this.options.concurrent=1/0:typeof this.options.concurrent!="number"&&(this.options.concurrent=1),this.concurrency=new uq({concurrency:this.options.concurrent}),r&&(this.path=[...r.listr.path,r.title],this.errors=r.listr.errors),this.parentTask?.listr.events instanceof BC?this.events=this.parentTask.listr.events:this.events=new BC,(this.options?.forceTTY||process.env.LISTR_FORCE_TTY)&&(process.stdout.isTTY=!0,process.stderr.isTTY=!0),this.options?.forceUnicode&&(process.env.LISTR_FORCE_UNICODE="1");let n=HC({renderer:this.options.renderer,rendererOptions:this.options.rendererOptions,fallbackRenderer:this.options.fallbackRenderer,fallbackRendererOptions:this.options.fallbackRendererOptions,fallbackRendererCondition:this.options?.fallbackRendererCondition,silentRendererCondition:this.options?.silentRendererCondition});this.rendererClass=n.renderer,this.rendererClassOptions=n.options,this.rendererSelection=n.selection,this.add(t??[]),this.options.registerSignalListeners&&(this.boundSignalHandler=this.signalHandler.bind(this),process.once("SIGINT",this.boundSignalHandler).setMaxListeners(0))}static{W(this,"Listr")}tasks=[];errors=[];ctx;events;path=[];rendererClass;rendererClassOptions;rendererSelection;boundSignalHandler;concurrency;renderer;isRoot(){return!this.parentTask}isSubtask(){return!!this.parentTask}add(t){this.tasks.push(...this.generate(t))}async run(t){this.renderer||(this.renderer=new this.rendererClass(this.tasks,this.rendererClassOptions,this.events)),await this.renderer.render(),this.ctx=this.options?.ctx??t??{},await Promise.all(this.tasks.map(e=>e.check(this.ctx)));try{await Promise.all(this.tasks.map(e=>this.concurrency.add(()=>this.runTask(e)))),this.renderer.end(),this.removeSignalHandler()}catch(e){if(this.options.exitOnError!==!1)throw this.renderer.end(e),this.removeSignalHandler(),e}return this.ctx}generate(t){return t=Array.isArray(t)?t:[t],t.map(e=>{let r;return this.rendererSelection==="PRIMARY"?r=e.rendererOptions:this.rendererSelection==="SECONDARY"&&(r=e.fallbackRendererOptions),new hq(this,e,this.options,this.rendererClassOptions,r)})}async runTask(t){if(await t.check(this.ctx))return new lq(t).run(this.ctx)}signalHandler(){this.tasks?.forEach(async t=>{t.isPending()&&(t.state$="FAILED")}),this.isRoot()&&(this.renderer?.end(new Error("Interrupted.")),process.exit(127))}removeSignalHandler(){this.boundSignalHandler&&process.removeListener("SIGINT",this.boundSignalHandler)}};var RH=Object.defineProperty,I8=(t,e)=>RH(t,"name",{value:e,configurable:!0}),Ie=class extends $C{static{I8(this,"ListrEnquirerPromptAdapter")}error;prompt;get instance(){return this.prompt}async run(t,e){Array.isArray(t)?t.length===1&&(t=t.map(i=>({...i,name:"default"}))):t=[{...t,name:"default"}],t=t.map(i=>({onCancel:I8(()=>(this.error=new wu("Cancelled prompt."),!0),"onCancel"),...i,stdout:e?.stdout??this.wrapper.stdout(Jl.PROMPT)}));let r;if(e?.enquirer)r=e.enquirer;else try{r=await Promise.resolve().then(()=>P(R8(),1)).then(i=>i.default?new i.default:new i)}catch{throw this.reportFailed(),new wu("Enquirer is a optional peer dependency that must be installed separately.")}this.reportStarted(),this.task.on(Jl.STATE,i=>{i===Xl.SKIPPED&&this.prompt&&!this.error&&this.cancel({throw:!1})});let n;try{n=await r.once("prompt",i=>this.prompt=i).prompt(t)}catch(i){throw this.reportFailed(),this.error?this.error:i}return this.reportCompleted(),t.length===1?n.default:n}cancel(t){!this.prompt||this.error||(t?.throw?this.prompt.cancel():this.prompt.submit(),this.reportFailed())}};var yo=require("node:fs"),q8=require("node:os"),H8=require("node:path");var si=require("node:crypto"),xo=require("node:fs"),ts=require("node:os"),M8=require("node:path"),ZD=(0,M8.join)((0,ts.homedir)(),".platform-sdk-keys"),L8="aes-256-gcm";function N8(){let t=`${(0,ts.hostname)()}:${(0,ts.userInfo)().username}:${(0,ts.homedir)()}`;return(0,si.createHash)("sha256").update(t).digest()}function $8(){if(!(0,xo.existsSync)(ZD))return{};try{return JSON.parse((0,xo.readFileSync)(ZD,"utf-8"))}catch{return{}}}function IH(t){(0,xo.writeFileSync)(ZD,JSON.stringify(t,null,2),{mode:384})}function MH(t){let e=N8(),r=(0,si.randomBytes)(16),n=(0,si.createCipheriv)(L8,e,r),i=n.update(t,"utf8","hex");return i+=n.final("hex"),{iv:r.toString("hex"),tag:n.getAuthTag().toString("hex"),data:i}}function LH(t){let e=N8(),r=Buffer.from(t.iv,"hex"),n=Buffer.from(t.tag,"hex"),i=(0,si.createDecipheriv)(L8,e,r);i.setAuthTag(n);let s=i.update(t.data,"hex","utf8");return s+=i.final("utf8"),s}async function j8(t,e){let r=$8();r[t]=MH(e),IH(r)}async function cf(t){let r=$8()[t];if(!r)return null;try{return LH(r)}catch{return null}}var Tu={openai:{id:"openai",name:"OpenAI",defaultApiKeyEnvVar:"OPENAI_API_KEY",defaultModel:"gpt-4o-mini",modelsApiUrl:"https://api.openai.com/v1/models",apiKeyUrl:"https://platform.openai.com/api-keys",buildHeaders:t=>({Authorization:`Bearer ${t}`}),parseModelsResponse:t=>t.data??[],modelFilters:[/^gpt-4/,/^gpt-3\.5/,/^o1/,/^o3/]},anthropic:{id:"anthropic",name:"Anthropic (Claude)",defaultApiKeyEnvVar:"ANTHROPIC_API_KEY",defaultModel:"claude-sonnet-4-20250514",modelsApiUrl:"https://api.anthropic.com/v1/models",apiKeyUrl:"https://console.anthropic.com/settings/keys",buildHeaders:t=>({"x-api-key":t,"anthropic-version":"2023-06-01"}),parseModelsResponse:t=>(t.data??[]).map(r=>({id:r.id,created:new Date(r.created_at).getTime()})),modelFilters:[/^claude-/]}};function U8(){return Object.entries(Tu).map(([t,e])=>({name:e.name,value:t}))}function ku(t){let e=Tu[t];if(!e)throw new Error(`Unknown AI provider: ${t}`);return e}var rs=(0,H8.join)((0,q8.homedir)(),".platform-sdk-ai.json");function NH(){let t="anthropic",e=Tu[t];return{provider:t,model:e.defaultModel}}var JD=NH();function Ou(){return(0,yo.existsSync)(rs)}function lf(){if(!Ou())throw new Error("AI configuration not found. Please run 'pf ai:setup' to configure your AI provider.");try{let t=(0,yo.readFileSync)(rs,"utf-8"),e=JSON.parse(t);return{...JD,...e}}catch{throw new Error(`Failed to load AI configuration from ${rs}. Please run 'pf setup --ai' again.`)}}function W8(t){let e=JSON.stringify(t,null,2);(0,yo.writeFileSync)(rs,e,"utf-8")}async function G8(t,e){await j8(t,e)}async function V8(t){let e=await cf(t.provider);if(e)return e;let r=Tu[t.provider],n=process.env[r.defaultApiKeyEnvVar];if(n)return n;throw new Error("API key not found. Please run 'pf setup --ai' to configure your API key.")}async function $H(t,e,r,n){let{createOpenAI:i}=await import("@ai-sdk/openai"),s=i({apiKey:r});if(n.onToken){let{streamText:u}=await import("ai"),c=u({model:s(e),prompt:t,system:n.system,maxOutputTokens:n.maxTokens,temperature:n.temperature}),l="";for await(let f of(await c).textStream)l+=f,n.onToken(f);return l}let{generateText:o}=await import("ai"),{text:a}=await o({model:s(e),prompt:t,system:n.system,maxOutputTokens:n.maxTokens,temperature:n.temperature});return a}async function jH(t,e,r,n){let{createAnthropic:i}=await import("@ai-sdk/anthropic"),s=i({apiKey:r});if(n.onToken){let{streamText:u}=await import("ai"),c=u({model:s(e),prompt:t,system:n.system,maxOutputTokens:n.maxTokens,temperature:n.temperature}),l="";for await(let f of(await c).textStream)l+=f,n.onToken(f);return l}let{generateText:o}=await import("ai"),{text:a}=await o({model:s(e),prompt:t,system:n.system,maxOutputTokens:n.maxTokens,temperature:n.temperature});return a}async function z8(t,e,r={}){let{system:n,maxTokens:i=4096,temperature:s=.7,onToken:o}=r,a=await V8(t);switch(t.provider){case"openai":return $H(e,t.model,a,{system:n,maxTokens:i,temperature:s,onToken:o});case"anthropic":return jH(e,t.model,a,{system:n,maxTokens:i,temperature:s,onToken:o});default:throw new Error(`Unsupported AI provider: ${t.provider}`)}}var G0=require("node:fs"),Vc=require("node:path");var rt=(t,e=[])=>t.name==="up"||e.includes("vim")&&t.name==="k"||e.includes("emacs")&&t.ctrl&&t.name==="p",Mt=(t,e=[])=>t.name==="down"||e.includes("vim")&&t.name==="j"||e.includes("emacs")&&t.ctrl&&t.name==="n",XD=t=>t.name==="space",ns=t=>t.name==="backspace",Bn=t=>t.name==="tab",Pu=t=>"1234567890".includes(t.name),Me=t=>t.name==="enter"||t.name==="return";var ff=class extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(e){super(),this.cause=e?.cause}},hf=class extends Error{name="CancelPromptError";message="Prompt was canceled"},Ru=class extends Error{name="ExitPromptError"},df=class extends Error{name="HookError"},Jr=class extends Error{name="ValidationError"};var J8=require("node:async_hooks");var pf=require("node:async_hooks");var K8=new pf.AsyncLocalStorage;function UH(t){return{rl:t,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function Y8(t,e){let r=UH(t);return K8.run(r,()=>{function n(i){r.handleChange=()=>{r.index=0,i()},r.handleChange()}return e(n)})}function is(){let t=K8.getStore();if(!t)throw new df("[Inquirer] Hook functions can only be called from within a prompt");return t}function QD(){return is().rl}function eg(t){let e=(...r)=>{let n=is(),i=!1,s=n.handleChange;n.handleChange=()=>{i=!0};let o=t(...r);return i&&s(),n.handleChange=s,o};return pf.AsyncResource.bind(e)}function bo(t){let e=is(),{index:r}=e,n={get(){return e.hooks[r]},set(s){e.hooks[r]=s},initialized:r in e.hooks},i=t(n);return e.index++,i}function Z8(){is().handleChange()}var ss={queue(t){let e=is(),{index:r}=e;e.hooksEffect.push(()=>{e.hooksCleanup[r]?.();let n=t(QD());if(n!=null&&typeof n!="function")throw new Jr("useEffect return value must be a cleanup function or nothing.");e.hooksCleanup[r]=n})},run(){let t=is();eg(()=>{t.hooksEffect.forEach(e=>{e()}),t.hooksEffect.length=0})()},clearAll(){let t=is();t.hooksCleanup.forEach(e=>{e?.()}),t.hooksEffect.length=0,t.hooksCleanup.length=0}};function z(t){return bo(e=>{let r=J8.AsyncResource.bind(function(s){e.get()!==s&&(e.set(s),Z8())});if(e.initialized)return[e.get(),r];let n=typeof t=="function"?t():t;return e.set(n),[n,r]})}function Gt(t,e){bo(r=>{let n=r.get();(!Array.isArray(n)||e.some((s,o)=>!Object.is(s,n[o])))&&ss.queue(t),r.set(e)})}var or=P(oi(),1);var Pr=P(require("node:process"),1);function WH(){return Pr.default.platform!=="win32"?Pr.default.env.TERM!=="linux":!!Pr.default.env.WT_SESSION||!!Pr.default.env.TERMINUS_SUBLIME||Pr.default.env.ConEmuTask==="{cmd::Cmder}"||Pr.default.env.TERM_PROGRAM==="Terminus-Sublime"||Pr.default.env.TERM_PROGRAM==="vscode"||Pr.default.env.TERM==="xterm-256color"||Pr.default.env.TERM==="alacritty"||Pr.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Q8={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},eS={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},GH={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},VH={...Q8,...eS},zH={...Q8,...GH},KH=WH(),YH=KH?VH:zH,sr=YH,PDe=Object.entries(eS);var tS={prefix:{idle:or.default.blue("?"),done:or.default.green(sr.tick)},spinner:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"].map(t=>or.default.yellow(t))},style:{answer:or.default.cyan,message:or.default.bold,error:t=>or.default.red(`> ${t}`),defaultAnswer:t=>or.default.dim(`(${t})`),help:or.default.dim,highlight:or.default.cyan,key:t=>or.default.cyan(or.default.bold(`<${t}>`))}};function rS(t){if(typeof t!="object"||t===null)return!1;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function nS(...t){let e={};for(let r of t)for(let[n,i]of Object.entries(r)){let s=e[n];e[n]=rS(s)&&rS(i)?nS(s,i):i}return e}function ke(...t){let e=[tS,...t.filter(r=>r!=null)];return nS(...e)}function Le({status:t="idle",theme:e}){let[r,n]=z(!1),[i,s]=z(0),{prefix:o,spinner:a}=ke(e);return Gt(()=>{if(t==="loading"){let c,l=-1,f=setTimeout(()=>{n(!0),c=setInterval(()=>{l=l+1,s(l%a.frames.length)},a.interval)},300);return()=>{clearTimeout(f),clearInterval(c)}}else n(!1)},[t]),r?a.frames[i]:typeof o=="string"?o:o[t==="loading"?"idle":t]??o.idle}function Lt(t,e){return bo(r=>{let n=r.get();if(!n||n.dependencies.length!==e.length||n.dependencies.some((i,s)=>i!==e[s])){let i=t();return r.set({value:i,dependencies:e}),i}return n.value})}function os(t){return z({current:t})[0]}function Ne(t){let e=os(t);e.current=t,Gt(r=>{let n=!1,i=eg((s,o)=>{n||e.current(o,r)});return r.input.on("keypress",i),()=>{n=!0,r.input.removeListener("keypress",i)}},[])}var AS=P(sS(),1),BS=P(_S(),1);function Lu(t,e){return t.split(`
|
|
122
122
|
`).flatMap(r=>(0,BS.default)(r,e,{trim:!1,hard:!0}).split(`
|
|
123
123
|
`).map(n=>n.trimEnd())).join(`
|
|
124
124
|
`)}function gf(){return(0,AS.default)({defaultWidth:80,output:QD().output})}function gW({active:t,renderedItems:e,pageSize:r,loop:n}){let i=os({lastPointer:t,lastActive:void 0}),{lastPointer:s,lastActive:o}=i.current,a=Math.floor(r/2),u=e.reduce((f,h)=>f+h.length,0),c=e.slice(0,t).reduce((f,h)=>f+h.length,0),l=c;if(u>r)if(n)l=s,o!=null&&o<t&&t-o<r&&(l=Math.min(a,Math.abs(t-o)===1?Math.min(s+(e[o]?.length??0),Math.max(c,s)):s+t-o));else{let f=e.slice(t).reduce((h,d)=>h+d.length,0);l=f<r-a?r-f:Math.min(c,a)}return i.current.lastPointer=l,i.current.lastActive=t,l}function as({items:t,active:e,renderItem:r,pageSize:n,loop:i=!0}){let s=gf(),o=D=>(D%t.length+t.length)%t.length,a=t.map((D,y)=>D==null?[]:Lu(r({item:D,index:y,isActive:y===e}),s).split(`
|
|
@@ -128,20 +128,20 @@ Expecting `+J.join(", ")+", got '"+(this.terminals_[C]||C)+"'":w="Parse error on
|
|
|
128
128
|
`).pop()??"",Nu=class{height=0;extraLinesUnderPrompt=0;cursorPos;rl;constructor(e){this.rl=e,this.cursorPos=e.getCursorPos()}write(e){this.rl.output.unmute(),this.rl.output.write(e),this.rl.output.mute()}render(e,r=""){let n=yW(e),i=(0,IS.stripVTControlCharacters)(n),s=i;this.rl.line.length>0&&(s=s.slice(0,-this.rl.line.length)),this.rl.setPrompt(s),this.cursorPos=this.rl.getCursorPos();let o=gf();e=Lu(e,o),r=Lu(r,o),i.length%o===0&&(e+=`
|
|
129
129
|
`);let a=e+(r?`
|
|
130
130
|
`+r:""),c=Math.floor(i.length/o)-this.cursorPos.rows+(r?RS(r):0);c>0&&(a+=lg(c)),a+=hg(this.cursorPos.cols),this.write(fg(this.extraLinesUnderPrompt)+dg(this.height)+a),this.extraLinesUnderPrompt=c,this.height=RS(a)}checkCursorPos(){let e=this.rl.getCursorPos();e.cols!==this.cursorPos.cols&&(this.write(hg(e.cols)),this.cursorPos=e)}done({clearContent:e}){this.rl.setPrompt("");let r=fg(this.extraLinesUnderPrompt);r+=e?dg(this.height):`
|
|
131
|
-
`,r+=PS,this.write(r),this.rl.close()}};var xf=class extends Promise{static withResolver(){let e,r;return{promise:new Promise((i,s)=>{e=i,r=s}),resolve:e,reject:r}}};function bW(){let t=Error.prepareStackTrace,e=[];try{Error.prepareStackTrace=(r,n)=>{let i=n.slice(1);return e=i,i},new Error().stack}catch{return e}return Error.prepareStackTrace=t,e}function
|
|
132
|
-
at ${T}`)}let[C,_]=typeof b=="string"?[b]:b;l.render(C,_),ss.run()}catch(b){d(b)}}),Object.assign(f.then(b=>(ss.clearAll(),b),b=>{throw ss.clearAll(),b}).finally(()=>{a.forEach(b=>b()),l.done({clearContent:!!i.clearPromptOnDone}),u.end()}).then(()=>f),{cancel:p})})}}var $S=P(oi(),1);var fe=class{separator=$S.default.dim(Array.from({length:15}).join(sr.line));type="separator";constructor(e){e&&(this.separator=e)}static isSeparator(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="separator")}};var us=P(oi(),1);var FW={icon:{checked:us.default.green(sr.circleFilled),unchecked:sr.circle,cursor:sr.pointer},style:{disabledChoice:t=>us.default.dim(`- ${t}`),renderSelectedChoices:t=>t.map(e=>e.short).join(", "),description:t=>us.default.cyan(t),keysHelpTip:t=>t.map(([e,r])=>`${us.default.bold(e)} ${us.default.dim(r)}`).join(us.default.dim(" \u2022 "))},helpMode:"always",keybindings:[]};function ai(t){return!fe.isSeparator(t)&&!t.disabled}function pg(t){return ai(t)&&t.checked}function mg(t){return ai(t)?{...t,checked:!t.checked}:t}function EW(t){return function(e){return ai(e)?{...e,checked:t}:e}}function CW(t){return t.map(e=>{if(fe.isSeparator(e))return e;if(typeof e=="string")return{value:e,name:e,short:e,checkedName:e,disabled:!1,checked:!1};let r=e.name??String(e.value),n={value:e.value,name:r,short:e.short??r,checkedName:e.checkedName??r,disabled:e.disabled??!1,checked:e.checked??!1};return e.description&&(n.description=e.description),n})}var wW
|
|
133
|
-
`).trimEnd()}${wo}`});var j3=P(XS(),1),qf=require("child_process"),Ao=require("fs"),Uf=P(require("node:path"),1),U3=P(require("node:os"),1),q3=require("node:crypto"),Tx=P(N3(),1);var Nf=class extends Error{originalError;constructor(e){super(`Failed to create temporary file. ${e.message}`),this.originalError=e}};var Gu=class extends Error{originalError;constructor(e){super(`Failed to launch editor. ${e.message}`),this.originalError=e}};var $f=class extends Error{originalError;constructor(e){super(`Failed to read temporary file. ${e.message}`),this.originalError=e}};var jf=class extends Error{originalError;constructor(e){super(`Failed to remove temporary file. ${e.message}`),this.originalError=e}};function H3(t="",e,r){let n=new kx(t,r);n.runAsync((i,s)=>{if(i)setImmediate(e,i,void 0);else try{n.cleanup(),setImmediate(e,void 0,s)}catch(o){setImmediate(e,o,void 0)}})}function $3(t){return t?t.replace(/[^a-zA-Z0-9_.-]/g,"_"):""}function lG(t){let e=[],r="";for(let n=0;n<t.length;n++){let i=t.charAt(n);n>0&&i===" "&&t[n-1]!=="\\"&&r.length>0?(e.push(r),r=""):r=`${r}${i}`}return r.length>0&&e.push(r),e}var kx=class{text="";tempFile;editor;lastExitStatus=0;fileOptions={};get temp_file(){return console.log("DEPRECATED: temp_file. Use tempFile moving forward."),this.tempFile}get last_exit_status(){return console.log("DEPRECATED: last_exit_status. Use lastExitStatus moving forward."),this.lastExitStatus}constructor(e="",r){this.text=e,r&&(this.fileOptions=r),this.determineEditor(),this.createTemporaryFile()}run(){return this.launchEditor(),this.readTemporaryFile(),this.text}runAsync(e){try{this.launchEditorAsync(()=>{try{this.readTemporaryFile(),setImmediate(e,void 0,this.text)}catch(r){setImmediate(e,r,void 0)}})}catch(r){setImmediate(e,r,void 0)}}cleanup(){this.removeTemporaryFile()}determineEditor(){let e=process.env.VISUAL?process.env.VISUAL:process.env.EDITOR?process.env.EDITOR:process.platform.startsWith("win")?"notepad":"vim",r=lG(e).map(i=>i.replace("\\ "," ")),n=r.shift();this.editor={args:r,bin:n}}createTemporaryFile(){try{let e=this.fileOptions.dir??U3.default.tmpdir(),r=(0,q3.randomUUID)(),n=$3(this.fileOptions.prefix),i=$3(this.fileOptions.postfix),s=`${n}${r}${i}`,o=Uf.default.resolve(e,s),a=Uf.default.resolve(e)+Uf.default.sep;if(!o.startsWith(a))throw new Error("Resolved temporary file escaped the base directory");this.tempFile=o;let u={encoding:"utf8",flag:"wx"};Object.prototype.hasOwnProperty.call(this.fileOptions,"mode")&&(u.mode=this.fileOptions.mode),(0,Ao.writeFileSync)(this.tempFile,this.text,u)}catch(e){throw new Nf(e)}}readTemporaryFile(){try{let e=(0,Ao.readFileSync)(this.tempFile);if(e.length===0)this.text="";else{let r=(0,j3.detect)(e)??"utf8";Tx.default.encodingExists(r)||(r="utf8"),this.text=Tx.default.decode(e,r)}}catch(e){throw new $f(e)}}removeTemporaryFile(){try{(0,Ao.unlinkSync)(this.tempFile)}catch(e){throw new jf(e)}}launchEditor(){try{let e=(0,qf.spawnSync)(this.editor.bin,this.editor.args.concat([this.tempFile]),{stdio:"inherit"});this.lastExitStatus=e.status??0}catch(e){throw new Gu(e)}}launchEditorAsync(e){try{(0,qf.spawn)(this.editor.bin,this.editor.args.concat([this.tempFile]),{stdio:"inherit"}).on("exit",n=>{this.lastExitStatus=n,setImmediate(e)})}catch(r){throw new Gu(r)}}};var fG={validationFailureMode:"keep"},hG
|
|
131
|
+
`,r+=PS,this.write(r),this.rl.close()}};var xf=class extends Promise{static withResolver(){let e,r;return{promise:new Promise((i,s)=>{e=i,r=s}),resolve:e,reject:r}}};function bW(){let t=Error.prepareStackTrace,e=[];try{Error.prepareStackTrace=(r,n)=>{let i=n.slice(1);return e=i,i},new Error().stack}catch{return e}return Error.prepareStackTrace=t,e}function $e(t){let e=bW();return(n,i={})=>{let{input:s=process.stdin,signal:o}=i,a=new Set,u=new NS.default;u.pipe(i.output??process.stdout);let c=MS.createInterface({terminal:!0,input:s,output:u}),l=new Nu(c),{promise:f,resolve:h,reject:d}=xf.withResolver(),p=()=>d(new hf);if(o){let D=()=>d(new ff({cause:o.reason}));if(o.aborted)return D(),Object.assign(f,{cancel:p});o.addEventListener("abort",D),a.add(()=>o.removeEventListener("abort",D))}a.add(ao((D,y)=>{d(new Ru(`User force closed the prompt with ${D} ${y}`))}));let m=()=>d(new Ru("User force closed the prompt with SIGINT"));c.on("SIGINT",m),a.add(()=>c.removeListener("SIGINT",m));let x=()=>l.checkCursorPos();return c.input.on("keypress",x),a.add(()=>c.input.removeListener("keypress",x)),Y8(c,D=>{let y=LS.AsyncResource.bind(()=>ss.clearAll());return c.on("close",y),a.add(()=>c.removeListener("close",y)),D(()=>{try{let b=t(n,T=>{setImmediate(()=>h(T))});if(b===void 0){let T=e[1]?.getFileName();throw new Error(`Prompt functions must return a string.
|
|
132
|
+
at ${T}`)}let[C,_]=typeof b=="string"?[b]:b;l.render(C,_),ss.run()}catch(b){d(b)}}),Object.assign(f.then(b=>(ss.clearAll(),b),b=>{throw ss.clearAll(),b}).finally(()=>{a.forEach(b=>b()),l.done({clearContent:!!i.clearPromptOnDone}),u.end()}).then(()=>f),{cancel:p})})}}var $S=P(oi(),1);var fe=class{separator=$S.default.dim(Array.from({length:15}).join(sr.line));type="separator";constructor(e){e&&(this.separator=e)}static isSeparator(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="separator")}};var us=P(oi(),1);var FW={icon:{checked:us.default.green(sr.circleFilled),unchecked:sr.circle,cursor:sr.pointer},style:{disabledChoice:t=>us.default.dim(`- ${t}`),renderSelectedChoices:t=>t.map(e=>e.short).join(", "),description:t=>us.default.cyan(t),keysHelpTip:t=>t.map(([e,r])=>`${us.default.bold(e)} ${us.default.dim(r)}`).join(us.default.dim(" \u2022 "))},helpMode:"always",keybindings:[]};function ai(t){return!fe.isSeparator(t)&&!t.disabled}function pg(t){return ai(t)&&t.checked}function mg(t){return ai(t)?{...t,checked:!t.checked}:t}function EW(t){return function(e){return ai(e)?{...e,checked:t}:e}}function CW(t){return t.map(e=>{if(fe.isSeparator(e))return e;if(typeof e=="string")return{value:e,name:e,short:e,checkedName:e,disabled:!1,checked:!1};let r=e.name??String(e.value),n={value:e.value,name:r,short:e.short??r,checkedName:e.checkedName??r,disabled:e.disabled??!1,checked:e.checked??!1};return e.description&&(n.description=e.description),n})}var wW=$e((t,e)=>{let{instructions:r,pageSize:n=7,loop:i=!0,required:s,validate:o=()=>!0}=t,a={all:"a",invert:"i",...t.shortcuts},u=ke(FW,t.theme),{keybindings:c}=u,[l,f]=z("idle"),h=Le({status:l,theme:u}),[d,p]=z(CW(t.choices)),m=Lt(()=>{let v=d.findIndex(ai),A=d.findLastIndex(ai);if(v===-1)throw new Jr("[checkbox prompt] No selectable choices. All choices are disabled.");return{first:v,last:A}},[d]),[x,D]=z(m.first),[y,b]=z();Ne(async v=>{if(Me(v)){let A=d.filter(pg),F=await o([...A]);s&&!d.some(pg)?b("At least one choice must be selected"):F===!0?(f("done"),e(A.map(I=>I.value))):b(F||"You must select a valid value")}else if(rt(v,c)||Mt(v,c)){if(i||rt(v,c)&&x!==m.first||Mt(v,c)&&x!==m.last){let A=rt(v,c)?-1:1,F=x;do F=(F+A+d.length)%d.length;while(!ai(d[F]));D(F)}}else if(XD(v))b(void 0),p(d.map((A,F)=>F===x?mg(A):A));else if(v.name===a.all){let A=d.some(F=>ai(F)&&!F.checked);p(d.map(EW(A)))}else if(v.name===a.invert)p(d.map(mg));else if(Pu(v)){let A=Number(v.name)-1,F=-1,I=d.findIndex(J=>fe.isSeparator(J)?!1:(F++,F===A)),$=d[I];$&&ai($)&&(D(I),p(d.map((J,w)=>w===I?mg(J):J)))}});let C=u.style.message(t.message,l),_,T=as({items:d,active:x,renderItem({item:v,isActive:A}){if(fe.isSeparator(v))return` ${v.separator}`;if(v.disabled){let w=typeof v.disabled=="string"?v.disabled:"(disabled)";return u.style.disabledChoice(`${v.name} ${w}`)}A&&(_=v.description);let F=v.checked?u.icon.checked:u.icon.unchecked,I=v.checked?v.checkedName:v.name,$=A?u.style.highlight:w=>w,J=A?u.icon.cursor:" ";return $(`${J}${F} ${I}`)},pageSize:n,loop:i});if(l==="done"){let v=d.filter(pg),A=u.style.answer(u.style.renderSelectedChoices(v,d));return[h,C,A].filter(Boolean).join(" ")}let B;if(u.helpMode!=="never"&&r!==!1)if(typeof r=="string")B=r;else{let v=[["\u2191\u2193","navigate"],["space","select"]];a.all&&v.push([a.all,"all"]),a.invert&&v.push([a.invert,"invert"]),v.push(["\u23CE","submit"]),B=u.style.keysHelpTip(v)}return`${[[h,C].filter(Boolean).join(" "),T," ",_?u.style.description(_):"",y?u.style.error(y):"",B].filter(Boolean).join(`
|
|
133
|
+
`).trimEnd()}${wo}`});var j3=P(XS(),1),qf=require("child_process"),Ao=require("fs"),Uf=P(require("node:path"),1),U3=P(require("node:os"),1),q3=require("node:crypto"),Tx=P(N3(),1);var Nf=class extends Error{originalError;constructor(e){super(`Failed to create temporary file. ${e.message}`),this.originalError=e}};var Gu=class extends Error{originalError;constructor(e){super(`Failed to launch editor. ${e.message}`),this.originalError=e}};var $f=class extends Error{originalError;constructor(e){super(`Failed to read temporary file. ${e.message}`),this.originalError=e}};var jf=class extends Error{originalError;constructor(e){super(`Failed to remove temporary file. ${e.message}`),this.originalError=e}};function H3(t="",e,r){let n=new kx(t,r);n.runAsync((i,s)=>{if(i)setImmediate(e,i,void 0);else try{n.cleanup(),setImmediate(e,void 0,s)}catch(o){setImmediate(e,o,void 0)}})}function $3(t){return t?t.replace(/[^a-zA-Z0-9_.-]/g,"_"):""}function lG(t){let e=[],r="";for(let n=0;n<t.length;n++){let i=t.charAt(n);n>0&&i===" "&&t[n-1]!=="\\"&&r.length>0?(e.push(r),r=""):r=`${r}${i}`}return r.length>0&&e.push(r),e}var kx=class{text="";tempFile;editor;lastExitStatus=0;fileOptions={};get temp_file(){return console.log("DEPRECATED: temp_file. Use tempFile moving forward."),this.tempFile}get last_exit_status(){return console.log("DEPRECATED: last_exit_status. Use lastExitStatus moving forward."),this.lastExitStatus}constructor(e="",r){this.text=e,r&&(this.fileOptions=r),this.determineEditor(),this.createTemporaryFile()}run(){return this.launchEditor(),this.readTemporaryFile(),this.text}runAsync(e){try{this.launchEditorAsync(()=>{try{this.readTemporaryFile(),setImmediate(e,void 0,this.text)}catch(r){setImmediate(e,r,void 0)}})}catch(r){setImmediate(e,r,void 0)}}cleanup(){this.removeTemporaryFile()}determineEditor(){let e=process.env.VISUAL?process.env.VISUAL:process.env.EDITOR?process.env.EDITOR:process.platform.startsWith("win")?"notepad":"vim",r=lG(e).map(i=>i.replace("\\ "," ")),n=r.shift();this.editor={args:r,bin:n}}createTemporaryFile(){try{let e=this.fileOptions.dir??U3.default.tmpdir(),r=(0,q3.randomUUID)(),n=$3(this.fileOptions.prefix),i=$3(this.fileOptions.postfix),s=`${n}${r}${i}`,o=Uf.default.resolve(e,s),a=Uf.default.resolve(e)+Uf.default.sep;if(!o.startsWith(a))throw new Error("Resolved temporary file escaped the base directory");this.tempFile=o;let u={encoding:"utf8",flag:"wx"};Object.prototype.hasOwnProperty.call(this.fileOptions,"mode")&&(u.mode=this.fileOptions.mode),(0,Ao.writeFileSync)(this.tempFile,this.text,u)}catch(e){throw new Nf(e)}}readTemporaryFile(){try{let e=(0,Ao.readFileSync)(this.tempFile);if(e.length===0)this.text="";else{let r=(0,j3.detect)(e)??"utf8";Tx.default.encodingExists(r)||(r="utf8"),this.text=Tx.default.decode(e,r)}}catch(e){throw new $f(e)}}removeTemporaryFile(){try{(0,Ao.unlinkSync)(this.tempFile)}catch(e){throw new jf(e)}}launchEditor(){try{let e=(0,qf.spawnSync)(this.editor.bin,this.editor.args.concat([this.tempFile]),{stdio:"inherit"});this.lastExitStatus=e.status??0}catch(e){throw new Gu(e)}}launchEditorAsync(e){try{(0,qf.spawn)(this.editor.bin,this.editor.args.concat([this.tempFile]),{stdio:"inherit"}).on("exit",n=>{this.lastExitStatus=n,setImmediate(e)})}catch(r){throw new Gu(r)}}};var fG={validationFailureMode:"keep"},hG=$e((t,e)=>{let{waitForUserInput:r=!0,file:{postfix:n=t.postfix??".txt",...i}={},validate:s=()=>!0}=t,o=ke(fG,t.theme),[a,u]=z("idle"),[c="",l]=z(t.default),[f,h]=z(),d=Le({status:a,theme:o});function p(y){y.pause();let b=async(C,_)=>{if(y.resume(),C)h(C.toString());else{u("loading");let T=_??"",B=await s(T);B===!0?(h(void 0),u("done"),e(T)):(o.validationFailureMode==="clear"?l(t.default):l(T),h(B||"You must provide a valid value"),u("idle"))}};H3(c,(C,_)=>void b(C,_),{postfix:n,...i})}Gt(y=>{r||p(y)},[]),Ne((y,b)=>{a==="idle"&&Me(y)&&p(b)});let m=o.style.message(t.message,a),x="";if(a==="loading")x=o.style.help("Received");else if(a==="idle"){let y=o.style.key("enter");x=o.style.help(`Press ${y} to launch your preferred editor.`)}let D="";return f&&(D=o.style.error(f)),[[d,m,x].filter(Boolean).join(" "),D]});function W3(t,e){let r=e!==!1;return/^(y|yes)/i.test(t)?r=!0:/^(n|no)/i.test(t)&&(r=!1),r}function G3(t){return t?"Yes":"No"}var Hf=$e((t,e)=>{let{transformer:r=G3}=t,[n,i]=z("idle"),[s,o]=z(""),a=ke(t.theme),u=Le({status:n,theme:a});Ne((h,d)=>{if(n==="idle")if(Me(h)){let p=W3(s,t.default);o(r(p)),i("done"),e(p)}else if(Bn(h)){let p=G3(!W3(s,t.default));d.clearLine(0),d.write(p),o(p)}else o(d.line)});let c=s,l="";n==="done"?c=a.style.answer(s):l=` ${a.style.defaultAnswer(t.default===!1?"y/N":"Y/n")}`;let f=a.style.message(t.message,n);return`${u} ${f}${l} ${c}`});var dG={validationFailureMode:"keep"},Vu=$e((t,e)=>{let{prefill:r="tab"}=t,n=ke(dG,t.theme),[i,s]=z("idle"),[o="",a]=z(t.default),[u,c]=z(),[l,f]=z(""),h=Le({status:i,theme:n});async function d(y){let{required:b,pattern:C,patternError:_="Invalid input"}=t;return b&&!y?"You must provide a value":C&&!C.test(y)?_:typeof t.validate=="function"?await t.validate(y)||"You must provide a valid value":!0}Ne(async(y,b)=>{if(i==="idle")if(Me(y)){let C=l||o;s("loading");let _=await d(C);_===!0?(f(C),s("done"),e(C)):(n.validationFailureMode==="clear"?f(""):b.write(l),c(_),s("idle"))}else ns(y)&&!l?a(void 0):Bn(y)&&!l?(a(void 0),b.clearLine(0),b.write(o),f(o)):(f(b.line),c(void 0))}),Gt(y=>{r==="editable"&&o&&(y.write(o),f(o))},[]);let p=n.style.message(t.message,i),m=l;typeof t.transformer=="function"?m=t.transformer(l,{isFinal:i==="done"}):i==="done"&&(m=n.style.answer(l));let x;o&&i!=="done"&&!l&&(x=n.style.defaultAnswer(o));let D="";return u&&(D=n.style.error(u)),[[h,p,x,m].filter(y=>y!==void 0).join(" "),D]});function pG(t,e,r){let n=t*Math.pow(10,6),i=e*Math.pow(10,6),s=r*Math.pow(10,6);return(n-(Number.isFinite(r)?s:0))%i===0}function V3(t,{min:e,max:r,step:n}){return t==null||Number.isNaN(t)?!1:t<e||t>r?`Value must be between ${e} and ${r}`:n!=="any"&&!pG(t,n,e)?`Value must be a multiple of ${n}${Number.isFinite(e)?` starting from ${e}`:""}`:!0}var mG=$e((t,e)=>{let{validate:r=()=>!0,min:n=-1/0,max:i=1/0,step:s=1,required:o=!1}=t,a=ke(t.theme),[u,c]=z("idle"),[l,f]=z(""),h=V3(t.default,{min:n,max:i,step:s})===!0?t.default?.toString():void 0,[d="",p]=z(h),[m,x]=z(),D=Le({status:u,theme:a});Ne(async(T,B)=>{if(u==="idle")if(Me(T)){let O=l||d,v=O===""?void 0:Number(O);c("loading");let A=!0;(o||v!=null)&&(A=V3(v,{min:n,max:i,step:s})),A===!0&&(A=await r(v)),A===!0?(f(String(v??"")),c("done"),e(v)):(B.write(l),x(A||"You must provide a valid numeric value"),c("idle"))}else ns(T)&&!l?p(void 0):Bn(T)&&!l?(p(void 0),B.clearLine(0),B.write(d),f(d)):(f(B.line),x(void 0))});let y=a.style.message(t.message,u),b=l;u==="done"&&(b=a.style.answer(l));let C;d&&u!=="done"&&!l&&(C=a.style.defaultAnswer(d));let _="";return m&&(_=a.style.error(m)),[[D,y,C,b].filter(T=>T!==void 0).join(" "),_]});var Ox=P(oi(),1);function DG(t){return t.map(e=>{if(fe.isSeparator(e))return e;let r="name"in e?e.name:String(e.value);return{value:"value"in e?e.value:r,name:r,key:e.key.toLowerCase()}})}var gG={key:"h",name:"Help, list all options",value:void 0},xG=$e((t,e)=>{let{default:r="h"}=t,n=Lt(()=>DG(t.choices),[t.choices]),[i,s]=z("idle"),[o,a]=z(""),[u,c]=z(t.expanded??!1),[l,f]=z(),h=ke(t.theme),d=Le({theme:h,status:i});Ne((_,T)=>{if(Me(_)){let B=(o||r).toLowerCase();if(B==="h"&&!u)c(!0);else{let O=n.find(v=>!fe.isSeparator(v)&&v.key===B);O?(s("done"),a(B),e(O.value)):f(o===""?"Please input a value":`"${Ox.default.red(o)}" isn't an available option`)}}else a(T.line),f(void 0)});let p=h.style.message(t.message,i);if(i==="done"){let _=n.find(T=>!fe.isSeparator(T)&&T.key===o.toLowerCase());return`${d} ${p} ${h.style.answer(_.name)}`}let m=u?n:[...n,gG],x="",D=m.map(_=>fe.isSeparator(_)?"":_.key===r?_.key.toUpperCase():_.key).join("");D=` ${h.style.defaultAnswer(D)}`,u&&(D="",x=m.map(_=>{if(fe.isSeparator(_))return` ${_.separator}`;let T=` ${_.key}) ${_.name}`;return _.key===o.toLowerCase()?h.style.highlight(T):T}).join(`
|
|
134
134
|
`));let y="",b=n.find(_=>!fe.isSeparator(_)&&_.key===o.toLowerCase());b&&(y=`${Ox.default.cyan(">>")} ${b.name}`);let C="";return l&&(C=h.style.error(l)),[`${d} ${p}${D} ${o}`,[x,y,C].filter(Boolean).join(`
|
|
135
|
-
`)]});var K3=P(oi(),1),yG=/\d+/;function hs(t){return t!=null&&!fe.isSeparator(t)}function bG(t){let e=0;return t.map(r=>{if(fe.isSeparator(r))return r;if(e+=1,typeof r=="string")return{value:r,name:r,short:r,key:String(e)};let n=r.name??String(r.value);return{value:r.value,name:n,short:r.short??n,key:r.key??String(e)}})}function z3(t,e){let r,n=e.filter(hs);if(r=n.find(i=>i.key===t),!r&&yG.test(t)){let i=Number.parseInt(t,10)-1;r=n[i]}return r?[r,e.indexOf(r)]:[void 0,void 0]}var FG
|
|
135
|
+
`)]});var K3=P(oi(),1),yG=/\d+/;function hs(t){return t!=null&&!fe.isSeparator(t)}function bG(t){let e=0;return t.map(r=>{if(fe.isSeparator(r))return r;if(e+=1,typeof r=="string")return{value:r,name:r,short:r,key:String(e)};let n=r.name??String(r.value);return{value:r.value,name:n,short:r.short??n,key:r.key??String(e)}})}function z3(t,e){let r,n=e.filter(hs);if(r=n.find(i=>i.key===t),!r&&yG.test(t)){let i=Number.parseInt(t,10)-1;r=n[i]}return r?[r,e.indexOf(r)]:[void 0,void 0]}var FG=$e((t,e)=>{let{loop:r=!0}=t,n=Lt(()=>bG(t.choices),[t.choices]),[i,s]=z("idle"),[o,a]=z(""),[u,c]=z(),l=ke(t.theme),f=Le({status:i,theme:l}),h=Lt(()=>{let x=n.findIndex(hs),D=n.findLastIndex(hs);if(x===-1)throw new Jr("[select prompt] No selectable choices. All choices are disabled.");return{first:x,last:D}},[n]);Ne((x,D)=>{if(Me(x)){let[y]=z3(o,n);hs(y)?(a(y.short),s("done"),e(y.value)):c(o===""?"Please input a value":`"${K3.default.red(o)}" isn't an available option`)}else if(rt(x)||Mt(x)){D.clearLine(0);let[y,b]=z3(o,n);if(y){if(r||rt(x)&&b!==h.first||Mt(x)&&b!==h.last){let C=rt(x)?-1:1,_=b;do _=(_+C+n.length)%n.length;while(!hs(n[_]));a(n[_].key)}}else{let C=Mt(x)?n.find(hs):n.findLast(hs);a(C.key)}}else a(D.line),c(void 0)});let d=l.style.message(t.message,i);if(i==="done")return`${f} ${d} ${l.style.answer(o)}`;let p=n.map(x=>{if(fe.isSeparator(x))return` ${x.separator}`;let D=` ${x.key}) ${x.name}`;return x.key===o.toLowerCase()?l.style.highlight(D):D}).join(`
|
|
136
136
|
`),m="";return u&&(m=l.style.error(u)),[`${f} ${d} ${o}`,[p,m].filter(Boolean).join(`
|
|
137
|
-
`)]});var Px
|
|
138
|
-
`).trimEnd();return[O,v]});var To=P(oi(),1);var SG={icon:{cursor:sr.pointer},style:{disabled:t=>To.default.dim(`- ${t}`),description:t=>To.default.cyan(t),keysHelpTip:t=>t.map(([e,r])=>`${To.default.bold(e)} ${To.default.dim(r)}`).join(To.default.dim(" \u2022 "))},helpMode:"always",indexMode:"hidden",keybindings:[]};function Bo(t){return!fe.isSeparator(t)&&!t.disabled}function vG(t){return t.map(e=>{if(fe.isSeparator(e))return e;if(typeof e=="string")return{value:e,name:e,short:e,disabled:!1};let r=e.name??String(e.value),n={value:e.value,name:r,short:e.short??r,disabled:e.disabled??!1};return e.description&&(n.description=e.description),n})}var Wf
|
|
137
|
+
`)]});var Px=$e((t,e)=>{let{validate:r=()=>!0}=t,n=ke(t.theme),[i,s]=z("idle"),[o,a]=z(),[u,c]=z(""),l=Le({status:i,theme:n});Ne(async(m,x)=>{if(i==="idle")if(Me(m)){let D=u;s("loading");let y=await r(D);y===!0?(c(D),s("done"),e(D)):(x.write(u),a(y||"You must provide a valid value"),s("idle"))}else c(x.line),a(void 0)});let f=n.style.message(t.message,i),h="",d;t.mask?h=(typeof t.mask=="string"?t.mask:"*").repeat(u.length):i!=="done"&&(d=`${n.style.help("[input is masked]")}${wo}`),i==="done"&&(h=n.style.answer(h));let p="";return o&&(p=n.style.error(o)),[[l,f,t.mask?h:d].join(" "),p]});var ds=P(oi(),1);var EG={icon:{cursor:sr.pointer},style:{disabled:t=>ds.default.dim(`- ${t}`),searchTerm:t=>ds.default.cyan(t),description:t=>ds.default.cyan(t),keysHelpTip:t=>t.map(([e,r])=>`${ds.default.bold(e)} ${ds.default.dim(r)}`).join(ds.default.dim(" \u2022 "))},helpMode:"always"};function Rx(t){return!fe.isSeparator(t)&&!t.disabled}function CG(t){return t.map(e=>{if(fe.isSeparator(e))return e;if(typeof e=="string")return{value:e,name:e,short:e,disabled:!1};let r=e.name??String(e.value),n={value:e.value,name:r,short:e.short??r,disabled:e.disabled??!1};return e.description&&(n.description=e.description),n})}var wG=$e((t,e)=>{let{pageSize:r=7,validate:n=()=>!0}=t,i=ke(EG,t.theme),[s,o]=z("loading"),[a,u]=z(""),[c,l]=z([]),[f,h]=z(),d=Le({status:s,theme:i}),p=Lt(()=>{let A=c.findIndex(Rx),F=c.findLastIndex(Rx);return{first:A,last:F}},[c]),[m=p.first,x]=z();Gt(()=>{let A=new AbortController;return o("loading"),h(void 0),(async()=>{try{let I=await t.source(a||void 0,{signal:A.signal});A.signal.aborted||(x(void 0),h(void 0),l(CG(I)),o("idle"))}catch(I){!A.signal.aborted&&I instanceof Error&&h(I.message)}})(),()=>{A.abort()}},[a]);let D=c[m];Ne(async(A,F)=>{if(Me(A))if(D){o("loading");let I=await n(D.value);o("idle"),I===!0?(o("done"),e(D.value)):D.name===a?h(I||"You must provide a valid value"):(F.write(D.name),u(D.name))}else F.write(a);else if(Bn(A)&&D)F.clearLine(0),F.write(D.name),u(D.name);else if(s!=="loading"&&(rt(A)||Mt(A))){if(F.clearLine(0),rt(A)&&m!==p.first||Mt(A)&&m!==p.last){let I=rt(A)?-1:1,$=m;do $=($+I+c.length)%c.length;while(!Rx(c[$]));x($)}}else u(F.line)});let y=i.style.message(t.message,s),b;if(i.helpMode!=="never")if(t.instructions){let{pager:A,navigation:F}=t.instructions;b=i.style.help(c.length>r?A:F)}else b=i.style.keysHelpTip([["\u2191\u2193","navigate"],["\u23CE","select"]]);let C=as({items:c,active:m,renderItem({item:A,isActive:F}){if(fe.isSeparator(A))return` ${A.separator}`;if(A.disabled){let J=typeof A.disabled=="string"?A.disabled:"(disabled)";return i.style.disabled(`${A.name} ${J}`)}let I=F?i.style.highlight:J=>J,$=F?i.icon.cursor:" ";return I(`${$} ${A.name}`)},pageSize:r,loop:!1}),_;f?_=i.style.error(f):c.length===0&&a!==""&&s==="idle"&&(_=i.style.error("No results found"));let T;if(s==="done"&&D)return[d,y,i.style.answer(D.short)].filter(Boolean).join(" ").trimEnd();T=i.style.searchTerm(a);let B=D?.description,O=[d,y,T].filter(Boolean).join(" ").trimEnd(),v=[_??C," ",B?i.style.description(B):"",b].filter(Boolean).join(`
|
|
138
|
+
`).trimEnd();return[O,v]});var To=P(oi(),1);var SG={icon:{cursor:sr.pointer},style:{disabled:t=>To.default.dim(`- ${t}`),description:t=>To.default.cyan(t),keysHelpTip:t=>t.map(([e,r])=>`${To.default.bold(e)} ${To.default.dim(r)}`).join(To.default.dim(" \u2022 "))},helpMode:"always",indexMode:"hidden",keybindings:[]};function Bo(t){return!fe.isSeparator(t)&&!t.disabled}function vG(t){return t.map(e=>{if(fe.isSeparator(e))return e;if(typeof e=="string")return{value:e,name:e,short:e,disabled:!1};let r=e.name??String(e.value),n={value:e.value,name:r,short:e.short??r,disabled:e.disabled??!1};return e.description&&(n.description=e.description),n})}var Wf=$e((t,e)=>{let{loop:r=!0,pageSize:n=7}=t,i=ke(SG,t.theme),{keybindings:s}=i,[o,a]=z("idle"),u=Le({status:o,theme:i}),c=os(),l=!s.includes("vim"),f=Lt(()=>vG(t.choices),[t.choices]),h=Lt(()=>{let B=f.findIndex(Bo),O=f.findLastIndex(Bo);if(B===-1)throw new Jr("[select prompt] No selectable choices. All choices are disabled.");return{first:B,last:O}},[f]),d=Lt(()=>"default"in t?f.findIndex(B=>Bo(B)&&B.value===t.default):-1,[t.default,f]),[p,m]=z(d===-1?h.first:d),x=f[p];Ne((B,O)=>{if(clearTimeout(c.current),Me(B))a("done"),e(x.value);else if(rt(B,s)||Mt(B,s)){if(O.clearLine(0),r||rt(B,s)&&p!==h.first||Mt(B,s)&&p!==h.last){let v=rt(B,s)?-1:1,A=p;do A=(A+v+f.length)%f.length;while(!Bo(f[A]));m(A)}}else if(Pu(B)&&!Number.isNaN(Number(O.line))){let v=Number(O.line)-1,A=-1,F=f.findIndex($=>fe.isSeparator($)?!1:(A++,A===v)),I=f[F];I!=null&&Bo(I)&&m(F),c.current=setTimeout(()=>{O.clearLine(0)},700)}else if(ns(B))O.clearLine(0);else if(l){let v=O.line.toLowerCase(),A=f.findIndex(F=>fe.isSeparator(F)||!Bo(F)?!1:F.name.toLowerCase().startsWith(v));A!==-1&&m(A),c.current=setTimeout(()=>{O.clearLine(0)},700)}}),Gt(()=>()=>{clearTimeout(c.current)},[]);let D=i.style.message(t.message,o),y;if(i.helpMode!=="never")if(t.instructions){let{pager:B,navigation:O}=t.instructions;y=i.style.help(f.length>n?B:O)}else y=i.style.keysHelpTip([["\u2191\u2193","navigate"],["\u23CE","select"]]);let b=0,C=as({items:f,active:p,renderItem({item:B,isActive:O,index:v}){if(fe.isSeparator(B))return b++,` ${B.separator}`;let A=i.indexMode==="number"?`${v+1-b}. `:"";if(B.disabled){let $=typeof B.disabled=="string"?B.disabled:"(disabled)";return i.style.disabled(`${A}${B.name} ${$}`)}let F=O?i.style.highlight:$=>$,I=O?i.icon.cursor:" ";return F(`${I} ${A}${B.name}`)},pageSize:n,loop:r});if(o==="done")return[u,D,i.style.answer(x.short)].filter(Boolean).join(" ");let{description:_}=x;return`${[[u,D].filter(Boolean).join(" "),C," ",_?i.style.description(_):"",y].filter(Boolean).join(`
|
|
139
139
|
`).trimEnd()}${wo}`});var Zu=P(require("node:process"),1);Bm();var Ju=P(Ix(),1);var hr=P(require("node:process"),1);function Mx(){return hr.default.platform!=="win32"?hr.default.env.TERM!=="linux":!!hr.default.env.CI||!!hr.default.env.WT_SESSION||!!hr.default.env.TERMINUS_SUBLIME||hr.default.env.ConEmuTask==="{cmd::Cmder}"||hr.default.env.TERM_PROGRAM==="Terminus-Sublime"||hr.default.env.TERM_PROGRAM==="vscode"||hr.default.env.TERM==="xterm-256color"||hr.default.env.TERM==="alacritty"||hr.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var AG={info:E.blue("\u2139"),success:E.green("\u2714"),warning:E.yellow("\u26A0"),error:E.red("\u2716")},BG={info:E.blue("i"),success:E.green("\u221A"),warning:E.yellow("\u203C"),error:E.red("\xD7")},TG=Mx()?AG:BG,zu=TG;function Lx({onlyFirst:t=!1}={}){let i="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(i,t?void 0:"g")}var kG=Lx();function Ku(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(kG,"")}bu();var ev=P(Q3(),1),OG=new Intl.Segmenter,PG=/^\p{Default_Ignorable_Code_Point}$/u;function Nx(t,e={}){if(typeof t!="string"||t.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=e;if(n||(t=Ku(t)),t.length===0)return 0;let i=0,s={ambiguousAsWide:!r};for(let{segment:o}of OG.segment(t)){let a=o.codePointAt(0);if(!(a<=31||a>=127&&a<=159)&&!(a>=8203&&a<=8207||a===65279)&&!(a>=768&&a<=879||a>=6832&&a<=6911||a>=7616&&a<=7679||a>=8400&&a<=8447||a>=65056&&a<=65071)&&!(a>=55296&&a<=57343)&&!(a>=65024&&a<=65039)&&!PG.test(o)){if((0,ev.default)().test(o)){i+=2;continue}i+=lo(a,s)}}return i}function $x({stream:t=process.stdout}={}){return!!(t&&t.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}var jx=P(require("node:process"),1);function Yu(){let{env:t}=jx.default,{TERM:e,TERM_PROGRAM:r}=t;return jx.default.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Rr=P(require("node:process"),1),RG=3,Ux=class{#e=0;start(){this.#e++,this.#e===1&&this.#r()}stop(){if(this.#e<=0)throw new Error("`stop` called more times than `start`");this.#e--,this.#e===0&&this.#t()}#r(){Rr.default.platform==="win32"||!Rr.default.stdin.isTTY||(Rr.default.stdin.setRawMode(!0),Rr.default.stdin.on("data",this.#n),Rr.default.stdin.resume())}#t(){Rr.default.stdin.isTTY&&(Rr.default.stdin.off("data",this.#n),Rr.default.stdin.pause(),Rr.default.stdin.setRawMode(!1))}#n(e){e[0]===RG&&Rr.default.emit("SIGINT")}},IG=new Ux,qx=IG;var MG=P(Ix(),1),Hx=class{#e=0;#r=!1;#t=0;#n=-1;#o=0;#a;#f;#u;#c;#m;#h;#l;#i;#x;#D;#p;color;constructor(e){typeof e=="string"&&(e={text:e}),this.#a={color:"cyan",stream:Zu.default.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#a.color,this.spinner=this.#a.spinner,this.#m=this.#a.interval,this.#u=this.#a.stream,this.#h=typeof this.#a.isEnabled=="boolean"?this.#a.isEnabled:$x({stream:this.#u}),this.#l=typeof this.#a.isSilent=="boolean"?this.#a.isSilent:!1,this.text=this.#a.text,this.prefixText=this.#a.prefixText,this.suffixText=this.#a.suffixText,this.indent=this.#a.indent,Zu.default.env.NODE_ENV==="test"&&(this._stream=this.#u,this._isEnabled=this.#h,Object.defineProperty(this,"_linesToClear",{get(){return this.#e},set(r){this.#e=r}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#n}}),Object.defineProperty(this,"_lineCount",{get(){return this.#t}}))}get indent(){return this.#i}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw new Error("The `indent` option must be an integer from 0 and up");this.#i=e,this.#g()}get interval(){return this.#m??this.#f.interval??100}get spinner(){return this.#f}set spinner(e){if(this.#n=-1,this.#m=void 0,typeof e=="object"){if(e.frames===void 0)throw new Error("The given spinner must have a `frames` property");this.#f=e}else if(!Yu())this.#f=Ju.default.line;else if(e===void 0)this.#f=Ju.default.dots;else if(e!=="default"&&Ju.default[e])this.#f=Ju.default[e];else throw new Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#x}set text(e=""){this.#x=e,this.#g()}get prefixText(){return this.#D}set prefixText(e=""){this.#D=e,this.#g()}get suffixText(){return this.#p}set suffixText(e=""){this.#p=e,this.#g()}get isSpinning(){return this.#c!==void 0}#y(e=this.#D,r=" "){return typeof e=="string"&&e!==""?e+r:typeof e=="function"?e()+r:""}#w(e=this.#p,r=" "){return typeof e=="string"&&e!==""?r+e:typeof e=="function"?r+e():""}#g(){let e=this.#u.columns??80,r=this.#y(this.#D,"-"),n=this.#w(this.#p,"-"),i=" ".repeat(this.#i)+r+"--"+this.#x+"--"+n;this.#t=0;for(let s of Ku(i).split(`
|
|
140
140
|
`))this.#t+=Math.max(1,Math.ceil(Nx(s,{countAnsiEscapeCodes:!0})/e))}get isEnabled(){return this.#h&&!this.#l}set isEnabled(e){if(typeof e!="boolean")throw new TypeError("The `isEnabled` option must be a boolean");this.#h=e}get isSilent(){return this.#l}set isSilent(e){if(typeof e!="boolean")throw new TypeError("The `isSilent` option must be a boolean");this.#l=e}frame(){let e=Date.now();(this.#n===-1||e-this.#o>=this.interval)&&(this.#n=++this.#n%this.#f.frames.length,this.#o=e);let{frames:r}=this.#f,n=r[this.#n];this.color&&(n=E[this.color](n));let i=typeof this.#D=="string"&&this.#D!==""?this.#D+" ":"",s=typeof this.text=="string"?" "+this.text:"",o=typeof this.#p=="string"&&this.#p!==""?" "+this.#p:"";return i+n+s+o}clear(){if(!this.#h||!this.#u.isTTY)return this;this.#u.cursorTo(0);for(let e=0;e<this.#e;e++)e>0&&this.#u.moveCursor(0,-1),this.#u.clearLine(1);return(this.#i||this.lastIndent!==this.#i)&&this.#u.cursorTo(this.#i),this.lastIndent=this.#i,this.#e=0,this}render(){return this.#l?this:(this.clear(),this.#u.write(this.frame()),this.#e=this.#t,this)}start(e){return e&&(this.text=e),this.#l?this:this.#h?this.isSpinning?this:(this.#a.hideCursor&&co.hide(this.#u),this.#a.discardStdin&&Zu.default.stdin.isTTY&&(this.#r=!0,qx.start()),this.render(),this.#c=setInterval(this.render.bind(this),this.interval),this):(this.text&&this.#u.write(`- ${this.text}
|
|
141
141
|
`),this)}stop(){return this.#h?(clearInterval(this.#c),this.#c=void 0,this.#n=0,this.clear(),this.#a.hideCursor&&co.show(this.#u),this.#a.discardStdin&&Zu.default.stdin.isTTY&&this.#r&&(qx.stop(),this.#r=!1),this):this}succeed(e){return this.stopAndPersist({symbol:zu.success,text:e})}fail(e){return this.stopAndPersist({symbol:zu.error,text:e})}warn(e){return this.stopAndPersist({symbol:zu.warning,text:e})}info(e){return this.stopAndPersist({symbol:zu.info,text:e})}stopAndPersist(e={}){if(this.#l)return this;let r=e.prefixText??this.#D,n=this.#y(r," "),i=e.symbol??" ",s=e.text??this.text,a=typeof s=="string"?(i?" ":"")+s:"",u=e.suffixText??this.#p,c=this.#w(u," "),l=n+i+a+c+`
|
|
142
|
-
`;return this.stop(),this.#u.write(l),this}};function Wx(t){return new Hx(t)}var xk=require("node:child_process");function
|
|
142
|
+
`;return this.stop(),this.#u.write(l),this}};function Wx(t){return new Hx(t)}var xk=require("node:child_process");function je(t){if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}var tv=require("node:url"),ko=(t,e)=>{let r=Vx(LG(t));if(typeof r!="string")throw new TypeError(`${e} must be a string or a file URL: ${r}.`);return r},LG=t=>Gx(t)?t.toString():t,Gx=t=>typeof t!="string"&&t&&Object.getPrototypeOf(t)===String.prototype,Vx=t=>t instanceof URL?(0,tv.fileURLToPath)(t):t;var Vf=(t,e=[],r={})=>{let n=ko(t,"First argument"),[i,s]=je(e)?[[],e]:[e,r];if(!Array.isArray(i))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(u=>typeof u=="object"&&u!==null))throw new TypeError(`Second argument must be an array of strings: ${i}`);let o=i.map(String),a=o.find(u=>u.includes("\0"));if(a!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!je(s))throw new TypeError(`Last argument must be an options object: ${s}`);return[n,o,s]};var lv=require("node:child_process");var rv=require("node:string_decoder"),{toString:nv}=Object.prototype,iv=t=>nv.call(t)==="[object ArrayBuffer]",ze=t=>nv.call(t)==="[object Uint8Array]",Pn=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),NG=new TextEncoder,sv=t=>NG.encode(t),$G=new TextDecoder,zf=t=>$G.decode(t),ov=(t,e)=>jG(t,e).join(""),jG=(t,e)=>{if(e==="utf8"&&t.every(s=>typeof s=="string"))return t;let r=new rv.StringDecoder(e),n=t.map(s=>typeof s=="string"?sv(s):s).map(s=>r.write(s)),i=r.end();return i===""?n:[...n,i]},Xu=t=>t.length===1&&ze(t[0])?t[0]:zx(UG(t)),UG=t=>t.map(e=>typeof e=="string"?sv(e):e),zx=t=>{let e=new Uint8Array(qG(t)),r=0;for(let n of t)e.set(n,r),r+=n.length;return e},qG=t=>{let e=0;for(let r of t)e+=r.length;return e};var fv=t=>Array.isArray(t)&&Array.isArray(t.raw),hv=(t,e)=>{let r=[];for(let[s,o]of t.entries())r=HG({templates:t,expressions:e,tokens:r,index:s,template:o});if(r.length===0)throw new TypeError("Template script must not be empty");let[n,...i]=r;return[n,i,{}]},HG=({templates:t,expressions:e,tokens:r,index:n,template:i})=>{if(i===void 0)throw new TypeError(`Invalid backslash sequence: ${t.raw[n]}`);let{nextTokens:s,leadingWhitespaces:o,trailingWhitespaces:a}=WG(i,t.raw[n]),u=uv(r,s,o);if(n===e.length)return u;let c=e[n],l=Array.isArray(c)?c.map(f=>cv(f)):[cv(c)];return uv(u,l,a)},WG=(t,e)=>{if(e.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let r=[],n=0,i=av.has(e[0]);for(let o=0,a=0;o<t.length;o+=1,a+=1){let u=e[a];if(av.has(u))n!==o&&r.push(t.slice(n,o)),n=o+1;else if(u==="\\"){let c=e[a+1];c===`
|
|
143
143
|
`?(o-=1,a+=1):c==="u"&&e[a+2]==="{"?a=e.indexOf("}",a+3):a+=GG[c]??1}}let s=n===t.length;return s||r.push(t.slice(n)),{nextTokens:r,leadingWhitespaces:i,trailingWhitespaces:s}},av=new Set([" "," ","\r",`
|
|
144
|
-
`]),GG={x:3,u:5},uv=(t,e,r)=>r||t.length===0||e.length===0?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],cv=t=>{let e=typeof t;if(e==="string")return t;if(e==="number")return String(t);if(
|
|
144
|
+
`]),GG={x:3,u:5},uv=(t,e,r)=>r||t.length===0||e.length===0?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],cv=t=>{let e=typeof t;if(e==="string")return t;if(e==="number")return String(t);if(je(t)&&("stdout"in t||"isMaxBuffer"in t))return VG(t);throw t instanceof lv.ChildProcess||Object.prototype.toString.call(t)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${e}" in template expression`)},VG=({stdout:t})=>{if(typeof t=="string")return t;if(ze(t))return zf(t);throw t===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof t}" stdout in template expression`)};var E5=require("node:child_process");var pv=require("node:util");var Kf=P(require("node:process"),1),Ir=t=>Yf.includes(t),Yf=[Kf.default.stdin,Kf.default.stdout,Kf.default.stderr],dr=["stdin","stdout","stderr"],Zf=t=>dr[t]??`stdio[${t}]`;var mv=t=>{let e={...t};for(let r of Zx)e[r]=Kx(t,r);return e},Kx=(t,e)=>{let r=Array.from({length:zG(t)+1}),n=KG(t[e],r,e);return QG(n,e)},zG=({stdio:t})=>Array.isArray(t)?Math.max(t.length,dr.length):dr.length,KG=(t,e,r)=>je(t)?YG(t,e,r):e.fill(t),YG=(t,e,r)=>{for(let n of Object.keys(t).sort(ZG))for(let i of JG(n,r,e))e[i]=t[n];return e},ZG=(t,e)=>dv(t)<dv(e)?1:-1,dv=t=>t==="stdout"||t==="stderr"?0:t==="all"?2:1,JG=(t,e,r)=>{if(t==="ipc")return[r.length-1];let n=Yx(t);if(n===void 0||n===0)throw new TypeError(`"${e}.${t}" is invalid.
|
|
145
145
|
It must be "${e}.stdout", "${e}.stderr", "${e}.all", "${e}.ipc", or "${e}.fd3", "${e}.fd4" (and so on).`);if(n>=r.length)throw new TypeError(`"${e}.${t}" is invalid: that file descriptor does not exist.
|
|
146
146
|
Please set the "stdio" option to ensure that file descriptor exists.`);return n==="all"?[1,2]:[n]},Yx=t=>{if(t==="all")return t;if(dr.includes(t))return dr.indexOf(t);let e=XG.exec(t);if(e!==null)return Number(e[1])},XG=/^fd(\d+)$/,QG=(t,e)=>t.map(r=>r===void 0?tV[e]:r),eV=(0,pv.debuglog)("execa").enabled?"full":"none",tV={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:eV,stripFinalNewline:!0},Zx=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],Rn=(t,e)=>e==="ipc"?t.at(-1):t[e];var Oo=({verbose:t},e)=>Jx(t,e)!=="none",Po=({verbose:t},e)=>!["none","short"].includes(Jx(t,e)),Dv=({verbose:t},e)=>{let r=Jx(t,e);return Jf(r)?r:void 0},Jx=(t,e)=>e===void 0?rV(t):Rn(t,e),rV=t=>t.find(e=>Jf(e))??Xf.findLast(e=>t.includes(e)),Jf=t=>typeof t=="function",Xf=["none","short","full"];var kv=require("node:util");var gv=require("node:process"),xv=require("node:util"),yv=(t,e)=>{let r=[t,...e],n=r.join(" "),i=r.map(s=>uV(bv(s))).join(" ");return{command:n,escapedCommand:i}},Qu=t=>(0,xv.stripVTControlCharacters)(t).split(`
|
|
147
147
|
`).map(e=>bv(e)).join(`
|
|
@@ -174,20 +174,20 @@ ${C}`,T=`${b}: ${a}${_}`,B=e===void 0?[t[2],t[1]]:[e],O=[T,...B,...t.slice(3),r.
|
|
|
174
174
|
`)].map(v=>Qu(jo(vK(v)))).filter(Boolean).join(`
|
|
175
175
|
|
|
176
176
|
`);return{originalMessage:C,shortMessage:T,message:O}},EK=({originalError:t,timedOut:e,timeout:r,isMaxBuffer:n,maxBuffer:i,errorCode:s,signal:o,signalDescription:a,exitCode:u,isCanceled:c,isGracefullyCanceled:l,isForcefullyTerminated:f,forceKillAfterDelay:h,killSignal:d})=>{let p=CK(f,h);return e?`Command timed out after ${r} milliseconds${p}`:l?o===void 0?`Command was gracefully canceled with exit code ${u}`:f?`Command was gracefully canceled${p}`:`Command was gracefully canceled with ${o} (${a})`:c?`Command was canceled${p}`:n?`${hA(t,i)}${p}`:s!==void 0?`Command failed with ${s}${p}`:f?`Command was killed with ${d} (${uh(d)})${p}`:o!==void 0?`Command was killed with ${o} (${a})`:u!==void 0?`Command failed with exit code ${u}`:"Command failed"},CK=(t,e)=>t?` and was forcefully terminated after ${e} milliseconds`:"",wK=(t,e)=>{if(t instanceof Mr)return;let r=A_(t)?t.originalMessage:String(t?.message??t),n=Qu(V4(r,e));return n===""?void 0:n},SK=t=>typeof t=="string"?t:(0,DA.inspect)(t),vK=t=>Array.isArray(t)?t.map(e=>jo(mA(e))).filter(Boolean).join(`
|
|
177
|
-
`):mA(t),mA=t=>typeof t=="string"?t:ze(t)?zf(t):"";var Rh=({command:t,escapedCommand:e,stdio:r,all:n,ipcOutput:i,options:{cwd:s},startTime:o})=>xA({command:t,escapedCommand:e,cwd:s,durationMs:Qx(o),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:n,stdio:r,ipcOutput:i,pipedFrom:[]}),qo=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:s,isSync:o})=>ac({error:t,command:e,escapedCommand:r,startTime:s,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:i,isSync:o}),ac=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:c,signal:l,stdio:f,all:h,ipcOutput:d,options:{timeoutDuration:p,timeout:m=p,forceKillAfterDelay:x,killSignal:D,cwd:y,maxBuffer:b},isSync:C})=>{let{exitCode:_,signal:T,signalDescription:B}=AK(c,l),{originalMessage:O,shortMessage:v,message:A}=gA({stdio:f,all:h,ipcOutput:d,originalError:t,signal:T,signalDescription:B,exitCode:_,escapedCommand:r,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:u,forceKillAfterDelay:x,killSignal:D,maxBuffer:b,timeout:m,cwd:y}),F=v_(t,A,C);return Object.assign(F,_K({error:F,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:_,signal:T,signalDescription:B,stdio:f,all:h,ipcOutput:d,cwd:y,originalMessage:O,shortMessage:v})),F},_K=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:c,signal:l,signalDescription:f,stdio:h,all:d,ipcOutput:p,cwd:m,originalMessage:x,shortMessage:D})=>xA({shortMessage:D,originalMessage:x,command:e,escapedCommand:r,cwd:m,durationMs:Qx(n),failed:!0,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isTerminated:l!==void 0,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:c,signal:l,signalDescription:f,code:t.cause?.code,stdout:h[1],stderr:h[2],all:d,stdio:h,ipcOutput:p,pipedFrom:[]}),xA=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),AK=(t,e)=>{let r=t===null?void 0:t,n=e===null?void 0:e,i=n===void 0?void 0:uh(e);return{exitCode:r,signal:n,signalDescription:i}};var yA=t=>Number.isFinite(t)?t:0;function BK(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(yA(t*1e3)%1e3),nanoseconds:Math.trunc(yA(t*1e6)%1e3)}}function TK(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function B2(t){switch(typeof t){case"number":{if(Number.isFinite(t))return BK(t);break}case"bigint":return TK(t)}throw new TypeError("Expected a finite number or bigint")}var kK=t=>t===0||t===0n,OK=(t,e)=>e===1||e===1n?t:`${t}s`,PK=1e-7,RK=24n*60n*60n*1000n;function T2(t,e){let r=typeof t=="bigint";if(!r&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};let n=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let i=[],s=(l,f)=>{let h=Math.floor(l*10**f+PK);return(Math.round(h)/10**f).toFixed(f)},o=(l,f,h,d)=>{if(!((i.length===0||!e.colonNotation)&&kK(l)&&!(e.colonNotation&&h==="m"))){if(d??=String(l),e.colonNotation){let p=d.includes(".")?d.split(".")[0].length:d.length,m=i.length>0?2:1;d="0".repeat(Math.max(0,m-p))+d}else d+=e.verbose?" "+OK(f,l):h;i.push(d)}},a=B2(t),u=BigInt(a.days);if(e.hideYearAndDays?o(BigInt(u)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?o(u,"day","d"):(o(u/365n,"year","y"),o(u%365n,"day","d")),o(Number(a.hours),"hour","h")),o(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3&&!e.subSecondsAsDecimals){let l=Number(a.seconds),f=Number(a.milliseconds),h=Number(a.microseconds),d=Number(a.nanoseconds);if(o(l,"second","s"),e.formatSubMilliseconds)o(f,"millisecond","ms"),o(h,"microsecond","\xB5s"),o(d,"nanosecond","ns");else{let p=f+h/1e3+d/1e6,m=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,x=p>=1?Math.round(p):Math.ceil(p),D=m?p.toFixed(m):x;o(Number.parseFloat(D),"millisecond","ms",D)}}else{let l=(r?Number(t%RK):t)/1e3%60,f=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,h=s(l,f),d=e.keepDecimalsOnWholeSeconds?h:h.replace(/\.0+$/,"");o(Number.parseFloat(d),"second","s",d)}if(i.length===0)return n+"0"+(e.verbose?" milliseconds":"ms");let c=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(i=i.slice(0,Math.max(e.unitCount,1))),n+i.join(c)}var bA=(t,e)=>{t.failed&&tn({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t})};var FA=(t,e)=>{Oo(e)&&(bA(t,e),IK(t,e))},IK=(t,e)=>{let r=`(done in ${T2(t.durationMs)})`;tn({type:"duration",verboseMessage:r,verboseInfo:e,result:t})};var Ho=(t,e,{reject:r})=>{if(FA(t,e),t.failed&&r)throw t;return t};var N2=require("node:fs");var wA=(t,e)=>Ds(t)?"asyncGenerator":_A(t)?"generator":Ih(t)?"fileUrl":jK(t)?"filePath":HK(t)?"webStream":Nr(t,{checkOpen:!1})?"native":ze(t)?"uint8Array":WK(t)?"asyncIterable":GK(t)?"iterable":P2(t)?SA({transform:t},e):$K(t)?MK(t,e):"native",MK=(t,e)=>S2(t.transform,{checkOpen:!1})?LK(t,e):P2(t.transform)?SA(t,e):NK(t,e),LK=(t,e)=>(vA(t,e,"Duplex stream"),"duplex"),SA=(t,e)=>(vA(t,e,"web TransformStream"),"webTransform"),vA=({final:t,binary:e,objectMode:r},n,i)=>{EA(t,`${n}.final`,i),EA(e,`${n}.binary`,i),k2(r,`${n}.objectMode`)},EA=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${r}.`)},NK=({transform:t,final:e,binary:r,objectMode:n},i)=>{if(t!==void 0&&!CA(t))throw new TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(S2(e,{checkOpen:!1}))throw new TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(P2(e))throw new TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!CA(e))throw new TypeError(`The \`${i}.final\` option must be a generator.`);return k2(r,`${i}.binary`),k2(n,`${i}.objectMode`),Ds(t)||Ds(e)?"asyncGenerator":"generator"},k2=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},CA=t=>Ds(t)||_A(t),Ds=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",_A=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",$K=t=>$e(t)&&(t.transform!==void 0||t.final!==void 0),Ih=t=>Object.prototype.toString.call(t)==="[object URL]",AA=t=>Ih(t)&&t.protocol!=="file:",jK=t=>$e(t)&&Object.keys(t).length>0&&Object.keys(t).every(e=>UK.has(e))&&O2(t.file),UK=new Set(["file","append"]),O2=t=>typeof t=="string",BA=(t,e)=>t==="native"&&typeof e=="string"&&!qK.has(e),qK=new Set(["ipc","ignore","inherit","overlapped","pipe"]),TA=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",Mh=t=>Object.prototype.toString.call(t)==="[object WritableStream]",HK=t=>TA(t)||Mh(t),P2=t=>TA(t?.readable)&&Mh(t?.writable),WK=t=>kA(t)&&typeof t[Symbol.asyncIterator]=="function",GK=t=>kA(t)&&typeof t[Symbol.iterator]=="function",kA=t=>typeof t=="object"&&t!==null,pr=new Set(["generator","asyncGenerator","duplex","webTransform"]),Lh=new Set(["fileUrl","filePath","fileNumber"]),R2=new Set(["fileUrl","filePath"]),OA=new Set([...R2,"webStream","nodeStream"]),PA=new Set(["webTransform","duplex"]),hi={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};var I2=(t,e,r,n)=>n==="output"?VK(t,e,r):zK(t,e,r),VK=(t,e,r)=>{let n=e!==0&&r[e-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:t??n}},zK=(t,e,r)=>{let n=e===0?t===!0:r[e-1].value.readableObjectMode,i=e!==r.length-1&&(t??n);return{writableObjectMode:n,readableObjectMode:i}},RA=(t,e)=>{let r=t.findLast(({type:n})=>pr.has(n));return r===void 0?!1:e==="input"?r.value.writableObjectMode:r.value.readableObjectMode};var IA=(t,e,r,n)=>[...t.filter(({type:i})=>!pr.has(i)),...KK(t,e,r,n)],KK=(t,e,r,{encoding:n})=>{let i=t.filter(({type:o})=>pr.has(o)),s=Array.from({length:i.length});for(let[o,a]of Object.entries(i))s[o]=YK({stdioItem:a,index:Number(o),newTransforms:s,optionName:e,direction:r,encoding:n});return QK(s,r)},YK=({stdioItem:t,stdioItem:{type:e},index:r,newTransforms:n,optionName:i,direction:s,encoding:o})=>e==="duplex"?ZK({stdioItem:t,optionName:i}):e==="webTransform"?JK({stdioItem:t,index:r,newTransforms:n,direction:s}):XK({stdioItem:t,index:r,newTransforms:n,direction:s,encoding:o}),ZK=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:r,readableObjectMode:n},objectMode:i=n}},optionName:s})=>{if(i&&!n)throw new TypeError(`The \`${s}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&n)throw new TypeError(`The \`${s}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...t,value:{transform:e,writableObjectMode:r,readableObjectMode:n}}},JK=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i})=>{let{transform:s,objectMode:o}=$e(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:u}=I2(o,r,n,i);return{...t,value:{transform:s,writableObjectMode:a,readableObjectMode:u}}},XK=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i,encoding:s})=>{let{transform:o,final:a,binary:u=!1,preserveNewlines:c=!1,objectMode:l}=$e(e)?e:{transform:e},f=u||Vt.has(s),{writableObjectMode:h,readableObjectMode:d}=I2(l,r,n,i);return{...t,value:{transform:o,final:a,binary:f,preserveNewlines:c,writableObjectMode:h,readableObjectMode:d}}},QK=(t,e)=>e==="input"?t.reverse():t;var Nh=P(require("node:process"),1);var MA=(t,e,r)=>{let n=t.map(i=>eY(i,e));if(n.includes("input")&&n.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return n.find(Boolean)??nY},eY=({type:t,value:e},r)=>tY[r]??LA[t](e),tY=["input","output","output"],Wo=()=>{},M2=()=>"input",LA={generator:Wo,asyncGenerator:Wo,fileUrl:Wo,filePath:Wo,iterable:M2,asyncIterable:M2,uint8Array:M2,webStream:t=>Mh(t)?"output":"input",nodeStream(t){return ms(t,{checkOpen:!1})?w2(t,{checkOpen:!1})?void 0:"input":"output"},webTransform:Wo,duplex:Wo,native(t){let e=rY(t);if(e!==void 0)return e;if(Nr(t,{checkOpen:!1}))return LA.nodeStream(t)}},rY=t=>{if([0,Nh.default.stdin].includes(t))return"input";if([1,2,Nh.default.stdout,Nh.default.stderr].includes(t))return"output"},nY="output";var NA=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t;var $A=({stdio:t,ipc:e,buffer:r,...n},i,s)=>{let o=iY(t,n).map((a,u)=>jA(a,u));return s?oY(o,r,i):NA(o,e)},iY=(t,e)=>{if(t===void 0)return dr.map(n=>e[n]);if(sY(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${dr.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return[t,t,t];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,dr.length);return Array.from({length:r},(n,i)=>t[i])},sY=t=>dr.some(e=>t[e]!==void 0),jA=(t,e)=>Array.isArray(t)?t.map(r=>jA(r,e)):t??(e>=dr.length?"ignore":"pipe"),oY=(t,e,r)=>t.map((n,i)=>!e[i]&&i!==0&&!Po(r,i)&&aY(n)?"ignore":n),aY=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe");var qA=require("node:fs"),HA=P(require("node:tty"),1);var WA=({stdioItem:t,stdioItem:{type:e},isStdioArray:r,fdNumber:n,direction:i,isSync:s})=>!r||e!=="native"?t:s?uY({stdioItem:t,fdNumber:n,direction:i}):fY({stdioItem:t,fdNumber:n}),uY=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n,direction:i})=>{let s=cY({value:e,optionName:r,fdNumber:n,direction:i});if(s!==void 0)return s;if(Nr(e,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},cY=({value:t,optionName:e,fdNumber:r,direction:n})=>{let i=lY(t,r);if(i!==void 0){if(n==="output")return{type:"fileNumber",value:i,optionName:e};if(HA.default.isatty(i))throw new TypeError(`The \`${e}: ${fh(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:Pn((0,qA.readFileSync)(i)),optionName:e}}},lY=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;let r=Yf.indexOf(t);if(r!==-1)return r},fY=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n})=>e==="inherit"?{type:"nodeStream",value:UA(n,e,r),optionName:r}:typeof e=="number"?{type:"nodeStream",value:UA(e,e,r),optionName:r}:Nr(e,{checkOpen:!1})?{type:"nodeStream",value:e,optionName:r}:t,UA=(t,e,r)=>{let n=Yf[t];if(n===void 0)throw new TypeError(`The \`${r}: ${e}\` option is invalid: no such standard stream.`);return n};var GA=({input:t,inputFile:e},r)=>r===0?[...hY(t),...pY(e)]:[],hY=t=>t===void 0?[]:[{type:dY(t),value:t,optionName:"input"}],dY=t=>{if(ms(t,{checkOpen:!1}))return"nodeStream";if(typeof t=="string")return"string";if(ze(t))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},pY=t=>t===void 0?[]:[{...mY(t),optionName:"inputFile"}],mY=t=>{if(Ih(t))return{type:"fileUrl",value:t};if(O2(t))return{type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")};var VA=t=>t.filter((e,r)=>t.every((n,i)=>e.value!==n.value||r>=i||e.type==="generator"||e.type==="asyncGenerator")),zA=({stdioItem:{type:t,value:e,optionName:r},direction:n,fileDescriptors:i,isSync:s})=>{let o=DY(i,t);if(o.length!==0){if(s){gY({otherStdioItems:o,type:t,value:e,optionName:r,direction:n});return}if(OA.has(t))return KA({otherStdioItems:o,type:t,value:e,optionName:r,direction:n});PA.has(t)&&yY({otherStdioItems:o,type:t,value:e,optionName:r})}},DY=(t,e)=>t.flatMap(({direction:r,stdioItems:n})=>n.filter(i=>i.type===e).map((i=>({...i,direction:r})))),gY=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{R2.has(e)&&KA({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})},KA=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{let s=t.filter(a=>xY(a,r));if(s.length===0)return;let o=s.find(a=>a.direction!==i);return YA(o,n,e),i==="output"?s[0].stream:void 0},xY=({type:t,value:e},r)=>t==="filePath"?e.file===r.file:t==="fileUrl"?e.href===r.href:e===r,yY=({otherStdioItems:t,type:e,value:r,optionName:n})=>{let i=t.find(({value:{transform:s}})=>s===r.transform);YA(i,n,e)},YA=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${hi[r]} that is the same.`)};var $h=(t,e,r,n)=>{let s=$A(e,r,n).map((a,u)=>bY({stdioOption:a,fdNumber:u,options:e,isSync:n})),o=AY({initialFileDescriptors:s,addProperties:t,options:e,isSync:n});return e.stdio=o.map(({stdioItems:a})=>kY(a)),o},bY=({stdioOption:t,fdNumber:e,options:r,isSync:n})=>{let i=Zf(e),{stdioItems:s,isStdioArray:o}=FY({stdioOption:t,fdNumber:e,options:r,optionName:i}),a=MA(s,e,i),u=s.map(f=>WA({stdioItem:f,isStdioArray:o,fdNumber:e,direction:a,isSync:n})),c=IA(u,i,a,r),l=RA(c,a);return _Y(c,l),{direction:a,objectMode:l,stdioItems:c}},FY=({stdioOption:t,fdNumber:e,options:r,optionName:n})=>{let s=[...(Array.isArray(t)?t:[t]).map(u=>EY(u,n)),...GA(r,e)],o=VA(s),a=o.length>1;return CY(o,a,n),SY(o),{stdioItems:o,isStdioArray:a}},EY=(t,e)=>({type:wA(t,e),value:t,optionName:e}),CY=(t,e,r)=>{if(t.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(e){for(let{value:n,optionName:i}of t)if(wY.has(n))throw new Error(`The \`${i}\` option must not include \`${n}\`.`)}},wY=new Set(["ignore","ipc"]),SY=t=>{for(let e of t)vY(e)},vY=({type:t,value:e,optionName:r})=>{if(AA(e))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme.
|
|
177
|
+
`):mA(t),mA=t=>typeof t=="string"?t:ze(t)?zf(t):"";var Rh=({command:t,escapedCommand:e,stdio:r,all:n,ipcOutput:i,options:{cwd:s},startTime:o})=>xA({command:t,escapedCommand:e,cwd:s,durationMs:Qx(o),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:n,stdio:r,ipcOutput:i,pipedFrom:[]}),qo=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:s,isSync:o})=>ac({error:t,command:e,escapedCommand:r,startTime:s,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:i,isSync:o}),ac=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:c,signal:l,stdio:f,all:h,ipcOutput:d,options:{timeoutDuration:p,timeout:m=p,forceKillAfterDelay:x,killSignal:D,cwd:y,maxBuffer:b},isSync:C})=>{let{exitCode:_,signal:T,signalDescription:B}=AK(c,l),{originalMessage:O,shortMessage:v,message:A}=gA({stdio:f,all:h,ipcOutput:d,originalError:t,signal:T,signalDescription:B,exitCode:_,escapedCommand:r,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:u,forceKillAfterDelay:x,killSignal:D,maxBuffer:b,timeout:m,cwd:y}),F=v_(t,A,C);return Object.assign(F,_K({error:F,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:_,signal:T,signalDescription:B,stdio:f,all:h,ipcOutput:d,cwd:y,originalMessage:O,shortMessage:v})),F},_K=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:c,signal:l,signalDescription:f,stdio:h,all:d,ipcOutput:p,cwd:m,originalMessage:x,shortMessage:D})=>xA({shortMessage:D,originalMessage:x,command:e,escapedCommand:r,cwd:m,durationMs:Qx(n),failed:!0,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isTerminated:l!==void 0,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:c,signal:l,signalDescription:f,code:t.cause?.code,stdout:h[1],stderr:h[2],all:d,stdio:h,ipcOutput:p,pipedFrom:[]}),xA=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),AK=(t,e)=>{let r=t===null?void 0:t,n=e===null?void 0:e,i=n===void 0?void 0:uh(e);return{exitCode:r,signal:n,signalDescription:i}};var yA=t=>Number.isFinite(t)?t:0;function BK(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(yA(t*1e3)%1e3),nanoseconds:Math.trunc(yA(t*1e6)%1e3)}}function TK(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function B2(t){switch(typeof t){case"number":{if(Number.isFinite(t))return BK(t);break}case"bigint":return TK(t)}throw new TypeError("Expected a finite number or bigint")}var kK=t=>t===0||t===0n,OK=(t,e)=>e===1||e===1n?t:`${t}s`,PK=1e-7,RK=24n*60n*60n*1000n;function T2(t,e){let r=typeof t=="bigint";if(!r&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};let n=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let i=[],s=(l,f)=>{let h=Math.floor(l*10**f+PK);return(Math.round(h)/10**f).toFixed(f)},o=(l,f,h,d)=>{if(!((i.length===0||!e.colonNotation)&&kK(l)&&!(e.colonNotation&&h==="m"))){if(d??=String(l),e.colonNotation){let p=d.includes(".")?d.split(".")[0].length:d.length,m=i.length>0?2:1;d="0".repeat(Math.max(0,m-p))+d}else d+=e.verbose?" "+OK(f,l):h;i.push(d)}},a=B2(t),u=BigInt(a.days);if(e.hideYearAndDays?o(BigInt(u)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?o(u,"day","d"):(o(u/365n,"year","y"),o(u%365n,"day","d")),o(Number(a.hours),"hour","h")),o(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3&&!e.subSecondsAsDecimals){let l=Number(a.seconds),f=Number(a.milliseconds),h=Number(a.microseconds),d=Number(a.nanoseconds);if(o(l,"second","s"),e.formatSubMilliseconds)o(f,"millisecond","ms"),o(h,"microsecond","\xB5s"),o(d,"nanosecond","ns");else{let p=f+h/1e3+d/1e6,m=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,x=p>=1?Math.round(p):Math.ceil(p),D=m?p.toFixed(m):x;o(Number.parseFloat(D),"millisecond","ms",D)}}else{let l=(r?Number(t%RK):t)/1e3%60,f=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,h=s(l,f),d=e.keepDecimalsOnWholeSeconds?h:h.replace(/\.0+$/,"");o(Number.parseFloat(d),"second","s",d)}if(i.length===0)return n+"0"+(e.verbose?" milliseconds":"ms");let c=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(i=i.slice(0,Math.max(e.unitCount,1))),n+i.join(c)}var bA=(t,e)=>{t.failed&&tn({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t})};var FA=(t,e)=>{Oo(e)&&(bA(t,e),IK(t,e))},IK=(t,e)=>{let r=`(done in ${T2(t.durationMs)})`;tn({type:"duration",verboseMessage:r,verboseInfo:e,result:t})};var Ho=(t,e,{reject:r})=>{if(FA(t,e),t.failed&&r)throw t;return t};var N2=require("node:fs");var wA=(t,e)=>Ds(t)?"asyncGenerator":_A(t)?"generator":Ih(t)?"fileUrl":jK(t)?"filePath":HK(t)?"webStream":Nr(t,{checkOpen:!1})?"native":ze(t)?"uint8Array":WK(t)?"asyncIterable":GK(t)?"iterable":P2(t)?SA({transform:t},e):$K(t)?MK(t,e):"native",MK=(t,e)=>S2(t.transform,{checkOpen:!1})?LK(t,e):P2(t.transform)?SA(t,e):NK(t,e),LK=(t,e)=>(vA(t,e,"Duplex stream"),"duplex"),SA=(t,e)=>(vA(t,e,"web TransformStream"),"webTransform"),vA=({final:t,binary:e,objectMode:r},n,i)=>{EA(t,`${n}.final`,i),EA(e,`${n}.binary`,i),k2(r,`${n}.objectMode`)},EA=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${r}.`)},NK=({transform:t,final:e,binary:r,objectMode:n},i)=>{if(t!==void 0&&!CA(t))throw new TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(S2(e,{checkOpen:!1}))throw new TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(P2(e))throw new TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!CA(e))throw new TypeError(`The \`${i}.final\` option must be a generator.`);return k2(r,`${i}.binary`),k2(n,`${i}.objectMode`),Ds(t)||Ds(e)?"asyncGenerator":"generator"},k2=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},CA=t=>Ds(t)||_A(t),Ds=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",_A=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",$K=t=>je(t)&&(t.transform!==void 0||t.final!==void 0),Ih=t=>Object.prototype.toString.call(t)==="[object URL]",AA=t=>Ih(t)&&t.protocol!=="file:",jK=t=>je(t)&&Object.keys(t).length>0&&Object.keys(t).every(e=>UK.has(e))&&O2(t.file),UK=new Set(["file","append"]),O2=t=>typeof t=="string",BA=(t,e)=>t==="native"&&typeof e=="string"&&!qK.has(e),qK=new Set(["ipc","ignore","inherit","overlapped","pipe"]),TA=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",Mh=t=>Object.prototype.toString.call(t)==="[object WritableStream]",HK=t=>TA(t)||Mh(t),P2=t=>TA(t?.readable)&&Mh(t?.writable),WK=t=>kA(t)&&typeof t[Symbol.asyncIterator]=="function",GK=t=>kA(t)&&typeof t[Symbol.iterator]=="function",kA=t=>typeof t=="object"&&t!==null,pr=new Set(["generator","asyncGenerator","duplex","webTransform"]),Lh=new Set(["fileUrl","filePath","fileNumber"]),R2=new Set(["fileUrl","filePath"]),OA=new Set([...R2,"webStream","nodeStream"]),PA=new Set(["webTransform","duplex"]),hi={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};var I2=(t,e,r,n)=>n==="output"?VK(t,e,r):zK(t,e,r),VK=(t,e,r)=>{let n=e!==0&&r[e-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:t??n}},zK=(t,e,r)=>{let n=e===0?t===!0:r[e-1].value.readableObjectMode,i=e!==r.length-1&&(t??n);return{writableObjectMode:n,readableObjectMode:i}},RA=(t,e)=>{let r=t.findLast(({type:n})=>pr.has(n));return r===void 0?!1:e==="input"?r.value.writableObjectMode:r.value.readableObjectMode};var IA=(t,e,r,n)=>[...t.filter(({type:i})=>!pr.has(i)),...KK(t,e,r,n)],KK=(t,e,r,{encoding:n})=>{let i=t.filter(({type:o})=>pr.has(o)),s=Array.from({length:i.length});for(let[o,a]of Object.entries(i))s[o]=YK({stdioItem:a,index:Number(o),newTransforms:s,optionName:e,direction:r,encoding:n});return QK(s,r)},YK=({stdioItem:t,stdioItem:{type:e},index:r,newTransforms:n,optionName:i,direction:s,encoding:o})=>e==="duplex"?ZK({stdioItem:t,optionName:i}):e==="webTransform"?JK({stdioItem:t,index:r,newTransforms:n,direction:s}):XK({stdioItem:t,index:r,newTransforms:n,direction:s,encoding:o}),ZK=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:r,readableObjectMode:n},objectMode:i=n}},optionName:s})=>{if(i&&!n)throw new TypeError(`The \`${s}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&n)throw new TypeError(`The \`${s}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...t,value:{transform:e,writableObjectMode:r,readableObjectMode:n}}},JK=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i})=>{let{transform:s,objectMode:o}=je(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:u}=I2(o,r,n,i);return{...t,value:{transform:s,writableObjectMode:a,readableObjectMode:u}}},XK=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:i,encoding:s})=>{let{transform:o,final:a,binary:u=!1,preserveNewlines:c=!1,objectMode:l}=je(e)?e:{transform:e},f=u||Vt.has(s),{writableObjectMode:h,readableObjectMode:d}=I2(l,r,n,i);return{...t,value:{transform:o,final:a,binary:f,preserveNewlines:c,writableObjectMode:h,readableObjectMode:d}}},QK=(t,e)=>e==="input"?t.reverse():t;var Nh=P(require("node:process"),1);var MA=(t,e,r)=>{let n=t.map(i=>eY(i,e));if(n.includes("input")&&n.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return n.find(Boolean)??nY},eY=({type:t,value:e},r)=>tY[r]??LA[t](e),tY=["input","output","output"],Wo=()=>{},M2=()=>"input",LA={generator:Wo,asyncGenerator:Wo,fileUrl:Wo,filePath:Wo,iterable:M2,asyncIterable:M2,uint8Array:M2,webStream:t=>Mh(t)?"output":"input",nodeStream(t){return ms(t,{checkOpen:!1})?w2(t,{checkOpen:!1})?void 0:"input":"output"},webTransform:Wo,duplex:Wo,native(t){let e=rY(t);if(e!==void 0)return e;if(Nr(t,{checkOpen:!1}))return LA.nodeStream(t)}},rY=t=>{if([0,Nh.default.stdin].includes(t))return"input";if([1,2,Nh.default.stdout,Nh.default.stderr].includes(t))return"output"},nY="output";var NA=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t;var $A=({stdio:t,ipc:e,buffer:r,...n},i,s)=>{let o=iY(t,n).map((a,u)=>jA(a,u));return s?oY(o,r,i):NA(o,e)},iY=(t,e)=>{if(t===void 0)return dr.map(n=>e[n]);if(sY(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${dr.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return[t,t,t];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,dr.length);return Array.from({length:r},(n,i)=>t[i])},sY=t=>dr.some(e=>t[e]!==void 0),jA=(t,e)=>Array.isArray(t)?t.map(r=>jA(r,e)):t??(e>=dr.length?"ignore":"pipe"),oY=(t,e,r)=>t.map((n,i)=>!e[i]&&i!==0&&!Po(r,i)&&aY(n)?"ignore":n),aY=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe");var qA=require("node:fs"),HA=P(require("node:tty"),1);var WA=({stdioItem:t,stdioItem:{type:e},isStdioArray:r,fdNumber:n,direction:i,isSync:s})=>!r||e!=="native"?t:s?uY({stdioItem:t,fdNumber:n,direction:i}):fY({stdioItem:t,fdNumber:n}),uY=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n,direction:i})=>{let s=cY({value:e,optionName:r,fdNumber:n,direction:i});if(s!==void 0)return s;if(Nr(e,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},cY=({value:t,optionName:e,fdNumber:r,direction:n})=>{let i=lY(t,r);if(i!==void 0){if(n==="output")return{type:"fileNumber",value:i,optionName:e};if(HA.default.isatty(i))throw new TypeError(`The \`${e}: ${fh(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:Pn((0,qA.readFileSync)(i)),optionName:e}}},lY=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;let r=Yf.indexOf(t);if(r!==-1)return r},fY=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n})=>e==="inherit"?{type:"nodeStream",value:UA(n,e,r),optionName:r}:typeof e=="number"?{type:"nodeStream",value:UA(e,e,r),optionName:r}:Nr(e,{checkOpen:!1})?{type:"nodeStream",value:e,optionName:r}:t,UA=(t,e,r)=>{let n=Yf[t];if(n===void 0)throw new TypeError(`The \`${r}: ${e}\` option is invalid: no such standard stream.`);return n};var GA=({input:t,inputFile:e},r)=>r===0?[...hY(t),...pY(e)]:[],hY=t=>t===void 0?[]:[{type:dY(t),value:t,optionName:"input"}],dY=t=>{if(ms(t,{checkOpen:!1}))return"nodeStream";if(typeof t=="string")return"string";if(ze(t))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},pY=t=>t===void 0?[]:[{...mY(t),optionName:"inputFile"}],mY=t=>{if(Ih(t))return{type:"fileUrl",value:t};if(O2(t))return{type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")};var VA=t=>t.filter((e,r)=>t.every((n,i)=>e.value!==n.value||r>=i||e.type==="generator"||e.type==="asyncGenerator")),zA=({stdioItem:{type:t,value:e,optionName:r},direction:n,fileDescriptors:i,isSync:s})=>{let o=DY(i,t);if(o.length!==0){if(s){gY({otherStdioItems:o,type:t,value:e,optionName:r,direction:n});return}if(OA.has(t))return KA({otherStdioItems:o,type:t,value:e,optionName:r,direction:n});PA.has(t)&&yY({otherStdioItems:o,type:t,value:e,optionName:r})}},DY=(t,e)=>t.flatMap(({direction:r,stdioItems:n})=>n.filter(i=>i.type===e).map((i=>({...i,direction:r})))),gY=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{R2.has(e)&&KA({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})},KA=({otherStdioItems:t,type:e,value:r,optionName:n,direction:i})=>{let s=t.filter(a=>xY(a,r));if(s.length===0)return;let o=s.find(a=>a.direction!==i);return YA(o,n,e),i==="output"?s[0].stream:void 0},xY=({type:t,value:e},r)=>t==="filePath"?e.file===r.file:t==="fileUrl"?e.href===r.href:e===r,yY=({otherStdioItems:t,type:e,value:r,optionName:n})=>{let i=t.find(({value:{transform:s}})=>s===r.transform);YA(i,n,e)},YA=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${hi[r]} that is the same.`)};var $h=(t,e,r,n)=>{let s=$A(e,r,n).map((a,u)=>bY({stdioOption:a,fdNumber:u,options:e,isSync:n})),o=AY({initialFileDescriptors:s,addProperties:t,options:e,isSync:n});return e.stdio=o.map(({stdioItems:a})=>kY(a)),o},bY=({stdioOption:t,fdNumber:e,options:r,isSync:n})=>{let i=Zf(e),{stdioItems:s,isStdioArray:o}=FY({stdioOption:t,fdNumber:e,options:r,optionName:i}),a=MA(s,e,i),u=s.map(f=>WA({stdioItem:f,isStdioArray:o,fdNumber:e,direction:a,isSync:n})),c=IA(u,i,a,r),l=RA(c,a);return _Y(c,l),{direction:a,objectMode:l,stdioItems:c}},FY=({stdioOption:t,fdNumber:e,options:r,optionName:n})=>{let s=[...(Array.isArray(t)?t:[t]).map(u=>EY(u,n)),...GA(r,e)],o=VA(s),a=o.length>1;return CY(o,a,n),SY(o),{stdioItems:o,isStdioArray:a}},EY=(t,e)=>({type:wA(t,e),value:t,optionName:e}),CY=(t,e,r)=>{if(t.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(e){for(let{value:n,optionName:i}of t)if(wY.has(n))throw new Error(`The \`${i}\` option must not include \`${n}\`.`)}},wY=new Set(["ignore","ipc"]),SY=t=>{for(let e of t)vY(e)},vY=({type:t,value:e,optionName:r})=>{if(AA(e))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme.
|
|
178
178
|
For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(BA(t,e))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},_Y=(t,e)=>{if(!e)return;let r=t.find(({type:n})=>Lh.has(n));if(r!==void 0)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},AY=({initialFileDescriptors:t,addProperties:e,options:r,isSync:n})=>{let i=[];try{for(let s of t)i.push(BY({fileDescriptor:s,fileDescriptors:i,addProperties:e,options:r,isSync:n}));return i}catch(s){throw L2(i),s}},BY=({fileDescriptor:{direction:t,objectMode:e,stdioItems:r},fileDescriptors:n,addProperties:i,options:s,isSync:o})=>{let a=r.map(u=>TY({stdioItem:u,addProperties:i,direction:t,options:s,fileDescriptors:n,isSync:o}));return{direction:t,objectMode:e,stdioItems:a}},TY=({stdioItem:t,addProperties:e,direction:r,options:n,fileDescriptors:i,isSync:s})=>{let o=zA({stdioItem:t,direction:r,fileDescriptors:i,isSync:s});return o!==void 0?{...t,stream:o}:{...t,...e[r][t.type](t,n)}},L2=t=>{for(let{stdioItems:e}of t)for(let{stream:r}of e)r!==void 0&&!Ir(r)&&r.destroy()},kY=t=>{if(t.length>1)return t.some(({value:n})=>n==="overlapped")?"overlapped":"pipe";let[{type:e,value:r}]=t;return e==="native"?r:"pipe"};var JA=(t,e)=>$h(PY,t,e,!0),on=({type:t,optionName:e})=>{XA(e,hi[t])},OY=({optionName:t,value:e})=>((e==="ipc"||e==="overlapped")&&XA(t,`"${e}"`),{}),XA=(t,e)=>{throw new TypeError(`The \`${t}\` option cannot be ${e} with synchronous methods.`)},ZA={generator(){},asyncGenerator:on,webStream:on,nodeStream:on,webTransform:on,duplex:on,asyncIterable:on,native:OY},PY={input:{...ZA,fileUrl:({value:t})=>({contents:[Pn((0,N2.readFileSync)(t))]}),filePath:({value:{file:t}})=>({contents:[Pn((0,N2.readFileSync)(t))]}),fileNumber:on,iterable:({value:t})=>({contents:[...t]}),string:({value:t})=>({contents:[t]}),uint8Array:({value:t})=>({contents:[t]})},output:{...ZA,fileUrl:({value:t})=>({path:t}),filePath:({value:{file:t,append:e}})=>({path:t,append:e}),fileNumber:({value:t})=>({path:t}),iterable:on,string:on,uint8Array:on}};var Ln=(t,{stripFinalNewline:e},r)=>$2(e,r)&&t!==void 0&&!Array.isArray(t)?jo(t):t,$2=(t,e)=>e==="all"?t[1]||t[2]:t[e];var cc=require("node:stream");var jh=(t,e,r,n)=>t||r?void 0:e5(e,n),U2=(t,e,r)=>r?t.flatMap(n=>QA(n,e)):QA(t,e),QA=(t,e)=>{let{transform:r,final:n}=e5(e,{});return[...r(t),...n()]},e5=(t,e)=>(e.previousChunks="",{transform:RY.bind(void 0,e,t),final:MY.bind(void 0,e)}),RY=function*(t,e,r){if(typeof r!="string"){yield r;return}let{previousChunks:n}=t,i=-1;for(let s=0;s<r.length;s+=1)if(r[s]===`
|
|
179
179
|
`){let o=IY(r,s,e,t),a=r.slice(i+1,s+1-o);n.length>0&&(a=j2(n,a),n=""),yield a,i=s}i!==r.length-1&&(n=j2(n,r.slice(i+1))),t.previousChunks=n},IY=(t,e,r,n)=>r?0:(n.isWindowsNewline=e!==0&&t[e-1]==="\r",n.isWindowsNewline?2:1),MY=function*({previousChunks:t}){t.length>0&&(yield t)},t5=({binary:t,preserveNewlines:e,readableObjectMode:r,state:n})=>t||e||r?void 0:{transform:LY.bind(void 0,n)},LY=function*({isWindowsNewline:t=!1},e){let{unixNewline:r,windowsNewline:n,LF:i,concatBytes:s}=typeof e=="string"?NY:jY;if(e.at(-1)===i){yield e;return}yield s(e,t?n:r)},j2=(t,e)=>`${t}${e}`,NY={windowsNewline:`\r
|
|
180
180
|
`,unixNewline:`
|
|
181
181
|
`,LF:`
|
|
182
182
|
`,concatBytes:j2},$Y=(t,e)=>{let r=new Uint8Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r},jY={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:$Y};var r5=require("node:buffer");var n5=(t,e)=>t?void 0:UY.bind(void 0,e),UY=function*(t,e){if(typeof e!="string"&&!ze(e)&&!r5.Buffer.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e},i5=(t,e)=>t?qY.bind(void 0,e):HY.bind(void 0,e),qY=function*(t,e){s5(t,e),yield e},HY=function*(t,e){if(s5(t,e),typeof e!="string"&&!ze(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e},s5=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`.
|
|
183
183
|
Instead, \`yield\` should either be called with a value, or not be called at all. For example:
|
|
184
|
-
if (condition) { yield value; }`)};var o5=require("node:buffer"),a5=require("node:string_decoder");var Uh=(t,e,r)=>{if(r)return;if(t)return{transform:WY.bind(void 0,new TextEncoder)};let n=new a5.StringDecoder(e);return{transform:GY.bind(void 0,n),final:VY.bind(void 0,n)}},WY=function*(t,e){o5.Buffer.isBuffer(e)?yield Pn(e):typeof e=="string"?yield t.encode(e):yield e},GY=function*(t,e){yield ze(e)?t.write(e):e},VY=function*(t){let e=t.end();e!==""&&(yield e)};var q2=require("node:util"),H2=(0,q2.callbackify)(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let i of e.currentIterable)n.push(i)}finally{delete e.currentIterable}}),qh=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=KY}=e[r];for await(let i of n(t))yield*qh(i,e,r+1)},u5=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*zY(r,Number(e),t)},zY=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*qh(n,r,e+1)},c5=(0,q2.callbackify)(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),KY=function*(t){yield t};var W2=(t,e,r,n)=>{try{for(let i of t(...e))r.push(i);n()}catch(i){n(i)}},l5=(t,e)=>[...e.flatMap(r=>[...gs(r,t,0)]),...uc(t)],gs=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=ZY}=e[r];for(let i of n(t))yield*gs(i,e,r+1)},uc=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*YY(r,Number(e),t)},YY=function*(t,e,r){if(t!==void 0)for(let n of t())yield*gs(n,r,e+1)},ZY=function*(t){yield t};var G2=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:i},optionName:s},{encoding:o})=>{let a={},u=f5(t,o,s),c=Ds(e),l=Ds(r),f=c?H2.bind(void 0,qh,a):W2.bind(void 0,gs),h=c||l?H2.bind(void 0,u5,a):W2.bind(void 0,uc),d=c||l?c5.bind(void 0,a):void 0;return{stream:new cc.Transform({writableObjectMode:n,writableHighWaterMark:(0,cc.getDefaultHighWaterMark)(n),readableObjectMode:i,readableHighWaterMark:(0,cc.getDefaultHighWaterMark)(i),transform(m,x,D){f([m,u,0],this,D)},flush(m){h([u],this,m)},destroy:d})}},Hh=(t,e,r,n)=>{let i=e.filter(({type:o})=>o==="generator"),s=n?i.reverse():i;for(let{value:o,optionName:a}of s){let u=f5(o,r,a);t=l5(u,t)}return t},f5=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:i,preserveNewlines:s},o,a)=>{let u={};return[{transform:n5(n,a)},Uh(r,o,n),jh(r,s,n,u),{transform:t,final:e},{transform:i5(i,a)},t5({binary:r,preserveNewlines:s,readableObjectMode:i,state:u})].filter(Boolean)};var h5=(t,e)=>{for(let r of JY(t))XY(t,r,e)},JY=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),XY=(t,e,r)=>{let{stdioItems:n}=t[e],i=n.filter(({contents:a})=>a!==void 0);if(i.length===0)return;if(e!==0){let[{type:a,optionName:u}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${u}\`, can be ${hi[a]} with synchronous methods.`)}let o=i.map(({contents:a})=>a).map(a=>QY(a,n));r.input=Xu(o)},QY=(t,e)=>{let r=Hh(t,e,"utf8",!0);return eZ(r),Xu(r)},eZ=t=>{let e=t.find(r=>typeof r!="string"&&!ze(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)};var Gh=require("node:fs");var Wh=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&Po(r,n)&&!Vt.has(e)&&tZ(n)&&(t.some(({type:i,value:s})=>i==="native"&&rZ.has(s))||t.every(({type:i})=>pr.has(i))),tZ=t=>t===1||t===2,rZ=new Set(["pipe","overlapped"]),d5=async(t,e,r,n)=>{for await(let i of t)nZ(e)||m5(i,r,n)},p5=(t,e,r)=>{for(let n of t)m5(n,e,r)},nZ=t=>t._readableState.pipes.length>0,m5=(t,e,r)=>{let n=rh(t);tn({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})};var D5=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:i})=>{if(e===null)return{output:Array.from({length:3})};let s={},o=new Set([]);return{output:e.map((u,c)=>iZ({result:u,fileDescriptors:t,fdNumber:c,state:s,outputFiles:o,isMaxBuffer:n,verboseInfo:i},r)),...s}},iZ=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:i,isMaxBuffer:s,verboseInfo:o},{buffer:a,encoding:u,lines:c,stripFinalNewline:l,maxBuffer:f})=>{if(t===null)return;let h=pA(t,s,f),d=Pn(h),{stdioItems:p,objectMode:m}=e[r],x=sZ([d],p,u,n),{serializedResult:D,finalResult:y=D}=oZ({chunks:x,objectMode:m,encoding:u,lines:c,stripFinalNewline:l,fdNumber:r});aZ({serializedResult:D,fdNumber:r,state:n,verboseInfo:o,encoding:u,stdioItems:p,objectMode:m});let b=a[r]?y:void 0;try{return n.error===void 0&&uZ(D,p,i),b}catch(C){return n.error=C,b}},sZ=(t,e,r,n)=>{try{return Hh(t,e,r,!1)}catch(i){return n.error=i,t}},oZ=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:i,fdNumber:s})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:Xu(t)};let o=ov(t,r);return n[s]?{serializedResult:o,finalResult:U2(o,!i[s],e)}:{serializedResult:o}},aZ=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:i,stdioItems:s,objectMode:o})=>{if(!Wh({stdioItems:s,encoding:i,verboseInfo:n,fdNumber:e}))return;let a=U2(t,!1,o);try{p5(a,e,n)}catch(u){r.error??=u}},uZ=(t,e,r)=>{for(let{path:n,append:i}of e.filter(({type:s})=>Lh.has(s))){let s=typeof n=="string"?n:n.toString();i||r.has(s)?(0,Gh.appendFileSync)(n,t):(r.add(s),(0,Gh.writeFileSync)(n,t))}};var g5=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,Ln(e,r,"all")]:Array.isArray(e)?[Ln(t,r,"all"),...e]:ze(t)&&ze(e)?zx([t,e]):`${t}${e}`};var Vh=require("node:events");var x5=async(t,e)=>{let[r,n]=await cZ(t);return e.isForcefullyTerminated??=!1,[r,n]},cZ=async t=>{let[e,r]=await Promise.allSettled([(0,Vh.once)(t,"spawn"),(0,Vh.once)(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?y5(t):r.value},y5=async t=>{try{return await(0,Vh.once)(t,"exit")}catch{return y5(t)}},b5=async t=>{let[e,r]=await t;if(!lZ(e,r)&&V2(e,r))throw new Mr;return[e,r]},lZ=(t,e)=>t===void 0&&e===void 0,V2=(t,e)=>t!==0||e!==null;var F5=({error:t,status:e,signal:r,output:n},{maxBuffer:i})=>{let s=fZ(t,e,r),o=s?.code==="ETIMEDOUT",a=dA(s,n,i);return{resultError:s,exitCode:e,signal:r,timedOut:o,isMaxBuffer:a}},fZ=(t,e,r)=>t!==void 0?t:V2(e,r)?new Mr:void 0;var C5=(t,e,r)=>{let{file:n,commandArguments:i,command:s,escapedCommand:o,startTime:a,verboseInfo:u,options:c,fileDescriptors:l}=hZ(t,e,r),f=mZ({file:n,commandArguments:i,options:c,command:s,escapedCommand:o,verboseInfo:u,fileDescriptors:l,startTime:a});return Ho(f,u,c)},hZ=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:s,verboseInfo:o}=ih(t,e,r),a=dZ(r),{file:u,commandArguments:c,options:l}=wh(t,e,a);pZ(l);let f=JA(l,o);return{file:u,commandArguments:c,command:n,escapedCommand:i,startTime:s,verboseInfo:o,options:l,fileDescriptors:f}},dZ=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,pZ=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&zh("ipcInput"),t&&zh("ipc: true"),r&&zh("detached: true"),n&&zh("cancelSignal")},zh=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},mZ=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,verboseInfo:s,fileDescriptors:o,startTime:a})=>{let u=DZ({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:o,startTime:a});if(u.failed)return u;let{resultError:c,exitCode:l,signal:f,timedOut:h,isMaxBuffer:d}=F5(u,r),{output:p,error:m=c}=D5({fileDescriptors:o,syncResult:u,options:r,isMaxBuffer:d,verboseInfo:s}),x=p.map((y,b)=>Ln(y,r,b)),D=Ln(g5(p,r),r,"all");return xZ({error:m,exitCode:l,signal:f,timedOut:h,isMaxBuffer:d,stdio:x,all:D,options:r,command:n,escapedCommand:i,startTime:a})},DZ=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:s,startTime:o})=>{try{h5(s,r);let a=gZ(r);return(0,E5.spawnSync)(...Sh(t,e,a))}catch(a){return qo({error:a,command:n,escapedCommand:i,fileDescriptors:s,options:r,startTime:o,isSync:!0})}},gZ=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:Ph(e)}),xZ=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:i,stdio:s,all:o,options:a,command:u,escapedCommand:c,startTime:l})=>t===void 0?Rh({command:u,escapedCommand:c,stdio:s,all:o,ipcOutput:[],options:a,startTime:l}):ac({error:t,command:u,escapedCommand:c,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:e,signal:r,stdio:s,all:o,ipcOutput:[],options:a,startTime:l,isSync:!0});var T7=require("node:events"),k7=require("node:child_process");var K2=P(require("node:process"),1);var Go=require("node:events");var w5=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0,filter:s}={})=>(Lo({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:gh(t)}),yZ({anyProcess:t,channel:e,isSubprocess:r,filter:s,reference:i})),yZ=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:i})=>{dh(e,i);let s=fi(t,e,r),o=new AbortController;try{return await Promise.race([bZ(s,n,o),FZ(s,r,o),EZ(s,r,o)])}catch(a){throw No(t),a}finally{o.abort(),ph(e,i)}},bZ=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await(0,Go.once)(t,"message",{signal:r});return n}for await(let[n]of(0,Go.on)(t,"message",{signal:r}))if(e(n))return n},FZ=async(t,e,{signal:r})=>{await(0,Go.once)(t,"disconnect",{signal:r}),z_(e)},EZ=async(t,e,{signal:r})=>{let[n]=await(0,Go.once)(t,"strict:error",{signal:r});throw lh(n,e)};var lc=require("node:events");var v5=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0}={})=>z2({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:i}),z2=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:i,reference:s})=>{Lo({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:gh(t)}),dh(e,s);let o=fi(t,e,r),a=new AbortController,u={};return CZ(t,o,a),wZ({ipcEmitter:o,isSubprocess:r,controller:a,state:u}),SZ({anyProcess:t,channel:e,ipcEmitter:o,isSubprocess:r,shouldAwait:i,controller:a,state:u,reference:s})},CZ=async(t,e,r)=>{try{await(0,lc.once)(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},wZ=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[i]=await(0,lc.once)(t,"strict:error",{signal:r.signal});n.error=lh(i,e),r.abort()}catch{}},SZ=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:i,controller:s,state:o,reference:a}){try{for await(let[u]of(0,lc.on)(r,"message",{signal:s.signal}))S5(o),yield u}catch{S5(o)}finally{s.abort(),ph(e,a),n||No(t),i&&await t}},S5=({error:t})=>{if(t)throw t};var _5=(t,{ipc:e})=>{Object.assign(t,B5(t,!1,e))},A5=()=>{let t=K2.default,e=!0,r=K2.default.channel!==void 0;return{...B5(t,e,r),getCancelSignal:_4.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},B5=(t,e,r)=>({sendMessage:Fh.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:w5.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:v5.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})});var T5=require("node:child_process"),di=require("node:stream");var k5=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:s,verboseInfo:o})=>{L2(n);let a=new T5.ChildProcess;vZ(a,n),Object.assign(a,{readable:_Z,writable:AZ,duplex:BZ});let u=qo({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:s,isSync:!1}),c=TZ(u,o,i);return{subprocess:a,promise:c}},vZ=(t,e)=>{let r=fc(),n=fc(),i=fc(),s=Array.from({length:e.length-3},fc),o=fc(),a=[r,n,i,...s];Object.assign(t,{stdin:r,stdout:n,stderr:i,all:o,stdio:a})},fc=()=>{let t=new di.PassThrough;return t.end(),t},_Z=()=>new di.Readable({read(){}}),AZ=()=>new di.Writable({write(){}}),BZ=()=>new di.Duplex({read(){},write(){}}),TZ=async(t,e,r)=>Ho(t,e,r);var Vo=require("node:fs"),P5=require("node:buffer"),an=require("node:stream");var R5=(t,e)=>$h(kZ,t,e,!1),hc=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${hi[t]}.`)},O5={fileNumber:hc,generator:G2,asyncGenerator:G2,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:an.Duplex.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},kZ={input:{...O5,fileUrl:({value:t})=>({stream:(0,Vo.createReadStream)(t)}),filePath:({value:{file:t}})=>({stream:(0,Vo.createReadStream)(t)}),webStream:({value:t})=>({stream:an.Readable.fromWeb(t)}),iterable:({value:t})=>({stream:an.Readable.from(t)}),asyncIterable:({value:t})=>({stream:an.Readable.from(t)}),string:({value:t})=>({stream:an.Readable.from(t)}),uint8Array:({value:t})=>({stream:an.Readable.from(P5.Buffer.from(t))})},output:{...O5,fileUrl:({value:t})=>({stream:(0,Vo.createWriteStream)(t)}),filePath:({value:{file:t,append:e}})=>({stream:(0,Vo.createWriteStream)(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:an.Writable.fromWeb(t)}),iterable:hc,asyncIterable:hc,string:hc,uint8Array:hc}};var dc=require("node:events"),Yh=require("node:stream"),J2=require("node:stream/promises");function xs(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let i of t)Z2(i);let e=t.some(({readableObjectMode:i})=>i),r=OZ(t,e),n=new Y2({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let i of t)n.add(i);return n}var OZ=(t,e)=>{if(t.length===0)return(0,Yh.getDefaultHighWaterMark)(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},Y2=class extends Yh.PassThrough{#e=new Set([]);#r=new Set([]);#t=new Set([]);#n;#o=Symbol("unpipe");#a=new WeakMap;add(e){if(Z2(e),this.#e.has(e))return;this.#e.add(e),this.#n??=PZ(this,this.#e,this.#o);let r=MZ({passThroughStream:this,stream:e,streams:this.#e,ended:this.#r,aborted:this.#t,onFinished:this.#n,unpipeEvent:this.#o});this.#a.set(e,r),e.pipe(this,{end:!1})}async remove(e){if(Z2(e),!this.#e.has(e))return!1;let r=this.#a.get(e);return r===void 0?!1:(this.#a.delete(e),e.unpipe(this),await r,!0)}},PZ=async(t,e,r)=>{Kh(t,I5);let n=new AbortController;try{await Promise.race([RZ(t,n),IZ(t,e,r,n)])}finally{n.abort(),Kh(t,-I5)}},RZ=async(t,{signal:e})=>{try{await(0,J2.finished)(t,{signal:e,cleanup:!0})}catch(r){throw L5(t,r),r}},IZ=async(t,e,r,{signal:n})=>{for await(let[i]of(0,dc.on)(t,"unpipe",{signal:n}))e.has(i)&&i.emit(r)},Z2=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},MZ=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,onFinished:s,unpipeEvent:o})=>{Kh(t,M5);let a=new AbortController;try{await Promise.race([LZ(s,e,a),NZ({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:a}),$Z({stream:e,streams:r,ended:n,aborted:i,unpipeEvent:o,controller:a})])}finally{a.abort(),Kh(t,-M5)}r.size>0&&r.size===n.size+i.size&&(n.size===0&&i.size>0?X2(t):jZ(t))},LZ=async(t,e,{signal:r})=>{try{await t,r.aborted||X2(e)}catch(n){r.aborted||L5(e,n)}},NZ=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:{signal:s}})=>{try{await(0,J2.finished)(e,{signal:s,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(o){if(s.aborted||!r.has(e))return;N5(o)?i.add(e):$5(t,o)}},$Z=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:i,controller:{signal:s}})=>{if(await(0,dc.once)(t,i,{signal:s}),!t.readable)return(0,dc.once)(s,"abort",{signal:s});e.delete(t),r.delete(t),n.delete(t)},jZ=t=>{t.writable&&t.end()},L5=(t,e)=>{N5(e)?X2(t):$5(t,e)},N5=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",X2=t=>{(t.readable||t.writable)&&t.destroy()},$5=(t,e)=>{t.destroyed||(t.once("error",UZ),t.destroy(e))},UZ=()=>{},Kh=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},I5=2,M5=1;var Q2=require("node:stream/promises");var zo=(t,e)=>{t.pipe(e),qZ(t,e),HZ(t,e)},qZ=async(t,e)=>{if(!(Ir(t)||Ir(e))){try{await(0,Q2.finished)(t,{cleanup:!0,readable:!0,writable:!1})}catch{}e1(e)}},e1=t=>{t.writable&&t.end()},HZ=async(t,e)=>{if(!(Ir(t)||Ir(e))){try{await(0,Q2.finished)(e,{cleanup:!0,readable:!1,writable:!0})}catch{}t1(t)}},t1=t=>{t.readable&&t.destroy()};var j5=(t,e,r)=>{let n=new Map;for(let[i,{stdioItems:s,direction:o}]of Object.entries(e)){for(let{stream:a}of s.filter(({type:u})=>pr.has(u)))WZ(t,a,o,i);for(let{stream:a}of s.filter(({type:u})=>!pr.has(u)))VZ({subprocess:t,stream:a,direction:o,fdNumber:i,pipeGroups:n,controller:r})}for(let[i,s]of n.entries()){let o=s.length===1?s[0]:xs(s);zo(o,i)}},WZ=(t,e,r,n)=>{r==="output"?zo(t.stdio[n],e):zo(e,t.stdio[n]);let i=GZ[n];i!==void 0&&(t[i]=e),t.stdio[n]=e},GZ=["stdin","stdout","stderr"],VZ=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:i,controller:s})=>{if(e===void 0)return;zZ(e,s);let[o,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],u=i.get(o)??[];i.set(o,[...u,a])},zZ=(t,{signal:e})=>{Ir(t)&&ps(t,KZ,e)},KZ=2;var U5=require("node:events");Hl();var q5=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let i=ao(()=>{t.kill()});(0,U5.addAbortListener)(n,()=>{i()})};var W5=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...i)=>{let s=nh(),{destination:o,destinationStream:a,destinationError:u,from:c,unpipeSignal:l}=YZ(r,n,i),{sourceStream:f,sourceError:h}=JZ(t,c),{options:d,fileDescriptors:p}=nn.get(t);return{sourcePromise:e,sourceStream:f,sourceOptions:d,sourceError:h,destination:o,destinationStream:a,destinationError:u,unpipeSignal:l,fileDescriptors:p,startTime:s}},YZ=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:i,to:s,unpipeSignal:o}={}}=ZZ(t,e,...r),a=hh(n,s);return{destination:n,destinationStream:a,from:i,unpipeSignal:o}}catch(n){return{destinationError:n}}},ZZ=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(H5,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||Gx(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[i,s,o]=Vf(r,...n);return{destination:e(H5)(i,s,o),pipeOptions:o}}if(nn.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},H5=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),JZ=(t,e)=>{try{return{sourceStream:$o(t,e)}}catch(r){return{sourceError:r}}};var V5=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:i,sourceOptions:s,startTime:o})=>{let a=XZ({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw r1({error:a,fileDescriptors:i,sourceOptions:s,startTime:o})},XZ=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return t1(t),n;if(e!==void 0)return e1(r),e},r1=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>qo({error:t,command:G5,escapedCommand:G5,fileDescriptors:e,options:r,startTime:n,isSync:!1}),G5="source.pipe(destination)";var z5=async t=>{let[{status:e,reason:r,value:n=r},{status:i,reason:s,value:o=s}]=await t;if(o.pipedFrom.includes(n)||o.pipedFrom.push(n),i==="rejected")throw o;if(e==="rejected")throw n;return o};var K5=require("node:stream/promises");var Y5=(t,e,r)=>{let n=Zh.has(e)?eJ(t,e):QZ(t,e);return ps(t,rJ,r.signal),ps(e,nJ,r.signal),tJ(e),n},QZ=(t,e)=>{let r=xs([t]);return zo(r,e),Zh.set(e,r),r},eJ=(t,e)=>{let r=Zh.get(e);return r.add(t),r},tJ=async t=>{try{await(0,K5.finished)(t,{cleanup:!0,readable:!1,writable:!0})}catch{}Zh.delete(t)},Zh=new WeakMap,rJ=2,nJ=1;var Z5=require("node:util");var J5=(t,e)=>t===void 0?[]:[iJ(t,e)],iJ=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:i,startTime:s})=>{await(0,Z5.aborted)(t,e),await r.remove(e);let o=new Error("Pipe canceled by `unpipeSignal` option.");throw r1({error:o,fileDescriptors:n,sourceOptions:i,startTime:s})};var Jh=(t,...e)=>{if($e(e[0]))return Jh.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=W5(t,...e),i=sJ({...n,destination:r});return i.pipe=Jh.bind(void 0,{...t,source:r,sourcePromise:i,boundOptions:{}}),i},sJ=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:i,destinationStream:s,destinationError:o,unpipeSignal:a,fileDescriptors:u,startTime:c})=>{let l=oJ(t,i);V5({sourceStream:e,sourceError:n,destinationStream:s,destinationError:o,fileDescriptors:u,sourceOptions:r,startTime:c});let f=new AbortController;try{let h=Y5(e,s,f);return await Promise.race([z5(l),...J5(a,{sourceStream:e,mergedStream:h,sourceOptions:r,fileDescriptors:u,startTime:c})])}finally{f.abort()}},oJ=(t,e)=>Promise.allSettled([t,e]);var r7=require("node:timers/promises");var Q5=require("node:events"),e7=require("node:stream");var Xh=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:i,preserveNewlines:s})=>{let o=new AbortController;return aJ(e,o),t7({stream:t,controller:o,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:s})},aJ=async(t,e)=>{try{await t}catch{}finally{e.abort()}},n1=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:i,allMixed:s})=>{let o=new AbortController;uJ(e,o,t);let a=t.readableObjectMode&&!s;return t7({stream:t,controller:o,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!i})},uJ=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},t7=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:s,preserveNewlines:o})=>{let a=(0,Q5.on)(t,"data",{signal:e.signal,highWaterMark:X5,highWatermark:X5});return cJ({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:s,preserveNewlines:o})},i1=(0,e7.getDefaultHighWaterMark)(!0),X5=i1,cJ=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:s,preserveNewlines:o}){let a=lJ({binary:r,shouldEncode:n,encoding:i,shouldSplit:s,preserveNewlines:o});try{for await(let[u]of t)yield*gs(u,a,0)}catch(u){if(!e.signal.aborted)throw u}finally{yield*uc(a)}},lJ=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:i})=>[Uh(t,r,!e),jh(t,i,!n,{})].filter(Boolean);var n7=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:i,maxBuffer:s,lines:o,allMixed:a,stripFinalNewline:u,verboseInfo:c,streamInfo:l})=>{let f=fJ({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:c,streamInfo:l});if(!i){await Promise.all([hJ(t),f]);return}let h=$2(u,r),d=n1({stream:t,onStreamEnd:e,lines:o,encoding:n,stripFinalNewline:h,allMixed:a}),[p]=await Promise.all([dJ({stream:t,iterable:d,fdNumber:r,encoding:n,maxBuffer:s,lines:o}),f]);return p},fJ=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:i,verboseInfo:s,streamInfo:{fileDescriptors:o}})=>{if(!Wh({stdioItems:o[r]?.stdioItems,encoding:n,verboseInfo:s,fdNumber:r}))return;let a=n1({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:i});await d5(a,t,r,s)},hJ=async t=>{await(0,r7.setImmediate)(),t.readableFlowing===null&&t.resume()},dJ=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:i,maxBuffer:s,lines:o})=>{try{return e||o?await Bh(r,{maxBuffer:s}):i==="buffer"?new Uint8Array(await Th(r,{maxBuffer:s})):await Oh(r,{maxBuffer:s})}catch(a){return i7(lA({error:a,stream:t,readableObjectMode:e,lines:o,encoding:i,fdNumber:n}))}},s1=async t=>{try{return await t}catch(e){return i7(e)}},i7=({bufferedData:t})=>iv(t)?new Uint8Array(t):t;var o7=require("node:stream/promises"),pc=async(t,e,r,{isSameDirection:n,stopOnExit:i=!1}={})=>{let s=pJ(t,r),o=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],(0,o7.finished)(t,{cleanup:!0,signal:o.signal})])}catch(a){s.stdinCleanedUp||gJ(a,e,r,n)}finally{o.abort()}},pJ=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&mJ(t,r,n),n},mJ=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...i)=>{DJ(e,r),n.call(t,...i)}},DJ=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},gJ=(t,e,r,n)=>{if(!xJ(t,e,r,n))throw t},xJ=(t,e,r,n=!0)=>r.propagating?s7(t)||Qh(t):(r.propagating=!0,o1(r,e)===n?s7(t):Qh(t)),o1=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",Qh=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",s7=t=>t?.code==="EPIPE";var a7=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:s,verboseInfo:o,streamInfo:a})=>t.stdio.map((u,c)=>a1({stream:u,fdNumber:c,encoding:e,buffer:r[c],maxBuffer:n[c],lines:i[c],allMixed:!1,stripFinalNewline:s,verboseInfo:o,streamInfo:a})),a1=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:s,allMixed:o,stripFinalNewline:a,verboseInfo:u,streamInfo:c})=>{if(!t)return;let l=pc(t,e,c);if(o1(c,e)){await l;return}let[f]=await Promise.all([n7({stream:t,onStreamEnd:l,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:s,allMixed:o,stripFinalNewline:a,verboseInfo:u,streamInfo:c}),l]);return f};var u7=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?xs([t,e].filter(Boolean)):void 0,c7=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:s,verboseInfo:o,streamInfo:a})=>a1({...yJ(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:i[1]||i[2],allMixed:bJ(t),stripFinalNewline:s,verboseInfo:o,streamInfo:a}),yJ=({stdout:t,stderr:e,all:r},[,n,i])=>{let s=n||i;return s?n?i?{stream:r,buffer:s}:{stream:t,buffer:s}:{stream:e,buffer:s}:{stream:r,buffer:s}},bJ=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode;var p7=require("node:events");var l7=t=>Po(t,"ipc"),f7=(t,e)=>{let r=rh(t);tn({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})};var h7=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:i,verboseInfo:s})=>{if(!n)return i;let o=l7(s),a=Rn(e,"ipc"),u=Rn(r,"ipc");for await(let c of z2({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(fA(t,i,u),i.push(c)),o&&f7(c,s);return i},d7=async(t,e)=>(await Promise.allSettled([t]),e);var m7=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:i,timeoutDuration:s,cancelSignal:o,gracefulCancel:a,forceKillAfterDelay:u,stripFinalNewline:c,ipc:l,ipcInput:f},context:h,verboseInfo:d,fileDescriptors:p,originalStreams:m,onInternalError:x,controller:D})=>{let y=x5(t,h),b={originalStreams:m,fileDescriptors:p,subprocess:t,exitPromise:y,propagating:!1},C=a7({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:c,verboseInfo:d,streamInfo:b}),_=c7({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:c,verboseInfo:d,streamInfo:b}),T=[],B=h7({subprocess:t,buffer:r,maxBuffer:n,ipc:l,ipcOutput:T,verboseInfo:d}),O=FJ(m,t,b),v=EJ(p,b);try{return await Promise.race([Promise.all([{},b5(y),Promise.all(C),_,B,N4(t,f),...O,...v]),x,CJ(t,D),...P4(t,s,h,D),...V_({subprocess:t,cancelSignal:o,gracefulCancel:a,context:h,controller:D}),...T4({subprocess:t,cancelSignal:o,gracefulCancel:a,forceKillAfterDelay:u,context:h,controller:D})])}catch(A){return h.terminationReason??="other",Promise.all([{error:A},y,Promise.all(C.map(F=>s1(F))),s1(_),d7(B,T),Promise.allSettled(O),Promise.allSettled(v)])}},FJ=(t,e,r)=>t.map((n,i)=>n===e.stdio[i]?void 0:pc(n,i,r)),EJ=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:i,stream:s=i})=>Nr(s,{checkOpen:!1})&&!Ir(s)).map(({type:i,value:s,stream:o=s})=>pc(o,n,e,{isSameDirection:pr.has(i),stopOnExit:i==="native"}))),CJ=async(t,{signal:e})=>{let[r]=await(0,p7.once)(t,"error",{signal:e});throw r};var D7=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),mc=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let i=n.get(e),s=rn();return i.push(s),{resolve:s.resolve.bind(s),promises:i}},Ko=async({resolve:t,promises:e},r)=>{t();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...e])]);return!n};var x7=require("node:stream"),y7=require("node:util");var u1=require("node:stream/promises");var c1=async t=>{if(t!==void 0)try{await l1(t)}catch{}},g7=async t=>{if(t!==void 0)try{await f1(t)}catch{}},l1=async t=>{await(0,u1.finished)(t,{cleanup:!0,readable:!1,writable:!0})},f1=async t=>{await(0,u1.finished)(t,{cleanup:!0,readable:!0,writable:!1})},e0=async(t,e)=>{if(await t,e)throw e},t0=(t,e,r)=>{r&&!Qh(r)?t.destroy(r):e&&t.destroy()};var b7=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:i=!0,preserveNewlines:s=!0}={})=>{let o=i||Vt.has(r),{subprocessStdout:a,waitReadableDestroy:u}=h1(t,n,e),{readableEncoding:c,readableObjectMode:l,readableHighWaterMark:f}=d1(a,o),{read:h,onStdoutDataDone:d}=p1({subprocessStdout:a,subprocess:t,binary:o,encoding:r,preserveNewlines:s}),p=new x7.Readable({read:h,destroy:(0,y7.callbackify)(D1.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:u})),highWaterMark:f,objectMode:l,encoding:c});return m1({subprocessStdout:a,onStdoutDataDone:d,readable:p,subprocess:t}),p},h1=(t,e,r)=>{let n=$o(t,e),i=mc(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:i}},d1=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:i1},p1=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:i})=>{let s=rn(),o=Xh({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:i});return{read(){wJ(this,o,s)},onStdoutDataDone:s}},wJ=async(t,e,r)=>{try{let{value:n,done:i}=await e.next();i?r.resolve():t.push(n)}catch{}},m1=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:i})=>{try{await f1(t),await n,await c1(i),await e,r.readable&&r.push(null)}catch(s){await c1(i),F7(r,s)}},D1=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await Ko(r,e)&&(F7(t,n),await e0(e,n))},F7=(t,e)=>{t0(t,t.readable,e)};var E7=require("node:stream"),g1=require("node:util");var C7=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:s}=x1(t,r,e),o=new E7.Writable({...y1(n,t,i),destroy:(0,g1.callbackify)(F1.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:i,waitWritableDestroy:s})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return b1(n,o),o},x1=(t,e,r)=>{let n=hh(t,e),i=mc(r,n,"writableFinal"),s=mc(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:s}},y1=(t,e,r)=>({write:SJ.bind(void 0,t),final:(0,g1.callbackify)(vJ.bind(void 0,t,e,r))}),SJ=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},vJ=async(t,e,r)=>{await Ko(r,e)&&(t.writable&&t.end(),await e)},b1=async(t,e,r)=>{try{await l1(t),e.writable&&e.end()}catch(n){await g7(r),w7(e,n)}},F1=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},i)=>{await Ko(r,e),await Ko(n,e)&&(w7(t,i),await e0(e,i))},w7=(t,e)=>{t0(t,t.writable,e)};var S7=require("node:stream"),v7=require("node:util");var _7=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:i,binary:s=!0,preserveNewlines:o=!0}={})=>{let a=s||Vt.has(r),{subprocessStdout:u,waitReadableDestroy:c}=h1(t,n,e),{subprocessStdin:l,waitWritableFinal:f,waitWritableDestroy:h}=x1(t,i,e),{readableEncoding:d,readableObjectMode:p,readableHighWaterMark:m}=d1(u,a),{read:x,onStdoutDataDone:D}=p1({subprocessStdout:u,subprocess:t,binary:a,encoding:r,preserveNewlines:o}),y=new S7.Duplex({read:x,...y1(l,t,f),destroy:(0,v7.callbackify)(_J.bind(void 0,{subprocessStdout:u,subprocessStdin:l,subprocess:t,waitReadableDestroy:c,waitWritableFinal:f,waitWritableDestroy:h})),readableHighWaterMark:m,writableHighWaterMark:l.writableHighWaterMark,readableObjectMode:p,writableObjectMode:l.writableObjectMode,encoding:d});return m1({subprocessStdout:u,onStdoutDataDone:D,readable:y,subprocess:t,subprocessStdin:l}),b1(l,y,u),y},_J=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:i,waitWritableDestroy:s},o)=>{await Promise.all([D1({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},o),F1({subprocessStdin:e,subprocess:r,waitWritableFinal:i,waitWritableDestroy:s},o)])};var E1=(t,e,{from:r,binary:n=!1,preserveNewlines:i=!1}={})=>{let s=n||Vt.has(e),o=$o(t,r),a=Xh({subprocessStdout:o,subprocess:t,binary:s,shouldEncode:!0,encoding:e,preserveNewlines:i});return AJ(a,o,t)},AJ=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}};var A7=(t,{encoding:e})=>{let r=D7();t.readable=b7.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=C7.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=_7.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=E1.bind(void 0,t,e),t[Symbol.asyncIterator]=E1.bind(void 0,t,e,{})};var B7=(t,e)=>{for(let[r,n]of TJ){let i=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}},BJ=(async()=>{})().constructor.prototype,TJ=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(BJ,t)]);var O7=(t,e,r,n)=>{let{file:i,commandArguments:s,command:o,escapedCommand:a,startTime:u,verboseInfo:c,options:l,fileDescriptors:f}=kJ(t,e,r),{subprocess:h,promise:d}=PJ({file:i,commandArguments:s,options:l,startTime:u,verboseInfo:c,command:o,escapedCommand:a,fileDescriptors:f});return h.pipe=Jh.bind(void 0,{source:h,sourcePromise:d,boundOptions:{},createNested:n}),B7(h,d),nn.set(h,{options:l,fileDescriptors:f}),h},kJ=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:s,verboseInfo:o}=ih(t,e,r),{file:a,commandArguments:u,options:c}=wh(t,e,r),l=OJ(c),f=R5(l,o);return{file:a,commandArguments:u,command:n,escapedCommand:i,startTime:s,verboseInfo:o,options:l,fileDescriptors:f}},OJ=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:t}},PJ=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:i,command:s,escapedCommand:o,fileDescriptors:a})=>{let u;try{u=(0,k7.spawn)(...Sh(t,e,r))}catch(p){return k5({error:p,command:s,escapedCommand:o,fileDescriptors:a,options:r,startTime:n,verboseInfo:i})}let c=new AbortController;(0,T7.setMaxListeners)(Number.POSITIVE_INFINITY,c.signal);let l=[...u.stdio];j5(u,a,c),q5(u,r,c);let f={},h=rn();u.kill=H_.bind(void 0,{kill:u.kill.bind(u),options:r,onInternalError:h,context:f,controller:c}),u.all=u7(u,r),A7(u,r),_5(u,r);let d=RJ({subprocess:u,options:r,startTime:n,verboseInfo:i,fileDescriptors:a,originalStreams:l,command:s,escapedCommand:o,context:f,onInternalError:h,controller:c});return{subprocess:u,promise:d}},RJ=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:i,originalStreams:s,command:o,escapedCommand:a,context:u,onInternalError:c,controller:l})=>{let[f,[h,d],p,m,x]=await m7({subprocess:t,options:e,context:u,verboseInfo:n,fileDescriptors:i,originalStreams:s,onInternalError:c,controller:l});l.abort(),c.resolve();let D=p.map((C,_)=>Ln(C,e,_)),y=Ln(m,e,"all"),b=IJ({errorInfo:f,exitCode:h,signal:d,stdio:D,all:y,ipcOutput:x,context:u,options:e,command:o,escapedCommand:a,startTime:r});return Ho(b,n,e)},IJ=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:s,context:o,options:a,command:u,escapedCommand:c,startTime:l})=>"error"in t?ac({error:t.error,command:u,escapedCommand:c,timedOut:o.terminationReason==="timeout",isCanceled:o.terminationReason==="cancel"||o.terminationReason==="gracefulCancel",isGracefullyCanceled:o.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof sn,isForcefullyTerminated:o.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:s,options:a,startTime:l,isSync:!1}):Rh({command:u,escapedCommand:c,stdio:n,all:i,ipcOutput:s,options:a,startTime:l});var r0=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,i])=>[n,MJ(n,t[n],i)]));return{...t,...r}},MJ=(t,e,r)=>LJ.has(t)&&$e(e)&&$e(r)?{...e,...r}:r,LJ=new Set(["env",...Zx]);var pi=(t,e,r,n)=>{let i=(o,a,u)=>pi(o,a,r,u),s=(...o)=>NJ({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:i},...o);return n!==void 0&&n(s,i,e),s},NJ=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:i},s,...o)=>{if($e(s))return i(t,r0(r,s),n);let{file:a,commandArguments:u,options:c,isSync:l}=$J({mapArguments:t,firstArgument:s,nextArguments:o,deepOptions:e,boundOptions:r});return l?C5(a,u,c):O7(a,u,c,i)},$J=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:i})=>{let s=fv(e)?hv(e,r):[e,...r],[o,a,u]=Vf(...s),c=r0(r0(n,i),u),{file:l=o,commandArguments:f=a,options:h=c,isSync:d=!1}=t({file:o,commandArguments:a,options:c});return{file:l,commandArguments:f,options:h,isSync:d}};var P7=({file:t,commandArguments:e})=>I7(t,e),R7=({file:t,commandArguments:e})=>({...I7(t,e),isSync:!0}),I7=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...n]=jJ(t);return{file:r,commandArguments:n}},jJ=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return[];let r=[];for(let n of e.split(UJ)){let i=r.at(-1);i&&i.endsWith("\\")?r[r.length-1]=`${i.slice(0,-1)} ${n}`:r.push(n)}return r},UJ=/ +/g;var M7=(t,e,r)=>{t.sync=e(qJ,r),t.s=t.sync},L7=({options:t})=>N7(t),qJ=({options:t})=>({...N7(t),isSync:!0}),N7=t=>({options:{...HJ(t),...t}}),HJ=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},$7={preferLocal:!0};var j7=pi(()=>({})),n0=pi(()=>({isSync:!0})),J8e=pi(P7),X8e=pi(R7),Q8e=pi(R4),eSe=pi(L7,{},$7,M7),{sendMessage:tSe,getOneMessage:rSe,getEachMessage:nSe,getCancelSignal:iSe}=A5();function C1(t,e){if(t.length===0)return"No entries to display.";let r=e?.title||"Benchmark Results",n=e?.footer||"",i=e?.maxBarWidth||50,s=e?.unit||"",o=Math.max(...t.map(u=>u.value)),a=[];a.push(""),a.push(r),a.push("");for(let u of t){let c=WJ(u.barColor??e?.barColor),l=GJ(u,o,i,c,s,e?.labelColor);a.push(l)}return n&&(a.push(""),a.push(n)),a.join(`
|
|
184
|
+
if (condition) { yield value; }`)};var o5=require("node:buffer"),a5=require("node:string_decoder");var Uh=(t,e,r)=>{if(r)return;if(t)return{transform:WY.bind(void 0,new TextEncoder)};let n=new a5.StringDecoder(e);return{transform:GY.bind(void 0,n),final:VY.bind(void 0,n)}},WY=function*(t,e){o5.Buffer.isBuffer(e)?yield Pn(e):typeof e=="string"?yield t.encode(e):yield e},GY=function*(t,e){yield ze(e)?t.write(e):e},VY=function*(t){let e=t.end();e!==""&&(yield e)};var q2=require("node:util"),H2=(0,q2.callbackify)(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let i of e.currentIterable)n.push(i)}finally{delete e.currentIterable}}),qh=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=KY}=e[r];for await(let i of n(t))yield*qh(i,e,r+1)},u5=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*zY(r,Number(e),t)},zY=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*qh(n,r,e+1)},c5=(0,q2.callbackify)(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),KY=function*(t){yield t};var W2=(t,e,r,n)=>{try{for(let i of t(...e))r.push(i);n()}catch(i){n(i)}},l5=(t,e)=>[...e.flatMap(r=>[...gs(r,t,0)]),...uc(t)],gs=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=ZY}=e[r];for(let i of n(t))yield*gs(i,e,r+1)},uc=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*YY(r,Number(e),t)},YY=function*(t,e,r){if(t!==void 0)for(let n of t())yield*gs(n,r,e+1)},ZY=function*(t){yield t};var G2=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:i},optionName:s},{encoding:o})=>{let a={},u=f5(t,o,s),c=Ds(e),l=Ds(r),f=c?H2.bind(void 0,qh,a):W2.bind(void 0,gs),h=c||l?H2.bind(void 0,u5,a):W2.bind(void 0,uc),d=c||l?c5.bind(void 0,a):void 0;return{stream:new cc.Transform({writableObjectMode:n,writableHighWaterMark:(0,cc.getDefaultHighWaterMark)(n),readableObjectMode:i,readableHighWaterMark:(0,cc.getDefaultHighWaterMark)(i),transform(m,x,D){f([m,u,0],this,D)},flush(m){h([u],this,m)},destroy:d})}},Hh=(t,e,r,n)=>{let i=e.filter(({type:o})=>o==="generator"),s=n?i.reverse():i;for(let{value:o,optionName:a}of s){let u=f5(o,r,a);t=l5(u,t)}return t},f5=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:i,preserveNewlines:s},o,a)=>{let u={};return[{transform:n5(n,a)},Uh(r,o,n),jh(r,s,n,u),{transform:t,final:e},{transform:i5(i,a)},t5({binary:r,preserveNewlines:s,readableObjectMode:i,state:u})].filter(Boolean)};var h5=(t,e)=>{for(let r of JY(t))XY(t,r,e)},JY=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),XY=(t,e,r)=>{let{stdioItems:n}=t[e],i=n.filter(({contents:a})=>a!==void 0);if(i.length===0)return;if(e!==0){let[{type:a,optionName:u}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${u}\`, can be ${hi[a]} with synchronous methods.`)}let o=i.map(({contents:a})=>a).map(a=>QY(a,n));r.input=Xu(o)},QY=(t,e)=>{let r=Hh(t,e,"utf8",!0);return eZ(r),Xu(r)},eZ=t=>{let e=t.find(r=>typeof r!="string"&&!ze(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)};var Gh=require("node:fs");var Wh=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&Po(r,n)&&!Vt.has(e)&&tZ(n)&&(t.some(({type:i,value:s})=>i==="native"&&rZ.has(s))||t.every(({type:i})=>pr.has(i))),tZ=t=>t===1||t===2,rZ=new Set(["pipe","overlapped"]),d5=async(t,e,r,n)=>{for await(let i of t)nZ(e)||m5(i,r,n)},p5=(t,e,r)=>{for(let n of t)m5(n,e,r)},nZ=t=>t._readableState.pipes.length>0,m5=(t,e,r)=>{let n=rh(t);tn({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})};var D5=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:i})=>{if(e===null)return{output:Array.from({length:3})};let s={},o=new Set([]);return{output:e.map((u,c)=>iZ({result:u,fileDescriptors:t,fdNumber:c,state:s,outputFiles:o,isMaxBuffer:n,verboseInfo:i},r)),...s}},iZ=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:i,isMaxBuffer:s,verboseInfo:o},{buffer:a,encoding:u,lines:c,stripFinalNewline:l,maxBuffer:f})=>{if(t===null)return;let h=pA(t,s,f),d=Pn(h),{stdioItems:p,objectMode:m}=e[r],x=sZ([d],p,u,n),{serializedResult:D,finalResult:y=D}=oZ({chunks:x,objectMode:m,encoding:u,lines:c,stripFinalNewline:l,fdNumber:r});aZ({serializedResult:D,fdNumber:r,state:n,verboseInfo:o,encoding:u,stdioItems:p,objectMode:m});let b=a[r]?y:void 0;try{return n.error===void 0&&uZ(D,p,i),b}catch(C){return n.error=C,b}},sZ=(t,e,r,n)=>{try{return Hh(t,e,r,!1)}catch(i){return n.error=i,t}},oZ=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:i,fdNumber:s})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:Xu(t)};let o=ov(t,r);return n[s]?{serializedResult:o,finalResult:U2(o,!i[s],e)}:{serializedResult:o}},aZ=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:i,stdioItems:s,objectMode:o})=>{if(!Wh({stdioItems:s,encoding:i,verboseInfo:n,fdNumber:e}))return;let a=U2(t,!1,o);try{p5(a,e,n)}catch(u){r.error??=u}},uZ=(t,e,r)=>{for(let{path:n,append:i}of e.filter(({type:s})=>Lh.has(s))){let s=typeof n=="string"?n:n.toString();i||r.has(s)?(0,Gh.appendFileSync)(n,t):(r.add(s),(0,Gh.writeFileSync)(n,t))}};var g5=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,Ln(e,r,"all")]:Array.isArray(e)?[Ln(t,r,"all"),...e]:ze(t)&&ze(e)?zx([t,e]):`${t}${e}`};var Vh=require("node:events");var x5=async(t,e)=>{let[r,n]=await cZ(t);return e.isForcefullyTerminated??=!1,[r,n]},cZ=async t=>{let[e,r]=await Promise.allSettled([(0,Vh.once)(t,"spawn"),(0,Vh.once)(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?y5(t):r.value},y5=async t=>{try{return await(0,Vh.once)(t,"exit")}catch{return y5(t)}},b5=async t=>{let[e,r]=await t;if(!lZ(e,r)&&V2(e,r))throw new Mr;return[e,r]},lZ=(t,e)=>t===void 0&&e===void 0,V2=(t,e)=>t!==0||e!==null;var F5=({error:t,status:e,signal:r,output:n},{maxBuffer:i})=>{let s=fZ(t,e,r),o=s?.code==="ETIMEDOUT",a=dA(s,n,i);return{resultError:s,exitCode:e,signal:r,timedOut:o,isMaxBuffer:a}},fZ=(t,e,r)=>t!==void 0?t:V2(e,r)?new Mr:void 0;var C5=(t,e,r)=>{let{file:n,commandArguments:i,command:s,escapedCommand:o,startTime:a,verboseInfo:u,options:c,fileDescriptors:l}=hZ(t,e,r),f=mZ({file:n,commandArguments:i,options:c,command:s,escapedCommand:o,verboseInfo:u,fileDescriptors:l,startTime:a});return Ho(f,u,c)},hZ=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:s,verboseInfo:o}=ih(t,e,r),a=dZ(r),{file:u,commandArguments:c,options:l}=wh(t,e,a);pZ(l);let f=JA(l,o);return{file:u,commandArguments:c,command:n,escapedCommand:i,startTime:s,verboseInfo:o,options:l,fileDescriptors:f}},dZ=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,pZ=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&zh("ipcInput"),t&&zh("ipc: true"),r&&zh("detached: true"),n&&zh("cancelSignal")},zh=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},mZ=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,verboseInfo:s,fileDescriptors:o,startTime:a})=>{let u=DZ({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:o,startTime:a});if(u.failed)return u;let{resultError:c,exitCode:l,signal:f,timedOut:h,isMaxBuffer:d}=F5(u,r),{output:p,error:m=c}=D5({fileDescriptors:o,syncResult:u,options:r,isMaxBuffer:d,verboseInfo:s}),x=p.map((y,b)=>Ln(y,r,b)),D=Ln(g5(p,r),r,"all");return xZ({error:m,exitCode:l,signal:f,timedOut:h,isMaxBuffer:d,stdio:x,all:D,options:r,command:n,escapedCommand:i,startTime:a})},DZ=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:s,startTime:o})=>{try{h5(s,r);let a=gZ(r);return(0,E5.spawnSync)(...Sh(t,e,a))}catch(a){return qo({error:a,command:n,escapedCommand:i,fileDescriptors:s,options:r,startTime:o,isSync:!0})}},gZ=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:Ph(e)}),xZ=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:i,stdio:s,all:o,options:a,command:u,escapedCommand:c,startTime:l})=>t===void 0?Rh({command:u,escapedCommand:c,stdio:s,all:o,ipcOutput:[],options:a,startTime:l}):ac({error:t,command:u,escapedCommand:c,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:e,signal:r,stdio:s,all:o,ipcOutput:[],options:a,startTime:l,isSync:!0});var T7=require("node:events"),k7=require("node:child_process");var K2=P(require("node:process"),1);var Go=require("node:events");var w5=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0,filter:s}={})=>(Lo({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:gh(t)}),yZ({anyProcess:t,channel:e,isSubprocess:r,filter:s,reference:i})),yZ=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:i})=>{dh(e,i);let s=fi(t,e,r),o=new AbortController;try{return await Promise.race([bZ(s,n,o),FZ(s,r,o),EZ(s,r,o)])}catch(a){throw No(t),a}finally{o.abort(),ph(e,i)}},bZ=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await(0,Go.once)(t,"message",{signal:r});return n}for await(let[n]of(0,Go.on)(t,"message",{signal:r}))if(e(n))return n},FZ=async(t,e,{signal:r})=>{await(0,Go.once)(t,"disconnect",{signal:r}),z_(e)},EZ=async(t,e,{signal:r})=>{let[n]=await(0,Go.once)(t,"strict:error",{signal:r});throw lh(n,e)};var lc=require("node:events");var v5=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0}={})=>z2({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:i}),z2=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:i,reference:s})=>{Lo({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:gh(t)}),dh(e,s);let o=fi(t,e,r),a=new AbortController,u={};return CZ(t,o,a),wZ({ipcEmitter:o,isSubprocess:r,controller:a,state:u}),SZ({anyProcess:t,channel:e,ipcEmitter:o,isSubprocess:r,shouldAwait:i,controller:a,state:u,reference:s})},CZ=async(t,e,r)=>{try{await(0,lc.once)(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},wZ=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[i]=await(0,lc.once)(t,"strict:error",{signal:r.signal});n.error=lh(i,e),r.abort()}catch{}},SZ=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:i,controller:s,state:o,reference:a}){try{for await(let[u]of(0,lc.on)(r,"message",{signal:s.signal}))S5(o),yield u}catch{S5(o)}finally{s.abort(),ph(e,a),n||No(t),i&&await t}},S5=({error:t})=>{if(t)throw t};var _5=(t,{ipc:e})=>{Object.assign(t,B5(t,!1,e))},A5=()=>{let t=K2.default,e=!0,r=K2.default.channel!==void 0;return{...B5(t,e,r),getCancelSignal:_4.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},B5=(t,e,r)=>({sendMessage:Fh.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:w5.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:v5.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})});var T5=require("node:child_process"),di=require("node:stream");var k5=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:s,verboseInfo:o})=>{L2(n);let a=new T5.ChildProcess;vZ(a,n),Object.assign(a,{readable:_Z,writable:AZ,duplex:BZ});let u=qo({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:s,isSync:!1}),c=TZ(u,o,i);return{subprocess:a,promise:c}},vZ=(t,e)=>{let r=fc(),n=fc(),i=fc(),s=Array.from({length:e.length-3},fc),o=fc(),a=[r,n,i,...s];Object.assign(t,{stdin:r,stdout:n,stderr:i,all:o,stdio:a})},fc=()=>{let t=new di.PassThrough;return t.end(),t},_Z=()=>new di.Readable({read(){}}),AZ=()=>new di.Writable({write(){}}),BZ=()=>new di.Duplex({read(){},write(){}}),TZ=async(t,e,r)=>Ho(t,e,r);var Vo=require("node:fs"),P5=require("node:buffer"),an=require("node:stream");var R5=(t,e)=>$h(kZ,t,e,!1),hc=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${hi[t]}.`)},O5={fileNumber:hc,generator:G2,asyncGenerator:G2,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:an.Duplex.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},kZ={input:{...O5,fileUrl:({value:t})=>({stream:(0,Vo.createReadStream)(t)}),filePath:({value:{file:t}})=>({stream:(0,Vo.createReadStream)(t)}),webStream:({value:t})=>({stream:an.Readable.fromWeb(t)}),iterable:({value:t})=>({stream:an.Readable.from(t)}),asyncIterable:({value:t})=>({stream:an.Readable.from(t)}),string:({value:t})=>({stream:an.Readable.from(t)}),uint8Array:({value:t})=>({stream:an.Readable.from(P5.Buffer.from(t))})},output:{...O5,fileUrl:({value:t})=>({stream:(0,Vo.createWriteStream)(t)}),filePath:({value:{file:t,append:e}})=>({stream:(0,Vo.createWriteStream)(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:an.Writable.fromWeb(t)}),iterable:hc,asyncIterable:hc,string:hc,uint8Array:hc}};var dc=require("node:events"),Yh=require("node:stream"),J2=require("node:stream/promises");function xs(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let i of t)Z2(i);let e=t.some(({readableObjectMode:i})=>i),r=OZ(t,e),n=new Y2({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let i of t)n.add(i);return n}var OZ=(t,e)=>{if(t.length===0)return(0,Yh.getDefaultHighWaterMark)(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},Y2=class extends Yh.PassThrough{#e=new Set([]);#r=new Set([]);#t=new Set([]);#n;#o=Symbol("unpipe");#a=new WeakMap;add(e){if(Z2(e),this.#e.has(e))return;this.#e.add(e),this.#n??=PZ(this,this.#e,this.#o);let r=MZ({passThroughStream:this,stream:e,streams:this.#e,ended:this.#r,aborted:this.#t,onFinished:this.#n,unpipeEvent:this.#o});this.#a.set(e,r),e.pipe(this,{end:!1})}async remove(e){if(Z2(e),!this.#e.has(e))return!1;let r=this.#a.get(e);return r===void 0?!1:(this.#a.delete(e),e.unpipe(this),await r,!0)}},PZ=async(t,e,r)=>{Kh(t,I5);let n=new AbortController;try{await Promise.race([RZ(t,n),IZ(t,e,r,n)])}finally{n.abort(),Kh(t,-I5)}},RZ=async(t,{signal:e})=>{try{await(0,J2.finished)(t,{signal:e,cleanup:!0})}catch(r){throw L5(t,r),r}},IZ=async(t,e,r,{signal:n})=>{for await(let[i]of(0,dc.on)(t,"unpipe",{signal:n}))e.has(i)&&i.emit(r)},Z2=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},MZ=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,onFinished:s,unpipeEvent:o})=>{Kh(t,M5);let a=new AbortController;try{await Promise.race([LZ(s,e,a),NZ({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:a}),$Z({stream:e,streams:r,ended:n,aborted:i,unpipeEvent:o,controller:a})])}finally{a.abort(),Kh(t,-M5)}r.size>0&&r.size===n.size+i.size&&(n.size===0&&i.size>0?X2(t):jZ(t))},LZ=async(t,e,{signal:r})=>{try{await t,r.aborted||X2(e)}catch(n){r.aborted||L5(e,n)}},NZ=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:{signal:s}})=>{try{await(0,J2.finished)(e,{signal:s,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(o){if(s.aborted||!r.has(e))return;N5(o)?i.add(e):$5(t,o)}},$Z=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:i,controller:{signal:s}})=>{if(await(0,dc.once)(t,i,{signal:s}),!t.readable)return(0,dc.once)(s,"abort",{signal:s});e.delete(t),r.delete(t),n.delete(t)},jZ=t=>{t.writable&&t.end()},L5=(t,e)=>{N5(e)?X2(t):$5(t,e)},N5=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",X2=t=>{(t.readable||t.writable)&&t.destroy()},$5=(t,e)=>{t.destroyed||(t.once("error",UZ),t.destroy(e))},UZ=()=>{},Kh=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},I5=2,M5=1;var Q2=require("node:stream/promises");var zo=(t,e)=>{t.pipe(e),qZ(t,e),HZ(t,e)},qZ=async(t,e)=>{if(!(Ir(t)||Ir(e))){try{await(0,Q2.finished)(t,{cleanup:!0,readable:!0,writable:!1})}catch{}e1(e)}},e1=t=>{t.writable&&t.end()},HZ=async(t,e)=>{if(!(Ir(t)||Ir(e))){try{await(0,Q2.finished)(e,{cleanup:!0,readable:!1,writable:!0})}catch{}t1(t)}},t1=t=>{t.readable&&t.destroy()};var j5=(t,e,r)=>{let n=new Map;for(let[i,{stdioItems:s,direction:o}]of Object.entries(e)){for(let{stream:a}of s.filter(({type:u})=>pr.has(u)))WZ(t,a,o,i);for(let{stream:a}of s.filter(({type:u})=>!pr.has(u)))VZ({subprocess:t,stream:a,direction:o,fdNumber:i,pipeGroups:n,controller:r})}for(let[i,s]of n.entries()){let o=s.length===1?s[0]:xs(s);zo(o,i)}},WZ=(t,e,r,n)=>{r==="output"?zo(t.stdio[n],e):zo(e,t.stdio[n]);let i=GZ[n];i!==void 0&&(t[i]=e),t.stdio[n]=e},GZ=["stdin","stdout","stderr"],VZ=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:i,controller:s})=>{if(e===void 0)return;zZ(e,s);let[o,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],u=i.get(o)??[];i.set(o,[...u,a])},zZ=(t,{signal:e})=>{Ir(t)&&ps(t,KZ,e)},KZ=2;var U5=require("node:events");Hl();var q5=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let i=ao(()=>{t.kill()});(0,U5.addAbortListener)(n,()=>{i()})};var W5=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...i)=>{let s=nh(),{destination:o,destinationStream:a,destinationError:u,from:c,unpipeSignal:l}=YZ(r,n,i),{sourceStream:f,sourceError:h}=JZ(t,c),{options:d,fileDescriptors:p}=nn.get(t);return{sourcePromise:e,sourceStream:f,sourceOptions:d,sourceError:h,destination:o,destinationStream:a,destinationError:u,unpipeSignal:l,fileDescriptors:p,startTime:s}},YZ=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:i,to:s,unpipeSignal:o}={}}=ZZ(t,e,...r),a=hh(n,s);return{destination:n,destinationStream:a,from:i,unpipeSignal:o}}catch(n){return{destinationError:n}}},ZZ=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(H5,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||Gx(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[i,s,o]=Vf(r,...n);return{destination:e(H5)(i,s,o),pipeOptions:o}}if(nn.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},H5=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),JZ=(t,e)=>{try{return{sourceStream:$o(t,e)}}catch(r){return{sourceError:r}}};var V5=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:i,sourceOptions:s,startTime:o})=>{let a=XZ({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw r1({error:a,fileDescriptors:i,sourceOptions:s,startTime:o})},XZ=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return t1(t),n;if(e!==void 0)return e1(r),e},r1=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>qo({error:t,command:G5,escapedCommand:G5,fileDescriptors:e,options:r,startTime:n,isSync:!1}),G5="source.pipe(destination)";var z5=async t=>{let[{status:e,reason:r,value:n=r},{status:i,reason:s,value:o=s}]=await t;if(o.pipedFrom.includes(n)||o.pipedFrom.push(n),i==="rejected")throw o;if(e==="rejected")throw n;return o};var K5=require("node:stream/promises");var Y5=(t,e,r)=>{let n=Zh.has(e)?eJ(t,e):QZ(t,e);return ps(t,rJ,r.signal),ps(e,nJ,r.signal),tJ(e),n},QZ=(t,e)=>{let r=xs([t]);return zo(r,e),Zh.set(e,r),r},eJ=(t,e)=>{let r=Zh.get(e);return r.add(t),r},tJ=async t=>{try{await(0,K5.finished)(t,{cleanup:!0,readable:!1,writable:!0})}catch{}Zh.delete(t)},Zh=new WeakMap,rJ=2,nJ=1;var Z5=require("node:util");var J5=(t,e)=>t===void 0?[]:[iJ(t,e)],iJ=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:i,startTime:s})=>{await(0,Z5.aborted)(t,e),await r.remove(e);let o=new Error("Pipe canceled by `unpipeSignal` option.");throw r1({error:o,fileDescriptors:n,sourceOptions:i,startTime:s})};var Jh=(t,...e)=>{if(je(e[0]))return Jh.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=W5(t,...e),i=sJ({...n,destination:r});return i.pipe=Jh.bind(void 0,{...t,source:r,sourcePromise:i,boundOptions:{}}),i},sJ=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:i,destinationStream:s,destinationError:o,unpipeSignal:a,fileDescriptors:u,startTime:c})=>{let l=oJ(t,i);V5({sourceStream:e,sourceError:n,destinationStream:s,destinationError:o,fileDescriptors:u,sourceOptions:r,startTime:c});let f=new AbortController;try{let h=Y5(e,s,f);return await Promise.race([z5(l),...J5(a,{sourceStream:e,mergedStream:h,sourceOptions:r,fileDescriptors:u,startTime:c})])}finally{f.abort()}},oJ=(t,e)=>Promise.allSettled([t,e]);var r7=require("node:timers/promises");var Q5=require("node:events"),e7=require("node:stream");var Xh=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:i,preserveNewlines:s})=>{let o=new AbortController;return aJ(e,o),t7({stream:t,controller:o,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:s})},aJ=async(t,e)=>{try{await t}catch{}finally{e.abort()}},n1=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:i,allMixed:s})=>{let o=new AbortController;uJ(e,o,t);let a=t.readableObjectMode&&!s;return t7({stream:t,controller:o,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!i})},uJ=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},t7=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:s,preserveNewlines:o})=>{let a=(0,Q5.on)(t,"data",{signal:e.signal,highWaterMark:X5,highWatermark:X5});return cJ({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:s,preserveNewlines:o})},i1=(0,e7.getDefaultHighWaterMark)(!0),X5=i1,cJ=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:s,preserveNewlines:o}){let a=lJ({binary:r,shouldEncode:n,encoding:i,shouldSplit:s,preserveNewlines:o});try{for await(let[u]of t)yield*gs(u,a,0)}catch(u){if(!e.signal.aborted)throw u}finally{yield*uc(a)}},lJ=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:i})=>[Uh(t,r,!e),jh(t,i,!n,{})].filter(Boolean);var n7=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:i,maxBuffer:s,lines:o,allMixed:a,stripFinalNewline:u,verboseInfo:c,streamInfo:l})=>{let f=fJ({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:c,streamInfo:l});if(!i){await Promise.all([hJ(t),f]);return}let h=$2(u,r),d=n1({stream:t,onStreamEnd:e,lines:o,encoding:n,stripFinalNewline:h,allMixed:a}),[p]=await Promise.all([dJ({stream:t,iterable:d,fdNumber:r,encoding:n,maxBuffer:s,lines:o}),f]);return p},fJ=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:i,verboseInfo:s,streamInfo:{fileDescriptors:o}})=>{if(!Wh({stdioItems:o[r]?.stdioItems,encoding:n,verboseInfo:s,fdNumber:r}))return;let a=n1({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:i});await d5(a,t,r,s)},hJ=async t=>{await(0,r7.setImmediate)(),t.readableFlowing===null&&t.resume()},dJ=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:i,maxBuffer:s,lines:o})=>{try{return e||o?await Bh(r,{maxBuffer:s}):i==="buffer"?new Uint8Array(await Th(r,{maxBuffer:s})):await Oh(r,{maxBuffer:s})}catch(a){return i7(lA({error:a,stream:t,readableObjectMode:e,lines:o,encoding:i,fdNumber:n}))}},s1=async t=>{try{return await t}catch(e){return i7(e)}},i7=({bufferedData:t})=>iv(t)?new Uint8Array(t):t;var o7=require("node:stream/promises"),pc=async(t,e,r,{isSameDirection:n,stopOnExit:i=!1}={})=>{let s=pJ(t,r),o=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],(0,o7.finished)(t,{cleanup:!0,signal:o.signal})])}catch(a){s.stdinCleanedUp||gJ(a,e,r,n)}finally{o.abort()}},pJ=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&mJ(t,r,n),n},mJ=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...i)=>{DJ(e,r),n.call(t,...i)}},DJ=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},gJ=(t,e,r,n)=>{if(!xJ(t,e,r,n))throw t},xJ=(t,e,r,n=!0)=>r.propagating?s7(t)||Qh(t):(r.propagating=!0,o1(r,e)===n?s7(t):Qh(t)),o1=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",Qh=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",s7=t=>t?.code==="EPIPE";var a7=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:s,verboseInfo:o,streamInfo:a})=>t.stdio.map((u,c)=>a1({stream:u,fdNumber:c,encoding:e,buffer:r[c],maxBuffer:n[c],lines:i[c],allMixed:!1,stripFinalNewline:s,verboseInfo:o,streamInfo:a})),a1=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:s,allMixed:o,stripFinalNewline:a,verboseInfo:u,streamInfo:c})=>{if(!t)return;let l=pc(t,e,c);if(o1(c,e)){await l;return}let[f]=await Promise.all([n7({stream:t,onStreamEnd:l,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:s,allMixed:o,stripFinalNewline:a,verboseInfo:u,streamInfo:c}),l]);return f};var u7=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?xs([t,e].filter(Boolean)):void 0,c7=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:s,verboseInfo:o,streamInfo:a})=>a1({...yJ(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:i[1]||i[2],allMixed:bJ(t),stripFinalNewline:s,verboseInfo:o,streamInfo:a}),yJ=({stdout:t,stderr:e,all:r},[,n,i])=>{let s=n||i;return s?n?i?{stream:r,buffer:s}:{stream:t,buffer:s}:{stream:e,buffer:s}:{stream:r,buffer:s}},bJ=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode;var p7=require("node:events");var l7=t=>Po(t,"ipc"),f7=(t,e)=>{let r=rh(t);tn({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})};var h7=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:i,verboseInfo:s})=>{if(!n)return i;let o=l7(s),a=Rn(e,"ipc"),u=Rn(r,"ipc");for await(let c of z2({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(fA(t,i,u),i.push(c)),o&&f7(c,s);return i},d7=async(t,e)=>(await Promise.allSettled([t]),e);var m7=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:i,timeoutDuration:s,cancelSignal:o,gracefulCancel:a,forceKillAfterDelay:u,stripFinalNewline:c,ipc:l,ipcInput:f},context:h,verboseInfo:d,fileDescriptors:p,originalStreams:m,onInternalError:x,controller:D})=>{let y=x5(t,h),b={originalStreams:m,fileDescriptors:p,subprocess:t,exitPromise:y,propagating:!1},C=a7({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:c,verboseInfo:d,streamInfo:b}),_=c7({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:c,verboseInfo:d,streamInfo:b}),T=[],B=h7({subprocess:t,buffer:r,maxBuffer:n,ipc:l,ipcOutput:T,verboseInfo:d}),O=FJ(m,t,b),v=EJ(p,b);try{return await Promise.race([Promise.all([{},b5(y),Promise.all(C),_,B,N4(t,f),...O,...v]),x,CJ(t,D),...P4(t,s,h,D),...V_({subprocess:t,cancelSignal:o,gracefulCancel:a,context:h,controller:D}),...T4({subprocess:t,cancelSignal:o,gracefulCancel:a,forceKillAfterDelay:u,context:h,controller:D})])}catch(A){return h.terminationReason??="other",Promise.all([{error:A},y,Promise.all(C.map(F=>s1(F))),s1(_),d7(B,T),Promise.allSettled(O),Promise.allSettled(v)])}},FJ=(t,e,r)=>t.map((n,i)=>n===e.stdio[i]?void 0:pc(n,i,r)),EJ=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:i,stream:s=i})=>Nr(s,{checkOpen:!1})&&!Ir(s)).map(({type:i,value:s,stream:o=s})=>pc(o,n,e,{isSameDirection:pr.has(i),stopOnExit:i==="native"}))),CJ=async(t,{signal:e})=>{let[r]=await(0,p7.once)(t,"error",{signal:e});throw r};var D7=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),mc=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let i=n.get(e),s=rn();return i.push(s),{resolve:s.resolve.bind(s),promises:i}},Ko=async({resolve:t,promises:e},r)=>{t();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...e])]);return!n};var x7=require("node:stream"),y7=require("node:util");var u1=require("node:stream/promises");var c1=async t=>{if(t!==void 0)try{await l1(t)}catch{}},g7=async t=>{if(t!==void 0)try{await f1(t)}catch{}},l1=async t=>{await(0,u1.finished)(t,{cleanup:!0,readable:!1,writable:!0})},f1=async t=>{await(0,u1.finished)(t,{cleanup:!0,readable:!0,writable:!1})},e0=async(t,e)=>{if(await t,e)throw e},t0=(t,e,r)=>{r&&!Qh(r)?t.destroy(r):e&&t.destroy()};var b7=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:i=!0,preserveNewlines:s=!0}={})=>{let o=i||Vt.has(r),{subprocessStdout:a,waitReadableDestroy:u}=h1(t,n,e),{readableEncoding:c,readableObjectMode:l,readableHighWaterMark:f}=d1(a,o),{read:h,onStdoutDataDone:d}=p1({subprocessStdout:a,subprocess:t,binary:o,encoding:r,preserveNewlines:s}),p=new x7.Readable({read:h,destroy:(0,y7.callbackify)(D1.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:u})),highWaterMark:f,objectMode:l,encoding:c});return m1({subprocessStdout:a,onStdoutDataDone:d,readable:p,subprocess:t}),p},h1=(t,e,r)=>{let n=$o(t,e),i=mc(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:i}},d1=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:i1},p1=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:i})=>{let s=rn(),o=Xh({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:i});return{read(){wJ(this,o,s)},onStdoutDataDone:s}},wJ=async(t,e,r)=>{try{let{value:n,done:i}=await e.next();i?r.resolve():t.push(n)}catch{}},m1=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:i})=>{try{await f1(t),await n,await c1(i),await e,r.readable&&r.push(null)}catch(s){await c1(i),F7(r,s)}},D1=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await Ko(r,e)&&(F7(t,n),await e0(e,n))},F7=(t,e)=>{t0(t,t.readable,e)};var E7=require("node:stream"),g1=require("node:util");var C7=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:s}=x1(t,r,e),o=new E7.Writable({...y1(n,t,i),destroy:(0,g1.callbackify)(F1.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:i,waitWritableDestroy:s})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return b1(n,o),o},x1=(t,e,r)=>{let n=hh(t,e),i=mc(r,n,"writableFinal"),s=mc(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:s}},y1=(t,e,r)=>({write:SJ.bind(void 0,t),final:(0,g1.callbackify)(vJ.bind(void 0,t,e,r))}),SJ=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},vJ=async(t,e,r)=>{await Ko(r,e)&&(t.writable&&t.end(),await e)},b1=async(t,e,r)=>{try{await l1(t),e.writable&&e.end()}catch(n){await g7(r),w7(e,n)}},F1=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},i)=>{await Ko(r,e),await Ko(n,e)&&(w7(t,i),await e0(e,i))},w7=(t,e)=>{t0(t,t.writable,e)};var S7=require("node:stream"),v7=require("node:util");var _7=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:i,binary:s=!0,preserveNewlines:o=!0}={})=>{let a=s||Vt.has(r),{subprocessStdout:u,waitReadableDestroy:c}=h1(t,n,e),{subprocessStdin:l,waitWritableFinal:f,waitWritableDestroy:h}=x1(t,i,e),{readableEncoding:d,readableObjectMode:p,readableHighWaterMark:m}=d1(u,a),{read:x,onStdoutDataDone:D}=p1({subprocessStdout:u,subprocess:t,binary:a,encoding:r,preserveNewlines:o}),y=new S7.Duplex({read:x,...y1(l,t,f),destroy:(0,v7.callbackify)(_J.bind(void 0,{subprocessStdout:u,subprocessStdin:l,subprocess:t,waitReadableDestroy:c,waitWritableFinal:f,waitWritableDestroy:h})),readableHighWaterMark:m,writableHighWaterMark:l.writableHighWaterMark,readableObjectMode:p,writableObjectMode:l.writableObjectMode,encoding:d});return m1({subprocessStdout:u,onStdoutDataDone:D,readable:y,subprocess:t,subprocessStdin:l}),b1(l,y,u),y},_J=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:i,waitWritableDestroy:s},o)=>{await Promise.all([D1({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},o),F1({subprocessStdin:e,subprocess:r,waitWritableFinal:i,waitWritableDestroy:s},o)])};var E1=(t,e,{from:r,binary:n=!1,preserveNewlines:i=!1}={})=>{let s=n||Vt.has(e),o=$o(t,r),a=Xh({subprocessStdout:o,subprocess:t,binary:s,shouldEncode:!0,encoding:e,preserveNewlines:i});return AJ(a,o,t)},AJ=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}};var A7=(t,{encoding:e})=>{let r=D7();t.readable=b7.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=C7.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=_7.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=E1.bind(void 0,t,e),t[Symbol.asyncIterator]=E1.bind(void 0,t,e,{})};var B7=(t,e)=>{for(let[r,n]of TJ){let i=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}},BJ=(async()=>{})().constructor.prototype,TJ=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(BJ,t)]);var O7=(t,e,r,n)=>{let{file:i,commandArguments:s,command:o,escapedCommand:a,startTime:u,verboseInfo:c,options:l,fileDescriptors:f}=kJ(t,e,r),{subprocess:h,promise:d}=PJ({file:i,commandArguments:s,options:l,startTime:u,verboseInfo:c,command:o,escapedCommand:a,fileDescriptors:f});return h.pipe=Jh.bind(void 0,{source:h,sourcePromise:d,boundOptions:{},createNested:n}),B7(h,d),nn.set(h,{options:l,fileDescriptors:f}),h},kJ=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:s,verboseInfo:o}=ih(t,e,r),{file:a,commandArguments:u,options:c}=wh(t,e,r),l=OJ(c),f=R5(l,o);return{file:a,commandArguments:u,command:n,escapedCommand:i,startTime:s,verboseInfo:o,options:l,fileDescriptors:f}},OJ=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:t}},PJ=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:i,command:s,escapedCommand:o,fileDescriptors:a})=>{let u;try{u=(0,k7.spawn)(...Sh(t,e,r))}catch(p){return k5({error:p,command:s,escapedCommand:o,fileDescriptors:a,options:r,startTime:n,verboseInfo:i})}let c=new AbortController;(0,T7.setMaxListeners)(Number.POSITIVE_INFINITY,c.signal);let l=[...u.stdio];j5(u,a,c),q5(u,r,c);let f={},h=rn();u.kill=H_.bind(void 0,{kill:u.kill.bind(u),options:r,onInternalError:h,context:f,controller:c}),u.all=u7(u,r),A7(u,r),_5(u,r);let d=RJ({subprocess:u,options:r,startTime:n,verboseInfo:i,fileDescriptors:a,originalStreams:l,command:s,escapedCommand:o,context:f,onInternalError:h,controller:c});return{subprocess:u,promise:d}},RJ=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:i,originalStreams:s,command:o,escapedCommand:a,context:u,onInternalError:c,controller:l})=>{let[f,[h,d],p,m,x]=await m7({subprocess:t,options:e,context:u,verboseInfo:n,fileDescriptors:i,originalStreams:s,onInternalError:c,controller:l});l.abort(),c.resolve();let D=p.map((C,_)=>Ln(C,e,_)),y=Ln(m,e,"all"),b=IJ({errorInfo:f,exitCode:h,signal:d,stdio:D,all:y,ipcOutput:x,context:u,options:e,command:o,escapedCommand:a,startTime:r});return Ho(b,n,e)},IJ=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:s,context:o,options:a,command:u,escapedCommand:c,startTime:l})=>"error"in t?ac({error:t.error,command:u,escapedCommand:c,timedOut:o.terminationReason==="timeout",isCanceled:o.terminationReason==="cancel"||o.terminationReason==="gracefulCancel",isGracefullyCanceled:o.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof sn,isForcefullyTerminated:o.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:s,options:a,startTime:l,isSync:!1}):Rh({command:u,escapedCommand:c,stdio:n,all:i,ipcOutput:s,options:a,startTime:l});var r0=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,i])=>[n,MJ(n,t[n],i)]));return{...t,...r}},MJ=(t,e,r)=>LJ.has(t)&&je(e)&&je(r)?{...e,...r}:r,LJ=new Set(["env",...Zx]);var pi=(t,e,r,n)=>{let i=(o,a,u)=>pi(o,a,r,u),s=(...o)=>NJ({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:i},...o);return n!==void 0&&n(s,i,e),s},NJ=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:i},s,...o)=>{if(je(s))return i(t,r0(r,s),n);let{file:a,commandArguments:u,options:c,isSync:l}=$J({mapArguments:t,firstArgument:s,nextArguments:o,deepOptions:e,boundOptions:r});return l?C5(a,u,c):O7(a,u,c,i)},$J=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:i})=>{let s=fv(e)?hv(e,r):[e,...r],[o,a,u]=Vf(...s),c=r0(r0(n,i),u),{file:l=o,commandArguments:f=a,options:h=c,isSync:d=!1}=t({file:o,commandArguments:a,options:c});return{file:l,commandArguments:f,options:h,isSync:d}};var P7=({file:t,commandArguments:e})=>I7(t,e),R7=({file:t,commandArguments:e})=>({...I7(t,e),isSync:!0}),I7=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...n]=jJ(t);return{file:r,commandArguments:n}},jJ=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return[];let r=[];for(let n of e.split(UJ)){let i=r.at(-1);i&&i.endsWith("\\")?r[r.length-1]=`${i.slice(0,-1)} ${n}`:r.push(n)}return r},UJ=/ +/g;var M7=(t,e,r)=>{t.sync=e(qJ,r),t.s=t.sync},L7=({options:t})=>N7(t),qJ=({options:t})=>({...N7(t),isSync:!0}),N7=t=>({options:{...HJ(t),...t}}),HJ=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},$7={preferLocal:!0};var j7=pi(()=>({})),n0=pi(()=>({isSync:!0})),J8e=pi(P7),X8e=pi(R7),Q8e=pi(R4),eSe=pi(L7,{},$7,M7),{sendMessage:tSe,getOneMessage:rSe,getEachMessage:nSe,getCancelSignal:iSe}=A5();function C1(t,e){if(t.length===0)return"No entries to display.";let r=e?.title||"Benchmark Results",n=e?.footer||"",i=e?.maxBarWidth||50,s=e?.unit||"",o=Math.max(...t.map(u=>u.value)),a=[];a.push(""),a.push(r),a.push("");for(let u of t){let c=WJ(u.barColor??e?.barColor),l=GJ(u,o,i,c,s,e?.labelColor);a.push(l)}return n&&(a.push(""),a.push(n)),a.join(`
|
|
185
185
|
`)}function WJ(t){return t?E[t]("\u2587"):"\u2587"}function GJ(t,e,r,n,i,s){let o=Math.round(t.value/e*r),a=t.barColor?E[t.barColor](n.repeat(o)):n.repeat(o),u=t.color??s;return`${E.bold(u?E[u](t.label.padEnd(12)):t.label.padEnd(12))} ${a} ${t.value.toLocaleString()}${i?` ${i}`:""}`}var H={logs:[],breakLine:()=>(console.log(),H),success:(t,...e)=>(console.log(E.green(`\u2714 ${t}`),...e),H),info:(t,...e)=>(console.log(E.cyan(`\u{1F6C8} ${t}`),...e),H),warn:(t,...e)=>(console.warn(E.yellow(`\u26A0\uFE0E ${t}`),...e),H),error:(t,...e)=>(console.error(E.red(`\u2716 ${t}`),...e),H),log:(t,...e)=>(console.log(t,...e),H.logs.push({message:t,context:e.join()}),H),getStoredLogs:t=>t?H.logs.filter(e=>e.context?.includes(t)):H.logs,storeLog:(t,e)=>H.logs.push({message:t,context:e})};function mi(t){let e=new ut(t.name).description(E.bold(t.description)).showHelpAfterError();return t.arguments?.map(([r,n])=>e.argument(r,n)),t.options?.map(([r,n])=>e.option(r,n)),t.exampleUsage&&e.addHelpText("after",()=>`${E.cyan.bold(`
|
|
186
186
|
Example:`)}
|
|
187
187
|
${E.bold(t.exampleUsage)}
|
|
188
188
|
`),t.additionalInfo&&e.addHelpText("after",()=>(typeof t.additionalInfo=="function"?t.additionalInfo():t.additionalInfo)??""),e.action(async(...r)=>{try{let n=r.at(-1),i=n.args,s=n.opts(),o=VJ(t.arguments??[],i);if(t.shouldSkipWorkflow?.(o,s)){await t.onSkipWorkflow?.(o,s);return}let a=await t.buildContext(o,s);t.prompts?.length&&await new Su(U7(t.prompts,a),{rendererOptions:{lazy:!0,showErrorMessage:!1}}).run(a),await new Su(U7(t.actions,a),{rendererOptions:{lazy:!1,showErrorMessage:!1,clearOutput:!0}}).run(a),await t.onComplete?.(a)}catch(n){let i=n;H.error(i.message)}}),e}function VJ(t,e){let r={};return t.forEach(([n],i)=>{let s=n.replace(/[<>[\]]/g,"");r[s]=e[i]}),r}function U7(t,e){return t.map(r=>typeof r=="function"?r(e):r)}function q7(t,e,r){let n=e.split("."),i=t;for(;n.length>1;){let s=n.shift();s in i||(i[s]={}),i=i[s]}i[n[0]]=r}function Dc(t){try{return n0(t,["--version"]),!0}catch{return!1}}var _i=require("node:path"),hk=P(wc());var HB=P(require("node:process"),1);var $B=P(require("node:process"),1);var jB=require("node:url"),UB=P(require("node:fs"),1),Fs=P(require("node:path"),1),NB=t=>t instanceof URL?(0,jB.fileURLToPath)(t):t;function qB(t,{cwd:e=$B.default.cwd(),type:r="file",stopAt:n}={}){let i=Fs.default.resolve(NB(e)??""),{root:s}=Fs.default.parse(i);n=Fs.default.resolve(i,NB(n)??s);let o=Fs.default.isAbsolute(t);for(;i;){let a=o?t:Fs.default.join(i,t);try{let u=UB.default.statSync(a,{throwIfNoEntry:!1});if(r==="file"&&u?.isFile()||r==="directory"&&u?.isDirectory())return a}catch{}if(i===n||i===s)break;i=Fs.default.dirname(i)}}function N1({cwd:t=HB.default.cwd()}={}){return qB("package.json",{cwd:t})}var $1=(t,e,r)=>{let n=t instanceof RegExp?WB(t,r):t,i=e instanceof RegExp?WB(e,r):e,s=n!==null&&i!=null&&YQ(n,i,r);return s&&{start:s[0],end:s[1],pre:r.slice(0,s[0]),body:r.slice(s[0]+n.length,s[1]),post:r.slice(s[1]+i.length)}},WB=(t,e)=>{let r=e.match(t);return r?r[0]:null},YQ=(t,e,r)=>{let n,i,s,o,a,u=r.indexOf(t),c=r.indexOf(e,u+1),l=u;if(u>=0&&c>0){if(t===e)return[u,c];for(n=[],s=r.length;l>=0&&!a;){if(l===u)n.push(l),u=r.indexOf(t,l+1);else if(n.length===1){let f=n.pop();f!==void 0&&(a=[f,c])}else i=n.pop(),i!==void 0&&i<s&&(s=i,o=c),c=r.indexOf(e,l+1);l=u<c&&u>=0?u:c}n.length&&o!==void 0&&(a=[s,o])}return a};var GB="\0SLASH"+Math.random()+"\0",VB="\0OPEN"+Math.random()+"\0",U1="\0CLOSE"+Math.random()+"\0",zB="\0COMMA"+Math.random()+"\0",KB="\0PERIOD"+Math.random()+"\0",ZQ=new RegExp(GB,"g"),JQ=new RegExp(VB,"g"),XQ=new RegExp(U1,"g"),QQ=new RegExp(zB,"g"),eee=new RegExp(KB,"g"),tee=/\\\\/g,ree=/\\{/g,nee=/\\}/g,iee=/\\,/g,see=/\\./g;function j1(t){return isNaN(t)?t.charCodeAt(0):parseInt(t,10)}function oee(t){return t.replace(tee,GB).replace(ree,VB).replace(nee,U1).replace(iee,zB).replace(see,KB)}function aee(t){return t.replace(ZQ,"\\").replace(JQ,"{").replace(XQ,"}").replace(QQ,",").replace(eee,".")}function YB(t){if(!t)return[""];let e=[],r=$1("{","}",t);if(!r)return t.split(",");let{pre:n,body:i,post:s}=r,o=n.split(",");o[o.length-1]+="{"+i+"}";let a=YB(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function ZB(t){return t?(t.slice(0,2)==="{}"&&(t="\\{\\}"+t.slice(2)),Sc(oee(t),!0).map(aee)):[]}function uee(t){return"{"+t+"}"}function cee(t){return/^-?0\d/.test(t)}function lee(t,e){return t<=e}function fee(t,e){return t>=e}function Sc(t,e){let r=[],n=$1("{","}",t);if(!n)return[t];let i=n.pre,s=n.post.length?Sc(n.post,!1):[""];if(/\$$/.test(n.pre))for(let o=0;o<s.length;o++){let a=i+"{"+n.body+"}"+s[o];r.push(a)}else{let o=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),a=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),u=o||a,c=n.body.indexOf(",")>=0;if(!u&&!c)return n.post.match(/,(?!,).*\}/)?(t=n.pre+"{"+n.body+U1+n.post,Sc(t)):[t];let l;if(u)l=n.body.split(/\.\./);else if(l=YB(n.body),l.length===1&&l[0]!==void 0&&(l=Sc(l[0],!1).map(uee),l.length===1))return s.map(h=>n.pre+l[0]+h);let f;if(u&&l[0]!==void 0&&l[1]!==void 0){let h=j1(l[0]),d=j1(l[1]),p=Math.max(l[0].length,l[1].length),m=l.length===3&&l[2]!==void 0?Math.abs(j1(l[2])):1,x=lee;d<h&&(m*=-1,x=fee);let y=l.some(cee);f=[];for(let b=h;x(b,d);b+=m){let C;if(a)C=String.fromCharCode(b),C==="\\"&&(C="");else if(C=String(b),y){let _=p-C.length;if(_>0){let T=new Array(_+1).join("0");b<0?C="-"+T+C.slice(1):C=T+C}}f.push(C)}}else{f=[];for(let h=0;h<l.length;h++)f.push.apply(f,Sc(l[h],!1))}for(let h=0;h<f.length;h++)for(let d=0;d<s.length;d++){let p=i+f[h]+s[d];(!e||u||p)&&r.push(p)}}return r}var vc=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")};var hee={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},_c=t=>t.replace(/[[\]\\-]/g,"\\$&"),dee=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),JB=t=>t.join(""),XB=(t,e)=>{let r=e;if(t.charAt(r)!=="[")throw new Error("not in a brace expression");let n=[],i=[],s=r+1,o=!1,a=!1,u=!1,c=!1,l=r,f="";e:for(;s<t.length;){let m=t.charAt(s);if((m==="!"||m==="^")&&s===r+1){c=!0,s++;continue}if(m==="]"&&o&&!u){l=s+1;break}if(o=!0,m==="\\"&&!u){u=!0,s++;continue}if(m==="["&&!u){for(let[x,[D,y,b]]of Object.entries(hee))if(t.startsWith(x,s)){if(f)return["$.",!1,t.length-r,!0];s+=x.length,b?i.push(D):n.push(D),a=a||y;continue e}}if(u=!1,f){m>f?n.push(_c(f)+"-"+_c(m)):m===f&&n.push(_c(m)),f="",s++;continue}if(t.startsWith("-]",s+1)){n.push(_c(m+"-")),s+=2;continue}if(t.startsWith("-",s+1)){f=m,s+=2;continue}n.push(_c(m)),s++}if(l<s)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,t.length-r,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!c){let m=n[0].length===2?n[0].slice(-1):n[0];return[dee(m),!1,l-r,!1]}let h="["+(c?"^":"")+JB(n)+"]",d="["+(c?"":"^")+JB(i)+"]";return[n.length&&i.length?"("+h+"|"+d+")":n.length?h:d,a,l-r,!0]};var jr=(t,{windowsPathsNoEscape:e=!1,magicalBraces:r=!0}={})=>r?e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):e?t.replace(/\[([^\/\\{}])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1");var pee=new Set(["!","?","+","*","@"]),QB=t=>pee.has(t),mee="(?!(?:^|/)\\.\\.?(?:$|/))",p0="(?!\\.)",Dee=new Set(["[","."]),gee=new Set(["..","."]),xee=new Set("().*{}+?[]^$\\!"),yee=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),q1="[^/]",eT=q1+"*?",tT=q1+"+?",ea=class t{type;#e;#r;#t=!1;#n=[];#o;#a;#f;#u=!1;#c;#m;#h=!1;constructor(e,r,n={}){this.type=e,e&&(this.#r=!0),this.#o=r,this.#e=this.#o?this.#o.#e:this,this.#c=this.#e===this?n:this.#e.#c,this.#f=this.#e===this?[]:this.#e.#f,e==="!"&&!this.#e.#u&&this.#f.push(this),this.#a=this.#o?this.#o.#n.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let e of this.#n)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#m!==void 0?this.#m:this.type?this.#m=this.type+"("+this.#n.map(e=>String(e)).join("|")+")":this.#m=this.#n.map(e=>String(e)).join("")}#l(){if(this!==this.#e)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let e;for(;e=this.#f.pop();){if(e.type!=="!")continue;let r=e,n=r.#o;for(;n;){for(let i=r.#a+1;!n.type&&i<n.#n.length;i++)for(let s of e.#n){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(n.#n[i])}r=n,n=r.#o}}return this}push(...e){for(let r of e)if(r!==""){if(typeof r!="string"&&!(r instanceof t&&r.#o===this))throw new Error("invalid part: "+r);this.#n.push(r)}}toJSON(){let e=this.type===null?this.#n.slice().map(r=>typeof r=="string"?r:r.toJSON()):[this.type,...this.#n.map(r=>r.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#u&&this.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#o?.isStart())return!1;if(this.#a===0)return!0;let e=this.#o;for(let r=0;r<this.#a;r++){let n=e.#n[r];if(!(n instanceof t&&n.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#o?.type==="!")return!0;if(!this.#o?.isEnd())return!1;if(!this.type)return this.#o?.isEnd();let e=this.#o?this.#o.#n.length:0;return this.#a===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let r=new t(this.type,e);for(let n of this.#n)r.copyIn(n);return r}static#i(e,r,n,i){let s=!1,o=!1,a=-1,u=!1;if(r.type===null){let d=n,p="";for(;d<e.length;){let m=e.charAt(d++);if(s||m==="\\"){s=!s,p+=m;continue}if(o){d===a+1?(m==="^"||m==="!")&&(u=!0):m==="]"&&!(d===a+2&&u)&&(o=!1),p+=m;continue}else if(m==="["){o=!0,a=d,u=!1,p+=m;continue}if(!i.noext&&QB(m)&&e.charAt(d)==="("){r.push(p),p="";let x=new t(m,r);d=t.#i(e,x,d,i),r.push(x);continue}p+=m}return r.push(p),d}let c=n+1,l=new t(null,r),f=[],h="";for(;c<e.length;){let d=e.charAt(c++);if(s||d==="\\"){s=!s,h+=d;continue}if(o){c===a+1?(d==="^"||d==="!")&&(u=!0):d==="]"&&!(c===a+2&&u)&&(o=!1),h+=d;continue}else if(d==="["){o=!0,a=c,u=!1,h+=d;continue}if(QB(d)&&e.charAt(c)==="("){l.push(h),h="";let p=new t(d,l);l.push(p),c=t.#i(e,p,c,i);continue}if(d==="|"){l.push(h),h="",f.push(l),l=new t(null,r);continue}if(d===")")return h===""&&r.#n.length===0&&(r.#h=!0),l.push(h),h="",r.push(...f,l),c;h+=d}return r.type=null,r.#r=void 0,r.#n=[e.substring(n-1)],c}static fromGlob(e,r={}){let n=new t(null,void 0,r);return t.#i(e,n,0,r),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[r,n,i,s]=this.toRegExpSource();if(!(i||this.#r||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#c.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${r}$`,a),{_src:r,_glob:e})}get options(){return this.#c}toRegExpSource(e){let r=e??!!this.#c.dot;if(this.#e===this&&this.#l(),!this.type){let u=this.isStart()&&this.isEnd()&&!this.#n.some(d=>typeof d!="string"),c=this.#n.map(d=>{let[p,m,x,D]=typeof d=="string"?t.#D(d,this.#r,u):d.toRegExpSource(e);return this.#r=this.#r||x,this.#t=this.#t||D,p}).join(""),l="";if(this.isStart()&&typeof this.#n[0]=="string"&&!(this.#n.length===1&&gee.has(this.#n[0]))){let p=Dee,m=r&&p.has(c.charAt(0))||c.startsWith("\\.")&&p.has(c.charAt(2))||c.startsWith("\\.\\.")&&p.has(c.charAt(4)),x=!r&&!e&&p.has(c.charAt(0));l=m?mee:x?p0:""}let f="";return this.isEnd()&&this.#e.#u&&this.#o?.type==="!"&&(f="(?:$|\\/)"),[l+c+f,jr(c),this.#r=!!this.#r,this.#t]}let n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#x(r);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let u=this.toString();return this.#n=[u],this.type=null,this.#r=void 0,[u,jr(this.toString()),!1,!1]}let o=!n||e||r||!p0?"":this.#x(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#h)a=(this.isStart()&&!r?p0:"")+tT;else{let u=this.type==="!"?"))"+(this.isStart()&&!r&&!e?p0:"")+eT+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+u}return[a,jr(s),this.#r=!!this.#r,this.#t]}#x(e){return this.#n.map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");let[n,i,s,o]=r.toRegExpSource(e);return this.#t=this.#t||o,n}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")}static#D(e,r,n=!1){let i=!1,s="",o=!1;for(let a=0;a<e.length;a++){let u=e.charAt(a);if(i){i=!1,s+=(xee.has(u)?"\\":"")+u;continue}if(u==="\\"){a===e.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[c,l,f,h]=XB(e,a);if(f){s+=c,o=o||l,a+=f-1,r=r||h;continue}}if(u==="*"){s+=n&&e==="*"?tT:eT,r=!0;continue}if(u==="?"){s+=q1,r=!0;continue}s+=yee(u)}return[s,jr(e),!!r,o]}};var ta=(t,{windowsPathsNoEscape:e=!1,magicalBraces:r=!1}={})=>r?e?t.replace(/[?*()[\]{}]/g,"[$&]"):t.replace(/[?*()[\]\\{}]/g,"\\$&"):e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");var Bt=(t,e,r={})=>(vc(e),!r.nocomment&&e.charAt(0)==="#"?!1:new zt(e,r).match(t)),bee=/^\*+([^+@!?\*\[\(]*)$/,Fee=t=>e=>!e.startsWith(".")&&e.endsWith(t),Eee=t=>e=>e.endsWith(t),Cee=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),wee=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),See=/^\*+\.\*+$/,vee=t=>!t.startsWith(".")&&t.includes("."),_ee=t=>t!=="."&&t!==".."&&t.includes("."),Aee=/^\.\*+$/,Bee=t=>t!=="."&&t!==".."&&t.startsWith("."),Tee=/^\*+$/,kee=t=>t.length!==0&&!t.startsWith("."),Oee=t=>t.length!==0&&t!=="."&&t!=="..",Pee=/^\?+([^+@!?\*\[\(]*)?$/,Ree=([t,e=""])=>{let r=iT([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},Iee=([t,e=""])=>{let r=sT([t]);return e?(e=e.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(e)):r},Mee=([t,e=""])=>{let r=sT([t]);return e?n=>r(n)&&n.endsWith(e):r},Lee=([t,e=""])=>{let r=iT([t]);return e?n=>r(n)&&n.endsWith(e):r},iT=([t])=>{let e=t.length;return r=>r.length===e&&!r.startsWith(".")},sT=([t])=>{let e=t.length;return r=>r.length===e&&r!=="."&&r!==".."},oT=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",rT={win32:{sep:"\\"},posix:{sep:"/"}},Nee=oT==="win32"?rT.win32.sep:rT.posix.sep;Bt.sep=Nee;var st=Symbol("globstar **");Bt.GLOBSTAR=st;var $ee="[^/]",jee=$ee+"*?",Uee="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",qee="(?:(?!(?:\\/|^)\\.).)*?",Hee=(t,e={})=>r=>Bt(r,t,e);Bt.filter=Hee;var mr=(t,e={})=>Object.assign({},t,e),Wee=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return Bt;let e=Bt;return Object.assign((n,i,s={})=>e(n,i,mr(t,s)),{Minimatch:class extends e.Minimatch{constructor(i,s={}){super(i,mr(t,s))}static defaults(i){return e.defaults(mr(t,i)).Minimatch}},AST:class extends e.AST{constructor(i,s,o={}){super(i,s,mr(t,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,mr(t,s))}},unescape:(n,i={})=>e.unescape(n,mr(t,i)),escape:(n,i={})=>e.escape(n,mr(t,i)),filter:(n,i={})=>e.filter(n,mr(t,i)),defaults:n=>e.defaults(mr(t,n)),makeRe:(n,i={})=>e.makeRe(n,mr(t,i)),braceExpand:(n,i={})=>e.braceExpand(n,mr(t,i)),match:(n,i,s={})=>e.match(n,i,mr(t,s)),sep:e.sep,GLOBSTAR:st})};Bt.defaults=Wee;var aT=(t,e={})=>(vc(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:ZB(t));Bt.braceExpand=aT;var Gee=(t,e={})=>new zt(t,e).makeRe();Bt.makeRe=Gee;var Vee=(t,e,r={})=>{let n=new zt(e,r);return t=t.filter(i=>n.match(i)),n.options.nonull&&!t.length&&t.push(e),t};Bt.match=Vee;var nT=/[?*]|[+@!]\(.*?\)|\[|\]/,zee=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),zt=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,r={}){vc(e),r=r||{},this.options=r,this.pattern=e,this.platform=r.platform||oT,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let r of e)if(typeof r!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,r=this.options;if(!r.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let u=s[0]===""&&s[1]===""&&(s[2]==="?"||!nT.test(s[2]))&&!nT.test(s[3]),c=/^[a-z]:/i.test(s[0]);if(u)return[...s.slice(0,4),...s.slice(4).map(l=>this.parse(l))];if(c)return[s[0],...s.slice(1).map(l=>this.parse(l))]}return s.map(u=>this.parse(u))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let n=0;n<e.length;n++)for(let i=0;i<e[n].length;i++)e[n][i]==="**"&&(e[n][i]="*");let{optimizationLevel:r=1}=this.options;return r>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):r>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(r=>{let n=-1;for(;(n=r.indexOf("**",n+1))!==-1;){let i=n;for(;r[i+1]==="**";)i++;i!==n&&r.splice(n,i-n)}return r})}levelOneOptimize(e){return e.map(r=>(r=r.reduce((n,i)=>{let s=n[n.length-1];return i==="**"&&s==="**"?n:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(n.pop(),n):(n.push(i),n)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let s=e[i];i===1&&s===""&&e[0]===""||(s==="."||s==="")&&(r=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(r=!0,e.pop())}let n=0;for(;(n=e.indexOf("..",n+1))!==-1;){let i=e[n-1];i&&i!=="."&&i!==".."&&i!=="**"&&(r=!0,e.splice(n-1,2),n-=2)}}while(r);return e.length===0?[""]:e}firstPhasePreProcess(e){let r=!1;do{r=!1;for(let n of e){let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let o=i;for(;n[o+1]==="**";)o++;o>i&&n.splice(i+1,o-i);let a=n[i+1],u=n[i+2],c=n[i+3];if(a!==".."||!u||u==="."||u===".."||!c||c==="."||c==="..")continue;r=!0,n.splice(i,1);let l=n.slice(0);l[i]="**",e.push(l),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<n.length-1;o++){let a=n[o];o===1&&a===""&&n[0]===""||(a==="."||a==="")&&(r=!0,n.splice(o,1),o--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(r=!0,n.pop())}let s=0;for(;(s=n.indexOf("..",s+1))!==-1;){let o=n[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){r=!0;let u=s===1&&n[s+1]==="**"?["."]:[];n.splice(s-1,2,...u),n.length===0&&n.push(""),s-=2}}}}while(r);return e}secondPhasePreProcess(e){for(let r=0;r<e.length-1;r++)for(let n=r+1;n<e.length;n++){let i=this.partsMatch(e[r],e[n],!this.preserveMultipleSlashes);if(i){e[r]=[],e[n]=i;break}}return e.filter(r=>r.length)}partsMatch(e,r,n=!1){let i=0,s=0,o=[],a="";for(;i<e.length&&s<r.length;)if(e[i]===r[s])o.push(a==="b"?r[s]:e[i]),i++,s++;else if(n&&e[i]==="**"&&r[s]===e[i+1])o.push(e[i]),i++;else if(n&&r[s]==="**"&&e[i]===r[s+1])o.push(r[s]),s++;else if(e[i]==="*"&&r[s]&&(this.options.dot||!r[s].startsWith("."))&&r[s]!=="**"){if(a==="b")return!1;a="a",o.push(e[i]),i++,s++}else if(r[s]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(a==="a")return!1;a="b",o.push(r[s]),i++,s++}else return!1;return e.length===r.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,r=!1,n=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)r=!r,n++;n&&(this.pattern=e.slice(n)),this.negate=r}matchOne(e,r,n=!1){let i=this.options;if(this.isWindows){let m=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),x=!m&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),D=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),y=!D&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),b=x?3:m?0:void 0,C=y?3:D?0:void 0;if(typeof b=="number"&&typeof C=="number"){let[_,T]=[e[b],r[C]];_.toLowerCase()===T.toLowerCase()&&(r[C]=_,C>b?r=r.slice(C):b>C&&(e=e.slice(b)))}}let{optimizationLevel:s=1}=this.options;s>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:r}),this.debug("matchOne",e.length,r.length);for(var o=0,a=0,u=e.length,c=r.length;o<u&&a<c;o++,a++){this.debug("matchOne loop");var l=r[a],f=e[o];if(this.debug(r,l,f),l===!1)return!1;if(l===st){this.debug("GLOBSTAR",[r,l,f]);var h=o,d=a+1;if(d===c){for(this.debug("** at the end");o<u;o++)if(e[o]==="."||e[o]===".."||!i.dot&&e[o].charAt(0)===".")return!1;return!0}for(;h<u;){var p=e[h];if(this.debug(`
|
|
189
189
|
globstar while`,e,h,r,d,p),this.matchOne(e.slice(h),r.slice(d),n))return this.debug("globstar found match!",h,u,p),!0;if(p==="."||p===".."||!i.dot&&p.charAt(0)==="."){this.debug("dot detected!",e,h,r,d);break}this.debug("globstar swallow a segment, and continue"),h++}return!!(n&&(this.debug(`
|
|
190
|
-
>>> no match, partial?`,e,h,r,d),h===u))}let m;if(typeof l=="string"?(m=f===l,this.debug("string match",l,f,m)):(m=l.test(f),this.debug("pattern match",l,f,m)),!m)return!1}if(o===u&&a===c)return!0;if(o===u)return n;if(a===c)return o===u-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return aT(this.pattern,this.options)}parse(e){vc(e);let r=this.options;if(e==="**")return st;if(e==="")return"";let n,i=null;(n=e.match(Tee))?i=r.dot?Oee:kee:(n=e.match(bee))?i=(r.nocase?r.dot?wee:Cee:r.dot?Eee:Fee)(n[1]):(n=e.match(Pee))?i=(r.nocase?r.dot?Iee:Ree:r.dot?Mee:Lee)(n):(n=e.match(See))?i=r.dot?_ee:vee:(n=e.match(Aee))&&(i=Bee);let s=ea.fromGlob(e,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let r=this.options,n=r.noglobstar?jee:r.dot?Uee:qee,i=new Set(r.nocase?["i"]:[]),s=e.map(u=>{let c=u.map(f=>{if(f instanceof RegExp)for(let h of f.flags.split(""))i.add(h);return typeof f=="string"?zee(f):f===st?st:f._src});c.forEach((f,h)=>{let d=c[h+1],p=c[h-1];f!==st||p===st||(p===void 0?d!==void 0&&d!==st?c[h+1]="(?:\\/|"+n+"\\/)?"+d:c[h]=n:d===void 0?c[h-1]=p+"(?:\\/|\\/"+n+")?":d!==st&&(c[h-1]=p+"(?:\\/|\\/"+n+"\\/)"+d,c[h+1]=st))});let l=c.filter(f=>f!==st);if(this.partial&&l.length>=1){let f=[];for(let h=1;h<=l.length;h++)f.push(l.slice(0,h).join("/"));return"(?:"+f.join("|")+")"}return l.join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+a+"$",this.partial&&(s="^(?:\\/|"+o+s.slice(1,-1)+a+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,r=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&r)return!0;let n=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let o=i[i.length-1];if(!o)for(let a=i.length-2;!o&&a>=0;a--)o=i[a];for(let a=0;a<s.length;a++){let u=s[a],c=i;if(n.matchBase&&u.length===1&&(c=[o]),this.matchOne(c,u,r))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return Bt.defaults(e).Minimatch}};Bt.AST=ea;Bt.Minimatch=zt;Bt.escape=ta;Bt.unescape=jr;var kT=require("node:url");var Kee=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,cT=new Set,H1=typeof process=="object"&&process?process:{},lT=(t,e,r,n)=>{typeof H1.emitWarning=="function"?H1.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},m0=globalThis.AbortController,uT=globalThis.AbortSignal;if(typeof m0>"u"){uT=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(n,i){this._onabort.push(i)}},m0=class{constructor(){e()}signal=new uT;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let i of this.signal._onabort)i(n);this.signal.onabort?.(n)}}};let t=H1.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,lT("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var Yee=t=>!cT.has(t),A3e=Symbol("type"),bi=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),fT=t=>bi(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?ra:null:null,ra=class extends Array{constructor(e){super(e),this.fill(0)}},W1=class t{heap;length;static#e=!1;static create(e){let r=fT(e);if(!r)return[];t.#e=!0;let n=new t(e,r);return t.#e=!1,n}constructor(e,r){if(!t.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Es=class t{#e;#r;#t;#n;#o;#a;#f;#u;get perf(){return this.#u}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#c;#m;#h;#l;#i;#x;#D;#p;#y;#w;#g;#S;#v;#b;#F;#E;#_;#s;#R;static unsafeExposeInternals(e){return{starts:e.#v,ttls:e.#b,autopurgeTimers:e.#F,sizes:e.#S,keyMap:e.#h,keyList:e.#l,valList:e.#i,next:e.#x,prev:e.#D,get head(){return e.#p},get tail(){return e.#y},free:e.#w,isBackgroundFetch:r=>e.#d(r),backgroundFetch:(r,n,i,s)=>e.#q(r,n,i,s),moveToTail:r=>e.#M(r),indexes:r=>e.#T(r),rindexes:r=>e.#k(r),isStale:r=>e.#C(r)}}get max(){return this.#e}get maxSize(){return this.#r}get calculatedSize(){return this.#m}get size(){return this.#c}get fetchMethod(){return this.#a}get memoMethod(){return this.#f}get dispose(){return this.#t}get onInsert(){return this.#n}get disposeAfter(){return this.#o}constructor(e){let{max:r=0,ttl:n,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:c,onInsert:l,disposeAfter:f,noDisposeOnSet:h,noUpdateTTL:d,maxSize:p=0,maxEntrySize:m=0,sizeCalculation:x,fetchMethod:D,memoMethod:y,noDeleteOnFetchRejection:b,noDeleteOnStaleGet:C,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:T,ignoreFetchAbort:B,perf:O}=e;if(O!==void 0&&typeof O?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#u=O??Kee,r!==0&&!bi(r))throw new TypeError("max option must be a nonnegative integer");let v=r?fT(r):Array;if(!v)throw new Error("invalid max value: "+r);if(this.#e=r,this.#r=p,this.maxEntrySize=m||this.#r,this.sizeCalculation=x,this.sizeCalculation){if(!this.#r&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(y!==void 0&&typeof y!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#f=y,D!==void 0&&typeof D!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#a=D,this.#_=!!D,this.#h=new Map,this.#l=new Array(r).fill(void 0),this.#i=new Array(r).fill(void 0),this.#x=new v(r),this.#D=new v(r),this.#p=0,this.#y=0,this.#w=W1.create(r),this.#c=0,this.#m=0,typeof c=="function"&&(this.#t=c),typeof l=="function"&&(this.#n=l),typeof f=="function"?(this.#o=f,this.#g=[]):(this.#o=void 0,this.#g=void 0),this.#E=!!this.#t,this.#R=!!this.#n,this.#s=!!this.#o,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!b,this.allowStaleOnFetchRejection=!!_,this.allowStaleOnFetchAbort=!!T,this.ignoreFetchAbort=!!B,this.maxEntrySize!==0){if(this.#r!==0&&!bi(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!bi(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#W()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!C,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=bi(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!bi(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#O()}if(this.#e===0&&this.ttl===0&&this.#r===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#r){let A="LRU_CACHE_UNBOUNDED";Yee(A)&&(cT.add(A),lT("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",A,t))}}getRemainingTTL(e){return this.#h.has(e)?1/0:0}#O(){let e=new ra(this.#e),r=new ra(this.#e);this.#b=e,this.#v=r;let n=this.ttlAutopurge?new Array(this.#e):void 0;this.#F=n,this.#N=(o,a,u=this.#u.now())=>{if(r[o]=a!==0?u:0,e[o]=a,n?.[o]&&(clearTimeout(n[o]),n[o]=void 0),a!==0&&n){let c=setTimeout(()=>{this.#C(o)&&this.#B(this.#l[o],"expire")},a+1);c.unref&&c.unref(),n[o]=c}},this.#A=o=>{r[o]=e[o]!==0?this.#u.now():0},this.#P=(o,a)=>{if(e[a]){let u=e[a],c=r[a];if(!u||!c)return;o.ttl=u,o.start=c,o.now=i||s();let l=o.now-c;o.remainingTTL=u-l}};let i=0,s=()=>{let o=this.#u.now();if(this.ttlResolution>0){i=o;let a=setTimeout(()=>i=0,this.ttlResolution);a.unref&&a.unref()}return o};this.getRemainingTTL=o=>{let a=this.#h.get(o);if(a===void 0)return 0;let u=e[a],c=r[a];if(!u||!c)return 1/0;let l=(i||s())-c;return u-l},this.#C=o=>{let a=r[o],u=e[o];return!!u&&!!a&&(i||s())-a>u}}#A=()=>{};#P=()=>{};#N=()=>{};#C=()=>!1;#W(){let e=new ra(this.#e);this.#m=0,this.#S=e,this.#L=r=>{this.#m-=e[r],e[r]=0},this.#$=(r,n,i,s)=>{if(this.#d(n))return 0;if(!bi(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(n,r),!bi(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#I=(r,n,i)=>{if(e[r]=n,this.#r){let s=this.#r-e[r];for(;this.#m>s;)this.#U(!0)}this.#m+=e[r],i&&(i.entrySize=n,i.totalCalculatedSize=this.#m)}}#L=e=>{};#I=(e,r,n)=>{};#$=(e,r,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#T({allowStale:e=this.allowStale}={}){if(this.#c)for(let r=this.#y;!(!this.#j(r)||((e||!this.#C(r))&&(yield r),r===this.#p));)r=this.#D[r]}*#k({allowStale:e=this.allowStale}={}){if(this.#c)for(let r=this.#p;!(!this.#j(r)||((e||!this.#C(r))&&(yield r),r===this.#y));)r=this.#x[r]}#j(e){return e!==void 0&&this.#h.get(this.#l[e])===e}*entries(){for(let e of this.#T())this.#i[e]!==void 0&&this.#l[e]!==void 0&&!this.#d(this.#i[e])&&(yield[this.#l[e],this.#i[e]])}*rentries(){for(let e of this.#k())this.#i[e]!==void 0&&this.#l[e]!==void 0&&!this.#d(this.#i[e])&&(yield[this.#l[e],this.#i[e]])}*keys(){for(let e of this.#T()){let r=this.#l[e];r!==void 0&&!this.#d(this.#i[e])&&(yield r)}}*rkeys(){for(let e of this.#k()){let r=this.#l[e];r!==void 0&&!this.#d(this.#i[e])&&(yield r)}}*values(){for(let e of this.#T())this.#i[e]!==void 0&&!this.#d(this.#i[e])&&(yield this.#i[e])}*rvalues(){for(let e of this.#k())this.#i[e]!==void 0&&!this.#d(this.#i[e])&&(yield this.#i[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let n of this.#T()){let i=this.#i[n],s=this.#d(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#l[n],this))return this.get(this.#l[n],r)}}forEach(e,r=this){for(let n of this.#T()){let i=this.#i[n],s=this.#d(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(r,s,this.#l[n],this)}}rforEach(e,r=this){for(let n of this.#k()){let i=this.#i[n],s=this.#d(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(r,s,this.#l[n],this)}}purgeStale(){let e=!1;for(let r of this.#k({allowStale:!0}))this.#C(r)&&(this.#B(this.#l[r],"expire"),e=!0);return e}info(e){let r=this.#h.get(e);if(r===void 0)return;let n=this.#i[r],i=this.#d(n)?n.__staleWhileFetching:n;if(i===void 0)return;let s={value:i};if(this.#b&&this.#v){let o=this.#b[r],a=this.#v[r];if(o&&a){let u=o-(this.#u.now()-a);s.ttl=u,s.start=Date.now()}}return this.#S&&(s.size=this.#S[r]),s}dump(){let e=[];for(let r of this.#T({allowStale:!0})){let n=this.#l[r],i=this.#i[r],s=this.#d(i)?i.__staleWhileFetching:i;if(s===void 0||n===void 0)continue;let o={value:s};if(this.#b&&this.#v){o.ttl=this.#b[r];let a=this.#u.now()-this.#v[r];o.start=Math.floor(Date.now()-a)}this.#S&&(o.size=this.#S[r]),e.unshift([n,o])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let i=Date.now()-n.start;n.start=this.#u.now()-i}this.set(r,n.value,n)}}set(e,r,n={}){if(r===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:u}=n,{noUpdateTTL:c=this.noUpdateTTL}=n,l=this.#$(e,r,n.size||0,a);if(this.maxEntrySize&&l>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#B(e,"set"),this;let f=this.#c===0?void 0:this.#h.get(e);if(f===void 0)f=this.#c===0?this.#y:this.#w.length!==0?this.#w.pop():this.#c===this.#e?this.#U(!1):this.#c,this.#l[f]=e,this.#i[f]=r,this.#h.set(e,f),this.#x[this.#y]=f,this.#D[f]=this.#y,this.#y=f,this.#c++,this.#I(f,l,u),u&&(u.set="add"),c=!1,this.#R&&this.#n?.(r,e,"add");else{this.#M(f);let h=this.#i[f];if(r!==h){if(this.#_&&this.#d(h)){h.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:d}=h;d!==void 0&&!o&&(this.#E&&this.#t?.(d,e,"set"),this.#s&&this.#g?.push([d,e,"set"]))}else o||(this.#E&&this.#t?.(h,e,"set"),this.#s&&this.#g?.push([h,e,"set"]));if(this.#L(f),this.#I(f,l,u),this.#i[f]=r,u){u.set="replace";let d=h&&this.#d(h)?h.__staleWhileFetching:h;d!==void 0&&(u.oldValue=d)}}else u&&(u.set="update");this.#R&&this.onInsert?.(r,e,r===h?"update":"replace")}if(i!==0&&!this.#b&&this.#O(),this.#b&&(c||this.#N(f,i,s),u&&this.#P(u,f)),!o&&this.#s&&this.#g){let h=this.#g,d;for(;d=h?.shift();)this.#o?.(...d)}return this}pop(){try{for(;this.#c;){let e=this.#i[this.#p];if(this.#U(!0),this.#d(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#s&&this.#g){let e=this.#g,r;for(;r=e?.shift();)this.#o?.(...r)}}}#U(e){let r=this.#p,n=this.#l[r],i=this.#i[r];return this.#_&&this.#d(i)?i.__abortController.abort(new Error("evicted")):(this.#E||this.#s)&&(this.#E&&this.#t?.(i,n,"evict"),this.#s&&this.#g?.push([i,n,"evict"])),this.#L(r),this.#F?.[r]&&(clearTimeout(this.#F[r]),this.#F[r]=void 0),e&&(this.#l[r]=void 0,this.#i[r]=void 0,this.#w.push(r)),this.#c===1?(this.#p=this.#y=0,this.#w.length=0):this.#p=this.#x[r],this.#h.delete(n),this.#c--,r}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=r,s=this.#h.get(e);if(s!==void 0){let o=this.#i[s];if(this.#d(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#C(s))i&&(i.has="stale",this.#P(i,s));else return n&&this.#A(s),i&&(i.has="hit",this.#P(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,i=this.#h.get(e);if(i===void 0||!n&&this.#C(i))return;let s=this.#i[i];return this.#d(s)?s.__staleWhileFetching:s}#q(e,r,n,i){let s=r===void 0?void 0:this.#i[r];if(this.#d(s))return s;let o=new m0,{signal:a}=n;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let u={signal:o.signal,options:n,context:i},c=(m,x=!1)=>{let{aborted:D}=o.signal,y=n.ignoreFetchAbort&&m!==void 0;if(n.status&&(D&&!x?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,y&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),D&&!y&&!x)return f(o.signal.reason);let b=d,C=this.#i[r];return(C===d||y&&x&&C===void 0)&&(m===void 0?b.__staleWhileFetching!==void 0?this.#i[r]=b.__staleWhileFetching:this.#B(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,m,u.options))),m},l=m=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=m),f(m)),f=m=>{let{aborted:x}=o.signal,D=x&&n.allowStaleOnFetchAbort,y=D||n.allowStaleOnFetchRejection,b=y||n.noDeleteOnFetchRejection,C=d;if(this.#i[r]===d&&(!b||C.__staleWhileFetching===void 0?this.#B(e,"fetch"):D||(this.#i[r]=C.__staleWhileFetching)),y)return n.status&&C.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),C.__staleWhileFetching;if(C.__returned===C)throw m},h=(m,x)=>{let D=this.#a?.(e,s,u);D&&D instanceof Promise&&D.then(y=>m(y===void 0?void 0:y),x),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(m(void 0),n.allowStaleOnFetchAbort&&(m=y=>c(y,!0)))})};n.status&&(n.status.fetchDispatched=!0);let d=new Promise(h).then(c,l),p=Object.assign(d,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.set(e,p,{...u.options,status:void 0}),r=this.#h.get(e)):this.#i[r]=p,p}#d(e){if(!this.#_)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof m0}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:u=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:x=!1,status:D,signal:y}=r;if(!this.#_)return D&&(D.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:D});let b={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:a,size:u,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:p,ignoreFetchAbort:d,status:D,signal:y},C=this.#h.get(e);if(C===void 0){D&&(D.fetch="miss");let _=this.#q(e,C,b,m);return _.__returned=_}else{let _=this.#i[C];if(this.#d(_)){let A=n&&_.__staleWhileFetching!==void 0;return D&&(D.fetch="inflight",A&&(D.returnedStale=!0)),A?_.__staleWhileFetching:_.__returned=_}let T=this.#C(C);if(!x&&!T)return D&&(D.fetch="hit"),this.#M(C),i&&this.#A(C),D&&this.#P(D,C),_;let B=this.#q(e,C,b,m),v=B.__staleWhileFetching!==void 0&&n;return D&&(D.fetch=T?"stale":"refresh",v&&T&&(D.returnedStale=!0)),v?B.__staleWhileFetching:B.__returned=B}}async forceFetch(e,r={}){let n=await this.fetch(e,r);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,r={}){let n=this.#f;if(!n)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:s,...o}=r,a=this.get(e,o);if(!s&&a!==void 0)return a;let u=n(e,a,{options:o,context:i});return this.set(e,u,o),u}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=r,a=this.#h.get(e);if(a!==void 0){let u=this.#i[a],c=this.#d(u);return o&&this.#P(o,a),this.#C(a)?(o&&(o.get="stale"),c?(o&&n&&u.__staleWhileFetching!==void 0&&(o.returnedStale=!0),n?u.__staleWhileFetching:void 0):(s||this.#B(e,"expire"),o&&n&&(o.returnedStale=!0),n?u:void 0)):(o&&(o.get="hit"),c?u.__staleWhileFetching:(this.#M(a),i&&this.#A(a),u))}else o&&(o.get="miss")}#H(e,r){this.#D[r]=e,this.#x[e]=r}#M(e){e!==this.#y&&(e===this.#p?this.#p=this.#x[e]:this.#H(this.#D[e],this.#x[e]),this.#H(this.#y,e),this.#y=e)}delete(e){return this.#B(e,"delete")}#B(e,r){let n=!1;if(this.#c!==0){let i=this.#h.get(e);if(i!==void 0)if(this.#F?.[i]&&(clearTimeout(this.#F?.[i]),this.#F[i]=void 0),n=!0,this.#c===1)this.#G(r);else{this.#L(i);let s=this.#i[i];if(this.#d(s)?s.__abortController.abort(new Error("deleted")):(this.#E||this.#s)&&(this.#E&&this.#t?.(s,e,r),this.#s&&this.#g?.push([s,e,r])),this.#h.delete(e),this.#l[i]=void 0,this.#i[i]=void 0,i===this.#y)this.#y=this.#D[i];else if(i===this.#p)this.#p=this.#x[i];else{let o=this.#D[i];this.#x[o]=this.#x[i];let a=this.#x[i];this.#D[a]=this.#D[i]}this.#c--,this.#w.push(i)}}if(this.#s&&this.#g?.length){let i=this.#g,s;for(;s=i?.shift();)this.#o?.(...s)}return n}clear(){return this.#G("delete")}#G(e){for(let r of this.#k({allowStale:!0})){let n=this.#i[r];if(this.#d(n))n.__abortController.abort(new Error("deleted"));else{let i=this.#l[r];this.#E&&this.#t?.(n,i,e),this.#s&&this.#g?.push([n,i,e])}}if(this.#h.clear(),this.#i.fill(void 0),this.#l.fill(void 0),this.#b&&this.#v){this.#b.fill(0),this.#v.fill(0);for(let r of this.#F??[])r!==void 0&&clearTimeout(r);this.#F?.fill(void 0)}if(this.#S&&this.#S.fill(0),this.#p=0,this.#y=0,this.#w.length=0,this.#m=0,this.#c=0,this.#s&&this.#g){let r=this.#g,n;for(;n=r?.shift();)this.#o?.(...n)}}};var sa=require("node:path"),FT=require("node:url"),fn=require("fs"),ste=P(require("node:fs"),1),Ci=require("node:fs/promises");var E0=require("node:events"),J1=P(require("node:stream"),1),DT=require("node:string_decoder"),hT=typeof process=="object"&&process?process:{stdout:null,stderr:null},Zee=t=>!!t&&typeof t=="object"&&(t instanceof Ei||t instanceof J1.default||Jee(t)||Xee(t)),Jee=t=>!!t&&typeof t=="object"&&t instanceof E0.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==J1.default.Writable.prototype.pipe,Xee=t=>!!t&&typeof t=="object"&&t instanceof E0.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function",jn=Symbol("EOF"),Un=Symbol("maybeEmitEnd"),Fi=Symbol("emittedEnd"),D0=Symbol("emittingEnd"),Ac=Symbol("emittedError"),g0=Symbol("closed"),dT=Symbol("read"),x0=Symbol("flush"),pT=Symbol("flushChunk"),Ur=Symbol("encoding"),na=Symbol("decoder"),Xe=Symbol("flowing"),Bc=Symbol("paused"),ia=Symbol("resume"),Qe=Symbol("buffer"),Tt=Symbol("pipes"),et=Symbol("bufferLength"),G1=Symbol("bufferPush"),y0=Symbol("bufferShift"),ht=Symbol("objectMode"),je=Symbol("destroyed"),V1=Symbol("error"),z1=Symbol("emitData"),mT=Symbol("emitEnd"),K1=Symbol("emitEnd2"),cn=Symbol("async"),Y1=Symbol("abort"),b0=Symbol("aborted"),Tc=Symbol("signal"),Cs=Symbol("dataListeners"),Kt=Symbol("discarded"),kc=t=>Promise.resolve().then(t),Qee=t=>t(),ete=t=>t==="end"||t==="finish"||t==="prefinish",tte=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,rte=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),F0=class{src;dest;opts;ondrain;constructor(e,r,n){this.src=e,this.dest=r,this.opts=n,this.ondrain=()=>e[ia](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Z1=class extends F0{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,r,n){super(e,r,n),this.proxyErrors=i=>r.emit("error",i),e.on("error",this.proxyErrors)}},nte=t=>!!t.objectMode,ite=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",Ei=class extends E0.EventEmitter{[Xe]=!1;[Bc]=!1;[Tt]=[];[Qe]=[];[ht];[Ur];[cn];[na];[jn]=!1;[Fi]=!1;[D0]=!1;[g0]=!1;[Ac]=null;[et]=0;[je]=!1;[Tc];[b0]=!1;[Cs]=0;[Kt]=!1;writable=!0;readable=!0;constructor(...e){let r=e[0]||{};if(super(),r.objectMode&&typeof r.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");nte(r)?(this[ht]=!0,this[Ur]=null):ite(r)?(this[Ur]=r.encoding,this[ht]=!1):(this[ht]=!1,this[Ur]=null),this[cn]=!!r.async,this[na]=this[Ur]?new DT.StringDecoder(this[Ur]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Qe]}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[Tt]});let{signal:n}=r;n&&(this[Tc]=n,n.aborted?this[Y1]():n.addEventListener("abort",()=>this[Y1]()))}get bufferLength(){return this[et]}get encoding(){return this[Ur]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[ht]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[cn]}set async(e){this[cn]=this[cn]||!!e}[Y1](){this[b0]=!0,this.emit("abort",this[Tc]?.reason),this.destroy(this[Tc]?.reason)}get aborted(){return this[b0]}set aborted(e){}write(e,r,n){if(this[b0])return!1;if(this[jn])throw new Error("write after end");if(this[je])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof r=="function"&&(n=r,r="utf8"),r||(r="utf8");let i=this[cn]?kc:Qee;if(!this[ht]&&!Buffer.isBuffer(e)){if(rte(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(tte(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[ht]?(this[Xe]&&this[et]!==0&&this[x0](!0),this[Xe]?this.emit("data",e):this[G1](e),this[et]!==0&&this.emit("readable"),n&&i(n),this[Xe]):e.length?(typeof e=="string"&&!(r===this[Ur]&&!this[na]?.lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[Ur]&&(e=this[na].write(e)),this[Xe]&&this[et]!==0&&this[x0](!0),this[Xe]?this.emit("data",e):this[G1](e),this[et]!==0&&this.emit("readable"),n&&i(n),this[Xe]):(this[et]!==0&&this.emit("readable"),n&&i(n),this[Xe])}read(e){if(this[je])return null;if(this[Kt]=!1,this[et]===0||e===0||e&&e>this[et])return this[Un](),null;this[ht]&&(e=null),this[Qe].length>1&&!this[ht]&&(this[Qe]=[this[Ur]?this[Qe].join(""):Buffer.concat(this[Qe],this[et])]);let r=this[dT](e||null,this[Qe][0]);return this[Un](),r}[dT](e,r){if(this[ht])this[y0]();else{let n=r;e===n.length||e===null?this[y0]():typeof n=="string"?(this[Qe][0]=n.slice(e),r=n.slice(0,e),this[et]-=e):(this[Qe][0]=n.subarray(e),r=n.subarray(0,e),this[et]-=e)}return this.emit("data",r),!this[Qe].length&&!this[jn]&&this.emit("drain"),r}end(e,r,n){return typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r="utf8"),e!==void 0&&this.write(e,r),n&&this.once("end",n),this[jn]=!0,this.writable=!1,(this[Xe]||!this[Bc])&&this[Un](),this}[ia](){this[je]||(!this[Cs]&&!this[Tt].length&&(this[Kt]=!0),this[Bc]=!1,this[Xe]=!0,this.emit("resume"),this[Qe].length?this[x0]():this[jn]?this[Un]():this.emit("drain"))}resume(){return this[ia]()}pause(){this[Xe]=!1,this[Bc]=!0,this[Kt]=!1}get destroyed(){return this[je]}get flowing(){return this[Xe]}get paused(){return this[Bc]}[G1](e){this[ht]?this[et]+=1:this[et]+=e.length,this[Qe].push(e)}[y0](){return this[ht]?this[et]-=1:this[et]-=this[Qe][0].length,this[Qe].shift()}[x0](e=!1){do;while(this[pT](this[y0]())&&this[Qe].length);!e&&!this[Qe].length&&!this[jn]&&this.emit("drain")}[pT](e){return this.emit("data",e),this[Xe]}pipe(e,r){if(this[je])return e;this[Kt]=!1;let n=this[Fi];return r=r||{},e===hT.stdout||e===hT.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,n?r.end&&e.end():(this[Tt].push(r.proxyErrors?new Z1(this,e,r):new F0(this,e,r)),this[cn]?kc(()=>this[ia]()):this[ia]()),e}unpipe(e){let r=this[Tt].find(n=>n.dest===e);r&&(this[Tt].length===1?(this[Xe]&&this[Cs]===0&&(this[Xe]=!1),this[Tt]=[]):this[Tt].splice(this[Tt].indexOf(r),1),r.unpipe())}addListener(e,r){return this.on(e,r)}on(e,r){let n=super.on(e,r);if(e==="data")this[Kt]=!1,this[Cs]++,!this[Tt].length&&!this[Xe]&&this[ia]();else if(e==="readable"&&this[et]!==0)super.emit("readable");else if(ete(e)&&this[Fi])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Ac]){let i=r;this[cn]?kc(()=>i.call(this,this[Ac])):i.call(this,this[Ac])}return n}removeListener(e,r){return this.off(e,r)}off(e,r){let n=super.off(e,r);return e==="data"&&(this[Cs]=this.listeners("data").length,this[Cs]===0&&!this[Kt]&&!this[Tt].length&&(this[Xe]=!1)),n}removeAllListeners(e){let r=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Cs]=0,!this[Kt]&&!this[Tt].length&&(this[Xe]=!1)),r}get emittedEnd(){return this[Fi]}[Un](){!this[D0]&&!this[Fi]&&!this[je]&&this[Qe].length===0&&this[jn]&&(this[D0]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[g0]&&this.emit("close"),this[D0]=!1)}emit(e,...r){let n=r[0];if(e!=="error"&&e!=="close"&&e!==je&&this[je])return!1;if(e==="data")return!this[ht]&&!n?!1:this[cn]?(kc(()=>this[z1](n)),!0):this[z1](n);if(e==="end")return this[mT]();if(e==="close"){if(this[g0]=!0,!this[Fi]&&!this[je])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[Ac]=n,super.emit(V1,n);let s=!this[Tc]||this.listeners("error").length?super.emit("error",n):!1;return this[Un](),s}else if(e==="resume"){let s=super.emit("resume");return this[Un](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let i=super.emit(e,...r);return this[Un](),i}[z1](e){for(let n of this[Tt])n.dest.write(e)===!1&&this.pause();let r=this[Kt]?!1:super.emit("data",e);return this[Un](),r}[mT](){return this[Fi]?!1:(this[Fi]=!0,this.readable=!1,this[cn]?(kc(()=>this[K1]()),!0):this[K1]())}[K1](){if(this[na]){let r=this[na].end();if(r){for(let n of this[Tt])n.dest.write(r);this[Kt]||super.emit("data",r)}}for(let r of this[Tt])r.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[ht]||(e.dataLength=0);let r=this.promise();return this.on("data",n=>{e.push(n),this[ht]||(e.dataLength+=n.length)}),await r,e}async concat(){if(this[ht])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Ur]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,r)=>{this.on(je,()=>r(new Error("stream destroyed"))),this.on("error",n=>r(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Kt]=!1;let e=!1,r=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return r();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[jn])return r();let s,o,a=f=>{this.off("data",u),this.off("end",c),this.off(je,l),r(),o(f)},u=f=>{this.off("error",a),this.off("end",c),this.off(je,l),this.pause(),s({value:f,done:!!this[jn]})},c=()=>{this.off("error",a),this.off("data",u),this.off(je,l),r(),s({done:!0,value:void 0})},l=()=>a(new Error("stream destroyed"));return new Promise((f,h)=>{o=h,s=f,this.once(je,l),this.once("error",a),this.once("end",c),this.once("data",u)})},throw:r,return:r,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Kt]=!1;let e=!1,r=()=>(this.pause(),this.off(V1,r),this.off(je,r),this.off("end",r),e=!0,{done:!0,value:void 0}),n=()=>{if(e)return r();let i=this.read();return i===null?r():{done:!1,value:i}};return this.once("end",r),this.once(V1,r),this.once(je,r),{next:n,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(e){if(this[je])return e?this.emit("error",e):this.emit(je),this;this[je]=!0,this[Kt]=!0,this[Qe].length=0,this[et]=0;let r=this;return typeof r.close=="function"&&!this[g0]&&r.close(),e?this.emit("error",e):this.emit(je),this}static get isStream(){return Zee}};var ote=fn.realpathSync.native,Pc={lstatSync:fn.lstatSync,readdir:fn.readdir,readdirSync:fn.readdirSync,readlinkSync:fn.readlinkSync,realpathSync:ote,promises:{lstat:Ci.lstat,readdir:Ci.readdir,readlink:Ci.readlink,realpath:Ci.realpath}},ET=t=>!t||t===Pc||t===ste?Pc:{...Pc,...t,promises:{...Pc.promises,...t.promises||{}}},CT=/^\\\\\?\\([a-z]:)\\?$/i,ate=t=>t.replace(/\//g,"\\").replace(CT,"$1\\"),ute=/[\\\/]/,gr=0,wT=1,ST=2,ln=4,vT=6,_T=8,ws=10,AT=12,Dr=15,Oc=~Dr,X1=16,gT=32,Rc=64,qr=128,C0=256,S0=512,xT=Rc|qr|S0,cte=1023,Q1=t=>t.isFile()?_T:t.isDirectory()?ln:t.isSymbolicLink()?ws:t.isCharacterDevice()?ST:t.isBlockDevice()?vT:t.isSocket()?AT:t.isFIFO()?wT:gr,yT=new Es({max:2**12}),Ic=t=>{let e=yT.get(t);if(e)return e;let r=t.normalize("NFKD");return yT.set(t,r),r},bT=new Es({max:2**12}),w0=t=>{let e=bT.get(t);if(e)return e;let r=Ic(t.toLowerCase());return bT.set(t,r),r},v0=class extends Es{constructor(){super({max:256})}},ey=class extends Es{constructor(e=16*1024){super({maxSize:e,sizeCalculation:r=>r.length+1})}},BT=Symbol("PathScurry setAsCwd"),dt=class{name;root;roots;parent;nocase;isCWD=!1;#e;#r;get dev(){return this.#r}#t;get mode(){return this.#t}#n;get nlink(){return this.#n}#o;get uid(){return this.#o}#a;get gid(){return this.#a}#f;get rdev(){return this.#f}#u;get blksize(){return this.#u}#c;get ino(){return this.#c}#m;get size(){return this.#m}#h;get blocks(){return this.#h}#l;get atimeMs(){return this.#l}#i;get mtimeMs(){return this.#i}#x;get ctimeMs(){return this.#x}#D;get birthtimeMs(){return this.#D}#p;get atime(){return this.#p}#y;get mtime(){return this.#y}#w;get ctime(){return this.#w}#g;get birthtime(){return this.#g}#S;#v;#b;#F;#E;#_;#s;#R;#O;#A;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,r=gr,n,i,s,o,a){this.name=e,this.#S=s?w0(e):Ic(e),this.#s=r&cte,this.nocase=s,this.roots=i,this.root=n||this,this.#R=o,this.#b=a.fullpath,this.#E=a.relative,this.#_=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=ET(a.fs)}depth(){return this.#v!==void 0?this.#v:this.parent?this.#v=this.parent.depth()+1:this.#v=0}childrenCache(){return this.#R}resolve(e){if(!e)return this;let r=this.getRootString(e),i=e.substring(r.length).split(this.splitSep);return r?this.getRoot(r).#P(i):this.#P(i)}#P(e){let r=this;for(let n of e)r=r.child(n);return r}children(){let e=this.#R.get(this);if(e)return e;let r=Object.assign([],{provisional:0});return this.#R.set(this,r),this.#s&=~X1,r}child(e,r){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),i=this.nocase?w0(e):Ic(e);for(let u of n)if(u.#S===i)return u;let s=this.parent?this.sep:"",o=this.#b?this.#b+s+e:void 0,a=this.newChild(e,gr,{...r,parent:this,fullpath:o});return this.canReaddir()||(a.#s|=qr),n.push(a),a}relative(){if(this.isCWD)return"";if(this.#E!==void 0)return this.#E;let e=this.name,r=this.parent;if(!r)return this.#E=this.name;let n=r.relative();return n+(!n||!r.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#_!==void 0)return this.#_;let e=this.name,r=this.parent;if(!r)return this.#_=this.fullpathPosix();let n=r.relativePosix();return n+(!n||!r.parent?"":"/")+e}fullpath(){if(this.#b!==void 0)return this.#b;let e=this.name,r=this.parent;if(!r)return this.#b=this.name;let i=r.fullpath()+(r.parent?this.sep:"")+e;return this.#b=i}fullpathPosix(){if(this.#F!==void 0)return this.#F;if(this.sep==="/")return this.#F=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#F=`//?/${i}`:this.#F=i}let e=this.parent,r=e.fullpathPosix(),n=r+(!r||!e.parent?"":"/")+this.name;return this.#F=n}isUnknown(){return(this.#s&Dr)===gr}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#s&Dr)===_T}isDirectory(){return(this.#s&Dr)===ln}isCharacterDevice(){return(this.#s&Dr)===ST}isBlockDevice(){return(this.#s&Dr)===vT}isFIFO(){return(this.#s&Dr)===wT}isSocket(){return(this.#s&Dr)===AT}isSymbolicLink(){return(this.#s&ws)===ws}lstatCached(){return this.#s&gT?this:void 0}readlinkCached(){return this.#O}realpathCached(){return this.#A}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#O)return!0;if(!this.parent)return!1;let e=this.#s&Dr;return!(e!==gr&&e!==ws||this.#s&C0||this.#s&qr)}calledReaddir(){return!!(this.#s&X1)}isENOENT(){return!!(this.#s&qr)}isNamed(e){return this.nocase?this.#S===w0(e):this.#S===Ic(e)}async readlink(){let e=this.#O;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=await this.#e.promises.readlink(this.fullpath()),n=(await this.parent.realpath())?.resolve(r);if(n)return this.#O=n}catch(r){this.#k(r.code);return}}readlinkSync(){let e=this.#O;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=this.#e.readlinkSync(this.fullpath()),n=this.parent.realpathSync()?.resolve(r);if(n)return this.#O=n}catch(r){this.#k(r.code);return}}#N(e){this.#s|=X1;for(let r=e.provisional;r<e.length;r++){let n=e[r];n&&n.#C()}}#C(){this.#s&qr||(this.#s=(this.#s|qr)&Oc,this.#W())}#W(){let e=this.children();e.provisional=0;for(let r of e)r.#C()}#L(){this.#s|=S0,this.#I()}#I(){if(this.#s&Rc)return;let e=this.#s;(e&Dr)===ln&&(e&=Oc),this.#s=e|Rc,this.#W()}#$(e=""){e==="ENOTDIR"||e==="EPERM"?this.#I():e==="ENOENT"?this.#C():this.children().provisional=0}#T(e=""){e==="ENOTDIR"?this.parent.#I():e==="ENOENT"&&this.#C()}#k(e=""){let r=this.#s;r|=C0,e==="ENOENT"&&(r|=qr),(e==="EINVAL"||e==="UNKNOWN")&&(r&=Oc),this.#s=r,e==="ENOTDIR"&&this.parent&&this.parent.#I()}#j(e,r){return this.#q(e,r)||this.#U(e,r)}#U(e,r){let n=Q1(e),i=this.newChild(e.name,n,{parent:this}),s=i.#s&Dr;return s!==ln&&s!==ws&&s!==gr&&(i.#s|=Rc),r.unshift(i),r.provisional++,i}#q(e,r){for(let n=r.provisional;n<r.length;n++){let i=r[n];if((this.nocase?w0(e.name):Ic(e.name))===i.#S)return this.#d(e,i,n,r)}}#d(e,r,n,i){let s=r.name;return r.#s=r.#s&Oc|Q1(e),s!==e.name&&(r.name=e.name),n!==i.provisional&&(n===i.length-1?i.pop():i.splice(n,1),i.unshift(r)),i.provisional++,r}async lstat(){if((this.#s&qr)===0)try{return this.#H(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#T(e.code)}}lstatSync(){if((this.#s&qr)===0)try{return this.#H(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#T(e.code)}}#H(e){let{atime:r,atimeMs:n,birthtime:i,birthtimeMs:s,blksize:o,blocks:a,ctime:u,ctimeMs:c,dev:l,gid:f,ino:h,mode:d,mtime:p,mtimeMs:m,nlink:x,rdev:D,size:y,uid:b}=e;this.#p=r,this.#l=n,this.#g=i,this.#D=s,this.#u=o,this.#h=a,this.#w=u,this.#x=c,this.#r=l,this.#a=f,this.#c=h,this.#t=d,this.#y=p,this.#i=m,this.#n=x,this.#f=D,this.#m=y,this.#o=b;let C=Q1(e);this.#s=this.#s&Oc|C|gT,C!==gr&&C!==ln&&C!==ws&&(this.#s|=Rc)}#M=[];#B=!1;#G(e){this.#B=!1;let r=this.#M.slice();this.#M.length=0,r.forEach(n=>n(null,e))}readdirCB(e,r=!1){if(!this.canReaddir()){r?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let s=n.slice(0,n.provisional);r?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#M.push(e),this.#B)return;this.#B=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(s,o)=>{if(s)this.#$(s.code),n.provisional=0;else{for(let a of o)this.#j(a,n);this.#N(n)}this.#G(n.slice(0,n.provisional))})}#V;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();if(this.#V)await this.#V;else{let n=()=>{};this.#V=new Promise(i=>n=i);try{for(let i of await this.#e.promises.readdir(r,{withFileTypes:!0}))this.#j(i,e);this.#N(e)}catch(i){this.#$(i.code),e.provisional=0}this.#V=void 0,n()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();try{for(let n of this.#e.readdirSync(r,{withFileTypes:!0}))this.#j(n,e);this.#N(e)}catch(n){this.#$(n.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#s&xT)return!1;let e=Dr&this.#s;return e===gr||e===ln||e===ws}shouldWalk(e,r){return(this.#s&ln)===ln&&!(this.#s&xT)&&!e.has(this)&&(!r||r(this))}async realpath(){if(this.#A)return this.#A;if(!((S0|C0|qr)&this.#s))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#A=this.resolve(e)}catch{this.#L()}}realpathSync(){if(this.#A)return this.#A;if(!((S0|C0|qr)&this.#s))try{let e=this.#e.realpathSync(this.fullpath());return this.#A=this.resolve(e)}catch{this.#L()}}[BT](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let r=new Set([]),n=[],i=this;for(;i&&i.parent;)r.add(i),i.#E=n.join(this.sep),i.#_=n.join("/"),i=i.parent,n.push("..");for(i=e;i&&i.parent&&!r.has(i);)i.#E=void 0,i.#_=void 0,i=i.parent}},_0=class t extends dt{sep="\\";splitSep=ute;constructor(e,r=gr,n,i,s,o,a){super(e,r,n,i,s,o,a)}newChild(e,r=gr,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return sa.win32.parse(e).root}getRoot(e){if(e=ate(e.toUpperCase()),e===this.root.name)return this.root;for(let[r,n]of Object.entries(this.roots))if(this.sameRoot(e,r))return this.roots[e]=n;return this.roots[e]=new oa(e,this).root}sameRoot(e,r=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(CT,"$1\\"),e===r}},A0=class t extends dt{splitSep="/";sep="/";constructor(e,r=gr,n,i,s,o,a){super(e,r,n,i,s,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,r=gr,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}},B0=class{root;rootPath;roots;cwd;#e;#r;#t;nocase;#n;constructor(e=process.cwd(),r,n,{nocase:i,childrenCacheSize:s=16*1024,fs:o=Pc}={}){this.#n=ET(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,FT.fileURLToPath)(e));let a=r.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new v0,this.#r=new v0,this.#t=new ey(s);let u=a.substring(this.rootPath.length).split(n);if(u.length===1&&!u[0]&&u.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#n),this.roots[this.rootPath]=this.root;let c=this.root,l=u.length-1,f=r.sep,h=this.rootPath,d=!1;for(let p of u){let m=l--;c=c.child(p,{relative:new Array(m).fill("..").join(f),relativePosix:new Array(m).fill("..").join("/"),fullpath:h+=(d?"":f)+p}),d=!0}this.cwd=c}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#t}resolve(...e){let r="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(r=r?`${o}/${r}`:o,this.isAbsolute(o)))break}let n=this.#e.get(r);if(n!==void 0)return n;let i=this.cwd.resolve(r).fullpath();return this.#e.set(r,i),i}resolvePosix(...e){let r="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(r=r?`${o}/${r}`:o,this.isAbsolute(o)))break}let n=this.#r.get(r);if(n!==void 0)return n;let i=this.cwd.resolve(r).fullpathPosix();return this.#r.set(r,i),i}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof dt||(r=e,e=this.cwd);let{withFileTypes:n}=r;if(e.canReaddir()){let i=await e.readdir();return n?i:i.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof dt||(r=e,e=this.cwd);let{withFileTypes:n=!0}=r;return e.canReaddir()?n?e.readdirSync():e.readdirSync().map(i=>i.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof dt||(r=e.withFileTypes,e=this.cwd);let n=await e.readlink();return r?n:n?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof dt||(r=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return r?n:n?.fullpath()}async realpath(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof dt||(r=e.withFileTypes,e=this.cwd);let n=await e.realpath();return r?n:n?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof dt||(r=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return r?n:n?.fullpath()}async walk(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof dt||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=r,a=[];(!s||s(e))&&a.push(n?e:e.fullpath());let u=new Set,c=(f,h)=>{u.add(f),f.readdirCB((d,p)=>{if(d)return h(d);let m=p.length;if(!m)return h();let x=()=>{--m===0&&h()};for(let D of p)(!s||s(D))&&a.push(n?D:D.fullpath()),i&&D.isSymbolicLink()?D.realpath().then(y=>y?.isUnknown()?y.lstat():y).then(y=>y?.shouldWalk(u,o)?c(y,x):x()):D.shouldWalk(u,o)?c(D,x):x()},!0)},l=e;return new Promise((f,h)=>{c(l,d=>{if(d)return h(d);f(a)})})}walkSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof dt||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=r,a=[];(!s||s(e))&&a.push(n?e:e.fullpath());let u=new Set([e]);for(let c of u){let l=c.readdirSync();for(let f of l){(!s||s(f))&&a.push(n?f:f.fullpath());let h=f;if(f.isSymbolicLink()){if(!(i&&(h=f.realpathSync())))continue;h.isUnknown()&&h.lstatSync()}h.shouldWalk(u,o)&&u.add(h)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,r={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof dt||(r=e,e=this.cwd),this.stream(e,r)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof dt||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=r;(!s||s(e))&&(yield n?e:e.fullpath());let a=new Set([e]);for(let u of a){let c=u.readdirSync();for(let l of c){(!s||s(l))&&(yield n?l:l.fullpath());let f=l;if(l.isSymbolicLink()){if(!(i&&(f=l.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(a,o)&&a.add(f)}}}stream(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof dt||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=r,a=new Ei({objectMode:!0});(!s||s(e))&&a.write(n?e:e.fullpath());let u=new Set,c=[e],l=0,f=()=>{let h=!1;for(;!h;){let d=c.shift();if(!d){l===0&&a.end();return}l++,u.add(d);let p=(x,D,y=!1)=>{if(x)return a.emit("error",x);if(i&&!y){let b=[];for(let C of D)C.isSymbolicLink()&&b.push(C.realpath().then(_=>_?.isUnknown()?_.lstat():_));if(b.length){Promise.all(b).then(()=>p(null,D,!0));return}}for(let b of D)b&&(!s||s(b))&&(a.write(n?b:b.fullpath())||(h=!0));l--;for(let b of D){let C=b.realpathCached()||b;C.shouldWalk(u,o)&&c.push(C)}h&&!a.flowing?a.once("drain",f):m||f()},m=!0;d.readdirCB(p,!0),m=!1}};return f(),a}streamSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof dt||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=r,a=new Ei({objectMode:!0}),u=new Set;(!s||s(e))&&a.write(n?e:e.fullpath());let c=[e],l=0,f=()=>{let h=!1;for(;!h;){let d=c.shift();if(!d){l===0&&a.end();return}l++,u.add(d);let p=d.readdirSync();for(let m of p)(!s||s(m))&&(a.write(n?m:m.fullpath())||(h=!0));l--;for(let m of p){let x=m;if(m.isSymbolicLink()){if(!(i&&(x=m.realpathSync())))continue;x.isUnknown()&&x.lstatSync()}x.shouldWalk(u,o)&&c.push(x)}}h&&!a.flowing&&a.once("drain",f)};return f(),a}chdir(e=this.cwd){let r=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[BT](r)}},oa=class extends B0{sep="\\";constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,sa.win32,"\\",{...r,nocase:n}),this.nocase=n;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return sa.win32.parse(e).root.toUpperCase()}newRoot(e){return new _0(this.rootPath,ln,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},aa=class extends B0{sep="/";constructor(e=process.cwd(),r={}){let{nocase:n=!1}=r;super(e,sa.posix,"/",{...r,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new A0(this.rootPath,ln,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},Mc=class extends aa{constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,{...r,nocase:n})}},P3e=process.platform==="win32"?_0:A0,TT=process.platform==="win32"?oa:process.platform==="darwin"?Mc:aa;var lte=t=>t.length>=1,fte=t=>t.length>=1,ua=class t{#e;#r;#t;length;#n;#o;#a;#f;#u;#c;#m=!0;constructor(e,r,n,i){if(!lte(e))throw new TypeError("empty pattern list");if(!fte(r))throw new TypeError("empty glob list");if(r.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,n<0||n>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#r=r,this.#t=n,this.#n=i,this.#t===0){if(this.isUNC()){let[s,o,a,u,...c]=this.#e,[l,f,h,d,...p]=this.#r;c[0]===""&&(c.shift(),p.shift());let m=[s,o,a,u,""].join("/"),x=[l,f,h,d,""].join("/");this.#e=[m,...c],this.#r=[x,...p],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...o]=this.#e,[a,...u]=this.#r;o[0]===""&&(o.shift(),u.shift());let c=s+"/",l=a+"/";this.#e=[c,...o],this.#r=[l,...u],this.length=this.#e.length}}}pattern(){return this.#e[this.#t]}isString(){return typeof this.#e[this.#t]=="string"}isGlobstar(){return this.#e[this.#t]===st}isRegExp(){return this.#e[this.#t]instanceof RegExp}globString(){return this.#a=this.#a||(this.#t===0?this.isAbsolute()?this.#r[0]+this.#r.slice(1).join("/"):this.#r.join("/"):this.#r.slice(this.#t).join("/"))}hasMore(){return this.length>this.#t+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new t(this.#e,this.#r,this.#t+1,this.#n),this.#o.#c=this.#c,this.#o.#u=this.#u,this.#o.#f=this.#f,this.#o):this.#o=null}isUNC(){let e=this.#e;return this.#u!==void 0?this.#u:this.#u=this.#n==="win32"&&this.#t===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#f!==void 0?this.#f:this.#f=this.#n==="win32"&&this.#t===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#c!==void 0?this.#c:this.#c=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#t===0?e:""}checkFollowGlobstar(){return!(this.#t===0||!this.isGlobstar()||!this.#m)}markFollowGlobstar(){return this.#t===0||!this.isGlobstar()||!this.#m?!1:(this.#m=!1,!0)}};var hte=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",ca=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:r,nocase:n,noext:i,noglobstar:s,platform:o=hte}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:r,nocase:n,noext:i,noglobstar:s,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let r=new zt(e,this.mmopts);for(let n=0;n<r.set.length;n++){let i=r.set[n],s=r.globParts[n];if(!i||!s)throw new Error("invalid pattern object");for(;i[0]==="."&&s[0]===".";)i.shift(),s.shift();let o=new ua(i,s,0,this.platform),a=new zt(o.globString(),this.mmopts),u=s[s.length-1]==="**",c=o.isAbsolute();c?this.absolute.push(a):this.relative.push(a),u&&(c?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(e){let r=e.fullpath(),n=`${r}/`,i=e.relative()||".",s=`${i}/`;for(let o of this.relative)if(o.match(i)||o.match(s))return!0;for(let o of this.absolute)if(o.match(r)||o.match(n))return!0;return!1}childrenIgnored(e){let r=e.fullpath()+"/",n=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(n))return!0;for(let i of this.absoluteChildren)if(i.match(r))return!0;return!1}};var ty=class t{store;constructor(e=new Map){this.store=e}copy(){return new t(new Map(this.store))}hasWalked(e,r){return this.store.get(e.fullpath())?.has(r.globString())}storeWalked(e,r){let n=e.fullpath(),i=this.store.get(n);i?i.add(r.globString()):this.store.set(n,new Set([r.globString()]))}},ry=class{store=new Map;add(e,r,n){let i=(r?2:0)|(n?1:0),s=this.store.get(e);this.store.set(e,s===void 0?i:i&s)}entries(){return[...this.store.entries()].map(([e,r])=>[e,!!(r&2),!!(r&1)])}},ny=class{store=new Map;add(e,r){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(i=>i.globString()===r.globString())||n.push(r):this.store.set(e,[r])}get(e){let r=this.store.get(e);if(!r)throw new Error("attempting to walk unknown path");return r}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},Lc=class t{hasWalkedCache;matches=new ry;subwalks=new ny;patterns;follow;dot;opts;constructor(e,r){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=r?r.copy():new ty}processPatterns(e,r){this.patterns=r;let n=r.map(i=>[e,i]);for(let[i,s]of n){this.hasWalkedCache.storeWalked(i,s);let o=s.root(),a=s.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let f=s.rest();if(f)s=f;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let u,c,l=!1;for(;typeof(u=s.pattern())=="string"&&(c=s.rest());)i=i.resolve(u),s=c,l=!0;if(u=s.pattern(),c=s.rest(),l){if(this.hasWalkedCache.hasWalked(i,s))continue;this.hasWalkedCache.storeWalked(i,s)}if(typeof u=="string"){let f=u===".."||u===""||u===".";this.matches.add(i.resolve(u),a,f);continue}else if(u===st){(!i.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(i,s);let f=c?.pattern(),h=c?.rest();if(!c||(f===""||f===".")&&!h)this.matches.add(i,a,f===""||f===".");else if(f===".."){let d=i.parent||i;h?this.hasWalkedCache.hasWalked(d,h)||this.subwalks.add(d,h):this.matches.add(d,a,!0)}}else u instanceof RegExp&&this.subwalks.add(i,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,r){let n=this.subwalks.get(e),i=this.child();for(let s of r)for(let o of n){let a=o.isAbsolute(),u=o.pattern(),c=o.rest();u===st?i.testGlobstar(s,o,c,a):u instanceof RegExp?i.testRegExp(s,u,c,a):i.testString(s,u,c,a)}return i}testGlobstar(e,r,n,i){if((this.dot||!e.name.startsWith("."))&&(r.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,r):e.isSymbolicLink()&&(n&&r.checkFollowGlobstar()?this.subwalks.add(e,n):r.markFollowGlobstar()&&this.subwalks.add(e,r)))),n){let s=n.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,n.rest(),i);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,n)}else s instanceof RegExp&&this.testRegExp(e,s,n.rest(),i)}}testRegExp(e,r,n,i){r.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}testString(e,r,n,i){e.isNamed(r)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}};var dte=(t,e)=>typeof t=="string"?new ca([t],e):Array.isArray(t)?new ca(t,e):t,T0=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#r;#t;signal;maxDepth;includeChildMatches;constructor(e,r,n){if(this.patterns=e,this.path=r,this.opts=n,this.#t=!n.posix&&n.platform==="win32"?"\\":"/",this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#r=dte(n.ignore??[],n),!this.includeChildMatches&&typeof this.#r.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#n(e){return this.seen.has(e)||!!this.#r?.ignored?.(e)}#o(e){return!!this.#r?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=await s.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(s,r)}matchCheckTest(e,r){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!r||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#n(e)?e:void 0}matchCheckSync(e,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=s.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(s,r)}matchFinish(e,r){if(this.#n(e))return;if(!this.includeChildMatches&&this.#r?.add){let s=`${e.relativePosix()}/**`;this.#r.add(s)}let n=this.opts.absolute===void 0?r:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#t:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+i)}else{let s=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!s.startsWith(".."+this.#t)?"."+this.#t:"";this.matchEmit(s?o+s+i:"."+i)}}async match(e,r,n){let i=await this.matchCheck(e,n);i&&this.matchFinish(i,r)}matchSync(e,r,n){let i=this.matchCheckSync(e,n);i&&this.matchFinish(i,r)}walkCB(e,r,n){this.signal?.aborted&&n(),this.walkCB2(e,r,new Lc(this.opts),n)}walkCB2(e,r,n,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,r,n,i));return}n.processPatterns(e,r);let s=1,o=()=>{--s===0&&i()};for(let[a,u,c]of n.matches.entries())this.#n(a)||(s++,this.match(a,u,c).then(()=>o()));for(let a of n.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let u=a.readdirCached();a.calledReaddir()?this.walkCB3(a,u,n,o):a.readdirCB((c,l)=>this.walkCB3(a,l,n,o),!0)}o()}walkCB3(e,r,n,i){n=n.filterEntries(e,r);let s=1,o=()=>{--s===0&&i()};for(let[a,u,c]of n.matches.entries())this.#n(a)||(s++,this.match(a,u,c).then(()=>o()));for(let[a,u]of n.subwalks.entries())s++,this.walkCB2(a,u,n.child(),o);o()}walkCBSync(e,r,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,r,new Lc(this.opts),n)}walkCB2Sync(e,r,n,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,r,n,i));return}n.processPatterns(e,r);let s=1,o=()=>{--s===0&&i()};for(let[a,u,c]of n.matches.entries())this.#n(a)||this.matchSync(a,u,c);for(let a of n.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let u=a.readdirSync();this.walkCB3Sync(a,u,n,o)}o()}walkCB3Sync(e,r,n,i){n=n.filterEntries(e,r);let s=1,o=()=>{--s===0&&i()};for(let[a,u,c]of n.matches.entries())this.#n(a)||this.matchSync(a,u,c);for(let[a,u]of n.subwalks.entries())s++,this.walkCB2Sync(a,u,n.child(),o);o()}},Nc=class extends T0{matches=new Set;constructor(e,r,n){super(e,r,n)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,r)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?r(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},$c=class extends T0{results;constructor(e,r,n){super(e,r,n),this.results=new Ei({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var pte=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Hr=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,r){if(!r)throw new TypeError("glob options required");if(this.withFileTypes=!!r.withFileTypes,this.signal=r.signal,this.follow=!!r.follow,this.dot=!!r.dot,this.dotRelative=!!r.dotRelative,this.nodir=!!r.nodir,this.mark=!!r.mark,r.cwd?(r.cwd instanceof URL||r.cwd.startsWith("file://"))&&(r.cwd=(0,kT.fileURLToPath)(r.cwd)):this.cwd="",this.cwd=r.cwd||"",this.root=r.root,this.magicalBraces=!!r.magicalBraces,this.nobrace=!!r.nobrace,this.noext=!!r.noext,this.realpath=!!r.realpath,this.absolute=r.absolute,this.includeChildMatches=r.includeChildMatches!==!1,this.noglobstar=!!r.noglobstar,this.matchBase=!!r.matchBase,this.maxDepth=typeof r.maxDepth=="number"?r.maxDepth:1/0,this.stat=!!r.stat,this.ignore=r.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(u=>u.replace(/\\/g,"/"))),this.matchBase){if(r.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(u=>u.includes("/")?u:`./**/${u}`)}if(this.pattern=e,this.platform=r.platform||pte,this.opts={...r,platform:this.platform},r.scurry){if(this.scurry=r.scurry,r.nocase!==void 0&&r.nocase!==r.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let u=r.platform==="win32"?oa:r.platform==="darwin"?Mc:r.platform?aa:TT;this.scurry=new u(this.cwd,{nocase:r.nocase,fs:r.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",i={...r,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(u=>new zt(u,i)),[o,a]=s.reduce((u,c)=>(u[0].push(...c.set),u[1].push(...c.globParts),u),[[],[]]);this.patterns=o.map((u,c)=>{let l=a[c];if(!l)throw new Error("invalid pattern object");return new ua(u,l,0,this.platform)})}async walk(){return[...await new Nc(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new Nc(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new $c(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new $c(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var iy=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let r of t)if(new zt(r,e).hasMagic())return!0;return!1};function O0(t,e={}){return new Hr(t,e).streamSync()}function PT(t,e={}){return new Hr(t,e).stream()}function P0(t,e={}){return new Hr(t,e).walkSync()}async function OT(t,e={}){return new Hr(t,e).walk()}function R0(t,e={}){return new Hr(t,e).iterateSync()}function RT(t,e={}){return new Hr(t,e).iterate()}var mte=O0,Dte=Object.assign(PT,{sync:O0}),gte=R0,xte=Object.assign(RT,{sync:R0}),yte=Object.assign(P0,{stream:O0,iterate:R0}),k0=Object.assign(OT,{glob:OT,globSync:P0,sync:yte,globStream:PT,stream:Dte,globStreamSync:O0,streamSync:mte,globIterate:RT,iterate:xte,globIterateSync:R0,iterateSync:gte,Glob:Hr,hasMagic:iy,escape:ta,unescape:jr});k0.glob=k0;var wi=(t,e)=>typeof t>"u"||typeof t===e,IT=t=>!!t&&typeof t=="object"&&wi(t.preserveRoot,"boolean")&&wi(t.tmp,"string")&&wi(t.maxRetries,"number")&&wi(t.retryDelay,"number")&&wi(t.backoff,"number")&&wi(t.maxBackoff,"number")&&(wi(t.glob,"boolean")||t.glob&&typeof t.glob=="object")&&wi(t.filter,"function"),MT=t=>{if(!IT(t))throw new Error("invalid rimraf options")},LT=t=>{MT(t);let{glob:e,...r}=t;if(!e)return r;let n=e===!0?t.signal?{signal:t.signal}:{}:t.signal?{signal:t.signal,...e}:e;return{...r,glob:{...n,absolute:!0,withFileTypes:!1}}},NT=(t={})=>LT(t),$T=(t={})=>LT(t);var jc=require("path"),jT=require("util"),bte=(t,e={})=>{let r=typeof t;if(r!=="string"){let i=t&&r==="object"&&t.constructor,o=`The "path" argument must be of type string. Received ${i&&i.name?`an instance of ${i.name}`:r==="object"?(0,jT.inspect)(t):`type ${r} ${t}`}`;throw Object.assign(new TypeError(o),{path:t,code:"ERR_INVALID_ARG_TYPE"})}if(/\0/.test(t)){let i="path must be a string without null bytes";throw Object.assign(new TypeError(i),{path:t,code:"ERR_INVALID_ARG_VALUE"})}t=(0,jc.resolve)(t);let{root:n}=(0,jc.parse)(t);if(t===n&&e.preserveRoot!==!1){let i="refusing to remove root directory without preserveRoot:false";throw Object.assign(new Error(i),{path:t,code:"ERR_PRESERVE_ROOT"})}if(process.platform==="win32"){let i=/[*|"<>?:]/,{root:s}=(0,jc.parse)(t);if(i.test(t.substring(s.length)))throw Object.assign(new Error("Illegal characters in path."),{path:t,code:"EINVAL"})}return t},Uc=bte;var UT=require("fs"),hn=P(require("fs/promises"),1),he=require("fs"),qT=t=>(0,UT.readdirSync)(t,{withFileTypes:!0}),$t={chmod:hn.default.chmod,mkdir:hn.default.mkdir,readdir:t=>hn.default.readdir(t,{withFileTypes:!0}),rename:hn.default.rename,rm:hn.default.rm,rmdir:hn.default.rmdir,stat:hn.default.stat,lstat:hn.default.lstat,unlink:hn.default.unlink};var ha=require("path");var{readdir:Fte}=$t,la=t=>Fte(t).catch(e=>e),fa=t=>{try{return qT(t)}catch(e){return e}};var HT=t=>!!t&&typeof t=="object",sy=(t,e)=>e in t&&typeof t[e]=="string",oy=t=>HT(t)&&sy(t,"code")&&sy(t,"path"),Pe=t=>HT(t)&&sy(t,"code")?t.code:null;var kt=async(t,e)=>t.catch(r=>{if(Pe(r)!=="ENOENT")throw e??r}),Ot=(t,e)=>{try{return t()}catch(r){if(Pe(r)==="ENOENT")return;throw e??r}};var{lstat:Ete,rmdir:Cte,unlink:wte}=$t,I0=async(t,e)=>(e?.signal?.throwIfAborted(),await kt(Ete(t).then(r=>WT(t,e,r)))??!0),M0=(t,e)=>(e?.signal?.throwIfAborted(),Ot(()=>GT(t,e,(0,he.lstatSync)(t)))??!0),WT=async(t,e,r)=>{e?.signal?.throwIfAborted();let n=r.isDirectory()?await la(t):null;if(!Array.isArray(n)){if(n){if(Pe(n)==="ENOENT")return!0;if(Pe(n)!=="ENOTDIR")throw n}return e.filter&&!await e.filter(t,r)?!1:(await kt(wte(t)),!0)}return!(await Promise.all(n.map(s=>WT((0,ha.resolve)(t,s.name),e,s)))).every(s=>s===!0)||e.preserveRoot===!1&&t===(0,ha.parse)(t).root||e.filter&&!await e.filter(t,r)?!1:(await kt(Cte(t)),!0)},GT=(t,e,r)=>{e?.signal?.throwIfAborted();let n=r.isDirectory()?fa(t):null;if(!Array.isArray(n)){if(n){if(Pe(n)==="ENOENT")return!0;if(Pe(n)!=="ENOTDIR")throw n}return e.filter&&!e.filter(t,r)?!1:(Ot(()=>(0,he.unlinkSync)(t)),!0)}let i=!0;for(let s of n){let o=(0,ha.resolve)(t,s.name);i=GT(o,e,s)&&i}return e.preserveRoot===!1&&t===(0,ha.parse)(t).root||!i||e.filter&&!e.filter(t,r)?!1:(Ot(()=>(0,he.rmdirSync)(t)),!0)};var da=require("path");var{chmod:Ste}=$t,qc=t=>async e=>{try{return void await kt(t(e))}catch(r){if(Pe(r)==="EPERM")return await kt(Ste(e,438).then(()=>!0),r)?void await t(e):void 0;throw r}},Hc=t=>e=>{try{return void Ot(()=>t(e))}catch(r){if(Pe(r)==="EPERM")return Ot(()=>((0,he.chmodSync)(e,438),!0),r)?void t(e):void 0;throw r}};var VT=require("timers/promises");var vte=200,_te=1.2,zT=10,KT=new Set(["EMFILE","ENFILE","EBUSY"]),ay=t=>{let e=async(r,n,i=1,s=0)=>{let o=n.maxBackoff||vte,a=n.backoff||_te,u=n.maxRetries||zT,c=0;for(;;)try{return await t(r)}catch(l){if(oy(l)&&l.path===r&&KT.has(l.code)){if(i=Math.ceil(i*a),s=i+s,s<o)return await(0,VT.setTimeout)(i),e(r,n,i,s);if(c<u){c++;continue}}throw l}};return e},uy=t=>(r,n)=>{let i=n.maxRetries||zT,s=0;for(;;)try{return t(r)}catch(o){if(oy(o)&&o.path===r&&KT.has(o.code)&&s<i){s++;continue}throw o}};var xr=require("path");var Wc=require("os"),Si=require("path");var{stat:Ate}=$t,Bte=t=>{try{return(0,he.statSync)(t).isDirectory()}catch{return!1}},Tte=t=>Ate(t).then(e=>e.isDirectory(),()=>!1),kte=async t=>{let{root:e}=(0,Si.parse)(t),r=(0,Wc.tmpdir)(),{root:n}=(0,Si.parse)(r);if(e.toLowerCase()===n.toLowerCase())return r;let i=(0,Si.resolve)(e,"/temp");return await Tte(i)?i:e},Ote=t=>{let{root:e}=(0,Si.parse)(t),r=(0,Wc.tmpdir)(),{root:n}=(0,Si.parse)(r);if(e.toLowerCase()===n.toLowerCase())return r;let i=(0,Si.resolve)(e,"/temp");return Bte(i)?i:e},Pte=async()=>(0,Wc.tmpdir)(),Rte=()=>(0,Wc.tmpdir)(),YT=process.platform==="win32"?kte:Pte,ZT=process.platform==="win32"?Ote:Rte;var{lstat:Ite,rename:Mte,unlink:Lte,rmdir:Nte}=$t,QT=t=>`.${(0,xr.basename)(t)}.${Math.random()}`,$te=qc(Lte),jte=Hc(he.unlinkSync),L0=async(t,e)=>(e?.signal?.throwIfAborted(),await kt(Ite(t).then(r=>cy(t,e,r)))??!0),cy=async(t,e,r)=>{if(e?.signal?.throwIfAborted(),!e.tmp)return cy(t,{...e,tmp:await YT(t)},r);if(t===e.tmp&&(0,xr.parse)(t).root!==t)throw new Error("cannot delete temp directory used for deletion");let n=r.isDirectory()?await la(t):null;if(!Array.isArray(n)){if(n){if(Pe(n)==="ENOENT")return!0;if(Pe(n)!=="ENOTDIR")throw n}return e.filter&&!await e.filter(t,r)?!1:(await kt(JT(t,e.tmp,$te)),!0)}return!(await Promise.all(n.map(s=>cy((0,xr.resolve)(t,s.name),e,s)))).every(s=>s===!0)||e.preserveRoot===!1&&t===(0,xr.parse)(t).root||e.filter&&!await e.filter(t,r)?!1:(await kt(JT(t,e.tmp,Nte)),!0)},JT=async(t,e,r)=>{let n=(0,xr.resolve)(e,QT(t));return await Mte(t,n),await r(n)},N0=(t,e)=>(e?.signal?.throwIfAborted(),Ot(()=>ly(t,e,(0,he.lstatSync)(t)))??!0),ly=(t,e,r)=>{if(e?.signal?.throwIfAborted(),!e.tmp)return ly(t,{...e,tmp:ZT(t)},r);let n=e.tmp;if(t===e.tmp&&(0,xr.parse)(t).root!==t)throw new Error("cannot delete temp directory used for deletion");let i=r.isDirectory()?fa(t):null;if(!Array.isArray(i)){if(i){if(Pe(i)==="ENOENT")return!0;if(Pe(i)!=="ENOTDIR")throw i}return e.filter&&!e.filter(t,r)?!1:(Ot(()=>XT(t,n,jte)),!0)}let s=!0;for(let o of i){let a=(0,xr.resolve)(t,o.name);s=ly(a,e,o)&&s}return!s||e.preserveRoot===!1&&t===(0,xr.parse)(t).root||e.filter&&!e.filter(t,r)?!1:(Ot(()=>XT(t,n,he.rmdirSync)),!0)},XT=(t,e,r)=>{let n=(0,xr.resolve)(e,QT(t));return(0,he.renameSync)(t,n),r(n)};var{unlink:Ute,rmdir:qte,lstat:Hte}=$t,Wte=ay(qc(Ute)),Gte=uy(Hc(he.unlinkSync)),Vte=ay(qc(qte)),zte=uy(Hc(he.rmdirSync)),Kte=async(t,{filter:e,...r})=>{r?.signal?.throwIfAborted();try{return await Vte(t,r),!0}catch(n){if(Pe(n)==="ENOTEMPTY")return L0(t,r);throw n}},Yte=(t,{filter:e,...r})=>{r?.signal?.throwIfAborted();try{return zte(t,r),!0}catch(n){if(Pe(n)==="ENOTEMPTY")return N0(t,r);throw n}},vi=Symbol("start"),ek=Symbol("child"),$0=Symbol("finish"),j0=async(t,e)=>(e?.signal?.throwIfAborted(),await kt(Hte(t).then(r=>fy(t,e,r,vi)))??!0),U0=(t,e)=>(e?.signal?.throwIfAborted(),Ot(()=>hy(t,e,(0,he.lstatSync)(t),vi))??!0),fy=async(t,e,r,n=vi)=>{e?.signal?.throwIfAborted();let i=r.isDirectory()?await la(t):null;if(!Array.isArray(i)){if(i){if(Pe(i)==="ENOENT")return!0;if(Pe(i)!=="ENOTDIR")throw i}return e.filter&&!await e.filter(t,r)?!1:(await kt(Wte(t,e)),!0)}let s=n===vi?ek:n,o=(await Promise.all(i.map(a=>fy((0,da.resolve)(t,a.name),e,a,s)))).every(a=>a===!0);if(n===vi)return fy(t,e,r,$0);if(n===$0){if(e.preserveRoot===!1&&t===(0,da.parse)(t).root||!o||e.filter&&!await e.filter(t,r))return!1;await kt(Kte(t,e))}return!0},hy=(t,e,r,n=vi)=>{let i=r.isDirectory()?fa(t):null;if(!Array.isArray(i)){if(i){if(Pe(i)==="ENOENT")return!0;if(Pe(i)!=="ENOTDIR")throw i}return e.filter&&!e.filter(t,r)?!1:(Ot(()=>Gte(t,e)),!0)}let s=!0;for(let o of i){let a=n===vi?ek:n,u=(0,da.resolve)(t,o.name);s=hy(u,e,o,a)&&s}if(n===vi)return hy(t,e,r,$0);if(n===$0){if(e.preserveRoot===!1&&t===(0,da.parse)(t).root||!s||e.filter&&!e.filter(t,r))return!1;Ot(()=>Yte(t,e))}return!0};var dy=process.platform==="win32"?j0:I0,py=process.platform==="win32"?U0:M0;var{rm:Zte}=$t,my=async(t,e)=>(await Zte(t,{...e,force:!0,recursive:!0}),!0),Dy=(t,e)=>((0,he.rmSync)(t,{...e,force:!0,recursive:!0}),!0);var[tk=0,Jte=0]=process.version.replace(/^v/,"").split(".").map(t=>parseInt(t,10)),rk=tk>14||tk===14&&Jte>=14,nk=!rk||process.platform==="win32"?()=>!1:t=>!t?.signal&&!t?.filter,ik=!rk||process.platform==="win32"?()=>!1:t=>!t?.signal&&!t?.filter;var pa=t=>async(e,r)=>{let n=NT(r);return n.glob&&(e=await k0(e,n.glob)),Array.isArray(e)?!!(await Promise.all(e.map(i=>t(Uc(i,n),n)))).reduce((i,s)=>i&&s,!0):!!await t(Uc(e,n),n)},ma=t=>(e,r)=>{let n=$T(r);return n.glob&&(e=P0(e,n.glob)),Array.isArray(e)?!!e.map(i=>t(Uc(i,n),n)).reduce((i,s)=>i&&s,!0):!!t(Uc(e,n),n)},ak=ma(Dy),Xte=Object.assign(pa(my),{sync:ak}),uk=ma(py),Qte=Object.assign(pa(dy),{sync:uk}),ck=ma(U0),ere=Object.assign(pa(j0),{sync:ck}),lk=ma(M0),tre=Object.assign(pa(I0),{sync:lk}),fk=ma(N0),rre=Object.assign(pa(L0),{sync:fk}),sk=ma((t,e)=>ik(e)?Dy(t,e):py(t,e));var ok=pa((t,e)=>nk(e)?my(t,e):dy(t,e)),q0=Object.assign(ok,{rimraf:ok,sync:sk,rimrafSync:sk,manual:Qte,manualSync:uk,native:Xte,nativeSync:ak,posix:tre,posixSync:lk,windows:ere,windowsSync:ck,moveRemove:rre,moveRemoveSync:fk});q0.rimraf=q0;var pt=t=>(0,_i.join)(process.cwd(),t),dk=t=>{try{return(0,hk.readdirSync)(t).length===0}catch{return!0}},pk=()=>{try{return Gc()!==void 0}catch{return!1}};function mk(){let t=N1({cwd:(0,_i.dirname)(__filename)});if(!t)throw new Error("Could not find package.json");return(0,_i.dirname)(t)}function Gc(){let t=N1();if(!t)throw new Error("You are not in a project directory");return(0,_i.dirname)(t)}var Dk=t=>q0(t),gk=(t,e)=>(0,_i.resolve)(require.resolve(t),`../${e}`);async function mt(t,e){let r=Date.now(),n=t.title,i=()=>Math.floor((Date.now()-r)/1e3),s=setInterval(()=>{i()>1&&(t.title=`${n} (${i()}s)`)},1e3);try{return await e(i)}finally{clearInterval(s)}}async function H0(t,e,r){for(let n=0;n<e.length;n++){let i=e[n];t.output=E.dim(`[${n+1}/${e.length}] ${i.title}`),await i.fn(r??{},t)}}var nre={...process.env,NODE_NO_WARNINGS:"1"};async function Yt(t,e,{cwd:r=process.cwd(),task:n,shell:i,context:s=t,quiet:o=!1}={}){try{e.length===0&&(e=t.split(" ").slice(1));let u=j7(t,e,{cwd:r,stdio:o||n?"pipe":"inherit",all:n?!0:void 0,shell:i??!0,env:nre});n&&u.all&&u.all.on("data",c=>{n.output=c.toString().trim(),n.output.length&&H.storeLog(n.output,s)}),await u}catch(a){let u=a instanceof Error?a.message:String(a),c=ire(u);throw new Error(c)}}var ire=t=>{let e=t.match(/error: (.+)/);return e?e[1].trim():t};function yk(t,e,r={}){let{cwd:n=process.cwd(),envFile:i,detached:s=!0,onStderr:o,onExit:a}=r,u=i?["--env-file",i,t,...e]:[t,...e],f=(0,xk.spawn)(i?"bun":t,i?u:e,{cwd:n,env:{...process.env,FORCE_COLOR:"1"},stdio:["inherit","inherit","pipe"],detached:s});return o&&f.stderr?.on("data",o),a&&f.on("exit",a),f}async function bk(t,e){let r=[];for(let n of t)try{let i=n.command.split(/\s+/),s=i[0],o=i.slice(1);await Yt(s,o,{cwd:e,shell:!0,quiet:!1}),r.push({command:n.command,success:!0})}catch(i){r.push({command:n.command,success:!1,error:i instanceof Error?i.message:String(i)});break}return r}function Fk(t){let e=[/^pf\s+new\s+/,/^pf\s+add\s+/,/^bun\s+pf\s+new\s+/,/^bun\s+pf\s+add\s+/];return t.filter(r=>e.some(n=>n.test(r.command)))}function Ek(t){for(let e of t){let r=e.command.match(/(?:bun\s+)?pf\s+new\s+\S+\s+(\S+)/);if(r)return r[1]}return null}var Ss=require("node:fs"),W0=require("node:path");function Ck(t,e){let r={written:[],skipped:[],failed:[]};for(let n of t){let i=(0,W0.join)(e.baseDir,n.path);try{if((0,Ss.existsSync)(i)&&!e.overwrite){r.skipped.push(n.path);continue}if(e.dryRun){r.written.push(n.path);continue}let s=(0,W0.dirname)(i);(0,Ss.existsSync)(s)||(0,Ss.mkdirSync)(s,{recursive:!0}),(0,Ss.writeFileSync)(i,n.content,"utf-8"),r.written.push(n.path)}catch(s){r.failed.push({path:n.path,error:s.message})}}return r}var sre=[/####\s+`?([^\s`\n]+\.[a-z]+)`?\s*\n+```(\w+)?\n([\s\S]*?)```/gi,/\*\*(?:File|Datei):?\*\*\s*`?([^\s`\n]+\.[a-z]+)`?\s*\n+```(\w+)?\n([\s\S]*?)```/gi,/(?:File|Datei):?\s*`?([^\s`\n]+\.[a-z]+)`?\s*\n+```(\w+)?\n([\s\S]*?)```/gi,/`([^\s`]+\.[a-z]+)`[:\s]*\n+```(\w+)?\n([\s\S]*?)```/gi],wk=/```(\w+)?\n([\s\S]*?)```/g;function ore(t,e,r){let n=[[/new Hono\(\)/i,"src/index.ts"],[/@Module\(/i,"src/app.module.ts"],[/@Controller\(/i,"src/app.controller.ts"],[/@Injectable\(/i,"src/app.service.ts"],[/NestFactory\.create/i,"src/main.ts"],[/"name":\s*"[^"]+"/i,"package.json"],[/^FROM\s+/im,"Dockerfile"],[/"compilerOptions"/i,"tsconfig.json"],[/^[A-Z_]+=.+$/m,".env"]];for(let[o,a]of n)if(o.test(t))return a;let s={typescript:"ts",ts:"ts",javascript:"js",js:"js",json:"json",toml:"toml",yaml:"yaml",yml:"yml",plaintext:"txt",env:"env",dockerfile:""}[e?.toLowerCase()||"ts"]??"ts";return s?`src/file-${r+1}.${s}`:null}function Sk(t){let e=[],r=/```commands?\n([\s\S]*?)```/gi,n;for(r.lastIndex=0;(n=r.exec(t))!==null;){let s=n[1].trim().split(`
|
|
190
|
+
>>> no match, partial?`,e,h,r,d),h===u))}let m;if(typeof l=="string"?(m=f===l,this.debug("string match",l,f,m)):(m=l.test(f),this.debug("pattern match",l,f,m)),!m)return!1}if(o===u&&a===c)return!0;if(o===u)return n;if(a===c)return o===u-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return aT(this.pattern,this.options)}parse(e){vc(e);let r=this.options;if(e==="**")return st;if(e==="")return"";let n,i=null;(n=e.match(Tee))?i=r.dot?Oee:kee:(n=e.match(bee))?i=(r.nocase?r.dot?wee:Cee:r.dot?Eee:Fee)(n[1]):(n=e.match(Pee))?i=(r.nocase?r.dot?Iee:Ree:r.dot?Mee:Lee)(n):(n=e.match(See))?i=r.dot?_ee:vee:(n=e.match(Aee))&&(i=Bee);let s=ea.fromGlob(e,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let r=this.options,n=r.noglobstar?jee:r.dot?Uee:qee,i=new Set(r.nocase?["i"]:[]),s=e.map(u=>{let c=u.map(f=>{if(f instanceof RegExp)for(let h of f.flags.split(""))i.add(h);return typeof f=="string"?zee(f):f===st?st:f._src});c.forEach((f,h)=>{let d=c[h+1],p=c[h-1];f!==st||p===st||(p===void 0?d!==void 0&&d!==st?c[h+1]="(?:\\/|"+n+"\\/)?"+d:c[h]=n:d===void 0?c[h-1]=p+"(?:\\/|\\/"+n+")?":d!==st&&(c[h-1]=p+"(?:\\/|\\/"+n+"\\/)"+d,c[h+1]=st))});let l=c.filter(f=>f!==st);if(this.partial&&l.length>=1){let f=[];for(let h=1;h<=l.length;h++)f.push(l.slice(0,h).join("/"));return"(?:"+f.join("|")+")"}return l.join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+a+"$",this.partial&&(s="^(?:\\/|"+o+s.slice(1,-1)+a+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,r=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&r)return!0;let n=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let o=i[i.length-1];if(!o)for(let a=i.length-2;!o&&a>=0;a--)o=i[a];for(let a=0;a<s.length;a++){let u=s[a],c=i;if(n.matchBase&&u.length===1&&(c=[o]),this.matchOne(c,u,r))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return Bt.defaults(e).Minimatch}};Bt.AST=ea;Bt.Minimatch=zt;Bt.escape=ta;Bt.unescape=jr;var kT=require("node:url");var Kee=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,cT=new Set,H1=typeof process=="object"&&process?process:{},lT=(t,e,r,n)=>{typeof H1.emitWarning=="function"?H1.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)},m0=globalThis.AbortController,uT=globalThis.AbortSignal;if(typeof m0>"u"){uT=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(n,i){this._onabort.push(i)}},m0=class{constructor(){e()}signal=new uT;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let i of this.signal._onabort)i(n);this.signal.onabort?.(n)}}};let t=H1.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,lT("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var Yee=t=>!cT.has(t),A3e=Symbol("type"),bi=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),fT=t=>bi(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?ra:null:null,ra=class extends Array{constructor(e){super(e),this.fill(0)}},W1=class t{heap;length;static#e=!1;static create(e){let r=fT(e);if(!r)return[];t.#e=!0;let n=new t(e,r);return t.#e=!1,n}constructor(e,r){if(!t.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Es=class t{#e;#r;#t;#n;#o;#a;#f;#u;get perf(){return this.#u}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#c;#m;#h;#l;#i;#x;#D;#p;#y;#w;#g;#S;#v;#b;#F;#E;#_;#s;#R;static unsafeExposeInternals(e){return{starts:e.#v,ttls:e.#b,autopurgeTimers:e.#F,sizes:e.#S,keyMap:e.#h,keyList:e.#l,valList:e.#i,next:e.#x,prev:e.#D,get head(){return e.#p},get tail(){return e.#y},free:e.#w,isBackgroundFetch:r=>e.#d(r),backgroundFetch:(r,n,i,s)=>e.#q(r,n,i,s),moveToTail:r=>e.#M(r),indexes:r=>e.#T(r),rindexes:r=>e.#k(r),isStale:r=>e.#C(r)}}get max(){return this.#e}get maxSize(){return this.#r}get calculatedSize(){return this.#m}get size(){return this.#c}get fetchMethod(){return this.#a}get memoMethod(){return this.#f}get dispose(){return this.#t}get onInsert(){return this.#n}get disposeAfter(){return this.#o}constructor(e){let{max:r=0,ttl:n,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:c,onInsert:l,disposeAfter:f,noDisposeOnSet:h,noUpdateTTL:d,maxSize:p=0,maxEntrySize:m=0,sizeCalculation:x,fetchMethod:D,memoMethod:y,noDeleteOnFetchRejection:b,noDeleteOnStaleGet:C,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:T,ignoreFetchAbort:B,perf:O}=e;if(O!==void 0&&typeof O?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#u=O??Kee,r!==0&&!bi(r))throw new TypeError("max option must be a nonnegative integer");let v=r?fT(r):Array;if(!v)throw new Error("invalid max value: "+r);if(this.#e=r,this.#r=p,this.maxEntrySize=m||this.#r,this.sizeCalculation=x,this.sizeCalculation){if(!this.#r&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(y!==void 0&&typeof y!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#f=y,D!==void 0&&typeof D!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#a=D,this.#_=!!D,this.#h=new Map,this.#l=new Array(r).fill(void 0),this.#i=new Array(r).fill(void 0),this.#x=new v(r),this.#D=new v(r),this.#p=0,this.#y=0,this.#w=W1.create(r),this.#c=0,this.#m=0,typeof c=="function"&&(this.#t=c),typeof l=="function"&&(this.#n=l),typeof f=="function"?(this.#o=f,this.#g=[]):(this.#o=void 0,this.#g=void 0),this.#E=!!this.#t,this.#R=!!this.#n,this.#s=!!this.#o,this.noDisposeOnSet=!!h,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!b,this.allowStaleOnFetchRejection=!!_,this.allowStaleOnFetchAbort=!!T,this.ignoreFetchAbort=!!B,this.maxEntrySize!==0){if(this.#r!==0&&!bi(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!bi(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#W()}if(this.allowStale=!!u,this.noDeleteOnStaleGet=!!C,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=bi(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!bi(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#O()}if(this.#e===0&&this.ttl===0&&this.#r===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#r){let A="LRU_CACHE_UNBOUNDED";Yee(A)&&(cT.add(A),lT("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",A,t))}}getRemainingTTL(e){return this.#h.has(e)?1/0:0}#O(){let e=new ra(this.#e),r=new ra(this.#e);this.#b=e,this.#v=r;let n=this.ttlAutopurge?new Array(this.#e):void 0;this.#F=n,this.#N=(o,a,u=this.#u.now())=>{if(r[o]=a!==0?u:0,e[o]=a,n?.[o]&&(clearTimeout(n[o]),n[o]=void 0),a!==0&&n){let c=setTimeout(()=>{this.#C(o)&&this.#B(this.#l[o],"expire")},a+1);c.unref&&c.unref(),n[o]=c}},this.#A=o=>{r[o]=e[o]!==0?this.#u.now():0},this.#P=(o,a)=>{if(e[a]){let u=e[a],c=r[a];if(!u||!c)return;o.ttl=u,o.start=c,o.now=i||s();let l=o.now-c;o.remainingTTL=u-l}};let i=0,s=()=>{let o=this.#u.now();if(this.ttlResolution>0){i=o;let a=setTimeout(()=>i=0,this.ttlResolution);a.unref&&a.unref()}return o};this.getRemainingTTL=o=>{let a=this.#h.get(o);if(a===void 0)return 0;let u=e[a],c=r[a];if(!u||!c)return 1/0;let l=(i||s())-c;return u-l},this.#C=o=>{let a=r[o],u=e[o];return!!u&&!!a&&(i||s())-a>u}}#A=()=>{};#P=()=>{};#N=()=>{};#C=()=>!1;#W(){let e=new ra(this.#e);this.#m=0,this.#S=e,this.#L=r=>{this.#m-=e[r],e[r]=0},this.#$=(r,n,i,s)=>{if(this.#d(n))return 0;if(!bi(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(n,r),!bi(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#I=(r,n,i)=>{if(e[r]=n,this.#r){let s=this.#r-e[r];for(;this.#m>s;)this.#U(!0)}this.#m+=e[r],i&&(i.entrySize=n,i.totalCalculatedSize=this.#m)}}#L=e=>{};#I=(e,r,n)=>{};#$=(e,r,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#T({allowStale:e=this.allowStale}={}){if(this.#c)for(let r=this.#y;!(!this.#j(r)||((e||!this.#C(r))&&(yield r),r===this.#p));)r=this.#D[r]}*#k({allowStale:e=this.allowStale}={}){if(this.#c)for(let r=this.#p;!(!this.#j(r)||((e||!this.#C(r))&&(yield r),r===this.#y));)r=this.#x[r]}#j(e){return e!==void 0&&this.#h.get(this.#l[e])===e}*entries(){for(let e of this.#T())this.#i[e]!==void 0&&this.#l[e]!==void 0&&!this.#d(this.#i[e])&&(yield[this.#l[e],this.#i[e]])}*rentries(){for(let e of this.#k())this.#i[e]!==void 0&&this.#l[e]!==void 0&&!this.#d(this.#i[e])&&(yield[this.#l[e],this.#i[e]])}*keys(){for(let e of this.#T()){let r=this.#l[e];r!==void 0&&!this.#d(this.#i[e])&&(yield r)}}*rkeys(){for(let e of this.#k()){let r=this.#l[e];r!==void 0&&!this.#d(this.#i[e])&&(yield r)}}*values(){for(let e of this.#T())this.#i[e]!==void 0&&!this.#d(this.#i[e])&&(yield this.#i[e])}*rvalues(){for(let e of this.#k())this.#i[e]!==void 0&&!this.#d(this.#i[e])&&(yield this.#i[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,r={}){for(let n of this.#T()){let i=this.#i[n],s=this.#d(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#l[n],this))return this.get(this.#l[n],r)}}forEach(e,r=this){for(let n of this.#T()){let i=this.#i[n],s=this.#d(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(r,s,this.#l[n],this)}}rforEach(e,r=this){for(let n of this.#k()){let i=this.#i[n],s=this.#d(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(r,s,this.#l[n],this)}}purgeStale(){let e=!1;for(let r of this.#k({allowStale:!0}))this.#C(r)&&(this.#B(this.#l[r],"expire"),e=!0);return e}info(e){let r=this.#h.get(e);if(r===void 0)return;let n=this.#i[r],i=this.#d(n)?n.__staleWhileFetching:n;if(i===void 0)return;let s={value:i};if(this.#b&&this.#v){let o=this.#b[r],a=this.#v[r];if(o&&a){let u=o-(this.#u.now()-a);s.ttl=u,s.start=Date.now()}}return this.#S&&(s.size=this.#S[r]),s}dump(){let e=[];for(let r of this.#T({allowStale:!0})){let n=this.#l[r],i=this.#i[r],s=this.#d(i)?i.__staleWhileFetching:i;if(s===void 0||n===void 0)continue;let o={value:s};if(this.#b&&this.#v){o.ttl=this.#b[r];let a=this.#u.now()-this.#v[r];o.start=Math.floor(Date.now()-a)}this.#S&&(o.size=this.#S[r]),e.unshift([n,o])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let i=Date.now()-n.start;n.start=this.#u.now()-i}this.set(r,n.value,n)}}set(e,r,n={}){if(r===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:u}=n,{noUpdateTTL:c=this.noUpdateTTL}=n,l=this.#$(e,r,n.size||0,a);if(this.maxEntrySize&&l>this.maxEntrySize)return u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this.#B(e,"set"),this;let f=this.#c===0?void 0:this.#h.get(e);if(f===void 0)f=this.#c===0?this.#y:this.#w.length!==0?this.#w.pop():this.#c===this.#e?this.#U(!1):this.#c,this.#l[f]=e,this.#i[f]=r,this.#h.set(e,f),this.#x[this.#y]=f,this.#D[f]=this.#y,this.#y=f,this.#c++,this.#I(f,l,u),u&&(u.set="add"),c=!1,this.#R&&this.#n?.(r,e,"add");else{this.#M(f);let h=this.#i[f];if(r!==h){if(this.#_&&this.#d(h)){h.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:d}=h;d!==void 0&&!o&&(this.#E&&this.#t?.(d,e,"set"),this.#s&&this.#g?.push([d,e,"set"]))}else o||(this.#E&&this.#t?.(h,e,"set"),this.#s&&this.#g?.push([h,e,"set"]));if(this.#L(f),this.#I(f,l,u),this.#i[f]=r,u){u.set="replace";let d=h&&this.#d(h)?h.__staleWhileFetching:h;d!==void 0&&(u.oldValue=d)}}else u&&(u.set="update");this.#R&&this.onInsert?.(r,e,r===h?"update":"replace")}if(i!==0&&!this.#b&&this.#O(),this.#b&&(c||this.#N(f,i,s),u&&this.#P(u,f)),!o&&this.#s&&this.#g){let h=this.#g,d;for(;d=h?.shift();)this.#o?.(...d)}return this}pop(){try{for(;this.#c;){let e=this.#i[this.#p];if(this.#U(!0),this.#d(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#s&&this.#g){let e=this.#g,r;for(;r=e?.shift();)this.#o?.(...r)}}}#U(e){let r=this.#p,n=this.#l[r],i=this.#i[r];return this.#_&&this.#d(i)?i.__abortController.abort(new Error("evicted")):(this.#E||this.#s)&&(this.#E&&this.#t?.(i,n,"evict"),this.#s&&this.#g?.push([i,n,"evict"])),this.#L(r),this.#F?.[r]&&(clearTimeout(this.#F[r]),this.#F[r]=void 0),e&&(this.#l[r]=void 0,this.#i[r]=void 0,this.#w.push(r)),this.#c===1?(this.#p=this.#y=0,this.#w.length=0):this.#p=this.#x[r],this.#h.delete(n),this.#c--,r}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=r,s=this.#h.get(e);if(s!==void 0){let o=this.#i[s];if(this.#d(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#C(s))i&&(i.has="stale",this.#P(i,s));else return n&&this.#A(s),i&&(i.has="hit",this.#P(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,i=this.#h.get(e);if(i===void 0||!n&&this.#C(i))return;let s=this.#i[i];return this.#d(s)?s.__staleWhileFetching:s}#q(e,r,n,i){let s=r===void 0?void 0:this.#i[r];if(this.#d(s))return s;let o=new m0,{signal:a}=n;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let u={signal:o.signal,options:n,context:i},c=(m,x=!1)=>{let{aborted:D}=o.signal,y=n.ignoreFetchAbort&&m!==void 0;if(n.status&&(D&&!x?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,y&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),D&&!y&&!x)return f(o.signal.reason);let b=d,C=this.#i[r];return(C===d||y&&x&&C===void 0)&&(m===void 0?b.__staleWhileFetching!==void 0?this.#i[r]=b.__staleWhileFetching:this.#B(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,m,u.options))),m},l=m=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=m),f(m)),f=m=>{let{aborted:x}=o.signal,D=x&&n.allowStaleOnFetchAbort,y=D||n.allowStaleOnFetchRejection,b=y||n.noDeleteOnFetchRejection,C=d;if(this.#i[r]===d&&(!b||C.__staleWhileFetching===void 0?this.#B(e,"fetch"):D||(this.#i[r]=C.__staleWhileFetching)),y)return n.status&&C.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),C.__staleWhileFetching;if(C.__returned===C)throw m},h=(m,x)=>{let D=this.#a?.(e,s,u);D&&D instanceof Promise&&D.then(y=>m(y===void 0?void 0:y),x),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(m(void 0),n.allowStaleOnFetchAbort&&(m=y=>c(y,!0)))})};n.status&&(n.status.fetchDispatched=!0);let d=new Promise(h).then(c,l),p=Object.assign(d,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.set(e,p,{...u.options,status:void 0}),r=this.#h.get(e)):this.#i[r]=p,p}#d(e){if(!this.#_)return!1;let r=e;return!!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof m0}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:u=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:x=!1,status:D,signal:y}=r;if(!this.#_)return D&&(D.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:D});let b={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:a,size:u,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:p,ignoreFetchAbort:d,status:D,signal:y},C=this.#h.get(e);if(C===void 0){D&&(D.fetch="miss");let _=this.#q(e,C,b,m);return _.__returned=_}else{let _=this.#i[C];if(this.#d(_)){let A=n&&_.__staleWhileFetching!==void 0;return D&&(D.fetch="inflight",A&&(D.returnedStale=!0)),A?_.__staleWhileFetching:_.__returned=_}let T=this.#C(C);if(!x&&!T)return D&&(D.fetch="hit"),this.#M(C),i&&this.#A(C),D&&this.#P(D,C),_;let B=this.#q(e,C,b,m),v=B.__staleWhileFetching!==void 0&&n;return D&&(D.fetch=T?"stale":"refresh",v&&T&&(D.returnedStale=!0)),v?B.__staleWhileFetching:B.__returned=B}}async forceFetch(e,r={}){let n=await this.fetch(e,r);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,r={}){let n=this.#f;if(!n)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:s,...o}=r,a=this.get(e,o);if(!s&&a!==void 0)return a;let u=n(e,a,{options:o,context:i});return this.set(e,u,o),u}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=r,a=this.#h.get(e);if(a!==void 0){let u=this.#i[a],c=this.#d(u);return o&&this.#P(o,a),this.#C(a)?(o&&(o.get="stale"),c?(o&&n&&u.__staleWhileFetching!==void 0&&(o.returnedStale=!0),n?u.__staleWhileFetching:void 0):(s||this.#B(e,"expire"),o&&n&&(o.returnedStale=!0),n?u:void 0)):(o&&(o.get="hit"),c?u.__staleWhileFetching:(this.#M(a),i&&this.#A(a),u))}else o&&(o.get="miss")}#H(e,r){this.#D[r]=e,this.#x[e]=r}#M(e){e!==this.#y&&(e===this.#p?this.#p=this.#x[e]:this.#H(this.#D[e],this.#x[e]),this.#H(this.#y,e),this.#y=e)}delete(e){return this.#B(e,"delete")}#B(e,r){let n=!1;if(this.#c!==0){let i=this.#h.get(e);if(i!==void 0)if(this.#F?.[i]&&(clearTimeout(this.#F?.[i]),this.#F[i]=void 0),n=!0,this.#c===1)this.#G(r);else{this.#L(i);let s=this.#i[i];if(this.#d(s)?s.__abortController.abort(new Error("deleted")):(this.#E||this.#s)&&(this.#E&&this.#t?.(s,e,r),this.#s&&this.#g?.push([s,e,r])),this.#h.delete(e),this.#l[i]=void 0,this.#i[i]=void 0,i===this.#y)this.#y=this.#D[i];else if(i===this.#p)this.#p=this.#x[i];else{let o=this.#D[i];this.#x[o]=this.#x[i];let a=this.#x[i];this.#D[a]=this.#D[i]}this.#c--,this.#w.push(i)}}if(this.#s&&this.#g?.length){let i=this.#g,s;for(;s=i?.shift();)this.#o?.(...s)}return n}clear(){return this.#G("delete")}#G(e){for(let r of this.#k({allowStale:!0})){let n=this.#i[r];if(this.#d(n))n.__abortController.abort(new Error("deleted"));else{let i=this.#l[r];this.#E&&this.#t?.(n,i,e),this.#s&&this.#g?.push([n,i,e])}}if(this.#h.clear(),this.#i.fill(void 0),this.#l.fill(void 0),this.#b&&this.#v){this.#b.fill(0),this.#v.fill(0);for(let r of this.#F??[])r!==void 0&&clearTimeout(r);this.#F?.fill(void 0)}if(this.#S&&this.#S.fill(0),this.#p=0,this.#y=0,this.#w.length=0,this.#m=0,this.#c=0,this.#s&&this.#g){let r=this.#g,n;for(;n=r?.shift();)this.#o?.(...n)}}};var sa=require("node:path"),FT=require("node:url"),fn=require("fs"),ste=P(require("node:fs"),1),Ci=require("node:fs/promises");var E0=require("node:events"),J1=P(require("node:stream"),1),DT=require("node:string_decoder"),hT=typeof process=="object"&&process?process:{stdout:null,stderr:null},Zee=t=>!!t&&typeof t=="object"&&(t instanceof Ei||t instanceof J1.default||Jee(t)||Xee(t)),Jee=t=>!!t&&typeof t=="object"&&t instanceof E0.EventEmitter&&typeof t.pipe=="function"&&t.pipe!==J1.default.Writable.prototype.pipe,Xee=t=>!!t&&typeof t=="object"&&t instanceof E0.EventEmitter&&typeof t.write=="function"&&typeof t.end=="function",jn=Symbol("EOF"),Un=Symbol("maybeEmitEnd"),Fi=Symbol("emittedEnd"),D0=Symbol("emittingEnd"),Ac=Symbol("emittedError"),g0=Symbol("closed"),dT=Symbol("read"),x0=Symbol("flush"),pT=Symbol("flushChunk"),Ur=Symbol("encoding"),na=Symbol("decoder"),Xe=Symbol("flowing"),Bc=Symbol("paused"),ia=Symbol("resume"),Qe=Symbol("buffer"),Tt=Symbol("pipes"),et=Symbol("bufferLength"),G1=Symbol("bufferPush"),y0=Symbol("bufferShift"),ht=Symbol("objectMode"),Ue=Symbol("destroyed"),V1=Symbol("error"),z1=Symbol("emitData"),mT=Symbol("emitEnd"),K1=Symbol("emitEnd2"),cn=Symbol("async"),Y1=Symbol("abort"),b0=Symbol("aborted"),Tc=Symbol("signal"),Cs=Symbol("dataListeners"),Kt=Symbol("discarded"),kc=t=>Promise.resolve().then(t),Qee=t=>t(),ete=t=>t==="end"||t==="finish"||t==="prefinish",tte=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,rte=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),F0=class{src;dest;opts;ondrain;constructor(e,r,n){this.src=e,this.dest=r,this.opts=n,this.ondrain=()=>e[ia](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Z1=class extends F0{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,r,n){super(e,r,n),this.proxyErrors=i=>r.emit("error",i),e.on("error",this.proxyErrors)}},nte=t=>!!t.objectMode,ite=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",Ei=class extends E0.EventEmitter{[Xe]=!1;[Bc]=!1;[Tt]=[];[Qe]=[];[ht];[Ur];[cn];[na];[jn]=!1;[Fi]=!1;[D0]=!1;[g0]=!1;[Ac]=null;[et]=0;[Ue]=!1;[Tc];[b0]=!1;[Cs]=0;[Kt]=!1;writable=!0;readable=!0;constructor(...e){let r=e[0]||{};if(super(),r.objectMode&&typeof r.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");nte(r)?(this[ht]=!0,this[Ur]=null):ite(r)?(this[Ur]=r.encoding,this[ht]=!1):(this[ht]=!1,this[Ur]=null),this[cn]=!!r.async,this[na]=this[Ur]?new DT.StringDecoder(this[Ur]):null,r&&r.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[Qe]}),r&&r.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[Tt]});let{signal:n}=r;n&&(this[Tc]=n,n.aborted?this[Y1]():n.addEventListener("abort",()=>this[Y1]()))}get bufferLength(){return this[et]}get encoding(){return this[Ur]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[ht]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[cn]}set async(e){this[cn]=this[cn]||!!e}[Y1](){this[b0]=!0,this.emit("abort",this[Tc]?.reason),this.destroy(this[Tc]?.reason)}get aborted(){return this[b0]}set aborted(e){}write(e,r,n){if(this[b0])return!1;if(this[jn])throw new Error("write after end");if(this[Ue])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof r=="function"&&(n=r,r="utf8"),r||(r="utf8");let i=this[cn]?kc:Qee;if(!this[ht]&&!Buffer.isBuffer(e)){if(rte(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(tte(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[ht]?(this[Xe]&&this[et]!==0&&this[x0](!0),this[Xe]?this.emit("data",e):this[G1](e),this[et]!==0&&this.emit("readable"),n&&i(n),this[Xe]):e.length?(typeof e=="string"&&!(r===this[Ur]&&!this[na]?.lastNeed)&&(e=Buffer.from(e,r)),Buffer.isBuffer(e)&&this[Ur]&&(e=this[na].write(e)),this[Xe]&&this[et]!==0&&this[x0](!0),this[Xe]?this.emit("data",e):this[G1](e),this[et]!==0&&this.emit("readable"),n&&i(n),this[Xe]):(this[et]!==0&&this.emit("readable"),n&&i(n),this[Xe])}read(e){if(this[Ue])return null;if(this[Kt]=!1,this[et]===0||e===0||e&&e>this[et])return this[Un](),null;this[ht]&&(e=null),this[Qe].length>1&&!this[ht]&&(this[Qe]=[this[Ur]?this[Qe].join(""):Buffer.concat(this[Qe],this[et])]);let r=this[dT](e||null,this[Qe][0]);return this[Un](),r}[dT](e,r){if(this[ht])this[y0]();else{let n=r;e===n.length||e===null?this[y0]():typeof n=="string"?(this[Qe][0]=n.slice(e),r=n.slice(0,e),this[et]-=e):(this[Qe][0]=n.subarray(e),r=n.subarray(0,e),this[et]-=e)}return this.emit("data",r),!this[Qe].length&&!this[jn]&&this.emit("drain"),r}end(e,r,n){return typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r="utf8"),e!==void 0&&this.write(e,r),n&&this.once("end",n),this[jn]=!0,this.writable=!1,(this[Xe]||!this[Bc])&&this[Un](),this}[ia](){this[Ue]||(!this[Cs]&&!this[Tt].length&&(this[Kt]=!0),this[Bc]=!1,this[Xe]=!0,this.emit("resume"),this[Qe].length?this[x0]():this[jn]?this[Un]():this.emit("drain"))}resume(){return this[ia]()}pause(){this[Xe]=!1,this[Bc]=!0,this[Kt]=!1}get destroyed(){return this[Ue]}get flowing(){return this[Xe]}get paused(){return this[Bc]}[G1](e){this[ht]?this[et]+=1:this[et]+=e.length,this[Qe].push(e)}[y0](){return this[ht]?this[et]-=1:this[et]-=this[Qe][0].length,this[Qe].shift()}[x0](e=!1){do;while(this[pT](this[y0]())&&this[Qe].length);!e&&!this[Qe].length&&!this[jn]&&this.emit("drain")}[pT](e){return this.emit("data",e),this[Xe]}pipe(e,r){if(this[Ue])return e;this[Kt]=!1;let n=this[Fi];return r=r||{},e===hT.stdout||e===hT.stderr?r.end=!1:r.end=r.end!==!1,r.proxyErrors=!!r.proxyErrors,n?r.end&&e.end():(this[Tt].push(r.proxyErrors?new Z1(this,e,r):new F0(this,e,r)),this[cn]?kc(()=>this[ia]()):this[ia]()),e}unpipe(e){let r=this[Tt].find(n=>n.dest===e);r&&(this[Tt].length===1?(this[Xe]&&this[Cs]===0&&(this[Xe]=!1),this[Tt]=[]):this[Tt].splice(this[Tt].indexOf(r),1),r.unpipe())}addListener(e,r){return this.on(e,r)}on(e,r){let n=super.on(e,r);if(e==="data")this[Kt]=!1,this[Cs]++,!this[Tt].length&&!this[Xe]&&this[ia]();else if(e==="readable"&&this[et]!==0)super.emit("readable");else if(ete(e)&&this[Fi])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Ac]){let i=r;this[cn]?kc(()=>i.call(this,this[Ac])):i.call(this,this[Ac])}return n}removeListener(e,r){return this.off(e,r)}off(e,r){let n=super.off(e,r);return e==="data"&&(this[Cs]=this.listeners("data").length,this[Cs]===0&&!this[Kt]&&!this[Tt].length&&(this[Xe]=!1)),n}removeAllListeners(e){let r=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Cs]=0,!this[Kt]&&!this[Tt].length&&(this[Xe]=!1)),r}get emittedEnd(){return this[Fi]}[Un](){!this[D0]&&!this[Fi]&&!this[Ue]&&this[Qe].length===0&&this[jn]&&(this[D0]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[g0]&&this.emit("close"),this[D0]=!1)}emit(e,...r){let n=r[0];if(e!=="error"&&e!=="close"&&e!==Ue&&this[Ue])return!1;if(e==="data")return!this[ht]&&!n?!1:this[cn]?(kc(()=>this[z1](n)),!0):this[z1](n);if(e==="end")return this[mT]();if(e==="close"){if(this[g0]=!0,!this[Fi]&&!this[Ue])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[Ac]=n,super.emit(V1,n);let s=!this[Tc]||this.listeners("error").length?super.emit("error",n):!1;return this[Un](),s}else if(e==="resume"){let s=super.emit("resume");return this[Un](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let i=super.emit(e,...r);return this[Un](),i}[z1](e){for(let n of this[Tt])n.dest.write(e)===!1&&this.pause();let r=this[Kt]?!1:super.emit("data",e);return this[Un](),r}[mT](){return this[Fi]?!1:(this[Fi]=!0,this.readable=!1,this[cn]?(kc(()=>this[K1]()),!0):this[K1]())}[K1](){if(this[na]){let r=this[na].end();if(r){for(let n of this[Tt])n.dest.write(r);this[Kt]||super.emit("data",r)}}for(let r of this[Tt])r.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[ht]||(e.dataLength=0);let r=this.promise();return this.on("data",n=>{e.push(n),this[ht]||(e.dataLength+=n.length)}),await r,e}async concat(){if(this[ht])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Ur]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,r)=>{this.on(Ue,()=>r(new Error("stream destroyed"))),this.on("error",n=>r(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Kt]=!1;let e=!1,r=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return r();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[jn])return r();let s,o,a=f=>{this.off("data",u),this.off("end",c),this.off(Ue,l),r(),o(f)},u=f=>{this.off("error",a),this.off("end",c),this.off(Ue,l),this.pause(),s({value:f,done:!!this[jn]})},c=()=>{this.off("error",a),this.off("data",u),this.off(Ue,l),r(),s({done:!0,value:void 0})},l=()=>a(new Error("stream destroyed"));return new Promise((f,h)=>{o=h,s=f,this.once(Ue,l),this.once("error",a),this.once("end",c),this.once("data",u)})},throw:r,return:r,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Kt]=!1;let e=!1,r=()=>(this.pause(),this.off(V1,r),this.off(Ue,r),this.off("end",r),e=!0,{done:!0,value:void 0}),n=()=>{if(e)return r();let i=this.read();return i===null?r():{done:!1,value:i}};return this.once("end",r),this.once(V1,r),this.once(Ue,r),{next:n,throw:r,return:r,[Symbol.iterator](){return this}}}destroy(e){if(this[Ue])return e?this.emit("error",e):this.emit(Ue),this;this[Ue]=!0,this[Kt]=!0,this[Qe].length=0,this[et]=0;let r=this;return typeof r.close=="function"&&!this[g0]&&r.close(),e?this.emit("error",e):this.emit(Ue),this}static get isStream(){return Zee}};var ote=fn.realpathSync.native,Pc={lstatSync:fn.lstatSync,readdir:fn.readdir,readdirSync:fn.readdirSync,readlinkSync:fn.readlinkSync,realpathSync:ote,promises:{lstat:Ci.lstat,readdir:Ci.readdir,readlink:Ci.readlink,realpath:Ci.realpath}},ET=t=>!t||t===Pc||t===ste?Pc:{...Pc,...t,promises:{...Pc.promises,...t.promises||{}}},CT=/^\\\\\?\\([a-z]:)\\?$/i,ate=t=>t.replace(/\//g,"\\").replace(CT,"$1\\"),ute=/[\\\/]/,gr=0,wT=1,ST=2,ln=4,vT=6,_T=8,ws=10,AT=12,Dr=15,Oc=~Dr,X1=16,gT=32,Rc=64,qr=128,C0=256,S0=512,xT=Rc|qr|S0,cte=1023,Q1=t=>t.isFile()?_T:t.isDirectory()?ln:t.isSymbolicLink()?ws:t.isCharacterDevice()?ST:t.isBlockDevice()?vT:t.isSocket()?AT:t.isFIFO()?wT:gr,yT=new Es({max:2**12}),Ic=t=>{let e=yT.get(t);if(e)return e;let r=t.normalize("NFKD");return yT.set(t,r),r},bT=new Es({max:2**12}),w0=t=>{let e=bT.get(t);if(e)return e;let r=Ic(t.toLowerCase());return bT.set(t,r),r},v0=class extends Es{constructor(){super({max:256})}},ey=class extends Es{constructor(e=16*1024){super({maxSize:e,sizeCalculation:r=>r.length+1})}},BT=Symbol("PathScurry setAsCwd"),dt=class{name;root;roots;parent;nocase;isCWD=!1;#e;#r;get dev(){return this.#r}#t;get mode(){return this.#t}#n;get nlink(){return this.#n}#o;get uid(){return this.#o}#a;get gid(){return this.#a}#f;get rdev(){return this.#f}#u;get blksize(){return this.#u}#c;get ino(){return this.#c}#m;get size(){return this.#m}#h;get blocks(){return this.#h}#l;get atimeMs(){return this.#l}#i;get mtimeMs(){return this.#i}#x;get ctimeMs(){return this.#x}#D;get birthtimeMs(){return this.#D}#p;get atime(){return this.#p}#y;get mtime(){return this.#y}#w;get ctime(){return this.#w}#g;get birthtime(){return this.#g}#S;#v;#b;#F;#E;#_;#s;#R;#O;#A;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,r=gr,n,i,s,o,a){this.name=e,this.#S=s?w0(e):Ic(e),this.#s=r&cte,this.nocase=s,this.roots=i,this.root=n||this,this.#R=o,this.#b=a.fullpath,this.#E=a.relative,this.#_=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=ET(a.fs)}depth(){return this.#v!==void 0?this.#v:this.parent?this.#v=this.parent.depth()+1:this.#v=0}childrenCache(){return this.#R}resolve(e){if(!e)return this;let r=this.getRootString(e),i=e.substring(r.length).split(this.splitSep);return r?this.getRoot(r).#P(i):this.#P(i)}#P(e){let r=this;for(let n of e)r=r.child(n);return r}children(){let e=this.#R.get(this);if(e)return e;let r=Object.assign([],{provisional:0});return this.#R.set(this,r),this.#s&=~X1,r}child(e,r){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),i=this.nocase?w0(e):Ic(e);for(let u of n)if(u.#S===i)return u;let s=this.parent?this.sep:"",o=this.#b?this.#b+s+e:void 0,a=this.newChild(e,gr,{...r,parent:this,fullpath:o});return this.canReaddir()||(a.#s|=qr),n.push(a),a}relative(){if(this.isCWD)return"";if(this.#E!==void 0)return this.#E;let e=this.name,r=this.parent;if(!r)return this.#E=this.name;let n=r.relative();return n+(!n||!r.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#_!==void 0)return this.#_;let e=this.name,r=this.parent;if(!r)return this.#_=this.fullpathPosix();let n=r.relativePosix();return n+(!n||!r.parent?"":"/")+e}fullpath(){if(this.#b!==void 0)return this.#b;let e=this.name,r=this.parent;if(!r)return this.#b=this.name;let i=r.fullpath()+(r.parent?this.sep:"")+e;return this.#b=i}fullpathPosix(){if(this.#F!==void 0)return this.#F;if(this.sep==="/")return this.#F=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#F=`//?/${i}`:this.#F=i}let e=this.parent,r=e.fullpathPosix(),n=r+(!r||!e.parent?"":"/")+this.name;return this.#F=n}isUnknown(){return(this.#s&Dr)===gr}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#s&Dr)===_T}isDirectory(){return(this.#s&Dr)===ln}isCharacterDevice(){return(this.#s&Dr)===ST}isBlockDevice(){return(this.#s&Dr)===vT}isFIFO(){return(this.#s&Dr)===wT}isSocket(){return(this.#s&Dr)===AT}isSymbolicLink(){return(this.#s&ws)===ws}lstatCached(){return this.#s&gT?this:void 0}readlinkCached(){return this.#O}realpathCached(){return this.#A}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#O)return!0;if(!this.parent)return!1;let e=this.#s&Dr;return!(e!==gr&&e!==ws||this.#s&C0||this.#s&qr)}calledReaddir(){return!!(this.#s&X1)}isENOENT(){return!!(this.#s&qr)}isNamed(e){return this.nocase?this.#S===w0(e):this.#S===Ic(e)}async readlink(){let e=this.#O;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=await this.#e.promises.readlink(this.fullpath()),n=(await this.parent.realpath())?.resolve(r);if(n)return this.#O=n}catch(r){this.#k(r.code);return}}readlinkSync(){let e=this.#O;if(e)return e;if(this.canReadlink()&&this.parent)try{let r=this.#e.readlinkSync(this.fullpath()),n=this.parent.realpathSync()?.resolve(r);if(n)return this.#O=n}catch(r){this.#k(r.code);return}}#N(e){this.#s|=X1;for(let r=e.provisional;r<e.length;r++){let n=e[r];n&&n.#C()}}#C(){this.#s&qr||(this.#s=(this.#s|qr)&Oc,this.#W())}#W(){let e=this.children();e.provisional=0;for(let r of e)r.#C()}#L(){this.#s|=S0,this.#I()}#I(){if(this.#s&Rc)return;let e=this.#s;(e&Dr)===ln&&(e&=Oc),this.#s=e|Rc,this.#W()}#$(e=""){e==="ENOTDIR"||e==="EPERM"?this.#I():e==="ENOENT"?this.#C():this.children().provisional=0}#T(e=""){e==="ENOTDIR"?this.parent.#I():e==="ENOENT"&&this.#C()}#k(e=""){let r=this.#s;r|=C0,e==="ENOENT"&&(r|=qr),(e==="EINVAL"||e==="UNKNOWN")&&(r&=Oc),this.#s=r,e==="ENOTDIR"&&this.parent&&this.parent.#I()}#j(e,r){return this.#q(e,r)||this.#U(e,r)}#U(e,r){let n=Q1(e),i=this.newChild(e.name,n,{parent:this}),s=i.#s&Dr;return s!==ln&&s!==ws&&s!==gr&&(i.#s|=Rc),r.unshift(i),r.provisional++,i}#q(e,r){for(let n=r.provisional;n<r.length;n++){let i=r[n];if((this.nocase?w0(e.name):Ic(e.name))===i.#S)return this.#d(e,i,n,r)}}#d(e,r,n,i){let s=r.name;return r.#s=r.#s&Oc|Q1(e),s!==e.name&&(r.name=e.name),n!==i.provisional&&(n===i.length-1?i.pop():i.splice(n,1),i.unshift(r)),i.provisional++,r}async lstat(){if((this.#s&qr)===0)try{return this.#H(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#T(e.code)}}lstatSync(){if((this.#s&qr)===0)try{return this.#H(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#T(e.code)}}#H(e){let{atime:r,atimeMs:n,birthtime:i,birthtimeMs:s,blksize:o,blocks:a,ctime:u,ctimeMs:c,dev:l,gid:f,ino:h,mode:d,mtime:p,mtimeMs:m,nlink:x,rdev:D,size:y,uid:b}=e;this.#p=r,this.#l=n,this.#g=i,this.#D=s,this.#u=o,this.#h=a,this.#w=u,this.#x=c,this.#r=l,this.#a=f,this.#c=h,this.#t=d,this.#y=p,this.#i=m,this.#n=x,this.#f=D,this.#m=y,this.#o=b;let C=Q1(e);this.#s=this.#s&Oc|C|gT,C!==gr&&C!==ln&&C!==ws&&(this.#s|=Rc)}#M=[];#B=!1;#G(e){this.#B=!1;let r=this.#M.slice();this.#M.length=0,r.forEach(n=>n(null,e))}readdirCB(e,r=!1){if(!this.canReaddir()){r?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let s=n.slice(0,n.provisional);r?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#M.push(e),this.#B)return;this.#B=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(s,o)=>{if(s)this.#$(s.code),n.provisional=0;else{for(let a of o)this.#j(a,n);this.#N(n)}this.#G(n.slice(0,n.provisional))})}#V;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();if(this.#V)await this.#V;else{let n=()=>{};this.#V=new Promise(i=>n=i);try{for(let i of await this.#e.promises.readdir(r,{withFileTypes:!0}))this.#j(i,e);this.#N(e)}catch(i){this.#$(i.code),e.provisional=0}this.#V=void 0,n()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let r=this.fullpath();try{for(let n of this.#e.readdirSync(r,{withFileTypes:!0}))this.#j(n,e);this.#N(e)}catch(n){this.#$(n.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#s&xT)return!1;let e=Dr&this.#s;return e===gr||e===ln||e===ws}shouldWalk(e,r){return(this.#s&ln)===ln&&!(this.#s&xT)&&!e.has(this)&&(!r||r(this))}async realpath(){if(this.#A)return this.#A;if(!((S0|C0|qr)&this.#s))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#A=this.resolve(e)}catch{this.#L()}}realpathSync(){if(this.#A)return this.#A;if(!((S0|C0|qr)&this.#s))try{let e=this.#e.realpathSync(this.fullpath());return this.#A=this.resolve(e)}catch{this.#L()}}[BT](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let r=new Set([]),n=[],i=this;for(;i&&i.parent;)r.add(i),i.#E=n.join(this.sep),i.#_=n.join("/"),i=i.parent,n.push("..");for(i=e;i&&i.parent&&!r.has(i);)i.#E=void 0,i.#_=void 0,i=i.parent}},_0=class t extends dt{sep="\\";splitSep=ute;constructor(e,r=gr,n,i,s,o,a){super(e,r,n,i,s,o,a)}newChild(e,r=gr,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return sa.win32.parse(e).root}getRoot(e){if(e=ate(e.toUpperCase()),e===this.root.name)return this.root;for(let[r,n]of Object.entries(this.roots))if(this.sameRoot(e,r))return this.roots[e]=n;return this.roots[e]=new oa(e,this).root}sameRoot(e,r=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(CT,"$1\\"),e===r}},A0=class t extends dt{splitSep="/";sep="/";constructor(e,r=gr,n,i,s,o,a){super(e,r,n,i,s,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,r=gr,n={}){return new t(e,r,this.root,this.roots,this.nocase,this.childrenCache(),n)}},B0=class{root;rootPath;roots;cwd;#e;#r;#t;nocase;#n;constructor(e=process.cwd(),r,n,{nocase:i,childrenCacheSize:s=16*1024,fs:o=Pc}={}){this.#n=ET(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,FT.fileURLToPath)(e));let a=r.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new v0,this.#r=new v0,this.#t=new ey(s);let u=a.substring(this.rootPath.length).split(n);if(u.length===1&&!u[0]&&u.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#n),this.roots[this.rootPath]=this.root;let c=this.root,l=u.length-1,f=r.sep,h=this.rootPath,d=!1;for(let p of u){let m=l--;c=c.child(p,{relative:new Array(m).fill("..").join(f),relativePosix:new Array(m).fill("..").join("/"),fullpath:h+=(d?"":f)+p}),d=!0}this.cwd=c}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#t}resolve(...e){let r="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(r=r?`${o}/${r}`:o,this.isAbsolute(o)))break}let n=this.#e.get(r);if(n!==void 0)return n;let i=this.cwd.resolve(r).fullpath();return this.#e.set(r,i),i}resolvePosix(...e){let r="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(r=r?`${o}/${r}`:o,this.isAbsolute(o)))break}let n=this.#r.get(r);if(n!==void 0)return n;let i=this.cwd.resolve(r).fullpathPosix();return this.#r.set(r,i),i}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof dt||(r=e,e=this.cwd);let{withFileTypes:n}=r;if(e.canReaddir()){let i=await e.readdir();return n?i:i.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,r={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof dt||(r=e,e=this.cwd);let{withFileTypes:n=!0}=r;return e.canReaddir()?n?e.readdirSync():e.readdirSync().map(i=>i.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof dt||(r=e.withFileTypes,e=this.cwd);let n=await e.readlink();return r?n:n?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof dt||(r=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return r?n:n?.fullpath()}async realpath(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof dt||(r=e.withFileTypes,e=this.cwd);let n=await e.realpath();return r?n:n?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:r}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof dt||(r=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return r?n:n?.fullpath()}async walk(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof dt||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=r,a=[];(!s||s(e))&&a.push(n?e:e.fullpath());let u=new Set,c=(f,h)=>{u.add(f),f.readdirCB((d,p)=>{if(d)return h(d);let m=p.length;if(!m)return h();let x=()=>{--m===0&&h()};for(let D of p)(!s||s(D))&&a.push(n?D:D.fullpath()),i&&D.isSymbolicLink()?D.realpath().then(y=>y?.isUnknown()?y.lstat():y).then(y=>y?.shouldWalk(u,o)?c(y,x):x()):D.shouldWalk(u,o)?c(D,x):x()},!0)},l=e;return new Promise((f,h)=>{c(l,d=>{if(d)return h(d);f(a)})})}walkSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof dt||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=r,a=[];(!s||s(e))&&a.push(n?e:e.fullpath());let u=new Set([e]);for(let c of u){let l=c.readdirSync();for(let f of l){(!s||s(f))&&a.push(n?f:f.fullpath());let h=f;if(f.isSymbolicLink()){if(!(i&&(h=f.realpathSync())))continue;h.isUnknown()&&h.lstatSync()}h.shouldWalk(u,o)&&u.add(h)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,r={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof dt||(r=e,e=this.cwd),this.stream(e,r)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof dt||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=r;(!s||s(e))&&(yield n?e:e.fullpath());let a=new Set([e]);for(let u of a){let c=u.readdirSync();for(let l of c){(!s||s(l))&&(yield n?l:l.fullpath());let f=l;if(l.isSymbolicLink()){if(!(i&&(f=l.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(a,o)&&a.add(f)}}}stream(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof dt||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=r,a=new Ei({objectMode:!0});(!s||s(e))&&a.write(n?e:e.fullpath());let u=new Set,c=[e],l=0,f=()=>{let h=!1;for(;!h;){let d=c.shift();if(!d){l===0&&a.end();return}l++,u.add(d);let p=(x,D,y=!1)=>{if(x)return a.emit("error",x);if(i&&!y){let b=[];for(let C of D)C.isSymbolicLink()&&b.push(C.realpath().then(_=>_?.isUnknown()?_.lstat():_));if(b.length){Promise.all(b).then(()=>p(null,D,!0));return}}for(let b of D)b&&(!s||s(b))&&(a.write(n?b:b.fullpath())||(h=!0));l--;for(let b of D){let C=b.realpathCached()||b;C.shouldWalk(u,o)&&c.push(C)}h&&!a.flowing?a.once("drain",f):m||f()},m=!0;d.readdirCB(p,!0),m=!1}};return f(),a}streamSync(e=this.cwd,r={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof dt||(r=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=r,a=new Ei({objectMode:!0}),u=new Set;(!s||s(e))&&a.write(n?e:e.fullpath());let c=[e],l=0,f=()=>{let h=!1;for(;!h;){let d=c.shift();if(!d){l===0&&a.end();return}l++,u.add(d);let p=d.readdirSync();for(let m of p)(!s||s(m))&&(a.write(n?m:m.fullpath())||(h=!0));l--;for(let m of p){let x=m;if(m.isSymbolicLink()){if(!(i&&(x=m.realpathSync())))continue;x.isUnknown()&&x.lstatSync()}x.shouldWalk(u,o)&&c.push(x)}}h&&!a.flowing&&a.once("drain",f)};return f(),a}chdir(e=this.cwd){let r=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[BT](r)}},oa=class extends B0{sep="\\";constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,sa.win32,"\\",{...r,nocase:n}),this.nocase=n;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return sa.win32.parse(e).root.toUpperCase()}newRoot(e){return new _0(this.rootPath,ln,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},aa=class extends B0{sep="/";constructor(e=process.cwd(),r={}){let{nocase:n=!1}=r;super(e,sa.posix,"/",{...r,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new A0(this.rootPath,ln,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},Mc=class extends aa{constructor(e=process.cwd(),r={}){let{nocase:n=!0}=r;super(e,{...r,nocase:n})}},P3e=process.platform==="win32"?_0:A0,TT=process.platform==="win32"?oa:process.platform==="darwin"?Mc:aa;var lte=t=>t.length>=1,fte=t=>t.length>=1,ua=class t{#e;#r;#t;length;#n;#o;#a;#f;#u;#c;#m=!0;constructor(e,r,n,i){if(!lte(e))throw new TypeError("empty pattern list");if(!fte(r))throw new TypeError("empty glob list");if(r.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,n<0||n>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#r=r,this.#t=n,this.#n=i,this.#t===0){if(this.isUNC()){let[s,o,a,u,...c]=this.#e,[l,f,h,d,...p]=this.#r;c[0]===""&&(c.shift(),p.shift());let m=[s,o,a,u,""].join("/"),x=[l,f,h,d,""].join("/");this.#e=[m,...c],this.#r=[x,...p],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...o]=this.#e,[a,...u]=this.#r;o[0]===""&&(o.shift(),u.shift());let c=s+"/",l=a+"/";this.#e=[c,...o],this.#r=[l,...u],this.length=this.#e.length}}}pattern(){return this.#e[this.#t]}isString(){return typeof this.#e[this.#t]=="string"}isGlobstar(){return this.#e[this.#t]===st}isRegExp(){return this.#e[this.#t]instanceof RegExp}globString(){return this.#a=this.#a||(this.#t===0?this.isAbsolute()?this.#r[0]+this.#r.slice(1).join("/"):this.#r.join("/"):this.#r.slice(this.#t).join("/"))}hasMore(){return this.length>this.#t+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new t(this.#e,this.#r,this.#t+1,this.#n),this.#o.#c=this.#c,this.#o.#u=this.#u,this.#o.#f=this.#f,this.#o):this.#o=null}isUNC(){let e=this.#e;return this.#u!==void 0?this.#u:this.#u=this.#n==="win32"&&this.#t===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#f!==void 0?this.#f:this.#f=this.#n==="win32"&&this.#t===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#c!==void 0?this.#c:this.#c=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#t===0?e:""}checkFollowGlobstar(){return!(this.#t===0||!this.isGlobstar()||!this.#m)}markFollowGlobstar(){return this.#t===0||!this.isGlobstar()||!this.#m?!1:(this.#m=!1,!0)}};var hte=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",ca=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:r,nocase:n,noext:i,noglobstar:s,platform:o=hte}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:r,nocase:n,noext:i,noglobstar:s,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let r=new zt(e,this.mmopts);for(let n=0;n<r.set.length;n++){let i=r.set[n],s=r.globParts[n];if(!i||!s)throw new Error("invalid pattern object");for(;i[0]==="."&&s[0]===".";)i.shift(),s.shift();let o=new ua(i,s,0,this.platform),a=new zt(o.globString(),this.mmopts),u=s[s.length-1]==="**",c=o.isAbsolute();c?this.absolute.push(a):this.relative.push(a),u&&(c?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(e){let r=e.fullpath(),n=`${r}/`,i=e.relative()||".",s=`${i}/`;for(let o of this.relative)if(o.match(i)||o.match(s))return!0;for(let o of this.absolute)if(o.match(r)||o.match(n))return!0;return!1}childrenIgnored(e){let r=e.fullpath()+"/",n=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(n))return!0;for(let i of this.absoluteChildren)if(i.match(r))return!0;return!1}};var ty=class t{store;constructor(e=new Map){this.store=e}copy(){return new t(new Map(this.store))}hasWalked(e,r){return this.store.get(e.fullpath())?.has(r.globString())}storeWalked(e,r){let n=e.fullpath(),i=this.store.get(n);i?i.add(r.globString()):this.store.set(n,new Set([r.globString()]))}},ry=class{store=new Map;add(e,r,n){let i=(r?2:0)|(n?1:0),s=this.store.get(e);this.store.set(e,s===void 0?i:i&s)}entries(){return[...this.store.entries()].map(([e,r])=>[e,!!(r&2),!!(r&1)])}},ny=class{store=new Map;add(e,r){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(i=>i.globString()===r.globString())||n.push(r):this.store.set(e,[r])}get(e){let r=this.store.get(e);if(!r)throw new Error("attempting to walk unknown path");return r}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},Lc=class t{hasWalkedCache;matches=new ry;subwalks=new ny;patterns;follow;dot;opts;constructor(e,r){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=r?r.copy():new ty}processPatterns(e,r){this.patterns=r;let n=r.map(i=>[e,i]);for(let[i,s]of n){this.hasWalkedCache.storeWalked(i,s);let o=s.root(),a=s.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let f=s.rest();if(f)s=f;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let u,c,l=!1;for(;typeof(u=s.pattern())=="string"&&(c=s.rest());)i=i.resolve(u),s=c,l=!0;if(u=s.pattern(),c=s.rest(),l){if(this.hasWalkedCache.hasWalked(i,s))continue;this.hasWalkedCache.storeWalked(i,s)}if(typeof u=="string"){let f=u===".."||u===""||u===".";this.matches.add(i.resolve(u),a,f);continue}else if(u===st){(!i.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(i,s);let f=c?.pattern(),h=c?.rest();if(!c||(f===""||f===".")&&!h)this.matches.add(i,a,f===""||f===".");else if(f===".."){let d=i.parent||i;h?this.hasWalkedCache.hasWalked(d,h)||this.subwalks.add(d,h):this.matches.add(d,a,!0)}}else u instanceof RegExp&&this.subwalks.add(i,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new t(this.opts,this.hasWalkedCache)}filterEntries(e,r){let n=this.subwalks.get(e),i=this.child();for(let s of r)for(let o of n){let a=o.isAbsolute(),u=o.pattern(),c=o.rest();u===st?i.testGlobstar(s,o,c,a):u instanceof RegExp?i.testRegExp(s,u,c,a):i.testString(s,u,c,a)}return i}testGlobstar(e,r,n,i){if((this.dot||!e.name.startsWith("."))&&(r.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,r):e.isSymbolicLink()&&(n&&r.checkFollowGlobstar()?this.subwalks.add(e,n):r.markFollowGlobstar()&&this.subwalks.add(e,r)))),n){let s=n.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,n.rest(),i);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,n)}else s instanceof RegExp&&this.testRegExp(e,s,n.rest(),i)}}testRegExp(e,r,n,i){r.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}testString(e,r,n,i){e.isNamed(r)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}};var dte=(t,e)=>typeof t=="string"?new ca([t],e):Array.isArray(t)?new ca(t,e):t,T0=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#r;#t;signal;maxDepth;includeChildMatches;constructor(e,r,n){if(this.patterns=e,this.path=r,this.opts=n,this.#t=!n.posix&&n.platform==="win32"?"\\":"/",this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#r=dte(n.ignore??[],n),!this.includeChildMatches&&typeof this.#r.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#n(e){return this.seen.has(e)||!!this.#r?.ignored?.(e)}#o(e){return!!this.#r?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=await s.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(s,r)}matchCheckTest(e,r){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!r||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#n(e)?e:void 0}matchCheckSync(e,r){if(r&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=s.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(s,r)}matchFinish(e,r){if(this.#n(e))return;if(!this.includeChildMatches&&this.#r?.add){let s=`${e.relativePosix()}/**`;this.#r.add(s)}let n=this.opts.absolute===void 0?r:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#t:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+i)}else{let s=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!s.startsWith(".."+this.#t)?"."+this.#t:"";this.matchEmit(s?o+s+i:"."+i)}}async match(e,r,n){let i=await this.matchCheck(e,n);i&&this.matchFinish(i,r)}matchSync(e,r,n){let i=this.matchCheckSync(e,n);i&&this.matchFinish(i,r)}walkCB(e,r,n){this.signal?.aborted&&n(),this.walkCB2(e,r,new Lc(this.opts),n)}walkCB2(e,r,n,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,r,n,i));return}n.processPatterns(e,r);let s=1,o=()=>{--s===0&&i()};for(let[a,u,c]of n.matches.entries())this.#n(a)||(s++,this.match(a,u,c).then(()=>o()));for(let a of n.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let u=a.readdirCached();a.calledReaddir()?this.walkCB3(a,u,n,o):a.readdirCB((c,l)=>this.walkCB3(a,l,n,o),!0)}o()}walkCB3(e,r,n,i){n=n.filterEntries(e,r);let s=1,o=()=>{--s===0&&i()};for(let[a,u,c]of n.matches.entries())this.#n(a)||(s++,this.match(a,u,c).then(()=>o()));for(let[a,u]of n.subwalks.entries())s++,this.walkCB2(a,u,n.child(),o);o()}walkCBSync(e,r,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,r,new Lc(this.opts),n)}walkCB2Sync(e,r,n,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,r,n,i));return}n.processPatterns(e,r);let s=1,o=()=>{--s===0&&i()};for(let[a,u,c]of n.matches.entries())this.#n(a)||this.matchSync(a,u,c);for(let a of n.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;s++;let u=a.readdirSync();this.walkCB3Sync(a,u,n,o)}o()}walkCB3Sync(e,r,n,i){n=n.filterEntries(e,r);let s=1,o=()=>{--s===0&&i()};for(let[a,u,c]of n.matches.entries())this.#n(a)||this.matchSync(a,u,c);for(let[a,u]of n.subwalks.entries())s++,this.walkCB2Sync(a,u,n.child(),o);o()}},Nc=class extends T0{matches=new Set;constructor(e,r,n){super(e,r,n)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,r)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?r(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},$c=class extends T0{results;constructor(e,r,n){super(e,r,n),this.results=new Ei({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var pte=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Hr=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,r){if(!r)throw new TypeError("glob options required");if(this.withFileTypes=!!r.withFileTypes,this.signal=r.signal,this.follow=!!r.follow,this.dot=!!r.dot,this.dotRelative=!!r.dotRelative,this.nodir=!!r.nodir,this.mark=!!r.mark,r.cwd?(r.cwd instanceof URL||r.cwd.startsWith("file://"))&&(r.cwd=(0,kT.fileURLToPath)(r.cwd)):this.cwd="",this.cwd=r.cwd||"",this.root=r.root,this.magicalBraces=!!r.magicalBraces,this.nobrace=!!r.nobrace,this.noext=!!r.noext,this.realpath=!!r.realpath,this.absolute=r.absolute,this.includeChildMatches=r.includeChildMatches!==!1,this.noglobstar=!!r.noglobstar,this.matchBase=!!r.matchBase,this.maxDepth=typeof r.maxDepth=="number"?r.maxDepth:1/0,this.stat=!!r.stat,this.ignore=r.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(u=>u.replace(/\\/g,"/"))),this.matchBase){if(r.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(u=>u.includes("/")?u:`./**/${u}`)}if(this.pattern=e,this.platform=r.platform||pte,this.opts={...r,platform:this.platform},r.scurry){if(this.scurry=r.scurry,r.nocase!==void 0&&r.nocase!==r.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let u=r.platform==="win32"?oa:r.platform==="darwin"?Mc:r.platform?aa:TT;this.scurry=new u(this.cwd,{nocase:r.nocase,fs:r.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",i={...r,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(u=>new zt(u,i)),[o,a]=s.reduce((u,c)=>(u[0].push(...c.set),u[1].push(...c.globParts),u),[[],[]]);this.patterns=o.map((u,c)=>{let l=a[c];if(!l)throw new Error("invalid pattern object");return new ua(u,l,0,this.platform)})}async walk(){return[...await new Nc(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new Nc(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new $c(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new $c(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var iy=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let r of t)if(new zt(r,e).hasMagic())return!0;return!1};function O0(t,e={}){return new Hr(t,e).streamSync()}function PT(t,e={}){return new Hr(t,e).stream()}function P0(t,e={}){return new Hr(t,e).walkSync()}async function OT(t,e={}){return new Hr(t,e).walk()}function R0(t,e={}){return new Hr(t,e).iterateSync()}function RT(t,e={}){return new Hr(t,e).iterate()}var mte=O0,Dte=Object.assign(PT,{sync:O0}),gte=R0,xte=Object.assign(RT,{sync:R0}),yte=Object.assign(P0,{stream:O0,iterate:R0}),k0=Object.assign(OT,{glob:OT,globSync:P0,sync:yte,globStream:PT,stream:Dte,globStreamSync:O0,streamSync:mte,globIterate:RT,iterate:xte,globIterateSync:R0,iterateSync:gte,Glob:Hr,hasMagic:iy,escape:ta,unescape:jr});k0.glob=k0;var wi=(t,e)=>typeof t>"u"||typeof t===e,IT=t=>!!t&&typeof t=="object"&&wi(t.preserveRoot,"boolean")&&wi(t.tmp,"string")&&wi(t.maxRetries,"number")&&wi(t.retryDelay,"number")&&wi(t.backoff,"number")&&wi(t.maxBackoff,"number")&&(wi(t.glob,"boolean")||t.glob&&typeof t.glob=="object")&&wi(t.filter,"function"),MT=t=>{if(!IT(t))throw new Error("invalid rimraf options")},LT=t=>{MT(t);let{glob:e,...r}=t;if(!e)return r;let n=e===!0?t.signal?{signal:t.signal}:{}:t.signal?{signal:t.signal,...e}:e;return{...r,glob:{...n,absolute:!0,withFileTypes:!1}}},NT=(t={})=>LT(t),$T=(t={})=>LT(t);var jc=require("path"),jT=require("util"),bte=(t,e={})=>{let r=typeof t;if(r!=="string"){let i=t&&r==="object"&&t.constructor,o=`The "path" argument must be of type string. Received ${i&&i.name?`an instance of ${i.name}`:r==="object"?(0,jT.inspect)(t):`type ${r} ${t}`}`;throw Object.assign(new TypeError(o),{path:t,code:"ERR_INVALID_ARG_TYPE"})}if(/\0/.test(t)){let i="path must be a string without null bytes";throw Object.assign(new TypeError(i),{path:t,code:"ERR_INVALID_ARG_VALUE"})}t=(0,jc.resolve)(t);let{root:n}=(0,jc.parse)(t);if(t===n&&e.preserveRoot!==!1){let i="refusing to remove root directory without preserveRoot:false";throw Object.assign(new Error(i),{path:t,code:"ERR_PRESERVE_ROOT"})}if(process.platform==="win32"){let i=/[*|"<>?:]/,{root:s}=(0,jc.parse)(t);if(i.test(t.substring(s.length)))throw Object.assign(new Error("Illegal characters in path."),{path:t,code:"EINVAL"})}return t},Uc=bte;var UT=require("fs"),hn=P(require("fs/promises"),1),he=require("fs"),qT=t=>(0,UT.readdirSync)(t,{withFileTypes:!0}),$t={chmod:hn.default.chmod,mkdir:hn.default.mkdir,readdir:t=>hn.default.readdir(t,{withFileTypes:!0}),rename:hn.default.rename,rm:hn.default.rm,rmdir:hn.default.rmdir,stat:hn.default.stat,lstat:hn.default.lstat,unlink:hn.default.unlink};var ha=require("path");var{readdir:Fte}=$t,la=t=>Fte(t).catch(e=>e),fa=t=>{try{return qT(t)}catch(e){return e}};var HT=t=>!!t&&typeof t=="object",sy=(t,e)=>e in t&&typeof t[e]=="string",oy=t=>HT(t)&&sy(t,"code")&&sy(t,"path"),Pe=t=>HT(t)&&sy(t,"code")?t.code:null;var kt=async(t,e)=>t.catch(r=>{if(Pe(r)!=="ENOENT")throw e??r}),Ot=(t,e)=>{try{return t()}catch(r){if(Pe(r)==="ENOENT")return;throw e??r}};var{lstat:Ete,rmdir:Cte,unlink:wte}=$t,I0=async(t,e)=>(e?.signal?.throwIfAborted(),await kt(Ete(t).then(r=>WT(t,e,r)))??!0),M0=(t,e)=>(e?.signal?.throwIfAborted(),Ot(()=>GT(t,e,(0,he.lstatSync)(t)))??!0),WT=async(t,e,r)=>{e?.signal?.throwIfAborted();let n=r.isDirectory()?await la(t):null;if(!Array.isArray(n)){if(n){if(Pe(n)==="ENOENT")return!0;if(Pe(n)!=="ENOTDIR")throw n}return e.filter&&!await e.filter(t,r)?!1:(await kt(wte(t)),!0)}return!(await Promise.all(n.map(s=>WT((0,ha.resolve)(t,s.name),e,s)))).every(s=>s===!0)||e.preserveRoot===!1&&t===(0,ha.parse)(t).root||e.filter&&!await e.filter(t,r)?!1:(await kt(Cte(t)),!0)},GT=(t,e,r)=>{e?.signal?.throwIfAborted();let n=r.isDirectory()?fa(t):null;if(!Array.isArray(n)){if(n){if(Pe(n)==="ENOENT")return!0;if(Pe(n)!=="ENOTDIR")throw n}return e.filter&&!e.filter(t,r)?!1:(Ot(()=>(0,he.unlinkSync)(t)),!0)}let i=!0;for(let s of n){let o=(0,ha.resolve)(t,s.name);i=GT(o,e,s)&&i}return e.preserveRoot===!1&&t===(0,ha.parse)(t).root||!i||e.filter&&!e.filter(t,r)?!1:(Ot(()=>(0,he.rmdirSync)(t)),!0)};var da=require("path");var{chmod:Ste}=$t,qc=t=>async e=>{try{return void await kt(t(e))}catch(r){if(Pe(r)==="EPERM")return await kt(Ste(e,438).then(()=>!0),r)?void await t(e):void 0;throw r}},Hc=t=>e=>{try{return void Ot(()=>t(e))}catch(r){if(Pe(r)==="EPERM")return Ot(()=>((0,he.chmodSync)(e,438),!0),r)?void t(e):void 0;throw r}};var VT=require("timers/promises");var vte=200,_te=1.2,zT=10,KT=new Set(["EMFILE","ENFILE","EBUSY"]),ay=t=>{let e=async(r,n,i=1,s=0)=>{let o=n.maxBackoff||vte,a=n.backoff||_te,u=n.maxRetries||zT,c=0;for(;;)try{return await t(r)}catch(l){if(oy(l)&&l.path===r&&KT.has(l.code)){if(i=Math.ceil(i*a),s=i+s,s<o)return await(0,VT.setTimeout)(i),e(r,n,i,s);if(c<u){c++;continue}}throw l}};return e},uy=t=>(r,n)=>{let i=n.maxRetries||zT,s=0;for(;;)try{return t(r)}catch(o){if(oy(o)&&o.path===r&&KT.has(o.code)&&s<i){s++;continue}throw o}};var xr=require("path");var Wc=require("os"),Si=require("path");var{stat:Ate}=$t,Bte=t=>{try{return(0,he.statSync)(t).isDirectory()}catch{return!1}},Tte=t=>Ate(t).then(e=>e.isDirectory(),()=>!1),kte=async t=>{let{root:e}=(0,Si.parse)(t),r=(0,Wc.tmpdir)(),{root:n}=(0,Si.parse)(r);if(e.toLowerCase()===n.toLowerCase())return r;let i=(0,Si.resolve)(e,"/temp");return await Tte(i)?i:e},Ote=t=>{let{root:e}=(0,Si.parse)(t),r=(0,Wc.tmpdir)(),{root:n}=(0,Si.parse)(r);if(e.toLowerCase()===n.toLowerCase())return r;let i=(0,Si.resolve)(e,"/temp");return Bte(i)?i:e},Pte=async()=>(0,Wc.tmpdir)(),Rte=()=>(0,Wc.tmpdir)(),YT=process.platform==="win32"?kte:Pte,ZT=process.platform==="win32"?Ote:Rte;var{lstat:Ite,rename:Mte,unlink:Lte,rmdir:Nte}=$t,QT=t=>`.${(0,xr.basename)(t)}.${Math.random()}`,$te=qc(Lte),jte=Hc(he.unlinkSync),L0=async(t,e)=>(e?.signal?.throwIfAborted(),await kt(Ite(t).then(r=>cy(t,e,r)))??!0),cy=async(t,e,r)=>{if(e?.signal?.throwIfAborted(),!e.tmp)return cy(t,{...e,tmp:await YT(t)},r);if(t===e.tmp&&(0,xr.parse)(t).root!==t)throw new Error("cannot delete temp directory used for deletion");let n=r.isDirectory()?await la(t):null;if(!Array.isArray(n)){if(n){if(Pe(n)==="ENOENT")return!0;if(Pe(n)!=="ENOTDIR")throw n}return e.filter&&!await e.filter(t,r)?!1:(await kt(JT(t,e.tmp,$te)),!0)}return!(await Promise.all(n.map(s=>cy((0,xr.resolve)(t,s.name),e,s)))).every(s=>s===!0)||e.preserveRoot===!1&&t===(0,xr.parse)(t).root||e.filter&&!await e.filter(t,r)?!1:(await kt(JT(t,e.tmp,Nte)),!0)},JT=async(t,e,r)=>{let n=(0,xr.resolve)(e,QT(t));return await Mte(t,n),await r(n)},N0=(t,e)=>(e?.signal?.throwIfAborted(),Ot(()=>ly(t,e,(0,he.lstatSync)(t)))??!0),ly=(t,e,r)=>{if(e?.signal?.throwIfAborted(),!e.tmp)return ly(t,{...e,tmp:ZT(t)},r);let n=e.tmp;if(t===e.tmp&&(0,xr.parse)(t).root!==t)throw new Error("cannot delete temp directory used for deletion");let i=r.isDirectory()?fa(t):null;if(!Array.isArray(i)){if(i){if(Pe(i)==="ENOENT")return!0;if(Pe(i)!=="ENOTDIR")throw i}return e.filter&&!e.filter(t,r)?!1:(Ot(()=>XT(t,n,jte)),!0)}let s=!0;for(let o of i){let a=(0,xr.resolve)(t,o.name);s=ly(a,e,o)&&s}return!s||e.preserveRoot===!1&&t===(0,xr.parse)(t).root||e.filter&&!e.filter(t,r)?!1:(Ot(()=>XT(t,n,he.rmdirSync)),!0)},XT=(t,e,r)=>{let n=(0,xr.resolve)(e,QT(t));return(0,he.renameSync)(t,n),r(n)};var{unlink:Ute,rmdir:qte,lstat:Hte}=$t,Wte=ay(qc(Ute)),Gte=uy(Hc(he.unlinkSync)),Vte=ay(qc(qte)),zte=uy(Hc(he.rmdirSync)),Kte=async(t,{filter:e,...r})=>{r?.signal?.throwIfAborted();try{return await Vte(t,r),!0}catch(n){if(Pe(n)==="ENOTEMPTY")return L0(t,r);throw n}},Yte=(t,{filter:e,...r})=>{r?.signal?.throwIfAborted();try{return zte(t,r),!0}catch(n){if(Pe(n)==="ENOTEMPTY")return N0(t,r);throw n}},vi=Symbol("start"),ek=Symbol("child"),$0=Symbol("finish"),j0=async(t,e)=>(e?.signal?.throwIfAborted(),await kt(Hte(t).then(r=>fy(t,e,r,vi)))??!0),U0=(t,e)=>(e?.signal?.throwIfAborted(),Ot(()=>hy(t,e,(0,he.lstatSync)(t),vi))??!0),fy=async(t,e,r,n=vi)=>{e?.signal?.throwIfAborted();let i=r.isDirectory()?await la(t):null;if(!Array.isArray(i)){if(i){if(Pe(i)==="ENOENT")return!0;if(Pe(i)!=="ENOTDIR")throw i}return e.filter&&!await e.filter(t,r)?!1:(await kt(Wte(t,e)),!0)}let s=n===vi?ek:n,o=(await Promise.all(i.map(a=>fy((0,da.resolve)(t,a.name),e,a,s)))).every(a=>a===!0);if(n===vi)return fy(t,e,r,$0);if(n===$0){if(e.preserveRoot===!1&&t===(0,da.parse)(t).root||!o||e.filter&&!await e.filter(t,r))return!1;await kt(Kte(t,e))}return!0},hy=(t,e,r,n=vi)=>{let i=r.isDirectory()?fa(t):null;if(!Array.isArray(i)){if(i){if(Pe(i)==="ENOENT")return!0;if(Pe(i)!=="ENOTDIR")throw i}return e.filter&&!e.filter(t,r)?!1:(Ot(()=>Gte(t,e)),!0)}let s=!0;for(let o of i){let a=n===vi?ek:n,u=(0,da.resolve)(t,o.name);s=hy(u,e,o,a)&&s}if(n===vi)return hy(t,e,r,$0);if(n===$0){if(e.preserveRoot===!1&&t===(0,da.parse)(t).root||!s||e.filter&&!e.filter(t,r))return!1;Ot(()=>Yte(t,e))}return!0};var dy=process.platform==="win32"?j0:I0,py=process.platform==="win32"?U0:M0;var{rm:Zte}=$t,my=async(t,e)=>(await Zte(t,{...e,force:!0,recursive:!0}),!0),Dy=(t,e)=>((0,he.rmSync)(t,{...e,force:!0,recursive:!0}),!0);var[tk=0,Jte=0]=process.version.replace(/^v/,"").split(".").map(t=>parseInt(t,10)),rk=tk>14||tk===14&&Jte>=14,nk=!rk||process.platform==="win32"?()=>!1:t=>!t?.signal&&!t?.filter,ik=!rk||process.platform==="win32"?()=>!1:t=>!t?.signal&&!t?.filter;var pa=t=>async(e,r)=>{let n=NT(r);return n.glob&&(e=await k0(e,n.glob)),Array.isArray(e)?!!(await Promise.all(e.map(i=>t(Uc(i,n),n)))).reduce((i,s)=>i&&s,!0):!!await t(Uc(e,n),n)},ma=t=>(e,r)=>{let n=$T(r);return n.glob&&(e=P0(e,n.glob)),Array.isArray(e)?!!e.map(i=>t(Uc(i,n),n)).reduce((i,s)=>i&&s,!0):!!t(Uc(e,n),n)},ak=ma(Dy),Xte=Object.assign(pa(my),{sync:ak}),uk=ma(py),Qte=Object.assign(pa(dy),{sync:uk}),ck=ma(U0),ere=Object.assign(pa(j0),{sync:ck}),lk=ma(M0),tre=Object.assign(pa(I0),{sync:lk}),fk=ma(N0),rre=Object.assign(pa(L0),{sync:fk}),sk=ma((t,e)=>ik(e)?Dy(t,e):py(t,e));var ok=pa((t,e)=>nk(e)?my(t,e):dy(t,e)),q0=Object.assign(ok,{rimraf:ok,sync:sk,rimrafSync:sk,manual:Qte,manualSync:uk,native:Xte,nativeSync:ak,posix:tre,posixSync:lk,windows:ere,windowsSync:ck,moveRemove:rre,moveRemoveSync:fk});q0.rimraf=q0;var pt=t=>(0,_i.join)(process.cwd(),t),dk=t=>{try{return(0,hk.readdirSync)(t).length===0}catch{return!0}},pk=()=>{try{return Gc()!==void 0}catch{return!1}};function mk(){let t=N1({cwd:(0,_i.dirname)(__filename)});if(!t)throw new Error("Could not find package.json");return(0,_i.dirname)(t)}function Gc(){let t=N1();if(!t)throw new Error("You are not in a project directory");return(0,_i.dirname)(t)}var Dk=t=>q0(t),gk=(t,e)=>(0,_i.resolve)(require.resolve(t),`../${e}`);async function mt(t,e){let r=Date.now(),n=t.title,i=()=>Math.floor((Date.now()-r)/1e3),s=setInterval(()=>{i()>1&&(t.title=`${n} (${i()}s)`)},1e3);try{return await e(i)}finally{clearInterval(s)}}async function H0(t,e,r){for(let n=0;n<e.length;n++){let i=e[n];t.output=E.dim(`[${n+1}/${e.length}] ${i.title}`),await i.fn(r??{},t)}}var nre={...process.env,NODE_NO_WARNINGS:"1"};async function Yt(t,e,{cwd:r=process.cwd(),task:n,shell:i,context:s=t,quiet:o=!1}={}){try{e.length===0&&(e=t.split(" ").slice(1));let u=j7(t,e,{cwd:r,stdio:o||n?"pipe":"inherit",all:n?!0:void 0,shell:i??!0,env:nre});n&&u.all&&u.all.on("data",c=>{n.output=c.toString().trim(),n.output.length&&H.storeLog(n.output,s)}),await u}catch(a){let u=a instanceof Error?a.message:String(a),c=ire(u);throw new Error(c)}}var ire=t=>{let e=t.match(/error: (.+)/);return e?e[1].trim():t};function yk(t,e,r={}){let{cwd:n=process.cwd(),envFile:i,detached:s=!0,onStderr:o,onExit:a}=r,u=i?["--env-file",i,t,...e]:[t,...e],f=(0,xk.spawn)(i?"bun":t,i?u:e,{cwd:n,env:{...process.env,FORCE_COLOR:"1"},stdio:["inherit","inherit","pipe"],detached:s});return o&&f.stderr?.on("data",o),a&&f.on("exit",a),f}async function bk(t,e){let r=[];for(let n of t)try{let i=n.command.split(/\s+/),s=i[0],o=i.slice(1);await Yt(s,o,{cwd:e,shell:!0,quiet:!1}),r.push({command:n.command,success:!0})}catch(i){r.push({command:n.command,success:!1,error:i instanceof Error?i.message:String(i)});break}return r}function Fk(t){let e=[/^pf\s+new\s+/,/^pf\s+add\s+/,/^bun\s+pf\s+new\s+/,/^bun\s+pf\s+add\s+/];return t.filter(r=>e.some(n=>n.test(r.command)))}function Ek(t){for(let e of t){let r=e.command.match(/(?:bun\s+)?pf\s+new\s+\S+\s+(\S+)/);if(r)return r[1]}return null}var Ss=require("node:fs"),W0=require("node:path");function Ck(t,e){let r={written:[],skipped:[],failed:[]};for(let n of t){let i=(0,W0.join)(e.baseDir,n.path);try{if((0,Ss.existsSync)(i)&&!e.overwrite){r.skipped.push(n.path);continue}if(e.dryRun){r.written.push(n.path);continue}let s=(0,W0.dirname)(i);(0,Ss.existsSync)(s)||(0,Ss.mkdirSync)(s,{recursive:!0}),(0,Ss.writeFileSync)(i,n.content,"utf-8"),r.written.push(n.path)}catch(s){r.failed.push({path:n.path,error:s.message})}}return r}var sre=[/####\s+`?([^\s`\n]+\.[a-z]+)`?\s*\n+```(\w+)?\n([\s\S]*?)```/gi,/\*\*(?:File|Datei):?\*\*\s*`?([^\s`\n]+\.[a-z]+)`?\s*\n+```(\w+)?\n([\s\S]*?)```/gi,/(?:File|Datei):?\s*`?([^\s`\n]+\.[a-z]+)`?\s*\n+```(\w+)?\n([\s\S]*?)```/gi,/`([^\s`]+\.[a-z]+)`[:\s]*\n+```(\w+)?\n([\s\S]*?)```/gi],wk=/```(\w+)?\n([\s\S]*?)```/g;function ore(t,e,r){let n=[[/new Hono\(\)/i,"src/index.ts"],[/@Module\(/i,"src/app.module.ts"],[/@Controller\(/i,"src/app.controller.ts"],[/@Injectable\(/i,"src/app.service.ts"],[/NestFactory\.create/i,"src/main.ts"],[/"name":\s*"[^"]+"/i,"package.json"],[/^FROM\s+/im,"Dockerfile"],[/"compilerOptions"/i,"tsconfig.json"],[/^[A-Z_]+=.+$/m,".env"]];for(let[o,a]of n)if(o.test(t))return a;let s={typescript:"ts",ts:"ts",javascript:"js",js:"js",json:"json",toml:"toml",yaml:"yaml",yml:"yml",plaintext:"txt",env:"env",dockerfile:""}[e?.toLowerCase()||"ts"]??"ts";return s?`src/file-${r+1}.${s}`:null}function Sk(t){let e=[],r=/```commands?\n([\s\S]*?)```/gi,n;for(r.lastIndex=0;(n=r.exec(t))!==null;){let s=n[1].trim().split(`
|
|
191
191
|
`).filter(o=>o.trim());for(let o of s){let a=o.trim();a&&!a.startsWith("#")&&e.push({command:a,isPfCommand:a.startsWith("pf ")||a.includes(" pf ")})}}if(e.length===0){let i=/```(?:bash|shell|sh)\n([\s\S]*?)```/gi;for(i.lastIndex=0;(n=i.exec(t))!==null;){let o=n[1].trim().split(`
|
|
192
192
|
`).filter(a=>a.trim());for(let a of o){let u=a.trim();u&&(u.startsWith("pf ")||u.startsWith("bun pf "))&&e.push({command:u.replace(/^bun\s+/,""),isPfCommand:!0})}}}return e}function are(t,e){let r=[`${e}/`,`services/${e}/`,"./"];for(let n of r)if(t.startsWith(n))return t.slice(n.length);return t}function vk(t,e){let r=[],n=new Set;for(let o of sre){o.lastIndex=0;let a;for(;(a=o.exec(t))!==null;){let[,u,c="typescript",l]=a,f=are(u.trim(),e);n.has(f)||(n.add(f),r.push({path:f,content:l.trim(),language:c||"typescript"}))}}if(r.length>0)return r;wk.lastIndex=0;let i,s=0;for(;(i=wk.exec(t))!==null;){let[,o="typescript",a]=i,u=ore(a,o,s);u&&!n.has(u)&&(n.add(u),r.push({path:u,content:a.trim(),language:o||"typescript"})),s++}return r}function _k(t){let e=[];t.length===0&&e.push("No code files could be extracted from the AI response");let r=t.some(n=>n.path==="src/index.ts"||n.path==="src/main.ts"||n.path==="index.ts");t.length>0&&!r&&e.push("No entry point file (src/index.ts or src/main.ts) found");for(let n of t)(!n.content||n.content.trim().length===0)&&e.push(`File ${n.path} is empty`);return{valid:e.length===0,errors:e}}var ure=[".github/copilot-instructions.md","docs/copilot-instructions.md","copilot-instructions.md"];function cre(t){for(let e of ure){let r=(0,Vc.join)(t,e);if((0,G0.existsSync)(r))try{return(0,G0.readFileSync)(r,"utf-8")}catch{}}return null}var Ak=`You are an expert code generator. Generate clean, production-ready code.
|
|
193
193
|
|
|
@@ -246,7 +246,7 @@ ${t.message}`)}},Ta=()=>Er().reduce((e,r)=>(r.initial&&e.push(r.name),e),[]),Tne
|
|
|
246
246
|
`))}))},kne=t=>t.toUpperCase().replace(/-/g,"_"),sd=(t,e)=>{let r=kne(t);H.breakLine().log(E.bold("Environment variables:")).log(E.dim(" Local:")).log(E.cyan(` ${r}_PORT=${e}`)).log(E.cyan(` ${r}_URL=http://localhost:${e}`)).breakLine().log(E.dim(" Production (auto-configured):")).log(E.cyan(` ${r}_PORT=${e}`)).log(E.cyan(` ${r}_URL=http://${t}:${e}`))};var One=t=>{let e=t.match(/^(@?[^@]+)@(.+)$/);return e?{name:e[1],version:e[2]}:{name:t,version:"latest"}},rO=async t=>{let{selectedIntegrations:e,cwd:r,packageManager:n=Dt(),task:i}=t;if(!e?.length||!i)return;let s=Pne(e,r,n,i);await H0(i,s)},Pne=(t,e,r,n)=>{let s=Er()?.filter(a=>t.includes(a.name))?.flatMap(a=>a.install.map(u=>{let{name:c,version:l}=One(u);return{title:E.cyanBright(`Adding ${u} (${a.name})`),fn:async()=>{ya(`dependencies.${c}`,l,e)}}})),o={title:E.cyanBright("Installing packages..."),fn:async()=>{await Fa({cwd:e,packageManager:r,task:n})}};return[...s??[],o]};var nO=async t=>{let{selectedIntegrations:e,cwd:r,task:n}=t;if(!e?.length||!n)return;let i=Rne(e,r,n,t.packageManager);await H0(n,i)},Rne=(t,e,r,n)=>Er().filter(s=>t.includes(s.name)&&s.run?.length).flatMap(s=>s.run?.map(o=>({title:E.cyanBright(`Running "${o}" for ${s.name}
|
|
247
247
|
`),fn:()=>Ine(s,o,e,r,n)}))),Ine=async(t,e,r,n,i)=>{let s=`${X0}:${t.name}`;try{if(t.interactive)return $k(e,[],{cwd:r,context:s,task:n,manager:i});await Bi(e,[],{cwd:r,task:n,context:s})}catch(o){H.error(`Failed to run command "${e}" for ${t.name}: ${o.message}`)}};var Ey=require("node:path"),iO=P(wc());var Mne=["nest-add","ng-add","angular-app","application","library","sub-app","add-module-import"],od=()=>{try{let t=Une();return[...Lne(),...t]}catch(t){return H.error("Error retrieving schematics:",t),[]}};function Lne(){if(!pk())return[];try{let t=Gc(),e=Er(),r=Nne(e);return $ne(r,t)}catch(t){return H.breakLine().error("Error retrieving integration schematics:",t.message),[]}}function Nne(t){return t.filter(({name:e})=>Ik(e))}function $ne(t,e){return t.map(({name:r})=>jne(r,e)).filter(Boolean).flat().filter(r=>r!==void 0)}function jne(t,e){try{let r=(0,Ey.join)(e,"node_modules",t,"package.json"),n=ba(r)?.schematics;if(!n)return[];let i=(0,Ey.join)(e,"node_modules",t,n),s=(0,iO.readJSONSync)(i).schematics;return sO(s,t)}catch(r){return H.error(`Error processing package ${t}:`,r),[]}}function Une(){try{let t="@nestjs/schematics",e=gk(t,"collection.json"),r=ba(e);return sO(r.schematics,t)}catch(t){return H.error("Error retrieving NestJS schematics:",t),[]}}function sO(t,e){return t?Object.keys(t).filter(r=>!Mne.includes(r)).map(r=>{let{description:n,aliases:i=[r]}=t[r];return{name:r,aliases:i,description:n,packageName:e}}):[]}async function oO(t,e,r=!1){let i=od().find(({name:o,aliases:a})=>o===t||a.includes(t));if(!i)throw new Error(`Schematic "${t}" is not available.`);let s=i.packageName;if(!s)throw new Error(`Package for schematic "${t}" not found.`);await Bi("nest",["g","-c",s,i.name,e],{stdio:"inherit"}),r&&Mk("lint")&&await jk("lint")}var JO=P(ky());var XO=()=>{let t=od(),e=new JO.default({head:["name","alias","description","package"],style:{head:["dim","bold"],compact:!0}});return t.map(Fie).forEach(r=>{e.push(r)}),E.bold(`
|
|
248
248
|
Available schematics:
|
|
249
|
-
`)+e.toString()},Fie=({name:t,aliases:e,description:r,packageName:n})=>{let i=n==="@nestjs/schematics";return[i?E.green(t):E.greenBright(t),i?E.cyan(e.join(", ")):E.cyanBright(e.join(", ")),i?E.dim(r):r,i?E.dim(n):n]};function fd(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}async function QO(t,e,r={},n=[],i=[]){if(!t){console.error("Subcommand is not defined.");return}let s=n.map(u=>e[u]).filter(u=>u!==void 0),o=i.map(u=>{let c=e[u];if(!(c===!1||c===void 0))return c===!0?`--${fd(String(u))}`:`--${fd(String(u))}=${String(c)}`}).filter(u=>u!==void 0),a=Object.entries(r).map(([u,c])=>{if(!(c===!1||c===void 0))return c===!0?`--${fd(u)}`:`--${fd(u)}=${String(c)}`}).filter(u=>u!==void 0);await t.parseAsync([...s,...o,...a].map(String),{from:"user"})}var iI=require("node:path");var Pa={title:"Confirm creation",enabled:t=>!t.userConfirmed,task:async(t,e)=>{if(t.userConfirmed=await e.prompt(
|
|
249
|
+
`)+e.toString()},Fie=({name:t,aliases:e,description:r,packageName:n})=>{let i=n==="@nestjs/schematics";return[i?E.green(t):E.greenBright(t),i?E.cyan(e.join(", ")):E.cyanBright(e.join(", ")),i?E.dim(r):r,i?E.dim(n):n]};function fd(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}async function QO(t,e,r={},n=[],i=[]){if(!t){console.error("Subcommand is not defined.");return}let s=n.map(u=>e[u]).filter(u=>u!==void 0),o=i.map(u=>{let c=e[u];if(!(c===!1||c===void 0))return c===!0?`--${fd(String(u))}`:`--${fd(String(u))}=${String(c)}`}).filter(u=>u!==void 0),a=Object.entries(r).map(([u,c])=>{if(!(c===!1||c===void 0))return c===!0?`--${fd(u)}`:`--${fd(u)}=${String(c)}`}).filter(u=>u!==void 0);await t.parseAsync([...s,...o,...a].map(String),{from:"user"})}var iI=require("node:path");var Pa={title:"Confirm creation",enabled:t=>!t.userConfirmed,task:async(t,e)=>{if(t.userConfirmed=await e.prompt(Ie).run({type:"Toggle",initial:!0,message:"\u{1F680} Ready to launch your project?"}),!t.userConfirmed)throw new Error("Project creation was canceled by the user.")}};var gn=require("node:fs"),Ra=require("node:path");function eP(t,e){return`import type { K8sServiceConfig } from '@crossdelta/infrastructure'
|
|
250
250
|
|
|
251
251
|
/**
|
|
252
252
|
* ${t} service configuration.
|
|
@@ -289,20 +289,20 @@ const config: K8sServiceConfig = {
|
|
|
289
289
|
}
|
|
290
290
|
|
|
291
291
|
export default config
|
|
292
|
-
`}var Eie=4001,Cie=4e3;function wie(t){let e=[],r=t.match(/containerPort\s*:\s*(\d+)/);r&&e.push(Number(r[1]));let n=t.match(/internalPorts\s*:\s*\[([^\]]+)\]/);if(n){let o=n[1].match(/\d+/g);o&&e.push(...o.map(Number))}let i=t.match(/httpPort\s*:\s*(\d+)/);i&&e.push(Number(i[1]));let s=t.matchAll(/const\s+\w*[pP]ort\w*\s*=\s*(\d+)/g);for(let o of s)e.push(Number(o[1]));return e}function Sie(t,e){let r=e?Eie:Cie,n=new Set;if(!(0,gn.existsSync)(t))return r;let i=(0,gn.readdirSync)(t).filter(o=>o.endsWith(".ts"));for(let o of i){let a=(0,Ra.join)(t,o);try{let u=(0,gn.readFileSync)(a,"utf-8"),c=wie(u);for(let l of c)n.add(l)}catch{}}let s=r;for(;n.has(s);)s++;return s}function vie(t){return(0,Ra.basename)(t)}var hd={title:"Creating infrastructure service config",task:async(t,e)=>{let r=vie(t.projectName),n=Kc(),i=(0,Ra.join)(n,"infra","services");if(!(0,gn.existsSync)(i)){e.title="Skipping infra config (no infra/services directory found)";return}let s=(0,Ra.join)(i,`${r}.ts`);if((0,gn.existsSync)(s)){e.title=`Service config already exists: infra/services/${r}.ts`;return}let o=Sie(i,!0);t.assignedPort=o;let a=t.serviceType==="hono"?eP(r,o):tP(r,o);(0,gn.writeFileSync)(s,a),e.title=`Created infra/services/${r}.ts (port: ${o})`}};var rl=require("node:child_process"),rP=require("node:fs"),nP=require("node:path"),_ie=()=>{try{return(0,rl.execSync)("git --version",{stdio:"ignore"}),!0}catch{return!1}},Aie=t=>(0,rP.existsSync)((0,nP.join)(t,".git")),iP={title:"Initializing git repository",enabled:()=>_ie(),skip:t=>Aie(t.cwd)?"Already a git repository":!1,task:async(t,e)=>{try{(0,rl.execSync)("git init",{cwd:t.cwd,stdio:"ignore"}),(0,rl.execSync)("git add -A",{cwd:t.cwd,stdio:"ignore"}),(0,rl.execSync)('git commit -m "chore: initial commit"',{cwd:t.cwd,stdio:"ignore",env:{...process.env,GIT_AUTHOR_NAME:process.env.GIT_AUTHOR_NAME||"Platform SDK",GIT_AUTHOR_EMAIL:process.env.GIT_AUTHOR_EMAIL||"platform-sdk@localhost",GIT_COMMITTER_NAME:process.env.GIT_COMMITTER_NAME||"Platform SDK",GIT_COMMITTER_EMAIL:process.env.GIT_COMMITTER_EMAIL||"platform-sdk@localhost"}}),e.title="Git repository initialized with initial commit"}catch{e.title="Git initialization skipped (git error)"}}};var Ia={title:"Installing Bun",enabled:t=>!!t.shouldInstallBun&&!gy(),task:async(t,e)=>mt(e,async r=>{await Bk(e),t.elapsedTime+=r(),e.title=`Bun installed successfully. (${t.elapsedTime}s)`})},Ma={enabled:t=>!gy()&&!t.shouldInstallBun&&!t.packageManager,task:async(t,e)=>{t.shouldInstallBun=await e.prompt(
|
|
293
|
-
`)}),t.shouldInstallBun&&(t.packageManager="bun")}};var dd={title:"Install integrations",enabled:t=>t.selectedIntegrations.length>0,task:async(t,e)=>mt(e,async r=>{let{selectedIntegrations:n,cwd:i,packageManager:s}=t;await rO({selectedIntegrations:n,packageManager:s,cwd:i,task:e}),t.elapsedTime+=r()}),rendererOptions:{outputBar:1e3}},pd={title:"Select integrations",enabled:t=>t.selectedIntegrations.length===0,task:async(t,e)=>{t.selectedIntegrations=await e.prompt(
|
|
292
|
+
`}var Eie=4001,Cie=4e3;function wie(t){let e=[],r=t.match(/containerPort\s*:\s*(\d+)/);r&&e.push(Number(r[1]));let n=t.match(/internalPorts\s*:\s*\[([^\]]+)\]/);if(n){let o=n[1].match(/\d+/g);o&&e.push(...o.map(Number))}let i=t.match(/httpPort\s*:\s*(\d+)/);i&&e.push(Number(i[1]));let s=t.matchAll(/const\s+\w*[pP]ort\w*\s*=\s*(\d+)/g);for(let o of s)e.push(Number(o[1]));return e}function Sie(t,e){let r=e?Eie:Cie,n=new Set;if(!(0,gn.existsSync)(t))return r;let i=(0,gn.readdirSync)(t).filter(o=>o.endsWith(".ts"));for(let o of i){let a=(0,Ra.join)(t,o);try{let u=(0,gn.readFileSync)(a,"utf-8"),c=wie(u);for(let l of c)n.add(l)}catch{}}let s=r;for(;n.has(s);)s++;return s}function vie(t){return(0,Ra.basename)(t)}var hd={title:"Creating infrastructure service config",task:async(t,e)=>{let r=vie(t.projectName),n=Kc(),i=(0,Ra.join)(n,"infra","services");if(!(0,gn.existsSync)(i)){e.title="Skipping infra config (no infra/services directory found)";return}let s=(0,Ra.join)(i,`${r}.ts`);if((0,gn.existsSync)(s)){e.title=`Service config already exists: infra/services/${r}.ts`;return}let o=Sie(i,!0);t.assignedPort=o;let a=t.serviceType==="hono"?eP(r,o):tP(r,o);(0,gn.writeFileSync)(s,a),e.title=`Created infra/services/${r}.ts (port: ${o})`}};var rl=require("node:child_process"),rP=require("node:fs"),nP=require("node:path"),_ie=()=>{try{return(0,rl.execSync)("git --version",{stdio:"ignore"}),!0}catch{return!1}},Aie=t=>(0,rP.existsSync)((0,nP.join)(t,".git")),iP={title:"Initializing git repository",enabled:()=>_ie(),skip:t=>Aie(t.cwd)?"Already a git repository":!1,task:async(t,e)=>{try{(0,rl.execSync)("git init",{cwd:t.cwd,stdio:"ignore"}),(0,rl.execSync)("git add -A",{cwd:t.cwd,stdio:"ignore"}),(0,rl.execSync)('git commit -m "chore: initial commit"',{cwd:t.cwd,stdio:"ignore",env:{...process.env,GIT_AUTHOR_NAME:process.env.GIT_AUTHOR_NAME||"Platform SDK",GIT_AUTHOR_EMAIL:process.env.GIT_AUTHOR_EMAIL||"platform-sdk@localhost",GIT_COMMITTER_NAME:process.env.GIT_COMMITTER_NAME||"Platform SDK",GIT_COMMITTER_EMAIL:process.env.GIT_COMMITTER_EMAIL||"platform-sdk@localhost"}}),e.title="Git repository initialized with initial commit"}catch{e.title="Git initialization skipped (git error)"}}};var Ia={title:"Installing Bun",enabled:t=>!!t.shouldInstallBun&&!gy(),task:async(t,e)=>mt(e,async r=>{await Bk(e),t.elapsedTime+=r(),e.title=`Bun installed successfully. (${t.elapsedTime}s)`})},Ma={enabled:t=>!gy()&&!t.shouldInstallBun&&!t.packageManager,task:async(t,e)=>{t.shouldInstallBun=await e.prompt(Ie).run({type:"Toggle",message:"Would you like to use Bun? (recommended)",initial:!0,footer:["",`${E.magenta.bold("Bun")} is a fast JavaScript runtime, package manager, bundler, and test runner: ${E.underline("https://bun.sh")}`,Tk(),kk()].join(`
|
|
293
|
+
`)}),t.shouldInstallBun&&(t.packageManager="bun")}};var dd={title:"Install integrations",enabled:t=>t.selectedIntegrations.length>0,task:async(t,e)=>mt(e,async r=>{let{selectedIntegrations:n,cwd:i,packageManager:s}=t;await rO({selectedIntegrations:n,packageManager:s,cwd:i,task:e}),t.elapsedTime+=r()}),rendererOptions:{outputBar:1e3}},pd={title:"Select integrations",enabled:t=>t.selectedIntegrations.length===0,task:async(t,e)=>{t.selectedIntegrations=await e.prompt(Ie).run({type:"MultiSelect",hint:`
|
|
294
294
|
Press <space> to select/deselect, <enter> to confirm, <i> to invert selection`,message:"Which integrations would you like to include?",initial:Ta().map((r,n)=>n),choices:t.availableIntegrations.map(({name:r,description:n})=>({name:r,message:[E.bold(r),n].join(" - "),value:r}))}),!t.selectedIntegrations||t.selectedIntegrations.length===0?e.title="No integrations selected.":e.title=["Selected integrations:",...t.selectedIntegrations.map(r=>E.bold(`\u2022 ${r}`))].join(`
|
|
295
|
-
`)}};var sP={title:"Install Nest CLI",task:async(t,e)=>mt(e,async r=>{await Nk({packages:["@nestjs/cli"],task:e,cwd:t.cwd}),t.elapsedTime+=r()}),rendererOptions:{outputBar:1e3}};var md={title:"Install dependencies",task:async(t,e)=>mt(e,async r=>{await Fa({cwd:t.cwd,task:e,packageManager:t.packageManager}),t.elapsedTime+=r()})};var La={enabled:t=>!t.removeDir&&!dk(t.cwd),task:async(t,e)=>{if(t.removeDir=await e.prompt(
|
|
295
|
+
`)}};var sP={title:"Install Nest CLI",task:async(t,e)=>mt(e,async r=>{await Nk({packages:["@nestjs/cli"],task:e,cwd:t.cwd}),t.elapsedTime+=r()}),rendererOptions:{outputBar:1e3}};var md={title:"Install dependencies",task:async(t,e)=>mt(e,async r=>{await Fa({cwd:t.cwd,task:e,packageManager:t.packageManager}),t.elapsedTime+=r()})};var La={enabled:t=>!t.removeDir&&!dk(t.cwd),task:async(t,e)=>{if(t.removeDir=await e.prompt(Ie).run({type:"Toggle",message:E.bold("\u26A0\uFE0F Overwrite existing directory?"),initial:!1}),!t.removeDir)throw new Error("Project creation was canceled by the user.")}},Na={enabled:t=>!!t.removeDir,task:async t=>Dk(t.cwd)};var Dd={title:"Run integration commands",enabled:t=>t.selectedIntegrations.length>0,task:async(t,e)=>mt(e,async r=>{let{selectedIntegrations:n,cwd:i}=t;await nO({selectedIntegrations:n,cwd:i,task:e,packageManager:t.packageManager}),t.elapsedTime+=r()}),rendererOptions:{outputBar:1}};var $a={task:async(t,e)=>{t.projectName=await e.prompt(Ie).run({type:"Input",initial:t.projectName,message:"Enter project name",validate:r=>r?!0:"Project name is required."}),t.cwd&&(t.cwd=pt(t.projectName))}};var ja={title:"Select Package manager",task:async(t,e)=>{if(t.packageManager){e.title=`Using ${E.bold(t.packageManager)} as package manager.`;return}t.packageManager=await e.prompt(Ie).run({type:"Select",message:"Which package manager would you like to use?",initial:Dt(),choices:Lk}),e.title=`Using ${E.bold(t.packageManager)} as package manager.`}};var oP={title:"GitHub repository owner",task:async(t,e)=>{if(t.githubOwner){e.title=`GitHub owner: ${E.bold(t.githubOwner)}`;return}t.githubOwner=await e.prompt(Ie).run({type:"Input",message:"Enter GitHub organization or username",initial:"my-org",validate:r=>r?.trim()?!0:"GitHub owner is required."}),e.title=`GitHub owner: ${E.bold(t.githubOwner)}`}},aP={title:"Include GitHub CI/CD",task:async(t,e)=>{if(t.includeGitHubCI!==void 0){e.title=t.includeGitHubCI?"Including GitHub CI/CD workflows":"Skipping GitHub CI/CD";return}t.includeGitHubCI=await e.prompt(Ie).run({type:"Toggle",message:"Include GitHub Actions workflows and CI/CD?",initial:!0,enabled:"Yes",disabled:"No"}),e.title=t.includeGitHubCI?"Including GitHub CI/CD workflows":"Skipping GitHub CI/CD"}};var uP={title:"Pulumi stack name",task:async(t,e)=>{if(t.pulumiStackBase){e.title=`Pulumi stack: ${E.bold(t.pulumiStackBase)}`;return}let r=t.githubOwner||"myorg",n=t.projectName?.replace(/[^a-zA-Z0-9-]/g,"-")||"myproject",i=`${r}/${n}`;t.pulumiStackBase=await e.prompt(Ie).run({type:"Input",message:"Enter Pulumi stack base name (org/project)",initial:i,validate:s=>s?.trim()?s.includes("/")?!0:"Format should be org/project (e.g., myorg/myproject)":"Pulumi stack name is required."}),e.title=`Pulumi stack: ${E.bold(t.pulumiStackBase)}`}};var rp=require("node:fs"),Za=require("node:path");var tp=require("node:fs"),ep=require("node:path"),QR=P(Qd()),bae=t=>t.toUpperCase().replace(/-/g,"_"),Fae=()=>{let t=[(0,ep.join)(__dirname,"templates","hono-microservice"),(0,ep.join)(__dirname,"..","hono-microservice","templates")];for(let e of t)if((0,tp.existsSync)(e))return e;throw new Error(`Hono templates directory not found. Searched in: ${t.join(", ")}`)},wb=(t,e)=>{let r=Fae(),n=(0,ep.join)(r,t),i=(0,tp.readFileSync)(n,"utf-8");return QR.default.compile(i)(e)};function eI(t){return wb("src/index.ts.hbs",{serviceName:t,envKey:bae(t)})}function tI(){return wb("tsconfig.json.hbs",{})}function rI(t="1.2.23"){return wb("Dockerfile.hbs",{bunVersion:t})}var nI={title:"Create Hono app structure",rendererOptions:{outputBar:1e3},task:async(t,e)=>mt(e,async r=>{await Bi("create-hono@latest",[t.projectName,"--pm",t.packageManager,"--template bun","--install"],{task:e});let n=(0,Za.basename)(t.projectName),i="bun run --hot src/index.ts",s=Ok();ya("scripts.start:dev",i,t.projectName),ya("name",`${s}/${n}`,t.projectName);let o=(0,Za.join)(pt(t.projectName),"src","index.ts");(0,rp.writeFileSync)(o,eI(n));let a=(0,Za.join)(pt(t.projectName),"tsconfig.json");(0,rp.writeFileSync)(a,tI());let u=(0,Za.join)(pt(t.projectName),"Dockerfile");(0,rp.writeFileSync)(u,rI()),t.elapsedTime+=r()})};async function Eae(t,e){let{valid:r,config:n,error:i}=Da();(!r||!n)&&(console.log(i),process.exit(1));let s=(e.servicePath||t||"services/my-hono-service").trim(),o=await V0(e.description);K0(s,n,o);try{await z0({servicePath:s,description:o,serviceType:"hono"},n)&&(console.log(E.green.bold(`
|
|
296
296
|
\u2705 Service generated successfully!
|
|
297
|
-
`)),console.log(E.dim("Next steps:")),console.log(E.dim(` 1. ${E.cyan(`cd ${
|
|
297
|
+
`)),console.log(E.dim("Next steps:")),console.log(E.dim(` 1. ${E.cyan(`cd ${s}`)}`)),console.log(E.dim(` 2. ${E.cyan("bun install")}`)),console.log(E.dim(` 3. ${E.cyan("bun dev")}`)),console.log())}catch(a){console.log(E.red.bold(`
|
|
298
298
|
\u274C Error: ${a.message}
|
|
299
299
|
`)),process.exit(1)}}var sI=mi({name:"hono-micro",description:"Create a new Hono microservice with the Crossdelta setup. Use --ai for AI-powered generation.",arguments:[["[name]","Name or path of the service"]],options:[["-P, --package-manager <manager>","Specify the package manager (e.g., npm, yarn, pnpm, bun)"],["--install","Allow create-hono to install dependencies during scaffolding"],["-y, --yes","Skip all prompts and use default values"],["--ai","Use AI to generate service code based on a description"],["-d, --description <description>","Service description for AI generation (requires --ai)"]],exampleUsage:'platform new hono-micro my-service --ai -d "Payment processing service"',buildContext:(t,e)=>{let r=(t.name??"services/my-hono-service").trim(),n=pt(r),i=e.packageManager??(e.yes&&Dt()),s=Er(),o=e.yes?Ta():[],a=e.packageManager==="bun";return{cwd:n,projectName:r,packageManager:i,shouldInstallBun:a,availableIntegrations:s,selectedIntegrations:o,serviceType:"hono",elapsedTime:0,userConfirmed:!!e.yes,removeDir:!!e.yes}},shouldSkipWorkflow:(t,e)=>!!e.ai,onSkipWorkflow:(t,e)=>Eae(t.name,e),prompts:[$a,La,Ma,ja,pd,Pa],actions:[Na,Ia,nI,hd,dd,Dd],onComplete:({projectName:t,packageManager:e,selectedIntegrations:r,assignedPort:n})=>{H.breakLine().log(E.bold.green("Hono Microservice created successfully!")),id(r),sd((0,iI.basename)(t),n??8080);let i=e??Dt();H.breakLine().log(`To start the project, run:
|
|
300
|
-
${E.bold(`cd ${t} && ${i} run dev`)}`).breakLine().log("Happy shipping with Hono! \u26A1\uFE0F").breakLine()}});var mI=require("node:path");var lI=require("node:fs"),fI=require("node:path");var ip=require("node:fs"),np=require("node:path"),oI=P(Qd()),Cae=t=>t.toUpperCase().replace(/-/g,"_"),wae=t=>t.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),Sae=()=>{let t=[(0,np.join)(__dirname,"templates","nest-microservice"),(0,np.join)(__dirname,"..","nest-microservice","templates")];for(let e of t)if((0,ip.existsSync)(e))return e;throw new Error(`NestJS templates directory not found. Searched in: ${t.join(", ")}`)},aI=(t,e)=>{let r=Sae(),n=(0,np.join)(r,t),i=(0,ip.readFileSync)(n,"utf-8");return oI.default.compile(i)(e)};function uI(t,e=3e3){return aI("src/main.ts.hbs",{serviceName:t,envKey:Cae(t),displayName:wae(t),defaultPort:e})}function cI(t="24",e="1.2.23"){return aI("Dockerfile.hbs",{nodeVersion:t,bunVersion:e})}var hI={title:"Create NestJS app structure",rendererOptions:{outputBar:1e3},task:async(t,e)=>mt(e,async r=>{await Bi("@nestjs/cli",["new",t.projectName,"--skip-install","--package-manager",t.packageManager],{task:e});let n=(0,fI.join)(pt(t.projectName),"Dockerfile");(0,lI.writeFileSync)(n,cI()),t.elapsedTime+=r()})};var dI=require("node:fs"),sp=require("node:path");var pI={title:"Patch main.ts with PORT pattern",task:async(t,e)=>mt(e,async r=>{let n=(0,sp.basename)(t.projectName),i=t.assignedPort??3e3,s=(0,sp.join)(pt(t.projectName),"src","main.ts");(0,dI.writeFileSync)(s,uI(n,i)),e.title=`Patched main.ts with PORT || ${n.toUpperCase().replace(/-/g,"_")}_PORT`,t.elapsedTime+=r()})};async function vae(t,e){let
|
|
300
|
+
${E.bold(`cd ${t} && ${i} run dev`)}`).breakLine().log("Happy shipping with Hono! \u26A1\uFE0F").breakLine()}});var mI=require("node:path");var lI=require("node:fs"),fI=require("node:path");var ip=require("node:fs"),np=require("node:path"),oI=P(Qd()),Cae=t=>t.toUpperCase().replace(/-/g,"_"),wae=t=>t.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),Sae=()=>{let t=[(0,np.join)(__dirname,"templates","nest-microservice"),(0,np.join)(__dirname,"..","nest-microservice","templates")];for(let e of t)if((0,ip.existsSync)(e))return e;throw new Error(`NestJS templates directory not found. Searched in: ${t.join(", ")}`)},aI=(t,e)=>{let r=Sae(),n=(0,np.join)(r,t),i=(0,ip.readFileSync)(n,"utf-8");return oI.default.compile(i)(e)};function uI(t,e=3e3){return aI("src/main.ts.hbs",{serviceName:t,envKey:Cae(t),displayName:wae(t),defaultPort:e})}function cI(t="24",e="1.2.23"){return aI("Dockerfile.hbs",{nodeVersion:t,bunVersion:e})}var hI={title:"Create NestJS app structure",rendererOptions:{outputBar:1e3},task:async(t,e)=>mt(e,async r=>{await Bi("@nestjs/cli",["new",t.projectName,"--skip-install","--package-manager",t.packageManager],{task:e});let n=(0,fI.join)(pt(t.projectName),"Dockerfile");(0,lI.writeFileSync)(n,cI()),t.elapsedTime+=r()})};var dI=require("node:fs"),sp=require("node:path");var pI={title:"Patch main.ts with PORT pattern",task:async(t,e)=>mt(e,async r=>{let n=(0,sp.basename)(t.projectName),i=t.assignedPort??3e3,s=(0,sp.join)(pt(t.projectName),"src","main.ts");(0,dI.writeFileSync)(s,uI(n,i)),e.title=`Patched main.ts with PORT || ${n.toUpperCase().replace(/-/g,"_")}_PORT`,t.elapsedTime+=r()})};async function vae(t,e){let{valid:r,config:n,error:i}=Da();(!r||!n)&&(console.log(i),process.exit(1));let s=(e.servicePath||t||"services/my-nest-service").trim(),o=await V0(e.description);K0(s,n,o);try{await z0({servicePath:s,description:o,serviceType:"nest"},n)&&(console.log(E.green.bold(`
|
|
301
301
|
\u2705 Service generated successfully!
|
|
302
|
-
`)),console.log(E.dim("Next steps:")),console.log(E.dim(` 1. ${E.cyan(`cd ${
|
|
302
|
+
`)),console.log(E.dim("Next steps:")),console.log(E.dim(` 1. ${E.cyan(`cd ${s}`)}`)),console.log(E.dim(` 2. ${E.cyan("bun install")}`)),console.log(E.dim(` 3. ${E.cyan("bun run start:dev")}`)),console.log())}catch(a){console.log(E.red.bold(`
|
|
303
303
|
\u274C Error: ${a.message}
|
|
304
304
|
`)),process.exit(1)}}var DI=mi({name:"nest-micro",description:"Create a new NestJS microservice with the Crossdelta setup. Use --ai for AI-powered generation.",arguments:[["[name]","Name or path of the service"]],options:[["-P, --package-manager <manager>","Specify the package manager (e.g., npm, yarn, pnpm, bun)"],["-y, --yes","Skip all prompts and use default values"],["--ai","Use AI to generate service code based on a description"],["-d, --description <description>","Service description for AI generation (requires --ai)"]],exampleUsage:'platform new nest-micro my-service --ai -d "User authentication service"',buildContext:(t,e)=>{let r=(t.name??"services/my-nest-service").trim(),n=pt(r),i=e.packageManager??(e.yes&&Dt()),s=e.packageManager==="bun",o=Er(),a=e.yes?Ta():[];return{cwd:n,projectName:r,shouldInstallBun:s,packageManager:i,availableIntegrations:o,selectedIntegrations:a,serviceType:"nest",elapsedTime:0,userConfirmed:!!e.yes,removeDir:!!e.yes}},shouldSkipWorkflow:(t,e)=>!!e.ai,onSkipWorkflow:(t,e)=>vae(t.name,e),prompts:[$a,La,Ma,ja,pd,Pa],actions:[Na,Ia,hI,hd,pI,md,sP,dd,Dd],onComplete:({projectName:t,packageManager:e,selectedIntegrations:r,assignedPort:n})=>{H.breakLine().log(E.bold.green("NestJS Microservice created successfully!")),id(r),sd((0,mI.basename)(t),n??3e3),H.breakLine().log(`To start the project, run:
|
|
305
|
-
${E.bold(`cd ${t} && ${e} run start:dev`)}`).breakLine().log("Happy coding! \u{1F389}").breakLine()}});var qt=require("node:fs"),Mi=require("node:path"),gI=P(Qd()),_ae=()=>{let t=[(0,Mi.join)(__dirname,"templates","workspace"),(0,Mi.join)(__dirname,"..","workspace","templates")];for(let e of t)if((0,qt.existsSync)(e))return e;throw new Error(`Workspace templates directory not found. Searched in: ${t.join(", ")}`)},Aae=(t,e)=>{let r=(0,qt.readFileSync)(t,"utf-8");return gI.default.compile(r)(e)},Bae=[{template:"package.json.hbs",output:"package.json"},{template:"biome.json.hbs",output:"biome.json"},{template:"turbo.json.hbs",output:"turbo.json"},{template:"bunfig.toml.hbs",output:"bunfig.toml"},{template:"gitignore.hbs",output:".gitignore"},{template:"editorconfig.hbs",output:".editorconfig"},{template:"npmrc.hbs",output:".npmrc"},{template:"infra/package.json.hbs",output:"infra/package.json"},{template:"infra/index.ts.hbs",output:"infra/index.ts"},{template:"infra/tsconfig.json.hbs",output:"infra/tsconfig.json"},{template:"infra/Pulumi.yaml.hbs",output:"infra/Pulumi.yaml"},{template:"infra/Pulumi.dev.yaml.hbs",output:"infra/Pulumi.dev.yaml"},{template:"infra/services/example.ts.hbs",output:"infra/services/example.ts"},{template:"apps/.gitkeep",output:"apps/.gitkeep",isStatic:!0},{template:"services/.gitkeep",output:"services/.gitkeep",isStatic:!0},{template:"packages/.gitkeep",output:"packages/.gitkeep",isStatic:!0},{template:"docs/.gitkeep",output:"docs/.gitkeep",isStatic:!0},{template:".github/copilot-instructions.md.hbs",output:".github/copilot-instructions.md"},{template:".github/README.md",output:".github/README.md",isStatic:!0,isGitHubCI:!0},{template:".github/dependabot.yml",output:".github/dependabot.yml",isStatic:!0,isGitHubCI:!0},{template:".github/workflows/lint-and-tests.yml.hbs",output:".github/workflows/lint-and-tests.yml",isGitHubCI:!0},{template:".github/workflows/build-and-deploy.yml.hbs",output:".github/workflows/build-and-deploy.yml",isGitHubCI:!0},{template:".github/workflows/publish-packages.yml",output:".github/workflows/publish-packages.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/setup-bun-install/action.yml.hbs",output:".github/actions/setup-bun-install/action.yml",isGitHubCI:!0},{template:".github/actions/check-image-tag-exists/action.yml",output:".github/actions/check-image-tag-exists/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/check-image-tag-exists/index.js",output:".github/actions/check-image-tag-exists/index.js",isStatic:!0,isGitHubCI:!0},{template:".github/actions/check-path-changes/action.yml",output:".github/actions/check-path-changes/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/check-path-changes/index.js",output:".github/actions/check-path-changes/index.js",isStatic:!0,isGitHubCI:!0},{template:".github/actions/detect-skipped-services/action.yml",output:".github/actions/detect-skipped-services/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/generate-scope-matrix/action.yml",output:".github/actions/generate-scope-matrix/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/generate-scope-matrix/index.js",output:".github/actions/generate-scope-matrix/index.js",isStatic:!0,isGitHubCI:!0},{template:".github/actions/prepare-build-context/action.yml",output:".github/actions/prepare-build-context/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/resolve-scope-tags/action.yml",output:".github/actions/resolve-scope-tags/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/resolve-scope-tags/index.js",output:".github/actions/resolve-scope-tags/index.js",isStatic:!0,isGitHubCI:!0}],xI={title:"Creating workspace structure",task:async(t,e)=>{if((0,qt.existsSync)(t.cwd)){e.title="Workspace directory already exists, skipping...";return}let r=_ae(),n=t.includeGitHubCI??!0,i={projectName:t.projectName,githubOwner:t.githubOwner||"",pulumiStackBase:t.pulumiStackBase||t.projectName},s=Bae.filter(o=>!(o.isGitHubCI&&!n));for(let o of s){let a=(0,Mi.join)(t.cwd,o.output),u=(0,Mi.dirname)(a);if((0,qt.existsSync)(u)||(0,qt.mkdirSync)(u,{recursive:!0}),o.isStatic){let c=(0,Mi.join)(r,o.template);(0,qt.existsSync)(c)?(0,qt.writeFileSync)(a,(0,qt.readFileSync)(c)):(0,qt.writeFileSync)(a,"")}else{let c=(0,Mi.join)(r,o.template),l=Aae(c,i);(0,qt.writeFileSync)(a,l)}}e.title="Workspace structure created"}};var yI=mi({name:"workspace",description:"Create a new workspace with infrastructure setup",arguments:[["[name]","Name or path of the workspace"]],options:[["-P, --package-manager <manager>","Specify the package manager (e.g., npm, yarn, pnpm, bun)"],["-y, --yes","Skip all prompts and use default values"],["-o, --github-owner <owner>","GitHub organization or username"],["-s, --pulumi-stack <name>","Pulumi stack base name (org/project)"],["--no-github","Skip GitHub CI/CD workflows"]],exampleUsage:"pf new workspace my-platform -o my-org",buildContext:(t,e)=>{let r=(t.name??"my-platform").trim(),n=pt(r),i=e.packageManager??(e.yes?Dt():void 0),s=e.packageManager==="bun",o=!!e.yes,a=e.githubOwner??(o?"my-org":void 0),u=e.pulumiStack??(o?`${a}/${r}`:void 0),c=e.github!==void 0?e.github:o?!0:void 0;return{cwd:n,projectName:r,shouldInstallBun:s,packageManager:i,elapsedTime:0,userConfirmed:o,removeDir:o,githubOwner:a,pulumiStackBase:u,includeGitHubCI:c}},prompts:[$a,La,oP,aP,uP,Ma,ja,Pa],actions:[Na,Ia,xI,md,iP],onComplete:({projectName:t,includeGitHubCI:e})=>{H.breakLine().log(E.bold.green("Workspace created successfully!")),H.breakLine().log(E.bold("Next steps:")).log(` 1. ${E.cyan(`cd ${t}`)}`).log(` 2. ${E.cyan("bun pulumi login")}`).log(` 3. ${E.cyan("bun pulumi up --stack dev")}`),e&&H.breakLine().log(E.bold("GitHub Setup:")).log(" Configure these secrets in your GitHub repository:").log(` \u2022 ${E.yellow("PULUMI_ACCESS_TOKEN")} - Pulumi Cloud access token`).log(` \u2022 ${E.yellow("DIGITALOCEAN_TOKEN")} - DigitalOcean API token`).log(` \u2022 ${E.yellow("NPM_TOKEN")} - (optional) NPM token for private packages`),H.breakLine().log(E.bold("Structure created:")).log(" apps/ # Frontend applications").log(" services/ # Backend microservices").log(" packages/ # Shared libraries").log(" infra/").log(" \u251C\u2500\u2500 index.ts # Pulumi entry point").log(" \u251C\u2500\u2500 services/ # Service configs").log(" \u251C\u2500\u2500 Pulumi.yaml # Pulumi project config").log(" \u2514\u2500\u2500 Pulumi.dev.yaml # Dev stack config"),e&&H.log(" .github/").log(" \u251C\u2500\u2500 workflows/ # CI/CD workflows").log(" \u2514\u2500\u2500 actions/ # Custom actions"),H.breakLine().log("Happy coding! \u{1F389}").breakLine()}});var Dl=[{name:"Hono Microservice",value:"hono-micro",command:sI,supportsAi:!0},{name:"Nest Microservice",value:"nest-micro",command:DI,supportsAi:!0},{name:"Workspace (Infrastructure)",value:"workspace",command:yI,supportsAi:!1}],bI=()=>{let t=mi({name:"new",description:"Create a new project",arguments:[["[type]","Type of the project (e.g., nest-micro, shopware-plugin)"]],exampleUsage:"platform new nest-micro test-project",buildContext:e=>({projectType:e.type??"",useAi:!1,aiDescription:"",elapsedTime:0,cwd:process.cwd()}),prompts:[{enabled:e=>!e.projectType,task:async(e,r)=>{let n=await r.prompt(
|
|
305
|
+
${E.bold(`cd ${t} && ${e} run start:dev`)}`).breakLine().log("Happy coding! \u{1F389}").breakLine()}});var qt=require("node:fs"),Mi=require("node:path"),gI=P(Qd()),_ae=()=>{let t=[(0,Mi.join)(__dirname,"templates","workspace"),(0,Mi.join)(__dirname,"..","workspace","templates")];for(let e of t)if((0,qt.existsSync)(e))return e;throw new Error(`Workspace templates directory not found. Searched in: ${t.join(", ")}`)},Aae=(t,e)=>{let r=(0,qt.readFileSync)(t,"utf-8");return gI.default.compile(r)(e)},Bae=[{template:"package.json.hbs",output:"package.json"},{template:"biome.json.hbs",output:"biome.json"},{template:"turbo.json.hbs",output:"turbo.json"},{template:"bunfig.toml.hbs",output:"bunfig.toml"},{template:"gitignore.hbs",output:".gitignore"},{template:"editorconfig.hbs",output:".editorconfig"},{template:"npmrc.hbs",output:".npmrc"},{template:"infra/package.json.hbs",output:"infra/package.json"},{template:"infra/index.ts.hbs",output:"infra/index.ts"},{template:"infra/tsconfig.json.hbs",output:"infra/tsconfig.json"},{template:"infra/Pulumi.yaml.hbs",output:"infra/Pulumi.yaml"},{template:"infra/Pulumi.dev.yaml.hbs",output:"infra/Pulumi.dev.yaml"},{template:"infra/services/example.ts.hbs",output:"infra/services/example.ts"},{template:"apps/.gitkeep",output:"apps/.gitkeep",isStatic:!0},{template:"services/.gitkeep",output:"services/.gitkeep",isStatic:!0},{template:"packages/.gitkeep",output:"packages/.gitkeep",isStatic:!0},{template:"docs/.gitkeep",output:"docs/.gitkeep",isStatic:!0},{template:".github/copilot-instructions.md.hbs",output:".github/copilot-instructions.md"},{template:".github/README.md",output:".github/README.md",isStatic:!0,isGitHubCI:!0},{template:".github/dependabot.yml",output:".github/dependabot.yml",isStatic:!0,isGitHubCI:!0},{template:".github/workflows/lint-and-tests.yml.hbs",output:".github/workflows/lint-and-tests.yml",isGitHubCI:!0},{template:".github/workflows/build-and-deploy.yml.hbs",output:".github/workflows/build-and-deploy.yml",isGitHubCI:!0},{template:".github/workflows/publish-packages.yml",output:".github/workflows/publish-packages.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/setup-bun-install/action.yml.hbs",output:".github/actions/setup-bun-install/action.yml",isGitHubCI:!0},{template:".github/actions/check-image-tag-exists/action.yml",output:".github/actions/check-image-tag-exists/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/check-image-tag-exists/index.js",output:".github/actions/check-image-tag-exists/index.js",isStatic:!0,isGitHubCI:!0},{template:".github/actions/check-path-changes/action.yml",output:".github/actions/check-path-changes/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/check-path-changes/index.js",output:".github/actions/check-path-changes/index.js",isStatic:!0,isGitHubCI:!0},{template:".github/actions/detect-skipped-services/action.yml",output:".github/actions/detect-skipped-services/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/generate-scope-matrix/action.yml",output:".github/actions/generate-scope-matrix/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/generate-scope-matrix/index.js",output:".github/actions/generate-scope-matrix/index.js",isStatic:!0,isGitHubCI:!0},{template:".github/actions/prepare-build-context/action.yml",output:".github/actions/prepare-build-context/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/resolve-scope-tags/action.yml",output:".github/actions/resolve-scope-tags/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/resolve-scope-tags/index.js",output:".github/actions/resolve-scope-tags/index.js",isStatic:!0,isGitHubCI:!0}],xI={title:"Creating workspace structure",task:async(t,e)=>{if((0,qt.existsSync)(t.cwd)){e.title="Workspace directory already exists, skipping...";return}let r=_ae(),n=t.includeGitHubCI??!0,i={projectName:t.projectName,githubOwner:t.githubOwner||"",pulumiStackBase:t.pulumiStackBase||t.projectName},s=Bae.filter(o=>!(o.isGitHubCI&&!n));for(let o of s){let a=(0,Mi.join)(t.cwd,o.output),u=(0,Mi.dirname)(a);if((0,qt.existsSync)(u)||(0,qt.mkdirSync)(u,{recursive:!0}),o.isStatic){let c=(0,Mi.join)(r,o.template);(0,qt.existsSync)(c)?(0,qt.writeFileSync)(a,(0,qt.readFileSync)(c)):(0,qt.writeFileSync)(a,"")}else{let c=(0,Mi.join)(r,o.template),l=Aae(c,i);(0,qt.writeFileSync)(a,l)}}e.title="Workspace structure created"}};var yI=mi({name:"workspace",description:"Create a new workspace with infrastructure setup",arguments:[["[name]","Name or path of the workspace"]],options:[["-P, --package-manager <manager>","Specify the package manager (e.g., npm, yarn, pnpm, bun)"],["-y, --yes","Skip all prompts and use default values"],["-o, --github-owner <owner>","GitHub organization or username"],["-s, --pulumi-stack <name>","Pulumi stack base name (org/project)"],["--no-github","Skip GitHub CI/CD workflows"]],exampleUsage:"pf new workspace my-platform -o my-org",buildContext:(t,e)=>{let r=(t.name??"my-platform").trim(),n=pt(r),i=e.packageManager??(e.yes?Dt():void 0),s=e.packageManager==="bun",o=!!e.yes,a=e.githubOwner??(o?"my-org":void 0),u=e.pulumiStack??(o?`${a}/${r}`:void 0),c=e.github!==void 0?e.github:o?!0:void 0;return{cwd:n,projectName:r,shouldInstallBun:s,packageManager:i,elapsedTime:0,userConfirmed:o,removeDir:o,githubOwner:a,pulumiStackBase:u,includeGitHubCI:c}},prompts:[$a,La,oP,aP,uP,Ma,ja,Pa],actions:[Na,Ia,xI,md,iP],onComplete:({projectName:t,includeGitHubCI:e})=>{H.breakLine().log(E.bold.green("Workspace created successfully!")),H.breakLine().log(E.bold("Next steps:")).log(` 1. ${E.cyan(`cd ${t}`)}`).log(` 2. ${E.cyan("bun pulumi login")}`).log(` 3. ${E.cyan("bun pulumi up --stack dev")}`),e&&H.breakLine().log(E.bold("GitHub Setup:")).log(" Configure these secrets in your GitHub repository:").log(` \u2022 ${E.yellow("PULUMI_ACCESS_TOKEN")} - Pulumi Cloud access token`).log(` \u2022 ${E.yellow("DIGITALOCEAN_TOKEN")} - DigitalOcean API token`).log(` \u2022 ${E.yellow("NPM_TOKEN")} - (optional) NPM token for private packages`),H.breakLine().log(E.bold("Structure created:")).log(" apps/ # Frontend applications").log(" services/ # Backend microservices").log(" packages/ # Shared libraries").log(" infra/").log(" \u251C\u2500\u2500 index.ts # Pulumi entry point").log(" \u251C\u2500\u2500 services/ # Service configs").log(" \u251C\u2500\u2500 Pulumi.yaml # Pulumi project config").log(" \u2514\u2500\u2500 Pulumi.dev.yaml # Dev stack config"),e&&H.log(" .github/").log(" \u251C\u2500\u2500 workflows/ # CI/CD workflows").log(" \u2514\u2500\u2500 actions/ # Custom actions"),H.breakLine().log("Happy coding! \u{1F389}").breakLine()}});var Dl=[{name:"Hono Microservice",value:"hono-micro",command:sI,supportsAi:!0},{name:"Nest Microservice",value:"nest-micro",command:DI,supportsAi:!0},{name:"Workspace (Infrastructure)",value:"workspace",command:yI,supportsAi:!1}],bI=()=>{let t=mi({name:"new",description:"Create a new project",arguments:[["[type]","Type of the project (e.g., nest-micro, shopware-plugin)"]],exampleUsage:"platform new nest-micro test-project",buildContext:e=>({projectType:e.type??"",useAi:!1,aiDescription:"",elapsedTime:0,cwd:process.cwd()}),prompts:[{enabled:e=>!e.projectType,task:async(e,r)=>{let n=await r.prompt(Ie).run({type:"select",message:"Select Project type",choices:Dl});e.projectType=Dl.find(i=>i.name===n)?.value||"",r.title=`Using ${E.bold(n)}`}},{enabled:e=>!!Dl.find(n=>n.value===e.projectType)?.supportsAi&&Da().valid,task:async(e,r)=>{let n=await r.prompt(Ie).run({type:"toggle",message:"Use AI to generate service code?",enabled:"Yes",disabled:"No",initial:!1});e.useAi=n,r.title=n?E.cyan("\u{1F916} AI-powered generation"):"Standard scaffolding"}},{enabled:e=>e.useAi,task:async(e,r)=>{let n=await r.prompt(Ie).run({type:"input",message:"\u{1F4E6} Service path (e.g., services/my-service):",initial:"services/my-hono-service"});e.servicePath=n.trim(),r.title=`Path: ${E.dim(n)}`}},{enabled:e=>e.useAi,task:async(e,r)=>{let n=await r.prompt(Ie).run({type:"input",message:"Describe what this service should do:"});e.aiDescription=n,r.title=`Description: ${E.dim(n.slice(0,50))}${n.length>50?"...":""}`}}],actions:[],onComplete:async e=>{Dl.find(i=>i.value===e.projectType)||t.error(E.red(`Project type ${e.projectType} is not supported.`));let r=t.commands.find(i=>i.name()===e.projectType),n={};e.useAi&&(n.ai=!0,n.description=e.aiDescription,n.servicePath=e.servicePath),await QO(r,e,n)}});for(let e of Dl)t.addCommand(e.command);return t};var bn=require("node:fs"),op=require("node:path");var CI=300,Tae=1e3,FI=["infra/services"],EI=["services","apps"],gl=null,xl=!1,Li=t=>{process.stdout.write(`${t}
|
|
306
306
|
`)},kae=t=>new Promise(e=>setTimeout(e,t)),wI=(t,e)=>{let r=null;return(...n)=>{r&&clearTimeout(r),r=setTimeout(()=>t(...n),e)}},Oae=()=>{process.stdout.write("\x1B[2J\x1B[0f")},Pae=t=>{let e=(0,op.join)(t,"package.json");try{let r=(0,bn.readFileSync)(e,"utf-8"),n=JSON.parse(r);return{watchDirs:n.pf?.dev?.watchDirs??FI,watchPackages:n.pf?.dev?.watchPackages??EI}}catch{return{watchDirs:FI,watchPackages:EI}}},SI=async()=>{if(gl?.pid){try{process.kill(-gl.pid,"SIGTERM")}catch{try{gl.kill("SIGTERM")}catch{}}gl=null,await kae(Tae)}},vI=t=>{gl=yk("turbo",["start:dev","--continue"],{cwd:t,envFile:".env.local",onStderr:e=>{xl||process.stderr.write(e)},onExit:e=>{xl||(Li(`
|
|
307
307
|
Turbo exited with code ${e}`),process.exit(e??0))}})},_I=async t=>{Li("\u{1F4DD} Generating .env.local..."),await Yt("bun",["run","generate-env"],{cwd:t,quiet:!0})},Rae=async t=>{Li("\u{1F4E6} Installing dependencies..."),await Yt("bun",["install"],{cwd:t,quiet:!0})},Iae=t=>{for(let e of Object.keys(require.cache))t.some(r=>e.includes(r))&&delete require.cache[e]},AI=async(t,e,r,n=!1)=>{if(!xl){xl=!0;try{Iae(r),await SI(),Oae(),Li(`\u{1F504} Detected change in ${E.cyan(t.replace(/ /g,""))}, restarting...`),n&&await Rae(e),await _I(e),vI(e)}catch(i){Li(`\u274C Failed to restart: ${i}`)}finally{xl=!1}}},Mae=(t,e)=>{for(let r of t){let n=(0,op.join)(e,r),i=wI(s=>AI(s,e,t),CI);(0,bn.watch)(n,{recursive:!0},(s,o)=>{o?.endsWith(".ts")&&i(o)})}},Lae=(t,e,r)=>{for(let n of t){let i=(0,op.join)(e,n);if(!(0,bn.existsSync)(i))continue;let s=new Set((0,bn.readdirSync)(i,{withFileTypes:!0}).filter(a=>a.isDirectory()).map(a=>a.name)),o=wI(async()=>{let a=new Set((0,bn.readdirSync)(i,{withFileTypes:!0}).filter(l=>l.isDirectory()).map(l=>l.name)),u=[...a].filter(l=>!s.has(l)),c=[...s].filter(l=>!a.has(l));if(u.length>0||c.length>0){let l=[...u.map(f=>`+${f}`),...c.map(f=>`-${f}`)].join(", ");s=a,await AI(`${n}/ [${l}]`,e,r,!0)}},CI);(0,bn.watch)(i,{recursive:!1},()=>o())}},Nae=()=>{let t=async()=>{Li(`
|
|
308
308
|
\u{1F44B} Shutting down...`),await SI(),process.exit(0)};process.on("SIGINT",t),process.on("SIGTERM",t)},BI=new ut("dev").description("Start development environment with hot reload").option("--no-watch","Disable watching for changes").action(async t=>{let e=Kc(),r=Pae(e);if(await _I(e),vI(e),!t.watch){Li(`
|