docs-hn/.yarn/releases/yarn-4.9.1.cjs

949 lines
2.9 MiB
JavaScript
Raw Permalink Normal View History

2025-04-10 09:51:25 -04:00
#!/usr/bin/env node
/* eslint-disable */
//prettier-ignore
2025-04-11 10:05:45 -04:00
(()=>{var u7e=Object.create;var D_=Object.defineProperty;var f7e=Object.getOwnPropertyDescriptor;var A7e=Object.getOwnPropertyNames;var p7e=Object.getPrototypeOf,h7e=Object.prototype.hasOwnProperty;var ye=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var It=(t,e)=>()=>(t&&(e=t(t=0)),e);var L=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Vt=(t,e)=>{for(var r in e)D_(t,r,{get:e[r],enumerable:!0})},g7e=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of A7e(e))!h7e.call(t,a)&&a!==r&&D_(t,a,{get:()=>e[a],enumerable:!(s=f7e(e,a))||s.enumerable});return t};var et=(t,e,r)=>(r=t!=null?u7e(p7e(t)):{},g7e(e||!t||!t.__esModule?D_(r,"default",{value:t,enumerable:!0}):r,t));var ui={};Vt(ui,{SAFE_TIME:()=>P$,S_IFDIR:()=>lx,S_IFLNK:()=>cx,S_IFMT:()=>_f,S_IFREG:()=>M2});var _f,lx,M2,cx,P$,x$=It(()=>{_f=61440,lx=16384,M2=32768,cx=40960,P$=456789e3});var or={};Vt(or,{EBADF:()=>Uo,EBUSY:()=>d7e,EEXIST:()=>w7e,EINVAL:()=>y7e,EISDIR:()=>C7e,ENOENT:()=>E7e,ENOSYS:()=>m7e,ENOTDIR:()=>I7e,ENOTEMPTY:()=>v7e,EOPNOTSUPP:()=>S7e,EROFS:()=>B7e,ERR_DIR_CLOSED:()=>b_});function wc(t,e){return Object.assign(new Error(`${t}: ${e}`),{code:t})}function d7e(t){return wc("EBUSY",t)}function m7e(t,e){return wc("ENOSYS",`${t}, ${e}`)}function y7e(t){return wc("EINVAL",`invalid argument, ${t}`)}function Uo(t){return wc("EBADF",`bad file descriptor, ${t}`)}function E7e(t){return wc("ENOENT",`no such file or directory, ${t}`)}function I7e(t){return wc("ENOTDIR",`not a directory, ${t}`)}function C7e(t){return wc("EISDIR",`illegal operation on a directory, ${t}`)}function w7e(t){return wc("EEXIST",`file already exists, ${t}`)}function B7e(t){return wc("EROFS",`read-only filesystem, ${t}`)}function v7e(t){return wc("ENOTEMPTY",`directory not empty, ${t}`)}function S7e(t){return wc("EOPNOTSUPP",`operation not supported, ${t}`)}function b_(){return wc("ERR_DIR_CLOSED","Directory handle was closed")}var ux=It(()=>{});var el={};Vt(el,{BigIntStatsEntry:()=>iE,DEFAULT_MODE:()=>k_,DirEntry:()=>P_,StatEntry:()=>nE,areStatsEqual:()=>Q_,clearStats:()=>fx,convertToBigIntStats:()=>b7e,makeDefaultStats:()=>k$,makeEmptyStats:()=>D7e});function k$(){return new nE}function D7e(){return fx(k$())}function fx(t){for(let e in t)if(Object.hasOwn(t,e)){let r=t[e];typeof r=="number"?t[e]=0:typeof r=="bigint"?t[e]=BigInt(0):x_.types.isDate(r)&&(t[e]=new Date(0))}return t}function b7e(t){let e=new iE;for(let r in t)if(Object.hasOwn(t,r)){let s=t[r];typeof s=="number"?e[r]=BigInt(s):x_.types.isDate(s)&&(e[r]=new Date(s))}return e.atimeNs=e.atimeMs*BigInt(1e6),e.mtimeNs=e.mtimeMs*BigInt(1e6),e.ctimeNs=e.ctimeMs*BigInt(1e6),e.birthtimeNs=e.birthtimeMs*BigInt(1e6),e}function Q_(t,e){if(t.atimeMs!==e.atimeMs||t.birthtimeMs!==e.birthtimeMs||t.blksize!==e.blksize||t.blocks!==e.blocks||t.ctimeMs!==e.ctimeMs||t.dev!==e.dev||t.gid!==e.gid||t.ino!==e.ino||t.isBlockDevice()!==e.isBlockDevice()||t.isCharacterDevice()!==e.isCharacterDevice()||t.isDirectory()!==e.isDirectory()||t.isFIFO()!==e.isFIFO()||t.isFile()!==e.isFile()||t.isSocket()!==e.isSocket()||t.isSymbolicLink()!==e.isSymbolicLink()||t.mode!==e.mode||t.mtimeMs!==e.mtimeMs||t.nlink!==e.nlink||t.rdev!==e.rdev||t.size!==e.size||t.uid!==e.uid)return!1;let r=t,s=e;return!(r.atimeNs!==s.atimeNs||r.mtimeNs!==s.mtimeNs||r.ctimeNs!==s.ctimeNs||r.birthtimeNs!==s.birthtimeNs)}var x_,k_,P_,nE,iE,T_=It(()=>{x_=et(ye("util")),k_=33188,P_=class{constructor(){this.name="";this.path="";this.mode=0}isBlockDevice(){return!1}isCharacterDevice(){return!1}isDirectory(){return(this.mode&61440)===16384}isFIFO(){return!1}isFile(){return(this.mode&61440)===32768}isSocket(){return!1}isSymbolicLink(){return(this.mode&61440)===40960}},nE=class{constructor(){this.uid=0;this.gid=0;this.size=0;this.blksize=0;this.atimeMs=0;this.mtimeMs=0;this.ctimeMs=0;this.birthtimeMs=0;this.atime=new Date(0);this.mtime=new Date(0);this.ctime=new Date(0);this.birtht
2025-04-10 09:51:25 -04:00
`).length,s=e.length-r;return r>s?`\r
`:`
`}function Id(t,e){return e.replace(/\r?\n/g,U7e(t))}var _$,U$,Ep,Uf,Cd=It(()=>{_$=ye("crypto"),U$=ye("os");N_();tl();Ep=class{constructor(e){this.pathUtils=e}async*genTraversePromise(e,{stableSort:r=!1}={}){let s=[e];for(;s.length>0;){let a=s.shift();if((await this.lstatPromise(a)).isDirectory()){let c=await this.readdirPromise(a);if(r)for(let f of c.sort())s.push(this.pathUtils.join(a,f));else throw new Error("Not supported")}else yield a}}async checksumFilePromise(e,{algorithm:r="sha512"}={}){let s=await this.openPromise(e,"r");try{let n=Buffer.allocUnsafeSlow(65536),c=(0,_$.createHash)(r),f=0;for(;(f=await this.readPromise(s,n,0,65536))!==0;)c.update(f===65536?n:n.slice(0,f));return c.digest("hex")}finally{await this.closePromise(s)}}async removePromise(e,{recursive:r=!0,maxRetries:s=5}={}){let a;try{a=await this.lstatPromise(e)}catch(n){if(n.code==="ENOENT")return;throw n}if(a.isDirectory()){if(r){let n=await this.readdirPromise(e);await Promise.all(n.map(c=>this.removePromise(this.pathUtils.resolve(e,c))))}for(let n=0;n<=s;n++)try{await this.rmdirPromise(e);break}catch(c){if(c.code!=="EBUSY"&&c.code!=="ENOTEMPTY")throw c;n<s&&await new Promise(f=>setTimeout(f,n*100))}}else await this.unlinkPromise(e)}removeSync(e,{recursive:r=!0}={}){let s;try{s=this.lstatSync(e)}catch(a){if(a.code==="ENOENT")return;throw a}if(s.isDirectory()){if(r)for(let a of this.readdirSync(e))this.removeSync(this.pathUtils.resolve(e,a));this.rmdirSync(e)}else this.unlinkSync(e)}async mkdirpPromise(e,{chmod:r,utimes:s}={}){if(e=this.resolve(e),e===this.pathUtils.dirname(e))return;let a=e.split(this.pathUtils.sep),n;for(let c=2;c<=a.length;++c){let f=a.slice(0,c).join(this.pathUtils.sep);if(!this.existsSync(f)){try{await this.mkdirPromise(f)}catch(p){if(p.code==="EEXIST")continue;throw p}if(n??=f,r!=null&&await this.chmodPromise(f,r),s!=null)await this.utimesPromise(f,s[0],s[1]);else{let p=await this.statPromise(this.pathUtils.dirname(f));await this.utimesPromise(f,p.atime,p.mtime)}}}return n}mkdirpSync(e,{chmod:r,utimes:s}={}){if(e=this.resolve(e),e===this.pathUtils.dirname(e))return;let a=e.split(this.pathUtils.sep),n;for(let c=2;c<=a.length;++c){let f=a.slice(0,c).join(this.pathUtils.sep);if(!this.existsSync(f)){try{this.mkdirSync(f)}catch(p){if(p.code==="EEXIST")continue;throw p}if(n??=f,r!=null&&this.chmodSync(f,r),s!=null)this.utimesSync(f,s[0],s[1]);else{let p=this.statSync(this.pathUtils.dirname(f));this.utimesSync(f,p.atime,p.mtime)}}}return n}async copyPromise(e,r,{baseFs:s=this,overwrite:a=!0,stableSort:n=!1,stableTime:c=!1,linkStrategy:f=null}={}){return await R$(this,e,s,r,{overwrite:a,stableSort:n,stableTime:c,linkStrategy:f})}copySync(e,r,{baseFs:s=this,overwrite:a=!0}={}){let n=s.lstatSync(r),c=this.existsSync(e);if(n.isDirectory()){this.mkdirpSync(e);let p=s.readdirSync(r);for(let h of p)this.copySync(this.pathUtils.join(e,h),s.pathUtils.join(r,h),{baseFs:s,overwrite:a})}else if(n.isFile()){if(!c||a){c&&this.removeSync(e);let p=s.readFileSync(r);this.writeFileSync(e,p)}}else if(n.isSymbolicLink()){if(!c||a){c&&this.removeSync(e);let p=s.readlinkSync(r);this.symlinkSync(Ax(this.pathUtils,p),e)}}else throw new Error(`Unsupported file type (file: ${r}, mode: 0o${n.mode.toString(8).padStart(6,"0")})`);let f=n.mode&511;this.chmodSync(e,f)}async changeFilePromise(e,r,s={}){return Buffer.isBuffer(r)?this.changeFileBufferPromise(e,r,s):this.changeFileTextPromise(e,r,s)}async changeFileBufferPromise(e,r,{mode:s}={}){let a=Buffer.alloc(0);try{a=await this.readFilePromise(e)}catch{}Buffer.compare(a,r)!==0&&await this.writeFilePromise(e,r,{mode:s})}async changeFileTextPromise(e,r,{automaticNewlines:s,mode:a}={}){let n="";try{n=await this.readFilePromise(e,"utf8")}catch{}let c=s?Id(n,r):r;n!==c&&await this.writeFilePromise(e,c,{mode:a})}changeFileSync(e,r,s={}){return Buffer.isBuffer(r)?this.changeFileBufferSync(e,r,s):this.changeFileTextSync(e,r,s)}changeFileBufferSync(e,r,{mode:s}={}){let a=Buffer.alloc(0);try{a=this.readFileSync(e)}catch{}Buffer.compare(a,r)!==0&&this.writeFileSync(e,r,{mode:s})}changeFileTextSync(e,r,{automaticNewlines:
`)}writeJsonSync(e,r,{compact:s=!1}={}){let a=s?0:2;return this.writeFileSync(e,`${JSON.stringify(r,null,a)}
2025-04-11 10:05:45 -04:00
`)}async preserveTimePromise(e,r){let s=await this.lstatPromise(e),a=await r();typeof a<"u"&&(e=a),await this.lutimesPromise(e,s.atime,s.mtime)}async preserveTimeSync(e,r){let s=this.lstatSync(e),a=r();typeof a<"u"&&(e=a),this.lutimesSync(e,s.atime,s.mtime)}},Uf=class extends Ep{constructor(){super(K)}}});var Hs,Ip=It(()=>{Cd();Hs=class extends Ep{getExtractHint(e){return this.baseFs.getExtractHint(e)}resolve(e){return this.mapFromBase(this.baseFs.resolve(this.mapToBase(e)))}getRealPath(){return this.mapFromBase(this.baseFs.getRealPath())}async openPromise(e,r,s){return this.baseFs.openPromise(this.mapToBase(e),r,s)}openSync(e,r,s){return this.baseFs.openSync(this.mapToBase(e),r,s)}async opendirPromise(e,r){return Object.assign(await this.baseFs.opendirPromise(this.mapToBase(e),r),{path:e})}opendirSync(e,r){return Object.assign(this.baseFs.opendirSync(this.mapToBase(e),r),{path:e})}async readPromise(e,r,s,a,n){return await this.baseFs.readPromise(e,r,s,a,n)}readSync(e,r,s,a,n){return this.baseFs.readSync(e,r,s,a,n)}async writePromise(e,r,s,a,n){return typeof r=="string"?await this.baseFs.writePromise(e,r,s):await this.baseFs.writePromise(e,r,s,a,n)}writeSync(e,r,s,a,n){return typeof r=="string"?this.baseFs.writeSync(e,r,s):this.baseFs.writeSync(e,r,s,a,n)}async closePromise(e){return this.baseFs.closePromise(e)}closeSync(e){this.baseFs.closeSync(e)}createReadStream(e,r){return this.baseFs.createReadStream(e!==null?this.mapToBase(e):e,r)}createWriteStream(e,r){return this.baseFs.createWriteStream(e!==null?this.mapToBase(e):e,r)}async realpathPromise(e){return this.mapFromBase(await this.baseFs.realpathPromise(this.mapToBase(e)))}realpathSync(e){return this.mapFromBase(this.baseFs.realpathSync(this.mapToBase(e)))}async existsPromise(e){return this.baseFs.existsPromise(this.mapToBase(e))}existsSync(e){return this.baseFs.existsSync(this.mapToBase(e))}accessSync(e,r){return this.baseFs.accessSync(this.mapToBase(e),r)}async accessPromise(e,r){return this.baseFs.accessPromise(this.mapToBase(e),r)}async statPromise(e,r){return this.baseFs.statPromise(this.mapToBase(e),r)}statSync(e,r){return this.baseFs.statSync(this.mapToBase(e),r)}async fstatPromise(e,r){return this.baseFs.fstatPromise(e,r)}fstatSync(e,r){return this.baseFs.fstatSync(e,r)}lstatPromise(e,r){return this.baseFs.lstatPromise(this.mapToBase(e),r)}lstatSync(e,r){return this.baseFs.lstatSync(this.mapToBase(e),r)}async fchmodPromise(e,r){return this.baseFs.fchmodPromise(e,r)}fchmodSync(e,r){return this.baseFs.fchmodSync(e,r)}async chmodPromise(e,r){return this.baseFs.chmodPromise(this.mapToBase(e),r)}chmodSync(e,r){return this.baseFs.chmodSync(this.mapToBase(e),r)}async fchownPromise(e,r,s){return this.baseFs.fchownPromise(e,r,s)}fchownSync(e,r,s){return this.baseFs.fchownSync(e,r,s)}async chownPromise(e,r,s){return this.baseFs.chownPromise(this.mapToBase(e),r,s)}chownSync(e,r,s){return this.baseFs.chownSync(this.mapToBase(e),r,s)}async renamePromise(e,r){return this.baseFs.renamePromise(this.mapToBase(e),this.mapToBase(r))}renameSync(e,r){return this.baseFs.renameSync(this.mapToBase(e),this.mapToBase(r))}async copyFilePromise(e,r,s=0){return this.baseFs.copyFilePromise(this.mapToBase(e),this.mapToBase(r),s)}copyFileSync(e,r,s=0){return this.baseFs.copyFileSync(this.mapToBase(e),this.mapToBase(r),s)}async appendFilePromise(e,r,s){return this.baseFs.appendFilePromise(this.fsMapToBase(e),r,s)}appendFileSync(e,r,s){return this.baseFs.appendFileSync(this.fsMapToBase(e),r,s)}async writeFilePromise(e,r,s){return this.baseFs.writeFilePromise(this.fsMapToBase(e),r,s)}writeFileSync(e,r,s){return this.baseFs.writeFileSync(this.fsMapToBase(e),r,s)}async unlinkPromise(e){return this.baseFs.unlinkPromise(this.mapToBase(e))}unlinkSync(e){return this.baseFs.unlinkSync(this.mapToBase(e))}async utimesPromise(e,r,s){return this.baseFs.utimesPromise(this.mapToBase(e),r,s)}utimesSync(e,r,s){return this.baseFs.utimesSync(this.mapToBase(e),r,s)}async lutimesPromise(e,r,s){return this.baseFs.lutimesPromise(this.mapToBase(e),r,s)}lutimesSync(e,r,s){return this.baseFs.lutimesSync(this.mapToB
2025-04-10 09:51:25 -04:00
`,FA=ur(`\\
`,!1),NA=function(){return""},aa="\\",la=ur("\\",!1),OA=/^[\\$"`]/,gr=zi(["\\","$",'"',"`"],!1,!1),So=function(O){return O},Me="\\a",fu=ur("\\a",!1),Cr=function(){return"a"},hf="\\b",LA=ur("\\b",!1),MA=function(){return"\b"},Au=/^[Ee]/,pu=zi(["E","e"],!1,!1),ac=function(){return"\x1B"},ve="\\f",Nt=ur("\\f",!1),lc=function(){return"\f"},Ni="\\n",io=ur("\\n",!1),Rt=function(){return`
2025-04-11 10:05:45 -04:00
`},xn="\\r",ca=ur("\\r",!1),ji=function(){return"\r"},Oi="\\t",Oa=ur("\\t",!1),dn=function(){return" "},Jn="\\v",hu=ur("\\v",!1),Ch=function(){return"\v"},La=/^[\\'"?]/,Ma=zi(["\\","'",'"',"?"],!1,!1),Ua=function(O){return String.fromCharCode(parseInt(O,16))},Xe="\\x",Ha=ur("\\x",!1),gf="\\u",cc=ur("\\u",!1),wn="\\U",ua=ur("\\U",!1),_A=function(O){return String.fromCodePoint(parseInt(O,16))},UA=/^[0-7]/,fa=zi([["0","7"]],!1,!1),vl=/^[0-9a-fA-f]/,Mt=zi([["0","9"],["a","f"],["A","f"]],!1,!1),kn=Ef(),Aa="{}",ja=ur("{}",!1),ns=function(){return"{}"},uc="-",gu=ur("-",!1),fc="+",qa=ur("+",!1),Li=".",Cs=ur(".",!1),Sl=function(O,J,re){return{type:"number",value:(O==="-"?-1:1)*parseFloat(J.join("")+"."+re.join(""))}},df=function(O,J){return{type:"number",value:(O==="-"?-1:1)*parseInt(J.join(""))}},Ac=function(O){return{type:"variable",...O}},wi=function(O){return{type:"variable",name:O}},Qn=function(O){return O},pc="*",Je=ur("*",!1),st="/",St=ur("/",!1),lr=function(O,J,re){return{type:J==="*"?"multiplication":"division",right:re}},ee=function(O,J){return J.reduce((re,de)=>({left:re,...de}),O)},Ie=function(O,J,re){return{type:J==="+"?"addition":"subtraction",right:re}},Oe="$((",ht=ur("$((",!1),mt="))",Dt=ur("))",!1),tr=function(O){return O},fn="$(",ai=ur("$(",!1),qi=function(O){return O},Tn="${",Ga=ur("${",!1),my=":-",t2=ur(":-",!1),Do=function(O,J){return{name:O,defaultValue:J}},yy=":-}",wh=ur(":-}",!1),r2=function(O){return{name:O,defaultValue:[]}},bo=":+",Bh=ur(":+",!1),vh=function(O,J){return{name:O,alternativeValue:J}},du=":+}",Sh=ur(":+}",!1),Ng=function(O){return{name:O,alternativeValue:[]}},Og=function(O){return{name:O}},Lg="$",Ey=ur("$",!1),mf=function(O){return e.isGlobPattern(O)},Po=function(O){return O},Dl=/^[a-zA-Z0-9_]/,Dh=zi([["a","z"],["A","Z"],["0","9"],"_"],!1,!1),Mg=function(){return By()},bl=/^[$@*?#a-zA-Z0-9_\-]/,Pl=zi(["$","@","*","?","#",["a","z"],["A","Z"],["0","9"],"_","-"],!1,!1),Iy=/^[()}<>$|&; \t"']/,HA=zi(["(",")","}","<",">","$","|","&",";"," "," ",'"',"'"],!1,!1),Cy=/^[<>&; \t"']/,wy=zi(["<",">","&",";"," "," ",'"',"'"],!1,!1),jA=/^[ \t]/,qA=zi([" "," "],!1,!1),Y=0,xt=0,GA=[{line:1,column:1}],xo=0,yf=[],dt=0,mu;if("startRule"in e){if(!(e.startRule in s))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');a=s[e.startRule]}function By(){return t.substring(xt,Y)}function _g(){return If(xt,Y)}function n2(O,J){throw J=J!==void 0?J:If(xt,Y),WA([Ug(O)],t.substring(xt,Y),J)}function bh(O,J){throw J=J!==void 0?J:If(xt,Y),gi(O,J)}function ur(O,J){return{type:"literal",text:O,ignoreCase:J}}function zi(O,J,re){return{type:"class",parts:O,inverted:J,ignoreCase:re}}function Ef(){return{type:"any"}}function Wa(){return{type:"end"}}function Ug(O){return{type:"other",description:O}}function yu(O){var J=GA[O],re;if(J)return J;for(re=O-1;!GA[re];)re--;for(J=GA[re],J={line:J.line,column:J.column};re<O;)t.charCodeAt(re)===10?(J.line++,J.column=1):J.column++,re++;return GA[O]=J,J}function If(O,J){var re=yu(O),de=yu(J);return{start:{offset:O,line:re.line,column:re.column},end:{offset:J,line:de.line,column:de.column}}}function wt(O){Y<xo||(Y>xo&&(xo=Y,yf=[]),yf.push(O))}function gi(O,J){return new vd(O,null,null,J)}function WA(O,J,re){return new vd(vd.buildMessage(O,J),O,J,re)}function Ya(){var O,J,re;for(O=Y,J=[],re=kt();re!==r;)J.push(re),re=kt();return J!==r?(re=pa(),re===r&&(re=null),re!==r?(xt=O,J=n(re),O=J):(Y=O,O=r)):(Y=O,O=r),O}function pa(){var O,J,re,de,Ke;if(O=Y,J=Ph(),J!==r){for(re=[],de=kt();de!==r;)re.push(de),de=kt();re!==r?(de=Hg(),de!==r?(Ke=Va(),Ke===r&&(Ke=null),Ke!==r?(xt=O,J=c(J,de,Ke),O=J):(Y=O,O=r)):(Y=O,O=r)):(Y=O,O=r)}else Y=O,O=r;if(O===r)if(O=Y,J=Ph(),J!==r){for(re=[],de=kt();de!==r;)re.push(de),de=kt();re!==r?(de=Hg(),de===r&&(de=null),de!==r?(xt=O,J=f(J,de),O=J):(Y=O,O=r)):(Y=O,O=r)}else Y=O,O=r;return O}function Va(){var O,J,re,de,Ke;for(O=Y,J=[],re=kt();re!==r;)J.push(re),re=kt();if(J!==r)if(re=pa(),re!==r){for(de=[],Ke=kt();Ke!==r;)de.push(Ke),Ke=kt();de!==r?(xt=O,J=p(re),O=J):(Y=O,O=r)}else Y=O,O=r;else Y=O,O=r;return O}function Hg(){var O;return t.charCodeAt(Y)===59?(O=h,Y+
`,"\\n"],["\r","\\r"],[" ","\\t"],["\v","\\v"],["\0","\\0"]]),EKe=new Map([["\\","\\\\"],["$","\\$"],['"','\\"'],...Array.from(nte,([t,e])=>[t,`"$'${e}'"`])]),ite=t=>nte.get(t)??`\\x${t.charCodeAt(0).toString(16).padStart(2,"0")}`,IKe=t=>EKe.get(t)??`"$'${ite(t)}'"`});var ate=L((U5t,ote)=>{"use strict";function CKe(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}function Dd(t,e,r,s){this.message=t,this.expected=e,this.found=r,this.location=s,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Dd)}CKe(Dd,Error);Dd.buildMessage=function(t,e){var r={literal:function(h){return'"'+a(h.text)+'"'},class:function(h){var E="",C;for(C=0;C<h.parts.length;C++)E+=h.parts[C]instanceof Array?n(h.parts[C][0])+"-"+n(h.parts[C][1]):n(h.parts[C]);return"["+(h.inverted?"^":"")+E+"]"},any:function(h){return"any character"},end:function(h){return"end of input"},other:function(h){return h.description}};function s(h){return h.charCodeAt(0).toString(16).toUpperCase()}function a(h){return h.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(E){return"\\x0"+s(E)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(E){return"\\x"+s(E)})}function n(h){return h.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(E){return"\\x0"+s(E)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(E){return"\\x"+s(E)})}function c(h){return r[h.type](h)}function f(h){var E=new Array(h.length),C,S;for(C=0;C<h.length;C++)E[C]=c(h[C]);if(E.sort(),E.length>0){for(C=1,S=1;C<E.length;C++)E[C-1]!==E[C]&&(E[S]=E[C],S++);E.length=S}switch(E.length){case 1:return E[0];case 2:return E[0]+" or "+E[1];default:return E.slice(0,-1).join(", ")+", or "+E[E.length-1]}}function p(h){return h?'"'+a(h)+'"':"end of input"}return"Expected "+f(t)+" but "+p(e)+" found."};function wKe(t,e){e=e!==void 0?e:{};var r={},s={resolution:Ne},a=Ne,n="/",c=Ee("/",!1),f=function(_e,x){return{from:_e,descriptor:x}},p=function(_e){return{descriptor:_e}},h="@",E=Ee("@",!1),C=function(_e,x){return{fullName:_e,description:x}},S=function(_e){return{fullName:_e}},P=function(){return Be()},I=/^[^\/@]/,R=fe(["/","@"],!0,!1),N=/^[^\/]/,U=fe(["/"],!0,!1),W=0,te=0,ie=[{line:1,column:1}],Ae=0,ce=[],me=0,pe;if("startRule"in e){if(!(e.startRule in s))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');a=s[e.startRule]}function Be(){return t.substring(te,W)}function Ce(){return gt(te,W)}function g(_e,x){throw x=x!==void 0?x:gt(te,W),Fe([De(_e)],t.substring(te,W),x)}function we(_e,x){throw x=x!==void 0?x:gt(te,W),rt(_e,x)}function Ee(_e,x){return{type:"literal",text:_e,ignoreCase:x}}function fe(_e,x,w){return{type:"class",parts:_e,inverted:x,ignoreCase:w}}function se(){return{type:"any"}}function X(){return{type:"end"}}function De(_e){return{type:"other",description:_e}}function Re(_e){var x=ie[_e],w;if(x)return x;for(w=_e-1;!ie[w];)w--;for(x=ie[w],x={line:x.line,column:x.column};w<_e;)t.charCodeAt(w)===10?(x.line++,x.column=1):x.column++,w++;return ie[_e]=x,x}function gt(_e,x){var w=Re(_e),b=Re(x);return{start:{offset:_e,line:w.line,column:w.column},end:{offset:x,line:b.line,column:b.column}}}function j(_e){W<Ae||(W>Ae&&(Ae=W,ce=[]),ce.push(_e))}function rt(_e,x){return new Dd(_e,null,null,x)}function Fe(_e,x,w){return new Dd(Dd.buildMessage(_e,x),_e,x,w)}function Ne(){var _e,x,w,b;return _e=W,x=Pe(),x!==r?(t.charCodeAt(W)===47?(w=n,W++):(w=r,me===0&&j(c)),w!==r?(b=Pe(),b!==r?(te=_e,x=f(x,b),_e=x):(W=_e,_e=r)):(W=_e,_e=r)):(W=_e,_e=r),_e===r&&(_e=W,x=Pe(),x!==r&&(te=_e,x=p(x)),_e=x),_e}function Pe(){var _e,x,w,b;return _e=W,x=Ye(),x!==r?(t.charCodeAt(W)===64?(w=h,W++):(w=r,me===0&&j(E)),w!==r?(b=it(),b!==r?(te=_e,x=C(x,b),_e=x):(W=_e,_e=r)):(W=_e,_e=r)):(W=_e,_e=r),_e===r&&(_e=W,x=Ye(),x!==r&&(te=_e,x=S(x)),_e=x),_e}function Ye(){var _e,x,w,b,y;return _e=W,t.charCodeAt(W)===64?(x=h,W++):(x=r,me
2025-04-10 09:51:25 -04:00
\x85\u2028\u2029`.indexOf(this.buffer.charAt(a-1))===-1;)if(a-=1,this.position-a>r/2-1){s=" ... ",a+=5;break}for(n="",c=this.position;c<this.buffer.length&&`\0\r
\x85\u2028\u2029`.indexOf(this.buffer.charAt(c))===-1;)if(c+=1,c-this.position>r/2-1){n=" ... ",c-=5;break}return f=this.buffer.slice(a,c),Ate.repeat(" ",e)+s+f+n+`
`+Ate.repeat(" ",e+this.position-a+s.length)+"^"};tU.prototype.toString=function(e){var r,s="";return this.name&&(s+='in "'+this.name+'" '),s+="at line "+(this.line+1)+", column "+(this.column+1),e||(r=this.getSnippet(),r&&(s+=`:
2025-04-11 10:05:45 -04:00
`+r)),s};pte.exports=tU});var Ds=L((W5t,dte)=>{"use strict";var gte=pE(),PKe=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],xKe=["scalar","sequence","mapping"];function kKe(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(s){e[String(s)]=r})}),e}function QKe(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(PKe.indexOf(r)===-1)throw new gte('Unknown option "'+r+'" is met in definition of "'+t+'" YAML type.')}),this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(r){return r},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.defaultStyle=e.defaultStyle||null,this.styleAliases=kKe(e.styleAliases||null),xKe.indexOf(this.kind)===-1)throw new gte('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}dte.exports=QKe});var xd=L((Y5t,yte)=>{"use strict";var mte=Pd(),xx=pE(),TKe=Ds();function rU(t,e,r){var s=[];return t.include.forEach(function(a){r=rU(a,e,r)}),t[e].forEach(function(a){r.forEach(function(n,c){n.tag===a.tag&&n.kind===a.kind&&s.push(c)}),r.push(a)}),r.filter(function(a,n){return s.indexOf(n)===-1})}function RKe(){var t={scalar:{},sequence:{},mapping:{},fallback:{}},e,r;function s(a){t[a.kind][a.tag]=t.fallback[a.tag]=a}for(e=0,r=arguments.length;e<r;e+=1)arguments[e].forEach(s);return t}function hE(t){this.include=t.include||[],this.implicit=t.implicit||[],this.explicit=t.explicit||[],this.implicit.forEach(function(e){if(e.loadKind&&e.loadKind!=="scalar")throw new xx("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=rU(this,"implicit",[]),this.compiledExplicit=rU(this,"explicit",[]),this.compiledTypeMap=RKe(this.compiledImplicit,this.compiledExplicit)}hE.DEFAULT=null;hE.create=function(){var e,r;switch(arguments.length){case 1:e=hE.DEFAULT,r=arguments[0];break;case 2:e=arguments[0],r=arguments[1];break;default:throw new xx("Wrong number of arguments for Schema.create function")}if(e=mte.toArray(e),r=mte.toArray(r),!e.every(function(s){return s instanceof hE}))throw new xx("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!r.every(function(s){return s instanceof TKe}))throw new xx("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new hE({include:e,explicit:r})};yte.exports=hE});var Ite=L((V5t,Ete)=>{"use strict";var FKe=Ds();Ete.exports=new FKe("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}})});var wte=L((K5t,Cte)=>{"use strict";var NKe=Ds();Cte.exports=new NKe("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}})});var vte=L((J5t,Bte)=>{"use strict";var OKe=Ds();Bte.exports=new OKe("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}})});var kx=L((z5t,Ste)=>{"use strict";var LKe=xd();Ste.exports=new LKe({explicit:[Ite(),wte(),vte()]})});var bte=L((Z5t,Dte)=>{"use strict";var MKe=Ds();function _Ke(t){if(t===null)return!0;var e=t.length;return e===1&&t==="~"||e===4&&(t==="null"||t==="Null"||t==="NULL")}function UKe(){return null}function HKe(t){return t===null}Dte.exports=new MKe("tag:yaml.org,2002:null",{kind:"scalar",resolve:_Ke,construct:UKe,predicate:HKe,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"})});var xte=L((X5t,Pte)=>{"use strict";var jKe=Ds();function qKe(t){if(t===null)return!1;var e=t.length;return e===4&&(t==="true"||t==="True"||t==="TRUE")||e===5&&(t==="false"||t==="False"||t==="FALSE")}function GKe(t){return t==="true"||t==="True"||t==="TRUE"}function WKe(t){return Object.prototype.toString.call(t)==="[object Boolean]"}Pte.exports=new jKe("tag:yaml.org,2002:bool",{kind:"scalar",resolve:qKe,construct:GKe,predicate:WKe,represent:{lowercase:function(t){return t?"true":"false"},upperc
\r`;function dJe(t){if(t===null)return!1;var e,r,s=0,a=t.length,n=sU;for(r=0;r<a;r++)if(e=n.indexOf(t.charAt(r)),!(e>64)){if(e<0)return!1;s+=6}return s%8===0}function mJe(t){var e,r,s=t.replace(/[\r\n=]/g,""),a=s.length,n=sU,c=0,f=[];for(e=0;e<a;e++)e%4===0&&e&&(f.push(c>>16&255),f.push(c>>8&255),f.push(c&255)),c=c<<6|n.indexOf(s.charAt(e));return r=a%4*6,r===0?(f.push(c>>16&255),f.push(c>>8&255),f.push(c&255)):r===18?(f.push(c>>10&255),f.push(c>>2&255)):r===12&&f.push(c>>4&255),kd?kd.from?kd.from(f):new kd(f):f}function yJe(t){var e="",r=0,s,a,n=t.length,c=sU;for(s=0;s<n;s++)s%3===0&&s&&(e+=c[r>>18&63],e+=c[r>>12&63],e+=c[r>>6&63],e+=c[r&63]),r=(r<<8)+t[s];return a=n%3,a===0?(e+=c[r>>18&63],e+=c[r>>12&63],e+=c[r>>6&63],e+=c[r&63]):a===2?(e+=c[r>>10&63],e+=c[r>>4&63],e+=c[r<<2&63],e+=c[64]):a===1&&(e+=c[r>>2&63],e+=c[r<<4&63],e+=c[64],e+=c[64]),e}function EJe(t){return kd&&kd.isBuffer(t)}Gte.exports=new gJe("tag:yaml.org,2002:binary",{kind:"scalar",resolve:dJe,construct:mJe,predicate:EJe,represent:yJe})});var Vte=L((a9t,Yte)=>{"use strict";var IJe=Ds(),CJe=Object.prototype.hasOwnProperty,wJe=Object.prototype.toString;function BJe(t){if(t===null)return!0;var e=[],r,s,a,n,c,f=t;for(r=0,s=f.length;r<s;r+=1){if(a=f[r],c=!1,wJe.call(a)!=="[object Object]")return!1;for(n in a)if(CJe.call(a,n))if(!c)c=!0;else return!1;if(!c)return!1;if(e.indexOf(n)===-1)e.push(n);else return!1}return!0}function vJe(t){return t!==null?t:[]}Yte.exports=new IJe("tag:yaml.org,2002:omap",{kind:"sequence",resolve:BJe,construct:vJe})});var Jte=L((l9t,Kte)=>{"use strict";var SJe=Ds(),DJe=Object.prototype.toString;function bJe(t){if(t===null)return!0;var e,r,s,a,n,c=t;for(n=new Array(c.length),e=0,r=c.length;e<r;e+=1){if(s=c[e],DJe.call(s)!=="[object Object]"||(a=Object.keys(s),a.length!==1))return!1;n[e]=[a[0],s[a[0]]]}return!0}function PJe(t){if(t===null)return[];var e,r,s,a,n,c=t;for(n=new Array(c.length),e=0,r=c.length;e<r;e+=1)s=c[e],a=Object.keys(s),n[e]=[a[0],s[a[0]]];return n}Kte.exports=new SJe("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:bJe,construct:PJe})});var Zte=L((c9t,zte)=>{"use strict";var xJe=Ds(),kJe=Object.prototype.hasOwnProperty;function QJe(t){if(t===null)return!0;var e,r=t;for(e in r)if(kJe.call(r,e)&&r[e]!==null)return!1;return!0}function TJe(t){return t!==null?t:{}}zte.exports=new xJe("tag:yaml.org,2002:set",{kind:"mapping",resolve:QJe,construct:TJe})});var gE=L((u9t,Xte)=>{"use strict";var RJe=xd();Xte.exports=new RJe({include:[iU()],implicit:[Ute(),jte()],explicit:[Wte(),Vte(),Jte(),Zte()]})});var ere=L((f9t,$te)=>{"use strict";var FJe=Ds();function NJe(){return!0}function OJe(){}function LJe(){return""}function MJe(t){return typeof t>"u"}$te.exports=new FJe("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:NJe,construct:OJe,predicate:MJe,represent:LJe})});var rre=L((A9t,tre)=>{"use strict";var _Je=Ds();function UJe(t){if(t===null||t.length===0)return!1;var e=t,r=/\/([gim]*)$/.exec(t),s="";return!(e[0]==="/"&&(r&&(s=r[1]),s.length>3||e[e.length-s.length-1]!=="/"))}function HJe(t){var e=t,r=/\/([gim]*)$/.exec(t),s="";return e[0]==="/"&&(r&&(s=r[1]),e=e.slice(1,e.length-s.length-1)),new RegExp(e,s)}function jJe(t){var e="/"+t.source+"/";return t.global&&(e+="g"),t.multiline&&(e+="m"),t.ignoreCase&&(e+="i"),e}function qJe(t){return Object.prototype.toString.call(t)==="[object RegExp]"}tre.exports=new _Je("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:UJe,construct:HJe,predicate:qJe,represent:jJe})});var sre=L((p9t,ire)=>{"use strict";var Qx;try{nre=ye,Qx=nre("esprima")}catch{typeof window<"u"&&(Qx=window.esprima)}var nre,GJe=Ds();function WJe(t){if(t===null)return!1;try{var e="("+t+")",r=Qx.parse(e,{range:!0});return!(r.type!=="Program"||r.body.length!==1||r.body[0].type!=="ExpressionStatement"||r.body[0].expression.type!=="ArrowFunctionExpression"&&r.body[0].expression.type!=="FunctionExpression")}catch{return!1}}function YJe(t){var e="("+t+")",r=Qx.parse(e,{range:!0}),s=[],a;if(r.type!=="Program"||r.body.length!==1||r.body[0].type!=="ExpressionStatement"||r.body[0].expression.type!=="ArrowFunctionExpression
`:t===118?"\v":t===102?"\f":t===114?"\r":t===101?"\x1B":t===32?" ":t===34?'"':t===47?"/":t===92?"\\":t===78?"\x85":t===95?"\xA0":t===76?"\u2028":t===80?"\u2029":""}function ize(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}var Ire=new Array(256),Cre=new Array(256);for(Qd=0;Qd<256;Qd++)Ire[Qd]=ure(Qd)?1:0,Cre[Qd]=ure(Qd);var Qd;function sze(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||zJe,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function wre(t,e){return new hre(e,new JJe(t.filename,t.input,t.position,t.line,t.position-t.lineStart))}function Rr(t,e){throw wre(t,e)}function Fx(t,e){t.onWarning&&t.onWarning.call(null,wre(t,e))}var fre={YAML:function(e,r,s){var a,n,c;e.version!==null&&Rr(e,"duplication of %YAML directive"),s.length!==1&&Rr(e,"YAML directive accepts exactly one argument"),a=/^([0-9]+)\.([0-9]+)$/.exec(s[0]),a===null&&Rr(e,"ill-formed argument of the YAML directive"),n=parseInt(a[1],10),c=parseInt(a[2],10),n!==1&&Rr(e,"unacceptable YAML version of the document"),e.version=s[0],e.checkLineBreaks=c<2,c!==1&&c!==2&&Fx(e,"unsupported YAML version of the document")},TAG:function(e,r,s){var a,n;s.length!==2&&Rr(e,"TAG directive accepts exactly two arguments"),a=s[0],n=s[1],yre.test(a)||Rr(e,"ill-formed tag handle (first argument) of the TAG directive"),a0.call(e.tagMap,a)&&Rr(e,'there is a previously declared suffix for "'+a+'" tag handle'),Ere.test(n)||Rr(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[a]=n}};function o0(t,e,r,s){var a,n,c,f;if(e<r){if(f=t.input.slice(e,r),s)for(a=0,n=f.length;a<n;a+=1)c=f.charCodeAt(a),c===9||32<=c&&c<=1114111||Rr(t,"expected valid JSON character");else XJe.test(f)&&Rr(t,"the stream contains non-printable characters");t.result+=f}}function Are(t,e,r,s){var a,n,c,f;for(wp.isObject(r)||Rr(t,"cannot merge mappings; the provided source object is unacceptable"),a=Object.keys(r),c=0,f=a.length;c<f;c+=1)n=a[c],a0.call(e,n)||(e[n]=r[n],s[n]=!0)}function mE(t,e,r,s,a,n,c,f){var p,h;if(Array.isArray(a))for(a=Array.prototype.slice.call(a),p=0,h=a.length;p<h;p+=1)Array.isArray(a[p])&&Rr(t,"nested arrays are not supported inside keys"),typeof a=="object"&&cre(a[p])==="[object Object]"&&(a[p]="[object Object]");if(typeof a=="object"&&cre(a)==="[object Object]"&&(a="[object Object]"),a=String(a),e===null&&(e={}),s==="tag:yaml.org,2002:merge")if(Array.isArray(n))for(p=0,h=n.length;p<h;p+=1)Are(t,e,n[p],r);else Are(t,e,n,r);else!t.json&&!a0.call(r,a)&&a0.call(e,a)&&(t.line=c||t.line,t.position=f||t.position,Rr(t,"duplicated mapping key")),e[a]=n,delete r[a];return e}function aU(t){var e;e=t.input.charCodeAt(t.position),e===10?t.position++:e===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):Rr(t,"a line break is expected"),t.line+=1,t.lineStart=t.position}function as(t,e,r){for(var s=0,a=t.input.charCodeAt(t.position);a!==0;){for(;Td(a);)a=t.input.charCodeAt(++t.position);if(e&&a===35)do a=t.input.charCodeAt(++t.position);while(a!==10&&a!==13&&a!==0);if(qf(a))for(aU(t),a=t.input.charCodeAt(t.position),s++,t.lineIndent=0;a===32;)t.lineIndent++,a=t.input.charCodeAt(++t.position);else break}return r!==-1&&s!==0&&t.lineIndent<r&&Fx(t,"deficient indentation"),s}function Nx(t){var e=t.position,r;return r=t.input.charCodeAt(e),!!((r===45||r===46)&&r===t.input.charCodeAt(e+1)&&r===t.input.charCodeAt(e+2)&&(e+=3,r=t.input.charCodeAt(e),r===0||nl(r)))}function lU(t,e){e===1?t.result+=" ":e>1&&(t.result+=wp.repeat(`
`,e-1))}function oze(t,e,r){var s,a,n,c,f,p,h,E,C=t.kind,S=t.result,P;if(P=t.input.charCodeAt(t.position),nl(P)||dE(P)||P===35||P===38||P===42||P===33||P===124||P===62||P===39||P===34||P===37||P===64||P===96||(P===63||P===45)&&(a=t.input.charCodeAt(t.position+1),nl(a)||r&&dE(a)))return!1;for(t.kind="scalar",t.result="",n=c=t.position,f=!1;P!==0;){if(P===58){if(a=t.input.charCodeAt(t.position+1),nl(a)||r&&dE(a))break}else if(P===35){if(s=t.input.charCodeAt(t.position-1),nl(s))break}else{if(t.position===t.lineStart&&Nx(t)||r&&dE(P))break;if(qf(P))if(p=t.line,h=t.lineStart,E=t.lineIndent,as(t,!1,-1),t.lineIndent>=e){f=!0,P=t.input.charCodeAt(t.position);continue}else{t.position=c,t.line=p,t.lineStart=h,t.lineIndent=E;break}}f&&(o0(t,n,c,!1),lU(t,t.line-p),n=c=t.position,f=!1),Td(P)||(c=t.position+1),P=t.input.charCodeAt(++t.position)}return o0(t,n,c,!1),t.result?!0:(t.kind=C,t.result=S,!1)}function aze(t,e){var r,s,a;if(r=t.input.charCodeAt(t.position),r!==39)return!1;for(t.kind="scalar",t.result="",t.position++,s=a=t.position;(r=t.input.charCodeAt(t.position))!==0;)if(r===39)if(o0(t,s,t.position,!0),r=t.input.charCodeAt(++t.position),r===39)s=t.position,t.position++,a=t.position;else return!0;else qf(r)?(o0(t,s,a,!0),lU(t,as(t,!1,e)),s=a=t.position):t.position===t.lineStart&&Nx(t)?Rr(t,"unexpected end of the document within a single quoted scalar"):(t.position++,a=t.position);Rr(t,"unexpected end of the stream within a single quoted scalar")}function lze(t,e){var r,s,a,n,c,f;if(f=t.input.charCodeAt(t.position),f!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=s=t.position;(f=t.input.charCodeAt(t.position))!==0;){if(f===34)return o0(t,r,t.position,!0),t.position++,!0;if(f===92){if(o0(t,r,t.position,!0),f=t.input.charCodeAt(++t.position),qf(f))as(t,!1,e);else if(f<256&&Ire[f])t.result+=Cre[f],t.position++;else if((c=rze(f))>0){for(a=c,n=0;a>0;a--)f=t.input.charCodeAt(++t.position),(c=tze(f))>=0?n=(n<<4)+c:Rr(t,"expected hexadecimal character");t.result+=ize(n),t.position++}else Rr(t,"unknown escape sequence");r=s=t.position}else qf(f)?(o0(t,r,s,!0),lU(t,as(t,!1,e)),r=s=t.position):t.position===t.lineStart&&Nx(t)?Rr(t,"unexpected end of the document within a double quoted scalar"):(t.position++,s=t.position)}Rr(t,"unexpected end of the stream within a double quoted scalar")}function cze(t,e){var r=!0,s,a=t.tag,n,c=t.anchor,f,p,h,E,C,S={},P,I,R,N;if(N=t.input.charCodeAt(t.position),N===91)p=93,C=!1,n=[];else if(N===123)p=125,C=!0,n={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=n),N=t.input.charCodeAt(++t.position);N!==0;){if(as(t,!0,e),N=t.input.charCodeAt(t.position),N===p)return t.position++,t.tag=a,t.anchor=c,t.kind=C?"mapping":"sequence",t.result=n,!0;r||Rr(t,"missed comma between flow collection entries"),I=P=R=null,h=E=!1,N===63&&(f=t.input.charCodeAt(t.position+1),nl(f)&&(h=E=!0,t.position++,as(t,!0,e))),s=t.line,yE(t,e,Tx,!1,!0),I=t.tag,P=t.result,as(t,!0,e),N=t.input.charCodeAt(t.position),(E||t.line===s)&&N===58&&(h=!0,N=t.input.charCodeAt(++t.position),as(t,!0,e),yE(t,e,Tx,!1,!0),R=t.result),C?mE(t,n,S,I,P,R):h?n.push(mE(t,null,S,I,P,R)):n.push(P),as(t,!0,e),N=t.input.charCodeAt(t.position),N===44?(r=!0,N=t.input.charCodeAt(++t.position)):r=!1}Rr(t,"unexpected end of the stream within a flow collection")}function uze(t,e){var r,s,a=oU,n=!1,c=!1,f=e,p=0,h=!1,E,C;if(C=t.input.charCodeAt(t.position),C===124)s=!1;else if(C===62)s=!0;else return!1;for(t.kind="scalar",t.result="";C!==0;)if(C=t.input.charCodeAt(++t.position),C===43||C===45)oU===a?a=C===43?lre:ZJe:Rr(t,"repeat of a chomping mode identifier");else if((E=nze(C))>=0)E===0?Rr(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?Rr(t,"repeat of an indentation width identifier"):(f=e+E-1,c=!0);else break;if(Td(C)){do C=t.input.charCodeAt(++t.position);while(Td(C));if(C===35)do C=t.input.charCodeAt(++t.position);while(!qf(C)&&C!==0)}for(;C!==0;){for(aU(t),t.lineIndent=0,C=t.input.charCodeAt(t.position);(!c||t.lineIndent<f)&&C===32;)t.lineIndent++,C=t.input.charCodeAt(++t.position);if(!c&&t.lineIndent>f&&(
2025-04-10 09:51:25 -04:00
`,n?1+p:p):a===oU&&n&&(t.result+=`
`);break}for(s?Td(C)?(h=!0,t.result+=wp.repeat(`
`,n?1+p:p)):h?(h=!1,t.result+=wp.repeat(`
`,p+1)):p===0?n&&(t.result+=" "):t.result+=wp.repeat(`
`,p):t.result+=wp.repeat(`
2025-04-11 10:05:45 -04:00
`,n?1+p:p),n=!0,c=!0,p=0,r=t.position;!qf(C)&&C!==0;)C=t.input.charCodeAt(++t.position);o0(t,r,t.position,!1)}return!0}function pre(t,e){var r,s=t.tag,a=t.anchor,n=[],c,f=!1,p;for(t.anchor!==null&&(t.anchorMap[t.anchor]=n),p=t.input.charCodeAt(t.position);p!==0&&!(p!==45||(c=t.input.charCodeAt(t.position+1),!nl(c)));){if(f=!0,t.position++,as(t,!0,-1)&&t.lineIndent<=e){n.push(null),p=t.input.charCodeAt(t.position);continue}if(r=t.line,yE(t,e,mre,!1,!0),n.push(t.result),as(t,!0,-1),p=t.input.charCodeAt(t.position),(t.line===r||t.lineIndent>e)&&p!==0)Rr(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break}return f?(t.tag=s,t.anchor=a,t.kind="sequence",t.result=n,!0):!1}function fze(t,e,r){var s,a,n,c,f=t.tag,p=t.anchor,h={},E={},C=null,S=null,P=null,I=!1,R=!1,N;for(t.anchor!==null&&(t.anchorMap[t.anchor]=h),N=t.input.charCodeAt(t.position);N!==0;){if(s=t.input.charCodeAt(t.position+1),n=t.line,c=t.position,(N===63||N===58)&&nl(s))N===63?(I&&(mE(t,h,E,C,S,null),C=S=P=null),R=!0,I=!0,a=!0):I?(I=!1,a=!0):Rr(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,N=s;else if(yE(t,r,dre,!1,!0))if(t.line===n){for(N=t.input.charCodeAt(t.position);Td(N);)N=t.input.charCodeAt(++t.position);if(N===58)N=t.input.charCodeAt(++t.position),nl(N)||Rr(t,"a whitespace character is expected after the key-value separator within a block mapping"),I&&(mE(t,h,E,C,S,null),C=S=P=null),R=!0,I=!1,a=!1,C=t.tag,S=t.result;else if(R)Rr(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=f,t.anchor=p,!0}else if(R)Rr(t,"can not read a block mapping entry; a multiline key may not be an implicit key");else return t.tag=f,t.anchor=p,!0;else break;if((t.line===n||t.lineIndent>e)&&(yE(t,e,Rx,!0,a)&&(I?S=t.result:P=t.result),I||(mE(t,h,E,C,S,P,n,c),C=S=P=null),as(t,!0,-1),N=t.input.charCodeAt(t.position)),t.lineIndent>e&&N!==0)Rr(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return I&&mE(t,h,E,C,S,null),R&&(t.tag=f,t.anchor=p,t.kind="mapping",t.result=h),R}function Aze(t){var e,r=!1,s=!1,a,n,c;if(c=t.input.charCodeAt(t.position),c!==33)return!1;if(t.tag!==null&&Rr(t,"duplication of a tag property"),c=t.input.charCodeAt(++t.position),c===60?(r=!0,c=t.input.charCodeAt(++t.position)):c===33?(s=!0,a="!!",c=t.input.charCodeAt(++t.position)):a="!",e=t.position,r){do c=t.input.charCodeAt(++t.position);while(c!==0&&c!==62);t.position<t.length?(n=t.input.slice(e,t.position),c=t.input.charCodeAt(++t.position)):Rr(t,"unexpected end of the stream within a verbatim tag")}else{for(;c!==0&&!nl(c);)c===33&&(s?Rr(t,"tag suffix cannot contain exclamation marks"):(a=t.input.slice(e-1,t.position+1),yre.test(a)||Rr(t,"named tag handle cannot contain such characters"),s=!0,e=t.position+1)),c=t.input.charCodeAt(++t.position);n=t.input.slice(e,t.position),eze.test(n)&&Rr(t,"tag suffix cannot contain flow indicator characters")}return n&&!Ere.test(n)&&Rr(t,"tag name cannot contain such characters: "+n),r?t.tag=n:a0.call(t.tagMap,a)?t.tag=t.tagMap[a]+n:a==="!"?t.tag="!"+n:a==="!!"?t.tag="tag:yaml.org,2002:"+n:Rr(t,'undeclared tag handle "'+a+'"'),!0}function pze(t){var e,r;if(r=t.input.charCodeAt(t.position),r!==38)return!1;for(t.anchor!==null&&Rr(t,"duplication of an anchor property"),r=t.input.charCodeAt(++t.position),e=t.position;r!==0&&!nl(r)&&!dE(r);)r=t.input.charCodeAt(++t.position);return t.position===e&&Rr(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(e,t.position),!0}function hze(t){var e,r,s;if(s=t.input.charCodeAt(t.position),s!==42)return!1;for(s=t.input.charCodeAt(++t.position),e=t.position;s!==0&&!nl(s)&&!dE(s);)s=t.input.charCodeAt(++t.position);return t.position===e&&Rr(t,"name of an alias node must contain at least one character"),r=t.input.slice(e,t.position),a0.call(t.anchorMap,r)||Rr(t,'unidentified alias "'+r+'"'),t.result=t.anchorMap[r],as(t,!0,-1),!0}function yE(t,e,r,s,a){var n,c,f,p=1,h=!1,E=!1,C,S,P,I,R;if(t.listener!==null&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=n
`),t.charCodeAt(0)===65279&&(t=t.slice(1)));var r=new sze(t,e),s=t.indexOf("\0");for(s!==-1&&(r.position=s,Rr(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)gze(r);return r.documents}function vre(t,e,r){e!==null&&typeof e=="object"&&typeof r>"u"&&(r=e,e=null);var s=Bre(t,r);if(typeof e!="function")return s;for(var a=0,n=s.length;a<n;a+=1)e(s[a])}function Sre(t,e){var r=Bre(t,e);if(r.length!==0){if(r.length===1)return r[0];throw new hre("expected a single document in the stream, but found more")}}function dze(t,e,r){return typeof e=="object"&&e!==null&&typeof r>"u"&&(r=e,e=null),vre(t,e,wp.extend({schema:gre},r))}function mze(t,e){return Sre(t,wp.extend({schema:gre},e))}V2.exports.loadAll=vre;V2.exports.load=Sre;V2.exports.safeLoadAll=dze;V2.exports.safeLoad=mze});var Jre=L((m9t,AU)=>{"use strict";var J2=Pd(),z2=pE(),yze=Y2(),Eze=gE(),Fre=Object.prototype.toString,Nre=Object.prototype.hasOwnProperty,Ize=9,K2=10,Cze=13,wze=32,Bze=33,vze=34,Ore=35,Sze=37,Dze=38,bze=39,Pze=42,Lre=44,xze=45,Mre=58,kze=61,Qze=62,Tze=63,Rze=64,_re=91,Ure=93,Fze=96,Hre=123,Nze=124,jre=125,jo={};jo[0]="\\0";jo[7]="\\a";jo[8]="\\b";jo[9]="\\t";jo[10]="\\n";jo[11]="\\v";jo[12]="\\f";jo[13]="\\r";jo[27]="\\e";jo[34]='\\"';jo[92]="\\\\";jo[133]="\\N";jo[160]="\\_";jo[8232]="\\L";jo[8233]="\\P";var Oze=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function Lze(t,e){var r,s,a,n,c,f,p;if(e===null)return{};for(r={},s=Object.keys(e),a=0,n=s.length;a<n;a+=1)c=s[a],f=String(e[c]),c.slice(0,2)==="!!"&&(c="tag:yaml.org,2002:"+c.slice(2)),p=t.compiledTypeMap.fallback[c],p&&Nre.call(p.styleAliases,f)&&(f=p.styleAliases[f]),r[c]=f;return r}function bre(t){var e,r,s;if(e=t.toString(16).toUpperCase(),t<=255)r="x",s=2;else if(t<=65535)r="u",s=4;else if(t<=4294967295)r="U",s=8;else throw new z2("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+J2.repeat("0",s-e.length)+e}function Mze(t){this.schema=t.schema||yze,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=J2.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=Lze(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Pre(t,e){for(var r=J2.repeat(" ",e),s=0,a=-1,n="",c,f=t.length;s<f;)a=t.indexOf(`
2025-04-10 09:51:25 -04:00
`,s),a===-1?(c=t.slice(s),s=f):(c=t.slice(s,a+1),s=a+1),c.length&&c!==`
`&&(n+=r),n+=c;return n}function cU(t,e){return`
2025-04-11 10:05:45 -04:00
`+J2.repeat(" ",t.indent*e)}function _ze(t,e){var r,s,a;for(r=0,s=t.implicitTypes.length;r<s;r+=1)if(a=t.implicitTypes[r],a.resolve(e))return!0;return!1}function fU(t){return t===wze||t===Ize}function EE(t){return 32<=t&&t<=126||161<=t&&t<=55295&&t!==8232&&t!==8233||57344<=t&&t<=65533&&t!==65279||65536<=t&&t<=1114111}function Uze(t){return EE(t)&&!fU(t)&&t!==65279&&t!==Cze&&t!==K2}function xre(t,e){return EE(t)&&t!==65279&&t!==Lre&&t!==_re&&t!==Ure&&t!==Hre&&t!==jre&&t!==Mre&&(t!==Ore||e&&Uze(e))}function Hze(t){return EE(t)&&t!==65279&&!fU(t)&&t!==xze&&t!==Tze&&t!==Mre&&t!==Lre&&t!==_re&&t!==Ure&&t!==Hre&&t!==jre&&t!==Ore&&t!==Dze&&t!==Pze&&t!==Bze&&t!==Nze&&t!==kze&&t!==Qze&&t!==bze&&t!==vze&&t!==Sze&&t!==Rze&&t!==Fze}function qre(t){var e=/^\n* /;return e.test(t)}var Gre=1,Wre=2,Yre=3,Vre=4,Ox=5;function jze(t,e,r,s,a){var n,c,f,p=!1,h=!1,E=s!==-1,C=-1,S=Hze(t.charCodeAt(0))&&!fU(t.charCodeAt(t.length-1));if(e)for(n=0;n<t.length;n++){if(c=t.charCodeAt(n),!EE(c))return Ox;f=n>0?t.charCodeAt(n-1):null,S=S&&xre(c,f)}else{for(n=0;n<t.length;n++){if(c=t.charCodeAt(n),c===K2)p=!0,E&&(h=h||n-C-1>s&&t[C+1]!==" ",C=n);else if(!EE(c))return Ox;f=n>0?t.charCodeAt(n-1):null,S=S&&xre(c,f)}h=h||E&&n-C-1>s&&t[C+1]!==" "}return!p&&!h?S&&!a(t)?Gre:Wre:r>9&&qre(t)?Ox:h?Vre:Yre}function qze(t,e,r,s){t.dump=function(){if(e.length===0)return"''";if(!t.noCompatMode&&Oze.indexOf(e)!==-1)return"'"+e+"'";var a=t.indent*Math.max(1,r),n=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-a),c=s||t.flowLevel>-1&&r>=t.flowLevel;function f(p){return _ze(t,p)}switch(jze(e,c,t.indent,n,f)){case Gre:return e;case Wre:return"'"+e.replace(/'/g,"''")+"'";case Yre:return"|"+kre(e,t.indent)+Qre(Pre(e,a));case Vre:return">"+kre(e,t.indent)+Qre(Pre(Gze(e,n),a));case Ox:return'"'+Wze(e,n)+'"';default:throw new z2("impossible error: invalid scalar style")}}()}function kre(t,e){var r=qre(t)?String(e):"",s=t[t.length-1]===`
2025-04-10 09:51:25 -04:00
`,a=s&&(t[t.length-2]===`
`||t===`
`),n=a?"+":s?"":"-";return r+n+`
`}function Qre(t){return t[t.length-1]===`
`?t.slice(0,-1):t}function Gze(t,e){for(var r=/(\n+)([^\n]*)/g,s=function(){var h=t.indexOf(`
`);return h=h!==-1?h:t.length,r.lastIndex=h,Tre(t.slice(0,h),e)}(),a=t[0]===`
`||t[0]===" ",n,c;c=r.exec(t);){var f=c[1],p=c[2];n=p[0]===" ",s+=f+(!a&&!n&&p!==""?`
`:"")+Tre(p,e),a=n}return s}function Tre(t,e){if(t===""||t[0]===" ")return t;for(var r=/ [^ ]/g,s,a=0,n,c=0,f=0,p="";s=r.exec(t);)f=s.index,f-a>e&&(n=c>a?c:f,p+=`
`+t.slice(a,n),a=n+1),c=f;return p+=`
`,t.length-a>e&&c>a?p+=t.slice(a,c)+`
2025-04-11 10:05:45 -04:00
`+t.slice(c+1):p+=t.slice(a),p.slice(1)}function Wze(t){for(var e="",r,s,a,n=0;n<t.length;n++){if(r=t.charCodeAt(n),r>=55296&&r<=56319&&(s=t.charCodeAt(n+1),s>=56320&&s<=57343)){e+=bre((r-55296)*1024+s-56320+65536),n++;continue}a=jo[r],e+=!a&&EE(r)?t[n]:a||bre(r)}return e}function Yze(t,e,r){var s="",a=t.tag,n,c;for(n=0,c=r.length;n<c;n+=1)Rd(t,e,r[n],!1,!1)&&(n!==0&&(s+=","+(t.condenseFlow?"":" ")),s+=t.dump);t.tag=a,t.dump="["+s+"]"}function Vze(t,e,r,s){var a="",n=t.tag,c,f;for(c=0,f=r.length;c<f;c+=1)Rd(t,e+1,r[c],!0,!0)&&((!s||c!==0)&&(a+=cU(t,e)),t.dump&&K2===t.dump.charCodeAt(0)?a+="-":a+="- ",a+=t.dump);t.tag=n,t.dump=a||"[]"}function Kze(t,e,r){var s="",a=t.tag,n=Object.keys(r),c,f,p,h,E;for(c=0,f=n.length;c<f;c+=1)E="",c!==0&&(E+=", "),t.condenseFlow&&(E+='"'),p=n[c],h=r[p],Rd(t,e,p,!1,!1)&&(t.dump.length>1024&&(E+="? "),E+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),Rd(t,e,h,!1,!1)&&(E+=t.dump,s+=E));t.tag=a,t.dump="{"+s+"}"}function Jze(t,e,r,s){var a="",n=t.tag,c=Object.keys(r),f,p,h,E,C,S;if(t.sortKeys===!0)c.sort();else if(typeof t.sortKeys=="function")c.sort(t.sortKeys);else if(t.sortKeys)throw new z2("sortKeys must be a boolean or a function");for(f=0,p=c.length;f<p;f+=1)S="",(!s||f!==0)&&(S+=cU(t,e)),h=c[f],E=r[h],Rd(t,e+1,h,!0,!0,!0)&&(C=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024,C&&(t.dump&&K2===t.dump.charCodeAt(0)?S+="?":S+="? "),S+=t.dump,C&&(S+=cU(t,e)),Rd(t,e+1,E,!0,C)&&(t.dump&&K2===t.dump.charCodeAt(0)?S+=":":S+=": ",S+=t.dump,a+=S));t.tag=n,t.dump=a||"{}"}function Rre(t,e,r){var s,a,n,c,f,p;for(a=r?t.explicitTypes:t.implicitTypes,n=0,c=a.length;n<c;n+=1)if(f=a[n],(f.instanceOf||f.predicate)&&(!f.instanceOf||typeof e=="object"&&e instanceof f.instanceOf)&&(!f.predicate||f.predicate(e))){if(t.tag=r?f.tag:"?",f.represent){if(p=t.styleMap[f.tag]||f.defaultStyle,Fre.call(f.represent)==="[object Function]")s=f.represent(e,p);else if(Nre.call(f.represent,p))s=f.represent[p](e,p);else throw new z2("!<"+f.tag+'> tag resolver accepts not "'+p+'" style');t.dump=s}return!0}return!1}function Rd(t,e,r,s,a,n){t.tag=null,t.dump=r,Rre(t,r,!1)||Rre(t,r,!0);var c=Fre.call(t.dump);s&&(s=t.flowLevel<0||t.flowLevel>e);var f=c==="[object Object]"||c==="[object Array]",p,h;if(f&&(p=t.duplicates.indexOf(r),h=p!==-1),(t.tag!==null&&t.tag!=="?"||h||t.indent!==2&&e>0)&&(a=!1),h&&t.usedDuplicates[p])t.dump="*ref_"+p;else{if(f&&h&&!t.usedDuplicates[p]&&(t.usedDuplicates[p]=!0),c==="[object Object]")s&&Object.keys(t.dump).length!==0?(Jze(t,e,t.dump,a),h&&(t.dump="&ref_"+p+t.dump)):(Kze(t,e,t.dump),h&&(t.dump="&ref_"+p+" "+t.dump));else if(c==="[object Array]"){var E=t.noArrayIndent&&e>0?e-1:e;s&&t.dump.length!==0?(Vze(t,E,t.dump,a),h&&(t.dump="&ref_"+p+t.dump)):(Yze(t,E,t.dump),h&&(t.dump="&ref_"+p+" "+t.dump))}else if(c==="[object String]")t.tag!=="?"&&qze(t,t.dump,e,n);else{if(t.skipInvalid)return!1;throw new z2("unacceptable kind of an object to dump "+c)}t.tag!==null&&t.tag!=="?"&&(t.dump="!<"+t.tag+"> "+t.dump)}return!0}function zze(t,e){var r=[],s=[],a,n;for(uU(t,r,s),a=0,n=s.length;a<n;a+=1)e.duplicates.push(r[s[a]]);e.usedDuplicates=new Array(n)}function uU(t,e,r){var s,a,n;if(t!==null&&typeof t=="object")if(a=e.indexOf(t),a!==-1)r.indexOf(a)===-1&&r.push(a);else if(e.push(t),Array.isArray(t))for(a=0,n=t.length;a<n;a+=1)uU(t[a],e,r);else for(s=Object.keys(t),a=0,n=s.length;a<n;a+=1)uU(t[s[a]],e,r)}function Kre(t,e){e=e||{};var r=new Mze(e);return r.noRefs||zze(t,r),Rd(r,0,t,!0,!0)?r.dump+`
`:""}function Zze(t,e){return Kre(t,J2.extend({schema:Eze},e))}AU.exports.dump=Kre;AU.exports.safeDump=Zze});var Zre=L((y9t,Gi)=>{"use strict";var Lx=Dre(),zre=Jre();function Mx(t){return function(){throw new Error("Function "+t+" is deprecated and cannot be used.")}}Gi.exports.Type=Ds();Gi.exports.Schema=xd();Gi.exports.FAILSAFE_SCHEMA=kx();Gi.exports.JSON_SCHEMA=nU();Gi.exports.CORE_SCHEMA=iU();Gi.exports.DEFAULT_SAFE_SCHEMA=gE();Gi.exports.DEFAULT_FULL_SCHEMA=Y2();Gi.exports.load=Lx.load;Gi.exports.loadAll=Lx.loadAll;Gi.exports.safeLoad=Lx.safeLoad;Gi.exports.safeLoadAll=Lx.safeLoadAll;Gi.exports.dump=zre.dump;Gi.exports.safeDump=zre.safeDump;Gi.exports.YAMLException=pE();Gi.exports.MINIMAL_SCHEMA=kx();Gi.exports.SAFE_SCHEMA=gE();Gi.exports.DEFAULT_SCHEMA=Y2();Gi.exports.scan=Mx("scan");Gi.exports.parse=Mx("parse");Gi.exports.compose=Mx("compose");Gi.exports.addConstructor=Mx("addConstructor")});var $re=L((E9t,Xre)=>{"use strict";var Xze=Zre();Xre.exports=Xze});var tne=L((I9t,ene)=>{"use strict";function $ze(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}function Fd(t,e,r,s){this.message=t,this.expected=e,this.found=r,this.location=s,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Fd)}$ze(Fd,Error);Fd.buildMessage=function(t,e){var r={literal:function(h){return'"'+a(h.text)+'"'},class:function(h){var E="",C;for(C=0;C<h.parts.length;C++)E+=h.parts[C]instanceof Array?n(h.parts[C][0])+"-"+n(h.parts[C][1]):n(h.parts[C]);return"["+(h.inverted?"^":"")+E+"]"},any:function(h){return"any character"},end:function(h){return"end of input"},other:function(h){return h.description}};function s(h){return h.charCodeAt(0).toString(16).toUpperCase()}function a(h){return h.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(E){return"\\x0"+s(E)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(E){return"\\x"+s(E)})}function n(h){return h.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(E){return"\\x0"+s(E)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(E){return"\\x"+s(E)})}function c(h){return r[h.type](h)}function f(h){var E=new Array(h.length),C,S;for(C=0;C<h.length;C++)E[C]=c(h[C]);if(E.sort(),E.length>0){for(C=1,S=1;C<E.length;C++)E[C-1]!==E[C]&&(E[S]=E[C],S++);E.length=S}switch(E.length){case 1:return E[0];case 2:return E[0]+" or "+E[1];default:return E.slice(0,-1).join(", ")+", or "+E[E.length-1]}}function p(h){return h?'"'+a(h)+'"':"end of input"}return"Expected "+f(t)+" but "+p(e)+" found."};function eZe(t,e){e=e!==void 0?e:{};var r={},s={Start:cc},a=cc,n=function(ee){return[].concat(...ee)},c="-",f=dn("-",!1),p=function(ee){return ee},h=function(ee){return Object.assign({},...ee)},E="#",C=dn("#",!1),S=hu(),P=function(){return{}},I=":",R=dn(":",!1),N=function(ee,Ie){return{[ee]:Ie}},U=",",W=dn(",",!1),te=function(ee,Ie){return Ie},ie=function(ee,Ie,Oe){return Object.assign({},...[ee].concat(Ie).map(ht=>({[ht]:Oe})))},Ae=function(ee){return ee},ce=function(ee){return ee},me=La("correct indentation"),pe=" ",Be=dn(" ",!1),Ce=function(ee){return ee.length===lr*St},g=function(ee){return ee.length===(lr+1)*St},we=function(){return lr++,!0},Ee=function(){return lr--,!0},fe=function(){return ca()},se=La("pseudostring"),X=/^[^\r\n\t ?:,\][{}#&*!|>'"%@`\-]/,De=Jn(["\r",`
`," "," ","?",":",",","]","[","{","}","#","&","*","!","|",">","'",'"',"%","@","`","-"],!0,!1),Re=/^[^\r\n\t ,\][{}:#"']/,gt=Jn(["\r",`
`," "," ",",","]","[","{","}",":","#",'"',"'"],!0,!1),j=function(){return ca().replace(/^ *| *$/g,"")},rt="--",Fe=dn("--",!1),Ne=/^[a-zA-Z\/0-9]/,Pe=Jn([["a","z"],["A","Z"],"/",["0","9"]],!1,!1),Ye=/^[^\r\n\t :,]/,ke=Jn(["\r",`
`," "," ",":",","],!0,!1),it="null",_e=dn("null",!1),x=function(){return null},w="true",b=dn("true",!1),y=function(){return!0},F="false",z=dn("false",!1),Z=function(){return!1},$=La("string"),oe='"',xe=dn('"',!1),Te=function(){return""},lt=function(ee){return ee},Et=function(ee){return ee.join("")},qt=/^[^"\\\0-\x1F\x7F]/,ir=Jn(['"',"\\",["\0",""],"\x7F"],!0,!1),Pt='\\"',gn=dn('\\"',!1),Pr=function(){return'"'},Ir="\\\\",Nr=dn("\\\\",!1),nn=function(){return"\\"},oi="\\/",wo=dn("\\/",!1),rs=function(){return"/"},eo="\\b",Bo=dn("\\b",!1),Hi=function(){return"\b"},to="\\f",vo=dn("\\f",!1),RA=function(){return"\f"},pf="\\n",Eh=dn("\\n",!1),Ih=function(){return`
`},ro="\\r",jn=dn("\\r",!1),Rs=function(){return"\r"},no="\\t",lu=dn("\\t",!1),cu=function(){return" "},uu="\\u",FA=dn("\\u",!1),NA=function(ee,Ie,Oe,ht){return String.fromCharCode(parseInt(`0x${ee}${Ie}${Oe}${ht}`))},aa=/^[0-9a-fA-F]/,la=Jn([["0","9"],["a","f"],["A","F"]],!1,!1),OA=La("blank space"),gr=/^[ \t]/,So=Jn([" "," "],!1,!1),Me=La("white space"),fu=/^[ \t\n\r]/,Cr=Jn([" "," ",`
2025-04-10 09:51:25 -04:00
`,"\r"],!1,!1),hf=`\r
`,LA=dn(`\r
`,!1),MA=`
`,Au=dn(`
2025-04-11 10:05:45 -04:00
`,!1),pu="\r",ac=dn("\r",!1),ve=0,Nt=0,lc=[{line:1,column:1}],Ni=0,io=[],Rt=0,xn;if("startRule"in e){if(!(e.startRule in s))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');a=s[e.startRule]}function ca(){return t.substring(Nt,ve)}function ji(){return Ua(Nt,ve)}function Oi(ee,Ie){throw Ie=Ie!==void 0?Ie:Ua(Nt,ve),gf([La(ee)],t.substring(Nt,ve),Ie)}function Oa(ee,Ie){throw Ie=Ie!==void 0?Ie:Ua(Nt,ve),Ha(ee,Ie)}function dn(ee,Ie){return{type:"literal",text:ee,ignoreCase:Ie}}function Jn(ee,Ie,Oe){return{type:"class",parts:ee,inverted:Ie,ignoreCase:Oe}}function hu(){return{type:"any"}}function Ch(){return{type:"end"}}function La(ee){return{type:"other",description:ee}}function Ma(ee){var Ie=lc[ee],Oe;if(Ie)return Ie;for(Oe=ee-1;!lc[Oe];)Oe--;for(Ie=lc[Oe],Ie={line:Ie.line,column:Ie.column};Oe<ee;)t.charCodeAt(Oe)===10?(Ie.line++,Ie.column=1):Ie.column++,Oe++;return lc[ee]=Ie,Ie}function Ua(ee,Ie){var Oe=Ma(ee),ht=Ma(Ie);return{start:{offset:ee,line:Oe.line,column:Oe.column},end:{offset:Ie,line:ht.line,column:ht.column}}}function Xe(ee){ve<Ni||(ve>Ni&&(Ni=ve,io=[]),io.push(ee))}function Ha(ee,Ie){return new Fd(ee,null,null,Ie)}function gf(ee,Ie,Oe){return new Fd(Fd.buildMessage(ee,Ie),ee,Ie,Oe)}function cc(){var ee;return ee=_A(),ee}function wn(){var ee,Ie,Oe;for(ee=ve,Ie=[],Oe=ua();Oe!==r;)Ie.push(Oe),Oe=ua();return Ie!==r&&(Nt=ee,Ie=n(Ie)),ee=Ie,ee}function ua(){var ee,Ie,Oe,ht,mt;return ee=ve,Ie=vl(),Ie!==r?(t.charCodeAt(ve)===45?(Oe=c,ve++):(Oe=r,Rt===0&&Xe(f)),Oe!==r?(ht=Qn(),ht!==r?(mt=fa(),mt!==r?(Nt=ee,Ie=p(mt),ee=Ie):(ve=ee,ee=r)):(ve=ee,ee=r)):(ve=ee,ee=r)):(ve=ee,ee=r),ee}function _A(){var ee,Ie,Oe;for(ee=ve,Ie=[],Oe=UA();Oe!==r;)Ie.push(Oe),Oe=UA();return Ie!==r&&(Nt=ee,Ie=h(Ie)),ee=Ie,ee}function UA(){var ee,Ie,Oe,ht,mt,Dt,tr,fn,ai;if(ee=ve,Ie=Qn(),Ie===r&&(Ie=null),Ie!==r){if(Oe=ve,t.charCodeAt(ve)===35?(ht=E,ve++):(ht=r,Rt===0&&Xe(C)),ht!==r){if(mt=[],Dt=ve,tr=ve,Rt++,fn=st(),Rt--,fn===r?tr=void 0:(ve=tr,tr=r),tr!==r?(t.length>ve?(fn=t.charAt(ve),ve++):(fn=r,Rt===0&&Xe(S)),fn!==r?(tr=[tr,fn],Dt=tr):(ve=Dt,Dt=r)):(ve=Dt,Dt=r),Dt!==r)for(;Dt!==r;)mt.push(Dt),Dt=ve,tr=ve,Rt++,fn=st(),Rt--,fn===r?tr=void 0:(ve=tr,tr=r),tr!==r?(t.length>ve?(fn=t.charAt(ve),ve++):(fn=r,Rt===0&&Xe(S)),fn!==r?(tr=[tr,fn],Dt=tr):(ve=Dt,Dt=r)):(ve=Dt,Dt=r);else mt=r;mt!==r?(ht=[ht,mt],Oe=ht):(ve=Oe,Oe=r)}else ve=Oe,Oe=r;if(Oe===r&&(Oe=null),Oe!==r){if(ht=[],mt=Je(),mt!==r)for(;mt!==r;)ht.push(mt),mt=Je();else ht=r;ht!==r?(Nt=ee,Ie=P(),ee=Ie):(ve=ee,ee=r)}else ve=ee,ee=r}else ve=ee,ee=r;if(ee===r&&(ee=ve,Ie=vl(),Ie!==r?(Oe=ja(),Oe!==r?(ht=Qn(),ht===r&&(ht=null),ht!==r?(t.charCodeAt(ve)===58?(mt=I,ve++):(mt=r,Rt===0&&Xe(R)),mt!==r?(Dt=Qn(),Dt===r&&(Dt=null),Dt!==r?(tr=fa(),tr!==r?(Nt=ee,Ie=N(Oe,tr),ee=Ie):(ve=ee,ee=r)):(ve=ee,ee=r)):(ve=ee,ee=r)):(ve=ee,ee=r)):(ve=ee,ee=r)):(ve=ee,ee=r),ee===r&&(ee=ve,Ie=vl(),Ie!==r?(Oe=ns(),Oe!==r?(ht=Qn(),ht===r&&(ht=null),ht!==r?(t.charCodeAt(ve)===58?(mt=I,ve++):(mt=r,Rt===0&&Xe(R)),mt!==r?(Dt=Qn(),Dt===r&&(Dt=null),Dt!==r?(tr=fa(),tr!==r?(Nt=ee,Ie=N(Oe,tr),ee=Ie):(ve=ee,ee=r)):(ve=ee,ee=r)):(ve=ee,ee=r)):(ve=ee,ee=r)):(ve=ee,ee=r)):(ve=ee,ee=r),ee===r))){if(ee=ve,Ie=vl(),Ie!==r)if(Oe=ns(),Oe!==r)if(ht=Qn(),ht!==r)if(mt=gu(),mt!==r){if(Dt=[],tr=Je(),tr!==r)for(;tr!==r;)Dt.push(tr),tr=Je();else Dt=r;Dt!==r?(Nt=ee,Ie=N(Oe,mt),ee=Ie):(ve=ee,ee=r)}else ve=ee,ee=r;else ve=ee,ee=r;else ve=ee,ee=r;else ve=ee,ee=r;if(ee===r)if(ee=ve,Ie=vl(),Ie!==r)if(Oe=ns(),Oe!==r){if(ht=[],mt=ve,Dt=Qn(),Dt===r&&(Dt=null),Dt!==r?(t.charCodeAt(ve)===44?(tr=U,ve++):(tr=r,Rt===0&&Xe(W)),tr!==r?(fn=Qn(),fn===r&&(fn=null),fn!==r?(ai=ns(),ai!==r?(Nt=mt,Dt=te(Oe,ai),mt=Dt):(ve=mt,mt=r)):(ve=mt,mt=r)):(ve=mt,mt=r)):(ve=mt,mt=r),mt!==r)for(;mt!==r;)ht.push(mt),mt=ve,Dt=Qn(),Dt===r&&(Dt=null),Dt!==r?(t.charCodeAt(ve)===44?(tr=U,ve++):(tr=r,Rt===0&&Xe(W)),tr!==r?(fn=Qn(),fn===r&&(fn=null),fn!==r?(ai=ns(),ai!==r?(Nt=mt,Dt=te(Oe,ai),mt=Dt):(ve=mt,mt=r)):(ve=mt,mt=r)):(ve=mt,mt=r)):(ve=mt,mt=r);else ht=r;ht!==r?(mt=Qn(),mt===r&&(mt=null),mt!==r?(t.charCodeAt(ve)===58?(Dt=I,ve++):(Dt=r,Rt===0&&Xe(R)),Dt!==r?(tr=Qn(),tr===
2025-04-10 09:51:25 -04:00
`;if(typeof t=="number"||typeof t=="boolean")return`${t.toString()}
`;if(typeof t=="string")return`${nne(t)}
`;if(Array.isArray(t)){if(t.length===0)return`[]
`;let s=" ".repeat(e);return`
${t.map(n=>`${s}- ${pU(n,e+1,!1)}`).join("")}`}if(typeof t=="object"&&t){let[s,a]=t instanceof _x?[t.data,!1]:[t,!0],n=" ".repeat(e),c=Object.keys(s);a&&c.sort((p,h)=>{let E=rne.indexOf(p),C=rne.indexOf(h);return E===-1&&C===-1?p<h?-1:p>h?1:0:E!==-1&&C===-1?-1:E===-1&&C!==-1?1:E-C});let f=c.filter(p=>!sne(s[p])).map((p,h)=>{let E=s[p],C=nne(p),S=pU(E,e+1,!0),P=h>0||r?n:"",I=C.length>1024?`? ${C}
${P}:`:`${C}:`,R=S.startsWith(`
`)?S:` ${S}`;return`${P}${I}${R}`}).join(e===0?`
`:"")||`
`;return r?`
${f}`:`${f}`}throw new Error(`Unsupported value type (${t})`)}function il(t){try{let e=pU(t,0,!1);return e!==`
`?e:""}catch(e){throw e.location&&(e.message=e.message.replace(/(\.)?$/,` (line ${e.location.start.line}, column ${e.location.start.column})$1`)),e}}function rZe(t){return t.endsWith(`
`)||(t+=`
2025-04-11 10:05:45 -04:00
`),(0,ine.parse)(t)}function iZe(t){if(nZe.test(t))return rZe(t);let e=(0,Ux.safeLoad)(t,{schema:Ux.FAILSAFE_SCHEMA,json:!0});if(e==null)return{};if(typeof e!="object")throw new Error(`Expected an indexed object, got a ${typeof e} instead. Does your file follow Yaml's rules?`);if(Array.isArray(e))throw new Error("Expected an indexed object, got an array instead. Does your file follow Yaml's rules?");return e}function ls(t){return iZe(t)}var Ux,ine,tZe,rne,_x,nZe,one=It(()=>{Ux=et($re()),ine=et(tne()),tZe=/^(?![-?:,\][{}#&*!|>'"%@` \t\r\n]).([ \t]*(?![,\][{}:# \t\r\n]).)*$/,rne=["__metadata","version","resolution","dependencies","peerDependencies","dependenciesMeta","peerDependenciesMeta","binaries"],_x=class{constructor(e){this.data=e}};il.PreserveOrdering=_x;nZe=/^(#.*(\r?\n))*?#\s+yarn\s+lockfile\s+v1\r?\n/i});var Z2={};Vt(Z2,{parseResolution:()=>bx,parseShell:()=>vx,parseSyml:()=>ls,stringifyArgument:()=>$_,stringifyArgumentSegment:()=>eU,stringifyArithmeticExpression:()=>Dx,stringifyCommand:()=>X_,stringifyCommandChain:()=>AE,stringifyCommandChainThen:()=>Z_,stringifyCommandLine:()=>Sx,stringifyCommandLineThen:()=>z_,stringifyEnvSegment:()=>Bx,stringifyRedirectArgument:()=>G2,stringifyResolution:()=>Px,stringifyShell:()=>fE,stringifyShellLine:()=>fE,stringifySyml:()=>il,stringifyValueArgument:()=>Sd});var Bc=It(()=>{ste();cte();one()});var lne=L((S9t,hU)=>{"use strict";var sZe=t=>{let e=!1,r=!1,s=!1;for(let a=0;a<t.length;a++){let n=t[a];e&&/[a-zA-Z]/.test(n)&&n.toUpperCase()===n?(t=t.slice(0,a)+"-"+t.slice(a),e=!1,s=r,r=!0,a++):r&&s&&/[a-zA-Z]/.test(n)&&n.toLowerCase()===n?(t=t.slice(0,a-1)+"-"+t.slice(a-1),s=r,r=!1,e=!0):(e=n.toLowerCase()===n&&n.toUpperCase()!==n,s=r,r=n.toUpperCase()===n&&n.toLowerCase()!==n)}return t},ane=(t,e)=>{if(!(typeof t=="string"||Array.isArray(t)))throw new TypeError("Expected the input to be `string | string[]`");e=Object.assign({pascalCase:!1},e);let r=a=>e.pascalCase?a.charAt(0).toUpperCase()+a.slice(1):a;return Array.isArray(t)?t=t.map(a=>a.trim()).filter(a=>a.length).join("-"):t=t.trim(),t.length===0?"":t.length===1?e.pascalCase?t.toUpperCase():t.toLowerCase():(t!==t.toLowerCase()&&(t=sZe(t)),t=t.replace(/^[_.\- ]+/,"").toLowerCase().replace(/[_.\- ]+(\w|$)/g,(a,n)=>n.toUpperCase()).replace(/\d+(\w|$)/g,a=>a.toUpperCase()),r(t))};hU.exports=ane;hU.exports.default=ane});var cne=L((D9t,oZe)=>{oZe.exports=[{name:"Agola CI",constant:"AGOLA",env:"AGOLA_GIT_REF",pr:"AGOLA_PULL_REQUEST_ID"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE"},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN"},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"TF_BUILD",pr:{BUILD_REASON:"PullRequest"}},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codemagic",constant:"CODEMAGIC",env:"CM_BUILD_ID",pr:"CM_PULL_REQUEST"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"Earthly",constant:"EARTHLY",env:"EARTHLY_CI"},{name:"Expo Application Services",constant:"EAS",env:"EAS_BUILD"},{name:"Gerrit",constant:"GERRIT",env:"GERRIT_PROJECT"},{name:"Gitea Actions",constant:"GITEA_ACTIONS",env:"GITEA_ACTIONS"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab
2025-04-10 09:51:25 -04:00
${this.candidates.map(({usage:a})=>`$ ${a}`).join(`
`)}`}else if(this.candidates.length===1){let[{usage:s}]=this.candidates;this.message=`Command not found; did you mean:
$ ${s}
${yU(e)}`}else this.message=`Command not found; did you mean one of:
${this.candidates.map(({usage:s},a)=>`${`${a}.`.padStart(4)} ${s}`).join(`
`)}
${yU(e)}`}},qx=class extends Error{constructor(e,r){super(),this.input=e,this.usages=r,this.clipanion={type:"none"},this.name="AmbiguousSyntaxError",this.message=`Cannot find which to pick amongst the following alternatives:
${this.usages.map((s,a)=>`${`${a}.`.padStart(4)} ${s}`).join(`
`)}
${yU(e)}`}},yU=t=>`While running ${t.filter(e=>e!==ei.EndOfInput&&e!==ei.EndOfPartialInput).map(e=>{let r=JSON.stringify(e);return e.match(/\s/)||e.length===0||r!==`"${e}"`?r:e}).join(" ")}`});function aZe(t){let e=t.split(`
`),r=e.filter(a=>a.match(/\S/)),s=r.length>0?r.reduce((a,n)=>Math.min(a,n.length-n.trimStart().length),Number.MAX_VALUE):0;return e.map(a=>a.slice(s).trimRight()).join(`
`)}function qo(t,{format:e,paragraphs:r}){return t=t.replace(/\r\n?/g,`
`),t=aZe(t),t=t.replace(/^\n+|\n+$/g,""),t=t.replace(/^(\s*)-([^\n]*?)\n+/gm,`$1-$2
`),t=t.replace(/\n(\n)?\n*/g,(s,a)=>a||" "),r&&(t=t.split(/\n/).map(s=>{let a=s.match(/^\s*[*-][\t ]+(.*)/);if(!a)return s.match(/(.{1,80})(?: |$)/g).join(`
`);let n=s.length-s.trimStart().length;return a[1].match(new RegExp(`(.{1,${78-n}})(?: |$)`,"g")).map((c,f)=>" ".repeat(n)+(f===0?"- ":" ")+c).join(`
`)}).join(`
`)),t=t.replace(/(`+)((?:.|[\n])*?)\1/g,(s,a,n)=>e.code(a+n+a)),t=t.replace(/(\*\*)((?:.|[\n])*?)\1/g,(s,a,n)=>e.bold(a+n+a)),t?`${t}
`:""}var EU,pne,hne,IU=It(()=>{EU=Array(80).fill("\u2501");for(let t=0;t<=24;++t)EU[EU.length-t]=`\x1B[38;5;${232+t}m\u2501`;pne={header:t=>`\x1B[1m\u2501\u2501\u2501 ${t}${t.length<75?` ${EU.slice(t.length+5).join("")}`:":"}\x1B[0m`,bold:t=>`\x1B[1m${t}\x1B[22m`,error:t=>`\x1B[31m\x1B[1m${t}\x1B[22m\x1B[39m`,code:t=>`\x1B[36m${t}\x1B[39m`},hne={header:t=>t,bold:t=>t,error:t=>t,code:t=>t}});function Ea(t){return{...t,[X2]:!0}}function Gf(t,e){return typeof t>"u"?[t,e]:typeof t=="object"&&t!==null&&!Array.isArray(t)?[void 0,t]:[t,e]}function Wx(t,{mergeName:e=!1}={}){let r=t.match(/^([^:]+): (.*)$/m);if(!r)return"validation failed";let[,s,a]=r;return e&&(a=a[0].toLowerCase()+a.slice(1)),a=s!=="."||!e?`${s.replace(/^\.(\[|$)/,"$1")}: ${a}`:`: ${a}`,a}function $2(t,e){return e.length===1?new nt(`${t}${Wx(e[0],{mergeName:!0})}`):new nt(`${t}:
${e.map(r=>`
2025-04-11 10:05:45 -04:00
- ${Wx(r)}`).join("")}`)}function Ld(t,e,r){if(typeof r>"u")return e;let s=[],a=[],n=f=>{let p=e;return e=f,n.bind(null,p)};if(!r(e,{errors:s,coercions:a,coercion:n}))throw $2(`Invalid value for ${t}`,s);for(let[,f]of a)f();return e}var X2,Bp=It(()=>{Gx();X2=Symbol("clipanion/isOption")});var Ia={};Vt(Ia,{KeyRelationship:()=>Wf,TypeAssertionError:()=>c0,applyCascade:()=>rB,as:()=>DZe,assert:()=>BZe,assertWithErrors:()=>vZe,cascade:()=>Jx,fn:()=>bZe,hasAtLeastOneKey:()=>bU,hasExactLength:()=>Ene,hasForbiddenKeys:()=>YZe,hasKeyRelationship:()=>iB,hasMaxLength:()=>xZe,hasMinLength:()=>PZe,hasMutuallyExclusiveKeys:()=>VZe,hasRequiredKeys:()=>WZe,hasUniqueItems:()=>kZe,isArray:()=>Yx,isAtLeast:()=>SU,isAtMost:()=>RZe,isBase64:()=>HZe,isBoolean:()=>gZe,isDate:()=>mZe,isDict:()=>IZe,isEnum:()=>Ao,isHexColor:()=>UZe,isISO8601:()=>_Ze,isInExclusiveRange:()=>NZe,isInInclusiveRange:()=>FZe,isInstanceOf:()=>wZe,isInteger:()=>DU,isJSON:()=>jZe,isLiteral:()=>dne,isLowerCase:()=>OZe,isMap:()=>EZe,isNegative:()=>QZe,isNullable:()=>GZe,isNumber:()=>BU,isObject:()=>mne,isOneOf:()=>vU,isOptional:()=>qZe,isPartial:()=>CZe,isPayload:()=>dZe,isPositive:()=>TZe,isRecord:()=>Kx,isSet:()=>yZe,isString:()=>wE,isTuple:()=>Vx,isUUID4:()=>MZe,isUnknown:()=>wU,isUpperCase:()=>LZe,makeTrait:()=>yne,makeValidator:()=>Wr,matchesRegExp:()=>tB,softAssert:()=>SZe});function ti(t){return t===null?"null":t===void 0?"undefined":t===""?"an empty string":typeof t=="symbol"?`<${t.toString()}>`:Array.isArray(t)?"an array":JSON.stringify(t)}function CE(t,e){if(t.length===0)return"nothing";if(t.length===1)return ti(t[0]);let r=t.slice(0,-1),s=t[t.length-1],a=t.length>2?`, ${e} `:` ${e} `;return`${r.map(n=>ti(n)).join(", ")}${a}${ti(s)}`}function l0(t,e){var r,s,a;return typeof e=="number"?`${(r=t?.p)!==null&&r!==void 0?r:"."}[${e}]`:lZe.test(e)?`${(s=t?.p)!==null&&s!==void 0?s:""}.${e}`:`${(a=t?.p)!==null&&a!==void 0?a:"."}[${JSON.stringify(e)}]`}function CU(t,e,r){return t===1?e:r}function mr({errors:t,p:e}={},r){return t?.push(`${e??"."}: ${r}`),!1}function pZe(t,e){return r=>{t[e]=r}}function Yf(t,e){return r=>{let s=t[e];return t[e]=r,Yf(t,e).bind(null,s)}}function eB(t,e,r){let s=()=>(t(r()),a),a=()=>(t(e),s);return s}function wU(){return Wr({test:(t,e)=>!0})}function dne(t){return Wr({test:(e,r)=>e!==t?mr(r,`Expected ${ti(t)} (got ${ti(e)})`):!0})}function wE(){return Wr({test:(t,e)=>typeof t!="string"?mr(e,`Expected a string (got ${ti(t)})`):!0})}function Ao(t){let e=Array.isArray(t)?t:Object.values(t),r=e.every(a=>typeof a=="string"||typeof a=="number"),s=new Set(e);return s.size===1?dne([...s][0]):Wr({test:(a,n)=>s.has(a)?!0:r?mr(n,`Expected one of ${CE(e,"or")} (got ${ti(a)})`):mr(n,`Expected a valid enumeration value (got ${ti(a)})`)})}function gZe(){return Wr({test:(t,e)=>{var r;if(typeof t!="boolean"){if(typeof e?.coercions<"u"){if(typeof e?.coercion>"u")return mr(e,"Unbound coercion result");let s=hZe.get(t);if(typeof s<"u")return e.coercions.push([(r=e.p)!==null&&r!==void 0?r:".",e.coercion.bind(null,s)]),!0}return mr(e,`Expected a boolean (got ${ti(t)})`)}return!0}})}function BU(){return Wr({test:(t,e)=>{var r;if(typeof t!="number"){if(typeof e?.coercions<"u"){if(typeof e?.coercion>"u")return mr(e,"Unbound coercion result");let s;if(typeof t=="string"){let a;try{a=JSON.parse(t)}catch{}if(typeof a=="number")if(JSON.stringify(a)===t)s=a;else return mr(e,`Received a number that can't be safely represented by the runtime (${t})`)}if(typeof s<"u")return e.coercions.push([(r=e.p)!==null&&r!==void 0?r:".",e.coercion.bind(null,s)]),!0}return mr(e,`Expected a number (got ${ti(t)})`)}return!0}})}function dZe(t){return Wr({test:(e,r)=>{var s;if(typeof r?.coercions>"u")return mr(r,"The isPayload predicate can only be used with coercion enabled");if(typeof r.coercion>"u")return mr(r,"Unbound coercion result");if(typeof e!="string")return mr(r,`Expected a string (got ${ti(e)})`);let a;try{a=JSON.parse(e)}catch{return mr(r,`Expected a JSON string (got ${ti(e)})`)}let n={value:a};return t(a,Object.assign(Object.assign({},r),{coercion:Yf(n,"value")}))?(r.coercions.
2025-04-10 09:51:25 -04:00
`;for(let s of e)r+=`
2025-04-11 10:05:45 -04:00
- ${s}`}super(r)}};nB={missing:(t,e)=>t.has(e),undefined:(t,e,r)=>t.has(e)&&typeof r[e]<"u",nil:(t,e,r)=>t.has(e)&&r[e]!=null,falsy:(t,e,r)=>t.has(e)&&!!r[e]};(function(t){t.Forbids="Forbids",t.Requires="Requires"})(Wf||(Wf={}));KZe={[Wf.Forbids]:{expect:!1,message:"forbids using"},[Wf.Requires]:{expect:!0,message:"requires using"}}});var ot,u0=It(()=>{Bp();ot=class{constructor(){this.help=!1}static Usage(e){return e}async catch(e){throw e}async validateAndExecute(){let r=this.constructor.schema;if(Array.isArray(r)){let{isDict:a,isUnknown:n,applyCascade:c}=await Promise.resolve().then(()=>(Ul(),Ia)),f=c(a(n()),r),p=[],h=[];if(!f(this,{errors:p,coercions:h}))throw $2("Invalid option schema",p);for(let[,C]of h)C()}else if(r!=null)throw new Error("Invalid command schema");let s=await this.execute();return typeof s<"u"?s:0}};ot.isOption=X2;ot.Default=[]});function sl(t){mU&&console.log(t)}function Cne(){let t={nodes:[]};for(let e=0;e<En.CustomNode;++e)t.nodes.push(Hl());return t}function JZe(t){let e=Cne(),r=[],s=e.nodes.length;for(let a of t){r.push(s);for(let n=0;n<a.nodes.length;++n)Bne(n)||e.nodes.push(nXe(a.nodes[n],s));s+=a.nodes.length-En.CustomNode+1}for(let a of r)BE(e,En.InitialNode,a);return e}function Mu(t,e){return t.nodes.push(e),t.nodes.length-1}function zZe(t){let e=new Set,r=s=>{if(e.has(s))return;e.add(s);let a=t.nodes[s];for(let c of Object.values(a.statics))for(let{to:f}of c)r(f);for(let[,{to:c}]of a.dynamics)r(c);for(let{to:c}of a.shortcuts)r(c);let n=new Set(a.shortcuts.map(({to:c})=>c));for(;a.shortcuts.length>0;){let{to:c}=a.shortcuts.shift(),f=t.nodes[c];for(let[p,h]of Object.entries(f.statics)){let E=Object.prototype.hasOwnProperty.call(a.statics,p)?a.statics[p]:a.statics[p]=[];for(let C of h)E.some(({to:S})=>C.to===S)||E.push(C)}for(let[p,h]of f.dynamics)a.dynamics.some(([E,{to:C}])=>p===E&&h.to===C)||a.dynamics.push([p,h]);for(let p of f.shortcuts)n.has(p.to)||(a.shortcuts.push(p),n.add(p.to))}};r(En.InitialNode)}function ZZe(t,{prefix:e=""}={}){if(mU){sl(`${e}Nodes are:`);for(let r=0;r<t.nodes.length;++r)sl(`${e} ${r}: ${JSON.stringify(t.nodes[r])}`)}}function XZe(t,e,r=!1){sl(`Running a vm on ${JSON.stringify(e)}`);let s=[{node:En.InitialNode,state:{candidateUsage:null,requiredOptions:[],errorMessage:null,ignoreOptions:!1,options:[],path:[],positionals:[],remainder:null,selectedIndex:null,partial:!1,tokens:[]}}];ZZe(t,{prefix:" "});let a=[ei.StartOfInput,...e];for(let n=0;n<a.length;++n){let c=a[n],f=c===ei.EndOfInput||c===ei.EndOfPartialInput,p=n-1;sl(` Processing ${JSON.stringify(c)}`);let h=[];for(let{node:E,state:C}of s){sl(` Current node is ${E}`);let S=t.nodes[E];if(E===En.ErrorNode){h.push({node:E,state:C});continue}console.assert(S.shortcuts.length===0,"Shortcuts should have been eliminated by now");let P=Object.prototype.hasOwnProperty.call(S.statics,c);if(!r||n<a.length-1||P)if(P){let I=S.statics[c];for(let{to:R,reducer:N}of I)h.push({node:R,state:typeof N<"u"?zx(xU,N,C,c,p):C}),sl(` Static transition to ${R} found`)}else sl(" No static transition found");else{let I=!1;for(let R of Object.keys(S.statics))if(R.startsWith(c)){if(c===R)for(let{to:N,reducer:U}of S.statics[R])h.push({node:N,state:typeof U<"u"?zx(xU,U,C,c,p):C}),sl(` Static transition to ${N} found`);else for(let{to:N}of S.statics[R])h.push({node:N,state:{...C,remainder:R.slice(c.length)}}),sl(` Static transition to ${N} found (partial match)`);I=!0}I||sl(" No partial static transition found")}if(!f)for(let[I,{to:R,reducer:N}]of S.dynamics)zx(iXe,I,C,c,p)&&(h.push({node:R,state:typeof N<"u"?zx(xU,N,C,c,p):C}),sl(` Dynamic transition to ${R} found (via ${I})`))}if(h.length===0&&f&&e.length===1)return[{node:En.InitialNode,state:Ine}];if(h.length===0)throw new IE(e,s.filter(({node:E})=>E!==En.ErrorNode).map(({state:E})=>({usage:E.candidateUsage,reason:null})));if(h.every(({node:E})=>E===En.ErrorNode))throw new IE(e,h.map(({state:E})=>({usage:E.candidateUsage,reason:E.errorMessage})));s=eXe(h)}if(s.length>0){sl(" Results:");for(let n of s)sl(` - ${n.node} -> ${JSON.stringify(n.state)}`)}e
2025-04-10 09:51:25 -04:00
`),this.context.stdout.write(`
`);let r=0;for(let s of this.commands)this.context.stdout.write(this.cli.usage(this.contexts[s].commandClass,{prefix:`${r++}. `.padStart(5)}));this.context.stdout.write(`
`),this.context.stdout.write(`Run again with -h=<index> to see the longer details of any of those commands.
`)}}}});async function Qne(...t){let{resolvedOptions:e,resolvedCommandClasses:r,resolvedArgv:s,resolvedContext:a}=Rne(t);return wa.from(r,e).runExit(s,a)}async function Tne(...t){let{resolvedOptions:e,resolvedCommandClasses:r,resolvedArgv:s,resolvedContext:a}=Rne(t);return wa.from(r,e).run(s,a)}function Rne(t){let e,r,s,a;switch(typeof process<"u"&&typeof process.argv<"u"&&(s=process.argv.slice(2)),t.length){case 1:r=t[0];break;case 2:t[0]&&t[0].prototype instanceof ot||Array.isArray(t[0])?(r=t[0],Array.isArray(t[1])?s=t[1]:a=t[1]):(e=t[0],r=t[1]);break;case 3:Array.isArray(t[2])?(e=t[0],r=t[1],s=t[2]):t[0]&&t[0].prototype instanceof ot||Array.isArray(t[0])?(r=t[0],s=t[1],a=t[2]):(e=t[0],r=t[1],a=t[2]);break;default:e=t[0],r=t[1],s=t[2],a=t[3];break}if(typeof s>"u")throw new Error("The argv parameter must be provided when running Clipanion outside of a Node context");return{resolvedOptions:e,resolvedCommandClasses:r,resolvedArgv:s,resolvedContext:a}}function kne(t){return t()}var xne,wa,Fne=It(()=>{jx();Xx();IU();bne();u0();Pne();xne=Symbol("clipanion/errorCommand");wa=class t{constructor({binaryLabel:e,binaryName:r="...",binaryVersion:s,enableCapture:a=!1,enableColors:n}={}){this.registrations=new Map,this.builder=new Zx({binaryName:r}),this.binaryLabel=e,this.binaryName=r,this.binaryVersion=s,this.enableCapture=a,this.enableColors=n}static from(e,r={}){let s=new t(r),a=Array.isArray(e)?e:[e];for(let n of a)s.register(n);return s}register(e){var r;let s=new Map,a=new e;for(let p in a){let h=a[p];typeof h=="object"&&h!==null&&h[ot.isOption]&&s.set(p,h)}let n=this.builder.command(),c=n.cliIndex,f=(r=e.paths)!==null&&r!==void 0?r:a.paths;if(typeof f<"u")for(let p of f)n.addPath(p);this.registrations.set(e,{specs:s,builder:n,index:c});for(let[p,{definition:h}]of s.entries())h(n,p);n.setContext({commandClass:e})}process(e,r){let{input:s,context:a,partial:n}=typeof e=="object"&&Array.isArray(e)?{input:e,context:r}:e,{contexts:c,process:f}=this.builder.compile(),p=f(s,{partial:n}),h={...t.defaultContext,...a};switch(p.selectedIndex){case Od:{let E=ek.from(p,c);return E.context=h,E.tokens=p.tokens,E}default:{let{commandClass:E}=c[p.selectedIndex],C=this.registrations.get(E);if(typeof C>"u")throw new Error("Assertion failed: Expected the command class to have been registered.");let S=new E;S.context=h,S.tokens=p.tokens,S.path=p.path;try{for(let[P,{transformer:I}]of C.specs.entries())S[P]=I(C.builder,P,p,h);return S}catch(P){throw P[xne]=S,P}}break}}async run(e,r){var s,a;let n,c={...t.defaultContext,...r},f=(s=this.enableColors)!==null&&s!==void 0?s:c.colorDepth>1;if(!Array.isArray(e))n=e;else try{n=this.process(e,c)}catch(E){return c.stdout.write(this.error(E,{colored:f})),1}if(n.help)return c.stdout.write(this.usage(n,{colored:f,detailed:!0})),0;n.context=c,n.cli={binaryLabel:this.binaryLabel,binaryName:this.binaryName,binaryVersion:this.binaryVersion,enableCapture:this.enableCapture,enableColors:this.enableColors,definitions:()=>this.definitions(),definition:E=>this.definition(E),error:(E,C)=>this.error(E,C),format:E=>this.format(E),process:(E,C)=>this.process(E,{...c,...C}),run:(E,C)=>this.run(E,{...c,...C}),usage:(E,C)=>this.usage(E,C)};let p=this.enableCapture&&(a=Dne(c))!==null&&a!==void 0?a:kne,h;try{h=await p(()=>n.validateAndExecute().catch(E=>n.catch(E).then(()=>0)))}catch(E){return c.stdout.write(this.error(E,{colored:f,command:n})),1}return h}async runExit(e,r){process.exitCode=await this.run(e,r)}definition(e,{colored:r=!1}={}){if(!e.usage)return null;let{usage:s}=this.getUsageByRegistration(e,{detailed:!1}),{usage:a,options:n}=this.getUsageByRegistration(e,{detailed:!0,inlineOptions:!1}),c=typeof e.usage.category<"u"?qo(e.usage.category,{format:this.format(r),paragraphs:!1}):void 0,f=typeof e.usage.description<"u"?qo(e.usage.description,{format:this.format(r),paragraphs:!1}):void 0,p=typeof e.usage.details<"u"?qo(e.usage.details,{format:this.format(r),paragraphs:!0}):void 0,h=typeof e.usage.examples<"u"?e.usage.examples.map(([E,C])=>[qo(E,{format:this.format(r),paragraphs:!1}),C.replace(/\$0/g,this.binaryName)]):
`),(h!==""||E.length>0)&&(f+=`${this.format(r).header("Usage")}
`,f+=`
`);let{usage:C,options:S}=this.getUsageByRegistration(c,{inlineOptions:!1});if(f+=`${this.format(r).bold(a)}${C}
`,S.length>0){f+=`
`,f+=`${this.format(r).header("Options")}
`;let P=S.reduce((I,R)=>Math.max(I,R.definition.length),0);f+=`
`;for(let{definition:I,description:R}of S)f+=` ${this.format(r).bold(I.padEnd(P))} ${qo(R,{format:this.format(r),paragraphs:!1})}`}if(h!==""&&(f+=`
`,f+=`${this.format(r).header("Details")}
`,f+=`
`,f+=qo(h,{format:this.format(r),paragraphs:!0})),E.length>0){f+=`
`,f+=`${this.format(r).header("Examples")}
`;for(let[P,I]of E)f+=`
`,f+=qo(P,{format:this.format(r),paragraphs:!1}),f+=`${I.replace(/^/m,` ${this.format(r).bold(a)}`).replace(/\$0/g,this.binaryName)}
`}}else{let{usage:p}=this.getUsageByRegistration(c);f+=`${this.format(r).bold(a)}${p}
`}else{let p=new Map;for(let[S,{index:P}]of this.registrations.entries()){if(typeof S.usage>"u")continue;let I=typeof S.usage.category<"u"?qo(S.usage.category,{format:this.format(r),paragraphs:!1}):null,R=p.get(I);typeof R>"u"&&p.set(I,R=[]);let{usage:N}=this.getUsageByIndex(P);R.push({commandClass:S,usage:N})}let h=Array.from(p.keys()).sort((S,P)=>S===null?-1:P===null?1:S.localeCompare(P,"en",{usage:"sort",caseFirst:"upper"})),E=typeof this.binaryLabel<"u",C=typeof this.binaryVersion<"u";E||C?(E&&C?f+=`${this.format(r).header(`${this.binaryLabel} - ${this.binaryVersion}`)}
`:E?f+=`${this.format(r).header(`${this.binaryLabel}`)}
`:f+=`${this.format(r).header(`${this.binaryVersion}`)}
`,f+=` ${this.format(r).bold(a)}${this.binaryName} <command>
`):f+=`${this.format(r).bold(a)}${this.binaryName} <command>
`;for(let S of h){let P=p.get(S).slice().sort((R,N)=>R.usage.localeCompare(N.usage,"en",{usage:"sort",caseFirst:"upper"})),I=S!==null?S.trim():"General commands";f+=`
`,f+=`${this.format(r).header(`${I}`)}
`;for(let{commandClass:R,usage:N}of P){let U=R.usage.description||"undocumented";f+=`
`,f+=` ${this.format(r).bold(N)}
`,f+=` ${qo(U,{format:this.format(r),paragraphs:!1})}`}}f+=`
`,f+=qo("You can also print more details about any of these commands by calling them with the `-h,--help` flag right after the command name.",{format:this.format(r),paragraphs:!0})}return f}error(e,r){var s,{colored:a,command:n=(s=e[xne])!==null&&s!==void 0?s:null}=r===void 0?{}:r;(!e||typeof e!="object"||!("stack"in e))&&(e=new Error(`Execution failed with a non-error rejection (rejected value: ${JSON.stringify(e)})`));let c="",f=e.name.replace(/([a-z])([A-Z])/g,"$1 $2");f==="Error"&&(f="Internal Error"),c+=`${this.format(a).error(f)}: ${e.message}
`;let p=e.clipanion;return typeof p<"u"?p.type==="usage"&&(c+=`
`,c+=this.usage(n)):e.stack&&(c+=`${e.stack.replace(/^.*\n/,"")}
`),c}format(e){var r;return((r=e??this.enableColors)!==null&&r!==void 0?r:t.defaultContext.colorDepth>1)?pne:hne}getUsageByRegistration(e,r){let s=this.registrations.get(e);if(typeof s>"u")throw new Error("Assertion failed: Unregistered command");return this.getUsageByIndex(s.index,r)}getUsageByIndex(e,r){return this.builder.getBuilderByIndex(e).usage(r)}};wa.defaultContext={env:process.env,stdin:process.stdin,stdout:process.stdout,stderr:process.stderr,colorDepth:Sne()}});var sB,Nne=It(()=>{u0();sB=class extends ot{async execute(){this.context.stdout.write(`${JSON.stringify(this.cli.definitions(),null,2)}
`)}};sB.paths=[["--clipanion=definitions"]]});var oB,One=It(()=>{u0();oB=class extends ot{async execute(){this.context.stdout.write(this.cli.usage())}};oB.paths=[["-h"],["--help"]]});function tk(t={}){return Ea({definition(e,r){var s;e.addProxy({name:(s=t.name)!==null&&s!==void 0?s:r,required:t.required})},transformer(e,r,s){return s.positionals.map(({value:a})=>a)}})}var QU=It(()=>{Bp()});var aB,Lne=It(()=>{u0();QU();aB=class extends ot{constructor(){super(...arguments),this.args=tk()}async execute(){this.context.stdout.write(`${JSON.stringify(this.cli.process(this.args).tokens,null,2)}
`)}};aB.paths=[["--clipanion=tokens"]]});var lB,Mne=It(()=>{u0();lB=class extends ot{async execute(){var e;this.context.stdout.write(`${(e=this.cli.binaryVersion)!==null&&e!==void 0?e:"<unknown>"}
2025-04-11 10:05:45 -04:00
`)}};lB.paths=[["-v"],["--version"]]});var TU={};Vt(TU,{DefinitionsCommand:()=>sB,HelpCommand:()=>oB,TokensCommand:()=>aB,VersionCommand:()=>lB});var _ne=It(()=>{Nne();One();Lne();Mne()});function Une(t,e,r){let[s,a]=Gf(e,r??{}),{arity:n=1}=a,c=t.split(","),f=new Set(c);return Ea({definition(p){p.addOption({names:c,arity:n,hidden:a?.hidden,description:a?.description,required:a.required})},transformer(p,h,E){let C,S=typeof s<"u"?[...s]:void 0;for(let{name:P,value:I}of E.options)f.has(P)&&(C=P,S=S??[],S.push(I));return typeof S<"u"?Ld(C??h,S,a.validator):S}})}var Hne=It(()=>{Bp()});function jne(t,e,r){let[s,a]=Gf(e,r??{}),n=t.split(","),c=new Set(n);return Ea({definition(f){f.addOption({names:n,allowBinding:!1,arity:0,hidden:a.hidden,description:a.description,required:a.required})},transformer(f,p,h){let E=s;for(let{name:C,value:S}of h.options)c.has(C)&&(E=S);return E}})}var qne=It(()=>{Bp()});function Gne(t,e,r){let[s,a]=Gf(e,r??{}),n=t.split(","),c=new Set(n);return Ea({definition(f){f.addOption({names:n,allowBinding:!1,arity:0,hidden:a.hidden,description:a.description,required:a.required})},transformer(f,p,h){let E=s;for(let{name:C,value:S}of h.options)c.has(C)&&(E??(E=0),S?E+=1:E=0);return E}})}var Wne=It(()=>{Bp()});function Yne(t={}){return Ea({definition(e,r){var s;e.addRest({name:(s=t.name)!==null&&s!==void 0?s:r,required:t.required})},transformer(e,r,s){let a=c=>{let f=s.positionals[c];return f.extra===jl||f.extra===!1&&c<e.arity.leading.length},n=0;for(;n<s.positionals.length&&a(n);)n+=1;return s.positionals.splice(0,n).map(({value:c})=>c)}})}var Vne=It(()=>{Xx();Bp()});function sXe(t,e,r){let[s,a]=Gf(e,r??{}),{arity:n=1}=a,c=t.split(","),f=new Set(c);return Ea({definition(p){p.addOption({names:c,arity:a.tolerateBoolean?0:n,hidden:a.hidden,description:a.description,required:a.required})},transformer(p,h,E,C){let S,P=s;typeof a.env<"u"&&C.env[a.env]&&(S=a.env,P=C.env[a.env]);for(let{name:I,value:R}of E.options)f.has(I)&&(S=I,P=R);return typeof P=="string"?Ld(S??h,P,a.validator):P}})}function oXe(t={}){let{required:e=!0}=t;return Ea({definition(r,s){var a;r.addPositional({name:(a=t.name)!==null&&a!==void 0?a:s,required:t.required})},transformer(r,s,a){var n;for(let c=0;c<a.positionals.length;++c){if(a.positionals[c].extra===jl||e&&a.positionals[c].extra===!0||!e&&a.positionals[c].extra===!1)continue;let[f]=a.positionals.splice(c,1);return Ld((n=t.name)!==null&&n!==void 0?n:s,f.value,t.validator)}}})}function Kne(t,...e){return typeof t=="string"?sXe(t,...e):oXe(t)}var Jne=It(()=>{Xx();Bp()});var ge={};Vt(ge,{Array:()=>Une,Boolean:()=>jne,Counter:()=>Gne,Proxy:()=>tk,Rest:()=>Yne,String:()=>Kne,applyValidator:()=>Ld,cleanValidationError:()=>Wx,formatError:()=>$2,isOptionSymbol:()=>X2,makeCommandOption:()=>Ea,rerouteArguments:()=>Gf});var zne=It(()=>{Bp();QU();Hne();qne();Wne();Vne();Jne()});var cB={};Vt(cB,{Builtins:()=>TU,Cli:()=>wa,Command:()=>ot,Option:()=>ge,UsageError:()=>nt,formatMarkdownish:()=>qo,run:()=>Tne,runExit:()=>Qne});var Wt=It(()=>{Gx();IU();u0();Fne();_ne();zne()});var Zne=L((RWt,aXe)=>{aXe.exports={name:"dotenv",version:"16.3.1",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard","lint-readme":"standard-markdown",pretest:"npm run lint && npm run dts-check",test:"tap tests/*.js --100 -Rspec",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},funding:"https://github.com/motdotla/dotenv?sponsor=1",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@definitelytyped/dtslint
2025-04-10 09:51:25 -04:00
`);let s;for(;(s=fXe.exec(r))!=null;){let a=s[1],n=s[2]||"";n=n.trim();let c=n[0];n=n.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),c==='"'&&(n=n.replace(/\\n/g,`
2025-04-11 10:05:45 -04:00
`),n=n.replace(/\\r/g,"\r")),e[a]=n}return e}function pXe(t){let e=eie(t),r=qs.configDotenv({path:e});if(!r.parsed)throw new Error(`MISSING_DATA: Cannot parse ${e} for an unknown reason`);let s=$ne(t).split(","),a=s.length,n;for(let c=0;c<a;c++)try{let f=s[c].trim(),p=dXe(r,f);n=qs.decrypt(p.ciphertext,p.key);break}catch(f){if(c+1>=a)throw f}return qs.parse(n)}function hXe(t){console.log(`[dotenv@${NU}][INFO] ${t}`)}function gXe(t){console.log(`[dotenv@${NU}][WARN] ${t}`)}function RU(t){console.log(`[dotenv@${NU}][DEBUG] ${t}`)}function $ne(t){return t&&t.DOTENV_KEY&&t.DOTENV_KEY.length>0?t.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function dXe(t,e){let r;try{r=new URL(e)}catch(f){throw f.code==="ERR_INVALID_URL"?new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=development"):f}let s=r.password;if(!s)throw new Error("INVALID_DOTENV_KEY: Missing key part");let a=r.searchParams.get("environment");if(!a)throw new Error("INVALID_DOTENV_KEY: Missing environment part");let n=`DOTENV_VAULT_${a.toUpperCase()}`,c=t.parsed[n];if(!c)throw new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${n} in your .env.vault file.`);return{ciphertext:c,key:s}}function eie(t){let e=FU.resolve(process.cwd(),".env");return t&&t.path&&t.path.length>0&&(e=t.path),e.endsWith(".vault")?e:`${e}.vault`}function mXe(t){return t[0]==="~"?FU.join(lXe.homedir(),t.slice(1)):t}function yXe(t){hXe("Loading env from encrypted .env.vault");let e=qs._parseVault(t),r=process.env;return t&&t.processEnv!=null&&(r=t.processEnv),qs.populate(r,e,t),{parsed:e}}function EXe(t){let e=FU.resolve(process.cwd(),".env"),r="utf8",s=!!(t&&t.debug);t&&(t.path!=null&&(e=mXe(t.path)),t.encoding!=null&&(r=t.encoding));try{let a=qs.parse(Xne.readFileSync(e,{encoding:r})),n=process.env;return t&&t.processEnv!=null&&(n=t.processEnv),qs.populate(n,a,t),{parsed:a}}catch(a){return s&&RU(`Failed to load ${e} ${a.message}`),{error:a}}}function IXe(t){let e=eie(t);return $ne(t).length===0?qs.configDotenv(t):Xne.existsSync(e)?qs._configVault(t):(gXe(`You set DOTENV_KEY but you are missing a .env.vault file at ${e}. Did you forget to build it?`),qs.configDotenv(t))}function CXe(t,e){let r=Buffer.from(e.slice(-64),"hex"),s=Buffer.from(t,"base64"),a=s.slice(0,12),n=s.slice(-16);s=s.slice(12,-16);try{let c=cXe.createDecipheriv("aes-256-gcm",r,a);return c.setAuthTag(n),`${c.update(s)}${c.final()}`}catch(c){let f=c instanceof RangeError,p=c.message==="Invalid key length",h=c.message==="Unsupported state or unable to authenticate data";if(f||p){let E="INVALID_DOTENV_KEY: It must be 64 characters long (or more)";throw new Error(E)}else if(h){let E="DECRYPTION_FAILED: Please check your DOTENV_KEY";throw new Error(E)}else throw console.error("Error: ",c.code),console.error("Error: ",c.message),c}}function wXe(t,e,r={}){let s=!!(r&&r.debug),a=!!(r&&r.override);if(typeof e!="object")throw new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");for(let n of Object.keys(e))Object.prototype.hasOwnProperty.call(t,n)?(a===!0&&(t[n]=e[n]),s&&RU(a===!0?`"${n}" is already defined and WAS overwritten`:`"${n}" is already defined and was NOT overwritten`)):t[n]=e[n]}var qs={configDotenv:EXe,_configVault:yXe,_parseVault:pXe,config:IXe,decrypt:CXe,parse:AXe,populate:wXe};vp.exports.configDotenv=qs.configDotenv;vp.exports._configVault=qs._configVault;vp.exports._parseVault=qs._parseVault;vp.exports.config=qs.config;vp.exports.decrypt=qs.decrypt;vp.exports.parse=qs.parse;vp.exports.populate=qs.populate;vp.exports=qs});var nie=L((NWt,rie)=>{"use strict";rie.exports=(t,...e)=>new Promise(r=>{r(t(...e))})});var Md=L((OWt,OU)=>{"use strict";var BXe=nie(),iie=t=>{if(t<1)throw new TypeError("Expected `concurrency` to be a number from 1 and up");let e=[],r=0,s=()=>{r--,e.length>0&&e.shift()()},a=(f,p,...h)=>{r++;let E=BXe(f,...h);p(E),E.then(s,s)},n=(f,p,...h)=>{r<t?a(f,p,...h):e.push(a.bind(null,f,p,...h))},c=(f,...p)=>new Promise(h=>n(
2025-04-10 09:51:25 -04:00
`,"\r","(",")","!","|","&","^"],!0,!1),ce=function($){return e.queryPattern.test($)},me=function($){return e.checkFn($)},pe=ke("whitespace"),Be=/^[ \t\n\r]/,Ce=Ne([" "," ",`
2025-04-11 10:05:45 -04:00
`,"\r"],!1,!1),g=0,we=0,Ee=[{line:1,column:1}],fe=0,se=[],X=0,De;if("startRule"in e){if(!(e.startRule in s))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');a=s[e.startRule]}function Re(){return t.substring(we,g)}function gt(){return _e(we,g)}function j($,oe){throw oe=oe!==void 0?oe:_e(we,g),b([ke($)],t.substring(we,g),oe)}function rt($,oe){throw oe=oe!==void 0?oe:_e(we,g),w($,oe)}function Fe($,oe){return{type:"literal",text:$,ignoreCase:oe}}function Ne($,oe,xe){return{type:"class",parts:$,inverted:oe,ignoreCase:xe}}function Pe(){return{type:"any"}}function Ye(){return{type:"end"}}function ke($){return{type:"other",description:$}}function it($){var oe=Ee[$],xe;if(oe)return oe;for(xe=$-1;!Ee[xe];)xe--;for(oe=Ee[xe],oe={line:oe.line,column:oe.column};xe<$;)t.charCodeAt(xe)===10?(oe.line++,oe.column=1):oe.column++,xe++;return Ee[$]=oe,oe}function _e($,oe){var xe=it($),Te=it(oe);return{start:{offset:$,line:xe.line,column:xe.column},end:{offset:oe,line:Te.line,column:Te.column}}}function x($){g<fe||(g>fe&&(fe=g,se=[]),se.push($))}function w($,oe){return new qd($,null,null,oe)}function b($,oe,xe){return new qd(qd.buildMessage($,oe),$,oe,xe)}function y(){var $,oe,xe,Te,lt,Et,qt,ir;if($=g,oe=F(),oe!==r){for(xe=[],Te=g,lt=Z(),lt!==r?(t.charCodeAt(g)===124?(Et=n,g++):(Et=r,X===0&&x(c)),Et===r&&(t.charCodeAt(g)===38?(Et=f,g++):(Et=r,X===0&&x(p)),Et===r&&(t.charCodeAt(g)===94?(Et=h,g++):(Et=r,X===0&&x(E)))),Et!==r?(qt=Z(),qt!==r?(ir=F(),ir!==r?(lt=[lt,Et,qt,ir],Te=lt):(g=Te,Te=r)):(g=Te,Te=r)):(g=Te,Te=r)):(g=Te,Te=r);Te!==r;)xe.push(Te),Te=g,lt=Z(),lt!==r?(t.charCodeAt(g)===124?(Et=n,g++):(Et=r,X===0&&x(c)),Et===r&&(t.charCodeAt(g)===38?(Et=f,g++):(Et=r,X===0&&x(p)),Et===r&&(t.charCodeAt(g)===94?(Et=h,g++):(Et=r,X===0&&x(E)))),Et!==r?(qt=Z(),qt!==r?(ir=F(),ir!==r?(lt=[lt,Et,qt,ir],Te=lt):(g=Te,Te=r)):(g=Te,Te=r)):(g=Te,Te=r)):(g=Te,Te=r);xe!==r?(we=$,oe=C(oe,xe),$=oe):(g=$,$=r)}else g=$,$=r;return $}function F(){var $,oe,xe,Te,lt,Et;return $=g,t.charCodeAt(g)===33?(oe=S,g++):(oe=r,X===0&&x(P)),oe!==r?(xe=F(),xe!==r?(we=$,oe=I(xe),$=oe):(g=$,$=r)):(g=$,$=r),$===r&&($=g,t.charCodeAt(g)===40?(oe=R,g++):(oe=r,X===0&&x(N)),oe!==r?(xe=Z(),xe!==r?(Te=y(),Te!==r?(lt=Z(),lt!==r?(t.charCodeAt(g)===41?(Et=U,g++):(Et=r,X===0&&x(W)),Et!==r?(we=$,oe=te(Te),$=oe):(g=$,$=r)):(g=$,$=r)):(g=$,$=r)):(g=$,$=r)):(g=$,$=r),$===r&&($=z())),$}function z(){var $,oe,xe,Te,lt;if($=g,oe=Z(),oe!==r){if(xe=g,Te=[],ie.test(t.charAt(g))?(lt=t.charAt(g),g++):(lt=r,X===0&&x(Ae)),lt!==r)for(;lt!==r;)Te.push(lt),ie.test(t.charAt(g))?(lt=t.charAt(g),g++):(lt=r,X===0&&x(Ae));else Te=r;Te!==r?xe=t.substring(xe,g):xe=Te,xe!==r?(we=g,Te=ce(xe),Te?Te=void 0:Te=r,Te!==r?(we=$,oe=me(xe),$=oe):(g=$,$=r)):(g=$,$=r)}else g=$,$=r;return $}function Z(){var $,oe;for(X++,$=[],Be.test(t.charAt(g))?(oe=t.charAt(g),g++):(oe=r,X===0&&x(Ce));oe!==r;)$.push(oe),Be.test(t.charAt(g))?(oe=t.charAt(g),g++):(oe=r,X===0&&x(Ce));return X--,$===r&&(oe=r,X===0&&x(pe)),$}if(De=a(),De!==r&&g===t.length)return De;throw De!==r&&g<t.length&&x(Ye()),b(se,fe<t.length?t.charAt(fe):null,fe<t.length?_e(fe,fe+1):_e(fe,fe))}toe.exports={SyntaxError:qd,parse:vtt}});var noe=L(dk=>{var{parse:Stt}=roe();dk.makeParser=(t=/[a-z]+/)=>(e,r)=>Stt(e,{queryPattern:t,checkFn:r});dk.parse=dk.makeParser()});var soe=L((TYt,ioe)=>{"use strict";ioe.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagr
2025-04-10 09:51:25 -04:00
`:`
`)+r,a=s+1,s=t.indexOf(`
2025-04-11 10:05:45 -04:00
`,a)}while(s!==-1);return n+=t.substr(a),n};Coe.exports={stringReplaceAll:Mtt,stringEncaseCRLFWithFirstIndex:_tt}});var boe=L((UYt,Doe)=>{"use strict";var Utt=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,Boe=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,Htt=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,jtt=/\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.)|([^\\])/gi,qtt=new Map([["n",`
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function Soe(t){let e=t[0]==="u",r=t[1]==="{";return e&&!r&&t.length===5||t[0]==="x"&&t.length===3?String.fromCharCode(parseInt(t.slice(1),16)):e&&r?String.fromCodePoint(parseInt(t.slice(2,-1),16)):qtt.get(t)||t}function Gtt(t,e){let r=[],s=e.trim().split(/\s*,\s*/g),a;for(let n of s){let c=Number(n);if(!Number.isNaN(c))r.push(c);else if(a=n.match(Htt))r.push(a[2].replace(jtt,(f,p,h)=>p?Soe(p):h));else throw new Error(`Invalid Chalk template style argument: ${n} (in style '${t}')`)}return r}function Wtt(t){Boe.lastIndex=0;let e=[],r;for(;(r=Boe.exec(t))!==null;){let s=r[1];if(r[2]){let a=Gtt(s,r[2]);e.push([s].concat(a))}else e.push([s])}return e}function voe(t,e){let r={};for(let a of e)for(let n of a.styles)r[n[0]]=a.inverse?null:n.slice(1);let s=t;for(let[a,n]of Object.entries(r))if(Array.isArray(n)){if(!(a in s))throw new Error(`Unknown Chalk style: ${a}`);s=n.length>0?s[a](...n):s[a]}return s}Doe.exports=(t,e)=>{let r=[],s=[],a=[];if(e.replace(Utt,(n,c,f,p,h,E)=>{if(c)a.push(Soe(c));else if(p){let C=a.join("");a=[],s.push(r.length===0?C:voe(t,r)(C)),r.push({inverse:f,styles:Wtt(p)})}else if(h){if(r.length===0)throw new Error("Found extraneous } in Chalk template literal");s.push(voe(t,r)(a.join(""))),a=[],r.pop()}else a.push(E)}),s.push(a.join("")),r.length>0){let n=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(n)}return s.join("")}});var g4=L((HYt,Qoe)=>{"use strict";var CB=IB(),{stdout:f4,stderr:A4}=c4(),{stringReplaceAll:Ytt,stringEncaseCRLFWithFirstIndex:Vtt}=woe(),Poe=["ansi","ansi","ansi256","ansi16m"],QE=Object.create(null),Ktt=(t,e={})=>{if(e.level>3||e.level<0)throw new Error("The `level` option should be an integer from 0 to 3");let r=f4?f4.level:0;t.level=e.level===void 0?r:e.level},p4=class{constructor(e){return xoe(e)}},xoe=t=>{let e={};return Ktt(e,t),e.template=(...r)=>Ztt(e.template,...r),Object.setPrototypeOf(e,Ek.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},e.template.Instance=p4,e.template};function Ek(t){return xoe(t)}for(let[t,e]of Object.entries(CB))QE[t]={get(){let r=Ik(this,h4(e.open,e.close,this._styler),this._isEmpty);return Object.defineProperty(this,t,{value:r}),r}};QE.visible={get(){let t=Ik(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:t}),t}};var koe=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let t of koe)QE[t]={get(){let{level:e}=this;return function(...r){let s=h4(CB.color[Poe[e]][t](...r),CB.color.close,this._styler);return Ik(this,s,this._isEmpty)}}};for(let t of koe){let e="bg"+t[0].toUpperCase()+t.slice(1);QE[e]={get(){let{level:r}=this;return function(...s){let a=h4(CB.bgColor[Poe[r]][t](...s),CB.bgColor.close,this._styler);return Ik(this,a,this._isEmpty)}}}}var Jtt=Object.defineProperties(()=>{},{...QE,level:{enumerable:!0,get(){return this._generator.level},set(t){this._generator.level=t}}}),h4=(t,e,r)=>{let s,a;return r===void 0?(s=t,a=e):(s=r.openAll+t,a=e+r.closeAll),{open:t,close:e,openAll:s,closeAll:a,parent:r}},Ik=(t,e,r)=>{let s=(...a)=>ztt(s,a.length===1?""+a[0]:a.join(" "));return s.__proto__=Jtt,s._generator=t,s._styler=e,s._isEmpty=r,s},ztt=(t,e)=>{if(t.level<=0||!e)return t._isEmpty?"":e;let r=t._styler;if(r===void 0)return e;let{openAll:s,closeAll:a}=r;if(e.indexOf("\x1B")!==-1)for(;r!==void 0;)e=Ytt(e,r.close,r.open),r=r.parent;let n=e.indexOf(`
`);return n!==-1&&(e=Vtt(e,a,s,n)),s+e+a},u4,Ztt=(t,...e)=>{let[r]=e;if(!Array.isArray(r))return e.join(" ");let s=e.slice(1),a=[r.raw[0]];for(let n=1;n<r.length;n++)a.push(String(s[n-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[n]));return u4===void 0&&(u4=boe()),u4(t,a.join(""))};Object.defineProperties(Ek.prototype,QE);var wB=Ek();wB.supportsColor=f4;wB.stderr=Ek({level:A4?A4.level:0});wB.stderr.supportsColor=A4;wB.Level={None:0,Basic:1,Ansi256:2,TrueColor:3,0:"None",1:"Basic",2:"Ansi256",3:"TrueColor"};Qoe.exports=wB});var Ck=L(bc=>{"use strict";bc.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;bc.find=(t,e)=>t.nodes.find(r=>r.type===e);bc.exceedsLimit=(t,e,r=1,s)=>s===!1||!bc.isInteger(t)||!bc.isInteger(e)?!1:(Number(e)-Number(t))/Number(r)>=s;bc.escapeNode=(t,e=0,r)=>{let s=t.nodes[e];s&&(r&&s.type===r||s.type==="open"||s.type==="close")&&s.escaped!==!0&&(s.value="\\"+s.value,s.escaped=!0)};bc.encloseBrace=t=>t.type!=="brace"||t.commas>>0+t.ranges>>0?!1:(t.invalid=!0,!0);bc.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:!(t.commas>>0+t.ranges>>0)||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1;bc.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0;bc.reduce=t=>t.reduce((e,r)=>(r.type==="text"&&e.push(r.value),r.type==="range"&&(r.type="text"),e),[]);bc.flatten=(...t)=>{let e=[],r=s=>{for(let a=0;a<s.length;a++){let n=s[a];Array.isArray(n)?r(n,e):n!==void 0&&e.push(n)}return e};return r(t),e}});var wk=L((qYt,Roe)=>{"use strict";var Toe=Ck();Roe.exports=(t,e={})=>{let r=(s,a={})=>{let n=e.escapeInvalid&&Toe.isInvalidBrace(a),c=s.invalid===!0&&e.escapeInvalid===!0,f="";if(s.value)return(n||c)&&Toe.isOpenOrClose(s)?"\\"+s.value:s.value;if(s.value)return s.value;if(s.nodes)for(let p of s.nodes)f+=r(p);return f};return r(t)}});var Noe=L((GYt,Foe)=>{"use strict";Foe.exports=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1}});var Goe=L((WYt,qoe)=>{"use strict";var Ooe=Noe(),Gd=(t,e,r)=>{if(Ooe(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(Ooe(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let s={relaxZeros:!0,...r};typeof s.strictZeros=="boolean"&&(s.relaxZeros=s.strictZeros===!1);let a=String(s.relaxZeros),n=String(s.shorthand),c=String(s.capture),f=String(s.wrap),p=t+":"+e+"="+a+n+c+f;if(Gd.cache.hasOwnProperty(p))return Gd.cache[p].result;let h=Math.min(t,e),E=Math.max(t,e);if(Math.abs(h-E)===1){let R=t+"|"+e;return s.capture?`(${R})`:s.wrap===!1?R:`(?:${R})`}let C=joe(t)||joe(e),S={min:t,max:e,a:h,b:E},P=[],I=[];if(C&&(S.isPadded=C,S.maxLen=String(S.max).length),h<0){let R=E<0?Math.abs(E):1;I=Loe(R,Math.abs(h),S,s),h=S.a=0}return E>=0&&(P=Loe(h,E,S,s)),S.negatives=I,S.positives=P,S.result=Xtt(I,P,s),s.capture===!0?S.result=`(${S.result})`:s.wrap!==!1&&P.length+I.length>1&&(S.result=`(?:${S.result})`),Gd.cache[p]=S,S.result};function Xtt(t,e,r){let s=d4(t,e,"-",!1,r)||[],a=d4(e,t,"",!1,r)||[],n=d4(t,e,"-?",!0,r)||[];return s.concat(n).concat(a).join("|")}function $tt(t,e){let r=1,s=1,a=_oe(t,r),n=new Set([e]);for(;t<=a&&a<=e;)n.add(a),r+=1,a=_oe(t,r);for(a=Uoe(e+1,s)-1;t<a&&a<=e;)n.add(a),s+=1,a=Uoe(e+1,s)-1;return n=[...n],n.sort(rrt),n}function ert(t,e,r){if(t===e)return{pattern:t,count:[],digits:0};let s=trt(t,e),a=s.length,n="",c=0;for(let f=0;f<a;f++){let[p,h]=s[f];p===h?n+=p:p!=="0"||h!=="9"?n+=nrt(p,h,r):c++}return c&&(n+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:n,count:[c],digits:a}}function Loe(t,e,r,s){let a=$tt(t,e),n=[],c=t,f;for(let p=0;p<a.length;p++){let h=a[p],E=ert(String(c),String(h),s),C="";if(!r.isPadded&&f&&f.pattern===E.pattern){f.count.length>1&&f.count.pop(),f.count.push(E.count[0]),f.string=f.pattern+Hoe(f.count),c=h+1;continue}r.isPadded&&(C=irt(h,r,s)),E.string=C+E.pattern+Hoe(E.count),n.push(E),c=h+1,f=E}return n}function d4(t,e,r,s,a){let n=[];for(let c of t){let{string:f}
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var fae=L((zYt,uae)=>{"use strict";var mrt=wk(),{MAX_LENGTH:aae,CHAR_BACKSLASH:I4,CHAR_BACKTICK:yrt,CHAR_COMMA:Ert,CHAR_DOT:Irt,CHAR_LEFT_PARENTHESES:Crt,CHAR_RIGHT_PARENTHESES:wrt,CHAR_LEFT_CURLY_BRACE:Brt,CHAR_RIGHT_CURLY_BRACE:vrt,CHAR_LEFT_SQUARE_BRACKET:lae,CHAR_RIGHT_SQUARE_BRACKET:cae,CHAR_DOUBLE_QUOTE:Srt,CHAR_SINGLE_QUOTE:Drt,CHAR_NO_BREAK_SPACE:brt,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Prt}=oae(),xrt=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},s=typeof r.maxLength=="number"?Math.min(aae,r.maxLength):aae;if(t.length>s)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${s})`);let a={type:"root",input:t,nodes:[]},n=[a],c=a,f=a,p=0,h=t.length,E=0,C=0,S,P={},I=()=>t[E++],R=N=>{if(N.type==="text"&&f.type==="dot"&&(f.type="text"),f&&f.type==="text"&&N.type==="text"){f.value+=N.value;return}return c.nodes.push(N),N.parent=c,N.prev=f,f=N,N};for(R({type:"bos"});E<h;)if(c=n[n.length-1],S=I(),!(S===Prt||S===brt)){if(S===I4){R({type:"text",value:(e.keepEscaping?S:"")+I()});continue}if(S===cae){R({type:"text",value:"\\"+S});continue}if(S===lae){p++;let N=!0,U;for(;E<h&&(U=I());){if(S+=U,U===lae){p++;continue}if(U===I4){S+=I();continue}if(U===cae&&(p--,p===0))break}R({type:"text",value:S});continue}if(S===Crt){c=R({type:"paren",nodes:[]}),n.push(c),R({type:"text",value:S});continue}if(S===wrt){if(c.type!=="paren"){R({type:"text",value:S});continue}c=n.pop(),R({type:"text",value:S}),c=n[n.length-1];continue}if(S===Srt||S===Drt||S===yrt){let N=S,U;for(e.keepQuotes!==!0&&(S="");E<h&&(U=I());){if(U===I4){S+=U+I();continue}if(U===N){e.keepQuotes===!0&&(S+=U);break}S+=U}R({type:"text",value:S});continue}if(S===Brt){C++;let U={type:"brace",open:!0,close:!1,dollar:f.value&&f.value.slice(-1)==="$"||c.dollar===!0,depth:C,commas:0,ranges:0,nodes:[]};c=R(U),n.push(c),R({type:"open",value:S});continue}if(S===vrt){if(c.type!=="brace"){R({type:"text",value:S});continue}let N="close";c=n.pop(),c.close=!0,R({type:N,value:S}),C--,c=n[n.length-1];continue}if(S===Ert&&C>0){if(c.ranges>0){c.ranges=0;let N=c.nodes.shift();c.nodes=[N,{type:"text",value:mrt(c)}]}R({type:"comma",value:S}),c.commas++;continue}if(S===Irt&&C>0&&c.commas===0){let N=c.nodes;if(C===0||N.length===0){R({type:"text",value:S});continue}if(f.type==="dot"){if(c.range=[],f.value+=S,f.type="range",c.nodes.length!==3&&c.nodes.length!==5){c.invalid=!0,c.ranges=0,f.type="text";continue}c.ranges++,c.args=[];continue}if(f.type==="range"){N.pop();let U=N[N.length-1];U.value+=f.value+S,f=U,c.ranges--;continue}R({type:"dot",value:S});continue}R({type:"text",value:S})}do if(c=n.pop(),c.type!=="root"){c.nodes.forEach(W=>{W.nodes||(W.type==="open"&&(W.isOpen=!0),W.type==="close"&&(W.isClose=!0),W.nodes||(W.type="text"),W.invalid=!0)});let N=n[n.length-1],U=N.nodes.indexOf(c);N.nodes.splice(U,1,...c.nodes)}while(n.length>0);return R({type:"eos"}),a};uae.exports=xrt});var hae=L((ZYt,pae)=>{"use strict";var Aae=wk(),krt=tae(),Qrt=iae(),Trt=fae(),ql=(t,e={})=>{let r=[];if(Array.isArray(t))for(let s of t){let a=ql.create(s,e);Array.isArray(a)?r.push(...a):r.push(a)}else r=[].concat(ql.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};ql.parse=(t,e={})=>Trt(t,e);ql.stringify=(t,e={})=>Aae(typeof t=="string"?ql.parse(t,e):t,e);ql.compile=(t,e={})=>(typeof t=="string"&&(t=ql.parse(t,e)),krt(t,e));ql.expand=(t,e={})=>{typeof t=="string"&&(t=ql.parse(t,e));let r=Qrt(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};ql.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?ql.compile(t,e):ql.expand(t,e);pae.exports=ql});var vB=L((XYt,Eae)=>{"use strict";var Rrt=ye("path"),Kf="\\\\/",gae=`[^${Kf}]`,Pp="\\.",Frt="\\+",Nrt="\\?",vk="\\/",Ort="(?=.)",dae="[^/]",C4=`(
`),f!==-1){let p=a+c.substring(0,f);c=c.substring(f+1),a="",e!==null?this.reportInfo(null,`${e} ${p}`):this.reportInfo(null,p)}while(f!==-1);a+=c}),r.on("end",()=>{let n=s.end();n!==""&&(e!==null?this.reportInfo(null,`${e} ${n}`):this.reportInfo(null,n))}),r}}});var lI,nH=It(()=>{Fc();Yo();lI=class{constructor(e){this.fetchers=e}supports(e,r){return!!this.tryFetcher(e,r)}getLocalPath(e,r){return this.getFetcher(e,r).getLocalPath(e,r)}async fetch(e,r){return await this.getFetcher(e,r).fetch(e,r)}tryFetcher(e,r){let s=this.fetchers.find(a=>a.supports(e,r));return s||null}getFetcher(e,r){let s=this.fetchers.find(a=>a.supports(e,r));if(!s)throw new Yt(11,`${Yr(r.project.configuration,e)} isn't supported by any available fetcher`);return s}}});var rm,iH=It(()=>{Yo();rm=class{constructor(e){this.resolvers=e.filter(r=>r)}supportsDescriptor(e,r){return!!this.tryResolverByDescriptor(e,r)}supportsLocator(e,r){return!!this.tryResolverByLocator(e,r)}shouldPersistResolution(e,r){return this.getResolverByLocator(e,r).shouldPersistResolution(e,r)}bindDescriptor(e,r,s){return this.getResolverByDescriptor(e,s).bindDescriptor(e,r,s)}getResolutionDependencies(e,r){return this.getResolverByDescriptor(e,r).getResolutionDependencies(e,r)}async getCandidates(e,r,s){return await this.getResolverByDescriptor(e,s).getCandidates(e,r,s)}async getSatisfying(e,r,s,a){return this.getResolverByDescriptor(e,a).getSatisfying(e,r,s,a)}async resolve(e,r){return await this.getResolverByLocator(e,r).resolve(e,r)}tryResolverByDescriptor(e,r){let s=this.resolvers.find(a=>a.supportsDescriptor(e,r));return s||null}getResolverByDescriptor(e,r){let s=this.resolvers.find(a=>a.supportsDescriptor(e,r));if(!s)throw new Error(`${ri(r.project.configuration,e)} isn't supported by any available resolver`);return s}tryResolverByLocator(e,r){let s=this.resolvers.find(a=>a.supportsLocator(e,r));return s||null}getResolverByLocator(e,r){let s=this.resolvers.find(a=>a.supportsLocator(e,r));if(!s)throw new Error(`${Yr(r.project.configuration,e)} isn't supported by any available resolver`);return s}}});var cI,sH=It(()=>{bt();Yo();cI=class{supports(e){return!!e.reference.startsWith("virtual:")}getLocalPath(e,r){let s=e.reference.indexOf("#");if(s===-1)throw new Error("Invalid virtual package reference");let a=e.reference.slice(s+1),n=Ys(e,a);return r.fetcher.getLocalPath(n,r)}async fetch(e,r){let s=e.reference.indexOf("#");if(s===-1)throw new Error("Invalid virtual package reference");let a=e.reference.slice(s+1),n=Ys(e,a),c=await r.fetcher.fetch(n,r);return await this.ensureVirtualLink(e,c,r)}getLocatorFilename(e){return nI(e)}async ensureVirtualLink(e,r,s){let a=r.packageFs.getRealPath(),n=s.project.configuration.get("virtualFolder"),c=this.getLocatorFilename(e),f=fo.makeVirtualPath(n,c,a),p=new Hf(f,{baseFs:r.packageFs,pathUtils:K});return{...r,packageFs:p}}}});var FQ,Hhe=It(()=>{FQ=class t{static{this.protocol="virtual:"}static isVirtualDescriptor(e){return!!e.range.startsWith(t.protocol)}static isVirtualLocator(e){return!!e.reference.startsWith(t.protocol)}supportsDescriptor(e,r){return t.isVirtualDescriptor(e)}supportsLocator(e,r){return t.isVirtualLocator(e)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,s){throw new Error('Assertion failed: calling "bindDescriptor" on a virtual descriptor is unsupported')}getResolutionDependencies(e,r){throw new Error('Assertion failed: calling "getResolutionDependencies" on a virtual descriptor is unsupported')}async getCandidates(e,r,s){throw new Error('Assertion failed: calling "getCandidates" on a virtual descriptor is unsupported')}async getSatisfying(e,r,s,a){throw new Error('Assertion failed: calling "getSatisfying" on a virtual descriptor is unsupported')}async resolve(e,r){throw new Error('Assertion failed: calling "resolve" on a virtual locator is unsupported')}}});var uI,oH=It(()=>{bt();tm();uI=class{supports(e){return!!e.reference.startsWith(yi.protocol)}getLocalPath(e,r){return this.getWorkspace(e,r).cwd}async fetch(e,r){let s=this.getWorkspace(e,r).cwd;return{packageFs:new Sn(s),prefixPath:vt.dot,localPath:s}}getWo
`,C.message,C.stack);var S=new Error("tunneling socket could not be established, cause="+C.message);S.code="ECONNRESET",e.request.emit("error",S),s.removeSocket(a)}};Op.prototype.removeSocket=function(e){var r=this.sockets.indexOf(e);if(r!==-1){this.sockets.splice(r,1);var s=this.requests.shift();s&&this.createSocket(s,function(a){s.request.onSocket(a)})}};function Khe(t,e){var r=this;Op.prototype.createSocket.call(r,t,function(s){var a=t.request.getHeader("host"),n=dH({},r.options,{socket:s,servername:a?a.replace(/:.*$/,""):t.host}),c=qht.connect(0,n);r.sockets[r.sockets.indexOf(s)]=c,e(c)})}function Jhe(t,e,r){return typeof t=="string"?{host:t,port:e,localAddress:r}:t}function dH(t){for(var e=1,r=arguments.length;e<r;++e){var s=arguments[e];if(typeof s=="object")for(var a=Object.keys(s),n=0,c=a.length;n<c;++n){var f=a[n];s[f]!==void 0&&(t[f]=s[f])}}return t}var w0;process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?w0=function(){var t=Array.prototype.slice.call(arguments);typeof t[0]=="string"?t[0]="TUNNEL: "+t[0]:t.unshift("TUNNEL:"),console.error.apply(console,t)}:w0=function(){};pI.debug=w0});var Xhe=L((pzt,Zhe)=>{Zhe.exports=zhe()});var Mp=L((Lp,MQ)=>{"use strict";Object.defineProperty(Lp,"__esModule",{value:!0});var $he=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function zht(t){return $he.includes(t)}var Zht=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Blob","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement",...$he];function Xht(t){return Zht.includes(t)}var $ht=["null","undefined","string","number","bigint","boolean","symbol"];function e0t(t){return $ht.includes(t)}function hI(t){return e=>typeof e===t}var{toString:e0e}=Object.prototype,ov=t=>{let e=e0e.call(t).slice(8,-1);if(/HTML\w+Element/.test(e)&&be.domElement(t))return"HTMLElement";if(Xht(e))return e},Ai=t=>e=>ov(e)===t;function be(t){if(t===null)return"null";switch(typeof t){case"undefined":return"undefined";case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"function":return"Function";case"bigint":return"bigint";case"symbol":return"symbol";default:}if(be.observable(t))return"Observable";if(be.array(t))return"Array";if(be.buffer(t))return"Buffer";let e=ov(t);if(e)return e;if(t instanceof String||t instanceof Boolean||t instanceof Number)throw new TypeError("Please don't use object wrappers for primitive types");return"Object"}be.undefined=hI("undefined");be.string=hI("string");var t0t=hI("number");be.number=t=>t0t(t)&&!be.nan(t);be.bigint=hI("bigint");be.function_=hI("function");be.null_=t=>t===null;be.class_=t=>be.function_(t)&&t.toString().startsWith("class ");be.boolean=t=>t===!0||t===!1;be.symbol=hI("symbol");be.numericString=t=>be.string(t)&&!be.emptyStringOrWhitespace(t)&&!Number.isNaN(Number(t));be.array=(t,e)=>Array.isArray(t)?be.function_(e)?t.every(e):!0:!1;be.buffer=t=>{var e,r,s,a;return(a=(s=(r=(e=t)===null||e===void 0?void 0:e.constructor)===null||r===void 0?void 0:r.isBuffer)===null||s===void 0?void 0:s.call(r,t))!==null&&a!==void 0?a:!1};be.blob=t=>Ai("Blob")(t);be.nullOrUndefined=t=>be.null_(t)||be.undefined(t);be.object=t=>!be.null_(t)&&(typeof t=="object"||be.function_(t));be.iterable=t=>{var e;return be.function_((e=t)===null||e===void 0?void 0:e[Symbol.iterator])};be.asyncIterable=t=>{var e;return be.function_((e=t)===null||e===void 0?void 0:e[Symbol.asyncIterator])};be.generator=t=>{var e,r;return be.iterable(t)&&be.function_((e=t)===null||e===void 0?void 0:e.next)&&be.function_((r=t)===null||r===void 0?void 0:r.throw)};be.asyncGenerator=t=>be.asyncIterable(t)&&be.function_(t.next)&&be.function_(t.throw);be.nativePromise=t=>Ai("Promise")(t);var r0t=t=>{var e,r;return be.function_((e=t)===null||e===void 0?void 0:e.then)&&be.function_((r=t)===null||r===void 0?voi
Please report this to https://github.com/szmarczak/http2-wrapper/`);I(R)}return}s[0].resolve(P);return}}if(c in this.queue){if(f in this.queue[c]){this.queue[c][f].listeners.push(...s),this._tryToCreateNewSession(c,f);return}}else this.queue[c]={};let p=()=>{c in this.queue&&this.queue[c][f]===h&&(delete this.queue[c][f],Object.keys(this.queue[c]).length===0&&delete this.queue[c])},h=()=>{let E=`${f}:${c}`,C=!1;try{let S=fgt.connect(e,{createConnection:this.createConnection,settings:this.settings,session:this.tlsSessionCache.get(E),...r});S[xa]=0,S[mI]=!1;let P=()=>S[xa]<S.remoteSettings.maxConcurrentStreams,I=!0;S.socket.once("session",N=>{this.tlsSessionCache.set(E,N)}),S.once("error",N=>{for(let{reject:U}of s)U(N);this.tlsSessionCache.delete(E)}),S.setTimeout(this.timeout,()=>{S.destroy()}),S.once("close",()=>{if(C){I&&this._freeSessionsCount--,this._sessionsCount--;let N=this.sessions[c];N.splice(N.indexOf(S),1),N.length===0&&delete this.sessions[c]}else{let N=new Error("Session closed without receiving a SETTINGS frame");N.code="HTTP2WRAPPER_NOSETTINGS";for(let{reject:U}of s)U(N);p()}this._tryToCreateNewSession(c,f)});let R=()=>{if(!(!(c in this.queue)||!P())){for(let N of S[Nc])if(N in this.queue[c]){let{listeners:U}=this.queue[c][N];for(;U.length!==0&&P();)U.shift().resolve(S);let W=this.queue[c];if(W[N].listeners.length===0&&(delete W[N],Object.keys(W).length===0)){delete this.queue[c];break}if(!P())break}}};S.on("origin",()=>{S[Nc]=S.originSet,P()&&(R(),HH(this.sessions[c],S))}),S.once("remoteSettings",()=>{if(S.ref(),S.unref(),this._sessionsCount++,h.destroyed){let N=new Error("Agent has been destroyed");for(let U of s)U.reject(N);S.destroy();return}S[Nc]=S.originSet;{let N=this.sessions;if(c in N){let U=N[c];U.splice(hgt(U,S,ggt),0,S)}else N[c]=[S]}this._freeSessionsCount+=1,C=!0,this.emit("session",S),R(),p(),S[xa]===0&&this._freeSessionsCount>this.maxFreeSessions&&S.close(),s.length!==0&&(this.getSession(f,r,s),s.length=0),S.on("remoteSettings",()=>{R(),HH(this.sessions[c],S)})}),S[Z0e]=S.request,S.request=(N,U)=>{if(S[mI])throw new Error("The session is gracefully closing. No new streams are allowed.");let W=S[Z0e](N,U);return S.ref(),++S[xa],S[xa]===S.remoteSettings.maxConcurrentStreams&&this._freeSessionsCount--,W.once("close",()=>{if(I=P(),--S[xa],!S.destroyed&&!S.closed&&(dgt(this.sessions[c],S),P()&&!S.closed)){I||(this._freeSessionsCount++,I=!0);let te=S[xa]===0;te&&S.unref(),te&&(this._freeSessionsCount>this.maxFreeSessions||S[mI])?S.close():(HH(this.sessions[c],S),R())}}),W}}catch(S){for(let P of s)P.reject(S);p()}};h.listeners=s,h.completed=!1,h.destroyed=!1,this.queue[c][f]=h,this._tryToCreateNewSession(c,f)})}request(e,r,s,a){return new Promise((n,c)=>{this.getSession(e,r,[{reject:c,resolve:f=>{try{n(f.request(s,a))}catch(p){c(p)}}}])})}createConnection(e,r){return t.connect(e,r)}static connect(e,r){r.ALPNProtocols=["h2"];let s=e.port||443,a=e.hostname||e.host;return typeof r.servername>"u"&&(r.servername=a),ugt.connect(s,a,r)}closeFreeSessions(){for(let e of Object.values(this.sessions))for(let r of e)r[xa]===0&&r.close()}destroy(e){for(let r of Object.values(this.sessions))for(let s of r)s.destroy(e);for(let r of Object.values(this.queue))for(let s of Object.values(r))s.destroyed=!0;this.queue={}}get freeSessions(){return X0e({agent:this,isFree:!0})}get busySessions(){return X0e({agent:this,isFree:!1})}};im.kCurrentStreamsCount=xa;im.kGracefullyClosing=mI;ege.exports={Agent:im,globalAgent:new im}});var GH=L((_zt,tge)=>{"use strict";var{Readable:mgt}=ye("stream"),qH=class extends mgt{constructor(e,r){super({highWaterMark:r,autoDestroy:!1}),this.statusCode=null,this.statusMessage="",this.httpVersion="2.0",this.httpVersionMajor=2,this.httpVersionMinor=0,this.headers={},this.trailers={},this.req=null,this.aborted=!1,this.complete=!1,this.upgrade=null,this.rawHeaders=[],this.rawTrailers=[],this.socket=e,this.connection=e,this._dumped=!1}_destroy(e){this.req._request.destroy(e)}setTimeout(e,r){return this.req.setTimeout(e,r),this}_dump(){this._dumped||(this._dumped=!0,this.removeAllListeners("data")
2025-04-10 09:51:25 -04:00
`).reverse(),f=r.stack.slice(r.stack.indexOf(r.message)+r.message.length).split(`
`).reverse();for(;f.length!==0&&f[0]===c[0];)c.shift();this.stack=`${this.stack.slice(0,n)}${c.reverse().join(`
`)}${f.reverse().join(`
2025-04-11 10:05:45 -04:00
`)}`}}};Ln.RequestError=fs;var tT=class extends fs{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e),this.name="MaxRedirectsError"}};Ln.MaxRedirectsError=tT;var rT=class extends fs{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request),this.name="HTTPError"}};Ln.HTTPError=rT;var nT=class extends fs{constructor(e,r){super(e.message,e,r),this.name="CacheError"}};Ln.CacheError=nT;var iT=class extends fs{constructor(e,r){super(e.message,e,r),this.name="UploadError"}};Ln.UploadError=iT;var sT=class extends fs{constructor(e,r,s){super(e.message,e,s),this.name="TimeoutError",this.event=e.event,this.timings=r}};Ln.TimeoutError=sT;var hv=class extends fs{constructor(e,r){super(e.message,e,r),this.name="ReadError"}};Ln.ReadError=hv;var oT=class extends fs{constructor(e){super(`Unsupported protocol "${e.url.protocol}"`,{},e),this.name="UnsupportedProtocolError"}};Ln.UnsupportedProtocolError=oT;var vdt=["socket","connect","continue","information","upgrade","timeout"],aT=class extends Gge.Duplex{constructor(e,r={},s){super({autoDestroy:!1,highWaterMark:0}),this[II]=0,this[wI]=0,this.requestInitialized=!1,this[XQ]=new Set,this.redirects=[],this[BI]=!1,this[$Q]=!1,this[pv]=[],this.retryCount=0,this._progressCallbacks=[];let a=()=>this._unlockWrite(),n=()=>this._lockWrite();this.on("pipe",h=>{h.prependListener("data",a),h.on("data",n),h.prependListener("end",a),h.on("end",n)}),this.on("unpipe",h=>{h.off("data",a),h.off("data",n),h.off("end",a),h.off("end",n)}),this.on("pipe",h=>{h instanceof gj.IncomingMessage&&(this.options.headers={...h.headers,...this.options.headers})});let{json:c,body:f,form:p}=r;if((c||f||p)&&this._lockWrite(),Ln.kIsNormalizedAlready in r)this.options=r;else try{this.options=this.constructor.normalizeArguments(e,r,s)}catch(h){at.default.nodeStream(r.body)&&r.body.destroy(),this.destroy(h);return}(async()=>{var h;try{this.options.body instanceof ndt.ReadStream&&await Cdt(this.options.body);let{url:E}=this.options;if(!E)throw new TypeError("Missing `url` property");if(this.requestUrl=E.toString(),decodeURI(this.requestUrl),await this._finalizeBody(),await this._makeRequest(),this.destroyed){(h=this[go])===null||h===void 0||h.destroy();return}for(let C of this[pv])C();this[pv].length=0,this.requestInitialized=!0}catch(E){if(E instanceof fs){this._beforeError(E);return}this.destroyed||this.destroy(E)}})()}static normalizeArguments(e,r,s){var a,n,c,f,p;let h=r;if(at.default.object(e)&&!at.default.urlInstance(e))r={...s,...e,...r};else{if(e&&r&&r.url!==void 0)throw new TypeError("The `url` option is mutually exclusive with the `input` argument");r={...s,...r},e!==void 0&&(r.url=e),at.default.urlInstance(r.url)&&(r.url=new B0.URL(r.url.toString()))}if(r.cache===!1&&(r.cache=void 0),r.dnsCache===!1&&(r.dnsCache=void 0),at.assert.any([at.default.string,at.default.undefined],r.method),at.assert.any([at.default.object,at.default.undefined],r.headers),at.assert.any([at.default.string,at.default.urlInstance,at.default.undefined],r.prefixUrl),at.assert.any([at.default.object,at.default.undefined],r.cookieJar),at.assert.any([at.default.object,at.default.string,at.default.undefined],r.searchParams),at.assert.any([at.default.object,at.default.string,at.default.undefined],r.cache),at.assert.any([at.default.object,at.default.number,at.default.undefined],r.timeout),at.assert.any([at.default.object,at.default.undefined],r.context),at.assert.any([at.default.object,at.default.undefined],r.hooks),at.assert.any([at.default.boolean,at.default.undefined],r.decompress),at.assert.any([at.default.boolean,at.default.undefined],r.ignoreInvalidCookies),at.assert.any([at.default.boolean,at.default.undefined],r.followRedirect),at.assert.any([at.default.number,at.default.undefined],r.maxRedirects),at.assert.any([at.default.boolean,at.default.undefined],r.throwHttpErrors),at.assert.any([at.default.boolean,at.default.undefined],r.http2),at.assert.any([at.default.boolean,at.default.undefined],r.allowGetBody),at.assert.any([at.default.string,at.default.undefined],r.localAddress),at.asser
`)[3];return cmt(e)}function Rj(){return typeof hT.default.availableParallelism<"u"?hT.default.availableParallelism():Math.max(1,hT.default.cpus().length)}var hT,rmt,xde,nmt,imt,kde,Qde,amt,lmt,gT=It(()=>{bt();hT=et(ye("os"));dT();kc();rmt=Number(process.versions.node.split(".")[0]),xde=new Map([["darwin","open"],["linux","xdg-open"],["win32","explorer.exe"]]).get(process.platform),nmt=typeof xde<"u"?async t=>{try{return await Fj(xde,[t],{cwd:K.cwd()}),!0}catch{return!1}}:void 0,imt="/usr/bin/ldd";amt=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,lmt=/\((\S*)(?::(\d+))(?::(\d+))\)/});function _j(t,e,r,s,a){let n=sv(r);if(s.isArray||s.type==="ANY"&&Array.isArray(n))return Array.isArray(n)?n.map((c,f)=>Nj(t,`${e}[${f}]`,c,s,a)):String(n).split(/,/).map(c=>Nj(t,e,c,s,a));if(Array.isArray(n))throw new Error(`Non-array configuration settings "${e}" cannot be an array`);return Nj(t,e,r,s,a)}function Nj(t,e,r,s,a){let n=sv(r);switch(s.type){case"ANY":return NQ(n);case"SHAPE":return hmt(t,e,r,s,a);case"MAP":return gmt(t,e,r,s,a)}if(n===null&&!s.isNullable&&s.default!==null)throw new Error(`Non-nullable configuration settings "${e}" cannot be set to null`);if(s.values?.includes(n))return n;let f=(()=>{if(s.type==="BOOLEAN"&&typeof n!="string")return qB(n);if(typeof n!="string")throw new Error(`Expected configuration setting "${e}" to be a string, got ${typeof n}`);let p=Jk(n,{env:t.env});switch(s.type){case"ABSOLUTE_PATH":{let h=a,E=fH(r);return E&&E[0]!=="<"&&(h=K.dirname(E)),K.resolve(h,ue.toPortablePath(p))}case"LOCATOR_LOOSE":return Rp(p,!1);case"NUMBER":return parseInt(p);case"LOCATOR":return Rp(p);case"BOOLEAN":return qB(p);default:return p}})();if(s.values&&!s.values.includes(f))throw new Error(`Invalid value, expected one of ${s.values.join(", ")}`);return f}function hmt(t,e,r,s,a){let n=sv(r);if(typeof n!="object"||Array.isArray(n))throw new nt(`Object configuration settings "${e}" must be an object`);let c=Uj(t,s,{ignoreArrays:!0});if(n===null)return c;for(let[f,p]of Object.entries(n)){let h=`${e}.${f}`;if(!s.properties[f])throw new nt(`Unrecognized configuration settings found: ${e}.${f} - run "yarn config -v" to see the list of settings supported in Yarn`);c.set(f,_j(t,h,p,s.properties[f],a))}return c}function gmt(t,e,r,s,a){let n=sv(r),c=new Map;if(typeof n!="object"||Array.isArray(n))throw new nt(`Map configuration settings "${e}" must be an object`);if(n===null)return c;for(let[f,p]of Object.entries(n)){let h=s.normalizeKeys?s.normalizeKeys(f):f,E=`${e}['${h}']`,C=s.valueDefinition;c.set(h,_j(t,E,p,C,a))}return c}function Uj(t,e,{ignoreArrays:r=!1}={}){switch(e.type){case"SHAPE":{if(e.isArray&&!r)return[];let s=new Map;for(let[a,n]of Object.entries(e.properties))s.set(a,Uj(t,n));return s}case"MAP":return e.isArray&&!r?[]:new Map;case"ABSOLUTE_PATH":return e.default===null?null:t.projectCwd===null?Array.isArray(e.default)?e.default.map(s=>K.normalize(s)):K.isAbsolute(e.default)?K.normalize(e.default):e.isNullable?null:void 0:Array.isArray(e.default)?e.default.map(s=>K.resolve(t.projectCwd,s)):K.resolve(t.projectCwd,e.default);default:return e.default}}function yT(t,e,r){if(e.type==="SECRET"&&typeof t=="string"&&r.hideSecrets)return pmt;if(e.type==="ABSOLUTE_PATH"&&typeof t=="string"&&r.getNativePaths)return ue.fromPortablePath(t);if(e.isArray&&Array.isArray(t)){let s=[];for(let a of t)s.push(yT(a,e,r));return s}if(e.type==="MAP"&&t instanceof Map){if(t.size===0)return;let s=new Map;for(let[a,n]of t.entries()){let c=yT(n,e.valueDefinition,r);typeof c<"u"&&s.set(a,c)}return s}if(e.type==="SHAPE"&&t instanceof Map){if(t.size===0)return;let s=new Map;for(let[a,n]of t.entries()){let c=e.properties[a],f=yT(n,c,r);typeof f<"u"&&s.set(a,f)}return s}return t}function dmt(){let t={};for(let[e,r]of Object.entries(process.env))e=e.toLowerCase(),e.startsWith(ET)&&(e=(0,Rde.default)(e.slice(ET.length)),t[e]=r);return t}function Lj(){let t=`${ET}rc_filename`;for(let[e,r]of Object.entries(process.env))if(e.toLowerCase()===t&&typeof r=="st
`);return{stdout:n,stderr:c}}makeResolver(){let e=[];for(let r of this.plugins.values())for(let s of r.resolvers||[])e.push(new s);return new rm([new FQ,new yi,...e])}makeFetcher(){let e=[];for(let r of this.plugins.values())for(let s of r.fetchers||[])e.push(new s);return new lI([new cI,new uI,...e])}getLinkers(){let e=[];for(let r of this.plugins.values())for(let s of r.linkers||[])e.push(new s);return e}getSupportedArchitectures(){let e=yv(),r=this.get("supportedArchitectures"),s=r.get("os");s!==null&&(s=s.map(c=>c==="current"?e.os:c));let a=r.get("cpu");a!==null&&(a=a.map(c=>c==="current"?e.cpu:c));let n=r.get("libc");return n!==null&&(n=Yl(n,c=>c==="current"?e.libc??Yl.skip:c)),{os:s,cpu:a,libc:n}}isInteractive({interactive:e,stdout:r}){return r.isTTY?e??this.get("preferInteractive"):!1}async getPackageExtensions(){if(this.packageExtensions!==null)return this.packageExtensions;this.packageExtensions=new Map;let e=this.packageExtensions,r=(s,a,{userProvided:n=!1}={})=>{if(!ul(s.range))throw new Error("Only semver ranges are allowed as keys for the packageExtensions setting");let c=new Ht;c.load(a,{yamlCompatibilityMode:!0});let f=jB(e,s.identHash),p=[];f.push([s.range,p]);let h={status:"inactive",userProvided:n,parentDescriptor:s};for(let E of c.dependencies.values())p.push({...h,type:"Dependency",descriptor:E});for(let E of c.peerDependencies.values())p.push({...h,type:"PeerDependency",descriptor:E});for(let[E,C]of c.peerDependenciesMeta)for(let[S,P]of Object.entries(C))p.push({...h,type:"PeerDependencyMeta",selector:E,key:S,value:P})};await this.triggerHook(s=>s.registerPackageExtensions,this,r);for(let[s,a]of this.get("packageExtensions"))r(C0(s,!0),Kk(a),{userProvided:!0});return e}normalizeLocator(e){return ul(e.reference)?Ys(e,`${this.get("defaultProtocol")}${e.reference}`):Hp.test(e.reference)?Ys(e,`${this.get("defaultProtocol")}${e.reference}`):e}normalizeDependency(e){return ul(e.range)?On(e,`${this.get("defaultProtocol")}${e.range}`):Hp.test(e.range)?On(e,`${this.get("defaultProtocol")}${e.range}`):e}normalizeDependencyMap(e){return new Map([...e].map(([r,s])=>[r,this.normalizeDependency(s)]))}normalizePackage(e,{packageExtensions:r}){let s=zB(e),a=r.get(e.identHash);if(typeof a<"u"){let c=e.version;if(c!==null){for(let[f,p]of a)if(eA(c,f))for(let h of p)switch(h.status==="inactive"&&(h.status="redundant"),h.type){case"Dependency":typeof s.dependencies.get(h.descriptor.identHash)>"u"&&(h.status="active",s.dependencies.set(h.descriptor.identHash,this.normalizeDependency(h.descriptor)));break;case"PeerDependency":typeof s.peerDependencies.get(h.descriptor.identHash)>"u"&&(h.status="active",s.peerDependencies.set(h.descriptor.identHash,h.descriptor));break;case"PeerDependencyMeta":{let E=s.peerDependenciesMeta.get(h.selector);(typeof E>"u"||!Object.hasOwn(E,h.key)||E[h.key]!==h.value)&&(h.status="active",Vl(s.peerDependenciesMeta,h.selector,()=>({}))[h.key]=h.value)}break;default:f3(h)}}}let n=c=>c.scope?`${c.scope}__${c.name}`:`${c.name}`;for(let c of s.peerDependenciesMeta.keys()){let f=Da(c);s.peerDependencies.has(f.identHash)||s.peerDependencies.set(f.identHash,On(f,"*"))}for(let c of s.peerDependencies.values()){if(c.scope==="types")continue;let f=n(c),p=ba("types",f),h=cn(p);s.peerDependencies.has(p.identHash)||s.peerDependenciesMeta.has(h)||(s.peerDependencies.set(p.identHash,On(p,"*")),s.peerDependenciesMeta.set(h,{optional:!0}))}return s.dependencies=new Map(Ws(s.dependencies,([,c])=>ll(c))),s.peerDependencies=new Map(Ws(s.peerDependencies,([,c])=>ll(c))),s}getLimit(e){return Vl(this.limits,e,()=>(0,Ode.default)(this.get(e)))}async triggerHook(e,...r){for(let s of this.plugins.values()){let a=s.hooks;if(!a)continue;let n=e(a);n&&await n(...r)}}async triggerMultipleHooks(e,r){for(let s of r)await this.triggerHook(e,...s)}async reduceHook(e,r,...s){let a=r;for(let n of this.plugins.values()){let c=n.hooks;if(!c)continue;let f=e(c);f&&(a=await f(a,...s))}return a}async firstHook(e,...r){for(let s of this.plugins.values()){let a=s.hooks;if(!a)continue;let n=e(a);if(!n)continue;let c=await n(...r);if(type
2025-04-10 09:51:25 -04:00
This command will run a command using Yarn's portable shell.
Make sure to escape glob patterns, redirections, and other features that might be expanded by your own shell.
Note: To escape something from Yarn's shell, you might have to escape it twice, the first time from your own shell.
Note: Don't use this command in Yarn scripts, as Yarn's shell is automatically used.
For a list of features, visit: https://github.com/yarnpkg/berry/blob/master/packages/yarnpkg-shell/README.md.
2025-04-11 10:05:45 -04:00
`,examples:[["Run a simple command","$0 echo Hello"],["Run a command with a glob pattern","$0 echo '*.js'"],["Run a command with a redirection","$0 echo Hello World '>' hello.txt"],["Run a command with an escaped glob pattern (The double escape is needed in Unix shells)",`$0 echo '"*.js"'`],["Run a command with a variable (Double quotes are needed in Unix shells, to prevent them from expanding the variable)",'$0 "GREETING=Hello echo $GREETING World"']]}}async execute(){let r=this.args.length>0?`${this.commandName} ${this.args.join(" ")}`:this.commandName;return await SI(r,[],{cwd:ue.toPortablePath(this.cwd),stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})}}});var Kl,eme=It(()=>{Kl=class extends Error{constructor(e){super(e),this.name="ShellError"}}});var PT={};Vt(PT,{fastGlobOptions:()=>nme,isBraceExpansion:()=>i6,isGlobPattern:()=>bmt,match:()=>Pmt,micromatchOptions:()=>bT});function bmt(t){if(!DT.default.scan(t,bT).isGlob)return!1;try{DT.default.parse(t,bT)}catch{return!1}return!0}function Pmt(t,{cwd:e,baseFs:r}){return(0,tme.default)(t,{...nme,cwd:ue.fromPortablePath(e),fs:Cx(rme.default,new i0(r))})}function i6(t){return DT.default.scan(t,bT).isBrace}var tme,rme,DT,bT,nme,ime=It(()=>{bt();tme=et(BQ()),rme=et(ye("fs")),DT=et(Sa()),bT={strictBrackets:!0},nme={onlyDirectories:!1,onlyFiles:!1}});function s6(){}function o6(){for(let t of cm)t.kill()}function lme(t,e,r,s){return a=>{let n=a[0]instanceof nA.Transform?"pipe":a[0],c=a[1]instanceof nA.Transform?"pipe":a[1],f=a[2]instanceof nA.Transform?"pipe":a[2],p=(0,ome.default)(t,e,{...s,stdio:[n,c,f]});return cm.add(p),cm.size===1&&(process.on("SIGINT",s6),process.on("SIGTERM",o6)),a[0]instanceof nA.Transform&&a[0].pipe(p.stdin),a[1]instanceof nA.Transform&&p.stdout.pipe(a[1],{end:!1}),a[2]instanceof nA.Transform&&p.stderr.pipe(a[2],{end:!1}),{stdin:p.stdin,promise:new Promise(h=>{p.on("error",E=>{switch(cm.delete(p),cm.size===0&&(process.off("SIGINT",s6),process.off("SIGTERM",o6)),E.code){case"ENOENT":a[2].write(`command not found: ${t}
2025-04-10 09:51:25 -04:00
`),h(127);break;case"EACCES":a[2].write(`permission denied: ${t}
`),h(128);break;default:a[2].write(`uncaught error: ${E.message}
`),h(1);break}}),p.on("close",E=>{cm.delete(p),cm.size===0&&(process.off("SIGINT",s6),process.off("SIGTERM",o6)),h(E!==null?E:129)})})}}}function cme(t){return e=>{let r=e[0]==="pipe"?new nA.PassThrough:e[0];return{stdin:r,promise:Promise.resolve().then(()=>t({stdin:r,stdout:e[1],stderr:e[2]}))}}}function xT(t,e){return l6.start(t,e)}function sme(t,e=null){let r=new nA.PassThrough,s=new ame.StringDecoder,a="";return r.on("data",n=>{let c=s.write(n),f;do if(f=c.indexOf(`
`),f!==-1){let p=a+c.substring(0,f);c=c.substring(f+1),a="",t(e!==null?`${e} ${p}`:p)}while(f!==-1);a+=c}),r.on("end",()=>{let n=s.end();n!==""&&t(e!==null?`${e} ${n}`:n)}),r}function ume(t,{prefix:e}){return{stdout:sme(r=>t.stdout.write(`${r}
`),t.stdout.isTTY?e:null),stderr:sme(r=>t.stderr.write(`${r}
2025-04-11 10:05:45 -04:00
`),t.stderr.isTTY?e:null)}}var ome,nA,ame,cm,Mc,a6,l6,c6=It(()=>{ome=et(J_()),nA=ye("stream"),ame=ye("string_decoder"),cm=new Set;Mc=class{constructor(e){this.stream=e}close(){}get(){return this.stream}},a6=class{constructor(){this.stream=null}close(){if(this.stream===null)throw new Error("Assertion failed: No stream attached");this.stream.end()}attach(e){this.stream=e}get(){if(this.stream===null)throw new Error("Assertion failed: No stream attached");return this.stream}},l6=class t{constructor(e,r){this.stdin=null;this.stdout=null;this.stderr=null;this.pipe=null;this.ancestor=e,this.implementation=r}static start(e,{stdin:r,stdout:s,stderr:a}){let n=new t(null,e);return n.stdin=r,n.stdout=s,n.stderr=a,n}pipeTo(e,r=1){let s=new t(this,e),a=new a6;return s.pipe=a,s.stdout=this.stdout,s.stderr=this.stderr,(r&1)===1?this.stdout=a:this.ancestor!==null&&(this.stderr=this.ancestor.stdout),(r&2)===2?this.stderr=a:this.ancestor!==null&&(this.stderr=this.ancestor.stderr),s}async exec(){let e=["ignore","ignore","ignore"];if(this.pipe)e[0]="pipe";else{if(this.stdin===null)throw new Error("Assertion failed: No input stream registered");e[0]=this.stdin.get()}let r;if(this.stdout===null)throw new Error("Assertion failed: No output stream registered");r=this.stdout,e[1]=r.get();let s;if(this.stderr===null)throw new Error("Assertion failed: No error stream registered");s=this.stderr,e[2]=s.get();let a=this.implementation(e);return this.pipe&&this.pipe.attach(a.stdin),await a.promise.then(n=>(r.close(),s.close(),n))}async run(){let e=[];for(let s=this;s;s=s.ancestor)e.push(s.exec());return(await Promise.all(e))[0]}}});var Qv={};Vt(Qv,{EntryCommand:()=>Dv,ShellError:()=>Kl,execute:()=>SI,globUtils:()=>PT});function fme(t,e,r){let s=new Jl.PassThrough({autoDestroy:!0});switch(t){case 0:(e&1)===1&&r.stdin.pipe(s,{end:!1}),(e&2)===2&&r.stdin instanceof Jl.Writable&&s.pipe(r.stdin,{end:!1});break;case 1:(e&1)===1&&r.stdout.pipe(s,{end:!1}),(e&2)===2&&s.pipe(r.stdout,{end:!1});break;case 2:(e&1)===1&&r.stderr.pipe(s,{end:!1}),(e&2)===2&&s.pipe(r.stderr,{end:!1});break;default:throw new Kl(`Bad file descriptor: "${t}"`)}return s}function QT(t,e={}){let r={...t,...e};return r.environment={...t.environment,...e.environment},r.variables={...t.variables,...e.variables},r}async function kmt(t,e,r){let s=[],a=new Jl.PassThrough;return a.on("data",n=>s.push(n)),await TT(t,e,QT(r,{stdout:a})),Buffer.concat(s).toString().replace(/[\r\n]+$/,"")}async function Ame(t,e,r){let s=t.map(async n=>{let c=await um(n.args,e,r);return{name:n.name,value:c.join(" ")}});return(await Promise.all(s)).reduce((n,c)=>(n[c.name]=c.value,n),{})}function kT(t){return t.match(/[^ \r\n\t]+/g)||[]}async function yme(t,e,r,s,a=s){switch(t.name){case"$":s(String(process.pid));break;case"#":s(String(e.args.length));break;case"@":if(t.quoted)for(let n of e.args)a(n);else for(let n of e.args){let c=kT(n);for(let f=0;f<c.length-1;++f)a(c[f]);s(c[c.length-1])}break;case"*":{let n=e.args.join(" ");if(t.quoted)s(n);else for(let c of kT(n))a(c)}break;case"PPID":s(String(process.ppid));break;case"RANDOM":s(String(Math.floor(Math.random()*32768)));break;default:{let n=parseInt(t.name,10),c,f=Number.isFinite(n);if(f?n>=0&&n<e.args.length&&(c=e.args[n]):Object.hasOwn(r.variables,t.name)?c=r.variables[t.name]:Object.hasOwn(r.environment,t.name)&&(c=r.environment[t.name]),typeof c<"u"&&t.alternativeValue?c=(await um(t.alternativeValue,e,r)).join(" "):typeof c>"u"&&(t.defaultValue?c=(await um(t.defaultValue,e,r)).join(" "):t.alternativeValue&&(c="")),typeof c>"u")throw f?new Kl(`Unbound argument #${n}`):new Kl(`Unbound variable "${t.name}"`);if(t.quoted)s(c);else{let p=kT(c);for(let E=0;E<p.length-1;++E)a(p[E]);let h=p[p.length-1];typeof h<"u"&&s(h)}}break}}async function Pv(t,e,r){if(t.type==="number"){if(Number.isInteger(t.value))return t.value;throw new Error(`Invalid number: "${t.value}", only integers are allowed`)}else if(t.type==="variable"){let s=[];await yme({...t,quoted:!0},e,r,n=>s.push(n));let a=Number(s.join(" "));return Number.isNaN(a)?Pv({type:"variable",name:s.join(" ")},e,r):Pv
2025-04-10 09:51:25 -04:00
`)).finally(()=>{r.stdout.isTTY&&r.stdout.write(`Job ${p}, '${c(AE(t))}' has ended
2025-04-11 10:05:45 -04:00
`)})),0}return await hme(t,e,r)}async function Nmt(t,e,r,{background:s=!1}={}){let a,n=f=>{a=f,r.variables["?"]=String(f)},c=async f=>{try{return await Fmt(f.chain,e,r,{background:s&&typeof f.then>"u"})}catch(p){if(!(p instanceof Kl))throw p;return r.stderr.write(`${p.message}
`),1}};for(n(await c(t));t.then;){if(r.exitCode!==null)return r.exitCode;switch(t.then.type){case"&&":a===0&&n(await c(t.then.line));break;case"||":a!==0&&n(await c(t.then.line));break;default:throw new Error(`Assertion failed: Unsupported command type: "${t.then.type}"`)}t=t.then.line}return a}async function TT(t,e,r){let s=r.backgroundJobs;r.backgroundJobs=[];let a=0;for(let{command:n,type:c}of t){if(a=await Nmt(n,e,r,{background:c==="&"}),r.exitCode!==null)return r.exitCode;r.variables["?"]=String(a)}return await Promise.all(r.backgroundJobs),r.backgroundJobs=s,a}function Eme(t){switch(t.type){case"variable":return t.name==="@"||t.name==="#"||t.name==="*"||Number.isFinite(parseInt(t.name,10))||"defaultValue"in t&&!!t.defaultValue&&t.defaultValue.some(e=>kv(e))||"alternativeValue"in t&&!!t.alternativeValue&&t.alternativeValue.some(e=>kv(e));case"arithmetic":return u6(t.arithmetic);case"shell":return f6(t.shell);default:return!1}}function kv(t){switch(t.type){case"redirection":return t.args.some(e=>kv(e));case"argument":return t.segments.some(e=>Eme(e));default:throw new Error(`Assertion failed: Unsupported argument type: "${t.type}"`)}}function u6(t){switch(t.type){case"variable":return Eme(t);case"number":return!1;default:return u6(t.left)||u6(t.right)}}function f6(t){return t.some(({command:e})=>{for(;e;){let r=e.chain;for(;r;){let s;switch(r.type){case"subshell":s=f6(r.subshell);break;case"command":s=r.envs.some(a=>a.args.some(n=>kv(n)))||r.args.some(a=>kv(a));break}if(s)return!0;if(!r.then)break;r=r.then.chain}if(!e.then)break;e=e.then.line}return!1})}async function SI(t,e=[],{baseFs:r=new Yn,builtins:s={},cwd:a=ue.toPortablePath(process.cwd()),env:n=process.env,stdin:c=process.stdin,stdout:f=process.stdout,stderr:p=process.stderr,variables:h={},glob:E=PT}={}){let C={};for(let[I,R]of Object.entries(n))typeof R<"u"&&(C[I]=R);let S=new Map(xmt);for(let[I,R]of Object.entries(s))S.set(I,R);c===null&&(c=new Jl.PassThrough,c.end());let P=vx(t,E);if(!f6(P)&&P.length>0&&e.length>0){let{command:I}=P[P.length-1];for(;I.then;)I=I.then.line;let R=I.chain;for(;R.then;)R=R.then.chain;R.type==="command"&&(R.args=R.args.concat(e.map(N=>({type:"argument",segments:[{type:"text",text:N}]}))))}return await TT(P,{args:e,baseFs:r,builtins:S,initialStdin:c,initialStdout:f,initialStderr:p,glob:E},{cwd:a,environment:C,exitCode:null,procedures:{},stdin:c,stdout:f,stderr:p,variables:Object.assign({},h,{"?":0}),nextBackgroundJobIndex:1,backgroundJobs:[]})}var gme,dme,Jl,mme,xmt,Qmt,bv=It(()=>{bt();Bc();gme=et(g4()),dme=ye("os"),Jl=ye("stream"),mme=ye("timers/promises");$de();eme();ime();c6();c6();xmt=new Map([["cd",async([t=(0,dme.homedir)(),...e],r,s)=>{let a=K.resolve(s.cwd,ue.toPortablePath(t));if(!(await r.baseFs.statPromise(a).catch(c=>{throw c.code==="ENOENT"?new Kl(`cd: no such file or directory: ${t}`):c})).isDirectory())throw new Kl(`cd: not a directory: ${t}`);return s.cwd=a,0}],["pwd",async(t,e,r)=>(r.stdout.write(`${ue.fromPortablePath(r.cwd)}
2025-04-10 09:51:25 -04:00
`),0)],[":",async(t,e,r)=>0],["true",async(t,e,r)=>0],["false",async(t,e,r)=>1],["exit",async([t,...e],r,s)=>s.exitCode=parseInt(t??s.variables["?"],10)],["echo",async(t,e,r)=>(r.stdout.write(`${t.join(" ")}
2025-04-11 10:05:45 -04:00
`),0)],["sleep",async([t],e,r)=>{if(typeof t>"u")throw new Kl("sleep: missing operand");let s=Number(t);if(Number.isNaN(s))throw new Kl(`sleep: invalid time interval '${t}'`);return await(0,mme.setTimeout)(1e3*s,0)}],["unset",async(t,e,r)=>{for(let s of t)delete r.environment[s],delete r.variables[s];return 0}],["__ysh_run_procedure",async(t,e,r)=>{let s=r.procedures[t[0]];return await xT(s,{stdin:new Mc(r.stdin),stdout:new Mc(r.stdout),stderr:new Mc(r.stderr)}).run()}],["__ysh_set_redirects",async(t,e,r)=>{let s=r.stdin,a=r.stdout,n=r.stderr,c=[],f=[],p=[],h=0;for(;t[h]!=="--";){let C=t[h++],{type:S,fd:P}=JSON.parse(C),I=W=>{switch(P){case null:case 0:c.push(W);break;default:throw new Error(`Unsupported file descriptor: "${P}"`)}},R=W=>{switch(P){case null:case 1:f.push(W);break;case 2:p.push(W);break;default:throw new Error(`Unsupported file descriptor: "${P}"`)}},N=Number(t[h++]),U=h+N;for(let W=h;W<U;++h,++W)switch(S){case"<":I(()=>e.baseFs.createReadStream(K.resolve(r.cwd,ue.toPortablePath(t[W]))));break;case"<<<":I(()=>{let te=new Jl.PassThrough;return process.nextTick(()=>{te.write(`${t[W]}
`),te.end()}),te});break;case"<&":I(()=>fme(Number(t[W]),1,r));break;case">":case">>":{let te=K.resolve(r.cwd,ue.toPortablePath(t[W]));R(te==="/dev/null"?new Jl.Writable({autoDestroy:!0,emitClose:!0,write(ie,Ae,ce){setImmediate(ce)}}):e.baseFs.createWriteStream(te,S===">>"?{flags:"a"}:void 0))}break;case">&":R(fme(Number(t[W]),2,r));break;default:throw new Error(`Assertion failed: Unsupported redirection type: "${S}"`)}}if(c.length>0){let C=new Jl.PassThrough;s=C;let S=P=>{if(P===c.length)C.end();else{let I=c[P]();I.pipe(C,{end:!1}),I.on("end",()=>{S(P+1)})}};S(0)}if(f.length>0){let C=new Jl.PassThrough;a=C;for(let S of f)C.pipe(S)}if(p.length>0){let C=new Jl.PassThrough;n=C;for(let S of p)C.pipe(S)}let E=await xT(xv(t.slice(h+1),e,r),{stdin:new Mc(s),stdout:new Mc(a),stderr:new Mc(n)}).run();return await Promise.all(f.map(C=>new Promise((S,P)=>{C.on("error",I=>{P(I)}),C.on("close",()=>{S()}),C.end()}))),await Promise.all(p.map(C=>new Promise((S,P)=>{C.on("error",I=>{P(I)}),C.on("close",()=>{S()}),C.end()}))),E}]]);Qmt={addition:(t,e)=>t+e,subtraction:(t,e)=>t-e,multiplication:(t,e)=>t*e,division:(t,e)=>Math.trunc(t/e)}});var RT=L((y$t,Ime)=>{function Omt(t,e){for(var r=-1,s=t==null?0:t.length,a=Array(s);++r<s;)a[r]=e(t[r],r,t);return a}Ime.exports=Omt});var Dme=L((E$t,Sme)=>{var Cme=Yd(),Lmt=RT(),Mmt=xc(),_mt=aI(),Umt=1/0,wme=Cme?Cme.prototype:void 0,Bme=wme?wme.toString:void 0;function vme(t){if(typeof t=="string")return t;if(Mmt(t))return Lmt(t,vme)+"";if(_mt(t))return Bme?Bme.call(t):"";var e=t+"";return e=="0"&&1/t==-Umt?"-0":e}Sme.exports=vme});var Tv=L((I$t,bme)=>{var Hmt=Dme();function jmt(t){return t==null?"":Hmt(t)}bme.exports=jmt});var A6=L((C$t,Pme)=>{function qmt(t,e,r){var s=-1,a=t.length;e<0&&(e=-e>a?0:a+e),r=r>a?a:r,r<0&&(r+=a),a=e>r?0:r-e>>>0,e>>>=0;for(var n=Array(a);++s<a;)n[s]=t[s+e];return n}Pme.exports=qmt});var kme=L((w$t,xme)=>{var Gmt=A6();function Wmt(t,e,r){var s=t.length;return r=r===void 0?s:r,!e&&r>=s?t:Gmt(t,e,r)}xme.exports=Wmt});var p6=L((B$t,Qme)=>{var Ymt="\\ud800-\\udfff",Vmt="\\u0300-\\u036f",Kmt="\\ufe20-\\ufe2f",Jmt="\\u20d0-\\u20ff",zmt=Vmt+Kmt+Jmt,Zmt="\\ufe0e\\ufe0f",Xmt="\\u200d",$mt=RegExp("["+Xmt+Ymt+zmt+Zmt+"]");function eyt(t){return $mt.test(t)}Qme.exports=eyt});var Rme=L((v$t,Tme)=>{function tyt(t){return t.split("")}Tme.exports=tyt});var Hme=L((S$t,Ume)=>{var Fme="\\ud800-\\udfff",ryt="\\u0300-\\u036f",nyt="\\ufe20-\\ufe2f",iyt="\\u20d0-\\u20ff",syt=ryt+nyt+iyt,oyt="\\ufe0e\\ufe0f",ayt="["+Fme+"]",h6="["+syt+"]",g6="\\ud83c[\\udffb-\\udfff]",lyt="(?:"+h6+"|"+g6+")",Nme="[^"+Fme+"]",Ome="(?:\\ud83c[\\udde6-\\uddff]){2}",Lme="[\\ud800-\\udbff][\\udc00-\\udfff]",cyt="\\u200d",Mme=lyt+"?",_me="["+oyt+"]?",uyt="(?:"+cyt+"(?:"+[Nme,Ome,Lme].join("|")+")"+_me+Mme+")*",fyt=_me+Mme+uyt,Ayt="(?:"+[Nme+h6+"?",h6,Ome,Lme,ayt].join("|")+")",pyt=RegExp(g6+"(?="+g6+")|"+Ayt+fyt,"g");function hyt(t){return t.match(pyt)||[]}Ume.exports=hyt});var qme=L((D$t,jme)=>{var gyt=Rme(),dyt=p6(),myt=Hme();function yyt(t){return dyt(t)?myt(t):gyt(t)}jme.exports=yyt});var Wme=L((b$t,Gme)=>{var Eyt=kme(),Iyt=p6(),Cyt=qme(),wyt=Tv();function Byt(t){return function(e){e=wyt(e);var r=Iyt(e)?Cyt(e):void 0,s=r?r[0]:e.charAt(0),a=r?Eyt(r,1).join(""):e.slice(1);return s[t]()+a}}Gme.exports=Byt});var Vme=L((P$t,Yme)=>{var vyt=Wme(),Syt=vyt("toUpperCase");Yme.exports=Syt});var d6=L((x$t,Kme)=>{var Dyt=Tv(),byt=Vme();function Pyt(t){return byt(Dyt(t).toLowerCase())}Kme.exports=Pyt});var Jme=L((k$t,FT)=>{function xyt(){var t=0,e=1,r=2,s=3,a=4,n=5,c=6,f=7,p=8,h=9,E=10,C=11,S=12,P=13,I=14,R=15,N=16,U=17,W=0,te=1,ie=2,Ae=3,ce=4;function me(g,we){return 55296<=g.charCodeAt(we)&&g.charCodeAt(we)<=56319&&56320<=g.charCodeAt(we+1)&&g.charCodeAt(we+1)<=57343}function pe(g,we){we===void 0&&(we=0);var Ee=g.charCodeAt(we);if(55296<=Ee&&Ee<=56319&&we<g.length-1){var fe=Ee,se=g.charCodeAt(we+1);return 56320<=se&&se<=57343?(fe-55296)*1024+(se-56320)+65536:fe}if(56320<=Ee&&Ee<=57343&&we>=1){var fe=g.charCodeAt(we-1),se=Ee;return 55296<=fe&&fe<=56319?(fe-55296)*1024+(se-56320)+65536:se}return Ee}function Be(g,we,Ee){var fe=[g]
2025-04-10 09:51:25 -04:00
`,end:t=>`::endgroup::
`}:OT.default.TRAVIS?{start:t=>`travis_fold:start:${t}
`,end:t=>`travis_fold:end:${t}
`}:OT.default.GITLAB?{start:t=>`section_start:${Math.floor(Date.now()/1e3)}:${t.toLowerCase().replace(/\W+/g,"_")}[collapsed=true]\r\x1B[0K${t}
`,end:t=>`section_end:${Math.floor(Date.now()/1e3)}:${t.toLowerCase().replace(/\W+/g,"_")}\r\x1B[0K`}:null,rye=b0!==null,eye=new Date,Ryt=["iTerm.app","Apple_Terminal","WarpTerminal","vscode"].includes(process.env.TERM_PROGRAM)||!!process.env.WT_SESSION,Fyt=t=>t,LT=Fyt({patrick:{date:[17,3],chars:["\u{1F340}","\u{1F331}"],size:40},simba:{date:[19,7],chars:["\u{1F981}","\u{1F334}"],size:40},jack:{date:[31,10],chars:["\u{1F383}","\u{1F987}"],size:40},hogsfather:{date:[31,12],chars:["\u{1F389}","\u{1F384}"],size:40},default:{chars:["=","-"],size:80}}),Nyt=Ryt&&Object.keys(LT).find(t=>{let e=LT[t];return!(e.date&&(e.date[0]!==eye.getDate()||e.date[1]!==eye.getMonth()+1))})||"default";Ot=class extends ho{constructor({configuration:r,stdout:s,json:a=!1,forceSectionAlignment:n=!1,includeNames:c=!0,includePrefix:f=!0,includeFooter:p=!0,includeLogs:h=!a,includeInfos:E=h,includeWarnings:C=h}){super();this.uncommitted=new Set;this.warningCount=0;this.errorCount=0;this.timerFooter=[];this.startTime=Date.now();this.indent=0;this.level=0;this.progress=new Map;this.progressTime=0;this.progressFrame=0;this.progressTimeout=null;this.progressStyle=null;this.progressMaxScaledSize=null;if(YB(this,{configuration:r}),this.configuration=r,this.forceSectionAlignment=n,this.includeNames=c,this.includePrefix=f,this.includeFooter=p,this.includeInfos=E,this.includeWarnings=C,this.json=a,this.stdout=s,r.get("enableProgressBars")&&!a&&s.isTTY&&s.columns>22){let S=r.get("progressBarStyle")||Nyt;if(!Object.hasOwn(LT,S))throw new Error("Assertion failed: Invalid progress bar style");this.progressStyle=LT[S];let P=Math.min(this.getRecommendedLength(),80);this.progressMaxScaledSize=Math.floor(this.progressStyle.size*P/80)}}static async start(r,s){let a=new this(r),n=process.emitWarning;process.emitWarning=(c,f)=>{if(typeof c!="string"){let h=c;c=h.message,f=f??h.name}let p=typeof f<"u"?`${f}: ${c}`:c;a.reportWarning(0,p)},r.includeVersion&&a.reportInfo(0,zd(r.configuration,`Yarn ${un}`,2));try{await s(a)}catch(c){a.reportExceptionOnce(c)}finally{await a.finalize(),process.emitWarning=n}return a}hasErrors(){return this.errorCount>0}exitCode(){return this.hasErrors()?1:0}getRecommendedLength(){let s=this.progressStyle!==null?this.stdout.columns-1:super.getRecommendedLength();return Math.max(40,s-12-this.indent*2)}startSectionSync({reportHeader:r,reportFooter:s,skipIfEmpty:a},n){let c={committed:!1,action:()=>{r?.()}};a?this.uncommitted.add(c):(c.action(),c.committed=!0);let f=Date.now();try{return n()}catch(p){throw this.reportExceptionOnce(p),p}finally{let p=Date.now();this.uncommitted.delete(c),c.committed&&s?.(p-f)}}async startSectionPromise({reportHeader:r,reportFooter:s,skipIfEmpty:a},n){let c={committed:!1,action:()=>{r?.()}};a?this.uncommitted.add(c):(c.action(),c.committed=!0);let f=Date.now();try{return await n()}catch(p){throw this.reportExceptionOnce(p),p}finally{let p=Date.now();this.uncommitted.delete(c),c.committed&&s?.(p-f)}}startTimerImpl(r,s,a){return{cb:typeof s=="function"?s:a,reportHeader:()=>{this.level+=1,this.reportInfo(null,`\u250C ${r}`),this.indent+=1,b0!==null&&!this.json&&this.includeInfos&&this.stdout.write(b0.start(r))},reportFooter:f=>{if(this.indent-=1,b0!==null&&!this.json&&this.includeInfos){this.stdout.write(b0.end(r));for(let p of this.timerFooter)p()}this.configuration.get("enableTimers")&&f>200?this.reportInfo(null,`\u2514 Completed in ${Ut(this.configuration,f,Ct.DURATION)}`):this.reportInfo(null,"\u2514 Completed"),this.level-=1},skipIfEmpty:(typeof s=="function"?{}:s).skipIfEmpty}}startTimerSync(r,s,a){let{cb:n,...c}=this.startTimerImpl(r,s,a);return this.startSectionSync(c,n)}async startTimerPromise(r,s,a){let{cb:n,...c}=this.startTimerImpl(r,s,a);return this.startSectionPromise(c,n)}reportSeparator(){this.indent===0?this.writeLine(""):this.reportInfo(null,"")}reportInfo(r,s){if(!this.includeInfos)return;this.commit();let a=this.formatNameWithHyperlink(r),n=a?`${a}: `:"",c=`${this.formatPrefix(n,"blueBright")}${s}`;this.json?this.reportJson({type:"info",name:r,displayName:this.formatName(r),indent:this.formatIndent
`),this.writeProgress()}writeLines(r,{truncate:s}={}){this.clearProgress({delta:r.length});for(let a of r)this.stdout.write(`${this.truncate(a,{truncate:s})}
`);this.writeProgress()}commit(){let r=this.uncommitted;this.uncommitted=new Set;for(let s of r)s.committed=!0,s.action()}clearProgress({delta:r=0,clear:s=!1}){this.progressStyle!==null&&this.progress.size+r>0&&(this.stdout.write(`\x1B[${this.progress.size+r}A`),(r>0||s)&&this.stdout.write("\x1B[0J"))}writeProgress(){if(this.progressStyle===null||(this.progressTimeout!==null&&clearTimeout(this.progressTimeout),this.progressTimeout=null,this.progress.size===0))return;let r=Date.now();r-this.progressTime>$me&&(this.progressFrame=(this.progressFrame+1)%Xme.length,this.progressTime=r);let s=Xme[this.progressFrame];for(let a of this.progress.values()){let n="";if(typeof a.lastScaledSize<"u"){let h=this.progressStyle.chars[0].repeat(a.lastScaledSize),E=this.progressStyle.chars[1].repeat(this.progressMaxScaledSize-a.lastScaledSize);n=` ${h}${E}`}let c=this.formatName(null),f=c?`${c}: `:"",p=a.definition.title?` ${a.definition.title}`:"";this.stdout.write(`${Ut(this.configuration,"\u27A4","blueBright")} ${f}${s}${n}${p}
2025-04-11 10:05:45 -04:00
`)}this.progressTimeout=setTimeout(()=>{this.refreshProgress({force:!0})},$me)}refreshProgress({delta:r=0,force:s=!1}={}){let a=!1,n=!1;if(s||this.progress.size===0)a=!0;else for(let c of this.progress.values()){let f=typeof c.definition.progress<"u"?Math.trunc(this.progressMaxScaledSize*c.definition.progress):void 0,p=c.lastScaledSize;c.lastScaledSize=f;let h=c.lastTitle;if(c.lastTitle=c.definition.title,f!==p||(n=h!==c.definition.title)){a=!0;break}}a&&(this.clearProgress({delta:r,clear:n}),this.writeProgress())}truncate(r,{truncate:s}={}){return this.progressStyle===null&&(s=!1),typeof s>"u"&&(s=this.configuration.get("preferTruncatedLines")),s&&(r=(0,tye.default)(r,0,this.stdout.columns-1)),r}formatName(r){return this.includeNames?nye(r,{configuration:this.configuration,json:this.json}):""}formatPrefix(r,s){return this.includePrefix?`${Ut(this.configuration,"\u27A4",s)} ${r}${this.formatIndent()}`:""}formatNameWithHyperlink(r){return this.includeNames?m6(r,{configuration:this.configuration,json:this.json}):""}formatIndent(){return this.level>0||!this.forceSectionAlignment?"\u2502 ".repeat(this.indent):`${Tyt} `}}});var In={};Vt(In,{PackageManager:()=>oye,detectPackageManager:()=>aye,executePackageAccessibleBinary:()=>Aye,executePackageScript:()=>MT,executePackageShellcode:()=>y6,executeWorkspaceAccessibleBinary:()=>jyt,executeWorkspaceLifecycleScript:()=>uye,executeWorkspaceScript:()=>cye,getPackageAccessibleBinaries:()=>_T,getWorkspaceAccessibleBinaries:()=>fye,hasPackageScript:()=>_yt,hasWorkspaceScript:()=>E6,isNodeScript:()=>I6,makeScriptEnv:()=>Nv,maybeExecuteWorkspaceLifecycleScript:()=>Hyt,prepareExternalProject:()=>Myt});async function P0(t,e,r,s=[]){if(process.platform==="win32"){let a=`@goto #_undefined_# 2>NUL || @title %COMSPEC% & @setlocal & @"${r}" ${s.map(n=>`"${n.replace('"','""')}"`).join(" ")} %*`;await le.writeFilePromise(K.format({dir:t,name:e,ext:".cmd"}),a)}await le.writeFilePromise(K.join(t,e),`#!/bin/sh
2025-04-10 09:51:25 -04:00
exec "${r}" ${s.map(a=>`'${a.replace(/'/g,`'"'"'`)}'`).join(" ")} "$@"
2025-04-11 10:05:45 -04:00
`,{mode:493})}async function aye(t){let e=await Ht.tryFind(t);if(e?.packageManager){let s=xQ(e.packageManager);if(s?.name){let a=`found ${JSON.stringify({packageManager:e.packageManager})} in manifest`,[n]=s.reference.split(".");switch(s.name){case"yarn":return{packageManagerField:!0,packageManager:Number(n)===1?"Yarn Classic":"Yarn",reason:a};case"npm":return{packageManagerField:!0,packageManager:"npm",reason:a};case"pnpm":return{packageManagerField:!0,packageManager:"pnpm",reason:a}}}}let r;try{r=await le.readFilePromise(K.join(t,Er.lockfile),"utf8")}catch{}return r!==void 0?r.match(/^__metadata:$/m)?{packageManager:"Yarn",reason:'"__metadata" key found in yarn.lock'}:{packageManager:"Yarn Classic",reason:'"__metadata" key not found in yarn.lock, must be a Yarn classic lockfile'}:le.existsSync(K.join(t,"package-lock.json"))?{packageManager:"npm",reason:`found npm's "package-lock.json" lockfile`}:le.existsSync(K.join(t,"pnpm-lock.yaml"))?{packageManager:"pnpm",reason:`found pnpm's "pnpm-lock.yaml" lockfile`}:null}async function Nv({project:t,locator:e,binFolder:r,ignoreCorepack:s,lifecycleScript:a,baseEnv:n=t?.configuration.env??process.env}){let c={};for(let[E,C]of Object.entries(n))typeof C<"u"&&(c[E.toLowerCase()!=="path"?E:"PATH"]=C);let f=ue.fromPortablePath(r);c.BERRY_BIN_FOLDER=ue.fromPortablePath(f);let p=process.env.COREPACK_ROOT&&!s?ue.join(process.env.COREPACK_ROOT,"dist/yarn.js"):process.argv[1];if(await Promise.all([P0(r,"node",process.execPath),...un!==null?[P0(r,"run",process.execPath,[p,"run"]),P0(r,"yarn",process.execPath,[p]),P0(r,"yarnpkg",process.execPath,[p]),P0(r,"node-gyp",process.execPath,[p,"run","--top-level","node-gyp"])]:[]]),t&&(c.INIT_CWD=ue.fromPortablePath(t.configuration.startingCwd),c.PROJECT_CWD=ue.fromPortablePath(t.cwd)),c.PATH=c.PATH?`${f}${ue.delimiter}${c.PATH}`:`${f}`,c.npm_execpath=`${f}${ue.sep}yarn`,c.npm_node_execpath=`${f}${ue.sep}node`,e){if(!t)throw new Error("Assertion failed: Missing project");let E=t.tryWorkspaceByLocator(e),C=E?E.manifest.version??"":t.storedPackages.get(e.locatorHash).version??"";c.npm_package_name=cn(e),c.npm_package_version=C;let S;if(E)S=E.cwd;else{let P=t.storedPackages.get(e.locatorHash);if(!P)throw new Error(`Package for ${Yr(t.configuration,e)} not found in the project`);let I=t.configuration.getLinkers(),R={project:t,report:new Ot({stdout:new x0.PassThrough,configuration:t.configuration})},N=I.find(U=>U.supportsPackage(P,R));if(!N)throw new Error(`The package ${Yr(t.configuration,P)} isn't supported by any of the available linkers`);S=await N.findPackageLocation(P,R)}c.npm_package_json=ue.fromPortablePath(K.join(S,Er.manifest))}let h=un!==null?`yarn/${un}`:`yarn/${kp("@yarnpkg/core").version}-core`;return c.npm_config_user_agent=`${h} npm/? node/${process.version} ${process.platform} ${process.arch}`,a&&(c.npm_lifecycle_event=a),t&&await t.configuration.triggerHook(E=>E.setupScriptEnvironment,t,c,async(E,C,S)=>await P0(r,E,C,S)),c}async function Myt(t,e,{configuration:r,report:s,workspace:a=null,locator:n=null}){await Lyt(async()=>{await le.mktempPromise(async c=>{let f=K.join(c,"pack.log"),p=null,{stdout:h,stderr:E}=r.getSubprocessStreams(f,{prefix:ue.fromPortablePath(t),report:s}),C=n&&Gu(n)?rI(n):n,S=C?cl(C):"an external project";h.write(`Packing ${S} from sources
2025-04-10 09:51:25 -04:00
`);let P=await aye(t),I;P!==null?(h.write(`Using ${P.packageManager} for bootstrap. Reason: ${P.reason}
`),I=P.packageManager):(h.write(`No package manager configuration detected; defaulting to Yarn
2025-04-11 10:05:45 -04:00
`),I="Yarn");let R=I==="Yarn"&&!P?.packageManagerField;await le.mktempPromise(async N=>{let U=await Nv({binFolder:N,ignoreCorepack:R,baseEnv:{...process.env,COREPACK_ENABLE_AUTO_PIN:"0"}}),te=new Map([["Yarn Classic",async()=>{let Ae=a!==null?["workspace",a]:[],ce=K.join(t,Er.manifest),me=await le.readFilePromise(ce),pe=await Yu(process.execPath,[process.argv[1],"set","version","classic","--only-if-needed","--yarn-path"],{cwd:t,env:U,stdin:p,stdout:h,stderr:E,end:1});if(pe.code!==0)return pe.code;await le.writeFilePromise(ce,me),await le.appendFilePromise(K.join(t,".npmignore"),`/.yarn
2025-04-10 09:51:25 -04:00
`),h.write(`
`),delete U.NODE_ENV;let Be=await Yu("yarn",["install"],{cwd:t,env:U,stdin:p,stdout:h,stderr:E,end:1});if(Be.code!==0)return Be.code;h.write(`
2025-04-11 10:05:45 -04:00
`);let Ce=await Yu("yarn",[...Ae,"pack","--filename",ue.fromPortablePath(e)],{cwd:t,env:U,stdin:p,stdout:h,stderr:E});return Ce.code!==0?Ce.code:0}],["Yarn",async()=>{let Ae=a!==null?["workspace",a]:[];U.YARN_ENABLE_INLINE_BUILDS="1";let ce=K.join(t,Er.lockfile);await le.existsPromise(ce)||await le.writeFilePromise(ce,"");let me=await Yu("yarn",[...Ae,"pack","--install-if-needed","--filename",ue.fromPortablePath(e)],{cwd:t,env:U,stdin:p,stdout:h,stderr:E});return me.code!==0?me.code:0}],["npm",async()=>{if(a!==null){let we=new x0.PassThrough,Ee=WE(we);we.pipe(h,{end:!1});let fe=await Yu("npm",["--version"],{cwd:t,env:U,stdin:p,stdout:we,stderr:E,end:0});if(we.end(),fe.code!==0)return h.end(),E.end(),fe.code;let se=(await Ee).toString().trim();if(!eA(se,">=7.x")){let X=ba(null,"npm"),De=On(X,se),Re=On(X,">=7.x");throw new Error(`Workspaces aren't supported by ${ri(r,De)}; please upgrade to ${ri(r,Re)} (npm has been detected as the primary package manager for ${Ut(r,t,Ct.PATH)})`)}}let Ae=a!==null?["--workspace",a]:[];delete U.npm_config_user_agent,delete U.npm_config_production,delete U.NPM_CONFIG_PRODUCTION,delete U.NODE_ENV;let ce=await Yu("npm",["install","--legacy-peer-deps"],{cwd:t,env:U,stdin:p,stdout:h,stderr:E,end:1});if(ce.code!==0)return ce.code;let me=new x0.PassThrough,pe=WE(me);me.pipe(h);let Be=await Yu("npm",["pack","--silent",...Ae],{cwd:t,env:U,stdin:p,stdout:me,stderr:E});if(Be.code!==0)return Be.code;let Ce=(await pe).toString().trim().replace(/^.*\n/s,""),g=K.resolve(t,ue.toPortablePath(Ce));return await le.renamePromise(g,e),0}]]).get(I);if(typeof te>"u")throw new Error("Assertion failed: Unsupported workflow");let ie=await te();if(!(ie===0||typeof ie>"u"))throw le.detachTemp(c),new Yt(58,`Packing the package failed (exit code ${ie}, logs can be found here: ${Ut(r,f,Ct.PATH)})`)})})})}async function _yt(t,e,{project:r}){let s=r.tryWorkspaceByLocator(t);if(s!==null)return E6(s,e);let a=r.storedPackages.get(t.locatorHash);if(!a)throw new Error(`Package for ${Yr(r.configuration,t)} not found in the project`);return await tA.openPromise(async n=>{let c=r.configuration,f=r.configuration.getLinkers(),p={project:r,report:new Ot({stdout:new x0.PassThrough,configuration:c})},h=f.find(P=>P.supportsPackage(a,p));if(!h)throw new Error(`The package ${Yr(r.configuration,a)} isn't supported by any of the available linkers`);let E=await h.findPackageLocation(a,p),C=new Sn(E,{baseFs:n});return(await Ht.find(vt.dot,{baseFs:C})).scripts.has(e)})}async function MT(t,e,r,{cwd:s,project:a,stdin:n,stdout:c,stderr:f}){return await le.mktempPromise(async p=>{let{manifest:h,env:E,cwd:C}=await lye(t,{project:a,binFolder:p,cwd:s,lifecycleScript:e}),S=h.scripts.get(e);if(typeof S>"u")return 1;let P=async()=>await SI(S,r,{cwd:C,env:E,stdin:n,stdout:c,stderr:f});return await(await a.configuration.reduceHook(R=>R.wrapScriptExecution,P,a,t,e,{script:S,args:r,cwd:C,env:E,stdin:n,stdout:c,stderr:f}))()})}async function y6(t,e,r,{cwd:s,project:a,stdin:n,stdout:c,stderr:f}){return await le.mktempPromise(async p=>{let{env:h,cwd:E}=await lye(t,{project:a,binFolder:p,cwd:s});return await SI(e,r,{cwd:E,env:h,stdin:n,stdout:c,stderr:f})})}async function Uyt(t,{binFolder:e,cwd:r,lifecycleScript:s}){let a=await Nv({project:t.project,locator:t.anchoredLocator,binFolder:e,lifecycleScript:s});return await C6(e,await fye(t)),typeof r>"u"&&(r=K.dirname(await le.realpathPromise(K.join(t.cwd,"package.json")))),{manifest:t.manifest,binFolder:e,env:a,cwd:r}}async function lye(t,{project:e,binFolder:r,cwd:s,lifecycleScript:a}){let n=e.tryWorkspaceByLocator(t);if(n!==null)return Uyt(n,{binFolder:r,cwd:s,lifecycleScript:a});let c=e.storedPackages.get(t.locatorHash);if(!c)throw new Error(`Package for ${Yr(e.configuration,t)} not found in the project`);return await tA.openPromise(async f=>{let p=e.configuration,h=e.configuration.getLinkers(),E={project:e,report:new Ot({stdout:new x0.PassThrough,configuration:p})},C=h.find(N=>N.supportsPackage(c,E));if(!C)throw new Error(`The package ${Yr(e.configuration,c)} isn't supported by any of the available linkers`);
`,{stdout:h,stderr:E}=a.getSubprocessStreams(f,{report:s,prefix:Yr(a,t.anchoredLocator),header:p});s.reportInfo(36,`Calling the "${e}" lifecycle script`);let C=await cye(t,e,[],{cwd:r,stdin:n,stdout:h,stderr:E});if(h.end(),E.end(),C!==0)throw le.detachTemp(c),new Yt(36,`${(0,iye.default)(e)} script failed (exit code ${Ut(a,C,Ct.NUMBER)}, logs can be found here: ${Ut(a,f,Ct.PATH)}); run ${Ut(a,`yarn ${e}`,Ct.CODE)} to investigate`)})}async function Hyt(t,e,r){E6(t,e)&&await uye(t,e,r)}function I6(t){let e=K.extname(t);if(e.match(/\.[cm]?[jt]sx?$/))return!0;if(e===".exe"||e===".bin")return!1;let r=Buffer.alloc(4),s;try{s=le.openSync(t,"r")}catch{return!0}try{le.readSync(s,r,0,r.length,0)}finally{le.closeSync(s)}let a=r.readUint32BE();return!(a===3405691582||a===3489328638||a===2135247942||(a&4294901760)===1297743872)}async function _T(t,{project:e}){let r=e.configuration,s=new Map,a=e.storedPackages.get(t.locatorHash);if(!a)throw new Error(`Package for ${Yr(r,t)} not found in the project`);let n=new x0.Writable,c=r.getLinkers(),f={project:e,report:new Ot({configuration:r,stdout:n})},p=new Set([t.locatorHash]);for(let E of a.dependencies.values()){let C=e.storedResolutions.get(E.descriptorHash);if(!C)throw new Error(`Assertion failed: The resolution (${ri(r,E)}) should have been registered`);p.add(C)}let h=await Promise.all(Array.from(p,async E=>{let C=e.storedPackages.get(E);if(!C)throw new Error(`Assertion failed: The package (${E}) should have been registered`);if(C.bin.size===0)return Yl.skip;let S=c.find(I=>I.supportsPackage(C,f));if(!S)return Yl.skip;let P=null;try{P=await S.findPackageLocation(C,f)}catch(I){if(I.code==="LOCATOR_NOT_INSTALLED")return Yl.skip;throw I}return{dependency:C,packageLocation:P}}));for(let E of h){if(E===Yl.skip)continue;let{dependency:C,packageLocation:S}=E;for(let[P,I]of C.bin){let R=K.resolve(S,I);s.set(P,[C,ue.fromPortablePath(R),I6(R)])}}return s}async function fye(t){return await _T(t.anchoredLocator,{project:t.project})}async function C6(t,e){await Promise.all(Array.from(e,([r,[,s,a]])=>a?P0(t,r,process.execPath,[s]):P0(t,r,s,[])))}async function Aye(t,e,r,{cwd:s,project:a,stdin:n,stdout:c,stderr:f,nodeArgs:p=[],packageAccessibleBinaries:h}){h??=await _T(t,{project:a});let E=h.get(e);if(!E)throw new Error(`Binary not found (${e}) for ${Yr(a.configuration,t)}`);return await le.mktempPromise(async C=>{let[,S]=E,P=await Nv({project:a,locator:t,binFolder:C});await C6(P.BERRY_BIN_FOLDER,h);let I=I6(ue.toPortablePath(S))?Yu(process.execPath,[...p,S,...r],{cwd:s,env:P,stdin:n,stdout:c,stderr:f}):Yu(S,r,{cwd:s,env:P,stdin:n,stdout:c,stderr:f}),R;try{R=await I}finally{await le.removePromise(P.BERRY_BIN_FOLDER)}return R.code})}async function jyt(t,e,r,{cwd:s,stdin:a,stdout:n,stderr:c,packageAccessibleBinaries:f}){return await Aye(t.anchoredLocator,e,r,{project:t.project,cwd:s,stdin:a,stdout:n,stderr:c,packageAccessibleBinaries:f})}var iye,sye,x0,oye,Oyt,Lyt,w6=It(()=>{bt();bt();rA();bv();iye=et(d6()),sye=et(Md()),x0=ye("stream");oI();Fc();Fv();Rv();dT();Qc();kc();Np();Yo();oye=(a=>(a.Yarn1="Yarn Classic",a.Yarn2="Yarn",a.Npm="npm",a.Pnpm="pnpm",a))(oye||{});Oyt=2,Lyt=(0,sye.default)(Oyt)});var bI=L((X$t,hye)=>{"use strict";var pye=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"]]);hye.exports=t=>t?Object.keys(t).map(e=>[pye.has(e)?pye.get(e):e,t[e]]).reduce((e,r)=>(e[r[0]]=r[1],e),Object.create(null)):{}});var xI=L(($$t,Bye)=>{"use strict";var gye=typeof process=="object"&&process?process:{stdout:null,stderr:null},qyt=ye("events"),dye=ye("stream"),mye=ye("string_decoder").StringDecoder,qp=Symbol("EOF"),Gp=Symbol("maybeEmitEnd"),k0=Symbol("emittedEnd"),UT=Symbol("emittingEnd"),Ov=Symbol("emittedError"),HT=Symbol("closed"),yye=Symbol("read"),jT=Symbol("flus
2025-04-10 09:51:25 -04:00
`,a=Buffer.byteLength(s),n=Math.floor(Math.log(a)/Math.log(10))+1;return a+n>=Math.pow(10,n)&&(n+=1),n+a+s}};Uv.parse=(t,e,r)=>new Uv(mEt(yEt(t),e),r);var mEt=(t,e)=>e?Object.keys(t).reduce((r,s)=>(r[s]=t[s],r),e):t,yEt=t=>t.replace(/\n$/,"").split(`
2025-04-11 10:05:45 -04:00
`).reduce(EEt,Object.create(null)),EEt=(t,e)=>{let r=parseInt(e,10);if(r!==Buffer.byteLength(e)+1)return t;e=e.substr((r+" ").length);let s=e.split("="),a=s.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!a)return t;let n=s.join("=");return t[a]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(a)?new Date(n*1e3):/^[0-9]+$/.test(n)?+n:n,t};Lye.exports=Uv});var NI=L((fer,Mye)=>{Mye.exports=t=>{let e=t.length-1,r=-1;for(;e>-1&&t.charAt(e)==="/";)r=e,e--;return r===-1?t:t.slice(0,r)}});var ZT=L((Aer,_ye)=>{"use strict";_ye.exports=t=>class extends t{warn(e,r,s={}){this.file&&(s.file=this.file),this.cwd&&(s.cwd=this.cwd),s.code=r instanceof Error&&r.code||e,s.tarCode=e,!this.strict&&s.recoverable!==!1?(r instanceof Error&&(s=Object.assign(r,s),r=r.message),this.emit("warn",s.tarCode,r,s)):r instanceof Error?this.emit("error",Object.assign(r,s)):this.emit("error",Object.assign(new Error(`${e}: ${r}`),s))}}});var $6=L((her,Uye)=>{"use strict";var XT=["|","<",">","?",":"],X6=XT.map(t=>String.fromCharCode(61440+t.charCodeAt(0))),IEt=new Map(XT.map((t,e)=>[t,X6[e]])),CEt=new Map(X6.map((t,e)=>[t,XT[e]]));Uye.exports={encode:t=>XT.reduce((e,r)=>e.split(r).join(IEt.get(r)),t),decode:t=>X6.reduce((e,r)=>e.split(r).join(CEt.get(r)),t)}});var eq=L((ger,jye)=>{var{isAbsolute:wEt,parse:Hye}=ye("path").win32;jye.exports=t=>{let e="",r=Hye(t);for(;wEt(t)||r.root;){let s=t.charAt(0)==="/"&&t.slice(0,4)!=="//?/"?"/":r.root;t=t.substr(s.length),e+=s,r=Hye(t)}return[e,t]}});var Gye=L((der,qye)=>{"use strict";qye.exports=(t,e,r)=>(t&=4095,r&&(t=(t|384)&-19),e&&(t&256&&(t|=64),t&32&&(t|=8),t&4&&(t|=1)),t)});var uq=L((Eer,iEe)=>{"use strict";var Zye=xI(),Xye=zT(),$ye=FI(),sA=ye("fs"),Wye=ye("path"),iA=TI(),BEt=NI(),eEe=(t,e)=>e?(t=iA(t).replace(/^\.(\/|$)/,""),BEt(e)+"/"+t):iA(t),vEt=16*1024*1024,Yye=Symbol("process"),Vye=Symbol("file"),Kye=Symbol("directory"),rq=Symbol("symlink"),Jye=Symbol("hardlink"),Hv=Symbol("header"),$T=Symbol("read"),nq=Symbol("lstat"),eR=Symbol("onlstat"),iq=Symbol("onread"),sq=Symbol("onreadlink"),oq=Symbol("openfile"),aq=Symbol("onopenfile"),F0=Symbol("close"),tR=Symbol("mode"),lq=Symbol("awaitDrain"),tq=Symbol("ondrain"),oA=Symbol("prefix"),zye=Symbol("hadError"),tEe=ZT(),SEt=$6(),rEe=eq(),nEe=Gye(),rR=tEe(class extends Zye{constructor(e,r){if(r=r||{},super(r),typeof e!="string")throw new TypeError("path is required");this.path=iA(e),this.portable=!!r.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=r.maxReadSize||vEt,this.linkCache=r.linkCache||new Map,this.statCache=r.statCache||new Map,this.preservePaths=!!r.preservePaths,this.cwd=iA(r.cwd||process.cwd()),this.strict=!!r.strict,this.noPax=!!r.noPax,this.noMtime=!!r.noMtime,this.mtime=r.mtime||null,this.prefix=r.prefix?iA(r.prefix):null,this.fd=null,this.blockLen=null,this.blockRemain=null,this.buf=null,this.offset=null,this.length=null,this.pos=null,this.remain=null,typeof r.onwarn=="function"&&this.on("warn",r.onwarn);let s=!1;if(!this.preservePaths){let[a,n]=rEe(this.path);a&&(this.path=n,s=a)}this.win32=!!r.win32||process.platform==="win32",this.win32&&(this.path=SEt.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=iA(r.absolute||Wye.resolve(this.cwd,e)),this.path===""&&(this.path="./"),s&&this.warn("TAR_ENTRY_INFO",`stripping ${s} from absolute path`,{entry:this,path:s+this.path}),this.statCache.has(this.absolute)?this[eR](this.statCache.get(this.absolute)):this[nq]()}emit(e,...r){return e==="error"&&(this[zye]=!0),super.emit(e,...r)}[nq](){sA.lstat(this.absolute,(e,r)=>{if(e)return this.emit("error",e);this[eR](r)})}[eR](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=bEt(e),this.emit("stat",e),this[Yye]()}[Yye](){switch(this.type){case"File":return this[Vye]();case"Directory":return this[Kye]();case"SymbolicLink":return this[rq]();default:return this.end()}}[tR](e){return nEe(e,this.type==="Directory",this.portable)}[oA](e){return eEe(e,this.prefix)}[Hv](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new $ye({path:
2025-04-10 09:51:25 -04:00
`}),f},s})});var ks={};Vt(ks,{emitList:()=>ECt,emitTree:()=>ACe,treeNodeToJson:()=>fCe,treeNodeToTreeify:()=>uCe});function uCe(t,{configuration:e}){let r={},s=0,a=(n,c)=>{let f=Array.isArray(n)?n.entries():Object.entries(n);for(let[p,h]of f){if(!h)continue;let{label:E,value:C,children:S}=h,P=[];typeof E<"u"&&P.push(zd(e,E,2)),typeof C<"u"&&P.push(Ut(e,C[0],C[1])),P.length===0&&P.push(zd(e,`${p}`,2));let I=P.join(": ").trim(),R=`\0${s++}\0`,N=c[`${R}${I}`]={};typeof S<"u"&&a(S,N)}};if(typeof t.children>"u")throw new Error("The root node must only contain children");return a(t.children,r),r}function fCe(t){let e=r=>{if(typeof r.children>"u"){if(typeof r.value>"u")throw new Error("Assertion failed: Expected a value to be set if the children are missing");return Zd(r.value[0],r.value[1])}let s=Array.isArray(r.children)?r.children.entries():Object.entries(r.children??{}),a=Array.isArray(r.children)?[]:{};for(let[n,c]of s)c&&(a[ICt(n)]=e(c));return typeof r.value>"u"?a:{value:Zd(r.value[0],r.value[1]),children:a}};return e(t)}function ECt(t,{configuration:e,stdout:r,json:s}){let a=t.map(n=>({value:n}));ACe({children:a},{configuration:e,stdout:r,json:s})}function ACe(t,{configuration:e,stdout:r,json:s,separators:a=0}){if(s){let c=Array.isArray(t.children)?t.children.values():Object.values(t.children??{});for(let f of c)f&&r.write(`${JSON.stringify(fCe(f))}
`);return}let n=(0,cCe.asTree)(uCe(t,{configuration:e}),!1,!1);if(n=n.replace(/\0[0-9]+\0/g,""),a>=1&&(n=n.replace(/^([├└]─)/gm,`\u2502
$1`).replace(/^│\n/,"")),a>=2)for(let c=0;c<2;++c)n=n.replace(/^([│ ].{2}[├│ ].{2}[^\n]+\n)(([│ ]).{2}[├└].{2}[^\n]*\n[│ ].{2}[│ ].{2}[├└]─)/gm,`$1$3 \u2502
2025-04-11 10:05:45 -04:00
$2`).replace(/^│\n/,"");if(a>=3)throw new Error("Only the first two levels are accepted by treeUtils.emitTree");r.write(n)}function ICt(t){return typeof t=="string"?t.replace(/^\0[0-9]+\0/,""):t}var cCe,pCe=It(()=>{cCe=et(lCe());Qc()});var _R,hCe=It(()=>{_R=class{constructor(e){this.releaseFunction=e;this.map=new Map}addOrCreate(e,r){let s=this.map.get(e);if(typeof s<"u"){if(s.refCount<=0)throw new Error(`Race condition in RefCountedMap. While adding a new key the refCount is: ${s.refCount} for ${JSON.stringify(e)}`);return s.refCount++,{value:s.value,release:()=>this.release(e)}}else{let a=r();return this.map.set(e,{refCount:1,value:a}),{value:a,release:()=>this.release(e)}}}release(e){let r=this.map.get(e);if(!r)throw new Error(`Unbalanced calls to release. No known instances of: ${JSON.stringify(e)}`);let s=r.refCount;if(s<=0)throw new Error(`Unbalanced calls to release. Too many release vs alloc refcount would become: ${s-1} of ${JSON.stringify(e)}`);s==1?(this.map.delete(e),this.releaseFunction(r.value)):r.refCount--}}});function tS(t){let e=t.match(CCt);if(!e?.groups)throw new Error("Assertion failed: Expected the checksum to match the requested pattern");let r=e.groups.cacheVersion?parseInt(e.groups.cacheVersion):null;return{cacheKey:e.groups.cacheKey??null,cacheVersion:r,cacheSpec:e.groups.cacheSpec??null,hash:e.groups.hash}}var gCe,aG,lG,UR,Jr,CCt,cG=It(()=>{Ve();bt();bt();rA();gCe=ye("crypto"),aG=et(ye("fs"));hCe();Fc();I0();kc();Yo();lG=YE(process.env.YARN_CACHE_CHECKPOINT_OVERRIDE??process.env.YARN_CACHE_VERSION_OVERRIDE??9),UR=YE(process.env.YARN_CACHE_VERSION_OVERRIDE??10),Jr=class t{constructor(e,{configuration:r,immutable:s=r.get("enableImmutableCache"),check:a=!1}){this.markedFiles=new Set;this.mutexes=new Map;this.refCountedZipFsCache=new _R(e=>{e.discardAndClose()});this.cacheId=`-${(0,gCe.randomBytes)(8).toString("hex")}.tmp`;this.configuration=r,this.cwd=e,this.immutable=s,this.check=a;let{cacheSpec:n,cacheKey:c}=t.getCacheKey(r);this.cacheSpec=n,this.cacheKey=c}static async find(e,{immutable:r,check:s}={}){let a=new t(e.get("cacheFolder"),{configuration:e,immutable:r,check:s});return await a.setup(),a}static getCacheKey(e){let r=e.get("compressionLevel"),s=r!=="mixed"?`c${r}`:"";return{cacheKey:[UR,s].join(""),cacheSpec:s}}get mirrorCwd(){if(!this.configuration.get("enableMirror"))return null;let e=`${this.configuration.get("globalFolder")}/cache`;return e!==this.cwd?e:null}getVersionFilename(e){return`${nI(e)}-${this.cacheKey}.zip`}getChecksumFilename(e,r){let a=tS(r).hash.slice(0,10);return`${nI(e)}-${a}.zip`}isChecksumCompatible(e){if(e===null)return!1;let{cacheVersion:r,cacheSpec:s}=tS(e);if(r===null||r<lG)return!1;let a=this.configuration.get("cacheMigrationMode");return!(r<UR&&a==="always"||s!==this.cacheSpec&&a!=="required-only")}getLocatorPath(e,r){return this.mirrorCwd===null?K.resolve(this.cwd,this.getVersionFilename(e)):r===null?K.resolve(this.cwd,this.getVersionFilename(e)):K.resolve(this.cwd,this.getChecksumFilename(e,r))}getLocatorMirrorPath(e){let r=this.mirrorCwd;return r!==null?K.resolve(r,this.getVersionFilename(e)):null}async setup(){if(!this.configuration.get("enableGlobalCache"))if(this.immutable){if(!await le.existsPromise(this.cwd))throw new Yt(56,"Cache path does not exist.")}else{await le.mkdirPromise(this.cwd,{recursive:!0});let e=K.resolve(this.cwd,".gitignore");await le.changeFilePromise(e,`/.gitignore
2025-04-10 09:51:25 -04:00
*.flock
*.tmp
2025-04-11 10:05:45 -04:00
`)}(this.mirrorCwd||!this.immutable)&&await le.mkdirPromise(this.mirrorCwd||this.cwd,{recursive:!0})}async fetchPackageFromCache(e,r,{onHit:s,onMiss:a,loader:n,...c}){let f=this.getLocatorMirrorPath(e),p=new Yn,h=()=>{let pe=new ps,Be=K.join(vt.root,Z8(e));return pe.mkdirSync(Be,{recursive:!0}),pe.writeJsonSync(K.join(Be,Er.manifest),{name:cn(e),mocked:!0}),pe},E=async(pe,{isColdHit:Be,controlPath:Ce=null})=>{if(Ce===null&&c.unstablePackages?.has(e.locatorHash))return{isValid:!0,hash:null};let g=r&&!Be?tS(r).cacheKey:this.cacheKey,we=!c.skipIntegrityCheck||!r?`${g}/${await SQ(pe)}`:r;if(Ce!==null){let fe=!c.skipIntegrityCheck||!r?`${this.cacheKey}/${await SQ(Ce)}`:r;if(we!==fe)throw new Yt(18,"The remote archive doesn't match the local checksum - has the local cache been corrupted?")}let Ee=null;switch(r!==null&&we!==r&&(this.check?Ee="throw":tS(r).cacheKey!==tS(we).cacheKey?Ee="update":Ee=this.configuration.get("checksumBehavior")),Ee){case null:case"update":return{isValid:!0,hash:we};case"ignore":return{isValid:!0,hash:r};case"reset":return{isValid:!1,hash:r};default:case"throw":throw new Yt(18,"The remote archive doesn't match the expected checksum")}},C=async pe=>{if(!n)throw new Error(`Cache check required but no loader configured for ${Yr(this.configuration,e)}`);let Be=await n(),Ce=Be.getRealPath();Be.saveAndClose(),await le.chmodPromise(Ce,420);let g=await E(pe,{controlPath:Ce,isColdHit:!1});if(!g.isValid)throw new Error("Assertion failed: Expected a valid checksum");return g.hash},S=async()=>{if(f===null||!await le.existsPromise(f)){let pe=await n(),Be=pe.getRealPath();return pe.saveAndClose(),{source:"loader",path:Be}}return{source:"mirror",path:f}},P=async()=>{if(!n)throw new Error(`Cache entry required but missing for ${Yr(this.configuration,e)}`);if(this.immutable)throw new Yt(56,`Cache entry required but missing for ${Yr(this.configuration,e)}`);let{path:pe,source:Be}=await S(),{hash:Ce}=await E(pe,{isColdHit:!0}),g=this.getLocatorPath(e,Ce),we=[];Be!=="mirror"&&f!==null&&we.push(async()=>{let fe=`${f}${this.cacheId}`;await le.copyFilePromise(pe,fe,aG.default.constants.COPYFILE_FICLONE),await le.chmodPromise(fe,420),await le.renamePromise(fe,f)}),(!c.mirrorWriteOnly||f===null)&&we.push(async()=>{let fe=`${g}${this.cacheId}`;await le.copyFilePromise(pe,fe,aG.default.constants.COPYFILE_FICLONE),await le.chmodPromise(fe,420),await le.renamePromise(fe,g)});let Ee=c.mirrorWriteOnly?f??g:g;return await Promise.all(we.map(fe=>fe())),[!1,Ee,Ce]},I=async()=>{let Be=(async()=>{let Ce=c.unstablePackages?.has(e.locatorHash),g=Ce||!r||this.isChecksumCompatible(r)?this.getLocatorPath(e,r):null,we=g!==null?this.markedFiles.has(g)||await p.existsPromise(g):!1,Ee=!!c.mockedPackages?.has(e.locatorHash)&&(!this.check||!we),fe=Ee||we,se=fe?s:a;if(se&&se(),fe){let X=null,De=g;if(!Ee)if(this.check)X=await C(De);else{let Re=await E(De,{isColdHit:!1});if(Re.isValid)X=Re.hash;else return P()}return[Ee,De,X]}else{if(this.immutable&&Ce)throw new Yt(56,`Cache entry required but missing for ${Yr(this.configuration,e)}; consider defining ${he.pretty(this.configuration,"supportedArchitectures",he.Type.CODE)} to cache packages for multiple systems`);return P()}})();this.mutexes.set(e.locatorHash,Be);try{return await Be}finally{this.mutexes.delete(e.locatorHash)}};for(let pe;pe=this.mutexes.get(e.locatorHash);)await pe;let[R,N,U]=await I();R||this.markedFiles.add(N);let W=()=>this.refCountedZipFsCache.addOrCreate(N,()=>R?h():new ps(N,{baseFs:p,readOnly:!0})),te,ie=new oE(()=>p3(()=>(te=W(),te.value),pe=>`Failed to open the cache entry for ${Yr(this.configuration,e)}: ${pe}`),K),Ae=new Hf(N,{baseFs:ie,pathUtils:K}),ce=()=>{te?.release()},me=c.unstablePackages?.has(e.locatorHash)?null:U;return[Ae,ce,me]}},CCt=/^(?:(?<cacheKey>(?<cacheVersion>[0-9]+)(?<cacheSpec>.*))\/)?(?<hash>.*)$/});var HR,dCe=It(()=>{HR=(r=>(r[r.SCRIPT=0]="SCRIPT",r[r.SHELLCODE=1]="SHELLCODE",r))(HR||{})});var wCt,zI,uG=It(()=>{bt();Bc();Np();Yo();wCt=[[/^(git(?:\+(?:https|ssh))?:\/\/.*(?:\.git)?)#(.*)$/,(t,e,r,s)=>`${r}#commit=${s}`],[/^https:\/\/((?:[^/]+?)@)?codeload\
2025-04-10 09:51:25 -04:00
`)}reportProgress(r){return{...Promise.resolve().then(async()=>{for await(let{}of r);}),stop:()=>{}}}reportJson(r){}reportFold(r,s){}async finalize(){this.errorCount>0&&(this.stdout.write(`
`),this.stdout.write(`${Ut(this.configuration,"\u27A4","redBright")} Errors happened when preparing the environment required to run this command.
`),this.suggestInstall&&this.stdout.write(`${Ut(this.configuration,"\u27A4","redBright")} This might be caused by packages being missing from the lockfile, in which case running "yarn install" might help.
`))}formatNameWithHyperlink(r){return m6(r,{configuration:this.configuration,json:!1})}}});var ZI,fG=It(()=>{Yo();ZI=class{constructor(e){this.resolver=e}supportsDescriptor(e,r){return!!(r.project.storedResolutions.get(e.descriptorHash)||r.project.originalPackages.has(bQ(e).locatorHash))}supportsLocator(e,r){return!!(r.project.originalPackages.has(e.locatorHash)&&!r.project.lockfileNeedsRefresh)}shouldPersistResolution(e,r){throw new Error("The shouldPersistResolution method shouldn't be called on the lockfile resolver, which would always answer yes")}bindDescriptor(e,r,s){return e}getResolutionDependencies(e,r){return this.resolver.getResolutionDependencies(e,r)}async getCandidates(e,r,s){let a=s.project.storedResolutions.get(e.descriptorHash);if(a){let c=s.project.originalPackages.get(a);if(c)return[c]}let n=s.project.originalPackages.get(bQ(e).locatorHash);if(n)return[n];throw new Error("Resolution expected from the lockfile data")}async getSatisfying(e,r,s,a){let[n]=await this.getCandidates(e,r,a);return{locators:s.filter(c=>c.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){let s=r.project.originalPackages.get(e.locatorHash);if(!s)throw new Error("The lockfile resolver isn't meant to resolve packages - they should already have been stored into a cache");return s}}});function Xp(){}function BCt(t,e,r,s,a){for(var n=0,c=e.length,f=0,p=0;n<c;n++){var h=e[n];if(h.removed){if(h.value=t.join(s.slice(p,p+h.count)),p+=h.count,n&&e[n-1].added){var C=e[n-1];e[n-1]=e[n],e[n]=C}}else{if(!h.added&&a){var E=r.slice(f,f+h.count);E=E.map(function(P,I){var R=s[p+I];return R.length>P.length?R:P}),h.value=t.join(E)}else h.value=t.join(r.slice(f,f+h.count));f+=h.count,h.added||(p+=h.count)}}var S=e[c-1];return c>1&&typeof S.value=="string"&&(S.added||S.removed)&&t.equals("",S.value)&&(e[c-2].value+=S.value,e.pop()),e}function vCt(t){return{newPos:t.newPos,components:t.components.slice(0)}}function SCt(t,e){if(typeof t=="function")e.callback=t;else if(t)for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}function ICe(t,e,r){return r=SCt(r,{ignoreWhitespace:!0}),dG.diff(t,e,r)}function DCt(t,e,r){return mG.diff(t,e,r)}function jR(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?jR=function(e){return typeof e}:jR=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jR(t)}function AG(t){return xCt(t)||kCt(t)||QCt(t)||TCt()}function xCt(t){if(Array.isArray(t))return pG(t)}function kCt(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function QCt(t,e){if(t){if(typeof t=="string")return pG(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return pG(t,e)}}function pG(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,s=new Array(e);r<e;r++)s[r]=t[r];return s}function TCt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hG(t,e,r,s,a){e=e||[],r=r||[],s&&(t=s(a,t));var n;for(n=0;n<e.length;n+=1)if(e[n]===t)return r[n];var c;if(RCt.call(t)==="[object Array]"){for(e.push(t),c=new Array(t.length),r.push(c),n=0;n<t.length;n+=1)c[n]=hG(t[n],e,r,s,a);return e.pop(),r.pop(),c}if(t&&t.toJSON&&(t=t.toJSON()),jR(t)==="object"&&t!==null){e.push(t),c={},r.push(c);var f=[],p;for(p in t)t.hasOwnProperty(p)&&f.push(p);for(f.sort(),n=0;n<f.length;n+=1)p=f[n],c[p]=hG(t[p],e,r,s,p);e.pop(),r.pop()}else c=t;return c}function CCe(t,e,r,s,a,n,c){c||(c={}),typeof c.context>"u"&&(c.context=4);var f=DCt(r,s,c);if(!f)return;f.push({value:"",lines:[]});function p(U){return U.map(function(W){return" "+W})}for(var h=[],E=0,C=0,S=[],P=1,I=1,R=function(W){var te=f[W],ie=te.lines||te.value.replace(/\n$/,"").split(`
2025-04-11 10:05:45 -04:00
`);if(te.lines=ie,te.added||te.removed){var Ae;if(!E){var ce=f[W-1];E=P,C=I,ce&&(S=c.context>0?p(ce.lines.slice(-c.context)):[],E-=S.length,C-=S.length)}(Ae=S).push.apply(Ae,AG(ie.map(function(fe){return(te.added?"+":"-")+fe}))),te.added?I+=ie.length:P+=ie.length}else{if(E)if(ie.length<=c.context*2&&W<f.length-2){var me;(me=S).push.apply(me,AG(p(ie)))}else{var pe,Be=Math.min(ie.length,c.context);(pe=S).push.apply(pe,AG(p(ie.slice(0,Be))));var Ce={oldStart:E,oldLines:P-E+Be,newStart:C,newLines:I-C+Be,lines:S};if(W>=f.length-2&&ie.length<=c.context){var g=/\n$/.test(r),we=/\n$/.test(s),Ee=ie.length==0&&S.length>Ce.oldLines;!g&&Ee&&r.length>0&&S.splice(Ce.oldLines,0,"\\ No newline at end of file"),(!g&&!Ee||!we)&&S.push("\\ No newline at end of file")}h.push(Ce),E=0,C=0,S=[]}P+=ie.length,I+=ie.length}},N=0;N<f.length;N++)R(N);return{oldFileName:t,newFileName:e,oldHeader:a,newHeader:n,hunks:h}}var Btr,yCe,ECe,dG,mG,bCt,PCt,RCt,rS,gG,yG=It(()=>{Xp.prototype={diff:function(e,r){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=s.callback;typeof s=="function"&&(a=s,s={}),this.options=s;var n=this;function c(R){return a?(setTimeout(function(){a(void 0,R)},0),!0):R}e=this.castInput(e),r=this.castInput(r),e=this.removeEmpty(this.tokenize(e)),r=this.removeEmpty(this.tokenize(r));var f=r.length,p=e.length,h=1,E=f+p;s.maxEditLength&&(E=Math.min(E,s.maxEditLength));var C=[{newPos:-1,components:[]}],S=this.extractCommon(C[0],r,e,0);if(C[0].newPos+1>=f&&S+1>=p)return c([{value:this.join(r),count:r.length}]);function P(){for(var R=-1*h;R<=h;R+=2){var N=void 0,U=C[R-1],W=C[R+1],te=(W?W.newPos:0)-R;U&&(C[R-1]=void 0);var ie=U&&U.newPos+1<f,Ae=W&&0<=te&&te<p;if(!ie&&!Ae){C[R]=void 0;continue}if(!ie||Ae&&U.newPos<W.newPos?(N=vCt(W),n.pushComponent(N.components,void 0,!0)):(N=U,N.newPos++,n.pushComponent(N.components,!0,void 0)),te=n.extractCommon(N,r,e,R),N.newPos+1>=f&&te+1>=p)return c(BCt(n,N.components,r,e,n.useLongestToken));C[R]=N}h++}if(a)(function R(){setTimeout(function(){if(h>E)return a();P()||R()},0)})();else for(;h<=E;){var I=P();if(I)return I}},pushComponent:function(e,r,s){var a=e[e.length-1];a&&a.added===r&&a.removed===s?e[e.length-1]={count:a.count+1,added:r,removed:s}:e.push({count:1,added:r,removed:s})},extractCommon:function(e,r,s,a){for(var n=r.length,c=s.length,f=e.newPos,p=f-a,h=0;f+1<n&&p+1<c&&this.equals(r[f+1],s[p+1]);)f++,p++,h++;return h&&e.components.push({count:h}),e.newPos=f,p},equals:function(e,r){return this.options.comparator?this.options.comparator(e,r):e===r||this.options.ignoreCase&&e.toLowerCase()===r.toLowerCase()},removeEmpty:function(e){for(var r=[],s=0;s<e.length;s++)e[s]&&r.push(e[s]);return r},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}};Btr=new Xp;yCe=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,ECe=/\S/,dG=new Xp;dG.equals=function(t,e){return this.options.ignoreCase&&(t=t.toLowerCase(),e=e.toLowerCase()),t===e||this.options.ignoreWhitespace&&!ECe.test(t)&&!ECe.test(e)};dG.tokenize=function(t){for(var e=t.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),r=0;r<e.length-1;r++)!e[r+1]&&e[r+2]&&yCe.test(e[r])&&yCe.test(e[r+2])&&(e[r]+=e[r+2],e.splice(r+1,2),r--);return e};mG=new Xp;mG.tokenize=function(t){var e=[],r=t.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(var s=0;s<r.length;s++){var a=r[s];s%2&&!this.options.newlineIsToken?e[e.length-1]+=a:(this.options.ignoreWhitespace&&(a=a.trim()),e.push(a))}return e};bCt=new Xp;bCt.tokenize=function(t){return t.split(/(\S.+?[.!?])(?=\s+|$)/)};PCt=new Xp;PCt.tokenize=function(t){return t.split(/([{}:;,]|\s+)/)};RCt=Object.prototype.toString,rS=new Xp;rS.useLongestToken=!0;rS.tokenize=mG.tokenize;rS.castInput=function(t){var e=this.options,r=e.undefinedReplacement,s=e.stringifyReplacer,a=s===void 0?function(n,c){return typeof c>"u"?r:c}:s;return typeof t=="string"?t:JSON.stringify(hG(t,null,null,a),a," ")};rS.equals=function(t,e){return Xp.prototype.equals.call(rS,t.replace(/,([\r\n])/g,"$1"),e.replace(/,([\r\n])/g,"$1"))};gG=new Xp;gG.tokenize=function(t){return t.s
`;await le.changeFilePromise(r,s,{automaticNewlines:!0}),this.manifest.raw=e}}});function Ywt({project:t,allDescriptors:e,allResolutions:r,allPackages:s,accessibleLocators:a=new Set,optionalBuilds:n=new Set,peerRequirements:c=new Map,peerWarnings:f=[],peerRequirementNodes:p=new Map,volatileDescriptors:h=new Set}){let E=new Map,C=[],S=new Map,P=new Map,I=new Map,R=new Map,N=new Map,U=new Map(t.workspaces.map(ce=>{let me=ce.anchoredLocator.locatorHash,pe=s.get(me);if(typeof pe>"u")throw new Error("Assertion failed: The workspace should have an associated package");return[me,zB(pe)]})),W=()=>{let ce=le.mktempSync(),me=K.join(ce,"stacktrace.log"),pe=String(C.length+1).length,Be=C.map((Ce,g)=>`${`${g+1}.`.padStart(pe," ")} ${cl(Ce)}
`).join("");throw le.writeFileSync(me,Be),le.detachTemp(ce),new Yt(45,`Encountered a stack overflow when resolving peer dependencies; cf ${ue.fromPortablePath(me)}`)},te=ce=>{let me=r.get(ce.descriptorHash);if(typeof me>"u")throw new Error("Assertion failed: The resolution should have been registered");let pe=s.get(me);if(!pe)throw new Error("Assertion failed: The package could not be found");return pe},ie=(ce,me,pe,{top:Be,optional:Ce})=>{C.length>1e3&&W(),C.push(me);let g=Ae(ce,me,pe,{top:Be,optional:Ce});return C.pop(),g},Ae=(ce,me,pe,{top:Be,optional:Ce})=>{if(Ce||n.delete(me.locatorHash),a.has(me.locatorHash))return;a.add(me.locatorHash);let g=s.get(me.locatorHash);if(!g)throw new Error(`Assertion failed: The package (${Yr(t.configuration,me)}) should have been registered`);let we=new Set,Ee=new Map,fe=[],se=[],X=[],De=[];for(let Re of Array.from(g.dependencies.values())){if(g.peerDependencies.has(Re.identHash)&&g.locatorHash!==Be)continue;if(Tp(Re))throw new Error("Assertion failed: Virtual packages shouldn't be encountered when virtualizing a branch");h.delete(Re.descriptorHash);let gt=Ce;if(!gt){let ke=g.dependenciesMeta.get(cn(Re));if(typeof ke<"u"){let it=ke.get(null);typeof it<"u"&&it.optional&&(gt=!0)}}let j=r.get(Re.descriptorHash);if(!j)throw new Error(`Assertion failed: The resolution (${ri(t.configuration,Re)}) should have been registered`);let rt=U.get(j)||s.get(j);if(!rt)throw new Error(`Assertion failed: The package (${j}, resolved from ${ri(t.configuration,Re)}) should have been registered`);if(rt.peerDependencies.size===0){ie(Re,rt,new Map,{top:Be,optional:gt});continue}let Fe,Ne,Pe=new Set,Ye=new Map;fe.push(()=>{Fe=J8(Re,me.locatorHash),Ne=z8(rt,me.locatorHash),g.dependencies.set(Re.identHash,Fe),r.set(Fe.descriptorHash,Ne.locatorHash),e.set(Fe.descriptorHash,Fe),s.set(Ne.locatorHash,Ne),xp(R,Ne.locatorHash).add(Fe.descriptorHash),we.add(Ne.locatorHash)}),se.push(()=>{N.set(Ne.locatorHash,Ye);for(let ke of Ne.peerDependencies.values()){let _e=Vl(Ee,ke.identHash,()=>{let x=pe.get(ke.identHash)??null,w=g.dependencies.get(ke.identHash);return!w&&XB(me,ke)&&(ce.identHash===me.identHash?w=ce:(w=On(me,ce.range),e.set(w.descriptorHash,w),r.set(w.descriptorHash,me.locatorHash),h.delete(w.descriptorHash),x=null)),w||(w=On(ke,"missing:")),{subject:me,ident:ke,provided:w,root:!x,requests:new Map,hash:`p${us(me.locatorHash,ke.identHash).slice(0,5)}`}}).provided;if(_e.range==="missing:"&&Ne.dependencies.has(ke.identHash)){Ne.peerDependencies.delete(ke.identHash);continue}if(Ye.set(ke.identHash,{requester:Ne,descriptor:ke,meta:Ne.peerDependenciesMeta.get(cn(ke)),children:new Map}),Ne.dependencies.set(ke.identHash,_e),Tp(_e)){let x=r.get(_e.descriptorHash);xp(I,x).add(Ne.locatorHash)}S.set(_e.identHash,_e),_e.range==="missing:"&&Pe.add(_e.identHash)}Ne.dependencies=new Map(Ws(Ne.dependencies,([ke,it])=>cn(it)))}),X.push(()=>{if(!s.has(Ne.locatorHash))return;let ke=E.get(rt.locatorHash);typeof ke=="number"&&ke>=2&&W();let it=E.get(rt.locatorHash),_e=typeof it<"u"?it+1:1;E.set(rt.locatorHash,_e),ie(Fe,Ne,Ye,{top:Be,optional:gt}),E.set(rt.locatorHash,_e-1)}),De.push(()=>{let ke=r.get(Fe.descriptorHash);if(typeof ke>"u")throw new Error("Assertion failed: Expected the descriptor to be registered");let it=N.get(ke);if(typeof it>"u")throw new Error("Assertion failed: Expected the peer requests to be registered");for(let _e of Ee.values()){let x=it.get(_e.ident.identHash);x&&(_e.requests.set(Fe.descriptorHash,x),p.set(_e.hash,_e),_e.root||pe.get(_e.ident.identHash)?.children.set(Fe.descriptorHash,x))}if(s.has(Ne.locatorHash))for(let _e of Pe)Ne.dependencies.delete(_e)})}for(let Re of[...fe,...se])Re();for(let Re of we){we.delete(Re);let gt=s.get(Re),j=us(rI(gt).locatorHash,...Array.from(gt.dependencies.values(),Pe=>{let Ye=Pe.range!=="missing:"?r.get(Pe.descriptorHash):"missing:";if(typeof Ye>"u")throw new Error(`Assertion failed: Expected the resolution for ${ri(t.configuration,Pe)} to have been registered`);return Ye===Be?`${Ye} (top)`:Ye})),rt=P.get(j);if(typeof rt>"u"){P.set(j,gt);continue}let Fe=xp(R,rt.locatorHash
2025-04-10 09:51:25 -04:00
${[C,S,P].join(`
2025-04-11 10:05:45 -04:00
`)}`)}async setupResolutions(){this.storedResolutions=new Map,this.storedDescriptors=new Map,this.storedPackages=new Map,this.lockFileChecksum=null;let e=K.join(this.cwd,Er.lockfile),r=this.configuration.get("defaultLanguageName");if(le.existsSync(e)){let s=await le.readFilePromise(e,"utf8");this.lockFileChecksum=iwe(s);let a=ls(s);if(a.__metadata){let n=a.__metadata.version,c=a.__metadata.cacheKey;this.lockfileLastVersion=n,this.lockfileNeedsRefresh=n<KR;for(let f of Object.keys(a)){if(f==="__metadata")continue;let p=a[f];if(typeof p.resolution>"u")throw new Error(`Assertion failed: Expected the lockfile entry to have a resolution field (${f})`);let h=Rp(p.resolution,!0),E=new Ht;E.load(p,{yamlCompatibilityMode:!0});let C=E.version,S=E.languageName||r,P=p.linkType.toUpperCase(),I=p.conditions??null,R=E.dependencies,N=E.peerDependencies,U=E.dependenciesMeta,W=E.peerDependenciesMeta,te=E.bin;if(p.checksum!=null){let Ae=typeof c<"u"&&!p.checksum.includes("/")?`${c}/${p.checksum}`:p.checksum;this.storedChecksums.set(h.locatorHash,Ae)}let ie={...h,version:C,languageName:S,linkType:P,conditions:I,dependencies:R,peerDependencies:N,dependenciesMeta:U,peerDependenciesMeta:W,bin:te};this.originalPackages.set(ie.locatorHash,ie);for(let Ae of f.split(jwt)){let ce=C0(Ae);n<=6&&(ce=this.configuration.normalizeDependency(ce),ce=On(ce,ce.range.replace(/^patch:[^@]+@(?!npm(:|%3A))/,"$1npm%3A"))),this.storedDescriptors.set(ce.descriptorHash,ce),this.storedResolutions.set(ce.descriptorHash,h.locatorHash)}}}else s.includes("yarn lockfile v1")&&(this.lockfileLastVersion=-1)}}async setupWorkspaces(){this.workspaces=[],this.workspacesByCwd=new Map,this.workspacesByIdent=new Map;let e=new Set,r=(0,VR.default)(4),s=async(a,n)=>{if(e.has(n))return a;e.add(n);let c=new $I(n,{project:this});await r(()=>c.setup());let f=a.then(()=>{this.addWorkspace(c)});return Array.from(c.workspacesCwds).reduce(s,f)};await s(Promise.resolve(),this.cwd)}addWorkspace(e){let r=this.workspacesByIdent.get(e.anchoredLocator.identHash);if(typeof r<"u")throw new Error(`Duplicate workspace name ${$i(this.configuration,e.anchoredLocator)}: ${ue.fromPortablePath(e.cwd)} conflicts with ${ue.fromPortablePath(r.cwd)}`);this.workspaces.push(e),this.workspacesByCwd.set(e.cwd,e),this.workspacesByIdent.set(e.anchoredLocator.identHash,e)}get topLevelWorkspace(){return this.getWorkspaceByCwd(this.cwd)}tryWorkspaceByCwd(e){K.isAbsolute(e)||(e=K.resolve(this.cwd,e)),e=K.normalize(e).replace(/\/+$/,"");let r=this.workspacesByCwd.get(e);return r||null}getWorkspaceByCwd(e){let r=this.tryWorkspaceByCwd(e);if(!r)throw new Error(`Workspace not found (${e})`);return r}tryWorkspaceByFilePath(e){let r=null;for(let s of this.workspaces)K.relative(s.cwd,e).startsWith("../")||r&&r.cwd.length>=s.cwd.length||(r=s);return r||null}getWorkspaceByFilePath(e){let r=this.tryWorkspaceByFilePath(e);if(!r)throw new Error(`Workspace not found (${e})`);return r}tryWorkspaceByIdent(e){let r=this.workspacesByIdent.get(e.identHash);return typeof r>"u"?null:r}getWorkspaceByIdent(e){let r=this.tryWorkspaceByIdent(e);if(!r)throw new Error(`Workspace not found (${$i(this.configuration,e)})`);return r}tryWorkspaceByDescriptor(e){if(e.range.startsWith(yi.protocol)){let s=e.range.slice(yi.protocol.length);if(s!=="^"&&s!=="~"&&s!=="*"&&!ul(s))return this.tryWorkspaceByCwd(s)}let r=this.tryWorkspaceByIdent(e);return r===null||(Tp(e)&&(e=ZB(e)),!r.accepts(e.range))?null:r}getWorkspaceByDescriptor(e){let r=this.tryWorkspaceByDescriptor(e);if(r===null)throw new Error(`Workspace not found (${ri(this.configuration,e)})`);return r}tryWorkspaceByLocator(e){let r=this.tryWorkspaceByIdent(e);return r===null||(Gu(e)&&(e=rI(e)),r.anchoredLocator.locatorHash!==e.locatorHash)?null:r}getWorkspaceByLocator(e){let r=this.tryWorkspaceByLocator(e);if(!r)throw new Error(`Workspace not found (${Yr(this.configuration,e)})`);return r}deleteDescriptor(e){this.storedResolutions.delete(e),this.storedDescriptors.delete(e)}deleteLocator(e){this.originalPackages.delete(e),this.storedPackages.delete(e),this.accessibleLocators.delete(e)}forgetResolu
2025-04-10 09:51:25 -04:00
`;switch(rt.type){case 0:Fe+=`# Script name: ${rt.script}
`;break;case 1:Fe+=`# Script code: ${rt.script}
2025-04-11 10:05:45 -04:00
`;break}let Ne=null;if(!await le.mktempPromise(async Ye=>{let ke=K.join(Ye,"build.log"),{stdout:it,stderr:_e}=this.configuration.getSubprocessStreams(ke,{header:Fe,prefix:Yr(this.configuration,X),report:r}),x;try{switch(rt.type){case 0:x=await MT(X,rt.script,[],{cwd:j,project:this,stdin:Ne,stdout:it,stderr:_e});break;case 1:x=await y6(X,rt.script,[],{cwd:j,project:this,stdin:Ne,stdout:it,stderr:_e});break}}catch(y){_e.write(y.stack),x=1}if(it.end(),_e.end(),x===0)return!0;le.detachTemp(Ye);let w=`${Yr(this.configuration,X)} couldn't be built successfully (exit code ${Ut(this.configuration,x,Ct.NUMBER)}, logs can be found here: ${Ut(this.configuration,ke,Ct.PATH)})`,b=this.optionalBuilds.has(X.locatorHash);return b?r.reportInfo(9,w):r.reportError(9,w),rye&&r.reportFold(ue.fromPortablePath(ke),le.readFileSync(ke,"utf8")),b}))return!1}return!0});fe.push(...gt,Promise.allSettled(gt).then(j=>{ie.delete(se),j.every(rt=>rt.status==="fulfilled"&&rt.value===!0)&&Ce.set(X.locatorHash,Re)}))}if(await Uu(fe),Ee===ie.size){let se=Array.from(ie).map(X=>{let De=this.storedPackages.get(X);if(!De)throw new Error("Assertion failed: The package should have been registered");return Yr(this.configuration,De)}).join(", ");r.reportError(3,`Some packages have circular dependencies that make their build order unsatisfiable - as a result they won't be built (affected packages are: ${se})`);break}}this.storedBuildState=Ce,this.skippedBuilds=N}async installWithNewReport(e,r){return(await Ot.start({configuration:this.configuration,json:e.json,stdout:e.stdout,forceSectionAlignment:!0,includeLogs:!e.json&&!e.quiet,includeVersion:!0},async a=>{await this.install({...r,report:a})})).exitCode()}async install(e){let r=this.configuration.get("nodeLinker");ze.telemetry?.reportInstall(r);let s=!1;if(await e.report.startTimerPromise("Project validation",{skipIfEmpty:!0},async()=>{this.configuration.get("enableOfflineMode")&&e.report.reportWarning(90,"Offline work is enabled; Yarn won't fetch packages from the remote registry if it can avoid it"),await this.configuration.triggerHook(E=>E.validateProject,this,{reportWarning:(E,C)=>{e.report.reportWarning(E,C)},reportError:(E,C)=>{e.report.reportError(E,C),s=!0}})}),s)return;let a=await this.configuration.getPackageExtensions();for(let E of a.values())for(let[,C]of E)for(let S of C)S.status="inactive";let n=K.join(this.cwd,Er.lockfile),c=null;if(e.immutable)try{c=await le.readFilePromise(n,"utf8")}catch(E){throw E.code==="ENOENT"?new Yt(28,"The lockfile would have been created by this install, which is explicitly forbidden."):E}await e.report.startTimerPromise("Resolution step",async()=>{await this.resolveEverything(e)}),await e.report.startTimerPromise("Post-resolution validation",{skipIfEmpty:!0},async()=>{Kwt(this,e.report);for(let[,E]of a)for(let[,C]of E)for(let S of C)if(S.userProvided){let P=Ut(this.configuration,S,Ct.PACKAGE_EXTENSION);switch(S.status){case"inactive":e.report.reportWarning(68,`${P}: No matching package in the dependency tree; you may not need this rule anymore.`);break;case"redundant":e.report.reportWarning(69,`${P}: This rule seems redundant when applied on the original package; the extension may have been applied upstream.`);break}}if(c!==null){let E=Id(c,this.generateLockfile());if(E!==c){let C=CCe(n,n,c,E,void 0,void 0,{maxEditLength:100});if(C){e.report.reportSeparator();for(let S of C.hunks){e.report.reportInfo(null,`@@ -${S.oldStart},${S.oldLines} +${S.newStart},${S.newLines} @@`);for(let P of S.lines)P.startsWith("+")?e.report.reportError(28,Ut(this.configuration,P,Ct.ADDED)):P.startsWith("-")?e.report.reportError(28,Ut(this.configuration,P,Ct.REMOVED)):e.report.reportInfo(null,Ut(this.configuration,P,"grey"))}e.report.reportSeparator()}throw new Yt(28,"The lockfile would have been modified by this install, which is explicitly forbidden.")}}});for(let E of a.values())for(let[,C]of E)for(let S of C)S.userProvided&&S.status==="active"&&ze.telemetry?.reportPackageExtension(Zd(S,Ct.PACKAGE_EXTENSION));await e.report.startTimerPromise("Fetch step",async()=>{await this.fetchEverything(
2025-04-10 09:51:25 -04:00
`,`# Manual changes might be lost - proceed with caution!
`].join("")}
2025-04-11 10:05:45 -04:00
`+il(r)}async persistLockfile(){let e=K.join(this.cwd,Er.lockfile),r="";try{r=await le.readFilePromise(e,"utf8")}catch{}let s=this.generateLockfile(),a=Id(r,s);a!==r&&(await le.writeFilePromise(e,a),this.lockFileChecksum=iwe(a),this.lockfileNeedsRefresh=!1)}async persistInstallStateFile(){let e=[];for(let c of Object.values(bG))e.push(...c);let r=(0,YR.default)(this,e),s=PG.default.serialize(r),a=us(s);if(this.installStateChecksum===a)return;let n=this.configuration.get("installStatePath");await le.mkdirPromise(K.dirname(n),{recursive:!0}),await le.writeFilePromise(n,await Gwt(s)),this.installStateChecksum=a}async restoreInstallState({restoreLinkersCustomData:e=!0,restoreResolutions:r=!0,restoreBuildState:s=!0}={}){let a=this.configuration.get("installStatePath"),n;try{let c=await Wwt(await le.readFilePromise(a));n=PG.default.deserialize(c),this.installStateChecksum=us(c)}catch{r&&await this.applyLightResolution();return}e&&typeof n.linkersCustomData<"u"&&(this.linkersCustomData=n.linkersCustomData),s&&Object.assign(this,(0,YR.default)(n,bG.restoreBuildState)),r&&(n.lockFileChecksum===this.lockFileChecksum?Object.assign(this,(0,YR.default)(n,bG.restoreResolutions)):await this.applyLightResolution())}async applyLightResolution(){await this.resolveEverything({lockfileOnly:!0,report:new Wi}),await this.persistInstallStateFile()}async persist(){let e=(0,VR.default)(4);await Promise.all([this.persistLockfile(),...this.workspaces.map(r=>e(()=>r.persistManifest()))])}async cacheCleanup({cache:e,report:r}){if(this.configuration.get("enableGlobalCache"))return null;let s=new Set([".gitignore"]);if(!hH(e.cwd,this.cwd)||!await le.existsPromise(e.cwd))return null;let a=[];for(let c of await le.readdirPromise(e.cwd)){if(s.has(c))continue;let f=K.resolve(e.cwd,c);e.markedFiles.has(f)||(e.immutable?r.reportError(56,`${Ut(this.configuration,K.basename(f),"magenta")} appears to be unused and would be marked for deletion, but the cache is immutable`):a.push(le.lstatPromise(f).then(async p=>(await le.removePromise(f),p.size))))}if(a.length===0)return null;let n=await Promise.all(a);return{count:a.length,size:n.reduce((c,f)=>c+f,0)}}}});function Jwt(t){let s=Math.floor(t.timeNow/864e5),a=t.updateInterval*864e5,n=t.state.lastUpdate??t.timeNow+a+Math.floor(a*t.randomInitialInterval),c=n+a,f=t.state.lastTips??s*864e5,p=f+864e5+8*36e5-t.timeZone,h=c<=t.timeNow,E=p<=t.timeNow,C=null;return(h||E||!t.state.lastUpdate||!t.state.lastTips)&&(C={},C.lastUpdate=h?t.timeNow:n,C.lastTips=f,C.blocks=h?{}:t.state.blocks,C.displayedTips=t.state.displayedTips),{nextState:C,triggerUpdate:h,triggerTips:E,nextTips:E?s*864e5:f}}var eC,awe=It(()=>{bt();Rv();I0();pT();kc();Np();eC=class{constructor(e,r){this.values=new Map;this.hits=new Map;this.enumerators=new Map;this.nextTips=0;this.displayedTips=[];this.shouldCommitTips=!1;this.configuration=e;let s=this.getRegistryPath();this.isNew=!le.existsSync(s),this.shouldShowTips=!1,this.sendReport(r),this.startBuffer()}commitTips(){this.shouldShowTips&&(this.shouldCommitTips=!0)}selectTip(e){let r=new Set(this.displayedTips),s=f=>f&&un?eA(un,f):!1,a=e.map((f,p)=>p).filter(f=>e[f]&&s(e[f]?.selector));if(a.length===0)return null;let n=a.filter(f=>!r.has(f));if(n.length===0){let f=Math.floor(a.length*.2);this.displayedTips=f>0?this.displayedTips.slice(-f):[],n=a.filter(p=>!r.has(p))}let c=n[Math.floor(Math.random()*n.length)];return this.displayedTips.push(c),this.commitTips(),e[c]}reportVersion(e){this.reportValue("version",e.replace(/-git\..*/,"-git"))}reportCommandName(e){this.reportValue("commandName",e||"<none>")}reportPluginName(e){this.reportValue("pluginName",e)}reportProject(e){this.reportEnumerator("projectCount",e)}reportInstall(e){this.reportHit("installCount",e)}reportPackageExtension(e){this.reportValue("packageExtension",e)}reportWorkspaceCount(e){this.reportValue("workspaceCount",String(e))}reportDependencyCount(e){this.reportValue("dependencyCount",String(e))}reportValue(e,r){xp(this.values,e).add(r)}reportEnumerator(e,r){xp(this.enumerators,e).add(us(r))}reportHit(e,r="*"){let s=A3(this.hits,e),a=Vl(s,r
`),h=c.length;for(h>0&&c.includes("unstyle")&&(c=[...new Set(["unstyle",...c])].reverse());h-- >0;)f=r(t.styles[c[h]],f,p);return f},a=(n,c,f)=>{t.styles[n]=e({name:n,codes:c}),(t.keys[f]||(t.keys[f]=[])).push(n),Reflect.defineProperty(t,n,{configurable:!0,enumerable:!0,set(h){t.alias(n,h)},get(){let h=E=>s(E,h.stack);return Reflect.setPrototypeOf(h,t),h.stack=this.stack?this.stack.concat(n):[n],h}})};return a("reset",[0,0],"modifier"),a("bold",[1,22],"modifier"),a("dim",[2,22],"modifier"),a("italic",[3,23],"modifier"),a("underline",[4,24],"modifier"),a("inverse",[7,27],"modifier"),a("hidden",[8,28],"modifier"),a("strikethrough",[9,29],"modifier"),a("black",[30,39],"color"),a("red",[31,39],"color"),a("green",[32,39],"color"),a("yellow",[33,39],"color"),a("blue",[34,39],"color"),a("magenta",[35,39],"color"),a("cyan",[36,39],"color"),a("white",[37,39],"color"),a("gray",[90,39],"color"),a("grey",[90,39],"color"),a("bgBlack",[40,49],"bg"),a("bgRed",[41,49],"bg"),a("bgGreen",[42,49],"bg"),a("bgYellow",[43,49],"bg"),a("bgBlue",[44,49],"bg"),a("bgMagenta",[45,49],"bg"),a("bgCyan",[46,49],"bg"),a("bgWhite",[47,49],"bg"),a("blackBright",[90,39],"bright"),a("redBright",[91,39],"bright"),a("greenBright",[92,39],"bright"),a("yellowBright",[93,39],"bright"),a("blueBright",[94,39],"bright"),a("magentaBright",[95,39],"bright"),a("cyanBright",[96,39],"bright"),a("whiteBright",[97,39],"bright"),a("bgBlackBright",[100,49],"bgBright"),a("bgRedBright",[101,49],"bgBright"),a("bgGreenBright",[102,49],"bgBright"),a("bgYellowBright",[103,49],"bgBright"),a("bgBlueBright",[104,49],"bgBright"),a("bgMagentaBright",[105,49],"bgBright"),a("bgCyanBright",[106,49],"bgBright"),a("bgWhiteBright",[107,49],"bgBright"),t.ansiRegex=e1t,t.hasColor=t.hasAnsi=n=>(t.ansiRegex.lastIndex=0,typeof n=="string"&&n!==""&&t.ansiRegex.test(n)),t.alias=(n,c)=>{let f=typeof c=="string"?t[c]:c;if(typeof f!="function")throw new TypeError("Expected alias to be the name of an existing color (string) or a function");f.stack||(Reflect.defineProperty(f,"name",{value:n}),t.styles[n]=f,f.stack=[n]),Reflect.defineProperty(t,n,{configurable:!0,enumerable:!0,set(p){t.alias(n,p)},get(){let p=h=>s(h,p.stack);return Reflect.setPrototypeOf(p,t),p.stack=this.stack?this.stack.concat(f.stack):f.stack,p}})},t.theme=n=>{if(!$wt(n))throw new TypeError("Expected theme to be an object");for(let c of Object.keys(n))t.alias(c,n[c]);return t},t.alias("unstyle",n=>typeof n=="string"&&n!==""?(t.ansiRegex.lastIndex=0,n.replace(t.ansiRegex,"")):""),t.alias("noop",n=>n),t.none=t.clear=t.noop,t.stripColor=t.unstyle,t.symbols=pwe(),t.define=a,t};TG.exports=hwe();TG.exports.create=hwe});var $o=L(pn=>{"use strict";var t1t=Object.prototype.toString,Gc=Ju(),gwe=!1,RG=[],dwe={yellow:"blue",cyan:"red",green:"magenta",black:"white",blue:"yellow",red:"cyan",magenta:"green",white:"black"};pn.longest=(t,e)=>t.reduce((r,s)=>Math.max(r,e?s[e].length:s.length),0);pn.hasColor=t=>!!t&&Gc.hasColor(t);var ZR=pn.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);pn.nativeType=t=>t1t.call(t).slice(8,-1).toLowerCase().replace(/\s/g,"");pn.isAsyncFn=t=>pn.nativeType(t)==="asyncfunction";pn.isPrimitive=t=>t!=null&&typeof t!="object"&&typeof t!="function";pn.resolve=(t,e,...r)=>typeof e=="function"?e.call(t,...r):e;pn.scrollDown=(t=[])=>[...t.slice(1),t[0]];pn.scrollUp=(t=[])=>[t.pop(),...t];pn.reorder=(t=[])=>{let e=t.slice();return e.sort((r,s)=>r.index>s.index?1:r.index<s.index?-1:0),e};pn.swap=(t,e,r)=>{let s=t.length,a=r===s?0:r<0?s-1:r,n=t[e];t[e]=t[a],t[a]=n};pn.width=(t,e=80)=>{let r=t&&t.columns?t.columns:e;return t&&typeof t.getWindowSize=="function"&&(r=t.getWindowSize()[0]),process.platform==="win32"?r-1:r};pn.height=(t,e=20)=>{let r=t&&t.rows?t.rows:e;return t&&typeof t.getWindowSize=="function"&&(r=t.getWindowSize()[1]),r};pn.wordWrap=(t,e={})=>{if(!t)return t;typeof e=="number"&&(e={width:e});let{indent:r="",newline:s=`
`+r,width:a=80}=e,n=(s+r).match(/[^\S\n]/g)||[];a-=n.length;let c=`.{1,${a}}([\\s\\u200B]+|$)|[^\\s\\u200B]+?([\\s\\u200B]+|$)`,f=t.trim(),p=new RegExp(c,"g"),h=f.match(p)||[];return h=h.map(E=>E.replace(/\n$/,"")),e.padEnd&&(h=h.map(E=>E.padEnd(a," "))),e.padStart&&(h=h.map(E=>E.padStart(a," "))),r+h.join(s)};pn.unmute=t=>{let e=t.stack.find(s=>Gc.keys.color.includes(s));return e?Gc[e]:t.stack.find(s=>s.slice(2)==="bg")?Gc[e.slice(2)]:s=>s};pn.pascal=t=>t?t[0].toUpperCase()+t.slice(1):"";pn.inverse=t=>{if(!t||!t.stack)return t;let e=t.stack.find(s=>Gc.keys.color.includes(s));if(e){let s=Gc["bg"+pn.pascal(e)];return s?s.black:t}let r=t.stack.find(s=>s.slice(0,2)==="bg");return r?Gc[r.slice(2).toLowerCase()]||t:Gc.none};pn.complement=t=>{if(!t||!t.stack)return t;let e=t.stack.find(s=>Gc.keys.color.includes(s)),r=t.stack.find(s=>s.slice(0,2)==="bg");if(e&&!r)return Gc[dwe[e]||e];if(r){let s=r.slice(2).toLowerCase(),a=dwe[s];return a&&Gc["bg"+pn.pascal(a)]||t}return Gc.none};pn.meridiem=t=>{let e=t.getHours(),r=t.getMinutes(),s=e>=12?"pm":"am";e=e%12;let a=e===0?12:e,n=r<10?"0"+r:r;return a+":"+n+" "+s};pn.set=(t={},e="",r)=>e.split(".").reduce((s,a,n,c)=>{let f=c.length-1>n?s[a]||{}:r;return!pn.isObject(f)&&n<c.length-1&&(f={}),s[a]=f},t);pn.get=(t={},e="",r)=>{let s=t[e]==null?e.split(".").reduce((a,n)=>a&&a[n],t):t[e];return s??r};pn.mixin=(t,e)=>{if(!ZR(t))return e;if(!ZR(e))return t;for(let r of Object.keys(e)){let s=Object.getOwnPropertyDescriptor(e,r);if(s.hasOwnProperty("value"))if(t.hasOwnProperty(r)&&ZR(s.value)){let a=Object.getOwnPropertyDescriptor(t,r);ZR(a.value)?t[r]=pn.merge({},t[r],e[r]):Reflect.defineProperty(t,r,s)}else Reflect.defineProperty(t,r,s);else Reflect.defineProperty(t,r,s)}return t};pn.merge=(...t)=>{let e={};for(let r of t)pn.mixin(e,r);return e};pn.mixinEmitter=(t,e)=>{let r=e.constructor.prototype;for(let s of Object.keys(r)){let a=r[s];typeof a=="function"?pn.define(t,s,a.bind(e)):pn.define(t,s,a)}};pn.onExit=t=>{let e=(r,s)=>{gwe||(gwe=!0,RG.forEach(a=>a()),r===!0&&process.exit(128+s))};RG.length===0&&(process.once("SIGTERM",e.bind(null,!0,15)),process.once("SIGINT",e.bind(null,!0,2)),process.once("exit",e)),RG.push(t)};pn.define=(t,e,r)=>{Reflect.defineProperty(t,e,{value:r})};pn.defineExport=(t,e,r)=>{let s;Reflect.defineProperty(t,e,{enumerable:!0,configurable:!0,set(a){s=a},get(){return s?s():r()}})}});var mwe=L(iC=>{"use strict";iC.ctrl={a:"first",b:"backward",c:"cancel",d:"deleteForward",e:"last",f:"forward",g:"reset",i:"tab",k:"cutForward",l:"reset",n:"newItem",m:"cancel",j:"submit",p:"search",r:"remove",s:"save",u:"undo",w:"cutLeft",x:"toggleCursor",v:"paste"};iC.shift={up:"shiftUp",down:"shiftDown",left:"shiftLeft",right:"shiftRight",tab:"prev"};iC.fn={up:"pageUp",down:"pageDown",left:"pageLeft",right:"pageRight",delete:"deleteForward"};iC.option={b:"backward",f:"forward",d:"cutRight",left:"cutLeft",up:"altUp",down:"altDown"};iC.keys={pageup:"pageUp",pagedown:"pageDown",home:"home",end:"end",cancel:"cancel",delete:"deleteForward",backspace:"delete",down:"down",enter:"submit",escape:"cancel",left:"left",space:"space",number:"number",return:"submit",right:"right",tab:"next",up:"up"}});var Iwe=L((ynr,Ewe)=>{"use strict";var ywe=ye("readline"),r1t=mwe(),n1t=/^(?:\x1b)([a-zA-Z0-9])$/,i1t=/^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,s1t={OP:"f1",OQ:"f2",OR:"f3",OS:"f4","[11~":"f1","[12~":"f2","[13~":"f3","[14~":"f4","[[A":"f1","[[B":"f2","[[C":"f3","[[D":"f4","[[E":"f5","[15~":"f5","[17~":"f6","[18~":"f7","[19~":"f8","[20~":"f9","[21~":"f10","[23~":"f11","[24~":"f12","[A":"up","[B":"down","[C":"right","[D":"left","[E":"clear","[F":"end","[H":"home",OA:"up",OB:"down",OC:"right",OD:"left",OE:"clear",OF:"end",OH:"home","[1~":"home","[2~":"insert","[3~":"delete","[4~":"end","[5~":"pageup","[6~":"pagedown","[[5~":"pageup","[[6~":"pagedown","[7~":"home","[8~":"end","[a":"up","[b":"down","[c":"right","[d":"left","[e":"clear","[2$":"insert","[3$":"delete","[5$":"pageup","[6$":"pagedown","[7$":"home","[8$":"end",Oa:"up",Ob:"down",Oc:"right",Od:"left",Oe:"clear","
`)s.name="enter";else if(t===" ")s.name="tab";else if(t==="\b"||t==="\x7F"||t==="\x1B\x7F"||t==="\x1B\b")s.name="backspace",s.meta=t.charAt(0)==="\x1B";else if(t==="\x1B"||t==="\x1B\x1B")s.name="escape",s.meta=t.length===2;else if(t===" "||t==="\x1B ")s.name="space",s.meta=t.length===2;else if(t<="")s.name=String.fromCharCode(t.charCodeAt(0)+97-1),s.ctrl=!0;else if(t.length===1&&t>="0"&&t<="9")s.name="number";else if(t.length===1&&t>="a"&&t<="z")s.name=t;else if(t.length===1&&t>="A"&&t<="Z")s.name=t.toLowerCase(),s.shift=!0;else if(r=n1t.exec(t))s.meta=!0,s.shift=/^[A-Z]$/.test(r[1]);else if(r=i1t.exec(t)){let a=[...t];a[0]==="\x1B"&&a[1]==="\x1B"&&(s.option=!0);let n=[r[1],r[2],r[4],r[6]].filter(Boolean).join(""),c=(r[3]||r[5]||1)-1;s.ctrl=!!(c&4),s.meta=!!(c&10),s.shift=!!(c&1),s.code=n,s.name=s1t[n],s.shift=o1t(n)||s.shift,s.ctrl=a1t(n)||s.ctrl}return s};XR.listen=(t={},e)=>{let{stdin:r}=t;if(!r||r!==process.stdin&&!r.isTTY)throw new Error("Invalid stream passed");let s=ywe.createInterface({terminal:!0,input:r});ywe.emitKeypressEvents(r,s);let a=(f,p)=>e(f,XR(f,p),s),n=r.isRaw;return r.isTTY&&r.setRawMode(!0),r.on("keypress",a),s.resume(),()=>{r.isTTY&&r.setRawMode(n),r.removeListener("keypress",a),s.pause(),s.close()}};XR.action=(t,e,r)=>{let s={...r1t,...r};return e.ctrl?(e.action=s.ctrl[e.name],e):e.option&&s.option?(e.action=s.option[e.name],e):e.shift?(e.action=s.shift[e.name],e):(e.action=s.keys[e.name],e)};Ewe.exports=XR});var wwe=L((Enr,Cwe)=>{"use strict";Cwe.exports=t=>{t.timers=t.timers||{};let e=t.options.timers;if(e)for(let r of Object.keys(e)){let s=e[r];typeof s=="number"&&(s={interval:s}),l1t(t,r,s)}};function l1t(t,e,r={}){let s=t.timers[e]={name:e,start:Date.now(),ms:0,tick:0},a=r.interval||120;s.frames=r.frames||[],s.loading=!0;let n=setInterval(()=>{s.ms=Date.now()-s.start,s.tick++,t.render()},a);return s.stop=()=>{s.loading=!1,clearInterval(n)},Reflect.defineProperty(s,"interval",{value:n}),t.once("close",()=>s.stop()),s.stop}});var vwe=L((Inr,Bwe)=>{"use strict";var{define:c1t,width:u1t}=$o(),FG=class{constructor(e){let r=e.options;c1t(this,"_prompt",e),this.type=e.type,this.name=e.name,this.message="",this.header="",this.footer="",this.error="",this.hint="",this.input="",this.cursor=0,this.index=0,this.lines=0,this.tick=0,this.prompt="",this.buffer="",this.width=u1t(r.stdout||process.stdout),Object.assign(this,r),this.name=this.name||this.message,this.message=this.message||this.name,this.symbols=e.symbols,this.styles=e.styles,this.required=new Set,this.cancelled=!1,this.submitted=!1}clone(){let e={...this};return e.status=this.status,e.buffer=Buffer.from(e.buffer),delete e.clone,e}set color(e){this._color=e}get color(){let e=this.prompt.styles;if(this.cancelled)return e.cancelled;if(this.submitted)return e.submitted;let r=this._color||e[this.status];return typeof r=="function"?r:e.pending}set loading(e){this._loading=e}get loading(){return typeof this._loading=="boolean"?this._loading:this.loadingChoices?"choices":!1}get status(){return this.cancelled?"cancelled":this.submitted?"submitted":"pending"}};Bwe.exports=FG});var Dwe=L((Cnr,Swe)=>{"use strict";var NG=$o(),mo=Ju(),OG={default:mo.noop,noop:mo.noop,set inverse(t){this._inverse=t},get inverse(){return this._inverse||NG.inverse(this.primary)},set complement(t){this._complement=t},get complement(){return this._complement||NG.complement(this.primary)},primary:mo.cyan,success:mo.green,danger:mo.magenta,strong:mo.bold,warning:mo.yellow,muted:mo.dim,disabled:mo.gray,dark:mo.dim.gray,underline:mo.underline,set info(t){this._info=t},get info(){return this._info||this.primary},set em(t){this._em=t},get em(){return this._em||this.primary.underline},set heading(t){this._heading=t},get heading(){return this._heading||this.muted.underline},set pending(t){this._pending=t},get pending(){return this._pending||this.primary},set submitted(t){this._submitted=t},get submitted(){return this._submitted||this.success},set cancelled(t){this._cancelled=t},get cancelled(){return this._cancelled||this.danger},set typing(t){this._typing=t},get typing(){return this._
2025-04-10 09:51:25 -04:00
`),h=p[0],E=p[p.length-1],S=(s+(r?" "+r:"")).length,P=S<h.length?h.slice(S+1):"";return{header:c,prompt:h,after:P,rest:p.slice(1),last:E}}async submit(){this.state.submitted=!0,this.state.validating=!0,this.options.onSubmit&&await this.options.onSubmit.call(this,this.name,this.value,this);let e=this.state.error||await this.validate(this.value,this.state);if(e!==!0){let r=`
`+this.symbols.pointer+" ";typeof e=="string"?r+=e.trim():r+="Invalid input",this.state.error=`
`+this.styles.danger(r),this.state.submitted=!1,await this.render(),await this.alert(),this.state.validating=!1,this.state.error=void 0;return}this.state.validating=!1,await this.render(),await this.close(),this.value=await this.result(this.value),this.emit("submit",this.value)}async cancel(e){this.state.cancelled=this.state.submitted=!0,await this.render(),await this.close(),typeof this.options.onCancel=="function"&&await this.options.onCancel.call(this,this.name,this.value,this),this.emit("cancel",await this.error(e))}async close(){this.state.closed=!0;try{let e=this.sections(),r=Math.ceil(e.prompt.length/this.width);e.rest&&this.write(vm.cursor.down(e.rest.length)),this.write(`
`.repeat(r))}catch{}this.emit("close")}start(){!this.stop&&this.options.show!==!1&&(this.stop=jG.listen(this,this.keypress.bind(this)),this.once("close",this.stop))}async skip(){return this.skipped=this.options.skip===!0,typeof this.options.skip=="function"&&(this.skipped=await this.options.skip.call(this,this.name,this.value)),this.skipped}async initialize(){let{format:e,options:r,result:s}=this;if(this.format=()=>e.call(this,this.value),this.result=()=>s.call(this,this.value),typeof r.initial=="function"&&(this.initial=await r.initial.call(this,this)),typeof r.onRun=="function"&&await r.onRun.call(this,this),typeof r.onSubmit=="function"){let a=r.onSubmit.bind(this),n=this.submit.bind(this);delete this.options.onSubmit,this.submit=async()=>(await a(this.name,this.value,this),n())}await this.start(),await this.render()}render(){throw new Error("expected prompt to have a custom render method")}run(){return new Promise(async(e,r)=>{if(this.once("submit",e),this.once("cancel",r),await this.skip())return this.render=()=>{},this.submit();await this.initialize(),this.emit("run")})}async element(e,r,s){let{options:a,state:n,symbols:c,timers:f}=this,p=f&&f[e];n.timer=p;let h=a[e]||n[e]||c[e],E=r&&r[e]!=null?r[e]:await h;if(E==="")return E;let C=await this.resolve(E,n,r,s);return!C&&r&&r[e]?this.resolve(h,n,r,s):C}async prefix(){let e=await this.element("prefix")||this.symbols,r=this.timers&&this.timers.prefix,s=this.state;return s.timer=r,hl.isObject(e)&&(e=e[s.status]||e.pending),hl.hasColor(e)?e:(this.styles[s.status]||this.styles.pending)(e)}async message(){let e=await this.element("message");return hl.hasColor(e)?e:this.styles.strong(e)}async separator(){let e=await this.element("separator")||this.symbols,r=this.timers&&this.timers.separator,s=this.state;s.timer=r;let a=e[s.status]||e.pending||s.separator,n=await this.resolve(a,s);return hl.isObject(n)&&(n=n[s.status]||n.pending),hl.hasColor(n)?n:this.styles.muted(n)}async pointer(e,r){let s=await this.element("pointer",e,r);if(typeof s=="string"&&hl.hasColor(s))return s;if(s){let a=this.styles,n=this.index===r,c=n?a.primary:h=>h,f=await this.resolve(s[n?"on":"off"]||s,this.state),p=hl.hasColor(f)?f:c(f);return n?p:" ".repeat(f.length)}}async indicator(e,r){let s=await this.element("indicator",e,r);if(typeof s=="string"&&hl.hasColor(s))return s;if(s){let a=this.styles,n=e.enabled===!0,c=n?a.success:a.dark,f=s[n?"on":"off"]||s;return hl.hasColor(f)?f:c(f)}return""}body(){return null}footer(){if(this.state.status==="pending")return this.element("footer")}header(){if(this.state.status==="pending")return this.element("header")}async hint(){if(this.state.status==="pending"&&!this.isValue(this.state.input)){let e=await this.element("hint");return hl.hasColor(e)?e:this.styles.muted(e)}}error(e){return this.state.submitted?"":e||this.state.error}format(e){return e}result(e){return e}validate(e){return this.options.required===!0?this.isValue(e):!0}isValue(e){return e!=null&&e!==""}resolve(e,...r){return hl.resolve(this,e,...r)}get base(){return t.prototype}get style(){return this.styles[this.state.status]}get height(){return this.options.rows||hl.height(this.stdout,25)}get width(){return this.options.columns||hl.width(this.stdout,80)}get size(){return{width:this.width,height:this.height}}set cursor(e){this.state.cursor=e}get cursor(){return this.state.cursor}set input(e){this.state.input=e}get input(){return this.state.input}set value(e){this.state.value=e}get value(){let{input:e,value:r}=this.state,s=[r,e].find(this.isValue.bind(this));return this.isValue(s)?s:this.initial}static get prompt(){return e=>new this(e).run()}};function I1t(t){let e=a=>t[a]===void 0||typeof t[a]=="function",r=["actions","choices","initial","margin","roles","styles","symbols","theme","timers","value"],s=["body","footer","error","header","hint","indicator","message","prefix","separator","skip"];for(let a of Object.keys(t.options)){if(r.includes(a)||/^on[A-Z]/.test(a))continue;let n=t.options[a];typeof n=="function"&&e(a)?s.includes(a)||(t[a]=n.bind(t)):typeof t[a]!="function"&&(t[a]=n)}}function C1t(t){ty
2025-04-11 10:05:45 -04:00
`:" ",s=[];for(let a=0;a<4;a++){let n=r(a);e[a]?s.push(n.repeat(e[a])):s.push("")}return s}Lwe.exports=qG});var Uwe=L((Snr,_we)=>{"use strict";var w1t=$o(),Mwe={default(t,e){return e},checkbox(t,e){throw new Error("checkbox role is not implemented yet")},editable(t,e){throw new Error("editable role is not implemented yet")},expandable(t,e){throw new Error("expandable role is not implemented yet")},heading(t,e){return e.disabled="",e.indicator=[e.indicator," "].find(r=>r!=null),e.message=e.message||"",e},input(t,e){throw new Error("input role is not implemented yet")},option(t,e){return Mwe.default(t,e)},radio(t,e){throw new Error("radio role is not implemented yet")},separator(t,e){return e.disabled="",e.indicator=[e.indicator," "].find(r=>r!=null),e.message=e.message||t.symbols.line.repeat(5),e},spacer(t,e){return e}};_we.exports=(t,e={})=>{let r=w1t.merge({},Mwe,e.roles);return r[t]||r.default}});var oS=L((Dnr,qwe)=>{"use strict";var B1t=Ju(),v1t=sC(),S1t=Uwe(),$R=$o(),{reorder:GG,scrollUp:D1t,scrollDown:b1t,isObject:Hwe,swap:P1t}=$R,WG=class extends v1t{constructor(e){super(e),this.cursorHide(),this.maxSelected=e.maxSelected||1/0,this.multiple=e.multiple||!1,this.initial=e.initial||0,this.delay=e.delay||0,this.longest=0,this.num=""}async initialize(){typeof this.options.initial=="function"&&(this.initial=await this.options.initial.call(this)),await this.reset(!0),await super.initialize()}async reset(){let{choices:e,initial:r,autofocus:s,suggest:a}=this.options;if(this.state._choices=[],this.state.choices=[],this.choices=await Promise.all(await this.toChoices(e)),this.choices.forEach(n=>n.enabled=!1),typeof a!="function"&&this.selectable.length===0)throw new Error("At least one choice must be selectable");Hwe(r)&&(r=Object.keys(r)),Array.isArray(r)?(s!=null&&(this.index=this.findIndex(s)),r.forEach(n=>this.enable(this.find(n))),await this.render()):(s!=null&&(r=s),typeof r=="string"&&(r=this.findIndex(r)),typeof r=="number"&&r>-1&&(this.index=Math.max(0,Math.min(r,this.choices.length)),this.enable(this.find(this.index)))),this.isDisabled(this.focused)&&await this.down()}async toChoices(e,r){this.state.loadingChoices=!0;let s=[],a=0,n=async(c,f)=>{typeof c=="function"&&(c=await c.call(this)),c instanceof Promise&&(c=await c);for(let p=0;p<c.length;p++){let h=c[p]=await this.toChoice(c[p],a++,f);s.push(h),h.choices&&await n(h.choices,h)}return s};return n(e,r).then(c=>(this.state.loadingChoices=!1,c))}async toChoice(e,r,s){if(typeof e=="function"&&(e=await e.call(this,this)),e instanceof Promise&&(e=await e),typeof e=="string"&&(e={name:e}),e.normalized)return e;e.normalized=!0;let a=e.value;if(e=S1t(e.role,this.options)(this,e),typeof e.disabled=="string"&&!e.hint&&(e.hint=e.disabled,e.disabled=!0),e.disabled===!0&&e.hint==null&&(e.hint="(disabled)"),e.index!=null)return e;e.name=e.name||e.key||e.title||e.value||e.message,e.message=e.message||e.name||"",e.value=[e.value,e.name].find(this.isValue.bind(this)),e.input="",e.index=r,e.cursor=0,$R.define(e,"parent",s),e.level=s?s.level+1:1,e.indent==null&&(e.indent=s?s.indent+" ":e.indent||""),e.path=s?s.path+"."+e.name:e.name,e.enabled=!!(this.multiple&&!this.isDisabled(e)&&(e.enabled||this.isSelected(e))),this.isDisabled(e)||(this.longest=Math.max(this.longest,B1t.unstyle(e.message).length));let c={...e};return e.reset=(f=c.input,p=c.value)=>{for(let h of Object.keys(c))e[h]=c[h];e.input=f,e.value=p},a==null&&typeof e.initial=="function"&&(e.input=await e.initial.call(this,this.state,e,r)),e}async onChoice(e,r){this.emit("choice",e,r,this),typeof e.onChoice=="function"&&await e.onChoice.call(this,this.state,e,r)}async addChoice(e,r,s){let a=await this.toChoice(e,r,s);return this.choices.push(a),this.index=this.choices.length-1,this.limit=this.choices.length,a}async newItem(e,r,s){let a={name:"New choice name?",editable:!0,newChoice:!0,...e},n=await this.addChoice(a,r,s);return n.updateChoice=()=>{delete n.newChoice,n.name=n.message=n.input,n.input="",n.cursor=0},this.render()}indent(e){return e.indent==null?e.level>1?" ".repeat(e.level-1):"":e.indent}dispatch(e,r){if(thi
2025-04-10 09:51:25 -04:00
`),a;return this.options.choicesHeader&&(a=await this.resolve(this.options.choicesHeader,this.state)),[a,s].filter(Boolean).join(`
`)}format(){return!this.state.submitted||this.state.cancelled?"":Array.isArray(this.selected)?this.selected.map(e=>this.styles.primary(e.name)).join(", "):this.styles.primary(this.selected.name)}async render(){let{submitted:e,size:r}=this.state,s="",a=await this.header(),n=await this.prefix(),c=await this.separator(),f=await this.message();this.options.promptLine!==!1&&(s=[n,f,c,""].join(" "),this.state.prompt=s);let p=await this.format(),h=await this.error()||await this.hint(),E=await this.renderChoices(),C=await this.footer();p&&(s+=p),h&&!s.includes(h)&&(s+=" "+h),e&&!p&&!E.trim()&&this.multiple&&this.emptyError!=null&&(s+=this.styles.danger(this.emptyError)),this.clear(r),this.write([a,s,E,C].filter(Boolean).join(`
2025-04-11 10:05:45 -04:00
`)),this.write(this.margin[2]),this.restore()}};Gwe.exports=VG});var Ywe=L((Pnr,Wwe)=>{"use strict";var k1t=G0(),Q1t=(t,e)=>{let r=t.toLowerCase();return s=>{let n=s.toLowerCase().indexOf(r),c=e(s.slice(n,n+r.length));return n>=0?s.slice(0,n)+c+s.slice(n+r.length):s}},KG=class extends k1t{constructor(e){super(e),this.cursorShow()}moveCursor(e){this.state.cursor+=e}dispatch(e){return this.append(e)}space(e){return this.options.multiple?super.space(e):this.append(e)}append(e){let{cursor:r,input:s}=this.state;return this.input=s.slice(0,r)+e+s.slice(r),this.moveCursor(1),this.complete()}delete(){let{cursor:e,input:r}=this.state;return r?(this.input=r.slice(0,e-1)+r.slice(e),this.moveCursor(-1),this.complete()):this.alert()}deleteForward(){let{cursor:e,input:r}=this.state;return r[e]===void 0?this.alert():(this.input=`${r}`.slice(0,e)+`${r}`.slice(e+1),this.complete())}number(e){return this.append(e)}async complete(){this.completing=!0,this.choices=await this.suggest(this.input,this.state._choices),this.state.limit=void 0,this.index=Math.min(Math.max(this.visible.length-1,0),this.index),await this.render(),this.completing=!1}suggest(e=this.input,r=this.state._choices){if(typeof this.options.suggest=="function")return this.options.suggest.call(this,e,r);let s=e.toLowerCase();return r.filter(a=>a.message.toLowerCase().includes(s))}pointer(){return""}format(){if(!this.focused)return this.input;if(this.options.multiple&&this.state.submitted)return this.selected.map(e=>this.styles.primary(e.message)).join(", ");if(this.state.submitted){let e=this.value=this.input=this.focused.value;return this.styles.primary(e)}return this.input}async render(){if(this.state.status!=="pending")return super.render();let e=this.options.highlight?this.options.highlight.bind(this):this.styles.placeholder,r=Q1t(this.input,e),s=this.choices;this.choices=s.map(a=>({...a,message:r(a.message)})),await super.render(),this.choices=s}submit(){return this.options.multiple&&(this.value=this.selected.map(e=>e.name)),super.submit()}};Wwe.exports=KG});var zG=L((xnr,Vwe)=>{"use strict";var JG=$o();Vwe.exports=(t,e={})=>{t.cursorHide();let{input:r="",initial:s="",pos:a,showCursor:n=!0,color:c}=e,f=c||t.styles.placeholder,p=JG.inverse(t.styles.primary),h=R=>p(t.styles.black(R)),E=r,C=" ",S=h(C);if(t.blink&&t.blink.off===!0&&(h=R=>R,S=""),n&&a===0&&s===""&&r==="")return h(C);if(n&&a===0&&(r===s||r===""))return h(s[0])+f(s.slice(1));s=JG.isPrimitive(s)?`${s}`:"",r=JG.isPrimitive(r)?`${r}`:"";let P=s&&s.startsWith(r)&&s!==r,I=P?h(s[r.length]):S;if(a!==r.length&&n===!0&&(E=r.slice(0,a)+h(r[a])+r.slice(a+1),I=""),n===!1&&(I=""),P){let R=t.styles.unstyle(E+I);return E+I+f(s.slice(R.length))}return E+I}});var eF=L((knr,Kwe)=>{"use strict";var T1t=Ju(),R1t=G0(),F1t=zG(),ZG=class extends R1t{constructor(e){super({...e,multiple:!0}),this.type="form",this.initial=this.options.initial,this.align=[this.options.align,"right"].find(r=>r!=null),this.emptyError="",this.values={}}async reset(e){return await super.reset(),e===!0&&(this._index=this.index),this.index=this._index,this.values={},this.choices.forEach(r=>r.reset&&r.reset()),this.render()}dispatch(e){return!!e&&this.append(e)}append(e){let r=this.focused;if(!r)return this.alert();let{cursor:s,input:a}=r;return r.value=r.input=a.slice(0,s)+e+a.slice(s),r.cursor++,this.render()}delete(){let e=this.focused;if(!e||e.cursor<=0)return this.alert();let{cursor:r,input:s}=e;return e.value=e.input=s.slice(0,r-1)+s.slice(r),e.cursor--,this.render()}deleteForward(){let e=this.focused;if(!e)return this.alert();let{cursor:r,input:s}=e;if(s[r]===void 0)return this.alert();let a=`${s}`.slice(0,r)+`${s}`.slice(r+1);return e.value=e.input=a,this.render()}right(){let e=this.focused;return e?e.cursor>=e.input.length?this.alert():(e.cursor++,this.render()):this.alert()}left(){let e=this.focused;return e?e.cursor<=0?this.alert():(e.cursor--,this.render()):this.alert()}space(e,r){return this.dispatch(e,r)}number(e,r){return this.dispatch(e,r)}next(){let e=this.focused;if(!e)return this.alert();let{initial:r,input:s}=e;return r&&r.startsWith(s)&&s!
`)),this.restore()}set value(e){super.value=e}get value(){return this.cast(super.value)}};e1e.exports=$G});var r1e=L((Fnr,t1e)=>{"use strict";var j1t=tF(),e5=class extends j1t{constructor(e){super(e),this.default=this.options.default||(this.initial?"(Y/n)":"(y/N)")}};t1e.exports=e5});var i1e=L((Nnr,n1e)=>{"use strict";var q1t=G0(),G1t=eF(),oC=G1t.prototype,t5=class extends q1t{constructor(e){super({...e,multiple:!0}),this.align=[this.options.align,"left"].find(r=>r!=null),this.emptyError="",this.values={}}dispatch(e,r){let s=this.focused,a=s.parent||{};return!s.editable&&!a.editable&&(e==="a"||e==="i")?super[e]():oC.dispatch.call(this,e,r)}append(e,r){return oC.append.call(this,e,r)}delete(e,r){return oC.delete.call(this,e,r)}space(e){return this.focused.editable?this.append(e):super.space()}number(e){return this.focused.editable?this.append(e):super.number(e)}next(){return this.focused.editable?oC.next.call(this):super.next()}prev(){return this.focused.editable?oC.prev.call(this):super.prev()}async indicator(e,r){let s=e.indicator||"",a=e.editable?s:super.indicator(e,r);return await this.resolve(a,this.state,e,r)||""}indent(e){return e.role==="heading"?"":e.editable?" ":" "}async renderChoice(e,r){return e.indent="",e.editable?oC.renderChoice.call(this,e,r):super.renderChoice(e,r)}error(){return""}footer(){return this.state.error}async validate(){let e=!0;for(let r of this.choices){if(typeof r.validate!="function"||r.role==="heading")continue;let s=r.parent?this.value[r.parent.name]:this.value;if(r.editable?s=r.value===r.name?r.initial||"":r.value:this.isDisabled(r)||(s=r.enabled===!0),e=await r.validate(s,this.state),e!==!0)break}return e!==!0&&(this.state.error=typeof e=="string"?e:"Invalid Input"),e}submit(){if(this.focused.newChoice===!0)return super.submit();if(this.choices.some(e=>e.newChoice))return this.alert();this.value={};for(let e of this.choices){let r=e.parent?this.value[e.parent.name]:this.value;if(e.role==="heading"){this.value[e.name]={};continue}e.editable?r[e.name]=e.value===e.name?e.initial||"":e.value:this.isDisabled(e)||(r[e.name]=e.enabled===!0)}return this.base.submit.call(this)}};n1e.exports=t5});var Sm=L((Onr,s1e)=>{"use strict";var W1t=sC(),Y1t=zG(),{isPrimitive:V1t}=$o(),r5=class extends W1t{constructor(e){super(e),this.initial=V1t(this.initial)?String(this.initial):"",this.initial&&this.cursorHide(),this.state.prevCursor=0,this.state.clipboard=[]}async keypress(e,r={}){let s=this.state.prevKeypress;return this.state.prevKeypress=r,this.options.multiline===!0&&r.name==="return"&&(!s||s.name!=="return")?this.append(`
2025-04-10 09:51:25 -04:00
`,r):super.keypress(e,r)}moveCursor(e){this.cursor+=e}reset(){return this.input=this.value="",this.cursor=0,this.render()}dispatch(e,r){if(!e||r.ctrl||r.code)return this.alert();this.append(e)}append(e){let{cursor:r,input:s}=this.state;this.input=`${s}`.slice(0,r)+e+`${s}`.slice(r),this.moveCursor(String(e).length),this.render()}insert(e){this.append(e)}delete(){let{cursor:e,input:r}=this.state;if(e<=0)return this.alert();this.input=`${r}`.slice(0,e-1)+`${r}`.slice(e),this.moveCursor(-1),this.render()}deleteForward(){let{cursor:e,input:r}=this.state;if(r[e]===void 0)return this.alert();this.input=`${r}`.slice(0,e)+`${r}`.slice(e+1),this.render()}cutForward(){let e=this.cursor;if(this.input.length<=e)return this.alert();this.state.clipboard.push(this.input.slice(e)),this.input=this.input.slice(0,e),this.render()}cutLeft(){let e=this.cursor;if(e===0)return this.alert();let r=this.input.slice(0,e),s=this.input.slice(e),a=r.split(" ");this.state.clipboard.push(a.pop()),this.input=a.join(" "),this.cursor=this.input.length,this.input+=s,this.render()}paste(){if(!this.state.clipboard.length)return this.alert();this.insert(this.state.clipboard.pop()),this.render()}toggleCursor(){this.state.prevCursor?(this.cursor=this.state.prevCursor,this.state.prevCursor=0):(this.state.prevCursor=this.cursor,this.cursor=0),this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.input.length-1,this.render()}next(){let e=this.initial!=null?String(this.initial):"";if(!e||!e.startsWith(this.input))return this.alert();this.input=this.initial,this.cursor=this.initial.length,this.render()}prev(){if(!this.input)return this.alert();this.reset()}backward(){return this.left()}forward(){return this.right()}right(){return this.cursor>=this.input.length?this.alert():(this.moveCursor(1),this.render())}left(){return this.cursor<=0?this.alert():(this.moveCursor(-1),this.render())}isValue(e){return!!e}async format(e=this.value){let r=await this.resolve(this.initial,this.state);return this.state.submitted?this.styles.submitted(e||r):Y1t(this,{input:e,initial:r,pos:this.cursor})}async render(){let e=this.state.size,r=await this.prefix(),s=await this.separator(),a=await this.message(),n=[r,a,s].filter(Boolean).join(" ");this.state.prompt=n;let c=await this.header(),f=await this.format(),p=await this.error()||await this.hint(),h=await this.footer();p&&!f.includes(p)&&(f+=" "+p),n+=" "+f,this.clear(e),this.write([c,n,h].filter(Boolean).join(`
2025-04-11 10:05:45 -04:00
`)),this.restore()}};s1e.exports=r5});var a1e=L((Lnr,o1e)=>{"use strict";var K1t=t=>t.filter((e,r)=>t.lastIndexOf(e)===r),rF=t=>K1t(t).filter(Boolean);o1e.exports=(t,e={},r="")=>{let{past:s=[],present:a=""}=e,n,c;switch(t){case"prev":case"undo":return n=s.slice(0,s.length-1),c=s[s.length-1]||"",{past:rF([r,...n]),present:c};case"next":case"redo":return n=s.slice(1),c=s[0]||"",{past:rF([...n,r]),present:c};case"save":return{past:rF([...s,r]),present:""};case"remove":return c=rF(s.filter(f=>f!==r)),a="",c.length&&(a=c.pop()),{past:c,present:a};default:throw new Error(`Invalid action: "${t}"`)}}});var i5=L((Mnr,c1e)=>{"use strict";var J1t=Sm(),l1e=a1e(),n5=class extends J1t{constructor(e){super(e);let r=this.options.history;if(r&&r.store){let s=r.values||this.initial;this.autosave=!!r.autosave,this.store=r.store,this.data=this.store.get("values")||{past:[],present:s},this.initial=this.data.present||this.data.past[this.data.past.length-1]}}completion(e){return this.store?(this.data=l1e(e,this.data,this.input),this.data.present?(this.input=this.data.present,this.cursor=this.input.length,this.render()):this.alert()):this.alert()}altUp(){return this.completion("prev")}altDown(){return this.completion("next")}prev(){return this.save(),super.prev()}save(){this.store&&(this.data=l1e("save",this.data,this.input),this.store.set("values",this.data))}submit(){return this.store&&this.autosave===!0&&this.save(),super.submit()}};c1e.exports=n5});var f1e=L((_nr,u1e)=>{"use strict";var z1t=Sm(),s5=class extends z1t{format(){return""}};u1e.exports=s5});var p1e=L((Unr,A1e)=>{"use strict";var Z1t=Sm(),o5=class extends Z1t{constructor(e={}){super(e),this.sep=this.options.separator||/, */,this.initial=e.initial||""}split(e=this.value){return e?String(e).split(this.sep):[]}format(){let e=this.state.submitted?this.styles.primary:r=>r;return this.list.map(e).join(", ")}async submit(e){let r=this.state.error||await this.validate(this.list,this.state);return r!==!0?(this.state.error=r,super.submit()):(this.value=this.list,super.submit())}get list(){return this.split()}};A1e.exports=o5});var g1e=L((Hnr,h1e)=>{"use strict";var X1t=G0(),a5=class extends X1t{constructor(e){super({...e,multiple:!0})}};h1e.exports=a5});var c5=L((jnr,d1e)=>{"use strict";var $1t=Sm(),l5=class extends $1t{constructor(e={}){super({style:"number",...e}),this.min=this.isValue(e.min)?this.toNumber(e.min):-1/0,this.max=this.isValue(e.max)?this.toNumber(e.max):1/0,this.delay=e.delay!=null?e.delay:1e3,this.float=e.float!==!1,this.round=e.round===!0||e.float===!1,this.major=e.major||10,this.minor=e.minor||1,this.initial=e.initial!=null?e.initial:"",this.input=String(this.initial),this.cursor=this.input.length,this.cursorShow()}append(e){return!/[-+.]/.test(e)||e==="."&&this.input.includes(".")?this.alert("invalid number"):super.append(e)}number(e){return super.append(e)}next(){return this.input&&this.input!==this.initial?this.alert():this.isValue(this.initial)?(this.input=this.initial,this.cursor=String(this.initial).length,this.render()):this.alert()}up(e){let r=e||this.minor,s=this.toNumber(this.input);return s>this.max+r?this.alert():(this.input=`${s+r}`,this.render())}down(e){let r=e||this.minor,s=this.toNumber(this.input);return s<this.min-r?this.alert():(this.input=`${s-r}`,this.render())}shiftDown(){return this.down(this.major)}shiftUp(){return this.up(this.major)}format(e=this.input){return typeof this.options.format=="function"?this.options.format.call(this,e):this.styles.info(e)}toNumber(e=""){return this.float?+e:Math.round(+e)}isValue(e){return/^[-+]?[0-9]+((\.)|(\.[0-9]+))?$/.test(e)}submit(){let e=[this.input,this.initial].find(r=>this.isValue(r));return this.value=this.toNumber(e||0),super.submit()}};d1e.exports=l5});var y1e=L((qnr,m1e)=>{m1e.exports=c5()});var I1e=L((Gnr,E1e)=>{"use strict";var e2t=Sm(),u5=class extends e2t{constructor(e){super(e),this.cursorShow()}format(e=this.input){return this.keypressed?(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(e.length)):""}};E1e.exports=u5});var B1e=L((Wnr,w1e)=>{"use strict";va
2025-04-10 09:51:25 -04:00
`;let r=e.startNumber||1;typeof this.scale=="number"&&(this.scaleKey=!1,this.scale=Array(this.scale).fill(0).map((s,a)=>({name:a+r})))}async reset(){return this.tableized=!1,await super.reset(),this.render()}tableize(){if(this.tableized===!0)return;this.tableized=!0;let e=0;for(let r of this.choices){e=Math.max(e,r.message.length),r.scaleIndex=r.initial||2,r.scale=[];for(let s=0;s<this.scale.length;s++)r.scale.push({index:s})}this.widths[0]=Math.min(this.widths[0],e+3)}async dispatch(e,r){if(this.multiple)return this[r.name]?await this[r.name](e,r):await super.dispatch(e,r);this.alert()}heading(e,r,s){return this.styles.strong(e)}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let e=this.focused;return e.scaleIndex>=this.scale.length-1?this.alert():(e.scaleIndex++,this.render())}left(){let e=this.focused;return e.scaleIndex<=0?this.alert():(e.scaleIndex--,this.render())}indent(){return""}format(){return this.state.submitted?this.choices.map(r=>this.styles.info(r.index)).join(", "):""}pointer(){return""}renderScaleKey(){return this.scaleKey===!1||this.state.submitted?"":["",...this.scale.map(s=>` ${s.name} - ${s.message}`)].map(s=>this.styles.muted(s)).join(`
`)}renderScaleHeading(e){let r=this.scale.map(p=>p.name);typeof this.options.renderScaleHeading=="function"&&(r=this.options.renderScaleHeading.call(this,e));let s=this.scaleLength-r.join("").length,a=Math.round(s/(r.length-1)),c=r.map(p=>this.styles.strong(p)).join(" ".repeat(a)),f=" ".repeat(this.widths[0]);return this.margin[3]+f+this.margin[1]+c}scaleIndicator(e,r,s){if(typeof this.options.scaleIndicator=="function")return this.options.scaleIndicator.call(this,e,r,s);let a=e.scaleIndex===r.index;return r.disabled?this.styles.hint(this.symbols.radio.disabled):a?this.styles.success(this.symbols.radio.on):this.symbols.radio.off}renderScale(e,r){let s=e.scale.map(n=>this.scaleIndicator(e,n,r)),a=this.term==="Hyper"?"":" ";return s.join(a+this.symbols.line.repeat(this.edgeLength))}async renderChoice(e,r){await this.onChoice(e,r);let s=this.index===r,a=await this.pointer(e,r),n=await e.hint;n&&!C1e.hasColor(n)&&(n=this.styles.muted(n));let c=I=>this.margin[3]+I.replace(/\s+$/,"").padEnd(this.widths[0]," "),f=this.newline,p=this.indent(e),h=await this.resolve(e.message,this.state,e,r),E=await this.renderScale(e,r),C=this.margin[1]+this.margin[3];this.scaleLength=t2t.unstyle(E).length,this.widths[0]=Math.min(this.widths[0],this.width-this.scaleLength-C.length);let P=C1e.wordWrap(h,{width:this.widths[0],newline:f}).split(`
`).map(I=>c(I)+this.margin[1]);return s&&(E=this.styles.info(E),P=P.map(I=>this.styles.info(I))),P[0]+=E,this.linebreak&&P.push(""),[p+a,P.join(`
`)].filter(Boolean)}async renderChoices(){if(this.state.submitted)return"";this.tableize();let e=this.visible.map(async(a,n)=>await this.renderChoice(a,n)),r=await Promise.all(e),s=await this.renderScaleHeading();return this.margin[0]+[s,...r.map(a=>a.join(" "))].join(`
`)}async render(){let{submitted:e,size:r}=this.state,s=await this.prefix(),a=await this.separator(),n=await this.message(),c="";this.options.promptLine!==!1&&(c=[s,n,a,""].join(" "),this.state.prompt=c);let f=await this.header(),p=await this.format(),h=await this.renderScaleKey(),E=await this.error()||await this.hint(),C=await this.renderChoices(),S=await this.footer(),P=this.emptyError;p&&(c+=p),E&&!c.includes(E)&&(c+=" "+E),e&&!p&&!C.trim()&&this.multiple&&P!=null&&(c+=this.styles.danger(P)),this.clear(r),this.write([f,c,h,C,S].filter(Boolean).join(`
2025-04-11 10:05:45 -04:00
`)),this.state.submitted||this.write(this.margin[2]),this.restore()}submit(){this.value={};for(let e of this.choices)this.value[e.name]=e.scaleIndex;return this.base.submit.call(this)}};w1e.exports=f5});var D1e=L((Ynr,S1e)=>{"use strict";var v1e=Ju(),n2t=(t="")=>typeof t=="string"?t.replace(/^['"]|['"]$/g,""):"",p5=class{constructor(e){this.name=e.key,this.field=e.field||{},this.value=n2t(e.initial||this.field.initial||""),this.message=e.message||this.name,this.cursor=0,this.input="",this.lines=[]}},i2t=async(t={},e={},r=s=>s)=>{let s=new Set,a=t.fields||[],n=t.template,c=[],f=[],p=[],h=1;typeof n=="function"&&(n=await n());let E=-1,C=()=>n[++E],S=()=>n[E+1],P=I=>{I.line=h,c.push(I)};for(P({type:"bos",value:""});E<n.length-1;){let I=C();if(/^[^\S\n ]$/.test(I)){P({type:"text",value:I});continue}if(I===`
2025-04-10 09:51:25 -04:00
`){P({type:"newline",value:I}),h++;continue}if(I==="\\"){I+=C(),P({type:"text",value:I});continue}if((I==="$"||I==="#"||I==="{")&&S()==="{"){let N=C();I+=N;let U={type:"template",open:I,inner:"",close:"",value:I},W;for(;W=C();){if(W==="}"){S()==="}"&&(W+=C()),U.value+=W,U.close=W;break}W===":"?(U.initial="",U.key=U.inner):U.initial!==void 0&&(U.initial+=W),U.value+=W,U.inner+=W}U.template=U.open+(U.initial||U.inner)+U.close,U.key=U.key||U.inner,e.hasOwnProperty(U.key)&&(U.initial=e[U.key]),U=r(U),P(U),p.push(U.key),s.add(U.key);let te=f.find(ie=>ie.name===U.key);U.field=a.find(ie=>ie.name===U.key),te||(te=new p5(U),f.push(te)),te.lines.push(U.line-1);continue}let R=c[c.length-1];R.type==="text"&&R.line===h?R.value+=I:P({type:"text",value:I})}return P({type:"eos",value:""}),{input:n,tabstops:c,unique:s,keys:p,items:f}};S1e.exports=async t=>{let e=t.options,r=new Set(e.required===!0?[]:e.required||[]),s={...e.values,...e.initial},{tabstops:a,items:n,keys:c}=await i2t(e,s),f=A5("result",t,e),p=A5("format",t,e),h=A5("validate",t,e,!0),E=t.isValue.bind(t);return async(C={},S=!1)=>{let P=0;C.required=r,C.items=n,C.keys=c,C.output="";let I=async(W,te,ie,Ae)=>{let ce=await h(W,te,ie,Ae);return ce===!1?"Invalid field "+ie.name:ce};for(let W of a){let te=W.value,ie=W.key;if(W.type!=="template"){te&&(C.output+=te);continue}if(W.type==="template"){let Ae=n.find(Ce=>Ce.name===ie);e.required===!0&&C.required.add(Ae.name);let ce=[Ae.input,C.values[Ae.value],Ae.value,te].find(E),pe=(Ae.field||{}).message||W.inner;if(S){let Ce=await I(C.values[ie],C,Ae,P);if(Ce&&typeof Ce=="string"||Ce===!1){C.invalid.set(ie,Ce);continue}C.invalid.delete(ie);let g=await f(C.values[ie],C,Ae,P);C.output+=v1e.unstyle(g);continue}Ae.placeholder=!1;let Be=te;te=await p(te,C,Ae,P),ce!==te?(C.values[ie]=ce,te=t.styles.typing(ce),C.missing.delete(pe)):(C.values[ie]=void 0,ce=`<${pe}>`,te=t.styles.primary(ce),Ae.placeholder=!0,C.required.has(ie)&&C.missing.add(pe)),C.missing.has(pe)&&C.validating&&(te=t.styles.warning(ce)),C.invalid.has(ie)&&C.validating&&(te=t.styles.danger(ce)),P===C.index&&(Be!==te?te=t.styles.underline(te):te=t.styles.heading(v1e.unstyle(te))),P++}te&&(C.output+=te)}let R=C.output.split(`
`).map(W=>" "+W),N=n.length,U=0;for(let W of n)C.invalid.has(W.name)&&W.lines.forEach(te=>{R[te][0]===" "&&(R[te]=C.styles.danger(C.symbols.bullet)+R[te].slice(1))}),t.isValue(C.values[W.name])&&U++;return C.completed=(U/N*100).toFixed(0),C.output=R.join(`
2025-04-11 10:05:45 -04:00
`),C.output}};function A5(t,e,r,s){return(a,n,c,f)=>typeof c.field[t]=="function"?c.field[t].call(e,a,n,c,f):[s,a].find(p=>e.isValue(p))}});var P1e=L((Vnr,b1e)=>{"use strict";var s2t=Ju(),o2t=D1e(),a2t=sC(),h5=class extends a2t{constructor(e){super(e),this.cursorHide(),this.reset(!0)}async initialize(){this.interpolate=await o2t(this),await super.initialize()}async reset(e){this.state.keys=[],this.state.invalid=new Map,this.state.missing=new Set,this.state.completed=0,this.state.values={},e!==!0&&(await this.initialize(),await this.render())}moveCursor(e){let r=this.getItem();this.cursor+=e,r.cursor+=e}dispatch(e,r){if(!r.code&&!r.ctrl&&e!=null&&this.getItem()){this.append(e,r);return}this.alert()}append(e,r){let s=this.getItem(),a=s.input.slice(0,this.cursor),n=s.input.slice(this.cursor);this.input=s.input=`${a}${e}${n}`,this.moveCursor(1),this.render()}delete(){let e=this.getItem();if(this.cursor<=0||!e.input)return this.alert();let r=e.input.slice(this.cursor),s=e.input.slice(0,this.cursor-1);this.input=e.input=`${s}${r}`,this.moveCursor(-1),this.render()}increment(e){return e>=this.state.keys.length-1?0:e+1}decrement(e){return e<=0?this.state.keys.length-1:e-1}first(){this.state.index=0,this.render()}last(){this.state.index=this.state.keys.length-1,this.render()}right(){if(this.cursor>=this.input.length)return this.alert();this.moveCursor(1),this.render()}left(){if(this.cursor<=0)return this.alert();this.moveCursor(-1),this.render()}prev(){this.state.index=this.decrement(this.state.index),this.getItem(),this.render()}next(){this.state.index=this.increment(this.state.index),this.getItem(),this.render()}up(){this.prev()}down(){this.next()}format(e){let r=this.state.completed<100?this.styles.warning:this.styles.success;return this.state.submitted===!0&&this.state.completed!==100&&(r=this.styles.danger),r(`${this.state.completed}% completed`)}async render(){let{index:e,keys:r=[],submitted:s,size:a}=this.state,n=[this.options.newline,`
2025-04-10 09:51:25 -04:00
`].find(W=>W!=null),c=await this.prefix(),f=await this.separator(),p=await this.message(),h=[c,p,f].filter(Boolean).join(" ");this.state.prompt=h;let E=await this.header(),C=await this.error()||"",S=await this.hint()||"",P=s?"":await this.interpolate(this.state),I=this.state.key=r[e]||"",R=await this.format(I),N=await this.footer();R&&(h+=" "+R),S&&!R&&this.state.completed===0&&(h+=" "+S),this.clear(a);let U=[E,h,P,N,C.trim()];this.write(U.filter(Boolean).join(n)),this.restore()}getItem(e){let{items:r,keys:s,index:a}=this.state,n=r.find(c=>c.name===s[a]);return n&&n.input!=null&&(this.input=n.input,this.cursor=n.cursor),n}async submit(){typeof this.interpolate!="function"&&await this.initialize(),await this.interpolate(this.state,!0);let{invalid:e,missing:r,output:s,values:a}=this.state;if(e.size){let f="";for(let[p,h]of e)f+=`Invalid ${p}: ${h}
`;return this.state.error=f,super.submit()}if(r.size)return this.state.error="Required: "+[...r.keys()].join(", "),super.submit();let c=s2t.unstyle(s).split(`
`).map(f=>f.slice(1)).join(`
2025-04-11 10:05:45 -04:00
`);return this.value={values:a,result:c},super.submit()}};b1e.exports=h5});var k1e=L((Knr,x1e)=>{"use strict";var l2t="(Use <shift>+<up/down> to sort)",c2t=G0(),g5=class extends c2t{constructor(e){super({...e,reorder:!1,sort:!0,multiple:!0}),this.state.hint=[this.options.hint,l2t].find(this.isValue.bind(this))}indicator(){return""}async renderChoice(e,r){let s=await super.renderChoice(e,r),a=this.symbols.identicalTo+" ",n=this.index===r&&this.sorting?this.styles.muted(a):" ";return this.options.drag===!1&&(n=""),this.options.numbered===!0?n+`${r+1} - `+s:n+s}get selected(){return this.choices}submit(){return this.value=this.choices.map(e=>e.value),super.submit()}};x1e.exports=g5});var T1e=L((Jnr,Q1e)=>{"use strict";var u2t=oS(),d5=class extends u2t{constructor(e={}){if(super(e),this.emptyError=e.emptyError||"No items were selected",this.term=process.env.TERM_PROGRAM,!this.options.header){let r=["","4 - Strongly Agree","3 - Agree","2 - Neutral","1 - Disagree","0 - Strongly Disagree",""];r=r.map(s=>this.styles.muted(s)),this.state.header=r.join(`
2025-04-10 09:51:25 -04:00
`)}}async toChoices(...e){if(this.createdScales)return!1;this.createdScales=!0;let r=await super.toChoices(...e);for(let s of r)s.scale=f2t(5,this.options),s.scaleIdx=2;return r}dispatch(){this.alert()}space(){let e=this.focused,r=e.scale[e.scaleIdx],s=r.selected;return e.scale.forEach(a=>a.selected=!1),r.selected=!s,this.render()}indicator(){return""}pointer(){return""}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let e=this.focused;return e.scaleIdx>=e.scale.length-1?this.alert():(e.scaleIdx++,this.render())}left(){let e=this.focused;return e.scaleIdx<=0?this.alert():(e.scaleIdx--,this.render())}indent(){return" "}async renderChoice(e,r){await this.onChoice(e,r);let s=this.index===r,a=this.term==="Hyper",n=a?9:8,c=a?"":" ",f=this.symbols.line.repeat(n),p=" ".repeat(n+(a?0:1)),h=te=>(te?this.styles.success("\u25C9"):"\u25EF")+c,E=r+1+".",C=s?this.styles.heading:this.styles.noop,S=await this.resolve(e.message,this.state,e,r),P=this.indent(e),I=P+e.scale.map((te,ie)=>h(ie===e.scaleIdx)).join(f),R=te=>te===e.scaleIdx?C(te):te,N=P+e.scale.map((te,ie)=>R(ie)).join(p),U=()=>[E,S].filter(Boolean).join(" "),W=()=>[U(),I,N," "].filter(Boolean).join(`
`);return s&&(I=this.styles.cyan(I),N=this.styles.cyan(N)),W()}async renderChoices(){if(this.state.submitted)return"";let e=this.visible.map(async(s,a)=>await this.renderChoice(s,a)),r=await Promise.all(e);return r.length||r.push(this.styles.danger("No matching choices")),r.join(`
`)}format(){return this.state.submitted?this.choices.map(r=>this.styles.info(r.scaleIdx)).join(", "):""}async render(){let{submitted:e,size:r}=this.state,s=await this.prefix(),a=await this.separator(),n=await this.message(),c=[s,n,a].filter(Boolean).join(" ");this.state.prompt=c;let f=await this.header(),p=await this.format(),h=await this.error()||await this.hint(),E=await this.renderChoices(),C=await this.footer();(p||!h)&&(c+=" "+p),h&&!c.includes(h)&&(c+=" "+h),e&&!p&&!E&&this.multiple&&this.type!=="form"&&(c+=this.styles.danger(this.emptyError)),this.clear(r),this.write([c,f,E,C].filter(Boolean).join(`
2025-04-11 10:05:45 -04:00
`)),this.restore()}submit(){this.value={};for(let e of this.choices)this.value[e.name]=e.scaleIdx;return this.base.submit.call(this)}};function f2t(t,e={}){if(Array.isArray(e.scale))return e.scale.map(s=>({...s}));let r=[];for(let s=1;s<t+1;s++)r.push({i:s,selected:!1});return r}Q1e.exports=d5});var F1e=L((znr,R1e)=>{R1e.exports=i5()});var O1e=L((Znr,N1e)=>{"use strict";var A2t=tF(),m5=class extends A2t{async initialize(){await super.initialize(),this.value=this.initial=!!this.options.initial,this.disabled=this.options.disabled||"no",this.enabled=this.options.enabled||"yes",await this.render()}reset(){this.value=this.initial,this.render()}delete(){this.alert()}toggle(){this.value=!this.value,this.render()}enable(){if(this.value===!0)return this.alert();this.value=!0,this.render()}disable(){if(this.value===!1)return this.alert();this.value=!1,this.render()}up(){this.toggle()}down(){this.toggle()}right(){this.toggle()}left(){this.toggle()}next(){this.toggle()}prev(){this.toggle()}dispatch(e="",r){switch(e.toLowerCase()){case" ":return this.toggle();case"1":case"y":case"t":return this.enable();case"0":case"n":case"f":return this.disable();default:return this.alert()}}format(){let e=s=>this.styles.primary.underline(s);return[this.value?this.disabled:e(this.disabled),this.value?e(this.enabled):this.enabled].join(this.styles.muted(" / "))}async render(){let{size:e}=this.state,r=await this.header(),s=await this.prefix(),a=await this.separator(),n=await this.message(),c=await this.format(),f=await this.error()||await this.hint(),p=await this.footer(),h=[s,n,a,c].join(" ");this.state.prompt=h,f&&!h.includes(f)&&(h+=" "+f),this.clear(e),this.write([r,h,p].filter(Boolean).join(`
`)),this.write(this.margin[2]),this.restore()}};N1e.exports=m5});var M1e=L((Xnr,L1e)=>{"use strict";var p2t=G0(),y5=class extends p2t{constructor(e){if(super(e),typeof this.options.correctChoice!="number"||this.options.correctChoice<0)throw new Error("Please specify the index of the correct answer from the list of choices")}async toChoices(e,r){let s=await super.toChoices(e,r);if(s.length<2)throw new Error("Please give at least two choices to the user");if(this.options.correctChoice>s.length)throw new Error("Please specify the index of the correct answer from the list of choices");return s}check(e){return e.index===this.options.correctChoice}async result(e){return{selectedAnswer:e,correctAnswer:this.options.choices[this.options.correctChoice].value,correct:await this.check(this.state)}}};L1e.exports=y5});var U1e=L(E5=>{"use strict";var _1e=$o(),Qs=(t,e)=>{_1e.defineExport(E5,t,e),_1e.defineExport(E5,t.toLowerCase(),e)};Qs("AutoComplete",()=>Ywe());Qs("BasicAuth",()=>$we());Qs("Confirm",()=>r1e());Qs("Editable",()=>i1e());Qs("Form",()=>eF());Qs("Input",()=>i5());Qs("Invisible",()=>f1e());Qs("List",()=>p1e());Qs("MultiSelect",()=>g1e());Qs("Numeral",()=>y1e());Qs("Password",()=>I1e());Qs("Scale",()=>B1e());Qs("Select",()=>G0());Qs("Snippet",()=>P1e());Qs("Sort",()=>k1e());Qs("Survey",()=>T1e());Qs("Text",()=>F1e());Qs("Toggle",()=>O1e());Qs("Quiz",()=>M1e())});var j1e=L((eir,H1e)=>{H1e.exports={ArrayPrompt:oS(),AuthPrompt:XG(),BooleanPrompt:tF(),NumberPrompt:c5(),StringPrompt:Sm()}});var lS=L((tir,G1e)=>{"use strict";var q1e=ye("assert"),C5=ye("events"),W0=$o(),Zu=class extends C5{constructor(e,r){super(),this.options=W0.merge({},e),this.answers={...r}}register(e,r){if(W0.isObject(e)){for(let a of Object.keys(e))this.register(a,e[a]);return this}q1e.equal(typeof r,"function","expected a function");let s=e.toLowerCase();return r.prototype instanceof this.Prompt?this.prompts[s]=r:this.prompts[s]=r(this.Prompt,this),this}async prompt(e=[]){for(let r of[].concat(e))try{typeof r=="function"&&(r=await r.call(this)),await this.ask(W0.merge({},this.options,r))}catch(s){return Promise.reject(s)}return this.answers}async ask(e){typeof e=="function"&&(e=await e.call(this));let r=W0.merge({},this.options,e),{type:s,name:a}=e,{set:n,get:c}=W0;if(typeof s=="function"&&(s=await s.call(this,e,this.answers)),!s)return this.answers[a];q1e(this.prompts[s],`Prompt "${s}" is not registered`);let f=new this.prompts[s](r),p=c(this.answers,a);f.state.answers=this.answers,f.enquirer=this,a&&f.on("submit",E=>{this.emit("answer",a,E,f),n(this.answers,a,E)});let h=f.emit.bind(f);return f.emit=(...E)=>(this.emit.call(this,...E),h(...E)),this.emit("prompt",f,this),r.autofill&&p!=null?(f.value=f.input=p,r.autofill==="show"&&await f.submit()):p=f.value=await f.run(),p}use(e){return e.call(this,this),this}set Prompt(e){this._Prompt=e}get Prompt(){return this._Prompt||this.constructor.Prompt}get prompts(){return this.constructor.prompts}static set Prompt(e){this._Prompt=e}static get Prompt(){return this._Prompt||sC()}static get prompts(){return U1e()}static get types(){return j1e()}static get prompt(){let e=(r,...s)=>{let a=new this(...s),n=a.emit.bind(a);return a.emit=(...c)=>(e.emit(...c),n(...c)),a.prompt(r)};return W0.mixinEmitter(e,new C5),e}};W0.mixinEmitter(Zu,new C5);var I5=Zu.prompts;for(let t of Object.keys(I5)){let e=t.toLowerCase(),r=s=>new I5[t](s).run();Zu.prompt[e]=r,Zu[e]=r,Zu[t]||Reflect.defineProperty(Zu,t,{get:()=>I5[t]})}var aS=t=>{W0.defineExport(Zu,t,()=>Zu.types[t])};aS("ArrayPrompt");aS("AuthPrompt");aS("BooleanPrompt");aS("NumberPrompt");aS("StringPrompt");G1e.exports=Zu});var AS=L((Lir,Z1e)=>{var I2t=qR();function C2t(t,e,r){var s=t==null?void 0:I2t(t,e);return s===void 0?r:s}Z1e.exports=C2t});var e2e=L((qir,$1e)=>{function w2t(t,e){for(var r=-1,s=t==null?0:t.length;++r<s&&e(t[r],r,t)!==!1;);return t}$1e.exports=w2t});var r2e=L((Gir,t2e)=>{var B2t=Jd(),v2t=Uk();function S2t(t,e){return t&&B2t(e,v2t(e),t)}t2e.exports=S2t});var i2e=L((Wir,n2e)=>{var D2t=Jd(),b2t=qE();function P2t(t,e){return t&&D2t(e,b2t(e),t)}n2e.exports=P2t});var
2025-04-10 09:51:25 -04:00
${W} at ${te}`:`
2025-04-11 10:05:45 -04:00
${W}`}).join("");h.push({text:`Conflict detected in constraint targeting ${he.pretty(t.configuration,P,he.Type.CODE)}; conflicting values are:${R}`,fixable:!1})}else{let[[R]]=I,N=(0,VBe.default)(S,P);if(JSON.stringify(N)===JSON.stringify(R))continue;if(!s){let U=typeof N>"u"?`Missing field ${he.pretty(t.configuration,P,he.Type.CODE)}; expected ${he.pretty(t.configuration,R,he.Type.INSPECT)}`:typeof R>"u"?`Extraneous field ${he.pretty(t.configuration,P,he.Type.CODE)} currently set to ${he.pretty(t.configuration,N,he.Type.INSPECT)}`:`Invalid field ${he.pretty(t.configuration,P,he.Type.CODE)}; expected ${he.pretty(t.configuration,R,he.Type.INSPECT)}, found ${he.pretty(t.configuration,N,he.Type.INSPECT)}`;h.push({text:U,fixable:!0});continue}typeof R>"u"?(0,zBe.default)(S,P):(0,KBe.default)(S,P,R),E=!0}E&&a.set(C,S)}h.length>0&&n.set(C,h)}return{changedWorkspaces:a,remainingErrors:n}}function ZBe(t,{configuration:e}){let r={children:[]};for(let[s,a]of t){let n=[];for(let f of a){let p=f.text.split(/\n/);f.fixable&&(p[0]=`${he.pretty(e,"\u2699","gray")} ${p[0]}`),n.push({value:he.tuple(he.Type.NO_HINT,p[0]),children:p.slice(1).map(h=>({value:he.tuple(he.Type.NO_HINT,h)}))})}let c={value:he.tuple(he.Type.LOCATOR,s.anchoredLocator),children:je.sortMap(n,f=>f.value[1])};r.children.push(c)}return r.children=je.sortMap(r.children,s=>s.value[1]),r}var VBe,KBe,JBe,zBe,VC,rDt,nDt,iDt,IS=It(()=>{Ve();VBe=et(AS()),KBe=et(Q5()),JBe=et(YBe()),zBe=et(F5()),VC=class{constructor(e){this.indexedFields=e;this.items=[];this.indexes={};this.clear()}clear(){this.items=[];for(let e of this.indexedFields)this.indexes[e]=new Map}insert(e){this.items.push(e);for(let r of this.indexedFields){let s=Object.hasOwn(e,r)?e[r]:void 0;if(typeof s>"u")continue;je.getArrayWithDefault(this.indexes[r],s).push(e)}return e}find(e){if(typeof e>"u")return this.items;let r=Object.entries(e);if(r.length===0)return this.items;let s=[],a;for(let[c,f]of r){let p=c,h=Object.hasOwn(this.indexes,p)?this.indexes[p]:void 0;if(typeof h>"u"){s.push([p,f]);continue}let E=new Set(h.get(f)??[]);if(E.size===0)return[];if(typeof a>"u")a=E;else for(let C of a)E.has(C)||a.delete(C);if(a.size===0)break}let n=[...a??[]];return s.length>0&&(n=n.filter(c=>{for(let[f,p]of s)if(!(typeof p<"u"?Object.hasOwn(c,f)&&c[f]===p:Object.hasOwn(c,f)===!1))return!1;return!0})),n}},rDt=/^[0-9]+$/,nDt=/^[a-zA-Z0-9_]+$/,iDt=new Set(["scripts",...Ht.allDependencies])});var XBe=L((wfr,s9)=>{var aDt;(function(t){var e=function(){return{"append/2":[new t.type.Rule(new t.type.Term("append",[new t.type.Var("X"),new t.type.Var("L")]),new t.type.Term("foldl",[new t.type.Term("append",[]),new t.type.Var("X"),new t.type.Term("[]",[]),new t.type.Var("L")]))],"append/3":[new t.type.Rule(new t.type.Term("append",[new t.type.Term("[]",[]),new t.type.Var("X"),new t.type.Var("X")]),null),new t.type.Rule(new t.type.Term("append",[new t.type.Term(".",[new t.type.Var("H"),new t.type.Var("T")]),new t.type.Var("X"),new t.type.Term(".",[new t.type.Var("H"),new t.type.Var("S")])]),new t.type.Term("append",[new t.type.Var("T"),new t.type.Var("X"),new t.type.Var("S")]))],"member/2":[new t.type.Rule(new t.type.Term("member",[new t.type.Var("X"),new t.type.Term(".",[new t.type.Var("X"),new t.type.Var("_")])]),null),new t.type.Rule(new t.type.Term("member",[new t.type.Var("X"),new t.type.Term(".",[new t.type.Var("_"),new t.type.Var("Xs")])]),new t.type.Term("member",[new t.type.Var("X"),new t.type.Var("Xs")]))],"permutation/2":[new t.type.Rule(new t.type.Term("permutation",[new t.type.Term("[]",[]),new t.type.Term("[]",[])]),null),new t.type.Rule(new t.type.Term("permutation",[new t.type.Term(".",[new t.type.Var("H"),new t.type.Var("T")]),new t.type.Var("S")]),new t.type.Term(",",[new t.type.Term("permutation",[new t.type.Var("T"),new t.type.Var("P")]),new t.type.Term(",",[new t.type.Term("append",[new t.type.Var("X"),new t.type.Var("Y"),new t.type.Var("P")]),new t.type.Term("append",[new t.type.Var("X"),new t.type.Term(".",[new t.type.Var("H"),new t.type.Var("Y")]),new t.type.Var("S")])])]))],"maplist/2":[new t.type.Rule(new t.t
2025-04-10 09:51:25 -04:00
`+p:"")),c.error.method="_execFileSync",c.error.program=a,c.error.args=n,c.error.extMessage=p,c.error.exitCode=+f),ii.unlinkSync(h),ii.unlinkSync(E),ii.unlinkSync(C),ii.unlinkSync(S),c}function fDt(t){var e,r={},s,a={env:process.env,encoding:t.encoding};if(V0||(Pm?process.env.PSModulePath?(V0="powershell.exe",uF=["-ExecutionPolicy","Bypass","-File",__dirname+"\\read.ps1"]):(V0="cscript.exe",uF=["//nologo",__dirname+"\\read.cs.js"]):(V0="/bin/sh",uF=[__dirname+"/read.sh"])),Pm&&!process.env.PSModulePath&&(a.stdio=[process.stdin]),l9.execFileSync){e=nve(t),CS&&CS("execFileSync",e);try{r.input=l9.execFileSync(V0,e,a)}catch(n){s=n.stderr?(n.stderr+"").trim():"",r.error=new Error(tve+(s?`
2025-04-11 10:05:45 -04:00
`+s:"")),r.error.method="execFileSync",r.error.program=V0,r.error.args=e,r.error.extMessage=s,r.error.exitCode=n.status,r.error.code=n.code,r.error.signal=n.signal}}else r=uDt(t,a);return r.error||(r.input=r.input.replace(/^\s*'|'\s*$/g,""),t.display=""),r}function f9(t){var e="",r=t.display,s=!t.display&&t.keyIn&&t.hideEchoBack&&!t.mask;function a(){var n=fDt(t);if(n.error)throw n.error;return n.input}return u9&&u9(t),function(){var n,c,f;function p(){return n||(n=process.binding("fs"),c=process.binding("constants")),n}if(typeof eh=="string")if(eh=null,Pm){if(f=function(h){var E=h.replace(/^\D+/,"").split("."),C=0;return(E[0]=+E[0])&&(C+=E[0]*1e4),(E[1]=+E[1])&&(C+=E[1]*100),(E[2]=+E[2])&&(C+=E[2]),C}(process.version),!(f>=20302&&f<40204||f>=5e4&&f<50100||f>=50600&&f<60200)&&process.stdin.isTTY)process.stdin.pause(),eh=process.stdin.fd,JC=process.stdin._handle;else try{eh=p().open("CONIN$",c.O_RDWR,parseInt("0666",8)),JC=new $Be(eh,!0)}catch{}if(process.stdout.isTTY)$u=process.stdout.fd;else{try{$u=ii.openSync("\\\\.\\CON","w")}catch{}if(typeof $u!="number")try{$u=p().open("CONOUT$",c.O_RDWR,parseInt("0666",8))}catch{}}}else{if(process.stdin.isTTY){process.stdin.pause();try{eh=ii.openSync("/dev/tty","r"),JC=process.stdin._handle}catch{}}else try{eh=ii.openSync("/dev/tty","r"),JC=new $Be(eh,!1)}catch{}if(process.stdout.isTTY)$u=process.stdout.fd;else try{$u=ii.openSync("/dev/tty","w")}catch{}}}(),function(){var n,c,f=!t.hideEchoBack&&!t.keyIn,p,h,E,C,S;fF="";function P(I){return I===eve?!0:JC.setRawMode(I)!==0?!1:(eve=I,!0)}if(rve||!JC||typeof $u!="number"&&(t.display||!f)){e=a();return}if(t.display&&(ii.writeSync($u,t.display),t.display=""),!t.displayOnly){if(!P(!f)){e=a();return}for(h=t.keyIn?1:t.bufferSize,p=Buffer.allocUnsafe&&Buffer.alloc?Buffer.alloc(h):new Buffer(h),t.keyIn&&t.limit&&(c=new RegExp("[^"+t.limit+"]","g"+(t.caseSensitive?"":"i")));;){E=0;try{E=ii.readSync(eh,p,0,h)}catch(I){if(I.code!=="EOF"){P(!1),e+=a();return}}if(E>0?(C=p.toString(t.encoding,0,E),fF+=C):(C=`
2025-04-10 09:51:25 -04:00
`,fF+="\0"),C&&typeof(S=(C.match(/^(.*?)[\r\n]/)||[])[1])=="string"&&(C=S,n=!0),C&&(C=C.replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g,"")),C&&c&&(C=C.replace(c,"")),C&&(f||(t.hideEchoBack?t.mask&&ii.writeSync($u,new Array(C.length+1).join(t.mask)):ii.writeSync($u,C)),e+=C),!t.keyIn&&n||t.keyIn&&e.length>=h)break}!f&&!s&&ii.writeSync($u,`
`),P(!1)}}(),t.print&&!s&&t.print(r+(t.displayOnly?"":(t.hideEchoBack?new Array(e.length+1).join(t.mask):e)+`
2025-04-11 10:05:45 -04:00
`),t.encoding),t.displayOnly?"":h9=t.keepWhitespace||t.keyIn?e:e.trim()}function ADt(t,e){var r=[];function s(a){a!=null&&(Array.isArray(a)?a.forEach(s):(!e||e(a))&&r.push(a))}return s(t),r}function g9(t){return t.replace(/[\x00-\x7f]/g,function(e){return"\\x"+("00"+e.charCodeAt().toString(16)).substr(-2)})}function Ks(){var t=Array.prototype.slice.call(arguments),e,r;return t.length&&typeof t[0]=="boolean"&&(r=t.shift(),r&&(e=Object.keys(c9),t.unshift(c9))),t.reduce(function(s,a){return a==null||(a.hasOwnProperty("noEchoBack")&&!a.hasOwnProperty("hideEchoBack")&&(a.hideEchoBack=a.noEchoBack,delete a.noEchoBack),a.hasOwnProperty("noTrim")&&!a.hasOwnProperty("keepWhitespace")&&(a.keepWhitespace=a.noTrim,delete a.noTrim),r||(e=Object.keys(a)),e.forEach(function(n){var c;if(a.hasOwnProperty(n))switch(c=a[n],n){case"mask":case"limitMessage":case"defaultInput":case"encoding":c=c!=null?c+"":"",c&&n!=="limitMessage"&&(c=c.replace(/[\r\n]/g,"")),s[n]=c;break;case"bufferSize":!isNaN(c=parseInt(c,10))&&typeof c=="number"&&(s[n]=c);break;case"displayOnly":case"keyIn":case"hideEchoBack":case"caseSensitive":case"keepWhitespace":case"history":case"cd":s[n]=!!c;break;case"limit":case"trueValue":case"falseValue":s[n]=ADt(c,function(f){var p=typeof f;return p==="string"||p==="number"||p==="function"||f instanceof RegExp}).map(function(f){return typeof f=="string"?f.replace(/[\r\n]/g,""):f});break;case"print":case"phContent":case"preCheck":s[n]=typeof c=="function"?c:void 0;break;case"prompt":case"display":s[n]=c??"";break}})),s},{})}function A9(t,e,r){return e.some(function(s){var a=typeof s;return a==="string"?r?t===s:t.toLowerCase()===s.toLowerCase():a==="number"?parseFloat(t)===s:a==="function"?s(t):s instanceof RegExp?s.test(t):!1})}function d9(t,e){var r=K0.normalize(Pm?(process.env.HOMEDRIVE||"")+(process.env.HOMEPATH||""):process.env.HOME||"").replace(/[\/\\]+$/,"");return t=K0.normalize(t),e?t.replace(/^~(?=\/|\\|$)/,r):t.replace(new RegExp("^"+g9(r)+"(?=\\/|\\\\|$)",Pm?"i":""),"~")}function zC(t,e){var r="(?:\\(([\\s\\S]*?)\\))?(\\w+|.-.)(?:\\(([\\s\\S]*?)\\))?",s=new RegExp("(\\$)?(\\$<"+r+">)","g"),a=new RegExp("(\\$)?(\\$\\{"+r+"\\})","g");function n(c,f,p,h,E,C){var S;return f||typeof(S=e(E))!="string"?p:S?(h||"")+S+(C||""):""}return t.replace(s,n).replace(a,n)}function ive(t,e,r){var s,a=[],n=-1,c=0,f="",p;function h(E,C){return C.length>3?(E.push(C[0]+"..."+C[C.length-1]),p=!0):C.length&&(E=E.concat(C)),E}return s=t.reduce(function(E,C){return E.concat((C+"").split(""))},[]).reduce(function(E,C){var S,P;return e||(C=C.toLowerCase()),S=/^\d$/.test(C)?1:/^[A-Z]$/.test(C)?2:/^[a-z]$/.test(C)?3:0,r&&S===0?f+=C:(P=C.charCodeAt(0),S&&S===n&&P===c+1?a.push(C):(E=h(E,a),a=[C],n=S),c=P),E},[]),s=h(s,a),f&&(s.push(f),p=!0),{values:s,suppressed:p}}function sve(t,e){return t.join(t.length>2?", ":e?" / ":"/")}function ove(t,e){var r,s,a={},n;if(e.phContent&&(r=e.phContent(t,e)),typeof r!="string")switch(t){case"hideEchoBack":case"mask":case"defaultInput":case"caseSensitive":case"keepWhitespace":case"encoding":case"bufferSize":case"history":case"cd":r=e.hasOwnProperty(t)?typeof e[t]=="boolean"?e[t]?"on":"off":e[t]+"":"";break;case"limit":case"trueValue":case"falseValue":s=e[e.hasOwnProperty(t+"Src")?t+"Src":t],e.keyIn?(a=ive(s,e.caseSensitive),s=a.values):s=s.filter(function(c){var f=typeof c;return f==="string"||f==="number"}),r=sve(s,a.suppressed);break;case"limitCount":case"limitCountNotZero":r=e[e.hasOwnProperty("limitSrc")?"limitSrc":"limit"].length,r=r||t!=="limitCountNotZero"?r+"":"";break;case"lastInput":r=h9;break;case"cwd":case"CWD":case"cwdHome":r=process.cwd(),t==="CWD"?r=K0.basename(r):t==="cwdHome"&&(r=d9(r));break;case"date":case"time":case"localeDate":case"localeTime":r=new Date()["to"+t.replace(/^./,function(c){return c.toUpperCase()})+"String"]();break;default:typeof(n=(t.match(/^history_m(\d+)$/)||[])[1])=="string"&&(r=bm[bm.length-n]||"")}return r}function ave(t){var e=/^(.)-(.)$/.exec(t),r="",s,a,n,c;if(!e)return null;for(s=e[1].charCodeAt(0),a=e[2].charCodeAt(0),c=s<a?1:-1,n=s;n!==a+c;n+=c)r+=String.fromCharCode(n
2025-04-10 09:51:25 -04:00
`:"")+E}for(t.limitSrc=t.limit,t.displaySrc=t.display,t.limit="",t.display=zC(t.display+"",p);;){if(e=f9(t),r=!1,s="",t.defaultInput&&!e&&(e=t.defaultInput),t.history&&((a=/^\s*\!(?:\!|-1)(:p)?\s*$/.exec(e))?(n=bm[0]||"",a[1]?r=!0:e=n,h(n+`
`),r||(t.displayOnly=!0,f9(t),t.displayOnly=!1)):e&&e!==bm[bm.length-1]&&(bm=[e])),!r&&t.cd&&e)switch(c=p9(e),c[0].toLowerCase()){case"cd":if(c[1])try{process.chdir(d9(c[1],!0))}catch(E){h(E+"")}r=!0;break;case"pwd":h(process.cwd()),r=!0;break}if(!r&&t.preCheck&&(f=t.preCheck(e,t),e=f.res,f.forceNext&&(r=!0)),!r){if(!t.limitSrc.length||A9(e,t.limitSrc,t.caseSensitive))break;t.limitMessage&&(s=zC(t.limitMessage,p))}h((s?s+`
2025-04-11 10:05:45 -04:00
`:"")+zC(t.displaySrc+"",p))}return lve(e,t)}$r._DBG_set_useExt=function(t){rve=t};$r._DBG_set_checkOptions=function(t){u9=t};$r._DBG_set_checkMethod=function(t){CS=t};$r._DBG_clearHistory=function(){h9="",bm=[]};$r.setDefaultOptions=function(t){return c9=Ks(!0,t),Ks(!0)};$r.question=function(t,e){return cve(Ks(Ks(!0,e),{display:t}))};$r.prompt=function(t){var e=Ks(!0,t);return e.display=e.prompt,cve(e)};$r.keyIn=function(t,e){var r=Ks(Ks(!0,e),{display:t,keyIn:!0,keepWhitespace:!0});return r.limitSrc=r.limit.filter(function(s){var a=typeof s;return a==="string"||a==="number"}).map(function(s){return zC(s+"",ave)}),r.limit=g9(r.limitSrc.join("")),["trueValue","falseValue"].forEach(function(s){r[s]=r[s].reduce(function(a,n){var c=typeof n;return c==="string"||c==="number"?a=a.concat((n+"").split("")):a.push(n),a},[])}),r.display=zC(r.display+"",function(s){return ove(s,r)}),lve(f9(r),r)};$r.questionEMail=function(t,e){return t==null&&(t="Input e-mail address: "),$r.question(t,Ks({hideEchoBack:!1,limit:/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,limitMessage:"Input valid e-mail address, please.",trueValue:null,falseValue:null},e,{keepWhitespace:!1,cd:!1}))};$r.questionNewPassword=function(t,e){var r,s,a,n=Ks({hideEchoBack:!0,mask:"*",limitMessage:`It can include: $<charlist>
And the length must be: $<length>`,trueValue:null,falseValue:null,caseSensitive:!0},e,{history:!1,cd:!1,phContent:function(P){return P==="charlist"?r.text:P==="length"?s+"..."+a:null}}),c,f,p,h,E,C,S;for(e=e||{},c=zC(e.charlist?e.charlist+"":"$<!-~>",ave),(isNaN(s=parseInt(e.min,10))||typeof s!="number")&&(s=12),(isNaN(a=parseInt(e.max,10))||typeof a!="number")&&(a=24),h=new RegExp("^["+g9(c)+"]{"+s+","+a+"}$"),r=ive([c],n.caseSensitive,!0),r.text=sve(r.values,r.suppressed),f=e.confirmMessage!=null?e.confirmMessage:"Reinput a same one to confirm it: ",p=e.unmatchMessage!=null?e.unmatchMessage:"It differs from first one. Hit only the Enter key if you want to retry from first one.",t==null&&(t="Input new password: "),E=n.limitMessage;!S;)n.limit=h,n.limitMessage=E,C=$r.question(t,n),n.limit=[C,""],n.limitMessage=p,S=$r.question(f,n);return C};function uve(t,e,r){var s;function a(n){return s=r(n),!isNaN(s)&&typeof s=="number"}return $r.question(t,Ks({limitMessage:"Input valid number, please."},e,{limit:a,cd:!1})),s}$r.questionInt=function(t,e){return uve(t,e,function(r){return parseInt(r,10)})};$r.questionFloat=function(t,e){return uve(t,e,parseFloat)};$r.questionPath=function(t,e){var r,s="",a=Ks({hideEchoBack:!1,limitMessage:`$<error(
)>Input valid path, please.$<( Min:)min>$<( Max:)max>`,history:!0,cd:!0},e,{keepWhitespace:!1,limit:function(n){var c,f,p;n=d9(n,!0),s="";function h(E){E.split(/\/|\\/).reduce(function(C,S){var P=K0.resolve(C+=S+K0.sep);if(!ii.existsSync(P))ii.mkdirSync(P);else if(!ii.statSync(P).isDirectory())throw new Error("Non directory already exists: "+P);return C},"")}try{if(c=ii.existsSync(n),r=c?ii.realpathSync(n):K0.resolve(n),!e.hasOwnProperty("exists")&&!c||typeof e.exists=="boolean"&&e.exists!==c)return s=(c?"Already exists":"No such file or directory")+": "+r,!1;if(!c&&e.create&&(e.isDirectory?h(r):(h(K0.dirname(r)),ii.closeSync(ii.openSync(r,"w"))),r=ii.realpathSync(r)),c&&(e.min||e.max||e.isFile||e.isDirectory)){if(f=ii.statSync(r),e.isFile&&!f.isFile())return s="Not file: "+r,!1;if(e.isDirectory&&!f.isDirectory())return s="Not directory: "+r,!1;if(e.min&&f.size<+e.min||e.max&&f.size>+e.max)return s="Size "+f.size+" is out of range: "+r,!1}if(typeof e.validate=="function"&&(p=e.validate(r))!==!0)return typeof p=="string"&&(s=p),!1}catch(E){return s=E+"",!1}return!0},phContent:function(n){return n==="error"?s:n!=="min"&&n!=="max"?null:e.hasOwnProperty(n)?e[n]+"":""}});return e=e||{},t==null&&(t='Input path (you can "cd" and "pwd"): '),$r.question(t,a),r};function fve(t,e){var r={},s={};return typeof t=="object"?(Object.keys(t).forEach(function(a){typeof t[a]=="function"&&(s[e.caseSensitive?a:a.toLowerCase()]=t[a])}),r.preCheck=function(a){var n;return r.args=p9(a),n=r.args[0]||"",e.caseSensitive||(n=n.toLowerCase()),r.hRes=n!=="_"&&s.hasOwnProperty(n)?s[n].apply(a,r.args.slice(1)):s.hasOwnProperty("_")?s._.apply(a,r.args):null,{res:a,forceNext:!1}},s.hasOwnProperty("_")||(r.limit=function(){var a=r.args[0]||"";return e.caseSensitive||(a=a.toLowerCase()),s.hasOwnProperty(a)})):r.preCheck=function(a){return r.args=p9(a),r.hRes=typeof t=="function"?t.apply(a,r.args):!0,{res:a,forceNext:!1}},r}$r.promptCL=function(t,e){var r=Ks({hideEchoBack:!1,limitMessage:"Requested command is not available.",caseSensitive:!1,history:!0},e),s=fve(t,r);return r.limit=s.limit,r.preCheck=s.preCheck,$r.prompt(r),s.args};$r.promptLoop=function(t,e){for(var r=Ks({hideEchoBack:!1,trueValue:null,falseValue:null,caseSensitive:!1,history:!0},e);!t($r.prompt(r)););};$r.promptCLLoop=function(t,e){var r=Ks({hideEchoBack:!1,limitMessage:"Requested command is not available.",caseSensitive:!1,history:!0},e),s=fve(t,r);for(r.limit=s.limit,r.preCheck=s.preCheck;$r.prompt(r),!s.hRes;);};$r.promptSimShell=function(t){return $r.prompt(Ks({hideEchoBack:!1,history:!0},t,{prompt:function(){return Pm?"$<cwd>>":(process.env.USER||"")+(process.env.HOSTNAME?"@"+process.env.HOSTNAME.replace(/\..*$/,""):"")+":$<cwdHome>$ "}()}))};function Ave(t,e,r){var s;return t==null&&(t="Are you sure? "),(!e||e.guide!==!1)&&(t+="")&&(t=t.replace(/\s*:?\s*$/,"")+" [y/n]: "),s=$r.keyIn(t,Ks(e,{hideEchoBack:!1,limit:r,trueValue:"y",falseValue:"n",caseSensitive:!1})),typeof s=="boolean"?s:""}$r.keyInYN=function(t,e){return Ave(t,e)};$r.keyInYNStrict=function(t,e){return Ave(t,e,"yn")};$r.keyInPause=function(t,e){t==null&&(t="Continue..."),(!e||e.guide!==!1)&&(t+="")&&(t=t.replace(/\s+$/,"")+" (Hit any key)"),$r.keyIn(t,Ks({limit:null},e,{hideEchoBack:!0,mask:""}))};$r.keyInSelect=function(t,e,r){var s=Ks({hideEchoBack:!1},r,{trueValue:null,falseValue:null,caseSensitive:!1,phContent:function(p){return p==="itemsCount"?t.length+"":p==="firstItem"?(t[0]+"").trim():p==="lastItem"?(t[t.length-1]+"").trim():null}}),a="",n={},c=49,f=`
2025-04-10 09:51:25 -04:00
`;if(!Array.isArray(t)||!t.length||t.length>35)throw"`items` must be Array (max length: 35).";return t.forEach(function(p,h){var E=String.fromCharCode(c);a+=E,n[E]=h,f+="["+E+"] "+(p+"").trim()+`
`,c=c===57?97:c+1}),(!r||r.cancel!==!1)&&(a+="0",n[0]=-1,f+="[0] "+(r&&r.cancel!=null&&typeof r.cancel!="boolean"?(r.cancel+"").trim():"CANCEL")+`
`),s.limit=a,f+=`
2025-04-11 10:05:45 -04:00
`,e==null&&(e="Choose one from list: "),(e+="")&&((!r||r.guide!==!1)&&(e=e.replace(/\s*:?\s*$/,"")+" [$<limit>]: "),f+=e),n[$r.keyIn(f,s).toLowerCase()]};$r.getRawInput=function(){return fF};function wS(t,e){var r;return e.length&&(r={},r[t]=e[0]),$r.setDefaultOptions(r)[t]}$r.setPrint=function(){return wS("print",arguments)};$r.setPrompt=function(){return wS("prompt",arguments)};$r.setEncoding=function(){return wS("encoding",arguments)};$r.setMask=function(){return wS("mask",arguments)};$r.setBufferSize=function(){return wS("bufferSize",arguments)}});var m9=L((vfr,tc)=>{(function(){var t={major:0,minor:2,patch:66,status:"beta"};tau_file_system={files:{},open:function(w,b,y){var F=tau_file_system.files[w];if(!F){if(y==="read")return null;F={path:w,text:"",type:b,get:function(z,Z){return Z===this.text.length||Z>this.text.length?"end_of_file":this.text.substring(Z,Z+z)},put:function(z,Z){return Z==="end_of_file"?(this.text+=z,!0):Z==="past_end_of_file"?null:(this.text=this.text.substring(0,Z)+z+this.text.substring(Z+z.length),!0)},get_byte:function(z){if(z==="end_of_stream")return-1;var Z=Math.floor(z/2);if(this.text.length<=Z)return-1;var $=n(this.text[Math.floor(z/2)],0);return z%2===0?$&255:$/256>>>0},put_byte:function(z,Z){var $=Z==="end_of_stream"?this.text.length:Math.floor(Z/2);if(this.text.length<$)return null;var oe=this.text.length===$?-1:n(this.text[Math.floor(Z/2)],0);return Z%2===0?(oe=oe/256>>>0,oe=(oe&255)<<8|z&255):(oe=oe&255,oe=(z&255)<<8|oe&255),this.text.length===$?this.text+=c(oe):this.text=this.text.substring(0,$)+c(oe)+this.text.substring($+1),!0},flush:function(){return!0},close:function(){var z=tau_file_system.files[this.path];return z?!0:null}},tau_file_system.files[w]=F}return y==="write"&&(F.text=""),F}},tau_user_input={buffer:"",get:function(w,b){for(var y;tau_user_input.buffer.length<w;)y=window.prompt(),y&&(tau_user_input.buffer+=y);return y=tau_user_input.buffer.substr(0,w),tau_user_input.buffer=tau_user_input.buffer.substr(w),y}},tau_user_output={put:function(w,b){return console.log(w),!0},flush:function(){return!0}},nodejs_file_system={open:function(w,b,y){var F=ye("fs"),z=F.openSync(w,y[0]);return y==="read"&&!F.existsSync(w)?null:{get:function(Z,$){var oe=new Buffer(Z);return F.readSync(z,oe,0,Z,$),oe.toString()},put:function(Z,$){var oe=Buffer.from(Z);if($==="end_of_file")F.writeSync(z,oe);else{if($==="past_end_of_file")return null;F.writeSync(z,oe,0,oe.length,$)}return!0},get_byte:function(Z){return null},put_byte:function(Z,$){return null},flush:function(){return!0},close:function(){return F.closeSync(z),!0}}}},nodejs_user_input={buffer:"",get:function(w,b){for(var y,F=pve();nodejs_user_input.buffer.length<w;)nodejs_user_input.buffer+=F.question();return y=nodejs_user_input.buffer.substr(0,w),nodejs_user_input.buffer=nodejs_user_input.buffer.substr(w),y}},nodejs_user_output={put:function(w,b){return process.stdout.write(w),!0},flush:function(){return!0}};var e;Array.prototype.indexOf?e=function(w,b){return w.indexOf(b)}:e=function(w,b){for(var y=w.length,F=0;F<y;F++)if(b===w[F])return F;return-1};var r=function(w,b){if(w.length!==0){for(var y=w[0],F=w.length,z=1;z<F;z++)y=b(y,w[z]);return y}},s;Array.prototype.map?s=function(w,b){return w.map(b)}:s=function(w,b){for(var y=[],F=w.length,z=0;z<F;z++)y.push(b(w[z]));return y};var a;Array.prototype.filter?a=function(w,b){return w.filter(b)}:a=function(w,b){for(var y=[],F=w.length,z=0;z<F;z++)b(w[z])&&y.push(w[z]);return y};var n;String.prototype.codePointAt?n=function(w,b){return w.codePointAt(b)}:n=function(w,b){return w.charCodeAt(b)};var c;String.fromCodePoint?c=function(){return String.fromCodePoint.apply(null,arguments)}:c=function(){return String.fromCharCode.apply(null,arguments)};var f=0,p=1,h=/(\\a)|(\\b)|(\\f)|(\\n)|(\\r)|(\\t)|(\\v)|\\x([0-9a-fA-F]+)\\|\\([0-7]+)\\|(\\\\)|(\\')|('')|(\\")|(\\`)|(\\.)|(.)/g,E={"\\a":7,"\\b":8,"\\f":12,"\\n":10,"\\r":13,"\\t":9,"\\v":11};function C(w){var b=[],y=!1;return w.replace(h,function(F,z,Z,$,oe,xe,Te,lt,Et,qt,ir,Pt,gn,Pr,Ir,Nr,nn){switch(!0){case Et!==void 0:return b.push(parseInt(Et,16)
2025-04-10 09:51:25 -04:00
`,"\r"," ","\v"].indexOf(Z)!==-1)switch(F+=1,Z){case"a":y+="a";break;case"b":y+="\b";break;case"f":y+="\f";break;case"n":y+=`
`;break;case"r":y+="\r";break;case"t":y+=" ";break;case"v":y+="\v";break;case"'":y+="'";break;case'"':y+='"';break;case"\\":y+="\\";break}else return null;else y+=z}return y}function P(w){for(var b="",y=0;y<w.length;y++)switch(w.charAt(y)){case"'":b+="\\'";break;case"\\":b+="\\\\";break;case"\b":b+="\\b";break;case"\f":b+="\\f";break;case`
`:b+="\\n";break;case"\r":b+="\\r";break;case" ":b+="\\t";break;case"\v":b+="\\v";break;default:b+=w.charAt(y);break}return b}function I(w){var b=w.substr(2);switch(w.substr(0,2).toLowerCase()){case"0x":return parseInt(b,16);case"0b":return parseInt(b,2);case"0o":return parseInt(b,8);case"0'":return C(b)[0];default:return parseFloat(w)}}var R={whitespace:/^\s*(?:(?:%.*)|(?:\/\*(?:\n|\r|.)*?\*\/)|(?:\s+))\s*/,variable:/^(?:[A-Z_][a-zA-Z0-9_]*)/,atom:/^(\!|,|;|[a-z][0-9a-zA-Z_]*|[#\$\&\*\+\-\.\/\:\<\=\>\?\@\^\~\\]+|'(?:[^']*?(?:\\(?:x?\d+)?\\)*(?:'')*(?:\\')*)*')/,number:/^(?:0o[0-7]+|0x[0-9a-fA-F]+|0b[01]+|0'(?:''|\\[abfnrtv\\'"`]|\\x?\d+\\|[^\\])|\d+(?:\.\d+(?:[eE][+-]?\d+)?)?)/,string:/^(?:"([^"]|""|\\")*"|`([^`]|``|\\`)*`)/,l_brace:/^(?:\[)/,r_brace:/^(?:\])/,l_bracket:/^(?:\{)/,r_bracket:/^(?:\})/,bar:/^(?:\|)/,l_paren:/^(?:\()/,r_paren:/^(?:\))/};function N(w,b){return w.get_flag("char_conversion").id==="on"?b.replace(/./g,function(y){return w.get_char_conversion(y)}):b}function U(w){this.thread=w,this.text="",this.tokens=[]}U.prototype.set_last_tokens=function(w){return this.tokens=w},U.prototype.new_text=function(w){this.text=w,this.tokens=[]},U.prototype.get_tokens=function(w){var b,y=0,F=0,z=0,Z=[],$=!1;if(w){var oe=this.tokens[w-1];y=oe.len,b=N(this.thread,this.text.substr(oe.len)),F=oe.line,z=oe.start}else b=this.text;if(/^\s*$/.test(b))return null;for(;b!=="";){var xe=[],Te=!1;if(/^\n/.exec(b)!==null){F++,z=0,y++,b=b.replace(/\n/,""),$=!0;continue}for(var lt in R)if(R.hasOwnProperty(lt)){var Et=R[lt].exec(b);Et&&xe.push({value:Et[0],name:lt,matches:Et})}if(!xe.length)return this.set_last_tokens([{value:b,matches:[],name:"lexical",line:F,start:z}]);var oe=r(xe,function(Pr,Ir){return Pr.value.length>=Ir.value.length?Pr:Ir});switch(oe.start=z,oe.line=F,b=b.replace(oe.value,""),z+=oe.value.length,y+=oe.value.length,oe.name){case"atom":oe.raw=oe.value,oe.value.charAt(0)==="'"&&(oe.value=S(oe.value.substr(1,oe.value.length-2),"'"),oe.value===null&&(oe.name="lexical",oe.value="unknown escape sequence"));break;case"number":oe.float=oe.value.substring(0,2)!=="0x"&&oe.value.match(/[.eE]/)!==null&&oe.value!=="0'.",oe.value=I(oe.value),oe.blank=Te;break;case"string":var qt=oe.value.charAt(0);oe.value=S(oe.value.substr(1,oe.value.length-2),qt),oe.value===null&&(oe.name="lexical",oe.value="unknown escape sequence");break;case"whitespace":var ir=Z[Z.length-1];ir&&(ir.space=!0),Te=!0;continue;case"r_bracket":Z.length>0&&Z[Z.length-1].name==="l_bracket"&&(oe=Z.pop(),oe.name="atom",oe.value="{}",oe.raw="{}",oe.space=!1);break;case"r_brace":Z.length>0&&Z[Z.length-1].name==="l_brace"&&(oe=Z.pop(),oe.name="atom",oe.value="[]",oe.raw="[]",oe.space=!1);break}oe.len=y,Z.push(oe),Te=!1}var Pt=this.set_last_tokens(Z);return Pt.length===0?null:Pt};function W(w,b,y,F,z){if(!b[y])return{type:f,value:x.error.syntax(b[y-1],"expression expected",!0)};var Z;if(F==="0"){var $=b[y];switch($.name){case"number":return{type:p,len:y+1,value:new x.type.Num($.value,$.float)};case"variable":return{type:p,len:y+1,value:new x.type.Var($.value)};case"string":var oe;switch(w.get_flag("double_quotes").id){case"atom":oe=new j($.value,[]);break;case"codes":oe=new j("[]",[]);for(var xe=$.value.length-1;xe>=0;xe--)oe=new j(".",[new x.type.Num(n($.value,xe),!1),oe]);break;case"chars":oe=new j("[]",[]);for(var xe=$.value.length-1;xe>=0;xe--)oe=new j(".",[new x.type.Term($.value.charAt(xe),[]),oe]);break}return{type:p,len:y+1,value:oe};case"l_paren":var Pt=W(w,b,y+1,w.__get_max_priority(),!0);return Pt.type!==p?Pt:b[Pt.len]&&b[Pt.len].name==="r_paren"?(Pt.len++,Pt):{type:f,derived:!0,value:x.error.syntax(b[Pt.len]?b[Pt.len]:b[Pt.len-1],") or operator expected",!b[Pt.len])};case"l_bracket":var Pt=W(w,b,y+1,w.__get_max_priority(),!0);return Pt.type!==p?Pt:b[Pt.len]&&b[Pt.len].name==="r_bracket"?(Pt.len++,Pt.value=new j("{}",[Pt.value]),Pt):{type:f,derived:!0,value:x.error.syntax(b[Pt.len]?b[Pt.len]:b[Pt.len-1],"} or operator expected",!b[Pt.len])}}var Te=te(w,b,y,z);return Te.type===p||Te.derived||(Te=ie(w,b,y),Te.type===p||Te.derived)?Te:{type:f,derived:!1,value:
`;b+=`
`;for(key in this.rules)for(y=0;y<this.rules[key].length;y++)b+=this.rules[key][y].toString(w),b+=`
`;return b},De.prototype.clone=function(){return new De(this.id)},Re.prototype.clone=function(){return new Re(this.value,this.is_float)},j.prototype.clone=function(){return new j(this.id,s(this.args,function(w){return w.clone()}))},Fe.prototype.clone=function(){return new Stram(this.stream,this.mode,this.alias,this.type,this.reposition,this.eof_action)},Ne.prototype.clone=function(){var w={};for(var b in this.links)this.links.hasOwnProperty(b)&&(w[b]=this.links[b].clone());return new Ne(w)},Pe.prototype.clone=function(){return new Pe(this.goal.clone(),this.substitution.clone(),this.parent)},Ye.prototype.clone=function(){return new Ye(this.head.clone(),this.body!==null?this.body.clone():null)},De.prototype.equals=function(w){return x.type.is_variable(w)&&this.id===w.id},Re.prototype.equals=function(w){return x.type.is_number(w)&&this.value===w.value&&this.is_float===w.is_float},j.prototype.equals=function(w){if(!x.type.is_term(w)||this.indicator!==w.indicator)return!1;for(var b=0;b<this.args.length;b++)if(!this.args[b].equals(w.args[b]))return!1;return!0},Fe.prototype.equals=function(w){return x.type.is_stream(w)&&this.id===w.id},Ne.prototype.equals=function(w){var b;if(!x.type.is_substitution(w))return!1;for(b in this.links)if(this.links.hasOwnProperty(b)&&(!w.links[b]||!this.links[b].equals(w.links[b])))return!1;for(b in w.links)if(w.links.hasOwnProperty(b)&&!this.links[b])return!1;return!0},Pe.prototype.equals=function(w){return x.type.is_state(w)&&this.goal.equals(w.goal)&&this.substitution.equals(w.substitution)&&this.parent===w.parent},Ye.prototype.equals=function(w){return x.type.is_rule(w)&&this.head.equals(w.head)&&(this.body===null&&w.body===null||this.body!==null&&this.body.equals(w.body))},De.prototype.rename=function(w){return w.get_free_variable(this)},Re.prototype.rename=function(w){return this},j.prototype.rename=function(w){return new j(this.id,s(this.args,function(b){return b.rename(w)}))},Fe.prototype.rename=function(w){return this},Ye.prototype.rename=function(w){return new Ye(this.head.rename(w),this.body!==null?this.body.rename(w):null)},De.prototype.variables=function(){return[this.id]},Re.prototype.variables=function(){return[]},j.prototype.variables=function(){return[].concat.apply([],s(this.args,function(w){return w.variables()}))},Fe.prototype.variables=function(){return[]},Ye.prototype.variables=function(){return this.body===null?this.head.variables():this.head.variables().concat(this.body.variables())},De.prototype.apply=function(w){return w.lookup(this.id)?w.lookup(this.id):this},Re.prototype.apply=function(w){return this},j.prototype.apply=function(w){if(this.indicator==="./2"){for(var b=[],y=this;y.indicator==="./2";)b.push(y.args[0].apply(w)),y=y.args[1];for(var F=y.apply(w),z=b.length-1;z>=0;z--)F=new j(".",[b[z],F]);return F}return new j(this.id,s(this.args,function(Z){return Z.apply(w)}),this.ref)},Fe.prototype.apply=function(w){return this},Ye.prototype.apply=function(w){return new Ye(this.head.apply(w),this.body!==null?this.body.apply(w):null)},Ne.prototype.apply=function(w){var b,y={};for(b in this.links)this.links.hasOwnProperty(b)&&(y[b]=this.links[b].apply(w));return new Ne(y)},j.prototype.select=function(){for(var w=this;w.indicator===",/2";)w=w.args[0];return w},j.prototype.replace=function(w){return this.indicator===",/2"?this.args[0].indicator===",/2"?new j(",",[this.args[0].replace(w),this.args[1]]):w===null?this.args[1]:new j(",",[w,this.args[1]]):w},j.prototype.search=function(w){if(x.type.is_term(w)&&w.ref!==void 0&&this.ref===w.ref)return!0;for(var b=0;b<this.args.length;b++)if(x.type.is_term(this.args[b])&&this.args[b].search(w))return!0;return!1},ke.prototype.get_current_input=function(){return this.current_input},it.prototype.get_current_input=function(){return this.session.get_current_input()},ke.prototype.get_current_output=function(){return this.current_output},it.prototype.get_current_output=function(){return this.session.get_current_output()},ke.prototype.set_current_input=function(w){this.current_input=w},it.prototype.set_current_input=function(w){return this.se
`,[])])])),b.substitution,b)])},"nl/1":function(w,b,y){var F=y.args[0];w.prepend([new Pe(b.goal.replace(new j("put_char",[F,new j(`
2025-04-11 10:05:45 -04:00
`,[])])),b.substitution,b)])},"get_byte/1":function(w,b,y){var F=y.args[0];w.prepend([new Pe(b.goal.replace(new j(",",[new j("current_input",[new De("S")]),new j("get_byte",[new De("S"),F])])),b.substitution,b)])},"get_byte/2":function(w,b,y){var F=y.args[0],z=y.args[1],Z=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);if(x.type.is_variable(F))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(z)&&!x.type.is_byte(z))w.throw_error(x.error.type("in_byte",char,y.indicator));else if(!x.type.is_stream(F)&&!x.type.is_atom(F))w.throw_error(x.error.domain("stream_or_alias",F,y.indicator));else if(!x.type.is_stream(Z)||Z.stream===null)w.throw_error(x.error.existence("stream",F,y.indicator));else if(Z.output)w.throw_error(x.error.permission("input","stream",F,y.indicator));else if(Z.type==="text")w.throw_error(x.error.permission("input","text_stream",F,y.indicator));else if(Z.position==="past_end_of_stream"&&Z.eof_action==="error")w.throw_error(x.error.permission("input","past_end_of_stream",F,y.indicator));else{var $;if(Z.position==="end_of_stream")$="end_of_file",Z.position="past_end_of_stream";else{if($=Z.stream.get_byte(Z.position),$===null){w.throw_error(x.error.representation("byte",y.indicator));return}Z.position++}w.prepend([new Pe(b.goal.replace(new j("=",[new Re($,!1),z])),b.substitution,b)])}},"peek_byte/1":function(w,b,y){var F=y.args[0];w.prepend([new Pe(b.goal.replace(new j(",",[new j("current_input",[new De("S")]),new j("peek_byte",[new De("S"),F])])),b.substitution,b)])},"peek_byte/2":function(w,b,y){var F=y.args[0],z=y.args[1],Z=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);if(x.type.is_variable(F))w.throw_error(x.error.instantiation(y.indicator));else if(!x.type.is_variable(z)&&!x.type.is_byte(z))w.throw_error(x.error.type("in_byte",char,y.indicator));else if(!x.type.is_stream(F)&&!x.type.is_atom(F))w.throw_error(x.error.domain("stream_or_alias",F,y.indicator));else if(!x.type.is_stream(Z)||Z.stream===null)w.throw_error(x.error.existence("stream",F,y.indicator));else if(Z.output)w.throw_error(x.error.permission("input","stream",F,y.indicator));else if(Z.type==="text")w.throw_error(x.error.permission("input","text_stream",F,y.indicator));else if(Z.position==="past_end_of_stream"&&Z.eof_action==="error")w.throw_error(x.error.permission("input","past_end_of_stream",F,y.indicator));else{var $;if(Z.position==="end_of_stream")$="end_of_file",Z.position="past_end_of_stream";else if($=Z.stream.get_byte(Z.position),$===null){w.throw_error(x.error.representation("byte",y.indicator));return}w.prepend([new Pe(b.goal.replace(new j("=",[new Re($,!1),z])),b.substitution,b)])}},"put_byte/1":function(w,b,y){var F=y.args[0];w.prepend([new Pe(b.goal.replace(new j(",",[new j("current_output",[new De("S")]),new j("put_byte",[new De("S"),F])])),b.substitution,b)])},"put_byte/2":function(w,b,y){var F=y.args[0],z=y.args[1],Z=x.type.is_stream(F)?F:w.get_stream_by_alias(F.id);x.type.is_variable(F)||x.type.is_variable(z)?w.throw_error(x.error.instantiation(y.indicator)):x.type.is_byte(z)?!x.type.is_variable(F)&&!x.type.is_stream(F)&&!x.type.is_atom(F)?w.throw_error(x.error.domain("stream_or_alias",F,y.indicator)):!x.type.is_stream(Z)||Z.stream===null?w.throw_error(x.error.existence("stream",F,y.indicator)):Z.input?w.throw_error(x.error.permission("output","stream",F,y.indicator)):Z.type==="text"?w.throw_error(x.error.permission("output","text_stream",F,y.indicator)):Z.stream.put_byte(z.value,Z.position)&&(typeof Z.position=="number"&&Z.position++,w.success(b)):w.throw_error(x.error.type("byte",z,y.indicator))},"read/1":function(w,b,y){var F=y.args[0];w.prepend([new Pe(b.goal.replace(new j(",",[new j("current_input",[new De("S")]),new j("read_term",[new De("S"),F,new j("[]",[])])])),b.substitution,b)])},"read/2":function(w,b,y){var F=y.args[0],z=y.args[1];w.prepend([new Pe(b.goal.replace(new j("read_term",[F,z,new j("[]",[])])),b.substitution,b)])},"read_term/2":function(w,b,y){var F=y.args[0],z=y.args[1];w.prepend([new Pe(b.goal.replace(new j(",",[new j("current_input",[new De("S")]),new j("read_term",[new
2025-04-10 09:51:25 -04:00
`;for(let r of this.project.workspacesByCwd.values()){let s=r.relativeCwd;e+=`workspace(${z0(s)}).
`,e+=`workspace_ident(${z0(s)}, ${z0(q.stringifyIdent(r.anchoredLocator))}).
`,e+=`workspace_version(${z0(s)}, ${z0(r.manifest.version)}).
`;for(let a of Eve)for(let n of r.manifest[a].values())e+=`workspace_has_dependency(${z0(s)}, ${z0(q.stringifyIdent(n))}, ${z0(n.range)}, ${a}).
`}return e+=`workspace(_) :- false.
`,e+=`workspace_ident(_, _) :- false.
`,e+=`workspace_version(_, _) :- false.
`,e+=`workspace_has_dependency(_, _, _, _) :- false.
`,e}getDeclarations(){let e="";return e+=`gen_enforced_dependency(_, _, _, _) :- false.
`,e+=`gen_enforced_field(_, _, _) :- false.
`,e}get fullSource(){return`${this.getProjectDatabase()}
${this.source}
2025-04-11 10:05:45 -04:00
${this.getDeclarations()}`}createSession(){return new I9(this.project,this.fullSource)}async processClassic(){let e=this.createSession();return{enforcedDependencies:await this.genEnforcedDependencies(e),enforcedFields:await this.genEnforcedFields(e)}}async process(){let{enforcedDependencies:e,enforcedFields:r}=await this.processClassic(),s=new Map;for(let{workspace:a,dependencyIdent:n,dependencyRange:c,dependencyType:f}of e){let p=ES([f,q.stringifyIdent(n)]),h=je.getMapWithDefault(s,a.cwd);je.getMapWithDefault(h,p).set(c??void 0,new Set)}for(let{workspace:a,fieldPath:n,fieldValue:c}of r){let f=ES(n),p=je.getMapWithDefault(s,a.cwd);je.getMapWithDefault(p,f).set(JSON.parse(c)??void 0,new Set)}return{manifestUpdates:s,reportedErrors:new Map}}async genEnforcedDependencies(e){let r=[];for await(let s of e.makeQuery("workspace(WorkspaceCwd), dependency_type(DependencyType), gen_enforced_dependency(WorkspaceCwd, DependencyIdent, DependencyRange, DependencyType).")){let a=K.resolve(this.project.cwd,xm(s.links.WorkspaceCwd)),n=xm(s.links.DependencyIdent),c=xm(s.links.DependencyRange),f=xm(s.links.DependencyType);if(a===null||n===null)throw new Error("Invalid rule");let p=this.project.getWorkspaceByCwd(a),h=q.parseIdent(n);r.push({workspace:p,dependencyIdent:h,dependencyRange:c,dependencyType:f})}return je.sortMap(r,[({dependencyRange:s})=>s!==null?"0":"1",({workspace:s})=>q.stringifyIdent(s.anchoredLocator),({dependencyIdent:s})=>q.stringifyIdent(s)])}async genEnforcedFields(e){let r=[];for await(let s of e.makeQuery("workspace(WorkspaceCwd), gen_enforced_field(WorkspaceCwd, FieldPath, FieldValue).")){let a=K.resolve(this.project.cwd,xm(s.links.WorkspaceCwd)),n=xm(s.links.FieldPath),c=dDt(s.links.FieldValue);if(a===null||n===null)throw new Error("Invalid rule");let f=this.project.getWorkspaceByCwd(a);r.push({workspace:f,fieldPath:n,fieldValue:c})}return je.sortMap(r,[({workspace:s})=>q.stringifyIdent(s.anchoredLocator),({fieldPath:s})=>s])}async*query(e){let r=this.createSession();for await(let s of r.makeQuery(e)){let a={};for(let[n,c]of Object.entries(s.links))n!=="_"&&(a[n]=xm(c));yield a}}}});var Qve=L(gF=>{"use strict";Object.defineProperty(gF,"__esModule",{value:!0});function US(t){let e=[...t.caches],r=e.shift();return r===void 0?kve():{get(s,a,n={miss:()=>Promise.resolve()}){return r.get(s,a,n).catch(()=>US({caches:e}).get(s,a,n))},set(s,a){return r.set(s,a).catch(()=>US({caches:e}).set(s,a))},delete(s){return r.delete(s).catch(()=>US({caches:e}).delete(s))},clear(){return r.clear().catch(()=>US({caches:e}).clear())}}}function kve(){return{get(t,e,r={miss:()=>Promise.resolve()}){return e().then(a=>Promise.all([a,r.miss(a)])).then(([a])=>a)},set(t,e){return Promise.resolve(e)},delete(t){return Promise.resolve()},clear(){return Promise.resolve()}}}gF.createFallbackableCache=US;gF.createNullCache=kve});var Rve=L((ihr,Tve)=>{Tve.exports=Qve()});var Fve=L(N9=>{"use strict";Object.defineProperty(N9,"__esModule",{value:!0});function NDt(t={serializable:!0}){let e={};return{get(r,s,a={miss:()=>Promise.resolve()}){let n=JSON.stringify(r);if(n in e)return Promise.resolve(t.serializable?JSON.parse(e[n]):e[n]);let c=s(),f=a&&a.miss||(()=>Promise.resolve());return c.then(p=>f(p)).then(()=>c)},set(r,s){return e[JSON.stringify(r)]=t.serializable?JSON.stringify(s):s,Promise.resolve(s)},delete(r){return delete e[JSON.stringify(r)],Promise.resolve()},clear(){return e={},Promise.resolve()}}}N9.createInMemoryCache=NDt});var Ove=L((ohr,Nve)=>{Nve.exports=Fve()});var Mve=L(ef=>{"use strict";Object.defineProperty(ef,"__esModule",{value:!0});function ODt(t,e,r){let s={"x-algolia-api-key":r,"x-algolia-application-id":e};return{headers(){return t===O9.WithinHeaders?s:{}},queryParameters(){return t===O9.WithinQueryParameters?s:{}}}}function LDt(t){let e=0,r=()=>(e++,new Promise(s=>{setTimeout(()=>{s(t(r))},Math.min(100*e,1e3))}));return t(r)}function Lve(t,e=(r,s)=>Promise.resolve()){return Object.assign(t,{wait(r){return Lve(t.then(s=>Promise.all([e(s,r),s])).then(s=>s[1]))}})}function MDt(t){let e=t.length-1;for(e;e>0;e--){let r=Math.floor(Math.
2025-04-10 09:51:25 -04:00
`;f!==s&&(s=f,t.write(EDe.default.eraseLines(r)+f),r=f.split(`
2025-04-11 10:05:45 -04:00
`).length)};return n.clear=()=>{t.write(EDe.default.eraseLines(r)),s="",r=0},n.done=()=>{s="",r=0,e||(IDe.default.show(),a=!1)},n};XS.default={create:WPt}});var BDe=L((Lhr,YPt)=>{YPt.exports=[{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"SYSTEM_TEAMFOUNDATIONCOLLECTIONURI",pr:"SYSTEM_PULLREQUEST_PULLREQUESTID"},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY_BUILD_BASE",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Shippable",constant:"SHIPPABLE",env:"SHIPPABLE",pr:{IS_PULL_REQUEST:"true"}},{name:"Solano CI",constant:"SOLANO",env:"TDDIUM",pr:"TDDIUM_PR_ID"},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}}]});var DDe=L(rc=>{"use strict";var SDe=BDe(),AA=process.env;Object.defineProperty(rc,"_vendors",{value:SDe.map(function(t){return t.constant})});rc.name=null;rc.isPR=null;SDe.forEach(function(t){var e=Array.isArray(t.env)?t.env:[t.env],r=e.every(function(s){return vDe(s)});if(rc[t.constant]=r,r)switch(rc.name=t.name,typeof t.pr){case"string":rc.isPR=!!AA[t.pr];break;case"object":"env"in t.pr?rc.isPR=t.pr.env in AA&&AA[t.pr.env]!==t.pr.ne:"any"in t.pr?rc.isPR=t.pr.any.some(function(s){return!!AA[s]}):rc.isPR=vDe(t.pr);break;default:rc.isPR=null}});rc.isCI=!!(AA.CI||AA.CONTINUOUS_INTEGRATION||AA.BUILD_NUMBER||AA.RUN_ID||rc.name);function vDe(t){return typeof t=="string"?!!AA[t]:Object.keys(t).every(function(e){return AA[e]===t[e]})}});var PDe=L((_hr,bDe)=>{"use strict";bDe.exports=DDe().isCI});var kDe=L((Uhr,xDe)=>{"use strict";var VPt=t=>{let e=new Set;do for(let r of Reflect.ownKeys(t))e.add([t,r]);while((t=Reflect.getPrototypeOf(t))&&t!==Object.prototype);return e};xDe.exports=(t,{include:e,exclude:r}={})=>{let s=a=>{let n=c=>typeof c=="string"?a===c:c.test(a);return e?e.some(n):r?!r.some(n):!0};for(let[a,n]of VPt(t.constructor.prototype)){if(n==="constructor"||!s(n))continue;let c=Reflect.getOwnPropertyDescriptor(a,n);c&&typeof c.value=="function"&&(t[n]=t[n].bind(t))}return t}});var ODe=L(Vn=>{"use strict";var Ew,tD,FF,IW;typeof performance=="object"&&typeof performance.now=="function"?(QDe=performance,Vn.unstable_now=function(){return QDe.now()}):(hW=Date,TDe=hW.now(),Vn.unstable_now=function(){return hW.now()-TDe});var QDe,hW,TDe;typeof window>"u"||typeof MessageChannel!="function"?(yw=null,gW=null,dW=function(){if(yw!==null)try{var t=Vn.unstable_now();yw(!0,t),yw=null}catch(e){throw setTimeout(dW,0),e}},Ew=function(t){yw!==null?setTimeout(Ew,0,t):(yw=t,setTimeout(dW,0))},tD=function(t,e){gW=setTimeout(t,e)},FF=function(){clear
2025-04-10 09:51:25 -04:00
`+pu+v}var ve=!1;function Nt(v,D){if(!v||ve)return"";ve=!0;var Q=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(D)if(D=function(){throw Error()},Object.defineProperty(D.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(D,[])}catch(At){var H=At}Reflect.construct(v,[],D)}else{try{D.call()}catch(At){H=At}v.call(D.prototype)}else{try{throw Error()}catch(At){H=At}v()}}catch(At){if(At&&H&&typeof At.stack=="string"){for(var V=At.stack.split(`
`),ne=H.stack.split(`
`),Se=V.length-1,Ue=ne.length-1;1<=Se&&0<=Ue&&V[Se]!==ne[Ue];)Ue--;for(;1<=Se&&0<=Ue;Se--,Ue--)if(V[Se]!==ne[Ue]){if(Se!==1||Ue!==1)do if(Se--,Ue--,0>Ue||V[Se]!==ne[Ue])return`
2025-04-11 10:05:45 -04:00
`+V[Se].replace(" at new "," at ");while(1<=Se&&0<=Ue);break}}}finally{ve=!1,Error.prepareStackTrace=Q}return(v=v?v.displayName||v.name:"")?ac(v):""}var lc=[],Ni=-1;function io(v){return{current:v}}function Rt(v){0>Ni||(v.current=lc[Ni],lc[Ni]=null,Ni--)}function xn(v,D){Ni++,lc[Ni]=v.current,v.current=D}var ca={},ji=io(ca),Oi=io(!1),Oa=ca;function dn(v,D){var Q=v.type.contextTypes;if(!Q)return ca;var H=v.stateNode;if(H&&H.__reactInternalMemoizedUnmaskedChildContext===D)return H.__reactInternalMemoizedMaskedChildContext;var V={},ne;for(ne in Q)V[ne]=D[ne];return H&&(v=v.stateNode,v.__reactInternalMemoizedUnmaskedChildContext=D,v.__reactInternalMemoizedMaskedChildContext=V),V}function Jn(v){return v=v.childContextTypes,v!=null}function hu(){Rt(Oi),Rt(ji)}function Ch(v,D,Q){if(ji.current!==ca)throw Error(c(168));xn(ji,D),xn(Oi,Q)}function La(v,D,Q){var H=v.stateNode;if(v=D.childContextTypes,typeof H.getChildContext!="function")return Q;H=H.getChildContext();for(var V in H)if(!(V in v))throw Error(c(108,g(D)||"Unknown",V));return s({},Q,H)}function Ma(v){return v=(v=v.stateNode)&&v.__reactInternalMemoizedMergedChildContext||ca,Oa=ji.current,xn(ji,v),xn(Oi,Oi.current),!0}function Ua(v,D,Q){var H=v.stateNode;if(!H)throw Error(c(169));Q?(v=La(v,D,Oa),H.__reactInternalMemoizedMergedChildContext=v,Rt(Oi),Rt(ji),xn(ji,v)):Rt(Oi),xn(Oi,Q)}var Xe=null,Ha=null,gf=n.unstable_now;gf();var cc=0,wn=8;function ua(v){if(1&v)return wn=15,1;if(2&v)return wn=14,2;if(4&v)return wn=13,4;var D=24&v;return D!==0?(wn=12,D):v&32?(wn=11,32):(D=192&v,D!==0?(wn=10,D):v&256?(wn=9,256):(D=3584&v,D!==0?(wn=8,D):v&4096?(wn=7,4096):(D=4186112&v,D!==0?(wn=6,D):(D=62914560&v,D!==0?(wn=5,D):v&67108864?(wn=4,67108864):v&134217728?(wn=3,134217728):(D=805306368&v,D!==0?(wn=2,D):1073741824&v?(wn=1,1073741824):(wn=8,v))))))}function _A(v){switch(v){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}function UA(v){switch(v){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(c(358,v))}}function fa(v,D){var Q=v.pendingLanes;if(Q===0)return wn=0;var H=0,V=0,ne=v.expiredLanes,Se=v.suspendedLanes,Ue=v.pingedLanes;if(ne!==0)H=ne,V=wn=15;else if(ne=Q&134217727,ne!==0){var At=ne&~Se;At!==0?(H=ua(At),V=wn):(Ue&=ne,Ue!==0&&(H=ua(Ue),V=wn))}else ne=Q&~Se,ne!==0?(H=ua(ne),V=wn):Ue!==0&&(H=ua(Ue),V=wn);if(H===0)return 0;if(H=31-ns(H),H=Q&((0>H?0:1<<H)<<1)-1,D!==0&&D!==H&&!(D&Se)){if(ua(D),V<=wn)return D;wn=V}if(D=v.entangledLanes,D!==0)for(v=v.entanglements,D&=H;0<D;)Q=31-ns(D),V=1<<Q,H|=v[Q],D&=~V;return H}function vl(v){return v=v.pendingLanes&-1073741825,v!==0?v:v&1073741824?1073741824:0}function Mt(v,D){switch(v){case 15:return 1;case 14:return 2;case 12:return v=kn(24&~D),v===0?Mt(10,D):v;case 10:return v=kn(192&~D),v===0?Mt(8,D):v;case 8:return v=kn(3584&~D),v===0&&(v=kn(4186112&~D),v===0&&(v=512)),v;case 2:return D=kn(805306368&~D),D===0&&(D=268435456),D}throw Error(c(358,v))}function kn(v){return v&-v}function Aa(v){for(var D=[],Q=0;31>Q;Q++)D.push(v);return D}function ja(v,D,Q){v.pendingLanes|=D;var H=D-1;v.suspendedLanes&=H,v.pingedLanes&=H,v=v.eventTimes,D=31-ns(D),v[D]=Q}var ns=Math.clz32?Math.clz32:fc,uc=Math.log,gu=Math.LN2;function fc(v){return v===0?32:31-(uc(v)/gu|0)|0}var qa=n.unstable_runWithPriority,Li=n.unstable_scheduleCallback,Cs=n.unstable_cancelCallback,Sl=n.unstable_shouldYield,df=n.unstable_requestPaint,Ac=n.unstable_now,wi=n.unstable_getCurrentPriorityLevel,Qn=n.unstable_ImmediatePriority,pc=n.unstable_UserBlockingPriority,Je=n.unstable_NormalPriority,st=n.unstable_LowPriority,St=n.unstable_IdlePriority,lr={},ee=df!==void 0?df:function(){},Ie=null,Oe=null,ht=!1,mt=Ac(),Dt=1e4>mt?Ac:function(){return Ac()-mt};function tr(){switch(wi()){case Qn:return 99;case pc:return 98;case Je:return 97;case st:return 96;case St:return 95;default:throw Error(c(332))}}function fn(v){switch(v){case 99:return Qn;case 98:return pc;case 97:return Je;case 96:return st;case 95:return St;defau
2025-04-10 09:51:25 -04:00
Error generating stack: `+ne.message+`
2025-04-11 10:05:45 -04:00
`+ne.stack}return{value:v,source:D,stack:V}}function Kg(v,D){try{console.error(D.value)}catch(Q){setTimeout(function(){throw Q})}}var eM=typeof WeakMap=="function"?WeakMap:Map;function a2(v,D,Q){Q=bl(-1,Q),Q.tag=3,Q.payload={element:null};var H=D.value;return Q.callback=function(){Uy||(Uy=!0,C2=H),Kg(v,D)},Q}function Jg(v,D,Q){Q=bl(-1,Q),Q.tag=3;var H=v.type.getDerivedStateFromError;if(typeof H=="function"){var V=D.value;Q.payload=function(){return Kg(v,D),H(V)}}var ne=v.stateNode;return ne!==null&&typeof ne.componentDidCatch=="function"&&(Q.callback=function(){typeof H!="function"&&(gc===null?gc=new Set([this]):gc.add(this),Kg(v,D));var Se=D.stack;this.componentDidCatch(D.value,{componentStack:Se!==null?Se:""})}),Q}var tM=typeof WeakSet=="function"?WeakSet:Set;function l2(v){var D=v.ref;if(D!==null)if(typeof D=="function")try{D(null)}catch(Q){kf(v,Q)}else D.current=null}function xy(v,D){switch(D.tag){case 0:case 11:case 15:case 22:return;case 1:if(D.flags&256&&v!==null){var Q=v.memoizedProps,H=v.memoizedState;v=D.stateNode,D=v.getSnapshotBeforeUpdate(D.elementType===D.type?Q:bo(D.type,Q),H),v.__reactInternalSnapshotBeforeUpdate=D}return;case 3:F&&D.flags&256&&Rs(D.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(c(163))}function Nh(v,D){if(D=D.updateQueue,D=D!==null?D.lastEffect:null,D!==null){var Q=D=D.next;do{if((Q.tag&v)===v){var H=Q.destroy;Q.destroy=void 0,H!==void 0&&H()}Q=Q.next}while(Q!==D)}}function vP(v,D,Q){switch(Q.tag){case 0:case 11:case 15:case 22:if(D=Q.updateQueue,D=D!==null?D.lastEffect:null,D!==null){v=D=D.next;do{if((v.tag&3)===3){var H=v.create;v.destroy=H()}v=v.next}while(v!==D)}if(D=Q.updateQueue,D=D!==null?D.lastEffect:null,D!==null){v=D=D.next;do{var V=v;H=V.next,V=V.tag,V&4&&V&1&&(MP(Q,v),uM(Q,v)),v=H}while(v!==D)}return;case 1:v=Q.stateNode,Q.flags&4&&(D===null?v.componentDidMount():(H=Q.elementType===Q.type?D.memoizedProps:bo(Q.type,D.memoizedProps),v.componentDidUpdate(H,D.memoizedState,v.__reactInternalSnapshotBeforeUpdate))),D=Q.updateQueue,D!==null&&Cy(Q,D,v);return;case 3:if(D=Q.updateQueue,D!==null){if(v=null,Q.child!==null)switch(Q.child.tag){case 5:v=Re(Q.child.stateNode);break;case 1:v=Q.child.stateNode}Cy(Q,D,v)}return;case 5:v=Q.stateNode,D===null&&Q.flags&4&&eo(v,Q.type,Q.memoizedProps,Q);return;case 6:return;case 4:return;case 12:return;case 13:Z&&Q.memoizedState===null&&(Q=Q.alternate,Q!==null&&(Q=Q.memoizedState,Q!==null&&(Q=Q.dehydrated,Q!==null&&Au(Q))));return;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(c(163))}function SP(v,D){if(F)for(var Q=v;;){if(Q.tag===5){var H=Q.stateNode;D?Eh(H):ro(Q.stateNode,Q.memoizedProps)}else if(Q.tag===6)H=Q.stateNode,D?Ih(H):jn(H,Q.memoizedProps);else if((Q.tag!==23&&Q.tag!==24||Q.memoizedState===null||Q===v)&&Q.child!==null){Q.child.return=Q,Q=Q.child;continue}if(Q===v)break;for(;Q.sibling===null;){if(Q.return===null||Q.return===v)return;Q=Q.return}Q.sibling.return=Q.return,Q=Q.sibling}}function ky(v,D){if(Ha&&typeof Ha.onCommitFiberUnmount=="function")try{Ha.onCommitFiberUnmount(Xe,D)}catch{}switch(D.tag){case 0:case 11:case 14:case 15:case 22:if(v=D.updateQueue,v!==null&&(v=v.lastEffect,v!==null)){var Q=v=v.next;do{var H=Q,V=H.destroy;if(H=H.tag,V!==void 0)if(H&4)MP(D,Q);else{H=D;try{V()}catch(ne){kf(H,ne)}}Q=Q.next}while(Q!==v)}break;case 1:if(l2(D),v=D.stateNode,typeof v.componentWillUnmount=="function")try{v.props=D.memoizedProps,v.state=D.memoizedState,v.componentWillUnmount()}catch(ne){kf(D,ne)}break;case 5:l2(D);break;case 4:F?xP(v,D):z&&z&&(D=D.stateNode.containerInfo,v=lu(D),FA(D,v))}}function DP(v,D){for(var Q=D;;)if(ky(v,Q),Q.child===null||F&&Q.tag===4){if(Q===D)break;for(;Q.sibling===null;){if(Q.return===null||Q.return===D)return;Q=Q.return}Q.sibling.return=Q.return,Q=Q.sibling}else Q.child.return=Q,Q=Q.child}function Qy(v){v.alternate=null,v.child=null,v.dependencies=null,v.firstEffect=null,v.lastEffect=null,v.memoizedProps=null,v.memoizedState=null,v.pendingProps=null,v.return=null,v.updateQueue=null}function bP(v){return v.tag===5||v.tag===3||v.tag===4}function PP(v){if(F
2025-04-10 09:51:25 -04:00
2025-04-11 10:05:45 -04:00
Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`)}Bs!==5&&(Bs=2),At=Vg(At,Ue),Xt=Se;do{switch(Xt.tag){case 3:ne=At,Xt.flags|=4096,D&=-D,Xt.lanes|=D;var Xn=a2(Xt,ne,D);Iy(Xt,Xn);break e;case 1:ne=At;var kr=Xt.type,Rn=Xt.stateNode;if(!(Xt.flags&64)&&(typeof kr.getDerivedStateFromError=="function"||Rn!==null&&typeof Rn.componentDidCatch=="function"&&(gc===null||!gc.has(Rn)))){Xt.flags|=4096,D&=-D,Xt.lanes|=D;var Un=Jg(Xt,ne,D);Iy(Xt,Un);break e}}Xt=Xt.return}while(Xt!==null)}LP(Q)}catch(zr){D=zr,Zi===Q&&Q!==null&&(Zi=Q=Q.return);continue}break}while(!0)}function NP(){var v=My.current;return My.current=kt,v===null?kt:v}function sd(v,D){var Q=xr;xr|=16;var H=NP();oo===v&&Os===D||_h(v,D);do try{oM();break}catch(V){FP(v,V)}while(!0);if(Ng(),xr=Q,My.current=H,Zi!==null)throw Error(c(261));return oo=null,Os=0,Bs}function oM(){for(;Zi!==null;)OP(Zi)}function aM(){for(;Zi!==null&&!Sl();)OP(Zi)}function OP(v){var D=HP(v.alternate,v,ep);v.memoizedProps=v.pendingProps,D===null?LP(v):Zi=D,h2.current=null}function LP(v){var D=v;do{var Q=D.alternate;if(v=D.return,D.flags&2048){if(Q=$L(D),Q!==null){Q.flags&=2047,Zi=Q;return}v!==null&&(v.firstEffect=v.lastEffect=null,v.flags|=2048)}else{if(Q=XL(Q,D,ep),Q!==null){Zi=Q;return}if(Q=D,Q.tag!==24&&Q.tag!==23||Q.memoizedState===null||ep&1073741824||!(Q.mode&4)){for(var H=0,V=Q.child;V!==null;)H|=V.lanes|V.childLanes,V=V.sibling;Q.childLanes=H}v!==null&&!(v.flags&2048)&&(v.firstEffect===null&&(v.firstEffect=D.firstEffect),D.lastEffect!==null&&(v.lastEffect!==null&&(v.lastEffect.nextEffect=D.firstEffect),v.lastEffect=D.lastEffect),1<D.flags&&(v.lastEffect!==null?v.lastEffect.nextEffect=D:v.firstEffect=D,v.lastEffect=D))}if(D=D.sibling,D!==null){Zi=D;return}Zi=D=v}while(D!==null);Bs===0&&(Bs=5)}function tp(v){var D=tr();return ai(99,lM.bind(null,v,D)),null}function lM(v,D){do Du();while(ed!==null);if(xr&48)throw Error(c(327));var Q=v.finishedWork;if(Q===null)return null;if(v.finishedWork=null,v.finishedLanes=0,Q===v.current)throw Error(c(177));v.callbackNode=null;var H=Q.lanes|Q.childLanes,V=H,ne=v.pendingLanes&~V;v.pendingLanes=V,v.suspendedLanes=0,v.pingedLanes=0,v.expiredLanes&=V,v.mutableReadLanes&=V,v.entangledLanes&=V,V=v.entanglements;for(var Se=v.eventTimes,Ue=v.expirationTimes;0<ne;){var At=31-ns(ne),Gt=1<<At;V[At]=0,Se[At]=-1,Ue[At]=-1,ne&=~Gt}if(vu!==null&&!(H&24)&&vu.has(v)&&vu.delete(v),v===oo&&(Zi=oo=null,Os=0),1<Q.flags?Q.lastEffect!==null?(Q.lastEffect.nextEffect=Q,H=Q.firstEffect):H=Q:H=Q.firstEffect,H!==null){V=xr,xr|=32,h2.current=null,nd=rt(v.containerInfo),id=!1,sr=H;do try{cM()}catch(qe){if(sr===null)throw Error(c(330));kf(sr,qe),sr=sr.nextEffect}while(sr!==null);nd=null,sr=H;do try{for(Se=v;sr!==null;){var vr=sr.flags;if(vr&16&&F&&pf(sr.stateNode),vr&128){var Lr=sr.alternate;if(Lr!==null){var Xt=Lr.ref;Xt!==null&&(typeof Xt=="function"?Xt(null):Xt.current=null)}}switch(vr&1038){case 2:PP(sr),sr.flags&=-3;break;case 6:PP(sr),sr.flags&=-3,f2(sr.alternate,sr);break;case 1024:sr.flags&=-1025;break;case 1028:sr.flags&=-1025,f2(sr.alternate,sr);break;case 4:f2(sr.alternate,sr);break;case 8:Ue=Se,ne=sr,F?xP(Ue,ne):DP(Ue,ne);var zn=ne.alternate;Qy(ne),zn!==null&&Qy(zn)}sr=sr.nextEffect}}catch(qe){if(sr===null)throw Error(c(330));kf(sr,qe),sr=sr.nextEffect}while(sr!==null);id&&lt(),Fe(v.containerInfo),v.current=Q,sr=H;do try{for(vr=v;sr!==null;){var mi=sr.flags;if(mi&36&&vP(vr,sr.alternate,sr),mi&128){Lr=void 0;var Za=sr.ref;if(Za!==null){var $e=sr.stateNode;switch(sr.tag){case 5:Lr=Re($e);break;default:Lr=$e}typeof Za=="function"?Za(Lr):Za.current=Lr}}sr=sr.nextEffect}}catch(qe){if(sr===null)throw Error(c(330));kf(sr,qe),sr=sr.nextEffect}while(sr!==null);sr=null,ee(),xr=V}else v.current=Q;if(xf)xf=!1,ed=v,td=D;else for(sr=H;sr!==null;)D=sr.nextEffect,sr.nextEffect=null,sr.flags&8&&(mi=sr,mi.sibling=null,mi.stateNode=null),sr=D;if(H=v.pendingLanes,H===0&&(gc=null),H===1?v===v2?rd++:(rd=0,v2=v):rd=0,Q=Q.stateNode,Ha&&typeof Ha.onCommitFiberRoot=="function")try{Ha.onCommitFiberRoot(Xe,Q,void 0,(Q.current.flags&64)===6
2025-04-10 09:51:25 -04:00
`+(H.join(" > ")+`
No matching component was found for:
2025-04-11 10:05:45 -04:00
`)+v.join(" > ")}return null},r.getPublicRootInstance=function(v){if(v=v.current,!v.child)return null;switch(v.child.tag){case 5:return Re(v.child.stateNode);default:return v.child.stateNode}},r.injectIntoDevTools=function(v){if(v={bundleType:v.bundleType,version:v.version,rendererPackageName:v.rendererPackageName,rendererConfig:v.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:f.ReactCurrentDispatcher,findHostInstanceByFiber:dM,findFiberByHostInstance:v.findFiberByHostInstance||mM,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")v=!1;else{var D=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!D.isDisabled&&D.supportsFiber)try{Xe=D.inject(v),Ha=D}catch{}v=!0}return v},r.observeVisibleRects=function(v,D,Q,H){if(!qt)throw Error(c(363));v=p2(v,D);var V=nn(v,Q,H).disconnect;return{disconnect:function(){V()}}},r.registerMutableSourceForHydration=function(v,D){var Q=D._getVersion;Q=Q(D._source),v.mutableSourceEagerHydrationData==null?v.mutableSourceEagerHydrationData=[D,Q]:v.mutableSourceEagerHydrationData.push(D,Q)},r.runWithPriority=function(v,D){var Q=cc;try{return cc=v,D()}finally{cc=Q}},r.shouldSuspend=function(){return!1},r.unbatchedUpdates=function(v,D){var Q=xr;xr&=-2,xr|=8;try{return v(D)}finally{xr=Q,xr===0&&(Pf(),Tn())}},r.updateContainer=function(v,D,Q,H){var V=D.current,ne=To(),Se=vs(V);e:if(Q){Q=Q._reactInternals;t:{if(we(Q)!==Q||Q.tag!==1)throw Error(c(170));var Ue=Q;do{switch(Ue.tag){case 3:Ue=Ue.stateNode.context;break t;case 1:if(Jn(Ue.type)){Ue=Ue.stateNode.__reactInternalMemoizedMergedChildContext;break t}}Ue=Ue.return}while(Ue!==null);throw Error(c(171))}if(Q.tag===1){var At=Q.type;if(Jn(At)){Q=La(Q,At,Ue);break e}}Q=Ue}else Q=ca;return D.context===null?D.context=Q:D.pendingContext=Q,D=bl(ne,Se),D.payload={element:v},H=H===void 0?null:H,H!==null&&(D.callback=H),Pl(V,D),Rl(V,Se,ne),Se},r}});var UDe=L((Ghr,_De)=>{"use strict";_De.exports=MDe()});var jDe=L((Whr,HDe)=>{"use strict";var zPt={ALIGN_COUNT:8,ALIGN_AUTO:0,ALIGN_FLEX_START:1,ALIGN_CENTER:2,ALIGN_FLEX_END:3,ALIGN_STRETCH:4,ALIGN_BASELINE:5,ALIGN_SPACE_BETWEEN:6,ALIGN_SPACE_AROUND:7,DIMENSION_COUNT:2,DIMENSION_WIDTH:0,DIMENSION_HEIGHT:1,DIRECTION_COUNT:3,DIRECTION_INHERIT:0,DIRECTION_LTR:1,DIRECTION_RTL:2,DISPLAY_COUNT:2,DISPLAY_FLEX:0,DISPLAY_NONE:1,EDGE_COUNT:9,EDGE_LEFT:0,EDGE_TOP:1,EDGE_RIGHT:2,EDGE_BOTTOM:3,EDGE_START:4,EDGE_END:5,EDGE_HORIZONTAL:6,EDGE_VERTICAL:7,EDGE_ALL:8,EXPERIMENTAL_FEATURE_COUNT:1,EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS:0,FLEX_DIRECTION_COUNT:4,FLEX_DIRECTION_COLUMN:0,FLEX_DIRECTION_COLUMN_REVERSE:1,FLEX_DIRECTION_ROW:2,FLEX_DIRECTION_ROW_REVERSE:3,JUSTIFY_COUNT:6,JUSTIFY_FLEX_START:0,JUSTIFY_CENTER:1,JUSTIFY_FLEX_END:2,JUSTIFY_SPACE_BETWEEN:3,JUSTIFY_SPACE_AROUND:4,JUSTIFY_SPACE_EVENLY:5,LOG_LEVEL_COUNT:6,LOG_LEVEL_ERROR:0,LOG_LEVEL_WARN:1,LOG_LEVEL_INFO:2,LOG_LEVEL_DEBUG:3,LOG_LEVEL_VERBOSE:4,LOG_LEVEL_FATAL:5,MEASURE_MODE_COUNT:3,MEASURE_MODE_UNDEFINED:0,MEASURE_MODE_EXACTLY:1,MEASURE_MODE_AT_MOST:2,NODE_TYPE_COUNT:2,NODE_TYPE_DEFAULT:0,NODE_TYPE_TEXT:1,OVERFLOW_COUNT:3,OVERFLOW_VISIBLE:0,OVERFLOW_HIDDEN:1,OVERFLOW_SCROLL:2,POSITION_TYPE_COUNT:2,POSITION_TYPE_RELATIVE:0,POSITION_TYPE_ABSOLUTE:1,PRINT_OPTIONS_COUNT:3,PRINT_OPTIONS_LAYOUT:1,PRINT_OPTIONS_STYLE:2,PRINT_OPTIONS_CHILDREN:4,UNIT_COUNT:4,UNIT_UNDEFINED:0,UNIT_POINT:1,UNIT_PERCENT:2,UNIT_AUTO:3,WRAP_COUNT:3,WRAP_NO_WRAP:0,WRAP_WRAP:1,WRAP_WRAP_REVERSE:2};HDe.exports=zPt});var YDe=L((Yhr,WDe)=>{"use strict";var ZPt=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},LF=function(){function t(e,r){for(var s=0;s<r.length;s++){var a=r[s];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(e,r,s){re
`+Module.extraStackTrace()),demangleAll(t)}Module.stackTrace=stackTrace;var HEAP,buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferViews(){Module.HEAP8=HEAP8=new Int8Array(buffer),Module.HEAP16=HEAP16=new Int16Array(buffer),Module.HEAP32=HEAP32=new Int32Array(buffer),Module.HEAPU8=HEAPU8=new Uint8Array(buffer),Module.HEAPU16=HEAPU16=new Uint16Array(buffer),Module.HEAPU32=HEAPU32=new Uint32Array(buffer),Module.HEAPF32=HEAPF32=new Float32Array(buffer),Module.HEAPF64=HEAPF64=new Float64Array(buffer)}var STATIC_BASE,STATICTOP,staticSealed,STACK_BASE,STACKTOP,STACK_MAX,DYNAMIC_BASE,DYNAMICTOP_PTR;STATIC_BASE=STATICTOP=STACK_BASE=STACKTOP=STACK_MAX=DYNAMIC_BASE=DYNAMICTOP_PTR=0,staticSealed=!1;function abortOnCannotGrowMemory(){abort("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+TOTAL_MEMORY+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")}function enlargeMemory(){abortOnCannotGrowMemory()}var TOTAL_STACK=Module.TOTAL_STACK||5242880,TOTAL_MEMORY=Module.TOTAL_MEMORY||134217728;TOTAL_MEMORY<TOTAL_STACK&&Module.printErr("TOTAL_MEMORY should be larger than TOTAL_STACK, was "+TOTAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")"),Module.buffer?buffer=Module.buffer:buffer=new ArrayBuffer(TOTAL_MEMORY),updateGlobalBufferViews();function getTotalMemory(){return TOTAL_MEMORY}if(HEAP32[0]=1668509029,HEAP16[1]=25459,HEAPU8[2]!==115||HEAPU8[3]!==99)throw"Runtime error: expected the system to be little-endian!";Module.HEAP=HEAP,Module.buffer=buffer,Module.HEAP8=HEAP8,Module.HEAP16=HEAP16,Module.HEAP32=HEAP32,Module.HEAPU8=HEAPU8,Module.HEAPU16=HEAPU16,Module.HEAPU32=HEAPU32,Module.HEAPF32=HEAPF32,Module.HEAPF64=HEAPF64;function callRuntimeCallbacks(t){for(;t.length>0;){var e=t.shift();if(typeof e=="function"){e();continue}var r=e.func;typeof r=="number"?e.arg===void 0?Module.dynCall_v(r):Module.dynCall_vi(r,e.arg):r(e.arg===void 0?null:e.arg)}}var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1,runtimeExited=!1;function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){runtimeInitialized||(runtimeInitialized=!0,callRuntimeCallbacks(__ATINIT__))}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__),runtimeExited=!0}function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(t){__ATPRERUN__.unshift(t)}Module.addOnPreRun=addOnPreRun;function addOnInit(t){__ATINIT__.unshift(t)}Module.addOnInit=addOnInit;function addOnPreMain(t){__ATMAIN__.unshift(t)}Module.addOnPreMain=addOnPreMain;function addOnExit(t){__ATEXIT__.unshift(t)}Module.addOnExit=addOnExit;function addOnPostRun(t){__ATPOSTRUN__.unshift(t)}Module.addOnPostRun=addOnPostRun;function intArrayFromString(t,e,r){var s=r>0?r:lengthBytesUTF8(t)+1,a=new Array(s),n=stringToUTF8Array(t,a,0,a.length);return e&&(a.length=n),a}Module.intArrayFromString=intArrayFromString;function intArrayToString(t){for(var e=[],r=0;r<t.length;r++){var s=t[r];s>255&&(s&=255),e.push(String.fromCharCode(s))}return e.join("")}Module.intArrayToString=intArrayToString;function writeStringToMemory(t,e,r){Runtime.warnOnce("writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!");var s,a;r&&(a=e+lengthBytesUTF8(t),s=HEAP8[a]),stringToUTF8(t,e,1/0),r&&(HEAP8[a]=s)}Module.writeStringToMemory=writeStringToMemory;function writeArrayToMemory(t,e){HEAP8.set(t,e)}Module.writeArrayToMemory=writeArrayToMemory;function
If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.`,r="abort("+t+") at "+stackTrace()+e;throw abortDecorators&&abortDecorators.forEach(function(s){r=s(r,t)}),r}if(Module.abort=Module.abort=abort,Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;Module.noInitialRun&&(shouldRunNow=!1),run()})});var Nm=L((Khr,KDe)=>{"use strict";var $Pt=YDe(),ext=VDe(),PW=!1,xW=null;ext({},function(t,e){if(!PW){if(PW=!0,t)throw t;xW=e}});if(!PW)throw new Error("Failed to load the yoga module - it needed to be loaded synchronously, but didn't");KDe.exports=$Pt(xW.bind,xW.lib)});var QW=L((Jhr,kW)=>{"use strict";var JDe=t=>Number.isNaN(t)?!1:t>=4352&&(t<=4447||t===9001||t===9002||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141);kW.exports=JDe;kW.exports.default=JDe});var ZDe=L((zhr,zDe)=>{"use strict";zDe.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD8
2025-04-10 09:51:25 -04:00
`))e=Math.max(e,ixt(r));return e};RW.exports=$De;RW.exports.default=$De});var ebe=L(sD=>{"use strict";var sxt=sD&&sD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(sD,"__esModule",{value:!0});var oxt=sxt(FW()),NW={};sD.default=t=>{if(t.length===0)return{width:0,height:0};if(NW[t])return NW[t];let e=oxt.default(t),r=t.split(`
2025-04-11 10:05:45 -04:00
`).length;return NW[t]={width:e,height:r},{width:e,height:r}}});var tbe=L(oD=>{"use strict";var axt=oD&&oD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(oD,"__esModule",{value:!0});var bn=axt(Nm()),lxt=(t,e)=>{"position"in e&&t.setPositionType(e.position==="absolute"?bn.default.POSITION_TYPE_ABSOLUTE:bn.default.POSITION_TYPE_RELATIVE)},cxt=(t,e)=>{"marginLeft"in e&&t.setMargin(bn.default.EDGE_START,e.marginLeft||0),"marginRight"in e&&t.setMargin(bn.default.EDGE_END,e.marginRight||0),"marginTop"in e&&t.setMargin(bn.default.EDGE_TOP,e.marginTop||0),"marginBottom"in e&&t.setMargin(bn.default.EDGE_BOTTOM,e.marginBottom||0)},uxt=(t,e)=>{"paddingLeft"in e&&t.setPadding(bn.default.EDGE_LEFT,e.paddingLeft||0),"paddingRight"in e&&t.setPadding(bn.default.EDGE_RIGHT,e.paddingRight||0),"paddingTop"in e&&t.setPadding(bn.default.EDGE_TOP,e.paddingTop||0),"paddingBottom"in e&&t.setPadding(bn.default.EDGE_BOTTOM,e.paddingBottom||0)},fxt=(t,e)=>{var r;"flexGrow"in e&&t.setFlexGrow((r=e.flexGrow)!==null&&r!==void 0?r:0),"flexShrink"in e&&t.setFlexShrink(typeof e.flexShrink=="number"?e.flexShrink:1),"flexDirection"in e&&(e.flexDirection==="row"&&t.setFlexDirection(bn.default.FLEX_DIRECTION_ROW),e.flexDirection==="row-reverse"&&t.setFlexDirection(bn.default.FLEX_DIRECTION_ROW_REVERSE),e.flexDirection==="column"&&t.setFlexDirection(bn.default.FLEX_DIRECTION_COLUMN),e.flexDirection==="column-reverse"&&t.setFlexDirection(bn.default.FLEX_DIRECTION_COLUMN_REVERSE)),"flexBasis"in e&&(typeof e.flexBasis=="number"?t.setFlexBasis(e.flexBasis):typeof e.flexBasis=="string"?t.setFlexBasisPercent(Number.parseInt(e.flexBasis,10)):t.setFlexBasis(NaN)),"alignItems"in e&&((e.alignItems==="stretch"||!e.alignItems)&&t.setAlignItems(bn.default.ALIGN_STRETCH),e.alignItems==="flex-start"&&t.setAlignItems(bn.default.ALIGN_FLEX_START),e.alignItems==="center"&&t.setAlignItems(bn.default.ALIGN_CENTER),e.alignItems==="flex-end"&&t.setAlignItems(bn.default.ALIGN_FLEX_END)),"alignSelf"in e&&((e.alignSelf==="auto"||!e.alignSelf)&&t.setAlignSelf(bn.default.ALIGN_AUTO),e.alignSelf==="flex-start"&&t.setAlignSelf(bn.default.ALIGN_FLEX_START),e.alignSelf==="center"&&t.setAlignSelf(bn.default.ALIGN_CENTER),e.alignSelf==="flex-end"&&t.setAlignSelf(bn.default.ALIGN_FLEX_END)),"justifyContent"in e&&((e.justifyContent==="flex-start"||!e.justifyContent)&&t.setJustifyContent(bn.default.JUSTIFY_FLEX_START),e.justifyContent==="center"&&t.setJustifyContent(bn.default.JUSTIFY_CENTER),e.justifyContent==="flex-end"&&t.setJustifyContent(bn.default.JUSTIFY_FLEX_END),e.justifyContent==="space-between"&&t.setJustifyContent(bn.default.JUSTIFY_SPACE_BETWEEN),e.justifyContent==="space-around"&&t.setJustifyContent(bn.default.JUSTIFY_SPACE_AROUND))},Axt=(t,e)=>{var r,s;"width"in e&&(typeof e.width=="number"?t.setWidth(e.width):typeof e.width=="string"?t.setWidthPercent(Number.parseInt(e.width,10)):t.setWidthAuto()),"height"in e&&(typeof e.height=="number"?t.setHeight(e.height):typeof e.height=="string"?t.setHeightPercent(Number.parseInt(e.height,10)):t.setHeightAuto()),"minWidth"in e&&(typeof e.minWidth=="string"?t.setMinWidthPercent(Number.parseInt(e.minWidth,10)):t.setMinWidth((r=e.minWidth)!==null&&r!==void 0?r:0)),"minHeight"in e&&(typeof e.minHeight=="string"?t.setMinHeightPercent(Number.parseInt(e.minHeight,10)):t.setMinHeight((s=e.minHeight)!==null&&s!==void 0?s:0))},pxt=(t,e)=>{"display"in e&&t.setDisplay(e.display==="flex"?bn.default.DISPLAY_FLEX:bn.default.DISPLAY_NONE)},hxt=(t,e)=>{if("borderStyle"in e){let r=typeof e.borderStyle=="string"?1:0;t.setBorder(bn.default.EDGE_TOP,r),t.setBorder(bn.default.EDGE_BOTTOM,r),t.setBorder(bn.default.EDGE_LEFT,r),t.setBorder(bn.default.EDGE_RIGHT,r)}};oD.default=(t,e={})=>{lxt(t,e),cxt(t,e),uxt(t,e),fxt(t,e),Axt(t,e),pxt(t,e),hxt(t,e)}});var ibe=L((t0r,nbe)=>{"use strict";var aD=iD(),gxt=bk(),dxt=IB(),LW=new Set(["\x1B","\x9B"]),mxt=39,rbe=t=>`${LW.values().next().value}[${t}m`,yxt=t=>t.split(" ").map(e=>aD(e)),OW=(t,e,r)=>{let s=[...e],a=!1,n=aD(gxt(t[t.length-1]));for(let[c,f]of s.entries()){let p=aD(f)
2025-04-10 09:51:25 -04:00
`);for(let[p,h]of[...s].entries()){if(a+=h,LW.has(h)){let C=parseFloat(/\d[^m]*/.exec(s.slice(p,p+4)));n=C===mxt?null:C}let E=dxt.codes.get(Number(n));n&&E&&(s[p+1]===`
`?a+=rbe(E):h===`
`&&(a+=rbe(n)))}return a};nbe.exports=(t,e,r)=>String(t).normalize().replace(/\r\n/g,`
`).split(`
`).map(s=>Ixt(s,e,r)).join(`
2025-04-11 10:05:45 -04:00
`)});var abe=L((r0r,obe)=>{"use strict";var sbe="[\uD800-\uDBFF][\uDC00-\uDFFF]",Cxt=t=>t&&t.exact?new RegExp(`^${sbe}$`):new RegExp(sbe,"g");obe.exports=Cxt});var MW=L((n0r,fbe)=>{"use strict";var wxt=QW(),Bxt=abe(),lbe=IB(),ube=["\x1B","\x9B"],MF=t=>`${ube[0]}[${t}m`,cbe=(t,e,r)=>{let s=[];t=[...t];for(let a of t){let n=a;a.match(";")&&(a=a.split(";")[0][0]+"0");let c=lbe.codes.get(parseInt(a,10));if(c){let f=t.indexOf(c.toString());f>=0?t.splice(f,1):s.push(MF(e?c:n))}else if(e){s.push(MF(0));break}else s.push(MF(n))}if(e&&(s=s.filter((a,n)=>s.indexOf(a)===n),r!==void 0)){let a=MF(lbe.codes.get(parseInt(r,10)));s=s.reduce((n,c)=>c===a?[c,...n]:[...n,c],[])}return s.join("")};fbe.exports=(t,e,r)=>{let s=[...t.normalize()],a=[];r=typeof r=="number"?r:s.length;let n=!1,c,f=0,p="";for(let[h,E]of s.entries()){let C=!1;if(ube.includes(E)){let S=/\d[^m]*/.exec(t.slice(h,h+18));c=S&&S.length>0?S[0]:void 0,f<r&&(n=!0,c!==void 0&&a.push(c))}else n&&E==="m"&&(n=!1,C=!0);if(!n&&!C&&++f,!Bxt({exact:!0}).test(E)&&wxt(E.codePointAt())&&++f,f>e&&f<=r)p+=E;else if(f===e&&!n&&c!==void 0)p=cbe(a);else if(f>=r){p+=cbe(a,!0,c);break}}return p}});var pbe=L((i0r,Abe)=>{"use strict";var eg=MW(),vxt=iD();function _F(t,e,r){if(t.charAt(e)===" ")return e;for(let s=1;s<=3;s++)if(r){if(t.charAt(e+s)===" ")return e+s}else if(t.charAt(e-s)===" ")return e-s;return e}Abe.exports=(t,e,r)=>{r={position:"end",preferTruncationOnSpace:!1,...r};let{position:s,space:a,preferTruncationOnSpace:n}=r,c="\u2026",f=1;if(typeof t!="string")throw new TypeError(`Expected \`input\` to be a string, got ${typeof t}`);if(typeof e!="number")throw new TypeError(`Expected \`columns\` to be a number, got ${typeof e}`);if(e<1)return"";if(e===1)return c;let p=vxt(t);if(p<=e)return t;if(s==="start"){if(n){let h=_F(t,p-e+1,!0);return c+eg(t,h,p).trim()}return a===!0&&(c+=" ",f=2),c+eg(t,p-e+f,p)}if(s==="middle"){a===!0&&(c=" "+c+" ",f=3);let h=Math.floor(e/2);if(n){let E=_F(t,h),C=_F(t,p-(e-h)+1,!0);return eg(t,0,E)+c+eg(t,C,p).trim()}return eg(t,0,h)+c+eg(t,p-(e-h)+f,p)}if(s==="end"){if(n){let h=_F(t,e-1);return eg(t,0,h)+c}return a===!0&&(c=" "+c,f=2),eg(t,0,e-f)+c}throw new Error(`Expected \`options.position\` to be either \`start\`, \`middle\` or \`end\`, got ${s}`)}});var UW=L(lD=>{"use strict";var hbe=lD&&lD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(lD,"__esModule",{value:!0});var Sxt=hbe(ibe()),Dxt=hbe(pbe()),_W={};lD.default=(t,e,r)=>{let s=t+String(e)+String(r);if(_W[s])return _W[s];let a=t;if(r==="wrap"&&(a=Sxt.default(t,e,{trim:!1,hard:!0})),r.startsWith("truncate")){let n="end";r==="truncate-middle"&&(n="middle"),r==="truncate-start"&&(n="start"),a=Dxt.default(t,e,{position:n})}return _W[s]=a,a}});var jW=L(HW=>{"use strict";Object.defineProperty(HW,"__esModule",{value:!0});var gbe=t=>{let e="";if(t.childNodes.length>0)for(let r of t.childNodes){let s="";r.nodeName==="#text"?s=r.nodeValue:((r.nodeName==="ink-text"||r.nodeName==="ink-virtual-text")&&(s=gbe(r)),s.length>0&&typeof r.internal_transform=="function"&&(s=r.internal_transform(s))),e+=s}return e};HW.default=gbe});var qW=L(Pi=>{"use strict";var cD=Pi&&Pi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Pi,"__esModule",{value:!0});Pi.setTextNodeValue=Pi.createTextNode=Pi.setStyle=Pi.setAttribute=Pi.removeChildNode=Pi.insertBeforeNode=Pi.appendChildNode=Pi.createNode=Pi.TEXT_NAME=void 0;var bxt=cD(Nm()),dbe=cD(ebe()),Pxt=cD(tbe()),xxt=cD(UW()),kxt=cD(jW());Pi.TEXT_NAME="#text";Pi.createNode=t=>{var e;let r={nodeName:t,style:{},attributes:{},childNodes:[],parentNode:null,yogaNode:t==="ink-virtual-text"?void 0:bxt.default.Node.create()};return t==="ink-text"&&((e=r.yogaNode)===null||e===void 0||e.setMeasureFunc(Qxt.bind(null,r))),r};Pi.appendChildNode=(t,e)=>{var r;e.parentNode&&Pi.removeChildNode(e.parentNode,e),e.parentNode=t,t.childNodes.push(e),e.yogaNode&&((r=t.yogaNode)===null||r===void 0||r.insertChild(e.yogaNode,t.yogaNode.getChildCount())),(t.nodeName==="ink-text"||t.nodeName==="ink-virtual-text")&&UF(t)};Pi.insertBefo
2025-04-10 09:51:25 -04:00
`:`
`)+r,a=s+1,s=t.indexOf(`
2025-04-11 10:05:45 -04:00
`,a)}while(s!==-1);return n+=t.substr(a),n};xbe.exports={stringReplaceAll:Nxt,stringEncaseCRLFWithFirstIndex:Oxt}});var Nbe=L((h0r,Fbe)=>{"use strict";var Lxt=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,Qbe=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,Mxt=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,_xt=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,Uxt=new Map([["n",`
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function Rbe(t){let e=t[0]==="u",r=t[1]==="{";return e&&!r&&t.length===5||t[0]==="x"&&t.length===3?String.fromCharCode(parseInt(t.slice(1),16)):e&&r?String.fromCodePoint(parseInt(t.slice(2,-1),16)):Uxt.get(t)||t}function Hxt(t,e){let r=[],s=e.trim().split(/\s*,\s*/g),a;for(let n of s){let c=Number(n);if(!Number.isNaN(c))r.push(c);else if(a=n.match(Mxt))r.push(a[2].replace(_xt,(f,p,h)=>p?Rbe(p):h));else throw new Error(`Invalid Chalk template style argument: ${n} (in style '${t}')`)}return r}function jxt(t){Qbe.lastIndex=0;let e=[],r;for(;(r=Qbe.exec(t))!==null;){let s=r[1];if(r[2]){let a=Hxt(s,r[2]);e.push([s].concat(a))}else e.push([s])}return e}function Tbe(t,e){let r={};for(let a of e)for(let n of a.styles)r[n[0]]=a.inverse?null:n.slice(1);let s=t;for(let[a,n]of Object.entries(r))if(Array.isArray(n)){if(!(a in s))throw new Error(`Unknown Chalk style: ${a}`);s=n.length>0?s[a](...n):s[a]}return s}Fbe.exports=(t,e)=>{let r=[],s=[],a=[];if(e.replace(Lxt,(n,c,f,p,h,E)=>{if(c)a.push(Rbe(c));else if(p){let C=a.join("");a=[],s.push(r.length===0?C:Tbe(t,r)(C)),r.push({inverse:f,styles:jxt(p)})}else if(h){if(r.length===0)throw new Error("Found extraneous } in Chalk template literal");s.push(Tbe(t,r)(a.join(""))),a=[],r.pop()}else a.push(E)}),s.push(a.join("")),r.length>0){let n=`Chalk template literal is missing ${r.length} closing bracket${r.length===1?"":"s"} (\`}\`)`;throw new Error(n)}return s.join("")}});var YF=L((g0r,Hbe)=>{"use strict";var AD=IB(),{stdout:YW,stderr:VW}=c4(),{stringReplaceAll:qxt,stringEncaseCRLFWithFirstIndex:Gxt}=kbe(),{isArray:jF}=Array,Lbe=["ansi","ansi","ansi256","ansi16m"],Iw=Object.create(null),Wxt=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=YW?YW.level:0;t.level=e.level===void 0?r:e.level},KW=class{constructor(e){return Mbe(e)}},Mbe=t=>{let e={};return Wxt(e,t),e.template=(...r)=>Ube(e.template,...r),Object.setPrototypeOf(e,qF.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},e.template.Instance=KW,e.template};function qF(t){return Mbe(t)}for(let[t,e]of Object.entries(AD))Iw[t]={get(){let r=GF(this,JW(e.open,e.close,this._styler),this._isEmpty);return Object.defineProperty(this,t,{value:r}),r}};Iw.visible={get(){let t=GF(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:t}),t}};var _be=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let t of _be)Iw[t]={get(){let{level:e}=this;return function(...r){let s=JW(AD.color[Lbe[e]][t](...r),AD.color.close,this._styler);return GF(this,s,this._isEmpty)}}};for(let t of _be){let e="bg"+t[0].toUpperCase()+t.slice(1);Iw[e]={get(){let{level:r}=this;return function(...s){let a=JW(AD.bgColor[Lbe[r]][t](...s),AD.bgColor.close,this._styler);return GF(this,a,this._isEmpty)}}}}var Yxt=Object.defineProperties(()=>{},{...Iw,level:{enumerable:!0,get(){return this._generator.level},set(t){this._generator.level=t}}}),JW=(t,e,r)=>{let s,a;return r===void 0?(s=t,a=e):(s=r.openAll+t,a=e+r.closeAll),{open:t,close:e,openAll:s,closeAll:a,parent:r}},GF=(t,e,r)=>{let s=(...a)=>jF(a[0])&&jF(a[0].raw)?Obe(s,Ube(s,...a)):Obe(s,a.length===1?""+a[0]:a.join(" "));return Object.setPrototypeOf(s,Yxt),s._generator=t,s._styler=e,s._isEmpty=r,s},Obe=(t,e)=>{if(t.level<=0||!e)return t._isEmpty?"":e;let r=t._styler;if(r===void 0)return e;let{openAll:s,closeAll:a}=r;if(e.indexOf("\x1B")!==-1)for(;r!==void 0;)e=qxt(e,r.close,r.open),r=r.parent;let n=e.indexOf(`
`);return n!==-1&&(e=Gxt(e,a,s,n)),s+e+a},WW,Ube=(t,...e)=>{let[r]=e;if(!jF(r)||!jF(r.raw))return e.join(" ");let s=e.slice(1),a=[r.raw[0]];for(let n=1;n<r.length;n++)a.push(String(s[n-1]).replace(/[{}\\]/g,"\\$&"),String(r.raw[n]));return WW===void 0&&(WW=Nbe()),WW(t,a.join(""))};Object.defineProperties(qF.prototype,Iw);var WF=qF();WF.supportsColor=YW;WF.stderr=qF({level:VW?VW.level:0});WF.stderr.supportsColor=VW;Hbe.exports=WF});var zW=L(hD=>{"use strict";var Vxt=hD&&hD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(hD,"__esModule",{value:!0});var pD=Vxt(YF()),Kxt=/^(rgb|hsl|hsv|hwb)\(\s?(\d+),\s?(\d+),\s?(\d+)\s?\)$/,Jxt=/^(ansi|ansi256)\(\s?(\d+)\s?\)$/,VF=(t,e)=>e==="foreground"?t:"bg"+t[0].toUpperCase()+t.slice(1);hD.default=(t,e,r)=>{if(!e)return t;if(e in pD.default){let a=VF(e,r);return pD.default[a](t)}if(e.startsWith("#")){let a=VF("hex",r);return pD.default[a](e)(t)}if(e.startsWith("ansi")){let a=Jxt.exec(e);if(!a)return t;let n=VF(a[1],r),c=Number(a[2]);return pD.default[n](c)(t)}if(e.startsWith("rgb")||e.startsWith("hsl")||e.startsWith("hsv")||e.startsWith("hwb")){let a=Kxt.exec(e);if(!a)return t;let n=VF(a[1],r),c=Number(a[2]),f=Number(a[3]),p=Number(a[4]);return pD.default[n](c,f,p)(t)}return t}});var qbe=L(gD=>{"use strict";var jbe=gD&&gD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(gD,"__esModule",{value:!0});var zxt=jbe(Pbe()),ZW=jbe(zW());gD.default=(t,e,r,s)=>{if(typeof r.style.borderStyle=="string"){let a=r.yogaNode.getComputedWidth(),n=r.yogaNode.getComputedHeight(),c=r.style.borderColor,f=zxt.default[r.style.borderStyle],p=ZW.default(f.topLeft+f.horizontal.repeat(a-2)+f.topRight,c,"foreground"),h=(ZW.default(f.vertical,c,"foreground")+`
2025-04-10 09:51:25 -04:00
`).repeat(n-2),E=ZW.default(f.bottomLeft+f.horizontal.repeat(a-2)+f.bottomRight,c,"foreground");s.write(t,e,p,{transformers:[]}),s.write(t,e+1,h,{transformers:[]}),s.write(t+a-1,e+1,h,{transformers:[]}),s.write(t,e+n-1,E,{transformers:[]})}}});var Wbe=L(dD=>{"use strict";var Om=dD&&dD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(dD,"__esModule",{value:!0});var Zxt=Om(Nm()),Xxt=Om(FW()),$xt=Om(vbe()),ekt=Om(UW()),tkt=Om(Sbe()),rkt=Om(jW()),nkt=Om(qbe()),ikt=(t,e)=>{var r;let s=(r=t.childNodes[0])===null||r===void 0?void 0:r.yogaNode;if(s){let a=s.getComputedLeft(),n=s.getComputedTop();e=`
2025-04-11 10:05:45 -04:00
`.repeat(n)+$xt.default(e,a)}return e},Gbe=(t,e,r)=>{var s;let{offsetX:a=0,offsetY:n=0,transformers:c=[],skipStaticElements:f}=r;if(f&&t.internal_static)return;let{yogaNode:p}=t;if(p){if(p.getDisplay()===Zxt.default.DISPLAY_NONE)return;let h=a+p.getComputedLeft(),E=n+p.getComputedTop(),C=c;if(typeof t.internal_transform=="function"&&(C=[t.internal_transform,...c]),t.nodeName==="ink-text"){let S=rkt.default(t);if(S.length>0){let P=Xxt.default(S),I=tkt.default(p);if(P>I){let R=(s=t.style.textWrap)!==null&&s!==void 0?s:"wrap";S=ekt.default(S,I,R)}S=ikt(t,S),e.write(h,E,S,{transformers:C})}return}if(t.nodeName==="ink-box"&&nkt.default(h,E,t,e),t.nodeName==="ink-root"||t.nodeName==="ink-box")for(let S of t.childNodes)Gbe(S,e,{offsetX:h,offsetY:E,transformers:C,skipStaticElements:f})}};dD.default=Gbe});var Kbe=L(mD=>{"use strict";var Vbe=mD&&mD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(mD,"__esModule",{value:!0});var Ybe=Vbe(MW()),skt=Vbe(iD()),XW=class{constructor(e){this.writes=[];let{width:r,height:s}=e;this.width=r,this.height=s}write(e,r,s,a){let{transformers:n}=a;s&&this.writes.push({x:e,y:r,text:s,transformers:n})}get(){let e=[];for(let s=0;s<this.height;s++)e.push(" ".repeat(this.width));for(let s of this.writes){let{x:a,y:n,text:c,transformers:f}=s,p=c.split(`
2025-04-10 09:51:25 -04:00
`),h=0;for(let E of p){let C=e[n+h];if(!C)continue;let S=skt.default(E);for(let P of f)E=P(E);e[n+h]=Ybe.default(C,0,a)+E+Ybe.default(C,a+S),h++}}return{output:e.map(s=>s.trimRight()).join(`
2025-04-11 10:05:45 -04:00
`),height:e.length}}};mD.default=XW});var Zbe=L(yD=>{"use strict";var $W=yD&&yD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(yD,"__esModule",{value:!0});var okt=$W(Nm()),Jbe=$W(Wbe()),zbe=$W(Kbe());yD.default=(t,e)=>{var r;if(t.yogaNode.setWidth(e),t.yogaNode){t.yogaNode.calculateLayout(void 0,void 0,okt.default.DIRECTION_LTR);let s=new zbe.default({width:t.yogaNode.getComputedWidth(),height:t.yogaNode.getComputedHeight()});Jbe.default(t,s,{skipStaticElements:!0});let a;!((r=t.staticNode)===null||r===void 0)&&r.yogaNode&&(a=new zbe.default({width:t.staticNode.yogaNode.getComputedWidth(),height:t.staticNode.yogaNode.getComputedHeight()}),Jbe.default(t.staticNode,a,{skipStaticElements:!1}));let{output:n,height:c}=s.get();return{output:n,outputHeight:c,staticOutput:a?`${a.get().output}
`:""}}return{output:"",outputHeight:0,staticOutput:""}}});var tPe=L((C0r,ePe)=>{"use strict";var Xbe=ye("stream"),$be=["assert","count","countReset","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","table","time","timeEnd","timeLog","trace","warn"],eY={},akt=t=>{let e=new Xbe.PassThrough,r=new Xbe.PassThrough;e.write=a=>t("stdout",a),r.write=a=>t("stderr",a);let s=new console.Console(e,r);for(let a of $be)eY[a]=console[a],console[a]=s[a];return()=>{for(let a of $be)console[a]=eY[a];eY={}}};ePe.exports=akt});var rY=L(tY=>{"use strict";Object.defineProperty(tY,"__esModule",{value:!0});tY.default=new WeakMap});var iY=L(nY=>{"use strict";Object.defineProperty(nY,"__esModule",{value:!0});var lkt=hn(),rPe=lkt.createContext({exit:()=>{}});rPe.displayName="InternalAppContext";nY.default=rPe});var oY=L(sY=>{"use strict";Object.defineProperty(sY,"__esModule",{value:!0});var ckt=hn(),nPe=ckt.createContext({stdin:void 0,setRawMode:()=>{},isRawModeSupported:!1,internal_exitOnCtrlC:!0});nPe.displayName="InternalStdinContext";sY.default=nPe});var lY=L(aY=>{"use strict";Object.defineProperty(aY,"__esModule",{value:!0});var ukt=hn(),iPe=ukt.createContext({stdout:void 0,write:()=>{}});iPe.displayName="InternalStdoutContext";aY.default=iPe});var uY=L(cY=>{"use strict";Object.defineProperty(cY,"__esModule",{value:!0});var fkt=hn(),sPe=fkt.createContext({stderr:void 0,write:()=>{}});sPe.displayName="InternalStderrContext";cY.default=sPe});var KF=L(fY=>{"use strict";Object.defineProperty(fY,"__esModule",{value:!0});var Akt=hn(),oPe=Akt.createContext({activeId:void 0,add:()=>{},remove:()=>{},activate:()=>{},deactivate:()=>{},enableFocus:()=>{},disableFocus:()=>{},focusNext:()=>{},focusPrevious:()=>{},focus:()=>{}});oPe.displayName="InternalFocusContext";fY.default=oPe});var lPe=L((P0r,aPe)=>{"use strict";var pkt=/[|\\{}()[\]^$+*?.-]/g;aPe.exports=t=>{if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(pkt,"\\$&")}});var APe=L((x0r,fPe)=>{"use strict";var hkt=lPe(),gkt=typeof process=="object"&&process&&typeof process.cwd=="function"?process.cwd():".",uPe=[].concat(ye("module").builtinModules,"bootstrap_node","node").map(t=>new RegExp(`(?:\\((?:node:)?${t}(?:\\.js)?:\\d+:\\d+\\)$|^\\s*at (?:node:)?${t}(?:\\.js)?:\\d+:\\d+$)`));uPe.push(/\((?:node:)?internal\/[^:]+:\d+:\d+\)$/,/\s*at (?:node:)?internal\/[^:]+:\d+:\d+$/,/\/\.node-spawn-wrap-\w+-\w+\/node:\d+:\d+\)?$/);var AY=class t{constructor(e){e={ignoredPackages:[],...e},"internals"in e||(e.internals=t.nodeInternals()),"cwd"in e||(e.cwd=gkt),this._cwd=e.cwd.replace(/\\/g,"/"),this._internals=[].concat(e.internals,dkt(e.ignoredPackages)),this._wrapCallSite=e.wrapCallSite||!1}static nodeInternals(){return[...uPe]}clean(e,r=0){r=" ".repeat(r),Array.isArray(e)||(e=e.split(`
2025-04-10 09:51:25 -04:00
`)),!/^\s*at /.test(e[0])&&/^\s*at /.test(e[1])&&(e=e.slice(1));let s=!1,a=null,n=[];return e.forEach(c=>{if(c=c.replace(/\\/g,"/"),this._internals.some(p=>p.test(c)))return;let f=/^\s*at /.test(c);s?c=c.trimEnd().replace(/^(\s+)at /,"$1"):(c=c.trim(),f&&(c=c.slice(3))),c=c.replace(`${this._cwd}/`,""),c&&(f?(a&&(n.push(a),a=null),n.push(c)):(s=!0,a=c))}),n.map(c=>`${r}${c}
2025-04-11 10:05:45 -04:00
`).join("")}captureString(e,r=this.captureString){typeof e=="function"&&(r=e,e=1/0);let{stackTraceLimit:s}=Error;e&&(Error.stackTraceLimit=e);let a={};Error.captureStackTrace(a,r);let{stack:n}=a;return Error.stackTraceLimit=s,this.clean(n)}capture(e,r=this.capture){typeof e=="function"&&(r=e,e=1/0);let{prepareStackTrace:s,stackTraceLimit:a}=Error;Error.prepareStackTrace=(f,p)=>this._wrapCallSite?p.map(this._wrapCallSite):p,e&&(Error.stackTraceLimit=e);let n={};Error.captureStackTrace(n,r);let{stack:c}=n;return Object.assign(Error,{prepareStackTrace:s,stackTraceLimit:a}),c}at(e=this.at){let[r]=this.capture(1,e);if(!r)return{};let s={line:r.getLineNumber(),column:r.getColumnNumber()};cPe(s,r.getFileName(),this._cwd),r.isConstructor()&&(s.constructor=!0),r.isEval()&&(s.evalOrigin=r.getEvalOrigin()),r.isNative()&&(s.native=!0);let a;try{a=r.getTypeName()}catch{}a&&a!=="Object"&&a!=="[object Object]"&&(s.type=a);let n=r.getFunctionName();n&&(s.function=n);let c=r.getMethodName();return c&&n!==c&&(s.method=c),s}parseLine(e){let r=e&&e.match(mkt);if(!r)return null;let s=r[1]==="new",a=r[2],n=r[3],c=r[4],f=Number(r[5]),p=Number(r[6]),h=r[7],E=r[8],C=r[9],S=r[10]==="native",P=r[11]===")",I,R={};if(E&&(R.line=Number(E)),C&&(R.column=Number(C)),P&&h){let N=0;for(let U=h.length-1;U>0;U--)if(h.charAt(U)===")")N++;else if(h.charAt(U)==="("&&h.charAt(U-1)===" "&&(N--,N===-1&&h.charAt(U-1)===" ")){let W=h.slice(0,U-1);h=h.slice(U+1),a+=` (${W}`;break}}if(a){let N=a.match(ykt);N&&(a=N[1],I=N[2])}return cPe(R,h,this._cwd),s&&(R.constructor=!0),n&&(R.evalOrigin=n,R.evalLine=f,R.evalColumn=p,R.evalFile=c&&c.replace(/\\/g,"/")),S&&(R.native=!0),a&&(R.function=a),I&&a!==I&&(R.method=I),R}};function cPe(t,e,r){e&&(e=e.replace(/\\/g,"/"),e.startsWith(`${r}/`)&&(e=e.slice(r.length+1)),t.file=e)}function dkt(t){if(t.length===0)return[];let e=t.map(r=>hkt(r));return new RegExp(`[/\\\\]node_modules[/\\\\](?:${e.join("|")})[/\\\\][^:]+:\\d+:\\d+`)}var mkt=new RegExp("^(?:\\s*at )?(?:(new) )?(?:(.*?) \\()?(?:eval at ([^ ]+) \\((.+?):(\\d+):(\\d+)\\), )?(?:(.+?):(\\d+):(\\d+)|(native))(\\)?)$"),ykt=/^(.*?) \[as (.*?)\]$/;fPe.exports=AY});var hPe=L((k0r,pPe)=>{"use strict";pPe.exports=(t,e)=>t.replace(/^\t+/gm,r=>" ".repeat(r.length*(e||2)))});var dPe=L((Q0r,gPe)=>{"use strict";var Ekt=hPe(),Ikt=(t,e)=>{let r=[],s=t-e,a=t+e;for(let n=s;n<=a;n++)r.push(n);return r};gPe.exports=(t,e,r)=>{if(typeof t!="string")throw new TypeError("Source code is missing.");if(!e||e<1)throw new TypeError("Line number must start from `1`.");if(t=Ekt(t).split(/\r?\n/),!(e>t.length))return r={around:3,...r},Ikt(e,r.around).filter(s=>t[s-1]!==void 0).map(s=>({line:s,value:t[s-1]}))}});var JF=L(nf=>{"use strict";var Ckt=nf&&nf.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r),Object.defineProperty(t,s,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),wkt=nf&&nf.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Bkt=nf&&nf.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.hasOwnProperty.call(t,r)&&Ckt(e,t,r);return wkt(e,t),e},vkt=nf&&nf.__rest||function(t,e){var r={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(r[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,s=Object.getOwnPropertySymbols(t);a<s.length;a++)e.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(t,s[a])&&(r[s[a]]=t[s[a]]);return r};Object.defineProperty(nf,"__esModule",{value:!0});var mPe=Bkt(hn()),pY=mPe.forwardRef((t,e)=>{var{children:r}=t,s=vkt(t,["children"]);let a=Object.assign(Object.assign({},s),{marginLeft:s.marginLeft||s.marginX||s.margin||0,marginRight:s.marginRight||s.marginX||s.margin||0,marginTop:s.marginTop||s.marginY||s.margin||0,marginBottom:s.marginBottom||s.marginY||s.margin||0,paddingLeft:s.paddingLeft||s.paddingX||s.padding||0,paddingRight:s.paddingRight||s.paddingX||s.padding||0,paddingTop:s.paddingTop||s.paddingY||
2025-04-10 09:51:25 -04:00
`).slice(1):void 0,r=e?CPe.parseLine(e[0]):void 0,s,a=0;if(r?.file&&r?.line&&EPe.existsSync(r.file)){let n=EPe.readFileSync(r.file,"utf8");if(s=xkt.default(n,r.line),s)for(let{line:c}of s)a=Math.max(a,String(c).length)}return Ts.default.createElement(rh.default,{flexDirection:"column",padding:1},Ts.default.createElement(rh.default,null,Ts.default.createElement(hA.default,{backgroundColor:"red",color:"white"}," ","ERROR"," "),Ts.default.createElement(hA.default,null," ",t.message)),r&&Ts.default.createElement(rh.default,{marginTop:1},Ts.default.createElement(hA.default,{dimColor:!0},r.file,":",r.line,":",r.column)),r&&s&&Ts.default.createElement(rh.default,{marginTop:1,flexDirection:"column"},s.map(({line:n,value:c})=>Ts.default.createElement(rh.default,{key:n},Ts.default.createElement(rh.default,{width:a+1},Ts.default.createElement(hA.default,{dimColor:n!==r.line,backgroundColor:n===r.line?"red":void 0,color:n===r.line?"white":void 0},String(n).padStart(a," "),":")),Ts.default.createElement(hA.default,{key:n,backgroundColor:n===r.line?"red":void 0,color:n===r.line?"white":void 0}," "+c)))),t.stack&&Ts.default.createElement(rh.default,{marginTop:1,flexDirection:"column"},t.stack.split(`
2025-04-11 10:05:45 -04:00
`).slice(1).map(n=>{let c=CPe.parseLine(n);return c?Ts.default.createElement(rh.default,{key:n},Ts.default.createElement(hA.default,{dimColor:!0},"- "),Ts.default.createElement(hA.default,{dimColor:!0,bold:!0},c.function),Ts.default.createElement(hA.default,{dimColor:!0,color:"gray"}," ","(",c.file,":",c.line,":",c.column,")")):Ts.default.createElement(rh.default,{key:n},Ts.default.createElement(hA.default,{dimColor:!0},"- "),Ts.default.createElement(hA.default,{dimColor:!0,bold:!0},n))})))};sf.default=kkt});var vPe=L(of=>{"use strict";var Qkt=of&&of.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r),Object.defineProperty(t,s,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),Tkt=of&&of.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Rkt=of&&of.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.hasOwnProperty.call(t,r)&&Qkt(e,t,r);return Tkt(e,t),e},Mm=of&&of.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(of,"__esModule",{value:!0});var Lm=Rkt(hn()),BPe=Mm(pW()),Fkt=Mm(iY()),Nkt=Mm(oY()),Okt=Mm(lY()),Lkt=Mm(uY()),Mkt=Mm(KF()),_kt=Mm(wPe()),Ukt=" ",Hkt="\x1B[Z",jkt="\x1B",zF=class extends Lm.PureComponent{constructor(){super(...arguments),this.state={isFocusEnabled:!0,activeFocusId:void 0,focusables:[],error:void 0},this.rawModeEnabledCount=0,this.handleSetRawMode=e=>{let{stdin:r}=this.props;if(!this.isRawModeSupported())throw r===process.stdin?new Error(`Raw mode is not supported on the current process.stdin, which Ink uses as input stream by default.
2025-04-10 09:51:25 -04:00
Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported`):new Error(`Raw mode is not supported on the stdin provided to Ink.
2025-04-11 10:05:45 -04:00
Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported`);if(r.setEncoding("utf8"),e){this.rawModeEnabledCount===0&&(r.addListener("data",this.handleInput),r.resume(),r.setRawMode(!0)),this.rawModeEnabledCount++;return}--this.rawModeEnabledCount===0&&(r.setRawMode(!1),r.removeListener("data",this.handleInput),r.pause())},this.handleInput=e=>{e===""&&this.props.exitOnCtrlC&&this.handleExit(),e===jkt&&this.state.activeFocusId&&this.setState({activeFocusId:void 0}),this.state.isFocusEnabled&&this.state.focusables.length>0&&(e===Ukt&&this.focusNext(),e===Hkt&&this.focusPrevious())},this.handleExit=e=>{this.isRawModeSupported()&&this.handleSetRawMode(!1),this.props.onExit(e)},this.enableFocus=()=>{this.setState({isFocusEnabled:!0})},this.disableFocus=()=>{this.setState({isFocusEnabled:!1})},this.focus=e=>{this.setState(r=>r.focusables.some(a=>a?.id===e)?{activeFocusId:e}:r)},this.focusNext=()=>{this.setState(e=>{var r;let s=(r=e.focusables[0])===null||r===void 0?void 0:r.id;return{activeFocusId:this.findNextFocusable(e)||s}})},this.focusPrevious=()=>{this.setState(e=>{var r;let s=(r=e.focusables[e.focusables.length-1])===null||r===void 0?void 0:r.id;return{activeFocusId:this.findPreviousFocusable(e)||s}})},this.addFocusable=(e,{autoFocus:r})=>{this.setState(s=>{let a=s.activeFocusId;return!a&&r&&(a=e),{activeFocusId:a,focusables:[...s.focusables,{id:e,isActive:!0}]}})},this.removeFocusable=e=>{this.setState(r=>({activeFocusId:r.activeFocusId===e?void 0:r.activeFocusId,focusables:r.focusables.filter(s=>s.id!==e)}))},this.activateFocusable=e=>{this.setState(r=>({focusables:r.focusables.map(s=>s.id!==e?s:{id:e,isActive:!0})}))},this.deactivateFocusable=e=>{this.setState(r=>({activeFocusId:r.activeFocusId===e?void 0:r.activeFocusId,focusables:r.focusables.map(s=>s.id!==e?s:{id:e,isActive:!1})}))},this.findNextFocusable=e=>{var r;let s=e.focusables.findIndex(a=>a.id===e.activeFocusId);for(let a=s+1;a<e.focusables.length;a++)if(!((r=e.focusables[a])===null||r===void 0)&&r.isActive)return e.focusables[a].id},this.findPreviousFocusable=e=>{var r;let s=e.focusables.findIndex(a=>a.id===e.activeFocusId);for(let a=s-1;a>=0;a--)if(!((r=e.focusables[a])===null||r===void 0)&&r.isActive)return e.focusables[a].id}}static getDerivedStateFromError(e){return{error:e}}isRawModeSupported(){return this.props.stdin.isTTY}render(){return Lm.default.createElement(Fkt.default.Provider,{value:{exit:this.handleExit}},Lm.default.createElement(Nkt.default.Provider,{value:{stdin:this.props.stdin,setRawMode:this.handleSetRawMode,isRawModeSupported:this.isRawModeSupported(),internal_exitOnCtrlC:this.props.exitOnCtrlC}},Lm.default.createElement(Okt.default.Provider,{value:{stdout:this.props.stdout,write:this.props.writeToStdout}},Lm.default.createElement(Lkt.default.Provider,{value:{stderr:this.props.stderr,write:this.props.writeToStderr}},Lm.default.createElement(Mkt.default.Provider,{value:{activeId:this.state.activeFocusId,add:this.addFocusable,remove:this.removeFocusable,activate:this.activateFocusable,deactivate:this.deactivateFocusable,enableFocus:this.enableFocus,disableFocus:this.disableFocus,focusNext:this.focusNext,focusPrevious:this.focusPrevious,focus:this.focus}},this.state.error?Lm.default.createElement(_kt.default,{error:this.state.error}):this.props.children)))))}componentDidMount(){BPe.default.hide(this.props.stdout)}componentWillUnmount(){BPe.default.show(this.props.stdout),this.isRawModeSupported()&&this.handleSetRawMode(!1)}componentDidCatch(e){this.handleExit(e)}};of.default=zF;zF.displayName="InternalApp"});var bPe=L(af=>{"use strict";var qkt=af&&af.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r),Object.defineProperty(t,s,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),Gkt=af&&af.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Wkt=af&&af.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Objec
`;if(this.options.debug){n&&(this.fullStaticOutput+=a),this.options.stdout.write(this.fullStaticOutput+r);return}if(ww){n&&this.options.stdout.write(a),this.lastOutput=r;return}if(n&&(this.fullStaticOutput+=a),s>=this.options.stdout.rows){this.options.stdout.write(Kkt.default.clearTerminal+this.fullStaticOutput+r),this.lastOutput=r;return}n&&(this.log.clear(),this.options.stdout.write(a),this.log(r)),!n&&r!==this.lastOutput&&this.throttledLog(r),this.lastOutput=r},zkt.default(this),this.options=e,this.rootNode=eQt.createNode("ink-root"),this.rootNode.onRender=e.debug?this.onRender:SPe(this.onRender,32,{leading:!0,trailing:!0}),this.rootNode.onImmediateRender=this.onRender,this.log=Vkt.default.create(e.stdout),this.throttledLog=e.debug?this.log:SPe(this.log,void 0,{leading:!0,trailing:!0}),this.isUnmounted=!1,this.lastOutput="",this.fullStaticOutput="",this.container=mY.default.createContainer(this.rootNode,0,!1,null),this.unsubscribeExit=Xkt.default(this.unmount,{alwaysLast:!1}),e.patchConsole&&this.patchConsole(),ww||(e.stdout.on("resize",this.onRender),this.unsubscribeResize=()=>{e.stdout.off("resize",this.onRender)})}render(e){let r=Ykt.default.createElement(rQt.default,{stdin:this.options.stdin,stdout:this.options.stdout,stderr:this.options.stderr,writeToStdout:this.writeToStdout,writeToStderr:this.writeToStderr,exitOnCtrlC:this.options.exitOnCtrlC,onExit:this.unmount},e);mY.default.updateContainer(r,this.container,null,DPe)}writeToStdout(e){if(!this.isUnmounted){if(this.options.debug){this.options.stdout.write(e+this.fullStaticOutput+this.lastOutput);return}if(ww){this.options.stdout.write(e);return}this.log.clear(),this.options.stdout.write(e),this.log(this.lastOutput)}}writeToStderr(e){if(!this.isUnmounted){if(this.options.debug){this.options.stderr.write(e),this.options.stdout.write(this.fullStaticOutput+this.lastOutput);return}if(ww){this.options.stderr.write(e);return}this.log.clear(),this.options.stderr.write(e),this.log(this.lastOutput)}}unmount(e){this.isUnmounted||(this.onRender(),this.unsubscribeExit(),typeof this.restoreConsole=="function"&&this.restoreConsole(),typeof this.unsubscribeResize=="function"&&this.unsubscribeResize(),ww?this.options.stdout.write(this.lastOutput+`
2025-04-10 09:51:25 -04:00
`):this.options.debug||this.log.done(),this.isUnmounted=!0,mY.default.updateContainer(null,this.container,null,DPe),tQt.default.delete(this.options.stdout),e instanceof Error?this.rejectExitPromise(e):this.resolveExitPromise())}waitUntilExit(){return this.exitPromise||(this.exitPromise=new Promise((e,r)=>{this.resolveExitPromise=e,this.rejectExitPromise=r})),this.exitPromise}clear(){!ww&&!this.options.debug&&this.log.clear()}patchConsole(){this.options.debug||(this.restoreConsole=$kt.default((e,r)=>{e==="stdout"&&this.writeToStdout(r),e==="stderr"&&(r.startsWith("The above error occurred")||this.writeToStderr(r))}))}};af.default=yY});var xPe=L(CD=>{"use strict";var PPe=CD&&CD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(CD,"__esModule",{value:!0});var nQt=PPe(bPe()),ZF=PPe(rY()),iQt=ye("stream"),sQt=(t,e)=>{let r=Object.assign({stdout:process.stdout,stdin:process.stdin,stderr:process.stderr,debug:!1,exitOnCtrlC:!0,patchConsole:!0},oQt(e)),s=aQt(r.stdout,()=>new nQt.default(r));return s.render(t),{rerender:s.render,unmount:()=>s.unmount(),waitUntilExit:s.waitUntilExit,cleanup:()=>ZF.default.delete(r.stdout),clear:s.clear}};CD.default=sQt;var oQt=(t={})=>t instanceof iQt.Stream?{stdout:t,stdin:process.stdin}:t,aQt=(t,e)=>{let r;return ZF.default.has(t)?r=ZF.default.get(t):(r=e(),ZF.default.set(t,r)),r}});var QPe=L(nh=>{"use strict";var lQt=nh&&nh.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r),Object.defineProperty(t,s,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),cQt=nh&&nh.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),uQt=nh&&nh.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.hasOwnProperty.call(t,r)&&lQt(e,t,r);return cQt(e,t),e};Object.defineProperty(nh,"__esModule",{value:!0});var wD=uQt(hn()),kPe=t=>{let{items:e,children:r,style:s}=t,[a,n]=wD.useState(0),c=wD.useMemo(()=>e.slice(a),[e,a]);wD.useLayoutEffect(()=>{n(e.length)},[e.length]);let f=c.map((h,E)=>r(h,a+E)),p=wD.useMemo(()=>Object.assign({position:"absolute",flexDirection:"column"},s),[s]);return wD.default.createElement("ink-box",{internal_static:!0,style:p},f)};kPe.displayName="Static";nh.default=kPe});var RPe=L(BD=>{"use strict";var fQt=BD&&BD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(BD,"__esModule",{value:!0});var AQt=fQt(hn()),TPe=({children:t,transform:e})=>t==null?null:AQt.default.createElement("ink-text",{style:{flexGrow:0,flexShrink:1,flexDirection:"row"},internal_transform:e},t);TPe.displayName="Transform";BD.default=TPe});var NPe=L(vD=>{"use strict";var pQt=vD&&vD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(vD,"__esModule",{value:!0});var hQt=pQt(hn()),FPe=({count:t=1})=>hQt.default.createElement("ink-text",null,`
2025-04-11 10:05:45 -04:00
`.repeat(t));FPe.displayName="Newline";vD.default=FPe});var MPe=L(SD=>{"use strict";var OPe=SD&&SD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(SD,"__esModule",{value:!0});var gQt=OPe(hn()),dQt=OPe(JF()),LPe=()=>gQt.default.createElement(dQt.default,{flexGrow:1});LPe.displayName="Spacer";SD.default=LPe});var XF=L(DD=>{"use strict";var mQt=DD&&DD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(DD,"__esModule",{value:!0});var yQt=hn(),EQt=mQt(oY()),IQt=()=>yQt.useContext(EQt.default);DD.default=IQt});var UPe=L(bD=>{"use strict";var CQt=bD&&bD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(bD,"__esModule",{value:!0});var _Pe=hn(),wQt=CQt(XF()),BQt=(t,e={})=>{let{stdin:r,setRawMode:s,internal_exitOnCtrlC:a}=wQt.default();_Pe.useEffect(()=>{if(e.isActive!==!1)return s(!0),()=>{s(!1)}},[e.isActive,s]),_Pe.useEffect(()=>{if(e.isActive===!1)return;let n=c=>{let f=String(c),p={upArrow:f==="\x1B[A",downArrow:f==="\x1B[B",leftArrow:f==="\x1B[D",rightArrow:f==="\x1B[C",pageDown:f==="\x1B[6~",pageUp:f==="\x1B[5~",return:f==="\r",escape:f==="\x1B",ctrl:!1,shift:!1,tab:f===" "||f==="\x1B[Z",backspace:f==="\b",delete:f==="\x7F"||f==="\x1B[3~",meta:!1};f<=""&&!p.return&&(f=String.fromCharCode(f.charCodeAt(0)+97-1),p.ctrl=!0),f.startsWith("\x1B")&&(f=f.slice(1),p.meta=!0);let h=f>="A"&&f<="Z",E=f>="\u0410"&&f<="\u042F";f.length===1&&(h||E)&&(p.shift=!0),p.tab&&f==="[Z"&&(p.shift=!0),(p.tab||p.backspace||p.delete)&&(f=""),(!(f==="c"&&p.ctrl)||!a)&&t(f,p)};return r?.on("data",n),()=>{r?.off("data",n)}},[e.isActive,r,a,t])};bD.default=BQt});var HPe=L(PD=>{"use strict";var vQt=PD&&PD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(PD,"__esModule",{value:!0});var SQt=hn(),DQt=vQt(iY()),bQt=()=>SQt.useContext(DQt.default);PD.default=bQt});var jPe=L(xD=>{"use strict";var PQt=xD&&xD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xD,"__esModule",{value:!0});var xQt=hn(),kQt=PQt(lY()),QQt=()=>xQt.useContext(kQt.default);xD.default=QQt});var qPe=L(kD=>{"use strict";var TQt=kD&&kD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(kD,"__esModule",{value:!0});var RQt=hn(),FQt=TQt(uY()),NQt=()=>RQt.useContext(FQt.default);kD.default=NQt});var WPe=L(TD=>{"use strict";var GPe=TD&&TD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(TD,"__esModule",{value:!0});var QD=hn(),OQt=GPe(KF()),LQt=GPe(XF()),MQt=({isActive:t=!0,autoFocus:e=!1,id:r}={})=>{let{isRawModeSupported:s,setRawMode:a}=LQt.default(),{activeId:n,add:c,remove:f,activate:p,deactivate:h,focus:E}=QD.useContext(OQt.default),C=QD.useMemo(()=>r??Math.random().toString().slice(2,7),[r]);return QD.useEffect(()=>(c(C,{autoFocus:e}),()=>{f(C)}),[C,e]),QD.useEffect(()=>{t?p(C):h(C)},[t,C]),QD.useEffect(()=>{if(!(!s||!t))return a(!0),()=>{a(!1)}},[t]),{isFocused:!!C&&n===C,focus:E}};TD.default=MQt});var YPe=L(RD=>{"use strict";var _Qt=RD&&RD.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(RD,"__esModule",{value:!0});var UQt=hn(),HQt=_Qt(KF()),jQt=()=>{let t=UQt.useContext(HQt.default);return{enableFocus:t.enableFocus,disableFocus:t.disableFocus,focusNext:t.focusNext,focusPrevious:t.focusPrevious,focus:t.focus}};RD.default=jQt});var VPe=L(EY=>{"use strict";Object.defineProperty(EY,"__esModule",{value:!0});EY.default=t=>{var e,r,s,a;return{width:(r=(e=t.yogaNode)===null||e===void 0?void 0:e.getComputedWidth())!==null&&r!==void 0?r:0,height:(a=(s=t.yogaNode)===null||s===void 0?void 0:s.getComputedHeight())!==null&&a!==void 0?a:0}}});var Vc=L(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});var qQt=xPe();Object.defineProperty(Eo,"render",{enumerable:!0,get:function(){return qQt.default}});var GQt=JF();Object.defineProperty(Eo,"Box",{enumerable:!0,get:function(){return GQt.default}});var WQt=dY();Object.defineProperty(Eo,"Text",{enumerable:!0,get:function(){return WQ
2025-04-10 09:51:25 -04:00
`:"";return c?C+=`@IF EXIST ${c} (\r
${c} ${p} ${a} ${E}%*\r
) ELSE (\r
@SETLOCAL\r
@SET PATHEXT=%PATHEXT:;.JS;=;%\r
${f} ${p} ${a} ${E}%*\r
)\r
`:C+=`@${f} ${p} ${a} ${E}%*\r
2025-04-11 10:05:45 -04:00
`,C}function yRt(t,e,r){let s=Jc.relative(Jc.dirname(e),t),a=r.prog&&r.prog.split("\\").join("/"),n;s=s.split("\\").join("/");let c=Jc.isAbsolute(s)?`"${s}"`:`"$basedir/${s}"`,f=r.args||"",p=uV(r.nodePath).posix;a?(n=`"$basedir/${r.prog}"`,s=c):(a=c,f="",s="");let h=r.progArgs?`${r.progArgs.join(" ")} `:"",E=`#!/bin/sh
2025-04-10 09:51:25 -04:00
basedir=$(dirname "$(echo "$0" | sed -e 's,\\\\,/,g')")
case \`uname\` in
*CYGWIN*) basedir=\`cygpath -w "$basedir"\`;;
esac
`,C=r.nodePath?`export NODE_PATH="${p}"
`:"";return n?E+=`${C}if [ -x ${n} ]; then
exec ${n} ${f} ${s} ${h}"$@"
else
exec ${a} ${f} ${s} ${h}"$@"
fi
`:E+=`${C}${a} ${f} ${s} ${h}"$@"
exit $?
2025-04-11 10:05:45 -04:00
`,E}function ERt(t,e,r){let s=Jc.relative(Jc.dirname(e),t),a=r.prog&&r.prog.split("\\").join("/"),n=a&&`"${a}$exe"`,c;s=s.split("\\").join("/");let f=Jc.isAbsolute(s)?`"${s}"`:`"$basedir/${s}"`,p=r.args||"",h=uV(r.nodePath),E=h.win32,C=h.posix;n?(c=`"$basedir/${r.prog}$exe"`,s=f):(n=f,p="",s="");let S=r.progArgs?`${r.progArgs.join(" ")} `:"",P=`#!/usr/bin/env pwsh
2025-04-10 09:51:25 -04:00
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
${r.nodePath?`$env_node_path=$env:NODE_PATH
$env:NODE_PATH="${E}"
`:""}if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}`;return r.nodePath&&(P+=` else {
$env:NODE_PATH="${C}"
}`),c?P+=`
$ret=0
if (Test-Path ${c}) {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & ${c} ${p} ${s} ${S}$args
} else {
& ${c} ${p} ${s} ${S}$args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & ${n} ${p} ${s} ${S}$args
} else {
& ${n} ${p} ${s} ${S}$args
}
$ret=$LASTEXITCODE
}
${r.nodePath?`$env:NODE_PATH=$env_node_path
`:""}exit $ret
`:P+=`
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & ${n} ${p} ${s} ${S}$args
} else {
& ${n} ${p} ${s} ${S}$args
}
${r.nodePath?`$env:NODE_PATH=$env_node_path
`:""}exit $LASTEXITCODE
2025-04-11 10:05:45 -04:00
`,P}function IRt(t,e){return e.fs_.chmod(t,493)}function uV(t){if(!t)return{win32:"",posix:""};let e=typeof t=="string"?t.split(Jc.delimiter):Array.from(t),r={};for(let s=0;s<e.length;s++){let a=e[s].split("/").join("\\"),n=ake()?e[s].split("\\").join("/").replace(/^([^:\\/]*):/,(c,f)=>`/mnt/${f.toLowerCase()}`):e[s];r.win32=r.win32?`${r.win32};${a}`:a,r.posix=r.posix?`${r.posix}:${n}`:n,r[s]={win32:a,posix:n}}return r}cke.exports=cV});var vV=L((tIr,kke)=>{kke.exports=ye("stream")});var Fke=L((rIr,Rke)=>{"use strict";function Qke(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,s)}return r}function JRt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Qke(Object(r),!0).forEach(function(s){zRt(t,s,r[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Qke(Object(r)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(r,s))})}return t}function zRt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ZRt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Tke(t,e){for(var r=0;r<e.length;r++){var s=e[r];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}function XRt(t,e,r){return e&&Tke(t.prototype,e),r&&Tke(t,r),t}var $Rt=ye("buffer"),CN=$Rt.Buffer,eFt=ye("util"),SV=eFt.inspect,tFt=SV&&SV.custom||"inspect";function rFt(t,e,r){CN.prototype.copy.call(t,e,r)}Rke.exports=function(){function t(){ZRt(this,t),this.head=null,this.tail=null,this.length=0}return XRt(t,[{key:"push",value:function(r){var s={data:r,next:null};this.length>0?this.tail.next=s:this.head=s,this.tail=s,++this.length}},{key:"unshift",value:function(r){var s={data:r,next:this.head};this.length===0&&(this.tail=s),this.head=s,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var s=this.head,a=""+s.data;s=s.next;)a+=r+s.data;return a}},{key:"concat",value:function(r){if(this.length===0)return CN.alloc(0);for(var s=CN.allocUnsafe(r>>>0),a=this.head,n=0;a;)rFt(a.data,s,n),n+=a.data.length,a=a.next;return s}},{key:"consume",value:function(r,s){var a;return r<this.head.data.length?(a=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?a=this.shift():a=s?this._getString(r):this._getBuffer(r),a}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var s=this.head,a=1,n=s.data;for(r-=n.length;s=s.next;){var c=s.data,f=r>c.length?c.length:r;if(f===c.length?n+=c:n+=c.slice(0,r),r-=f,r===0){f===c.length?(++a,s.next?this.head=s.next:this.head=this.tail=null):(this.head=s,s.data=c.slice(f));break}++a}return this.length-=a,n}},{key:"_getBuffer",value:function(r){var s=CN.allocUnsafe(r),a=this.head,n=1;for(a.data.copy(s),r-=a.data.length;a=a.next;){var c=a.data,f=r>c.length?c.length:r;if(c.copy(s,s.length-r,0,f),r-=f,r===0){f===c.length?(++n,a.next?this.head=a.next:this.head=this.tail=null):(this.head=a,a.data=c.slice(f));break}++n}return this.length-=n,s}},{key:tFt,value:function(r,s){return SV(this,JRt({},s,{depth:0,customInspect:!1}))}}]),t}()});var bV=L((nIr,Oke)=>{"use strict";function nFt(t,e){var r=this,s=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return s||a?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(DV,this,t)):process.nextTick(DV,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,functio
2025-04-10 09:51:25 -04:00
`)),t.linkname&&(e+=t7(" linkpath="+t.linkname+`
`));var r=t.pax;if(r)for(var s in r)e+=t7(" "+s+"="+r[s]+`
2025-04-11 10:05:45 -04:00
`);return Buffer.from(e)};Hw.decodePax=function(t){for(var e={};t.length;){for(var r=0;r<t.length&&t[r]!==32;)r++;var s=parseInt(t.slice(0,r).toString(),10);if(!s)return e;var a=t.slice(r+1,s-1).toString(),n=a.indexOf("=");if(n===-1)return e;e[a.slice(0,n)]=a.slice(n+1),t=t.slice(s)}return e};Hw.encode=function(t){var e=ZNt(512),r=t.name,s="";if(t.typeflag===5&&r[r.length-1]!=="/"&&(r+="/"),Buffer.byteLength(r)!==r.length)return null;for(;Buffer.byteLength(r)>100;){var a=r.indexOf("/");if(a===-1)return null;s+=s?"/"+r.slice(0,a):r.slice(0,a),r=r.slice(a+1)}return Buffer.byteLength(r)>100||Buffer.byteLength(s)>155||t.linkname&&Buffer.byteLength(t.linkname)>100?null:(e.write(r),e.write(gg(t.mode&nOt,6),100),e.write(gg(t.uid,6),108),e.write(gg(t.gid,6),116),e.write(gg(t.size,11),124),e.write(gg(t.mtime.getTime()/1e3|0,11),136),e[156]=OQe+oOt(t.type),t.linkname&&e.write(t.linkname,157),LQe.copy(e,Bb),eOt.copy(e,r7),t.uname&&e.write(t.uname,265),t.gname&&e.write(t.gname,297),e.write(gg(t.devmajor||0,6),329),e.write(gg(t.devminor||0,6),337),s&&e.write(s,345),e.write(gg(_Qe(e),6),148),e)};Hw.decode=function(t,e,r){var s=t[156]===0?0:t[156]-OQe,a=Uw(t,0,100,e),n=dg(t,100,8),c=dg(t,108,8),f=dg(t,116,8),p=dg(t,124,12),h=dg(t,136,12),E=sOt(s),C=t[157]===0?null:Uw(t,157,100,e),S=Uw(t,265,32),P=Uw(t,297,32),I=dg(t,329,8),R=dg(t,337,8),N=_Qe(t);if(N===8*32)return null;if(N!==dg(t,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(LQe.compare(t,Bb,Bb+6)===0)t[345]&&(a=Uw(t,345,155,e)+"/"+a);else if(!(tOt.compare(t,Bb,Bb+6)===0&&rOt.compare(t,r7,r7+2)===0)){if(!r)throw new Error("Invalid tar header: unknown format.")}return s===0&&a&&a[a.length-1]==="/"&&(s=5),{name:a,mode:n,uid:c,gid:f,size:p,mtime:new Date(1e3*h),type:E,linkname:C,uname:S,gname:P,devmajor:I,devminor:R}}});var YQe=L((BIr,WQe)=>{var HQe=ye("util"),lOt=NQe(),vb=n7(),jQe=_w().Writable,qQe=_w().PassThrough,GQe=function(){},UQe=function(t){return t&=511,t&&512-t},cOt=function(t,e){var r=new LN(t,e);return r.end(),r},uOt=function(t,e){return e.path&&(t.name=e.path),e.linkpath&&(t.linkname=e.linkpath),e.size&&(t.size=parseInt(e.size,10)),t.pax=e,t},LN=function(t,e){this._parent=t,this.offset=e,qQe.call(this,{autoDestroy:!1})};HQe.inherits(LN,qQe);LN.prototype.destroy=function(t){this._parent.destroy(t)};var Ah=function(t){if(!(this instanceof Ah))return new Ah(t);jQe.call(this,t),t=t||{},this._offset=0,this._buffer=lOt(),this._missing=0,this._partial=!1,this._onparse=GQe,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var e=this,r=e._buffer,s=function(){e._continue()},a=function(S){if(e._locked=!1,S)return e.destroy(S);e._stream||s()},n=function(){e._stream=null;var S=UQe(e._header.size);S?e._parse(S,c):e._parse(512,C),e._locked||s()},c=function(){e._buffer.consume(UQe(e._header.size)),e._parse(512,C),s()},f=function(){var S=e._header.size;e._paxGlobal=vb.decodePax(r.slice(0,S)),r.consume(S),n()},p=function(){var S=e._header.size;e._pax=vb.decodePax(r.slice(0,S)),e._paxGlobal&&(e._pax=Object.assign({},e._paxGlobal,e._pax)),r.consume(S),n()},h=function(){var S=e._header.size;this._gnuLongPath=vb.decodeLongPath(r.slice(0,S),t.filenameEncoding),r.consume(S),n()},E=function(){var S=e._header.size;this._gnuLongLinkPath=vb.decodeLongPath(r.slice(0,S),t.filenameEncoding),r.consume(S),n()},C=function(){var S=e._offset,P;try{P=e._header=vb.decode(r.slice(0,512),t.filenameEncoding,t.allowUnknownFormat)}catch(I){e.emit("error",I)}if(r.consume(512),!P){e._parse(512,C),s();return}if(P.type==="gnu-long-path"){e._parse(P.size,h),s();return}if(P.type==="gnu-long-link-path"){e._parse(P.size,E),s();return}if(P.type==="pax-global-header"){e._parse(P.size,f),s();return}if(P.type==="pax-header"){e._parse(P.size,p),s();return}if(e._gnuLongPath&&(P.name=e._gnuLongPath,e._gnuLongPath=null),e._gnuLongLinkPath&&(P.linkname=e._gnuLongLinkPath,e._gnuLongLinkPath=null),e._pax&&(e._header=P=uOt(P,e._pax),e._pax
2025-04-10 09:51:25 -04:00
Wanted: ${this.expectedSize}
2025-04-11 10:05:45 -04:00
Found: ${this.size}`);s.code="EBADSIZE",s.found=this.size,s.expected=this.expectedSize,s.sri=this.sri,this.emit("error",s)}else if(this.sri&&!r){let s=new Error(`${this.sri} integrity checksum failed when using ${this.algorithm}: wanted ${this.digests} but got ${e}. (${this.size} bytes)`);s.code="EINTEGRITY",s.found=e,s.expected=this.digests,s.algorithm=this.algorithm,s.sri=this.sri,this.emit("error",s)}else this.#r=this.size,this.emit("size",this.size),this.#t=e,this.emit("integrity",e),r&&(this.#i=r,this.emit("verified",r))}},gh=class{get isHash(){return!0}constructor(e,r){let s=r?.strict;this.source=e.trim(),this.digest="",this.algorithm="",this.options=[];let a=this.source.match(s?jOt:HOt);if(!a||s&&!I7.includes(a[1]))return;this.algorithm=a[1],this.digest=a[2];let n=a[3];n&&(this.options=n.slice(1).split("?"))}hexDigest(){return this.digest&&Buffer.from(this.digest,"base64").toString("hex")}toJSON(){return this.toString()}match(e,r){let s=ic(e,r);if(!s)return!1;if(s.isIntegrity){let a=s.pickAlgorithm(r,[this.algorithm]);if(!a)return!1;let n=s[a].find(c=>c.digest===this.digest);return n||!1}return s.digest===this.digest?s:!1}toString(e){return e?.strict&&!(I7.includes(this.algorithm)&&this.digest.match(UOt)&&this.options.every(r=>r.match(qOt)))?"":`${this.algorithm}-${this.digest}${Tb(this.options)}`}};function hTe(t,e,r,s){let a=t!=="",n=!1,c="",f=s.length-1;for(let h=0;h<f;h++){let E=gh.prototype.toString.call(s[h],r);E&&(n=!0,c+=E,c+=e)}let p=gh.prototype.toString.call(s[f],r);return p&&(n=!0,c+=p),a&&n?t+e+c:t+c}var Xm=class{get isIntegrity(){return!0}toJSON(){return this.toString()}isEmpty(){return Object.keys(this).length===0}toString(e){let r=e?.sep||" ",s="";if(e?.strict){r=r.replace(/\S+/g," ");for(let a of I7)this[a]&&(s=hTe(s,r,e,this[a]))}else for(let a of Object.keys(this))s=hTe(s,r,e,this[a]);return s}concat(e,r){let s=typeof e=="string"?e:kb(e,r);return ic(`${this.toString(r)} ${s}`,r)}hexDigest(){return ic(this,{single:!0}).hexDigest()}merge(e,r){let s=ic(e,r);for(let a in s)if(this[a]){if(!this[a].find(n=>s[a].find(c=>n.digest===c.digest)))throw new Error("hashes do not match, cannot update integrity")}else this[a]=s[a]}match(e,r){let s=ic(e,r);if(!s)return!1;let a=s.pickAlgorithm(r,Object.keys(this));return!!a&&this[a]&&s[a]&&this[a].find(n=>s[a].find(c=>n.digest===c.digest))||!1}pickAlgorithm(e,r){let s=e?.pickAlgorithm||ZOt,a=Object.keys(this).filter(n=>r?.length?r.includes(n):!0);return a.length?a.reduce((n,c)=>s(n,c)||n):null}};wA.exports.parse=ic;function ic(t,e){if(!t)return null;if(typeof t=="string")return E7(t,e);if(t.algorithm&&t.digest){let r=new Xm;return r[t.algorithm]=[t],E7(kb(r,e),e)}else return E7(kb(t,e),e)}function E7(t,e){if(e?.single)return new gh(t,e);let r=t.trim().split(/\s+/).reduce((s,a)=>{let n=new gh(a,e);if(n.algorithm&&n.digest){let c=n.algorithm;s[c]||(s[c]=[]),s[c].push(n)}return s},new Xm);return r.isEmpty()?null:r}wA.exports.stringify=kb;function kb(t,e){return t.algorithm&&t.digest?gh.prototype.toString.call(t,e):typeof t=="string"?kb(ic(t,e),e):Xm.prototype.toString.call(t,e)}wA.exports.fromHex=GOt;function GOt(t,e,r){let s=Tb(r?.options);return ic(`${e}-${Buffer.from(t,"hex").toString("base64")}${s}`,r)}wA.exports.fromData=WOt;function WOt(t,e){let r=e?.algorithms||[...w7],s=Tb(e?.options);return r.reduce((a,n)=>{let c=Qb.createHash(n).update(t).digest("base64"),f=new gh(`${n}-${c}${s}`,e);if(f.algorithm&&f.digest){let p=f.algorithm;a[p]||(a[p]=[]),a[p].push(f)}return a},new Xm)}wA.exports.fromStream=YOt;function YOt(t,e){let r=B7(e);return new Promise((s,a)=>{t.pipe(r),t.on("error",a),r.on("error",a);let n;r.on("integrity",c=>{n=c}),r.on("end",()=>s(n)),r.resume()})}wA.exports.checkData=VOt;function VOt(t,e,r){if(e=ic(e,r),!e||!Object.keys(e).length){if(r?.error)throw Object.assign(new Error("No valid integrity hashes to check against"),{code:"EINTEGRITY"});return!1}let s=e.pickAlgorithm(r),a=Qb.createHash(s).update(t).digest("base64"),n=ic({algorithm:s,digest:a}),c=n.match(e,r);if(r=r||{},c||!r.error)return c;if(typeof r.size=="number"&&t.length!==r.size){le
2025-04-10 09:51:25 -04:00
Wanted: ${r.size}
2025-04-11 10:05:45 -04:00
Found: ${t.length}`);throw f.code="EBADSIZE",f.found=t.length,f.expected=r.size,f.sri=e,f}else{let f=new Error(`Integrity checksum failed when using ${s}: Wanted ${e}, but got ${n}. (${t.length} bytes)`);throw f.code="EINTEGRITY",f.found=n,f.expected=e,f.algorithm=s,f.sri=e,f}}wA.exports.checkStream=KOt;function KOt(t,e,r){if(r=r||Object.create(null),r.integrity=e,e=ic(e,r),!e||!Object.keys(e).length)return Promise.reject(Object.assign(new Error("No valid integrity hashes to check against"),{code:"EINTEGRITY"}));let s=B7(r);return new Promise((a,n)=>{t.pipe(s),t.on("error",n),s.on("error",n);let c;s.on("verified",f=>{c=f}),s.on("end",()=>a(c)),s.resume()})}wA.exports.integrityStream=B7;function B7(t=Object.create(null)){return new C7(t)}wA.exports.create=JOt;function JOt(t){let e=t?.algorithms||[...w7],r=Tb(t?.options),s=e.map(Qb.createHash);return{update:function(a,n){return s.forEach(c=>c.update(a,n)),this},digest:function(){return e.reduce((n,c)=>{let f=s.shift().digest("base64"),p=new gh(`${c}-${f}${r}`,t);if(p.algorithm&&p.digest){let h=p.algorithm;n[h]||(n[h]=[]),n[h].push(p)}return n},new Xm)}}}var zOt=Qb.getHashes(),gTe=["md5","whirlpool","sha1","sha224","sha256","sha384","sha512","sha3","sha3-256","sha3-384","sha3-512","sha3_256","sha3_384","sha3_512"].filter(t=>zOt.includes(t));function ZOt(t,e){return gTe.indexOf(t.toLowerCase())>=gTe.indexOf(e.toLowerCase())?t:e}});var v7=L(yg=>{"use strict";Object.defineProperty(yg,"__esModule",{value:!0});yg.Signature=yg.Envelope=void 0;yg.Envelope={fromJSON(t){return{payload:ZN(t.payload)?Buffer.from(mTe(t.payload)):Buffer.alloc(0),payloadType:ZN(t.payloadType)?globalThis.String(t.payloadType):"",signatures:globalThis.Array.isArray(t?.signatures)?t.signatures.map(e=>yg.Signature.fromJSON(e)):[]}},toJSON(t){let e={};return t.payload.length!==0&&(e.payload=yTe(t.payload)),t.payloadType!==""&&(e.payloadType=t.payloadType),t.signatures?.length&&(e.signatures=t.signatures.map(r=>yg.Signature.toJSON(r))),e}};yg.Signature={fromJSON(t){return{sig:ZN(t.sig)?Buffer.from(mTe(t.sig)):Buffer.alloc(0),keyid:ZN(t.keyid)?globalThis.String(t.keyid):""}},toJSON(t){let e={};return t.sig.length!==0&&(e.sig=yTe(t.sig)),t.keyid!==""&&(e.keyid=t.keyid),e}};function mTe(t){return Uint8Array.from(globalThis.Buffer.from(t,"base64"))}function yTe(t){return globalThis.Buffer.from(t).toString("base64")}function ZN(t){return t!=null}});var ITe=L(XN=>{"use strict";Object.defineProperty(XN,"__esModule",{value:!0});XN.Timestamp=void 0;XN.Timestamp={fromJSON(t){return{seconds:ETe(t.seconds)?globalThis.String(t.seconds):"0",nanos:ETe(t.nanos)?globalThis.Number(t.nanos):0}},toJSON(t){let e={};return t.seconds!=="0"&&(e.seconds=t.seconds),t.nanos!==0&&(e.nanos=Math.round(t.nanos)),e}};function ETe(t){return t!=null}});var Vw=L(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.TimeRange=_r.X509CertificateChain=_r.SubjectAlternativeName=_r.X509Certificate=_r.DistinguishedName=_r.ObjectIdentifierValuePair=_r.ObjectIdentifier=_r.PublicKeyIdentifier=_r.PublicKey=_r.RFC3161SignedTimestamp=_r.LogId=_r.MessageSignature=_r.HashOutput=_r.SubjectAlternativeNameType=_r.PublicKeyDetails=_r.HashAlgorithm=void 0;_r.hashAlgorithmFromJSON=wTe;_r.hashAlgorithmToJSON=BTe;_r.publicKeyDetailsFromJSON=vTe;_r.publicKeyDetailsToJSON=STe;_r.subjectAlternativeNameTypeFromJSON=DTe;_r.subjectAlternativeNameTypeToJSON=bTe;var XOt=ITe(),El;(function(t){t[t.HASH_ALGORITHM_UNSPECIFIED=0]="HASH_ALGORITHM_UNSPECIFIED",t[t.SHA2_256=1]="SHA2_256",t[t.SHA2_384=2]="SHA2_384",t[t.SHA2_512=3]="SHA2_512",t[t.SHA3_256=4]="SHA3_256",t[t.SHA3_384=5]="SHA3_384"})(El||(_r.HashAlgorithm=El={}));function wTe(t){switch(t){case 0:case"HASH_ALGORITHM_UNSPECIFIED":return El.HASH_ALGORITHM_UNSPECIFIED;case 1:case"SHA2_256":return El.SHA2_256;case 2:case"SHA2_384":return El.SHA2_384;case 3:case"SHA2_512":return El.SHA2_512;case 4:case"SHA3_256":return El.SHA3_256;case 5:case"SHA3_384":return El.SHA3_384;default:throw new globalThis.Error("Unrecognized enum value "+t+" for enum HashAlgorithm")}}function BTe(t){switch(t){case El.HASH_ALGORI
`).forEach(r=>{r.match(GLt)||r.match(WLt)||(e+=r)}),Buffer.from(e,"base64")}function VLt(t,e="CERTIFICATE"){let s=t.toString("base64").match(/.{1,64}/g)||"";return[`-----BEGIN ${e}-----`,...s,`-----END ${e}-----`].join(`
2025-04-10 09:51:25 -04:00
`).concat(`
2025-04-11 10:05:45 -04:00
`)}});var IO=L(Xw=>{"use strict";Object.defineProperty(Xw,"__esModule",{value:!0});Xw.SHA2_HASH_ALGOS=Xw.ECDSA_SIGNATURE_ALGOS=void 0;Xw.ECDSA_SIGNATURE_ALGOS={"1.2.840.10045.4.3.1":"sha224","1.2.840.10045.4.3.2":"sha256","1.2.840.10045.4.3.3":"sha384","1.2.840.10045.4.3.4":"sha512"};Xw.SHA2_HASH_ALGOS={"2.16.840.1.101.3.4.2.1":"sha256","2.16.840.1.101.3.4.2.2":"sha384","2.16.840.1.101.3.4.2.3":"sha512"}});var q7=L(CO=>{"use strict";Object.defineProperty(CO,"__esModule",{value:!0});CO.RFC3161TimestampVerificationError=void 0;var j7=class extends Error{};CO.RFC3161TimestampVerificationError=j7});var nRe=L(DA=>{"use strict";var KLt=DA&&DA.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r);var a=Object.getOwnPropertyDescriptor(e,r);(!a||("get"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,s,a)}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),JLt=DA&&DA.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),zLt=DA&&DA.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&KLt(e,t,r);return JLt(e,t),e};Object.defineProperty(DA,"__esModule",{value:!0});DA.TSTInfo=void 0;var rRe=zLt(Zw()),ZLt=IO(),XLt=q7(),G7=class{constructor(e){this.root=e}get version(){return this.root.subs[0].toInteger()}get genTime(){return this.root.subs[4].toDate()}get messageImprintHashAlgorithm(){let e=this.messageImprintObj.subs[0].subs[0].toOID();return ZLt.SHA2_HASH_ALGOS[e]}get messageImprintHashedMessage(){return this.messageImprintObj.subs[1].value}get raw(){return this.root.toDER()}verify(e){let r=rRe.digest(this.messageImprintHashAlgorithm,e);if(!rRe.bufferEqual(r,this.messageImprintHashedMessage))throw new XLt.RFC3161TimestampVerificationError("message imprint does not match artifact")}get messageImprintObj(){return this.root.subs[2]}};DA.TSTInfo=G7});var sRe=L(bA=>{"use strict";var $Lt=bA&&bA.__createBinding||(Object.create?function(t,e,r,s){s===void 0&&(s=r);var a=Object.getOwnPropertyDescriptor(e,r);(!a||("get"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,s,a)}:function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),eMt=bA&&bA.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),tMt=bA&&bA.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&$Lt(e,t,r);return eMt(e,t),e};Object.defineProperty(bA,"__esModule",{value:!0});bA.RFC3161Timestamp=void 0;var rMt=mO(),W7=tMt(Zw()),iRe=IO(),Mb=q7(),nMt=nRe(),iMt="1.2.840.113549.1.7.2",sMt="1.2.840.113549.1.9.16.1.4",oMt="1.2.840.113549.1.9.4",Y7=class t{constructor(e){this.root=e}static parse(e){let r=rMt.ASN1Obj.parseBuffer(e);return new t(r)}get status(){return this.pkiStatusInfoObj.subs[0].toInteger()}get contentType(){return this.contentTypeObj.toOID()}get eContentType(){return this.eContentTypeObj.toOID()}get signingTime(){return this.tstInfo.genTime}get signerIssuer(){return this.signerSidObj.subs[0].value}get signerSerialNumber(){return this.signerSidObj.subs[1].value}get signerDigestAlgorithm(){let e=this.signerDigestAlgorithmObj.subs[0].toOID();return iRe.SHA2_HASH_ALGOS[e]}get signatureAlgorithm(){let e=this.signatureAlgorithmObj.subs[0].toOID();return iRe.ECDSA_SIGNATURE_ALGOS[e]}get signatureValue(){return this.signatureValueObj.value}get tstInfo(){return new nMt.TSTInfo(this.eContentObj.subs[0].subs[0])}verify(e,r){if(!this.timeStampTokenObj)throw new Mb.RFC3161TimestampVerificationError("timeStampToken is missing");if(this.contentType!==iMt)throw new Mb.RFC3161TimestampVerificationError(`incorrect content type: ${this.contentType}`);if(this.eContentType!==sMt)throw new Mb.RFC3161TimestampVerificationError(`incorrect encapsulated content type: ${this.eContentType}`);this.tstInfo.verify(
2025-04-10 09:51:25 -04:00
globstar while`,e,S,r,P,I),this.matchOne(e.slice(S),r.slice(P),s))return this.debug("globstar found match!",S,p,I),!0;if(I==="."||I===".."||!a.dot&&I.charAt(0)==="."){this.debug("dot detected!",e,S,r,P);break}this.debug("globstar swallow a segment, and continue"),S++}return!!(s&&(this.debug(`
2025-04-11 10:05:45 -04:00
>>> no match, partial?`,e,S,r,P),S===p))}let R;if(typeof E=="string"?(R=C===E,this.debug("string match",E,C,R)):(R=E.test(C),this.debug("pattern match",E,C,R)),!R)return!1}if(c===p&&f===h)return!0;if(c===p)return s;if(f===h)return c===p-1&&e[c]==="";throw new Error("wtf?")}braceExpand(){return(0,pr.braceExpand)(this.pattern,this.options)}parse(e){(0,XO.assertValidPattern)(e);let r=this.options;if(e==="**")return pr.GLOBSTAR;if(e==="")return"";let s,a=null;(s=e.match(S4t))?a=r.dot?b4t:D4t:(s=e.match(g4t))?a=(r.nocase?r.dot?E4t:y4t:r.dot?m4t:d4t)(s[1]):(s=e.match(P4t))?a=(r.nocase?r.dot?k4t:x4t:r.dot?Q4t:T4t)(s):(s=e.match(I4t))?a=r.dot?w4t:C4t:(s=e.match(B4t))&&(a=v4t);let n=ZFe.AST.fromGlob(e,this.options).toMMPattern();return a&&typeof n=="object"&&Reflect.defineProperty(n,"test",{value:a}),n}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let r=this.options,s=r.noglobstar?F4t:r.dot?N4t:O4t,a=new Set(r.nocase?["i"]:[]),n=e.map(p=>{let h=p.map(E=>{if(E instanceof RegExp)for(let C of E.flags.split(""))a.add(C);return typeof E=="string"?j4t(E):E===pr.GLOBSTAR?pr.GLOBSTAR:E._src});return h.forEach((E,C)=>{let S=h[C+1],P=h[C-1];E!==pr.GLOBSTAR||P===pr.GLOBSTAR||(P===void 0?S!==void 0&&S!==pr.GLOBSTAR?h[C+1]="(?:\\/|"+s+"\\/)?"+S:h[C]=s:S===void 0?h[C-1]=P+"(?:\\/|"+s+")?":S!==pr.GLOBSTAR&&(h[C-1]=P+"(?:\\/|\\/"+s+"\\/)"+S,h[C+1]=pr.GLOBSTAR))}),h.filter(E=>E!==pr.GLOBSTAR).join("/")}).join("|"),[c,f]=e.length>1?["(?:",")"]:["",""];n="^"+c+n+f+"$",this.negate&&(n="^(?!"+n+").+$");try{this.regexp=new RegExp(n,[...a].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,r=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&r)return!0;let s=this.options;this.isWindows&&(e=e.split("\\").join("/"));let a=this.slashSplit(e);this.debug(this.pattern,"split",a);let n=this.set;this.debug(this.pattern,"set",n);let c=a[a.length-1];if(!c)for(let f=a.length-2;!c&&f>=0;f--)c=a[f];for(let f=0;f<n.length;f++){let p=n[f],h=a;if(s.matchBase&&p.length===1&&(h=[c]),this.matchOne(h,p,r))return s.flipNegate?!0:!this.negate}return s.flipNegate?!1:this.negate}static defaults(e){return pr.minimatch.defaults(e).Minimatch}};pr.Minimatch=cy;var q4t=WK();Object.defineProperty(pr,"AST",{enumerable:!0,get:function(){return q4t.AST}});var G4t=YK();Object.defineProperty(pr,"escape",{enumerable:!0,get:function(){return G4t.escape}});var W4t=VO();Object.defineProperty(pr,"unescape",{enumerable:!0,get:function(){return W4t.unescape}});pr.minimatch.AST=ZFe.AST;pr.minimatch.Minimatch=cy;pr.minimatch.escape=A4t.escape;pr.minimatch.unescape=p4t.unescape});var JK=L(iu=>{"use strict";var rNe=iu&&iu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(iu,"__esModule",{value:!0});iu.SuccinctRoles=iu.DelegatedRole=iu.Role=iu.TOP_LEVEL_ROLE_NAMES=void 0;var nNe=rNe(ye("crypto")),Y4t=tNe(),$O=rNe(ye("util")),eL=kA(),uy=Af();iu.TOP_LEVEL_ROLE_NAMES=["root","targets","snapshot","timestamp"];var $b=class t{constructor(e){let{keyIDs:r,threshold:s,unrecognizedFields:a}=e;if(V4t(r))throw new eL.ValueError("duplicate key IDs found");if(s<1)throw new eL.ValueError("threshold must be at least 1");this.keyIDs=r,this.threshold=s,this.unrecognizedFields=a||{}}equals(e){return e instanceof t?this.threshold===e.threshold&&$O.default.isDeepStrictEqual(this.keyIDs,e.keyIDs)&&$O.default.isDeepStrictEqual(this.unrecognizedFields,e.unrecognizedFields):!1}toJSON(){return{keyids:this.keyIDs,threshold:this.threshold,...this.unrecognizedFields}}static fromJSON(e){let{keyids:r,threshold:s,...a}=e;if(!uy.guard.isStringArray(r))throw new TypeError("keyids must be an array");if(typeof s!="number")throw new TypeError("threshold must be a number");return new t({keyIDs:r,threshold:s,unrecognizedFields:a})}};iu.Role=$b;function V4t(t){return new Set(t).size!==t.length}var VK=class t extends $
2025-04-10 09:51:25 -04:00
`).join(`
2025-04-11 10:05:45 -04:00
`+n),t.push(a+"m+"+AL.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=Z3t()+e+" "+t[0]}function Z3t(){return $s.inspectOpts.hideDate?"":new Date().toISOString()+" "}function X3t(...t){return process.stderr.write(fL.formatWithOptions($s.inspectOpts,...t)+`
`)}function $3t(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function e8t(){return process.env.DEBUG}function t8t(t){t.inspectOpts={};let e=Object.keys($s.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=$s.inspectOpts[e[r]]}AL.exports=gJ()($s);var{formatters:yNe}=AL.exports;yNe.o=function(t){return this.inspectOpts.colors=this.useColors,fL.inspect(t,this.inspectOpts).split(`
`).map(e=>e.trim()).join(" ")};yNe.O=function(t){return this.inspectOpts.colors=this.useColors,fL.inspect(t,this.inspectOpts)}});var mJ=L((jwr,dJ)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?dJ.exports=mNe():dJ.exports=ENe()});var hL=L(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.DownloadHTTPError=Ji.DownloadLengthMismatchError=Ji.DownloadError=Ji.ExpiredMetadataError=Ji.EqualVersionError=Ji.BadVersionError=Ji.RepositoryError=Ji.PersistError=Ji.RuntimeError=Ji.ValueError=void 0;var yJ=class extends Error{};Ji.ValueError=yJ;var EJ=class extends Error{};Ji.RuntimeError=EJ;var IJ=class extends Error{};Ji.PersistError=IJ;var tP=class extends Error{};Ji.RepositoryError=tP;var pL=class extends tP{};Ji.BadVersionError=pL;var CJ=class extends pL{};Ji.EqualVersionError=CJ;var wJ=class extends tP{};Ji.ExpiredMetadataError=wJ;var rP=class extends Error{};Ji.DownloadError=rP;var BJ=class extends rP{};Ji.DownloadLengthMismatchError=BJ;var vJ=class extends rP{constructor(e,r){super(e),this.statusCode=r}};Ji.DownloadHTTPError=vJ});var CNe=L(y1=>{"use strict";var DJ=y1&&y1.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(y1,"__esModule",{value:!0});y1.withTempFile=void 0;var SJ=DJ(ye("fs/promises")),r8t=DJ(ye("os")),INe=DJ(ye("path")),n8t=async t=>i8t(async e=>t(INe.default.join(e,"tempfile")));y1.withTempFile=n8t;var i8t=async t=>{let e=await SJ.default.realpath(r8t.default.tmpdir()),r=await SJ.default.mkdtemp(e+INe.default.sep);try{return await t(r)}finally{await SJ.default.rm(r,{force:!0,recursive:!0,maxRetries:3})}}});var PJ=L(Qg=>{"use strict";var dL=Qg&&Qg.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Qg,"__esModule",{value:!0});Qg.DefaultFetcher=Qg.BaseFetcher=void 0;var s8t=dL(mJ()),wNe=dL(ye("fs")),o8t=dL(xO()),a8t=dL(ye("util")),BNe=hL(),l8t=CNe(),c8t=(0,s8t.default)("tuf:fetch"),gL=class{async downloadFile(e,r,s){return(0,l8t.withTempFile)(async a=>{let n=await this.fetch(e),c=0,f=wNe.default.createWriteStream(a);try{for await(let p of n){let h=Buffer.from(p);if(c+=h.length,c>r)throw new BNe.DownloadLengthMismatchError("Max length reached");await u8t(f,h)}}finally{await a8t.default.promisify(f.close).bind(f)()}return s(a)})}async downloadBytes(e,r){return this.downloadFile(e,r,async s=>{let a=wNe.default.createReadStream(s),n=[];for await(let c of a)n.push(c);return Buffer.concat(n)})}};Qg.BaseFetcher=gL;var bJ=class extends gL{constructor(e={}){super(),this.timeout=e.timeout,this.retry=e.retry}async fetch(e){c8t("GET %s",e);let r=await(0,o8t.default)(e,{timeout:this.timeout,retry:this.retry});if(!r.ok||!r?.body)throw new BNe.DownloadHTTPError("Failed to download",r.status);return r.body}};Qg.DefaultFetcher=bJ;var u8t=async(t,e)=>new Promise((r,s)=>{t.write(e,a=>{a&&s(a),r(!0)})})});var vNe=L(mL=>{"use strict";Object.defineProperty(mL,"__esModule",{value:!0});mL.defaultConfig=void 0;mL.defaultConfig={maxRootRotations:256,maxDelegations:32,rootMaxLength:512e3,timestampMaxLength:16384,snapshotMaxLength:2e6,targetsMaxLength:5e6,prefixTargetsWithHash:!0,fetchTimeout:1e5,fetchRetries:void 0,fetchRetry:2}});var SNe=L(yL=>{"use strict";Object.defineProperty(yL,"__esModule",{value:!0});yL.TrustedMetadataStore=void 0;var Is=lL(),Ui=hL(),xJ=class{constructor(e){this.trustedSet={},this.referenceTime=new Date,this.loadTrustedRoot(e)}get root(){if(!this.trustedSet.root)throw new ReferenceError("No trusted root metadata");return this.trustedSet.root}get timestamp(){return this.trustedSet.timestamp}get snapshot(){return this.trustedSet.snapshot}get targets(){return this.trustedSet.targets}getRole(e){return this.trustedSet[e]}updateRoot(e){let r=JSON.parse(e.toString("utf8")),s=Is.Metadata.fromJSON(Is.MetadataKind.Root,r);if(s.signed.type!=Is.MetadataKind.Root)throw new Ui.RepositoryError(`Expected 'root', got ${s.signed.type}`);if(this.root.verifyDelegate(Is.MetadataKind.Root,s),s.signed.version!=this.root.signed.version+1)throw new Ui.BadVersionError(`Expected version ${this.root.signed.ver
2025-04-10 09:51:25 -04:00
2025-04-11 10:05:45 -04:00
`,yHt=/\u2014 (\S+) (\S+)\n/g;function EHt(t,e){let r=(0,mHt.filterTLogAuthorities)(e,{targetDate:new Date(Number(t.integratedTime)*1e3)}),s=t.inclusionProof,a=ZJ.fromString(s.checkpoint.envelope),n=XJ.fromString(a.note);if(!IHt(a,r))throw new w1.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"invalid checkpoint signature"});if(!zJ.crypto.bufferEqual(n.logHash,s.rootHash))throw new w1.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"root hash mismatch"})}function IHt(t,e){let r=Buffer.from(t.note,"utf-8");return t.signatures.every(s=>{let a=e.find(n=>zJ.crypto.bufferEqual(n.logID.subarray(0,4),s.keyHint));return a?zJ.crypto.verify(r,a.publicKey,s.signature):!1})}var ZJ=class t{constructor(e,r){this.note=e,this.signatures=r}static fromString(e){if(!e.includes(JJ))throw new w1.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"missing checkpoint separator"});let r=e.indexOf(JJ),s=e.slice(0,r+1),n=e.slice(r+JJ.length).matchAll(yHt),c=Array.from(n,f=>{let[,p,h]=f,E=Buffer.from(h,"base64");if(E.length<5)throw new w1.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"malformed checkpoint signature"});return{name:p,keyHint:E.subarray(0,4),signature:E.subarray(4)}});if(c.length===0)throw new w1.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"no signatures found in checkpoint"});return new t(s,c)}},XJ=class t{constructor(e,r,s,a){this.origin=e,this.logSize=r,this.logHash=s,this.rest=a}static fromString(e){let r=e.trimEnd().split(`
`);if(r.length<3)throw new w1.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"too few lines in checkpoint header"});let s=r[0],a=BigInt(r[1]),n=Buffer.from(r[2],"base64"),c=r.slice(3);return new t(s,a,n,c)}}});var KNe=L(nz=>{"use strict";Object.defineProperty(nz,"__esModule",{value:!0});nz.verifyMerkleInclusion=BHt;var rz=wl(),ez=Co(),CHt=Buffer.from([0]),wHt=Buffer.from([1]);function BHt(t){let e=t.inclusionProof,r=BigInt(e.logIndex),s=BigInt(e.treeSize);if(r<0n||r>=s)throw new ez.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:`invalid index: ${r}`});let{inner:a,border:n}=vHt(r,s);if(e.hashes.length!==a+n)throw new ez.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"invalid hash count"});let c=e.hashes.slice(0,a),f=e.hashes.slice(a),p=kHt(t.canonicalizedBody),h=DHt(SHt(p,c,r),f);if(!rz.crypto.bufferEqual(h,e.rootHash))throw new ez.VerificationError({code:"TLOG_INCLUSION_PROOF_ERROR",message:"calculated root hash does not match inclusion proof"})}function vHt(t,e){let r=bHt(t,e),s=PHt(t>>BigInt(r));return{inner:r,border:s}}function SHt(t,e,r){return e.reduce((s,a,n)=>r>>BigInt(n)&BigInt(1)?tz(a,s):tz(s,a),t)}function DHt(t,e){return e.reduce((r,s)=>tz(s,r),t)}function bHt(t,e){return xHt(t^e-BigInt(1))}function PHt(t){return t.toString(2).split("1").length-1}function xHt(t){return t===0n?0:t.toString(2).length}function tz(t,e){return rz.crypto.digest("sha256",wHt,t,e)}function kHt(t){return rz.crypto.digest("sha256",CHt,t)}});var zNe=L(iz=>{"use strict";Object.defineProperty(iz,"__esModule",{value:!0});iz.verifyTLogSET=RHt;var JNe=wl(),QHt=Co(),THt=hy();function RHt(t,e){if(!(0,THt.filterTLogAuthorities)(e,{logID:t.logId.keyId,targetDate:new Date(Number(t.integratedTime)*1e3)}).some(a=>{let n=FHt(t),c=Buffer.from(JNe.json.canonicalize(n),"utf8"),f=t.inclusionPromise.signedEntryTimestamp;return JNe.crypto.verify(c,a.publicKey,f)}))throw new QHt.VerificationError({code:"TLOG_INCLUSION_PROMISE_ERROR",message:"inclusion promise could not be verified"})}function FHt(t){let{integratedTime:e,logIndex:r,logId:s,canonicalizedBody:a}=t;return{body:a.toString("base64"),integratedTime:Number(e),logIndex:Number(r),logID:s.keyId.toString("hex")}}});var ZNe=L(az=>{"use strict";Object.defineProperty(az,"__esModule",{value:!0});az.verifyRFC3161Timestamp=LHt;var sz=wl(),oz=Co(),NHt=VJ(),OHt=hy();function LHt(t,e,r){let s=t.signingTime;if(r=(0,OHt.filterCertAuthorities)(r,{start:s,end:s}),r=_Ht(r,{serialNumber:t.signerSerialNumber,issuer:t.signerIssuer}),!r.some(n=>{try{return MHt(t,e,n),!0}catch{return!1}}))throw new oz.VerificationError({code:"TIMESTAMP_ERROR",message:"timestamp could not be verified"})}function MHt(t,e,r){let[s,...a]=r.certChain,n=sz.crypto.createPublicKey(s.publicKey),c=t.signingTime;try{new NHt.CertificateChainVerifier({untrustedCert:s,trustedCerts:a}).verify()}catch{throw new oz.VerificationError({code:"TIMESTAMP_ERROR",message:"invalid certificate chain"})}if(!r.certChain.every(p=>p.validForDate(c)))throw new oz.VerificationError({code:"TIMESTAMP_ERROR",message:"timestamp was signed with an expired certificate"});t.verify(e,n)}function _Ht(t,e){return t.filter(r=>r.certChain.length>0&&sz.crypto.bufferEqual(r.certChain[0].serialNumber,e.serialNumber)&&sz.crypto.bufferEqual(r.certChain[0].issuer,e.issuer))}});var XNe=L(TL=>{"use strict";Object.defineProperty(TL,"__esModule",{value:!0});TL.verifyTSATimestamp=WHt;TL.verifyTLogTimestamp=YHt;var UHt=Co(),HHt=VNe(),jHt=KNe(),qHt=zNe(),GHt=ZNe();function WHt(t,e,r){return(0,GHt.verifyRFC3161Timestamp)(t,e,r),{type:"timestamp-authority",logID:t.signerSerialNumber,timestamp:t.signingTime}}function YHt(t,e){let r=!1;if(VHt(t)&&((0,qHt.verifyTLogSET)(t,e),r=!0),KHt(t)&&((0,jHt.verifyMerkleInclusion)(t),(0,HHt.verifyCheckpoint)(t,e),r=!0),!r)throw new UHt.VerificationError({code:"TLOG_MISSING_INCLUSION_ERROR",message:"inclusion could not be verified"});return{type:"transparency-log",logID:t.logId.keyId,timestamp:new Date(Number(t.integratedTime)*1e3)}}function VHt(t){return t.inclusionPromise!==void 0}function KHt(t){return t.inclusionPr
2025-04-10 09:51:25 -04:00
Try running the command again with the package name prefixed: ${he.pretty(r,"yarn add",he.Type.CODE)} ${he.pretty(r,q.makeDescriptor(q.makeIdent(null,"my-package"),`${ie[0]}...`),he.Type.DESCRIPTOR)}`);if(!te)throw new nt(`The ${he.pretty(r,W,he.Type.CODE)} string didn't match the required format (package-name@range). Did you perhaps forget to explicitly reference the package name?`);let Ae=E2t(a,te,{dev:this.dev,peer:this.peer,preferDev:this.preferDev,optional:this.optional});return await Promise.all(Ae.map(async me=>{let pe=await fS(te,{project:s,workspace:a,cache:n,fixed:c,target:me,modifier:h,strategies:E,maxResults:C});return{request:te,suggestedDescriptors:pe,target:me}}))})).then(W=>W.flat()),I=await uA.start({configuration:r,stdout:this.context.stdout,suggestInstall:!1},async W=>{for(let{request:te,suggestedDescriptors:{suggestions:ie,rejections:Ae}}of P)if(ie.filter(me=>me.descriptor!==null).length===0){let[me]=Ae;if(typeof me>"u")throw new Error("Assertion failed: Expected an error to have been set");s.configuration.get("enableNetwork")?W.reportError(27,`${q.prettyDescriptor(r,te)} can't be resolved to a satisfying range`):W.reportError(27,`${q.prettyDescriptor(r,te)} can't be resolved to a satisfying range (note: network resolution has been disabled)`),W.reportSeparator(),W.reportExceptionOnce(me)}});if(I.hasErrors())return I.exitCode();let R=!1,N=[],U=[];for(let{suggestedDescriptors:{suggestions:W},target:te}of P){let ie,Ae=W.filter(Be=>Be.descriptor!==null),ce=Ae[0].descriptor,me=Ae.every(Be=>q.areDescriptorsEqual(Be.descriptor,ce));Ae.length===1||me?ie=ce:(R=!0,{answer:ie}=await(0,z1e.prompt)({type:"select",name:"answer",message:"Which range do you want to use?",choices:W.map(({descriptor:Be,name:Ce,reason:g})=>Be?{name:Ce,hint:g,descriptor:Be}:{name:Ce,hint:g,disabled:!0}),onCancel:()=>process.exit(130),result(Be){return this.find(Be,"descriptor")},stdin:this.context.stdin,stdout:this.context.stdout}));let pe=a.manifest[te].get(ie.identHash);(typeof pe>"u"||pe.descriptorHash!==ie.descriptorHash)&&(a.manifest[te].set(ie.identHash,ie),this.optional&&(te==="dependencies"?a.manifest.ensureDependencyMeta({...ie,range:"unknown"}).optional=!0:te==="peerDependencies"&&(a.manifest.ensurePeerDependencyMeta({...ie,range:"unknown"}).optional=!0)),typeof pe>"u"?N.push([a,te,ie,E]):U.push([a,te,pe,ie]))}return await r.triggerMultipleHooks(W=>W.afterWorkspaceDependencyAddition,N),await r.triggerMultipleHooks(W=>W.afterWorkspaceDependencyReplacement,U),R&&this.context.stdout.write(`
`),await s.installWithNewReport({json:this.json,stdout:this.context.stdout,quiet:this.context.quiet},{cache:n,mode:this.mode})}};function E2t(t,e,{dev:r,peer:s,preferDev:a,optional:n}){let c=t.manifest.dependencies.has(e.identHash),f=t.manifest.devDependencies.has(e.identHash),p=t.manifest.peerDependencies.has(e.identHash);if((r||s)&&c)throw new nt(`Package "${q.prettyIdent(t.project.configuration,e)}" is already listed as a regular dependency - remove the -D,-P flags or remove it from your dependencies first`);if(!r&&!s&&p)throw new nt(`Package "${q.prettyIdent(t.project.configuration,e)}" is already listed as a peer dependency - use either of -D or -P, or remove it from your peer dependencies first`);if(n&&f)throw new nt(`Package "${q.prettyIdent(t.project.configuration,e)}" is already listed as a dev dependency - remove the -O flag or remove it from your dev dependencies first`);if(n&&!s&&p)throw new nt(`Package "${q.prettyIdent(t.project.configuration,e)}" is already listed as a peer dependency - remove the -O flag or add the -P flag or remove it from your peer dependencies first`);if((r||a)&&n)throw new nt(`Package "${q.prettyIdent(t.project.configuration,e)}" cannot simultaneously be a dev dependency and an optional dependency`);let h=[];return s&&h.push("peerDependencies"),(r||a)&&h.push("devDependencies"),n&&h.push("dependencies"),h.length>0?h:f?["devDependencies"]:p?["peerDependencies"]:["dependencies"]}Ve();Ve();Wt();var lC=class extends ut{constructor(){super(...arguments);this.verbose=ge.Boolean("-v,--verbose",!1,{description:"Print both the binary name and the locator of the package that provides the binary"});this.json=ge.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.name=ge.String({required:!1})}static{this.paths=[["bin"]]}static{this.usage=ot.Usage({description:"get the path to a binary script",details:`
When used without arguments, this command will print the list of all the binaries available in the current workspace. Adding the \`-v,--verbose\` flag will cause the output to contain both the binary name and the locator of the package that provides the binary.
When an argument is specified, this command will just print the path to the binary on the standard output and exit. Note that the reported path may be stored within a zip archive.
`,examples:[["List all the available binaries","$0 bin"],["Print the path to a specific binary","$0 bin eslint"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,locator:a}=await Tt.find(r,this.context.cwd);if(await s.restoreInstallState(),this.name){let f=(await In.getPackageAccessibleBinaries(a,{project:s})).get(this.name);if(!f)throw new nt(`Couldn't find a binary named "${this.name}" for package "${q.prettyLocator(r,a)}"`);let[,p]=f;return this.context.stdout.write(`${p}
`),0}return(await Ot.start({configuration:r,json:this.json,stdout:this.context.stdout},async c=>{let f=await In.getPackageAccessibleBinaries(a,{project:s}),h=Array.from(f.keys()).reduce((E,C)=>Math.max(E,C.length),0);for(let[E,[C,S]]of f)c.reportJson({name:E,source:q.stringifyIdent(C),path:S});if(this.verbose)for(let[E,[C]]of f)c.reportInfo(null,`${E.padEnd(h," ")} ${q.prettyLocator(r,C)}`);else for(let E of f.keys())c.reportInfo(null,E)})).exitCode()}};Ve();bt();Wt();var cC=class extends ut{constructor(){super(...arguments);this.mirror=ge.Boolean("--mirror",!1,{description:"Remove the global cache files instead of the local cache files"});this.all=ge.Boolean("--all",!1,{description:"Remove both the global cache files and the local cache files of the current project"})}static{this.paths=[["cache","clean"],["cache","clear"]]}static{this.usage=ot.Usage({description:"remove the shared cache files",details:`
This command will remove all the files from the cache.
2025-04-11 10:05:45 -04:00
`,examples:[["Remove all the local archives","$0 cache clean"],["Remove all the archives stored in the ~/.yarn directory","$0 cache clean --mirror"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins);if(!r.get("enableCacheClean"))throw new nt("Cache cleaning is currently disabled. To enable it, set `enableCacheClean: true` in your configuration file. Note: Cache cleaning is typically not required and should be avoided when using Zero-Installs.");let s=await Jr.find(r);return(await Ot.start({configuration:r,stdout:this.context.stdout},async()=>{let n=(this.all||this.mirror)&&s.mirrorCwd!==null,c=!this.mirror;n&&(await le.removePromise(s.mirrorCwd),await r.triggerHook(f=>f.cleanGlobalArtifacts,r)),c&&await le.removePromise(s.cwd)})).exitCode()}};Ve();Wt();var X1e=et(AS()),D5=ye("util"),uC=class extends ut{constructor(){super(...arguments);this.why=ge.Boolean("--why",!1,{description:"Print the explanation for why a setting has its value"});this.json=ge.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.unsafe=ge.Boolean("--no-redacted",!1,{description:"Don't redact secrets (such as tokens) from the output"});this.name=ge.String()}static{this.paths=[["config","get"]]}static{this.usage=ot.Usage({description:"read a configuration settings",details:`
2025-04-10 09:51:25 -04:00
This command will print a configuration setting.
Secrets (such as tokens) will be redacted from the output by default. If this behavior isn't desired, set the \`--no-redacted\` to get the untransformed value.
`,examples:[["Print a simple configuration setting","yarn config get yarnPath"],["Print a complex configuration setting","yarn config get packageExtensions"],["Print a nested field from the configuration",`yarn config get 'npmScopes["my-company"].npmRegistryServer'`],["Print a token from the configuration","yarn config get npmAuthToken --no-redacted"],["Print a configuration setting as JSON","yarn config get packageExtensions --json"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),s=this.name.replace(/[.[].*$/,""),a=this.name.replace(/^[^.[]*/,"");if(typeof r.settings.get(s)>"u")throw new nt(`Couldn't find a configuration settings named "${s}"`);let c=r.getSpecial(s,{hideSecrets:!this.unsafe,getNativePaths:!0}),f=je.convertMapsToIndexableObjects(c),p=a?(0,X1e.default)(f,a):f,h=await Ot.start({configuration:r,includeFooter:!1,json:this.json,stdout:this.context.stdout},async E=>{E.reportJson(p)});if(!this.json){if(typeof p=="string")return this.context.stdout.write(`${p}
`),h.exitCode();D5.inspect.styles.name="cyan",this.context.stdout.write(`${(0,D5.inspect)(p,{depth:1/0,colors:r.get("enableColors"),compact:!1})}
`)}return h.exitCode()}};Ve();Wt();var j2e=et(k5()),q2e=et(AS()),G2e=et(Q5()),T5=ye("util"),fC=class extends ut{constructor(){super(...arguments);this.json=ge.Boolean("--json",!1,{description:"Set complex configuration settings to JSON values"});this.home=ge.Boolean("-H,--home",!1,{description:"Update the home configuration instead of the project configuration"});this.name=ge.String();this.value=ge.String()}static{this.paths=[["config","set"]]}static{this.usage=ot.Usage({description:"change a configuration settings",details:`
This command will set a configuration setting.
When used without the \`--json\` flag, it can only set a simple configuration setting (a string, a number, or a boolean).
When used with the \`--json\` flag, it can set both simple and complex configuration settings, including Arrays and Objects.
2025-04-11 10:05:45 -04:00
`,examples:[["Set a simple configuration setting (a string, a number, or a boolean)","yarn config set initScope myScope"],["Set a simple configuration setting (a string, a number, or a boolean) using the `--json` flag",'yarn config set initScope --json \\"myScope\\"'],["Set a complex configuration setting (an Array) using the `--json` flag",`yarn config set unsafeHttpWhitelist --json '["*.example.com", "example.com"]'`],["Set a complex configuration setting (an Object) using the `--json` flag",`yarn config set packageExtensions --json '{ "@babel/parser@*": { "dependencies": { "@babel/types": "*" } } }'`],["Set a nested configuration setting",'yarn config set npmScopes.company.npmRegistryServer "https://npm.example.com"'],["Set a nested configuration setting using indexed access for non-simple keys",`yarn config set 'npmRegistries["//npm.example.com"].npmAuthToken' "ffffffff-ffff-ffff-ffff-ffffffffffff"`]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),s=()=>{if(!r.projectCwd)throw new nt("This command must be run from within a project folder");return r.projectCwd},a=this.name.replace(/[.[].*$/,""),n=this.name.replace(/^[^.[]*\.?/,"");if(typeof r.settings.get(a)>"u")throw new nt(`Couldn't find a configuration settings named "${a}"`);if(a==="enableStrictSettings")throw new nt("This setting only affects the file it's in, and thus cannot be set from the CLI");let f=this.json?JSON.parse(this.value):this.value;await(this.home?I=>ze.updateHomeConfiguration(I):I=>ze.updateConfiguration(s(),I))(I=>{if(n){let R=(0,j2e.default)(I);return(0,G2e.default)(R,this.name,f),R}else return{...I,[a]:f}});let E=(await ze.find(this.context.cwd,this.context.plugins)).getSpecial(a,{hideSecrets:!0,getNativePaths:!0}),C=je.convertMapsToIndexableObjects(E),S=n?(0,q2e.default)(C,n):C;return(await Ot.start({configuration:r,includeFooter:!1,stdout:this.context.stdout},async I=>{T5.inspect.styles.name="cyan",I.reportInfo(0,`Successfully set ${this.name} to ${(0,T5.inspect)(S,{depth:1/0,colors:r.get("enableColors"),compact:!1})}`)})).exitCode()}};Ve();Wt();var tBe=et(k5()),rBe=et(K2e()),nBe=et(F5()),AC=class extends ut{constructor(){super(...arguments);this.home=ge.Boolean("-H,--home",!1,{description:"Update the home configuration instead of the project configuration"});this.name=ge.String()}static{this.paths=[["config","unset"]]}static{this.usage=ot.Usage({description:"unset a configuration setting",details:`
2025-04-10 09:51:25 -04:00
This command will unset a configuration setting.
`,examples:[["Unset a simple configuration setting","yarn config unset initScope"],["Unset a complex configuration setting","yarn config unset packageExtensions"],["Unset a nested configuration setting","yarn config unset npmScopes.company.npmRegistryServer"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),s=()=>{if(!r.projectCwd)throw new nt("This command must be run from within a project folder");return r.projectCwd},a=this.name.replace(/[.[].*$/,""),n=this.name.replace(/^[^.[]*\.?/,"");if(typeof r.settings.get(a)>"u")throw new nt(`Couldn't find a configuration settings named "${a}"`);let f=this.home?h=>ze.updateHomeConfiguration(h):h=>ze.updateConfiguration(s(),h);return(await Ot.start({configuration:r,includeFooter:!1,stdout:this.context.stdout},async h=>{let E=!1;await f(C=>{if(!(0,rBe.default)(C,this.name))return h.reportWarning(0,`Configuration doesn't contain setting ${this.name}; there is nothing to unset`),E=!0,C;let S=n?(0,tBe.default)(C):{...C};return(0,nBe.default)(S,this.name),S}),E||h.reportInfo(0,`Successfully unset ${this.name}`)})).exitCode()}};Ve();bt();Wt();var sF=ye("util"),pC=class extends ut{constructor(){super(...arguments);this.noDefaults=ge.Boolean("--no-defaults",!1,{description:"Omit the default values from the display"});this.json=ge.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.verbose=ge.Boolean("-v,--verbose",{hidden:!0});this.why=ge.Boolean("--why",{hidden:!0});this.names=ge.Rest()}static{this.paths=[["config"]]}static{this.usage=ot.Usage({description:"display the current configuration",details:`
This command prints the current active configuration settings.
`,examples:[["Print the active configuration settings","$0 config"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins,{strict:!1}),s=await DI({configuration:r,stdout:this.context.stdout,forceError:this.json},[{option:this.verbose,message:"The --verbose option is deprecated, the settings' descriptions are now always displayed"},{option:this.why,message:"The --why option is deprecated, the settings' sources are now always displayed"}]);if(s!==null)return s;let a=this.names.length>0?[...new Set(this.names)].sort():[...r.settings.keys()].sort(),n,c=await Ot.start({configuration:r,json:this.json,stdout:this.context.stdout,includeFooter:!1},async f=>{if(r.invalid.size>0&&!this.json){for(let[p,h]of r.invalid)f.reportError(34,`Invalid configuration key "${p}" in ${h}`);f.reportSeparator()}if(this.json)for(let p of a){if(this.noDefaults&&!r.sources.has(p))continue;let h=r.settings.get(p);typeof h>"u"&&f.reportError(34,`No configuration key named "${p}"`);let E=r.getSpecial(p,{hideSecrets:!0,getNativePaths:!0}),C=r.sources.get(p)??"<default>",S=C&&C[0]!=="<"?ue.fromPortablePath(C):C;f.reportJson({key:p,effective:E,source:S,...h})}else{let p={breakLength:1/0,colors:r.get("enableColors"),maxArrayLength:2},h={},E={children:h};for(let C of a){if(this.noDefaults&&!r.sources.has(C))continue;let S=r.settings.get(C),P=r.sources.get(C)??"<default>",I=r.getSpecial(C,{hideSecrets:!0,getNativePaths:!0}),R={Description:{label:"Description",value:he.tuple(he.Type.MARKDOWN,{text:S.description,format:this.cli.format(),paragraphs:!1})},Source:{label:"Source",value:he.tuple(P[0]==="<"?he.Type.CODE:he.Type.PATH,P)}};h[C]={value:he.tuple(he.Type.CODE,C),children:R};let N=(U,W)=>{for(let[te,ie]of W)if(ie instanceof Map){let Ae={};U[te]={children:Ae},N(Ae,ie)}else U[te]={label:te,value:he.tuple(he.Type.NO_HINT,(0,sF.inspect)(ie,p))}};I instanceof Map?N(R,I):R.Value={label:"Value",value:he.tuple(he.Type.NO_HINT,(0,sF.inspect)(I,p))}}a.length!==1&&(n=void 0),ks.emitTree(E,{configuration:r,json:this.json,stdout:this.context.stdout,separators:2})}});if(!this.json&&typeof n<"u"){let f=a[0],p=(0,sF.inspect)(r.getSpecial(f,{hideSecrets:!0,getNativePaths:!0}),{colors:r.get("enableColors")});this.context.stdout.write(`
`),this.context.stdout.write(`${p}
2025-04-11 10:05:45 -04:00
`)}return c.exitCode()}};Ve();Wt();Ul();var oF={};Vt(oF,{Strategy:()=>pS,acceptedStrategies:()=>tSt,dedupe:()=>N5});Ve();Ve();var iBe=et(Sa()),pS=(e=>(e.HIGHEST="highest",e))(pS||{}),tSt=new Set(Object.values(pS)),rSt={highest:async(t,e,{resolver:r,fetcher:s,resolveOptions:a,fetchOptions:n})=>{let c=new Map;for(let[p,h]of t.storedResolutions){let E=t.storedDescriptors.get(p);if(typeof E>"u")throw new Error(`Assertion failed: The descriptor (${p}) should have been registered`);je.getSetWithDefault(c,E.identHash).add(h)}let f=new Map(je.mapAndFilter(t.storedDescriptors.values(),p=>q.isVirtualDescriptor(p)?je.mapAndFilter.skip:[p.descriptorHash,je.makeDeferred()]));for(let p of t.storedDescriptors.values()){let h=f.get(p.descriptorHash);if(typeof h>"u")throw new Error(`Assertion failed: The descriptor (${p.descriptorHash}) should have been registered`);let E=t.storedResolutions.get(p.descriptorHash);if(typeof E>"u")throw new Error(`Assertion failed: The resolution (${p.descriptorHash}) should have been registered`);let C=t.originalPackages.get(E);if(typeof C>"u")throw new Error(`Assertion failed: The package (${E}) should have been registered`);Promise.resolve().then(async()=>{let S=r.getResolutionDependencies(p,a),P=Object.fromEntries(await je.allSettledSafe(Object.entries(S).map(async([te,ie])=>{let Ae=f.get(ie.descriptorHash);if(typeof Ae>"u")throw new Error(`Assertion failed: The descriptor (${ie.descriptorHash}) should have been registered`);let ce=await Ae.promise;if(!ce)throw new Error("Assertion failed: Expected the dependency to have been through the dedupe process itself");return[te,ce.updatedPackage]})));if(e.length&&!iBe.default.isMatch(q.stringifyIdent(p),e)||!r.shouldPersistResolution(C,a))return C;let I=c.get(p.identHash);if(typeof I>"u")throw new Error(`Assertion failed: The resolutions (${p.identHash}) should have been registered`);if(I.size===1)return C;let R=[...I].map(te=>{let ie=t.originalPackages.get(te);if(typeof ie>"u")throw new Error(`Assertion failed: The package (${te}) should have been registered`);return ie}),N=await r.getSatisfying(p,P,R,a),U=N.locators?.[0];if(typeof U>"u"||!N.sorted)return C;let W=t.originalPackages.get(U.locatorHash);if(typeof W>"u")throw new Error(`Assertion failed: The package (${U.locatorHash}) should have been registered`);return W}).then(async S=>{let P=await t.preparePackage(S,{resolver:r,resolveOptions:a});h.resolve({descriptor:p,currentPackage:C,updatedPackage:S,resolvedPackage:P})}).catch(S=>{h.reject(S)})}return[...f.values()].map(p=>p.promise)}};async function N5(t,{strategy:e,patterns:r,cache:s,report:a}){let{configuration:n}=t,c=new Wi,f=n.makeResolver(),p=n.makeFetcher(),h={cache:s,checksums:t.storedChecksums,fetcher:p,project:t,report:c,cacheOptions:{skipIntegrityCheck:!0}},E={project:t,resolver:f,report:c,fetchOptions:h};return await a.startTimerPromise("Deduplication step",async()=>{let C=rSt[e],S=await C(t,r,{resolver:f,resolveOptions:E,fetcher:p,fetchOptions:h}),P=ho.progressViaCounter(S.length);await a.reportProgress(P);let I=0;await Promise.all(S.map(U=>U.then(W=>{if(W===null||W.currentPackage.locatorHash===W.updatedPackage.locatorHash)return;I++;let{descriptor:te,currentPackage:ie,updatedPackage:Ae}=W;a.reportInfo(0,`${q.prettyDescriptor(n,te)} can be deduped from ${q.prettyLocator(n,ie)} to ${q.prettyLocator(n,Ae)}`),a.reportJson({descriptor:q.stringifyDescriptor(te),currentResolution:q.stringifyLocator(ie),updatedResolution:q.stringifyLocator(Ae)}),t.storedResolutions.set(te.descriptorHash,Ae.locatorHash)}).finally(()=>P.tick())));let R;switch(I){case 0:R="No packages";break;case 1:R="One package";break;default:R=`${I} packages`}let N=he.pretty(n,e,he.Type.CODE);return a.reportInfo(0,`${R} can be deduped using the ${N} strategy`),I})}var hC=class extends ut{constructor(){super(...arguments);this.strategy=ge.String("-s,--strategy","highest",{description:"The strategy to use when deduping dependencies",validator:Ao(pS)});this.check=ge.Boolean("-c,--check",!1,{description:"Exit with exit code 1 when duplicates are found, without persisting the dependenc
`)}};var dC=class extends ut{static{this.paths=[["help"],["--help"],["-h"]]}async execute(){this.context.stdout.write(this.cli.usage(null))}};Ve();bt();Wt();var mC=class extends ut{constructor(){super(...arguments);this.leadingArgument=ge.String();this.args=ge.Proxy()}async execute(){if(this.leadingArgument.match(/[\\/]/)&&!q.tryParseIdent(this.leadingArgument)){let r=K.resolve(this.context.cwd,ue.toPortablePath(this.leadingArgument));return await this.cli.run(this.args,{cwd:r})}else return await this.cli.run(["run",this.leadingArgument,...this.args])}};Ve();var yC=class extends ut{static{this.paths=[["-v"],["--version"]]}async execute(){this.context.stdout.write(`${un||"<unknown>"}
2025-04-10 09:51:25 -04:00
`)}};Ve();Ve();Wt();var EC=class extends ut{constructor(){super(...arguments);this.commandName=ge.String();this.args=ge.Proxy()}static{this.paths=[["exec"]]}static{this.usage=ot.Usage({description:"execute a shell script",details:`
This command simply executes a shell script within the context of the root directory of the active workspace using the portable shell.
It also makes sure to call it in a way that's compatible with the current project (for example, on PnP projects the environment will be setup in such a way that PnP will be correctly injected into the environment).
2025-04-11 10:05:45 -04:00
`,examples:[["Execute a single shell command","$0 exec echo Hello World"],["Execute a shell script",'$0 exec "tsc & babel src --out-dir lib"']]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,locator:a}=await Tt.find(r,this.context.cwd);return await s.restoreInstallState(),await In.executePackageShellcode(a,this.commandName,this.args,{cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,project:s})}};Ve();Wt();Ul();var IC=class extends ut{constructor(){super(...arguments);this.hash=ge.String({required:!1,validator:Jx(wE(),[tB(/^p[0-9a-f]{5}$/)])})}static{this.paths=[["explain","peer-requirements"]]}static{this.usage=ot.Usage({description:"explain a set of peer requirements",details:`
2025-04-10 09:51:25 -04:00
A peer requirement represents all peer requests that a subject must satisfy when providing a requested package to requesters.
When the hash argument is specified, this command prints a detailed explanation of the peer requirement corresponding to the hash and whether it is satisfied or not.
When used without arguments, this command lists all peer requirements and the corresponding hash that can be used to get detailed information about a given requirement.
**Note:** A hash is a six-letter p-prefixed code that can be obtained from peer dependency warnings or from the list of all peer requirements (\`yarn explain peer-requirements\`).
2025-04-11 10:05:45 -04:00
`,examples:[["Explain the corresponding peer requirement for a hash","$0 explain peer-requirements p1a4ed"],["List all peer requirements","$0 explain peer-requirements"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s}=await Tt.find(r,this.context.cwd);return await s.restoreInstallState({restoreResolutions:!1}),await s.applyLightResolution(),typeof this.hash<"u"?await iSt(this.hash,s,{stdout:this.context.stdout}):await sSt(s,{stdout:this.context.stdout})}};async function iSt(t,e,r){let s=e.peerRequirementNodes.get(t);if(typeof s>"u")throw new Error(`No peerDependency requirements found for hash: "${t}"`);let a=new Set,n=p=>a.has(p.requester.locatorHash)?{value:he.tuple(he.Type.DEPENDENT,{locator:p.requester,descriptor:p.descriptor}),children:p.children.size>0?[{value:he.tuple(he.Type.NO_HINT,"...")}]:[]}:(a.add(p.requester.locatorHash),{value:he.tuple(he.Type.DEPENDENT,{locator:p.requester,descriptor:p.descriptor}),children:Object.fromEntries(Array.from(p.children.values(),h=>[q.stringifyLocator(h.requester),n(h)]))}),c=e.peerWarnings.find(p=>p.hash===t);return(await Ot.start({configuration:e.configuration,stdout:r.stdout,includeFooter:!1,includePrefix:!1},async p=>{let h=he.mark(e.configuration),E=c?h.Cross:h.Check;if(p.reportInfo(0,`Package ${he.pretty(e.configuration,s.subject,he.Type.LOCATOR)} is requested to provide ${he.pretty(e.configuration,s.ident,he.Type.IDENT)} by its descendants`),p.reportSeparator(),p.reportInfo(0,he.pretty(e.configuration,s.subject,he.Type.LOCATOR)),ks.emitTree({children:Object.fromEntries(Array.from(s.requests.values(),C=>[q.stringifyLocator(C.requester),n(C)]))},{configuration:e.configuration,stdout:r.stdout,json:!1}),p.reportSeparator(),s.provided.range==="missing:"){let C=c?"":" , but all peer requests are optional";p.reportInfo(0,`${E} Package ${he.pretty(e.configuration,s.subject,he.Type.LOCATOR)} does not provide ${he.pretty(e.configuration,s.ident,he.Type.IDENT)}${C}.`)}else{let C=e.storedResolutions.get(s.provided.descriptorHash);if(!C)throw new Error("Assertion failed: Expected the descriptor to be registered");let S=e.storedPackages.get(C);if(!S)throw new Error("Assertion failed: Expected the package to be registered");p.reportInfo(0,`${E} Package ${he.pretty(e.configuration,s.subject,he.Type.LOCATOR)} provides ${he.pretty(e.configuration,s.ident,he.Type.IDENT)} with version ${q.prettyReference(e.configuration,S.version??"0.0.0")}, ${c?"which does not satisfy all requests.":"which satisfies all requests"}`),c?.type===3&&(c.range?p.reportInfo(0,` The combined requested range is ${he.pretty(e.configuration,c.range,he.Type.RANGE)}`):p.reportInfo(0," Unfortunately, the requested ranges have no overlap"))}})).exitCode()}async function sSt(t,e){return(await Ot.start({configuration:t.configuration,stdout:e.stdout,includeFooter:!1,includePrefix:!1},async s=>{let a=he.mark(t.configuration),n=je.sortMap(t.peerRequirementNodes,[([,c])=>q.stringifyLocator(c.subject),([,c])=>q.stringifyIdent(c.ident)]);for(let[,c]of n.values()){if(!c.root)continue;let f=t.peerWarnings.find(E=>E.hash===c.hash),p=[...q.allPeerRequests(c)],h;if(p.length>2?h=` and ${p.length-1} other dependencies`:p.length===2?h=" and 1 other dependency":h="",c.provided.range!=="missing:"){let E=t.storedResolutions.get(c.provided.descriptorHash);if(!E)throw new Error("Assertion failed: Expected the resolution to have been registered");let C=t.storedPackages.get(E);if(!C)throw new Error("Assertion failed: Expected the provided package to have been registered");let S=`${he.pretty(t.configuration,c.hash,he.Type.CODE)} \u2192 ${f?a.Cross:a.Check} ${q.prettyLocator(t.configuration,c.subject)} provides ${q.prettyLocator(t.configuration,C)} to ${q.prettyLocator(t.configuration,p[0].requester)}${h}`;f?s.reportWarning(0,S):s.reportInfo(0,S)}else{let E=`${he.pretty(t.configuration,c.hash,he.Type.CODE)} \u2192 ${f?a.Cross:a.Check} ${q.prettyLocator(t.configuration,c.subject)} doesn't provide ${q.prettyIdent(t.configuration,c.ident)} to ${q.prettyLocator(t.configuration,p[0].requester)}${h}`;f?
${e}`)})}let f=t.projectCwd??t.startingCwd,p=K.resolve(f,".yarn/releases"),h=K.resolve(p,`yarn-${e}.cjs`),E=K.relative(t.startingCwd,h),C=je.isTaggedYarnVersion(e),S=t.get("yarnPath"),P=!C,I=P||!!S||!!a;if(a===!1){if(P)throw new Yt(0,"You explicitly opted out of yarnPath usage in your command line, but the version you specified cannot be represented by Corepack");I=!1}else!I&&!process.env.COREPACK_ROOT&&(s.reportWarning(0,`You don't seem to have ${he.applyHyperlink(t,"Corepack","https://nodejs.org/api/corepack.html")} enabled; we'll have to rely on ${he.applyHyperlink(t,"yarnPath","https://yarnpkg.com/configuration/yarnrc#yarnPath")} instead`),I=!0);if(I){let te=await c();s.reportInfo(0,`Saving the new release in ${he.pretty(t,E,"magenta")}`),await le.removePromise(K.dirname(h)),await le.mkdirPromise(K.dirname(h),{recursive:!0}),await le.writeFilePromise(h,te,{mode:493}),await ze.updateConfiguration(f,{yarnPath:K.relative(f,h)})}else await le.removePromise(K.dirname(h)),await ze.updateConfiguration(f,{yarnPath:ze.deleteProperty});let R=await Ht.tryFind(f)||new Ht;R.packageManager=`yarn@${C?e:await hS(t,"stable")}`;let N={};R.exportTo(N);let U=K.join(f,Ht.fileName),W=`${JSON.stringify(N,null,R.indent)}
2025-04-10 09:51:25 -04:00
`;return await le.changeFilePromise(U,W,{automaticNewlines:!0}),{bundleVersion:e}}function aBe(t){return Dr[rk(t)]}var aSt=/## (?<code>YN[0-9]{4}) - `(?<name>[A-Z_]+)`\n\n(?<details>(?:.(?!##))+)/gs;async function lSt(t){let r=`https://repo.yarnpkg.com/${je.isTaggedYarnVersion(un)?un:await hS(t,"canary")}/packages/docusaurus/docs/advanced/01-general-reference/error-codes.mdx`,s=await An.get(r,{configuration:t});return new Map(Array.from(s.toString().matchAll(aSt),({groups:a})=>{if(!a)throw new Error("Assertion failed: Expected the match to have been successful");let n=aBe(a.code);if(a.name!==n)throw new Error(`Assertion failed: Invalid error code data: Expected "${a.name}" to be named "${n}"`);return[a.code,a.details]}))}var wC=class extends ut{constructor(){super(...arguments);this.code=ge.String({required:!1,validator:rB(wE(),[tB(/^YN[0-9]{4}$/)])});this.json=ge.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["explain"]]}static{this.usage=ot.Usage({description:"explain an error code",details:`
When the code argument is specified, this command prints its name and its details.
When used without arguments, this command lists all error codes and their names.
`,examples:[["Explain an error code","$0 explain YN0006"],["List all error codes","$0 explain"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins);if(typeof this.code<"u"){let s=aBe(this.code),a=he.pretty(r,s,he.Type.CODE),n=this.cli.format().header(`${this.code} - ${a}`),f=(await lSt(r)).get(this.code),p=typeof f<"u"?he.jsonOrPretty(this.json,r,he.tuple(he.Type.MARKDOWN,{text:f,format:this.cli.format(),paragraphs:!0})):`This error code does not have a description.
You can help us by editing this page on GitHub \u{1F642}:
${he.jsonOrPretty(this.json,r,he.tuple(he.Type.URL,"https://github.com/yarnpkg/berry/blob/master/packages/docusaurus/docs/advanced/01-general-reference/error-codes.mdx"))}
`;this.json?this.context.stdout.write(`${JSON.stringify({code:this.code,name:s,details:p})}
`):this.context.stdout.write(`${n}
${p}
2025-04-11 10:05:45 -04:00
`)}else{let s={children:je.mapAndFilter(Object.entries(Dr),([a,n])=>Number.isNaN(Number(a))?je.mapAndFilter.skip:{label:Vf(Number(a)),value:he.tuple(he.Type.CODE,n)})};ks.emitTree(s,{configuration:r,stdout:this.context.stdout,json:this.json})}}};Ve();bt();Wt();var lBe=et(Sa()),BC=class extends ut{constructor(){super(...arguments);this.all=ge.Boolean("-A,--all",!1,{description:"Print versions of a package from the whole project"});this.recursive=ge.Boolean("-R,--recursive",!1,{description:"Print information for all packages, including transitive dependencies"});this.extra=ge.Array("-X,--extra",[],{description:"An array of requests of extra data provided by plugins"});this.cache=ge.Boolean("--cache",!1,{description:"Print information about the cache entry of a package (path, size, checksum)"});this.dependents=ge.Boolean("--dependents",!1,{description:"Print all dependents for each matching package"});this.manifest=ge.Boolean("--manifest",!1,{description:"Print data obtained by looking at the package archive (license, homepage, ...)"});this.nameOnly=ge.Boolean("--name-only",!1,{description:"Only print the name for the matching packages"});this.virtuals=ge.Boolean("--virtuals",!1,{description:"Print each instance of the virtual packages"});this.json=ge.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.patterns=ge.Rest()}static{this.paths=[["info"]]}static{this.usage=ot.Usage({description:"see information related to packages",details:"\n This command prints various information related to the specified packages, accepting glob patterns.\n\n By default, if the locator reference is missing, Yarn will default to print the information about all the matching direct dependencies of the package for the active workspace. To instead print all versions of the package that are direct dependencies of any of your workspaces, use the `-A,--all` flag. Adding the `-R,--recursive` flag will also report transitive dependencies.\n\n Some fields will be hidden by default in order to keep the output readable, but can be selectively displayed by using additional options (`--dependents`, `--manifest`, `--virtuals`, ...) described in the option descriptions.\n\n Note that this command will only print the information directly related to the selected packages - if you wish to know why the package is there in the first place, use `yarn why` which will do just that (it also provides a `-R,--recursive` flag that may be of some help).\n ",examples:[["Show information about Lodash","$0 info lodash"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd),n=await Jr.find(r);if(!a&&!this.all)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState();let c=new Set(this.extra);this.cache&&c.add("cache"),this.dependents&&c.add("dependents"),this.manifest&&c.add("manifest");let f=(ie,{recursive:Ae})=>{let ce=ie.anchoredLocator.locatorHash,me=new Map,pe=[ce];for(;pe.length>0;){let Be=pe.shift();if(me.has(Be))continue;let Ce=s.storedPackages.get(Be);if(typeof Ce>"u")throw new Error("Assertion failed: Expected the package to be registered");if(me.set(Be,Ce),q.isVirtualLocator(Ce)&&pe.push(q.devirtualizeLocator(Ce).locatorHash),!(!Ae&&Be!==ce))for(let g of Ce.dependencies.values()){let we=s.storedResolutions.get(g.descriptorHash);if(typeof we>"u")throw new Error("Assertion failed: Expected the resolution to be registered");pe.push(we)}}return me.values()},p=({recursive:ie})=>{let Ae=new Map;for(let ce of s.workspaces)for(let me of f(ce,{recursive:ie}))Ae.set(me.locatorHash,me);return Ae.values()},h=({all:ie,recursive:Ae})=>ie&&Ae?s.storedPackages.values():ie?p({recursive:Ae}):f(a,{recursive:Ae}),E=({all:ie,recursive:Ae})=>{let ce=h({all:ie,recursive:Ae}),me=this.patterns.map(Ce=>{let g=q.parseLocator(Ce),we=lBe.default.makeRe(q.stringifyIdent(g)),Ee=q.isVirtualLocator(g),fe=Ee?q.devirtualizeLocator(g):g;return se=>{let X=q.stringifyIdent(se);if(!we.test(X))return!1;if(g.reference==="unknown")return!0;let De=q.isVirtualLocator(s
2025-04-10 09:51:25 -04:00
This command simply runs Node. It also makes sure to call it in a way that's compatible with the current project (for example, on PnP projects the environment will be setup in such a way that PnP will be correctly injected into the environment).
The Node process will use the exact same version of Node as the one used to run Yarn itself, which might be a good way to ensure that your commands always use a consistent Node version.
`,examples:[["Run a Node script","$0 node ./my-script.js"]]})}async execute(){return this.cli.run(["exec","node",...this.args])}};Ve();Wt();var bC=class extends ut{constructor(){super(...arguments);this.json=ge.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["plugin","check"]]}static{this.usage=ot.Usage({category:"Plugin-related commands",description:"find all third-party plugins that differ from their own spec",details:`
Check only the plugins from https.
If this command detects any plugin differences in the CI environment, it will throw an error.
2025-04-11 10:05:45 -04:00
`,examples:[["find all third-party plugins that differ from their own spec","$0 plugin check"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),s=await ze.findRcFiles(this.context.cwd);return(await Ot.start({configuration:r,json:this.json,stdout:this.context.stdout},async n=>{for(let c of s)if(c.data?.plugins)for(let f of c.data.plugins){if(!f.checksum||!f.spec.match(/^https?:/))continue;let p=await An.get(f.spec,{configuration:r}),h=Nn.makeHash(p);if(f.checksum===h)continue;let E=he.pretty(r,f.path,he.Type.PATH),C=he.pretty(r,f.spec,he.Type.URL),S=`${E} is different from the file provided by ${C}`;n.reportJson({...f,newChecksum:h}),n.reportError(0,S)}})).exitCode()}};Ve();Ve();bt();Wt();var pBe=ye("os");Ve();bt();Wt();var cBe=ye("os");Ve();Bc();Wt();var pSt="https://raw.githubusercontent.com/yarnpkg/berry/master/plugins.yml";async function Dm(t,e){let r=await An.get(pSt,{configuration:t}),s=ls(r.toString());return Object.fromEntries(Object.entries(s).filter(([a,n])=>!e||Or.satisfiesWithPrereleases(e,n.range??"<4.0.0-rc.1")))}var PC=class extends ut{constructor(){super(...arguments);this.json=ge.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["plugin","list"]]}static{this.usage=ot.Usage({category:"Plugin-related commands",description:"list the available official plugins",details:"\n This command prints the plugins available directly from the Yarn repository. Only those plugins can be referenced by name in `yarn plugin import`.\n ",examples:[["List the official plugins","$0 plugin list"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins);return(await Ot.start({configuration:r,json:this.json,stdout:this.context.stdout},async a=>{let n=await Dm(r,un);for(let[c,{experimental:f,...p}]of Object.entries(n)){let h=c;f&&(h+=" [experimental]"),a.reportJson({name:c,experimental:f,...p}),a.reportInfo(null,h)}})).exitCode()}};var hSt=/^[0-9]+$/,gSt=process.platform==="win32";function uBe(t){return hSt.test(t)?`pull/${t}/head`:t}var dSt=({repository:t,branch:e},r)=>[["git","init",ue.fromPortablePath(r)],["git","remote","add","origin",t],["git","fetch","origin","--depth=1",uBe(e)],["git","reset","--hard","FETCH_HEAD"]],mSt=({branch:t})=>[["git","fetch","origin","--depth=1",uBe(t),"--force"],["git","reset","--hard","FETCH_HEAD"],["git","clean","-dfx","-e","packages/yarnpkg-cli/bundles"]],ySt=({plugins:t,noMinify:e},r,s)=>[["yarn","build:cli",...new Array().concat(...t.map(a=>["--plugin",K.resolve(s,a)])),...e?["--no-minify"]:[],"|"],[gSt?"move":"mv","packages/yarnpkg-cli/bundles/yarn.js",ue.fromPortablePath(r),"|"]],xC=class extends ut{constructor(){super(...arguments);this.installPath=ge.String("--path",{description:"The path where the repository should be cloned to"});this.repository=ge.String("--repository","https://github.com/yarnpkg/berry.git",{description:"The repository that should be cloned"});this.branch=ge.String("--branch","master",{description:"The branch of the repository that should be cloned"});this.plugins=ge.Array("--plugin",[],{description:"An array of additional plugins that should be included in the bundle"});this.dryRun=ge.Boolean("-n,--dry-run",!1,{description:"If set, the bundle will be built but not added to the project"});this.noMinify=ge.Boolean("--no-minify",!1,{description:"Build a bundle for development (debugging) - non-minified and non-mangled"});this.force=ge.Boolean("-f,--force",!1,{description:"Always clone the repository instead of trying to fetch the latest commits"});this.skipPlugins=ge.Boolean("--skip-plugins",!1,{description:"Skip updating the contrib plugins"})}static{this.paths=[["set","version","from","sources"]]}static{this.usage=ot.Usage({description:"build Yarn from master",details:`
2025-04-10 09:51:25 -04:00
This command will clone the Yarn repository into a temporary folder, then build it. The resulting bundle will then be copied into the local project.
By default, it also updates all contrib plugins to the same commit the bundle is built from. This behavior can be disabled by using the \`--skip-plugins\` flag.
2025-04-11 10:05:45 -04:00
`,examples:[["Build Yarn from master","$0 set version from sources"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s}=await Tt.find(r,this.context.cwd),a=typeof this.installPath<"u"?K.resolve(this.context.cwd,ue.toPortablePath(this.installPath)):K.resolve(ue.toPortablePath((0,cBe.tmpdir)()),"yarnpkg-sources",Nn.makeHash(this.repository).slice(0,6));return(await Ot.start({configuration:r,stdout:this.context.stdout},async c=>{await M5(this,{configuration:r,report:c,target:a}),c.reportSeparator(),c.reportInfo(0,"Building a fresh bundle"),c.reportSeparator();let f=await Gr.execvp("git",["rev-parse","--short","HEAD"],{cwd:a,strict:!0}),p=K.join(a,`packages/yarnpkg-cli/bundles/yarn-${f.stdout.trim()}.js`);le.existsSync(p)||(await gS(ySt(this,p,a),{configuration:r,context:this.context,target:a}),c.reportSeparator());let h=await le.readFilePromise(p);if(!this.dryRun){let{bundleVersion:E}=await O5(r,null,async()=>h,{report:c});this.skipPlugins||await ESt(this,E,{project:s,report:c,target:a})}})).exitCode()}};async function gS(t,{configuration:e,context:r,target:s}){for(let[a,...n]of t){let c=n[n.length-1]==="|";if(c&&n.pop(),c)await Gr.pipevp(a,n,{cwd:s,stdin:r.stdin,stdout:r.stdout,stderr:r.stderr,strict:!0});else{r.stdout.write(`${he.pretty(e,` $ ${[a,...n].join(" ")}`,"grey")}
`);try{await Gr.execvp(a,n,{cwd:s,strict:!0})}catch(f){throw r.stdout.write(f.stdout||f.stack),f}}}}async function M5(t,{configuration:e,report:r,target:s}){let a=!1;if(!t.force&&le.existsSync(K.join(s,".git"))){r.reportInfo(0,"Fetching the latest commits"),r.reportSeparator();try{await gS(mSt(t),{configuration:e,context:t.context,target:s}),a=!0}catch{r.reportSeparator(),r.reportWarning(0,"Repository update failed; we'll try to regenerate it")}}a||(r.reportInfo(0,"Cloning the remote repository"),r.reportSeparator(),await le.removePromise(s),await le.mkdirPromise(s,{recursive:!0}),await gS(dSt(t,s),{configuration:e,context:t.context,target:s}))}async function ESt(t,e,{project:r,report:s,target:a}){let n=await Dm(r.configuration,e),c=new Set(Object.keys(n));for(let f of r.configuration.plugins.keys())c.has(f)&&await _5(f,t,{project:r,report:s,target:a})}Ve();Ve();bt();Wt();var fBe=et(fi()),ABe=ye("vm");var kC=class extends ut{constructor(){super(...arguments);this.name=ge.String();this.checksum=ge.Boolean("--checksum",!0,{description:"Whether to care if this plugin is modified"})}static{this.paths=[["plugin","import"]]}static{this.usage=ot.Usage({category:"Plugin-related commands",description:"download a plugin",details:`
2025-04-10 09:51:25 -04:00
This command downloads the specified plugin from its remote location and updates the configuration to reference it in further CLI invocations.
Three types of plugin references are accepted:
- If the plugin is stored within the Yarn repository, it can be referenced by name.
- Third-party plugins can be referenced directly through their public urls.
- Local plugins can be referenced by their path on the disk.
If the \`--no-checksum\` option is set, Yarn will no longer care if the plugin is modified.
Plugins cannot be downloaded from the npm registry, and aren't allowed to have dependencies (they need to be bundled into a single file, possibly thanks to the \`@yarnpkg/builder\` package).
2025-04-11 10:05:45 -04:00
`,examples:[['Download and activate the "@yarnpkg/plugin-exec" plugin',"$0 plugin import @yarnpkg/plugin-exec"],['Download and activate the "@yarnpkg/plugin-exec" plugin (shorthand)',"$0 plugin import exec"],["Download and activate a community plugin","$0 plugin import https://example.org/path/to/plugin.js"],["Activate a local plugin","$0 plugin import ./path/to/plugin.js"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins);return(await Ot.start({configuration:r,stdout:this.context.stdout},async a=>{let{project:n}=await Tt.find(r,this.context.cwd),c,f;if(this.name.match(/^\.{0,2}[\\/]/)||ue.isAbsolute(this.name)){let p=K.resolve(this.context.cwd,ue.toPortablePath(this.name));a.reportInfo(0,`Reading ${he.pretty(r,p,he.Type.PATH)}`),c=K.relative(n.cwd,p),f=await le.readFilePromise(p)}else{let p;if(this.name.match(/^https?:/)){try{new URL(this.name)}catch{throw new Yt(52,`Plugin specifier "${this.name}" is neither a plugin name nor a valid url`)}c=this.name,p=this.name}else{let h=q.parseLocator(this.name.replace(/^((@yarnpkg\/)?plugin-)?/,"@yarnpkg/plugin-"));if(h.reference!=="unknown"&&!fBe.default.valid(h.reference))throw new Yt(0,"Official plugins only accept strict version references. Use an explicit URL if you wish to download them from another location.");let E=q.stringifyIdent(h),C=await Dm(r,un);if(!Object.hasOwn(C,E)){let S=`Couldn't find a plugin named ${q.prettyIdent(r,h)} on the remote registry.
`;throw r.plugins.has(E)?S+=`A plugin named ${q.prettyIdent(r,h)} is already installed; possibly attempting to import a built-in plugin.`:S+=`Note that only the plugins referenced on our website (${he.pretty(r,"https://github.com/yarnpkg/berry/blob/master/plugins.yml",he.Type.URL)}) can be referenced by their name; any other plugin will have to be referenced through its public url (for example ${he.pretty(r,"https://github.com/yarnpkg/berry/raw/master/packages/plugin-typescript/bin/%40yarnpkg/plugin-typescript.js",he.Type.URL)}).`,new Yt(51,S)}c=E,p=C[E].url,h.reference!=="unknown"?p=p.replace(/\/master\//,`/${E}/${h.reference}/`):un!==null&&(p=p.replace(/\/master\//,`/@yarnpkg/cli/${un}/`))}a.reportInfo(0,`Downloading ${he.pretty(r,p,"green")}`),f=await An.get(p,{configuration:r})}await U5(c,f,{checksum:this.checksum,project:n,report:a})})).exitCode()}};async function U5(t,e,{checksum:r=!0,project:s,report:a}){let{configuration:n}=s,c={},f={exports:c};(0,ABe.runInNewContext)(e.toString(),{module:f,exports:c});let h=`.yarn/plugins/${f.exports.name}.cjs`,E=K.resolve(s.cwd,h);a.reportInfo(0,`Saving the new plugin in ${he.pretty(n,h,"magenta")}`),await le.mkdirPromise(K.dirname(E),{recursive:!0}),await le.writeFilePromise(E,e);let C={path:h,spec:t};r&&(C.checksum=Nn.makeHash(e)),await ze.addPlugin(s.cwd,[C])}var ISt=({pluginName:t,noMinify:e},r)=>[["yarn",`build:${t}`,...e?["--no-minify"]:[],"|"]],QC=class extends ut{constructor(){super(...arguments);this.installPath=ge.String("--path",{description:"The path where the repository should be cloned to"});this.repository=ge.String("--repository","https://github.com/yarnpkg/berry.git",{description:"The repository that should be cloned"});this.branch=ge.String("--branch","master",{description:"The branch of the repository that should be cloned"});this.noMinify=ge.Boolean("--no-minify",!1,{description:"Build a plugin for development (debugging) - non-minified and non-mangled"});this.force=ge.Boolean("-f,--force",!1,{description:"Always clone the repository instead of trying to fetch the latest commits"});this.name=ge.String()}static{this.paths=[["plugin","import","from","sources"]]}static{this.usage=ot.Usage({category:"Plugin-related commands",description:"build a plugin from sources",details:`
2025-04-10 09:51:25 -04:00
This command clones the Yarn repository into a temporary folder, builds the specified contrib plugin and updates the configuration to reference it in further CLI invocations.
The plugins can be referenced by their short name if sourced from the official Yarn repository.
2025-04-11 10:05:45 -04:00
`,examples:[['Build and activate the "@yarnpkg/plugin-exec" plugin',"$0 plugin import from sources @yarnpkg/plugin-exec"],['Build and activate the "@yarnpkg/plugin-exec" plugin (shorthand)',"$0 plugin import from sources exec"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),s=typeof this.installPath<"u"?K.resolve(this.context.cwd,ue.toPortablePath(this.installPath)):K.resolve(ue.toPortablePath((0,pBe.tmpdir)()),"yarnpkg-sources",Nn.makeHash(this.repository).slice(0,6));return(await Ot.start({configuration:r,stdout:this.context.stdout},async n=>{let{project:c}=await Tt.find(r,this.context.cwd),f=q.parseIdent(this.name.replace(/^((@yarnpkg\/)?plugin-)?/,"@yarnpkg/plugin-")),p=q.stringifyIdent(f),h=await Dm(r,un);if(!Object.hasOwn(h,p))throw new Yt(51,`Couldn't find a plugin named "${p}" on the remote registry. Note that only the plugins referenced on our website (https://github.com/yarnpkg/berry/blob/master/plugins.yml) can be built and imported from sources.`);let E=p;await M5(this,{configuration:r,report:n,target:s}),await _5(E,this,{project:c,report:n,target:s})})).exitCode()}};async function _5(t,{context:e,noMinify:r},{project:s,report:a,target:n}){let c=t.replace(/@yarnpkg\//,""),{configuration:f}=s;a.reportSeparator(),a.reportInfo(0,`Building a fresh ${c}`),a.reportSeparator(),await gS(ISt({pluginName:c,noMinify:r},n),{configuration:f,context:e,target:n}),a.reportSeparator();let p=K.resolve(n,`packages/${c}/bundles/${t}.js`),h=await le.readFilePromise(p);await U5(t,h,{project:s,report:a})}Ve();bt();Wt();var TC=class extends ut{constructor(){super(...arguments);this.name=ge.String()}static{this.paths=[["plugin","remove"]]}static{this.usage=ot.Usage({category:"Plugin-related commands",description:"remove a plugin",details:`
2025-04-10 09:51:25 -04:00
This command deletes the specified plugin from the .yarn/plugins folder and removes it from the configuration.
**Note:** The plugins have to be referenced by their name property, which can be obtained using the \`yarn plugin runtime\` command. Shorthands are not allowed.
2025-04-11 10:05:45 -04:00
`,examples:[["Remove a plugin imported from the Yarn repository","$0 plugin remove @yarnpkg/plugin-typescript"],["Remove a plugin imported from a local file","$0 plugin remove my-local-plugin"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s}=await Tt.find(r,this.context.cwd);return(await Ot.start({configuration:r,stdout:this.context.stdout},async n=>{let c=this.name,f=q.parseIdent(c);if(!r.plugins.has(c))throw new nt(`${q.prettyIdent(r,f)} isn't referenced by the current configuration`);let p=`.yarn/plugins/${c}.cjs`,h=K.resolve(s.cwd,p);le.existsSync(h)&&(n.reportInfo(0,`Removing ${he.pretty(r,p,he.Type.PATH)}...`),await le.removePromise(h)),n.reportInfo(0,"Updating the configuration..."),await ze.updateConfiguration(s.cwd,{plugins:E=>{if(!Array.isArray(E))return E;let C=E.filter(S=>S.path!==p);return C.length===0?ze.deleteProperty:C.length===E.length?E:C}})})).exitCode()}};Ve();Wt();var RC=class extends ut{constructor(){super(...arguments);this.json=ge.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["plugin","runtime"]]}static{this.usage=ot.Usage({category:"Plugin-related commands",description:"list the active plugins",details:`
2025-04-10 09:51:25 -04:00
This command prints the currently active plugins. Will be displayed both builtin plugins and external plugins.
`,examples:[["List the currently active plugins","$0 plugin runtime"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins);return(await Ot.start({configuration:r,json:this.json,stdout:this.context.stdout},async a=>{for(let n of r.plugins.keys()){let c=this.context.plugins.plugins.has(n),f=n;c&&(f+=" [builtin]"),a.reportJson({name:n,builtin:c}),a.reportInfo(null,`${f}`)}})).exitCode()}};Ve();Ve();Wt();var FC=class extends ut{constructor(){super(...arguments);this.idents=ge.Rest()}static{this.paths=[["rebuild"]]}static{this.usage=ot.Usage({description:"rebuild the project's native packages",details:`
This command will automatically cause Yarn to forget about previous compilations of the given packages and to run them again.
Note that while Yarn forgets the compilation, the previous artifacts aren't erased from the filesystem and may affect the next builds (in good or bad). To avoid this, you may remove the .yarn/unplugged folder, or any other relevant location where packages might have been stored (Yarn may offer a way to do that automatically in the future).
By default all packages will be rebuilt, but you can filter the list by specifying the names of the packages you want to clear from memory.
2025-04-11 10:05:45 -04:00
`,examples:[["Rebuild all packages","$0 rebuild"],["Rebuild fsevents only","$0 rebuild fsevents"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd),n=await Jr.find(r);if(!a)throw new ar(s.cwd,this.context.cwd);let c=new Set;for(let f of this.idents)c.add(q.parseIdent(f).identHash);if(await s.restoreInstallState({restoreResolutions:!1}),await s.resolveEverything({cache:n,report:new Wi}),c.size>0)for(let f of s.storedPackages.values())c.has(f.identHash)&&(s.storedBuildState.delete(f.locatorHash),s.skippedBuilds.delete(f.locatorHash));else s.storedBuildState.clear(),s.skippedBuilds.clear();return await s.installWithNewReport({stdout:this.context.stdout,quiet:this.context.quiet},{cache:n})}};Ve();Ve();Ve();Wt();var H5=et(Sa());Ul();var NC=class extends ut{constructor(){super(...arguments);this.all=ge.Boolean("-A,--all",!1,{description:"Apply the operation to all workspaces from the current project"});this.mode=ge.String("--mode",{description:"Change what artifacts installs generate",validator:Ao(ec)});this.patterns=ge.Rest()}static{this.paths=[["remove"]]}static{this.usage=ot.Usage({description:"remove dependencies from the project",details:`
2025-04-10 09:51:25 -04:00
This command will remove the packages matching the specified patterns from the current workspace.
If the \`--mode=<mode>\` option is set, Yarn will change which artifacts are generated. The modes currently supported are:
- \`skip-build\` will not run the build scripts at all. Note that this is different from setting \`enableScripts\` to false because the latter will disable build scripts, and thus affect the content of the artifacts generated on disk, whereas the former will just disable the build step - but not the scripts themselves, which just won't run.
- \`update-lockfile\` will skip the link step altogether, and only fetch packages that are missing from the lockfile (or that have no associated checksums). This mode is typically used by tools like Renovate or Dependabot to keep a lockfile up-to-date without incurring the full install cost.
This command accepts glob patterns as arguments (if valid Idents and supported by [micromatch](https://github.com/micromatch/micromatch)). Make sure to escape the patterns, to prevent your own shell from trying to expand them.
2025-04-11 10:05:45 -04:00
`,examples:[["Remove a dependency from the current project","$0 remove lodash"],["Remove a dependency from all workspaces at once","$0 remove lodash --all"],["Remove all dependencies starting with `eslint-`","$0 remove 'eslint-*'"],["Remove all dependencies with the `@babel` scope","$0 remove '@babel/*'"],["Remove all dependencies matching `react-dom` or `react-helmet`","$0 remove 'react-{dom,helmet}'"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd),n=await Jr.find(r);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState({restoreResolutions:!1});let c=this.all?s.workspaces:[a],f=["dependencies","devDependencies","peerDependencies"],p=[],h=!1,E=[];for(let I of this.patterns){let R=!1,N=q.parseIdent(I);for(let U of c){let W=[...U.manifest.peerDependenciesMeta.keys()];for(let te of(0,H5.default)(W,I))U.manifest.peerDependenciesMeta.delete(te),h=!0,R=!0;for(let te of f){let ie=U.manifest.getForScope(te),Ae=[...ie.values()].map(ce=>q.stringifyIdent(ce));for(let ce of(0,H5.default)(Ae,q.stringifyIdent(N))){let{identHash:me}=q.parseIdent(ce),pe=ie.get(me);if(typeof pe>"u")throw new Error("Assertion failed: Expected the descriptor to be registered");U.manifest[te].delete(me),E.push([U,te,pe]),h=!0,R=!0}}}R||p.push(I)}let C=p.length>1?"Patterns":"Pattern",S=p.length>1?"don't":"doesn't",P=this.all?"any":"this";if(p.length>0)throw new nt(`${C} ${he.prettyList(r,p,he.Type.CODE)} ${S} match any packages referenced by ${P} workspace`);return h?(await r.triggerMultipleHooks(I=>I.afterWorkspaceDependencyRemoval,E),await s.installWithNewReport({stdout:this.context.stdout},{cache:n,mode:this.mode})):0}};Ve();Ve();Wt();var hBe=ye("util"),OC=class extends ut{constructor(){super(...arguments);this.json=ge.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["run"]]}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);return(await Ot.start({configuration:r,stdout:this.context.stdout,json:this.json},async c=>{let f=a.manifest.scripts,p=je.sortMap(f.keys(),C=>C),h={breakLength:1/0,colors:r.get("enableColors"),maxArrayLength:2},E=p.reduce((C,S)=>Math.max(C,S.length),0);for(let[C,S]of f.entries())c.reportInfo(null,`${C.padEnd(E," ")} ${(0,hBe.inspect)(S,h)}`),c.reportJson({name:C,script:S})})).exitCode()}};Ve();Ve();Wt();var LC=class extends ut{constructor(){super(...arguments);this.inspect=ge.String("--inspect",!1,{tolerateBoolean:!0,description:"Forwarded to the underlying Node process when executing a binary"});this.inspectBrk=ge.String("--inspect-brk",!1,{tolerateBoolean:!0,description:"Forwarded to the underlying Node process when executing a binary"});this.topLevel=ge.Boolean("-T,--top-level",!1,{description:"Check the root workspace for scripts and/or binaries instead of the current one"});this.binariesOnly=ge.Boolean("-B,--binaries-only",!1,{description:"Ignore any user defined scripts and only check for binaries"});this.require=ge.String("--require",{description:"Forwarded to the underlying Node process when executing a binary"});this.silent=ge.Boolean("--silent",{hidden:!0});this.scriptName=ge.String();this.args=ge.Proxy()}static{this.paths=[["run"]]}static{this.usage=ot.Usage({description:"run a script defined in the package.json",details:`
2025-04-10 09:51:25 -04:00
This command will run a tool. The exact tool that will be executed will depend on the current state of your workspace:
- If the \`scripts\` field from your local package.json contains a matching script name, its definition will get executed.
- Otherwise, if one of the local workspace's dependencies exposes a binary with a matching name, this binary will get executed.
- Otherwise, if the specified name contains a colon character and if one of the workspaces in the project contains exactly one script with a matching name, then this script will get executed.
Whatever happens, the cwd of the spawned process will be the workspace that declares the script (which makes it possible to call commands cross-workspaces using the third syntax).
2025-04-11 10:05:45 -04:00
`,examples:[["Run the tests from the local workspace","$0 run test"],['Same thing, but without the "run" keyword',"$0 test"],["Inspect Webpack while running","$0 run --inspect-brk webpack"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a,locator:n}=await Tt.find(r,this.context.cwd);await s.restoreInstallState();let c=this.topLevel?s.topLevelWorkspace.anchoredLocator:n;if(!this.binariesOnly&&await In.hasPackageScript(c,this.scriptName,{project:s}))return await In.executePackageScript(c,this.scriptName,this.args,{project:s,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr});let f=await In.getPackageAccessibleBinaries(c,{project:s});if(f.get(this.scriptName)){let h=[];return this.inspect&&(typeof this.inspect=="string"?h.push(`--inspect=${this.inspect}`):h.push("--inspect")),this.inspectBrk&&(typeof this.inspectBrk=="string"?h.push(`--inspect-brk=${this.inspectBrk}`):h.push("--inspect-brk")),this.require&&h.push(`--require=${this.require}`),await In.executePackageAccessibleBinary(c,this.scriptName,this.args,{cwd:this.context.cwd,project:s,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,nodeArgs:h,packageAccessibleBinaries:f})}if(!this.topLevel&&!this.binariesOnly&&a&&this.scriptName.includes(":")){let E=(await Promise.all(s.workspaces.map(async C=>C.manifest.scripts.has(this.scriptName)?C:null))).filter(C=>C!==null);if(E.length===1)return await In.executeWorkspaceScript(E[0],this.scriptName,this.args,{stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})}if(this.topLevel)throw this.scriptName==="node-gyp"?new nt(`Couldn't find a script name "${this.scriptName}" in the top-level (used by ${q.prettyLocator(r,n)}). This typically happens because some package depends on "node-gyp" to build itself, but didn't list it in their dependencies. To fix that, please run "yarn add node-gyp" into your top-level workspace. You also can open an issue on the repository of the specified package to suggest them to use an optional peer dependency.`):new nt(`Couldn't find a script name "${this.scriptName}" in the top-level (used by ${q.prettyLocator(r,n)}).`);{if(this.scriptName==="global")throw new nt("The 'yarn global' commands have been removed in 2.x - consider using 'yarn dlx' or a third-party plugin instead");let h=[this.scriptName].concat(this.args);for(let[E,C]of tC)for(let S of C)if(h.length>=S.length&&JSON.stringify(h.slice(0,S.length))===JSON.stringify(S))throw new nt(`Couldn't find a script named "${this.scriptName}", but a matching command can be found in the ${E} plugin. You can install it with "yarn plugin import ${E}".`);throw new nt(`Couldn't find a script named "${this.scriptName}".`)}}};Ve();Ve();Wt();var MC=class extends ut{constructor(){super(...arguments);this.descriptor=ge.String();this.resolution=ge.String()}static{this.paths=[["set","resolution"]]}static{this.usage=ot.Usage({description:"enforce a package resolution",details:'\n This command updates the resolution table so that `descriptor` is resolved by `resolution`.\n\n Note that by default this command only affect the current resolution table - meaning that this "manual override" will disappear if you remove the lockfile, or if the package disappear from the table. If you wish to make the enforced resolution persist whatever happens, edit the `resolutions` field in your top-level manifest.\n\n Note that no attempt is made at validating that `resolution` is a valid resolution entry for `descriptor`.\n ',examples:[["Force all instances of lodash@npm:^1.2.3 to resolve to 1.5.0","$0 set resolution lodash@npm:^1.2.3 npm:1.5.0"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd),n=await Jr.find(r);if(await s.restoreInstallState({restoreResolutions:!1}),!a)throw new ar(s.cwd,this.context.cwd);let c=q.parseDescriptor(this.descriptor,!0),f=q.makeDescriptor(c,this.resolution);return s.storedDescriptors.set(c.descriptorHash,c),s.stor
2025-04-10 09:51:25 -04:00
This command will remove any resolutions in the project-level manifest that would have been added via a yarn link with similar arguments.
2025-04-11 10:05:45 -04:00
`,examples:[["Unregister a remote workspace in the current project","$0 unlink ~/ts-loader"],["Unregister all workspaces from a remote project in the current project","$0 unlink ~/jest --all"],["Unregister all previously linked workspaces","$0 unlink --all"],["Unregister all workspaces matching a glob","$0 unlink '@babel/*' 'pkg-{a,b}'"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd),n=await Jr.find(r);if(!a)throw new ar(s.cwd,this.context.cwd);let c=s.topLevelWorkspace,f=new Set;if(this.leadingArguments.length===0&&this.all)for(let{pattern:p,reference:h}of c.manifest.resolutions)h.startsWith("portal:")&&f.add(p.descriptor.fullName);if(this.leadingArguments.length>0)for(let p of this.leadingArguments){let h=K.resolve(this.context.cwd,ue.toPortablePath(p));if(je.isPathLike(p)){let E=await ze.find(h,this.context.plugins,{useRc:!1,strict:!1}),{project:C,workspace:S}=await Tt.find(E,h);if(!S)throw new ar(C.cwd,h);if(this.all){for(let P of C.workspaces)P.manifest.name&&f.add(q.stringifyIdent(P.anchoredLocator));if(f.size===0)throw new nt("No workspace found to be unlinked in the target project")}else{if(!S.manifest.name)throw new nt("The target workspace doesn't have a name and thus cannot be unlinked");f.add(q.stringifyIdent(S.anchoredLocator))}}else{let E=[...c.manifest.resolutions.map(({pattern:C})=>C.descriptor.fullName)];for(let C of(0,gBe.default)(E,p))f.add(C)}}return c.manifest.resolutions=c.manifest.resolutions.filter(({pattern:p})=>!f.has(p.descriptor.fullName)),await s.installWithNewReport({stdout:this.context.stdout,quiet:this.context.quiet},{cache:n})}};Ve();Ve();Ve();Wt();var dBe=et(lS()),j5=et(Sa());Ul();var UC=class extends ut{constructor(){super(...arguments);this.interactive=ge.Boolean("-i,--interactive",{description:"Offer various choices, depending on the detected upgrade paths"});this.fixed=ge.Boolean("-F,--fixed",!1,{description:"Store dependency tags as-is instead of resolving them"});this.exact=ge.Boolean("-E,--exact",!1,{description:"Don't use any semver modifier on the resolved range"});this.tilde=ge.Boolean("-T,--tilde",!1,{description:"Use the `~` semver modifier on the resolved range"});this.caret=ge.Boolean("-C,--caret",!1,{description:"Use the `^` semver modifier on the resolved range"});this.recursive=ge.Boolean("-R,--recursive",!1,{description:"Resolve again ALL resolutions for those packages"});this.mode=ge.String("--mode",{description:"Change what artifacts installs generate",validator:Ao(ec)});this.patterns=ge.Rest()}static{this.paths=[["up"]]}static{this.usage=ot.Usage({description:"upgrade dependencies across the project",details:"\n This command upgrades the packages matching the list of specified patterns to their latest available version across the whole project (regardless of whether they're part of `dependencies` or `devDependencies` - `peerDependencies` won't be affected). This is a project-wide command: all workspaces will be upgraded in the process.\n\n If `-R,--recursive` is set the command will change behavior and no other switch will be allowed. When operating under this mode `yarn up` will force all ranges matching the selected packages to be resolved again (often to the highest available versions) before being stored in the lockfile. It however won't touch your manifests anymore, so depending on your needs you might want to run both `yarn up` and `yarn up -R` to cover all bases.\n\n If `-i,--interactive` is set (or if the `preferInteractive` settings is toggled on) the command will offer various choices, depending on the detected upgrade paths. Some upgrades require this flag in order to resolve ambiguities.\n\n The, `-C,--caret`, `-E,--exact` and `-T,--tilde` options have the same meaning as in the `add` command (they change the modifier used when the range is missing or a tag, and are ignored when the range is explicitly set).\n\n If the `--mode=<mode>` option is set, Yarn will change which artifacts are generated. The modes currently supported are:\n\n
2025-04-10 09:51:25 -04:00
${ce}`):N.reportError(27,`${q.prettyDescriptor(r,U)} can't be resolved to a satisfying range (note: network resolution has been disabled)
${ce}`)}else ie.length>1&&!f&&N.reportError(27,`${q.prettyDescriptor(r,U)} has multiple possible upgrade strategies; use -i to disambiguate manually`)}});if(P.hasErrors())return P.exitCode();let I=!1,R=[];for(let[N,U,,{suggestions:W}]of S){let te,ie=W.filter(pe=>pe.descriptor!==null),Ae=ie[0].descriptor,ce=ie.every(pe=>q.areDescriptorsEqual(pe.descriptor,Ae));ie.length===1||ce?te=Ae:(I=!0,{answer:te}=await(0,dBe.prompt)({type:"select",name:"answer",message:`Which range do you want to use in ${q.prettyWorkspace(r,N)} \u276F ${U}?`,choices:W.map(({descriptor:pe,name:Be,reason:Ce})=>pe?{name:Be,hint:Ce,descriptor:pe}:{name:Be,hint:Ce,disabled:!0}),onCancel:()=>process.exit(130),result(pe){return this.find(pe,"descriptor")},stdin:this.context.stdin,stdout:this.context.stdout}));let me=N.manifest[U].get(te.identHash);if(typeof me>"u")throw new Error("Assertion failed: This descriptor should have a matching entry");if(me.descriptorHash!==te.descriptorHash)N.manifest[U].set(te.identHash,te),R.push([N,U,me,te]);else{let pe=r.makeResolver(),Be={project:s,resolver:pe},Ce=r.normalizeDependency(me),g=pe.bindDescriptor(Ce,N.anchoredLocator,Be);s.forgetResolution(g)}}return await r.triggerMultipleHooks(N=>N.afterWorkspaceDependencyReplacement,R),I&&this.context.stdout.write(`
`),await s.installWithNewReport({stdout:this.context.stdout},{cache:n,mode:this.mode})}};Ve();Ve();Ve();Wt();var HC=class extends ut{constructor(){super(...arguments);this.recursive=ge.Boolean("-R,--recursive",!1,{description:"List, for each workspace, what are all the paths that lead to the dependency"});this.json=ge.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.peers=ge.Boolean("--peers",!1,{description:"Also print the peer dependencies that match the specified name"});this.package=ge.String()}static{this.paths=[["why"]]}static{this.usage=ot.Usage({description:"display the reason why a package is needed",details:`
This command prints the exact reasons why a package appears in the dependency tree.
If \`-R,--recursive\` is set, the listing will go in depth and will list, for each workspaces, what are all the paths that lead to the dependency. Note that the display is somewhat optimized in that it will not print the package listing twice for a single package, so if you see a leaf named "Foo" when looking for "Bar", it means that "Foo" already got printed higher in the tree.
2025-04-11 10:05:45 -04:00
`,examples:[["Explain why lodash is used in your project","$0 why lodash"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState();let n=q.parseIdent(this.package).identHash,c=this.recursive?wSt(s,n,{configuration:r,peers:this.peers}):CSt(s,n,{configuration:r,peers:this.peers});ks.emitTree(c,{configuration:r,stdout:this.context.stdout,json:this.json,separators:1})}};function CSt(t,e,{configuration:r,peers:s}){let a=je.sortMap(t.storedPackages.values(),f=>q.stringifyLocator(f)),n={},c={children:n};for(let f of a){let p={};for(let E of f.dependencies.values()){if(!s&&f.peerDependencies.has(E.identHash))continue;let C=t.storedResolutions.get(E.descriptorHash);if(!C)throw new Error("Assertion failed: The resolution should have been registered");let S=t.storedPackages.get(C);if(!S)throw new Error("Assertion failed: The package should have been registered");if(S.identHash!==e)continue;{let I=q.stringifyLocator(f);n[I]={value:[f,he.Type.LOCATOR],children:p}}let P=q.stringifyLocator(S);p[P]={value:[{descriptor:E,locator:S},he.Type.DEPENDENT]}}}return c}function wSt(t,e,{configuration:r,peers:s}){let a=je.sortMap(t.workspaces,S=>q.stringifyLocator(S.anchoredLocator)),n=new Set,c=new Set,f=S=>{if(n.has(S.locatorHash))return c.has(S.locatorHash);if(n.add(S.locatorHash),S.identHash===e)return c.add(S.locatorHash),!0;let P=!1;S.identHash===e&&(P=!0);for(let I of S.dependencies.values()){if(!s&&S.peerDependencies.has(I.identHash))continue;let R=t.storedResolutions.get(I.descriptorHash);if(!R)throw new Error("Assertion failed: The resolution should have been registered");let N=t.storedPackages.get(R);if(!N)throw new Error("Assertion failed: The package should have been registered");f(N)&&(P=!0)}return P&&c.add(S.locatorHash),P};for(let S of a)f(S.anchoredPackage);let p=new Set,h={},E={children:h},C=(S,P,I)=>{if(!c.has(S.locatorHash))return;let R=I!==null?he.tuple(he.Type.DEPENDENT,{locator:S,descriptor:I}):he.tuple(he.Type.LOCATOR,S),N={},U={value:R,children:N},W=q.stringifyLocator(S);if(P[W]=U,!(I!==null&&t.tryWorkspaceByLocator(S))&&!p.has(S.locatorHash)){p.add(S.locatorHash);for(let te of S.dependencies.values()){if(!s&&S.peerDependencies.has(te.identHash))continue;let ie=t.storedResolutions.get(te.descriptorHash);if(!ie)throw new Error("Assertion failed: The resolution should have been registered");let Ae=t.storedPackages.get(ie);if(!Ae)throw new Error("Assertion failed: The package should have been registered");C(Ae,N,te)}}};for(let S of a)C(S.anchoredPackage,h,null);return E}Ve();var X5={};Vt(X5,{GitFetcher:()=>mS,GitResolver:()=>yS,default:()=>qSt,gitUtils:()=>Qa});Ve();bt();var Qa={};Vt(Qa,{TreeishProtocols:()=>dS,clone:()=>Z5,fetchBase:()=>MBe,fetchChangedFiles:()=>_Be,fetchChangedWorkspaces:()=>HSt,fetchRoot:()=>LBe,isGitUrl:()=>GC,lsRemote:()=>OBe,normalizeLocator:()=>USt,normalizeRepoUrl:()=>jC,resolveUrl:()=>z5,splitRepoUrl:()=>Y0,validateRepoUrl:()=>J5});Ve();bt();Wt();var RBe=et(kBe()),FBe=et(d6()),qC=et(ye("querystring")),V5=et(fi());function Y5(t,e,r){let s=t.indexOf(r);return t.lastIndexOf(e,s>-1?s:1/0)}function QBe(t){try{return new URL(t)}catch{return}}function MSt(t){let e=Y5(t,"@","#"),r=Y5(t,":","#");return r>e&&(t=`${t.slice(0,r)}/${t.slice(r+1)}`),Y5(t,":","#")===-1&&t.indexOf("//")===-1&&(t=`ssh://${t}`),t}function TBe(t){return QBe(t)||QBe(MSt(t))}function jC(t,{git:e=!1}={}){if(t=t.replace(/^git\+https:/,"https:"),t=t.replace(/^(?:github:|https:\/\/github\.com\/|git:\/\/github\.com\/)?(?!\.{1,2}\/)([a-zA-Z0-9._-]+)\/(?!\.{1,2}(?:#|$))([a-zA-Z0-9._-]+?)(?:\.git)?(#.*)?$/,"https://github.com/$1/$2.git$3"),t=t.replace(/^https:\/\/github\.com\/(?!\.{1,2}\/)([a-zA-Z0-9._-]+)\/(?!\.{1,2}(?:#|$))([a-zA-Z0-9._-]+?)\/tarball\/(.+)?$/,"https://github.com/$1/$2.git#$3"),e){let r=TBe(t);r&&(t=r.href),t=t.replace(/^git\+([^:]+):/,"$1:")}return t}function NBe(){return{...process.env,GIT_SSH_COMMAND:process.env.GIT_SSH_COMMAND||`${process.env.GIT_SSH||"ssh"} -o BatchM
2025-04-10 09:51:25 -04:00
This command will run a given sub-command on a single workspace.
`,examples:[["Add a package to a single workspace","yarn workspace components add -D react"],["Run build script on a single workspace","yarn workspace components run build"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);let n=s.workspaces,c=new Map(n.map(p=>[q.stringifyIdent(p.anchoredLocator),p])),f=c.get(this.workspaceName);if(f===void 0){let p=Array.from(c.keys()).sort();throw new nt(`Workspace '${this.workspaceName}' not found. Did you mean any of the following:
- ${p.join(`
2025-04-11 10:05:45 -04:00
- `)}?`)}return this.cli.run([this.commandName,...this.args],{cwd:f.cwd})}};var GSt={configuration:{enableImmutableInstalls:{description:"If true (the default on CI), prevents the install command from modifying the lockfile",type:"BOOLEAN",default:UBe.isCI},defaultSemverRangePrefix:{description:"The default save prefix: '^', '~' or ''",type:"STRING",values:["^","~",""],default:"^"},preferReuse:{description:"If true, `yarn add` will attempt to reuse the most common dependency range in other workspaces.",type:"BOOLEAN",default:!1}},commands:[cC,uC,fC,AC,MC,xC,CC,WC,gC,dC,mC,yC,aC,lC,pC,hC,EC,IC,wC,BC,vC,SC,_C,DC,bC,QC,kC,TC,PC,RC,FC,NC,OC,LC,UC,HC,YC]},WSt=GSt;var i9={};Vt(i9,{default:()=>VSt});Ve();var Qt={optional:!0},e9=[["@tailwindcss/aspect-ratio@<0.2.1",{peerDependencies:{tailwindcss:"^2.0.2"}}],["@tailwindcss/line-clamp@<0.2.1",{peerDependencies:{tailwindcss:"^2.0.2"}}],["@fullhuman/postcss-purgecss@3.1.3 || 3.1.3-alpha.0",{peerDependencies:{postcss:"^8.0.0"}}],["@samverschueren/stream-to-observable@<0.3.1",{peerDependenciesMeta:{rxjs:Qt,zenObservable:Qt}}],["any-observable@<0.5.1",{peerDependenciesMeta:{rxjs:Qt,zenObservable:Qt}}],["@pm2/agent@<1.0.4",{dependencies:{debug:"*"}}],["debug@<4.2.0",{peerDependenciesMeta:{"supports-color":Qt}}],["got@<11",{dependencies:{"@types/responselike":"^1.0.0","@types/keyv":"^3.1.1"}}],["cacheable-lookup@<4.1.2",{dependencies:{"@types/keyv":"^3.1.1"}}],["http-link-dataloader@*",{peerDependencies:{graphql:"^0.13.1 || ^14.0.0"}}],["typescript-language-server@*",{dependencies:{"vscode-jsonrpc":"^5.0.1","vscode-languageserver-protocol":"^3.15.0"}}],["postcss-syntax@*",{peerDependenciesMeta:{"postcss-html":Qt,"postcss-jsx":Qt,"postcss-less":Qt,"postcss-markdown":Qt,"postcss-scss":Qt}}],["jss-plugin-rule-value-function@<=10.1.1",{dependencies:{"tiny-warning":"^1.0.2"}}],["ink-select-input@<4.1.0",{peerDependencies:{react:"^16.8.2"}}],["license-webpack-plugin@<2.3.18",{peerDependenciesMeta:{webpack:Qt}}],["snowpack@>=3.3.0",{dependencies:{"node-gyp":"^7.1.0"}}],["promise-inflight@*",{peerDependenciesMeta:{bluebird:Qt}}],["reactcss@*",{peerDependencies:{react:"*"}}],["react-color@<=2.19.0",{peerDependencies:{react:"*"}}],["gatsby-plugin-i18n@*",{dependencies:{ramda:"^0.24.1"}}],["useragent@^2.0.0",{dependencies:{request:"^2.88.0",yamlparser:"0.0.x",semver:"5.5.x"}}],["@apollographql/apollo-tools@<=0.5.2",{peerDependencies:{graphql:"^14.2.1 || ^15.0.0"}}],["material-table@^2.0.0",{dependencies:{"@babel/runtime":"^7.11.2"}}],["@babel/parser@*",{dependencies:{"@babel/types":"^7.8.3"}}],["fork-ts-checker-webpack-plugin@<=6.3.4",{peerDependencies:{eslint:">= 6",typescript:">= 2.7",webpack:">= 4","vue-template-compiler":"*"},peerDependenciesMeta:{eslint:Qt,"vue-template-compiler":Qt}}],["rc-animate@<=3.1.1",{peerDependencies:{react:">=16.9.0","react-dom":">=16.9.0"}}],["react-bootstrap-table2-paginator@*",{dependencies:{classnames:"^2.2.6"}}],["react-draggable@<=4.4.3",{peerDependencies:{react:">= 16.3.0","react-dom":">= 16.3.0"}}],["apollo-upload-client@<14",{peerDependencies:{graphql:"14 - 15"}}],["react-instantsearch-core@<=6.7.0",{peerDependencies:{algoliasearch:">= 3.1 < 5"}}],["react-instantsearch-dom@<=6.7.0",{dependencies:{"react-fast-compare":"^3.0.0"}}],["ws@<7.2.1",{peerDependencies:{bufferutil:"^4.0.1","utf-8-validate":"^5.0.2"},peerDependenciesMeta:{bufferutil:Qt,"utf-8-validate":Qt}}],["react-portal@<4.2.2",{peerDependencies:{"react-dom":"^15.0.0-0 || ^16.0.0-0 || ^17.0.0-0"}}],["react-scripts@<=4.0.1",{peerDependencies:{react:"*"}}],["testcafe@<=1.10.1",{dependencies:{"@babel/plugin-transform-for-of":"^7.12.1","@babel/runtime":"^7.12.5"}}],["testcafe-legacy-api@<=4.2.0",{dependencies:{"testcafe-hammerhead":"^17.0.1","read-file-relative":"^1.2.0"}}],["@google-cloud/firestore@<=4.9.3",{dependencies:{protobufjs:"^6.8.6"}}],["gatsby-source-apiserver@*",{dependencies:{"babel-polyfill":"^6.26.0"}}],["@webpack-cli/package-utils@<=1.0.1-alpha.4",{dependencies:{"cross-spawn":"^7.0.3"}}],["gatsby-remark-prismjs@<3.3.28",{dependencies:{lodash:"^4"}}],["gatsby-plugin-favicon@*",{peerDepe
2025-04-10 09:51:25 -04:00
This command will output all matches to the given prolog query.
`,examples:[["List all dependencies throughout the workspace","yarn constraints query 'workspace_has_dependency(_, DependencyName, _, _).'"]]})}async execute(){let{Constraints:r}=await Promise.resolve().then(()=>(vS(),BS)),s=await ze.find(this.context.cwd,this.context.plugins),{project:a}=await Tt.find(s,this.context.cwd),n=await r.find(a),c=this.query;return c.endsWith(".")||(c=`${c}.`),(await Ot.start({configuration:s,json:this.json,stdout:this.context.stdout},async p=>{for await(let h of n.query(c)){let E=Array.from(Object.entries(h)),C=E.length,S=E.reduce((P,[I])=>Math.max(P,I.length),0);for(let P=0;P<C;P++){let[I,R]=E[P];p.reportInfo(null,`${yDt(P,C)}${I.padEnd(S," ")} = ${mDt(R)}`)}p.reportJson(h)}})).exitCode()}};function mDt(t){return typeof t!="string"?`${t}`:t.match(/^[a-zA-Z][a-zA-Z0-9_]+$/)?t:`'${t}'`}function yDt(t,e){let r=t===0,s=t===e-1;return r&&s?"":r?"\u250C ":s?"\u2514 ":"\u2502 "}Ve();Wt();var $C=class extends ut{constructor(){super(...arguments);this.verbose=ge.Boolean("-v,--verbose",!1,{description:"Also print the fact database automatically compiled from the workspace manifests"})}static{this.paths=[["constraints","source"]]}static{this.usage=ot.Usage({category:"Constraints-related commands",description:"print the source code for the constraints",details:"\n This command will print the Prolog source code used by the constraints engine. Adding the `-v,--verbose` flag will print the *full* source code, including the fact database automatically compiled from the workspace manifests.\n ",examples:[["Prints the source code","yarn constraints source"],["Print the source code and the fact database","yarn constraints source -v"]]})}async execute(){let{Constraints:r}=await Promise.resolve().then(()=>(vS(),BS)),s=await ze.find(this.context.cwd,this.context.plugins),{project:a}=await Tt.find(s,this.context.cwd),n=await r.find(a);this.context.stdout.write(this.verbose?n.fullSource:n.source)}};Ve();Ve();Wt();IS();var ew=class extends ut{constructor(){super(...arguments);this.fix=ge.Boolean("--fix",!1,{description:"Attempt to automatically fix unambiguous issues, following a multi-pass process"});this.json=ge.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"})}static{this.paths=[["constraints"]]}static{this.usage=ot.Usage({category:"Constraints-related commands",description:"check that the project constraints are met",details:`
This command will run constraints on your project and emit errors for each one that is found but isn't met. If any error is emitted the process will exit with a non-zero exit code.
If the \`--fix\` flag is used, Yarn will attempt to automatically fix the issues the best it can, following a multi-pass process (with a maximum of 10 iterations). Some ambiguous patterns cannot be autofixed, in which case you'll have to manually specify the right resolution.
For more information as to how to write constraints, please consult our dedicated page on our website: https://yarnpkg.com/features/constraints.
2025-04-11 10:05:45 -04:00
`,examples:[["Check that all constraints are satisfied","yarn constraints"],["Autofix all unmet constraints","yarn constraints --fix"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s}=await Tt.find(r,this.context.cwd);await s.restoreInstallState();let a=await s.loadUserConfig(),n;if(a?.constraints)n=new KC(s);else{let{Constraints:h}=await Promise.resolve().then(()=>(vS(),BS));n=await h.find(s)}let c,f=!1,p=!1;for(let h=this.fix?10:1;h>0;--h){let E=await n.process();if(!E)break;let{changedWorkspaces:C,remainingErrors:S}=lF(s,E,{fix:this.fix}),P=[];for(let[I,R]of C){let N=I.manifest.indent;I.manifest=new Ht,I.manifest.indent=N,I.manifest.load(R),P.push(I.persistManifest())}if(await Promise.all(P),!(C.size>0&&h>1)){c=ZBe(S,{configuration:r}),f=!1,p=!0;for(let[,I]of S)for(let R of I)R.fixable?f=!0:p=!1}}if(c.children.length===0)return 0;if(f){let h=p?`Those errors can all be fixed by running ${he.pretty(r,"yarn constraints --fix",he.Type.CODE)}`:`Errors prefixed by '\u2699' can be fixed by running ${he.pretty(r,"yarn constraints --fix",he.Type.CODE)}`;await Ot.start({configuration:r,stdout:this.context.stdout,includeNames:!1,includeFooter:!1},async E=>{E.reportInfo(0,h),E.reportSeparator()})}return c.children=je.sortMap(c.children,h=>h.value[1]),ks.emitTree(c,{configuration:r,stdout:this.context.stdout,json:this.json,separators:1}),1}};IS();var EDt={configuration:{enableConstraintsChecks:{description:"If true, constraints will run during installs",type:"BOOLEAN",default:!1},constraintsPath:{description:"The path of the constraints file.",type:"ABSOLUTE_PATH",default:"./constraints.pro"}},commands:[XC,$C,ew],hooks:{async validateProjectAfterInstall(t,{reportError:e}){if(!t.configuration.get("enableConstraintsChecks"))return;let r=await t.loadUserConfig(),s;if(r?.constraints)s=new KC(t);else{let{Constraints:c}=await Promise.resolve().then(()=>(vS(),BS));s=await c.find(t)}let a=await s.process();if(!a)return;let{remainingErrors:n}=lF(t,a);if(n.size!==0)if(t.configuration.isCI)for(let[c,f]of n)for(let p of f)e(84,`${he.pretty(t.configuration,c.anchoredLocator,he.Type.IDENT)}: ${p.text}`);else e(84,`Constraint check failed; run ${he.pretty(t.configuration,"yarn constraints",he.Type.CODE)} for more details`)}}},IDt=EDt;var B9={};Vt(B9,{CreateCommand:()=>tw,DlxCommand:()=>rw,default:()=>wDt});Ve();Wt();var tw=class extends ut{constructor(){super(...arguments);this.pkg=ge.String("-p,--package",{description:"The package to run the provided command from"});this.quiet=ge.Boolean("-q,--quiet",!1,{description:"Only report critical errors instead of printing the full install logs"});this.command=ge.String();this.args=ge.Proxy()}static{this.paths=[["create"]]}async execute(){let r=[];this.pkg&&r.push("--package",this.pkg),this.quiet&&r.push("--quiet");let s=this.command.replace(/^(@[^@/]+)(@|$)/,"$1/create$2"),a=q.parseDescriptor(s),n=a.name.match(/^create(-|$)/)?a:a.scope?q.makeIdent(a.scope,`create-${a.name}`):q.makeIdent(null,`create-${a.name}`),c=q.stringifyIdent(n);return a.range!=="unknown"&&(c+=`@${a.range}`),this.cli.run(["dlx",...r,c,...this.args])}};Ve();Ve();bt();Wt();var rw=class extends ut{constructor(){super(...arguments);this.packages=ge.Array("-p,--package",{description:"The package(s) to install before running the command"});this.quiet=ge.Boolean("-q,--quiet",!1,{description:"Only report critical errors instead of printing the full install logs"});this.command=ge.String();this.args=ge.Proxy()}static{this.paths=[["dlx"]]}static{this.usage=ot.Usage({description:"run a package in a temporary environment",details:"\n This command will install a package within a temporary environment, and run its binary script if it contains any. The binary will run within the current cwd.\n\n By default Yarn will download the package named `command`, but this can be changed through the use of the `-p,--package` flag which will instruct Yarn to still run the same command but from a different package.\n\n Using `yarn dlx` as a replacement of `yarn add` isn't recommended, as it makes yo
`),await le.writeFilePromise(K.join(s,"yarn.lock"),"");let a=K.join(s,".yarnrc.yml"),n=await ze.findProjectCwd(this.context.cwd),f={enableGlobalCache:!(await ze.find(this.context.cwd,null,{strict:!1})).get("enableGlobalCache"),enableTelemetry:!1,logFilters:[{code:Vf(68),level:he.LogLevel.Discard}]},p=n!==null?K.join(n,".yarnrc.yml"):null;p!==null&&le.existsSync(p)?(await le.copyFilePromise(p,a),await ze.updateConfiguration(s,N=>{let U=je.toMerged(N,f);return Array.isArray(N.plugins)&&(U.plugins=N.plugins.map(W=>{let te=typeof W=="string"?W:W.path,ie=ue.isAbsolute(te)?te:ue.resolve(ue.fromPortablePath(n),te);return typeof W=="string"?ie:{path:ie,spec:W.spec}})),U})):await le.writeJsonPromise(a,f);let h=this.packages??[this.command],E=q.parseDescriptor(this.command).name,C=await this.cli.run(["add","--fixed","--",...h],{cwd:s,quiet:this.quiet});if(C!==0)return C;this.quiet||this.context.stdout.write(`
`);let S=await ze.find(s,this.context.plugins),{project:P,workspace:I}=await Tt.find(S,s);if(I===null)throw new ar(P.cwd,s);await P.restoreInstallState();let R=await In.getWorkspaceAccessibleBinaries(I);return R.has(E)===!1&&R.size===1&&typeof this.packages>"u"&&(E=Array.from(R)[0][0]),await In.executeWorkspaceAccessibleBinary(I,E,this.args,{packageAccessibleBinaries:R,cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr})})}};var CDt={commands:[tw,rw]},wDt=CDt;var D9={};Vt(D9,{ExecFetcher:()=>DS,ExecResolver:()=>bS,default:()=>SDt,execUtils:()=>AF});Ve();Ve();bt();var fA="exec:";var AF={};Vt(AF,{loadGeneratorFile:()=>SS,makeLocator:()=>S9,makeSpec:()=>Bve,parseSpec:()=>v9});Ve();bt();function v9(t){let{params:e,selector:r}=q.parseRange(t),s=ue.toPortablePath(r);return{parentLocator:e&&typeof e.locator=="string"?q.parseLocator(e.locator):null,path:s}}function Bve({parentLocator:t,path:e,generatorHash:r,protocol:s}){let a=t!==null?{locator:q.stringifyLocator(t)}:{},n=typeof r<"u"?{hash:r}:{};return q.makeRange({protocol:s,source:e,selector:e,params:{...n,...a}})}function S9(t,{parentLocator:e,path:r,generatorHash:s,protocol:a}){return q.makeLocator(t,Bve({parentLocator:e,path:r,generatorHash:s,protocol:a}))}async function SS(t,e,r){let{parentLocator:s,path:a}=q.parseFileStyleRange(t,{protocol:e}),n=K.isAbsolute(a)?{packageFs:new Sn(vt.root),prefixPath:vt.dot,localPath:vt.root}:await r.fetcher.fetch(s,r),c=n.localPath?{packageFs:new Sn(vt.root),prefixPath:K.relative(vt.root,n.localPath)}:n;n!==c&&n.releaseFs&&n.releaseFs();let f=c.packageFs,p=K.join(c.prefixPath,a);return await f.readFilePromise(p,"utf8")}var DS=class{supports(e,r){return!!e.reference.startsWith(fA)}getLocalPath(e,r){let{parentLocator:s,path:a}=q.parseFileStyleRange(e.reference,{protocol:fA});if(K.isAbsolute(a))return a;let n=r.fetcher.getLocalPath(s,r);return n===null?null:K.resolve(n,a)}async fetch(e,r){let s=r.checksums.get(e.locatorHash)||null,[a,n,c]=await r.cache.fetchPackageFromCache(e,s,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e),loader:()=>this.fetchFromDisk(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:q.getIdentVendorPath(e),localPath:this.getLocalPath(e,r),checksum:c}}async fetchFromDisk(e,r){let s=await SS(e.reference,fA,r);return le.mktempPromise(async a=>{let n=K.join(a,"generator.js");return await le.writeFilePromise(n,s),le.mktempPromise(async c=>{if(await this.generatePackage(c,e,n,r),!le.existsSync(K.join(c,"build")))throw new Error("The script should have generated a build directory");return await hs.makeArchiveFromDirectory(K.join(c,"build"),{prefixPath:q.getIdentVendorPath(e),compressionLevel:r.project.configuration.get("compressionLevel")})})})}async generatePackage(e,r,s,a){return await le.mktempPromise(async n=>{let c=await In.makeScriptEnv({project:a.project,binFolder:n}),f=K.join(e,"runtime.js");return await le.mktempPromise(async p=>{let h=K.join(p,"buildfile.log"),E=K.join(e,"generator"),C=K.join(e,"build");await le.mkdirPromise(E),await le.mkdirPromise(C);let S={tempDir:ue.fromPortablePath(E),buildDir:ue.fromPortablePath(C),locator:q.stringifyLocator(r)};await le.writeFilePromise(f,`
2025-04-10 09:51:25 -04:00
// Expose 'Module' as a global variable
Object.defineProperty(global, 'Module', {
get: () => require('module'),
configurable: true,
enumerable: false,
});
// Expose non-hidden built-in modules as global variables
for (const name of Module.builtinModules.filter((name) => name !== 'module' && !name.startsWith('_'))) {
Object.defineProperty(global, name, {
get: () => require(name),
configurable: true,
enumerable: false,
});
}
// Expose the 'execEnv' global variable
Object.defineProperty(global, 'execEnv', {
value: {
...${JSON.stringify(S)},
},
enumerable: true,
});
`);let P=c.NODE_OPTIONS||"",I=/\s*--require\s+\S*\.pnp\.c?js\s*/g;P=P.replace(I," ").trim(),c.NODE_OPTIONS=P;let{stdout:R,stderr:N}=a.project.configuration.getSubprocessStreams(h,{header:`# This file contains the result of Yarn generating a package (${q.stringifyLocator(r)})
2025-04-11 10:05:45 -04:00
`,prefix:q.prettyLocator(a.project.configuration,r),report:a.report}),{code:U}=await Gr.pipevp(process.execPath,["--require",ue.fromPortablePath(f),ue.fromPortablePath(s),q.stringifyIdent(r)],{cwd:e,env:c,stdin:null,stdout:R,stderr:N});if(U!==0)throw le.detachTemp(p),new Error(`Package generation failed (exit code ${U}, logs can be found here: ${he.pretty(a.project.configuration,h,he.Type.PATH)})`)})})}};Ve();Ve();var BDt=2,bS=class{supportsDescriptor(e,r){return!!e.range.startsWith(fA)}supportsLocator(e,r){return!!e.reference.startsWith(fA)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,s){return q.bindDescriptor(e,{locator:q.stringifyLocator(r)})}getResolutionDependencies(e,r){return{}}async getCandidates(e,r,s){if(!s.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let{path:a,parentLocator:n}=v9(e.range);if(n===null)throw new Error("Assertion failed: The descriptor should have been bound");let c=await SS(q.makeRange({protocol:fA,source:a,selector:a,params:{locator:q.stringifyLocator(n)}}),fA,s.fetchOptions),f=Nn.makeHash(`${BDt}`,c).slice(0,6);return[S9(e,{parentLocator:n,path:a,generatorHash:f,protocol:fA})]}async getSatisfying(e,r,s,a){let[n]=await this.getCandidates(e,r,a);return{locators:s.filter(c=>c.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){if(!r.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let s=await r.fetchOptions.fetcher.fetch(e,r.fetchOptions),a=await je.releaseAfterUseAsync(async()=>await Ht.find(s.prefixPath,{baseFs:s.packageFs}),s.releaseFs);return{...e,version:a.version||"0.0.0",languageName:a.languageName||r.project.configuration.get("defaultLanguageName"),linkType:"HARD",conditions:a.getConditions(),dependencies:r.project.configuration.normalizeDependencyMap(a.dependencies),peerDependencies:a.peerDependencies,dependenciesMeta:a.dependenciesMeta,peerDependenciesMeta:a.peerDependenciesMeta,bin:a.bin}}};var vDt={fetchers:[DS],resolvers:[bS]},SDt=vDt;var P9={};Vt(P9,{FileFetcher:()=>QS,FileResolver:()=>TS,TarballFileFetcher:()=>RS,TarballFileResolver:()=>NS,default:()=>PDt,fileUtils:()=>km});Ve();bt();var nw=/^(?:[a-zA-Z]:[\\/]|\.{0,2}\/)/,PS=/^[^?]*\.(?:tar\.gz|tgz)(?:::.*)?$/,es="file:";var km={};Vt(km,{fetchArchiveFromLocator:()=>kS,makeArchiveFromLocator:()=>pF,makeBufferFromLocator:()=>b9,makeLocator:()=>iw,makeSpec:()=>vve,parseSpec:()=>xS});Ve();bt();function xS(t){let{params:e,selector:r}=q.parseRange(t),s=ue.toPortablePath(r);return{parentLocator:e&&typeof e.locator=="string"?q.parseLocator(e.locator):null,path:s}}function vve({parentLocator:t,path:e,hash:r,protocol:s}){let a=t!==null?{locator:q.stringifyLocator(t)}:{},n=typeof r<"u"?{hash:r}:{};return q.makeRange({protocol:s,source:e,selector:e,params:{...n,...a}})}function iw(t,{parentLocator:e,path:r,hash:s,protocol:a}){return q.makeLocator(t,vve({parentLocator:e,path:r,hash:s,protocol:a}))}async function kS(t,e){let{parentLocator:r,path:s}=q.parseFileStyleRange(t.reference,{protocol:es}),a=K.isAbsolute(s)?{packageFs:new Sn(vt.root),prefixPath:vt.dot,localPath:vt.root}:await e.fetcher.fetch(r,e),n=a.localPath?{packageFs:new Sn(vt.root),prefixPath:K.relative(vt.root,a.localPath)}:a;a!==n&&a.releaseFs&&a.releaseFs();let c=n.packageFs,f=K.join(n.prefixPath,s);return await je.releaseAfterUseAsync(async()=>await c.readFilePromise(f),n.releaseFs)}async function pF(t,{protocol:e,fetchOptions:r,inMemory:s=!1}){let{parentLocator:a,path:n}=q.parseFileStyleRange(t.reference,{protocol:e}),c=K.isAbsolute(n)?{packageFs:new Sn(vt.root),prefixPath:vt.dot,localPath:vt.root}:await r.fetcher.fetch(a,r),f=c.localPath?{packageFs:new Sn(vt.root),prefixPath:K.relative(vt.root,c.localPath)}:c;c!==f&&c.releaseFs&&c.releaseFs();let p=f.packageFs,h=K.join(f.prefixPath,n);return await je.releaseAfterUseAsync(async()=>await hs.makeArchiveFromDirectory(h,{baseFs:p,prefixPath:q.getIdentVendorPath(t),compressionLevel:r.project.configuration.get("compressionLevel"),inMemory:s}),f.releaseFs)}async function b9(t,{protocol:e,fe
`,{automaticNewlines:!0});let h=[p],E=K.join(this.context.cwd,"README.md");if(le.existsSync(E)||(await le.writeFilePromise(E,`# ${q.stringifyIdent(n.name)}
`),h.push(E)),!s||s.cwd===this.context.cwd){let C=K.join(this.context.cwd,Er.lockfile);le.existsSync(C)||(await le.writeFilePromise(C,""),h.push(C));let P=[".yarn/*","!.yarn/patches","!.yarn/plugins","!.yarn/releases","!.yarn/sdks","!.yarn/versions","","# Whether you use PnP or not, the node_modules folder is often used to store","# build artifacts that should be gitignored","node_modules","","# Swap the comments on the following lines if you wish to use zero-installs","# In that case, don't forget to run `yarn config set enableGlobalCache false`!","# Documentation here: https://yarnpkg.com/features/caching#zero-installs","","#!.yarn/cache",".pnp.*"].map(Ae=>`${Ae}
`).join(""),I=K.join(this.context.cwd,".gitignore");le.existsSync(I)||(await le.writeFilePromise(I,P),h.push(I));let N=["/.yarn/** linguist-vendored","/.yarn/releases/* binary","/.yarn/plugins/**/* binary","/.pnp.* binary linguist-generated"].map(Ae=>`${Ae}
`).join(""),U=K.join(this.context.cwd,".gitattributes");le.existsSync(U)||(await le.writeFilePromise(U,N),h.push(U));let W={"*":{charset:"utf-8",endOfLine:"lf",indentSize:2,indentStyle:"space",insertFinalNewline:!0}};je.mergeIntoTarget(W,r.get("initEditorConfig"));let te=`root = true
2025-04-10 09:51:25 -04:00
`;for(let[Ae,ce]of Object.entries(W)){te+=`
[${Ae}]
`;for(let[me,pe]of Object.entries(ce)){let Be=me.replace(/[A-Z]/g,Ce=>`_${Ce.toLowerCase()}`);te+=`${Be} = ${pe}
2025-04-11 10:05:45 -04:00
`}}let ie=K.join(this.context.cwd,".editorconfig");le.existsSync(ie)||(await le.writeFilePromise(ie,te),h.push(ie)),await this.cli.run(["install"],{quiet:!0}),await this.initialize(),le.existsSync(K.join(this.context.cwd,".git"))||(await Gr.execvp("git",["init"],{cwd:this.context.cwd}),await Gr.execvp("git",["add","--",...h],{cwd:this.context.cwd}),await Gr.execvp("git",["commit","--allow-empty","-m","First commit"],{cwd:this.context.cwd}))}}};var sw=class extends Z0{constructor(){super(...arguments);this.initializer=ge.String();this.argv=ge.Proxy()}static{this.paths=[["init"]]}async initialize(){this.context.stdout.write(`
2025-04-10 09:51:25 -04:00
`),await this.cli.run(["dlx",this.initializer,...this.argv],{quiet:!0})}};var RDt={configuration:{initScope:{description:"Scope used when creating packages via the init command",type:"STRING",default:null},initFields:{description:"Additional fields to set when creating packages via the init command",type:"MAP",valueDefinition:{description:"",type:"ANY"}},initEditorConfig:{description:"Extra rules to define in the generator editorconfig",type:"MAP",valueDefinition:{description:"",type:"ANY"}}},commands:[Z0,sw]},FDt=RDt;var TY={};Vt(TY,{SearchCommand:()=>Bw,UpgradeInteractiveCommand:()=>vw,default:()=>cTt});Ve();var xve=et(ye("os"));function ow({stdout:t}){if(xve.default.endianness()==="BE")throw new Error("Interactive commands cannot be used on big-endian systems because ink depends on yoga-layout-prebuilt which only supports little-endian architectures");if(!t.isTTY)throw new Error("Interactive commands can only be used inside a TTY environment")}Wt();var HSe=et(Z9()),X9={appId:"OFCNCOG2CU",apiKey:"6fe4476ee5a1832882e326b506d14126",indexName:"npm-search"},QPt=(0,HSe.default)(X9.appId,X9.apiKey).initIndex(X9.indexName),$9=async(t,e=0)=>await QPt.search(t,{analyticsTags:["yarn-plugin-interactive-tools"],attributesToRetrieve:["name","version","owner","repository","humanDownloadsLast30Days"],page:e,hitsPerPage:10});var LD=["regular","dev","peer"],Bw=class extends ut{static{this.paths=[["search"]]}static{this.usage=ot.Usage({category:"Interactive commands",description:"open the search interface",details:`
This command opens a fullscreen terminal interface where you can search for and install packages from the npm registry.
`,examples:[["Open the search window","yarn search"]]})}async execute(){ow(this.context);let{Gem:e}=await Promise.resolve().then(()=>($F(),CY)),{ScrollableItems:r}=await Promise.resolve().then(()=>(nN(),rN)),{useKeypress:s}=await Promise.resolve().then(()=>(FD(),zPe)),{useMinistore:a}=await Promise.resolve().then(()=>(bY(),DY)),{renderForm:n}=await Promise.resolve().then(()=>(aN(),oN)),{default:c}=await Promise.resolve().then(()=>et(oxe())),{Box:f,Text:p}=await Promise.resolve().then(()=>et(Vc())),{default:h,useEffect:E,useState:C}=await Promise.resolve().then(()=>et(hn())),S=await ze.find(this.context.cwd,this.context.plugins),P=()=>h.createElement(f,{flexDirection:"row"},h.createElement(f,{flexDirection:"column",width:48},h.createElement(f,null,h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<up>"),"/",h.createElement(p,{bold:!0,color:"cyanBright"},"<down>")," to move between packages.")),h.createElement(f,null,h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<space>")," to select a package.")),h.createElement(f,null,h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<space>")," again to change the target."))),h.createElement(f,{flexDirection:"column"},h.createElement(f,{marginLeft:1},h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<enter>")," to install the selected packages.")),h.createElement(f,{marginLeft:1},h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<ctrl+c>")," to abort.")))),I=()=>h.createElement(h.Fragment,null,h.createElement(f,{width:15},h.createElement(p,{bold:!0,underline:!0,color:"gray"},"Owner")),h.createElement(f,{width:11},h.createElement(p,{bold:!0,underline:!0,color:"gray"},"Version")),h.createElement(f,{width:10},h.createElement(p,{bold:!0,underline:!0,color:"gray"},"Downloads"))),R=()=>h.createElement(f,{width:17},h.createElement(p,{bold:!0,underline:!0,color:"gray"},"Target")),N=({hit:pe,active:Be})=>{let[Ce,g]=a(pe.name,null);s({active:Be},(fe,se)=>{if(se.name!=="space")return;if(!Ce){g(LD[0]);return}let X=LD.indexOf(Ce)+1;X===LD.length?g(null):g(LD[X])},[Ce,g]);let we=q.parseIdent(pe.name),Ee=q.prettyIdent(S,we);return h.createElement(f,null,h.createElement(f,{width:45},h.createElement(p,{bold:!0,wrap:"wrap"},Ee)),h.createElement(f,{width:14,marginLeft:1},h.createElement(p,{bold:!0,wrap:"truncate"},pe.owner.name)),h.createElement(f,{width:10,marginLeft:1},h.createElement(p,{italic:!0,wrap:"truncate"},pe.version)),h.createElement(f,{width:16,marginLeft:1},h.createElement(p,null,pe.humanDownloadsLast30Days)))},U=({name:pe,active:Be})=>{let[Ce]=a(pe,null),g=q.parseIdent(pe);return h.createElement(f,null,h.createElement(f,{width:47},h.createElement(p,{bold:!0}," - ",q.prettyIdent(S,g))),LD.map(we=>h.createElement(f,{key:we,width:14,marginLeft:1},h.createElement(p,null," ",h.createElement(e,{active:Ce===we})," ",h.createElement(p,{bold:!0},we)))))},W=()=>h.createElement(f,{marginTop:1},h.createElement(p,null,"Powered by Algolia.")),ie=await n(({useSubmit:pe})=>{let Be=a();pe(Be);let Ce=Array.from(Be.keys()).filter(j=>Be.get(j)!==null),[g,we]=C(""),[Ee,fe]=C(0),[se,X]=C([]),De=j=>{j.match(/\t| /)||we(j)},Re=async()=>{fe(0);let j=await $9(g);j.query===g&&X(j.hits)},gt=async()=>{let j=await $9(g,Ee+1);j.query===g&&j.page-1===Ee&&(fe(j.page),X([...se,...j.hits]))};return E(()=>{g?Re():X([])},[g]),h.createElement(f,{flexDirection:"column"},h.createElement(P,null),h.createElement(f,{flexDirection:"row",marginTop:1},h.createElement(p,{bold:!0},"Search: "),h.createElement(f,{width:41},h.createElement(c,{value:g,onChange:De,placeholder:"i.e. babel, webpack, react...",showCursor:!1})),h.createElement(I,null)),se.length?h.createElement(r,{radius:2,loop:!1,children:se.map(j=>h.createElement(N,{key:j.name,hit:j,active:!1})),willReachEnd:gt}):h.createElement(p,{color:"gray"},"Start typing..."),h.createElement(f,{flexDirection:"row",marginTop:1},h.createElement(f,{width:49},h.createElement(p,{bold:!0},"Selected:")),h.createElement(R,null)),Ce.length?Ce.
This command opens a fullscreen terminal interface where you can see any out of date packages used by your application, their status compared to the latest versions available on the remote registry, and select packages to upgrade.
2025-04-11 10:05:45 -04:00
`,examples:[["Open the upgrade window","yarn upgrade-interactive"]]})}async execute(){ow(this.context);let{ItemOptions:e}=await Promise.resolve().then(()=>(fxe(),uxe)),{Pad:r}=await Promise.resolve().then(()=>(QY(),cxe)),{ScrollableItems:s}=await Promise.resolve().then(()=>(nN(),rN)),{useMinistore:a}=await Promise.resolve().then(()=>(bY(),DY)),{renderForm:n}=await Promise.resolve().then(()=>(aN(),oN)),{Box:c,Text:f}=await Promise.resolve().then(()=>et(Vc())),{default:p,useEffect:h,useRef:E,useState:C}=await Promise.resolve().then(()=>et(hn())),S=await ze.find(this.context.cwd,this.context.plugins),{project:P,workspace:I}=await Tt.find(S,this.context.cwd),R=await Jr.find(S);if(!I)throw new ar(P.cwd,this.context.cwd);await P.restoreInstallState({restoreResolutions:!1});let N=this.context.stdout.rows-7,U=(we,Ee)=>{let fe=ICe(we,Ee),se="";for(let X of fe)X.added?se+=he.pretty(S,X.value,"green"):X.removed||(se+=X.value);return se},W=(we,Ee)=>{if(we===Ee)return Ee;let fe=q.parseRange(we),se=q.parseRange(Ee),X=fe.selector.match(Axe),De=se.selector.match(Axe);if(!X||!De)return U(we,Ee);let Re=["gray","red","yellow","green","magenta"],gt=null,j="";for(let rt=1;rt<Re.length;++rt)gt!==null||X[rt]!==De[rt]?(gt===null&&(gt=Re[rt-1]),j+=he.pretty(S,De[rt],gt)):j+=De[rt];return j},te=async(we,Ee,fe)=>{let se=await Xu.fetchDescriptorFrom(we,fe,{project:P,cache:R,preserveModifier:Ee,workspace:I});return se!==null?se.range:we.range},ie=async we=>{let Ee=pxe.default.valid(we.range)?`^${we.range}`:we.range,[fe,se]=await Promise.all([te(we,we.range,Ee).catch(()=>null),te(we,we.range,"latest").catch(()=>null)]),X=[{value:null,label:we.range}];return fe&&fe!==we.range?X.push({value:fe,label:W(we.range,fe)}):X.push({value:null,label:""}),se&&se!==fe&&se!==we.range?X.push({value:se,label:W(we.range,se)}):X.push({value:null,label:""}),X},Ae=()=>p.createElement(c,{flexDirection:"row"},p.createElement(c,{flexDirection:"column",width:49},p.createElement(c,{marginLeft:1},p.createElement(f,null,"Press ",p.createElement(f,{bold:!0,color:"cyanBright"},"<up>"),"/",p.createElement(f,{bold:!0,color:"cyanBright"},"<down>")," to select packages.")),p.createElement(c,{marginLeft:1},p.createElement(f,null,"Press ",p.createElement(f,{bold:!0,color:"cyanBright"},"<left>"),"/",p.createElement(f,{bold:!0,color:"cyanBright"},"<right>")," to select versions."))),p.createElement(c,{flexDirection:"column"},p.createElement(c,{marginLeft:1},p.createElement(f,null,"Press ",p.createElement(f,{bold:!0,color:"cyanBright"},"<enter>")," to install.")),p.createElement(c,{marginLeft:1},p.createElement(f,null,"Press ",p.createElement(f,{bold:!0,color:"cyanBright"},"<ctrl+c>")," to abort.")))),ce=()=>p.createElement(c,{flexDirection:"row",paddingTop:1,paddingBottom:1},p.createElement(c,{width:50},p.createElement(f,{bold:!0},p.createElement(f,{color:"greenBright"},"?")," Pick the packages you want to upgrade.")),p.createElement(c,{width:17},p.createElement(f,{bold:!0,underline:!0,color:"gray"},"Current")),p.createElement(c,{width:17},p.createElement(f,{bold:!0,underline:!0,color:"gray"},"Range")),p.createElement(c,{width:17},p.createElement(f,{bold:!0,underline:!0,color:"gray"},"Latest"))),me=({active:we,descriptor:Ee,suggestions:fe})=>{let[se,X]=a(Ee.descriptorHash,null),De=q.stringifyIdent(Ee),Re=Math.max(0,45-De.length);return p.createElement(p.Fragment,null,p.createElement(c,null,p.createElement(c,{width:45},p.createElement(f,{bold:!0},q.prettyIdent(S,Ee)),p.createElement(r,{active:we,length:Re})),p.createElement(e,{active:we,options:fe,value:se,skewer:!0,onChange:X,sizes:[17,17,17]})))},pe=({dependencies:we})=>{let[Ee,fe]=C(we.map(()=>null)),se=E(!0),X=async De=>{let Re=await ie(De);return Re.filter(gt=>gt.label!=="").length<=1?null:{descriptor:De,suggestions:Re}};return h(()=>()=>{se.current=!1},[]),h(()=>{let De=Math.trunc(N*1.75),Re=we.slice(0,De),gt=we.slice(De),j=hxe(gt,N),rt=Re.map(X).reduce(async(Fe,Ne)=>{await Fe;let Pe=await Ne;Pe!==null&&se.current&&fe(Ye=>{let ke=Ye.findIndex(_e=>_e===null),it=[...Ye];return it[ke]=Pe,it})},Promise.resolve());j.reduce((Fe,Ne)=
2025-04-10 09:51:25 -04:00
${E}, next tree:
${GD(f)}`);let S=yxe(f);if(S)throw new Error(`${S}, after hoisting finished:
${GD(f)}`)}return n.debugLevel>=2&&console.log(GD(f)),BTt(f)},dTt=t=>{let e=t[t.length-1],r=new Map,s=new Set,a=n=>{if(!s.has(n)){s.add(n);for(let c of n.hoistedDependencies.values())r.set(c.name,c);for(let c of n.dependencies.values())n.peerNames.has(c.name)||a(c)}};return a(e),r},mTt=t=>{let e=t[t.length-1],r=new Map,s=new Set,a=new Set,n=(c,f)=>{if(s.has(c))return;s.add(c);for(let h of c.hoistedDependencies.values())if(!f.has(h.name)){let E;for(let C of t)E=C.dependencies.get(h.name),E&&r.set(E.name,E)}let p=new Set;for(let h of c.dependencies.values())p.add(h.name);for(let h of c.dependencies.values())c.peerNames.has(h.name)||n(h,p)};return n(e,a),r},dxe=(t,e)=>{if(e.decoupled)return e;let{name:r,references:s,ident:a,locator:n,dependencies:c,originalDependencies:f,hoistedDependencies:p,peerNames:h,reasons:E,isHoistBorder:C,hoistPriority:S,dependencyKind:P,hoistedFrom:I,hoistedTo:R}=e,N={name:r,references:new Set(s),ident:a,locator:n,dependencies:new Map(c),originalDependencies:new Map(f),hoistedDependencies:new Map(p),peerNames:new Set(h),reasons:new Map(E),decoupled:!0,isHoistBorder:C,hoistPriority:S,dependencyKind:P,hoistedFrom:new Map(I),hoistedTo:new Map(R)},U=N.dependencies.get(r);return U&&U.ident==N.ident&&N.dependencies.set(r,N),t.dependencies.set(N.name,N),N},yTt=(t,e)=>{let r=new Map([[t.name,[t.ident]]]);for(let a of t.dependencies.values())t.peerNames.has(a.name)||r.set(a.name,[a.ident]);let s=Array.from(e.keys());s.sort((a,n)=>{let c=e.get(a),f=e.get(n);if(f.hoistPriority!==c.hoistPriority)return f.hoistPriority-c.hoistPriority;{let p=c.dependents.size+c.peerDependents.size;return f.dependents.size+f.peerDependents.size-p}});for(let a of s){let n=a.substring(0,a.indexOf("@",1)),c=a.substring(n.length+1);if(!t.peerNames.has(n)){let f=r.get(n);f||(f=[],r.set(n,f)),f.indexOf(c)<0&&f.push(c)}}return r},OY=t=>{let e=new Set,r=(s,a=new Set)=>{if(!a.has(s)){a.add(s);for(let n of s.peerNames)if(!t.peerNames.has(n)){let c=t.dependencies.get(n);c&&!e.has(c)&&r(c,a)}e.add(s)}};for(let s of t.dependencies.values())t.peerNames.has(s.name)||r(s);return e},MY=(t,e,r,s,a,n=new Set)=>{let c=e[e.length-1];if(n.has(c))return{anotherRoundNeeded:!1,isGraphChanged:!1};n.add(c);let f=vTt(c),p=yTt(c,f),h=t==c?new Map:a.fastLookupPossible?dTt(e):mTt(e),E,C=!1,S=!1,P=new Map(Array.from(p.entries()).map(([R,N])=>[R,N[0]])),I=new Map;do{let R=CTt(t,e,r,h,P,p,s,I,a);R.isGraphChanged&&(S=!0),R.anotherRoundNeeded&&(C=!0),E=!1;for(let[N,U]of p)U.length>1&&!c.dependencies.has(N)&&(P.delete(N),U.shift(),P.set(N,U[0]),E=!0)}while(E);for(let R of c.dependencies.values())if(!c.peerNames.has(R.name)&&!r.has(R.locator)){r.add(R.locator);let N=MY(t,[...e,R],r,I,a);N.isGraphChanged&&(S=!0),N.anotherRoundNeeded&&(C=!0),r.delete(R.locator)}return{anotherRoundNeeded:C,isGraphChanged:S}},ETt=t=>{for(let[e,r]of t.dependencies)if(!t.peerNames.has(e)&&r.ident!==t.ident)return!0;return!1},ITt=(t,e,r,s,a,n,c,f,{outputReason:p,fastLookupPossible:h})=>{let E,C=null,S=new Set;p&&(E=`${Array.from(e).map(N=>Io(N)).join("\u2192")}`);let P=r[r.length-1],R=!(s.ident===P.ident);if(p&&!R&&(C="- self-reference"),R&&(R=s.dependencyKind!==1,p&&!R&&(C="- workspace")),R&&s.dependencyKind===2&&(R=!ETt(s),p&&!R&&(C="- external soft link with unhoisted dependencies")),R&&(R=!t.peerNames.has(s.name),p&&!R&&(C=`- cannot shadow peer: ${Io(t.originalDependencies.get(s.name).locator)} at ${E}`)),R){let N=!1,U=a.get(s.name);if(N=!U||U.ident===s.ident,p&&!N&&(C=`- filled by: ${Io(U.locator)} at ${E}`),N)for(let W=r.length-1;W>=1;W--){let ie=r[W].dependencies.get(s.name);if(ie&&ie.ident!==s.ident){N=!1;let Ae=f.get(P);Ae||(Ae=new Set,f.set(P,Ae)),Ae.add(s.name),p&&(C=`- filled by ${Io(ie.locator)} at ${r.slice(0,W).map(ce=>Io(ce.locator)).join("\u2192")}`);break}}R=N}if(R&&(R=n.get(s.name)===s.ident,p&&!R&&(C=`- filled by: ${Io(c.get(s.name)[0])} at ${E}`)),R){let N=!0,U=new Set(s.peerNames);for(let W=r.length-1;W>=1;W--){let te=r[W];for(let ie of U){if(te.peerNames.has(ie)&&te.originalDependencies.has(ie))continue;let Ae=te.dependencies.get(ie);Ae&&t.dependencies.get(ie)!==Ae&
${GD(t)}`)}let Ee=OY(ie);for(let fe of Ee)if(Ce.has(fe)){let se=Be.get(fe);if((a.get(fe.name)===fe.ident||!ie.reasons.has(fe.name))&&se.isHoistable!==0&&ie.reasons.set(fe.name,se.reason),!fe.isHoistBorder&&me.indexOf(uN(fe))<0){E.add(ie);let De=dxe(ie,fe);P([...U,ie],ce,me,De,R),E.delete(ie)}}},I,R=new Set(OY(h)),N=Array.from(e).map(U=>uN(U));do{I=R,R=new Set;for(let U of I){if(U.locator===h.locator||U.isHoistBorder)continue;let W=dxe(h,U);P([],Array.from(r),N,W,R)}}while(R.size>0);return{anotherRoundNeeded:C,isGraphChanged:S}},yxe=t=>{let e=[],r=new Set,s=new Set,a=(n,c,f)=>{if(r.has(n)||(r.add(n),s.has(n)))return;let p=new Map(c);for(let h of n.dependencies.values())n.peerNames.has(h.name)||p.set(h.name,h);for(let h of n.originalDependencies.values()){let E=p.get(h.name),C=()=>`${Array.from(s).concat([n]).map(S=>Io(S.locator)).join("\u2192")}`;if(n.peerNames.has(h.name)){let S=c.get(h.name);(S!==E||!S||S.ident!==h.ident)&&e.push(`${C()} - broken peer promise: expected ${h.ident} but found ${S&&S.ident}`)}else{let S=f.hoistedFrom.get(n.name),P=n.hoistedTo.get(h.name),I=`${S?` hoisted from ${S.join(", ")}`:""}`,R=`${P?` hoisted to ${P}`:""}`,N=`${C()}${I}`;E?E.ident!==h.ident&&e.push(`${N} - broken require promise for ${h.name}${R}: expected ${h.ident}, but found: ${E.ident}`):e.push(`${N} - broken require promise: no required dependency ${h.name}${R} found`)}}s.add(n);for(let h of n.dependencies.values())n.peerNames.has(h.name)||a(h,p,n);s.delete(n)};return a(t,t.dependencies,t),e.join(`
`)},wTt=(t,e)=>{let{identName:r,name:s,reference:a,peerNames:n}=t,c={name:s,references:new Set([a]),locator:LY(r,a),ident:gxe(r,a),dependencies:new Map,originalDependencies:new Map,hoistedDependencies:new Map,peerNames:new Set(n),reasons:new Map,decoupled:!0,isHoistBorder:!0,hoistPriority:0,dependencyKind:1,hoistedFrom:new Map,hoistedTo:new Map},f=new Map([[t,c]]),p=(h,E)=>{let C=f.get(h),S=!!C;if(!C){let{name:P,identName:I,reference:R,peerNames:N,hoistPriority:U,dependencyKind:W}=h,te=e.hoistingLimits.get(E.locator);C={name:P,references:new Set([R]),locator:LY(I,R),ident:gxe(I,R),dependencies:new Map,originalDependencies:new Map,hoistedDependencies:new Map,peerNames:new Set(N),reasons:new Map,decoupled:!0,isHoistBorder:te?te.has(P):!1,hoistPriority:U||0,dependencyKind:W||0,hoistedFrom:new Map,hoistedTo:new Map},f.set(h,C)}if(E.dependencies.set(h.name,C),E.originalDependencies.set(h.name,C),S){let P=new Set,I=R=>{if(!P.has(R)){P.add(R),R.decoupled=!1;for(let N of R.dependencies.values())R.peerNames.has(N.name)||I(N)}};I(C)}else for(let P of h.dependencies)p(P,C)};for(let h of t.dependencies)p(h,c);return c},_Y=t=>t.substring(0,t.indexOf("@",1)),BTt=t=>{let e={name:t.name,identName:_Y(t.locator),references:new Set(t.references),dependencies:new Set},r=new Set([t]),s=(a,n,c)=>{let f=r.has(a),p;if(n===a)p=c;else{let{name:h,references:E,locator:C}=a;p={name:h,identName:_Y(C),references:E,dependencies:new Set}}if(c.dependencies.add(p),!f){r.add(a);for(let h of a.dependencies.values())a.peerNames.has(h.name)||s(h,a,p);r.delete(a)}};for(let a of t.dependencies.values())s(a,t,e);return e},vTt=t=>{let e=new Map,r=new Set([t]),s=c=>`${c.name}@${c.ident}`,a=c=>{let f=s(c),p=e.get(f);return p||(p={dependents:new Set,peerDependents:new Set,hoistPriority:0},e.set(f,p)),p},n=(c,f)=>{let p=!!r.has(f);if(a(f).dependents.add(c.ident),!p){r.add(f);for(let E of f.dependencies.values()){let C=a(E);C.hoistPriority=Math.max(C.hoistPriority,E.hoistPriority),f.peerNames.has(E.name)?C.peerDependents.add(f.ident):n(f,E)}}};for(let c of t.dependencies.values())t.peerNames.has(c.name)||n(t,c);return e},Io=t=>{if(!t)return"none";let e=t.indexOf("@",1),r=t.substring(0,e);r.endsWith("$wsroot$")&&(r=`wh:${r.replace("$wsroot$","")}`);let s=t.substring(e+1);if(s==="workspace:.")return".";if(s){let a=(s.indexOf("#")>0?s.split("#")[1]:s).replace("npm:","");return s.startsWith("virtual")&&(r=`v:${r}`),a.startsWith("workspace")&&(r=`w:${r}`,a=""),`${r}${a?`@${a}`:""}`}else return`${r}`};var GD=t=>{let e=0,r=(a,n,c="")=>{if(e>5e4||n.has(a))return"";e++;let f=Array.from(a.dependencies.values()).sort((h,E)=>h.name===E.name?0:h.name>E.name?1:-1),p="";n.add(a);for(let h=0;h<f.length;h++){let E=f[h];if(!a.peerNames.has(E.name)&&E!==a){let C=a.reasons.get(E.name),S=_Y(E.locator);p+=`${c}${h<f.length-1?"\u251C\u2500":"\u2514\u2500"}${(n.has(E)?">":"")+(S!==E.name?`a:${E.name}:`:"")+Io(E.locator)+(C?` ${C}`:"")}
`,p+=r(E,n,`${c}${h<f.length-1?"\u2502 ":" "}`)}}return n.delete(a),p};return r(t,new Set)+(e>5e4?`
Tree is too large, part of the tree has been dunped
2025-04-11 10:05:45 -04:00
`:"")};var WD=(s=>(s.WORKSPACES="workspaces",s.DEPENDENCIES="dependencies",s.NONE="none",s))(WD||{}),Exe="node_modules",ng="$wsroot$";var YD=(t,e)=>{let{packageTree:r,hoistingLimits:s,errors:a,preserveSymlinksRequired:n}=DTt(t,e),c=null;if(a.length===0){let f=mxe(r,{hoistingLimits:s});c=PTt(t,f,e)}return{tree:c,errors:a,preserveSymlinksRequired:n}},gA=t=>`${t.name}@${t.reference}`,HY=t=>{let e=new Map;for(let[r,s]of t.entries())if(!s.dirList){let a=e.get(s.locator);a||(a={target:s.target,linkType:s.linkType,locations:[],aliases:s.aliases},e.set(s.locator,a)),a.locations.push(r)}for(let r of e.values())r.locations=r.locations.sort((s,a)=>{let n=s.split(K.delimiter).length,c=a.split(K.delimiter).length;return a===s?0:n!==c?c-n:a>s?1:-1});return e},Ixe=(t,e)=>{let r=q.isVirtualLocator(t)?q.devirtualizeLocator(t):t,s=q.isVirtualLocator(e)?q.devirtualizeLocator(e):e;return q.areLocatorsEqual(r,s)},UY=(t,e,r,s)=>{if(t.linkType!=="SOFT")return!1;let a=ue.toPortablePath(r.resolveVirtual&&e.reference&&e.reference.startsWith("virtual:")?r.resolveVirtual(t.packageLocation):t.packageLocation);return K.contains(s,a)===null},STt=t=>{let e=t.getPackageInformation(t.topLevel);if(e===null)throw new Error("Assertion failed: Expected the top-level package to have been registered");if(t.findPackageLocator(e.packageLocation)===null)throw new Error("Assertion failed: Expected the top-level package to have a physical locator");let s=ue.toPortablePath(e.packageLocation.slice(0,-1)),a=new Map,n={children:new Map},c=t.getDependencyTreeRoots(),f=new Map,p=new Set,h=(S,P)=>{let I=gA(S);if(p.has(I))return;p.add(I);let R=t.getPackageInformation(S);if(R){let N=P?gA(P):"";if(gA(S)!==N&&R.linkType==="SOFT"&&!S.reference.startsWith("link:")&&!UY(R,S,t,s)){let U=Cxe(R,S,t);(!f.get(U)||S.reference.startsWith("workspace:"))&&f.set(U,S)}for(let[U,W]of R.packageDependencies)W!==null&&(R.packagePeers.has(U)||h(t.getLocator(U,W),S))}};for(let S of c)h(S,null);let E=s.split(K.sep);for(let S of f.values()){let P=t.getPackageInformation(S),R=ue.toPortablePath(P.packageLocation.slice(0,-1)).split(K.sep).slice(E.length),N=n;for(let U of R){let W=N.children.get(U);W||(W={children:new Map},N.children.set(U,W)),N=W}N.workspaceLocator=S}let C=(S,P)=>{if(S.workspaceLocator){let I=gA(P),R=a.get(I);R||(R=new Set,a.set(I,R)),R.add(S.workspaceLocator)}for(let I of S.children.values())C(I,S.workspaceLocator||P)};for(let S of n.children.values())C(S,n.workspaceLocator);return a},DTt=(t,e)=>{let r=[],s=!1,a=new Map,n=STt(t),c=t.getPackageInformation(t.topLevel);if(c===null)throw new Error("Assertion failed: Expected the top-level package to have been registered");let f=t.findPackageLocator(c.packageLocation);if(f===null)throw new Error("Assertion failed: Expected the top-level package to have a physical locator");let p=ue.toPortablePath(c.packageLocation.slice(0,-1)),h={name:f.name,identName:f.name,reference:f.reference,peerNames:c.packagePeers,dependencies:new Set,dependencyKind:1},E=new Map,C=(P,I)=>`${gA(I)}:${P}`,S=(P,I,R,N,U,W,te,ie)=>{let Ae=C(P,R),ce=E.get(Ae),me=!!ce;!me&&R.name===f.name&&R.reference===f.reference&&(ce=h,E.set(Ae,h));let pe=UY(I,R,t,p);if(!ce){let fe=0;pe?fe=2:I.linkType==="SOFT"&&R.name.endsWith(ng)&&(fe=1),ce={name:P,identName:R.name,reference:R.reference,dependencies:new Set,peerNames:fe===1?new Set:I.packagePeers,dependencyKind:fe},E.set(Ae,ce)}let Be;if(pe?Be=2:U.linkType==="SOFT"?Be=1:Be=0,ce.hoistPriority=Math.max(ce.hoistPriority||0,Be),ie&&!pe){let fe=gA({name:N.identName,reference:N.reference}),se=a.get(fe)||new Set;a.set(fe,se),se.add(ce.name)}let Ce=new Map(I.packageDependencies);if(e.project){let fe=e.project.workspacesByCwd.get(ue.toPortablePath(I.packageLocation.slice(0,-1)));if(fe){let se=new Set([...Array.from(fe.manifest.peerDependencies.values(),X=>q.stringifyIdent(X)),...Array.from(fe.manifest.peerDependenciesMeta.keys())]);for(let X of se)Ce.has(X)||(Ce.set(X,W.get(X)||null),ce.peerNames.add(X))}}let g=gA({name:R.name.replace(ng,""),reference:R.reference}),we=n.get(g);if(we)for(let fe of we)Ce.set(`${fe.name}${ng}`,fe.reference);(I
2025-04-10 09:51:25 -04:00
`;for(let n=0,c=t.length;n<c;++n)a+=s+fN(String(n),t[n],e,s).replace(/^ +/,""),n+1<c&&(a+=","),a+=`
`;return a+=r,a+="]",a}function QTt(t,e,r){let s=Object.keys(t),a="";a+="{";for(let n=0,c=s.length,f=0;n<c;++n){let p=s[n],h=t[p];typeof h>"u"||(f!==0&&(a+=", "),a+=JSON.stringify(p),a+=": ",a+=fN(p,h,e,r).replace(/^ +/g,""),f+=1)}return a+="}",a}function TTt(t,e,r){let s=Object.keys(t),a=`${r} `,n="";n+=r,n+=`{
`;let c=0;for(let f=0,p=s.length;f<p;++f){let h=s[f],E=t[h];typeof E>"u"||(c!==0&&(n+=",",n+=`
`),n+=a,n+=JSON.stringify(h),n+=": ",n+=fN(h,E,e,a).replace(/^ +/g,""),c+=1)}return c!==0&&(n+=`
2025-04-11 10:05:45 -04:00
`),n+=r,n+="}",n}function fN(t,e,r,s){let{next:a}=wxe[r],n=a[t]||a["*"];return Bxe(e,n,s)}function Bxe(t,e,r){let{collapsed:s}=wxe[e];return Array.isArray(t)?s?xTt(t,e,r):kTt(t,e,r):typeof t=="object"&&t!==null?s?QTt(t,e,r):TTt(t,e,r):JSON.stringify(t)}function vxe(t){return Bxe(t,"TOP_LEVEL","")}function VD(t,e){let r=Array.from(t);Array.isArray(e)||(e=[e]);let s=[];for(let n of e)s.push(r.map(c=>n(c)));let a=r.map((n,c)=>c);return a.sort((n,c)=>{for(let f of s){let p=f[n]<f[c]?-1:f[n]>f[c]?1:0;if(p!==0)return p}return 0}),a.map(n=>r[n])}function RTt(t){let e=new Map,r=VD(t.fallbackExclusionList||[],[({name:s,reference:a})=>s,({name:s,reference:a})=>a]);for(let{name:s,reference:a}of r){let n=e.get(s);typeof n>"u"&&e.set(s,n=new Set),n.add(a)}return Array.from(e).map(([s,a])=>[s,Array.from(a)])}function FTt(t){return VD(t.fallbackPool||[],([e])=>e)}function NTt(t){let e=[],r=t.dependencyTreeRoots.find(s=>t.packageRegistry.get(s.name)?.get(s.reference)?.packageLocation==="./");for(let[s,a]of VD(t.packageRegistry,([n])=>n===null?"0":`1${n}`)){if(s===null)continue;let n=[];e.push([s,n]);for(let[c,{packageLocation:f,packageDependencies:p,packagePeers:h,linkType:E,discardFromLookup:C}]of VD(a,([S])=>S===null?"0":`1${S}`)){if(c===null)continue;let S=[];s!==null&&c!==null&&!p.has(s)&&S.push([s,c]);for(let[U,W]of p)S.push([U,W]);let P=VD(S,([U])=>U),I=h&&h.size>0?Array.from(h):void 0,N={packageLocation:f,packageDependencies:P,packagePeers:I,linkType:E,discardFromLookup:C||void 0};n.push([c,N]),r&&s===r.name&&c===r.reference&&e.unshift([null,[[null,N]]])}}return e}function KD(t){return{__info:["This file is automatically generated. Do not touch it, or risk","your modifications being lost."],dependencyTreeRoots:t.dependencyTreeRoots,enableTopLevelFallback:t.enableTopLevelFallback||!1,ignorePatternData:t.ignorePattern||null,pnpZipBackend:t.pnpZipBackend,fallbackExclusionList:RTt(t),fallbackPool:FTt(t),packageRegistryData:NTt(t)}}var bxe=et(Dxe());function Pxe(t,e){return[t?`${t}
2025-04-10 09:51:25 -04:00
`:"",`/* eslint-disable */
`,`// @ts-nocheck
`,`"use strict";
`,`
`,e,`
`,(0,bxe.default)()].join("")}function OTt(t){return JSON.stringify(t,null,2)}function LTt(t){return`'${t.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,`\\
`)}'`}function MTt(t){return[`const RAW_RUNTIME_STATE =
`,`${LTt(vxe(t))};
`,`function $$SETUP_STATE(hydrateRuntimeState, basePath) {
`,` return hydrateRuntimeState(JSON.parse(RAW_RUNTIME_STATE), {basePath: basePath || __dirname});
`,`}
`].join("")}function _Tt(){return[`function $$SETUP_STATE(hydrateRuntimeState, basePath) {
`,` const fs = require('fs');
`,` const path = require('path');
`,` const pnpDataFilepath = path.resolve(__dirname, ${JSON.stringify(Er.pnpData)});
`,` return hydrateRuntimeState(JSON.parse(fs.readFileSync(pnpDataFilepath, 'utf8')), {basePath: basePath || __dirname});
`,`}
2025-04-11 10:05:45 -04:00
`].join("")}function xxe(t){let e=KD(t),r=MTt(e);return Pxe(t.shebang,r)}function kxe(t){let e=KD(t),r=_Tt(),s=Pxe(t.shebang,r);return{dataFile:OTt(e),loaderFile:s}}bt();function qY(t,{basePath:e}){let r=ue.toPortablePath(e),s=K.resolve(r),a=t.ignorePatternData!==null?new RegExp(t.ignorePatternData):null,n=new Map,c=new Map(t.packageRegistryData.map(([C,S])=>[C,new Map(S.map(([P,I])=>{if(C===null!=(P===null))throw new Error("Assertion failed: The name and reference should be null, or neither should");let R=I.discardFromLookup??!1,N={name:C,reference:P},U=n.get(I.packageLocation);U?(U.discardFromLookup=U.discardFromLookup&&R,R||(U.locator=N)):n.set(I.packageLocation,{locator:N,discardFromLookup:R});let W=null;return[P,{packageDependencies:new Map(I.packageDependencies),packagePeers:new Set(I.packagePeers),linkType:I.linkType,discardFromLookup:R,get packageLocation(){return W||(W=K.join(s,I.packageLocation))}}]}))])),f=new Map(t.fallbackExclusionList.map(([C,S])=>[C,new Set(S)])),p=new Map(t.fallbackPool),h=t.dependencyTreeRoots,E=t.enableTopLevelFallback;return{basePath:r,dependencyTreeRoots:h,enableTopLevelFallback:E,fallbackExclusionList:f,pnpZipBackend:t.pnpZipBackend,fallbackPool:p,ignorePattern:a,packageLocatorsByLocations:n,packageRegistry:c}}bt();bt();var lh=ye("module"),qm=ye("url"),$Y=ye("util");var ra=ye("url");var Fxe=et(ye("assert"));var GY=Array.isArray,JD=JSON.stringify,zD=Object.getOwnPropertyNames,jm=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),WY=(t,e)=>RegExp.prototype.exec.call(t,e),YY=(t,...e)=>RegExp.prototype[Symbol.replace].apply(t,e),ig=(t,...e)=>String.prototype.endsWith.apply(t,e),VY=(t,...e)=>String.prototype.includes.apply(t,e),KY=(t,...e)=>String.prototype.lastIndexOf.apply(t,e),ZD=(t,...e)=>String.prototype.indexOf.apply(t,e),Qxe=(t,...e)=>String.prototype.replace.apply(t,e),sg=(t,...e)=>String.prototype.slice.apply(t,e),dA=(t,...e)=>String.prototype.startsWith.apply(t,e),Txe=Map,Rxe=JSON.parse;function XD(t,e,r){return class extends r{constructor(...s){super(e(...s)),this.code=t,this.name=`${r.name} [${t}]`}}}var Nxe=XD("ERR_PACKAGE_IMPORT_NOT_DEFINED",(t,e,r)=>`Package import specifier "${t}" is not defined${e?` in package ${e}package.json`:""} imported from ${r}`,TypeError),JY=XD("ERR_INVALID_MODULE_SPECIFIER",(t,e,r=void 0)=>`Invalid module "${t}" ${e}${r?` imported from ${r}`:""}`,TypeError),Oxe=XD("ERR_INVALID_PACKAGE_TARGET",(t,e,r,s=!1,a=void 0)=>{let n=typeof r=="string"&&!s&&r.length&&!dA(r,"./");return e==="."?((0,Fxe.default)(s===!1),`Invalid "exports" main target ${JD(r)} defined in the package config ${t}package.json${a?` imported from ${a}`:""}${n?'; targets must start with "./"':""}`):`Invalid "${s?"imports":"exports"}" target ${JD(r)} defined for '${e}' in the package config ${t}package.json${a?` imported from ${a}`:""}${n?'; targets must start with "./"':""}`},Error),$D=XD("ERR_INVALID_PACKAGE_CONFIG",(t,e,r)=>`Invalid package config ${t}${e?` while importing ${e}`:""}${r?`. ${r}`:""}`,Error),Lxe=XD("ERR_PACKAGE_PATH_NOT_EXPORTED",(t,e,r=void 0)=>e==="."?`No "exports" main defined in ${t}package.json${r?` imported from ${r}`:""}`:`Package subpath '${e}' is not defined by "exports" in ${t}package.json${r?` imported from ${r}`:""}`,Error);var pN=ye("url");function Mxe(t,e){let r=Object.create(null);for(let s=0;s<e.length;s++){let a=e[s];jm(t,a)&&(r[a]=t[a])}return r}var AN=new Txe;function UTt(t,e,r,s){let a=AN.get(t);if(a!==void 0)return a;let n=s(t);if(n===void 0){let P={pjsonPath:t,exists:!1,main:void 0,name:void 0,type:"none",exports:void 0,imports:void 0};return AN.set(t,P),P}let c;try{c=Rxe(n)}catch(P){throw new $D(t,(r?`"${e}" from `:"")+(0,pN.fileURLToPath)(r||e),P.message)}let{imports:f,main:p,name:h,type:E}=Mxe(c,["imports","main","name","type"]),C=jm(c,"exports")?c.exports:void 0;(typeof f!="object"||f===null)&&(f=void 0),typeof p!="string"&&(p=void 0),typeof h!="string"&&(h=void 0),E!=="module"&&E!=="commonjs"&&(E="none");let S={pjsonPath:t,exists:!0,main:p,name:h,type:E,exports:C,imports:f};return AN.set(t,S),S}function _xe(t,e){let r=new URL("./package.json"
2025-04-10 09:51:25 -04:00
`),r;c=t[++n]}else if(c===" "&&!s){a=!0;continue}else if(c==='"'){s=!s;continue}a?(r.push(c),a=!1):r[r.length-1]+=c}return s&&e.push(`invalid value for NODE_OPTIONS (unterminated string)
2025-04-11 10:05:45 -04:00
`),r}bt();var[yl,ah]=process.versions.node.split(".").map(t=>parseInt(t,10)),Zxe=yl>19||yl===19&&ah>=2||yl===18&&ah>=13,lmr=yl===20&&ah<6||yl===19&&ah>=3,cmr=yl>19||yl===19&&ah>=6,umr=yl>=21||yl===20&&ah>=10||yl===18&&ah>=19,fmr=yl>=21||yl===20&&ah>=10||yl===18&&ah>=20,Amr=yl>=22;function Xxe(t){if(process.env.WATCH_REPORT_DEPENDENCIES&&process.send)if(t=t.map(e=>ue.fromPortablePath(fo.resolveVirtual(ue.toPortablePath(e)))),Zxe)process.send({"watch:require":t});else for(let e of t)process.send({"watch:require":e})}function eV(t,e){let r=Number(process.env.PNP_ALWAYS_WARN_ON_FALLBACK)>0,s=Number(process.env.PNP_DEBUG_LEVEL),a=/^(?![a-zA-Z]:[\\/]|\\\\|\.{0,2}(?:\/|$))((?:node:)?(?:@[^/]+\/)?[^/]+)\/*(.*|)$/,n=/^(\/|\.{1,2}(\/|$))/,c=/\/$/,f=/^\.{0,2}\//,p={name:null,reference:null},h=[],E=new Set;if(t.enableTopLevelFallback===!0&&h.push(p),e.compatibilityMode!==!1)for(let Fe of["react-scripts","gatsby"]){let Ne=t.packageRegistry.get(Fe);if(Ne)for(let Pe of Ne.keys()){if(Pe===null)throw new Error("Assertion failed: This reference shouldn't be null");h.push({name:Fe,reference:Pe})}}let{ignorePattern:C,packageRegistry:S,packageLocatorsByLocations:P}=t;function I(Fe,Ne){return{fn:Fe,args:Ne,error:null,result:null}}function R(Fe){let Ne=process.stderr?.hasColors?.()??process.stdout.isTTY,Pe=(it,_e)=>`\x1B[${it}m${_e}\x1B[0m`,Ye=Fe.error;console.error(Ye?Pe("31;1",`\u2716 ${Fe.error?.message.replace(/\n.*/s,"")}`):Pe("33;1","\u203C Resolution")),Fe.args.length>0&&console.error();for(let it of Fe.args)console.error(` ${Pe("37;1","In \u2190")} ${(0,$Y.inspect)(it,{colors:Ne,compact:!0})}`);Fe.result&&(console.error(),console.error(` ${Pe("37;1","Out \u2192")} ${(0,$Y.inspect)(Fe.result,{colors:Ne,compact:!0})}`));let ke=new Error().stack.match(/(?<=^ +)at.*/gm)?.slice(2)??[];if(ke.length>0){console.error();for(let it of ke)console.error(` ${Pe("38;5;244",it)}`)}console.error()}function N(Fe,Ne){if(e.allowDebug===!1)return Ne;if(Number.isFinite(s)){if(s>=2)return(...Pe)=>{let Ye=I(Fe,Pe);try{return Ye.result=Ne(...Pe)}catch(ke){throw Ye.error=ke}finally{R(Ye)}};if(s>=1)return(...Pe)=>{try{return Ne(...Pe)}catch(Ye){let ke=I(Fe,Pe);throw ke.error=Ye,R(ke),Ye}}}return Ne}function U(Fe){let Ne=g(Fe);if(!Ne)throw ds("INTERNAL","Couldn't find a matching entry in the dependency tree for the specified parent (this is probably an internal error)");return Ne}function W(Fe){if(Fe.name===null)return!0;for(let Ne of t.dependencyTreeRoots)if(Ne.name===Fe.name&&Ne.reference===Fe.reference)return!0;return!1}let te=new Set(["node","require",...zxe("--conditions")]);function ie(Fe,Ne=te,Pe){let Ye=fe(K.join(Fe,"internal.js"),{resolveIgnored:!0,includeDiscardFromLookup:!0});if(Ye===null)throw ds("INTERNAL",`The locator that owns the "${Fe}" path can't be found inside the dependency tree (this is probably an internal error)`);let{packageLocation:ke}=U(Ye),it=K.join(ke,Er.manifest);if(!e.fakeFs.existsSync(it))return null;let _e=JSON.parse(e.fakeFs.readFileSync(it,"utf8"));if(_e.exports==null)return null;let x=K.contains(ke,Fe);if(x===null)throw ds("INTERNAL","unqualifiedPath doesn't contain the packageLocation (this is probably an internal error)");x!=="."&&!f.test(x)&&(x=`./${x}`);try{let w=Gxe({packageJSONUrl:(0,qm.pathToFileURL)(ue.fromPortablePath(it)),packageSubpath:x,exports:_e.exports,base:Pe?(0,qm.pathToFileURL)(ue.fromPortablePath(Pe)):null,conditions:Ne});return ue.toPortablePath((0,qm.fileURLToPath)(w))}catch(w){throw ds("EXPORTS_RESOLUTION_FAILED",w.message,{unqualifiedPath:cf(Fe),locator:Ye,pkgJson:_e,subpath:cf(x),conditions:Ne},w.code)}}function Ae(Fe,Ne,{extensions:Pe}){let Ye;try{Ne.push(Fe),Ye=e.fakeFs.statSync(Fe)}catch{}if(Ye&&!Ye.isDirectory())return e.fakeFs.realpathSync(Fe);if(Ye&&Ye.isDirectory()){let ke;try{ke=JSON.parse(e.fakeFs.readFileSync(K.join(Fe,Er.manifest),"utf8"))}catch{}let it;if(ke&&ke.main&&(it=K.resolve(Fe,ke.main)),it&&it!==Fe){let _e=Ae(it,Ne,{extensions:Pe});if(_e!==null)return _e}}for(let ke=0,it=Pe.length;ke<it;ke++){let _e=`${Fe}${Pe[ke]}`;if(Ne.push(_e),e.fakeFs.existsSync(_e))return _e}if(Ye&&Ye.isDir
2025-04-10 09:51:25 -04:00
Require request: "${Ye}"
Required by: ${ke}
`,{request:Ye,issuer:ke});return ue.toPortablePath(x)}let it,_e=Fe.match(a);if(_e){if(!Ne)throw ds("API_ERROR","The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute",{request:Ye,issuer:ke});let[,x,w]=_e,b=fe(Ne);if(!b){let Te=me(Fe,Ne);if(Te===!1)throw ds("BUILTIN_NODE_RESOLUTION_FAILED",`The builtin node resolution algorithm was unable to resolve the requested module (it didn't go through the pnp resolver because the issuer doesn't seem to be part of the Yarn-managed dependency tree).
Require path: "${Ye}"
Required by: ${ke}
`,{request:Ye,issuer:ke});return ue.toPortablePath(Te)}let F=U(b).packageDependencies.get(x),z=null;if(F==null&&b.name!==null){let Te=t.fallbackExclusionList.get(b.name);if(!Te||!Te.has(b.reference)){for(let Et=0,qt=h.length;Et<qt;++Et){let Pt=U(h[Et]).packageDependencies.get(x);if(Pt!=null){r?z=Pt:F=Pt;break}}if(t.enableTopLevelFallback&&F==null&&z===null){let Et=t.fallbackPool.get(x);Et!=null&&(z=Et)}}}let Z=null;if(F===null)if(W(b))Z=ds("MISSING_PEER_DEPENDENCY",`Your application tried to access ${x} (a peer dependency); this isn't allowed as there is no ancestor to satisfy the requirement. Use a devDependency if needed.
Required package: ${x}${x!==Ye?` (via "${Ye}")`:""}
Required by: ${ke}
`,{request:Ye,issuer:ke,dependencyName:x});else{let Te=Ee(x,b);Te.every(lt=>W(lt))?Z=ds("MISSING_PEER_DEPENDENCY",`${b.name} tried to access ${x} (a peer dependency) but it isn't provided by your application; this makes the require call ambiguous and unsound.
Required package: ${x}${x!==Ye?` (via "${Ye}")`:""}
Required by: ${b.name}@${b.reference} (via ${ke})
${Te.map(lt=>`Ancestor breaking the chain: ${lt.name}@${lt.reference}
`).join("")}
`,{request:Ye,issuer:ke,issuerLocator:Object.assign({},b),dependencyName:x,brokenAncestors:Te}):Z=ds("MISSING_PEER_DEPENDENCY",`${b.name} tried to access ${x} (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.
Required package: ${x}${x!==Ye?` (via "${Ye}")`:""}
Required by: ${b.name}@${b.reference} (via ${ke})
${Te.map(lt=>`Ancestor breaking the chain: ${lt.name}@${lt.reference}
`).join("")}
`,{request:Ye,issuer:ke,issuerLocator:Object.assign({},b),dependencyName:x,brokenAncestors:Te})}else F===void 0&&(!Pe&&(0,lh.isBuiltin)(Fe)?W(b)?Z=ds("UNDECLARED_DEPENDENCY",`Your application tried to access ${x}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${x} isn't otherwise declared in your dependencies, this makes the require call ambiguous and unsound.
Required package: ${x}${x!==Ye?` (via "${Ye}")`:""}
Required by: ${ke}
`,{request:Ye,issuer:ke,dependencyName:x}):Z=ds("UNDECLARED_DEPENDENCY",`${b.name} tried to access ${x}. While this module is usually interpreted as a Node builtin, your resolver is running inside a non-Node resolution context where such builtins are ignored. Since ${x} isn't otherwise declared in ${b.name}'s dependencies, this makes the require call ambiguous and unsound.
Required package: ${x}${x!==Ye?` (via "${Ye}")`:""}
Required by: ${ke}
`,{request:Ye,issuer:ke,issuerLocator:Object.assign({},b),dependencyName:x}):W(b)?Z=ds("UNDECLARED_DEPENDENCY",`Your application tried to access ${x}, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound.
Required package: ${x}${x!==Ye?` (via "${Ye}")`:""}
Required by: ${ke}
`,{request:Ye,issuer:ke,dependencyName:x}):Z=ds("UNDECLARED_DEPENDENCY",`${b.name} tried to access ${x}, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
Required package: ${x}${x!==Ye?` (via "${Ye}")`:""}
Required by: ${b.name}@${b.reference} (via ${ke})
`,{request:Ye,issuer:ke,issuerLocator:Object.assign({},b),dependencyName:x}));if(F==null){if(z===null||Z===null)throw Z||new Error("Assertion failed: Expected an error to have been set");F=z;let Te=Z.message.replace(/\n.*/g,"");Z.message=Te,!E.has(Te)&&s!==0&&(E.add(Te),process.emitWarning(Z))}let $=Array.isArray(F)?{name:F[0],reference:F[1]}:{name:x,reference:F},oe=U($);if(!oe.packageLocation)throw ds("MISSING_DEPENDENCY",`A dependency seems valid but didn't get installed for some reason. This might be caused by a partial install, such as dev vs prod.
Required package: ${$.name}@${$.reference}${$.name!==Ye?` (via "${Ye}")`:""}
Required by: ${b.name}@${b.reference} (via ${ke})
2025-04-11 10:05:45 -04:00
`,{request:Ye,issuer:ke,dependencyLocator:Object.assign({},$)});let xe=oe.packageLocation;w?it=K.join(xe,w):it=xe}else if(K.isAbsolute(Fe))it=K.normalize(Fe);else{if(!Ne)throw ds("API_ERROR","The resolveToUnqualified function must be called with a valid issuer when the path isn't a builtin nor absolute",{request:Ye,issuer:ke});let x=K.resolve(Ne);Ne.match(c)?it=K.normalize(K.join(x,Fe)):it=K.normalize(K.join(K.dirname(x),Fe))}return K.normalize(it)}function De(Fe,Ne,Pe=te,Ye){if(n.test(Fe))return Ne;let ke=ie(Ne,Pe,Ye);return ke?K.normalize(ke):Ne}function Re(Fe,{extensions:Ne=Object.keys(lh.Module._extensions)}={}){let Pe=[],Ye=Ae(Fe,Pe,{extensions:Ne});if(Ye)return K.normalize(Ye);{Xxe(Pe.map(_e=>ue.fromPortablePath(_e)));let ke=cf(Fe),it=fe(Fe);if(it){let{packageLocation:_e}=U(it),x=!0;try{e.fakeFs.accessSync(_e)}catch(w){if(w?.code==="ENOENT")x=!1;else{let b=(w?.message??w??"empty exception thrown").replace(/^[A-Z]/,y=>y.toLowerCase());throw ds("QUALIFIED_PATH_RESOLUTION_FAILED",`Required package exists but could not be accessed (${b}).
2025-04-10 09:51:25 -04:00
Missing package: ${it.name}@${it.reference}
Expected package location: ${cf(_e)}
`,{unqualifiedPath:ke,extensions:Ne})}}if(!x){let w=_e.includes("/unplugged/")?"Required unplugged package missing from disk. This may happen when switching branches without running installs (unplugged packages must be fully materialized on disk to work).":"Required package missing from disk. If you keep your packages inside your repository then restarting the Node process may be enough. Otherwise, try to run an install first.";throw ds("QUALIFIED_PATH_RESOLUTION_FAILED",`${w}
Missing package: ${it.name}@${it.reference}
Expected package location: ${cf(_e)}
`,{unqualifiedPath:ke,extensions:Ne})}}throw ds("QUALIFIED_PATH_RESOLUTION_FAILED",`Qualified path resolution failed: we looked for the following paths, but none could be accessed.
Source path: ${ke}
${Pe.map(_e=>`Not found: ${cf(_e)}
2025-04-11 10:05:45 -04:00
`).join("")}`,{unqualifiedPath:ke,extensions:Ne})}}function gt(Fe,Ne,Pe){if(!Ne)throw new Error("Assertion failed: An issuer is required to resolve private import mappings");let Ye=Wxe({name:Fe,base:(0,qm.pathToFileURL)(ue.fromPortablePath(Ne)),conditions:Pe.conditions??te,readFileSyncFn:se});if(Ye instanceof URL)return Re(ue.toPortablePath((0,qm.fileURLToPath)(Ye)),{extensions:Pe.extensions});if(Ye.startsWith("#"))throw new Error("Mapping from one private import to another isn't allowed");return j(Ye,Ne,Pe)}function j(Fe,Ne,Pe={}){try{if(Fe.startsWith("#"))return gt(Fe,Ne,Pe);let{considerBuiltins:Ye,extensions:ke,conditions:it}=Pe,_e=X(Fe,Ne,{considerBuiltins:Ye});if(Fe==="pnpapi")return _e;if(_e===null)return null;let x=()=>Ne!==null?pe(Ne):!1,w=(!Ye||!(0,lh.isBuiltin)(Fe))&&!x()?De(Fe,_e,it,Ne):_e;return Re(w,{extensions:ke})}catch(Ye){throw Object.hasOwn(Ye,"pnpCode")&&Object.assign(Ye.data,{request:cf(Fe),issuer:Ne&&cf(Ne)}),Ye}}function rt(Fe){let Ne=K.normalize(Fe),Pe=fo.resolveVirtual(Ne);return Pe!==Ne?Pe:null}return{VERSIONS:Be,topLevel:Ce,getLocator:(Fe,Ne)=>Array.isArray(Ne)?{name:Ne[0],reference:Ne[1]}:{name:Fe,reference:Ne},getDependencyTreeRoots:()=>[...t.dependencyTreeRoots],getAllLocators(){let Fe=[];for(let[Ne,Pe]of S)for(let Ye of Pe.keys())Ne!==null&&Ye!==null&&Fe.push({name:Ne,reference:Ye});return Fe},getPackageInformation:Fe=>{let Ne=g(Fe);if(Ne===null)return null;let Pe=ue.fromPortablePath(Ne.packageLocation);return{...Ne,packageLocation:Pe}},findPackageLocator:Fe=>fe(ue.toPortablePath(Fe)),resolveToUnqualified:N("resolveToUnqualified",(Fe,Ne,Pe)=>{let Ye=Ne!==null?ue.toPortablePath(Ne):null,ke=X(ue.toPortablePath(Fe),Ye,Pe);return ke===null?null:ue.fromPortablePath(ke)}),resolveUnqualified:N("resolveUnqualified",(Fe,Ne)=>ue.fromPortablePath(Re(ue.toPortablePath(Fe),Ne))),resolveRequest:N("resolveRequest",(Fe,Ne,Pe)=>{let Ye=Ne!==null?ue.toPortablePath(Ne):null,ke=j(ue.toPortablePath(Fe),Ye,Pe);return ke===null?null:ue.fromPortablePath(ke)}),resolveVirtual:N("resolveVirtual",Fe=>{let Ne=rt(ue.toPortablePath(Fe));return Ne!==null?ue.fromPortablePath(Ne):null})}}bt();var $xe=(t,e,r)=>{let s=KD(t),a=qY(s,{basePath:e}),n=ue.join(e,Er.pnpCjs);return eV(a,{fakeFs:r,pnpapiResolution:n})};var rV=et(tke());Wt();var mA={};Vt(mA,{checkManifestCompatibility:()=>rke,extractBuildRequest:()=>hN,getExtractHint:()=>nV,hasBindingGyp:()=>iV});Ve();bt();function rke(t){return q.isPackageCompatible(t,As.getArchitectureSet())}function hN(t,e,r,{configuration:s}){let a=[];for(let n of["preinstall","install","postinstall"])e.manifest.scripts.has(n)&&a.push({type:0,script:n});return!e.manifest.scripts.has("install")&&e.misc.hasBindingGyp&&a.push({type:1,script:"node-gyp rebuild"}),a.length===0?null:t.linkType!=="HARD"?{skipped:!0,explain:n=>n.reportWarningOnce(6,`${q.prettyLocator(s,t)} lists build scripts, but is referenced through a soft link. Soft links don't support build scripts, so they'll be ignored.`)}:r&&r.built===!1?{skipped:!0,explain:n=>n.reportInfoOnce(5,`${q.prettyLocator(s,t)} lists build scripts, but its build has been explicitly disabled through configuration.`)}:!s.get("enableScripts")&&!r.built?{skipped:!0,explain:n=>n.reportWarningOnce(4,`${q.prettyLocator(s,t)} lists build scripts, but all build scripts have been disabled.`)}:rke(t)?{skipped:!1,directives:a}:{skipped:!0,explain:n=>n.reportWarningOnce(76,`${q.prettyLocator(s,t)} The ${As.getArchitectureName()} architecture is incompatible with this package, build skipped.`)}}var XTt=new Set([".exe",".bin",".h",".hh",".hpp",".c",".cc",".cpp",".java",".jar",".node"]);function nV(t){return t.packageFs.getExtractHint({relevantExtensions:XTt})}function iV(t){let e=K.join(t.prefixPath,"binding.gyp");return t.packageFs.existsSync(e)}var nb={};Vt(nb,{getUnpluggedPath:()=>rb});Ve();bt();function rb(t,{configuration:e}){return K.resolve(e.get("pnpUnpluggedFolder"),q.slugifyLocator(t))}var $Tt=new Set([q.makeIdent(null,"open").identHash,q.makeIdent(null,"opn").identHash]),og=class{constructor(){this.mode="strict";this.pnpCache=new Map}getCustomDataKey(){return J
2025-04-10 09:51:25 -04:00
`,n+=`# cause your node_modules installation to become invalidated.
`,n+=`
`,n+=`__metadata:
`,n+=` version: ${gke}
`,n+=` nmMode: ${s.value}
`;let c=Array.from(e.keys()).sort(),f=q.stringifyLocator(t.topLevelWorkspace.anchoredLocator);for(let E of c){let C=e.get(E);n+=`
`,n+=`${JSON.stringify(E)}:
`,n+=` locations:
2025-04-11 10:05:45 -04:00
`;for(let S of C.locations){let P=K.contains(t.cwd,S);if(P===null)throw new Error(`Assertion failed: Expected the path to be within the project (${S})`);n+=` - ${JSON.stringify(P)}
2025-04-10 09:51:25 -04:00
`}if(C.aliases.length>0){n+=` aliases:
`;for(let S of C.aliases)n+=` - ${JSON.stringify(S)}
`}if(E===f&&r.size>0){n+=` bin:
2025-04-11 10:05:45 -04:00
`;for(let[S,P]of r){let I=K.contains(t.cwd,S);if(I===null)throw new Error(`Assertion failed: Expected the path to be within the project (${S})`);n+=` ${JSON.stringify(I)}:
`;for(let[R,N]of P){let U=K.relative(K.join(S,_i),N);n+=` ${JSON.stringify(R)}: ${JSON.stringify(U)}
`}}}}let p=t.cwd,h=K.join(p,_i,dke);a&&await le.removePromise(h),await le.changeFilePromise(h,n,{automaticNewlines:!0})}async function AV(t,{unrollAliases:e=!1}={}){let r=t.cwd,s=K.join(r,_i,dke),a;try{a=await le.statPromise(s)}catch{}if(!a)return null;let n=ls(await le.readFilePromise(s,"utf8"));if(n.__metadata.version>gke)return null;let c=n.__metadata.nmMode||"classic",f=new Map,p=new Map;delete n.__metadata;for(let[h,E]of Object.entries(n)){let C=E.locations.map(P=>K.join(r,P)),S=E.bin;if(S)for(let[P,I]of Object.entries(S)){let R=K.join(r,ue.toPortablePath(P)),N=je.getMapWithDefault(p,R);for(let[U,W]of Object.entries(I))N.set(U,ue.toPortablePath([R,_i,W].join(K.sep)))}if(f.set(h,{target:vt.dot,linkType:"HARD",locations:C,aliases:E.aliases||[]}),e&&E.aliases)for(let P of E.aliases){let{scope:I,name:R}=q.parseLocator(h),N=q.makeLocator(q.makeIdent(I,R),P),U=q.stringifyLocator(N);f.set(U,{target:vt.dot,linkType:"HARD",locations:C,aliases:[]})}}return{locatorMap:f,binSymlinks:p,locationTree:mke(f,{skipPrefix:t.cwd}),nmMode:c,mtimeMs:a.mtimeMs}}var kw=async(t,e)=>{if(t.split(K.sep).indexOf(_i)<0)throw new Error(`Assertion failed: trying to remove dir that doesn't contain node_modules: ${t}`);try{let r;if(!e.innerLoop&&(r=await le.lstatPromise(t),!r.isDirectory()&&!r.isSymbolicLink()||r.isSymbolicLink()&&!e.isWorkspaceDir)){await le.unlinkPromise(t);return}let s=await le.readdirPromise(t,{withFileTypes:!0});for(let n of s){let c=K.join(t,n.name);n.isDirectory()?(n.name!==_i||e&&e.innerLoop)&&await kw(c,{innerLoop:!0,contentsOnly:!1}):await le.unlinkPromise(c)}let a=!e.innerLoop&&e.isWorkspaceDir&&r?.isSymbolicLink();!e.contentsOnly&&!a&&await le.rmdirPromise(t)}catch(r){if(r.code!=="ENOENT"&&r.code!=="ENOTEMPTY")throw r}},fke=4,dN=(t,{skipPrefix:e})=>{let r=K.contains(e,t);if(r===null)throw new Error(`Assertion failed: Writing attempt prevented to ${t} which is outside project root: ${e}`);let s=r.split(K.sep).filter(p=>p!==""),a=s.indexOf(_i),n=s.slice(0,a).join(K.sep),c=K.join(e,n),f=s.slice(a);return{locationRoot:c,segments:f}},mke=(t,{skipPrefix:e})=>{let r=new Map;if(t===null)return r;let s=()=>({children:new Map,linkType:"HARD"});for(let[a,n]of t.entries()){if(n.linkType==="SOFT"&&K.contains(e,n.target)!==null){let f=je.getFactoryWithDefault(r,n.target,s);f.locator=a,f.linkType=n.linkType}for(let c of n.locations){let{locationRoot:f,segments:p}=dN(c,{skipPrefix:e}),h=je.getFactoryWithDefault(r,f,s);for(let E=0;E<p.length;++E){let C=p[E];if(C!=="."){let S=je.getFactoryWithDefault(h.children,C,s);h.children.set(C,S),h=S}E===p.length-1&&(h.locator=a,h.linkType=n.linkType)}}}return r},gV=async(t,e,r)=>{if(process.platform==="win32"&&r==="junctions"){let s;try{s=await le.lstatPromise(t)}catch{}if(!s||s.isDirectory()){await le.symlinkPromise(t,e,"junction");return}}await le.symlinkPromise(K.relative(K.dirname(e),t),e)};async function yke(t,e,r){let s=K.join(t,`${pV.default.randomBytes(16).toString("hex")}.tmp`);try{await le.writeFilePromise(s,r);try{await le.linkPromise(s,e)}catch{}}finally{await le.unlinkPromise(s)}}async function vRt({srcPath:t,dstPath:e,entry:r,globalHardlinksStore:s,baseFs:a,nmMode:n}){if(r.kind==="file"){if(n.value==="hardlinks-global"&&s&&r.digest){let f=K.join(s,r.digest.substring(0,2),`${r.digest.substring(2)}.dat`),p;try{let h=await le.statPromise(f);if(h&&(!r.mtimeMs||h.mtimeMs>r.mtimeMs||h.mtimeMs<r.mtimeMs-CRt))if(await Nn.checksumFile(f,{baseFs:le,algorithm:"sha1"})!==r.digest){let C=K.join(s,`${pV.default.randomBytes(16).toString("hex")}.tmp`);await le.renamePromise(f,C);let S=await a.readFilePromise(t);await le.writeFilePromise(C,S);try{await le.linkPromise(C,f),r.mtimeMs=new Date().getTime(),await le.unlinkPromise(C)}catch{}}else r.mtimeMs||(r.mtimeMs=Math.ceil(h.mtimeMs));await le.linkPromise(f,e),p=!0}catch{p=!1}if(!p){let h=await a.readFilePromise(t);await yke(s,f,h),r.mtimeMs=new Date().getTime();try{await le.linkPromise(f,e)}catch(E){E&&E.code&&E.code=="EXDEV"&&(n.value="hardlinks-local",await a.copyFilePromise(t,e))}}}else await a.copyFilePromise(t,e);let c=r.mode&511;c!==420&&await
2025-04-10 09:51:25 -04:00
`)),process.env.YARN_IS_TEST_ENV)return process.env.YARN_INJECT_NPM_2FA_TOKEN||"";let{otp:s}=await(0,CV.prompt)({type:"password",name:"otp",message:"One-time password:",required:!0,onCancel:()=>process.exit(130)});return process.stdout.write(`
2025-04-11 10:05:45 -04:00
`),s}function EN(t){if(t.originalError?.name!=="HTTPError")return!1;try{return(t.originalError?.response.headers["www-authenticate"].split(/,\s*/).map(r=>r.toLowerCase())).includes("otp")}catch{return!1}}function Tw(t){return{"npm-otp":t}}var lb=class{supports(e,r){if(!e.reference.startsWith(si))return!1;let{selector:s,params:a}=q.parseRange(e.reference);return!(!bke.default.valid(s)||a===null||typeof a.__archiveUrl!="string")}getLocalPath(e,r){return null}async fetch(e,r){let s=r.checksums.get(e.locatorHash)||null,[a,n,c]=await r.cache.fetchPackageFromCache(e,s,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${q.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from the remote server`),loader:()=>this.fetchFromNetwork(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:q.getIdentVendorPath(e),checksum:c}}async fetchFromNetwork(e,r){let{params:s}=q.parseRange(e.reference);if(s===null||typeof s.__archiveUrl!="string")throw new Error("Assertion failed: The archiveUrl querystring parameter should have been available");let a=await Ym(s.__archiveUrl,{customErrorMessage:Wm,configuration:r.project.configuration,ident:e});return await hs.convertToZip(a,{configuration:r.project.configuration,prefixPath:q.getIdentVendorPath(e),stripComponents:1})}};Ve();var ub=class{supportsDescriptor(e,r){return!(!e.range.startsWith(si)||!q.tryParseDescriptor(e.range.slice(si.length),!0))}supportsLocator(e,r){return!1}shouldPersistResolution(e,r){throw new Error("Unreachable")}bindDescriptor(e,r,s){return e}getResolutionDependencies(e,r){let s=r.project.configuration.normalizeDependency(q.parseDescriptor(e.range.slice(si.length),!0));return r.resolver.getResolutionDependencies(s,r)}async getCandidates(e,r,s){let a=s.project.configuration.normalizeDependency(q.parseDescriptor(e.range.slice(si.length),!0));return await s.resolver.getCandidates(a,r,s)}async getSatisfying(e,r,s,a){let n=a.project.configuration.normalizeDependency(q.parseDescriptor(e.range.slice(si.length),!0));return a.resolver.getSatisfying(n,r,s,a)}resolve(e,r){throw new Error("Unreachable")}};Ve();Ve();var Pke=et(fi());var ch=class t{supports(e,r){if(!e.reference.startsWith(si))return!1;let s=new URL(e.reference);return!(!Pke.default.valid(s.pathname)||s.searchParams.has("__archiveUrl"))}getLocalPath(e,r){return null}async fetch(e,r){let s=r.checksums.get(e.locatorHash)||null,[a,n,c]=await r.cache.fetchPackageFromCache(e,s,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${q.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from the remote registry`),loader:()=>this.fetchFromNetwork(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:q.getIdentVendorPath(e),checksum:c}}async fetchFromNetwork(e,r){let s;try{s=await Ym(t.getLocatorUrl(e),{customErrorMessage:Wm,configuration:r.project.configuration,ident:e})}catch{s=await Ym(t.getLocatorUrl(e).replace(/%2f/g,"/"),{customErrorMessage:Wm,configuration:r.project.configuration,ident:e})}return await hs.convertToZip(s,{configuration:r.project.configuration,prefixPath:q.getIdentVendorPath(e),stripComponents:1})}static isConventionalTarballUrl(e,r,{configuration:s}){let a=Qw(e.scope,{configuration:s}),n=t.getLocatorUrl(e);return r=r.replace(/^https?:(\/\/(?:[^/]+\.)?npmjs.org(?:$|\/))/,"https:$1"),a=a.replace(/^https:\/\/registry\.npmjs\.org($|\/)/,"https://registry.yarnpkg.com$1"),r=r.replace(/^https:\/\/registry\.npmjs\.org($|\/)/,"https://registry.yarnpkg.com$1"),r===a+n||r===a+n.replace(/%2f/g,"/")}static getLocatorUrl(e){let r=Or.clean(e.reference.slice(si.length));if(r===null)throw new Yt(10,"The npm semver resolver got selected, but the version isn't semver");return`${mN(e)}/-/${e.name}-${r}.tgz`}};Ve();Ve();Ve();var BV=et(fi());var IN=q.makeIdent(null,"node-gyp"),KRt=/\b(node-gyp|prebuild-install)\b/,fb=class{supportsDescriptor(e,r){return e.range.startsWith(si)?!!Or.validRange(e.range.slice(si.length)):!1}supportsLocator(e,r){if(!e.reference.startsWith(si))return!1;l
https://docs.gitlab.com/ee/ci/secrets/id_token_authentication.html`);r={_type:kjt,subject:t,predicateType:Tjt,predicate:{buildType:`${Ojt}/${Ljt}`,builder:{id:`${Bt.CI_PROJECT_URL}/-/runners/${Bt.CI_RUNNER_ID}`},invocation:{configSource:{uri:`git+${Bt.CI_PROJECT_URL}`,digest:{sha1:Bt.CI_COMMIT_SHA},entryPoint:Bt.CI_JOB_NAME},parameters:{CI:Bt.CI,CI_API_GRAPHQL_URL:Bt.CI_API_GRAPHQL_URL,CI_API_V4_URL:Bt.CI_API_V4_URL,CI_BUILD_BEFORE_SHA:Bt.CI_BUILD_BEFORE_SHA,CI_BUILD_ID:Bt.CI_BUILD_ID,CI_BUILD_NAME:Bt.CI_BUILD_NAME,CI_BUILD_REF:Bt.CI_BUILD_REF,CI_BUILD_REF_NAME:Bt.CI_BUILD_REF_NAME,CI_BUILD_REF_SLUG:Bt.CI_BUILD_REF_SLUG,CI_BUILD_STAGE:Bt.CI_BUILD_STAGE,CI_COMMIT_BEFORE_SHA:Bt.CI_COMMIT_BEFORE_SHA,CI_COMMIT_BRANCH:Bt.CI_COMMIT_BRANCH,CI_COMMIT_REF_NAME:Bt.CI_COMMIT_REF_NAME,CI_COMMIT_REF_PROTECTED:Bt.CI_COMMIT_REF_PROTECTED,CI_COMMIT_REF_SLUG:Bt.CI_COMMIT_REF_SLUG,CI_COMMIT_SHA:Bt.CI_COMMIT_SHA,CI_COMMIT_SHORT_SHA:Bt.CI_COMMIT_SHORT_SHA,CI_COMMIT_TIMESTAMP:Bt.CI_COMMIT_TIMESTAMP,CI_COMMIT_TITLE:Bt.CI_COMMIT_TITLE,CI_CONFIG_PATH:Bt.CI_CONFIG_PATH,CI_DEFAULT_BRANCH:Bt.CI_DEFAULT_BRANCH,CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX:Bt.CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX,CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX:Bt.CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX,CI_DEPENDENCY_PROXY_SERVER:Bt.CI_DEPENDENCY_PROXY_SERVER,CI_DEPENDENCY_PROXY_USER:Bt.CI_DEPENDENCY_PROXY_USER,CI_JOB_ID:Bt.CI_JOB_ID,CI_JOB_NAME:Bt.CI_JOB_NAME,CI_JOB_NAME_SLUG:Bt.CI_JOB_NAME_SLUG,CI_JOB_STAGE:Bt.CI_JOB_STAGE,CI_JOB_STARTED_AT:Bt.CI_JOB_STARTED_AT,CI_JOB_URL:Bt.CI_JOB_URL,CI_NODE_TOTAL:Bt.CI_NODE_TOTAL,CI_PAGES_DOMAIN:Bt.CI_PAGES_DOMAIN,CI_PAGES_URL:Bt.CI_PAGES_URL,CI_PIPELINE_CREATED_AT:Bt.CI_PIPELINE_CREATED_AT,CI_PIPELINE_ID:Bt.CI_PIPELINE_ID,CI_PIPELINE_IID:Bt.CI_PIPELINE_IID,CI_PIPELINE_SOURCE:Bt.CI_PIPELINE_SOURCE,CI_PIPELINE_URL:Bt.CI_PIPELINE_URL,CI_PROJECT_CLASSIFICATION_LABEL:Bt.CI_PROJECT_CLASSIFICATION_LABEL,CI_PROJECT_DESCRIPTION:Bt.CI_PROJECT_DESCRIPTION,CI_PROJECT_ID:Bt.CI_PROJECT_ID,CI_PROJECT_NAME:Bt.CI_PROJECT_NAME,CI_PROJECT_NAMESPACE:Bt.CI_PROJECT_NAMESPACE,CI_PROJECT_NAMESPACE_ID:Bt.CI_PROJECT_NAMESPACE_ID,CI_PROJECT_PATH:Bt.CI_PROJECT_PATH,CI_PROJECT_PATH_SLUG:Bt.CI_PROJECT_PATH_SLUG,CI_PROJECT_REPOSITORY_LANGUAGES:Bt.CI_PROJECT_REPOSITORY_LANGUAGES,CI_PROJECT_ROOT_NAMESPACE:Bt.CI_PROJECT_ROOT_NAMESPACE,CI_PROJECT_TITLE:Bt.CI_PROJECT_TITLE,CI_PROJECT_URL:Bt.CI_PROJECT_URL,CI_PROJECT_VISIBILITY:Bt.CI_PROJECT_VISIBILITY,CI_REGISTRY:Bt.CI_REGISTRY,CI_REGISTRY_IMAGE:Bt.CI_REGISTRY_IMAGE,CI_REGISTRY_USER:Bt.CI_REGISTRY_USER,CI_RUNNER_DESCRIPTION:Bt.CI_RUNNER_DESCRIPTION,CI_RUNNER_ID:Bt.CI_RUNNER_ID,CI_RUNNER_TAGS:Bt.CI_RUNNER_TAGS,CI_SERVER_HOST:Bt.CI_SERVER_HOST,CI_SERVER_NAME:Bt.CI_SERVER_NAME,CI_SERVER_PORT:Bt.CI_SERVER_PORT,CI_SERVER_PROTOCOL:Bt.CI_SERVER_PROTOCOL,CI_SERVER_REVISION:Bt.CI_SERVER_REVISION,CI_SERVER_SHELL_SSH_HOST:Bt.CI_SERVER_SHELL_SSH_HOST,CI_SERVER_SHELL_SSH_PORT:Bt.CI_SERVER_SHELL_SSH_PORT,CI_SERVER_URL:Bt.CI_SERVER_URL,CI_SERVER_VERSION:Bt.CI_SERVER_VERSION,CI_SERVER_VERSION_MAJOR:Bt.CI_SERVER_VERSION_MAJOR,CI_SERVER_VERSION_MINOR:Bt.CI_SERVER_VERSION_MINOR,CI_SERVER_VERSION_PATCH:Bt.CI_SERVER_VERSION_PATCH,CI_TEMPLATE_REGISTRY_HOST:Bt.CI_TEMPLATE_REGISTRY_HOST,GITLAB_CI:Bt.GITLAB_CI,GITLAB_FEATURES:Bt.GITLAB_FEATURES,GITLAB_USER_ID:Bt.GITLAB_USER_ID,GITLAB_USER_LOGIN:Bt.GITLAB_USER_LOGIN,RUNNER_GENERATE_ARTIFACTS_METADATA:Bt.RUNNER_GENERATE_ARTIFACTS_METADATA},environment:{name:Bt.CI_RUNNER_DESCRIPTION,architecture:Bt.CI_RUNNER_EXECUTABLE_ARCH,server:Bt.CI_SERVER_URL,project:Bt.CI_PROJECT_PATH,job:{id:Bt.CI_JOB_ID},pipeline:{id:Bt.CI_PIPELINE_ID,ref:Bt.CI_CONFIG_PATH}}},metadata:{buildInvocationId:`${Bt.CI_JOB_URL}`,completeness:{parameters:!0,environment:!0,materials:!1},reproducible:!1},materials:[{uri:`git+${Bt.CI_PROJECT_URL}`,digest:{sha1:Bt.CI_COMMIT_SHA}}]}}}else throw new Yt(91,"Provenance generation is only supported in GitHub Actions and GitLab CI");return dOe.attest(Buffer.from(JSON.stringify(r)),xjt,e)};async function Mjt(t,e,{access:r,tag:s,registry:a,gitHead:n,provenance:c}){let f=t.manifest.name,
`;try{a=await le.readFilePromise(e,"utf8")}catch(n){if(n.code==="ENOENT")return a;throw n}return a}var mz={npmAlwaysAuth:{description:"URL of the selected npm registry (note: npm enterprise isn't supported)",type:"BOOLEAN",default:!1},npmAuthIdent:{description:"Authentication identity for the npm registry (_auth in npm and yarn v1)",type:"SECRET",default:null},npmAuthToken:{description:"Authentication token for the npm registry (_authToken in npm and yarn v1)",type:"SECRET",default:null}},COe={npmAuditRegistry:{description:"Registry to query for audit reports",type:"STRING",default:null},npmPublishRegistry:{description:"Registry to push packages to",type:"STRING",default:null},npmRegistryServer:{description:"URL of the selected npm registry (note: npm enterprise isn't supported)",type:"STRING",default:"https://registry.yarnpkg.com"}},Ujt={configuration:{...mz,...COe,npmScopes:{description:"Settings per package scope",type:"MAP",valueDefinition:{description:"",type:"SHAPE",properties:{...mz,...COe}}},npmRegistries:{description:"Settings per registry",type:"MAP",normalizeKeys:zc,valueDefinition:{description:"",type:"SHAPE",properties:{...mz}}}},fetchers:[lb,ch],resolvers:[ub,fb,Ab]},Hjt=Ujt;var bz={};Vt(bz,{NpmAuditCommand:()=>P1,NpmInfoCommand:()=>x1,NpmLoginCommand:()=>k1,NpmLogoutCommand:()=>T1,NpmPublishCommand:()=>R1,NpmTagAddCommand:()=>N1,NpmTagListCommand:()=>F1,NpmTagRemoveCommand:()=>O1,NpmWhoamiCommand:()=>L1,default:()=>Kjt,npmAuditTypes:()=>fP,npmAuditUtils:()=>ML});Ve();Ve();Wt();var Bz=et(Sa());Ul();var fP={};Vt(fP,{Environment:()=>cP,Severity:()=>uP});var cP=(s=>(s.All="all",s.Production="production",s.Development="development",s))(cP||{}),uP=(n=>(n.Info="info",n.Low="low",n.Moderate="moderate",n.High="high",n.Critical="critical",n))(uP||{});var ML={};Vt(ML,{allSeverities:()=>b1,getPackages:()=>wz,getReportTree:()=>Iz,getSeverityInclusions:()=>Ez,getTopLevelDependencies:()=>Cz});Ve();var wOe=et(fi());var b1=["info","low","moderate","high","critical"];function Ez(t){if(typeof t>"u")return new Set(b1);let e=b1.indexOf(t),r=b1.slice(e);return new Set(r)}function Iz(t){let e={},r={children:e};for(let[s,a]of je.sortMap(Object.entries(t),n=>n[0]))for(let n of je.sortMap(a,c=>`${c.id}`))e[`${s}/${n.id}`]={value:he.tuple(he.Type.IDENT,q.parseIdent(s)),children:{ID:typeof n.id<"u"&&{label:"ID",value:he.tuple(he.Type.ID,n.id)},Issue:{label:"Issue",value:he.tuple(he.Type.NO_HINT,n.title)},URL:typeof n.url<"u"&&{label:"URL",value:he.tuple(he.Type.URL,n.url)},Severity:{label:"Severity",value:he.tuple(he.Type.NO_HINT,n.severity)},"Vulnerable Versions":{label:"Vulnerable Versions",value:he.tuple(he.Type.RANGE,n.vulnerable_versions)},"Tree Versions":{label:"Tree Versions",children:[...n.versions].sort(wOe.default.compare).map(c=>({value:he.tuple(he.Type.REFERENCE,c)}))},Dependents:{label:"Dependents",children:je.sortMap(n.dependents,c=>q.stringifyLocator(c)).map(c=>({value:he.tuple(he.Type.LOCATOR,c)}))}}};return r}function Cz(t,e,{all:r,environment:s}){let a=[],n=r?t.workspaces:[e],c=["all","production"].includes(s),f=["all","development"].includes(s);for(let p of n)for(let h of p.anchoredPackage.dependencies.values())(p.manifest.devDependencies.has(h.identHash)?!f:!c)||a.push({workspace:p,dependency:h});return a}function wz(t,e,{recursive:r}){let s=new Map,a=new Set,n=[],c=(f,p)=>{let h=t.storedResolutions.get(p.descriptorHash);if(typeof h>"u")throw new Error("Assertion failed: The resolution should have been registered");if(!a.has(h))a.add(h);else return;let E=t.storedPackages.get(h);if(typeof E>"u")throw new Error("Assertion failed: The package should have been registered");if(q.ensureDevirtualizedLocator(E).reference.startsWith("npm:")&&E.version!==null){let S=q.stringifyIdent(E),P=je.getMapWithDefault(s,S);je.getArrayWithDefault(P,E.version).push(f)}if(r)for(let S of E.dependencies.values())n.push([E,S])};for(let{workspace:f,dependency:p}of e)n.push([f.anchoredLocator,p]);for(;n.length>0;){let[f,p]=n.shift();c(f,p)}return s}var P1=class extends ut{constructor(){super(...arguments);this.all=ge.Boolean("-A,--all",!1,{
2025-04-10 09:51:25 -04:00
This command checks for known security reports on the packages you use. The reports are by default extracted from the npm registry, and may or may not be relevant to your actual program (not all vulnerabilities affect all code paths).
For consistency with our other commands the default is to only check the direct dependencies for the active workspace. To extend this search to all workspaces, use \`-A,--all\`. To extend this search to both direct and transitive dependencies, use \`-R,--recursive\`.
Applying the \`--severity\` flag will limit the audit table to vulnerabilities of the corresponding severity and above. Valid values are ${b1.map(r=>`\`${r}\``).join(", ")}.
If the \`--json\` flag is set, Yarn will print the output exactly as received from the registry. Regardless of this flag, the process will exit with a non-zero exit code if a report is found for the selected packages.
If certain packages produce false positives for a particular environment, the \`--exclude\` flag can be used to exclude any number of packages from the audit. This can also be set in the configuration file with the \`npmAuditExcludePackages\` option.
If particular advisories are needed to be ignored, the \`--ignore\` flag can be used with Advisory ID's to ignore any number of advisories in the audit report. This can also be set in the configuration file with the \`npmAuditIgnoreAdvisories\` option.
To understand the dependency tree requiring vulnerable packages, check the raw report with the \`--json\` flag or use \`yarn why package\` to get more information as to who depends on them.
2025-04-11 10:05:45 -04:00
`,examples:[["Checks for known security issues with the installed packages. The output is a list of known issues.","yarn npm audit"],["Audit dependencies in all workspaces","yarn npm audit --all"],["Limit auditing to `dependencies` (excludes `devDependencies`)","yarn npm audit --environment production"],["Show audit report as valid JSON","yarn npm audit --json"],["Audit all direct and transitive dependencies","yarn npm audit --recursive"],["Output moderate (or more severe) vulnerabilities","yarn npm audit --severity moderate"],["Exclude certain packages","yarn npm audit --exclude package1 --exclude package2"],["Ignore specific advisories","yarn npm audit --ignore 1234567 --ignore 7654321"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState();let n=Cz(s,a,{all:this.all,environment:this.environment}),c=wz(s,n,{recursive:this.recursive}),f=Array.from(new Set([...r.get("npmAuditExcludePackages"),...this.excludes])),p=Object.create(null);for(let[N,U]of c)f.some(W=>Bz.default.isMatch(N,W))||(p[N]=[...U.keys()]);let h=pi.getAuditRegistry({configuration:r}),E,C=await uA.start({configuration:r,stdout:this.context.stdout},async()=>{let N=an.post("/-/npm/v1/security/advisories/bulk",p,{authType:an.AuthType.BEST_EFFORT,configuration:r,jsonResponse:!0,registry:h}),U=this.noDeprecations?[]:await Promise.all(Array.from(Object.entries(p),async([te,ie])=>{let Ae=await an.getPackageMetadata(q.parseIdent(te),{project:s});return je.mapAndFilter(ie,ce=>{let{deprecated:me}=Ae.versions[ce];return me?[te,ce,me]:je.mapAndFilter.skip})})),W=await N;for(let[te,ie,Ae]of U.flat(1))Object.hasOwn(W,te)&&W[te].some(ce=>Or.satisfiesWithPrereleases(ie,ce.vulnerable_versions))||(W[te]??=[],W[te].push({id:`${te} (deprecation)`,title:(typeof Ae=="string"?Ae:"").trim()||"This package has been deprecated.",severity:"moderate",vulnerable_versions:ie}));E=W});if(C.hasErrors())return C.exitCode();let S=Ez(this.severity),P=Array.from(new Set([...r.get("npmAuditIgnoreAdvisories"),...this.ignores])),I=Object.create(null);for(let[N,U]of Object.entries(E)){let W=U.filter(te=>!Bz.default.isMatch(`${te.id}`,P)&&S.has(te.severity));W.length>0&&(I[N]=W.map(te=>{let ie=c.get(N);if(typeof ie>"u")throw new Error("Assertion failed: Expected the registry to only return packages that were requested");let Ae=[...ie.keys()].filter(me=>Or.satisfiesWithPrereleases(me,te.vulnerable_versions)),ce=new Map;for(let me of Ae)for(let pe of ie.get(me))ce.set(pe.locatorHash,pe);return{...te,versions:Ae,dependents:[...ce.values()]}}))}let R=Object.keys(I).length>0;return R?(ks.emitTree(Iz(I),{configuration:r,json:this.json,stdout:this.context.stdout,separators:2}),1):(await Ot.start({configuration:r,includeFooter:!1,json:this.json,stdout:this.context.stdout},async N=>{N.reportInfo(1,"No audit suggestions")}),R?1:0)}};Ve();Ve();bt();Wt();var vz=et(fi()),Sz=ye("util"),x1=class extends ut{constructor(){super(...arguments);this.fields=ge.String("-f,--fields",{description:"A comma-separated list of manifest fields that should be displayed"});this.json=ge.Boolean("--json",!1,{description:"Format the output as an NDJSON stream"});this.packages=ge.Rest()}static{this.paths=[["npm","info"]]}static{this.usage=ot.Usage({category:"Npm-related commands",description:"show information about a package",details:"\n This command fetches information about a package from the npm registry and prints it in a tree format.\n\n The package does not have to be installed locally, but needs to have been published (in particular, local changes will be ignored even for workspaces).\n\n Append `@<range>` to the package argument to provide information specific to the latest version that satisfies the range or to the corresponding tagged version. If the range is invalid or if there is no version satisfying the range, the command will print a warning and fall back to the latest version.\n\n If the `-f,--fields` option is set, it's a comma-separate
2025-04-10 09:51:25 -04:00
`),this.context.stdout.write(`${(0,Sz.inspect)(p,{depth:1/0,colors:!0,compact:!1})}
2025-04-11 10:05:45 -04:00
`);return f.exitCode()}};function Dz(t){if(Array.isArray(t)){let e=[];for(let r of t)r=Dz(r),r&&e.push(r);return e}else if(typeof t=="object"&&t!==null){let e={};for(let r of Object.keys(t)){if(r.startsWith("_"))continue;let s=Dz(t[r]);s&&(e[r]=s)}return e}else return t||null}Ve();Ve();Wt();var BOe=et(lS()),k1=class extends ut{constructor(){super(...arguments);this.scope=ge.String("-s,--scope",{description:"Login to the registry configured for a given scope"});this.publish=ge.Boolean("--publish",!1,{description:"Login to the publish registry"});this.alwaysAuth=ge.Boolean("--always-auth",{description:"Set the npmAlwaysAuth configuration"})}static{this.paths=[["npm","login"]]}static{this.usage=ot.Usage({category:"Npm-related commands",description:"store new login info to access the npm registry",details:"\n This command will ask you for your username, password, and 2FA One-Time-Password (when it applies). It will then modify your local configuration (in your home folder, never in the project itself) to reference the new tokens thus generated.\n\n Adding the `-s,--scope` flag will cause the authentication to be done against whatever registry is configured for the associated scope (see also `npmScopes`).\n\n Adding the `--publish` flag will cause the authentication to be done against the registry used when publishing the package (see also `publishConfig.registry` and `npmPublishRegistry`).\n ",examples:[["Login to the default registry","yarn npm login"],["Login to the registry linked to the @my-scope registry","yarn npm login --scope my-scope"],["Login to the publish registry for the current package","yarn npm login --publish"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),s=await _L({configuration:r,cwd:this.context.cwd,publish:this.publish,scope:this.scope});return(await Ot.start({configuration:r,stdout:this.context.stdout,includeFooter:!1},async n=>{let c=await Gjt({configuration:r,registry:s,report:n,stdin:this.context.stdin,stdout:this.context.stdout}),f=await jjt(s,c,r);return await qjt(s,f,{alwaysAuth:this.alwaysAuth,scope:this.scope}),n.reportInfo(0,"Successfully logged in")})).exitCode()}};async function _L({scope:t,publish:e,configuration:r,cwd:s}){return t&&e?pi.getScopeRegistry(t,{configuration:r,type:pi.RegistryType.PUBLISH_REGISTRY}):t?pi.getScopeRegistry(t,{configuration:r}):e?pi.getPublishRegistry((await rC(r,s)).manifest,{configuration:r}):pi.getDefaultRegistry({configuration:r})}async function jjt(t,e,r){let s=`/-/user/org.couchdb.user:${encodeURIComponent(e.name)}`,a={_id:`org.couchdb.user:${e.name}`,name:e.name,password:e.password,type:"user",roles:[],date:new Date().toISOString()},n={attemptedAs:e.name,configuration:r,registry:t,jsonResponse:!0,authType:an.AuthType.NO_AUTH};try{return(await an.put(s,a,n)).token}catch(E){if(!(E.originalError?.name==="HTTPError"&&E.originalError?.response.statusCode===409))throw E}let c={...n,authType:an.AuthType.NO_AUTH,headers:{authorization:`Basic ${Buffer.from(`${e.name}:${e.password}`).toString("base64")}`}},f=await an.get(s,c);for(let[E,C]of Object.entries(f))(!a[E]||E==="roles")&&(a[E]=C);let p=`${s}/-rev/${a._rev}`;return(await an.put(p,a,c)).token}async function qjt(t,e,{alwaysAuth:r,scope:s}){let a=c=>f=>{let p=je.isIndexableObject(f)?f:{},h=p[c],E=je.isIndexableObject(h)?h:{};return{...p,[c]:{...E,...r!==void 0?{npmAlwaysAuth:r}:{},npmAuthToken:e}}},n=s?{npmScopes:a(s)}:{npmRegistries:a(t)};return await ze.updateHomeConfiguration(n)}async function Gjt({configuration:t,registry:e,report:r,stdin:s,stdout:a}){r.reportInfo(0,`Logging in to ${he.pretty(t,e,he.Type.URL)}`);let n=!1;if(e.match(/^https:\/\/npm\.pkg\.github\.com(\/|$)/)&&(r.reportInfo(0,"You seem to be using the GitHub Package Registry. Tokens must be generated with the 'repo', 'write:packages', and 'read:packages' permissions."),n=!0),r.reportSeparator(),t.env.YARN_IS_TEST_ENV)return{name:t.env.YARN_INJECT_NPM_USER||"",password:t.env.YARN_INJECT_NPM_PASSWORD||""};let c=await(0,BOe.prompt)([{type:"input",name:"name",message:"Username:",required:!0,onCanc
2025-04-10 09:51:25 -04:00
This command will list all tags of a package from the npm registry.
If the package is not specified, Yarn will default to the current workspace.
2025-04-11 10:05:45 -04:00
`,examples:[["List all tags of package `my-pkg`","yarn npm tag list my-pkg"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd),n;if(typeof this.package<"u")n=q.parseIdent(this.package);else{if(!a)throw new ar(s.cwd,this.context.cwd);if(!a.manifest.name)throw new nt(`Missing 'name' field in ${ue.fromPortablePath(K.join(a.cwd,Er.manifest))}`);n=a.manifest.name}let c=await AP(n,r),p={children:je.sortMap(Object.entries(c),([h])=>h).map(([h,E])=>({value:he.tuple(he.Type.RESOLUTION,{descriptor:q.makeDescriptor(n,h),locator:q.makeLocator(n,E)})}))};return ks.emitTree(p,{configuration:r,json:this.json,stdout:this.context.stdout})}};async function AP(t,e){let r=`/-/package${an.getIdentUrl(t)}/dist-tags`;return an.get(r,{configuration:e,ident:t,jsonResponse:!0,customErrorMessage:an.customPackageError})}var N1=class extends ut{constructor(){super(...arguments);this.package=ge.String();this.tag=ge.String()}static{this.paths=[["npm","tag","add"]]}static{this.usage=ot.Usage({category:"Npm-related commands",description:"add a tag for a specific version of a package",details:`
2025-04-10 09:51:25 -04:00
This command will add a tag to the npm registry for a specific version of a package. If the tag already exists, it will be overwritten.
`,examples:[["Add a `beta` tag for version `2.3.4-beta.4` of package `my-pkg`","yarn npm tag add my-pkg@2.3.4-beta.4 beta"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);let n=q.parseDescriptor(this.package,!0),c=n.range;if(!SOe.default.valid(c))throw new nt(`The range ${he.pretty(r,n.range,he.Type.RANGE)} must be a valid semver version`);let f=pi.getPublishRegistry(a.manifest,{configuration:r}),p=he.pretty(r,n,he.Type.IDENT),h=he.pretty(r,c,he.Type.RANGE),E=he.pretty(r,this.tag,he.Type.CODE);return(await Ot.start({configuration:r,stdout:this.context.stdout},async S=>{let P=await AP(n,r);Object.hasOwn(P,this.tag)&&P[this.tag]===c&&S.reportWarning(0,`Tag ${E} is already set to version ${h}`);let I=`/-/package${an.getIdentUrl(n)}/dist-tags/${encodeURIComponent(this.tag)}`;await an.put(I,c,{configuration:r,registry:f,ident:n,jsonRequest:!0,jsonResponse:!0}),S.reportInfo(0,`Tag ${E} added to version ${h} of package ${p}`)})).exitCode()}};Ve();Wt();var O1=class extends ut{constructor(){super(...arguments);this.package=ge.String();this.tag=ge.String()}static{this.paths=[["npm","tag","remove"]]}static{this.usage=ot.Usage({category:"Npm-related commands",description:"remove a tag from a package",details:`
This command will remove a tag from a package from the npm registry.
2025-04-11 10:05:45 -04:00
`,examples:[["Remove the `beta` tag from package `my-pkg`","yarn npm tag remove my-pkg beta"]]})}async execute(){if(this.tag==="latest")throw new nt("The 'latest' tag cannot be removed.");let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd);if(!a)throw new ar(s.cwd,this.context.cwd);let n=q.parseIdent(this.package),c=pi.getPublishRegistry(a.manifest,{configuration:r}),f=he.pretty(r,this.tag,he.Type.CODE),p=he.pretty(r,n,he.Type.IDENT),h=await AP(n,r);if(!Object.hasOwn(h,this.tag))throw new nt(`${f} is not a tag of package ${p}`);return(await Ot.start({configuration:r,stdout:this.context.stdout},async C=>{let S=`/-/package${an.getIdentUrl(n)}/dist-tags/${encodeURIComponent(this.tag)}`;await an.del(S,{configuration:r,registry:c,ident:n,jsonResponse:!0}),C.reportInfo(0,`Tag ${f} removed from package ${p}`)})).exitCode()}};Ve();Ve();Wt();var L1=class extends ut{constructor(){super(...arguments);this.scope=ge.String("-s,--scope",{description:"Print username for the registry configured for a given scope"});this.publish=ge.Boolean("--publish",!1,{description:"Print username for the publish registry"})}static{this.paths=[["npm","whoami"]]}static{this.usage=ot.Usage({category:"Npm-related commands",description:"display the name of the authenticated user",details:"\n Print the username associated with the current authentication settings to the standard output.\n\n When using `-s,--scope`, the username printed will be the one that matches the authentication settings of the registry associated with the given scope (those settings can be overriden using the `npmRegistries` map, and the registry associated with the scope is configured via the `npmScopes` map).\n\n When using `--publish`, the registry we'll select will by default be the one used when publishing packages (`publishConfig.registry` or `npmPublishRegistry` if available, otherwise we'll fallback to the regular `npmRegistryServer`).\n ",examples:[["Print username for the default registry","yarn npm whoami"],["Print username for the registry on a given scope","yarn npm whoami --scope company"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),s;return this.scope&&this.publish?s=pi.getScopeRegistry(this.scope,{configuration:r,type:pi.RegistryType.PUBLISH_REGISTRY}):this.scope?s=pi.getScopeRegistry(this.scope,{configuration:r}):this.publish?s=pi.getPublishRegistry((await rC(r,this.context.cwd)).manifest,{configuration:r}):s=pi.getDefaultRegistry({configuration:r}),(await Ot.start({configuration:r,stdout:this.context.stdout},async n=>{let c;try{c=await an.get("/-/whoami",{configuration:r,registry:s,authType:an.AuthType.ALWAYS_AUTH,jsonResponse:!0,ident:this.scope?q.makeIdent(this.scope,""):void 0})}catch(f){if(f.response?.statusCode===401||f.response?.statusCode===403){n.reportError(41,"Authentication failed - your credentials may have expired");return}else throw f}n.reportInfo(0,c.username)})).exitCode()}};var Vjt={configuration:{npmPublishAccess:{description:"Default access of the published packages",type:"STRING",default:null},npmPublishProvenance:{description:"Whether to generate provenance for the published packages",type:"BOOLEAN",default:!1},npmAuditExcludePackages:{description:"Array of glob patterns of packages to exclude from npm audit",type:"STRING",default:[],isArray:!0},npmAuditIgnoreAdvisories:{description:"Array of glob patterns of advisory IDs to exclude from npm audit",type:"STRING",default:[],isArray:!0}},commands:[P1,x1,k1,T1,R1,N1,F1,O1,L1]},Kjt=Vjt;var Fz={};Vt(Fz,{PatchCommand:()=>q1,PatchCommitCommand:()=>j1,PatchFetcher:()=>mP,PatchResolver:()=>yP,default:()=>A6t,patchUtils:()=>dy});Ve();Ve();bt();rA();var dy={};Vt(dy,{applyPatchFile:()=>HL,diffFolders:()=>Tz,ensureUnpatchedDescriptor:()=>Pz,ensureUnpatchedLocator:()=>qL,extractPackageToDisk:()=>Qz,extractPatchFlags:()=>TOe,isParentRequired:()=>kz,isPatchDescriptor:()=>jL,isPatchLocator:()=>Fg,loadPatchFiles:()=>dP,makeDescriptor:()=>WL,makeLocator:()=>xz,makePatchHash:()=>Rz,parseDescriptor:
2025-04-10 09:51:25 -04:00
`)+(a.hunk.parts[0].noNewlineAtEndOfFile?"":`
2025-04-11 10:05:45 -04:00
`):"";await e.mkdirpPromise(K.dirname(a.path),{chmod:493,utimes:[ui.SAFE_TIME,ui.SAFE_TIME]}),await e.writeFilePromise(a.path,n,{mode:a.mode}),await e.utimesPromise(a.path,ui.SAFE_TIME,ui.SAFE_TIME)}break;case"patch":await U1(e,a.path,async()=>{await o6t(a,{baseFs:e,dryRun:r})});break;case"mode change":{let c=(await e.statPromise(a.path)).mode;if(bOe(a.newMode)!==bOe(c))continue;await U1(e,a.path,async()=>{await e.chmodPromise(a.path,a.newMode)})}break;default:je.assertNever(a);break}}function bOe(t){return(t&64)>0}function POe(t){return t.replace(/\s+$/,"")}function s6t(t,e){return POe(t)===POe(e)}async function o6t({hunks:t,path:e},{baseFs:r,dryRun:s=!1}){let a=await r.statSync(e).mode,c=(await r.readFileSync(e,"utf8")).split(/\n/),f=[],p=0,h=0;for(let C of t){let S=Math.max(h,C.header.patched.start+p),P=Math.max(0,S-h),I=Math.max(0,c.length-S-C.header.original.length),R=Math.max(P,I),N=0,U=0,W=null;for(;N<=R;){if(N<=P&&(U=S-N,W=xOe(C,c,U),W!==null)){N=-N;break}if(N<=I&&(U=S+N,W=xOe(C,c,U),W!==null))break;N+=1}if(W===null)throw new _1(t.indexOf(C),C);f.push(W),p+=N,h=U+C.header.original.length}if(s)return;let E=0;for(let C of f)for(let S of C)switch(S.type){case"splice":{let P=S.index+E;c.splice(P,S.numToDelete,...S.linesToInsert),E+=S.linesToInsert.length-S.numToDelete}break;case"pop":c.pop();break;case"push":c.push(S.line);break;default:je.assertNever(S);break}await r.writeFilePromise(e,c.join(`
`),{mode:a})}function xOe(t,e,r){let s=[];for(let a of t.parts)switch(a.type){case"context":case"deletion":{for(let n of a.lines){let c=e[r];if(c==null||!s6t(c,n))return null;r+=1}a.type==="deletion"&&(s.push({type:"splice",index:r-a.lines.length,numToDelete:a.lines.length,linesToInsert:[]}),a.noNewlineAtEndOfFile&&s.push({type:"push",line:""}))}break;case"insertion":s.push({type:"splice",index:r,numToDelete:0,linesToInsert:a.lines}),a.noNewlineAtEndOfFile&&s.push({type:"pop"});break;default:je.assertNever(a.type);break}return s}var l6t=/^builtin<([^>]+)>$/;function H1(t,e){let{protocol:r,source:s,selector:a,params:n}=q.parseRange(t);if(r!=="patch:")throw new Error("Invalid patch range");if(s===null)throw new Error("Patch locators must explicitly define their source");let c=a?a.split(/&/).map(E=>ue.toPortablePath(E)):[],f=n&&typeof n.locator=="string"?q.parseLocator(n.locator):null,p=n&&typeof n.version=="string"?n.version:null,h=e(s);return{parentLocator:f,sourceItem:h,patchPaths:c,sourceVersion:p}}function jL(t){return t.range.startsWith("patch:")}function Fg(t){return t.reference.startsWith("patch:")}function hP(t){let{sourceItem:e,...r}=H1(t.range,q.parseDescriptor);return{...r,sourceDescriptor:e}}function gP(t){let{sourceItem:e,...r}=H1(t.reference,q.parseLocator);return{...r,sourceLocator:e}}function c6t(t){let{sourceItem:e}=H1(t.range,q.parseDescriptor);return e}function u6t(t){let{sourceItem:e}=H1(t.reference,q.parseLocator);return e}function Pz(t){if(!jL(t))return t;let{sourceItem:e}=H1(t.range,q.parseDescriptor);return e}function qL(t){if(!Fg(t))return t;let{sourceItem:e}=H1(t.reference,q.parseLocator);return e}function kOe({parentLocator:t,sourceItem:e,patchPaths:r,sourceVersion:s,patchHash:a},n){let c=t!==null?{locator:q.stringifyLocator(t)}:{},f=typeof s<"u"?{version:s}:{},p=typeof a<"u"?{hash:a}:{};return q.makeRange({protocol:"patch:",source:n(e),selector:r.join("&"),params:{...f,...p,...c}})}function WL(t,{parentLocator:e,sourceDescriptor:r,patchPaths:s}){return q.makeDescriptor(t,kOe({parentLocator:e,sourceItem:r,patchPaths:s},q.stringifyDescriptor))}function xz(t,{parentLocator:e,sourcePackage:r,patchPaths:s,patchHash:a}){return q.makeLocator(t,kOe({parentLocator:e,sourceItem:r,sourceVersion:r.version,patchPaths:s,patchHash:a},q.stringifyLocator))}function QOe({onAbsolute:t,onRelative:e,onProject:r,onBuiltin:s},a){let n=a.lastIndexOf("!");n!==-1&&(a=a.slice(n+1));let c=a.match(l6t);return c!==null?s(c[1]):a.startsWith("~/")?r(a.slice(2)):K.isAbsolute(a)?t(a):e(a)}function TOe(t){let e=t.lastIndexOf("!");return{optional:(e!==-1?new Set(t.slice(0,e).split(/!/)):new Set).has("optional")}}function kz(t){return QOe({onAbsolute:()=>!1,onRelative:()=>!0,onProject:()=>!1,onBuiltin:()=>!1},t)}async function dP(t,e,r){let s=t!==null?await r.fetcher.fetch(t,r):null,a=s&&s.localPath?{packageFs:new Sn(vt.root),prefixPath:K.relative(vt.root,s.localPath)}:s;s&&s!==a&&s.releaseFs&&s.releaseFs();let n=await je.releaseAfterUseAsync(async()=>await Promise.all(e.map(async c=>{let f=TOe(c),p=await QOe({onAbsolute:async h=>await le.readFilePromise(h,"utf8"),onRelative:async h=>{if(a===null)throw new Error("Assertion failed: The parent locator should have been fetched");return await a.packageFs.readFilePromise(K.join(a.prefixPath,h),"utf8")},onProject:async h=>await le.readFilePromise(K.join(r.project.cwd,h),"utf8"),onBuiltin:async h=>await r.project.configuration.firstHook(E=>E.getBuiltinPatch,r.project,h)},c);return{...f,source:p}})));for(let c of n)typeof c.source=="string"&&(c.source=c.source.replace(/\r\n?/g,`
`));return n}async function Qz(t,{cache:e,project:r}){let s=r.storedPackages.get(t.locatorHash);if(typeof s>"u")throw new Error("Assertion failed: Expected the package to be registered");let a=qL(t),n=r.storedChecksums,c=new Wi,f=await le.mktempPromise(),p=K.join(f,"source"),h=K.join(f,"user"),E=K.join(f,".yarn-patch.json"),C=r.configuration.makeFetcher(),S=[];try{let P,I;if(t.locatorHash===a.locatorHash){let R=await C.fetch(t,{cache:e,project:r,fetcher:C,checksums:n,report:c});S.push(()=>R.releaseFs?.()),P=R,I=R}else P=await C.fetch(t,{cache:e,project:r,fetcher:C,checksums:n,report:c}),S.push(()=>P.releaseFs?.()),I=await C.fetch(t,{cache:e,project:r,fetcher:C,checksums:n,report:c}),S.push(()=>I.releaseFs?.());await Promise.all([le.copyPromise(p,P.prefixPath,{baseFs:P.packageFs}),le.copyPromise(h,I.prefixPath,{baseFs:I.packageFs}),le.writeJsonPromise(E,{locator:q.stringifyLocator(t),version:s.version})])}finally{for(let P of S)P()}return le.detachTemp(f),h}async function Tz(t,e){let r=ue.fromPortablePath(t).replace(/\\/g,"/"),s=ue.fromPortablePath(e).replace(/\\/g,"/"),{stdout:a,stderr:n}=await Gr.execvp("git",["-c","core.safecrlf=false","diff","--src-prefix=a/","--dst-prefix=b/","--ignore-cr-at-eol","--full-index","--no-index","--no-renames","--text",r,s],{cwd:ue.toPortablePath(process.cwd()),env:{...process.env,GIT_CONFIG_NOSYSTEM:"1",HOME:"",XDG_CONFIG_HOME:"",USERPROFILE:""}});if(n.length>0)throw new Error(`Unable to diff directories. Make sure you have a recent version of 'git' available in PATH.
2025-04-10 09:51:25 -04:00
The following error was reported by 'git':
2025-04-11 10:05:45 -04:00
${n}`);let c=r.startsWith("/")?f=>f.slice(1):f=>f;return a.replace(new RegExp(`(a|b)(${je.escapeRegExp(`/${c(r)}/`)})`,"g"),"$1/").replace(new RegExp(`(a|b)${je.escapeRegExp(`/${c(s)}/`)}`,"g"),"$1/").replace(new RegExp(je.escapeRegExp(`${r}/`),"g"),"").replace(new RegExp(je.escapeRegExp(`${s}/`),"g"),"")}function Rz(t,e){let r=[];for(let{source:s}of t){if(s===null)continue;let a=pP(s);for(let n of a){let{semverExclusivity:c,...f}=n;c!==null&&e!==null&&!Or.satisfiesWithPrereleases(e,c)||r.push(JSON.stringify(f))}}return Nn.makeHash(`${3}`,...r).slice(0,6)}Ve();function ROe(t,{configuration:e,report:r}){for(let s of t.parts)for(let a of s.lines)switch(s.type){case"context":r.reportInfo(null,` ${he.pretty(e,a,"grey")}`);break;case"deletion":r.reportError(28,`- ${he.pretty(e,a,he.Type.REMOVED)}`);break;case"insertion":r.reportError(28,`+ ${he.pretty(e,a,he.Type.ADDED)}`);break;default:je.assertNever(s.type)}}var mP=class{supports(e,r){return!!Fg(e)}getLocalPath(e,r){return null}async fetch(e,r){let s=r.checksums.get(e.locatorHash)||null,[a,n,c]=await r.cache.fetchPackageFromCache(e,s,{onHit:()=>r.report.reportCacheHit(e),onMiss:()=>r.report.reportCacheMiss(e,`${q.prettyLocator(r.project.configuration,e)} can't be found in the cache and will be fetched from the disk`),loader:()=>this.patchPackage(e,r),...r.cacheOptions});return{packageFs:a,releaseFs:n,prefixPath:q.getIdentVendorPath(e),localPath:this.getLocalPath(e,r),checksum:c}}async patchPackage(e,r){let{parentLocator:s,sourceLocator:a,sourceVersion:n,patchPaths:c}=gP(e),f=await dP(s,c,r),p=await le.mktempPromise(),h=K.join(p,"current.zip"),E=await r.fetcher.fetch(a,r),C=q.getIdentVendorPath(e),S=new ps(h,{create:!0,level:r.project.configuration.get("compressionLevel")});await je.releaseAfterUseAsync(async()=>{await S.copyPromise(C,E.prefixPath,{baseFs:E.packageFs,stableSort:!0})},E.releaseFs),S.saveAndClose();for(let{source:P,optional:I}of f){if(P===null)continue;let R=new ps(h,{level:r.project.configuration.get("compressionLevel")}),N=new Sn(K.resolve(vt.root,C),{baseFs:R});try{await HL(pP(P),{baseFs:N,version:n})}catch(U){if(!(U instanceof _1))throw U;let W=r.project.configuration.get("enableInlineHunks"),te=!W&&!I?" (set enableInlineHunks for details)":"",ie=`${q.prettyLocator(r.project.configuration,e)}: ${U.message}${te}`,Ae=ce=>{W&&ROe(U.hunk,{configuration:r.project.configuration,report:ce})};if(R.discardAndClose(),I){r.report.reportWarningOnce(66,ie,{reportExtra:Ae});continue}else throw new Yt(66,ie,Ae)}R.saveAndClose()}return new ps(h,{level:r.project.configuration.get("compressionLevel")})}};Ve();var yP=class{supportsDescriptor(e,r){return!!jL(e)}supportsLocator(e,r){return!!Fg(e)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,s){let{patchPaths:a}=hP(e);return a.every(n=>!kz(n))?e:q.bindDescriptor(e,{locator:q.stringifyLocator(r)})}getResolutionDependencies(e,r){let{sourceDescriptor:s}=hP(e);return{sourceDescriptor:r.project.configuration.normalizeDependency(s)}}async getCandidates(e,r,s){if(!s.fetchOptions)throw new Error("Assertion failed: This resolver cannot be used unless a fetcher is configured");let{parentLocator:a,patchPaths:n}=hP(e),c=await dP(a,n,s.fetchOptions),f=r.sourceDescriptor;if(typeof f>"u")throw new Error("Assertion failed: The dependency should have been resolved");let p=Rz(c,f.version);return[xz(e,{parentLocator:a,sourcePackage:f,patchPaths:n,patchHash:p})]}async getSatisfying(e,r,s,a){let[n]=await this.getCandidates(e,r,a);return{locators:s.filter(c=>c.locatorHash===n.locatorHash),sorted:!1}}async resolve(e,r){let{sourceLocator:s}=gP(e);return{...await r.resolver.resolve(s,r),...e}}};Ve();bt();Wt();var j1=class extends ut{constructor(){super(...arguments);this.save=ge.Boolean("-s,--save",!1,{description:"Add the patch to your resolution entries"});this.patchFolder=ge.String()}static{this.paths=[["patch-commit"]]}static{this.usage=ot.Usage({description:"generate a patch out of a directory",details:"\n By default, this will print a patchfile on stdout based on the diff between the folder passed in and the original version of
2025-04-10 09:51:25 -04:00
${f.map(p=>`
2025-04-11 10:05:45 -04:00
- ${q.prettyLocator(r,p)}`).join("")}`);c=f[0]}if(!s.storedPackages.has(c.locatorHash))throw new nt("No package found in the project for the given locator");await Ot.start({configuration:r,json:this.json,stdout:this.context.stdout},async f=>{let p=qL(c),h=await Qz(c,{cache:n,project:s});f.reportJson({locator:q.stringifyLocator(p),path:ue.fromPortablePath(h)});let E=this.update?" along with its current modifications":"";f.reportInfo(0,`Package ${q.prettyLocator(r,p)} got extracted with success${E}!`),f.reportInfo(0,`You can now edit the following folder: ${he.pretty(r,ue.fromPortablePath(h),"magenta")}`),f.reportInfo(0,`Once you are done run ${he.pretty(r,`yarn patch-commit -s ${process.platform==="win32"?'"':""}${ue.fromPortablePath(h)}${process.platform==="win32"?'"':""}`,"cyan")} and Yarn will store a patchfile based on your changes.`)})}};var f6t={configuration:{enableInlineHunks:{description:"If true, the installs will print unmatched patch hunks",type:"BOOLEAN",default:!1},patchFolder:{description:"Folder where the patch files must be written",type:"ABSOLUTE_PATH",default:"./.yarn/patches"}},commands:[j1,q1],fetchers:[mP],resolvers:[yP]},A6t=f6t;var Lz={};Vt(Lz,{PnpmLinker:()=>EP,default:()=>y6t});Ve();bt();Wt();var EP=class{getCustomDataKey(){return JSON.stringify({name:"PnpmLinker",version:3})}supportsPackage(e,r){return this.isEnabled(r)}async findPackageLocation(e,r){if(!this.isEnabled(r))throw new Error("Assertion failed: Expected the pnpm linker to be enabled");let s=this.getCustomDataKey(),a=r.project.linkersCustomData.get(s);if(!a)throw new nt(`The project in ${he.pretty(r.project.configuration,`${r.project.cwd}/package.json`,he.Type.PATH)} doesn't seem to have been installed - running an install there might help`);let n=a.pathsByLocator.get(e.locatorHash);if(typeof n>"u")throw new nt(`Couldn't find ${q.prettyLocator(r.project.configuration,e)} in the currently installed pnpm map - running an install might help`);return n.packageLocation}async findPackageLocator(e,r){if(!this.isEnabled(r))return null;let s=this.getCustomDataKey(),a=r.project.linkersCustomData.get(s);if(!a)throw new nt(`The project in ${he.pretty(r.project.configuration,`${r.project.cwd}/package.json`,he.Type.PATH)} doesn't seem to have been installed - running an install there might help`);let n=e.match(/(^.*\/node_modules\/(@[^/]*\/)?[^/]+)(\/.*$)/);if(n){let p=a.locatorByPath.get(n[1]);if(p)return p}let c=e,f=e;do{f=c,c=K.dirname(f);let p=a.locatorByPath.get(f);if(p)return p}while(c!==f);return null}makeInstaller(e){return new Nz(e)}isEnabled(e){return e.project.configuration.get("nodeLinker")==="pnpm"}},Nz=class{constructor(e){this.opts=e;this.asyncActions=new je.AsyncActions(10);this.customData={pathsByLocator:new Map,locatorByPath:new Map};this.indexFolderPromise=px(le,{indexPath:K.join(e.project.configuration.get("globalFolder"),"index")})}attachCustomData(e){}async installPackage(e,r,s){switch(e.linkType){case"SOFT":return this.installPackageSoft(e,r,s);case"HARD":return this.installPackageHard(e,r,s)}throw new Error("Assertion failed: Unsupported package link type")}async installPackageSoft(e,r,s){let a=K.resolve(r.packageFs.getRealPath(),r.prefixPath),n=this.opts.project.tryWorkspaceByLocator(e)?K.join(a,Er.nodeModules):null;return this.customData.pathsByLocator.set(e.locatorHash,{packageLocation:a,dependenciesLocation:n}),{packageLocation:a,buildRequest:null}}async installPackageHard(e,r,s){let a=h6t(e,{project:this.opts.project}),n=a.packageLocation;this.customData.locatorByPath.set(n,q.stringifyLocator(e)),this.customData.pathsByLocator.set(e.locatorHash,a),s.holdFetchResult(this.asyncActions.set(e.locatorHash,async()=>{await le.mkdirPromise(n,{recursive:!0}),await le.copyPromise(n,r.prefixPath,{baseFs:r.packageFs,overwrite:!1,linkStrategy:{type:"HardlinkFromIndex",indexPath:await this.indexFolderPromise,autoRepair:!0}})}));let f=q.isVirtualLocator(e)?q.devirtualizeLocator(e):e,p={manifest:await Ht.tryFind(r.prefixPath,{baseFs:r.packageFs})??new Ht,misc:{hasBindingGyp:mA.hasBindingGyp(r)}},h=this.opts.project.getDependencyMeta(f
2025-04-10 09:51:25 -04:00
2025-04-11 10:05:45 -04:00
${I6t}
`,"--",...s],{cwd:t,strict:!0})},async makeReset(t,e){let r=e.map(s=>ue.fromPortablePath(s.path));await Gr.execvp("git",["reset","HEAD","--",...r],{cwd:t,strict:!0})}};var S6t=[MOe],G1=class extends ut{constructor(){super(...arguments);this.commit=ge.Boolean("-c,--commit",!1,{description:"Commit the staged files"});this.reset=ge.Boolean("-r,--reset",!1,{description:"Remove all files from the staging area"});this.dryRun=ge.Boolean("-n,--dry-run",!1,{description:"Print the commit message and the list of modified files without staging / committing"});this.update=ge.Boolean("-u,--update",!1,{hidden:!0})}static{this.paths=[["stage"]]}static{this.usage=ot.Usage({description:"add all yarn files to your vcs",details:"\n This command will add to your staging area the files belonging to Yarn (typically any modified `package.json` and `.yarnrc.yml` files, but also linker-generated files, cache data, etc). It will take your ignore list into account, so the cache files won't be added if the cache is ignored in a `.gitignore` file (assuming you use Git).\n\n Running `--reset` will instead remove them from the staging area (the changes will still be there, but won't be committed until you stage them back).\n\n Since the staging area is a non-existent concept in Mercurial, Yarn will always create a new commit when running this command on Mercurial repositories. You can get this behavior when using Git by using the `--commit` flag which will directly create a commit.\n ",examples:[["Adds all modified project files to the staging area","yarn stage"],["Creates a new commit containing all modified project files","yarn stage --commit"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s}=await Tt.find(r,this.context.cwd),{driver:a,root:n}=await D6t(s.cwd),c=[r.get("cacheFolder"),r.get("globalFolder"),r.get("virtualFolder"),r.get("yarnPath")];await r.triggerHook(C=>C.populateYarnPaths,s,C=>{c.push(C)});let f=new Set;for(let C of c)for(let S of b6t(n,C))f.add(S);let p=new Set([r.get("rcFilename"),Er.lockfile,Er.manifest]),h=await a.filterChanges(n,f,p),E=await a.genCommitMessage(n,h);if(this.dryRun)if(this.commit)this.context.stdout.write(`${E}
2025-04-10 09:51:25 -04:00
`);else for(let C of h)this.context.stdout.write(`${ue.fromPortablePath(C.path)}
2025-04-11 10:05:45 -04:00
`);else if(this.reset){let C=await a.filterChanges(n,f,p,{staged:!0});C.length===0?this.context.stdout.write("No staged changes found!"):await a.makeReset(n,C)}else h.length===0?this.context.stdout.write("No changes found!"):this.commit?await a.makeCommit(n,h,E):(await a.makeStage(n,h),this.context.stdout.write(E))}};async function D6t(t){let e=null,r=null;for(let s of S6t)if((r=await s.findRoot(t))!==null){e=s;break}if(e===null||r===null)throw new nt("No stage driver has been found for your current project");return{driver:e,root:r}}function b6t(t,e){let r=[];if(e===null)return r;for(;;){(e===t||e.startsWith(`${t}/`))&&r.push(e);let s;try{s=le.statSync(e)}catch{break}if(s.isSymbolicLink())e=K.resolve(K.dirname(e),le.readlinkSync(e));else break}return r}var P6t={commands:[G1]},x6t=P6t;var Wz={};Vt(Wz,{default:()=>L6t});Ve();Ve();bt();var HOe=et(fi());Ve();var _Oe=et(Z9()),k6t="e8e1bd300d860104bb8c58453ffa1eb4",Q6t="OFCNCOG2CU",UOe=async(t,e)=>{let r=q.stringifyIdent(t),a=T6t(e).initIndex("npm-search");try{return(await a.getObject(r,{attributesToRetrieve:["types"]})).types?.ts==="definitely-typed"}catch{return!1}},T6t=t=>(0,_Oe.default)(Q6t,k6t,{requester:{async send(r){try{let s=await An.request(r.url,r.data||null,{configuration:t,headers:r.headers});return{content:s.body,isTimedOut:!1,status:s.statusCode}}catch(s){return{content:s.response.body,isTimedOut:!1,status:s.response.statusCode}}}}});var jOe=t=>t.scope?`${t.scope}__${t.name}`:`${t.name}`,R6t=async(t,e,r,s)=>{if(r.scope==="types")return;let{project:a}=t,{configuration:n}=a;if(!(n.get("tsEnableAutoTypes")??(le.existsSync(K.join(t.cwd,"tsconfig.json"))||le.existsSync(K.join(a.cwd,"tsconfig.json")))))return;let f=n.makeResolver(),p={project:a,resolver:f,report:new Wi};if(!await UOe(r,n))return;let E=jOe(r),C=q.parseRange(r.range).selector;if(!Or.validRange(C)){let N=n.normalizeDependency(r),U=await f.getCandidates(N,{},p);C=q.parseRange(U[0].reference).selector}let S=HOe.default.coerce(C);if(S===null)return;let P=`${Xu.Modifier.CARET}${S.major}`,I=q.makeDescriptor(q.makeIdent("types",E),P),R=je.mapAndFind(a.workspaces,N=>{let U=N.manifest.dependencies.get(r.identHash)?.descriptorHash,W=N.manifest.devDependencies.get(r.identHash)?.descriptorHash;if(U!==r.descriptorHash&&W!==r.descriptorHash)return je.mapAndFind.skip;let te=[];for(let ie of Ht.allDependencies){let Ae=N.manifest[ie].get(I.identHash);typeof Ae>"u"||te.push([ie,Ae])}return te.length===0?je.mapAndFind.skip:te});if(typeof R<"u")for(let[N,U]of R)t.manifest[N].set(U.identHash,U);else{try{let N=n.normalizeDependency(I);if((await f.getCandidates(N,{},p)).length===0)return}catch{return}t.manifest[Xu.Target.DEVELOPMENT].set(I.identHash,I)}},F6t=async(t,e,r)=>{if(r.scope==="types")return;let{project:s}=t,{configuration:a}=s;if(!(a.get("tsEnableAutoTypes")??(le.existsSync(K.join(t.cwd,"tsconfig.json"))||le.existsSync(K.join(s.cwd,"tsconfig.json")))))return;let c=jOe(r),f=q.makeIdent("types",c);for(let p of Ht.allDependencies)typeof t.manifest[p].get(f.identHash)>"u"||t.manifest[p].delete(f.identHash)},N6t=(t,e)=>{e.publishConfig&&e.publishConfig.typings&&(e.typings=e.publishConfig.typings),e.publishConfig&&e.publishConfig.types&&(e.types=e.publishConfig.types)},O6t={configuration:{tsEnableAutoTypes:{description:"Whether Yarn should auto-install @types/ dependencies on 'yarn add'",type:"BOOLEAN",isNullable:!0,default:null}},hooks:{afterWorkspaceDependencyAddition:R6t,afterWorkspaceDependencyRemoval:F6t,beforeWorkspacePacking:N6t}},L6t=O6t;var zz={};Vt(zz,{VersionApplyCommand:()=>J1,VersionCheckCommand:()=>z1,VersionCommand:()=>Z1,default:()=>rqt,versionUtils:()=>K1});Ve();Ve();Wt();var K1={};Vt(K1,{Decision:()=>Y1,applyPrerelease:()=>KOe,applyReleases:()=>Jz,applyStrategy:()=>JL,clearVersionFiles:()=>Yz,getUndecidedDependentWorkspaces:()=>CP,getUndecidedWorkspaces:()=>KL,openVersionFile:()=>V1,requireMoreDecisions:()=>$6t,resolveVersionFiles:()=>IP,suggestStrategy:()=>Kz,updateVersionFiles:()=>Vz,validateReleaseDecision:()=>W1});Ve();bt();Bc();Wt();var VOe=et(YOe()),TA=et(fi()),X6t=/^(>=|[~^]|)(0|[1-9]\d*)\.(0|[1-
2025-04-10 09:51:25 -04:00
- ${f.map(P=>ue.fromPortablePath(P)).join(`
2025-04-11 10:05:45 -04:00
- `)}`);let p=new Set(je.mapAndFilter(n,P=>{let I=t.tryWorkspaceByFilePath(P);return I===null?je.mapAndFilter.skip:I}));if(f.length===0&&p.size===0&&!e)return null;let h=f.length===1?f[0]:K.join(c,`${Nn.makeHash(Math.random().toString()).slice(0,8)}.yml`),E=le.existsSync(h)?await le.readFilePromise(h,"utf8"):"{}",C=ls(E),S=new Map;for(let P of C.declined||[]){let I=q.parseIdent(P),R=t.getWorkspaceByIdent(I);S.set(R,"decline")}for(let[P,I]of Object.entries(C.releases||{})){let R=q.parseIdent(P),N=t.getWorkspaceByIdent(R);S.set(N,W1(I))}return{project:t,root:s,baseHash:a!==null?a.hash:null,baseTitle:a!==null?a.title:null,changedFiles:new Set(n),changedWorkspaces:p,releaseRoots:new Set([...p].filter(P=>P.manifest.version!==null)),releases:S,async saveAll(){let P={},I=[],R=[];for(let N of t.workspaces){if(N.manifest.version===null)continue;let U=q.stringifyIdent(N.anchoredLocator),W=S.get(N);W==="decline"?I.push(U):typeof W<"u"?P[U]=W1(W):p.has(N)&&R.push(U)}await le.mkdirPromise(K.dirname(h),{recursive:!0}),await le.changeFilePromise(h,il(new il.PreserveOrdering({releases:Object.keys(P).length>0?P:void 0,declined:I.length>0?I:void 0,undecided:R.length>0?R:void 0})))}}}function $6t(t){return KL(t).size>0||CP(t).length>0}function KL(t){let e=new Set;for(let r of t.changedWorkspaces)r.manifest.version!==null&&(t.releases.has(r)||e.add(r));return e}function CP(t,{include:e=new Set}={}){let r=[],s=new Map(je.mapAndFilter([...t.releases],([n,c])=>c==="decline"?je.mapAndFilter.skip:[n.anchoredLocator.locatorHash,n])),a=new Map(je.mapAndFilter([...t.releases],([n,c])=>c!=="decline"?je.mapAndFilter.skip:[n.anchoredLocator.locatorHash,n]));for(let n of t.project.workspaces)if(!(!e.has(n)&&(a.has(n.anchoredLocator.locatorHash)||s.has(n.anchoredLocator.locatorHash)))&&n.manifest.version!==null)for(let c of Ht.hardDependencies)for(let f of n.manifest.getForScope(c).values()){let p=t.project.tryWorkspaceByDescriptor(f);p!==null&&s.has(p.anchoredLocator.locatorHash)&&r.push([n,p])}return r}function Kz(t,e){let r=TA.default.clean(e);for(let s of Object.values(Y1))if(s!=="undecided"&&s!=="decline"&&TA.default.inc(t,s)===r)return s;return null}function JL(t,e){if(TA.default.valid(e))return e;if(t===null)throw new nt(`Cannot apply the release strategy "${e}" unless the workspace already has a valid version`);if(!TA.default.valid(t))throw new nt(`Cannot apply the release strategy "${e}" on a non-semver version (${t})`);let r=TA.default.inc(t,e);if(r===null)throw new nt(`Cannot apply the release strategy "${e}" on the specified version (${t})`);return r}function Jz(t,e,{report:r,exact:s}){let a=new Map;for(let n of t.workspaces)for(let c of Ht.allDependencies)for(let f of n.manifest[c].values()){let p=t.tryWorkspaceByDescriptor(f);if(p===null||!e.has(p))continue;je.getArrayWithDefault(a,p).push([n,c,f.identHash])}for(let[n,c]of e){let f=n.manifest.version;n.manifest.version=c,TA.default.prerelease(c)===null?delete n.manifest.raw.stableVersion:n.manifest.raw.stableVersion||(n.manifest.raw.stableVersion=f);let p=n.manifest.name!==null?q.stringifyIdent(n.manifest.name):null;r.reportInfo(0,`${q.prettyLocator(t.configuration,n.anchoredLocator)}: Bumped to ${c}`),r.reportJson({cwd:ue.fromPortablePath(n.cwd),ident:p,oldVersion:f,newVersion:c});let h=a.get(n);if(!(typeof h>"u"))for(let[E,C,S]of h){let P=E.manifest[C].get(S);if(typeof P>"u")throw new Error("Assertion failed: The dependency should have existed");let I=P.range,R=!1;if(I.startsWith(yi.protocol)&&(I=I.slice(yi.protocol.length),R=!0,I===n.relativeCwd))continue;let N=I.match(X6t);if(!N){r.reportWarning(0,`Couldn't auto-upgrade range ${I} (in ${q.prettyLocator(t.configuration,E.anchoredLocator)})`);continue}let U=s?`${c}`:`${N[1]}${c}`;R&&(U=`${yi.protocol}${U}`);let W=q.makeDescriptor(P,U);E.manifest[C].set(S,W)}}}var eqt=new Map([["%n",{extract:t=>t.length>=1?[t[0],t.slice(1)]:null,generate:(t=0)=>`${t+1}`}]]);function KOe(t,{current:e,prerelease:r}){let s=new TA.default.SemVer(e),a=s.prerelease.slice(),n=[];s.prerelease=[],s.format()!==t&&(a.length=0);let c=!0,f=r.split(/\./g);for(let p of
2025-04-10 09:51:25 -04:00
This command will apply the deferred version changes and remove their definitions from the repository.
Note that if \`--prerelease\` is set, the given prerelease identifier (by default \`rc.%n\`) will be used on all new versions and the version definitions will be kept as-is.
By default only the current workspace will be bumped, but you can configure this behavior by using one of:
- \`--recursive\` to also apply the version bump on its dependencies
- \`--all\` to apply the version bump on all packages in the repository
Note that this command will also update the \`workspace:\` references across all your local workspaces, thus ensuring that they keep referring to the same workspaces even after the version bump.
2025-04-11 10:05:45 -04:00
`,examples:[["Apply the version change to the local workspace","yarn version apply"],["Apply the version change to all the workspaces in the local workspace","yarn version apply --all"]]})}async execute(){let r=await ze.find(this.context.cwd,this.context.plugins),{project:s,workspace:a}=await Tt.find(r,this.context.cwd),n=await Jr.find(r);if(!a)throw new ar(s.cwd,this.context.cwd);await s.restoreInstallState({restoreResolutions:!1});let c=await Ot.start({configuration:r,json:this.json,stdout:this.context.stdout},async f=>{let p=this.prerelease?typeof this.prerelease!="boolean"?this.prerelease:"rc.%n":null,h=await IP(s,{prerelease:p}),E=new Map;if(this.all)E=h;else{let C=this.recursive?a.getRecursiveWorkspaceDependencies():[a];for(let S of C){let P=h.get(S);typeof P<"u"&&E.set(S,P)}}if(E.size===0){let C=h.size>0?" Did you want to add --all?":"";f.reportWarning(0,`The current workspace doesn't seem to require a version bump.${C}`);return}Jz(s,E,{report:f,exact:this.exact}),this.dryRun||(p||(this.all?await Yz(s):await Vz(s,[...E.keys()])),f.reportSeparator())});return this.dryRun||c.hasErrors()?c.exitCode():await s.installWithNewReport({json:this.json,stdout:this.context.stdout},{cache:n})}};Ve();bt();Wt();var zL=et(fi());var z1=class extends ut{constructor(){super(...arguments);this.interactive=ge.Boolean("-i,--interactive",{description:"Open an interactive interface used to set version bumps"})}static{this.paths=[["version","check"]]}static{this.usage=ot.Usage({category:"Release-related commands",description:"check that all the relevant packages have been bumped",details:"\n **Warning:** This command currently requires Git.\n\n This command will check that all the packages covered by the files listed in argument have been properly bumped or declined to bump.\n\n In the case of a bump, the check will also cover transitive packages - meaning that should `Foo` be bumped, a package `Bar` depending on `Foo` will require a decision as to whether `Bar` will need to be bumped. This check doesn't cross packages that have declined to bump.\n\n In case no arguments are passed to the function, the list of modified files will be generated by comparing the HEAD against `master`.\n ",examples:[["Check whether the modified packages need a bump","yarn version check"]]})}async execute(){return this.interactive?await this.executeInteractive():await this.executeStandard()}async executeInteractive(){ow(this.context);let{Gem:r}=await Promise.resolve().then(()=>($F(),CY)),{ScrollableItems:s}=await Promise.resolve().then(()=>(nN(),rN)),{FocusRequest:a}=await Promise.resolve().then(()=>(BY(),XPe)),{useListInput:n}=await Promise.resolve().then(()=>(tN(),$Pe)),{renderForm:c}=await Promise.resolve().then(()=>(aN(),oN)),{Box:f,Text:p}=await Promise.resolve().then(()=>et(Vc())),{default:h,useCallback:E,useState:C}=await Promise.resolve().then(()=>et(hn())),S=await ze.find(this.context.cwd,this.context.plugins),{project:P,workspace:I}=await Tt.find(S,this.context.cwd);if(!I)throw new ar(P.cwd,this.context.cwd);await P.restoreInstallState();let R=await V1(P);if(R===null||R.releaseRoots.size===0)return 0;if(R.root===null)throw new nt("This command can only be run on Git repositories");let N=()=>h.createElement(f,{flexDirection:"row",paddingBottom:1},h.createElement(f,{flexDirection:"column",width:60},h.createElement(f,null,h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<up>"),"/",h.createElement(p,{bold:!0,color:"cyanBright"},"<down>")," to select workspaces.")),h.createElement(f,null,h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<left>"),"/",h.createElement(p,{bold:!0,color:"cyanBright"},"<right>")," to select release strategies."))),h.createElement(f,{flexDirection:"column"},h.createElement(f,{marginLeft:1},h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<enter>")," to save.")),h.createElement(f,{marginLeft:1},h.createElement(p,null,"Press ",h.createElement(p,{bold:!0,color:"cyanBright"},"<ctrl+c>")," to abort.")))),U=({workspa
2025-04-10 09:51:25 -04:00
`)},p=()=>{let Ce=this.from.map(g=>$1.default.matcher(g));return s.workspaces.filter(g=>{let we=q.stringifyIdent(g.anchoredLocator),Ee=g.relativeCwd;return Ce.some(fe=>fe(we)||fe(Ee))})},h=[];if(this.since?(f("Option --since is set; selecting the changed workspaces as root for workspace selection"),h=Array.from(await Qa.fetchChangedWorkspaces({ref:this.since,project:s}))):this.from?(f("Option --from is set; selecting the specified workspaces"),h=[...p()]):this.worktree?(f("Option --worktree is set; selecting the current workspace"),h=[a]):this.recursive?(f("Option --recursive is set; selecting the current workspace"),h=[a]):this.all&&(f("Option --all is set; selecting all workspaces"),h=[...s.workspaces]),this.dryRun&&!this.all){for(let Ce of h)f(`
- ${Ce.relativeCwd}
${q.prettyLocator(r,Ce.anchoredLocator)}`);h.length>0&&f("")}let E;if(this.recursive?this.since?(f("Option --recursive --since is set; recursively selecting all dependent workspaces"),E=new Set(h.map(Ce=>[...Ce.getRecursiveWorkspaceDependents()]).flat())):(f("Option --recursive is set; recursively selecting all transitive dependencies"),E=new Set(h.map(Ce=>[...Ce.getRecursiveWorkspaceDependencies()]).flat())):this.worktree?(f("Option --worktree is set; recursively selecting all nested workspaces"),E=new Set(h.map(Ce=>[...Ce.getRecursiveWorkspaceChildren()]).flat())):E=null,E!==null&&(h=[...new Set([...h,...E])],this.dryRun))for(let Ce of E)f(`
- ${Ce.relativeCwd}
2025-04-11 10:05:45 -04:00
${q.prettyLocator(r,Ce.anchoredLocator)}`);let C=[],S=!1;if(c?.includes(":")){for(let Ce of s.workspaces)if(Ce.manifest.scripts.has(c)&&(S=!S,S===!1))break}for(let Ce of h){if(c&&!Ce.manifest.scripts.has(c)&&!S&&!(await In.getWorkspaceAccessibleBinaries(Ce)).has(c)){f(`Excluding ${Ce.relativeCwd} because it doesn't have a "${c}" script`);continue}if(!(c===r.env.npm_lifecycle_event&&Ce.cwd===a.cwd)){if(this.include.length>0&&!$1.default.isMatch(q.stringifyIdent(Ce.anchoredLocator),this.include)&&!$1.default.isMatch(Ce.relativeCwd,this.include)){f(`Excluding ${Ce.relativeCwd} because it doesn't match the --include filter`);continue}if(this.exclude.length>0&&($1.default.isMatch(q.stringifyIdent(Ce.anchoredLocator),this.exclude)||$1.default.isMatch(Ce.relativeCwd,this.exclude))){f(`Excluding ${Ce.relativeCwd} because it matches the --exclude filter`);continue}if(this.publicOnly&&Ce.manifest.private===!0){f(`Excluding ${Ce.relativeCwd} because it's a private workspace and --no-private was set`);continue}C.push(Ce)}}if(this.dryRun)return 0;let P=this.verbose??(this.context.stdout.isTTY?1/0:0),I=P>0,R=P>1,N=this.parallel?this.jobs==="unlimited"?1/0:Number(this.jobs)||Math.ceil(As.availableParallelism()/2):1,U=N===1?!1:this.parallel,W=U?this.interlaced:!0,te=(0,zOe.default)(N),ie=new Map,Ae=new Set,ce=0,me=null,pe=!1,Be=await Ot.start({configuration:r,stdout:this.context.stdout,includePrefix:!1},async Ce=>{let g=async(we,{commandIndex:Ee})=>{if(pe)return-1;!U&&R&&Ee>1&&Ce.reportSeparator();let fe=nqt(we,{configuration:r,label:I,commandIndex:Ee}),[se,X]=JOe(Ce,{prefix:fe,interlaced:W}),[De,Re]=JOe(Ce,{prefix:fe,interlaced:W});try{R&&Ce.reportInfo(null,`${fe?`${fe} `:""}Process started`);let gt=Date.now(),j=await this.cli.run([this.commandName,...this.args],{cwd:we.cwd,stdout:se,stderr:De})||0;se.end(),De.end(),await X,await Re;let rt=Date.now();if(R){let Fe=r.get("enableTimers")?`, completed in ${he.pretty(r,rt-gt,he.Type.DURATION)}`:"";Ce.reportInfo(null,`${fe?`${fe} `:""}Process exited (exit code ${j})${Fe}`)}return j===130&&(pe=!0,me=j),j}catch(gt){throw se.end(),De.end(),await X,await Re,gt}};for(let we of C)ie.set(we.anchoredLocator.locatorHash,we);for(;ie.size>0&&!Ce.hasErrors();){let we=[];for(let[X,De]of ie){if(Ae.has(De.anchoredDescriptor.descriptorHash))continue;let Re=!0;if(this.topological||this.topologicalDev){let gt=this.topologicalDev?new Map([...De.manifest.dependencies,...De.manifest.devDependencies]):De.manifest.dependencies;for(let j of gt.values()){let rt=s.tryWorkspaceByDescriptor(j);if(Re=rt===null||!ie.has(rt.anchoredLocator.locatorHash),!Re)break}}if(Re&&(Ae.add(De.anchoredDescriptor.descriptorHash),we.push(te(async()=>{let gt=await g(De,{commandIndex:++ce});return ie.delete(X),Ae.delete(De.anchoredDescriptor.descriptorHash),{workspace:De,exitCode:gt}})),!U))break}if(we.length===0){let X=Array.from(ie.values()).map(De=>q.prettyLocator(r,De.anchoredLocator)).join(", ");Ce.reportError(3,`Dependency cycle detected (${X})`);return}let Ee=await Promise.all(we);Ee.forEach(({workspace:X,exitCode:De})=>{De!==0&&Ce.reportError(0,`The command failed in workspace ${q.prettyLocator(r,X.anchoredLocator)} with exit code ${De}`)});let se=Ee.map(X=>X.exitCode).find(X=>X!==0);(this.topological||this.topologicalDev)&&typeof se<"u"&&Ce.reportError(0,"The command failed for workspaces that are depended upon by other workspaces; can't satisfy the dependency graph")}});return me!==null?me:Be.exitCode()}};function JOe(t,{prefix:e,interlaced:r}){let s=t.createStreamReporter(e),a=new je.DefaultStream;a.pipe(s,{end:!1}),a.on("finish",()=>{s.end()});let n=new Promise(f=>{s.on("finish",()=>{f(a.active)})});if(r)return[a,n];let c=new je.BufferStream;return c.pipe(a,{end:!1}),c.on("finish",()=>{a.end()}),[c,n]}function nqt(t,{configuration:e,commandIndex:r,label:s}){if(!s)return null;let n=`[${q.stringifyIdent(t.anchoredLocator)}]:`,c=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],f=c[r%c.length];return he.pretty(e,n,f)}var iqt={commands:[X1,e2]},sqt=iqt;var nC=()=>({modules:new Map([["@yarnpkg/cli",iS],["@yarnpkg/core",nS],["@
Please report this issue at https://github.com/yarnpkg/berry/issues.`)}process.once("beforeExit",n);try{process.exitCode=42,process.exitCode=await fqt(a,t,{selfPath:r,pluginConfiguration:s})}catch(c){wa.defaultContext.stdout.write(a.error(c)),process.exitCode=1}finally{process.off("beforeExit",n),await le.rmtempPromise()}}zR(process.argv.slice(2),{cwd:K.cwd(),selfPath:ue.toPortablePath(ue.resolve(process.argv[1])),pluginConfiguration:nC()});})();
2025-04-10 09:51:25 -04:00
/**
@license
Copyright (c) 2015, Rebecca Turner
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
/**
@license
Copyright Node.js contributors. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
*/
/**
@license
The MIT License (MIT)
Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
/**
@license
Copyright Joyent, Inc. and other Node contributors.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*! Bundled license information:
is-number/index.js:
(*!
* is-number <https://github.com/jonschlinkert/is-number>
*
* Copyright (c) 2014-present, Jon Schlinkert.
* Released under the MIT License.
*)
to-regex-range/index.js:
(*!
* to-regex-range <https://github.com/micromatch/to-regex-range>
*
* Copyright (c) 2015-present, Jon Schlinkert.
* Released under the MIT License.
*)
fill-range/index.js:
(*!
* fill-range <https://github.com/jonschlinkert/fill-range>
*
* Copyright (c) 2014-present, Jon Schlinkert.
* Licensed under the MIT License.
*)
is-extglob/index.js:
(*!
* is-extglob <https://github.com/jonschlinkert/is-extglob>
*
* Copyright (c) 2014-2016, Jon Schlinkert.
* Licensed under the MIT License.
*)
is-glob/index.js:
(*!
* is-glob <https://github.com/jonschlinkert/is-glob>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*)
queue-microtask/index.js:
(*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
run-parallel/index.js:
(*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
git-url-parse/lib/index.js:
(*!
* buildToken
* Builds OAuth token prefix (helper function)
*
* @name buildToken
* @function
* @param {GitUrl} obj The parsed Git url object.
* @return {String} token prefix
*)
object-assign/index.js:
(*
object-assign
(c) Sindre Sorhus
@license MIT
*)
react/cjs/react.production.min.js:
(** @license React v17.0.2
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
scheduler/cjs/scheduler.production.min.js:
(** @license React v0.20.2
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
react-reconciler/cjs/react-reconciler.production.min.js:
(** @license React v0.26.2
* react-reconciler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
is-windows/index.js:
(*!
* is-windows <https://github.com/jonschlinkert/is-windows>
*
* Copyright © 2015-2018, Jon Schlinkert.
* Released under the MIT License.
*)
*/