@kitelev/exocortex-cli 16.255.21 → 16.255.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// @kitelev/exocortex-cli v16.255.
|
|
2
|
+
// @kitelev/exocortex-cli v16.255.22
|
|
3
3
|
// CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more
|
|
4
4
|
// License: MIT
|
|
5
5
|
|
|
@@ -359,7 +359,7 @@ ${g.body}`,warnings:m}}splitDoc(e){let t=fae.exec(e);if(!t)return{frontmatter:{}
|
|
|
359
359
|
\u{1F4CB} Context:`;for(let[t,n]of Object.entries(this.context))e+=`
|
|
360
360
|
${t}: ${JSON.stringify(n)}`}return e}toStructuredResponse(e=!1){return pt.error(this.errorCode,this.message,this.exitCode,{recovery:this.recoveryHint||{message:this.guidance},context:this.context,stack:e?this.stack:void 0})}formatJson(e=!1){return JSON.stringify(this.toStructuredResponse(e),null,2)}}});function Tue(r){let e=r.toLowerCase();return e.includes("transition")?{exitCode:6,errorCode:"STATE_INVALID_TRANSITION"}:e.includes("transaction")?{exitCode:7,errorCode:"INTERNAL_TRANSACTION_FAILED"}:e.includes("concurrent")||e.includes("modified")?{exitCode:8,errorCode:"STATE_CONCURRENT_MODIFICATION"}:r.includes("not found")||r.includes("ENOENT")?{exitCode:3,errorCode:"VALIDATION_FILE_NOT_FOUND"}:r.includes("EACCES")||r.includes("permission denied")?{exitCode:4,errorCode:"PERMISSION_DENIED"}:r.includes("Invalid")||r.includes("outside vault")||r.includes("Not a")?{exitCode:2,errorCode:"VALIDATION_INVALID_ARGUMENTS"}:{exitCode:1,errorCode:"INTERNAL_UNKNOWN"}}var ue,St=Me(()=>{"use strict";tr();Hi();Er();ue=class r{static{a(this,"ErrorHandler")}static{this.outputFormat="text"}static withCommand(e,t){return t?{...e,command:t}:e}static setFormat(e){r.outputFormat=e}static getFormat(){return r.outputFormat}static isDebugMode(){return!!process.env.DEBUG}static handle(e,t){let n=t?.command;if(e instanceof Lr){if(r.outputFormat==="json"){let o=e.toStructuredResponse(r.isDebugMode());console.log(JSON.stringify(r.withCommand(o,n),null,2))}else n&&console.error(`\u274C Command failed: ${n}`),console.error(e.format()),r.isDebugMode()&&(console.error(`
|
|
361
361
|
\u{1F4CD} Stack trace:`),console.error(e.stack));process.exit(e.exitCode)}let{exitCode:i,errorCode:s}=r.classifyError(e);if(r.outputFormat==="json"){let o=r.buildErrorResponse(s,e.message,i,r.isDebugMode()?e.stack:void 0);console.log(JSON.stringify(r.withCommand(o,n),null,2))}else n&&console.error(`\u274C Command failed: ${n}`),console.error(`\u274C Error: ${e.message}`),r.isDebugMode()&&console.error(e.stack);process.exit(i)}static handleWithMessage(e,t=1,n="INTERNAL_UNKNOWN"){if(r.outputFormat==="json"){let i=r.buildErrorResponse(n,e,t);console.log(JSON.stringify(i,null,2))}else console.error(`\u274C Error: ${e}`);process.exit(t)}static classifyError(e){return Tue(e.message)}static buildErrorResponse(e,t,n,i){return pt.error(e,t,n,{recovery:r.getRecoveryHint(e),stack:i})}static getRecoveryHint(e){switch(e){case"VALIDATION_FILE_NOT_FOUND":return{message:"Verify the file path is correct and the file exists",suggestion:"Check file path spelling and ensure the file is in the vault"};case"VALIDATION_VAULT_NOT_FOUND":return{message:"Verify the vault path is correct",suggestion:"Check --vault option or current directory"};case"VALIDATION_INVALID_ARGUMENTS":return{message:"Check command syntax and argument format",suggestion:"Use --help for usage information"};case"STATE_INVALID_TRANSITION":return{message:"The requested state transition is not allowed",suggestion:"Check the current asset state and valid transitions"};case"STATE_CONCURRENT_MODIFICATION":return{message:"File was modified by another process",suggestion:"Wait and retry the command"};case"PERMISSION_DENIED":return{message:"Check file permissions",suggestion:"Ensure you have write access to the vault"};case"INTERNAL_TRANSACTION_FAILED":return{message:"Transaction could not complete",suggestion:"Check for locked files and retry"};default:return{message:"An unexpected error occurred",suggestion:"Check the error details and retry"}}}};a(Tue,"classifyMessage")});var q9=Me(()=>{"use strict";tr();Hi();Er()});var Ye,W9=Me(()=>{"use strict";tr();Hi();Er();Ye=class extends Lr{constructor(t,n,i){let s=`Check command syntax and argument format.
|
|
362
|
-
Use: exocortex
|
|
362
|
+
Use: exocortex --help for usage information.`;super(t,i,{message:n||"Check command syntax and argument format",suggestion:"exocortex --help"});this.exitCode=2;this.errorCode="VALIDATION_INVALID_ARGUMENTS";this.guidance=n||s}static{a(this,"InvalidArgumentsError")}}});var z9=Me(()=>{"use strict";tr();Hi();Er()});var Le,H9=Me(()=>{"use strict";tr();Hi();Er();Le=class extends Lr{constructor(t,n){super(`Vault not found: ${t}`,{vaultPath:t,...n},{message:"Verify the vault path is correct and the directory exists",suggestion:`ls -la "${t}" or check --vault option`});this.exitCode=3;this.errorCode="VALIDATION_VAULT_NOT_FOUND";this.guidance=`The specified vault directory does not exist.
|
|
363
363
|
Check:
|
|
364
364
|
\u2022 Path spelling and case sensitivity
|
|
365
365
|
\u2022 Directory exists and is accessible
|
|
@@ -424,7 +424,7 @@ ${r.slice(o+1)}`:l+=r.slice(i),l.slice(1)}function Hhe(r){let e="",t=0;for(let n
|
|
|
424
424
|
`:" ";n+=`---${d}${f}
|
|
425
425
|
`}else n+=Va(t,0,o.contents,{block:!0,compact:!0})+`
|
|
426
426
|
`;i=o.explicitEnd||o.contents!==null&&Jhe(o.contents),i&&(n+=`...
|
|
427
|
-
`)}return n}function qd(r,e={}){let t={...tme,...e},n=whe(r,t.schema,{noRefs:t.noRefs,skipInvalid:t.skipInvalid});return t.flowLevel>=0&&vhe(n,(i,s)=>{if(!(s.depth<t.flowLevel))return i.style.flow=!0,AB}),t.transform(n),eme(n,{...Ix(t,Object.keys(Kx)),schema:t.schema})}var yt,Rde,Cde,xde,Ode,Pde,Fde,Dde,Lde,Nde,kde,Mde,jde,$de,Ude,Bde,Vde,Gde,lB,zde,Hde,Xde,Qde,Tx,epe,tpe,uB,ipe,spe,cpe,lpe,upe,Ax,ppe,hpe,ype,bpe,_pe,wpe,Epe,vpe,Tpe,Ape,Ipe,nw,Bx,ALe,mu,Vx,Ope,ILe,RLe,Ppe,Bc,br,In,Vc,Ki,Dpe,pB,hB,Bpe,kd,Vpe,qx,wt,_B,Ud,Rx,SB,ZS,Kpe,Ype,wB,Cx,EB,Xpe,Qpe,Jpe,Wx,yhe,YS,lu,Ehe,AB,zx,The,hu,IB,Ahe,Ihe,RB,Px,Rhe,Che,CB,xhe,Fx,Hx,Bm,Ohe,Phe,xB,Fhe,Dx,Lx,Dhe,Nx,Lhe,kx,Wn,Kx,Gm,Um,Yx,Xx,Uc,tme,CLe,xLe,OLe,PLe,FLe,DLe,LLe,NLe,kLe,MLe,jLe,$Le,ULe,BLe,VLe,GLe,Wm=Me(()=>{yt=Symbol("NOT_RESOLVED");a(qn,"defineScalarTag");a(Ux,"defineSequenceTag");a(tw,"defineMappingTag");Rde=qn("tag:yaml.org,2002:str",{resolve:a(r=>r,"resolve"),identify:a(r=>typeof r=="string","identify")}),Cde=["","~","null","Null","NULL"],xde=qn("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:a(r=>Cde.indexOf(r)!==-1?null:yt,"resolve"),identify:a(r=>r===null,"identify"),represent:a(()=>"null","represent")}),Ode=qn("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["n"],resolve:a((r,e)=>r==="null"||e&&r===""?null:yt,"resolve"),identify:a(r=>r===null,"identify"),represent:a(()=>"null","represent")}),Pde=["","~","null","Null","NULL"],Fde=qn("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:a(r=>Pde.indexOf(r)!==-1?null:yt,"resolve"),identify:a(r=>r===null,"identify"),represent:a(()=>"null","represent")}),Dde=["true","True","TRUE"],Lde=["false","False","FALSE"],Nde=qn("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","T","f","F"],resolve:a(r=>Dde.indexOf(r)!==-1?!0:Lde.indexOf(r)!==-1?!1:yt,"resolve"),identify:a(r=>Object.prototype.toString.call(r)==="[object Boolean]","identify"),represent:a(r=>r?"true":"false","represent")}),kde=["true"],Mde=["false"],jde=qn("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","f"],resolve:a(r=>kde.indexOf(r)!==-1?!0:Mde.indexOf(r)!==-1?!1:yt,"resolve"),identify:a(r=>Object.prototype.toString.call(r)==="[object Boolean]","identify"),represent:a(r=>r?"true":"false","represent")}),$de=["true","True","TRUE","y","Y","yes","Yes","YES","on","On","ON"],Ude=["false","False","FALSE","n","N","no","No","NO","off","Off","OFF"],Bde=qn("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["y","Y","n","N","t","T","f","F","o","O"],resolve:a(r=>$de.indexOf(r)!==-1?!0:Ude.indexOf(r)!==-1?!1:yt,"resolve"),identify:a(r=>Object.prototype.toString.call(r)==="[object Boolean]","identify"),represent:a(r=>r?"true":"false","represent")}),Vde=new RegExp("^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$"),Gde=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");a(qde,"parseYamlInteger$2");a(Wde,"resolveYamlInteger$2");lB=qn("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:Wde,identify:a(r=>Number.isInteger(r)&&!Object.is(r,-0)&&r.toString(10).indexOf("e")<0,"identify"),represent:a(r=>r.toString(10),"represent")}),zde=new RegExp("^-?(?:0|[1-9][0-9]*)$"),Hde=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");a(Kde,"parseYamlInteger$1");a(Yde,"resolveYamlInteger$1");Xde=qn("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:Yde,identify:a(r=>Number.isInteger(r)&&!Object.is(r,-0)&&r.toString(10).indexOf("e")<0,"identify"),represent:a(r=>r.toString(10),"represent")}),Qde=new RegExp("^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$");a(Jde,"parseYamlInteger");a(Zde,"resolveYamlInteger");Tx=qn("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:Zde,identify:a(r=>Number.isInteger(r)&&!Object.is(r,-0)&&r.toString(10).indexOf("e")<0,"identify"),represent:a(r=>r.toString(10),"represent")}),epe=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),tpe=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");a(rpe,"resolveYamlFloat$2");a(npe,"representYamlFloat$2");uB=qn("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:rpe,identify:a(r=>typeof r=="number"&&(!Number.isInteger(r)||Object.is(r,-0)||r.toString(10).indexOf("e")>=0),"identify"),represent:npe}),ipe=new RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$"),spe=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");a(ope,"resolveYamlFloat$1");a(ape,"representYamlFloat$1");cpe=qn("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:ope,identify:a(r=>typeof r=="number"&&(!Number.isInteger(r)||Object.is(r,-0)||r.toString(10).indexOf("e")>=0),"identify"),represent:ape}),lpe=new RegExp("^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),upe=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");a(fpe,"resolveYamlFloat");a(dpe,"representYamlFloat");Ax=qn("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:fpe,identify:a(r=>typeof r=="number"&&(!Number.isInteger(r)||Object.is(r,-0)||r.toString(10).indexOf("e")>=0),"identify"),represent:dpe}),ppe=qn("tag:yaml.org,2002:merge",{implicit:!0,implicitFirstChars:["<"],resolve:a((r,e)=>r==="<<"||e&&r===""?"<<":yt,"resolve"),identify:a(()=>!1,"identify")}),hpe=/^[A-Za-z0-9+/]*={0,2}$/;a(mpe,"resolveYamlBinary");a(gpe,"representYamlBinary");ype=qn("tag:yaml.org,2002:binary",{resolve:mpe,identify:a(r=>Object.prototype.toString.call(r)==="[object Uint8Array]","identify"),represent:gpe}),bpe=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),_pe=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");a(W5,"makeUtcDate");a(Spe,"resolveYamlTimestamp");wpe=qn("tag:yaml.org,2002:timestamp",{implicit:!0,implicitFirstChars:[..."0123456789"],resolve:Spe,identify:a(r=>r instanceof Date,"identify"),represent:a(r=>r.toISOString(),"represent")}),Epe=Ux("tag:yaml.org,2002:seq",{create:a(()=>[],"create"),addItem:a((r,e)=>{r.push(e)},"addItem"),identify:Array.isArray});a(rw,"isPlainObject");a(Ix,"pick");vpe=Ux("tag:yaml.org,2002:omap",{create:a(()=>({list:[],seen:new Set}),"create"),addItem:a((r,e)=>{let t;if(e instanceof Map){if(e.size!==1)return"cannot resolve an ordered map item";t=e.keys().next().value}else if(rw(e)){let n=Object.keys(e);if(n.length!==1)return"cannot resolve an ordered map item";t=n[0]}else return"cannot resolve an ordered map item";return r.seen.has(t)?"duplicate key in ordered map":(r.seen.add(t),r.list.push(e),"")},"addItem"),finalize:a(r=>r.list,"finalize"),identify:a(()=>!1,"identify")}),Tpe=Ux("tag:yaml.org,2002:pairs",{create:a(()=>[],"create"),addItem:a((r,e)=>{if(e instanceof Map)return e.size!==1?"cannot resolve a pairs item":(r.push(e.entries().next().value),"");if(Object.prototype.toString.call(e)!=="[object Object]")return"cannot resolve a pairs item";let t=e,n=Object.keys(t);return n.length!==1?"cannot resolve a pairs item":(r.push([n[0],t[n[0]]]),"")},"addItem"),identify:a(()=>!1,"identify")}),Ape=tw("tag:yaml.org,2002:map",{create:a(()=>({}),"create"),identify:rw,represent:a(r=>{let e=new Map;for(let t of Object.keys(r))e.set(t,r[t]);return e},"represent"),addPair:a((r,e,t)=>{if(e!==null&&typeof e=="object")return"object-based map does not support complex keys";let n=String(e);return n==="__proto__"?Object.defineProperty(r,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[n]=t,""},"addPair"),has:a((r,e)=>e!==null&&typeof e=="object"?!1:Object.prototype.hasOwnProperty.call(r,String(e)),"has"),keys:a(r=>Object.keys(r),"keys"),get:a((r,e)=>{let t=String(e);return Object.prototype.hasOwnProperty.call(r,t)?r[t]:null},"get")}),Ipe=tw("tag:yaml.org,2002:set",{create:a(()=>new Set,"create"),identify:a(r=>r instanceof Set,"identify"),represent:a(r=>{let e=new Map;for(let t of r)e.set(t,null);return e},"represent"),addPair:a((r,e,t)=>t!==null?"cannot resolve a set item":(r.add(e),""),"addPair"),has:a((r,e)=>r.has(e),"has"),keys:a(r=>r.keys(),"keys"),get:a(()=>null,"get")});a(Rpe,"createTagDefinitionMap");a(Cpe,"createTagDefinitionListMap");a(xpe,"compileTags");nw=class fB{static{a(this,"Schema")}tags;implicitScalarTags;implicitScalarByFirstChar;implicitScalarAnyFirstChar;defaultScalarTag;defaultSequenceTag;defaultMappingTag;exact;prefix;constructor(e){let t=xpe(e),n=[],i=Rpe(),s=Cpe();for(let f of t){if(f.nodeKind==="scalar"&&f.implicit){if(f.matchByTagPrefix)throw new Error("Implicit scalar tags cannot match by tag prefix");n.push(f)}switch(f.nodeKind){case"scalar":f.matchByTagPrefix?s.scalar.push(f):i.scalar[f.tagName]=f;break;case"sequence":f.matchByTagPrefix?s.sequence.push(f):i.sequence[f.tagName]=f;break;case"mapping":f.matchByTagPrefix?s.mapping.push(f):i.mapping[f.tagName]=f;break}}let o=n.filter(f=>f.implicitFirstChars===null),c=new Set;for(let f of n)if(f.implicitFirstChars!==null)for(let d of f.implicitFirstChars)c.add(d);let l=new Map;for(let f of c)l.set(f,n.filter(d=>d.implicitFirstChars===null||d.implicitFirstChars.indexOf(f)!==-1));let u=i.scalar["tag:yaml.org,2002:str"];if(!u)throw new Error("schema does not define the default scalar tag (tag:yaml.org,2002:str)");this.tags=t,this.implicitScalarTags=n,this.implicitScalarByFirstChar=l,this.implicitScalarAnyFirstChar=o,this.defaultScalarTag=u,this.defaultSequenceTag=i.sequence["tag:yaml.org,2002:seq"],this.defaultMappingTag=i.mapping["tag:yaml.org,2002:map"],this.exact=i,this.prefix=s}lookupScalarTag(e){let t=this.exact.scalar[e];if(t)return t;for(let n of this.prefix.scalar)if(e.startsWith(n.tagName))return n}lookupSequenceTag(e){let t=this.exact.sequence[e];if(t)return t;for(let n of this.prefix.sequence)if(e.startsWith(n.tagName))return n}lookupMappingTag(e){let t=this.exact.mapping[e];if(t)return t;for(let n of this.prefix.mapping)if(e.startsWith(n.tagName))return n}resolveImplicitScalarTag(e){let t=this.implicitScalarByFirstChar.get(e.charAt(0))??this.implicitScalarAnyFirstChar;for(let i of t){let s=i.resolve(e,!1,i.tagName);if(s!==yt)return{value:s,tag:i}}let n=this.defaultScalarTag;return{value:n.resolve(e,!1,n.tagName),tag:n}}withTags(...e){let t=[];for(let n of e)t=t.concat(n);return new fB([...this.tags,...t])}},Bx=new nw([Rde,Epe,Ape]),ALe=new nw([...Bx.tags,Ode,jde,Xde,cpe]),mu=new nw([...Bx.tags,xde,Nde,lB,uB]),Vx=new nw([...Bx.tags,Fde,Bde,Tx,Ax,wpe,ppe,ype,vpe,Tpe,Ipe]),Ope=Vx.withTags({...Tx,resolve:a((r,e,t)=>{let n=Tx.resolve(r,e,t);return n===yt?lB.resolve(r,e,t):n},"resolve")},{...Ax,resolve:a((r,e,t)=>{let n=Ax.resolve(r,e,t);return n===yt?uB.resolve(r,e,t):n},"resolve")}),ILe=tw("tag:yaml.org,2002:map",{create:a(()=>new Map,"create"),addPair:a((r,e,t)=>(r.set(e,t),""),"addPair"),has:a((r,e)=>r.has(e),"has"),keys:a(r=>r.keys(),"keys"),get:a((r,e)=>r.get(e),"get"),identify:a(r=>r instanceof Map||rw(r),"identify"),represent:a(r=>{if(r instanceof Map)return r;let e=new Map,t=r;for(let n of Object.keys(t))e.set(n,t[n]);return e},"represent")});a(z5,"normalizeKey");RLe=tw("tag:yaml.org,2002:map",{create:a(()=>({}),"create"),identify:rw,represent:a(r=>{let e=new Map;for(let t of Object.keys(r))e.set(t,r[t]);return e},"represent"),addPair:a((r,e,t)=>{let n=z5(e);return n===null?"nested arrays are not supported inside keys":(n==="__proto__"?Object.defineProperty(r,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[n]=t,"")},"addPair"),has:a((r,e)=>{let t=z5(e);return t!==null&&Object.prototype.hasOwnProperty.call(r,t)},"has"),keys:a(r=>Object.keys(r),"keys"),get:a((r,e)=>{let t=String(e);return Object.prototype.hasOwnProperty.call(r,t)?r[t]:null},"get")}),Ppe={maxLength:79,indent:1,linesBefore:3,linesAfter:2};a(bx,"getLine");a(_x,"padStart");a(Fpe,"makeSnippet");a(H5,"formatError");Bc=class dB extends Error{static{a(this,"YAMLException")}reason;mark;constructor(e,t){super(),this.name="YAMLException",this.reason=e,this.mark=t,this.message=H5(this,!1),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toString(e){return`${this.name}: ${H5(this,e)}`}static throwAt(e,t,n,i=""){let s=0,o=0;for(let l=0;l<t;l++){let u=e.charCodeAt(l);u===10?(s++,o=l+1):u===13&&(s++,e.charCodeAt(l+1)===10&&l++,o=l+1)}let c={name:i,buffer:e,position:t,line:s,column:t-o};throw c.snippet=Fpe(c),new dB(n,c)}},br={DOCUMENT:1,SEQUENCE:2,MAPPING:3,SCALAR:4,ALIAS:5,POP:6},In={PLAIN:1,SINGLE_QUOTED:2,DOUBLE_QUOTED:3,LITERAL_BLOCK:4,FOLDED_BLOCK:5},Vc={BLOCK:1,FLOW:2},Ki={CLIP:1,STRIP:2,KEEP:3},Dpe=-1;a(K5,"simpleEscapeSequence");pB=new Array(256),hB=new Array(256);for(let r=0;r<256;r++)pB[r]=K5(r)?1:0,hB[r]=K5(r);a(Lpe,"charFromCodepoint");a(Npe,"fromHexCode$1");a(kpe,"escapedHexLen$1");a(JS,"skipFoldedBreaks");a(Gx,"foldedBreaks");a(Mpe,"getPlainValue");a(jpe,"getSingleQuotedValue");a($pe,"getDoubleQuotedValue");a(Y5,"getBlockValue");a(Upe,"getScalarValue");Bpe=Object.assign(Object.create(null),{"!":"!","!!":"tag:yaml.org,2002:"});a(Sx,"tagPercentEncode");a(mB,"tagNameFull");a(gB,"tagNameShort");kd=-1,Vpe="tag:yaml.org,2002:merge",qx={filename:"",schema:mu,json:!1,maxTotalMergeKeys:1e4,maxAliases:-1};a(Gpe,"eventPosition$1");a(Gn,"throwError$1");a(yB,"finalizeCollection");a(qpe,"constructScalar");a(X5,"collectionTagName");a(bB,"isMappingTag");a(Q5,"mergeKeys");a(Wpe,"mergeSource");a(zpe,"addMappingValue");a(wx,"addValue");a(Ex,"storeAnchor");a(Hpe,"constructFromEvents");wt=-1,_B=Object.prototype.hasOwnProperty,Ud=1,Rx=2,SB=3,ZS=4,Kpe=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Ype=/[,\[\]{}]/,wB=/^(?:!|!!|![0-9A-Za-z-]+!)$/,Cx=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`,EB=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`,Xpe=new RegExp(`^(?:${Cx})*$`),Qpe=new RegExp(`^(?:${EB})+$`),Jpe=new RegExp(`^(?:!(?:${Cx})*|${EB}(?:${Cx})*)$`),Wx={filename:"",maxDepth:100};a(Zpe,"addDocumentEvent");a(vB,"addSequenceEvent");a(xx,"addMappingEvent");a(J5,"insertFlowPairMappingEvent");a(Vd,"addScalarEvent");a(ehe,"addAliasEvent");a(Md,"addPopEvent");a(di,"addEmptyScalarEvent");a(Z5,"emptyProperties");a($m,"snapshotState");a(jd,"restoreState");a(Ue,"throwError");a(rn,"isEol");a(du,"isWhiteSpace");a(Ws,"isWsOrEol");a(Ba,"isWsOrEolOrEnd");a(pu,"isFlowIndicator");a(the,"fromDecimalCode");a(rhe,"fromHexCode");a(nhe,"escapedHexLen");a(ihe,"isSimpleEscape");a(ew,"consumeLineBreak");a(pi,"skipSeparationSpace");a(uu,"testDocumentSeparator");a(eB,"skipUntilLineEnd");a(TB,"checkPrintable");a(she,"readTagProperty");a(ohe,"readAnchorProperty");a(ahe,"readAlias");a(Ox,"readFlowScalarBreak");a(che,"readSingleQuotedScalar");a(lhe,"readDoubleQuotedScalar");a(uhe,"readBlockScalar");a(fhe,"canStartPlainScalar");a(dhe,"readPlainScalar");a(Mm,"skipFlowSeparationSpace");a(phe,"readFlowCollection");a(tB,"readBlockSequence");a(vx,"readBlockMapping");a(fu,"parseNode");a(hhe,"readDirective");a(mhe,"readDocument");a(ghe,"parseEvents");yhe={...Wx,...qx};a(bhe,"loadDocuments");a(Gd,"load");YS=class{static{a(this,"Style")}tagged=!1;flow=!1;singleQuoted=!1;doubleQuoted=!1;literal=!1;folded=!1},lu=Symbol("INVALID");a(_he,"buildRepresentTypes");a(She,"matchTag");a(jm,"build");a(whe,"jsToAst");Ehe=Symbol("visit:break"),AB=Symbol("visit:skip");a(QS,"visitNode");a(vhe,"visit");zx=65279,The=9,hu=10,IB=13,Ahe=32,Ihe=33,RB=34,Px=35,Rhe=37,Che=38,CB=39,xhe=42,Fx=44,Hx=45,Bm=58,Ohe=61,Phe=62,xB=63,Fhe=64,Dx=91,Lx=93,Dhe=96,Nx=123,Lhe=124,kx=125,Wn={};Wn[0]="\\0";Wn[7]="\\a";Wn[8]="\\b";Wn[9]="\\t";Wn[10]="\\n";Wn[11]="\\v";Wn[12]="\\f";Wn[13]="\\r";Wn[27]="\\e";Wn[34]='\\"';Wn[92]="\\\\";Wn[133]="\\N";Wn[160]="\\_";Wn[8232]="\\L";Wn[8233]="\\P";Kx={indent:2,seqNoIndent:!1,seqInlineFirst:!0,sortKeys:!1,lineWidth:80,flowBracketPadding:!1,flowSkipCommaSpace:!1,flowSkipColonSpace:!1,quoteFlowKeys:!1,quoteStyle:"single",forceQuotes:!1,tagBeforeAnchor:!1};a(Nhe,"nodeTagShort");a(khe,"createPresenterState");a(Mhe,"encodeNonPrintable");a(rB,"indentString");a(Mx,"generateNextLine");a(jhe,"scalarLayout");a(Bd,"isWhitespace");a($he,"startsWithDocumentSeparator");a(Vm,"isPrintable");a(nB,"isNsCharOrWhitespace");a(jx,"isPlainSafe");a(Uhe,"isPlainSafeFirst");a(Bhe,"isPlainSafeAtStart");a(Vhe,"isPlainSafeLast");a($d,"codePointAt");a(OB,"needIndentIndicator");Gm=1,Um=2,Yx=3,Xx=4,Uc=5;a(Ghe,"chooseScalarStyle");a(qhe,"renderScalarStyle");a(Whe,"resolveScalarStyle");a(iB,"blockHeader");a(sB,"encodeFlowBreaks");a(oB,"dropEndingNewline");a(qm,"isMoreIndented");a(zhe,"foldBlockScalar");a(aB,"foldLine");a(Hhe,"escapeString");a(Khe,"writeFlowSequence");a(cB,"writeBlockSequence");a(Yhe,"writeFlowMapping");a(XS,"sortKeyValue");a(PB,"sortMappingItems");a(Xhe,"writeBlockMapping");a($x,"cannotBeCompact");a(Va,"writeNode");a(Qhe,"rootStartsOwnLine");a(Jhe,"isOpenEnded");a(Zhe,"writeDocumentDirectives");a(eme,"present");tme={...Kx,schema:Ope,skipInvalid:!1,noRefs:!1,flowLevel:-1,transform:a(()=>{},"transform")};a(qd,"dump");CLe=br.DOCUMENT,xLe=br.SEQUENCE,OLe=br.MAPPING,PLe=br.SCALAR,FLe=br.ALIAS,DLe=br.POP,LLe=In.PLAIN,NLe=In.SINGLE_QUOTED,kLe=In.DOUBLE_QUOTED,MLe=In.LITERAL_BLOCK,jLe=In.FOLDED_BLOCK,$Le=Vc.BLOCK,ULe=Vc.FLOW,BLe=Ki.CLIP,VLe=Ki.STRIP,GLe=Ki.KEEP});var Qx,FB,rme,DB=Me(()=>{Qx=a((r,e,t)=>{let n=r instanceof RegExp?FB(r,t):r,i=e instanceof RegExp?FB(e,t):e,s=n!==null&&i!=null&&rme(n,i,t);return s&&{start:s[0],end:s[1],pre:t.slice(0,s[0]),body:t.slice(s[0]+n.length,s[1]),post:t.slice(s[1]+i.length)}},"balanced"),FB=a((r,e)=>{let t=e.match(r);return t?t[0]:null},"maybeMatch"),rme=a((r,e,t)=>{let n,i,s,o,c,l=t.indexOf(r),u=t.indexOf(e,l+1),f=l;if(l>=0&&u>0){if(r===e)return[l,u];for(n=[],s=t.length;f>=0&&!c;){if(f===l)n.push(f),l=t.indexOf(r,f+1);else if(n.length===1){let d=n.pop();d!==void 0&&(c=[d,u])}else i=n.pop(),i!==void 0&&i<s&&(s=i,o=u),u=t.indexOf(e,f+1);f=l<u&&l>=0?l:u}n.length&&o!==void 0&&(c=[s,o])}return c},"range")});function Jx(r){return isNaN(r)?r.charCodeAt(0):parseInt(r,10)}function mme(r){return r.replace(cme,LB).replace(lme,NB).replace(ume,eO).replace(fme,kB).replace(dme,MB)}function gme(r){return r.replace(nme,"\\").replace(ime,"{").replace(sme,"}").replace(ome,",").replace(ame,".")}function jB(r){if(!r)return[""];let e=[],t=Qx("{","}",r);if(!t)return r.split(",");let{pre:n,body:i,post:s}=t,o=n.split(",");o[o.length-1]+="{"+i+"}";let c=jB(s);return s.length&&(o[o.length-1]+=c.shift(),o.push.apply(o,c)),e.push.apply(e,o),e}function $B(r,e={}){if(!r)return[];let{max:t=pme,maxLength:n=hme}=e;return r.slice(0,2)==="{}"&&(r="\\{\\}"+r.slice(2)),Zx(mme(r),t,n,!0).map(gme)}function yme(r){return"{"+r+"}"}function bme(r){return/^-?0\d/.test(r)}function _me(r,e){return r<=e}function Sme(r,e){return r>=e}function zm(r,e,t,n,i,s){let o=[],c=0;for(let l=0;l<r.length;l++)for(let u=0;u<t.length;u++){if(o.length>=n)return o;let f=r[l]+e+t[u];if(!(s&&!f)){if(c+f.length>i)return o;o.push(f),c+=f.length}}return o}function wme(r,e,t,n){let i=r.split(/\.\./),s=[];if(i[0]===void 0||i[1]===void 0)return s;let o=Jx(i[0]),c=Jx(i[1]),l=Math.max(i[0].length,i[1].length),u=i.length===3&&i[2]!==void 0?Math.max(Math.abs(Jx(i[2])),1):1,f=_me;c<o&&(u*=-1,f=Sme);let p=i.some(bme),h=0;for(let g=o;f(g,c)&&s.length<t;g+=u){let m;if(e)m=String.fromCharCode(g),m==="\\"&&(m="");else if(m=String(g),p){let b=l-m.length;if(b>0){let _=new Array(b+1).join("0");g<0?m="-"+_+m.slice(1):m=_+m}}if(h+m.length>n)break;s.push(m),h+=m.length}return s}function Zx(r,e,t,n){let i=[""],s=!1,o=!0;for(;;){let c=Qx("{","}",r);if(!c)return zm(i,r,[""],e,t,s);let l=c.pre;if(/\$$/.test(l)){if(i=zm(i,l+"{"+c.body+"}",[""],e,t,s&&!c.post.length),o=!1,!c.post.length)break;r=c.post;continue}let u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(c.body),f=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(c.body),d=u||f,p=c.body.indexOf(",")>=0;if(!d&&!p){if(c.post.match(/,(?!,).*\}/)){r=c.pre+"{"+c.body+eO+c.post,n=!0;continue}return zm(i,l+"{"+c.body+"}"+c.post,[""],e,t,s)}o&&(s=n&&!d,o=!1);let h;if(d)h=wme(c.body,f,e,t);else{let g=jB(c.body);if(g.length===1&&g[0]!==void 0&&(g=Zx(g[0],e,t,!1).map(yme),g.length===1)){if(i=zm(i,l+g[0],[""],e,t,s&&!c.post.length),!c.post.length)break;r=c.post;continue}let m=s&&!c.post.length&&!l;for(let _=0;m&&_<i.length;_++)i[_]&&(m=!1);h=[];let b=0;e:for(let _=0;_<g.length;_++){let S=Zx(g[_],e,t,!1);for(let I=0;I<S.length;I++){let E=S[I];if(!(m&&!E)){if(h.length>=e||b+E.length>t)break e;h.push(E),b+=E.length}}}}if(i=zm(i,l,h,e,t,s&&!c.post.length),!c.post.length)break;r=c.post}return i}var LB,NB,eO,kB,MB,nme,ime,sme,ome,ame,cme,lme,ume,fme,dme,pme,hme,UB=Me(()=>{DB();LB="\0SLASH"+Math.random()+"\0",NB="\0OPEN"+Math.random()+"\0",eO="\0CLOSE"+Math.random()+"\0",kB="\0COMMA"+Math.random()+"\0",MB="\0PERIOD"+Math.random()+"\0",nme=new RegExp(LB,"g"),ime=new RegExp(NB,"g"),sme=new RegExp(eO,"g"),ome=new RegExp(kB,"g"),ame=new RegExp(MB,"g"),cme=/\\\\/g,lme=/\\{/g,ume=/\\}/g,fme=/\\,/g,dme=/\\\./g,pme=1e5,hme=4e6;a(Jx,"numeric");a(mme,"escapeBraces");a(gme,"unescapeBraces");a(jB,"parseCommaParts");a($B,"expand");a(yme,"embrace");a(bme,"isPadded");a(_me,"lte");a(Sme,"gte");a(zm,"combine");a(wme,"expandSequence");a(Zx,"expand_")});var Hm,BB=Me(()=>{Hm=a(r=>{if(typeof r!="string")throw new TypeError("invalid pattern");if(r.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern")});var Eme,Km,vme,VB,GB,qB=Me(()=>{Eme={"[: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]},Km=a(r=>r.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),vme=a(r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),VB=a(r=>r.join(""),"rangesToString"),GB=a((r,e)=>{let t=e;if(r.charAt(t)!=="[")throw new Error("not in a brace expression");let n=[],i=[],s=t+1,o=!1,c=!1,l=!1,u=!1,f=t,d="";e:for(;s<r.length;){let m=r.charAt(s);if((m==="!"||m==="^")&&s===t+1){u=!0,s++;continue}if(m==="]"&&o&&!l){f=s+1;break}if(o=!0,m==="\\"&&!l){l=!0,s++;continue}if(m==="["&&!l){for(let[b,[_,S,I]]of Object.entries(Eme))if(r.startsWith(b,s)){if(d)return["$.",!1,r.length-t,!0];s+=b.length,I?i.push(_):n.push(_),c=c||S;continue e}}if(l=!1,d){m>d?n.push(Km(d)+"-"+Km(m)):m===d&&n.push(Km(m)),d="",s++;continue}if(r.startsWith("-]",s+1)){n.push(Km(m+"-")),s+=2;continue}if(r.startsWith("-",s+1)){d=m,s+=2;continue}n.push(Km(m)),s++}if(f<s)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,r.length-t,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!u){let m=n[0].length===2?n[0].slice(-1):n[0];return[vme(m),!1,f-t,!1]}let p="["+(u?"^":"")+VB(n)+"]",h="["+(u?"":"^")+VB(i)+"]";return[n.length&&i.length?"("+p+"|"+h+")":n.length?p:h,c,f-t,!0]},"parseClass")});var zs,sw=Me(()=>{zs=a((r,{windowsPathsNoEscape:e=!1,magicalBraces:t=!0}={})=>t?e?r.replace(/\[([^/\\])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):e?r.replace(/\[([^/\\{}])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),"unescape")});var Mi,Tme,tO,WB,Ame,Ime,Rme,zB,Cme,ow,xme,Ome,Pme,Fme,rO,HB,KB,Dme,gu,nO=Me(()=>{qB();sw();Tme=new Set(["!","?","+","*","@"]),tO=a(r=>Tme.has(r),"isExtglobType"),WB=a(r=>tO(r.type),"isExtglobAST"),Ame=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),Ime=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),Rme=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),zB=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),Cme="(?!(?:^|/)\\.\\.?(?:$|/))",ow="(?!\\.)",xme=new Set(["[","."]),Ome=new Set(["..","."]),Pme=new Set("().*{}+?[]^$\\!"),Fme=a(r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),rO="[^/]",HB=rO+"*?",KB=rO+"+?",Dme=0,gu=class{static{a(this,"AST")}type;#t;#r;#n=!1;#e=[];#i;#a;#p;#u=!1;#c;#f;#l=!1;id=++Dme;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#t.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#e.length,parts:this.#e}}constructor(e,t,n={}){this.type=e,e&&(this.#r=!0),this.#i=t,this.#t=this.#i?this.#i.#t:this,this.#c=this.#t===this?n:this.#t.#c,this.#p=this.#t===this?[]:this.#t.#p,e==="!"&&!this.#t.#u&&this.#p.push(this),this.#a=this.#i?this.#i.#e.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let e of this.#e)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#f!==void 0?this.#f:this.type?this.#f=this.type+"("+this.#e.map(e=>String(e)).join("|")+")":this.#f=this.#e.map(e=>String(e)).join("")}#d(){if(this!==this.#t)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let e;for(;e=this.#p.pop();){if(e.type!=="!")continue;let t=e,n=t.#i;for(;n;){for(let i=t.#a+1;!n.type&&i<n.#e.length;i++)for(let s of e.#e){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(n.#e[i])}t=n,n=t.#i}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof Mi&&t.#i===this))throw new Error("invalid part: "+t);this.#e.push(t)}}toJSON(){let e=this.type===null?this.#e.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#e.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#u&&this.#i?.type==="!")&&e.push({}),e}isStart(){if(this.#t===this)return!0;if(!this.#i?.isStart())return!1;if(this.#a===0)return!0;let e=this.#i;for(let t=0;t<this.#a;t++){let n=e.#e[t];if(!(n instanceof Mi&&n.type==="!"))return!1}return!0}isEnd(){if(this.#t===this||this.#i?.type==="!")return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let e=this.#i?this.#i.#e.length:0;return this.#a===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new Mi(this.type,e);for(let n of this.#e)t.copyIn(n);return t}static#o(e,t,n,i,s){let o=i.maxExtglobRecursion??2,c=!1,l=!1,u=-1,f=!1;if(t.type===null){let m=n,b="";for(;m<e.length;){let _=e.charAt(m++);if(c||_==="\\"){c=!c,b+=_;continue}if(l){m===u+1?(_==="^"||_==="!")&&(f=!0):_==="]"&&!(m===u+2&&f)&&(l=!1),b+=_;continue}else if(_==="["){l=!0,u=m,f=!1,b+=_;continue}if(!i.noext&&tO(_)&&e.charAt(m)==="("&&s<=o){t.push(b),b="";let I=new Mi(_,t);m=Mi.#o(e,I,m,i,s+1),t.push(I);continue}b+=_}return t.push(b),m}let d=n+1,p=new Mi(null,t),h=[],g="";for(;d<e.length;){let m=e.charAt(d++);if(c||m==="\\"){c=!c,g+=m;continue}if(l){d===u+1?(m==="^"||m==="!")&&(f=!0):m==="]"&&!(d===u+2&&f)&&(l=!1),g+=m;continue}else if(m==="["){l=!0,u=d,f=!1,g+=m;continue}if(!i.noext&&tO(m)&&e.charAt(d)==="("&&(s<=o||t&&t.#_(m))){let _=t&&t.#_(m)?0:1;p.push(g),g="";let S=new Mi(m,p);p.push(S),d=Mi.#o(e,S,d,i,s+_);continue}if(m==="|"){p.push(g),g="",h.push(p),p=new Mi(null,t);continue}if(m===")")return g===""&&t.#e.length===0&&(t.#l=!0),p.push(g),g="",t.push(...h,p),d;g+=m}return t.type=null,t.#r=void 0,t.#e=[e.substring(n-1)],d}#g(e){return this.#E(e,Ime)}#E(e,t=Ame){if(!e||typeof e!="object"||e.type!==null||e.#e.length!==1||this.type===null)return!1;let n=e.#e[0];return!n||typeof n!="object"||n.type===null?!1:this.#_(n.type,t)}#_(e,t=Rme){return!!t.get(this.type)?.includes(e)}#S(e,t){let n=e.#e[0],i=new Mi(null,n,this.options);i.#e.push(""),n.push(i),this.#A(e,t)}#A(e,t){let n=e.#e[0];this.#e.splice(t,1,...n.#e);for(let i of n.#e)typeof i=="object"&&(i.#i=this);this.#f=void 0}#y(e){return!!zB.get(this.type)?.has(e)}#v(e){if(!e||typeof e!="object"||e.type!==null||e.#e.length!==1||this.type===null||this.#e.length!==1)return!1;let t=e.#e[0];return!t||typeof t!="object"||t.type===null?!1:this.#y(t.type)}#T(e){let t=zB.get(this.type),n=e.#e[0],i=t?.get(n.type);if(!i)return!1;this.#e=n.#e;for(let s of this.#e)typeof s=="object"&&(s.#i=this);this.type=i,this.#f=void 0,this.#l=!1}static fromGlob(e,t={}){let n=new Mi(null,void 0,t);return Mi.#o(e,n,0,t,0),n}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();let e=this.toString(),[t,n,i,s]=this.toRegExpSource();if(!(i||this.#r||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let c=(this.#c.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${t}$`,c),{_src:t,_glob:e})}get options(){return this.#c}toRegExpSource(e){let t=e??!!this.#c.dot;if(this.#t===this&&(this.#m(),this.#d()),!WB(this)){let l=this.isStart()&&this.isEnd()&&!this.#e.some(h=>typeof h!="string"),u=this.#e.map(h=>{let[g,m,b,_]=typeof h=="string"?Mi.#w(h,this.#r,l):h.toRegExpSource(e);return this.#r=this.#r||b,this.#n=this.#n||_,g}).join(""),f="";if(this.isStart()&&typeof this.#e[0]=="string"&&!(this.#e.length===1&&Ome.has(this.#e[0]))){let g=xme,m=t&&g.has(u.charAt(0))||u.startsWith("\\.")&&g.has(u.charAt(2))||u.startsWith("\\.\\.")&&g.has(u.charAt(4)),b=!t&&!e&&g.has(u.charAt(0));f=m?Cme:b?ow:""}let d="";return this.isEnd()&&this.#t.#u&&this.#i?.type==="!"&&(d="(?:$|\\/)"),[f+u+d,zs(u),this.#r=!!this.#r,this.#n]}let n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#b(t);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let l=this.toString(),u=this;return u.#e=[l],u.type=null,u.#r=void 0,[l,zs(this.toString()),!1,!1]}let o=!n||e||t||!ow?"":this.#b(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let c="";if(this.type==="!"&&this.#l)c=(this.isStart()&&!t?ow:"")+KB;else{let l=this.type==="!"?"))"+(this.isStart()&&!t&&!e?ow:"")+HB+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;c=i+s+l}return[c,zs(s),this.#r=!!this.#r,this.#n]}#m(){if(WB(this)){let e=0,t=!1;do{t=!0;for(let n=0;n<this.#e.length;n++){let i=this.#e[n];typeof i=="object"&&(i.#m(),this.#E(i)?(t=!1,this.#A(i,n)):this.#g(i)?(t=!1,this.#S(i,n)):this.#v(i)&&(t=!1,this.#T(i)))}}while(!t&&++e<10)}else for(let e of this.#e)typeof e=="object"&&e.#m();this.#f=void 0}#b(e){return this.#e.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[n,i,s,o]=t.toRegExpSource(e);return this.#n=this.#n||o,n}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#w(e,t,n=!1){let i=!1,s="",o=!1,c=!1;for(let l=0;l<e.length;l++){let u=e.charAt(l);if(i){i=!1,s+=(Pme.has(u)?"\\":"")+u;continue}if(u==="*"){if(c)continue;c=!0,s+=n&&/^[*]+$/.test(e)?KB:HB,t=!0;continue}else c=!1;if(u==="\\"){l===e.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[f,d,p,h]=GB(e,l);if(p){s+=f,o=o||d,l+=p-1,t=t||h;continue}}if(u==="?"){s+=rO,t=!0;continue}s+=Fme(u)}return[s,zs(e),!!t,o]}};Mi=gu});var Wd,iO=Me(()=>{Wd=a((r,{windowsPathsNoEscape:e=!1,magicalBraces:t=!1}={})=>t?e?r.replace(/[?*()[\]{}]/g,"[$&]"):r.replace(/[?*()[\]\\{}]/g,"\\$&"):e?r.replace(/[?*()[\]]/g,"[$&]"):r.replace(/[?*()[\]\\]/g,"\\$&"),"escape")});var hi,Lme,Nme,kme,Mme,jme,$me,Ume,Bme,Vme,Gme,qme,Wme,zme,Hme,Kme,Yme,Xme,Qme,QB,JB,ZB,YB,Jme,vr,Zme,ege,tge,rge,nge,us,ige,e6,sge,oge,XB,age,Yi,Gc=Me(()=>{UB();BB();nO();iO();sw();nO();iO();sw();hi=a((r,e,t={})=>(Hm(e),!t.nocomment&&e.charAt(0)==="#"?!1:new Yi(e,t).match(r)),"minimatch"),Lme=/^\*+([^+@!?*[(]*)$/,Nme=a(r=>e=>!e.startsWith(".")&&e.endsWith(r),"starDotExtTest"),kme=a(r=>e=>e.endsWith(r),"starDotExtTestDot"),Mme=a(r=>(r=r.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(r)),"starDotExtTestNocase"),jme=a(r=>(r=r.toLowerCase(),e=>e.toLowerCase().endsWith(r)),"starDotExtTestNocaseDot"),$me=/^\*+\.\*+$/,Ume=a(r=>!r.startsWith(".")&&r.includes("."),"starDotStarTest"),Bme=a(r=>r!=="."&&r!==".."&&r.includes("."),"starDotStarTestDot"),Vme=/^\.\*+$/,Gme=a(r=>r!=="."&&r!==".."&&r.startsWith("."),"dotStarTest"),qme=/^\*+$/,Wme=a(r=>r.length!==0&&!r.startsWith("."),"starTest"),zme=a(r=>r.length!==0&&r!=="."&&r!=="..","starTestDot"),Hme=/^\?+([^+@!?*[(]*)?$/,Kme=a(([r,e=""])=>{let t=QB([r]);return e?(e=e.toLowerCase(),n=>t(n)&&n.toLowerCase().endsWith(e)):t},"qmarksTestNocase"),Yme=a(([r,e=""])=>{let t=JB([r]);return e?(e=e.toLowerCase(),n=>t(n)&&n.toLowerCase().endsWith(e)):t},"qmarksTestNocaseDot"),Xme=a(([r,e=""])=>{let t=JB([r]);return e?n=>t(n)&&n.endsWith(e):t},"qmarksTestDot"),Qme=a(([r,e=""])=>{let t=QB([r]);return e?n=>t(n)&&n.endsWith(e):t},"qmarksTest"),QB=a(([r])=>{let e=r.length;return t=>t.length===e&&!t.startsWith(".")},"qmarksTestNoExt"),JB=a(([r])=>{let e=r.length;return t=>t.length===e&&t!=="."&&t!==".."},"qmarksTestNoExtDot"),ZB=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",YB={win32:{sep:"\\"},posix:{sep:"/"}},Jme=ZB==="win32"?YB.win32.sep:YB.posix.sep;hi.sep=Jme;vr=Symbol("globstar **");hi.GLOBSTAR=vr;Zme="[^/]",ege=Zme+"*?",tge="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",rge="(?:(?!(?:\\/|^)\\.).)*?",nge=a((r,e={})=>t=>hi(t,r,e),"filter");hi.filter=nge;us=a((r,e={})=>Object.assign({},r,e),"ext"),ige=a(r=>{if(!r||typeof r!="object"||!Object.keys(r).length)return hi;let e=hi;return Object.assign(a((n,i,s={})=>e(n,i,us(r,s)),"m"),{Minimatch:class extends e.Minimatch{static{a(this,"Minimatch")}constructor(i,s={}){super(i,us(r,s))}static defaults(i){return e.defaults(us(r,i)).Minimatch}},AST:class extends e.AST{static{a(this,"AST")}constructor(i,s,o={}){super(i,s,us(r,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,us(r,s))}},unescape:a((n,i={})=>e.unescape(n,us(r,i)),"unescape"),escape:a((n,i={})=>e.escape(n,us(r,i)),"escape"),filter:a((n,i={})=>e.filter(n,us(r,i)),"filter"),defaults:a(n=>e.defaults(us(r,n)),"defaults"),makeRe:a((n,i={})=>e.makeRe(n,us(r,i)),"makeRe"),braceExpand:a((n,i={})=>e.braceExpand(n,us(r,i)),"braceExpand"),match:a((n,i,s={})=>e.match(n,i,us(r,s)),"match"),sep:e.sep,GLOBSTAR:vr})},"defaults");hi.defaults=ige;e6=a((r,e={})=>(Hm(r),e.nobrace||!/\{(?:(?!\{).)*\}/.test(r)?[r]:$B(r,{max:e.braceExpandMax})),"braceExpand");hi.braceExpand=e6;sge=a((r,e={})=>new Yi(r,e).makeRe(),"makeRe");hi.makeRe=sge;oge=a((r,e,t={})=>{let n=new Yi(e,t);return r=r.filter(i=>n.match(i)),n.options.nonull&&!r.length&&r.push(e),r},"match");hi.match=oge;XB=/[?*]|[+@!]\(.*?\)|\[|\]/,age=a(r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Yi=class{static{a(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){Hm(e),t=t||{},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||ZB,this.isWindows=this.platform==="win32";let n="allowWindowsEscape";this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t[n]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,o,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let l=s[0]===""&&s[1]===""&&(s[2]==="?"||!XB.test(s[2]))&&!XB.test(s[3]),u=/^[a-z]:/i.test(s[0]);if(l)return[...s.slice(0,4),...s.slice(4).map(f=>this.parse(f))];if(u)return[s[0],...s.slice(1).map(f=>this.parse(f))]}return s.map(l=>this.parse(l))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let n of e)for(let i=0;i<n.length;i++)n[i]==="**"&&(n[i]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let n=-1;for(;(n=t.indexOf("**",n+1))!==-1;){let i=n;for(;t[i+1]==="**";)i++;i!==n&&t.splice(n,i-n)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((n,i)=>{let s=n[n.length-1];return i==="**"&&s==="**"?n:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(n.pop(),n):(n.push(i),n)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let s=e[i];i===1&&s===""&&e[0]===""||(s==="."||s==="")&&(t=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf("..",n+1))!==-1;){let i=e[n-1];i&&i!=="."&&i!==".."&&i!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(i))&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let o=i;for(;n[o+1]==="**";)o++;o>i&&n.splice(i+1,o-i);let c=n[i+1],l=n[i+2],u=n[i+3];if(c!==".."||!l||l==="."||l===".."||!u||u==="."||u==="..")continue;t=!0,n.splice(i,1);let f=n.slice(0);f[i]="**",e.push(f),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<n.length-1;o++){let c=n[o];o===1&&c===""&&n[0]===""||(c==="."||c==="")&&(t=!0,n.splice(o,1),o--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(t=!0,n.pop())}let s=0;for(;(s=n.indexOf("..",s+1))!==-1;){let o=n[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){t=!0;let l=s===1&&n[s+1]==="**"?["."]:[];n.splice(s-1,2,...l),n.length===0&&n.push(""),s-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let i=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(i){e[t]=[],e[n]=i;break}}return e.filter(t=>t.length)}partsMatch(e,t,n=!1){let i=0,s=0,o=[],c="";for(;i<e.length&&s<t.length;)if(e[i]===t[s])o.push(c==="b"?t[s]:e[i]),i++,s++;else if(n&&e[i]==="**"&&t[s]===e[i+1])o.push(e[i]),i++;else if(n&&t[s]==="**"&&e[i]===t[s+1])o.push(t[s]),s++;else if(e[i]==="*"&&t[s]&&(this.options.dot||!t[s].startsWith("."))&&t[s]!=="**"){if(c==="b")return!1;c="a",o.push(e[i]),i++,s++}else if(t[s]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(c==="a")return!1;c="b",o.push(t[s]),i++,s++}else return!1;return e.length===t.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!1){let i=0,s=0;if(this.isWindows){let c=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),l=!c&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),u=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),f=!u&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),d=l?3:c?0:void 0,p=f?3:u?0:void 0;if(typeof d=="number"&&typeof p=="number"){let[h,g]=[e[d],t[p]];h.toLowerCase()===g.toLowerCase()&&(t[p]=h,s=p,i=d)}}let{optimizationLevel:o=1}=this.options;return o>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(vr)?this.#t(e,t,n,i,s):this.#n(e,t,n,i,s)}#t(e,t,n,i,s){let o=t.indexOf(vr,s),c=t.lastIndexOf(vr),[l,u,f]=n?[t.slice(s,o),t.slice(o+1),[]]:[t.slice(s,o),t.slice(o+1,c),t.slice(c+1)];if(l.length){let S=e.slice(i,i+l.length);if(!this.#n(S,l,n,0,0))return!1;i+=l.length,s+=l.length}let d=0;if(f.length){if(f.length+i>e.length)return!1;let S=e.length-f.length;if(this.#n(e,f,n,S,0))d=f.length;else{if(e[e.length-1]!==""||i+f.length===e.length||(S--,!this.#n(e,f,n,S,0)))return!1;d=f.length+1}}if(!u.length){let S=!!d;for(let I=i;I<e.length-d;I++){let E=String(e[I]);if(S=!0,E==="."||E===".."||!this.options.dot&&E.startsWith("."))return!1}return n||S}let p=[[[],0]],h=p[0],g=0,m=[0];for(let S of u)S===vr?(m.push(g),h=[[],0],p.push(h)):(h[0].push(S),g++);let b=p.length-1,_=e.length-d;for(let S of p)S[1]=_-(m[b--]+S[0].length);return!!this.#r(e,p,i,0,n,0,!!d)}#r(e,t,n,i,s,o,c){let l=t[i];if(!l){for(let d=n;d<e.length;d++){c=!0;let p=e[d];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return c}let[u,f]=l;for(;n<=f;){if(this.#n(e.slice(0,n+u.length),u,s,n,0)&&o<this.maxGlobstarRecursion){let h=this.#r(e,t,n+u.length,i+1,s,o+1,c);if(h!==!1)return h}let p=e[n];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1;n++}return s||null}#n(e,t,n,i,s){let o,c,l,u;for(o=i,c=s,u=e.length,l=t.length;o<u&&c<l;o++,c++){this.debug("matchOne loop");let f=t[c],d=e[o];if(this.debug(t,f,d),f===!1||f===vr)return!1;let p;if(typeof f=="string"?(p=d===f,this.debug("string match",f,d,p)):(p=f.test(d),this.debug("pattern match",f,d,p)),!p)return!1}if(o===u&&c===l)return!0;if(o===u)return n;if(c===l)return o===u-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return e6(this.pattern,this.options)}parse(e){Hm(e);let t=this.options;if(e==="**")return vr;if(e==="")return"";let n,i=null;(n=e.match(qme))?i=t.dot?zme:Wme:(n=e.match(Lme))?i=(t.nocase?t.dot?jme:Mme:t.dot?kme:Nme)(n[1]):(n=e.match(Hme))?i=(t.nocase?t.dot?Yme:Kme:t.dot?Xme:Qme)(n):(n=e.match($me))?i=t.dot?Bme:Ume:(n=e.match(Vme))&&(i=Gme);let s=gu.fromGlob(e,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,n=t.noglobstar?ege:t.dot?tge:rge,i=new Set(t.nocase?["i"]:[]),s=e.map(l=>{let u=l.map(d=>{if(d instanceof RegExp)for(let p of d.flags.split(""))i.add(p);return typeof d=="string"?age(d):d===vr?vr:d._src});u.forEach((d,p)=>{let h=u[p+1],g=u[p-1];d!==vr||g===vr||(g===void 0?h!==void 0&&h!==vr?u[p+1]="(?:\\/|"+n+"\\/)?"+h:u[p]=n:h===void 0?u[p-1]=g+"(?:\\/|\\/"+n+")?":h!==vr&&(u[p-1]=g+"(?:\\/|\\/"+n+"\\/)"+h,u[p+1]=vr))});let f=u.filter(d=>d!==vr);if(this.partial&&f.length>=1){let d=[];for(let p=1;p<=f.length;p++)d.push(f.slice(0,p).join("/"));return"(?:"+d.join("|")+")"}return f.join("/")}).join("|"),[o,c]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+c+"$",this.partial&&(s="^(?:\\/|"+o+s.slice(1,-1)+c+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;let n=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let o=i[i.length-1];if(!o)for(let c=i.length-2;!o&&c>=0;c--)o=i[c];for(let c of s){let l=i;if(n.matchBase&&c.length===1&&(l=[o]),this.matchOne(l,c,t))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return hi.defaults(e).Minimatch}};hi.AST=gu;hi.Minimatch=Yi;hi.escape=Wd;hi.unescape=zs});var cw,Rn,Ym,cge,sO,r6,t6,lge,uge,qc,n6,aw,fge,Qm,s6=Me(()=>{cw=require("node:diagnostics_channel"),Rn=(0,cw.channel)("lru-cache:metrics"),Ym=(0,cw.tracingChannel)("lru-cache"),cge=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,sO=a(()=>Rn.hasSubscribers||Ym.hasSubscribers,"R"),r6=new Set,t6=typeof process=="object"&&process?process:{},lge=a((r,e,t,n)=>{typeof t6.emitWarning=="function"?t6.emitWarning(r,e,t,n):console.error(`[${t}] ${e}: ${r}`)},"k"),uge=a(r=>!r6.has(r),"H"),qc=a(r=>!!r&&r===Math.floor(r)&&r>0&&isFinite(r),"T"),n6=a(r=>qc(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?aw:null:null,"j"),aw=class extends Array{static{a(this,"O")}constructor(r){super(r),this.fill(0)}},fge=class Xm{static{a(this,"d")}heap;length;static#t=!1;static create(e){let t=n6(e);if(!t)return[];Xm.#t=!0;let n=new Xm(e,t);return Xm.#t=!1,n}constructor(e,t){if(!Xm.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Qm=class i6{static{a(this,"d")}#t;#r;#n;#e;#i;#a;#p;#u;get perf(){return this.#u}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#c;#f;#l;#d;#o;#g;#E;#_;#S;#A;#y;#v;#T;#m;#b;#w;#R;#s;#x;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#m,autopurgeTimers:e.#b,sizes:e.#v,keyMap:e.#l,keyList:e.#d,valList:e.#o,next:e.#g,prev:e.#E,get head(){return e.#_},get tail(){return e.#S},free:e.#A,isBackgroundFetch:a(t=>e.#h(t),"isBackgroundFetch"),backgroundFetch:a((t,n,i,s)=>e.#M(t,n,i,s),"backgroundFetch"),moveToTail:a(t=>e.#K(t),"moveToTail"),indexes:a(t=>e.#P(t),"indexes"),rindexes:a(t=>e.#F(t),"rindexes"),isStale:a(t=>e.#I(t),"isStale")}}get max(){return this.#t}get maxSize(){return this.#r}get calculatedSize(){return this.#f}get size(){return this.#c}get fetchMethod(){return this.#a}get memoMethod(){return this.#p}get dispose(){return this.#n}get onInsert(){return this.#e}get disposeAfter(){return this.#i}constructor(e){let{max:t=0,ttl:n,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:c,allowStale:l,dispose:u,onInsert:f,disposeAfter:d,noDisposeOnSet:p,noUpdateTTL:h,maxSize:g=0,maxEntrySize:m=0,sizeCalculation:b,fetchMethod:_,memoMethod:S,noDeleteOnFetchRejection:I,noDeleteOnStaleGet:E,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:R,ignoreFetchAbort:x,backgroundFetchSize:P=1,perf:N}=e;if(this.backgroundFetchSize=P,N!==void 0&&typeof N?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#u=N??cge,t!==0&&!qc(t))throw new TypeError("max option must be a nonnegative integer");let V=t?n6(t):Array;if(!V)throw new Error("invalid max value: "+t);if(this.#t=t,this.#r=g,this.maxEntrySize=m||this.#r,this.sizeCalculation=b,this.sizeCalculation){if(!this.#r&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(S!==void 0&&typeof S!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#p=S,_!==void 0&&typeof _!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#a=_,this.#R=!!_,this.#l=new Map,this.#d=Array.from({length:t}).fill(void 0),this.#o=Array.from({length:t}).fill(void 0),this.#g=new V(t),this.#E=new V(t),this.#_=0,this.#S=0,this.#A=fge.create(t),this.#c=0,this.#f=0,typeof u=="function"&&(this.#n=u),typeof f=="function"&&(this.#e=f),typeof d=="function"?(this.#i=d,this.#y=[]):(this.#i=void 0,this.#y=void 0),this.#w=!!this.#n,this.#x=!!this.#e,this.#s=!!this.#i,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!I,this.allowStaleOnFetchRejection=!!w,this.allowStaleOnFetchAbort=!!R,this.ignoreFetchAbort=!!x,this.maxEntrySize!==0){if(this.#r!==0&&!qc(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!qc(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#q()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!E,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!c,this.ttlResolution=qc(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!qc(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#O()}if(this.#t===0&&this.ttl===0&&this.#r===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#r){let $="LRU_CACHE_UNBOUNDED";uge($)&&(r6.add($),lge("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",$,i6))}}getRemainingTTL(e){return this.#l.has(e)?1/0:0}#O(){let e=new aw(this.#t),t=new aw(this.#t);this.#m=e,this.#T=t;let n=this.ttlAutopurge?Array.from({length:this.#t}):void 0;this.#b=n,this.#$=(l,u,f=this.#u.now())=>{t[l]=u!==0?f:0,e[l]=u,i(l,u)},this.#C=l=>{t[l]=e[l]!==0?this.#u.now():0,i(l,e[l])};let i=this.ttlAutopurge?(l,u)=>{if(n?.[l]&&(clearTimeout(n[l]),n[l]=void 0),u&&u!==0&&n){let f=setTimeout(()=>{this.#I(l)?(this.#j(this.#d[l],"expire"),n[l]=void 0):i(l,c(l))},u+1);f.unref&&f.unref(),n[l]=f}}:()=>{};this.#D=(l,u)=>{if(e[u]){let f=e[u],d=t[u];if(!f||!d)return;l.ttl=f,l.start=d,l.now=s||o();let p=l.now-d;l.remainingTTL=f-p}};let s=0,o=a(()=>{let l=this.#u.now();if(this.ttlResolution>0){s=l;let u=setTimeout(()=>s=0,this.ttlResolution);u.unref&&u.unref()}return l},"o");this.getRemainingTTL=l=>{let u=this.#l.get(l);return u===void 0?0:c(u)};let c=a(l=>{let u=e[l],f=t[l];if(!u||!f)return 1/0;let d=(s||o())-f;return u-d},"l");this.#I=l=>{let u=t[l],f=e[l];return!!f&&!!u&&(s||o())-u>f}}#C=a(()=>{},"#R");#D=a(()=>{},"#v");#$=a(()=>{},"#H");#I=a(()=>!1,"#p");#q(){let e=new aw(this.#t);this.#f=0,this.#v=e,this.#N=t=>{this.#f-=e[t],e[t]=0},this.#U=(t,n,i,s)=>{if(!qc(i)){if(this.#h(n))return this.backgroundFetchSize;if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(n,t),!qc(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return i},this.#L=(t,n,i)=>{if(e[t]=n,this.#r){let s=this.#r-e[t];for(;this.#f>s;)this.#G(!0)}this.#f+=e[t],i&&(i.entrySize=n,i.totalCalculatedSize=this.#f)}}#N=a(e=>{},"#x");#L=a((e,t,n)=>{},"#j");#U=a((e,t,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#N");*#P({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#S;this.#B(t)&&((e||!this.#I(t))&&(yield t),t!==this.#_);)t=this.#E[t]}*#F({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#_;this.#B(t)&&((e||!this.#I(t))&&(yield t),t!==this.#S);)t=this.#g[t]}#B(e){return e!==void 0&&this.#l.get(this.#d[e])===e}*entries(){for(let e of this.#P())this.#o[e]!==void 0&&this.#d[e]!==void 0&&!this.#h(this.#o[e])&&(yield[this.#d[e],this.#o[e]])}*rentries(){for(let e of this.#F())this.#o[e]!==void 0&&this.#d[e]!==void 0&&!this.#h(this.#o[e])&&(yield[this.#d[e],this.#o[e]])}*keys(){for(let e of this.#P()){let t=this.#d[e];t!==void 0&&!this.#h(this.#o[e])&&(yield t)}}*rkeys(){for(let e of this.#F()){let t=this.#d[e];t!==void 0&&!this.#h(this.#o[e])&&(yield t)}}*values(){for(let e of this.#P())this.#o[e]!==void 0&&!this.#h(this.#o[e])&&(yield this.#o[e])}*rvalues(){for(let e of this.#F())this.#o[e]!==void 0&&!this.#h(this.#o[e])&&(yield this.#o[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let n of this.#P()){let i=this.#o[n],s=this.#h(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#d[n],this))return this.#H(this.#d[n],t)}}forEach(e,t=this){for(let n of this.#P()){let i=this.#o[n],s=this.#h(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(t,s,this.#d[n],this)}}rforEach(e,t=this){for(let n of this.#F()){let i=this.#o[n],s=this.#h(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(t,s,this.#d[n],this)}}purgeStale(){let e=!1;for(let t of this.#F({allowStale:!0}))this.#I(t)&&(this.#j(this.#d[t],"expire"),e=!0);return e}info(e){let t=this.#l.get(e);if(t===void 0)return;let n=this.#o[t],i=this.#h(n)?n.__staleWhileFetching:n;if(i===void 0)return;let s={value:i};if(this.#m&&this.#T){let o=this.#m[t],c=this.#T[t];if(o&&c){let l=o-(this.#u.now()-c);s.ttl=l,s.start=Date.now()}}return this.#v&&(s.size=this.#v[t]),s}dump(){let e=[];for(let t of this.#P({allowStale:!0})){let n=this.#d[t],i=this.#o[t],s=this.#h(i)?i.__staleWhileFetching:i;if(s===void 0||n===void 0)continue;let o={value:s};if(this.#m&&this.#T){o.ttl=this.#m[t];let c=this.#u.now()-this.#T[t];o.start=Math.floor(Date.now()-c)}this.#v&&(o.size=this.#v[t]),e.unshift([n,o])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let i=Date.now()-n.start;n.start=this.#u.now()-i}this.#k(t,n.value,n)}}set(e,t,n={}){let{status:i=Rn.hasSubscribers?{}:void 0}=n;n.status=i,i&&(i.op="set",i.key=e,t!==void 0&&(i.value=t),i.cache=this);let s=this.#k(e,t,n);return i&&Rn.hasSubscribers&&Rn.publish(i),s}#k(e,t,n,i){let{ttl:s=this.ttl,start:o,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:u}=n,f=this.#h(t);if(t===void 0)return u&&(u.set="deleted"),this.delete(e),this;let{noUpdateTTL:d=this.noUpdateTTL}=n;u&&!f&&(u.value=t);let p=this.#U(e,t,n.size||0,l,u);if(this.maxEntrySize&&p>this.maxEntrySize)return this.#j(e,"set"),u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this;let h=this.#c===0?void 0:this.#l.get(e);if(h===void 0)h=this.#c===0?this.#S:this.#A.length!==0?this.#A.pop():this.#c===this.#t?this.#G(!1):this.#c,this.#d[h]=e,this.#o[h]=t,this.#l.set(e,h),this.#g[this.#S]=h,this.#E[h]=this.#S,this.#S=h,this.#c++,this.#L(h,p,u),u&&(u.set="add"),d=!1,this.#x&&!f&&this.#e?.(t,e,"add");else{this.#K(h);let g=this.#o[h];if(t!==g){if(!c)if(this.#h(g)){g!==i&&g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=g;m!==void 0&&m!==t&&(this.#w&&this.#n?.(m,e,"set"),this.#s&&this.#y?.push([m,e,"set"]))}else this.#w&&this.#n?.(g,e,"set"),this.#s&&this.#y?.push([g,e,"set"]);if(this.#N(h),this.#L(h,p,u),this.#o[h]=t,!f){let m=g&&this.#h(g)?g.__staleWhileFetching:g,b=m===void 0?"add":t!==m?"replace":"update";u&&(u.set=b,m!==void 0&&(u.oldValue=m)),this.#x&&this.onInsert?.(t,e,b)}}else f||(u&&(u.set="update"),this.#x&&this.onInsert?.(t,e,"update"))}if(s!==0&&!this.#m&&this.#O(),this.#m&&(d||this.#$(h,s,o),u&&this.#D(u,h)),!c&&this.#s&&this.#y){let g=this.#y,m;for(;m=g?.shift();)this.#i?.(...m)}return this}pop(){try{for(;this.#c;){let e=this.#o[this.#_];if(this.#G(!0),this.#h(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#s&&this.#y){let e=this.#y,t;for(;t=e?.shift();)this.#i?.(...t)}}}#G(e){let t=this.#_,n=this.#d[t],i=this.#o[t],s=this.#h(i);s&&i.__abortController.abort(new Error("evicted"));let o=s?i.__staleWhileFetching:i;return(this.#w||this.#s)&&o!==void 0&&(this.#w&&this.#n?.(o,n,"evict"),this.#s&&this.#y?.push([o,n,"evict"])),this.#N(t),this.#b?.[t]&&(clearTimeout(this.#b[t]),this.#b[t]=void 0),e&&(this.#d[t]=void 0,this.#o[t]=void 0,this.#A.push(t)),this.#c===1?(this.#_=this.#S=0,this.#A.length=0):this.#_=this.#g[t],this.#l.delete(n),this.#c--,t}has(e,t={}){let{status:n=Rn.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op="has",n.key=e,n.cache=this);let i=this.#Y(e,t);return Rn.hasSubscribers&&Rn.publish(n),i}#Y(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=t,s=this.#l.get(e);if(s!==void 0){let o=this.#o[s];if(this.#h(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#I(s))i&&(i.has="stale",this.#D(i,s));else return n&&this.#C(s),i&&(i.has="hit",this.#D(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,t={}){let{status:n=sO()?{}:void 0}=t;n&&(n.op="peek",n.key=e,n.cache=this),t.status=n;let i=this.#W(e,t);return Rn.hasSubscribers&&Rn.publish(n),i}#W(e,t){let{status:n,allowStale:i=this.allowStale}=t,s=this.#l.get(e);if(s===void 0||!i&&this.#I(s)){n&&(n.peek=s===void 0?"miss":"stale");return}let o=this.#o[s],c=this.#h(o)?o.__staleWhileFetching:o;return n&&(c!==void 0?(n.peek="hit",n.value=c):n.peek="miss"),c}#M(e,t,n,i){let s=t===void 0?void 0:this.#o[t];if(this.#h(s))return s;let o=new AbortController,{signal:c}=n;c?.addEventListener("abort",()=>o.abort(c.reason),{signal:o.signal});let l={signal:o.signal,options:n,context:i},u=a((m,b=!1)=>{let{aborted:_}=o.signal,S=n.ignoreFetchAbort&&m!==void 0,I=n.ignoreFetchAbort||!!(n.allowStaleOnFetchAbort&&m!==void 0);if(n.status&&(_&&!b?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,S&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),_&&!S&&!b)return d(o.signal.reason,I);let E=h,w=this.#o[t];return(w===h||w===void 0&&S&&b)&&(m===void 0?E.__staleWhileFetching!==void 0?this.#o[t]=E.__staleWhileFetching:this.#j(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.#k(e,m,l.options,E))),m},"r"),f=a(m=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=m),d(m,!1)),"c"),d=a((m,b)=>{let{aborted:_}=o.signal,S=_&&n.allowStaleOnFetchAbort,I=S||n.allowStaleOnFetchRejection,E=I||n.noDeleteOnFetchRejection,w=h;if(this.#o[t]===h&&(!E||!b&&w.__staleWhileFetching===void 0?this.#j(e,"fetch"):S||(this.#o[t]=w.__staleWhileFetching)),I)return n.status&&w.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),w.__staleWhileFetching;if(w.__returned===w)throw m},"m"),p=a((m,b)=>{let _=this.#a?.(e,s,l);o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(m(void 0),n.allowStaleOnFetchAbort&&(m=a(S=>u(S,!0),"f")))}),_&&_ instanceof Promise?_.then(S=>m(S===void 0?void 0:S),b):_!==void 0&&m(_)},"_");n.status&&(n.status.fetchDispatched=!0);let h=new Promise(p).then(u,f),g=Object.assign(h,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return t===void 0?(this.#k(e,g,{...l.options,status:void 0}),t=this.#l.get(e)):this.#o[t]=g,g}#h(e){if(!this.#R)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof AbortController}fetch(e,t={}){let n=Ym.hasSubscribers,{status:i=sO()?{}:void 0}=t;t.status=i,i&&t.context&&(i.context=t.context);let s=this.#z(e,t);return i&&n&&(i.trace=!0,Ym.tracePromise(()=>s,i).catch(()=>{})),s}async#z(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:m,forceRefresh:b=!1,status:_,signal:S}=t;if(_&&(_.op="fetch",_.key=e,b&&(_.forceRefresh=!0),_.cache=this),!this.#R)return _&&(_.fetch="get"),this.#H(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:_});let I={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:c,size:l,sizeCalculation:u,noUpdateTTL:f,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:g,ignoreFetchAbort:h,status:_,signal:S},E=this.#l.get(e);if(E===void 0){_&&(_.fetch="miss");let w=this.#M(e,E,I,m);return w.__returned=w}else{let w=this.#o[E];if(this.#h(w)){let N=n&&w.__staleWhileFetching!==void 0;return _&&(_.fetch="inflight",N&&(_.returnedStale=!0)),N?w.__staleWhileFetching:w.__returned=w}let R=this.#I(E);if(!b&&!R)return _&&(_.fetch="hit"),this.#K(E),i&&this.#C(E),_&&this.#D(_,E),w;let x=this.#M(e,E,I,m),P=x.__staleWhileFetching!==void 0&&n;return _&&(_.fetch=R?"stale":"refresh",P&&R&&(_.returnedStale=!0)),P?x.__staleWhileFetching:x.__returned=x}}forceFetch(e,t={}){let n=Ym.hasSubscribers,{status:i=sO()?{}:void 0}=t;t.status=i,i&&t.context&&(i.context=t.context);let s=this.#V(e,t);return i&&n&&(i.trace=!0,Ym.tracePromise(()=>s,i).catch(()=>{})),s}async#V(e,t={}){let n=await this.#z(e,t);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,t={}){let{status:n=Rn.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op="memo",n.key=e,t.context&&(n.context=t.context),n.cache=this);let i=this.#J(e,t);return n&&(n.value=i),Rn.hasSubscribers&&Rn.publish(n),i}#J(e,t={}){let n=this.#p;if(!n)throw new Error("no memoMethod provided to constructor");let{context:i,status:s,forceRefresh:o,...c}=t;s&&o&&(s.forceRefresh=!0);let l=this.#H(e,c),u=o||l===void 0;if(s&&(s.memo=u?"miss":"hit",u||(s.value=l)),!u)return l;let f=n(e,l,{options:c,context:i});return s&&(s.value=f),this.#k(e,f,c),f}get(e,t={}){let{status:n=Rn.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op="get",n.key=e,n.cache=this);let i=this.#H(e,t);return n&&(i!==void 0&&(n.value=i),Rn.hasSubscribers&&Rn.publish(n)),i}#H(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=t,c=this.#l.get(e);if(c===void 0){o&&(o.get="miss");return}let l=this.#o[c],u=this.#h(l);return o&&this.#D(o,c),this.#I(c)?u?(o&&(o.get="stale-fetching"),n&&l.__staleWhileFetching!==void 0?(o&&(o.returnedStale=!0),l.__staleWhileFetching):void 0):(s||this.#j(e,"expire"),o&&(o.get="stale"),n?(o&&(o.returnedStale=!0),l):void 0):(o&&(o.get=u?"fetching":"hit"),this.#K(c),i&&this.#C(c),u?l.__staleWhileFetching:l)}#X(e,t){this.#E[t]=e,this.#g[e]=t}#K(e){e!==this.#S&&(e===this.#_?this.#_=this.#g[e]:this.#X(this.#E[e],this.#g[e]),this.#X(this.#S,e),this.#S=e)}delete(e){return this.#j(e,"delete")}#j(e,t){Rn.hasSubscribers&&Rn.publish({op:"delete",delete:t,key:e,cache:this});let n=!1;if(this.#c!==0){let i=this.#l.get(e);if(i!==void 0)if(this.#b?.[i]&&(clearTimeout(this.#b[i]),this.#b[i]=void 0),n=!0,this.#c===1)this.#Q(t);else{this.#N(i);let s=this.#o[i];if(this.#h(s)?s.__abortController.abort(new Error("deleted")):(this.#w||this.#s)&&(this.#w&&this.#n?.(s,e,t),this.#s&&this.#y?.push([s,e,t])),this.#l.delete(e),this.#d[i]=void 0,this.#o[i]=void 0,i===this.#S)this.#S=this.#E[i];else if(i===this.#_)this.#_=this.#g[i];else{let o=this.#E[i];this.#g[o]=this.#g[i];let c=this.#g[i];this.#E[c]=this.#E[i]}this.#c--,this.#A.push(i)}}if(this.#s&&this.#y?.length){let i=this.#y,s;for(;s=i?.shift();)this.#i?.(...s)}return n}clear(){return this.#Q("delete")}#Q(e){for(let t of this.#F({allowStale:!0})){let n=this.#o[t];if(this.#h(n))n.__abortController.abort(new Error("deleted"));else{let i=this.#d[t];this.#w&&this.#n?.(n,i,e),this.#s&&this.#y?.push([n,i,e])}}if(this.#l.clear(),this.#o.fill(void 0),this.#d.fill(void 0),this.#m&&this.#T){this.#m.fill(0),this.#T.fill(0);for(let t of this.#b??[])t!==void 0&&clearTimeout(t);this.#b?.fill(void 0)}if(this.#v&&this.#v.fill(0),this.#_=0,this.#S=0,this.#A.length=0,this.#f=0,this.#c=0,this.#s&&this.#y){let t=this.#y,n;for(;n=t?.shift();)this.#i?.(...n)}}}});var mw,dO,u6,o6,dge,pge,hge,Ga,qa,Wc,lw,Jm,uw,a6,fw,c6,Hs,zd,nn,Zm,Hd,sn,mi,on,oO,dw,zn,Tr,aO,cO,l6,lO,Mo,uO,pw,eg,yu,Xi,tg,mge,gge,yge,bge,hw,fO,_ge,Sge,zc,pO=Me(()=>{mw=require("node:events"),dO=Q(require("node:stream"),1),u6=require("node:string_decoder"),o6=typeof process=="object"&&process?process:{stdout:null,stderr:null},dge=a(r=>!!r&&typeof r=="object"&&(r instanceof zc||r instanceof dO.default||pge(r)||hge(r)),"isStream"),pge=a(r=>!!r&&typeof r=="object"&&r instanceof mw.EventEmitter&&typeof r.pipe=="function"&&r.pipe!==dO.default.Writable.prototype.pipe,"isReadable"),hge=a(r=>!!r&&typeof r=="object"&&r instanceof mw.EventEmitter&&typeof r.write=="function"&&typeof r.end=="function","isWritable"),Ga=Symbol("EOF"),qa=Symbol("maybeEmitEnd"),Wc=Symbol("emittedEnd"),lw=Symbol("emittingEnd"),Jm=Symbol("emittedError"),uw=Symbol("closed"),a6=Symbol("read"),fw=Symbol("flush"),c6=Symbol("flushChunk"),Hs=Symbol("encoding"),zd=Symbol("decoder"),nn=Symbol("flowing"),Zm=Symbol("paused"),Hd=Symbol("resume"),sn=Symbol("buffer"),mi=Symbol("pipes"),on=Symbol("bufferLength"),oO=Symbol("bufferPush"),dw=Symbol("bufferShift"),zn=Symbol("objectMode"),Tr=Symbol("destroyed"),aO=Symbol("error"),cO=Symbol("emitData"),l6=Symbol("emitEnd"),lO=Symbol("emitEnd2"),Mo=Symbol("async"),uO=Symbol("abort"),pw=Symbol("aborted"),eg=Symbol("signal"),yu=Symbol("dataListeners"),Xi=Symbol("discarded"),tg=a(r=>Promise.resolve().then(r),"defer"),mge=a(r=>r(),"nodefer"),gge=a(r=>r==="end"||r==="finish"||r==="prefinish","isEndish"),yge=a(r=>r instanceof ArrayBuffer||!!r&&typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,"isArrayBufferLike"),bge=a(r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),"isArrayBufferView"),hw=class{static{a(this,"Pipe")}src;dest;opts;ondrain;constructor(e,t,n){this.src=e,this.dest=t,this.opts=n,this.ondrain=()=>e[Hd](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},fO=class extends hw{static{a(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,n){super(e,t,n),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors)}},_ge=a(r=>!!r.objectMode,"isObjectModeOptions"),Sge=a(r=>!r.objectMode&&!!r.encoding&&r.encoding!=="buffer","isEncodingOptions"),zc=class extends mw.EventEmitter{static{a(this,"Minipass")}[nn]=!1;[Zm]=!1;[mi]=[];[sn]=[];[zn];[Hs];[Mo];[zd];[Ga]=!1;[Wc]=!1;[lw]=!1;[uw]=!1;[Jm]=null;[on]=0;[Tr]=!1;[eg];[pw]=!1;[yu]=0;[Xi]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");_ge(t)?(this[zn]=!0,this[Hs]=null):Sge(t)?(this[Hs]=t.encoding,this[zn]=!1):(this[zn]=!1,this[Hs]=null),this[Mo]=!!t.async,this[zd]=this[Hs]?new u6.StringDecoder(this[Hs]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:a(()=>this[sn],"get")}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:a(()=>this[mi],"get")});let{signal:n}=t;n&&(this[eg]=n,n.aborted?this[uO]():n.addEventListener("abort",()=>this[uO]()))}get bufferLength(){return this[on]}get encoding(){return this[Hs]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[zn]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Mo]}set async(e){this[Mo]=this[Mo]||!!e}[uO](){this[pw]=!0,this.emit("abort",this[eg]?.reason),this.destroy(this[eg]?.reason)}get aborted(){return this[pw]}set aborted(e){}write(e,t,n){if(this[pw])return!1;if(this[Ga])throw new Error("write after end");if(this[Tr])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(n=t,t="utf8"),t||(t="utf8");let i=this[Mo]?tg:mge;if(!this[zn]&&!Buffer.isBuffer(e)){if(bge(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(yge(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[zn]?(this[nn]&&this[on]!==0&&this[fw](!0),this[nn]?this.emit("data",e):this[oO](e),this[on]!==0&&this.emit("readable"),n&&i(n),this[nn]):e.length?(typeof e=="string"&&!(t===this[Hs]&&!this[zd]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[Hs]&&(e=this[zd].write(e)),this[nn]&&this[on]!==0&&this[fw](!0),this[nn]?this.emit("data",e):this[oO](e),this[on]!==0&&this.emit("readable"),n&&i(n),this[nn]):(this[on]!==0&&this.emit("readable"),n&&i(n),this[nn])}read(e){if(this[Tr])return null;if(this[Xi]=!1,this[on]===0||e===0||e&&e>this[on])return this[qa](),null;this[zn]&&(e=null),this[sn].length>1&&!this[zn]&&(this[sn]=[this[Hs]?this[sn].join(""):Buffer.concat(this[sn],this[on])]);let t=this[a6](e||null,this[sn][0]);return this[qa](),t}[a6](e,t){if(this[zn])this[dw]();else{let n=t;e===n.length||e===null?this[dw]():typeof n=="string"?(this[sn][0]=n.slice(e),t=n.slice(0,e),this[on]-=e):(this[sn][0]=n.subarray(e),t=n.subarray(0,e),this[on]-=e)}return this.emit("data",t),!this[sn].length&&!this[Ga]&&this.emit("drain"),t}end(e,t,n){return typeof e=="function"&&(n=e,e=void 0),typeof t=="function"&&(n=t,t="utf8"),e!==void 0&&this.write(e,t),n&&this.once("end",n),this[Ga]=!0,this.writable=!1,(this[nn]||!this[Zm])&&this[qa](),this}[Hd](){this[Tr]||(!this[yu]&&!this[mi].length&&(this[Xi]=!0),this[Zm]=!1,this[nn]=!0,this.emit("resume"),this[sn].length?this[fw]():this[Ga]?this[qa]():this.emit("drain"))}resume(){return this[Hd]()}pause(){this[nn]=!1,this[Zm]=!0,this[Xi]=!1}get destroyed(){return this[Tr]}get flowing(){return this[nn]}get paused(){return this[Zm]}[oO](e){this[zn]?this[on]+=1:this[on]+=e.length,this[sn].push(e)}[dw](){return this[zn]?this[on]-=1:this[on]-=this[sn][0].length,this[sn].shift()}[fw](e=!1){do;while(this[c6](this[dw]())&&this[sn].length);!e&&!this[sn].length&&!this[Ga]&&this.emit("drain")}[c6](e){return this.emit("data",e),this[nn]}pipe(e,t){if(this[Tr])return e;this[Xi]=!1;let n=this[Wc];return t=t||{},e===o6.stdout||e===o6.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,n?t.end&&e.end():(this[mi].push(t.proxyErrors?new fO(this,e,t):new hw(this,e,t)),this[Mo]?tg(()=>this[Hd]()):this[Hd]()),e}unpipe(e){let t=this[mi].find(n=>n.dest===e);t&&(this[mi].length===1?(this[nn]&&this[yu]===0&&(this[nn]=!1),this[mi]=[]):this[mi].splice(this[mi].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let n=super.on(e,t);if(e==="data")this[Xi]=!1,this[yu]++,!this[mi].length&&!this[nn]&&this[Hd]();else if(e==="readable"&&this[on]!==0)super.emit("readable");else if(gge(e)&&this[Wc])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Jm]){let i=t;this[Mo]?tg(()=>i.call(this,this[Jm])):i.call(this,this[Jm])}return n}removeListener(e,t){return this.off(e,t)}off(e,t){let n=super.off(e,t);return e==="data"&&(this[yu]=this.listeners("data").length,this[yu]===0&&!this[Xi]&&!this[mi].length&&(this[nn]=!1)),n}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[yu]=0,!this[Xi]&&!this[mi].length&&(this[nn]=!1)),t}get emittedEnd(){return this[Wc]}[qa](){!this[lw]&&!this[Wc]&&!this[Tr]&&this[sn].length===0&&this[Ga]&&(this[lw]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[uw]&&this.emit("close"),this[lw]=!1)}emit(e,...t){let n=t[0];if(e!=="error"&&e!=="close"&&e!==Tr&&this[Tr])return!1;if(e==="data")return!this[zn]&&!n?!1:this[Mo]?(tg(()=>this[cO](n)),!0):this[cO](n);if(e==="end")return this[l6]();if(e==="close"){if(this[uw]=!0,!this[Wc]&&!this[Tr])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[Jm]=n,super.emit(aO,n);let s=!this[eg]||this.listeners("error").length?super.emit("error",n):!1;return this[qa](),s}else if(e==="resume"){let s=super.emit("resume");return this[qa](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let i=super.emit(e,...t);return this[qa](),i}[cO](e){for(let n of this[mi])n.dest.write(e)===!1&&this.pause();let t=this[Xi]?!1:super.emit("data",e);return this[qa](),t}[l6](){return this[Wc]?!1:(this[Wc]=!0,this.readable=!1,this[Mo]?(tg(()=>this[lO]()),!0):this[lO]())}[lO](){if(this[zd]){let t=this[zd].end();if(t){for(let n of this[mi])n.dest.write(t);this[Xi]||super.emit("data",t)}}for(let t of this[mi])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[zn]||(e.dataLength=0);let t=this.promise();return this.on("data",n=>{e.push(n),this[zn]||(e.dataLength+=n.length)}),await t,e}async concat(){if(this[zn])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Hs]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(Tr,()=>t(new Error("stream destroyed"))),this.on("error",n=>t(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Xi]=!1;let e=!1,t=a(async()=>(this.pause(),e=!0,{value:void 0,done:!0}),"stop");return{next:a(()=>{if(e)return t();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[Ga])return t();let s,o,c=a(d=>{this.off("data",l),this.off("end",u),this.off(Tr,f),t(),o(d)},"onerr"),l=a(d=>{this.off("error",c),this.off("end",u),this.off(Tr,f),this.pause(),s({value:d,done:!!this[Ga]})},"ondata"),u=a(()=>{this.off("error",c),this.off("data",l),this.off(Tr,f),t(),s({done:!0,value:void 0})},"onend"),f=a(()=>c(new Error("stream destroyed")),"ondestroy");return new Promise((d,p)=>{o=p,s=d,this.once(Tr,f),this.once("error",c),this.once("end",u),this.once("data",l)})},"next"),throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Xi]=!1;let e=!1,t=a(()=>(this.pause(),this.off(aO,t),this.off(Tr,t),this.off("end",t),e=!0,{done:!0,value:void 0}),"stop"),n=a(()=>{if(e)return t();let i=this.read();return i===null?t():{done:!1,value:i}},"next");return this.once("end",t),this.once(aO,t),this.once(Tr,t),{next:n,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[Tr])return e?this.emit("error",e):this.emit(Tr),this;this[Tr]=!0,this[Xi]=!0,this[sn].length=0,this[on]=0;let t=this;return typeof t.close=="function"&&!this[uw]&&t.close(),e?this.emit("error",e):this.emit(Tr),this}static get isStream(){return dge}}});var Kd,m6,$o,wge,Hc,Ege,ng,g6,y6,vge,Tge,ds,b6,_6,jo,S6,w6,bu,E6,fs,rg,hO,f6,ig,Ks,gw,bw,d6,Age,mO,p6,sg,h6,yw,_w,gO,v6,Hn,Sw,ww,Ew,Yd,Xd,og,CNe,T6,A6=Me(()=>{s6();Kd=require("node:path"),m6=require("node:url"),$o=require("fs"),wge=Q(require("node:fs"),1),Hc=require("node:fs/promises");pO();Ege=$o.realpathSync.native,ng={lstatSync:$o.lstatSync,readdir:$o.readdir,readdirSync:$o.readdirSync,readlinkSync:$o.readlinkSync,realpathSync:Ege,promises:{lstat:Hc.lstat,readdir:Hc.readdir,readlink:Hc.readlink,realpath:Hc.realpath}},g6=a(r=>!r||r===ng||r===wge?ng:{...ng,...r,promises:{...ng.promises,...r.promises||{}}},"fsFromOption"),y6=/^\\\\\?\\([a-z]:)\\?$/i,vge=a(r=>r.replace(/\//g,"\\").replace(y6,"$1\\"),"uncToDrive"),Tge=/[\\\/]/,ds=0,b6=1,_6=2,jo=4,S6=6,w6=8,bu=10,E6=12,fs=15,rg=~fs,hO=16,f6=32,ig=64,Ks=128,gw=256,bw=512,d6=ig|Ks|bw,Age=1023,mO=a(r=>r.isFile()?w6:r.isDirectory()?jo:r.isSymbolicLink()?bu:r.isCharacterDevice()?_6:r.isBlockDevice()?S6:r.isSocket()?E6:r.isFIFO()?b6:ds,"entToType"),p6=new Qm({max:2**12}),sg=a(r=>{let e=p6.get(r);if(e)return e;let t=r.normalize("NFKD");return p6.set(r,t),t},"normalize"),h6=new Qm({max:2**12}),yw=a(r=>{let e=h6.get(r);if(e)return e;let t=sg(r.toLowerCase());return h6.set(r,t),t},"normalizeNocase"),_w=class extends Qm{static{a(this,"ResolveCache")}constructor(){super({max:256})}},gO=class extends Qm{static{a(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:a(t=>t.length+1,"sizeCalculation")})}},v6=Symbol("PathScurry setAsCwd"),Hn=class{static{a(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#t;#r;get dev(){return this.#r}#n;get mode(){return this.#n}#e;get nlink(){return this.#e}#i;get uid(){return this.#i}#a;get gid(){return this.#a}#p;get rdev(){return this.#p}#u;get blksize(){return this.#u}#c;get ino(){return this.#c}#f;get size(){return this.#f}#l;get blocks(){return this.#l}#d;get atimeMs(){return this.#d}#o;get mtimeMs(){return this.#o}#g;get ctimeMs(){return this.#g}#E;get birthtimeMs(){return this.#E}#_;get atime(){return this.#_}#S;get mtime(){return this.#S}#A;get ctime(){return this.#A}#y;get birthtime(){return this.#y}#v;#T;#m;#b;#w;#R;#s;#x;#O;#C;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=ds,n,i,s,o,c){this.name=e,this.#v=s?yw(e):sg(e),this.#s=t&Age,this.nocase=s,this.roots=i,this.root=n||this,this.#x=o,this.#m=c.fullpath,this.#w=c.relative,this.#R=c.relativePosix,this.parent=c.parent,this.parent?this.#t=this.parent.#t:this.#t=g6(c.fs)}depth(){return this.#T!==void 0?this.#T:this.parent?this.#T=this.parent.depth()+1:this.#T=0}childrenCache(){return this.#x}resolve(e){if(!e)return this;let t=this.getRootString(e),i=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#D(i):this.#D(i)}#D(e){let t=this;for(let n of e)t=t.child(n);return t}children(){let e=this.#x.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#x.set(this,t),this.#s&=~hO,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),i=this.nocase?yw(e):sg(e);for(let l of n)if(l.#v===i)return l;let s=this.parent?this.sep:"",o=this.#m?this.#m+s+e:void 0,c=this.newChild(e,ds,{...t,parent:this,fullpath:o});return this.canReaddir()||(c.#s|=Ks),n.push(c),c}relative(){if(this.isCWD)return"";if(this.#w!==void 0)return this.#w;let e=this.name,t=this.parent;if(!t)return this.#w=this.name;let n=t.relative();return n+(!n||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#R!==void 0)return this.#R;let e=this.name,t=this.parent;if(!t)return this.#R=this.fullpathPosix();let n=t.relativePosix();return n+(!n||!t.parent?"":"/")+e}fullpath(){if(this.#m!==void 0)return this.#m;let e=this.name,t=this.parent;if(!t)return this.#m=this.name;let i=t.fullpath()+(t.parent?this.sep:"")+e;return this.#m=i}fullpathPosix(){if(this.#b!==void 0)return this.#b;if(this.sep==="/")return this.#b=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#b=`//?/${i}`:this.#b=i}let e=this.parent,t=e.fullpathPosix(),n=t+(!t||!e.parent?"":"/")+this.name;return this.#b=n}isUnknown(){return(this.#s&fs)===ds}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#s&fs)===w6}isDirectory(){return(this.#s&fs)===jo}isCharacterDevice(){return(this.#s&fs)===_6}isBlockDevice(){return(this.#s&fs)===S6}isFIFO(){return(this.#s&fs)===b6}isSocket(){return(this.#s&fs)===E6}isSymbolicLink(){return(this.#s&bu)===bu}lstatCached(){return this.#s&f6?this:void 0}readlinkCached(){return this.#O}realpathCached(){return this.#C}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#O)return!0;if(!this.parent)return!1;let e=this.#s&fs;return!(e!==ds&&e!==bu||this.#s&gw||this.#s&Ks)}calledReaddir(){return!!(this.#s&hO)}isENOENT(){return!!(this.#s&Ks)}isNamed(e){return this.nocase?this.#v===yw(e):this.#v===sg(e)}async readlink(){let e=this.#O;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#t.promises.readlink(this.fullpath()),n=(await this.parent.realpath())?.resolve(t);if(n)return this.#O=n}catch(t){this.#F(t.code);return}}readlinkSync(){let e=this.#O;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#t.readlinkSync(this.fullpath()),n=this.parent.realpathSync()?.resolve(t);if(n)return this.#O=n}catch(t){this.#F(t.code);return}}#$(e){this.#s|=hO;for(let t=e.provisional;t<e.length;t++){let n=e[t];n&&n.#I()}}#I(){this.#s&Ks||(this.#s=(this.#s|Ks)&rg,this.#q())}#q(){let e=this.children();e.provisional=0;for(let t of e)t.#I()}#N(){this.#s|=bw,this.#L()}#L(){if(this.#s&ig)return;let e=this.#s;(e&fs)===jo&&(e&=rg),this.#s=e|ig,this.#q()}#U(e=""){e==="ENOTDIR"||e==="EPERM"?this.#L():e==="ENOENT"?this.#I():this.children().provisional=0}#P(e=""){e==="ENOTDIR"?this.parent.#L():e==="ENOENT"&&this.#I()}#F(e=""){let t=this.#s;t|=gw,e==="ENOENT"&&(t|=Ks),(e==="EINVAL"||e==="UNKNOWN")&&(t&=rg),this.#s=t,e==="ENOTDIR"&&this.parent&&this.parent.#L()}#B(e,t){return this.#G(e,t)||this.#k(e,t)}#k(e,t){let n=mO(e),i=this.newChild(e.name,n,{parent:this}),s=i.#s&fs;return s!==jo&&s!==bu&&s!==ds&&(i.#s|=ig),t.unshift(i),t.provisional++,i}#G(e,t){for(let n=t.provisional;n<t.length;n++){let i=t[n];if((this.nocase?yw(e.name):sg(e.name))===i.#v)return this.#Y(e,i,n,t)}}#Y(e,t,n,i){let s=t.name;return t.#s=t.#s&rg|mO(e),s!==e.name&&(t.name=e.name),n!==i.provisional&&(n===i.length-1?i.pop():i.splice(n,1),i.unshift(t)),i.provisional++,t}async lstat(){if((this.#s&Ks)===0)try{return this.#W(await this.#t.promises.lstat(this.fullpath())),this}catch(e){this.#P(e.code)}}lstatSync(){if((this.#s&Ks)===0)try{return this.#W(this.#t.lstatSync(this.fullpath())),this}catch(e){this.#P(e.code)}}#W(e){let{atime:t,atimeMs:n,birthtime:i,birthtimeMs:s,blksize:o,blocks:c,ctime:l,ctimeMs:u,dev:f,gid:d,ino:p,mode:h,mtime:g,mtimeMs:m,nlink:b,rdev:_,size:S,uid:I}=e;this.#_=t,this.#d=n,this.#y=i,this.#E=s,this.#u=o,this.#l=c,this.#A=l,this.#g=u,this.#r=f,this.#a=d,this.#c=p,this.#n=h,this.#S=g,this.#o=m,this.#e=b,this.#p=_,this.#f=S,this.#i=I;let E=mO(e);this.#s=this.#s&rg|E|f6,E!==ds&&E!==jo&&E!==bu&&(this.#s|=ig)}#M=[];#h=!1;#z(e){this.#h=!1;let t=this.#M.slice();this.#M.length=0,t.forEach(n=>n(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let s=n.slice(0,n.provisional);t?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#M.push(e),this.#h)return;this.#h=!0;let i=this.fullpath();this.#t.readdir(i,{withFileTypes:!0},(s,o)=>{if(s)this.#U(s.code),n.provisional=0;else{for(let c of o)this.#B(c,n);this.#$(n)}this.#z(n.slice(0,n.provisional))})}#V;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#V)await this.#V;else{let n=a(()=>{},"resolve");this.#V=new Promise(i=>n=i);try{for(let i of await this.#t.promises.readdir(t,{withFileTypes:!0}))this.#B(i,e);this.#$(e)}catch(i){this.#U(i.code),e.provisional=0}this.#V=void 0,n()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let n of this.#t.readdirSync(t,{withFileTypes:!0}))this.#B(n,e);this.#$(e)}catch(n){this.#U(n.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#s&d6)return!1;let e=fs&this.#s;return e===ds||e===jo||e===bu}shouldWalk(e,t){return(this.#s&jo)===jo&&!(this.#s&d6)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#C)return this.#C;if(!((bw|gw|Ks)&this.#s))try{let e=await this.#t.promises.realpath(this.fullpath());return this.#C=this.resolve(e)}catch{this.#N()}}realpathSync(){if(this.#C)return this.#C;if(!((bw|gw|Ks)&this.#s))try{let e=this.#t.realpathSync(this.fullpath());return this.#C=this.resolve(e)}catch{this.#N()}}[v6](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),n=[],i=this;for(;i&&i.parent;)t.add(i),i.#w=n.join(this.sep),i.#R=n.join("/"),i=i.parent,n.push("..");for(i=e;i&&i.parent&&!t.has(i);)i.#w=void 0,i.#R=void 0,i=i.parent}},Sw=class r extends Hn{static{a(this,"PathWin32")}sep="\\";splitSep=Tge;constructor(e,t=ds,n,i,s,o,c){super(e,t,n,i,s,o,c)}newChild(e,t=ds,n={}){return new r(e,t,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return Kd.win32.parse(e).root}getRoot(e){if(e=vge(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,n]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=n;return this.roots[e]=new Yd(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(y6,"$1\\"),e===t}},ww=class r extends Hn{static{a(this,"PathPosix")}splitSep="/";sep="/";constructor(e,t=ds,n,i,s,o,c){super(e,t,n,i,s,o,c)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=ds,n={}){return new r(e,t,this.root,this.roots,this.nocase,this.childrenCache(),n)}},Ew=class{static{a(this,"PathScurryBase")}root;rootPath;roots;cwd;#t;#r;#n;nocase;#e;constructor(e=process.cwd(),t,n,{nocase:i,childrenCacheSize:s=16*1024,fs:o=ng}={}){this.#e=g6(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,m6.fileURLToPath)(e));let c=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(c),this.#t=new _w,this.#r=new _w,this.#n=new gO(s);let l=c.substring(this.rootPath.length).split(n);if(l.length===1&&!l[0]&&l.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#e),this.roots[this.rootPath]=this.root;let u=this.root,f=l.length-1,d=t.sep,p=this.rootPath,h=!1;for(let g of l){let m=f--;u=u.child(g,{relative:new Array(m).fill("..").join(d),relativePosix:new Array(m).fill("..").join("/"),fullpath:p+=(h?"":d)+g}),h=!0}this.cwd=u}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#n}resolve(...e){let t="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let n=this.#t.get(t);if(n!==void 0)return n;let i=this.cwd.resolve(t).fullpath();return this.#t.set(t,i),i}resolvePosix(...e){let t="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let n=this.#r.get(t);if(n!==void 0)return n;let i=this.cwd.resolve(t).fullpathPosix();return this.#r.set(t,i),i}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd);let{withFileTypes:n}=t;if(e.canReaddir()){let i=await e.readdir();return n?i:i.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0}=t;return e.canReaddir()?n?e.readdirSync():e.readdirSync().map(i=>i.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e.withFileTypes,e=this.cwd);let n=await e.readlink();return t?n:n?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return t?n:n?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e.withFileTypes,e=this.cwd);let n=await e.realpath();return t?n:n?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return t?n:n?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=[];(!s||s(e))&&c.push(n?e:e.fullpath());let l=new Set,u=a((d,p)=>{l.add(d),d.readdirCB((h,g)=>{if(h)return p(h);let m=g.length;if(!m)return p();let b=a(()=>{--m===0&&p()},"next");for(let _ of g)(!s||s(_))&&c.push(n?_:_.fullpath()),i&&_.isSymbolicLink()?_.realpath().then(S=>S?.isUnknown()?S.lstat():S).then(S=>S?.shouldWalk(l,o)?u(S,b):b()):_.shouldWalk(l,o)?u(_,b):b()},!0)},"walk"),f=e;return new Promise((d,p)=>{u(f,h=>{if(h)return p(h);d(c)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=[];(!s||s(e))&&c.push(n?e:e.fullpath());let l=new Set([e]);for(let u of l){let f=u.readdirSync();for(let d of f){(!s||s(d))&&c.push(n?d:d.fullpath());let p=d;if(d.isSymbolicLink()){if(!(i&&(p=d.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(l,o)&&l.add(p)}}return c}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t;(!s||s(e))&&(yield n?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let f of u){(!s||s(f))&&(yield n?f:f.fullpath());let d=f;if(f.isSymbolicLink()){if(!(i&&(d=f.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(c,o)&&c.add(d)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=new zc({objectMode:!0});(!s||s(e))&&c.write(n?e:e.fullpath());let l=new Set,u=[e],f=0,d=a(()=>{let p=!1;for(;!p;){let h=u.shift();if(!h){f===0&&c.end();return}f++,l.add(h);let g=a((b,_,S=!1)=>{if(b)return c.emit("error",b);if(i&&!S){let I=[];for(let E of _)E.isSymbolicLink()&&I.push(E.realpath().then(w=>w?.isUnknown()?w.lstat():w));if(I.length){Promise.all(I).then(()=>g(null,_,!0));return}}for(let I of _)I&&(!s||s(I))&&(c.write(n?I:I.fullpath())||(p=!0));f--;for(let I of _){let E=I.realpathCached()||I;E.shouldWalk(l,o)&&u.push(E)}p&&!c.flowing?c.once("drain",d):m||d()},"onReaddir"),m=!0;h.readdirCB(g,!0),m=!1}},"process");return d(),c}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=new zc({objectMode:!0}),l=new Set;(!s||s(e))&&c.write(n?e:e.fullpath());let u=[e],f=0,d=a(()=>{let p=!1;for(;!p;){let h=u.shift();if(!h){f===0&&c.end();return}f++,l.add(h);let g=h.readdirSync();for(let m of g)(!s||s(m))&&(c.write(n?m:m.fullpath())||(p=!0));f--;for(let m of g){let b=m;if(m.isSymbolicLink()){if(!(i&&(b=m.realpathSync())))continue;b.isUnknown()&&b.lstatSync()}b.shouldWalk(l,o)&&u.push(b)}}p&&!c.flowing&&c.once("drain",d)},"process");return d(),c}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[v6](t)}},Yd=class extends Ew{static{a(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,Kd.win32,"\\",{...t,nocase:n}),this.nocase=n;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return Kd.win32.parse(e).root.toUpperCase()}newRoot(e){return new Sw(this.rootPath,jo,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},Xd=class extends Ew{static{a(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),t={}){let{nocase:n=!1}=t;super(e,Kd.posix,"/",{...t,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new ww(this.rootPath,jo,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},og=class extends Xd{static{a(this,"PathScurryDarwin")}constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,{...t,nocase:n})}},CNe=process.platform==="win32"?Sw:ww,T6=process.platform==="win32"?Yd:process.platform==="darwin"?og:Xd});var Ige,Rge,Qd,yO=Me(()=>{Gc();Ige=a(r=>r.length>=1,"isPatternList"),Rge=a(r=>r.length>=1,"isGlobList"),Qd=class r{static{a(this,"Pattern")}#t;#r;#n;length;#e;#i;#a;#p;#u;#c;#f=!0;constructor(e,t,n,i){if(!Ige(e))throw new TypeError("empty pattern list");if(!Rge(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,n<0||n>=this.length)throw new TypeError("index out of range");if(this.#t=e,this.#r=t,this.#n=n,this.#e=i,this.#n===0){if(this.isUNC()){let[s,o,c,l,...u]=this.#t,[f,d,p,h,...g]=this.#r;u[0]===""&&(u.shift(),g.shift());let m=[s,o,c,l,""].join("/"),b=[f,d,p,h,""].join("/");this.#t=[m,...u],this.#r=[b,...g],this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){let[s,...o]=this.#t,[c,...l]=this.#r;o[0]===""&&(o.shift(),l.shift());let u=s+"/",f=c+"/";this.#t=[u,...o],this.#r=[f,...l],this.length=this.#t.length}}}pattern(){return this.#t[this.#n]}isString(){return typeof this.#t[this.#n]=="string"}isGlobstar(){return this.#t[this.#n]===vr}isRegExp(){return this.#t[this.#n]instanceof RegExp}globString(){return this.#a=this.#a||(this.#n===0?this.isAbsolute()?this.#r[0]+this.#r.slice(1).join("/"):this.#r.join("/"):this.#r.slice(this.#n).join("/"))}hasMore(){return this.length>this.#n+1}rest(){return this.#i!==void 0?this.#i:this.hasMore()?(this.#i=new r(this.#t,this.#r,this.#n+1,this.#e),this.#i.#c=this.#c,this.#i.#u=this.#u,this.#i.#p=this.#p,this.#i):this.#i=null}isUNC(){let e=this.#t;return this.#u!==void 0?this.#u:this.#u=this.#e==="win32"&&this.#n===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#t;return this.#p!==void 0?this.#p:this.#p=this.#e==="win32"&&this.#n===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#t;return this.#c!==void 0?this.#c:this.#c=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#t[0];return typeof e=="string"&&this.isAbsolute()&&this.#n===0?e:""}checkFollowGlobstar(){return!(this.#n===0||!this.isGlobstar()||!this.#f)}markFollowGlobstar(){return this.#n===0||!this.isGlobstar()||!this.#f?!1:(this.#f=!1,!0)}}});var Cge,Jd,bO=Me(()=>{Gc();yO();Cge=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Jd=class{static{a(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:n,noext:i,noglobstar:s,platform:o=Cge}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:n,noext:i,noglobstar:s,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let c of e)this.add(c)}add(e){let t=new Yi(e,this.mmopts);for(let n=0;n<t.set.length;n++){let i=t.set[n],s=t.globParts[n];if(!i||!s)throw new Error("invalid pattern object");for(;i[0]==="."&&s[0]===".";)i.shift(),s.shift();let o=new Qd(i,s,0,this.platform),c=new Yi(o.globString(),this.mmopts),l=s[s.length-1]==="**",u=o.isAbsolute();u?this.absolute.push(c):this.relative.push(c),l&&(u?this.absoluteChildren.push(c):this.relativeChildren.push(c))}}ignored(e){let t=e.fullpath(),n=`${t}/`,i=e.relative()||".",s=`${i}/`;for(let o of this.relative)if(o.match(i)||o.match(s))return!0;for(let o of this.absolute)if(o.match(t)||o.match(n))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",n=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(n))return!0;for(let i of this.absoluteChildren)if(i.match(t))return!0;return!1}}});var _O,SO,wO,ag,I6=Me(()=>{Gc();_O=class r{static{a(this,"HasWalkedCache")}store;constructor(e=new Map){this.store=e}copy(){return new r(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let n=e.fullpath(),i=this.store.get(n);i?i.add(t.globString()):this.store.set(n,new Set([t.globString()]))}},SO=class{static{a(this,"MatchRecord")}store=new Map;add(e,t,n){let i=(t?2:0)|(n?1:0),s=this.store.get(e);this.store.set(e,s===void 0?i:i&s)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}},wO=class{static{a(this,"SubWalks")}store=new Map;add(e,t){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(i=>i.globString()===t.globString())||n.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},ag=class r{static{a(this,"Processor")}hasWalkedCache;matches=new SO;subwalks=new wO;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new _O}processPatterns(e,t){this.patterns=t;let n=t.map(i=>[e,i]);for(let[i,s]of n){this.hasWalkedCache.storeWalked(i,s);let o=s.root(),c=s.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let d=s.rest();if(d)s=d;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let l,u,f=!1;for(;typeof(l=s.pattern())=="string"&&(u=s.rest());)i=i.resolve(l),s=u,f=!0;if(l=s.pattern(),u=s.rest(),f){if(this.hasWalkedCache.hasWalked(i,s))continue;this.hasWalkedCache.storeWalked(i,s)}if(typeof l=="string"){let d=l===".."||l===""||l===".";this.matches.add(i.resolve(l),c,d);continue}else if(l===vr){(!i.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(i,s);let d=u?.pattern(),p=u?.rest();if(!u||(d===""||d===".")&&!p)this.matches.add(i,c,d===""||d===".");else if(d===".."){let h=i.parent||i;p?this.hasWalkedCache.hasWalked(h,p)||this.subwalks.add(h,p):this.matches.add(h,c,!0)}}else l instanceof RegExp&&this.subwalks.add(i,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new r(this.opts,this.hasWalkedCache)}filterEntries(e,t){let n=this.subwalks.get(e),i=this.child();for(let s of t)for(let o of n){let c=o.isAbsolute(),l=o.pattern(),u=o.rest();l===vr?i.testGlobstar(s,o,u,c):l instanceof RegExp?i.testRegExp(s,l,u,c):i.testString(s,l,u,c)}return i}testGlobstar(e,t,n,i){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(n&&t.checkFollowGlobstar()?this.subwalks.add(e,n):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),n){let s=n.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,n.rest(),i);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,n)}else s instanceof RegExp&&this.testRegExp(e,s,n.rest(),i)}}testRegExp(e,t,n,i){t.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}testString(e,t,n,i){e.isNamed(t)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}}});var xge,vw,cg,lg,R6=Me(()=>{pO();bO();I6();xge=a((r,e)=>typeof r=="string"?new Jd([r],e):Array.isArray(r)?new Jd(r,e):r,"makeIgnore"),vw=class{static{a(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#t=[];#r;#n;signal;maxDepth;includeChildMatches;constructor(e,t,n){if(this.patterns=e,this.path=t,this.opts=n,this.#n=!n.posix&&n.platform==="win32"?"\\":"/",this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#r=xge(n.ignore??[],n),!this.includeChildMatches&&typeof this.#r.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener("abort",()=>{this.#t.length=0}))}#e(e){return this.seen.has(e)||!!this.#r?.ignored?.(e)}#i(e){return!!this.#r?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#t.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#t.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=await s.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(s,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#e(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=s.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(s,t)}matchFinish(e,t){if(this.#e(e))return;if(!this.includeChildMatches&&this.#r?.add){let s=`${e.relativePosix()}/**`;this.#r.add(s)}let n=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#n:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+i)}else{let s=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!s.startsWith(".."+this.#n)?"."+this.#n:"";this.matchEmit(s?o+s+i:"."+i)}}async match(e,t,n){let i=await this.matchCheck(e,n);i&&this.matchFinish(i,t)}matchSync(e,t,n){let i=this.matchCheckSync(e,n);i&&this.matchFinish(i,t)}walkCB(e,t,n){this.signal?.aborted&&n(),this.walkCB2(e,t,new ag(this.opts),n)}walkCB2(e,t,n,i){if(this.#i(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,t,n,i));return}n.processPatterns(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of n.matches.entries())this.#e(c)||(s++,this.match(c,l,u).then(()=>o()));for(let c of n.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;s++;let l=c.readdirCached();c.calledReaddir()?this.walkCB3(c,l,n,o):c.readdirCB((u,f)=>this.walkCB3(c,f,n,o),!0)}o()}walkCB3(e,t,n,i){n=n.filterEntries(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of n.matches.entries())this.#e(c)||(s++,this.match(c,l,u).then(()=>o()));for(let[c,l]of n.subwalks.entries())s++,this.walkCB2(c,l,n.child(),o);o()}walkCBSync(e,t,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,t,new ag(this.opts),n)}walkCB2Sync(e,t,n,i){if(this.#i(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,n,i));return}n.processPatterns(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of n.matches.entries())this.#e(c)||this.matchSync(c,l,u);for(let c of n.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;s++;let l=c.readdirSync();this.walkCB3Sync(c,l,n,o)}o()}walkCB3Sync(e,t,n,i){n=n.filterEntries(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of n.matches.entries())this.#e(c)||this.matchSync(c,l,u);for(let[c,l]of n.subwalks.entries())s++,this.walkCB2Sync(c,l,n.child(),o);o()}},cg=class extends vw{static{a(this,"GlobWalker")}matches=new Set;constructor(e,t,n){super(e,t,n)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},lg=class extends vw{static{a(this,"GlobStream")}results;constructor(e,t,n){super(e,t,n),this.results=new zc({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}}});var C6,Oge,Ys,EO=Me(()=>{Gc();C6=require("node:url");A6();yO();R6();Oge=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Ys=class{static{a(this,"Glob")}absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,t){if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=(0,C6.fileURLToPath)(t.cwd)):this.cwd="",this.cwd=t.cwd||"",this.root=t.root,this.magicalBraces=!!t.magicalBraces,this.nobrace=!!t.nobrace,this.noext=!!t.noext,this.realpath=!!t.realpath,this.absolute=t.absolute,this.includeChildMatches=t.includeChildMatches!==!1,this.noglobstar=!!t.noglobstar,this.matchBase=!!t.matchBase,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:1/0,this.stat=!!t.stat,this.ignore=t.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(l=>l.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(l=>l.includes("/")?l:`./**/${l}`)}if(this.pattern=e,this.platform=t.platform||Oge,this.opts={...t,platform:this.platform},t.scurry){if(this.scurry=t.scurry,t.nocase!==void 0&&t.nocase!==t.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let l=t.platform==="win32"?Yd:t.platform==="darwin"?og:t.platform?Xd:T6;this.scurry=new l(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",i={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(l=>new Yi(l,i)),[o,c]=s.reduce((l,u)=>(l[0].push(...u.set),l[1].push(...u.globParts),l),[[],[]]);this.patterns=o.map((l,u)=>{let f=c[u];if(!f)throw new Error("invalid pattern object");return new Qd(l,f,0,this.platform)})}async walk(){return[...await new cg(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 cg(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 lg(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 lg(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 vO,TO=Me(()=>{Gc();vO=a((r,e={})=>{Array.isArray(r)||(r=[r]);for(let t of r)if(new Yi(t,e).hasMagic())return!0;return!1},"hasMagic")});function Tw(r,e={}){return new Ys(r,e).streamSync()}function O6(r,e={}){return new Ys(r,e).stream()}function P6(r,e={}){return new Ys(r,e).walkSync()}async function x6(r,e={}){return new Ys(r,e).walk()}function Aw(r,e={}){return new Ys(r,e).iterateSync()}function F6(r,e={}){return new Ys(r,e).iterate()}var Pge,Fge,Dge,Lge,Nge,Zd,AO=Me(()=>{Gc();EO();TO();Gc();EO();TO();bO();a(Tw,"globStreamSync");a(O6,"globStream");a(P6,"globSync");a(x6,"glob_");a(Aw,"globIterateSync");a(F6,"globIterate");Pge=Tw,Fge=Object.assign(O6,{sync:Tw}),Dge=Aw,Lge=Object.assign(F6,{sync:Aw}),Nge=Object.assign(P6,{stream:Tw,iterate:Aw}),Zd=Object.assign(x6,{glob:x6,globSync:P6,sync:Nge,globStream:O6,stream:Fge,globStreamSync:Tw,streamSync:Pge,globIterate:F6,iterate:Lge,globIterateSync:Aw,iterateSync:Dge,Glob:Ys,hasMagic:vO,escape:Wd,unescape:zs});Zd.glob=Zd});async function L6(r,e,t,n={}){let{dryRun:i=!1,excludeRelPath:s}=n,o=_u.default.join(r,"**/*.md"),c=await Zd(o,{nodir:!0,ignore:[_u.default.join(r,".obsidian/**"),_u.default.join(r,".trash/**"),_u.default.join(r,"**/.obsidian/**"),_u.default.join(r,"**/.trash/**")]}),l={filesScanned:0,filesModified:0,replacements:0,modifiedFiles:[]};for(let u of c){let f=_u.default.relative(r,u);if(s&&f===s)continue;l.filesScanned+=1;let d;try{d=await IO.default.readFile(u,"utf-8")}catch{continue}let{updated:p,replacements:h}=kge(d,e,t);h>0&&(l.filesModified+=1,l.replacements+=h,l.modifiedFiles.push(f),i||await IO.default.writeFile(u,p,"utf-8"))}return l}function kge(r,e,t){let n=r.split(/(^```[\s\S]*?^```)/m),i=0;for(let s=0;s<n.length;s++){if(s%2===1)continue;let o=n[s],c=Mge(o,e,t);i+=c.replacements,n[s]=c.updated}return{updated:n.join(""),replacements:i}}function Mge(r,e,t){let n=r.split(/(`[^`\n]*`)/),i=0;for(let s=0;s<n.length;s++){if(s%2===1)continue;let o=jge(n[s],e,t);i+=o.replacements,n[s]=o.updated}return{updated:n.join(""),replacements:i}}function jge(r,e,t){let n=/(?<!!)\[\[([^\[\]\n|#^]+)((?:[#^][^\[\]\n|]*)?)(?:\|[^\[\]\n]*)?\]\]/g,i=0;return{updated:r.replace(n,(o,c,l)=>c.trim()!==e?o:(i+=1,`[[${t}${l}]]`)),replacements:i}}var IO,_u,N6=Me(()=>{"use strict";IO=Q(ko()),_u=Q(require("path"));AO();a(L6,"rewriteInboundWikilinks");a(kge,"rewriteContent");a(Mge,"rewriteProseSegment");a(jge,"replaceWikilinks")});var Nr,ur,Iw,$ge,Ht,Xs=Me(()=>{"use strict";Nr=Q(ko()),ur=Q(require("path"));Wm();Iw=Q(Fe());N6();$ge=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Ht=class r{constructor(e){this.rootPath=e;this.uuidIndex=null;this.basenameIndex=null;this.aliasIndex=null}static{a(this,"FileSystemVaultAdapter")}async read(e){let t=this.resolvePath(e.path);if(!await Nr.default.pathExists(t))throw new Error(`File not found: ${e.path}`);return Nr.default.readFile(t,"utf-8")}async create(e,t){let n=this.resolvePath(e);if(await Nr.default.pathExists(n))throw new Error(`File already exists: ${e}`);return await Nr.default.ensureDir(ur.default.dirname(n)),await Nr.default.writeFile(n,t,"utf-8"),this.createFileObject(e)}async modify(e,t){let n=this.resolvePath(e.path);if(!await Nr.default.pathExists(n))throw new Error(`File not found: ${e.path}`);await Nr.default.writeFile(n,t,"utf-8")}async delete(e){let t=this.resolvePath(e.path);if(!await Nr.default.pathExists(t))throw new Error(`File not found: ${e.path}`);await Nr.default.remove(t)}async exists(e){let t=this.resolvePath(e);return Nr.default.pathExists(t)}getAbstractFileByPath(e){let t=this.resolvePath(e);try{let n=Nr.default.statSync(t);if(n.isFile())return this.createFileObject(e);if(n.isDirectory())return this.createFolderObject(e)}catch{return null}return null}getAllFiles(){let e=[];return this.walkDirectory(this.rootPath,t=>{if(t.endsWith(".md")){let n=ur.default.relative(this.rootPath,t);e.push(this.createFileObject(n))}}),e}getFrontmatter(e){try{let t=Nr.default.readFileSync(this.resolvePath(e.path),"utf-8");return this.extractFrontmatter(t)}catch{return null}}async updateFrontmatter(e,t){let n=await this.read(e),i=this.extractFrontmatter(n),s=r.FRONTMATTER_BLOCK.exec(n)?.[1];if(i===null&&s!==void 0&&s.trim()!=="")throw new Error(`updateFrontmatter: frontmatter of ${e.path} is not parseable \u2014 refusing to patch (would drop keys)`);let o=i??{},c=t({...o});Iw.FrontmatterService.applyPatch(o,c);let l=this.replaceFrontmatter(n,o);await this.modify(e,l)}async rename(e,t){let n=this.resolvePath(e.path),i=this.resolvePath(t);if(!await Nr.default.pathExists(n))throw new Error(`File not found: ${e.path}`);await Nr.default.ensureDir(ur.default.dirname(i)),await Nr.default.move(n,i)}async createFolder(e){let t=this.resolvePath(e);await Nr.default.ensureDir(t)}getFirstLinkpathDest(e,t,n){let i=e.split("|")[0].trim();if(!i)return null;if($ge.test(i)){this.uuidIndex===null&&this.buildUuidIndex();let u=i.toLowerCase(),f=this.uuidIndex.get(u);return f?this.createFileObject(f):null}let s=ur.default.dirname(this.resolvePath(t)),o;if(ur.default.isAbsolute(i)?o=this.resolvePath(i):o=ur.default.resolve(s,i),i.endsWith(".md")||(o+=".md"),Nr.default.existsSync(o)){let u=ur.default.relative(this.rootPath,o);return this.createFileObject(u)}(this.basenameIndex===null||this.aliasIndex===null)&&this.buildLinkpathIndex();let c=i.toLowerCase(),l=this.basenameIndex.get(c);if(l)return this.createFileObject(l);if(n?.allowAliasFallback!==!1){let u=this.aliasIndex.get(c);if(u)return this.createFileObject(u)}return null}buildLinkpathIndex(){this.basenameIndex=new Map,this.aliasIndex=new Map,this.walkDirectory(this.rootPath,e=>{if(!e.endsWith(".md"))return;let t=ur.default.relative(this.rootPath,e),n=ur.default.basename(e,".md").toLowerCase();this.basenameIndex.has(n)||this.basenameIndex.set(n,t);let i;try{i=Nr.default.readFileSync(e,"utf-8")}catch{return}let s=this.extractFrontmatter(i);if(!s)return;let o=s.aliases,c=Array.isArray(o)?o:typeof o=="string"?[o]:[];for(let l of c){if(typeof l!="string")continue;let u=l.trim().toLowerCase();u&&(this.aliasIndex.has(u)||this.aliasIndex.set(u,t))}})}buildUuidIndex(){this.uuidIndex=new Map,this.walkDirectory(this.rootPath,e=>{if(e.endsWith(".md")){let n=ur.default.basename(e,".md").match(/^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i);if(n){let i=n[1].toLowerCase(),s=ur.default.relative(this.rootPath,e);this.uuidIndex.set(i,s)}}})}async process(e,t){let n=await this.read(e),i=t(n);return await this.modify(e,i),i}getDefaultNewFileParent(){return{path:"",name:""}}async updateLinks(e,t,n){let i=ur.default.basename(t,".md");await L6(this.rootPath,n,i,{excludeRelPath:e})}resolvePath(e){if(ur.default.isAbsolute(e))return e;let t=this.rootPath.replace(/[/\\]+$/,""),n=ur.default.sep+e;return n===t||n.startsWith(t+ur.default.sep)?n:ur.default.join(this.rootPath,e)}createFileObject(e){let t=ur.default.basename(e),n=ur.default.basename(e,ur.default.extname(e)),i=ur.default.dirname(e);return{path:e,basename:n,name:t,parent:i!=="."?this.createFolderObject(i):null}}createFolderObject(e){return{path:e,name:ur.default.basename(e)}}static{this.FRONTMATTER_BLOCK=/^---\n([\s\S]*?)\n---/}extractFrontmatter(e){let t=e.match(r.FRONTMATTER_BLOCK);return t?(0,Iw.parseYamlFrontmatterTolerant)(t[1]):null}replaceFrontmatter(e,t){let i=`---
|
|
427
|
+
`)}return n}function qd(r,e={}){let t={...tme,...e},n=whe(r,t.schema,{noRefs:t.noRefs,skipInvalid:t.skipInvalid});return t.flowLevel>=0&&vhe(n,(i,s)=>{if(!(s.depth<t.flowLevel))return i.style.flow=!0,AB}),t.transform(n),eme(n,{...Ix(t,Object.keys(Kx)),schema:t.schema})}var yt,Rde,Cde,xde,Ode,Pde,Fde,Dde,Lde,Nde,kde,Mde,jde,$de,Ude,Bde,Vde,Gde,lB,zde,Hde,Xde,Qde,Tx,epe,tpe,uB,ipe,spe,cpe,lpe,upe,Ax,ppe,hpe,ype,bpe,_pe,wpe,Epe,vpe,Tpe,Ape,Ipe,nw,Bx,ALe,mu,Vx,Ope,ILe,RLe,Ppe,Bc,br,In,Vc,Ki,Dpe,pB,hB,Bpe,kd,Vpe,qx,wt,_B,Ud,Rx,SB,ZS,Kpe,Ype,wB,Cx,EB,Xpe,Qpe,Jpe,Wx,yhe,YS,lu,Ehe,AB,zx,The,hu,IB,Ahe,Ihe,RB,Px,Rhe,Che,CB,xhe,Fx,Hx,Bm,Ohe,Phe,xB,Fhe,Dx,Lx,Dhe,Nx,Lhe,kx,Wn,Kx,Gm,Um,Yx,Xx,Uc,tme,CLe,xLe,OLe,PLe,FLe,DLe,LLe,NLe,kLe,MLe,jLe,$Le,ULe,BLe,VLe,GLe,Wm=Me(()=>{yt=Symbol("NOT_RESOLVED");a(qn,"defineScalarTag");a(Ux,"defineSequenceTag");a(tw,"defineMappingTag");Rde=qn("tag:yaml.org,2002:str",{resolve:a(r=>r,"resolve"),identify:a(r=>typeof r=="string","identify")}),Cde=["","~","null","Null","NULL"],xde=qn("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:a(r=>Cde.indexOf(r)!==-1?null:yt,"resolve"),identify:a(r=>r===null,"identify"),represent:a(()=>"null","represent")}),Ode=qn("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["n"],resolve:a((r,e)=>r==="null"||e&&r===""?null:yt,"resolve"),identify:a(r=>r===null,"identify"),represent:a(()=>"null","represent")}),Pde=["","~","null","Null","NULL"],Fde=qn("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:a(r=>Pde.indexOf(r)!==-1?null:yt,"resolve"),identify:a(r=>r===null,"identify"),represent:a(()=>"null","represent")}),Dde=["true","True","TRUE"],Lde=["false","False","FALSE"],Nde=qn("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","T","f","F"],resolve:a(r=>Dde.indexOf(r)!==-1?!0:Lde.indexOf(r)!==-1?!1:yt,"resolve"),identify:a(r=>Object.prototype.toString.call(r)==="[object Boolean]","identify"),represent:a(r=>r?"true":"false","represent")}),kde=["true"],Mde=["false"],jde=qn("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","f"],resolve:a(r=>kde.indexOf(r)!==-1?!0:Mde.indexOf(r)!==-1?!1:yt,"resolve"),identify:a(r=>Object.prototype.toString.call(r)==="[object Boolean]","identify"),represent:a(r=>r?"true":"false","represent")}),$de=["true","True","TRUE","y","Y","yes","Yes","YES","on","On","ON"],Ude=["false","False","FALSE","n","N","no","No","NO","off","Off","OFF"],Bde=qn("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["y","Y","n","N","t","T","f","F","o","O"],resolve:a(r=>$de.indexOf(r)!==-1?!0:Ude.indexOf(r)!==-1?!1:yt,"resolve"),identify:a(r=>Object.prototype.toString.call(r)==="[object Boolean]","identify"),represent:a(r=>r?"true":"false","represent")}),Vde=new RegExp("^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$"),Gde=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");a(qde,"parseYamlInteger$2");a(Wde,"resolveYamlInteger$2");lB=qn("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:Wde,identify:a(r=>Number.isInteger(r)&&!Object.is(r,-0)&&r.toString(10).indexOf("e")<0,"identify"),represent:a(r=>r.toString(10),"represent")}),zde=new RegExp("^-?(?:0|[1-9][0-9]*)$"),Hde=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");a(Kde,"parseYamlInteger$1");a(Yde,"resolveYamlInteger$1");Xde=qn("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:Yde,identify:a(r=>Number.isInteger(r)&&!Object.is(r,-0)&&r.toString(10).indexOf("e")<0,"identify"),represent:a(r=>r.toString(10),"represent")}),Qde=new RegExp("^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$");a(Jde,"parseYamlInteger");a(Zde,"resolveYamlInteger");Tx=qn("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:Zde,identify:a(r=>Number.isInteger(r)&&!Object.is(r,-0)&&r.toString(10).indexOf("e")<0,"identify"),represent:a(r=>r.toString(10),"represent")}),epe=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),tpe=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");a(rpe,"resolveYamlFloat$2");a(npe,"representYamlFloat$2");uB=qn("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:rpe,identify:a(r=>typeof r=="number"&&(!Number.isInteger(r)||Object.is(r,-0)||r.toString(10).indexOf("e")>=0),"identify"),represent:npe}),ipe=new RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$"),spe=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");a(ope,"resolveYamlFloat$1");a(ape,"representYamlFloat$1");cpe=qn("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:ope,identify:a(r=>typeof r=="number"&&(!Number.isInteger(r)||Object.is(r,-0)||r.toString(10).indexOf("e")>=0),"identify"),represent:ape}),lpe=new RegExp("^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),upe=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");a(fpe,"resolveYamlFloat");a(dpe,"representYamlFloat");Ax=qn("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:fpe,identify:a(r=>typeof r=="number"&&(!Number.isInteger(r)||Object.is(r,-0)||r.toString(10).indexOf("e")>=0),"identify"),represent:dpe}),ppe=qn("tag:yaml.org,2002:merge",{implicit:!0,implicitFirstChars:["<"],resolve:a((r,e)=>r==="<<"||e&&r===""?"<<":yt,"resolve"),identify:a(()=>!1,"identify")}),hpe=/^[A-Za-z0-9+/]*={0,2}$/;a(mpe,"resolveYamlBinary");a(gpe,"representYamlBinary");ype=qn("tag:yaml.org,2002:binary",{resolve:mpe,identify:a(r=>Object.prototype.toString.call(r)==="[object Uint8Array]","identify"),represent:gpe}),bpe=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),_pe=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");a(W5,"makeUtcDate");a(Spe,"resolveYamlTimestamp");wpe=qn("tag:yaml.org,2002:timestamp",{implicit:!0,implicitFirstChars:[..."0123456789"],resolve:Spe,identify:a(r=>r instanceof Date,"identify"),represent:a(r=>r.toISOString(),"represent")}),Epe=Ux("tag:yaml.org,2002:seq",{create:a(()=>[],"create"),addItem:a((r,e)=>{r.push(e)},"addItem"),identify:Array.isArray});a(rw,"isPlainObject");a(Ix,"pick");vpe=Ux("tag:yaml.org,2002:omap",{create:a(()=>({list:[],seen:new Set}),"create"),addItem:a((r,e)=>{let t;if(e instanceof Map){if(e.size!==1)return"cannot resolve an ordered map item";t=e.keys().next().value}else if(rw(e)){let n=Object.keys(e);if(n.length!==1)return"cannot resolve an ordered map item";t=n[0]}else return"cannot resolve an ordered map item";return r.seen.has(t)?"duplicate key in ordered map":(r.seen.add(t),r.list.push(e),"")},"addItem"),finalize:a(r=>r.list,"finalize"),identify:a(()=>!1,"identify")}),Tpe=Ux("tag:yaml.org,2002:pairs",{create:a(()=>[],"create"),addItem:a((r,e)=>{if(e instanceof Map)return e.size!==1?"cannot resolve a pairs item":(r.push(e.entries().next().value),"");if(Object.prototype.toString.call(e)!=="[object Object]")return"cannot resolve a pairs item";let t=e,n=Object.keys(t);return n.length!==1?"cannot resolve a pairs item":(r.push([n[0],t[n[0]]]),"")},"addItem"),identify:a(()=>!1,"identify")}),Ape=tw("tag:yaml.org,2002:map",{create:a(()=>({}),"create"),identify:rw,represent:a(r=>{let e=new Map;for(let t of Object.keys(r))e.set(t,r[t]);return e},"represent"),addPair:a((r,e,t)=>{if(e!==null&&typeof e=="object")return"object-based map does not support complex keys";let n=String(e);return n==="__proto__"?Object.defineProperty(r,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[n]=t,""},"addPair"),has:a((r,e)=>e!==null&&typeof e=="object"?!1:Object.prototype.hasOwnProperty.call(r,String(e)),"has"),keys:a(r=>Object.keys(r),"keys"),get:a((r,e)=>{let t=String(e);return Object.prototype.hasOwnProperty.call(r,t)?r[t]:null},"get")}),Ipe=tw("tag:yaml.org,2002:set",{create:a(()=>new Set,"create"),identify:a(r=>r instanceof Set,"identify"),represent:a(r=>{let e=new Map;for(let t of r)e.set(t,null);return e},"represent"),addPair:a((r,e,t)=>t!==null?"cannot resolve a set item":(r.add(e),""),"addPair"),has:a((r,e)=>r.has(e),"has"),keys:a(r=>r.keys(),"keys"),get:a(()=>null,"get")});a(Rpe,"createTagDefinitionMap");a(Cpe,"createTagDefinitionListMap");a(xpe,"compileTags");nw=class fB{static{a(this,"Schema")}tags;implicitScalarTags;implicitScalarByFirstChar;implicitScalarAnyFirstChar;defaultScalarTag;defaultSequenceTag;defaultMappingTag;exact;prefix;constructor(e){let t=xpe(e),n=[],i=Rpe(),s=Cpe();for(let f of t){if(f.nodeKind==="scalar"&&f.implicit){if(f.matchByTagPrefix)throw new Error("Implicit scalar tags cannot match by tag prefix");n.push(f)}switch(f.nodeKind){case"scalar":f.matchByTagPrefix?s.scalar.push(f):i.scalar[f.tagName]=f;break;case"sequence":f.matchByTagPrefix?s.sequence.push(f):i.sequence[f.tagName]=f;break;case"mapping":f.matchByTagPrefix?s.mapping.push(f):i.mapping[f.tagName]=f;break}}let o=n.filter(f=>f.implicitFirstChars===null),c=new Set;for(let f of n)if(f.implicitFirstChars!==null)for(let d of f.implicitFirstChars)c.add(d);let l=new Map;for(let f of c)l.set(f,n.filter(d=>d.implicitFirstChars===null||d.implicitFirstChars.indexOf(f)!==-1));let u=i.scalar["tag:yaml.org,2002:str"];if(!u)throw new Error("schema does not define the default scalar tag (tag:yaml.org,2002:str)");this.tags=t,this.implicitScalarTags=n,this.implicitScalarByFirstChar=l,this.implicitScalarAnyFirstChar=o,this.defaultScalarTag=u,this.defaultSequenceTag=i.sequence["tag:yaml.org,2002:seq"],this.defaultMappingTag=i.mapping["tag:yaml.org,2002:map"],this.exact=i,this.prefix=s}lookupScalarTag(e){let t=this.exact.scalar[e];if(t)return t;for(let n of this.prefix.scalar)if(e.startsWith(n.tagName))return n}lookupSequenceTag(e){let t=this.exact.sequence[e];if(t)return t;for(let n of this.prefix.sequence)if(e.startsWith(n.tagName))return n}lookupMappingTag(e){let t=this.exact.mapping[e];if(t)return t;for(let n of this.prefix.mapping)if(e.startsWith(n.tagName))return n}resolveImplicitScalarTag(e){let t=this.implicitScalarByFirstChar.get(e.charAt(0))??this.implicitScalarAnyFirstChar;for(let i of t){let s=i.resolve(e,!1,i.tagName);if(s!==yt)return{value:s,tag:i}}let n=this.defaultScalarTag;return{value:n.resolve(e,!1,n.tagName),tag:n}}withTags(...e){let t=[];for(let n of e)t=t.concat(n);return new fB([...this.tags,...t])}},Bx=new nw([Rde,Epe,Ape]),ALe=new nw([...Bx.tags,Ode,jde,Xde,cpe]),mu=new nw([...Bx.tags,xde,Nde,lB,uB]),Vx=new nw([...Bx.tags,Fde,Bde,Tx,Ax,wpe,ppe,ype,vpe,Tpe,Ipe]),Ope=Vx.withTags({...Tx,resolve:a((r,e,t)=>{let n=Tx.resolve(r,e,t);return n===yt?lB.resolve(r,e,t):n},"resolve")},{...Ax,resolve:a((r,e,t)=>{let n=Ax.resolve(r,e,t);return n===yt?uB.resolve(r,e,t):n},"resolve")}),ILe=tw("tag:yaml.org,2002:map",{create:a(()=>new Map,"create"),addPair:a((r,e,t)=>(r.set(e,t),""),"addPair"),has:a((r,e)=>r.has(e),"has"),keys:a(r=>r.keys(),"keys"),get:a((r,e)=>r.get(e),"get"),identify:a(r=>r instanceof Map||rw(r),"identify"),represent:a(r=>{if(r instanceof Map)return r;let e=new Map,t=r;for(let n of Object.keys(t))e.set(n,t[n]);return e},"represent")});a(z5,"normalizeKey");RLe=tw("tag:yaml.org,2002:map",{create:a(()=>({}),"create"),identify:rw,represent:a(r=>{let e=new Map;for(let t of Object.keys(r))e.set(t,r[t]);return e},"represent"),addPair:a((r,e,t)=>{let n=z5(e);return n===null?"nested arrays are not supported inside keys":(n==="__proto__"?Object.defineProperty(r,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[n]=t,"")},"addPair"),has:a((r,e)=>{let t=z5(e);return t!==null&&Object.prototype.hasOwnProperty.call(r,t)},"has"),keys:a(r=>Object.keys(r),"keys"),get:a((r,e)=>{let t=String(e);return Object.prototype.hasOwnProperty.call(r,t)?r[t]:null},"get")}),Ppe={maxLength:79,indent:1,linesBefore:3,linesAfter:2};a(bx,"getLine");a(_x,"padStart");a(Fpe,"makeSnippet");a(H5,"formatError");Bc=class dB extends Error{static{a(this,"YAMLException")}reason;mark;constructor(e,t){super(),this.name="YAMLException",this.reason=e,this.mark=t,this.message=H5(this,!1),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toString(e){return`${this.name}: ${H5(this,e)}`}static throwAt(e,t,n,i=""){let s=0,o=0;for(let l=0;l<t;l++){let u=e.charCodeAt(l);u===10?(s++,o=l+1):u===13&&(s++,e.charCodeAt(l+1)===10&&l++,o=l+1)}let c={name:i,buffer:e,position:t,line:s,column:t-o};throw c.snippet=Fpe(c),new dB(n,c)}},br={DOCUMENT:1,SEQUENCE:2,MAPPING:3,SCALAR:4,ALIAS:5,POP:6},In={PLAIN:1,SINGLE_QUOTED:2,DOUBLE_QUOTED:3,LITERAL_BLOCK:4,FOLDED_BLOCK:5},Vc={BLOCK:1,FLOW:2},Ki={CLIP:1,STRIP:2,KEEP:3},Dpe=-1;a(K5,"simpleEscapeSequence");pB=new Array(256),hB=new Array(256);for(let r=0;r<256;r++)pB[r]=K5(r)?1:0,hB[r]=K5(r);a(Lpe,"charFromCodepoint");a(Npe,"fromHexCode$1");a(kpe,"escapedHexLen$1");a(JS,"skipFoldedBreaks");a(Gx,"foldedBreaks");a(Mpe,"getPlainValue");a(jpe,"getSingleQuotedValue");a($pe,"getDoubleQuotedValue");a(Y5,"getBlockValue");a(Upe,"getScalarValue");Bpe=Object.assign(Object.create(null),{"!":"!","!!":"tag:yaml.org,2002:"});a(Sx,"tagPercentEncode");a(mB,"tagNameFull");a(gB,"tagNameShort");kd=-1,Vpe="tag:yaml.org,2002:merge",qx={filename:"",schema:mu,json:!1,maxTotalMergeKeys:1e4,maxAliases:-1};a(Gpe,"eventPosition$1");a(Gn,"throwError$1");a(yB,"finalizeCollection");a(qpe,"constructScalar");a(X5,"collectionTagName");a(bB,"isMappingTag");a(Q5,"mergeKeys");a(Wpe,"mergeSource");a(zpe,"addMappingValue");a(wx,"addValue");a(Ex,"storeAnchor");a(Hpe,"constructFromEvents");wt=-1,_B=Object.prototype.hasOwnProperty,Ud=1,Rx=2,SB=3,ZS=4,Kpe=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Ype=/[,\[\]{}]/,wB=/^(?:!|!!|![0-9A-Za-z-]+!)$/,Cx=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`,EB=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`,Xpe=new RegExp(`^(?:${Cx})*$`),Qpe=new RegExp(`^(?:${EB})+$`),Jpe=new RegExp(`^(?:!(?:${Cx})*|${EB}(?:${Cx})*)$`),Wx={filename:"",maxDepth:100};a(Zpe,"addDocumentEvent");a(vB,"addSequenceEvent");a(xx,"addMappingEvent");a(J5,"insertFlowPairMappingEvent");a(Vd,"addScalarEvent");a(ehe,"addAliasEvent");a(Md,"addPopEvent");a(di,"addEmptyScalarEvent");a(Z5,"emptyProperties");a($m,"snapshotState");a(jd,"restoreState");a(Ue,"throwError");a(rn,"isEol");a(du,"isWhiteSpace");a(Ws,"isWsOrEol");a(Ba,"isWsOrEolOrEnd");a(pu,"isFlowIndicator");a(the,"fromDecimalCode");a(rhe,"fromHexCode");a(nhe,"escapedHexLen");a(ihe,"isSimpleEscape");a(ew,"consumeLineBreak");a(pi,"skipSeparationSpace");a(uu,"testDocumentSeparator");a(eB,"skipUntilLineEnd");a(TB,"checkPrintable");a(she,"readTagProperty");a(ohe,"readAnchorProperty");a(ahe,"readAlias");a(Ox,"readFlowScalarBreak");a(che,"readSingleQuotedScalar");a(lhe,"readDoubleQuotedScalar");a(uhe,"readBlockScalar");a(fhe,"canStartPlainScalar");a(dhe,"readPlainScalar");a(Mm,"skipFlowSeparationSpace");a(phe,"readFlowCollection");a(tB,"readBlockSequence");a(vx,"readBlockMapping");a(fu,"parseNode");a(hhe,"readDirective");a(mhe,"readDocument");a(ghe,"parseEvents");yhe={...Wx,...qx};a(bhe,"loadDocuments");a(Gd,"load");YS=class{static{a(this,"Style")}tagged=!1;flow=!1;singleQuoted=!1;doubleQuoted=!1;literal=!1;folded=!1},lu=Symbol("INVALID");a(_he,"buildRepresentTypes");a(She,"matchTag");a(jm,"build");a(whe,"jsToAst");Ehe=Symbol("visit:break"),AB=Symbol("visit:skip");a(QS,"visitNode");a(vhe,"visit");zx=65279,The=9,hu=10,IB=13,Ahe=32,Ihe=33,RB=34,Px=35,Rhe=37,Che=38,CB=39,xhe=42,Fx=44,Hx=45,Bm=58,Ohe=61,Phe=62,xB=63,Fhe=64,Dx=91,Lx=93,Dhe=96,Nx=123,Lhe=124,kx=125,Wn={};Wn[0]="\\0";Wn[7]="\\a";Wn[8]="\\b";Wn[9]="\\t";Wn[10]="\\n";Wn[11]="\\v";Wn[12]="\\f";Wn[13]="\\r";Wn[27]="\\e";Wn[34]='\\"';Wn[92]="\\\\";Wn[133]="\\N";Wn[160]="\\_";Wn[8232]="\\L";Wn[8233]="\\P";Kx={indent:2,seqNoIndent:!1,seqInlineFirst:!0,sortKeys:!1,lineWidth:80,flowBracketPadding:!1,flowSkipCommaSpace:!1,flowSkipColonSpace:!1,quoteFlowKeys:!1,quoteStyle:"single",forceQuotes:!1,tagBeforeAnchor:!1};a(Nhe,"nodeTagShort");a(khe,"createPresenterState");a(Mhe,"encodeNonPrintable");a(rB,"indentString");a(Mx,"generateNextLine");a(jhe,"scalarLayout");a(Bd,"isWhitespace");a($he,"startsWithDocumentSeparator");a(Vm,"isPrintable");a(nB,"isNsCharOrWhitespace");a(jx,"isPlainSafe");a(Uhe,"isPlainSafeFirst");a(Bhe,"isPlainSafeAtStart");a(Vhe,"isPlainSafeLast");a($d,"codePointAt");a(OB,"needIndentIndicator");Gm=1,Um=2,Yx=3,Xx=4,Uc=5;a(Ghe,"chooseScalarStyle");a(qhe,"renderScalarStyle");a(Whe,"resolveScalarStyle");a(iB,"blockHeader");a(sB,"encodeFlowBreaks");a(oB,"dropEndingNewline");a(qm,"isMoreIndented");a(zhe,"foldBlockScalar");a(aB,"foldLine");a(Hhe,"escapeString");a(Khe,"writeFlowSequence");a(cB,"writeBlockSequence");a(Yhe,"writeFlowMapping");a(XS,"sortKeyValue");a(PB,"sortMappingItems");a(Xhe,"writeBlockMapping");a($x,"cannotBeCompact");a(Va,"writeNode");a(Qhe,"rootStartsOwnLine");a(Jhe,"isOpenEnded");a(Zhe,"writeDocumentDirectives");a(eme,"present");tme={...Kx,schema:Ope,skipInvalid:!1,noRefs:!1,flowLevel:-1,transform:a(()=>{},"transform")};a(qd,"dump");CLe=br.DOCUMENT,xLe=br.SEQUENCE,OLe=br.MAPPING,PLe=br.SCALAR,FLe=br.ALIAS,DLe=br.POP,LLe=In.PLAIN,NLe=In.SINGLE_QUOTED,kLe=In.DOUBLE_QUOTED,MLe=In.LITERAL_BLOCK,jLe=In.FOLDED_BLOCK,$Le=Vc.BLOCK,ULe=Vc.FLOW,BLe=Ki.CLIP,VLe=Ki.STRIP,GLe=Ki.KEEP});var Qx,FB,rme,DB=Me(()=>{Qx=a((r,e,t)=>{let n=r instanceof RegExp?FB(r,t):r,i=e instanceof RegExp?FB(e,t):e,s=n!==null&&i!=null&&rme(n,i,t);return s&&{start:s[0],end:s[1],pre:t.slice(0,s[0]),body:t.slice(s[0]+n.length,s[1]),post:t.slice(s[1]+i.length)}},"balanced"),FB=a((r,e)=>{let t=e.match(r);return t?t[0]:null},"maybeMatch"),rme=a((r,e,t)=>{let n,i,s,o,c,l=t.indexOf(r),u=t.indexOf(e,l+1),f=l;if(l>=0&&u>0){if(r===e)return[l,u];for(n=[],s=t.length;f>=0&&!c;){if(f===l)n.push(f),l=t.indexOf(r,f+1);else if(n.length===1){let d=n.pop();d!==void 0&&(c=[d,u])}else i=n.pop(),i!==void 0&&i<s&&(s=i,o=u),u=t.indexOf(e,f+1);f=l<u&&l>=0?l:u}n.length&&o!==void 0&&(c=[s,o])}return c},"range")});function Jx(r){return isNaN(r)?r.charCodeAt(0):parseInt(r,10)}function mme(r){return r.replace(cme,LB).replace(lme,NB).replace(ume,eO).replace(fme,kB).replace(dme,MB)}function gme(r){return r.replace(nme,"\\").replace(ime,"{").replace(sme,"}").replace(ome,",").replace(ame,".")}function jB(r){if(!r)return[""];let e=[],t=Qx("{","}",r);if(!t)return r.split(",");let{pre:n,body:i,post:s}=t,o=n.split(",");o[o.length-1]+="{"+i+"}";let c=jB(s);return s.length&&(o[o.length-1]+=c.shift(),o.push.apply(o,c)),e.push.apply(e,o),e}function $B(r,e={}){if(!r)return[];let{max:t=pme,maxLength:n=hme}=e;return r.slice(0,2)==="{}"&&(r="\\{\\}"+r.slice(2)),Zx(mme(r),t,n,!0).map(gme)}function yme(r){return"{"+r+"}"}function bme(r){return/^-?0\d/.test(r)}function _me(r,e){return r<=e}function Sme(r,e){return r>=e}function zm(r,e,t,n,i,s){let o=[],c=0;for(let l=0;l<r.length;l++)for(let u=0;u<t.length;u++){if(o.length>=n)return o;let f=r[l]+e+t[u];if(!(s&&!f)){if(c+f.length>i)return o;o.push(f),c+=f.length}}return o}function wme(r,e,t,n){let i=r.split(/\.\./),s=[];if(i[0]===void 0||i[1]===void 0)return s;let o=Jx(i[0]),c=Jx(i[1]),l=Math.max(i[0].length,i[1].length),u=i.length===3&&i[2]!==void 0?Math.max(Math.abs(Jx(i[2])),1):1,f=_me;c<o&&(u*=-1,f=Sme);let p=i.some(bme),h=0;for(let g=o;f(g,c)&&s.length<t;g+=u){let m;if(e)m=String.fromCharCode(g),m==="\\"&&(m="");else if(m=String(g),p){let b=l-m.length;if(b>0){let _=new Array(b+1).join("0");g<0?m="-"+_+m.slice(1):m=_+m}}if(h+m.length>n)break;s.push(m),h+=m.length}return s}function Zx(r,e,t,n){let i=[""],s=!1,o=!0;for(;;){let c=Qx("{","}",r);if(!c)return zm(i,r,[""],e,t,s);let l=c.pre;if(/\$$/.test(l)){if(i=zm(i,l+"{"+c.body+"}",[""],e,t,s&&!c.post.length),o=!1,!c.post.length)break;r=c.post;continue}let u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(c.body),f=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(c.body),d=u||f,p=c.body.indexOf(",")>=0;if(!d&&!p){if(c.post.match(/,(?!,).*\}/)){r=c.pre+"{"+c.body+eO+c.post,n=!0;continue}return zm(i,l+"{"+c.body+"}"+c.post,[""],e,t,s)}o&&(s=n&&!d,o=!1);let h;if(d)h=wme(c.body,f,e,t);else{let g=jB(c.body);if(g.length===1&&g[0]!==void 0&&(g=Zx(g[0],e,t,!1).map(yme),g.length===1)){if(i=zm(i,l+g[0],[""],e,t,s&&!c.post.length),!c.post.length)break;r=c.post;continue}let m=s&&!c.post.length&&!l;for(let _=0;m&&_<i.length;_++)i[_]&&(m=!1);h=[];let b=0;e:for(let _=0;_<g.length;_++){let S=Zx(g[_],e,t,!1);for(let I=0;I<S.length;I++){let E=S[I];if(!(m&&!E)){if(h.length>=e||b+E.length>t)break e;h.push(E),b+=E.length}}}}if(i=zm(i,l,h,e,t,s&&!c.post.length),!c.post.length)break;r=c.post}return i}var LB,NB,eO,kB,MB,nme,ime,sme,ome,ame,cme,lme,ume,fme,dme,pme,hme,UB=Me(()=>{DB();LB="\0SLASH"+Math.random()+"\0",NB="\0OPEN"+Math.random()+"\0",eO="\0CLOSE"+Math.random()+"\0",kB="\0COMMA"+Math.random()+"\0",MB="\0PERIOD"+Math.random()+"\0",nme=new RegExp(LB,"g"),ime=new RegExp(NB,"g"),sme=new RegExp(eO,"g"),ome=new RegExp(kB,"g"),ame=new RegExp(MB,"g"),cme=/\\\\/g,lme=/\\{/g,ume=/\\}/g,fme=/\\,/g,dme=/\\\./g,pme=1e5,hme=4e6;a(Jx,"numeric");a(mme,"escapeBraces");a(gme,"unescapeBraces");a(jB,"parseCommaParts");a($B,"expand");a(yme,"embrace");a(bme,"isPadded");a(_me,"lte");a(Sme,"gte");a(zm,"combine");a(wme,"expandSequence");a(Zx,"expand_")});var Hm,BB=Me(()=>{Hm=a(r=>{if(typeof r!="string")throw new TypeError("invalid pattern");if(r.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern")});var Eme,Km,vme,VB,GB,qB=Me(()=>{Eme={"[: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]},Km=a(r=>r.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),vme=a(r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),VB=a(r=>r.join(""),"rangesToString"),GB=a((r,e)=>{let t=e;if(r.charAt(t)!=="[")throw new Error("not in a brace expression");let n=[],i=[],s=t+1,o=!1,c=!1,l=!1,u=!1,f=t,d="";e:for(;s<r.length;){let m=r.charAt(s);if((m==="!"||m==="^")&&s===t+1){u=!0,s++;continue}if(m==="]"&&o&&!l){f=s+1;break}if(o=!0,m==="\\"&&!l){l=!0,s++;continue}if(m==="["&&!l){for(let[b,[_,S,I]]of Object.entries(Eme))if(r.startsWith(b,s)){if(d)return["$.",!1,r.length-t,!0];s+=b.length,I?i.push(_):n.push(_),c=c||S;continue e}}if(l=!1,d){m>d?n.push(Km(d)+"-"+Km(m)):m===d&&n.push(Km(m)),d="",s++;continue}if(r.startsWith("-]",s+1)){n.push(Km(m+"-")),s+=2;continue}if(r.startsWith("-",s+1)){d=m,s+=2;continue}n.push(Km(m)),s++}if(f<s)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,r.length-t,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!u){let m=n[0].length===2?n[0].slice(-1):n[0];return[vme(m),!1,f-t,!1]}let p="["+(u?"^":"")+VB(n)+"]",h="["+(u?"":"^")+VB(i)+"]";return[n.length&&i.length?"("+p+"|"+h+")":n.length?p:h,c,f-t,!0]},"parseClass")});var zs,sw=Me(()=>{zs=a((r,{windowsPathsNoEscape:e=!1,magicalBraces:t=!0}={})=>t?e?r.replace(/\[([^/\\])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):e?r.replace(/\[([^/\\{}])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),"unescape")});var Mi,Tme,tO,WB,Ame,Ime,Rme,zB,Cme,ow,xme,Ome,Pme,Fme,rO,HB,KB,Dme,gu,nO=Me(()=>{qB();sw();Tme=new Set(["!","?","+","*","@"]),tO=a(r=>Tme.has(r),"isExtglobType"),WB=a(r=>tO(r.type),"isExtglobAST"),Ame=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),Ime=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),Rme=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),zB=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),Cme="(?!(?:^|/)\\.\\.?(?:$|/))",ow="(?!\\.)",xme=new Set(["[","."]),Ome=new Set(["..","."]),Pme=new Set("().*{}+?[]^$\\!"),Fme=a(r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),rO="[^/]",HB=rO+"*?",KB=rO+"+?",Dme=0,gu=class{static{a(this,"AST")}type;#t;#r;#n=!1;#e=[];#i;#a;#p;#u=!1;#c;#f;#l=!1;id=++Dme;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#t.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#e.length,parts:this.#e}}constructor(e,t,n={}){this.type=e,e&&(this.#r=!0),this.#i=t,this.#t=this.#i?this.#i.#t:this,this.#c=this.#t===this?n:this.#t.#c,this.#p=this.#t===this?[]:this.#t.#p,e==="!"&&!this.#t.#u&&this.#p.push(this),this.#a=this.#i?this.#i.#e.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let e of this.#e)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#f!==void 0?this.#f:this.type?this.#f=this.type+"("+this.#e.map(e=>String(e)).join("|")+")":this.#f=this.#e.map(e=>String(e)).join("")}#d(){if(this!==this.#t)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let e;for(;e=this.#p.pop();){if(e.type!=="!")continue;let t=e,n=t.#i;for(;n;){for(let i=t.#a+1;!n.type&&i<n.#e.length;i++)for(let s of e.#e){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(n.#e[i])}t=n,n=t.#i}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof Mi&&t.#i===this))throw new Error("invalid part: "+t);this.#e.push(t)}}toJSON(){let e=this.type===null?this.#e.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#e.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#u&&this.#i?.type==="!")&&e.push({}),e}isStart(){if(this.#t===this)return!0;if(!this.#i?.isStart())return!1;if(this.#a===0)return!0;let e=this.#i;for(let t=0;t<this.#a;t++){let n=e.#e[t];if(!(n instanceof Mi&&n.type==="!"))return!1}return!0}isEnd(){if(this.#t===this||this.#i?.type==="!")return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let e=this.#i?this.#i.#e.length:0;return this.#a===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new Mi(this.type,e);for(let n of this.#e)t.copyIn(n);return t}static#o(e,t,n,i,s){let o=i.maxExtglobRecursion??2,c=!1,l=!1,u=-1,f=!1;if(t.type===null){let m=n,b="";for(;m<e.length;){let _=e.charAt(m++);if(c||_==="\\"){c=!c,b+=_;continue}if(l){m===u+1?(_==="^"||_==="!")&&(f=!0):_==="]"&&!(m===u+2&&f)&&(l=!1),b+=_;continue}else if(_==="["){l=!0,u=m,f=!1,b+=_;continue}if(!i.noext&&tO(_)&&e.charAt(m)==="("&&s<=o){t.push(b),b="";let I=new Mi(_,t);m=Mi.#o(e,I,m,i,s+1),t.push(I);continue}b+=_}return t.push(b),m}let d=n+1,p=new Mi(null,t),h=[],g="";for(;d<e.length;){let m=e.charAt(d++);if(c||m==="\\"){c=!c,g+=m;continue}if(l){d===u+1?(m==="^"||m==="!")&&(f=!0):m==="]"&&!(d===u+2&&f)&&(l=!1),g+=m;continue}else if(m==="["){l=!0,u=d,f=!1,g+=m;continue}if(!i.noext&&tO(m)&&e.charAt(d)==="("&&(s<=o||t&&t.#_(m))){let _=t&&t.#_(m)?0:1;p.push(g),g="";let S=new Mi(m,p);p.push(S),d=Mi.#o(e,S,d,i,s+_);continue}if(m==="|"){p.push(g),g="",h.push(p),p=new Mi(null,t);continue}if(m===")")return g===""&&t.#e.length===0&&(t.#l=!0),p.push(g),g="",t.push(...h,p),d;g+=m}return t.type=null,t.#r=void 0,t.#e=[e.substring(n-1)],d}#g(e){return this.#E(e,Ime)}#E(e,t=Ame){if(!e||typeof e!="object"||e.type!==null||e.#e.length!==1||this.type===null)return!1;let n=e.#e[0];return!n||typeof n!="object"||n.type===null?!1:this.#_(n.type,t)}#_(e,t=Rme){return!!t.get(this.type)?.includes(e)}#S(e,t){let n=e.#e[0],i=new Mi(null,n,this.options);i.#e.push(""),n.push(i),this.#A(e,t)}#A(e,t){let n=e.#e[0];this.#e.splice(t,1,...n.#e);for(let i of n.#e)typeof i=="object"&&(i.#i=this);this.#f=void 0}#y(e){return!!zB.get(this.type)?.has(e)}#v(e){if(!e||typeof e!="object"||e.type!==null||e.#e.length!==1||this.type===null||this.#e.length!==1)return!1;let t=e.#e[0];return!t||typeof t!="object"||t.type===null?!1:this.#y(t.type)}#T(e){let t=zB.get(this.type),n=e.#e[0],i=t?.get(n.type);if(!i)return!1;this.#e=n.#e;for(let s of this.#e)typeof s=="object"&&(s.#i=this);this.type=i,this.#f=void 0,this.#l=!1}static fromGlob(e,t={}){let n=new Mi(null,void 0,t);return Mi.#o(e,n,0,t,0),n}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();let e=this.toString(),[t,n,i,s]=this.toRegExpSource();if(!(i||this.#r||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let c=(this.#c.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${t}$`,c),{_src:t,_glob:e})}get options(){return this.#c}toRegExpSource(e){let t=e??!!this.#c.dot;if(this.#t===this&&(this.#m(),this.#d()),!WB(this)){let l=this.isStart()&&this.isEnd()&&!this.#e.some(h=>typeof h!="string"),u=this.#e.map(h=>{let[g,m,b,_]=typeof h=="string"?Mi.#w(h,this.#r,l):h.toRegExpSource(e);return this.#r=this.#r||b,this.#n=this.#n||_,g}).join(""),f="";if(this.isStart()&&typeof this.#e[0]=="string"&&!(this.#e.length===1&&Ome.has(this.#e[0]))){let g=xme,m=t&&g.has(u.charAt(0))||u.startsWith("\\.")&&g.has(u.charAt(2))||u.startsWith("\\.\\.")&&g.has(u.charAt(4)),b=!t&&!e&&g.has(u.charAt(0));f=m?Cme:b?ow:""}let d="";return this.isEnd()&&this.#t.#u&&this.#i?.type==="!"&&(d="(?:$|\\/)"),[f+u+d,zs(u),this.#r=!!this.#r,this.#n]}let n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#b(t);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let l=this.toString(),u=this;return u.#e=[l],u.type=null,u.#r=void 0,[l,zs(this.toString()),!1,!1]}let o=!n||e||t||!ow?"":this.#b(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let c="";if(this.type==="!"&&this.#l)c=(this.isStart()&&!t?ow:"")+KB;else{let l=this.type==="!"?"))"+(this.isStart()&&!t&&!e?ow:"")+HB+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;c=i+s+l}return[c,zs(s),this.#r=!!this.#r,this.#n]}#m(){if(WB(this)){let e=0,t=!1;do{t=!0;for(let n=0;n<this.#e.length;n++){let i=this.#e[n];typeof i=="object"&&(i.#m(),this.#E(i)?(t=!1,this.#A(i,n)):this.#g(i)?(t=!1,this.#S(i,n)):this.#v(i)&&(t=!1,this.#T(i)))}}while(!t&&++e<10)}else for(let e of this.#e)typeof e=="object"&&e.#m();this.#f=void 0}#b(e){return this.#e.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[n,i,s,o]=t.toRegExpSource(e);return this.#n=this.#n||o,n}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#w(e,t,n=!1){let i=!1,s="",o=!1,c=!1;for(let l=0;l<e.length;l++){let u=e.charAt(l);if(i){i=!1,s+=(Pme.has(u)?"\\":"")+u;continue}if(u==="*"){if(c)continue;c=!0,s+=n&&/^[*]+$/.test(e)?KB:HB,t=!0;continue}else c=!1;if(u==="\\"){l===e.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[f,d,p,h]=GB(e,l);if(p){s+=f,o=o||d,l+=p-1,t=t||h;continue}}if(u==="?"){s+=rO,t=!0;continue}s+=Fme(u)}return[s,zs(e),!!t,o]}};Mi=gu});var Wd,iO=Me(()=>{Wd=a((r,{windowsPathsNoEscape:e=!1,magicalBraces:t=!1}={})=>t?e?r.replace(/[?*()[\]{}]/g,"[$&]"):r.replace(/[?*()[\]\\{}]/g,"\\$&"):e?r.replace(/[?*()[\]]/g,"[$&]"):r.replace(/[?*()[\]\\]/g,"\\$&"),"escape")});var hi,Lme,Nme,kme,Mme,jme,$me,Ume,Bme,Vme,Gme,qme,Wme,zme,Hme,Kme,Yme,Xme,Qme,QB,JB,ZB,YB,Jme,vr,Zme,ege,tge,rge,nge,us,ige,e6,sge,oge,XB,age,Yi,Gc=Me(()=>{UB();BB();nO();iO();sw();nO();iO();sw();hi=a((r,e,t={})=>(Hm(e),!t.nocomment&&e.charAt(0)==="#"?!1:new Yi(e,t).match(r)),"minimatch"),Lme=/^\*+([^+@!?*[(]*)$/,Nme=a(r=>e=>!e.startsWith(".")&&e.endsWith(r),"starDotExtTest"),kme=a(r=>e=>e.endsWith(r),"starDotExtTestDot"),Mme=a(r=>(r=r.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(r)),"starDotExtTestNocase"),jme=a(r=>(r=r.toLowerCase(),e=>e.toLowerCase().endsWith(r)),"starDotExtTestNocaseDot"),$me=/^\*+\.\*+$/,Ume=a(r=>!r.startsWith(".")&&r.includes("."),"starDotStarTest"),Bme=a(r=>r!=="."&&r!==".."&&r.includes("."),"starDotStarTestDot"),Vme=/^\.\*+$/,Gme=a(r=>r!=="."&&r!==".."&&r.startsWith("."),"dotStarTest"),qme=/^\*+$/,Wme=a(r=>r.length!==0&&!r.startsWith("."),"starTest"),zme=a(r=>r.length!==0&&r!=="."&&r!=="..","starTestDot"),Hme=/^\?+([^+@!?*[(]*)?$/,Kme=a(([r,e=""])=>{let t=QB([r]);return e?(e=e.toLowerCase(),n=>t(n)&&n.toLowerCase().endsWith(e)):t},"qmarksTestNocase"),Yme=a(([r,e=""])=>{let t=JB([r]);return e?(e=e.toLowerCase(),n=>t(n)&&n.toLowerCase().endsWith(e)):t},"qmarksTestNocaseDot"),Xme=a(([r,e=""])=>{let t=JB([r]);return e?n=>t(n)&&n.endsWith(e):t},"qmarksTestDot"),Qme=a(([r,e=""])=>{let t=QB([r]);return e?n=>t(n)&&n.endsWith(e):t},"qmarksTest"),QB=a(([r])=>{let e=r.length;return t=>t.length===e&&!t.startsWith(".")},"qmarksTestNoExt"),JB=a(([r])=>{let e=r.length;return t=>t.length===e&&t!=="."&&t!==".."},"qmarksTestNoExtDot"),ZB=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",YB={win32:{sep:"\\"},posix:{sep:"/"}},Jme=ZB==="win32"?YB.win32.sep:YB.posix.sep;hi.sep=Jme;vr=Symbol("globstar **");hi.GLOBSTAR=vr;Zme="[^/]",ege=Zme+"*?",tge="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",rge="(?:(?!(?:\\/|^)\\.).)*?",nge=a((r,e={})=>t=>hi(t,r,e),"filter");hi.filter=nge;us=a((r,e={})=>Object.assign({},r,e),"ext"),ige=a(r=>{if(!r||typeof r!="object"||!Object.keys(r).length)return hi;let e=hi;return Object.assign(a((n,i,s={})=>e(n,i,us(r,s)),"m"),{Minimatch:class extends e.Minimatch{static{a(this,"Minimatch")}constructor(i,s={}){super(i,us(r,s))}static defaults(i){return e.defaults(us(r,i)).Minimatch}},AST:class extends e.AST{static{a(this,"AST")}constructor(i,s,o={}){super(i,s,us(r,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,us(r,s))}},unescape:a((n,i={})=>e.unescape(n,us(r,i)),"unescape"),escape:a((n,i={})=>e.escape(n,us(r,i)),"escape"),filter:a((n,i={})=>e.filter(n,us(r,i)),"filter"),defaults:a(n=>e.defaults(us(r,n)),"defaults"),makeRe:a((n,i={})=>e.makeRe(n,us(r,i)),"makeRe"),braceExpand:a((n,i={})=>e.braceExpand(n,us(r,i)),"braceExpand"),match:a((n,i,s={})=>e.match(n,i,us(r,s)),"match"),sep:e.sep,GLOBSTAR:vr})},"defaults");hi.defaults=ige;e6=a((r,e={})=>(Hm(r),e.nobrace||!/\{(?:(?!\{).)*\}/.test(r)?[r]:$B(r,{max:e.braceExpandMax})),"braceExpand");hi.braceExpand=e6;sge=a((r,e={})=>new Yi(r,e).makeRe(),"makeRe");hi.makeRe=sge;oge=a((r,e,t={})=>{let n=new Yi(e,t);return r=r.filter(i=>n.match(i)),n.options.nonull&&!r.length&&r.push(e),r},"match");hi.match=oge;XB=/[?*]|[+@!]\(.*?\)|\[|\]/,age=a(r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Yi=class{static{a(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){Hm(e),t=t||{},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||ZB,this.isWindows=this.platform==="win32";let n="allowWindowsEscape";this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t[n]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,o,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let l=s[0]===""&&s[1]===""&&(s[2]==="?"||!XB.test(s[2]))&&!XB.test(s[3]),u=/^[a-z]:/i.test(s[0]);if(l)return[...s.slice(0,4),...s.slice(4).map(f=>this.parse(f))];if(u)return[s[0],...s.slice(1).map(f=>this.parse(f))]}return s.map(l=>this.parse(l))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let n of e)for(let i=0;i<n.length;i++)n[i]==="**"&&(n[i]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let n=-1;for(;(n=t.indexOf("**",n+1))!==-1;){let i=n;for(;t[i+1]==="**";)i++;i!==n&&t.splice(n,i-n)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((n,i)=>{let s=n[n.length-1];return i==="**"&&s==="**"?n:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(n.pop(),n):(n.push(i),n)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let s=e[i];i===1&&s===""&&e[0]===""||(s==="."||s==="")&&(t=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf("..",n+1))!==-1;){let i=e[n-1];i&&i!=="."&&i!==".."&&i!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(i))&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let o=i;for(;n[o+1]==="**";)o++;o>i&&n.splice(i+1,o-i);let c=n[i+1],l=n[i+2],u=n[i+3];if(c!==".."||!l||l==="."||l===".."||!u||u==="."||u==="..")continue;t=!0,n.splice(i,1);let f=n.slice(0);f[i]="**",e.push(f),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<n.length-1;o++){let c=n[o];o===1&&c===""&&n[0]===""||(c==="."||c==="")&&(t=!0,n.splice(o,1),o--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(t=!0,n.pop())}let s=0;for(;(s=n.indexOf("..",s+1))!==-1;){let o=n[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){t=!0;let l=s===1&&n[s+1]==="**"?["."]:[];n.splice(s-1,2,...l),n.length===0&&n.push(""),s-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let i=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(i){e[t]=[],e[n]=i;break}}return e.filter(t=>t.length)}partsMatch(e,t,n=!1){let i=0,s=0,o=[],c="";for(;i<e.length&&s<t.length;)if(e[i]===t[s])o.push(c==="b"?t[s]:e[i]),i++,s++;else if(n&&e[i]==="**"&&t[s]===e[i+1])o.push(e[i]),i++;else if(n&&t[s]==="**"&&e[i]===t[s+1])o.push(t[s]),s++;else if(e[i]==="*"&&t[s]&&(this.options.dot||!t[s].startsWith("."))&&t[s]!=="**"){if(c==="b")return!1;c="a",o.push(e[i]),i++,s++}else if(t[s]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(c==="a")return!1;c="b",o.push(t[s]),i++,s++}else return!1;return e.length===t.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!1){let i=0,s=0;if(this.isWindows){let c=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),l=!c&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),u=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),f=!u&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),d=l?3:c?0:void 0,p=f?3:u?0:void 0;if(typeof d=="number"&&typeof p=="number"){let[h,g]=[e[d],t[p]];h.toLowerCase()===g.toLowerCase()&&(t[p]=h,s=p,i=d)}}let{optimizationLevel:o=1}=this.options;return o>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(vr)?this.#t(e,t,n,i,s):this.#n(e,t,n,i,s)}#t(e,t,n,i,s){let o=t.indexOf(vr,s),c=t.lastIndexOf(vr),[l,u,f]=n?[t.slice(s,o),t.slice(o+1),[]]:[t.slice(s,o),t.slice(o+1,c),t.slice(c+1)];if(l.length){let S=e.slice(i,i+l.length);if(!this.#n(S,l,n,0,0))return!1;i+=l.length,s+=l.length}let d=0;if(f.length){if(f.length+i>e.length)return!1;let S=e.length-f.length;if(this.#n(e,f,n,S,0))d=f.length;else{if(e[e.length-1]!==""||i+f.length===e.length||(S--,!this.#n(e,f,n,S,0)))return!1;d=f.length+1}}if(!u.length){let S=!!d;for(let I=i;I<e.length-d;I++){let E=String(e[I]);if(S=!0,E==="."||E===".."||!this.options.dot&&E.startsWith("."))return!1}return n||S}let p=[[[],0]],h=p[0],g=0,m=[0];for(let S of u)S===vr?(m.push(g),h=[[],0],p.push(h)):(h[0].push(S),g++);let b=p.length-1,_=e.length-d;for(let S of p)S[1]=_-(m[b--]+S[0].length);return!!this.#r(e,p,i,0,n,0,!!d)}#r(e,t,n,i,s,o,c){let l=t[i];if(!l){for(let d=n;d<e.length;d++){c=!0;let p=e[d];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return c}let[u,f]=l;for(;n<=f;){if(this.#n(e.slice(0,n+u.length),u,s,n,0)&&o<this.maxGlobstarRecursion){let h=this.#r(e,t,n+u.length,i+1,s,o+1,c);if(h!==!1)return h}let p=e[n];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1;n++}return s||null}#n(e,t,n,i,s){let o,c,l,u;for(o=i,c=s,u=e.length,l=t.length;o<u&&c<l;o++,c++){this.debug("matchOne loop");let f=t[c],d=e[o];if(this.debug(t,f,d),f===!1||f===vr)return!1;let p;if(typeof f=="string"?(p=d===f,this.debug("string match",f,d,p)):(p=f.test(d),this.debug("pattern match",f,d,p)),!p)return!1}if(o===u&&c===l)return!0;if(o===u)return n;if(c===l)return o===u-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return e6(this.pattern,this.options)}parse(e){Hm(e);let t=this.options;if(e==="**")return vr;if(e==="")return"";let n,i=null;(n=e.match(qme))?i=t.dot?zme:Wme:(n=e.match(Lme))?i=(t.nocase?t.dot?jme:Mme:t.dot?kme:Nme)(n[1]):(n=e.match(Hme))?i=(t.nocase?t.dot?Yme:Kme:t.dot?Xme:Qme)(n):(n=e.match($me))?i=t.dot?Bme:Ume:(n=e.match(Vme))&&(i=Gme);let s=gu.fromGlob(e,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,n=t.noglobstar?ege:t.dot?tge:rge,i=new Set(t.nocase?["i"]:[]),s=e.map(l=>{let u=l.map(d=>{if(d instanceof RegExp)for(let p of d.flags.split(""))i.add(p);return typeof d=="string"?age(d):d===vr?vr:d._src});u.forEach((d,p)=>{let h=u[p+1],g=u[p-1];d!==vr||g===vr||(g===void 0?h!==void 0&&h!==vr?u[p+1]="(?:\\/|"+n+"\\/)?"+h:u[p]=n:h===void 0?u[p-1]=g+"(?:\\/|\\/"+n+")?":h!==vr&&(u[p-1]=g+"(?:\\/|\\/"+n+"\\/)"+h,u[p+1]=vr))});let f=u.filter(d=>d!==vr);if(this.partial&&f.length>=1){let d=[];for(let p=1;p<=f.length;p++)d.push(f.slice(0,p).join("/"));return"(?:"+d.join("|")+")"}return f.join("/")}).join("|"),[o,c]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+c+"$",this.partial&&(s="^(?:\\/|"+o+s.slice(1,-1)+c+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;let n=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let o=i[i.length-1];if(!o)for(let c=i.length-2;!o&&c>=0;c--)o=i[c];for(let c of s){let l=i;if(n.matchBase&&c.length===1&&(l=[o]),this.matchOne(l,c,t))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return hi.defaults(e).Minimatch}};hi.AST=gu;hi.Minimatch=Yi;hi.escape=Wd;hi.unescape=zs});var cw,Rn,Ym,cge,sO,r6,t6,lge,uge,qc,n6,aw,fge,Qm,s6=Me(()=>{cw=require("node:diagnostics_channel"),Rn=(0,cw.channel)("lru-cache:metrics"),Ym=(0,cw.tracingChannel)("lru-cache"),cge=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,sO=a(()=>Rn.hasSubscribers||Ym.hasSubscribers,"R"),r6=new Set,t6=typeof process=="object"&&process?process:{},lge=a((r,e,t,n)=>{typeof t6.emitWarning=="function"?t6.emitWarning(r,e,t,n):console.error(`[${t}] ${e}: ${r}`)},"k"),uge=a(r=>!r6.has(r),"H"),qc=a(r=>!!r&&r===Math.floor(r)&&r>0&&isFinite(r),"T"),n6=a(r=>qc(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?aw:null:null,"j"),aw=class extends Array{static{a(this,"O")}constructor(r){super(r),this.fill(0)}},fge=class Xm{static{a(this,"d")}heap;length;static#t=!1;static create(e){let t=n6(e);if(!t)return[];Xm.#t=!0;let n=new Xm(e,t);return Xm.#t=!1,n}constructor(e,t){if(!Xm.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Qm=class i6{static{a(this,"d")}#t;#r;#n;#e;#i;#a;#p;#u;get perf(){return this.#u}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#c;#f;#l;#d;#o;#g;#E;#_;#S;#A;#y;#v;#T;#m;#b;#w;#R;#s;#x;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#m,autopurgeTimers:e.#b,sizes:e.#v,keyMap:e.#l,keyList:e.#d,valList:e.#o,next:e.#g,prev:e.#E,get head(){return e.#_},get tail(){return e.#S},free:e.#A,isBackgroundFetch:a(t=>e.#h(t),"isBackgroundFetch"),backgroundFetch:a((t,n,i,s)=>e.#M(t,n,i,s),"backgroundFetch"),moveToTail:a(t=>e.#K(t),"moveToTail"),indexes:a(t=>e.#P(t),"indexes"),rindexes:a(t=>e.#F(t),"rindexes"),isStale:a(t=>e.#I(t),"isStale")}}get max(){return this.#t}get maxSize(){return this.#r}get calculatedSize(){return this.#f}get size(){return this.#c}get fetchMethod(){return this.#a}get memoMethod(){return this.#p}get dispose(){return this.#n}get onInsert(){return this.#e}get disposeAfter(){return this.#i}constructor(e){let{max:t=0,ttl:n,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:c,allowStale:l,dispose:u,onInsert:f,disposeAfter:d,noDisposeOnSet:p,noUpdateTTL:h,maxSize:g=0,maxEntrySize:m=0,sizeCalculation:b,fetchMethod:_,memoMethod:S,noDeleteOnFetchRejection:I,noDeleteOnStaleGet:E,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:R,ignoreFetchAbort:x,backgroundFetchSize:P=1,perf:N}=e;if(this.backgroundFetchSize=P,N!==void 0&&typeof N?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#u=N??cge,t!==0&&!qc(t))throw new TypeError("max option must be a nonnegative integer");let V=t?n6(t):Array;if(!V)throw new Error("invalid max value: "+t);if(this.#t=t,this.#r=g,this.maxEntrySize=m||this.#r,this.sizeCalculation=b,this.sizeCalculation){if(!this.#r&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(S!==void 0&&typeof S!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#p=S,_!==void 0&&typeof _!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#a=_,this.#R=!!_,this.#l=new Map,this.#d=Array.from({length:t}).fill(void 0),this.#o=Array.from({length:t}).fill(void 0),this.#g=new V(t),this.#E=new V(t),this.#_=0,this.#S=0,this.#A=fge.create(t),this.#c=0,this.#f=0,typeof u=="function"&&(this.#n=u),typeof f=="function"&&(this.#e=f),typeof d=="function"?(this.#i=d,this.#y=[]):(this.#i=void 0,this.#y=void 0),this.#w=!!this.#n,this.#x=!!this.#e,this.#s=!!this.#i,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!I,this.allowStaleOnFetchRejection=!!w,this.allowStaleOnFetchAbort=!!R,this.ignoreFetchAbort=!!x,this.maxEntrySize!==0){if(this.#r!==0&&!qc(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!qc(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#q()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!E,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!c,this.ttlResolution=qc(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!qc(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#O()}if(this.#t===0&&this.ttl===0&&this.#r===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#r){let $="LRU_CACHE_UNBOUNDED";uge($)&&(r6.add($),lge("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",$,i6))}}getRemainingTTL(e){return this.#l.has(e)?1/0:0}#O(){let e=new aw(this.#t),t=new aw(this.#t);this.#m=e,this.#T=t;let n=this.ttlAutopurge?Array.from({length:this.#t}):void 0;this.#b=n,this.#$=(l,u,f=this.#u.now())=>{t[l]=u!==0?f:0,e[l]=u,i(l,u)},this.#C=l=>{t[l]=e[l]!==0?this.#u.now():0,i(l,e[l])};let i=this.ttlAutopurge?(l,u)=>{if(n?.[l]&&(clearTimeout(n[l]),n[l]=void 0),u&&u!==0&&n){let f=setTimeout(()=>{this.#I(l)?(this.#j(this.#d[l],"expire"),n[l]=void 0):i(l,c(l))},u+1);f.unref&&f.unref(),n[l]=f}}:()=>{};this.#D=(l,u)=>{if(e[u]){let f=e[u],d=t[u];if(!f||!d)return;l.ttl=f,l.start=d,l.now=s||o();let p=l.now-d;l.remainingTTL=f-p}};let s=0,o=a(()=>{let l=this.#u.now();if(this.ttlResolution>0){s=l;let u=setTimeout(()=>s=0,this.ttlResolution);u.unref&&u.unref()}return l},"o");this.getRemainingTTL=l=>{let u=this.#l.get(l);return u===void 0?0:c(u)};let c=a(l=>{let u=e[l],f=t[l];if(!u||!f)return 1/0;let d=(s||o())-f;return u-d},"l");this.#I=l=>{let u=t[l],f=e[l];return!!f&&!!u&&(s||o())-u>f}}#C=a(()=>{},"#R");#D=a(()=>{},"#v");#$=a(()=>{},"#H");#I=a(()=>!1,"#p");#q(){let e=new aw(this.#t);this.#f=0,this.#v=e,this.#N=t=>{this.#f-=e[t],e[t]=0},this.#U=(t,n,i,s)=>{if(!qc(i)){if(this.#h(n))return this.backgroundFetchSize;if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(n,t),!qc(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return i},this.#L=(t,n,i)=>{if(e[t]=n,this.#r){let s=this.#r-e[t];for(;this.#f>s;)this.#G(!0)}this.#f+=e[t],i&&(i.entrySize=n,i.totalCalculatedSize=this.#f)}}#N=a(e=>{},"#x");#L=a((e,t,n)=>{},"#j");#U=a((e,t,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#N");*#P({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#S;this.#B(t)&&((e||!this.#I(t))&&(yield t),t!==this.#_);)t=this.#E[t]}*#F({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#_;this.#B(t)&&((e||!this.#I(t))&&(yield t),t!==this.#S);)t=this.#g[t]}#B(e){return e!==void 0&&this.#l.get(this.#d[e])===e}*entries(){for(let e of this.#P())this.#o[e]!==void 0&&this.#d[e]!==void 0&&!this.#h(this.#o[e])&&(yield[this.#d[e],this.#o[e]])}*rentries(){for(let e of this.#F())this.#o[e]!==void 0&&this.#d[e]!==void 0&&!this.#h(this.#o[e])&&(yield[this.#d[e],this.#o[e]])}*keys(){for(let e of this.#P()){let t=this.#d[e];t!==void 0&&!this.#h(this.#o[e])&&(yield t)}}*rkeys(){for(let e of this.#F()){let t=this.#d[e];t!==void 0&&!this.#h(this.#o[e])&&(yield t)}}*values(){for(let e of this.#P())this.#o[e]!==void 0&&!this.#h(this.#o[e])&&(yield this.#o[e])}*rvalues(){for(let e of this.#F())this.#o[e]!==void 0&&!this.#h(this.#o[e])&&(yield this.#o[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let n of this.#P()){let i=this.#o[n],s=this.#h(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#d[n],this))return this.#H(this.#d[n],t)}}forEach(e,t=this){for(let n of this.#P()){let i=this.#o[n],s=this.#h(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(t,s,this.#d[n],this)}}rforEach(e,t=this){for(let n of this.#F()){let i=this.#o[n],s=this.#h(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(t,s,this.#d[n],this)}}purgeStale(){let e=!1;for(let t of this.#F({allowStale:!0}))this.#I(t)&&(this.#j(this.#d[t],"expire"),e=!0);return e}info(e){let t=this.#l.get(e);if(t===void 0)return;let n=this.#o[t],i=this.#h(n)?n.__staleWhileFetching:n;if(i===void 0)return;let s={value:i};if(this.#m&&this.#T){let o=this.#m[t],c=this.#T[t];if(o&&c){let l=o-(this.#u.now()-c);s.ttl=l,s.start=Date.now()}}return this.#v&&(s.size=this.#v[t]),s}dump(){let e=[];for(let t of this.#P({allowStale:!0})){let n=this.#d[t],i=this.#o[t],s=this.#h(i)?i.__staleWhileFetching:i;if(s===void 0||n===void 0)continue;let o={value:s};if(this.#m&&this.#T){o.ttl=this.#m[t];let c=this.#u.now()-this.#T[t];o.start=Math.floor(Date.now()-c)}this.#v&&(o.size=this.#v[t]),e.unshift([n,o])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let i=Date.now()-n.start;n.start=this.#u.now()-i}this.#k(t,n.value,n)}}set(e,t,n={}){let{status:i=Rn.hasSubscribers?{}:void 0}=n;n.status=i,i&&(i.op="set",i.key=e,t!==void 0&&(i.value=t),i.cache=this);let s=this.#k(e,t,n);return i&&Rn.hasSubscribers&&Rn.publish(i),s}#k(e,t,n,i){let{ttl:s=this.ttl,start:o,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:u}=n,f=this.#h(t);if(t===void 0)return u&&(u.set="deleted"),this.delete(e),this;let{noUpdateTTL:d=this.noUpdateTTL}=n;u&&!f&&(u.value=t);let p=this.#U(e,t,n.size||0,l,u);if(this.maxEntrySize&&p>this.maxEntrySize)return this.#j(e,"set"),u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this;let h=this.#c===0?void 0:this.#l.get(e);if(h===void 0)h=this.#c===0?this.#S:this.#A.length!==0?this.#A.pop():this.#c===this.#t?this.#G(!1):this.#c,this.#d[h]=e,this.#o[h]=t,this.#l.set(e,h),this.#g[this.#S]=h,this.#E[h]=this.#S,this.#S=h,this.#c++,this.#L(h,p,u),u&&(u.set="add"),d=!1,this.#x&&!f&&this.#e?.(t,e,"add");else{this.#K(h);let g=this.#o[h];if(t!==g){if(!c)if(this.#h(g)){g!==i&&g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=g;m!==void 0&&m!==t&&(this.#w&&this.#n?.(m,e,"set"),this.#s&&this.#y?.push([m,e,"set"]))}else this.#w&&this.#n?.(g,e,"set"),this.#s&&this.#y?.push([g,e,"set"]);if(this.#N(h),this.#L(h,p,u),this.#o[h]=t,!f){let m=g&&this.#h(g)?g.__staleWhileFetching:g,b=m===void 0?"add":t!==m?"replace":"update";u&&(u.set=b,m!==void 0&&(u.oldValue=m)),this.#x&&this.onInsert?.(t,e,b)}}else f||(u&&(u.set="update"),this.#x&&this.onInsert?.(t,e,"update"))}if(s!==0&&!this.#m&&this.#O(),this.#m&&(d||this.#$(h,s,o),u&&this.#D(u,h)),!c&&this.#s&&this.#y){let g=this.#y,m;for(;m=g?.shift();)this.#i?.(...m)}return this}pop(){try{for(;this.#c;){let e=this.#o[this.#_];if(this.#G(!0),this.#h(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#s&&this.#y){let e=this.#y,t;for(;t=e?.shift();)this.#i?.(...t)}}}#G(e){let t=this.#_,n=this.#d[t],i=this.#o[t],s=this.#h(i);s&&i.__abortController.abort(new Error("evicted"));let o=s?i.__staleWhileFetching:i;return(this.#w||this.#s)&&o!==void 0&&(this.#w&&this.#n?.(o,n,"evict"),this.#s&&this.#y?.push([o,n,"evict"])),this.#N(t),this.#b?.[t]&&(clearTimeout(this.#b[t]),this.#b[t]=void 0),e&&(this.#d[t]=void 0,this.#o[t]=void 0,this.#A.push(t)),this.#c===1?(this.#_=this.#S=0,this.#A.length=0):this.#_=this.#g[t],this.#l.delete(n),this.#c--,t}has(e,t={}){let{status:n=Rn.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op="has",n.key=e,n.cache=this);let i=this.#Y(e,t);return Rn.hasSubscribers&&Rn.publish(n),i}#Y(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=t,s=this.#l.get(e);if(s!==void 0){let o=this.#o[s];if(this.#h(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#I(s))i&&(i.has="stale",this.#D(i,s));else return n&&this.#C(s),i&&(i.has="hit",this.#D(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,t={}){let{status:n=sO()?{}:void 0}=t;n&&(n.op="peek",n.key=e,n.cache=this),t.status=n;let i=this.#W(e,t);return Rn.hasSubscribers&&Rn.publish(n),i}#W(e,t){let{status:n,allowStale:i=this.allowStale}=t,s=this.#l.get(e);if(s===void 0||!i&&this.#I(s)){n&&(n.peek=s===void 0?"miss":"stale");return}let o=this.#o[s],c=this.#h(o)?o.__staleWhileFetching:o;return n&&(c!==void 0?(n.peek="hit",n.value=c):n.peek="miss"),c}#M(e,t,n,i){let s=t===void 0?void 0:this.#o[t];if(this.#h(s))return s;let o=new AbortController,{signal:c}=n;c?.addEventListener("abort",()=>o.abort(c.reason),{signal:o.signal});let l={signal:o.signal,options:n,context:i},u=a((m,b=!1)=>{let{aborted:_}=o.signal,S=n.ignoreFetchAbort&&m!==void 0,I=n.ignoreFetchAbort||!!(n.allowStaleOnFetchAbort&&m!==void 0);if(n.status&&(_&&!b?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,S&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),_&&!S&&!b)return d(o.signal.reason,I);let E=h,w=this.#o[t];return(w===h||w===void 0&&S&&b)&&(m===void 0?E.__staleWhileFetching!==void 0?this.#o[t]=E.__staleWhileFetching:this.#j(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.#k(e,m,l.options,E))),m},"r"),f=a(m=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=m),d(m,!1)),"c"),d=a((m,b)=>{let{aborted:_}=o.signal,S=_&&n.allowStaleOnFetchAbort,I=S||n.allowStaleOnFetchRejection,E=I||n.noDeleteOnFetchRejection,w=h;if(this.#o[t]===h&&(!E||!b&&w.__staleWhileFetching===void 0?this.#j(e,"fetch"):S||(this.#o[t]=w.__staleWhileFetching)),I)return n.status&&w.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),w.__staleWhileFetching;if(w.__returned===w)throw m},"m"),p=a((m,b)=>{let _=this.#a?.(e,s,l);o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(m(void 0),n.allowStaleOnFetchAbort&&(m=a(S=>u(S,!0),"f")))}),_&&_ instanceof Promise?_.then(S=>m(S===void 0?void 0:S),b):_!==void 0&&m(_)},"_");n.status&&(n.status.fetchDispatched=!0);let h=new Promise(p).then(u,f),g=Object.assign(h,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return t===void 0?(this.#k(e,g,{...l.options,status:void 0}),t=this.#l.get(e)):this.#o[t]=g,g}#h(e){if(!this.#R)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof AbortController}fetch(e,t={}){let n=Ym.hasSubscribers,{status:i=sO()?{}:void 0}=t;t.status=i,i&&t.context&&(i.context=t.context);let s=this.#z(e,t);return i&&n&&(i.trace=!0,Ym.tracePromise(()=>s,i).catch(()=>{})),s}async#z(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:m,forceRefresh:b=!1,status:_,signal:S}=t;if(_&&(_.op="fetch",_.key=e,b&&(_.forceRefresh=!0),_.cache=this),!this.#R)return _&&(_.fetch="get"),this.#H(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:_});let I={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:c,size:l,sizeCalculation:u,noUpdateTTL:f,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:g,ignoreFetchAbort:h,status:_,signal:S},E=this.#l.get(e);if(E===void 0){_&&(_.fetch="miss");let w=this.#M(e,E,I,m);return w.__returned=w}else{let w=this.#o[E];if(this.#h(w)){let N=n&&w.__staleWhileFetching!==void 0;return _&&(_.fetch="inflight",N&&(_.returnedStale=!0)),N?w.__staleWhileFetching:w.__returned=w}let R=this.#I(E);if(!b&&!R)return _&&(_.fetch="hit"),this.#K(E),i&&this.#C(E),_&&this.#D(_,E),w;let x=this.#M(e,E,I,m),P=x.__staleWhileFetching!==void 0&&n;return _&&(_.fetch=R?"stale":"refresh",P&&R&&(_.returnedStale=!0)),P?x.__staleWhileFetching:x.__returned=x}}forceFetch(e,t={}){let n=Ym.hasSubscribers,{status:i=sO()?{}:void 0}=t;t.status=i,i&&t.context&&(i.context=t.context);let s=this.#V(e,t);return i&&n&&(i.trace=!0,Ym.tracePromise(()=>s,i).catch(()=>{})),s}async#V(e,t={}){let n=await this.#z(e,t);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,t={}){let{status:n=Rn.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op="memo",n.key=e,t.context&&(n.context=t.context),n.cache=this);let i=this.#J(e,t);return n&&(n.value=i),Rn.hasSubscribers&&Rn.publish(n),i}#J(e,t={}){let n=this.#p;if(!n)throw new Error("no memoMethod provided to constructor");let{context:i,status:s,forceRefresh:o,...c}=t;s&&o&&(s.forceRefresh=!0);let l=this.#H(e,c),u=o||l===void 0;if(s&&(s.memo=u?"miss":"hit",u||(s.value=l)),!u)return l;let f=n(e,l,{options:c,context:i});return s&&(s.value=f),this.#k(e,f,c),f}get(e,t={}){let{status:n=Rn.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op="get",n.key=e,n.cache=this);let i=this.#H(e,t);return n&&(i!==void 0&&(n.value=i),Rn.hasSubscribers&&Rn.publish(n)),i}#H(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=t,c=this.#l.get(e);if(c===void 0){o&&(o.get="miss");return}let l=this.#o[c],u=this.#h(l);return o&&this.#D(o,c),this.#I(c)?u?(o&&(o.get="stale-fetching"),n&&l.__staleWhileFetching!==void 0?(o&&(o.returnedStale=!0),l.__staleWhileFetching):void 0):(s||this.#j(e,"expire"),o&&(o.get="stale"),n?(o&&(o.returnedStale=!0),l):void 0):(o&&(o.get=u?"fetching":"hit"),this.#K(c),i&&this.#C(c),u?l.__staleWhileFetching:l)}#X(e,t){this.#E[t]=e,this.#g[e]=t}#K(e){e!==this.#S&&(e===this.#_?this.#_=this.#g[e]:this.#X(this.#E[e],this.#g[e]),this.#X(this.#S,e),this.#S=e)}delete(e){return this.#j(e,"delete")}#j(e,t){Rn.hasSubscribers&&Rn.publish({op:"delete",delete:t,key:e,cache:this});let n=!1;if(this.#c!==0){let i=this.#l.get(e);if(i!==void 0)if(this.#b?.[i]&&(clearTimeout(this.#b[i]),this.#b[i]=void 0),n=!0,this.#c===1)this.#Q(t);else{this.#N(i);let s=this.#o[i];if(this.#h(s)?s.__abortController.abort(new Error("deleted")):(this.#w||this.#s)&&(this.#w&&this.#n?.(s,e,t),this.#s&&this.#y?.push([s,e,t])),this.#l.delete(e),this.#d[i]=void 0,this.#o[i]=void 0,i===this.#S)this.#S=this.#E[i];else if(i===this.#_)this.#_=this.#g[i];else{let o=this.#E[i];this.#g[o]=this.#g[i];let c=this.#g[i];this.#E[c]=this.#E[i]}this.#c--,this.#A.push(i)}}if(this.#s&&this.#y?.length){let i=this.#y,s;for(;s=i?.shift();)this.#i?.(...s)}return n}clear(){return this.#Q("delete")}#Q(e){for(let t of this.#F({allowStale:!0})){let n=this.#o[t];if(this.#h(n))n.__abortController.abort(new Error("deleted"));else{let i=this.#d[t];this.#w&&this.#n?.(n,i,e),this.#s&&this.#y?.push([n,i,e])}}if(this.#l.clear(),this.#o.fill(void 0),this.#d.fill(void 0),this.#m&&this.#T){this.#m.fill(0),this.#T.fill(0);for(let t of this.#b??[])t!==void 0&&clearTimeout(t);this.#b?.fill(void 0)}if(this.#v&&this.#v.fill(0),this.#_=0,this.#S=0,this.#A.length=0,this.#f=0,this.#c=0,this.#s&&this.#y){let t=this.#y,n;for(;n=t?.shift();)this.#i?.(...n)}}}});var mw,dO,u6,o6,dge,pge,hge,Ga,qa,Wc,lw,Jm,uw,a6,fw,c6,Hs,zd,nn,Zm,Hd,sn,mi,on,oO,dw,zn,Tr,aO,cO,l6,lO,Mo,uO,pw,eg,yu,Xi,tg,mge,gge,yge,bge,hw,fO,_ge,Sge,zc,pO=Me(()=>{mw=require("node:events"),dO=Q(require("node:stream"),1),u6=require("node:string_decoder"),o6=typeof process=="object"&&process?process:{stdout:null,stderr:null},dge=a(r=>!!r&&typeof r=="object"&&(r instanceof zc||r instanceof dO.default||pge(r)||hge(r)),"isStream"),pge=a(r=>!!r&&typeof r=="object"&&r instanceof mw.EventEmitter&&typeof r.pipe=="function"&&r.pipe!==dO.default.Writable.prototype.pipe,"isReadable"),hge=a(r=>!!r&&typeof r=="object"&&r instanceof mw.EventEmitter&&typeof r.write=="function"&&typeof r.end=="function","isWritable"),Ga=Symbol("EOF"),qa=Symbol("maybeEmitEnd"),Wc=Symbol("emittedEnd"),lw=Symbol("emittingEnd"),Jm=Symbol("emittedError"),uw=Symbol("closed"),a6=Symbol("read"),fw=Symbol("flush"),c6=Symbol("flushChunk"),Hs=Symbol("encoding"),zd=Symbol("decoder"),nn=Symbol("flowing"),Zm=Symbol("paused"),Hd=Symbol("resume"),sn=Symbol("buffer"),mi=Symbol("pipes"),on=Symbol("bufferLength"),oO=Symbol("bufferPush"),dw=Symbol("bufferShift"),zn=Symbol("objectMode"),Tr=Symbol("destroyed"),aO=Symbol("error"),cO=Symbol("emitData"),l6=Symbol("emitEnd"),lO=Symbol("emitEnd2"),Mo=Symbol("async"),uO=Symbol("abort"),pw=Symbol("aborted"),eg=Symbol("signal"),yu=Symbol("dataListeners"),Xi=Symbol("discarded"),tg=a(r=>Promise.resolve().then(r),"defer"),mge=a(r=>r(),"nodefer"),gge=a(r=>r==="end"||r==="finish"||r==="prefinish","isEndish"),yge=a(r=>r instanceof ArrayBuffer||!!r&&typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,"isArrayBufferLike"),bge=a(r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),"isArrayBufferView"),hw=class{static{a(this,"Pipe")}src;dest;opts;ondrain;constructor(e,t,n){this.src=e,this.dest=t,this.opts=n,this.ondrain=()=>e[Hd](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},fO=class extends hw{static{a(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,n){super(e,t,n),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors)}},_ge=a(r=>!!r.objectMode,"isObjectModeOptions"),Sge=a(r=>!r.objectMode&&!!r.encoding&&r.encoding!=="buffer","isEncodingOptions"),zc=class extends mw.EventEmitter{static{a(this,"Minipass")}[nn]=!1;[Zm]=!1;[mi]=[];[sn]=[];[zn];[Hs];[Mo];[zd];[Ga]=!1;[Wc]=!1;[lw]=!1;[uw]=!1;[Jm]=null;[on]=0;[Tr]=!1;[eg];[pw]=!1;[yu]=0;[Xi]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");_ge(t)?(this[zn]=!0,this[Hs]=null):Sge(t)?(this[Hs]=t.encoding,this[zn]=!1):(this[zn]=!1,this[Hs]=null),this[Mo]=!!t.async,this[zd]=this[Hs]?new u6.StringDecoder(this[Hs]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:a(()=>this[sn],"get")}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:a(()=>this[mi],"get")});let{signal:n}=t;n&&(this[eg]=n,n.aborted?this[uO]():n.addEventListener("abort",()=>this[uO]()))}get bufferLength(){return this[on]}get encoding(){return this[Hs]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[zn]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Mo]}set async(e){this[Mo]=this[Mo]||!!e}[uO](){this[pw]=!0,this.emit("abort",this[eg]?.reason),this.destroy(this[eg]?.reason)}get aborted(){return this[pw]}set aborted(e){}write(e,t,n){if(this[pw])return!1;if(this[Ga])throw new Error("write after end");if(this[Tr])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(n=t,t="utf8"),t||(t="utf8");let i=this[Mo]?tg:mge;if(!this[zn]&&!Buffer.isBuffer(e)){if(bge(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(yge(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[zn]?(this[nn]&&this[on]!==0&&this[fw](!0),this[nn]?this.emit("data",e):this[oO](e),this[on]!==0&&this.emit("readable"),n&&i(n),this[nn]):e.length?(typeof e=="string"&&!(t===this[Hs]&&!this[zd]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[Hs]&&(e=this[zd].write(e)),this[nn]&&this[on]!==0&&this[fw](!0),this[nn]?this.emit("data",e):this[oO](e),this[on]!==0&&this.emit("readable"),n&&i(n),this[nn]):(this[on]!==0&&this.emit("readable"),n&&i(n),this[nn])}read(e){if(this[Tr])return null;if(this[Xi]=!1,this[on]===0||e===0||e&&e>this[on])return this[qa](),null;this[zn]&&(e=null),this[sn].length>1&&!this[zn]&&(this[sn]=[this[Hs]?this[sn].join(""):Buffer.concat(this[sn],this[on])]);let t=this[a6](e||null,this[sn][0]);return this[qa](),t}[a6](e,t){if(this[zn])this[dw]();else{let n=t;e===n.length||e===null?this[dw]():typeof n=="string"?(this[sn][0]=n.slice(e),t=n.slice(0,e),this[on]-=e):(this[sn][0]=n.subarray(e),t=n.subarray(0,e),this[on]-=e)}return this.emit("data",t),!this[sn].length&&!this[Ga]&&this.emit("drain"),t}end(e,t,n){return typeof e=="function"&&(n=e,e=void 0),typeof t=="function"&&(n=t,t="utf8"),e!==void 0&&this.write(e,t),n&&this.once("end",n),this[Ga]=!0,this.writable=!1,(this[nn]||!this[Zm])&&this[qa](),this}[Hd](){this[Tr]||(!this[yu]&&!this[mi].length&&(this[Xi]=!0),this[Zm]=!1,this[nn]=!0,this.emit("resume"),this[sn].length?this[fw]():this[Ga]?this[qa]():this.emit("drain"))}resume(){return this[Hd]()}pause(){this[nn]=!1,this[Zm]=!0,this[Xi]=!1}get destroyed(){return this[Tr]}get flowing(){return this[nn]}get paused(){return this[Zm]}[oO](e){this[zn]?this[on]+=1:this[on]+=e.length,this[sn].push(e)}[dw](){return this[zn]?this[on]-=1:this[on]-=this[sn][0].length,this[sn].shift()}[fw](e=!1){do;while(this[c6](this[dw]())&&this[sn].length);!e&&!this[sn].length&&!this[Ga]&&this.emit("drain")}[c6](e){return this.emit("data",e),this[nn]}pipe(e,t){if(this[Tr])return e;this[Xi]=!1;let n=this[Wc];return t=t||{},e===o6.stdout||e===o6.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,n?t.end&&e.end():(this[mi].push(t.proxyErrors?new fO(this,e,t):new hw(this,e,t)),this[Mo]?tg(()=>this[Hd]()):this[Hd]()),e}unpipe(e){let t=this[mi].find(n=>n.dest===e);t&&(this[mi].length===1?(this[nn]&&this[yu]===0&&(this[nn]=!1),this[mi]=[]):this[mi].splice(this[mi].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let n=super.on(e,t);if(e==="data")this[Xi]=!1,this[yu]++,!this[mi].length&&!this[nn]&&this[Hd]();else if(e==="readable"&&this[on]!==0)super.emit("readable");else if(gge(e)&&this[Wc])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Jm]){let i=t;this[Mo]?tg(()=>i.call(this,this[Jm])):i.call(this,this[Jm])}return n}removeListener(e,t){return this.off(e,t)}off(e,t){let n=super.off(e,t);return e==="data"&&(this[yu]=this.listeners("data").length,this[yu]===0&&!this[Xi]&&!this[mi].length&&(this[nn]=!1)),n}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[yu]=0,!this[Xi]&&!this[mi].length&&(this[nn]=!1)),t}get emittedEnd(){return this[Wc]}[qa](){!this[lw]&&!this[Wc]&&!this[Tr]&&this[sn].length===0&&this[Ga]&&(this[lw]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[uw]&&this.emit("close"),this[lw]=!1)}emit(e,...t){let n=t[0];if(e!=="error"&&e!=="close"&&e!==Tr&&this[Tr])return!1;if(e==="data")return!this[zn]&&!n?!1:this[Mo]?(tg(()=>this[cO](n)),!0):this[cO](n);if(e==="end")return this[l6]();if(e==="close"){if(this[uw]=!0,!this[Wc]&&!this[Tr])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[Jm]=n,super.emit(aO,n);let s=!this[eg]||this.listeners("error").length?super.emit("error",n):!1;return this[qa](),s}else if(e==="resume"){let s=super.emit("resume");return this[qa](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let i=super.emit(e,...t);return this[qa](),i}[cO](e){for(let n of this[mi])n.dest.write(e)===!1&&this.pause();let t=this[Xi]?!1:super.emit("data",e);return this[qa](),t}[l6](){return this[Wc]?!1:(this[Wc]=!0,this.readable=!1,this[Mo]?(tg(()=>this[lO]()),!0):this[lO]())}[lO](){if(this[zd]){let t=this[zd].end();if(t){for(let n of this[mi])n.dest.write(t);this[Xi]||super.emit("data",t)}}for(let t of this[mi])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[zn]||(e.dataLength=0);let t=this.promise();return this.on("data",n=>{e.push(n),this[zn]||(e.dataLength+=n.length)}),await t,e}async concat(){if(this[zn])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Hs]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(Tr,()=>t(new Error("stream destroyed"))),this.on("error",n=>t(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Xi]=!1;let e=!1,t=a(async()=>(this.pause(),e=!0,{value:void 0,done:!0}),"stop");return{next:a(()=>{if(e)return t();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[Ga])return t();let s,o,c=a(d=>{this.off("data",l),this.off("end",u),this.off(Tr,f),t(),o(d)},"onerr"),l=a(d=>{this.off("error",c),this.off("end",u),this.off(Tr,f),this.pause(),s({value:d,done:!!this[Ga]})},"ondata"),u=a(()=>{this.off("error",c),this.off("data",l),this.off(Tr,f),t(),s({done:!0,value:void 0})},"onend"),f=a(()=>c(new Error("stream destroyed")),"ondestroy");return new Promise((d,p)=>{o=p,s=d,this.once(Tr,f),this.once("error",c),this.once("end",u),this.once("data",l)})},"next"),throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Xi]=!1;let e=!1,t=a(()=>(this.pause(),this.off(aO,t),this.off(Tr,t),this.off("end",t),e=!0,{done:!0,value:void 0}),"stop"),n=a(()=>{if(e)return t();let i=this.read();return i===null?t():{done:!1,value:i}},"next");return this.once("end",t),this.once(aO,t),this.once(Tr,t),{next:n,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[Tr])return e?this.emit("error",e):this.emit(Tr),this;this[Tr]=!0,this[Xi]=!0,this[sn].length=0,this[on]=0;let t=this;return typeof t.close=="function"&&!this[uw]&&t.close(),e?this.emit("error",e):this.emit(Tr),this}static get isStream(){return dge}}});var Kd,m6,$o,wge,Hc,Ege,ng,g6,y6,vge,Tge,ds,b6,_6,jo,S6,w6,bu,E6,fs,rg,hO,f6,ig,Ks,gw,bw,d6,Age,mO,p6,sg,h6,yw,_w,gO,v6,Hn,Sw,ww,Ew,Yd,Xd,og,CNe,T6,A6=Me(()=>{s6();Kd=require("node:path"),m6=require("node:url"),$o=require("fs"),wge=Q(require("node:fs"),1),Hc=require("node:fs/promises");pO();Ege=$o.realpathSync.native,ng={lstatSync:$o.lstatSync,readdir:$o.readdir,readdirSync:$o.readdirSync,readlinkSync:$o.readlinkSync,realpathSync:Ege,promises:{lstat:Hc.lstat,readdir:Hc.readdir,readlink:Hc.readlink,realpath:Hc.realpath}},g6=a(r=>!r||r===ng||r===wge?ng:{...ng,...r,promises:{...ng.promises,...r.promises||{}}},"fsFromOption"),y6=/^\\\\\?\\([a-z]:)\\?$/i,vge=a(r=>r.replace(/\//g,"\\").replace(y6,"$1\\"),"uncToDrive"),Tge=/[\\\/]/,ds=0,b6=1,_6=2,jo=4,S6=6,w6=8,bu=10,E6=12,fs=15,rg=~fs,hO=16,f6=32,ig=64,Ks=128,gw=256,bw=512,d6=ig|Ks|bw,Age=1023,mO=a(r=>r.isFile()?w6:r.isDirectory()?jo:r.isSymbolicLink()?bu:r.isCharacterDevice()?_6:r.isBlockDevice()?S6:r.isSocket()?E6:r.isFIFO()?b6:ds,"entToType"),p6=new Qm({max:2**12}),sg=a(r=>{let e=p6.get(r);if(e)return e;let t=r.normalize("NFKD");return p6.set(r,t),t},"normalize"),h6=new Qm({max:2**12}),yw=a(r=>{let e=h6.get(r);if(e)return e;let t=sg(r.toLowerCase());return h6.set(r,t),t},"normalizeNocase"),_w=class extends Qm{static{a(this,"ResolveCache")}constructor(){super({max:256})}},gO=class extends Qm{static{a(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:a(t=>t.length+1,"sizeCalculation")})}},v6=Symbol("PathScurry setAsCwd"),Hn=class{static{a(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#t;#r;get dev(){return this.#r}#n;get mode(){return this.#n}#e;get nlink(){return this.#e}#i;get uid(){return this.#i}#a;get gid(){return this.#a}#p;get rdev(){return this.#p}#u;get blksize(){return this.#u}#c;get ino(){return this.#c}#f;get size(){return this.#f}#l;get blocks(){return this.#l}#d;get atimeMs(){return this.#d}#o;get mtimeMs(){return this.#o}#g;get ctimeMs(){return this.#g}#E;get birthtimeMs(){return this.#E}#_;get atime(){return this.#_}#S;get mtime(){return this.#S}#A;get ctime(){return this.#A}#y;get birthtime(){return this.#y}#v;#T;#m;#b;#w;#R;#s;#x;#O;#C;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=ds,n,i,s,o,c){this.name=e,this.#v=s?yw(e):sg(e),this.#s=t&Age,this.nocase=s,this.roots=i,this.root=n||this,this.#x=o,this.#m=c.fullpath,this.#w=c.relative,this.#R=c.relativePosix,this.parent=c.parent,this.parent?this.#t=this.parent.#t:this.#t=g6(c.fs)}depth(){return this.#T!==void 0?this.#T:this.parent?this.#T=this.parent.depth()+1:this.#T=0}childrenCache(){return this.#x}resolve(e){if(!e)return this;let t=this.getRootString(e),i=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#D(i):this.#D(i)}#D(e){let t=this;for(let n of e)t=t.child(n);return t}children(){let e=this.#x.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#x.set(this,t),this.#s&=~hO,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),i=this.nocase?yw(e):sg(e);for(let l of n)if(l.#v===i)return l;let s=this.parent?this.sep:"",o=this.#m?this.#m+s+e:void 0,c=this.newChild(e,ds,{...t,parent:this,fullpath:o});return this.canReaddir()||(c.#s|=Ks),n.push(c),c}relative(){if(this.isCWD)return"";if(this.#w!==void 0)return this.#w;let e=this.name,t=this.parent;if(!t)return this.#w=this.name;let n=t.relative();return n+(!n||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#R!==void 0)return this.#R;let e=this.name,t=this.parent;if(!t)return this.#R=this.fullpathPosix();let n=t.relativePosix();return n+(!n||!t.parent?"":"/")+e}fullpath(){if(this.#m!==void 0)return this.#m;let e=this.name,t=this.parent;if(!t)return this.#m=this.name;let i=t.fullpath()+(t.parent?this.sep:"")+e;return this.#m=i}fullpathPosix(){if(this.#b!==void 0)return this.#b;if(this.sep==="/")return this.#b=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#b=`//?/${i}`:this.#b=i}let e=this.parent,t=e.fullpathPosix(),n=t+(!t||!e.parent?"":"/")+this.name;return this.#b=n}isUnknown(){return(this.#s&fs)===ds}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#s&fs)===w6}isDirectory(){return(this.#s&fs)===jo}isCharacterDevice(){return(this.#s&fs)===_6}isBlockDevice(){return(this.#s&fs)===S6}isFIFO(){return(this.#s&fs)===b6}isSocket(){return(this.#s&fs)===E6}isSymbolicLink(){return(this.#s&bu)===bu}lstatCached(){return this.#s&f6?this:void 0}readlinkCached(){return this.#O}realpathCached(){return this.#C}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#O)return!0;if(!this.parent)return!1;let e=this.#s&fs;return!(e!==ds&&e!==bu||this.#s&gw||this.#s&Ks)}calledReaddir(){return!!(this.#s&hO)}isENOENT(){return!!(this.#s&Ks)}isNamed(e){return this.nocase?this.#v===yw(e):this.#v===sg(e)}async readlink(){let e=this.#O;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#t.promises.readlink(this.fullpath()),n=(await this.parent.realpath())?.resolve(t);if(n)return this.#O=n}catch(t){this.#F(t.code);return}}readlinkSync(){let e=this.#O;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#t.readlinkSync(this.fullpath()),n=this.parent.realpathSync()?.resolve(t);if(n)return this.#O=n}catch(t){this.#F(t.code);return}}#$(e){this.#s|=hO;for(let t=e.provisional;t<e.length;t++){let n=e[t];n&&n.#I()}}#I(){this.#s&Ks||(this.#s=(this.#s|Ks)&rg,this.#q())}#q(){let e=this.children();e.provisional=0;for(let t of e)t.#I()}#N(){this.#s|=bw,this.#L()}#L(){if(this.#s&ig)return;let e=this.#s;(e&fs)===jo&&(e&=rg),this.#s=e|ig,this.#q()}#U(e=""){e==="ENOTDIR"||e==="EPERM"?this.#L():e==="ENOENT"?this.#I():this.children().provisional=0}#P(e=""){e==="ENOTDIR"?this.parent.#L():e==="ENOENT"&&this.#I()}#F(e=""){let t=this.#s;t|=gw,e==="ENOENT"&&(t|=Ks),(e==="EINVAL"||e==="UNKNOWN")&&(t&=rg),this.#s=t,e==="ENOTDIR"&&this.parent&&this.parent.#L()}#B(e,t){return this.#G(e,t)||this.#k(e,t)}#k(e,t){let n=mO(e),i=this.newChild(e.name,n,{parent:this}),s=i.#s&fs;return s!==jo&&s!==bu&&s!==ds&&(i.#s|=ig),t.unshift(i),t.provisional++,i}#G(e,t){for(let n=t.provisional;n<t.length;n++){let i=t[n];if((this.nocase?yw(e.name):sg(e.name))===i.#v)return this.#Y(e,i,n,t)}}#Y(e,t,n,i){let s=t.name;return t.#s=t.#s&rg|mO(e),s!==e.name&&(t.name=e.name),n!==i.provisional&&(n===i.length-1?i.pop():i.splice(n,1),i.unshift(t)),i.provisional++,t}async lstat(){if((this.#s&Ks)===0)try{return this.#W(await this.#t.promises.lstat(this.fullpath())),this}catch(e){this.#P(e.code)}}lstatSync(){if((this.#s&Ks)===0)try{return this.#W(this.#t.lstatSync(this.fullpath())),this}catch(e){this.#P(e.code)}}#W(e){let{atime:t,atimeMs:n,birthtime:i,birthtimeMs:s,blksize:o,blocks:c,ctime:l,ctimeMs:u,dev:f,gid:d,ino:p,mode:h,mtime:g,mtimeMs:m,nlink:b,rdev:_,size:S,uid:I}=e;this.#_=t,this.#d=n,this.#y=i,this.#E=s,this.#u=o,this.#l=c,this.#A=l,this.#g=u,this.#r=f,this.#a=d,this.#c=p,this.#n=h,this.#S=g,this.#o=m,this.#e=b,this.#p=_,this.#f=S,this.#i=I;let E=mO(e);this.#s=this.#s&rg|E|f6,E!==ds&&E!==jo&&E!==bu&&(this.#s|=ig)}#M=[];#h=!1;#z(e){this.#h=!1;let t=this.#M.slice();this.#M.length=0,t.forEach(n=>n(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let s=n.slice(0,n.provisional);t?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#M.push(e),this.#h)return;this.#h=!0;let i=this.fullpath();this.#t.readdir(i,{withFileTypes:!0},(s,o)=>{if(s)this.#U(s.code),n.provisional=0;else{for(let c of o)this.#B(c,n);this.#$(n)}this.#z(n.slice(0,n.provisional))})}#V;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#V)await this.#V;else{let n=a(()=>{},"resolve");this.#V=new Promise(i=>n=i);try{for(let i of await this.#t.promises.readdir(t,{withFileTypes:!0}))this.#B(i,e);this.#$(e)}catch(i){this.#U(i.code),e.provisional=0}this.#V=void 0,n()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let n of this.#t.readdirSync(t,{withFileTypes:!0}))this.#B(n,e);this.#$(e)}catch(n){this.#U(n.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#s&d6)return!1;let e=fs&this.#s;return e===ds||e===jo||e===bu}shouldWalk(e,t){return(this.#s&jo)===jo&&!(this.#s&d6)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#C)return this.#C;if(!((bw|gw|Ks)&this.#s))try{let e=await this.#t.promises.realpath(this.fullpath());return this.#C=this.resolve(e)}catch{this.#N()}}realpathSync(){if(this.#C)return this.#C;if(!((bw|gw|Ks)&this.#s))try{let e=this.#t.realpathSync(this.fullpath());return this.#C=this.resolve(e)}catch{this.#N()}}[v6](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),n=[],i=this;for(;i&&i.parent;)t.add(i),i.#w=n.join(this.sep),i.#R=n.join("/"),i=i.parent,n.push("..");for(i=e;i&&i.parent&&!t.has(i);)i.#w=void 0,i.#R=void 0,i=i.parent}},Sw=class r extends Hn{static{a(this,"PathWin32")}sep="\\";splitSep=Tge;constructor(e,t=ds,n,i,s,o,c){super(e,t,n,i,s,o,c)}newChild(e,t=ds,n={}){return new r(e,t,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return Kd.win32.parse(e).root}getRoot(e){if(e=vge(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,n]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=n;return this.roots[e]=new Yd(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(y6,"$1\\"),e===t}},ww=class r extends Hn{static{a(this,"PathPosix")}splitSep="/";sep="/";constructor(e,t=ds,n,i,s,o,c){super(e,t,n,i,s,o,c)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=ds,n={}){return new r(e,t,this.root,this.roots,this.nocase,this.childrenCache(),n)}},Ew=class{static{a(this,"PathScurryBase")}root;rootPath;roots;cwd;#t;#r;#n;nocase;#e;constructor(e=process.cwd(),t,n,{nocase:i,childrenCacheSize:s=16*1024,fs:o=ng}={}){this.#e=g6(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,m6.fileURLToPath)(e));let c=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(c),this.#t=new _w,this.#r=new _w,this.#n=new gO(s);let l=c.substring(this.rootPath.length).split(n);if(l.length===1&&!l[0]&&l.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#e),this.roots[this.rootPath]=this.root;let u=this.root,f=l.length-1,d=t.sep,p=this.rootPath,h=!1;for(let g of l){let m=f--;u=u.child(g,{relative:new Array(m).fill("..").join(d),relativePosix:new Array(m).fill("..").join("/"),fullpath:p+=(h?"":d)+g}),h=!0}this.cwd=u}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#n}resolve(...e){let t="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let n=this.#t.get(t);if(n!==void 0)return n;let i=this.cwd.resolve(t).fullpath();return this.#t.set(t,i),i}resolvePosix(...e){let t="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let n=this.#r.get(t);if(n!==void 0)return n;let i=this.cwd.resolve(t).fullpathPosix();return this.#r.set(t,i),i}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd);let{withFileTypes:n}=t;if(e.canReaddir()){let i=await e.readdir();return n?i:i.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0}=t;return e.canReaddir()?n?e.readdirSync():e.readdirSync().map(i=>i.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e.withFileTypes,e=this.cwd);let n=await e.readlink();return t?n:n?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return t?n:n?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e.withFileTypes,e=this.cwd);let n=await e.realpath();return t?n:n?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return t?n:n?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=[];(!s||s(e))&&c.push(n?e:e.fullpath());let l=new Set,u=a((d,p)=>{l.add(d),d.readdirCB((h,g)=>{if(h)return p(h);let m=g.length;if(!m)return p();let b=a(()=>{--m===0&&p()},"next");for(let _ of g)(!s||s(_))&&c.push(n?_:_.fullpath()),i&&_.isSymbolicLink()?_.realpath().then(S=>S?.isUnknown()?S.lstat():S).then(S=>S?.shouldWalk(l,o)?u(S,b):b()):_.shouldWalk(l,o)?u(_,b):b()},!0)},"walk"),f=e;return new Promise((d,p)=>{u(f,h=>{if(h)return p(h);d(c)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=[];(!s||s(e))&&c.push(n?e:e.fullpath());let l=new Set([e]);for(let u of l){let f=u.readdirSync();for(let d of f){(!s||s(d))&&c.push(n?d:d.fullpath());let p=d;if(d.isSymbolicLink()){if(!(i&&(p=d.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(l,o)&&l.add(p)}}return c}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t;(!s||s(e))&&(yield n?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let f of u){(!s||s(f))&&(yield n?f:f.fullpath());let d=f;if(f.isSymbolicLink()){if(!(i&&(d=f.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(c,o)&&c.add(d)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=new zc({objectMode:!0});(!s||s(e))&&c.write(n?e:e.fullpath());let l=new Set,u=[e],f=0,d=a(()=>{let p=!1;for(;!p;){let h=u.shift();if(!h){f===0&&c.end();return}f++,l.add(h);let g=a((b,_,S=!1)=>{if(b)return c.emit("error",b);if(i&&!S){let I=[];for(let E of _)E.isSymbolicLink()&&I.push(E.realpath().then(w=>w?.isUnknown()?w.lstat():w));if(I.length){Promise.all(I).then(()=>g(null,_,!0));return}}for(let I of _)I&&(!s||s(I))&&(c.write(n?I:I.fullpath())||(p=!0));f--;for(let I of _){let E=I.realpathCached()||I;E.shouldWalk(l,o)&&u.push(E)}p&&!c.flowing?c.once("drain",d):m||d()},"onReaddir"),m=!0;h.readdirCB(g,!0),m=!1}},"process");return d(),c}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=new zc({objectMode:!0}),l=new Set;(!s||s(e))&&c.write(n?e:e.fullpath());let u=[e],f=0,d=a(()=>{let p=!1;for(;!p;){let h=u.shift();if(!h){f===0&&c.end();return}f++,l.add(h);let g=h.readdirSync();for(let m of g)(!s||s(m))&&(c.write(n?m:m.fullpath())||(p=!0));f--;for(let m of g){let b=m;if(m.isSymbolicLink()){if(!(i&&(b=m.realpathSync())))continue;b.isUnknown()&&b.lstatSync()}b.shouldWalk(l,o)&&u.push(b)}}p&&!c.flowing&&c.once("drain",d)},"process");return d(),c}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[v6](t)}},Yd=class extends Ew{static{a(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,Kd.win32,"\\",{...t,nocase:n}),this.nocase=n;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return Kd.win32.parse(e).root.toUpperCase()}newRoot(e){return new Sw(this.rootPath,jo,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},Xd=class extends Ew{static{a(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),t={}){let{nocase:n=!1}=t;super(e,Kd.posix,"/",{...t,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new ww(this.rootPath,jo,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},og=class extends Xd{static{a(this,"PathScurryDarwin")}constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,{...t,nocase:n})}},CNe=process.platform==="win32"?Sw:ww,T6=process.platform==="win32"?Yd:process.platform==="darwin"?og:Xd});var Ige,Rge,Qd,yO=Me(()=>{Gc();Ige=a(r=>r.length>=1,"isPatternList"),Rge=a(r=>r.length>=1,"isGlobList"),Qd=class r{static{a(this,"Pattern")}#t;#r;#n;length;#e;#i;#a;#p;#u;#c;#f=!0;constructor(e,t,n,i){if(!Ige(e))throw new TypeError("empty pattern list");if(!Rge(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,n<0||n>=this.length)throw new TypeError("index out of range");if(this.#t=e,this.#r=t,this.#n=n,this.#e=i,this.#n===0){if(this.isUNC()){let[s,o,c,l,...u]=this.#t,[f,d,p,h,...g]=this.#r;u[0]===""&&(u.shift(),g.shift());let m=[s,o,c,l,""].join("/"),b=[f,d,p,h,""].join("/");this.#t=[m,...u],this.#r=[b,...g],this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){let[s,...o]=this.#t,[c,...l]=this.#r;o[0]===""&&(o.shift(),l.shift());let u=s+"/",f=c+"/";this.#t=[u,...o],this.#r=[f,...l],this.length=this.#t.length}}}pattern(){return this.#t[this.#n]}isString(){return typeof this.#t[this.#n]=="string"}isGlobstar(){return this.#t[this.#n]===vr}isRegExp(){return this.#t[this.#n]instanceof RegExp}globString(){return this.#a=this.#a||(this.#n===0?this.isAbsolute()?this.#r[0]+this.#r.slice(1).join("/"):this.#r.join("/"):this.#r.slice(this.#n).join("/"))}hasMore(){return this.length>this.#n+1}rest(){return this.#i!==void 0?this.#i:this.hasMore()?(this.#i=new r(this.#t,this.#r,this.#n+1,this.#e),this.#i.#c=this.#c,this.#i.#u=this.#u,this.#i.#p=this.#p,this.#i):this.#i=null}isUNC(){let e=this.#t;return this.#u!==void 0?this.#u:this.#u=this.#e==="win32"&&this.#n===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#t;return this.#p!==void 0?this.#p:this.#p=this.#e==="win32"&&this.#n===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#t;return this.#c!==void 0?this.#c:this.#c=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#t[0];return typeof e=="string"&&this.isAbsolute()&&this.#n===0?e:""}checkFollowGlobstar(){return!(this.#n===0||!this.isGlobstar()||!this.#f)}markFollowGlobstar(){return this.#n===0||!this.isGlobstar()||!this.#f?!1:(this.#f=!1,!0)}}});var Cge,Jd,bO=Me(()=>{Gc();yO();Cge=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Jd=class{static{a(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:n,noext:i,noglobstar:s,platform:o=Cge}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:n,noext:i,noglobstar:s,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let c of e)this.add(c)}add(e){let t=new Yi(e,this.mmopts);for(let n=0;n<t.set.length;n++){let i=t.set[n],s=t.globParts[n];if(!i||!s)throw new Error("invalid pattern object");for(;i[0]==="."&&s[0]===".";)i.shift(),s.shift();let o=new Qd(i,s,0,this.platform),c=new Yi(o.globString(),this.mmopts),l=s[s.length-1]==="**",u=o.isAbsolute();u?this.absolute.push(c):this.relative.push(c),l&&(u?this.absoluteChildren.push(c):this.relativeChildren.push(c))}}ignored(e){let t=e.fullpath(),n=`${t}/`,i=e.relative()||".",s=`${i}/`;for(let o of this.relative)if(o.match(i)||o.match(s))return!0;for(let o of this.absolute)if(o.match(t)||o.match(n))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",n=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(n))return!0;for(let i of this.absoluteChildren)if(i.match(t))return!0;return!1}}});var _O,SO,wO,ag,I6=Me(()=>{Gc();_O=class r{static{a(this,"HasWalkedCache")}store;constructor(e=new Map){this.store=e}copy(){return new r(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let n=e.fullpath(),i=this.store.get(n);i?i.add(t.globString()):this.store.set(n,new Set([t.globString()]))}},SO=class{static{a(this,"MatchRecord")}store=new Map;add(e,t,n){let i=(t?2:0)|(n?1:0),s=this.store.get(e);this.store.set(e,s===void 0?i:i&s)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}},wO=class{static{a(this,"SubWalks")}store=new Map;add(e,t){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(i=>i.globString()===t.globString())||n.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},ag=class r{static{a(this,"Processor")}hasWalkedCache;matches=new SO;subwalks=new wO;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new _O}processPatterns(e,t){this.patterns=t;let n=t.map(i=>[e,i]);for(let[i,s]of n){this.hasWalkedCache.storeWalked(i,s);let o=s.root(),c=s.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let d=s.rest();if(d)s=d;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let l,u,f=!1;for(;typeof(l=s.pattern())=="string"&&(u=s.rest());)i=i.resolve(l),s=u,f=!0;if(l=s.pattern(),u=s.rest(),f){if(this.hasWalkedCache.hasWalked(i,s))continue;this.hasWalkedCache.storeWalked(i,s)}if(typeof l=="string"){let d=l===".."||l===""||l===".";this.matches.add(i.resolve(l),c,d);continue}else if(l===vr){(!i.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(i,s);let d=u?.pattern(),p=u?.rest();if(!u||(d===""||d===".")&&!p)this.matches.add(i,c,d===""||d===".");else if(d===".."){let h=i.parent||i;p?this.hasWalkedCache.hasWalked(h,p)||this.subwalks.add(h,p):this.matches.add(h,c,!0)}}else l instanceof RegExp&&this.subwalks.add(i,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new r(this.opts,this.hasWalkedCache)}filterEntries(e,t){let n=this.subwalks.get(e),i=this.child();for(let s of t)for(let o of n){let c=o.isAbsolute(),l=o.pattern(),u=o.rest();l===vr?i.testGlobstar(s,o,u,c):l instanceof RegExp?i.testRegExp(s,l,u,c):i.testString(s,l,u,c)}return i}testGlobstar(e,t,n,i){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(n&&t.checkFollowGlobstar()?this.subwalks.add(e,n):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),n){let s=n.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,n.rest(),i);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,n)}else s instanceof RegExp&&this.testRegExp(e,s,n.rest(),i)}}testRegExp(e,t,n,i){t.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}testString(e,t,n,i){e.isNamed(t)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}}});var xge,vw,cg,lg,R6=Me(()=>{pO();bO();I6();xge=a((r,e)=>typeof r=="string"?new Jd([r],e):Array.isArray(r)?new Jd(r,e):r,"makeIgnore"),vw=class{static{a(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#t=[];#r;#n;signal;maxDepth;includeChildMatches;constructor(e,t,n){if(this.patterns=e,this.path=t,this.opts=n,this.#n=!n.posix&&n.platform==="win32"?"\\":"/",this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#r=xge(n.ignore??[],n),!this.includeChildMatches&&typeof this.#r.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener("abort",()=>{this.#t.length=0}))}#e(e){return this.seen.has(e)||!!this.#r?.ignored?.(e)}#i(e){return!!this.#r?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#t.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#t.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=await s.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(s,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#e(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=s.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(s,t)}matchFinish(e,t){if(this.#e(e))return;if(!this.includeChildMatches&&this.#r?.add){let s=`${e.relativePosix()}/**`;this.#r.add(s)}let n=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#n:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+i)}else{let s=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!s.startsWith(".."+this.#n)?"."+this.#n:"";this.matchEmit(s?o+s+i:"."+i)}}async match(e,t,n){let i=await this.matchCheck(e,n);i&&this.matchFinish(i,t)}matchSync(e,t,n){let i=this.matchCheckSync(e,n);i&&this.matchFinish(i,t)}walkCB(e,t,n){this.signal?.aborted&&n(),this.walkCB2(e,t,new ag(this.opts),n)}walkCB2(e,t,n,i){if(this.#i(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,t,n,i));return}n.processPatterns(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of n.matches.entries())this.#e(c)||(s++,this.match(c,l,u).then(()=>o()));for(let c of n.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;s++;let l=c.readdirCached();c.calledReaddir()?this.walkCB3(c,l,n,o):c.readdirCB((u,f)=>this.walkCB3(c,f,n,o),!0)}o()}walkCB3(e,t,n,i){n=n.filterEntries(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of n.matches.entries())this.#e(c)||(s++,this.match(c,l,u).then(()=>o()));for(let[c,l]of n.subwalks.entries())s++,this.walkCB2(c,l,n.child(),o);o()}walkCBSync(e,t,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,t,new ag(this.opts),n)}walkCB2Sync(e,t,n,i){if(this.#i(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,n,i));return}n.processPatterns(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of n.matches.entries())this.#e(c)||this.matchSync(c,l,u);for(let c of n.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;s++;let l=c.readdirSync();this.walkCB3Sync(c,l,n,o)}o()}walkCB3Sync(e,t,n,i){n=n.filterEntries(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of n.matches.entries())this.#e(c)||this.matchSync(c,l,u);for(let[c,l]of n.subwalks.entries())s++,this.walkCB2Sync(c,l,n.child(),o);o()}},cg=class extends vw{static{a(this,"GlobWalker")}matches=new Set;constructor(e,t,n){super(e,t,n)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},lg=class extends vw{static{a(this,"GlobStream")}results;constructor(e,t,n){super(e,t,n),this.results=new zc({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}}});var C6,Oge,Ys,EO=Me(()=>{Gc();C6=require("node:url");A6();yO();R6();Oge=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Ys=class{static{a(this,"Glob")}absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,t){if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=(0,C6.fileURLToPath)(t.cwd)):this.cwd="",this.cwd=t.cwd||"",this.root=t.root,this.magicalBraces=!!t.magicalBraces,this.nobrace=!!t.nobrace,this.noext=!!t.noext,this.realpath=!!t.realpath,this.absolute=t.absolute,this.includeChildMatches=t.includeChildMatches!==!1,this.noglobstar=!!t.noglobstar,this.matchBase=!!t.matchBase,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:1/0,this.stat=!!t.stat,this.ignore=t.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(l=>l.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(l=>l.includes("/")?l:`./**/${l}`)}if(this.pattern=e,this.platform=t.platform||Oge,this.opts={...t,platform:this.platform},t.scurry){if(this.scurry=t.scurry,t.nocase!==void 0&&t.nocase!==t.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let l=t.platform==="win32"?Yd:t.platform==="darwin"?og:t.platform?Xd:T6;this.scurry=new l(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",i={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(l=>new Yi(l,i)),[o,c]=s.reduce((l,u)=>(l[0].push(...u.set),l[1].push(...u.globParts),l),[[],[]]);this.patterns=o.map((l,u)=>{let f=c[u];if(!f)throw new Error("invalid pattern object");return new Qd(l,f,0,this.platform)})}async walk(){return[...await new cg(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 cg(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 lg(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 lg(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 vO,TO=Me(()=>{Gc();vO=a((r,e={})=>{Array.isArray(r)||(r=[r]);for(let t of r)if(new Yi(t,e).hasMagic())return!0;return!1},"hasMagic")});function Tw(r,e={}){return new Ys(r,e).streamSync()}function O6(r,e={}){return new Ys(r,e).stream()}function P6(r,e={}){return new Ys(r,e).walkSync()}async function x6(r,e={}){return new Ys(r,e).walk()}function Aw(r,e={}){return new Ys(r,e).iterateSync()}function F6(r,e={}){return new Ys(r,e).iterate()}var Pge,Fge,Dge,Lge,Nge,Zd,AO=Me(()=>{Gc();EO();TO();Gc();EO();TO();bO();a(Tw,"globStreamSync");a(O6,"globStream");a(P6,"globSync");a(x6,"glob_");a(Aw,"globIterateSync");a(F6,"globIterate");Pge=Tw,Fge=Object.assign(O6,{sync:Tw}),Dge=Aw,Lge=Object.assign(F6,{sync:Aw}),Nge=Object.assign(P6,{stream:Tw,iterate:Aw}),Zd=Object.assign(x6,{glob:x6,globSync:P6,sync:Nge,globStream:O6,stream:Fge,globStreamSync:Tw,streamSync:Pge,globIterate:F6,iterate:Lge,globIterateSync:Aw,iterateSync:Dge,Glob:Ys,hasMagic:vO,escape:Wd,unescape:zs});Zd.glob=Zd});async function L6(r,e,t,n={}){let{excludeRelPath:i}=n,s=_u.default.join(r,"**/*.md"),o=await Zd(s,{nodir:!0,ignore:[_u.default.join(r,".obsidian/**"),_u.default.join(r,".trash/**"),_u.default.join(r,"**/.obsidian/**"),_u.default.join(r,"**/.trash/**")]}),c={filesScanned:0,filesModified:0,replacements:0,modifiedFiles:[]};for(let l of o){let u=_u.default.relative(r,l);if(i&&u===i)continue;c.filesScanned+=1;let f;try{f=await IO.default.readFile(l,"utf-8")}catch{continue}let{updated:d,replacements:p}=kge(f,e,t);p>0&&(c.filesModified+=1,c.replacements+=p,c.modifiedFiles.push(u),await IO.default.writeFile(l,d,"utf-8"))}return c}function kge(r,e,t){let n=r.split(/(^```[\s\S]*?^```)/m),i=0;for(let s=0;s<n.length;s++){if(s%2===1)continue;let o=n[s],c=Mge(o,e,t);i+=c.replacements,n[s]=c.updated}return{updated:n.join(""),replacements:i}}function Mge(r,e,t){let n=r.split(/(`[^`\n]*`)/),i=0;for(let s=0;s<n.length;s++){if(s%2===1)continue;let o=jge(n[s],e,t);i+=o.replacements,n[s]=o.updated}return{updated:n.join(""),replacements:i}}function jge(r,e,t){let n=/(?<!!)\[\[([^\[\]\n|#^]+)((?:[#^][^\[\]\n|]*)?)(?:\|[^\[\]\n]*)?\]\]/g,i=0;return{updated:r.replace(n,(o,c,l)=>c.trim()!==e?o:(i+=1,`[[${t}${l}]]`)),replacements:i}}var IO,_u,N6=Me(()=>{"use strict";IO=Q(ko()),_u=Q(require("path"));AO();a(L6,"rewriteInboundWikilinks");a(kge,"rewriteContent");a(Mge,"rewriteProseSegment");a(jge,"replaceWikilinks")});var Nr,ur,Iw,$ge,Ht,Xs=Me(()=>{"use strict";Nr=Q(ko()),ur=Q(require("path"));Wm();Iw=Q(Fe());N6();$ge=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Ht=class r{constructor(e){this.rootPath=e;this.uuidIndex=null;this.basenameIndex=null;this.aliasIndex=null}static{a(this,"FileSystemVaultAdapter")}async read(e){let t=this.resolvePath(e.path);if(!await Nr.default.pathExists(t))throw new Error(`File not found: ${e.path}`);return Nr.default.readFile(t,"utf-8")}async create(e,t){let n=this.resolvePath(e);if(await Nr.default.pathExists(n))throw new Error(`File already exists: ${e}`);return await Nr.default.ensureDir(ur.default.dirname(n)),await Nr.default.writeFile(n,t,"utf-8"),this.createFileObject(e)}async modify(e,t){let n=this.resolvePath(e.path);if(!await Nr.default.pathExists(n))throw new Error(`File not found: ${e.path}`);await Nr.default.writeFile(n,t,"utf-8")}async delete(e){let t=this.resolvePath(e.path);if(!await Nr.default.pathExists(t))throw new Error(`File not found: ${e.path}`);await Nr.default.remove(t)}async exists(e){let t=this.resolvePath(e);return Nr.default.pathExists(t)}getAbstractFileByPath(e){let t=this.resolvePath(e);try{let n=Nr.default.statSync(t);if(n.isFile())return this.createFileObject(e);if(n.isDirectory())return this.createFolderObject(e)}catch{return null}return null}getAllFiles(){let e=[];return this.walkDirectory(this.rootPath,t=>{if(t.endsWith(".md")){let n=ur.default.relative(this.rootPath,t);e.push(this.createFileObject(n))}}),e}getFrontmatter(e){try{let t=Nr.default.readFileSync(this.resolvePath(e.path),"utf-8");return this.extractFrontmatter(t)}catch{return null}}async updateFrontmatter(e,t){let n=await this.read(e),i=this.extractFrontmatter(n),s=r.FRONTMATTER_BLOCK.exec(n)?.[1];if(i===null&&s!==void 0&&s.trim()!=="")throw new Error(`updateFrontmatter: frontmatter of ${e.path} is not parseable \u2014 refusing to patch (would drop keys)`);let o=i??{},c=t({...o});Iw.FrontmatterService.applyPatch(o,c);let l=this.replaceFrontmatter(n,o);await this.modify(e,l)}async rename(e,t){let n=this.resolvePath(e.path),i=this.resolvePath(t);if(!await Nr.default.pathExists(n))throw new Error(`File not found: ${e.path}`);await Nr.default.ensureDir(ur.default.dirname(i)),await Nr.default.move(n,i)}async createFolder(e){let t=this.resolvePath(e);await Nr.default.ensureDir(t)}getFirstLinkpathDest(e,t,n){let i=e.split("|")[0].trim();if(!i)return null;if($ge.test(i)){this.uuidIndex===null&&this.buildUuidIndex();let u=i.toLowerCase(),f=this.uuidIndex.get(u);return f?this.createFileObject(f):null}let s=ur.default.dirname(this.resolvePath(t)),o;if(ur.default.isAbsolute(i)?o=this.resolvePath(i):o=ur.default.resolve(s,i),i.endsWith(".md")||(o+=".md"),Nr.default.existsSync(o)){let u=ur.default.relative(this.rootPath,o);return this.createFileObject(u)}(this.basenameIndex===null||this.aliasIndex===null)&&this.buildLinkpathIndex();let c=i.toLowerCase(),l=this.basenameIndex.get(c);if(l)return this.createFileObject(l);if(n?.allowAliasFallback!==!1){let u=this.aliasIndex.get(c);if(u)return this.createFileObject(u)}return null}buildLinkpathIndex(){this.basenameIndex=new Map,this.aliasIndex=new Map,this.walkDirectory(this.rootPath,e=>{if(!e.endsWith(".md"))return;let t=ur.default.relative(this.rootPath,e),n=ur.default.basename(e,".md").toLowerCase();this.basenameIndex.has(n)||this.basenameIndex.set(n,t);let i;try{i=Nr.default.readFileSync(e,"utf-8")}catch{return}let s=this.extractFrontmatter(i);if(!s)return;let o=s.aliases,c=Array.isArray(o)?o:typeof o=="string"?[o]:[];for(let l of c){if(typeof l!="string")continue;let u=l.trim().toLowerCase();u&&(this.aliasIndex.has(u)||this.aliasIndex.set(u,t))}})}buildUuidIndex(){this.uuidIndex=new Map,this.walkDirectory(this.rootPath,e=>{if(e.endsWith(".md")){let n=ur.default.basename(e,".md").match(/^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i);if(n){let i=n[1].toLowerCase(),s=ur.default.relative(this.rootPath,e);this.uuidIndex.set(i,s)}}})}async process(e,t){let n=await this.read(e),i=t(n);return await this.modify(e,i),i}getDefaultNewFileParent(){return{path:"",name:""}}async updateLinks(e,t,n){let i=ur.default.basename(t,".md");await L6(this.rootPath,n,i,{excludeRelPath:e})}resolvePath(e){if(ur.default.isAbsolute(e))return e;let t=this.rootPath.replace(/[/\\]+$/,""),n=ur.default.sep+e;return n===t||n.startsWith(t+ur.default.sep)?n:ur.default.join(this.rootPath,e)}createFileObject(e){let t=ur.default.basename(e),n=ur.default.basename(e,ur.default.extname(e)),i=ur.default.dirname(e);return{path:e,basename:n,name:t,parent:i!=="."?this.createFolderObject(i):null}}createFolderObject(e){return{path:e,name:ur.default.basename(e)}}static{this.FRONTMATTER_BLOCK=/^---\n([\s\S]*?)\n---/}extractFrontmatter(e){let t=e.match(r.FRONTMATTER_BLOCK);return t?(0,Iw.parseYamlFrontmatterTolerant)(t[1]):null}replaceFrontmatter(e,t){let i=`---
|
|
428
428
|
${qd(t,{lineWidth:-1,noRefs:!0,quoteStyle:"double"}).trim()}
|
|
429
429
|
---`,s=r.FRONTMATTER_BLOCK;return e.match(s)?e.replace(s,()=>i):`${i}
|
|
430
430
|
${e}`}shouldSkipDirectory(e){return e.startsWith(".")}walkDirectory(e,t){let n;try{n=Nr.default.readdirSync(e,{withFileTypes:!0})}catch(i){let s=i;if(s.code==="EPERM"||s.code==="EACCES")return;throw i}n.sort((i,s)=>i.name<s.name?-1:i.name>s.name?1:0);for(let i of n){let s=ur.default.join(e,i.name);if(i.isDirectory()){if(this.shouldSkipDirectory(i.name))continue;this.walkDirectory(s,t)}else i.isFile()&&t(s)}}}});function Wa(r){if(r instanceof Qi.IRI)return{type:"IRI",value:r.value};if(r instanceof Qi.Literal){let e={type:"Literal",value:r.value};return r.datatype&&(e.datatype=r.datatype.value),r.language&&(e.language=r.language),e}return r instanceof Qi.BlankNode?{type:"BlankNode",value:r.id}:{type:"IRI",value:String(r)}}function ug(r){switch(r.type){case"IRI":return new Qi.IRI(r.value);case"Literal":return r.datatype?new Qi.Literal(r.value,new Qi.IRI(r.datatype)):r.language?new Qi.Literal(r.value,void 0,r.language):new Qi.Literal(r.value);case"BlankNode":return new Qi.BlankNode(r.value);default:return new Qi.IRI(r.value)}}var Qi,RO=Me(()=>{"use strict";Qi=Q(Fe());a(Wa,"serializeNode");a(ug,"deserializeNode")});function k6(r){let e=Wa(r.subject),t=Wa(r.predicate),n=Wa(r.object);return`${e.type}:${e.value}|${t.type}:${t.value}|${n.type}:${n.value}|${n.datatype??""}|${n.language??""}`}async function fg(r){let e=new Uo.InMemoryTripleStore;await e.addAll(r);let n=await new Uo.RDFSInferenceEngine().materialize(e),i=new Uo.NonInheritablePropertyRegistry;await i.initialize(e);let s=new Uo.PropertyCardinalityRegistry;await s.initialize(e);let o=new Uo.PrototypeChainMaterializer(i,s);if(n+=await o.materialize(e),n<=0)return{inferred:[],inferredCount:0};let c=new Set;for(let f of r)c.add(k6(f));let l=await e.match(),u=[];for(let f of l)c.has(k6(f))||u.push(f);return{inferred:u,inferredCount:n}}var Uo,CO=Me(()=>{"use strict";Uo=Q(Fe());RO();a(k6,"tripleKey");a(fg,"materializeInferredTriples")});var Su,Rw,dg=Me(()=>{"use strict";Su="[a-z][a-zA-Z0-9]*(?:-[a-zA-Z0-9]+)*",Rw=new RegExp(`^${Su}$`)});var Y6={};qu(Y6,{CACHE_FORMAT_VERSION:()=>DO,CacheManager:()=>wu,DELTA_REBUILD_RATIO:()=>LO,STALE_TMP_MAX_AGE_MS:()=>G6,deserializeNode:()=>ug,diffManifest:()=>Cw,inferenceInputsChanged:()=>K6,isSafeRelativePath:()=>H6,serializeNode:()=>Wa});function xO(r){return r.added.length===0&&r.modified.length===0&&r.removed.length===0}function Cw(r,e){let t=[],n=[],i=[],s=new Map;for(let o of r)s.set(o.path,{mtimeMs:o.mtimeMs,size:o.size});for(let[o,c]of e){let l=s.get(o);l===void 0?t.push(o):(l.mtimeMs!==c.mtimeMs||l.size!==c.size)&&n.push(o)}for(let o of s.keys())e.has(o)||i.push(o);return{added:t,modified:n,removed:i}}function OO(r){return typeof r.basename=="string"}function M6(r){return ep.test(gi.default.basename(r,gi.default.extname(r)))}function PO(r){if(r.tboxLabel)return!0;let e=(0,an.vaultPathToIRI)(r.path);for(let t of r.triples)if(t.subject.type==="IRI"&&t.subject.value===e&&t.predicate.type==="IRI"&&t.predicate.value.endsWith(q6)&&(t.object.type==="IRI"||t.object.type==="Literal"&&ep.test(t.object.value)))return!0;return!1}function Bge(r,e,t){for(let n of r.triples)if(n.object.type==="IRI"){if(e.has(n.object.value))return!0}else if(n.object.type==="Literal"&&t.size>0&&t.has(Vge(n.object.value)))return!0;return!1}function Vge(r){let e=r.trim();e.startsWith("[[")&&e.endsWith("]]")&&(e=e.slice(2,-2));let t=e.indexOf("|");return t>=0&&(e=e.slice(0,t)),e=e.trim().toLowerCase(),e.endsWith(".md")?e.slice(0,-3):e}function j6(r){let e=(0,an.vaultPathToIRI)(r.path),t=new Set;for(let n of r.triples)n.subject.type==="IRI"&&n.subject.value===e&&n.predicate.type==="IRI"&&n.predicate.value.endsWith(kO)&&n.object.type==="Literal"&&t.add(n.object.value.trim().toLowerCase());return t}function Gge(r){let e=new Set;for(let t of z6(r))e.add(t.toLowerCase());return e}function z6(r){let e=r?.aliases,t=Array.isArray(e)?e:e==null?[]:[e],n=[];for(let i of t)typeof i=="string"&&i.trim()!==""&&n.push(i.trim());return n}function qge(r){return z6(r).some(e=>ep.test(e))}function Wge(r){let e=(0,an.vaultPathToIRI)(r.path);for(let t of r.triples)if(t.subject.type==="IRI"&&t.subject.value===e&&t.predicate.type==="IRI"&&t.predicate.value.endsWith(kO)&&(t.object.type==="IRI"||t.object.type==="Literal"&&ep.test(t.object.value.trim())))return!0;return!1}function zge(r,e){if(r.size!==e.size)return!1;for(let t of r)if(!e.has(t))return!1;return!0}function FO(r,e){if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0}function NO(r,e){return r.newLabel?`TBox-form asset changed: ${e}`:r.hadLabel?`asset lost its TBox-form label: ${e}`:`TBox-form alias: ${e}`}function $6(r,e){let t=(0,an.vaultPathToIRI)(r),n=[],i=[],s=[];for(let o of e){if(o.subject.type!=="IRI"||o.subject.value!==t||o.predicate.type!=="IRI")continue;let c=o.predicate.value;c.endsWith(q6)?o.object.type==="IRI"&&n.push(o.object.value):c.endsWith(kO)?o.object.type==="IRI"&&i.push(o.object.value):c.endsWith(W6)&&s.push(`${o.object.type}:${o.object.value}|${o.object.datatype??""}|${o.object.language??""}`)}return i.sort(),{label:n,tboxAliases:i,instanceClass:s}}function Hge(r,e,t,n){let i=$6(r,e),s=$6(r,t);return FO(i.label,s.label)?FO(i.tboxAliases,s.tboxAliases)?FO(i.instanceClass,s.instanceClass)?null:`TBox-form asset class changed: ${r}`:`TBox-form alias: ${r}`:NO(n,r)}function Kge(r){if((0,an.frontmatterDeclaresFileSpace)(r))return!0;let e=r.exo__Instance_class;return(Array.isArray(e)?e:[e]).some(n=>typeof n=="string"&&/\bexo__FileSpace\b/.test(n))}function H6(r){return r.length===0||gi.default.isAbsolute(r)||/^[a-zA-Z]:/.test(r)||/^[\\/]/.test(r)?!1:!r.split(/[\\/]/).some(e=>e==="..")}function U6(r){return r.predicate.type==="IRI"&&Uge.some(e=>r.predicate.value.endsWith(e))}function B6(r){return!!r&&r.triples.some(e=>e.predicate.type==="IRI"&&e.predicate.value.endsWith(MO))}function K6(r,e,t){let n=new Map;for(let s of r.files)n.set(s.path,s);let i=new Set;for(let s of r.files)for(let o of s.triples)o.object.type==="IRI"&&o.predicate.type==="IRI"&&o.predicate.value.endsWith(MO)&&i.add(o.object.value);for(let s of t){let o=n.get(s),c=e.get(s);if(B6(o)||B6(c)||i.has((0,an.vaultPathToIRI)(s)))return!0;let l=a(d=>`${d.subject.type}:${d.subject.value}|${d.predicate.value}|${d.object.type}:${d.object.value}`,"key"),u=(o?.triples??[]).filter(U6).map(l).sort(),f=(c?.triples??[]).filter(U6).map(l).sort();if(u.length!==f.length)return!0;for(let d=0;d<u.length;d++)if(u[d]!==f[d])return!0}return!1}var gi,V6,Gr,an,DO,LO,G6,ep,q6,kO,MO,W6,Uge,wu,xw=Me(()=>{"use strict";gi=Q(require("path")),V6=Q(require("crypto")),Gr=Q(ko()),an=Q(Fe());Xs();RO();CO();dg();DO=4,LO=.5,G6=600*1e3,ep=new RegExp(`^${Su}__\\S+$`),q6="#Asset_label",kO="#Asset_aliases",MO="#Asset_prototype",W6="#Instance_class",Uge=[W6,"#Class_superClass","#type",MO],wu=class r{constructor(e){this.cliVersion="1.0.0";this.loaded=null;this.loadedStamp=null;this.vaultPath=gi.default.resolve(e),this.cachePath=gi.default.join(this.vaultPath,".exocortex","cache","triples.json")}static{a(this,"CacheManager")}getCachePath(){return this.cachePath}async isCacheValid(){let e=await this.computeManifestDiff();return e!==null&&xO(e)}async computeManifestDiff(){let e=await this.readCacheData();if(!e)return null;let t=this.computeFileManifest();return t?Cw(e.files,t):null}async loadOrBuild(){let e=Date.now(),t=await this.readCacheData();if(!t)return this.rebuild(e,"cache absent, corrupt or legacy format",null);let n=this.computeFileManifest();if(!n)return this.rebuild(e,"vault could not be walked",t);let i=Cw(t.files,n);if(xO(i))return{triples:this.materializeTriples(t),explicitCount:r.explicitCountOf(t),zeroTriplePaths:r.zeroTriplePathsOf(t),cacheHit:!0,durationMs:Date.now()-e,mode:"hit",reparsedFiles:0};let s=new Ht(this.vaultPath),o=await this.planDelta(t,n,i,s);if(o.rebuildReason)return this.rebuild(e,o.rebuildReason,t);let c=await this.applyDelta(t,n,i,o.reparse,s);return{triples:c.triples,explicitCount:r.explicitCountOf(c.data),zeroTriplePaths:r.zeroTriplePathsOf(c.data),cacheHit:!0,durationMs:Date.now()-e,mode:"delta",reparsedFiles:o.reparse.length,inferredRecomputed:c.inferredRecomputed}}static explicitCountOf(e){let t=0;for(let n of e.files)t+=n.triples.length;return t}static zeroTriplePathsOf(e){let t=[];for(let n of e.files)n.triples.length===0&&t.push(n.path);return t}async refreshAfterWrite(){let e=await this.loadedIsCurrent()?this.loaded:await this.readCacheData();if(!e)return{mode:"skipped",reparsedFiles:0,reason:"no cache to refresh"};let t=new Ht(this.vaultPath),n=this.computeFileManifest(t);if(!n)return{mode:"skipped",reparsedFiles:0,reason:"vault could not be walked"};let i=Cw(e.files,n);if(xO(i))return{mode:"noop",reparsedFiles:0};let s=await this.planDelta(e,n,i,t);return s.rebuildReason?{mode:"skipped",reparsedFiles:0,reason:`rebuild needed (${s.rebuildReason}) \u2014 left to the next reader`}:(await this.applyDelta(e,n,i,s.reparse,t,{needTriples:!1}),{mode:"delta",reparsedFiles:s.reparse.length})}async rebuild(e,t,n){let i=await this.buildInternal({strict:!1,materializeInference:n?.metadata.inferenceEnabled===!0});return{triples:i.triples.concat(i.inferred),explicitCount:i.triples.length,zeroTriplePaths:r.zeroTriplePathsOf(i.data),cacheHit:!1,durationMs:Date.now()-e,mode:"rebuild",reparsedFiles:i.data.files.length,rebuildReason:t}}materializeTriples(e){let t=[];for(let n of e.files)for(let i of n.triples)t.push(this.deserializeTriple(i));for(let n of e.inferred)t.push(this.deserializeTriple(n));return t}async readCacheData(){try{if(!await Gr.default.pathExists(this.cachePath))return null;let e=await this.statCache(),t=await Gr.default.readJson(this.cachePath);if(!t.metadata||t.metadata.formatVersion!==DO||typeof t.metadata.tripleCount!="number"||!Array.isArray(t.files)||!Array.isArray(t.inferred))return null;for(let i of t.files)if(typeof i?.path!="string"||!H6(i.path)||typeof i.mtimeMs!="number"||typeof i.size!="number"||!Array.isArray(i.triples))return null;let n={metadata:{...t.metadata,fileSpacePrefixes:Array.isArray(t.metadata.fileSpacePrefixes)?t.metadata.fileSpacePrefixes:[],fileSpaceDeclarations:Array.isArray(t.metadata.fileSpaceDeclarations)?t.metadata.fileSpaceDeclarations:[],inferenceEnabled:typeof t.metadata.inferenceEnabled=="boolean"?t.metadata.inferenceEnabled:t.inferred.length>0},files:t.files,inferred:t.inferred};return this.loaded=n,this.loadedStamp=e,n}catch{return null}}async statCache(){try{let e=await Gr.default.stat(this.cachePath);return{mtimeMs:e.mtimeMs,size:e.size}}catch{return null}}async loadedIsCurrent(){if(!this.loaded||!this.loadedStamp)return!1;let e=await this.statCache();return e!==null&&e.mtimeMs===this.loadedStamp.mtimeMs&&e.size===this.loadedStamp.size}computeFileManifest(e){try{let t=e??new Ht(this.vaultPath),n=new Map;for(let i of t.getAllFiles())try{let s=Gr.default.statSync(gi.default.join(this.vaultPath,i.path));n.set(i.path,{mtimeMs:s.mtimeMs,size:s.size})}catch{}return n}catch{return null}}async planDelta(e,t,n,i){let s=n.added.length+n.modified.length+n.removed.length,o=Math.max(e.files.length,t.size,1);if(s>o*LO)return{reparse:[],rebuildReason:`${s} of ${o} files changed (> ${LO*100}%)`};let c=new Map;for(let m of e.files)c.set(m.path,m);let l=new Set(e.metadata.fileSpaceDeclarations),u=new Set,f=new Set;for(let m of n.removed){if(l.has(m))return{reparse:[],rebuildReason:`FileSpace declaration removed: ${m}`};if(M6(m))return{reparse:[],rebuildReason:`TBox-form file removed: ${m}`};let b=c.get(m);if(b&&PO(b))return{reparse:[],rebuildReason:`TBox-form asset removed: ${m}`};u.add((0,an.vaultPathToIRI)(m))}let d=new Map;for(let m of[...n.added,...n.modified]){if(l.has(m))return{reparse:[],rebuildReason:`FileSpace declaration changed: ${m}`};if(M6(m))return{reparse:[],rebuildReason:`TBox-form file changed: ${m}`};let b=i.getAbstractFileByPath(m),_=b&&OO(b)?b:null,S=_?i.getFrontmatter(_):null;if(S&&Kge(S))return{reparse:[],rebuildReason:`FileSpace declaration changed: ${m}`};d.set(m,{file:_,frontmatter:S})}let p=null;for(let[m,{file:b,frontmatter:_}]of d){let S=c.get(m),I=_?.exo__Asset_label,E={newLabel:typeof I=="string"&&ep.test(I),hadLabel:S!==void 0&&PO(S),newAlias:qge(_),hadAlias:S!==void 0&&Wge(S)},w;if(E.newLabel||E.hadLabel||E.newAlias||E.hadAlias){if(!S||S.triples.length===0||!b)return{reparse:[],rebuildReason:NO(E,m)};p??=new an.NoteToRDFConverter(i);let x;try{x=(await p.convertNote(b)).map(this.serializeTriple)}catch{return{reparse:[],rebuildReason:NO(E,m)}}let P=Hge(m,S.triples,x,E);if(P)return{reparse:[],rebuildReason:P};w=j6({path:m,mtimeMs:0,size:0,triples:x})}else w=Gge(_);let R=S?j6(S):new Set;if(S&&!zge(R,w)){let x=!1;for(let P of R)w.has(P)||(f.add(P),x=!0);for(let P of w)R.has(P)||f.add(P);x&&u.add((0,an.vaultPathToIRI)(m))}if(!S)for(let x of w)f.add(x)}for(let m of n.added){let b=gi.default.basename(m);u.add((0,an.vaultPathToIRI)(b)),f.add(gi.default.basename(m,gi.default.extname(m)).toLowerCase())}let h=new Set([...n.added,...n.modified]),g=new Set(n.removed);if(u.size>0||f.size>0)for(let m of e.files)h.has(m.path)||g.has(m.path)||Bge(m,u,f)&&h.add(m.path);return{reparse:[...h]}}async applyDelta(e,t,n,i,s,o={needTriples:!0}){let c=[];for(let R of i){let x=s.getAbstractFileByPath(R);x&&OO(x)&&c.push(x)}let l=new Map;await new an.NoteToRDFConverter(s).convertVaultWithValidation({strict:!1,files:c,fileSpacePrefixes:e.metadata.fileSpacePrefixes,onFileTriples:a((R,x)=>{l.set(R.path,x)},"onFileTriples")});let f=new Set(i),d=new Set(n.removed),p=a(R=>this.makeEntry(R,t,l.get(R)??[],s),"makeEntry"),h=[];for(let R of e.files)d.has(R.path)||h.push(f.has(R.path)?p(R.path):R);let g=new Set(h.map(R=>R.path));for(let R of t.keys())g.has(R)||h.push(p(R));let m=null,b=a(()=>{if(m===null){m=[];for(let R of h)for(let x of R.triples)m.push(this.deserializeTriple(x))}return m},"explicitTriples"),_=[],S=[],I=!1;if(e.metadata.inferenceEnabled){let R=new Map;for(let x of h)R.set(x.path,x);K6(e,R,[...f,...d])?(S=(await fg(b())).inferred,_=S.map(this.serializeTriple),I=!0):(_=e.inferred,o.needTriples&&(S=e.inferred.map(this.deserializeTriple)))}let E=this.assembleCacheData(h,_,{fileSpacePrefixes:e.metadata.fileSpacePrefixes,fileSpaceDeclarations:e.metadata.fileSpaceDeclarations,inferenceEnabled:e.metadata.inferenceEnabled});await this.writeCacheData(E);let w=o.needTriples?b().concat(S):[];return{data:E,triples:w,inferredRecomputed:I}}makeEntry(e,t,n,i){let s=t.get(e),o={path:e,mtimeMs:s?.mtimeMs??0,size:s?.size??0,triples:n.map(this.serializeTriple)},c=PO(o);if(!c&&n.length===0){let l=i.getAbstractFileByPath(e),f=(l&&OO(l)?i.getFrontmatter(l):null)?.exo__Asset_label;c=typeof f=="string"&&ep.test(f)}return c&&(o.tboxLabel=!0),o}async buildCache(){let e=await this.buildCacheWithValidation({strict:!1});return{tripleCount:e.tripleCount,durationMs:e.durationMs}}async buildCacheWithValidation(e={}){return(await this.buildInternal(e)).result}async buildInternal(e){let t=Date.now(),n=new Ht(this.vaultPath),i=n.getAllFiles(),s=new Map;for(let h of i)try{let g=Gr.default.statSync(gi.default.join(this.vaultPath,h.path));s.set(h.path,{mtimeMs:g.mtimeMs,size:g.size})}catch{}let o=new Map,l=await new an.NoteToRDFConverter(n).convertVaultWithValidation({strict:e.strict??!1,files:i,onFileTriples:a((h,g)=>{o.set(h.path,g)},"onFileTriples")}),u=[];for(let h of i)s.has(h.path)&&u.push(this.makeEntry(h.path,s,o.get(h.path)??[],n));let f=[];for(let h of i){if(!s.has(h.path))continue;let g=o.get(h.path);g&&f.push(...g)}let d=[];e.materializeInference&&(d=(await fg(f)).inferred);let p=this.assembleCacheData(u,d.map(this.serializeTriple),{fileSpacePrefixes:l.fileSpaces?.prefixes??[],fileSpaceDeclarations:l.fileSpaces?.declarationPaths??[],inferenceEnabled:e.materializeInference===!0});return await this.writeCacheData(p),{result:{tripleCount:l.triples.length,durationMs:Date.now()-t,skippedFiles:l.skippedFiles,summary:l.summary},data:p,triples:f,inferred:d}}async validateVault(){let e=new Ht(this.vaultPath);return new an.NoteToRDFConverter(e).validateVault()}async invalidate(){await Gr.default.pathExists(this.cachePath)&&await Gr.default.remove(this.cachePath),await this.removeStaleTempFiles()}async removeStaleTempFiles(){let e=gi.default.dirname(this.cachePath),t=`${gi.default.basename(this.cachePath)}.`,n;try{n=await Gr.default.readdir(e)}catch{return}let i=Date.now()-G6;for(let s of n){if(!s.startsWith(t)||!s.endsWith(".tmp"))continue;let o=gi.default.join(e,s);try{(await Gr.default.stat(o)).mtimeMs<i&&await Gr.default.remove(o)}catch{}}}async getCacheStats(){try{if(!await Gr.default.pathExists(this.cachePath))return null;let e=await this.readCacheData();if(!e){let i=await Gr.default.stat(this.cachePath);return{tripleCount:0,createdAt:new Date(i.mtimeMs),isValid:!1,sizeBytes:i.size}}let t=await Gr.default.stat(this.cachePath),n=await this.isCacheValid();return{tripleCount:e.metadata.tripleCount,createdAt:new Date(e.metadata.timestamp),isValid:n,sizeBytes:t.size}}catch{return null}}async saveInferredTriples(e){let t=await this.readCacheData();if(!t)throw new Error(`Cannot save inferred triples: no valid cache at ${this.cachePath} (build the cache first)`);let n=this.assembleCacheData(t.files,e.map(this.serializeTriple),{fileSpacePrefixes:t.metadata.fileSpacePrefixes,fileSpaceDeclarations:t.metadata.fileSpaceDeclarations,inferenceEnabled:!0});await this.writeCacheData(n)}assembleCacheData(e,t,n){let i=0;for(let s of e)i+=s.triples.length;return{metadata:{version:this.cliVersion,timestamp:Date.now(),vaultPath:this.vaultPath,tripleCount:i+t.length,formatVersion:DO,fileCount:e.length,inferredCount:t.length,fileSpacePrefixes:n.fileSpacePrefixes,fileSpaceDeclarations:n.fileSpaceDeclarations,inferenceEnabled:n.inferenceEnabled},files:e,inferred:t}}async writeCacheData(e){await Gr.default.ensureDir(gi.default.dirname(this.cachePath)),await this.removeStaleTempFiles();let t=`${this.cachePath}.${process.pid}.${V6.default.randomBytes(6).toString("hex")}.tmp`;try{await Gr.default.writeJson(t,e,{spaces:0});let n=await Gr.default.stat(t);await Gr.default.rename(t,this.cachePath),this.loaded=e,this.loadedStamp={mtimeMs:n.mtimeMs,size:n.size}}catch(n){throw await Gr.default.remove(t).catch(()=>{}),n}}serializeTriple(e){return{subject:Wa(e.subject),predicate:Wa(e.predicate),object:Wa(e.object)}}deserializeTriple(e){return new an.Triple(ug(e.subject),ug(e.predicate),ug(e.object))}};a(xO,"isEmptyDiff");a(Cw,"diffManifest");a(OO,"isFile");a(M6,"isTBoxBasename");a(PO,"entryHasTBoxLabel");a(Bge,"entryRefersTo");a(Vge,"linkpathOf");a(j6,"entryAliases");a(Gge,"frontmatterAliases");a(z6,"rawFrontmatterAliases");a(qge,"frontmatterHasTBoxFormAlias");a(Wge,"entryHasTBoxFormAlias");a(zge,"sameSet");a(FO,"sameList");a(NO,"tboxRebuildReason");a($6,"tboxProjection");a(Hge,"tboxProjectionChanged");a(Kge,"frontmatterDeclaresFileSpaceAnyForm");a(H6,"isSafeRelativePath");a(U6,"isInferenceRelevant");a(B6,"hasPrototype");a(K6,"inferenceInputsChanged")});var Q6={};qu(Q6,{SKIPPED_FILES_NOTICE_LIMIT:()=>$O,cacheLoadNotice:()=>Eu,loadVaultTriples:()=>yi,skippedFilesNotice:()=>UO,writeThroughCache:()=>BO,writeThroughNotice:()=>VO});async function yi(r,e){if(e.useCache){let u=e.cacheManager??new wu(r),f=jO.default.join(jO.default.resolve(r),".exocortex","cache","triples.json");if(u.getCachePath()!==f)throw new Error(`loadVaultTriples: the given CacheManager belongs to ${u.getCachePath()}, not to vault ${r}`);let d=await u.loadOrBuild();return{triples:d.triples,cacheHit:d.cacheHit,mode:d.mode,reparsedFiles:d.reparsedFiles,cacheManager:u,explicitCount:d.explicitCount,zeroTriplePaths:d.zeroTriplePaths}}let t=e.vaultAdapter??new Ht(r),n=new X6.NoteToRDFConverter(t),i=t.getAllFiles(),s=new Map,o=await n.convertVaultWithValidation({strict:!1,onFileTriples:a((u,f)=>{s.set(u.path,f.length)},"onFileTriples")}),c=o.triples,l=i.filter(u=>(s.get(u.path)??0)===0).map(u=>u.path);return{triples:c,cacheHit:!1,mode:"full-parse",explicitCount:c.length,zeroTriplePaths:l,skippedFiles:o.skippedFiles}}function Eu(r){switch(r.mode){case"hit":return"\u26A1 triple cache: hit";case"delta":return`\u267B\uFE0F triple cache: delta (${r.reparsedFiles??0} file(s) re-parsed)`;case"rebuild":{let e=r.triples.length-r.explicitCount,t=e>0?` + inferred layer (${e})`:"";return`\u{1F528} triple cache: rebuild (${r.reparsedFiles??0} file(s) parsed, cache written${t})`}default:return"triple cache: not used (full parse)"}}function UO(r){let e=r.skippedFiles;if(e!==void 0){if(e.length===0)return null;let t=[`\u26A0\uFE0F ${e.length} file(s) skipped by the vault loader \u2014 they contributed no triples:`];for(let i of e.slice(0,$O))t.push(` - ${i.path}`),t.push(` ${i.reason}`);let n=e.length-$O;return n>0&&t.push(` \u2026 and ${n} more \u2014 run 'index' to see them all`),t.join(`
|
|
@@ -701,7 +701,7 @@ Next steps:
|
|
|
701
701
|
`).map(n=>n.trim()).filter(n=>n.length>0),t=e[e.length-1];if(t!==void 0)try{return JSON.parse(t)}catch{return}}a(Swe,"parseLastJsonLine");function dG(r,e){return e.filter(t=>{let n=r[t];return typeof n!="string"||n.trim().length===0})}a(dG,"missingStringFields");var VE=class{constructor(e){this.deps=e}static{a(this,"McpServer")}async handle(e){if(typeof e!="object"||e===null||Array.isArray(e))return{jsonrpc:"2.0",id:null,error:{code:fG,message:"Invalid request: expected a JSON-RPC object"}};let t=e.id,n=t===void 0;if(typeof e.method!="string")return n?null:{jsonrpc:"2.0",id:t??null,error:{code:fG,message:"Invalid request: missing method"}};if(n)return null;let i=t??null;switch(e.method){case"initialize":return{jsonrpc:"2.0",id:i,result:{protocolVersion:bwe,capabilities:{tools:{}},serverInfo:{name:"exocortex",version:this.deps.version}}};case"ping":return{jsonrpc:"2.0",id:i,result:{}};case"tools/list":return{jsonrpc:"2.0",id:i,result:{tools:uG}};case"tools/call":return{jsonrpc:"2.0",id:i,result:await this.callTool(e.params??{})};default:return{jsonrpc:"2.0",id:i,error:{code:_we,message:`Method not found: ${e.method}`}}}}async callTool(e){let t=e.name,n=e.arguments??{},i;if(t==="create_asset"){let c=dG(n,["vault","class","label"]);if(c.length>0)return vp(`create_asset: missing required argument(s): ${c.join(", ")}`,!0);let l=aG(n);if(l!==null)return vp(`create_asset: ${l}`,!0);i=cG(n)}else if(t==="create_effort"){let c=dG(n,["vault","command","target"]);if(c.length>0)return vp(`create_effort: missing required argument(s): ${c.join(", ")}`,!0);i=lG(n)}else return vp(`Unknown tool: ${String(t)}`,!0);let s=await this.deps.runCli(i);if(s.exitCode!==0){let c=s.stderr.trim()||s.stdout.trim()||"(no diagnostic output)";return vp(`exocortex-cli exited ${s.exitCode}
|
|
702
702
|
${c}`,!0)}let o=Swe(s.stdout);return vp(o===void 0?s.stdout.trim():JSON.stringify(o))}};var mG=require("child_process");var wwe=32*1024*1024;function gG(r){return e=>new Promise(t=>{(0,mG.execFile)(process.execPath,[r,...e],{maxBuffer:wwe},(n,i,s)=>{let o=0;if(n){let c=n.code;o=typeof c=="number"?c:1}t({stdout:i,stderr:s,exitCode:o})})})}a(gG,"createSelfCliRunner");async function Ewe(r,e,t){let n=(0,yG.createInterface)({input:e,crlfDelay:1/0});for await(let i of n){let s=i.trim();if(s.length===0)continue;let o;try{o=JSON.parse(s)}catch{t(JSON.stringify({jsonrpc:"2.0",id:null,error:{code:pG,message:"Parse error: invalid JSON"}})+`
|
|
703
703
|
`);continue}let c;try{c=await r.handle(o)}catch(l){c={jsonrpc:"2.0",id:typeof o?.id=="string"||typeof o?.id=="number"?o.id:null,error:{code:hG,message:`Internal error: ${l instanceof Error?l.message:String(l)}`}}}c!==null&&t(JSON.stringify(c)+`
|
|
704
|
-
`)}}a(Ewe,"runStdioServer");function bG(r){return new pe("mcp").description("Run an MCP (Model Context Protocol) stdio server exposing create_asset / create_effort tools backed by this CLI").option("--entry <path>","Path to the CLI entry script the tools invoke (defaults to this process's script)").action(async e=>{let t=e.entry??process.argv[1],n=new VE({runCli:gG(t),version:r??"unknown"});await Ewe(n,process.stdin,i=>process.stdout.write(i))})}a(bG,"mcpCommand");function GE(r){let e=new pe;return e.name("exocortex").description("CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more").version(r??"16.255.
|
|
704
|
+
`)}}a(Ewe,"runStdioServer");function bG(r){return new pe("mcp").description("Run an MCP (Model Context Protocol) stdio server exposing create_asset / create_effort tools backed by this CLI").option("--entry <path>","Path to the CLI entry script the tools invoke (defaults to this process's script)").action(async e=>{let t=e.entry??process.argv[1],n=new VE({runCli:gG(t),version:r??"unknown"});await Ewe(n,process.stdin,i=>process.stdout.write(i))})}a(bG,"mcpCommand");function GE(r){let e=new pe;return e.name("exocortex").description("CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more").version(r??"16.255.22"),e.addCommand(Q7()),e.addCommand(aV()),e.addCommand(F8()),e.addCommand(k8()),e.addCommand(n7()),e.addCommand(M8()),e.addCommand(V8()),e.addCommand(G8()),e.addCommand(f7()),e.addCommand(g7()),e.addCommand(N7()),e.addCommand(U7()),e.addCommand(q7()),e.addCommand(W7()),e.addCommand(H7()),e.addCommand(K7()),e.addCommand(OV()),e.addCommand(DV()),e.addCommand(YV()),e.addCommand(QV()),e.addCommand(eG()),e.addCommand(tG()),e.addCommand(iG()),e.addCommand($V()),e.addCommand(zV()),e.addCommand(sG()),e.addCommand(bG(r??"16.255.22")),e}a(GE,"createProgram");GE().parse();0&&(module.exports={createProgram});
|
|
705
705
|
/*! Bundled license information:
|
|
706
706
|
|
|
707
707
|
reflect-metadata/Reflect.js:
|
package/package.json
CHANGED