@fnet/cli 1.0.17 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +0,0 @@
1
- import{g as I,h as B8,i as D}from"./index.cvxrf34y.js";var R8=B8((_5,M8)=>{M8.exports=w8;function w8(Q,X,$){if(Q instanceof RegExp)Q=U8(Q,$);if(X instanceof RegExp)X=U8(X,$);var Z=C8(Q,X,$);return Z&&{start:Z[0],end:Z[1],pre:$.slice(0,Z[0]),body:$.slice(Z[0]+Q.length,Z[1]),post:$.slice(Z[1]+X.length)}}function U8(Q,X){var $=X.match(Q);return $?$[0]:null}w8.range=C8;function C8(Q,X,$){var Z,J,V,q,_,Y=$.indexOf(Q),H=$.indexOf(X,Y+1),K=Y;if(Y>=0&&H>0){if(Q===X)return[Y,H];Z=[],V=$.length;while(K>=0&&!_){if(K==Y)Z.push(K),Y=$.indexOf(Q,K+1);else if(Z.length==1)_=[Z.pop(),H];else{if(J=Z.pop(),J<V)V=J,q=H;H=$.indexOf(X,K+1)}K=Y<H&&Y>=0?Y:H}if(Z.length)_=[V,q]}return _}});var P8=B8((Y5,v8)=>{var A8=R8();v8.exports=PQ;var I8="\x00SLASH"+Math.random()+"\x00",L8="\x00OPEN"+Math.random()+"\x00",s0="\x00CLOSE"+Math.random()+"\x00",O8="\x00COMMA"+Math.random()+"\x00",F8="\x00PERIOD"+Math.random()+"\x00";function a0(Q){return parseInt(Q,10)==Q?parseInt(Q,10):Q.charCodeAt(0)}function NQ(Q){return Q.split("\\\\").join(I8).split("\\{").join(L8).split("\\}").join(s0).split("\\,").join(O8).split("\\.").join(F8)}function vQ(Q){return Q.split(I8).join("\\").split(L8).join("{").split(s0).join("}").split(O8).join(",").split(F8).join(".")}function N8(Q){if(!Q)return[""];var X=[],$=A8("{","}",Q);if(!$)return Q.split(",");var{pre:Z,body:J,post:V}=$,q=Z.split(",");q[q.length-1]+="{"+J+"}";var _=N8(V);if(V.length)q[q.length-1]+=_.shift(),q.push.apply(q,_);return X.push.apply(X,q),X}function PQ(Q){if(!Q)return[];if(Q.substr(0,2)==="{}")Q="\\{\\}"+Q.substr(2);return G0(NQ(Q),!0).map(vQ)}function DQ(Q){return"{"+Q+"}"}function kQ(Q){return/^-?0\d/.test(Q)}function SQ(Q,X){return Q<=X}function TQ(Q,X){return Q>=X}function G0(Q,X){var $=[],Z=A8("{","}",Q);if(!Z)return[Q];var J=Z.pre,V=Z.post.length?G0(Z.post,!1):[""];if(/\$$/.test(Z.pre))for(var q=0;q<V.length;q++){var _=J+"{"+Z.body+"}"+V[q];$.push(_)}else{var Y=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(Z.body),H=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(Z.body),K=Y||H,G=Z.body.indexOf(",")>=0;if(!K&&!G){if(Z.post.match(/,.*\}/))return Q=Z.pre+"{"+Z.body+s0+Z.post,G0(Q);return[Q]}var W;if(K)W=Z.body.split(/\.\./);else if(W=N8(Z.body),W.length===1){if(W=G0(W[0],!1).map(DQ),W.length===1)return V.map(function(FQ){return Z.pre+W[0]+FQ})}var z;if(K){var j=a0(W[0]),U=a0(W[1]),B=Math.max(W[0].length,W[1].length),C=W.length==3?Math.abs(a0(W[2])):1,M=SQ,w=U<j;if(w)C*=-1,M=TQ;var R=W.some(kQ);z=[];for(var u=j;M(u,U);u+=C){var N;if(H){if(N=String.fromCharCode(u),N==="\\")N=""}else if(N=String(u),R){var t=B-N.length;if(t>0){var V0=Array(t+1).join("0");if(u<0)N="-"+V0+N.slice(1);else N=V0+N}}z.push(N)}}else{z=[];for(var g=0;g<W.length;g++)z.push.apply(z,G0(W[g],!1))}for(var g=0;g<z.length;g++)for(var q=0;q<V.length;q++){var _=J+z[g]+V[q];if(!X||K||_)$.push(_)}}return $}});var x8=I(P8(),1);var j0=(Q)=>{if(typeof Q!=="string")throw TypeError("invalid pattern");if(Q.length>65536)throw TypeError("pattern is too long")};var bQ={"[: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]},z0=(Q)=>Q.replace(/[[\]\\-]/g,"\\$&"),uQ=(Q)=>Q.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),D8=(Q)=>Q.join(""),k8=(Q,X)=>{let $=X;if(Q.charAt($)!=="[")throw Error("not in a brace expression");let Z=[],J=[],V=$+1,q=!1,_=!1,Y=!1,H=!1,K=$,G="";Q:while(V<Q.length){let U=Q.charAt(V);if((U==="!"||U==="^")&&V===$+1){H=!0,V++;continue}if(U==="]"&&q&&!Y){K=V+1;break}if(q=!0,U==="\\"){if(!Y){Y=!0,V++;continue}}if(U==="["&&!Y){for(let[B,[C,M,w]]of Object.entries(bQ))if(Q.startsWith(B,V)){if(G)return["$.",!1,Q.length-$,!0];if(V+=B.length,w)J.push(C);else Z.push(C);_=_||M;continue Q}}if(Y=!1,G){if(U>G)Z.push(z0(G)+"-"+z0(U));else if(U===G)Z.push(z0(U));G="",V++;continue}if(Q.startsWith("-]",V+1)){Z.push(z0(U+"-")),V+=2;continue}if(Q.startsWith("-",V+1)){G=U,V+=2;continue}Z.push(z0(U)),V++}if(K<V)return["",!1,0,!1];if(!Z.length&&!J.length)return["$.",!1,Q.length-$,!0];if(J.length===0&&Z.length===1&&/^\\?.$/.test(Z[0])&&!H){let U=Z[0].length===2?Z[0].slice(-1):Z[0];return[uQ(U),!1,K-$,!1]}let W="["+(H?"^":"")+D8(Z)+"]",z="["+(H?"":"^")+D8(J)+"]";return[Z.length&&J.length?"("+W+"|"+z+")":Z.length?W:z,_,K-$,!0]};var h=(Q,{windowsPathsNoEscape:X=!1}={})=>{return X?Q.replace(/\[([^\/\\])\]/g,"$1"):Q.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")};var EQ=new Set(["!","?","+","*","@"]),S8=(Q)=>EQ.has(Q),xQ="(?!(?:^|/)\\.\\.?(?:$|/))",D0="(?!\\.)",mQ=new Set(["[","."]),fQ=new Set(["..","."]),yQ=new Set("().*{}+?[]^$\\!"),gQ=(Q)=>Q.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),e0="[^/]",T8=e0+"*?",b8=e0+"+?";class v{type;#Q;#X;#$=!1;#J=[];#q;#M;#U;#_=!1;#H;#Y;#K=!1;constructor(Q,X,$={}){if(this.type=Q,Q)this.#X=!0;if(this.#q=X,this.#Q=this.#q?this.#q.#Q:this,this.#H=this.#Q===this?$:this.#Q.#H,this.#U=this.#Q===this?[]:this.#Q.#U,Q==="!"&&!this.#Q.#_)this.#U.push(this);this.#M=this.#q?this.#q.#J.length:0}get hasMagic(){if(this.#X!==void 0)return this.#X;for(let Q of this.#J){if(typeof Q==="string")continue;if(Q.type||Q.hasMagic)return this.#X=!0}return this.#X}toString(){if(this.#Y!==void 0)return this.#Y;if(!this.type)return this.#Y=this.#J.map((Q)=>String(Q)).join("");else return this.#Y=this.type+"("+this.#J.map((Q)=>String(Q)).join("|")+")"}#Z(){if(this!==this.#Q)throw Error("should only call on root");if(this.#_)return this;this.toString(),this.#_=!0;let Q;while(Q=this.#U.pop()){if(Q.type!=="!")continue;let X=Q,$=X.#q;while($){for(let Z=X.#M+1;!$.type&&Z<$.#J.length;Z++)for(let J of Q.#J){if(typeof J==="string")throw Error("string part in extglob AST??");J.copyIn($.#J[Z])}X=$,$=X.#q}}return this}push(...Q){for(let X of Q){if(X==="")continue;if(typeof X!=="string"&&!(X instanceof v&&X.#q===this))throw Error("invalid part: "+X);this.#J.push(X)}}toJSON(){let Q=this.type===null?this.#J.slice().map((X)=>typeof X==="string"?X:X.toJSON()):[this.type,...this.#J.map((X)=>X.toJSON())];if(this.isStart()&&!this.type)Q.unshift([]);if(this.isEnd()&&(this===this.#Q||this.#Q.#_&&this.#q?.type==="!"))Q.push({});return Q}isStart(){if(this.#Q===this)return!0;if(!this.#q?.isStart())return!1;if(this.#M===0)return!0;let Q=this.#q;for(let X=0;X<this.#M;X++){let $=Q.#J[X];if(!($ instanceof v&&$.type==="!"))return!1}return!0}isEnd(){if(this.#Q===this)return!0;if(this.#q?.type==="!")return!0;if(!this.#q?.isEnd())return!1;if(!this.type)return this.#q?.isEnd();let Q=this.#q?this.#q.#J.length:0;return this.#M===Q-1}copyIn(Q){if(typeof Q==="string")this.push(Q);else this.push(Q.clone(this))}clone(Q){let X=new v(this.type,Q);for(let $ of this.#J)X.copyIn($);return X}static#G(Q,X,$,Z){let J=!1,V=!1,q=-1,_=!1;if(X.type===null){let W=$,z="";while(W<Q.length){let j=Q.charAt(W++);if(J||j==="\\"){J=!J,z+=j;continue}if(V){if(W===q+1){if(j==="^"||j==="!")_=!0}else if(j==="]"&&!(W===q+2&&_))V=!1;z+=j;continue}else if(j==="["){V=!0,q=W,_=!1,z+=j;continue}if(!Z.noext&&S8(j)&&Q.charAt(W)==="("){X.push(z),z="";let U=new v(j,X);W=v.#G(Q,U,W,Z),X.push(U);continue}z+=j}return X.push(z),W}let Y=$+1,H=new v(null,X),K=[],G="";while(Y<Q.length){let W=Q.charAt(Y++);if(J||W==="\\"){J=!J,G+=W;continue}if(V){if(Y===q+1){if(W==="^"||W==="!")_=!0}else if(W==="]"&&!(Y===q+2&&_))V=!1;G+=W;continue}else if(W==="["){V=!0,q=Y,_=!1,G+=W;continue}if(S8(W)&&Q.charAt(Y)==="("){H.push(G),G="";let z=new v(W,H);H.push(z),Y=v.#G(Q,z,Y,Z);continue}if(W==="|"){H.push(G),G="",K.push(H),H=new v(null,X);continue}if(W===")"){if(G===""&&X.#J.length===0)X.#K=!0;return H.push(G),G="",X.push(...K,H),Y}G+=W}return X.type=null,X.#X=void 0,X.#J=[Q.substring($-1)],Y}static fromGlob(Q,X={}){let $=new v(null,void 0,X);return v.#G(Q,$,0,X),$}toMMPattern(){if(this!==this.#Q)return this.#Q.toMMPattern();let Q=this.toString(),[X,$,Z,J]=this.toRegExpSource();if(!(Z||this.#X||this.#H.nocase&&!this.#H.nocaseMagicOnly&&Q.toUpperCase()!==Q.toLowerCase()))return $;let q=(this.#H.nocase?"i":"")+(J?"u":"");return Object.assign(new RegExp(`^${X}$`,q),{_src:X,_glob:Q})}get options(){return this.#H}toRegExpSource(Q){let X=Q??!!this.#H.dot;if(this.#Q===this)this.#Z();if(!this.type){let _=this.isStart()&&this.isEnd(),Y=this.#J.map((W)=>{let[z,j,U,B]=typeof W==="string"?v.#j(W,this.#X,_):W.toRegExpSource(Q);return this.#X=this.#X||U,this.#$=this.#$||B,z}).join(""),H="";if(this.isStart()){if(typeof this.#J[0]==="string"){if(!(this.#J.length===1&&fQ.has(this.#J[0]))){let z=mQ,j=X&&z.has(Y.charAt(0))||Y.startsWith("\\.")&&z.has(Y.charAt(2))||Y.startsWith("\\.\\.")&&z.has(Y.charAt(4)),U=!X&&!Q&&z.has(Y.charAt(0));H=j?xQ:U?D0:""}}}let K="";if(this.isEnd()&&this.#Q.#_&&this.#q?.type==="!")K="(?:$|\\/)";return[H+Y+K,h(Y),this.#X=!!this.#X,this.#$]}let $=this.type==="*"||this.type==="+",Z=this.type==="!"?"(?:(?!(?:":"(?:",J=this.#B(X);if(this.isStart()&&this.isEnd()&&!J&&this.type!=="!"){let _=this.toString();return this.#J=[_],this.type=null,this.#X=void 0,[_,h(this.toString()),!1,!1]}let V=!$||Q||X||!D0?"":this.#B(!0);if(V===J)V="";if(V)J=`(?:${J})(?:${V})*?`;let q="";if(this.type==="!"&&this.#K)q=(this.isStart()&&!X?D0:"")+b8;else{let _=this.type==="!"?"))"+(this.isStart()&&!X&&!Q?D0:"")+T8+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&V?")":this.type==="*"&&V?")?":`)${this.type}`;q=Z+J+_}return[q,h(J),this.#X=!!this.#X,this.#$]}#B(Q){return this.#J.map((X)=>{if(typeof X==="string")throw Error("string type in extglob ast??");let[$,Z,J,V]=X.toRegExpSource(Q);return this.#$=this.#$||V,$}).filter((X)=>!(this.isStart()&&this.isEnd())||!!X).join("|")}static#j(Q,X,$=!1){let Z=!1,J="",V=!1;for(let q=0;q<Q.length;q++){let _=Q.charAt(q);if(Z){Z=!1,J+=(yQ.has(_)?"\\":"")+_;continue}if(_==="\\"){if(q===Q.length-1)J+="\\\\";else Z=!0;continue}if(_==="["){let[Y,H,K,G]=k8(Q,q);if(K){J+=Y,V=V||H,q+=K-1,X=X||G;continue}}if(_==="*"){if($&&Q==="*")J+=b8;else J+=T8;X=!0;continue}if(_==="?"){J+=e0,X=!0;continue}J+=gQ(_)}return[J,h(Q),!!X,V]}}var q0=(Q,{windowsPathsNoEscape:X=!1}={})=>{return X?Q.replace(/[?*()[\]]/g,"[$&]"):Q.replace(/[?*()[\]\\]/g,"\\$&")};var S=(Q,X,$={})=>{if(j0(X),!$.nocomment&&X.charAt(0)==="#")return!1;return new m(X,$).match(Q)},hQ=/^\*+([^+@!?\*\[\(]*)$/,dQ=(Q)=>(X)=>!X.startsWith(".")&&X.endsWith(Q),cQ=(Q)=>(X)=>X.endsWith(Q),lQ=(Q)=>{return Q=Q.toLowerCase(),(X)=>!X.startsWith(".")&&X.toLowerCase().endsWith(Q)},oQ=(Q)=>{return Q=Q.toLowerCase(),(X)=>X.toLowerCase().endsWith(Q)},pQ=/^\*+\.\*+$/,iQ=(Q)=>!Q.startsWith(".")&&Q.includes("."),nQ=(Q)=>Q!=="."&&Q!==".."&&Q.includes("."),rQ=/^\.\*+$/,aQ=(Q)=>Q!=="."&&Q!==".."&&Q.startsWith("."),sQ=/^\*+$/,eQ=(Q)=>Q.length!==0&&!Q.startsWith("."),tQ=(Q)=>Q.length!==0&&Q!=="."&&Q!=="..",QX=/^\?+([^+@!?\*\[\(]*)?$/,XX=([Q,X=""])=>{let $=m8([Q]);if(!X)return $;return X=X.toLowerCase(),(Z)=>$(Z)&&Z.toLowerCase().endsWith(X)},$X=([Q,X=""])=>{let $=f8([Q]);if(!X)return $;return X=X.toLowerCase(),(Z)=>$(Z)&&Z.toLowerCase().endsWith(X)},ZX=([Q,X=""])=>{let $=f8([Q]);return!X?$:(Z)=>$(Z)&&Z.endsWith(X)},JX=([Q,X=""])=>{let $=m8([Q]);return!X?$:(Z)=>$(Z)&&Z.endsWith(X)},m8=([Q])=>{let X=Q.length;return($)=>$.length===X&&!$.startsWith(".")},f8=([Q])=>{let X=Q.length;return($)=>$.length===X&&$!=="."&&$!==".."},y8=typeof process==="object"&&process?typeof process.env==="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",u8={win32:{sep:"\\"},posix:{sep:"/"}},VX=y8==="win32"?u8.win32.sep:u8.posix.sep;S.sep=VX;var P=Symbol("globstar **");S.GLOBSTAR=P;var qX="[^/]",_X=qX+"*?",YX="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",KX="(?:(?!(?:\\/|^)\\.).)*?",HX=(Q,X={})=>($)=>S($,Q,X);S.filter=HX;var x=(Q,X={})=>Object.assign({},Q,X),WX=(Q)=>{if(!Q||typeof Q!=="object"||!Object.keys(Q).length)return S;let X=S;return Object.assign((Z,J,V={})=>X(Z,J,x(Q,V)),{Minimatch:class extends X.Minimatch{constructor(J,V={}){super(J,x(Q,V))}static defaults(J){return X.defaults(x(Q,J)).Minimatch}},AST:class extends X.AST{constructor(J,V,q={}){super(J,V,x(Q,q))}static fromGlob(J,V={}){return X.AST.fromGlob(J,x(Q,V))}},unescape:(Z,J={})=>X.unescape(Z,x(Q,J)),escape:(Z,J={})=>X.escape(Z,x(Q,J)),filter:(Z,J={})=>X.filter(Z,x(Q,J)),defaults:(Z)=>X.defaults(x(Q,Z)),makeRe:(Z,J={})=>X.makeRe(Z,x(Q,J)),braceExpand:(Z,J={})=>X.braceExpand(Z,x(Q,J)),match:(Z,J,V={})=>X.match(Z,J,x(Q,V)),sep:X.sep,GLOBSTAR:P})};S.defaults=WX;var g8=(Q,X={})=>{if(j0(Q),X.nobrace||!/\{(?:(?!\{).)*\}/.test(Q))return[Q];return x8.default(Q)};S.braceExpand=g8;var GX=(Q,X={})=>new m(Q,X).makeRe();S.makeRe=GX;var jX=(Q,X,$={})=>{let Z=new m(X,$);if(Q=Q.filter((J)=>Z.match(J)),Z.options.nonull&&!Q.length)Q.push(X);return Q};S.match=jX;var E8=/[?*]|[+@!]\(.*?\)|\[|\]/,zX=(Q)=>Q.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class m{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(Q,X={}){if(j0(Q),X=X||{},this.options=X,this.pattern=Q,this.platform=X.platform||y8,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!X.windowsPathsNoEscape||X.allowWindowsEscape===!1,this.windowsPathsNoEscape)this.pattern=this.pattern.replace(/\\/g,"/");this.preserveMultipleSlashes=!!X.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!X.nonegate,this.comment=!1,this.empty=!1,this.partial=!!X.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=X.windowsNoMagicRoot!==void 0?X.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 Q of this.set)for(let X of Q)if(typeof X!=="string")return!0;return!1}debug(...Q){}make(){let Q=this.pattern,X=this.options;if(!X.nocomment&&Q.charAt(0)==="#"){this.comment=!0;return}if(!Q){this.empty=!0;return}if(this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],X.debug)this.debug=(...J)=>console.error(...J);this.debug(this.pattern,this.globSet);let $=this.globSet.map((J)=>this.slashSplit(J));this.globParts=this.preprocess($),this.debug(this.pattern,this.globParts);let Z=this.globParts.map((J,V,q)=>{if(this.isWindows&&this.windowsNoMagicRoot){let _=J[0]===""&&J[1]===""&&(J[2]==="?"||!E8.test(J[2]))&&!E8.test(J[3]),Y=/^[a-z]:/i.test(J[0]);if(_)return[...J.slice(0,4),...J.slice(4).map((H)=>this.parse(H))];else if(Y)return[J[0],...J.slice(1).map((H)=>this.parse(H))]}return J.map((_)=>this.parse(_))});if(this.debug(this.pattern,Z),this.set=Z.filter((J)=>J.indexOf(!1)===-1),this.isWindows)for(let J=0;J<this.set.length;J++){let V=this.set[J];if(V[0]===""&&V[1]===""&&this.globParts[J][2]==="?"&&typeof V[3]==="string"&&/^[a-z]:$/i.test(V[3]))V[2]="?"}this.debug(this.pattern,this.set)}preprocess(Q){if(this.options.noglobstar){for(let $=0;$<Q.length;$++)for(let Z=0;Z<Q[$].length;Z++)if(Q[$][Z]==="**")Q[$][Z]="*"}let{optimizationLevel:X=1}=this.options;if(X>=2)Q=this.firstPhasePreProcess(Q),Q=this.secondPhasePreProcess(Q);else if(X>=1)Q=this.levelOneOptimize(Q);else Q=this.adjascentGlobstarOptimize(Q);return Q}adjascentGlobstarOptimize(Q){return Q.map((X)=>{let $=-1;while(($=X.indexOf("**",$+1))!==-1){let Z=$;while(X[Z+1]==="**")Z++;if(Z!==$)X.splice($,Z-$)}return X})}levelOneOptimize(Q){return Q.map((X)=>{return X=X.reduce(($,Z)=>{let J=$[$.length-1];if(Z==="**"&&J==="**")return $;if(Z===".."){if(J&&J!==".."&&J!=="."&&J!=="**")return $.pop(),$}return $.push(Z),$},[]),X.length===0?[""]:X})}levelTwoFileOptimize(Q){if(!Array.isArray(Q))Q=this.slashSplit(Q);let X=!1;do{if(X=!1,!this.preserveMultipleSlashes){for(let Z=1;Z<Q.length-1;Z++){let J=Q[Z];if(Z===1&&J===""&&Q[0]==="")continue;if(J==="."||J==="")X=!0,Q.splice(Z,1),Z--}if(Q[0]==="."&&Q.length===2&&(Q[1]==="."||Q[1]===""))X=!0,Q.pop()}let $=0;while(($=Q.indexOf("..",$+1))!==-1){let Z=Q[$-1];if(Z&&Z!=="."&&Z!==".."&&Z!=="**")X=!0,Q.splice($-1,2),$-=2}}while(X);return Q.length===0?[""]:Q}firstPhasePreProcess(Q){let X=!1;do{X=!1;for(let $ of Q){let Z=-1;while((Z=$.indexOf("**",Z+1))!==-1){let V=Z;while($[V+1]==="**")V++;if(V>Z)$.splice(Z+1,V-Z);let q=$[Z+1],_=$[Z+2],Y=$[Z+3];if(q!=="..")continue;if(!_||_==="."||_===".."||!Y||Y==="."||Y==="..")continue;X=!0,$.splice(Z,1);let H=$.slice(0);H[Z]="**",Q.push(H),Z--}if(!this.preserveMultipleSlashes){for(let V=1;V<$.length-1;V++){let q=$[V];if(V===1&&q===""&&$[0]==="")continue;if(q==="."||q==="")X=!0,$.splice(V,1),V--}if($[0]==="."&&$.length===2&&($[1]==="."||$[1]===""))X=!0,$.pop()}let J=0;while((J=$.indexOf("..",J+1))!==-1){let V=$[J-1];if(V&&V!=="."&&V!==".."&&V!=="**"){X=!0;let _=J===1&&$[J+1]==="**"?["."]:[];if($.splice(J-1,2,..._),$.length===0)$.push("");J-=2}}}}while(X);return Q}secondPhasePreProcess(Q){for(let X=0;X<Q.length-1;X++)for(let $=X+1;$<Q.length;$++){let Z=this.partsMatch(Q[X],Q[$],!this.preserveMultipleSlashes);if(Z){Q[X]=[],Q[$]=Z;break}}return Q.filter((X)=>X.length)}partsMatch(Q,X,$=!1){let Z=0,J=0,V=[],q="";while(Z<Q.length&&J<X.length)if(Q[Z]===X[J])V.push(q==="b"?X[J]:Q[Z]),Z++,J++;else if($&&Q[Z]==="**"&&X[J]===Q[Z+1])V.push(Q[Z]),Z++;else if($&&X[J]==="**"&&Q[Z]===X[J+1])V.push(X[J]),J++;else if(Q[Z]==="*"&&X[J]&&(this.options.dot||!X[J].startsWith("."))&&X[J]!=="**"){if(q==="b")return!1;q="a",V.push(Q[Z]),Z++,J++}else if(X[J]==="*"&&Q[Z]&&(this.options.dot||!Q[Z].startsWith("."))&&Q[Z]!=="**"){if(q==="a")return!1;q="b",V.push(X[J]),Z++,J++}else return!1;return Q.length===X.length&&V}parseNegate(){if(this.nonegate)return;let Q=this.pattern,X=!1,$=0;for(let Z=0;Z<Q.length&&Q.charAt(Z)==="!";Z++)X=!X,$++;if($)this.pattern=Q.slice($);this.negate=X}matchOne(Q,X,$=!1){let Z=this.options;if(this.isWindows){let j=typeof Q[0]==="string"&&/^[a-z]:$/i.test(Q[0]),U=!j&&Q[0]===""&&Q[1]===""&&Q[2]==="?"&&/^[a-z]:$/i.test(Q[3]),B=typeof X[0]==="string"&&/^[a-z]:$/i.test(X[0]),C=!B&&X[0]===""&&X[1]===""&&X[2]==="?"&&typeof X[3]==="string"&&/^[a-z]:$/i.test(X[3]),M=U?3:j?0:void 0,w=C?3:B?0:void 0;if(typeof M==="number"&&typeof w==="number"){let[R,u]=[Q[M],X[w]];if(R.toLowerCase()===u.toLowerCase()){if(X[w]=R,w>M)X=X.slice(w);else if(M>w)Q=Q.slice(M)}}}let{optimizationLevel:J=1}=this.options;if(J>=2)Q=this.levelTwoFileOptimize(Q);this.debug("matchOne",this,{file:Q,pattern:X}),this.debug("matchOne",Q.length,X.length);for(var V=0,q=0,_=Q.length,Y=X.length;V<_&&q<Y;V++,q++){this.debug("matchOne loop");var H=X[q],K=Q[V];if(this.debug(X,H,K),H===!1)return!1;if(H===P){this.debug("GLOBSTAR",[X,H,K]);var G=V,W=q+1;if(W===Y){this.debug("** at the end");for(;V<_;V++)if(Q[V]==="."||Q[V]===".."||!Z.dot&&Q[V].charAt(0)===".")return!1;return!0}while(G<_){var z=Q[G];if(this.debug(`
2
- globstar while`,Q,G,X,W,z),this.matchOne(Q.slice(G),X.slice(W),$))return this.debug("globstar found match!",G,_,z),!0;else{if(z==="."||z===".."||!Z.dot&&z.charAt(0)==="."){this.debug("dot detected!",Q,G,X,W);break}this.debug("globstar swallow a segment, and continue"),G++}}if($){if(this.debug(`
3
- >>> no match, partial?`,Q,G,X,W),G===_)return!0}return!1}let j;if(typeof H==="string")j=K===H,this.debug("string match",H,K,j);else j=H.test(K),this.debug("pattern match",H,K,j);if(!j)return!1}if(V===_&&q===Y)return!0;else if(V===_)return $;else if(q===Y)return V===_-1&&Q[V]==="";else throw Error("wtf?")}braceExpand(){return g8(this.pattern,this.options)}parse(Q){j0(Q);let X=this.options;if(Q==="**")return P;if(Q==="")return"";let $,Z=null;if($=Q.match(sQ))Z=X.dot?tQ:eQ;else if($=Q.match(hQ))Z=(X.nocase?X.dot?oQ:lQ:X.dot?cQ:dQ)($[1]);else if($=Q.match(QX))Z=(X.nocase?X.dot?$X:XX:X.dot?ZX:JX)($);else if($=Q.match(pQ))Z=X.dot?nQ:iQ;else if($=Q.match(rQ))Z=aQ;let J=v.fromGlob(Q,this.options).toMMPattern();if(Z&&typeof J==="object")Reflect.defineProperty(J,"test",{value:Z});return J}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let Q=this.set;if(!Q.length)return this.regexp=!1,this.regexp;let X=this.options,$=X.noglobstar?_X:X.dot?YX:KX,Z=new Set(X.nocase?["i"]:[]),J=Q.map((_)=>{let Y=_.map((H)=>{if(H instanceof RegExp)for(let K of H.flags.split(""))Z.add(K);return typeof H==="string"?zX(H):H===P?P:H._src});return Y.forEach((H,K)=>{let G=Y[K+1],W=Y[K-1];if(H!==P||W===P)return;if(W===void 0)if(G!==void 0&&G!==P)Y[K+1]="(?:\\/|"+$+"\\/)?"+G;else Y[K]=$;else if(G===void 0)Y[K-1]=W+"(?:\\/|"+$+")?";else if(G!==P)Y[K-1]=W+"(?:\\/|\\/"+$+"\\/)"+G,Y[K+1]=P}),Y.filter((H)=>H!==P).join("/")}).join("|"),[V,q]=Q.length>1?["(?:",")"]:["",""];if(J="^"+V+J+q+"$",this.negate)J="^(?!"+J+").+$";try{this.regexp=new RegExp(J,[...Z].join(""))}catch(_){this.regexp=!1}return this.regexp}slashSplit(Q){if(this.preserveMultipleSlashes)return Q.split("/");else if(this.isWindows&&/^\/\/[^\/]+/.test(Q))return["",...Q.split(/\/+/)];else return Q.split(/\/+/)}match(Q,X=this.partial){if(this.debug("match",Q,this.pattern),this.comment)return!1;if(this.empty)return Q==="";if(Q==="/"&&X)return!0;let $=this.options;if(this.isWindows)Q=Q.split("\\").join("/");let Z=this.slashSplit(Q);this.debug(this.pattern,"split",Z);let J=this.set;this.debug(this.pattern,"set",J);let V=Z[Z.length-1];if(!V)for(let q=Z.length-2;!V&&q>=0;q--)V=Z[q];for(let q=0;q<J.length;q++){let _=J[q],Y=Z;if($.matchBase&&_.length===1)Y=[V];if(this.matchOne(Y,_,X)){if($.flipNegate)return!0;return!this.negate}}if($.flipNegate)return!1;return this.negate}static defaults(Q){return S.defaults(Q).Minimatch}}S.AST=v;S.Minimatch=m;S.escape=q0;S.unescape=h;import{fileURLToPath as pX}from"node:url";var _0=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date,d8=new Set,t0=typeof process==="object"&&!!process?process:{},c8=(Q,X,$,Z)=>{typeof t0.emitWarning==="function"?t0.emitWarning(Q,X,$,Z):console.error(`[${$}] ${X}: ${Q}`)},k0=globalThis.AbortController,h8=globalThis.AbortSignal;if(typeof k0>"u"){h8=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(Z,J){this._onabort.push(J)}},k0=class{constructor(){X()}signal=new h8;abort(Z){if(this.signal.aborted)return;this.signal.reason=Z,this.signal.aborted=!0;for(let J of this.signal._onabort)J(Z);this.signal.onabort?.(Z)}};let Q=t0.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",X=()=>{if(!Q)return;Q=!1,c8("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",X)}}var UX=(Q)=>!d8.has(Q),O5=Symbol("type"),a=(Q)=>Q&&Q===Math.floor(Q)&&Q>0&&isFinite(Q),l8=(Q)=>!a(Q)?null:Q<=Math.pow(2,8)?Uint8Array:Q<=Math.pow(2,16)?Uint16Array:Q<=Math.pow(2,32)?Uint32Array:Q<=Number.MAX_SAFE_INTEGER?U0:null;class U0 extends Array{constructor(Q){super(Q);this.fill(0)}}class Y0{heap;length;static#Q=!1;static create(Q){let X=l8(Q);if(!X)return[];Y0.#Q=!0;let $=new Y0(Q,X);return Y0.#Q=!1,$}constructor(Q,X){if(!Y0.#Q)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new X(Q),this.length=0}push(Q){this.heap[this.length++]=Q}pop(){return this.heap[--this.length]}}class B0{#Q;#X;#$;#J;#q;#M;#U;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#_;#H;#Y;#K;#Z;#G;#B;#j;#z;#w;#R;#P;#L;#I;#A;#N;#C;#k;static unsafeExposeInternals(Q){return{starts:Q.#L,ttls:Q.#I,sizes:Q.#P,keyMap:Q.#Y,keyList:Q.#K,valList:Q.#Z,next:Q.#G,prev:Q.#B,get head(){return Q.#j},get tail(){return Q.#z},free:Q.#w,isBackgroundFetch:(X)=>Q.#W(X),backgroundFetch:(X,$,Z,J)=>Q.#E(X,$,Z,J),moveToTail:(X)=>Q.#f(X),indexes:(X)=>Q.#v(X),rindexes:(X)=>Q.#D(X),isStale:(X)=>Q.#F(X)}}get max(){return this.#Q}get maxSize(){return this.#X}get calculatedSize(){return this.#H}get size(){return this.#_}get fetchMethod(){return this.#M}get memoMethod(){return this.#U}get dispose(){return this.#$}get onInsert(){return this.#J}get disposeAfter(){return this.#q}constructor(Q){let{max:X=0,ttl:$,ttlResolution:Z=1,ttlAutopurge:J,updateAgeOnGet:V,updateAgeOnHas:q,allowStale:_,dispose:Y,onInsert:H,disposeAfter:K,noDisposeOnSet:G,noUpdateTTL:W,maxSize:z=0,maxEntrySize:j=0,sizeCalculation:U,fetchMethod:B,memoMethod:C,noDeleteOnFetchRejection:M,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:R,allowStaleOnFetchAbort:u,ignoreFetchAbort:N}=Q;if(X!==0&&!a(X))throw TypeError("max option must be a nonnegative integer");let t=X?l8(X):Array;if(!t)throw Error("invalid max value: "+X);if(this.#Q=X,this.#X=z,this.maxEntrySize=j||this.#X,this.sizeCalculation=U,this.sizeCalculation){if(!this.#X&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!=="function")throw TypeError("sizeCalculation set to non-function")}if(C!==void 0&&typeof C!=="function")throw TypeError("memoMethod must be a function if defined");if(this.#U=C,B!==void 0&&typeof B!=="function")throw TypeError("fetchMethod must be a function if specified");if(this.#M=B,this.#N=!!B,this.#Y=new Map,this.#K=Array(X).fill(void 0),this.#Z=Array(X).fill(void 0),this.#G=new t(X),this.#B=new t(X),this.#j=0,this.#z=0,this.#w=Y0.create(X),this.#_=0,this.#H=0,typeof Y==="function")this.#$=Y;if(typeof H==="function")this.#J=H;if(typeof K==="function")this.#q=K,this.#R=[];else this.#q=void 0,this.#R=void 0;if(this.#A=!!this.#$,this.#k=!!this.#J,this.#C=!!this.#q,this.noDisposeOnSet=!!G,this.noUpdateTTL=!!W,this.noDeleteOnFetchRejection=!!M,this.allowStaleOnFetchRejection=!!R,this.allowStaleOnFetchAbort=!!u,this.ignoreFetchAbort=!!N,this.maxEntrySize!==0){if(this.#X!==0){if(!a(this.#X))throw TypeError("maxSize must be a positive integer if specified")}if(!a(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#g()}if(this.allowStale=!!_,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!V,this.updateAgeOnHas=!!q,this.ttlResolution=a(Z)||Z===0?Z:1,this.ttlAutopurge=!!J,this.ttl=$||0,this.ttl){if(!a(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#V()}if(this.#Q===0&&this.ttl===0&&this.#X===0)throw TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#Q&&!this.#X){if(UX("LRU_CACHE_UNBOUNDED"))d8.add("LRU_CACHE_UNBOUNDED"),c8("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning","LRU_CACHE_UNBOUNDED",B0)}}getRemainingTTL(Q){return this.#Y.has(Q)?1/0:0}#V(){let Q=new U0(this.#Q),X=new U0(this.#Q);this.#I=Q,this.#L=X,this.#S=(J,V,q=_0.now())=>{if(X[J]=V!==0?q:0,Q[J]=V,V!==0&&this.ttlAutopurge){let _=setTimeout(()=>{if(this.#F(J))this.#T(this.#K[J],"expire")},V+1);if(_.unref)_.unref()}},this.#b=(J)=>{X[J]=Q[J]!==0?_0.now():0},this.#O=(J,V)=>{if(Q[V]){let q=Q[V],_=X[V];if(!q||!_)return;J.ttl=q,J.start=_,J.now=$||Z();let Y=J.now-_;J.remainingTTL=q-Y}};let $=0,Z=()=>{let J=_0.now();if(this.ttlResolution>0){$=J;let V=setTimeout(()=>$=0,this.ttlResolution);if(V.unref)V.unref()}return J};this.getRemainingTTL=(J)=>{let V=this.#Y.get(J);if(V===void 0)return 0;let q=Q[V],_=X[V];if(!q||!_)return 1/0;let Y=($||Z())-_;return q-Y},this.#F=(J)=>{let V=X[J],q=Q[J];return!!q&&!!V&&($||Z())-V>q}}#b=()=>{};#O=()=>{};#S=()=>{};#F=()=>!1;#g(){let Q=new U0(this.#Q);this.#H=0,this.#P=Q,this.#u=(X)=>{this.#H-=Q[X],Q[X]=0},this.#h=(X,$,Z,J)=>{if(this.#W($))return 0;if(!a(Z))if(J){if(typeof J!=="function")throw TypeError("sizeCalculation must be a function");if(Z=J($,X),!a(Z))throw TypeError("sizeCalculation return invalid (expect positive integer)")}else throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return Z},this.#x=(X,$,Z)=>{if(Q[X]=$,this.#X){let J=this.#X-Q[X];while(this.#H>J)this.#m(!0)}if(this.#H+=Q[X],Z)Z.entrySize=$,Z.totalCalculatedSize=this.#H}}#u=(Q)=>{};#x=(Q,X,$)=>{};#h=(Q,X,$,Z)=>{if($||Z)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#v({allowStale:Q=this.allowStale}={}){if(this.#_)for(let X=this.#z;;){if(!this.#d(X))break;if(Q||!this.#F(X))yield X;if(X===this.#j)break;else X=this.#B[X]}}*#D({allowStale:Q=this.allowStale}={}){if(this.#_)for(let X=this.#j;;){if(!this.#d(X))break;if(Q||!this.#F(X))yield X;if(X===this.#z)break;else X=this.#G[X]}}#d(Q){return Q!==void 0&&this.#Y.get(this.#K[Q])===Q}*entries(){for(let Q of this.#v())if(this.#Z[Q]!==void 0&&this.#K[Q]!==void 0&&!this.#W(this.#Z[Q]))yield[this.#K[Q],this.#Z[Q]]}*rentries(){for(let Q of this.#D())if(this.#Z[Q]!==void 0&&this.#K[Q]!==void 0&&!this.#W(this.#Z[Q]))yield[this.#K[Q],this.#Z[Q]]}*keys(){for(let Q of this.#v()){let X=this.#K[Q];if(X!==void 0&&!this.#W(this.#Z[Q]))yield X}}*rkeys(){for(let Q of this.#D()){let X=this.#K[Q];if(X!==void 0&&!this.#W(this.#Z[Q]))yield X}}*values(){for(let Q of this.#v())if(this.#Z[Q]!==void 0&&!this.#W(this.#Z[Q]))yield this.#Z[Q]}*rvalues(){for(let Q of this.#D())if(this.#Z[Q]!==void 0&&!this.#W(this.#Z[Q]))yield this.#Z[Q]}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(Q,X={}){for(let $ of this.#v()){let Z=this.#Z[$],J=this.#W(Z)?Z.__staleWhileFetching:Z;if(J===void 0)continue;if(Q(J,this.#K[$],this))return this.get(this.#K[$],X)}}forEach(Q,X=this){for(let $ of this.#v()){let Z=this.#Z[$],J=this.#W(Z)?Z.__staleWhileFetching:Z;if(J===void 0)continue;Q.call(X,J,this.#K[$],this)}}rforEach(Q,X=this){for(let $ of this.#D()){let Z=this.#Z[$],J=this.#W(Z)?Z.__staleWhileFetching:Z;if(J===void 0)continue;Q.call(X,J,this.#K[$],this)}}purgeStale(){let Q=!1;for(let X of this.#D({allowStale:!0}))if(this.#F(X))this.#T(this.#K[X],"expire"),Q=!0;return Q}info(Q){let X=this.#Y.get(Q);if(X===void 0)return;let $=this.#Z[X],Z=this.#W($)?$.__staleWhileFetching:$;if(Z===void 0)return;let J={value:Z};if(this.#I&&this.#L){let V=this.#I[X],q=this.#L[X];if(V&&q){let _=V-(_0.now()-q);J.ttl=_,J.start=Date.now()}}if(this.#P)J.size=this.#P[X];return J}dump(){let Q=[];for(let X of this.#v({allowStale:!0})){let $=this.#K[X],Z=this.#Z[X],J=this.#W(Z)?Z.__staleWhileFetching:Z;if(J===void 0||$===void 0)continue;let V={value:J};if(this.#I&&this.#L){V.ttl=this.#I[X];let q=_0.now()-this.#L[X];V.start=Math.floor(Date.now()-q)}if(this.#P)V.size=this.#P[X];Q.unshift([$,V])}return Q}load(Q){this.clear();for(let[X,$]of Q){if($.start){let Z=Date.now()-$.start;$.start=_0.now()-Z}this.set(X,$.value,$)}}set(Q,X,$={}){if(X===void 0)return this.delete(Q),this;let{ttl:Z=this.ttl,start:J,noDisposeOnSet:V=this.noDisposeOnSet,sizeCalculation:q=this.sizeCalculation,status:_}=$,{noUpdateTTL:Y=this.noUpdateTTL}=$,H=this.#h(Q,X,$.size||0,q);if(this.maxEntrySize&&H>this.maxEntrySize){if(_)_.set="miss",_.maxEntrySizeExceeded=!0;return this.#T(Q,"set"),this}let K=this.#_===0?void 0:this.#Y.get(Q);if(K===void 0){if(K=this.#_===0?this.#z:this.#w.length!==0?this.#w.pop():this.#_===this.#Q?this.#m(!1):this.#_,this.#K[K]=Q,this.#Z[K]=X,this.#Y.set(Q,K),this.#G[this.#z]=K,this.#B[K]=this.#z,this.#z=K,this.#_++,this.#x(K,H,_),_)_.set="add";if(Y=!1,this.#k)this.#J?.(X,Q,"add")}else{this.#f(K);let G=this.#Z[K];if(X!==G){if(this.#N&&this.#W(G)){G.__abortController.abort(Error("replaced"));let{__staleWhileFetching:W}=G;if(W!==void 0&&!V){if(this.#A)this.#$?.(W,Q,"set");if(this.#C)this.#R?.push([W,Q,"set"])}}else if(!V){if(this.#A)this.#$?.(G,Q,"set");if(this.#C)this.#R?.push([G,Q,"set"])}if(this.#u(K),this.#x(K,H,_),this.#Z[K]=X,_){_.set="replace";let W=G&&this.#W(G)?G.__staleWhileFetching:G;if(W!==void 0)_.oldValue=W}}else if(_)_.set="update";if(this.#k)this.onInsert?.(X,Q,X===G?"update":"replace")}if(Z!==0&&!this.#I)this.#V();if(this.#I){if(!Y)this.#S(K,Z,J);if(_)this.#O(_,K)}if(!V&&this.#C&&this.#R){let G=this.#R,W;while(W=G?.shift())this.#q?.(...W)}return this}pop(){try{while(this.#_){let Q=this.#Z[this.#j];if(this.#m(!0),this.#W(Q)){if(Q.__staleWhileFetching)return Q.__staleWhileFetching}else if(Q!==void 0)return Q}}finally{if(this.#C&&this.#R){let Q=this.#R,X;while(X=Q?.shift())this.#q?.(...X)}}}#m(Q){let X=this.#j,$=this.#K[X],Z=this.#Z[X];if(this.#N&&this.#W(Z))Z.__abortController.abort(Error("evicted"));else if(this.#A||this.#C){if(this.#A)this.#$?.(Z,$,"evict");if(this.#C)this.#R?.push([Z,$,"evict"])}if(this.#u(X),Q)this.#K[X]=void 0,this.#Z[X]=void 0,this.#w.push(X);if(this.#_===1)this.#j=this.#z=0,this.#w.length=0;else this.#j=this.#G[X];return this.#Y.delete($),this.#_--,X}has(Q,X={}){let{updateAgeOnHas:$=this.updateAgeOnHas,status:Z}=X,J=this.#Y.get(Q);if(J!==void 0){let V=this.#Z[J];if(this.#W(V)&&V.__staleWhileFetching===void 0)return!1;if(!this.#F(J)){if($)this.#b(J);if(Z)Z.has="hit",this.#O(Z,J);return!0}else if(Z)Z.has="stale",this.#O(Z,J)}else if(Z)Z.has="miss";return!1}peek(Q,X={}){let{allowStale:$=this.allowStale}=X,Z=this.#Y.get(Q);if(Z===void 0||!$&&this.#F(Z))return;let J=this.#Z[Z];return this.#W(J)?J.__staleWhileFetching:J}#E(Q,X,$,Z){let J=X===void 0?void 0:this.#Z[X];if(this.#W(J))return J;let V=new k0,{signal:q}=$;q?.addEventListener("abort",()=>V.abort(q.reason),{signal:V.signal});let _={signal:V.signal,options:$,context:Z},Y=(j,U=!1)=>{let{aborted:B}=V.signal,C=$.ignoreFetchAbort&&j!==void 0;if($.status)if(B&&!U){if($.status.fetchAborted=!0,$.status.fetchError=V.signal.reason,C)$.status.fetchAbortIgnored=!0}else $.status.fetchResolved=!0;if(B&&!C&&!U)return K(V.signal.reason);let M=W;if(this.#Z[X]===W)if(j===void 0)if(M.__staleWhileFetching)this.#Z[X]=M.__staleWhileFetching;else this.#T(Q,"fetch");else{if($.status)$.status.fetchUpdated=!0;this.set(Q,j,_.options)}return j},H=(j)=>{if($.status)$.status.fetchRejected=!0,$.status.fetchError=j;return K(j)},K=(j)=>{let{aborted:U}=V.signal,B=U&&$.allowStaleOnFetchAbort,C=B||$.allowStaleOnFetchRejection,M=C||$.noDeleteOnFetchRejection,w=W;if(this.#Z[X]===W){if(!M||w.__staleWhileFetching===void 0)this.#T(Q,"fetch");else if(!B)this.#Z[X]=w.__staleWhileFetching}if(C){if($.status&&w.__staleWhileFetching!==void 0)$.status.returnedStale=!0;return w.__staleWhileFetching}else if(w.__returned===w)throw j},G=(j,U)=>{let B=this.#M?.(Q,J,_);if(B&&B instanceof Promise)B.then((C)=>j(C===void 0?void 0:C),U);V.signal.addEventListener("abort",()=>{if(!$.ignoreFetchAbort||$.allowStaleOnFetchAbort){if(j(void 0),$.allowStaleOnFetchAbort)j=(C)=>Y(C,!0)}})};if($.status)$.status.fetchDispatched=!0;let W=new Promise(G).then(Y,H),z=Object.assign(W,{__abortController:V,__staleWhileFetching:J,__returned:void 0});if(X===void 0)this.set(Q,z,{..._.options,status:void 0}),X=this.#Y.get(Q);else this.#Z[X]=z;return z}#W(Q){if(!this.#N)return!1;let X=Q;return!!X&&X instanceof Promise&&X.hasOwnProperty("__staleWhileFetching")&&X.__abortController instanceof k0}async fetch(Q,X={}){let{allowStale:$=this.allowStale,updateAgeOnGet:Z=this.updateAgeOnGet,noDeleteOnStaleGet:J=this.noDeleteOnStaleGet,ttl:V=this.ttl,noDisposeOnSet:q=this.noDisposeOnSet,size:_=0,sizeCalculation:Y=this.sizeCalculation,noUpdateTTL:H=this.noUpdateTTL,noDeleteOnFetchRejection:K=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:G=this.allowStaleOnFetchRejection,ignoreFetchAbort:W=this.ignoreFetchAbort,allowStaleOnFetchAbort:z=this.allowStaleOnFetchAbort,context:j,forceRefresh:U=!1,status:B,signal:C}=X;if(!this.#N){if(B)B.fetch="get";return this.get(Q,{allowStale:$,updateAgeOnGet:Z,noDeleteOnStaleGet:J,status:B})}let M={allowStale:$,updateAgeOnGet:Z,noDeleteOnStaleGet:J,ttl:V,noDisposeOnSet:q,size:_,sizeCalculation:Y,noUpdateTTL:H,noDeleteOnFetchRejection:K,allowStaleOnFetchRejection:G,allowStaleOnFetchAbort:z,ignoreFetchAbort:W,status:B,signal:C},w=this.#Y.get(Q);if(w===void 0){if(B)B.fetch="miss";let R=this.#E(Q,w,M,j);return R.__returned=R}else{let R=this.#Z[w];if(this.#W(R)){let g=$&&R.__staleWhileFetching!==void 0;if(B){if(B.fetch="inflight",g)B.returnedStale=!0}return g?R.__staleWhileFetching:R.__returned=R}let u=this.#F(w);if(!U&&!u){if(B)B.fetch="hit";if(this.#f(w),Z)this.#b(w);if(B)this.#O(B,w);return R}let N=this.#E(Q,w,M,j),V0=N.__staleWhileFetching!==void 0&&$;if(B){if(B.fetch=u?"stale":"refresh",V0&&u)B.returnedStale=!0}return V0?N.__staleWhileFetching:N.__returned=N}}async forceFetch(Q,X={}){let $=await this.fetch(Q,X);if($===void 0)throw Error("fetch() returned undefined");return $}memo(Q,X={}){let $=this.#U;if(!$)throw Error("no memoMethod provided to constructor");let{context:Z,forceRefresh:J,...V}=X,q=this.get(Q,V);if(!J&&q!==void 0)return q;let _=$(Q,q,{options:V,context:Z});return this.set(Q,_,V),_}get(Q,X={}){let{allowStale:$=this.allowStale,updateAgeOnGet:Z=this.updateAgeOnGet,noDeleteOnStaleGet:J=this.noDeleteOnStaleGet,status:V}=X,q=this.#Y.get(Q);if(q!==void 0){let _=this.#Z[q],Y=this.#W(_);if(V)this.#O(V,q);if(this.#F(q)){if(V)V.get="stale";if(!Y){if(!J)this.#T(Q,"expire");if(V&&$)V.returnedStale=!0;return $?_:void 0}else{if(V&&$&&_.__staleWhileFetching!==void 0)V.returnedStale=!0;return $?_.__staleWhileFetching:void 0}}else{if(V)V.get="hit";if(Y)return _.__staleWhileFetching;if(this.#f(q),Z)this.#b(q);return _}}else if(V)V.get="miss"}#c(Q,X){this.#B[X]=Q,this.#G[Q]=X}#f(Q){if(Q!==this.#z){if(Q===this.#j)this.#j=this.#G[Q];else this.#c(this.#B[Q],this.#G[Q]);this.#c(this.#z,Q),this.#z=Q}}delete(Q){return this.#T(Q,"delete")}#T(Q,X){let $=!1;if(this.#_!==0){let Z=this.#Y.get(Q);if(Z!==void 0)if($=!0,this.#_===1)this.#y(X);else{this.#u(Z);let J=this.#Z[Z];if(this.#W(J))J.__abortController.abort(Error("deleted"));else if(this.#A||this.#C){if(this.#A)this.#$?.(J,Q,X);if(this.#C)this.#R?.push([J,Q,X])}if(this.#Y.delete(Q),this.#K[Z]=void 0,this.#Z[Z]=void 0,Z===this.#z)this.#z=this.#B[Z];else if(Z===this.#j)this.#j=this.#G[Z];else{let V=this.#B[Z];this.#G[V]=this.#G[Z];let q=this.#G[Z];this.#B[q]=this.#B[Z]}this.#_--,this.#w.push(Z)}}if(this.#C&&this.#R?.length){let Z=this.#R,J;while(J=Z?.shift())this.#q?.(...J)}return $}clear(){return this.#y("delete")}#y(Q){for(let X of this.#D({allowStale:!0})){let $=this.#Z[X];if(this.#W($))$.__abortController.abort(Error("deleted"));else{let Z=this.#K[X];if(this.#A)this.#$?.($,Z,Q);if(this.#C)this.#R?.push([$,Z,Q])}}if(this.#Y.clear(),this.#Z.fill(void 0),this.#K.fill(void 0),this.#I&&this.#L)this.#I.fill(0),this.#L.fill(0);if(this.#P)this.#P.fill(0);if(this.#j=0,this.#z=0,this.#w.length=0,this.#H=0,this.#_=0,this.#C&&this.#R){let X=this.#R,$;while($=X?.shift())this.#q?.(...$)}}}import{posix as NX,win32 as K8}from"node:path";import{fileURLToPath as vX}from"node:url";import{lstatSync as PX,readdir as DX,readdirSync as kX,readlinkSync as SX,realpathSync as TX}from"fs";import*as bX from"node:fs";import{lstat as EX,readdir as xX,readlink as mX,realpath as fX}from"node:fs/promises";import{EventEmitter as V8}from"node:events";import r8 from"node:stream";import{StringDecoder as BX}from"node:string_decoder";var o8=typeof process==="object"&&process?process:{stdout:null,stderr:null},wX=(Q)=>!!Q&&typeof Q==="object"&&(Q instanceof X0||Q instanceof r8||CX(Q)||MX(Q)),CX=(Q)=>!!Q&&typeof Q==="object"&&Q instanceof V8&&typeof Q.pipe==="function"&&Q.pipe!==r8.Writable.prototype.pipe,MX=(Q)=>!!Q&&typeof Q==="object"&&Q instanceof V8&&typeof Q.write==="function"&&typeof Q.end==="function",n=Symbol("EOF"),r=Symbol("maybeEmitEnd"),s=Symbol("emittedEnd"),S0=Symbol("emittingEnd"),w0=Symbol("emittedError"),T0=Symbol("closed"),p8=Symbol("read"),b0=Symbol("flush"),i8=Symbol("flushChunk"),d=Symbol("encoding"),K0=Symbol("decoder"),L=Symbol("flowing"),C0=Symbol("paused"),H0=Symbol("resume"),O=Symbol("buffer"),T=Symbol("pipes"),F=Symbol("bufferLength"),Q8=Symbol("bufferPush"),u0=Symbol("bufferShift"),k=Symbol("objectMode"),A=Symbol("destroyed"),X8=Symbol("error"),$8=Symbol("emitData"),n8=Symbol("emitEnd"),Z8=Symbol("emitEnd2"),l=Symbol("async"),J8=Symbol("abort"),E0=Symbol("aborted"),M0=Symbol("signal"),Q0=Symbol("dataListeners"),E=Symbol("discarded"),R0=(Q)=>Promise.resolve().then(Q),RX=(Q)=>Q(),AX=(Q)=>Q==="end"||Q==="finish"||Q==="prefinish",IX=(Q)=>Q instanceof ArrayBuffer||!!Q&&typeof Q==="object"&&Q.constructor&&Q.constructor.name==="ArrayBuffer"&&Q.byteLength>=0,LX=(Q)=>!Buffer.isBuffer(Q)&&ArrayBuffer.isView(Q);class q8{src;dest;opts;ondrain;constructor(Q,X,$){this.src=Q,this.dest=X,this.opts=$,this.ondrain=()=>Q[H0](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(Q){}end(){if(this.unpipe(),this.opts.end)this.dest.end()}}class a8 extends q8{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(Q,X,$){super(Q,X,$);this.proxyErrors=(Z)=>X.emit("error",Z),Q.on("error",this.proxyErrors)}}var OX=(Q)=>!!Q.objectMode,FX=(Q)=>!Q.objectMode&&!!Q.encoding&&Q.encoding!=="buffer";class X0 extends V8{[L]=!1;[C0]=!1;[T]=[];[O]=[];[k];[d];[l];[K0];[n]=!1;[s]=!1;[S0]=!1;[T0]=!1;[w0]=null;[F]=0;[A]=!1;[M0];[E0]=!1;[Q0]=0;[E]=!1;writable=!0;readable=!0;constructor(...Q){let X=Q[0]||{};super();if(X.objectMode&&typeof X.encoding==="string")throw TypeError("Encoding and objectMode may not be used together");if(OX(X))this[k]=!0,this[d]=null;else if(FX(X))this[d]=X.encoding,this[k]=!1;else this[k]=!1,this[d]=null;if(this[l]=!!X.async,this[K0]=this[d]?new BX(this[d]):null,X&&X.debugExposeBuffer===!0)Object.defineProperty(this,"buffer",{get:()=>this[O]});if(X&&X.debugExposePipes===!0)Object.defineProperty(this,"pipes",{get:()=>this[T]});let{signal:$}=X;if($)if(this[M0]=$,$.aborted)this[J8]();else $.addEventListener("abort",()=>this[J8]())}get bufferLength(){return this[F]}get encoding(){return this[d]}set encoding(Q){throw Error("Encoding must be set at instantiation time")}setEncoding(Q){throw Error("Encoding must be set at instantiation time")}get objectMode(){return this[k]}set objectMode(Q){throw Error("objectMode must be set at instantiation time")}get["async"](){return this[l]}set["async"](Q){this[l]=this[l]||!!Q}[J8](){this[E0]=!0,this.emit("abort",this[M0]?.reason),this.destroy(this[M0]?.reason)}get aborted(){return this[E0]}set aborted(Q){}write(Q,X,$){if(this[E0])return!1;if(this[n])throw Error("write after end");if(this[A])return this.emit("error",Object.assign(Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;if(typeof X==="function")$=X,X="utf8";if(!X)X="utf8";let Z=this[l]?R0:RX;if(!this[k]&&!Buffer.isBuffer(Q)){if(LX(Q))Q=Buffer.from(Q.buffer,Q.byteOffset,Q.byteLength);else if(IX(Q))Q=Buffer.from(Q);else if(typeof Q!=="string")throw Error("Non-contiguous data written to non-objectMode stream")}if(this[k]){if(this[L]&&this[F]!==0)this[b0](!0);if(this[L])this.emit("data",Q);else this[Q8](Q);if(this[F]!==0)this.emit("readable");if($)Z($);return this[L]}if(!Q.length){if(this[F]!==0)this.emit("readable");if($)Z($);return this[L]}if(typeof Q==="string"&&!(X===this[d]&&!this[K0]?.lastNeed))Q=Buffer.from(Q,X);if(Buffer.isBuffer(Q)&&this[d])Q=this[K0].write(Q);if(this[L]&&this[F]!==0)this[b0](!0);if(this[L])this.emit("data",Q);else this[Q8](Q);if(this[F]!==0)this.emit("readable");if($)Z($);return this[L]}read(Q){if(this[A])return null;if(this[E]=!1,this[F]===0||Q===0||Q&&Q>this[F])return this[r](),null;if(this[k])Q=null;if(this[O].length>1&&!this[k])this[O]=[this[d]?this[O].join(""):Buffer.concat(this[O],this[F])];let X=this[p8](Q||null,this[O][0]);return this[r](),X}[p8](Q,X){if(this[k])this[u0]();else{let $=X;if(Q===$.length||Q===null)this[u0]();else if(typeof $==="string")this[O][0]=$.slice(Q),X=$.slice(0,Q),this[F]-=Q;else this[O][0]=$.subarray(Q),X=$.subarray(0,Q),this[F]-=Q}if(this.emit("data",X),!this[O].length&&!this[n])this.emit("drain");return X}end(Q,X,$){if(typeof Q==="function")$=Q,Q=void 0;if(typeof X==="function")$=X,X="utf8";if(Q!==void 0)this.write(Q,X);if($)this.once("end",$);if(this[n]=!0,this.writable=!1,this[L]||!this[C0])this[r]();return this}[H0](){if(this[A])return;if(!this[Q0]&&!this[T].length)this[E]=!0;if(this[C0]=!1,this[L]=!0,this.emit("resume"),this[O].length)this[b0]();else if(this[n])this[r]();else this.emit("drain")}resume(){return this[H0]()}pause(){this[L]=!1,this[C0]=!0,this[E]=!1}get destroyed(){return this[A]}get flowing(){return this[L]}get paused(){return this[C0]}[Q8](Q){if(this[k])this[F]+=1;else this[F]+=Q.length;this[O].push(Q)}[u0](){if(this[k])this[F]-=1;else this[F]-=this[O][0].length;return this[O].shift()}[b0](Q=!1){do;while(this[i8](this[u0]())&&this[O].length);if(!Q&&!this[O].length&&!this[n])this.emit("drain")}[i8](Q){return this.emit("data",Q),this[L]}pipe(Q,X){if(this[A])return Q;this[E]=!1;let $=this[s];if(X=X||{},Q===o8.stdout||Q===o8.stderr)X.end=!1;else X.end=X.end!==!1;if(X.proxyErrors=!!X.proxyErrors,$){if(X.end)Q.end()}else if(this[T].push(!X.proxyErrors?new q8(this,Q,X):new a8(this,Q,X)),this[l])R0(()=>this[H0]());else this[H0]();return Q}unpipe(Q){let X=this[T].find(($)=>$.dest===Q);if(X){if(this[T].length===1){if(this[L]&&this[Q0]===0)this[L]=!1;this[T]=[]}else this[T].splice(this[T].indexOf(X),1);X.unpipe()}}addListener(Q,X){return this.on(Q,X)}on(Q,X){let $=super.on(Q,X);if(Q==="data"){if(this[E]=!1,this[Q0]++,!this[T].length&&!this[L])this[H0]()}else if(Q==="readable"&&this[F]!==0)super.emit("readable");else if(AX(Q)&&this[s])super.emit(Q),this.removeAllListeners(Q);else if(Q==="error"&&this[w0]){let Z=X;if(this[l])R0(()=>Z.call(this,this[w0]));else Z.call(this,this[w0])}return $}removeListener(Q,X){return this.off(Q,X)}off(Q,X){let $=super.off(Q,X);if(Q==="data"){if(this[Q0]=this.listeners("data").length,this[Q0]===0&&!this[E]&&!this[T].length)this[L]=!1}return $}removeAllListeners(Q){let X=super.removeAllListeners(Q);if(Q==="data"||Q===void 0){if(this[Q0]=0,!this[E]&&!this[T].length)this[L]=!1}return X}get emittedEnd(){return this[s]}[r](){if(!this[S0]&&!this[s]&&!this[A]&&this[O].length===0&&this[n]){if(this[S0]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[T0])this.emit("close");this[S0]=!1}}emit(Q,...X){let $=X[0];if(Q!=="error"&&Q!=="close"&&Q!==A&&this[A])return!1;else if(Q==="data")return!this[k]&&!$?!1:this[l]?(R0(()=>this[$8]($)),!0):this[$8]($);else if(Q==="end")return this[n8]();else if(Q==="close"){if(this[T0]=!0,!this[s]&&!this[A])return!1;let J=super.emit("close");return this.removeAllListeners("close"),J}else if(Q==="error"){this[w0]=$,super.emit(X8,$);let J=!this[M0]||this.listeners("error").length?super.emit("error",$):!1;return this[r](),J}else if(Q==="resume"){let J=super.emit("resume");return this[r](),J}else if(Q==="finish"||Q==="prefinish"){let J=super.emit(Q);return this.removeAllListeners(Q),J}let Z=super.emit(Q,...X);return this[r](),Z}[$8](Q){for(let $ of this[T])if($.dest.write(Q)===!1)this.pause();let X=this[E]?!1:super.emit("data",Q);return this[r](),X}[n8](){if(this[s])return!1;return this[s]=!0,this.readable=!1,this[l]?(R0(()=>this[Z8]()),!0):this[Z8]()}[Z8](){if(this[K0]){let X=this[K0].end();if(X){for(let $ of this[T])$.dest.write(X);if(!this[E])super.emit("data",X)}}for(let X of this[T])X.end();let Q=super.emit("end");return this.removeAllListeners("end"),Q}async collect(){let Q=Object.assign([],{dataLength:0});if(!this[k])Q.dataLength=0;let X=this.promise();return this.on("data",($)=>{if(Q.push($),!this[k])Q.dataLength+=$.length}),await X,Q}async concat(){if(this[k])throw Error("cannot concat in objectMode");let Q=await this.collect();return this[d]?Q.join(""):Buffer.concat(Q,Q.dataLength)}async promise(){return new Promise((Q,X)=>{this.on(A,()=>X(Error("stream destroyed"))),this.on("error",($)=>X($)),this.on("end",()=>Q())})}[Symbol.asyncIterator](){this[E]=!1;let Q=!1,X=async()=>{return this.pause(),Q=!0,{value:void 0,done:!0}};return{next:()=>{if(Q)return X();let Z=this.read();if(Z!==null)return Promise.resolve({done:!1,value:Z});if(this[n])return X();let J,V,q=(K)=>{this.off("data",_),this.off("end",Y),this.off(A,H),X(),V(K)},_=(K)=>{this.off("error",q),this.off("end",Y),this.off(A,H),this.pause(),J({value:K,done:!!this[n]})},Y=()=>{this.off("error",q),this.off("data",_),this.off(A,H),X(),J({done:!0,value:void 0})},H=()=>q(Error("stream destroyed"));return new Promise((K,G)=>{V=G,J=K,this.once(A,H),this.once("error",q),this.once("end",Y),this.once("data",_)})},throw:X,return:X,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[E]=!1;let Q=!1,X=()=>{return this.pause(),this.off(X8,X),this.off(A,X),this.off("end",X),Q=!0,{done:!0,value:void 0}},$=()=>{if(Q)return X();let Z=this.read();return Z===null?X():{done:!1,value:Z}};return this.once("end",X),this.once(X8,X),this.once(A,X),{next:$,throw:X,return:X,[Symbol.iterator](){return this}}}destroy(Q){if(this[A]){if(Q)this.emit("error",Q);else this.emit(A);return this}this[A]=!0,this[E]=!0,this[O].length=0,this[F]=0;let X=this;if(typeof X.close==="function"&&!this[T0])X.close();if(Q)this.emit("error",Q);else this.emit(A);return this}static get isStream(){return wX}}var uX=TX.native,I0={lstatSync:PX,readdir:DX,readdirSync:kX,readlinkSync:SX,realpathSync:uX,promises:{lstat:EX,readdir:xX,readlink:mX,realpath:fX}},XQ=(Q)=>!Q||Q===I0||Q===bX?I0:{...I0,...Q,promises:{...I0.promises,...Q.promises||{}}},$Q=/^\\\\\?\\([a-z]:)\\?$/i,yX=(Q)=>Q.replace(/\//g,"\\").replace($Q,"$1\\"),gX=/[\\\/]/,y=0,ZQ=1,JQ=2,o=4,VQ=6,qQ=8,$0=10,_Q=12,f=15,A0=~f,_8=16,s8=32,L0=64,c=128,x0=256,f0=512,e8=L0|c|f0,hX=1023,Y8=(Q)=>Q.isFile()?qQ:Q.isDirectory()?o:Q.isSymbolicLink()?$0:Q.isCharacterDevice()?JQ:Q.isBlockDevice()?VQ:Q.isSocket()?_Q:Q.isFIFO()?ZQ:y,t8=new Map,O0=(Q)=>{let X=t8.get(Q);if(X)return X;let $=Q.normalize("NFKD");return t8.set(Q,$),$},QQ=new Map,m0=(Q)=>{let X=QQ.get(Q);if(X)return X;let $=O0(Q.toLowerCase());return QQ.set(Q,$),$};class H8 extends B0{constructor(){super({max:256})}}class YQ extends B0{constructor(Q=16384){super({maxSize:Q,sizeCalculation:(X)=>X.length+1})}}var KQ=Symbol("PathScurry setAsCwd");class b{name;root;roots;parent;nocase;isCWD=!1;#Q;#X;get dev(){return this.#X}#$;get mode(){return this.#$}#J;get nlink(){return this.#J}#q;get uid(){return this.#q}#M;get gid(){return this.#M}#U;get rdev(){return this.#U}#_;get blksize(){return this.#_}#H;get ino(){return this.#H}#Y;get size(){return this.#Y}#K;get blocks(){return this.#K}#Z;get atimeMs(){return this.#Z}#G;get mtimeMs(){return this.#G}#B;get ctimeMs(){return this.#B}#j;get birthtimeMs(){return this.#j}#z;get atime(){return this.#z}#w;get mtime(){return this.#w}#R;get ctime(){return this.#R}#P;get birthtime(){return this.#P}#L;#I;#A;#N;#C;#k;#V;#b;#O;#S;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(Q,X=y,$,Z,J,V,q){if(this.name=Q,this.#L=J?m0(Q):O0(Q),this.#V=X&hX,this.nocase=J,this.roots=Z,this.root=$||this,this.#b=V,this.#A=q.fullpath,this.#C=q.relative,this.#k=q.relativePosix,this.parent=q.parent,this.parent)this.#Q=this.parent.#Q;else this.#Q=XQ(q.fs)}depth(){if(this.#I!==void 0)return this.#I;if(!this.parent)return this.#I=0;return this.#I=this.parent.depth()+1}childrenCache(){return this.#b}resolve(Q){if(!Q)return this;let X=this.getRootString(Q),Z=Q.substring(X.length).split(this.splitSep);return X?this.getRoot(X).#F(Z):this.#F(Z)}#F(Q){let X=this;for(let $ of Q)X=X.child($);return X}children(){let Q=this.#b.get(this);if(Q)return Q;let X=Object.assign([],{provisional:0});return this.#b.set(this,X),this.#V&=~_8,X}child(Q,X){if(Q===""||Q===".")return this;if(Q==="..")return this.parent||this;let $=this.children(),Z=this.nocase?m0(Q):O0(Q);for(let _ of $)if(_.#L===Z)return _;let J=this.parent?this.sep:"",V=this.#A?this.#A+J+Q:void 0,q=this.newChild(Q,y,{...X,parent:this,fullpath:V});if(!this.canReaddir())q.#V|=c;return $.push(q),q}relative(){if(this.isCWD)return"";if(this.#C!==void 0)return this.#C;let Q=this.name,X=this.parent;if(!X)return this.#C=this.name;let $=X.relative();return $+(!$||!X.parent?"":this.sep)+Q}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#k!==void 0)return this.#k;let Q=this.name,X=this.parent;if(!X)return this.#k=this.fullpathPosix();let $=X.relativePosix();return $+(!$||!X.parent?"":"/")+Q}fullpath(){if(this.#A!==void 0)return this.#A;let Q=this.name,X=this.parent;if(!X)return this.#A=this.name;let Z=X.fullpath()+(!X.parent?"":this.sep)+Q;return this.#A=Z}fullpathPosix(){if(this.#N!==void 0)return this.#N;if(this.sep==="/")return this.#N=this.fullpath();if(!this.parent){let Z=this.fullpath().replace(/\\/g,"/");if(/^[a-z]:\//i.test(Z))return this.#N=`//?/${Z}`;else return this.#N=Z}let Q=this.parent,X=Q.fullpathPosix(),$=X+(!X||!Q.parent?"":"/")+this.name;return this.#N=$}isUnknown(){return(this.#V&f)===y}isType(Q){return this[`is${Q}`]()}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.#V&f)===qQ}isDirectory(){return(this.#V&f)===o}isCharacterDevice(){return(this.#V&f)===JQ}isBlockDevice(){return(this.#V&f)===VQ}isFIFO(){return(this.#V&f)===ZQ}isSocket(){return(this.#V&f)===_Q}isSymbolicLink(){return(this.#V&$0)===$0}lstatCached(){return this.#V&s8?this:void 0}readlinkCached(){return this.#O}realpathCached(){return this.#S}readdirCached(){let Q=this.children();return Q.slice(0,Q.provisional)}canReadlink(){if(this.#O)return!0;if(!this.parent)return!1;let Q=this.#V&f;return!(Q!==y&&Q!==$0||this.#V&x0||this.#V&c)}calledReaddir(){return!!(this.#V&_8)}isENOENT(){return!!(this.#V&c)}isNamed(Q){return!this.nocase?this.#L===O0(Q):this.#L===m0(Q)}async readlink(){let Q=this.#O;if(Q)return Q;if(!this.canReadlink())return;if(!this.parent)return;try{let X=await this.#Q.promises.readlink(this.fullpath()),$=(await this.parent.realpath())?.resolve(X);if($)return this.#O=$}catch(X){this.#m(X.code);return}}readlinkSync(){let Q=this.#O;if(Q)return Q;if(!this.canReadlink())return;if(!this.parent)return;try{let X=this.#Q.readlinkSync(this.fullpath()),$=this.parent.realpathSync()?.resolve(X);if($)return this.#O=$}catch(X){this.#m(X.code);return}}#g(Q){this.#V|=_8;for(let X=Q.provisional;X<Q.length;X++){let $=Q[X];if($)$.#u()}}#u(){if(this.#V&c)return;this.#V=(this.#V|c)&A0,this.#x()}#x(){let Q=this.children();Q.provisional=0;for(let X of Q)X.#u()}#h(){this.#V|=f0,this.#v()}#v(){if(this.#V&L0)return;let Q=this.#V;if((Q&f)===o)Q&=A0;this.#V=Q|L0,this.#x()}#D(Q=""){if(Q==="ENOTDIR"||Q==="EPERM")this.#v();else if(Q==="ENOENT")this.#u();else this.children().provisional=0}#d(Q=""){if(Q==="ENOTDIR")this.parent.#v();else if(Q==="ENOENT")this.#u()}#m(Q=""){let X=this.#V;if(X|=x0,Q==="ENOENT")X|=c;if(Q==="EINVAL"||Q==="UNKNOWN")X&=A0;if(this.#V=X,Q==="ENOTDIR"&&this.parent)this.parent.#v()}#E(Q,X){return this.#c(Q,X)||this.#W(Q,X)}#W(Q,X){let $=Y8(Q),Z=this.newChild(Q.name,$,{parent:this}),J=Z.#V&f;if(J!==o&&J!==$0&&J!==y)Z.#V|=L0;return X.unshift(Z),X.provisional++,Z}#c(Q,X){for(let $=X.provisional;$<X.length;$++){let Z=X[$];if((this.nocase?m0(Q.name):O0(Q.name))!==Z.#L)continue;return this.#f(Q,Z,$,X)}}#f(Q,X,$,Z){let J=X.name;if(X.#V=X.#V&A0|Y8(Q),J!==Q.name)X.name=Q.name;if($!==Z.provisional){if($===Z.length-1)Z.pop();else Z.splice($,1);Z.unshift(X)}return Z.provisional++,X}async lstat(){if((this.#V&c)===0)try{return this.#T(await this.#Q.promises.lstat(this.fullpath())),this}catch(Q){this.#d(Q.code)}}lstatSync(){if((this.#V&c)===0)try{return this.#T(this.#Q.lstatSync(this.fullpath())),this}catch(Q){this.#d(Q.code)}}#T(Q){let{atime:X,atimeMs:$,birthtime:Z,birthtimeMs:J,blksize:V,blocks:q,ctime:_,ctimeMs:Y,dev:H,gid:K,ino:G,mode:W,mtime:z,mtimeMs:j,nlink:U,rdev:B,size:C,uid:M}=Q;this.#z=X,this.#Z=$,this.#P=Z,this.#j=J,this.#_=V,this.#K=q,this.#R=_,this.#B=Y,this.#X=H,this.#M=K,this.#H=G,this.#$=W,this.#w=z,this.#G=j,this.#J=U,this.#U=B,this.#Y=C,this.#q=M;let w=Y8(Q);if(this.#V=this.#V&A0|w|s8,w!==y&&w!==o&&w!==$0)this.#V|=L0}#y=[];#o=!1;#p(Q){this.#o=!1;let X=this.#y.slice();this.#y.length=0,X.forEach(($)=>$(null,Q))}readdirCB(Q,X=!1){if(!this.canReaddir()){if(X)Q(null,[]);else queueMicrotask(()=>Q(null,[]));return}let $=this.children();if(this.calledReaddir()){let J=$.slice(0,$.provisional);if(X)Q(null,J);else queueMicrotask(()=>Q(null,J));return}if(this.#y.push(Q),this.#o)return;this.#o=!0;let Z=this.fullpath();this.#Q.readdir(Z,{withFileTypes:!0},(J,V)=>{if(J)this.#D(J.code),$.provisional=0;else{for(let q of V)this.#E(q,$);this.#g($)}this.#p($.slice(0,$.provisional));return})}#l;async readdir(){if(!this.canReaddir())return[];let Q=this.children();if(this.calledReaddir())return Q.slice(0,Q.provisional);let X=this.fullpath();if(this.#l)await this.#l;else{let $=()=>{};this.#l=new Promise((Z)=>$=Z);try{for(let Z of await this.#Q.promises.readdir(X,{withFileTypes:!0}))this.#E(Z,Q);this.#g(Q)}catch(Z){this.#D(Z.code),Q.provisional=0}this.#l=void 0,$()}return Q.slice(0,Q.provisional)}readdirSync(){if(!this.canReaddir())return[];let Q=this.children();if(this.calledReaddir())return Q.slice(0,Q.provisional);let X=this.fullpath();try{for(let $ of this.#Q.readdirSync(X,{withFileTypes:!0}))this.#E($,Q);this.#g(Q)}catch($){this.#D($.code),Q.provisional=0}return Q.slice(0,Q.provisional)}canReaddir(){if(this.#V&e8)return!1;let Q=f&this.#V;if(!(Q===y||Q===o||Q===$0))return!1;return!0}shouldWalk(Q,X){return(this.#V&o)===o&&!(this.#V&e8)&&!Q.has(this)&&(!X||X(this))}async realpath(){if(this.#S)return this.#S;if((f0|x0|c)&this.#V)return;try{let Q=await this.#Q.promises.realpath(this.fullpath());return this.#S=this.resolve(Q)}catch(Q){this.#h()}}realpathSync(){if(this.#S)return this.#S;if((f0|x0|c)&this.#V)return;try{let Q=this.#Q.realpathSync(this.fullpath());return this.#S=this.resolve(Q)}catch(Q){this.#h()}}[KQ](Q){if(Q===this)return;Q.isCWD=!1,this.isCWD=!0;let X=new Set([]),$=[],Z=this;while(Z&&Z.parent)X.add(Z),Z.#C=$.join(this.sep),Z.#k=$.join("/"),Z=Z.parent,$.push("..");Z=Q;while(Z&&Z.parent&&!X.has(Z))Z.#C=void 0,Z.#k=void 0,Z=Z.parent}}class y0 extends b{sep="\\";splitSep=gX;constructor(Q,X=y,$,Z,J,V,q){super(Q,X,$,Z,J,V,q)}newChild(Q,X=y,$={}){return new y0(Q,X,this.root,this.roots,this.nocase,this.childrenCache(),$)}getRootString(Q){return K8.parse(Q).root}getRoot(Q){if(Q=yX(Q.toUpperCase()),Q===this.root.name)return this.root;for(let[X,$]of Object.entries(this.roots))if(this.sameRoot(Q,X))return this.roots[Q]=$;return this.roots[Q]=new F0(Q,this).root}sameRoot(Q,X=this.root.name){return Q=Q.toUpperCase().replace(/\//g,"\\").replace($Q,"$1\\"),Q===X}}class g0 extends b{splitSep="/";sep="/";constructor(Q,X=y,$,Z,J,V,q){super(Q,X,$,Z,J,V,q)}getRootString(Q){return Q.startsWith("/")?"/":""}getRoot(Q){return this.root}newChild(Q,X=y,$={}){return new g0(Q,X,this.root,this.roots,this.nocase,this.childrenCache(),$)}}class W8{root;rootPath;roots;cwd;#Q;#X;#$;nocase;#J;constructor(Q=process.cwd(),X,$,{nocase:Z,childrenCacheSize:J=16384,fs:V=I0}={}){if(this.#J=XQ(V),Q instanceof URL||Q.startsWith("file://"))Q=vX(Q);let q=X.resolve(Q);this.roots=Object.create(null),this.rootPath=this.parseRootPath(q),this.#Q=new H8,this.#X=new H8,this.#$=new YQ(J);let _=q.substring(this.rootPath.length).split($);if(_.length===1&&!_[0])_.pop();if(Z===void 0)throw TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=Z,this.root=this.newRoot(this.#J),this.roots[this.rootPath]=this.root;let Y=this.root,H=_.length-1,K=X.sep,G=this.rootPath,W=!1;for(let z of _){let j=H--;Y=Y.child(z,{relative:Array(j).fill("..").join(K),relativePosix:Array(j).fill("..").join("/"),fullpath:G+=(W?"":K)+z}),W=!0}this.cwd=Y}depth(Q=this.cwd){if(typeof Q==="string")Q=this.cwd.resolve(Q);return Q.depth()}childrenCache(){return this.#$}resolve(...Q){let X="";for(let J=Q.length-1;J>=0;J--){let V=Q[J];if(!V||V===".")continue;if(X=X?`${V}/${X}`:V,this.isAbsolute(V))break}let $=this.#Q.get(X);if($!==void 0)return $;let Z=this.cwd.resolve(X).fullpath();return this.#Q.set(X,Z),Z}resolvePosix(...Q){let X="";for(let J=Q.length-1;J>=0;J--){let V=Q[J];if(!V||V===".")continue;if(X=X?`${V}/${X}`:V,this.isAbsolute(V))break}let $=this.#X.get(X);if($!==void 0)return $;let Z=this.cwd.resolve(X).fullpathPosix();return this.#X.set(X,Z),Z}relative(Q=this.cwd){if(typeof Q==="string")Q=this.cwd.resolve(Q);return Q.relative()}relativePosix(Q=this.cwd){if(typeof Q==="string")Q=this.cwd.resolve(Q);return Q.relativePosix()}basename(Q=this.cwd){if(typeof Q==="string")Q=this.cwd.resolve(Q);return Q.name}dirname(Q=this.cwd){if(typeof Q==="string")Q=this.cwd.resolve(Q);return(Q.parent||Q).fullpath()}async readdir(Q=this.cwd,X={withFileTypes:!0}){if(typeof Q==="string")Q=this.cwd.resolve(Q);else if(!(Q instanceof b))X=Q,Q=this.cwd;let{withFileTypes:$}=X;if(!Q.canReaddir())return[];else{let Z=await Q.readdir();return $?Z:Z.map((J)=>J.name)}}readdirSync(Q=this.cwd,X={withFileTypes:!0}){if(typeof Q==="string")Q=this.cwd.resolve(Q);else if(!(Q instanceof b))X=Q,Q=this.cwd;let{withFileTypes:$=!0}=X;if(!Q.canReaddir())return[];else if($)return Q.readdirSync();else return Q.readdirSync().map((Z)=>Z.name)}async lstat(Q=this.cwd){if(typeof Q==="string")Q=this.cwd.resolve(Q);return Q.lstat()}lstatSync(Q=this.cwd){if(typeof Q==="string")Q=this.cwd.resolve(Q);return Q.lstatSync()}async readlink(Q=this.cwd,{withFileTypes:X}={withFileTypes:!1}){if(typeof Q==="string")Q=this.cwd.resolve(Q);else if(!(Q instanceof b))X=Q.withFileTypes,Q=this.cwd;let $=await Q.readlink();return X?$:$?.fullpath()}readlinkSync(Q=this.cwd,{withFileTypes:X}={withFileTypes:!1}){if(typeof Q==="string")Q=this.cwd.resolve(Q);else if(!(Q instanceof b))X=Q.withFileTypes,Q=this.cwd;let $=Q.readlinkSync();return X?$:$?.fullpath()}async realpath(Q=this.cwd,{withFileTypes:X}={withFileTypes:!1}){if(typeof Q==="string")Q=this.cwd.resolve(Q);else if(!(Q instanceof b))X=Q.withFileTypes,Q=this.cwd;let $=await Q.realpath();return X?$:$?.fullpath()}realpathSync(Q=this.cwd,{withFileTypes:X}={withFileTypes:!1}){if(typeof Q==="string")Q=this.cwd.resolve(Q);else if(!(Q instanceof b))X=Q.withFileTypes,Q=this.cwd;let $=Q.realpathSync();return X?$:$?.fullpath()}async walk(Q=this.cwd,X={}){if(typeof Q==="string")Q=this.cwd.resolve(Q);else if(!(Q instanceof b))X=Q,Q=this.cwd;let{withFileTypes:$=!0,follow:Z=!1,filter:J,walkFilter:V}=X,q=[];if(!J||J(Q))q.push($?Q:Q.fullpath());let _=new Set,Y=(K,G)=>{_.add(K),K.readdirCB((W,z)=>{if(W)return G(W);let j=z.length;if(!j)return G();let U=()=>{if(--j===0)G()};for(let B of z){if(!J||J(B))q.push($?B:B.fullpath());if(Z&&B.isSymbolicLink())B.realpath().then((C)=>C?.isUnknown()?C.lstat():C).then((C)=>C?.shouldWalk(_,V)?Y(C,U):U());else if(B.shouldWalk(_,V))Y(B,U);else U()}},!0)},H=Q;return new Promise((K,G)=>{Y(H,(W)=>{if(W)return G(W);K(q)})})}walkSync(Q=this.cwd,X={}){if(typeof Q==="string")Q=this.cwd.resolve(Q);else if(!(Q instanceof b))X=Q,Q=this.cwd;let{withFileTypes:$=!0,follow:Z=!1,filter:J,walkFilter:V}=X,q=[];if(!J||J(Q))q.push($?Q:Q.fullpath());let _=new Set([Q]);for(let Y of _){let H=Y.readdirSync();for(let K of H){if(!J||J(K))q.push($?K:K.fullpath());let G=K;if(K.isSymbolicLink()){if(!(Z&&(G=K.realpathSync())))continue;if(G.isUnknown())G.lstatSync()}if(G.shouldWalk(_,V))_.add(G)}}return q}[Symbol.asyncIterator](){return this.iterate()}iterate(Q=this.cwd,X={}){if(typeof Q==="string")Q=this.cwd.resolve(Q);else if(!(Q instanceof b))X=Q,Q=this.cwd;return this.stream(Q,X)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(Q=this.cwd,X={}){if(typeof Q==="string")Q=this.cwd.resolve(Q);else if(!(Q instanceof b))X=Q,Q=this.cwd;let{withFileTypes:$=!0,follow:Z=!1,filter:J,walkFilter:V}=X;if(!J||J(Q))yield $?Q:Q.fullpath();let q=new Set([Q]);for(let _ of q){let Y=_.readdirSync();for(let H of Y){if(!J||J(H))yield $?H:H.fullpath();let K=H;if(H.isSymbolicLink()){if(!(Z&&(K=H.realpathSync())))continue;if(K.isUnknown())K.lstatSync()}if(K.shouldWalk(q,V))q.add(K)}}}stream(Q=this.cwd,X={}){if(typeof Q==="string")Q=this.cwd.resolve(Q);else if(!(Q instanceof b))X=Q,Q=this.cwd;let{withFileTypes:$=!0,follow:Z=!1,filter:J,walkFilter:V}=X,q=new X0({objectMode:!0});if(!J||J(Q))q.write($?Q:Q.fullpath());let _=new Set,Y=[Q],H=0,K=()=>{let G=!1;while(!G){let W=Y.shift();if(!W){if(H===0)q.end();return}H++,_.add(W);let z=(U,B,C=!1)=>{if(U)return q.emit("error",U);if(Z&&!C){let M=[];for(let w of B)if(w.isSymbolicLink())M.push(w.realpath().then((R)=>R?.isUnknown()?R.lstat():R));if(M.length){Promise.all(M).then(()=>z(null,B,!0));return}}for(let M of B)if(M&&(!J||J(M))){if(!q.write($?M:M.fullpath()))G=!0}H--;for(let M of B){let w=M.realpathCached()||M;if(w.shouldWalk(_,V))Y.push(w)}if(G&&!q.flowing)q.once("drain",K);else if(!j)K()},j=!0;W.readdirCB(z,!0),j=!1}};return K(),q}streamSync(Q=this.cwd,X={}){if(typeof Q==="string")Q=this.cwd.resolve(Q);else if(!(Q instanceof b))X=Q,Q=this.cwd;let{withFileTypes:$=!0,follow:Z=!1,filter:J,walkFilter:V}=X,q=new X0({objectMode:!0}),_=new Set;if(!J||J(Q))q.write($?Q:Q.fullpath());let Y=[Q],H=0,K=()=>{let G=!1;while(!G){let W=Y.shift();if(!W){if(H===0)q.end();return}H++,_.add(W);let z=W.readdirSync();for(let j of z)if(!J||J(j)){if(!q.write($?j:j.fullpath()))G=!0}H--;for(let j of z){let U=j;if(j.isSymbolicLink()){if(!(Z&&(U=j.realpathSync())))continue;if(U.isUnknown())U.lstatSync()}if(U.shouldWalk(_,V))Y.push(U)}}if(G&&!q.flowing)q.once("drain",K)};return K(),q}chdir(Q=this.cwd){let X=this.cwd;this.cwd=typeof Q==="string"?this.cwd.resolve(Q):Q,this.cwd[KQ](X)}}class F0 extends W8{sep="\\";constructor(Q=process.cwd(),X={}){let{nocase:$=!0}=X;super(Q,K8,"\\",{...X,nocase:$});this.nocase=$;for(let Z=this.cwd;Z;Z=Z.parent)Z.nocase=this.nocase}parseRootPath(Q){return K8.parse(Q).root.toUpperCase()}newRoot(Q){return new y0(this.rootPath,o,void 0,this.roots,this.nocase,this.childrenCache(),{fs:Q})}isAbsolute(Q){return Q.startsWith("/")||Q.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(Q)}}class N0 extends W8{sep="/";constructor(Q=process.cwd(),X={}){let{nocase:$=!1}=X;super(Q,NX,"/",{...X,nocase:$});this.nocase=$}parseRootPath(Q){return"/"}newRoot(Q){return new g0(this.rootPath,o,void 0,this.roots,this.nocase,this.childrenCache(),{fs:Q})}isAbsolute(Q){return Q.startsWith("/")}}class h0 extends N0{constructor(Q=process.cwd(),X={}){let{nocase:$=!0}=X;super(Q,{...X,nocase:$})}}var x5=process.platform==="win32"?y0:g0,HQ=process.platform==="win32"?F0:process.platform==="darwin"?h0:N0;var dX=(Q)=>Q.length>=1,cX=(Q)=>Q.length>=1;class W0{#Q;#X;#$;length;#J;#q;#M;#U;#_;#H;#Y=!0;constructor(Q,X,$,Z){if(!dX(Q))throw TypeError("empty pattern list");if(!cX(X))throw TypeError("empty glob list");if(X.length!==Q.length)throw TypeError("mismatched pattern list and glob list lengths");if(this.length=Q.length,$<0||$>=this.length)throw TypeError("index out of range");if(this.#Q=Q,this.#X=X,this.#$=$,this.#J=Z,this.#$===0){if(this.isUNC()){let[J,V,q,_,...Y]=this.#Q,[H,K,G,W,...z]=this.#X;if(Y[0]==="")Y.shift(),z.shift();let j=[J,V,q,_,""].join("/"),U=[H,K,G,W,""].join("/");this.#Q=[j,...Y],this.#X=[U,...z],this.length=this.#Q.length}else if(this.isDrive()||this.isAbsolute()){let[J,...V]=this.#Q,[q,..._]=this.#X;if(V[0]==="")V.shift(),_.shift();let Y=J+"/",H=q+"/";this.#Q=[Y,...V],this.#X=[H,..._],this.length=this.#Q.length}}}pattern(){return this.#Q[this.#$]}isString(){return typeof this.#Q[this.#$]==="string"}isGlobstar(){return this.#Q[this.#$]===P}isRegExp(){return this.#Q[this.#$]instanceof RegExp}globString(){return this.#M=this.#M||(this.#$===0?this.isAbsolute()?this.#X[0]+this.#X.slice(1).join("/"):this.#X.join("/"):this.#X.slice(this.#$).join("/"))}hasMore(){return this.length>this.#$+1}rest(){if(this.#q!==void 0)return this.#q;if(!this.hasMore())return this.#q=null;return this.#q=new W0(this.#Q,this.#X,this.#$+1,this.#J),this.#q.#H=this.#H,this.#q.#_=this.#_,this.#q.#U=this.#U,this.#q}isUNC(){let Q=this.#Q;return this.#_!==void 0?this.#_:this.#_=this.#J==="win32"&&this.#$===0&&Q[0]===""&&Q[1]===""&&typeof Q[2]==="string"&&!!Q[2]&&typeof Q[3]==="string"&&!!Q[3]}isDrive(){let Q=this.#Q;return this.#U!==void 0?this.#U:this.#U=this.#J==="win32"&&this.#$===0&&this.length>1&&typeof Q[0]==="string"&&/^[a-z]:$/i.test(Q[0])}isAbsolute(){let Q=this.#Q;return this.#H!==void 0?this.#H:this.#H=Q[0]===""&&Q.length>1||this.isDrive()||this.isUNC()}root(){let Q=this.#Q[0];return typeof Q==="string"&&this.isAbsolute()&&this.#$===0?Q:""}checkFollowGlobstar(){return!(this.#$===0||!this.isGlobstar()||!this.#Y)}markFollowGlobstar(){if(this.#$===0||!this.isGlobstar()||!this.#Y)return!1;return this.#Y=!1,!0}}var lX=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class v0{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(Q,{nobrace:X,nocase:$,noext:Z,noglobstar:J,platform:V=lX}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=V,this.mmopts={dot:!0,nobrace:X,nocase:$,noext:Z,noglobstar:J,optimizationLevel:2,platform:V,nocomment:!0,nonegate:!0};for(let q of Q)this.add(q)}add(Q){let X=new m(Q,this.mmopts);for(let $=0;$<X.set.length;$++){let Z=X.set[$],J=X.globParts[$];if(!Z||!J)throw Error("invalid pattern object");while(Z[0]==="."&&J[0]===".")Z.shift(),J.shift();let V=new W0(Z,J,0,this.platform),q=new m(V.globString(),this.mmopts),_=J[J.length-1]==="**",Y=V.isAbsolute();if(Y)this.absolute.push(q);else this.relative.push(q);if(_)if(Y)this.absoluteChildren.push(q);else this.relativeChildren.push(q)}}ignored(Q){let X=Q.fullpath(),$=`${X}/`,Z=Q.relative()||".",J=`${Z}/`;for(let V of this.relative)if(V.match(Z)||V.match(J))return!0;for(let V of this.absolute)if(V.match(X)||V.match($))return!0;return!1}childrenIgnored(Q){let X=Q.fullpath()+"/",$=(Q.relative()||".")+"/";for(let Z of this.relativeChildren)if(Z.match($))return!0;for(let Z of this.absoluteChildren)if(Z.match(X))return!0;return!1}}class G8{store;constructor(Q=new Map){this.store=Q}copy(){return new G8(new Map(this.store))}hasWalked(Q,X){return this.store.get(Q.fullpath())?.has(X.globString())}storeWalked(Q,X){let $=Q.fullpath(),Z=this.store.get($);if(Z)Z.add(X.globString());else this.store.set($,new Set([X.globString()]))}}class WQ{store=new Map;add(Q,X,$){let Z=(X?2:0)|($?1:0),J=this.store.get(Q);this.store.set(Q,J===void 0?Z:Z&J)}entries(){return[...this.store.entries()].map(([Q,X])=>[Q,!!(X&2),!!(X&1)])}}class GQ{store=new Map;add(Q,X){if(!Q.canReaddir())return;let $=this.store.get(Q);if($){if(!$.find((Z)=>Z.globString()===X.globString()))$.push(X)}else this.store.set(Q,[X])}get(Q){let X=this.store.get(Q);if(!X)throw Error("attempting to walk unknown path");return X}entries(){return this.keys().map((Q)=>[Q,this.store.get(Q)])}keys(){return[...this.store.keys()].filter((Q)=>Q.canReaddir())}}class P0{hasWalkedCache;matches=new WQ;subwalks=new GQ;patterns;follow;dot;opts;constructor(Q,X){this.opts=Q,this.follow=!!Q.follow,this.dot=!!Q.dot,this.hasWalkedCache=X?X.copy():new G8}processPatterns(Q,X){this.patterns=X;let $=X.map((Z)=>[Q,Z]);for(let[Z,J]of $){this.hasWalkedCache.storeWalked(Z,J);let V=J.root(),q=J.isAbsolute()&&this.opts.absolute!==!1;if(V){Z=Z.resolve(V==="/"&&this.opts.root!==void 0?this.opts.root:V);let K=J.rest();if(!K){this.matches.add(Z,!0,!1);continue}else J=K}if(Z.isENOENT())continue;let _,Y,H=!1;while(typeof(_=J.pattern())==="string"&&(Y=J.rest()))Z=Z.resolve(_),J=Y,H=!0;if(_=J.pattern(),Y=J.rest(),H){if(this.hasWalkedCache.hasWalked(Z,J))continue;this.hasWalkedCache.storeWalked(Z,J)}if(typeof _==="string"){let K=_===".."||_===""||_===".";this.matches.add(Z.resolve(_),q,K);continue}else if(_===P){if(!Z.isSymbolicLink()||this.follow||J.checkFollowGlobstar())this.subwalks.add(Z,J);let K=Y?.pattern(),G=Y?.rest();if(!Y||(K===""||K===".")&&!G)this.matches.add(Z,q,K===""||K===".");else if(K===".."){let W=Z.parent||Z;if(!G)this.matches.add(W,q,!0);else if(!this.hasWalkedCache.hasWalked(W,G))this.subwalks.add(W,G)}}else if(_ instanceof RegExp)this.subwalks.add(Z,J)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new P0(this.opts,this.hasWalkedCache)}filterEntries(Q,X){let $=this.subwalks.get(Q),Z=this.child();for(let J of X)for(let V of $){let q=V.isAbsolute(),_=V.pattern(),Y=V.rest();if(_===P)Z.testGlobstar(J,V,Y,q);else if(_ instanceof RegExp)Z.testRegExp(J,_,Y,q);else Z.testString(J,_,Y,q)}return Z}testGlobstar(Q,X,$,Z){if(this.dot||!Q.name.startsWith(".")){if(!X.hasMore())this.matches.add(Q,Z,!1);if(Q.canReaddir()){if(this.follow||!Q.isSymbolicLink())this.subwalks.add(Q,X);else if(Q.isSymbolicLink()){if($&&X.checkFollowGlobstar())this.subwalks.add(Q,$);else if(X.markFollowGlobstar())this.subwalks.add(Q,X)}}}if($){let J=$.pattern();if(typeof J==="string"&&J!==".."&&J!==""&&J!==".")this.testString(Q,J,$.rest(),Z);else if(J===".."){let V=Q.parent||Q;this.subwalks.add(V,$)}else if(J instanceof RegExp)this.testRegExp(Q,J,$.rest(),Z)}}testRegExp(Q,X,$,Z){if(!X.test(Q.name))return;if(!$)this.matches.add(Q,Z,!1);else this.subwalks.add(Q,$)}testString(Q,X,$,Z){if(!Q.isNamed(X))return;if(!$)this.matches.add(Q,Z,!1);else this.subwalks.add(Q,$)}}var oX=(Q,X)=>typeof Q==="string"?new v0([Q],X):Array.isArray(Q)?new v0(Q,X):Q;class j8{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#Q=[];#X;#$;signal;maxDepth;includeChildMatches;constructor(Q,X,$){if(this.patterns=Q,this.path=X,this.opts=$,this.#$=!$.posix&&$.platform==="win32"?"\\":"/",this.includeChildMatches=$.includeChildMatches!==!1,$.ignore||!this.includeChildMatches){if(this.#X=oX($.ignore??[],$),!this.includeChildMatches&&typeof this.#X.add!=="function")throw Error("cannot ignore child matches, ignore lacks add() method.")}if(this.maxDepth=$.maxDepth||1/0,$.signal)this.signal=$.signal,this.signal.addEventListener("abort",()=>{this.#Q.length=0})}#J(Q){return this.seen.has(Q)||!!this.#X?.ignored?.(Q)}#q(Q){return!!this.#X?.childrenIgnored?.(Q)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let Q=void 0;while(!this.paused&&(Q=this.#Q.shift()))Q()}onResume(Q){if(this.signal?.aborted)return;if(!this.paused)Q();else this.#Q.push(Q)}async matchCheck(Q,X){if(X&&this.opts.nodir)return;let $;if(this.opts.realpath){if($=Q.realpathCached()||await Q.realpath(),!$)return;Q=$}let J=Q.isUnknown()||this.opts.stat?await Q.lstat():Q;if(this.opts.follow&&this.opts.nodir&&J?.isSymbolicLink()){let V=await J.realpath();if(V&&(V.isUnknown()||this.opts.stat))await V.lstat()}return this.matchCheckTest(J,X)}matchCheckTest(Q,X){return Q&&(this.maxDepth===1/0||Q.depth()<=this.maxDepth)&&(!X||Q.canReaddir())&&(!this.opts.nodir||!Q.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!Q.isSymbolicLink()||!Q.realpathCached()?.isDirectory())&&!this.#J(Q)?Q:void 0}matchCheckSync(Q,X){if(X&&this.opts.nodir)return;let $;if(this.opts.realpath){if($=Q.realpathCached()||Q.realpathSync(),!$)return;Q=$}let J=Q.isUnknown()||this.opts.stat?Q.lstatSync():Q;if(this.opts.follow&&this.opts.nodir&&J?.isSymbolicLink()){let V=J.realpathSync();if(V&&(V?.isUnknown()||this.opts.stat))V.lstatSync()}return this.matchCheckTest(J,X)}matchFinish(Q,X){if(this.#J(Q))return;if(!this.includeChildMatches&&this.#X?.add){let J=`${Q.relativePosix()}/**`;this.#X.add(J)}let $=this.opts.absolute===void 0?X:this.opts.absolute;this.seen.add(Q);let Z=this.opts.mark&&Q.isDirectory()?this.#$:"";if(this.opts.withFileTypes)this.matchEmit(Q);else if($){let J=this.opts.posix?Q.fullpathPosix():Q.fullpath();this.matchEmit(J+Z)}else{let J=this.opts.posix?Q.relativePosix():Q.relative(),V=this.opts.dotRelative&&!J.startsWith(".."+this.#$)?"."+this.#$:"";this.matchEmit(!J?"."+Z:V+J+Z)}}async match(Q,X,$){let Z=await this.matchCheck(Q,$);if(Z)this.matchFinish(Z,X)}matchSync(Q,X,$){let Z=this.matchCheckSync(Q,$);if(Z)this.matchFinish(Z,X)}walkCB(Q,X,$){if(this.signal?.aborted)$();this.walkCB2(Q,X,new P0(this.opts),$)}walkCB2(Q,X,$,Z){if(this.#q(Q))return Z();if(this.signal?.aborted)Z();if(this.paused){this.onResume(()=>this.walkCB2(Q,X,$,Z));return}$.processPatterns(Q,X);let J=1,V=()=>{if(--J===0)Z()};for(let[q,_,Y]of $.matches.entries()){if(this.#J(q))continue;J++,this.match(q,_,Y).then(()=>V())}for(let q of $.subwalkTargets()){if(this.maxDepth!==1/0&&q.depth()>=this.maxDepth)continue;J++;let _=q.readdirCached();if(q.calledReaddir())this.walkCB3(q,_,$,V);else q.readdirCB((Y,H)=>this.walkCB3(q,H,$,V),!0)}V()}walkCB3(Q,X,$,Z){$=$.filterEntries(Q,X);let J=1,V=()=>{if(--J===0)Z()};for(let[q,_,Y]of $.matches.entries()){if(this.#J(q))continue;J++,this.match(q,_,Y).then(()=>V())}for(let[q,_]of $.subwalks.entries())J++,this.walkCB2(q,_,$.child(),V);V()}walkCBSync(Q,X,$){if(this.signal?.aborted)$();this.walkCB2Sync(Q,X,new P0(this.opts),$)}walkCB2Sync(Q,X,$,Z){if(this.#q(Q))return Z();if(this.signal?.aborted)Z();if(this.paused){this.onResume(()=>this.walkCB2Sync(Q,X,$,Z));return}$.processPatterns(Q,X);let J=1,V=()=>{if(--J===0)Z()};for(let[q,_,Y]of $.matches.entries()){if(this.#J(q))continue;this.matchSync(q,_,Y)}for(let q of $.subwalkTargets()){if(this.maxDepth!==1/0&&q.depth()>=this.maxDepth)continue;J++;let _=q.readdirSync();this.walkCB3Sync(q,_,$,V)}V()}walkCB3Sync(Q,X,$,Z){$=$.filterEntries(Q,X);let J=1,V=()=>{if(--J===0)Z()};for(let[q,_,Y]of $.matches.entries()){if(this.#J(q))continue;this.matchSync(q,_,Y)}for(let[q,_]of $.subwalks.entries())J++,this.walkCB2Sync(q,_,$.child(),V);V()}}class d0 extends j8{matches=new Set;constructor(Q,X,$){super(Q,X,$)}matchEmit(Q){this.matches.add(Q)}async walk(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown())await this.path.lstat();return await new Promise((Q,X)=>{this.walkCB(this.path,this.patterns,()=>{if(this.signal?.aborted)X(this.signal.reason);else Q(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown())this.path.lstatSync();return this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}}class c0 extends j8{results;constructor(Q,X,$){super(Q,X,$);this.results=new X0({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(Q){if(this.results.write(Q),!this.results.flowing)this.pause()}stream(){let Q=this.path;if(Q.isUnknown())Q.lstat().then(()=>{this.walkCB(Q,this.patterns,()=>this.results.end())});else this.walkCB(Q,this.patterns,()=>this.results.end());return this.results}streamSync(){if(this.path.isUnknown())this.path.lstatSync();return this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}}var iX=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class p{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(Q,X){if(!X)throw TypeError("glob options required");if(this.withFileTypes=!!X.withFileTypes,this.signal=X.signal,this.follow=!!X.follow,this.dot=!!X.dot,this.dotRelative=!!X.dotRelative,this.nodir=!!X.nodir,this.mark=!!X.mark,!X.cwd)this.cwd="";else if(X.cwd instanceof URL||X.cwd.startsWith("file://"))X.cwd=pX(X.cwd);if(this.cwd=X.cwd||"",this.root=X.root,this.magicalBraces=!!X.magicalBraces,this.nobrace=!!X.nobrace,this.noext=!!X.noext,this.realpath=!!X.realpath,this.absolute=X.absolute,this.includeChildMatches=X.includeChildMatches!==!1,this.noglobstar=!!X.noglobstar,this.matchBase=!!X.matchBase,this.maxDepth=typeof X.maxDepth==="number"?X.maxDepth:1/0,this.stat=!!X.stat,this.ignore=X.ignore,this.withFileTypes&&this.absolute!==void 0)throw Error("cannot set absolute and withFileTypes:true");if(typeof Q==="string")Q=[Q];if(this.windowsPathsNoEscape=!!X.windowsPathsNoEscape||X.allowWindowsEscape===!1,this.windowsPathsNoEscape)Q=Q.map((_)=>_.replace(/\\/g,"/"));if(this.matchBase){if(X.noglobstar)throw TypeError("base matching requires globstar");Q=Q.map((_)=>_.includes("/")?_:`./**/${_}`)}if(this.pattern=Q,this.platform=X.platform||iX,this.opts={...X,platform:this.platform},X.scurry){if(this.scurry=X.scurry,X.nocase!==void 0&&X.nocase!==X.scurry.nocase)throw Error("nocase option contradicts provided scurry option")}else{let _=X.platform==="win32"?F0:X.platform==="darwin"?h0:X.platform?N0:HQ;this.scurry=new _(this.cwd,{nocase:X.nocase,fs:X.fs})}this.nocase=this.scurry.nocase;let $=this.platform==="darwin"||this.platform==="win32",Z={...X,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:$,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},J=this.pattern.map((_)=>new m(_,Z)),[V,q]=J.reduce((_,Y)=>{return _[0].push(...Y.set),_[1].push(...Y.globParts),_},[[],[]]);this.patterns=V.map((_,Y)=>{let H=q[Y];if(!H)throw Error("invalid pattern object");return new W0(_,H,0,this.platform)})}async walk(){return[...await new d0(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 d0(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 c0(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 c0(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 z8=(Q,X={})=>{if(!Array.isArray(Q))Q=[Q];for(let $ of Q)if(new m($,X).hasMagic())return!0;return!1};function l0(Q,X={}){return new p(Q,X).streamSync()}function UQ(Q,X={}){return new p(Q,X).stream()}function o0(Q,X={}){return new p(Q,X).walkSync()}async function jQ(Q,X={}){return new p(Q,X).walk()}function p0(Q,X={}){return new p(Q,X).iterateSync()}function BQ(Q,X={}){return new p(Q,X).iterate()}var nX=l0,rX=Object.assign(UQ,{sync:l0}),aX=p0,sX=Object.assign(BQ,{sync:p0}),eX=Object.assign(o0,{stream:l0,iterate:p0}),zQ=Object.assign(jQ,{glob:jQ,globSync:o0,sync:eX,globStream:UQ,stream:rX,globStreamSync:l0,streamSync:nX,globIterate:BQ,iterate:sX,globIterateSync:p0,iterateSync:aX,Glob:p,hasMagic:z8,escape:q0,unescape:h});zQ.glob=zQ;import tX from"node:path";var wQ=({dir:Q,pattern:X="*",nodir:$=!1,dot:Z=!0,ignore:J=[],absolute:V=!1,matchBase:q=!1,follow:_=!1})=>{if(Q=Q||process.cwd(),Q=tX.resolve(Q),X&&!Array.isArray(X))X=[X];else X=X||["*"];if(J&&!Array.isArray(J))J=[J];else J=J||[];return o0(X,{cwd:Q,nodir:$,dot:Z,ignore:J,absolute:V,matchBase:q,follow:_})};import i from"node:fs";import n0 from"node:path";import{randomUUID as Q5}from"node:crypto";import X5 from"yaml";import $5 from"nunjucks";import Z5 from"chalk";import{Atom as Z0}from"@flownet/lib-atom-api-js";import J5 from"@fnet/config";import{Api as i0}from"@flownet/lib-atom-api-js";class CQ{init({config:Q,accessToken:X}){return new Promise(($,Z)=>{if(i0.set_api_url(Q.data.url),X){i0.set_req_token(X),$(X);return}fetch(`${Q.data.issuer}/protocol/openid-connect/token`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(Q.data.grant.params)}).then(async(J)=>{if(!J.ok)throw Error(await J.text());return J.json()}).then((J)=>{i0.set_req_token(J.access_token),$(J.access_token)}).catch((J)=>{i0.set_req_token(),Z(J)})})}}var MQ=async(Q)=>{let{atom:X,packageDependencies:$,context:Z,deploymentProjectTarget:J,setProgress:V,deploymentProject:q,yamlTarget:_}=Q;if(J.enabled!==!0)return;let Y=J.type;try{if(Y==="lib")await(await import("./index.j5z7dtsx.js")).default({...Q});else if(Y==="red")await(await import("./index.tgkhgnrp.js")).default({...Q});else if(Y==="npm")await(await import("./index.fbzv6wwf.js")).default({...Q});else if(Y==="gcs")await(await import("./index.s66v6wt4.js")).default({...Q});else if(Y==="gitlab")await(await import("./index.kb4e4bxf.js")).default({...Q});else if(Y==="fnet-package")await(await import("./index.f2tb0x3t.js")).default({...Q});else if(Y==="fnet-form")await(await import("./index.sv7v0y60.js")).default({...Q});else if(Y==="fnet-node")await(await import("./index.vq706f75.js")).default({...Q});else if(Y==="fnet-flow")await(await import("./index.z4vz93ww.js")).default({...Q});else if(Y==="nextjs")await(await import("./index.gazd9raq.js")).default({atom:X,target:J,onProgress:V,projectDir:Z.projectDir,dependencies:$,context:Z,yamlTarget:_}),q.isDirty=!0;else if(Y==="webos")await(await import("./index.y8pvdcny.js")).default({atom:X,target:J,onProgress:V,projectDir:Z.projectDir,dependencies:$,context:Z,yamlTarget:_}),q.isDirty=!0;else if(Y==="electron")await(await import("./index.eqxmcpdc.js")).default({atom:X,target:J,onProgress:V,projectDir:Z.projectDir,dependencies:$,context:Z,yamlTarget:_}),q.isDirty=!0;else if(Y==="docker")await(await import("./index.dp9wyahp.js")).default({atom:X,target:J,onProgress:V,projectDir:Z.projectDir,dependencies:$,context:Z,yamlTarget:_}),q.isDirty=!0;else if(Y==="ios")await(await import("./index.b1q7y05p.js")).default({atom:X,target:J,onProgress:V,projectDir:Z.projectDir,dependencies:$,context:Z,yamlTarget:_}),q.isDirty=!0;else if(Y==="macos")await(await import("./index.qn0schqp.js")).default({atom:X,target:J,onProgress:V,projectDir:Z.projectDir,dependencies:$,context:Z,yamlTarget:_}),q.isDirty=!0;else if(Y==="rust")await(await import("./index.2hc9tbyx.js")).default({atom:X,target:J,onProgress:V,projectDir:Z.projectDir,dependencies:$,context:Z,yamlTarget:_}),q.isDirty=!0;else if(Y==="pypi")await(await import("./index.rht29phd.js")).default({atom:X,target:J,onProgress:V,projectDir:Z.projectDir,dependencies:$,context:Z,yamlTarget:_}),q.isDirty=!0;else{console.warn(`No deployer found for type: ${Y}`);return}}catch(H){throw console.error(`Error during deployment for type "${Y}":`,H),H}};class RQ{#Q;#X;#$;#J;#q;#M;#U;#_;#H;#Y;#K;#Z;#G;#B;#j;#z;#w;constructor(Q){this.#Q=new CQ,this.#X=Q,this.#M=[],this.#U=[],this._expire_ttl=3600,this._expire_ttl_short=300,this.#w={packageDependencies:this.#M,packageDevDependencies:this.#U,setProgress:this.setProgress.bind(this),context:this.#X,Atom:Z0,registerToPackageManager:this.registerToPackageManager.bind(this)}}get apiContext(){return this.#w}get context(){return this.#X}get atom(){return this.#$}get libs(){return this.#q}set libs(Q){this.#q=Q}get fileMode(){return this.#B}get buildMode(){return this.#j}get deployMode(){return this.#z}async _cache_set(Q,X,$){}async initAuth(){if(!this.#X.id)return;this.#_=await this.#Q.init({config:this.#Z}),this.#w.atomAccessToken=this.#_}async initLibrary(){let Q=this.#X.id;this.#$=this.#X.project?.libraryAtom||await Z0.get({id:Q});let X=this.#$.doc.bundleName;X=X||(this.#$.doc.name||"").toUpperCase().replace(/[^A-Z0-9]/g,"_"),this.#$.doc.bundleName=X,this.#$.type=this.#$.type||"workflow.lib",this.#w.atom=this.#$}async initLibraryDir(){this.setProgress({message:"Initializing library directory."});let Q=this.#X.projectDir;this.setProgress({message:"Cleaning project directory."});let X=wQ({dir:Q,ignore:[".cache","node_modules",".conda",".bin",".dev"],absolute:!0});for(let Z of X)i.rmSync(Z,{recursive:!0,force:!0});this.setProgress({message:"Creating project directory."});let $=Q;if(!i.existsSync($))i.mkdirSync($,{recursive:!0});if($=n0.join(Q,"src"),!i.existsSync($))i.mkdirSync($,{recursive:!0});if($=n0.join(Q,"src","default"),!i.existsSync($))i.mkdirSync($,{recursive:!0});if($=n0.join(Q,".dev"),!i.existsSync($))i.mkdirSync($,{recursive:!0})}async initNunjucks(){this.setProgress({message:"Initializing nunjucks."});let Q=this.#X.templateDir;this.#J=$5.configure(Q,{watch:!1,dev:!0}),this.#w.njEnv=this.#J}async createProjectYaml(){await this.setProgress({message:"Creating fnode.yaml"});let{content:$,...Z}=this.#$.doc,J=this.#X.projectDir,V=n0.resolve(J,"fnode.yaml");i.writeFileSync(V,X5.stringify(Z),"utf8")}async deploy(){if(await this.setProgress({message:"Deploying."}),this.#X.project?.devops){let Q=[this.#X.project?.devops];for(let X=0;X<Q.length;X++){let $=Q[X];if(await this.deployProject({deploymentProject:$}),$.isDirty===!0)await $.save()}}else if(this.#$.id){let Q=await Z0.list({type:"library.deploy",parent_id:this.#$.id});for(let X=0;X<Q.length;X++){let $=Q[X];if(await this.deployProject({deploymentProject:$}),$.isDirty===!0)$=await Z0.update($,{id:$.id})}}}async deployProject(Q){let{deploymentProject:X}=Q,{yamlDocument:$}=X;if(X.doc.targets&&Array.isArray(X.doc.targets))throw Error("Deployment project targets are deprecated. Please update targets in the yaml file.");let Z=Object.keys(X.doc||{}),J=$||{};for(let V=0;V<Z.length;V++){let q=X.doc[Z[V]];q.name=Z[V];let _=J.get(Z[V]);await MQ({...this.#w,deploymentProject:X,deploymentProjectTarget:q,yamlTarget:_})}}async registerToPackageManager(Q){let{target:X,packageJSON:$}=Q;if(!this.#X.id)return;let Z=await Z0.first({name:X.params.name,parent_id:this.#Z.env.ATOM_PACKAGES_ID});if(!Z)Z=await Z0.create({parent_id:this.#Z.env.ATOM_PACKAGES_ID,doc:{name:X.params.name,type:"pm",versions:[{v:$.version}]}});else Z.doc.versions.splice(0,0,{v:$.version}),await Z0.update(Z,{id:Z.id})}async setProgress(Q){let X=typeof Q==="string"?Q:Q?.message;console.log(Z5.blue(X)),await this._cache_set(this.#Y,{status:"IN_PROGRESS",message:X})}async init(){this.#H=this.#X.buildId||Q5(),this.#w.buildId=this.#H,this.#G=this.#X.mode,this.#B=["all","deploy","build","file"].includes(this.#G),this.#j=["all","deploy","build"].includes(this.#G),this.#z=["all","deploy"].includes(this.#G),this.#K=this.#X.protocol,this.#Y="BUILD:"+this.#H,this.#Z=(await J5({optional:!0,name:this.#X.atomConfig||"atom",dir:this.#X.projectDir,tags:this.#X.tags}))?.data;try{await this.setProgress({message:"Initialization started."}),await this.initAuth(),await this.initLibrary(),await this.initRuntime()}catch(Q){throw await this._cache_set(this.#Y,{status:"FAILED",message:Q?.message||Q}),Q}}async initRuntime(){throw Error("initRuntime method must be implemented by runtime-specific builder")}async build(){throw Error("build method must be implemented by runtime-specific builder")}}var k6=RQ;import AQ from"node:fs";import IQ from"node:path";import LQ from"nunjucks";async function V5({atom:Q,setProgress:X,context:$,packageDependencies:Z}){await X({message:"Creating .gitignore"});let J={atom:Q,packageDependencies:Z},V=$.templateDir,_=LQ.compile(AQ.readFileSync(IQ.resolve(V,".gitignore.njk"),"utf8"),LQ.configure(V)).render(J),Y=$.projectDir,H=IQ.resolve(Y,".gitignore");AQ.writeFileSync(H,_,"utf8")}import r0 from"nunjucks";import e from"node:fs";import J0 from"node:path";import OQ from"@fnet/yaml";async function q5({atom:Q,context:X,setProgress:$,Atom:Z}){if(await $({message:"Creating readme.md"}),X.project?.readme){let q=X.projectDir,_={content:X.project.readme.doc.content},Y=J0.resolve(X.project.projectDir,"fnet/how-to.md");if(e.existsSync(Y)){let U=e.readFileSync(Y,"utf8");_.howto=U}let H=J0.resolve(X.project.projectDir,"fnet/input.yaml");if(e.existsSync(H)){let U=await OQ({file:H,tags:X.tags});_.input=U.content}let K=J0.resolve(X.project.projectDir,"fnet/output.yaml");if(e.existsSync(K)){let U=await OQ({file:K,tags:X.tags});_.output=U.content}let G=X.templateDir,z=r0.compile(e.readFileSync(J0.resolve(G,"readme.md.njk"),"utf8"),r0.configure(G)).render(_),j=J0.resolve(q,"readme.md");e.writeFileSync(j,z,"utf8")}else if(Q.id){let q=await Z.first({type:"wiki",parent_id:Q.id});if(!q||q.doc?.["content-type"]!=="markdown")return;let{content:_,...Y}=q.doc,H={content:_},K=X.templateDir,W=r0.compile(e.readFileSync(J0.resolve(K,"readme.md.njk"),"utf8"),r0.configure(K)).render(H),z=X.projectDir,j=J0.resolve(z,"readme.md");e.writeFileSync(j,W,"utf8")}}
4
- export{wQ as a,k6 as b,V5 as c,q5 as d};
@@ -1,2 +0,0 @@
1
- import{createRequire as L}from"node:module";var H=Object.create;var{getPrototypeOf:I,defineProperty:B,getOwnPropertyNames:J}=Object;var K=Object.prototype.hasOwnProperty;var Q=(j,y,z)=>{z=j!=null?H(I(j)):{};let q=y||!j||!j.__esModule?B(z,"default",{value:j,enumerable:!0}):z;for(let x of J(j))if(!K.call(q,x))B(q,x,{get:()=>j[x],enumerable:!0});return q};var U=L(import.meta.url);import M from"cli-table3";import A from"chalk";function E(j,y={}){let q={...{chars:{top:"─","top-mid":"─","top-left":" ","top-right":" ",bottom:"─","bottom-mid":"─","bottom-left":" ","bottom-right":" ",left:" ","left-mid":" ",mid:"─","mid-mid":"─",right:" ","right-mid":" ",middle:" "},style:{head:[],border:[],compact:!0},wordWrap:!0},...y,head:j.map((x)=>A.bold(x))};return new M(q)}function N(j,y,z={}){let q=E(j,z);if(Array.isArray(y))y.forEach((x)=>{q.push(x)});return q.toString()}function P(j){switch(j){case"running":return A.green;case"stopped":return A.yellow;case"failed":return A.red;case"registered":return A.blue;default:return A.gray}}var Z={createTable:E,createTableWithData:N,getStatusColor:P};export{P as getStatusColor,Z as default,N as createTableWithData,E as createTable};
2
- export{Q as a,U as b,Z as c};