@seed-design/codemod 0.0.12-rc.2 → 0.0.12-rc.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/index.mjs CHANGED
@@ -1,16 +1,73 @@
1
1
  #!/usr/bin/env node
2
- var u=(o=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(o,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):o)(function(o){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+o+'" is not supported')});import{cac as I}from"cac";import{execaNode as P}from"execa";import{readdirSync as G}from"fs";import{dirname as C,resolve as d}from"path";import{minVersion as S,satisfies as z}from"semver";var c={name:"@seed-design/codemod",version:"0.0.12-rc.2",type:"module",repository:{type:"git",url:"https://github.com/daangn/seed-design",directory:"packages/codemod"},license:"MIT",bin:"./bin/index.mjs",files:["bin"],scripts:{dev:"bun ./dev.mjs",build:"bun ./build.mjs",test:"LOG=true bun vitest"},dependencies:{"@seed-design/migration-index":"0.0.1-rc.0",cac:"^6.7.14","es-toolkit":"^1.25.2",execa:"^9.4.1",jscodeshift:"^17.0.0",picocolors:"^1.1.1",semver:"^7.6.3","simple-git":"^3.27.0",winston:"^3.15.0",zod:"^3.23.8"},devDependencies:{"@types/jscodeshift":"^0.12.0","@types/node":"^22.7.5","change-case":"^5.4.4","csv-parse":"^5.5.6",dotenv:"^16.4.5",esbuild:"^0.25.0",typescript:"^5.4.5",vitest:"^2.0.5"},optionalDependencies:{"@daangn/react-monochrome-icon":"^0.0.13","@daangn/react-multicolor-icon":"^0.0.11"},publishConfig:{access:"public"},engines:{node:">=20.16.0"}};import{z as t}from"zod";var b=t.object({list:t.boolean().optional(),log:t.boolean().optional(),track:t.boolean(),reporter:t.boolean().optional(),parser:t.enum(["babel","babylon","flow","ts","tsx"]).optional(),extensions:t.string().optional(),ignoreConfig:t.string().optional()});import{simpleGit as O}from"simple-git";async function x(){let o=O();try{let{current:e}=await o.branchLocal(),n=(await o.getRemotes(!0)).map(({name:r,refs:{fetch:a}})=>({name:r,url:a})),s=n.find(({name:r})=>r==="origin")??n[0];return{possibleRepositoryName:s?s.url.split("/").slice(-2).join("/").replace(/\.git$/,""):(await o.revparse(["--show-toplevel"])).split("/").pop(),branch:e,remotes:n}}catch{return null}}import R from"picocolors";var p=R.bold("@seed-design/codemod"),h=o=>({event:e,properties:n})=>console.log(p,e,n,o);L();var v=d(C(import.meta.filename),"transforms"),$=I(),y=await x(),j=h({...y});$.version(c.version).help().command("[transformName] [...paths]","\uCF54\uB4DC \uBCC0\uD658 (codemod)").option("-l, --list","\uC0AC\uC6A9 \uAC00\uB2A5\uD55C transform \uBAA9\uB85D\uC744 \uBCF4\uC5EC\uC918\uC694").option("--log","\uB85C\uADF8\uB97C \uD30C\uC77C\uB85C \uC800\uC7A5\uD574\uC694").option("--no-track","\uC0AC\uC6A9 \uD1B5\uACC4\uB97C \uC218\uC9D1\uD558\uC9C0 \uC54A\uC544\uC694").option("-p, --parser <parser>","jscodeshift\uAC00 \uC0AC\uC6A9\uD560 \uD30C\uC11C\uB97C \uC9C0\uC815\uD574\uC694 (babel|babylon|flow|ts|tsx)",{default:"tsx"}).option("--reporter","\uBCC0\uD658 \uACB0\uACFC\uB97C \uD30C\uC77C\uB85C \uC800\uC7A5\uD574\uC694").option("--extensions <extensions>","\uBCC0\uD658\uD560 \uD30C\uC77C \uD655\uC7A5\uC790").option("--ignore-config <ignoreConfig>","Ignore config").example(" $ npx @seed-design/codemod migrate-icons src/ui").action(async(o,e,n)=>{let s=b.parse(n);s.track&&j?.({event:"\uC2E4\uD589",properties:{transformName:o,paths:e}});let i=A();s.list&&(l(i),process.exit(0)),o||(console.error("transform \uC774\uB984\uC744 \uC785\uB825\uD574\uC8FC\uC138\uC694"),l(i),process.exit(1)),i.includes(o)||(console.error(`\uC774\uB984\uC774 ${o}\uC778 transform\uC774 \uC5C6\uC5B4\uC694`),l(i),process.exit(1)),e.length===0&&(console.error("\uD30C\uC77C \uACBD\uB85C\uB97C \uC785\uB825\uD574\uC8FC\uC138\uC694"),process.exit(1));let r=d(v,o,"index.mjs");console.log(p,`${e.join(", ")}\uC5D0 ${o} transform\uC744 \uC2E4\uD589\uD574\uC694.`),await N(r,e,s)});$.parse();function L(){z(process.versions.node,c.engines.node)===!1&&(console.error(`Node.js \uBC84\uC804 \uC694\uAD6C\uC0AC\uD56D\uC744 \uB9CC\uC871\uC2DC\uD0A4\uC9C0 \uC54A\uC544\uC694: "${c.engines.node}"
2
+ var aw=Object.create;var vc=Object.defineProperty;var cw=Object.getOwnPropertyDescriptor;var uw=Object.getOwnPropertyNames;var lw=Object.getPrototypeOf,fw=Object.prototype.hasOwnProperty;var pe=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var w=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var dw=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of uw(t))!fw.call(e,s)&&s!==r&&vc(e,s,{get:()=>t[s],enumerable:!(n=cw(t,s))||n.enumerable});return e};var gt=(e,t,r)=>(r=e!=null?aw(lw(e)):{},dw(t||!e||!e.__esModule?vc(r,"default",{value:e,enumerable:!0}):r,e));var ou=w((LL,su)=>{su.exports=nu;nu.sync=ES;var tu=pe("fs");function _S(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var s=r[n].toLowerCase();if(s&&e.substr(-s.length).toLowerCase()===s)return!0}return!1}function ru(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:_S(t,r)}function nu(e,t,r){tu.stat(e,function(n,s){r(n,n?!1:ru(s,e,t))})}function ES(e,t){return ru(tu.statSync(e),e,t)}});var lu=w((NL,uu)=>{uu.exports=au;au.sync=TS;var iu=pe("fs");function au(e,t,r){iu.stat(e,function(n,s){r(n,n?!1:cu(s,t))})}function TS(e,t){return cu(iu.statSync(e),t)}function cu(e,t){return e.isFile()&&OS(e,t)}function OS(e,t){var r=e.mode,n=e.uid,s=e.gid,o=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),i=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),u=parseInt("001",8),l=a|c,f=r&u||r&c&&s===i||r&a&&n===o||r&l&&o===0;return f}});var du=w((ML,fu)=>{var PL=pe("fs"),kn;process.platform==="win32"||global.TESTING_WINDOWS?kn=ou():kn=lu();fu.exports=$o;$o.sync=RS;function $o(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,s){$o(e,t||{},function(o,i){o?s(o):n(i)})})}kn(e,t||{},function(n,s){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,s=!1),r(n,s)})}function RS(e,t){try{return kn.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var wu=w((FL,bu)=>{var Yt=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",pu=pe("path"),kS=Yt?";":":",mu=du(),hu=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),gu=(e,t)=>{let r=t.colon||kS,n=e.match(/\//)||Yt&&e.match(/\\/)?[""]:[...Yt?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],s=Yt?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=Yt?s.split(r):[""];return Yt&&e.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:s}},yu=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:s,pathExtExe:o}=gu(e,t),i=[],a=u=>new Promise((l,f)=>{if(u===n.length)return t.all&&i.length?l(i):f(hu(e));let p=n[u],d=/^".*"$/.test(p)?p.slice(1,-1):p,b=pu.join(d,e),T=!d&&/^\.[\\\/]/.test(e)?e.slice(0,2)+b:b;l(c(T,u,0))}),c=(u,l,f)=>new Promise((p,d)=>{if(f===s.length)return p(a(l+1));let b=s[f];mu(u+b,{pathExt:o},(T,N)=>{if(!T&&N)if(t.all)i.push(u+b);else return p(u+b);return p(c(u,l,f+1))})});return r?a(0).then(u=>r(null,u),r):a(0)},CS=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:n,pathExtExe:s}=gu(e,t),o=[];for(let i=0;i<r.length;i++){let a=r[i],c=/^".*"$/.test(a)?a.slice(1,-1):a,u=pu.join(c,e),l=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;for(let f=0;f<n.length;f++){let p=l+n[f];try{if(mu.sync(p,{pathExt:s}))if(t.all)o.push(p);else return p}catch{}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw hu(e)};bu.exports=yu;yu.sync=CS});var xu=w((jL,Do)=>{"use strict";var Su=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};Do.exports=Su;Do.exports.default=Su});var Tu=w((BL,Eu)=>{"use strict";var vu=pe("path"),AS=wu(),IS=xu();function _u(e,t){let r=e.options.env||process.env,n=process.cwd(),s=e.options.cwd!=null,o=s&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(e.options.cwd)}catch{}let i;try{i=AS.sync(e.command,{path:r[IS({env:r})],pathExt:t?vu.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return i&&(i=vu.resolve(s?e.options.cwd:"",i)),i}function $S(e){return _u(e)||_u(e,!0)}Eu.exports=$S});var Ou=w((UL,No)=>{"use strict";var Lo=/([()\][%!^"`<>&|;, *?])/g;function DS(e){return e=e.replace(Lo,"^$1"),e}function LS(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(Lo,"^$1"),t&&(e=e.replace(Lo,"^$1")),e}No.exports.command=DS;No.exports.argument=LS});var ku=w((GL,Ru)=>{"use strict";Ru.exports=/^#!(.*)/});var Au=w((qL,Cu)=>{"use strict";var NS=ku();Cu.exports=(e="")=>{let t=e.match(NS);if(!t)return null;let[r,n]=t[0].replace(/#! ?/,"").split(" "),s=r.split("/").pop();return s==="env"?n:n?`${s} ${n}`:s}});var $u=w((VL,Iu)=>{"use strict";var Po=pe("fs"),PS=Au();function MS(e){let r=Buffer.alloc(150),n;try{n=Po.openSync(e,"r"),Po.readSync(n,r,0,150,0),Po.closeSync(n)}catch{}return PS(r.toString())}Iu.exports=MS});var Pu=w((zL,Nu)=>{"use strict";var FS=pe("path"),Du=Tu(),Lu=Ou(),jS=$u(),BS=process.platform==="win32",US=/\.(?:com|exe)$/i,GS=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function qS(e){e.file=Du(e);let t=e.file&&jS(e.file);return t?(e.args.unshift(e.file),e.command=t,Du(e)):e.file}function VS(e){if(!BS)return e;let t=qS(e),r=!US.test(t);if(e.options.forceShell||r){let n=GS.test(t);e.command=FS.normalize(e.command),e.command=Lu.command(e.command),e.args=e.args.map(o=>Lu.argument(o,n));let s=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${s}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function zS(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let n={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?n:VS(n)}Nu.exports=zS});var ju=w((WL,Fu)=>{"use strict";var Mo=process.platform==="win32";function Fo(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function WS(e,t){if(!Mo)return;let r=e.emit;e.emit=function(n,s){if(n==="exit"){let o=Mu(s,t);if(o)return r.call(e,"error",o)}return r.apply(e,arguments)}}function Mu(e,t){return Mo&&e===1&&!t.file?Fo(t.original,"spawn"):null}function ZS(e,t){return Mo&&e===1&&!t.file?Fo(t.original,"spawnSync"):null}Fu.exports={hookChildProcess:WS,verifyENOENT:Mu,verifyENOENTSync:ZS,notFoundError:Fo}});var Gu=w((ZL,Xt)=>{"use strict";var Bu=pe("child_process"),jo=Pu(),Bo=ju();function Uu(e,t,r){let n=jo(e,t,r),s=Bu.spawn(n.command,n.args,n.options);return Bo.hookChildProcess(s,n),s}function HS(e,t,r){let n=jo(e,t,r),s=Bu.spawnSync(n.command,n.args,n.options);return s.error=s.error||Bo.verifyENOENTSync(s.status,n),s}Xt.exports=Uu;Xt.exports.spawn=Uu;Xt.exports.sync=HS;Xt.exports._parse=jo;Xt.exports._enoent=Bo});var Gr=w((J9,Lp)=>{var YT="2.0.0",XT=Number.MAX_SAFE_INTEGER||9007199254740991,KT=16,JT=250,QT=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Lp.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:KT,MAX_SAFE_BUILD_LENGTH:JT,MAX_SAFE_INTEGER:XT,RELEASE_TYPES:QT,SEMVER_SPEC_VERSION:YT,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var qr=w((Q9,Np)=>{var eO=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};Np.exports=eO});var ar=w((Ve,Pp)=>{var{MAX_SAFE_COMPONENT_LENGTH:Qi,MAX_SAFE_BUILD_LENGTH:tO,MAX_LENGTH:rO}=Gr(),nO=qr();Ve=Pp.exports={};var sO=Ve.re=[],oO=Ve.safeRe=[],x=Ve.src=[],iO=Ve.safeSrc=[],v=Ve.t={},aO=0,ea="[a-zA-Z0-9-]",cO=[["\\s",1],["\\d",rO],[ea,tO]],uO=e=>{for(let[t,r]of cO)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},A=(e,t,r)=>{let n=uO(t),s=aO++;nO(e,s,t),v[e]=s,x[s]=t,iO[s]=n,sO[s]=new RegExp(t,r?"g":void 0),oO[s]=new RegExp(n,r?"g":void 0)};A("NUMERICIDENTIFIER","0|[1-9]\\d*");A("NUMERICIDENTIFIERLOOSE","\\d+");A("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${ea}*`);A("MAINVERSION",`(${x[v.NUMERICIDENTIFIER]})\\.(${x[v.NUMERICIDENTIFIER]})\\.(${x[v.NUMERICIDENTIFIER]})`);A("MAINVERSIONLOOSE",`(${x[v.NUMERICIDENTIFIERLOOSE]})\\.(${x[v.NUMERICIDENTIFIERLOOSE]})\\.(${x[v.NUMERICIDENTIFIERLOOSE]})`);A("PRERELEASEIDENTIFIER",`(?:${x[v.NUMERICIDENTIFIER]}|${x[v.NONNUMERICIDENTIFIER]})`);A("PRERELEASEIDENTIFIERLOOSE",`(?:${x[v.NUMERICIDENTIFIERLOOSE]}|${x[v.NONNUMERICIDENTIFIER]})`);A("PRERELEASE",`(?:-(${x[v.PRERELEASEIDENTIFIER]}(?:\\.${x[v.PRERELEASEIDENTIFIER]})*))`);A("PRERELEASELOOSE",`(?:-?(${x[v.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${x[v.PRERELEASEIDENTIFIERLOOSE]})*))`);A("BUILDIDENTIFIER",`${ea}+`);A("BUILD",`(?:\\+(${x[v.BUILDIDENTIFIER]}(?:\\.${x[v.BUILDIDENTIFIER]})*))`);A("FULLPLAIN",`v?${x[v.MAINVERSION]}${x[v.PRERELEASE]}?${x[v.BUILD]}?`);A("FULL",`^${x[v.FULLPLAIN]}$`);A("LOOSEPLAIN",`[v=\\s]*${x[v.MAINVERSIONLOOSE]}${x[v.PRERELEASELOOSE]}?${x[v.BUILD]}?`);A("LOOSE",`^${x[v.LOOSEPLAIN]}$`);A("GTLT","((?:<|>)?=?)");A("XRANGEIDENTIFIERLOOSE",`${x[v.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);A("XRANGEIDENTIFIER",`${x[v.NUMERICIDENTIFIER]}|x|X|\\*`);A("XRANGEPLAIN",`[v=\\s]*(${x[v.XRANGEIDENTIFIER]})(?:\\.(${x[v.XRANGEIDENTIFIER]})(?:\\.(${x[v.XRANGEIDENTIFIER]})(?:${x[v.PRERELEASE]})?${x[v.BUILD]}?)?)?`);A("XRANGEPLAINLOOSE",`[v=\\s]*(${x[v.XRANGEIDENTIFIERLOOSE]})(?:\\.(${x[v.XRANGEIDENTIFIERLOOSE]})(?:\\.(${x[v.XRANGEIDENTIFIERLOOSE]})(?:${x[v.PRERELEASELOOSE]})?${x[v.BUILD]}?)?)?`);A("XRANGE",`^${x[v.GTLT]}\\s*${x[v.XRANGEPLAIN]}$`);A("XRANGELOOSE",`^${x[v.GTLT]}\\s*${x[v.XRANGEPLAINLOOSE]}$`);A("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Qi}})(?:\\.(\\d{1,${Qi}}))?(?:\\.(\\d{1,${Qi}}))?`);A("COERCE",`${x[v.COERCEPLAIN]}(?:$|[^\\d])`);A("COERCEFULL",x[v.COERCEPLAIN]+`(?:${x[v.PRERELEASE]})?(?:${x[v.BUILD]})?(?:$|[^\\d])`);A("COERCERTL",x[v.COERCE],!0);A("COERCERTLFULL",x[v.COERCEFULL],!0);A("LONETILDE","(?:~>?)");A("TILDETRIM",`(\\s*)${x[v.LONETILDE]}\\s+`,!0);Ve.tildeTrimReplace="$1~";A("TILDE",`^${x[v.LONETILDE]}${x[v.XRANGEPLAIN]}$`);A("TILDELOOSE",`^${x[v.LONETILDE]}${x[v.XRANGEPLAINLOOSE]}$`);A("LONECARET","(?:\\^)");A("CARETTRIM",`(\\s*)${x[v.LONECARET]}\\s+`,!0);Ve.caretTrimReplace="$1^";A("CARET",`^${x[v.LONECARET]}${x[v.XRANGEPLAIN]}$`);A("CARETLOOSE",`^${x[v.LONECARET]}${x[v.XRANGEPLAINLOOSE]}$`);A("COMPARATORLOOSE",`^${x[v.GTLT]}\\s*(${x[v.LOOSEPLAIN]})$|^$`);A("COMPARATOR",`^${x[v.GTLT]}\\s*(${x[v.FULLPLAIN]})$|^$`);A("COMPARATORTRIM",`(\\s*)${x[v.GTLT]}\\s*(${x[v.LOOSEPLAIN]}|${x[v.XRANGEPLAIN]})`,!0);Ve.comparatorTrimReplace="$1$2$3";A("HYPHENRANGE",`^\\s*(${x[v.XRANGEPLAIN]})\\s+-\\s+(${x[v.XRANGEPLAIN]})\\s*$`);A("HYPHENRANGELOOSE",`^\\s*(${x[v.XRANGEPLAINLOOSE]})\\s+-\\s+(${x[v.XRANGEPLAINLOOSE]})\\s*$`);A("STAR","(<|>)?=?\\s*\\*");A("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");A("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Es=w((e3,Mp)=>{var lO=Object.freeze({loose:!0}),fO=Object.freeze({}),dO=e=>e?typeof e!="object"?lO:e:fO;Mp.exports=dO});var ta=w((t3,Bp)=>{var Fp=/^[0-9]+$/,jp=(e,t)=>{let r=Fp.test(e),n=Fp.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},pO=(e,t)=>jp(t,e);Bp.exports={compareIdentifiers:jp,rcompareIdentifiers:pO}});var Q=w((r3,Vp)=>{var Ts=qr(),{MAX_LENGTH:Up,MAX_SAFE_INTEGER:Os}=Gr(),{safeRe:Gp,safeSrc:qp,t:Rs}=ar(),mO=Es(),{compareIdentifiers:cr}=ta(),ra=class e{constructor(t,r){if(r=mO(r),t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>Up)throw new TypeError(`version is longer than ${Up} characters`);Ts("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=t.trim().match(r.loose?Gp[Rs.LOOSE]:Gp[Rs.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Os||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Os||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Os||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(s=>{if(/^[0-9]+$/.test(s)){let o=+s;if(o>=0&&o<Os)return o}return s}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(Ts("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if(typeof t=="string"&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),cr(this.major,t.major)||cr(this.minor,t.minor)||cr(this.patch,t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],s=t.prerelease[r];if(Ts("prerelease compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return cr(n,s)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let n=this.build[r],s=t.build[r];if(Ts("build compare",r,n,s),n===void 0&&s===void 0)return 0;if(s===void 0)return 1;if(n===void 0)return-1;if(n===s)continue;return cr(n,s)}while(++r)}inc(t,r,n){if(t.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let s=new RegExp(`^${this.options.loose?qp[Rs.PRERELEASELOOSE]:qp[Rs.PRERELEASE]}$`),o=`-${r}`.match(s);if(!o||o[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let s=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[s];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(s)}}if(r){let o=[r,s];n===!1&&(o=[r]),cr(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};Vp.exports=ra});var Et=w((n3,Wp)=>{var zp=Q(),hO=(e,t,r=!1)=>{if(e instanceof zp)return e;try{return new zp(e,t)}catch(n){if(!r)return null;throw n}};Wp.exports=hO});var Hp=w((s3,Zp)=>{var gO=Et(),yO=(e,t)=>{let r=gO(e,t);return r?r.version:null};Zp.exports=yO});var Xp=w((o3,Yp)=>{var bO=Et(),wO=(e,t)=>{let r=bO(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};Yp.exports=wO});var Qp=w((i3,Jp)=>{var Kp=Q(),SO=(e,t,r,n,s)=>{typeof r=="string"&&(s=n,n=r,r=void 0);try{return new Kp(e instanceof Kp?e.version:e,r).inc(t,n,s).version}catch{return null}};Jp.exports=SO});var rm=w((a3,tm)=>{var em=Et(),xO=(e,t)=>{let r=em(e,null,!0),n=em(t,null,!0),s=r.compare(n);if(s===0)return null;let o=s>0,i=o?r:n,a=o?n:r,c=!!i.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(i)===0)return a.minor&&!a.patch?"minor":"patch"}let l=c?"pre":"";return r.major!==n.major?l+"major":r.minor!==n.minor?l+"minor":r.patch!==n.patch?l+"patch":"prerelease"};tm.exports=xO});var sm=w((c3,nm)=>{var vO=Q(),_O=(e,t)=>new vO(e,t).major;nm.exports=_O});var im=w((u3,om)=>{var EO=Q(),TO=(e,t)=>new EO(e,t).minor;om.exports=TO});var cm=w((l3,am)=>{var OO=Q(),RO=(e,t)=>new OO(e,t).patch;am.exports=RO});var lm=w((f3,um)=>{var kO=Et(),CO=(e,t)=>{let r=kO(e,t);return r&&r.prerelease.length?r.prerelease:null};um.exports=CO});var Ee=w((d3,dm)=>{var fm=Q(),AO=(e,t,r)=>new fm(e,r).compare(new fm(t,r));dm.exports=AO});var mm=w((p3,pm)=>{var IO=Ee(),$O=(e,t,r)=>IO(t,e,r);pm.exports=$O});var gm=w((m3,hm)=>{var DO=Ee(),LO=(e,t)=>DO(e,t,!0);hm.exports=LO});var ks=w((h3,bm)=>{var ym=Q(),NO=(e,t,r)=>{let n=new ym(e,r),s=new ym(t,r);return n.compare(s)||n.compareBuild(s)};bm.exports=NO});var Sm=w((g3,wm)=>{var PO=ks(),MO=(e,t)=>e.sort((r,n)=>PO(r,n,t));wm.exports=MO});var vm=w((y3,xm)=>{var FO=ks(),jO=(e,t)=>e.sort((r,n)=>FO(n,r,t));xm.exports=jO});var Vr=w((b3,_m)=>{var BO=Ee(),UO=(e,t,r)=>BO(e,t,r)>0;_m.exports=UO});var Cs=w((w3,Em)=>{var GO=Ee(),qO=(e,t,r)=>GO(e,t,r)<0;Em.exports=qO});var na=w((S3,Tm)=>{var VO=Ee(),zO=(e,t,r)=>VO(e,t,r)===0;Tm.exports=zO});var sa=w((x3,Om)=>{var WO=Ee(),ZO=(e,t,r)=>WO(e,t,r)!==0;Om.exports=ZO});var As=w((v3,Rm)=>{var HO=Ee(),YO=(e,t,r)=>HO(e,t,r)>=0;Rm.exports=YO});var Is=w((_3,km)=>{var XO=Ee(),KO=(e,t,r)=>XO(e,t,r)<=0;km.exports=KO});var oa=w((E3,Cm)=>{var JO=na(),QO=sa(),eR=Vr(),tR=As(),rR=Cs(),nR=Is(),sR=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return JO(e,r,n);case"!=":return QO(e,r,n);case">":return eR(e,r,n);case">=":return tR(e,r,n);case"<":return rR(e,r,n);case"<=":return nR(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};Cm.exports=sR});var Im=w((T3,Am)=>{var oR=Q(),iR=Et(),{safeRe:$s,t:Ds}=ar(),aR=(e,t)=>{if(e instanceof oR)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?$s[Ds.COERCEFULL]:$s[Ds.COERCE]);else{let c=t.includePrerelease?$s[Ds.COERCERTLFULL]:$s[Ds.COERCERTL],u;for(;(u=c.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||u.index+u[0].length!==r.index+r[0].length)&&(r=u),c.lastIndex=u.index+u[1].length+u[2].length;c.lastIndex=-1}if(r===null)return null;let n=r[2],s=r[3]||"0",o=r[4]||"0",i=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return iR(`${n}.${s}.${o}${i}${a}`,t)};Am.exports=aR});var Dm=w((O3,$m)=>{var ia=class{constructor(){this.max=1e3,this.map=new Map}get(t){let r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){let s=this.map.keys().next().value;this.delete(s)}this.map.set(t,r)}return this}};$m.exports=ia});var Te=w((R3,Mm)=>{var cR=/\s+/g,aa=class e{constructor(t,r){if(r=lR(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof ca)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(cR," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(s=>!Nm(s[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let s of this.set)if(s.length===1&&yR(s[0])){this.set=[s];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t<this.set.length;t++){t>0&&(this.formatted+="||");let r=this.set[t];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){let n=((this.options.includePrerelease&&hR)|(this.options.loose&&gR))+":"+t,s=Lm.get(n);if(s)return s;let o=this.options.loose,i=o?ce[ne.HYPHENRANGELOOSE]:ce[ne.HYPHENRANGE];t=t.replace(i,RR(this.options.includePrerelease)),G("hyphen replace",t),t=t.replace(ce[ne.COMPARATORTRIM],dR),G("comparator trim",t),t=t.replace(ce[ne.TILDETRIM],pR),G("tilde trim",t),t=t.replace(ce[ne.CARETTRIM],mR),G("caret trim",t);let a=t.split(" ").map(f=>bR(f,this.options)).join(" ").split(/\s+/).map(f=>OR(f,this.options));o&&(a=a.filter(f=>(G("loose invalid filter",f,this.options),!!f.match(ce[ne.COMPARATORLOOSE])))),G("range list",a);let c=new Map,u=a.map(f=>new ca(f,this.options));for(let f of u){if(Nm(f))return[f];c.set(f.value,f)}c.size>1&&c.has("")&&c.delete("");let l=[...c.values()];return Lm.set(n,l),l}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(n=>Pm(n,r)&&t.set.some(s=>Pm(s,r)&&n.every(o=>s.every(i=>o.intersects(i,r)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new fR(t,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(kR(this.set[r],t,this.options))return!0;return!1}};Mm.exports=aa;var uR=Dm(),Lm=new uR,lR=Es(),ca=zr(),G=qr(),fR=Q(),{safeRe:ce,t:ne,comparatorTrimReplace:dR,tildeTrimReplace:pR,caretTrimReplace:mR}=ar(),{FLAG_INCLUDE_PRERELEASE:hR,FLAG_LOOSE:gR}=Gr(),Nm=e=>e.value==="<0.0.0-0",yR=e=>e.value==="",Pm=(e,t)=>{let r=!0,n=e.slice(),s=n.pop();for(;r&&n.length;)r=n.every(o=>s.intersects(o,t)),s=n.pop();return r},bR=(e,t)=>(G("comp",e,t),e=xR(e,t),G("caret",e),e=wR(e,t),G("tildes",e),e=_R(e,t),G("xrange",e),e=TR(e,t),G("stars",e),e),se=e=>!e||e.toLowerCase()==="x"||e==="*",wR=(e,t)=>e.trim().split(/\s+/).map(r=>SR(r,t)).join(" "),SR=(e,t)=>{let r=t.loose?ce[ne.TILDELOOSE]:ce[ne.TILDE];return e.replace(r,(n,s,o,i,a)=>{G("tilde",e,n,s,o,i,a);let c;return se(s)?c="":se(o)?c=`>=${s}.0.0 <${+s+1}.0.0-0`:se(i)?c=`>=${s}.${o}.0 <${s}.${+o+1}.0-0`:a?(G("replaceTilde pr",a),c=`>=${s}.${o}.${i}-${a} <${s}.${+o+1}.0-0`):c=`>=${s}.${o}.${i} <${s}.${+o+1}.0-0`,G("tilde return",c),c})},xR=(e,t)=>e.trim().split(/\s+/).map(r=>vR(r,t)).join(" "),vR=(e,t)=>{G("caret",e,t);let r=t.loose?ce[ne.CARETLOOSE]:ce[ne.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(s,o,i,a,c)=>{G("caret",e,s,o,i,a,c);let u;return se(o)?u="":se(i)?u=`>=${o}.0.0${n} <${+o+1}.0.0-0`:se(a)?o==="0"?u=`>=${o}.${i}.0${n} <${o}.${+i+1}.0-0`:u=`>=${o}.${i}.0${n} <${+o+1}.0.0-0`:c?(G("replaceCaret pr",c),o==="0"?i==="0"?u=`>=${o}.${i}.${a}-${c} <${o}.${i}.${+a+1}-0`:u=`>=${o}.${i}.${a}-${c} <${o}.${+i+1}.0-0`:u=`>=${o}.${i}.${a}-${c} <${+o+1}.0.0-0`):(G("no pr"),o==="0"?i==="0"?u=`>=${o}.${i}.${a}${n} <${o}.${i}.${+a+1}-0`:u=`>=${o}.${i}.${a}${n} <${o}.${+i+1}.0-0`:u=`>=${o}.${i}.${a} <${+o+1}.0.0-0`),G("caret return",u),u})},_R=(e,t)=>(G("replaceXRanges",e,t),e.split(/\s+/).map(r=>ER(r,t)).join(" ")),ER=(e,t)=>{e=e.trim();let r=t.loose?ce[ne.XRANGELOOSE]:ce[ne.XRANGE];return e.replace(r,(n,s,o,i,a,c)=>{G("xRange",e,n,s,o,i,a,c);let u=se(o),l=u||se(i),f=l||se(a),p=f;return s==="="&&p&&(s=""),c=t.includePrerelease?"-0":"",u?s===">"||s==="<"?n="<0.0.0-0":n="*":s&&p?(l&&(i=0),a=0,s===">"?(s=">=",l?(o=+o+1,i=0,a=0):(i=+i+1,a=0)):s==="<="&&(s="<",l?o=+o+1:i=+i+1),s==="<"&&(c="-0"),n=`${s+o}.${i}.${a}${c}`):l?n=`>=${o}.0.0${c} <${+o+1}.0.0-0`:f&&(n=`>=${o}.${i}.0${c} <${o}.${+i+1}.0-0`),G("xRange return",n),n})},TR=(e,t)=>(G("replaceStars",e,t),e.trim().replace(ce[ne.STAR],"")),OR=(e,t)=>(G("replaceGTE0",e,t),e.trim().replace(ce[t.includePrerelease?ne.GTE0PRE:ne.GTE0],"")),RR=e=>(t,r,n,s,o,i,a,c,u,l,f,p)=>(se(n)?r="":se(s)?r=`>=${n}.0.0${e?"-0":""}`:se(o)?r=`>=${n}.${s}.0${e?"-0":""}`:i?r=`>=${r}`:r=`>=${r}${e?"-0":""}`,se(u)?c="":se(l)?c=`<${+u+1}.0.0-0`:se(f)?c=`<${u}.${+l+1}.0-0`:p?c=`<=${u}.${l}.${f}-${p}`:e?c=`<${u}.${l}.${+f+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),kR=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++)if(G(e[n].semver),e[n].semver!==ca.ANY&&e[n].semver.prerelease.length>0){let s=e[n].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}return!1}return!0}});var zr=w((k3,qm)=>{var Wr=Symbol("SemVer ANY"),fa=class e{static get ANY(){return Wr}constructor(t,r){if(r=Fm(r),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),la("comparator",t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===Wr?this.value="":this.value=this.operator+this.semver.version,la("comp",this)}parse(t){let r=this.options.loose?jm[Bm.COMPARATORLOOSE]:jm[Bm.COMPARATOR],n=t.match(r);if(!n)throw new TypeError(`Invalid comparator: ${t}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new Um(n[2],this.options.loose):this.semver=Wr}toString(){return this.value}test(t){if(la("Comparator.test",t,this.options.loose),this.semver===Wr||t===Wr)return!0;if(typeof t=="string")try{t=new Um(t,this.options)}catch{return!1}return ua(t,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new Gm(t.value,r).test(this.value):t.operator===""?t.value===""?!0:new Gm(this.value,r).test(t.semver):(r=Fm(r),r.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||ua(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||ua(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};qm.exports=fa;var Fm=Es(),{safeRe:jm,t:Bm}=ar(),ua=oa(),la=qr(),Um=Q(),Gm=Te()});var Zr=w((C3,Vm)=>{var CR=Te(),AR=(e,t,r)=>{try{t=new CR(t,r)}catch{return!1}return t.test(e)};Vm.exports=AR});var Wm=w((A3,zm)=>{var IR=Te(),$R=(e,t)=>new IR(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));zm.exports=$R});var Hm=w((I3,Zm)=>{var DR=Q(),LR=Te(),NR=(e,t,r)=>{let n=null,s=null,o=null;try{o=new LR(t,r)}catch{return null}return e.forEach(i=>{o.test(i)&&(!n||s.compare(i)===-1)&&(n=i,s=new DR(n,r))}),n};Zm.exports=NR});var Xm=w(($3,Ym)=>{var PR=Q(),MR=Te(),FR=(e,t,r)=>{let n=null,s=null,o=null;try{o=new MR(t,r)}catch{return null}return e.forEach(i=>{o.test(i)&&(!n||s.compare(i)===1)&&(n=i,s=new PR(n,r))}),n};Ym.exports=FR});var Qm=w((D3,Jm)=>{var da=Q(),jR=Te(),Km=Vr(),BR=(e,t)=>{e=new jR(e,t);let r=new da("0.0.0");if(e.test(r)||(r=new da("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n<e.set.length;++n){let s=e.set[n],o=null;s.forEach(i=>{let a=new da(i.semver.version);switch(i.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||Km(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${i.operator}`)}}),o&&(!r||Km(r,o))&&(r=o)}return r&&e.test(r)?r:null};Jm.exports=BR});var th=w((L3,eh)=>{var UR=Te(),GR=(e,t)=>{try{return new UR(e,t).range||"*"}catch{return null}};eh.exports=GR});var Ls=w((N3,oh)=>{var qR=Q(),sh=zr(),{ANY:VR}=sh,zR=Te(),WR=Zr(),rh=Vr(),nh=Cs(),ZR=Is(),HR=As(),YR=(e,t,r,n)=>{e=new qR(e,n),t=new zR(t,n);let s,o,i,a,c;switch(r){case">":s=rh,o=ZR,i=nh,a=">",c=">=";break;case"<":s=nh,o=HR,i=rh,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(WR(e,t,n))return!1;for(let u=0;u<t.set.length;++u){let l=t.set[u],f=null,p=null;if(l.forEach(d=>{d.semver===VR&&(d=new sh(">=0.0.0")),f=f||d,p=p||d,s(d.semver,f.semver,n)?f=d:i(d.semver,p.semver,n)&&(p=d)}),f.operator===a||f.operator===c||(!p.operator||p.operator===a)&&o(e,p.semver))return!1;if(p.operator===c&&i(e,p.semver))return!1}return!0};oh.exports=YR});var ah=w((P3,ih)=>{var XR=Ls(),KR=(e,t,r)=>XR(e,t,">",r);ih.exports=KR});var uh=w((M3,ch)=>{var JR=Ls(),QR=(e,t,r)=>JR(e,t,"<",r);ch.exports=QR});var dh=w((F3,fh)=>{var lh=Te(),ek=(e,t,r)=>(e=new lh(e,r),t=new lh(t,r),e.intersects(t,r));fh.exports=ek});var mh=w((j3,ph)=>{var tk=Zr(),rk=Ee();ph.exports=(e,t,r)=>{let n=[],s=null,o=null,i=e.sort((l,f)=>rk(l,f,r));for(let l of i)tk(l,t,r)?(o=l,s||(s=l)):(o&&n.push([s,o]),o=null,s=null);s&&n.push([s,null]);let a=[];for(let[l,f]of n)l===f?a.push(l):!f&&l===i[0]?a.push("*"):f?l===i[0]?a.push(`<=${f}`):a.push(`${l} - ${f}`):a.push(`>=${l}`);let c=a.join(" || "),u=typeof t.raw=="string"?t.raw:String(t);return c.length<u.length?c:t}});var Sh=w((B3,wh)=>{var hh=Te(),ma=zr(),{ANY:pa}=ma,Hr=Zr(),ha=Ee(),nk=(e,t,r={})=>{if(e===t)return!0;e=new hh(e,r),t=new hh(t,r);let n=!1;e:for(let s of e.set){for(let o of t.set){let i=ok(s,o,r);if(n=n||i!==null,i)continue e}if(n)return!1}return!0},sk=[new ma(">=0.0.0-0")],gh=[new ma(">=0.0.0")],ok=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===pa){if(t.length===1&&t[0].semver===pa)return!0;r.includePrerelease?e=sk:e=gh}if(t.length===1&&t[0].semver===pa){if(r.includePrerelease)return!0;t=gh}let n=new Set,s,o;for(let d of e)d.operator===">"||d.operator===">="?s=yh(s,d,r):d.operator==="<"||d.operator==="<="?o=bh(o,d,r):n.add(d.semver);if(n.size>1)return null;let i;if(s&&o){if(i=ha(s.semver,o.semver,r),i>0)return null;if(i===0&&(s.operator!==">="||o.operator!=="<="))return null}for(let d of n){if(s&&!Hr(d,String(s),r)||o&&!Hr(d,String(o),r))return null;for(let b of t)if(!Hr(d,String(b),r))return!1;return!0}let a,c,u,l,f=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,p=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;f&&f.prerelease.length===1&&o.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let d of t){if(l=l||d.operator===">"||d.operator===">=",u=u||d.operator==="<"||d.operator==="<=",s){if(p&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===p.major&&d.semver.minor===p.minor&&d.semver.patch===p.patch&&(p=!1),d.operator===">"||d.operator===">="){if(a=yh(s,d,r),a===d&&a!==s)return!1}else if(s.operator===">="&&!Hr(s.semver,String(d),r))return!1}if(o){if(f&&d.semver.prerelease&&d.semver.prerelease.length&&d.semver.major===f.major&&d.semver.minor===f.minor&&d.semver.patch===f.patch&&(f=!1),d.operator==="<"||d.operator==="<="){if(c=bh(o,d,r),c===d&&c!==o)return!1}else if(o.operator==="<="&&!Hr(o.semver,String(d),r))return!1}if(!d.operator&&(o||s)&&i!==0)return!1}return!(s&&u&&!o&&i!==0||o&&l&&!s&&i!==0||p||f)},yh=(e,t,r)=>{if(!e)return t;let n=ha(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},bh=(e,t,r)=>{if(!e)return t;let n=ha(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};wh.exports=nk});var Eh=w((U3,_h)=>{var ga=ar(),xh=Gr(),ik=Q(),vh=ta(),ak=Et(),ck=Hp(),uk=Xp(),lk=Qp(),fk=rm(),dk=sm(),pk=im(),mk=cm(),hk=lm(),gk=Ee(),yk=mm(),bk=gm(),wk=ks(),Sk=Sm(),xk=vm(),vk=Vr(),_k=Cs(),Ek=na(),Tk=sa(),Ok=As(),Rk=Is(),kk=oa(),Ck=Im(),Ak=zr(),Ik=Te(),$k=Zr(),Dk=Wm(),Lk=Hm(),Nk=Xm(),Pk=Qm(),Mk=th(),Fk=Ls(),jk=ah(),Bk=uh(),Uk=dh(),Gk=mh(),qk=Sh();_h.exports={parse:ak,valid:ck,clean:uk,inc:lk,diff:fk,major:dk,minor:pk,patch:mk,prerelease:hk,compare:gk,rcompare:yk,compareLoose:bk,compareBuild:wk,sort:Sk,rsort:xk,gt:vk,lt:_k,eq:Ek,neq:Tk,gte:Ok,lte:Rk,cmp:kk,coerce:Ck,Comparator:Ak,Range:Ik,satisfies:$k,toComparators:Dk,maxSatisfying:Lk,minSatisfying:Nk,minVersion:Pk,validRange:Mk,outside:Fk,gtr:jk,ltr:Bk,intersects:Uk,simplifyRange:Gk,subset:qk,SemVer:ik,re:ga.re,src:ga.src,tokens:ga.t,SEMVER_SPEC_VERSION:xh.SEMVER_SPEC_VERSION,RELEASE_TYPES:xh.RELEASE_TYPES,compareIdentifiers:vh.compareIdentifiers,rcompareIdentifiers:vh.rcompareIdentifiers}});var jh=w((z3,Fh)=>{var yr=1e3,br=yr*60,wr=br*60,Ut=wr*24,JC=Ut*7,QC=Ut*365.25;Fh.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return eA(e);if(r==="number"&&isFinite(e))return t.long?rA(e):tA(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function eA(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*QC;case"weeks":case"week":case"w":return r*JC;case"days":case"day":case"d":return r*Ut;case"hours":case"hour":case"hrs":case"hr":case"h":return r*wr;case"minutes":case"minute":case"mins":case"min":case"m":return r*br;case"seconds":case"second":case"secs":case"sec":case"s":return r*yr;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function tA(e){var t=Math.abs(e);return t>=Ut?Math.round(e/Ut)+"d":t>=wr?Math.round(e/wr)+"h":t>=br?Math.round(e/br)+"m":t>=yr?Math.round(e/yr)+"s":e+"ms"}function rA(e){var t=Math.abs(e);return t>=Ut?Us(e,t,Ut,"day"):t>=wr?Us(e,t,wr,"hour"):t>=br?Us(e,t,br,"minute"):t>=yr?Us(e,t,yr,"second"):e+" ms"}function Us(e,t,r,n){var s=t>=r*1.5;return Math.round(e/r)+" "+n+(s?"s":"")}});var va=w((W3,Bh)=>{function nA(e){r.debug=r,r.default=r,r.coerce=c,r.disable=i,r.enable=s,r.enabled=a,r.humanize=jh(),r.destroy=u,Object.keys(e).forEach(l=>{r[l]=e[l]}),r.names=[],r.skips=[],r.formatters={};function t(l){let f=0;for(let p=0;p<l.length;p++)f=(f<<5)-f+l.charCodeAt(p),f|=0;return r.colors[Math.abs(f)%r.colors.length]}r.selectColor=t;function r(l){let f,p=null,d,b;function T(...N){if(!T.enabled)return;let P=T,U=Number(new Date),H=U-(f||U);P.diff=H,P.prev=f,P.curr=U,f=U,N[0]=r.coerce(N[0]),typeof N[0]!="string"&&N.unshift("%O");let Y=0;N[0]=N[0].replace(/%([a-zA-Z%])/g,(ae,Ae)=>{if(ae==="%%")return"%";Y++;let Ie=r.formatters[Ae];if(typeof Ie=="function"){let xe=N[Y];ae=Ie.call(P,xe),N.splice(Y,1),Y--}return ae}),r.formatArgs.call(P,N),(P.log||r.log).apply(P,N)}return T.namespace=l,T.useColors=r.useColors(),T.color=r.selectColor(l),T.extend=n,T.destroy=r.destroy,Object.defineProperty(T,"enabled",{enumerable:!0,configurable:!1,get:()=>p!==null?p:(d!==r.namespaces&&(d=r.namespaces,b=r.enabled(l)),b),set:N=>{p=N}}),typeof r.init=="function"&&r.init(T),T}function n(l,f){let p=r(this.namespace+(typeof f>"u"?":":f)+l);return p.log=this.log,p}function s(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let f=(typeof l=="string"?l:"").trim().replace(" ",",").split(",").filter(Boolean);for(let p of f)p[0]==="-"?r.skips.push(p.slice(1)):r.names.push(p)}function o(l,f){let p=0,d=0,b=-1,T=0;for(;p<l.length;)if(d<f.length&&(f[d]===l[p]||f[d]==="*"))f[d]==="*"?(b=d,T=p,d++):(p++,d++);else if(b!==-1)d=b+1,T++,p=T;else return!1;for(;d<f.length&&f[d]==="*";)d++;return d===f.length}function i(){let l=[...r.names,...r.skips.map(f=>"-"+f)].join(",");return r.enable(""),l}function a(l){for(let f of r.skips)if(o(l,f))return!1;for(let f of r.names)if(o(l,f))return!0;return!1}function c(l){return l instanceof Error?l.stack||l.message:l}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}Bh.exports=nA});var Uh=w((ye,Gs)=>{ye.formatArgs=oA;ye.save=iA;ye.load=aA;ye.useColors=sA;ye.storage=cA();ye.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();ye.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function sA(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function oA(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+Gs.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(r++,s==="%c"&&(n=r))}),e.splice(n,0,t)}ye.log=console.debug||console.log||(()=>{});function iA(e){try{e?ye.storage.setItem("debug",e):ye.storage.removeItem("debug")}catch{}}function aA(){let e;try{e=ye.storage.getItem("debug")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function cA(){try{return localStorage}catch{}}Gs.exports=va()(ye);var{formatters:uA}=Gs.exports;uA.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var qh=w((Z3,Gh)=>{"use strict";Gh.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),s=t.indexOf("--");return n!==-1&&(s===-1||n<s)}});var Wh=w((H3,zh)=>{"use strict";var lA=pe("os"),Vh=pe("tty"),ke=qh(),{env:K}=process,qs;ke("no-color")||ke("no-colors")||ke("color=false")||ke("color=never")?qs=0:(ke("color")||ke("colors")||ke("color=true")||ke("color=always"))&&(qs=1);function fA(){if("FORCE_COLOR"in K)return K.FORCE_COLOR==="true"?1:K.FORCE_COLOR==="false"?0:K.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(K.FORCE_COLOR,10),3)}function dA(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function pA(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=fA();n!==void 0&&(qs=n);let s=r?qs:n;if(s===0)return 0;if(r){if(ke("color=16m")||ke("color=full")||ke("color=truecolor"))return 3;if(ke("color=256"))return 2}if(e&&!t&&s===void 0)return 0;let o=s||0;if(K.TERM==="dumb")return o;if(process.platform==="win32"){let i=lA.release().split(".");return Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in K)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(i=>i in K)||K.CI_NAME==="codeship"?1:o;if("TEAMCITY_VERSION"in K)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(K.TEAMCITY_VERSION)?1:0;if(K.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in K){let i=Number.parseInt((K.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(K.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(K.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(K.TERM)||"COLORTERM"in K?1:o}function _a(e,t={}){let r=pA(e,{streamIsTTY:e&&e.isTTY,...t});return dA(r)}zh.exports={supportsColor:_a,stdout:_a({isTTY:Vh.isatty(1)}),stderr:_a({isTTY:Vh.isatty(2)})}});var Hh=w((J,zs)=>{var mA=pe("tty"),Vs=pe("util");J.init=xA;J.log=bA;J.formatArgs=gA;J.save=wA;J.load=SA;J.useColors=hA;J.destroy=Vs.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");J.colors=[6,2,3,4,5,1];try{let e=Wh();e&&(e.stderr||e).level>=2&&(J.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}J.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(s,o)=>o.toUpperCase()),n=process.env[t];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),e[r]=n,e},{});function hA(){return"colors"in J.inspectOpts?!!J.inspectOpts.colors:mA.isatty(process.stderr.fd)}function gA(e){let{namespace:t,useColors:r}=this;if(r){let n=this.color,s="\x1B[3"+(n<8?n:"8;5;"+n),o=` ${s};1m${t} \x1B[0m`;e[0]=o+e[0].split(`
3
+ `).join(`
4
+ `+o),e.push(s+"m+"+zs.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=yA()+t+" "+e[0]}function yA(){return J.inspectOpts.hideDate?"":new Date().toISOString()+" "}function bA(...e){return process.stderr.write(Vs.formatWithOptions(J.inspectOpts,...e)+`
5
+ `)}function wA(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function SA(){return process.env.DEBUG}function xA(e){e.inspectOpts={};let t=Object.keys(J.inspectOpts);for(let r=0;r<t.length;r++)e.inspectOpts[t[r]]=J.inspectOpts[t[r]]}zs.exports=va()(J);var{formatters:Zh}=zs.exports;Zh.o=function(e){return this.inspectOpts.colors=this.useColors,Vs.inspect(e,this.inspectOpts).split(`
6
+ `).map(t=>t.trim()).join(" ")};Zh.O=function(e){return this.inspectOpts.colors=this.useColors,Vs.inspect(e,this.inspectOpts)}});var Ta=w((Y3,Ea)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Ea.exports=Uh():Ea.exports=Hh()});var Yh=w(be=>{"use strict";var vA=be&&be.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(be,"__esModule",{value:!0});var _A=pe("fs"),EA=vA(Ta()),Sr=EA.default("@kwsites/file-exists");function TA(e,t,r){Sr("checking %s",e);try{let n=_A.statSync(e);return n.isFile()&&t?(Sr("[OK] path represents a file"),!0):n.isDirectory()&&r?(Sr("[OK] path represents a directory"),!0):(Sr("[FAIL] path represents something other than a file or directory"),!1)}catch(n){if(n.code==="ENOENT")return Sr("[FAIL] path is not accessible: %o",n),!1;throw Sr("[FATAL] %o",n),n}}function OA(e,t=be.READABLE){return TA(e,(t&be.FILE)>0,(t&be.FOLDER)>0)}be.exists=OA;be.FILE=1;be.FOLDER=2;be.READABLE=be.FILE+be.FOLDER});var Xh=w(Ws=>{"use strict";function RA(e){for(var t in e)Ws.hasOwnProperty(t)||(Ws[t]=e[t])}Object.defineProperty(Ws,"__esModule",{value:!0});RA(Yh())});var Ra=w(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.createDeferred=Gt.deferred=void 0;function Oa(){let e,t,r="pending";return{promise:new Promise((s,o)=>{e=s,t=o}),done(s){r==="pending"&&(r="resolved",e(s))},fail(s){r==="pending"&&(r="rejected",t(s))},get fulfilled(){return r!=="pending"},get status(){return r}}}Gt.deferred=Oa;Gt.createDeferred=Oa;Gt.default=Oa});var Lb=w((Dq,yc)=>{var ho=process||{},$b=ho.argv||[],mo=ho.env||{},B$=!(mo.NO_COLOR||$b.includes("--no-color"))&&(!!mo.FORCE_COLOR||$b.includes("--color")||ho.platform==="win32"||(ho.stdout||{}).isTTY&&mo.TERM!=="dumb"||!!mo.CI),U$=(e,t,r=e)=>n=>{let s=""+n,o=s.indexOf(t,e.length);return~o?e+G$(s,t,r,o)+t:e+s+t},G$=(e,t,r,n)=>{let s="",o=0;do s+=e.substring(o,n)+r,o=n+t.length,n=e.indexOf(t,o);while(~n);return s+e.substring(o)},Db=(e=B$)=>{let t=e?U$:()=>String;return{isColorSupported:e,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};yc.exports=Db();yc.exports.createColors=Db});import{EventEmitter as pw}from"events";function wo(e){return e==null?[]:Array.isArray(e)?e:[e]}function mw(e,t,r,n){var s,o=e[t],i=~n.string.indexOf(t)?r==null||r===!0?"":String(r):typeof r=="boolean"?r:~n.boolean.indexOf(t)?r==="false"?!1:r==="true"||(e._.push((s=+r,s*0===0?s:r)),!!r):(s=+r,s*0===0?s:r);e[t]=o==null?i:Array.isArray(o)?o.concat(i):[o,i]}function hw(e,t){e=e||[],t=t||{};var r,n,s,o,i,a={_:[]},c=0,u=0,l=0,f=e.length;let p=t.alias!==void 0,d=t.unknown!==void 0,b=t.default!==void 0;if(t.alias=t.alias||{},t.string=wo(t.string),t.boolean=wo(t.boolean),p)for(r in t.alias)for(n=t.alias[r]=wo(t.alias[r]),c=0;c<n.length;c++)(t.alias[n[c]]=n.concat(r)).splice(c,1);for(c=t.boolean.length;c-- >0;)for(n=t.alias[t.boolean[c]]||[],u=n.length;u-- >0;)t.boolean.push(n[u]);for(c=t.string.length;c-- >0;)for(n=t.alias[t.string[c]]||[],u=n.length;u-- >0;)t.string.push(n[u]);if(b){for(r in t.default)if(o=typeof t.default[r],n=t.alias[r]=t.alias[r]||[],t[o]!==void 0)for(t[o].push(r),c=0;c<n.length;c++)t[o].push(n[c])}let T=d?Object.keys(t.alias):[];for(c=0;c<f;c++){if(s=e[c],s==="--"){a._=a._.concat(e.slice(++c));break}for(u=0;u<s.length&&s.charCodeAt(u)===45;u++);if(u===0)a._.push(s);else if(s.substring(u,u+3)==="no-"){if(o=s.substring(u+3),d&&!~T.indexOf(o))return t.unknown(s);a[o]=!1}else{for(l=u+1;l<s.length&&s.charCodeAt(l)!==61;l++);for(o=s.substring(u,l),i=s.substring(++l)||c+1===f||(""+e[c+1]).charCodeAt(0)===45||e[++c],n=u===2?[o]:o,l=0;l<n.length;l++){if(o=n[l],d&&!~T.indexOf(o))return t.unknown("-".repeat(u)+o);mw(a,o,l+1<n.length||i,t)}}}if(b)for(r in t.default)a[r]===void 0&&(a[r]=t.default[r]);if(p)for(r in a)for(n=t.alias[r]||[];n.length>0;)a[n.shift()]=a[r];return a}var Tc=e=>e.replace(/[<[].+/,"").trim(),gw=e=>{let t=/<([^>]+)>/g,r=/\[([^\]]+)\]/g,n=[],s=a=>{let c=!1,u=a[1];return u.startsWith("...")&&(u=u.slice(3),c=!0),{required:a[0].startsWith("<"),value:u,variadic:c}},o;for(;o=t.exec(e);)n.push(s(o));let i;for(;i=r.exec(e);)n.push(s(i));return n},yw=e=>{let t={alias:{},boolean:[]};for(let[r,n]of e.entries())n.names.length>1&&(t.alias[n.names[0]]=n.names.slice(1)),n.isBoolean&&(n.negated&&e.some((o,i)=>i!==r&&o.names.some(a=>n.names.includes(a))&&typeof o.required=="boolean")||t.boolean.push(n.names[0]));return t},_c=e=>e.sort((t,r)=>t.length>r.length?-1:1)[0],Ec=(e,t)=>e.length>=t?e:`${e}${" ".repeat(t-e.length)}`,bw=e=>e.replace(/([a-z])-([a-z])/g,(t,r,n)=>r+n.toUpperCase()),ww=(e,t,r)=>{let n=0,s=t.length,o=e,i;for(;n<s;++n)i=o[t[n]],o=o[t[n]]=n===s-1?r:i??(~t[n+1].indexOf(".")||!(+t[n+1]>-1)?{}:[])},Sw=(e,t)=>{for(let r of Object.keys(t)){let n=t[r];n.shouldTransform&&(e[r]=Array.prototype.concat.call([],e[r]),typeof n.transformFunction=="function"&&(e[r]=e[r].map(n.transformFunction)))}},xw=e=>{let t=/([^\\\/]+)$/.exec(e);return t?t[1]:""},Oc=e=>e.split(".").map((t,r)=>r===0?bw(t):t).join("."),Tr=class extends Error{constructor(t){super(t),this.name=this.constructor.name,typeof Error.captureStackTrace=="function"?Error.captureStackTrace(this,this.constructor):this.stack=new Error(t).stack}},So=class{constructor(t,r,n){this.rawName=t,this.description=r,this.config=Object.assign({},n),t=t.replace(/\.\*/g,""),this.negated=!1,this.names=Tc(t).split(",").map(s=>{let o=s.trim().replace(/^-{1,2}/,"");return o.startsWith("no-")&&(this.negated=!0,o=o.replace(/^no-/,"")),Oc(o)}).sort((s,o)=>s.length>o.length?1:-1),this.name=this.names[this.names.length-1],this.negated&&this.config.default==null&&(this.config.default=!0),t.includes("<")?this.required=!0:t.includes("[")?this.required=!1:this.isBoolean=!0}},vw=process.argv,_w=`${process.platform}-${process.arch} node-${process.version}`,mn=class{constructor(t,r,n={},s){this.rawName=t,this.description=r,this.config=n,this.cli=s,this.options=[],this.aliasNames=[],this.name=Tc(t),this.args=gw(t),this.examples=[]}usage(t){return this.usageText=t,this}allowUnknownOptions(){return this.config.allowUnknownOptions=!0,this}ignoreOptionDefaultValue(){return this.config.ignoreOptionDefaultValue=!0,this}version(t,r="-v, --version"){return this.versionNumber=t,this.option(r,"Display version number"),this}example(t){return this.examples.push(t),this}option(t,r,n){let s=new So(t,r,n);return this.options.push(s),this}alias(t){return this.aliasNames.push(t),this}action(t){return this.commandAction=t,this}isMatched(t){return this.name===t||this.aliasNames.includes(t)}get isDefaultCommand(){return this.name===""||this.aliasNames.includes("!")}get isGlobalCommand(){return this instanceof hn}hasOption(t){return t=t.split(".")[0],this.options.find(r=>r.names.includes(t))}outputHelp(){let{name:t,commands:r}=this.cli,{versionNumber:n,options:s,helpCallback:o}=this.cli.globalCommand,i=[{body:`${t}${n?`/${n}`:""}`}];if(i.push({title:"Usage",body:` $ ${t} ${this.usageText||this.rawName}`}),(this.isGlobalCommand||this.isDefaultCommand)&&r.length>0){let u=_c(r.map(l=>l.rawName));i.push({title:"Commands",body:r.map(l=>` ${Ec(l.rawName,u.length)} ${l.description}`).join(`
7
+ `)}),i.push({title:"For more info, run any command with the `--help` flag",body:r.map(l=>` $ ${t}${l.name===""?"":` ${l.name}`} --help`).join(`
8
+ `)})}let c=this.isGlobalCommand?s:[...this.options,...s||[]];if(!this.isGlobalCommand&&!this.isDefaultCommand&&(c=c.filter(u=>u.name!=="version")),c.length>0){let u=_c(c.map(l=>l.rawName));i.push({title:"Options",body:c.map(l=>` ${Ec(l.rawName,u.length)} ${l.description} ${l.config.default===void 0?"":`(default: ${l.config.default})`}`).join(`
9
+ `)})}this.examples.length>0&&i.push({title:"Examples",body:this.examples.map(u=>typeof u=="function"?u(t):u).join(`
10
+ `)}),o&&(i=o(i)||i),console.log(i.map(u=>u.title?`${u.title}:
11
+ ${u.body}`:u.body).join(`
12
+
13
+ `))}outputVersion(){let{name:t}=this.cli,{versionNumber:r}=this.cli.globalCommand;r&&console.log(`${t}/${r} ${_w}`)}checkRequiredArgs(){let t=this.args.filter(r=>r.required).length;if(this.cli.args.length<t)throw new Tr(`missing required args for command \`${this.rawName}\``)}checkUnknownOptions(){let{options:t,globalCommand:r}=this.cli;if(!this.config.allowUnknownOptions){for(let n of Object.keys(t))if(n!=="--"&&!this.hasOption(n)&&!r.hasOption(n))throw new Tr(`Unknown option \`${n.length>1?`--${n}`:`-${n}`}\``)}}checkOptionValue(){let{options:t,globalCommand:r}=this.cli,n=[...r.options,...this.options];for(let s of n){let o=t[s.name.split(".")[0]];if(s.required){let i=n.some(a=>a.negated&&a.names.includes(s.name));if(o===!0||o===!1&&!i)throw new Tr(`option \`${s.rawName}\` value is missing`)}}}},hn=class extends mn{constructor(t){super("@@global@@","",{},t)}},pn=Object.assign,xo=class extends pw{constructor(t=""){super(),this.name=t,this.commands=[],this.rawArgs=[],this.args=[],this.options={},this.globalCommand=new hn(this),this.globalCommand.usage("<command> [options]")}usage(t){return this.globalCommand.usage(t),this}command(t,r,n){let s=new mn(t,r||"",n,this);return s.globalCommand=this.globalCommand,this.commands.push(s),s}option(t,r,n){return this.globalCommand.option(t,r,n),this}help(t){return this.globalCommand.option("-h, --help","Display this message"),this.globalCommand.helpCallback=t,this.showHelpOnExit=!0,this}version(t,r="-v, --version"){return this.globalCommand.version(t,r),this.showVersionOnExit=!0,this}example(t){return this.globalCommand.example(t),this}outputHelp(){this.matchedCommand?this.matchedCommand.outputHelp():this.globalCommand.outputHelp()}outputVersion(){this.globalCommand.outputVersion()}setParsedInfo({args:t,options:r},n,s){return this.args=t,this.options=r,n&&(this.matchedCommand=n),s&&(this.matchedCommandName=s),this}unsetMatchedCommand(){this.matchedCommand=void 0,this.matchedCommandName=void 0}parse(t=vw,{run:r=!0}={}){this.rawArgs=t,this.name||(this.name=t[1]?xw(t[1]):"cli");let n=!0;for(let o of this.commands){let i=this.mri(t.slice(2),o),a=i.args[0];if(o.isMatched(a)){n=!1;let c=pn(pn({},i),{args:i.args.slice(1)});this.setParsedInfo(c,o,a),this.emit(`command:${a}`,o)}}if(n){for(let o of this.commands)if(o.name===""){n=!1;let i=this.mri(t.slice(2),o);this.setParsedInfo(i,o),this.emit("command:!",o)}}if(n){let o=this.mri(t.slice(2));this.setParsedInfo(o)}this.options.help&&this.showHelpOnExit&&(this.outputHelp(),r=!1,this.unsetMatchedCommand()),this.options.version&&this.showVersionOnExit&&this.matchedCommandName==null&&(this.outputVersion(),r=!1,this.unsetMatchedCommand());let s={args:this.args,options:this.options};return r&&this.runMatchedCommand(),!this.matchedCommand&&this.args[0]&&this.emit("command:*"),s}mri(t,r){let n=[...this.globalCommand.options,...r?r.options:[]],s=yw(n),o=[],i=t.indexOf("--");i>-1&&(o=t.slice(i+1),t=t.slice(0,i));let a=hw(t,s);a=Object.keys(a).reduce((p,d)=>pn(pn({},p),{[Oc(d)]:a[d]}),{_:[]});let c=a._,u={"--":o},l=r&&r.config.ignoreOptionDefaultValue?r.config.ignoreOptionDefaultValue:this.globalCommand.config.ignoreOptionDefaultValue,f=Object.create(null);for(let p of n){if(!l&&p.config.default!==void 0)for(let d of p.names)u[d]=p.config.default;Array.isArray(p.config.type)&&f[p.name]===void 0&&(f[p.name]=Object.create(null),f[p.name].shouldTransform=!0,f[p.name].transformFunction=p.config.type[0])}for(let p of Object.keys(a))if(p!=="_"){let d=p.split(".");ww(u,d,a[p]),Sw(u,f)}return{args:c,options:u}}runMatchedCommand(){let{args:t,options:r,matchedCommand:n}=this;if(!n||!n.commandAction)return;n.checkUnknownOptions(),n.checkOptionValue(),n.checkRequiredArgs();let s=[];return n.args.forEach((o,i)=>{o.variadic?s.push(t.slice(i)):s.push(t[i])}),s.push(r),n.commandAction.apply(this,s)}},Rc=(e="")=>new xo(e);function z(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}import{fileURLToPath as Ew}from"node:url";var Wt=(e,t)=>{let r=_o(Tw(e));if(typeof r!="string")throw new TypeError(`${t} must be a string or a file URL: ${r}.`);return r},Tw=e=>vo(e)?e.toString():e,vo=e=>typeof e!="string"&&e&&Object.getPrototypeOf(e)===String.prototype,_o=e=>e instanceof URL?Ew(e):e;var gn=(e,t=[],r={})=>{let n=Wt(e,"First argument"),[s,o]=z(t)?[[],t]:[t,r];if(!Array.isArray(s))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${s}`);if(s.some(c=>typeof c=="object"&&c!==null))throw new TypeError(`Second argument must be an array of strings: ${s}`);let i=s.map(String),a=i.find(c=>c.includes("\0"));if(a!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!z(o))throw new TypeError(`Last argument must be an options object: ${o}`);return[n,i,o]};import{ChildProcess as $w}from"node:child_process";import{StringDecoder as Ow}from"node:string_decoder";var{toString:kc}=Object.prototype,Cc=e=>kc.call(e)==="[object ArrayBuffer]",X=e=>kc.call(e)==="[object Uint8Array]",Ye=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Rw=new TextEncoder,Ac=e=>Rw.encode(e),kw=new TextDecoder,yn=e=>kw.decode(e),Ic=(e,t)=>Cw(e,t).join(""),Cw=(e,t)=>{if(t==="utf8"&&e.every(o=>typeof o=="string"))return e;let r=new Ow(t),n=e.map(o=>typeof o=="string"?Ac(o):o).map(o=>r.write(o)),s=r.end();return s===""?n:[...n,s]},Or=e=>e.length===1&&X(e[0])?e[0]:Eo(Aw(e)),Aw=e=>e.map(t=>typeof t=="string"?Ac(t):t),Eo=e=>{let t=new Uint8Array(Iw(e)),r=0;for(let n of e)t.set(n,r),r+=n.length;return t},Iw=e=>{let t=0;for(let r of e)t+=r.length;return t};var Nc=e=>Array.isArray(e)&&Array.isArray(e.raw),Pc=(e,t)=>{let r=[];for(let[o,i]of e.entries())r=Dw({templates:e,expressions:t,tokens:r,index:o,template:i});if(r.length===0)throw new TypeError("Template script must not be empty");let[n,...s]=r;return[n,s,{}]},Dw=({templates:e,expressions:t,tokens:r,index:n,template:s})=>{if(s===void 0)throw new TypeError(`Invalid backslash sequence: ${e.raw[n]}`);let{nextTokens:o,leadingWhitespaces:i,trailingWhitespaces:a}=Lw(s,e.raw[n]),c=Dc(r,o,i);if(n===t.length)return c;let u=t[n],l=Array.isArray(u)?u.map(f=>Lc(f)):[Lc(u)];return Dc(c,l,a)},Lw=(e,t)=>{if(t.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let r=[],n=0,s=$c.has(t[0]);for(let i=0,a=0;i<e.length;i+=1,a+=1){let c=t[a];if($c.has(c))n!==i&&r.push(e.slice(n,i)),n=i+1;else if(c==="\\"){let u=t[a+1];u===`
14
+ `?(i-=1,a+=1):u==="u"&&t[a+2]==="{"?a=t.indexOf("}",a+3):a+=Nw[u]??1}}let o=n===e.length;return o||r.push(e.slice(n)),{nextTokens:r,leadingWhitespaces:s,trailingWhitespaces:o}},$c=new Set([" "," ","\r",`
15
+ `]),Nw={x:3,u:5},Dc=(e,t,r)=>r||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],Lc=e=>{let t=typeof e;if(t==="string")return e;if(t==="number")return String(e);if(z(e)&&("stdout"in e||"isMaxBuffer"in e))return Pw(e);throw e instanceof $w||Object.prototype.toString.call(e)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${t}" in template expression`)},Pw=({stdout:e})=>{if(typeof e=="string")return e;if(X(e))return yn(e);throw e===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof e}" stdout in template expression`)};import{spawnSync as BE}from"node:child_process";import{debuglog as Mw}from"node:util";import To from"node:process";var De=e=>bn.includes(e),bn=[To.stdin,To.stdout,To.stderr],ve=["stdin","stdout","stderr"],wn=e=>ve[e]??`stdio[${e}]`;var Fc=e=>{let t={...e};for(let r of ko)t[r]=Oo(e,r);return t},Oo=(e,t)=>{let r=Array.from({length:Fw(e)+1}),n=jw(e[t],r,t);return Vw(n,t)},Fw=({stdio:e})=>Array.isArray(e)?Math.max(e.length,ve.length):ve.length,jw=(e,t,r)=>z(e)?Bw(e,t,r):t.fill(e),Bw=(e,t,r)=>{for(let n of Object.keys(e).sort(Uw))for(let s of Gw(n,r,t))t[s]=e[n];return t},Uw=(e,t)=>Mc(e)<Mc(t)?1:-1,Mc=e=>e==="stdout"||e==="stderr"?0:e==="all"?2:1,Gw=(e,t,r)=>{if(e==="ipc")return[r.length-1];let n=Ro(e);if(n===void 0||n===0)throw new TypeError(`"${t}.${e}" is invalid.
16
+ It must be "${t}.stdout", "${t}.stderr", "${t}.all", "${t}.ipc", or "${t}.fd3", "${t}.fd4" (and so on).`);if(n>=r.length)throw new TypeError(`"${t}.${e}" is invalid: that file descriptor does not exist.
17
+ Please set the "stdio" option to ensure that file descriptor exists.`);return n==="all"?[1,2]:[n]},Ro=e=>{if(e==="all")return e;if(ve.includes(e))return ve.indexOf(e);let t=qw.exec(e);if(t!==null)return Number(t[1])},qw=/^fd(\d+)$/,Vw=(e,t)=>e.map(r=>r===void 0?Ww[t]:r),zw=Mw("execa").enabled?"full":"none",Ww={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:zw,stripFinalNewline:!0},ko=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],Xe=(e,t)=>t==="ipc"?e.at(-1):e[t];var Zt=({verbose:e},t)=>Co(e,t)!=="none",Ht=({verbose:e},t)=>!["none","short"].includes(Co(e,t)),jc=({verbose:e},t)=>{let r=Co(e,t);return Sn(r)?r:void 0},Co=(e,t)=>t===void 0?Zw(e):Xe(e,t),Zw=e=>e.find(t=>Sn(t))??xn.findLast(t=>e.includes(t)),Sn=e=>typeof e=="function",xn=["none","short","full"];import{inspect as hS}from"node:util";import{platform as Hw}from"node:process";import{stripVTControlCharacters as Yw}from"node:util";var Bc=(e,t)=>{let r=[e,...t],n=r.join(" "),s=r.map(o=>tS(Uc(o))).join(" ");return{command:n,escapedCommand:s}},Rr=e=>Yw(e).split(`
18
+ `).map(t=>Uc(t)).join(`
19
+ `),Uc=e=>e.replaceAll(Jw,t=>Xw(t)),Xw=e=>{let t=Qw[e];if(t!==void 0)return t;let r=e.codePointAt(0),n=r.toString(16);return r<=eS?`\\u${n.padStart(4,"0")}`:`\\U${n}`},Kw=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},Jw=Kw(),Qw={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},eS=65535,tS=e=>rS.test(e)?e:Hw==="win32"?`"${e.replaceAll('"','""')}"`:`'${e.replaceAll("'","'\\''")}'`,rS=/^[\w./-]+$/;import Gc from"node:process";function Ao(){let{env:e}=Gc,{TERM:t,TERM_PROGRAM:r}=e;return Gc.platform!=="win32"?t!=="linux":!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||e.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||t==="xterm-256color"||t==="alacritty"||t==="rxvt-unicode"||t==="rxvt-unicode-256color"||e.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var qc={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},Vc={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},nS={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},sS={...qc,...Vc},oS={...qc,...nS},iS=Ao(),aS=iS?sS:oS,vn=aS,ED=Object.entries(Vc);import cS from"node:tty";var uS=cS?.WriteStream?.prototype?.hasColors?.()??!1,L=(e,t)=>{if(!uS)return s=>s;let r=`\x1B[${e}m`,n=`\x1B[${t}m`;return s=>{let o=s+"",i=o.indexOf(n);if(i===-1)return r+o+n;let a=r,c=0;for(;i!==-1;)a+=o.slice(c,i)+r,c=i+n.length,i=o.indexOf(n,c);return a+=o.slice(c)+n,a}},RD=L(0,0),zc=L(1,22),kD=L(2,22),CD=L(3,23),AD=L(4,24),ID=L(53,55),$D=L(7,27),DD=L(8,28),LD=L(9,29),ND=L(30,39),PD=L(31,39),MD=L(32,39),FD=L(33,39),jD=L(34,39),BD=L(35,39),UD=L(36,39),GD=L(37,39),_n=L(90,39),qD=L(40,49),VD=L(41,49),zD=L(42,49),WD=L(43,49),ZD=L(44,49),HD=L(45,49),YD=L(46,49),XD=L(47,49),KD=L(100,49),Wc=L(91,39),JD=L(92,39),Zc=L(93,39),QD=L(94,39),eL=L(95,39),tL=L(96,39),rL=L(97,39),nL=L(101,49),sL=L(102,49),oL=L(103,49),iL=L(104,49),aL=L(105,49),cL=L(106,49),uL=L(107,49);var Xc=({type:e,message:t,timestamp:r,piped:n,commandId:s,result:{failed:o=!1}={},options:{reject:i=!0}})=>{let a=lS(r),c=fS[e]({failed:o,reject:i,piped:n}),u=dS[e]({reject:i});return`${_n(`[${a}]`)} ${_n(`[${s}]`)} ${u(c)} ${u(t)}`},lS=e=>`${En(e.getHours(),2)}:${En(e.getMinutes(),2)}:${En(e.getSeconds(),2)}.${En(e.getMilliseconds(),3)}`,En=(e,t)=>String(e).padStart(t,"0"),Hc=({failed:e,reject:t})=>e?t?vn.cross:vn.warning:vn.tick,fS={command:({piped:e})=>e?"|":"$",output:()=>" ",ipc:()=>"*",error:Hc,duration:Hc},Yc=e=>e,dS={command:()=>zc,output:()=>Yc,ipc:()=>Yc,error:({reject:e})=>e?Wc:Zc,duration:()=>_n};var Kc=(e,t,r)=>{let n=jc(t,r);return e.map(({verboseLine:s,verboseObject:o})=>pS(s,o,n)).filter(s=>s!==void 0).map(s=>mS(s)).join("")},pS=(e,t,r)=>{if(r===void 0)return e;let n=r(e,t);if(typeof n=="string")return n},mS=e=>e.endsWith(`
20
+ `)?e:`${e}
21
+ `;var je=({type:e,verboseMessage:t,fdNumber:r,verboseInfo:n,result:s})=>{let o=gS({type:e,result:s,verboseInfo:n}),i=yS(t,o),a=Kc(i,n,r);a!==""&&console.warn(a.slice(0,-1))},gS=({type:e,result:t,verboseInfo:{escapedCommand:r,commandId:n,rawOptions:{piped:s=!1,...o}}})=>({type:e,escapedCommand:r,commandId:`${n}`,timestamp:new Date,piped:s,result:t,options:o}),yS=(e,t)=>e.split(`
22
+ `).map(r=>bS({...t,message:r})),bS=e=>({verboseLine:Xc(e),verboseObject:e}),Tn=e=>{let t=typeof e=="string"?e:hS(e);return Rr(t).replaceAll(" "," ".repeat(wS))},wS=2;var Jc=(e,t)=>{Zt(t)&&je({type:"command",verboseMessage:e,verboseInfo:t})};var Qc=(e,t,r)=>{vS(e);let n=SS(e);return{verbose:e,escapedCommand:t,commandId:n,rawOptions:r}},SS=e=>Zt({verbose:e})?xS++:void 0,xS=0n,vS=e=>{for(let t of e){if(t===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(t===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!xn.includes(t)&&!Sn(t)){let r=xn.map(n=>`'${n}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${r} or a function.`)}}};import{hrtime as eu}from"node:process";var On=()=>eu.bigint(),Io=e=>Number(eu.bigint()-e)/1e6;var Rn=(e,t,r)=>{let n=On(),{command:s,escapedCommand:o}=Bc(e,t),i=Oo(r,"verbose"),a=Qc(i,o,{...r});return Jc(o,a),{command:s,escapedCommand:o,startTime:n,verboseInfo:a}};var Ql=gt(Gu(),1);import ov from"node:path";import Jl from"node:process";import In from"node:process";import yt from"node:path";function Cn(e={}){let{env:t=process.env,platform:r=process.platform}=e;return r!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"}import{promisify as YS}from"node:util";import{execFile as XS,execFileSync as KL}from"node:child_process";import qu from"node:path";import{fileURLToPath as KS}from"node:url";var eN=YS(XS);function An(e){return e instanceof URL?KS(e):e}function Vu(e){return{*[Symbol.iterator](){let t=qu.resolve(An(e)),r;for(;r!==t;)yield t,r=t,t=qu.resolve(t,"..")}}}var tN=10*1024*1024;var JS=({cwd:e=In.cwd(),path:t=In.env[Cn()],preferLocal:r=!0,execPath:n=In.execPath,addExecPath:s=!0}={})=>{let o=yt.resolve(An(e)),i=[],a=t.split(yt.delimiter);return r&&QS(i,a,o),s&&ex(i,a,n,o),t===""||t===yt.delimiter?`${i.join(yt.delimiter)}${t}`:[...i,t].join(yt.delimiter)},QS=(e,t,r)=>{for(let n of Vu(r)){let s=yt.join(n,"node_modules/.bin");t.includes(s)||e.push(s)}},ex=(e,t,r,n)=>{let s=yt.resolve(n,An(r),"..");t.includes(s)||e.push(s)},zu=({env:e=In.env,...t}={})=>{e={...e};let r=Cn({env:e});return t.path=e[r],e[r]=JS(t),e};import{setTimeout as hx}from"node:timers/promises";var Wu=(e,t,r)=>{let n=r?Cr:kr,s=e instanceof Le?{}:{cause:e};return new n(t,s)},Le=class extends Error{},Zu=(e,t)=>{Object.defineProperty(e.prototype,"name",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,Yu,{value:!0,writable:!1,enumerable:!1,configurable:!1})},Hu=e=>$n(e)&&Yu in e,Yu=Symbol("isExecaError"),$n=e=>Object.prototype.toString.call(e)==="[object Error]",kr=class extends Error{};Zu(kr,kr.name);var Cr=class extends Error{};Zu(Cr,Cr.name);import{constants as Ar}from"node:os";import{constants as sx}from"node:os";var Xu=()=>{let e=Ju-Ku+1;return Array.from({length:e},tx)},tx=(e,t)=>({name:`SIGRT${t+1}`,number:Ku+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),Ku=34,Ju=64;import{constants as rx}from"node:os";var Qu=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var Uo=()=>{let e=Xu();return[...Qu,...e].map(nx)},nx=({name:e,number:t,description:r,action:n,forced:s=!1,standard:o})=>{let{signals:{[e]:i}}=rx,a=i!==void 0;return{name:e,number:a?i:t,description:r,supported:a,action:n,forced:s,standard:o}};var ox=()=>{let e=Uo();return Object.fromEntries(e.map(ix))},ix=({name:e,number:t,description:r,supported:n,action:s,forced:o,standard:i})=>[e,{name:e,number:t,description:r,supported:n,action:s,forced:o,standard:i}],el=ox(),ax=()=>{let e=Uo(),t=65,r=Array.from({length:t},(n,s)=>cx(s,e));return Object.assign({},...r)},cx=(e,t)=>{let r=ux(e,t);if(r===void 0)return{};let{name:n,description:s,supported:o,action:i,forced:a,standard:c}=r;return{[e]:{name:n,number:e,description:s,supported:o,action:i,forced:a,standard:c}}},ux=(e,t)=>{let r=t.find(({name:n})=>sx.signals[n]===e);return r!==void 0?r:t.find(n=>n.number===e)},bN=ax();var rl=e=>{let t="option `killSignal`";if(e===0)throw new TypeError(`Invalid ${t}: 0 cannot be used.`);return sl(e,t)},nl=e=>e===0?e:sl(e,"`subprocess.kill()`'s argument"),sl=(e,t)=>{if(Number.isInteger(e))return lx(e,t);if(typeof e=="string")return dx(e,t);throw new TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.
23
+ ${Go()}`)},lx=(e,t)=>{if(tl.has(e))return tl.get(e);throw new TypeError(`Invalid ${t} ${e}: this signal integer does not exist.
24
+ ${Go()}`)},fx=()=>new Map(Object.entries(Ar.signals).reverse().map(([e,t])=>[t,e])),tl=fx(),dx=(e,t)=>{if(e in Ar.signals)return e;throw e.toUpperCase()in Ar.signals?new TypeError(`Invalid ${t} '${e}': please rename it to '${e.toUpperCase()}'.`):new TypeError(`Invalid ${t} '${e}': this signal name does not exist.
25
+ ${Go()}`)},Go=()=>`Available signal names: ${px()}.
26
+ Available signal numbers: ${mx()}.`,px=()=>Object.keys(Ar.signals).sort().map(e=>`'${e}'`).join(", "),mx=()=>[...new Set(Object.values(Ar.signals).sort((e,t)=>e-t))].join(", "),Dn=e=>el[e].description;var ol=e=>{if(e===!1)return e;if(e===!0)return gx;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},gx=1e3*5,il=({kill:e,options:{forceKillAfterDelay:t,killSignal:r},onInternalError:n,context:s,controller:o},i,a)=>{let{signal:c,error:u}=yx(i,a,r);bx(u,n);let l=e(c);return wx({kill:e,signal:c,forceKillAfterDelay:t,killSignal:r,killResult:l,context:s,controller:o}),l},yx=(e,t,r)=>{let[n=r,s]=$n(e)?[void 0,e]:[e,t];if(typeof n!="string"&&!Number.isInteger(n))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(n)}`);if(s!==void 0&&!$n(s))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${s}`);return{signal:nl(n),error:s}},bx=(e,t)=>{e!==void 0&&t.reject(e)},wx=async({kill:e,signal:t,forceKillAfterDelay:r,killSignal:n,killResult:s,context:o,controller:i})=>{t===n&&s&&qo({kill:e,forceKillAfterDelay:r,context:o,controllerSignal:i.signal})},qo=async({kill:e,forceKillAfterDelay:t,context:r,controllerSignal:n})=>{if(t!==!1)try{await hx(t,void 0,{signal:n}),e("SIGKILL")&&(r.isForcefullyTerminated??=!0)}catch{}};import{once as Sx}from"node:events";var Ln=async(e,t)=>{e.aborted||await Sx(e,"abort",{signal:t})};var al=({cancelSignal:e})=>{if(e!==void 0&&Object.prototype.toString.call(e)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(e)}`)},cl=({subprocess:e,cancelSignal:t,gracefulCancel:r,context:n,controller:s})=>t===void 0||r?[]:[xx(e,t,n,s)],xx=async(e,t,r,{signal:n})=>{throw await Ln(t,n),r.terminationReason??="cancel",e.kill(),t.reason};import{scheduler as Gx}from"node:timers/promises";import{promisify as jx}from"node:util";var Kt=({methodName:e,isSubprocess:t,ipc:r,isConnected:n})=>{vx(e,t,r),Vo(e,t,n)},vx=(e,t,r)=>{if(!r)throw new Error(`${Ne(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},Vo=(e,t,r)=>{if(!r)throw new Error(`${Ne(e,t)} cannot be used: the ${it(t)} has already exited or disconnected.`)},ul=e=>{throw new Error(`${Ne("getOneMessage",e)} could not complete: the ${it(e)} exited or disconnected.`)},ll=e=>{throw new Error(`${Ne("sendMessage",e)} failed: the ${it(e)} is sending a message too, instead of listening to incoming messages.
27
+ This can be fixed by both sending a message and listening to incoming messages at the same time:
28
+
29
+ const [receivedMessage] = await Promise.all([
30
+ ${Ne("getOneMessage",e)},
31
+ ${Ne("sendMessage",e,"message, {strict: true}")},
32
+ ]);`)},Nn=(e,t)=>new Error(`${Ne("sendMessage",t)} failed when sending an acknowledgment response to the ${it(t)}.`,{cause:e}),fl=e=>{throw new Error(`${Ne("sendMessage",e)} failed: the ${it(e)} is not listening to incoming messages.`)},dl=e=>{throw new Error(`${Ne("sendMessage",e)} failed: the ${it(e)} exited without listening to incoming messages.`)},pl=()=>new Error(`\`cancelSignal\` aborted: the ${it(!0)} disconnected.`),ml=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},hl=({error:e,methodName:t,isSubprocess:r})=>{if(e.code==="EPIPE")throw new Error(`${Ne(t,r)} cannot be used: the ${it(r)} is disconnecting.`,{cause:e})},gl=({error:e,methodName:t,isSubprocess:r,message:n})=>{if(_x(e))throw new Error(`${Ne(t,r)}'s argument type is invalid: the message cannot be serialized: ${String(n)}.`,{cause:e})},_x=({code:e,message:t})=>Ex.has(e)||Tx.some(r=>t.includes(r)),Ex=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),Tx=["could not be cloned","circular structure","call stack size exceeded"],Ne=(e,t,r="")=>e==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${Ox(t)}${e}(${r})`,Ox=e=>e?"":"subprocess.",it=e=>e?"parent process":"subprocess",Jt=e=>{e.connected&&e.disconnect()};var Be=()=>{let e={},t=new Promise((r,n)=>{Object.assign(e,{resolve:r,reject:n})});return Object.assign(t,e)};var Mn=(e,t="stdin")=>{let{options:n,fileDescriptors:s}=Ue.get(e),o=yl(s,t,!0),i=e.stdio[o];if(i===null)throw new TypeError(bl(o,t,n,!0));return i},Qt=(e,t="stdout")=>{let{options:n,fileDescriptors:s}=Ue.get(e),o=yl(s,t,!1),i=o==="all"?e.all:e.stdio[o];if(i==null)throw new TypeError(bl(o,t,n,!1));return i},Ue=new WeakMap,yl=(e,t,r)=>{let n=Rx(t,r);return kx(n,t,r,e),n},Rx=(e,t)=>{let r=Ro(e);if(r!==void 0)return r;let{validOptions:n,defaultValue:s}=t?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${Ir(t)}" must not be "${e}".
33
+ It must be ${n} or "fd3", "fd4" (and so on).
34
+ It is optional and defaults to "${s}".`)},kx=(e,t,r,n)=>{let s=n[wl(e)];if(s===void 0)throw new TypeError(`"${Ir(r)}" must not be ${t}. That file descriptor does not exist.
35
+ Please set the "stdio" option to ensure that file descriptor exists.`);if(s.direction==="input"&&!r)throw new TypeError(`"${Ir(r)}" must not be ${t}. It must be a readable stream, not writable.`);if(s.direction!=="input"&&r)throw new TypeError(`"${Ir(r)}" must not be ${t}. It must be a writable stream, not readable.`)},bl=(e,t,r,n)=>{if(e==="all"&&!r.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:s,optionValue:o}=Cx(e,r);return`The "${s}: ${Pn(o)}" option is incompatible with using "${Ir(n)}: ${Pn(t)}".
36
+ Please set this option with "pipe" instead.`},Cx=(e,{stdin:t,stdout:r,stderr:n,stdio:s})=>{let o=wl(e);return o===0&&t!==void 0?{optionName:"stdin",optionValue:t}:o===1&&r!==void 0?{optionName:"stdout",optionValue:r}:o===2&&n!==void 0?{optionName:"stderr",optionValue:n}:{optionName:`stdio[${o}]`,optionValue:s[o]}},wl=e=>e==="all"?1:e,Ir=e=>e?"to":"from",Pn=e=>typeof e=="string"?`'${e}'`:typeof e=="number"?`${e}`:"Stream";import{once as Nx}from"node:events";import{addAbortListener as Ax}from"node:events";var bt=(e,t,r)=>{let n=e.getMaxListeners();n===0||n===Number.POSITIVE_INFINITY||(e.setMaxListeners(n+t),Ax(r,()=>{e.setMaxListeners(e.getMaxListeners()-t)}))};import{EventEmitter as Dx}from"node:events";import{once as Ix}from"node:events";import{scheduler as $x}from"node:timers/promises";var Fn=(e,t)=>{t&&zo(e)},zo=e=>{e.refCounted()},jn=(e,t)=>{t&&Wo(e)},Wo=e=>{e.unrefCounted()},Sl=(e,t)=>{t&&(Wo(e),Wo(e))},xl=(e,t)=>{t&&(zo(e),zo(e))};var vl=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n},s)=>{if(Tl(s)||Rl(s))return;Bn.has(e)||Bn.set(e,[]);let o=Bn.get(e);if(o.push(s),!(o.length>1))for(;o.length>0;){await Ol(e,n,s),await $x.yield();let i=await El({wrappedMessage:o[0],anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n});o.shift(),n.emit("message",i),n.emit("message:done")}},_l=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n,boundOnMessage:s})=>{Zo();let o=Bn.get(e);for(;o?.length>0;)await Ix(n,"message:done");e.removeListener("message",s),xl(t,r),n.connected=!1,n.emit("disconnect")},Bn=new WeakMap;var at=(e,t,r)=>{if(Un.has(e))return Un.get(e);let n=new Dx;return n.connected=!0,Un.set(e,n),Lx({ipcEmitter:n,anyProcess:e,channel:t,isSubprocess:r}),n},Un=new WeakMap,Lx=({ipcEmitter:e,anyProcess:t,channel:r,isSubprocess:n})=>{let s=vl.bind(void 0,{anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:e});t.on("message",s),t.once("disconnect",_l.bind(void 0,{anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:e,boundOnMessage:s})),Sl(r,n)},Gn=e=>{let t=Un.get(e);return t===void 0?e.channel!==null:t.connected};var kl=({anyProcess:e,channel:t,isSubprocess:r,message:n,strict:s})=>{if(!s)return n;let o=at(e,t,r),i=zn(e,o);return{id:Px++,type:Vn,message:n,hasListeners:i}},Px=0n,Cl=(e,t)=>{if(!(t?.type!==Vn||t.hasListeners))for(let{id:r}of e)r!==void 0&&qn[r].resolve({isDeadlock:!0,hasListeners:!1})},El=async({wrappedMessage:e,anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:s})=>{if(e?.type!==Vn||!t.connected)return e;let{id:o,message:i}=e,a={id:o,type:Il,message:zn(t,s)};try{await Wn({anyProcess:t,channel:r,isSubprocess:n,ipc:!0},a)}catch(c){s.emit("strict:error",c)}return i},Tl=e=>{if(e?.type!==Il)return!1;let{id:t,message:r}=e;return qn[t]?.resolve({isDeadlock:!1,hasListeners:r}),!0},Al=async(e,t,r)=>{if(e?.type!==Vn)return;let n=Be();qn[e.id]=n;let s=new AbortController;try{let{isDeadlock:o,hasListeners:i}=await Promise.race([n,Mx(t,r,s)]);o&&ll(r),i||fl(r)}finally{s.abort(),delete qn[e.id]}},qn={},Mx=async(e,t,{signal:r})=>{bt(e,1,r),await Nx(e,"disconnect",{signal:r}),dl(t)},Vn="execa:ipc:request",Il="execa:ipc:response";var $l=(e,t,r)=>{$r.has(e)||$r.set(e,new Set);let n=$r.get(e),s=Be(),o=r?t.id:void 0,i={onMessageSent:s,id:o};return n.add(i),{outgoingMessages:n,outgoingMessage:i}},Dl=({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()},Ol=async(e,t,r)=>{for(;!zn(e,t)&&$r.get(e)?.size>0;){let n=[...$r.get(e)];Cl(n,r),await Promise.all(n.map(({onMessageSent:s})=>s))}},$r=new WeakMap,zn=(e,t)=>t.listenerCount("message")>Fx(e),Fx=e=>Ue.has(e)&&!Xe(Ue.get(e).options.buffer,"ipc")?1:0;var Wn=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},s,{strict:o=!1}={})=>{let i="sendMessage";return Kt({methodName:i,isSubprocess:r,ipc:n,isConnected:e.connected}),Bx({anyProcess:e,channel:t,methodName:i,isSubprocess:r,message:s,strict:o})},Bx=async({anyProcess:e,channel:t,methodName:r,isSubprocess:n,message:s,strict:o})=>{let i=kl({anyProcess:e,channel:t,isSubprocess:n,message:s,strict:o}),a=$l(e,i,o);try{await Yo({anyProcess:e,methodName:r,isSubprocess:n,wrappedMessage:i,message:s})}catch(c){throw Jt(e),c}finally{Dl(a)}},Yo=async({anyProcess:e,methodName:t,isSubprocess:r,wrappedMessage:n,message:s})=>{let o=Ux(e);try{await Promise.all([Al(n,e,r),o(n)])}catch(i){throw hl({error:i,methodName:t,isSubprocess:r}),gl({error:i,methodName:t,isSubprocess:r,message:s}),i}},Ux=e=>{if(Ho.has(e))return Ho.get(e);let t=jx(e.send.bind(e));return Ho.set(e,t),t},Ho=new WeakMap;var Nl=(e,t)=>{let r="cancelSignal";return Vo(r,!1,e.connected),Yo({anyProcess:e,methodName:r,isSubprocess:!1,wrappedMessage:{type:Ml,message:t},message:t})},Pl=async({anyProcess:e,channel:t,isSubprocess:r,ipc:n})=>(await qx({anyProcess:e,channel:t,isSubprocess:r,ipc:n}),Xo.signal),qx=async({anyProcess:e,channel:t,isSubprocess:r,ipc:n})=>{if(!Ll){if(Ll=!0,!n){ml();return}if(t===null){Zo();return}at(e,t,r),await Gx.yield()}},Ll=!1,Rl=e=>e?.type!==Ml?!1:(Xo.abort(e.message),!0),Ml="execa:ipc:cancel",Zo=()=>{Xo.abort(pl())},Xo=new AbortController;var Fl=({gracefulCancel:e,cancelSignal:t,ipc:r,serialization:n})=>{if(e){if(t===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!r)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(n==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},jl=({subprocess:e,cancelSignal:t,gracefulCancel:r,forceKillAfterDelay:n,context:s,controller:o})=>r?[Vx({subprocess:e,cancelSignal:t,forceKillAfterDelay:n,context:s,controller:o})]:[],Vx=async({subprocess:e,cancelSignal:t,forceKillAfterDelay:r,context:n,controller:{signal:s}})=>{await Ln(t,s);let o=zx(t);throw await Nl(e,o),qo({kill:e.kill,forceKillAfterDelay:r,context:n,controllerSignal:s}),n.terminationReason??="gracefulCancel",t.reason},zx=({reason:e})=>{if(!(e instanceof DOMException))return e;let t=new Error(e.message);return Object.defineProperty(t,"stack",{value:e.stack,enumerable:!1,configurable:!0,writable:!0}),t};import{setTimeout as Wx}from"node:timers/promises";var Bl=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},Ul=(e,t,r,n)=>t===0||t===void 0?[]:[Zx(e,t,r,n)],Zx=async(e,t,r,{signal:n})=>{throw await Wx(t,void 0,{signal:n}),r.terminationReason??="timeout",e.kill(),new Le};import{execPath as Hx,execArgv as Yx}from"node:process";import Gl from"node:path";var ql=({options:e})=>{if(e.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}},Vl=(e,t,{node:r=!1,nodePath:n=Hx,nodeOptions:s=Yx.filter(c=>!c.startsWith("--inspect")),cwd:o,execPath:i,...a})=>{if(i!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let c=Wt(n,'The "nodePath" option'),u=Gl.resolve(o,c),l={...a,nodePath:u,node:r,cwd:o};if(!r)return[e,t,l];if(Gl.basename(e,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[u,[...s,e,...t],{ipc:!0,...l,shell:!1}]};import{serialize as Xx}from"node:v8";var zl=({ipcInput:e,ipc:t,serialization:r})=>{if(e!==void 0){if(!t)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");Qx[r](e)}},Kx=e=>{try{Xx(e)}catch(t){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:t})}},Jx=e=>{try{JSON.stringify(e)}catch(t){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:t})}},Qx={advanced:Kx,json:Jx},Wl=async(e,t)=>{t!==void 0&&await e.sendMessage(t)};var Hl=({encoding:e})=>{if(Ko.has(e))return;let t=tv(e);if(t!==void 0)throw new TypeError(`Invalid option \`encoding: ${Zn(e)}\`.
37
+ Please rename it to ${Zn(t)}.`);let r=[...Ko].map(n=>Zn(n)).join(", ");throw new TypeError(`Invalid option \`encoding: ${Zn(e)}\`.
38
+ Please rename it to one of: ${r}.`)},ev=new Set(["utf8","utf16le"]),me=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),Ko=new Set([...ev,...me]),tv=e=>{if(e===null)return"buffer";if(typeof e!="string")return;let t=e.toLowerCase();if(t in Zl)return Zl[t];if(Ko.has(t))return t},Zl={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},Zn=e=>typeof e=="string"?`"${e}"`:String(e);import{statSync as rv}from"node:fs";import nv from"node:path";import sv from"node:process";var Yl=(e=Xl())=>{let t=Wt(e,'The "cwd" option');return nv.resolve(t)},Xl=()=>{try{return sv.cwd()}catch(e){throw e.message=`The current directory does not exist.
39
+ ${e.message}`,e}},Kl=(e,t)=>{if(t===Xl())return e;let r;try{r=rv(t)}catch(n){return`The "cwd" option is invalid: ${t}.
40
+ ${n.message}
41
+ ${e}`}return r.isDirectory()?e:`The "cwd" option is not a directory: ${t}.
42
+ ${e}`};var Hn=(e,t,r)=>{r.cwd=Yl(r.cwd);let[n,s,o]=Vl(e,t,r),{command:i,args:a,options:c}=Ql.default._parse(n,s,o),u=Fc(c),l=iv(u);return Bl(l),Hl(l),zl(l),al(l),Fl(l),l.shell=_o(l.shell),l.env=av(l),l.killSignal=rl(l.killSignal),l.forceKillAfterDelay=ol(l.forceKillAfterDelay),l.lines=l.lines.map((f,p)=>f&&!me.has(l.encoding)&&l.buffer[p]),Jl.platform==="win32"&&ov.basename(i,".exe")==="cmd"&&a.unshift("/q"),{file:i,commandArguments:a,options:l}},iv=({extendEnv:e=!0,preferLocal:t=!1,cwd:r,localDir:n=r,encoding:s="utf8",reject:o=!0,cleanup:i=!0,all:a=!1,windowsHide:c=!0,killSignal:u="SIGTERM",forceKillAfterDelay:l=!0,gracefulCancel:f=!1,ipcInput:p,ipc:d=p!==void 0||f,serialization:b="advanced",...T})=>({...T,extendEnv:e,preferLocal:t,cwd:r,localDirectory:n,encoding:s,reject:o,cleanup:i,all:a,windowsHide:c,killSignal:u,forceKillAfterDelay:l,gracefulCancel:f,ipcInput:p,ipc:d,serialization:b}),av=({env:e,extendEnv:t,preferLocal:r,node:n,localDirectory:s,nodePath:o})=>{let i=t?{...Jl.env,...e}:e;return r||n?zu({env:i,cwd:s,execPath:o,preferLocal:r,addExecPath:n}):i};import{inspect as Uv}from"node:util";function er(e){if(typeof e=="string")return cv(e);if(!(ArrayBuffer.isView(e)&&e.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return uv(e)}var cv=e=>e.at(-1)===ef?e.slice(0,e.at(-2)===tf?-2:-1):e,uv=e=>e.at(-1)===lv?e.subarray(0,e.at(-2)===fv?-2:-1):e,ef=`
43
+ `,lv=ef.codePointAt(0),tf="\r",fv=tf.codePointAt(0);import{on as Mv}from"node:events";import{finished as Fv}from"node:stream/promises";function Pe(e,{checkOpen:t=!0}={}){return e!==null&&typeof e=="object"&&(e.writable||e.readable||!t||e.writable===void 0&&e.readable===void 0)&&typeof e.pipe=="function"}function Jo(e,{checkOpen:t=!0}={}){return Pe(e,{checkOpen:t})&&(e.writable||!t)&&typeof e.write=="function"&&typeof e.end=="function"&&typeof e.writable=="boolean"&&typeof e.writableObjectMode=="boolean"&&typeof e.destroy=="function"&&typeof e.destroyed=="boolean"}function wt(e,{checkOpen:t=!0}={}){return Pe(e,{checkOpen:t})&&(e.readable||!t)&&typeof e.read=="function"&&typeof e.readable=="boolean"&&typeof e.readableObjectMode=="boolean"&&typeof e.destroy=="function"&&typeof e.destroyed=="boolean"}function Qo(e,t){return Jo(e,t)&&wt(e,t)}var dv=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),ei=class{#t;#r;#e=!1;#n=void 0;constructor(t,r){this.#t=t,this.#r=r}next(){let t=()=>this.#o();return this.#n=this.#n?this.#n.then(t,t):t(),this.#n}return(t){let r=()=>this.#s(t);return this.#n?this.#n.then(r,r):r()}async#o(){if(this.#e)return{done:!0,value:void 0};let t;try{t=await this.#t.read()}catch(r){throw this.#n=void 0,this.#e=!0,this.#t.releaseLock(),r}return t.done&&(this.#n=void 0,this.#e=!0,this.#t.releaseLock()),t}async#s(t){if(this.#e)return{done:!0,value:t};if(this.#e=!0,!this.#r){let r=this.#t.cancel(t);return this.#t.releaseLock(),await r,{done:!0,value:t}}return this.#t.releaseLock(),{done:!0,value:t}}},ti=Symbol();function rf(){return this[ti].next()}Object.defineProperty(rf,"name",{value:"next"});function nf(e){return this[ti].return(e)}Object.defineProperty(nf,"name",{value:"return"});var pv=Object.create(dv,{next:{enumerable:!0,configurable:!0,writable:!0,value:rf},return:{enumerable:!0,configurable:!0,writable:!0,value:nf}});function ri({preventCancel:e=!1}={}){let t=this.getReader(),r=new ei(t,e),n=Object.create(pv);return n[ti]=r,n}var sf=e=>{if(wt(e,{checkOpen:!1})&&Dr.on!==void 0)return hv(e);if(typeof e?.[Symbol.asyncIterator]=="function")return e;if(mv.call(e)==="[object ReadableStream]")return ri.call(e);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:mv}=Object.prototype,hv=async function*(e){let t=new AbortController,r={};gv(e,t,r);try{for await(let[n]of Dr.on(e,"data",{signal:t.signal}))yield n}catch(n){if(r.error!==void 0)throw r.error;if(!t.signal.aborted)throw n}finally{e.destroy()}},gv=async(e,t,r)=>{try{await Dr.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(n){r.error=n}finally{t.abort()}},Dr={};var tr=async(e,{init:t,convertChunk:r,getSize:n,truncateChunk:s,addChunk:o,getFinalChunk:i,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{let u=sf(e),l=t();l.length=0;try{for await(let f of u){let p=bv(f),d=r[p](f,l);cf({convertedChunk:d,state:l,getSize:n,truncateChunk:s,addChunk:o,maxBuffer:c})}return yv({state:l,convertChunk:r,getSize:n,truncateChunk:s,addChunk:o,getFinalChunk:i,maxBuffer:c}),a(l)}catch(f){let p=typeof f=="object"&&f!==null?f:new Error(f);throw p.bufferedData=a(l),p}},yv=({state:e,getSize:t,truncateChunk:r,addChunk:n,getFinalChunk:s,maxBuffer:o})=>{let i=s(e);i!==void 0&&cf({convertedChunk:i,state:e,getSize:t,truncateChunk:r,addChunk:n,maxBuffer:o})},cf=({convertedChunk:e,state:t,getSize:r,truncateChunk:n,addChunk:s,maxBuffer:o})=>{let i=r(e),a=t.length+i;if(a<=o){of(e,t,s,a);return}let c=n(e,o-t.length);throw c!==void 0&&of(c,t,s,o),new Ge},of=(e,t,r,n)=>{t.contents=r(e,t,n),t.length=n},bv=e=>{let t=typeof e;if(t==="string")return"string";if(t!=="object"||e===null)return"others";if(globalThis.Buffer?.isBuffer(e))return"buffer";let r=af.call(e);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&af.call(e.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:af}=Object.prototype,Ge=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}};var Ke=e=>e,Lr=()=>{},Yn=({contents:e})=>e,Xn=e=>{throw new Error(`Streams in object mode are not supported: ${String(e)}`)},Kn=e=>e.length;async function Jn(e,t){return tr(e,vv,t)}var wv=()=>({contents:[]}),Sv=()=>1,xv=(e,{contents:t})=>(t.push(e),t),vv={init:wv,convertChunk:{string:Ke,buffer:Ke,arrayBuffer:Ke,dataView:Ke,typedArray:Ke,others:Ke},getSize:Sv,truncateChunk:Lr,addChunk:xv,getFinalChunk:Lr,finalize:Yn};async function Qn(e,t){return tr(e,Iv,t)}var _v=()=>({contents:new ArrayBuffer(0)}),Ev=e=>Tv.encode(e),Tv=new TextEncoder,uf=e=>new Uint8Array(e),lf=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Ov=(e,t)=>e.slice(0,t),Rv=(e,{contents:t,length:r},n)=>{let s=pf()?Cv(t,n):kv(t,n);return new Uint8Array(s).set(e,r),s},kv=(e,t)=>{if(t<=e.byteLength)return e;let r=new ArrayBuffer(df(t));return new Uint8Array(r).set(new Uint8Array(e),0),r},Cv=(e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let r=new ArrayBuffer(t,{maxByteLength:df(t)});return new Uint8Array(r).set(new Uint8Array(e),0),r},df=e=>ff**Math.ceil(Math.log(e)/Math.log(ff)),ff=2,Av=({contents:e,length:t})=>pf()?e:e.slice(0,t),pf=()=>"resize"in ArrayBuffer.prototype,Iv={init:_v,convertChunk:{string:Ev,buffer:uf,arrayBuffer:uf,dataView:lf,typedArray:lf,others:Xn},getSize:Kn,truncateChunk:Ov,addChunk:Rv,getFinalChunk:Lr,finalize:Av};async function ts(e,t){return tr(e,Pv,t)}var $v=()=>({contents:"",textDecoder:new TextDecoder}),es=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),Dv=(e,{contents:t})=>t+e,Lv=(e,t)=>e.slice(0,t),Nv=({textDecoder:e})=>{let t=e.decode();return t===""?void 0:t},Pv={init:$v,convertChunk:{string:Ke,buffer:es,arrayBuffer:es,dataView:es,typedArray:es,others:Xn},getSize:Kn,truncateChunk:Lv,addChunk:Dv,getFinalChunk:Nv,finalize:Yn};Object.assign(Dr,{on:Mv,finished:Fv});var mf=({error:e,stream:t,readableObjectMode:r,lines:n,encoding:s,fdNumber:o})=>{if(!(e instanceof Ge))throw e;if(o==="all")return e;let i=jv(r,n,s);throw e.maxBufferInfo={fdNumber:o,unit:i},t.destroy(),e},jv=(e,t,r)=>e?"objects":t?"lines":r==="buffer"?"bytes":"characters",hf=(e,t,r)=>{if(t.length!==r)return;let n=new Ge;throw n.maxBufferInfo={fdNumber:"ipc"},n},gf=(e,t)=>{let{streamName:r,threshold:n,unit:s}=Bv(e,t);return`Command's ${r} was larger than ${n} ${s}`},Bv=(e,t)=>{if(e?.maxBufferInfo===void 0)return{streamName:"output",threshold:t[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:r,unit:n}}=e;delete e.maxBufferInfo;let s=Xe(t,r);return r==="ipc"?{streamName:"IPC output",threshold:s,unit:"messages"}:{streamName:wn(r),threshold:s,unit:n}},yf=(e,t,r)=>e?.code==="ENOBUFS"&&t!==null&&t.some(n=>n!==null&&n.length>rs(r)),bf=(e,t,r)=>{if(!t)return e;let n=rs(r);return e.length>n?e.slice(0,n):e},rs=([,e])=>e;var Sf=({stdio:e,all:t,ipcOutput:r,originalError:n,signal:s,signalDescription:o,exitCode:i,escapedCommand:a,timedOut:c,isCanceled:u,isGracefullyCanceled:l,isMaxBuffer:f,isForcefullyTerminated:p,forceKillAfterDelay:d,killSignal:b,maxBuffer:T,timeout:N,cwd:P})=>{let U=n?.code,H=Gv({originalError:n,timedOut:c,timeout:N,isMaxBuffer:f,maxBuffer:T,errorCode:U,signal:s,signalDescription:o,exitCode:i,isCanceled:u,isGracefullyCanceled:l,isForcefullyTerminated:p,forceKillAfterDelay:d,killSignal:b}),Y=Vv(n,P),Se=Y===void 0?"":`
44
+ ${Y}`,ae=`${H}: ${a}${Se}`,Ae=t===void 0?[e[2],e[1]]:[t],Ie=[ae,...Ae,...e.slice(3),r.map(xe=>zv(xe)).join(`
45
+ `)].map(xe=>Rr(er(Wv(xe)))).filter(Boolean).join(`
46
+
47
+ `);return{originalMessage:Y,shortMessage:ae,message:Ie}},Gv=({originalError:e,timedOut:t,timeout:r,isMaxBuffer:n,maxBuffer:s,errorCode:o,signal:i,signalDescription:a,exitCode:c,isCanceled:u,isGracefullyCanceled:l,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:d})=>{let b=qv(f,p);return t?`Command timed out after ${r} milliseconds${b}`:l?i===void 0?`Command was gracefully canceled with exit code ${c}`:f?`Command was gracefully canceled${b}`:`Command was gracefully canceled with ${i} (${a})`:u?`Command was canceled${b}`:n?`${gf(e,s)}${b}`:o!==void 0?`Command failed with ${o}${b}`:f?`Command was killed with ${d} (${Dn(d)})${b}`:i!==void 0?`Command was killed with ${i} (${a})`:c!==void 0?`Command failed with exit code ${c}`:"Command failed"},qv=(e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:"",Vv=(e,t)=>{if(e instanceof Le)return;let r=Hu(e)?e.originalMessage:String(e?.message??e),n=Rr(Kl(r,t));return n===""?void 0:n},zv=e=>typeof e=="string"?e:Uv(e),Wv=e=>Array.isArray(e)?e.map(t=>er(wf(t))).filter(Boolean).join(`
48
+ `):wf(e),wf=e=>typeof e=="string"?e:X(e)?yn(e):"";var ns=({command:e,escapedCommand:t,stdio:r,all:n,ipcOutput:s,options:{cwd:o},startTime:i})=>xf({command:e,escapedCommand:t,cwd:o,durationMs:Io(i),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:n,stdio:r,ipcOutput:s,pipedFrom:[]}),rr=({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:s,startTime:o,isSync:i})=>Nr({error:e,command:t,escapedCommand:r,startTime:o,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:s,isSync:i}),Nr=({error:e,command:t,escapedCommand:r,startTime:n,timedOut:s,isCanceled:o,isGracefullyCanceled:i,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:u,signal:l,stdio:f,all:p,ipcOutput:d,options:{timeoutDuration:b,timeout:T=b,forceKillAfterDelay:N,killSignal:P,cwd:U,maxBuffer:H},isSync:Y})=>{let{exitCode:Se,signal:ae,signalDescription:Ae}=Hv(u,l),{originalMessage:Ie,shortMessage:xe,message:Er}=Sf({stdio:f,all:p,ipcOutput:d,originalError:e,signal:ae,signalDescription:Ae,exitCode:Se,escapedCommand:r,timedOut:s,isCanceled:o,isGracefullyCanceled:i,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:N,killSignal:P,maxBuffer:H,timeout:T,cwd:U}),ht=Wu(e,Er,Y);return Object.assign(ht,Zv({error:ht,command:t,escapedCommand:r,startTime:n,timedOut:s,isCanceled:o,isGracefullyCanceled:i,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:Se,signal:ae,signalDescription:Ae,stdio:f,all:p,ipcOutput:d,cwd:U,originalMessage:Ie,shortMessage:xe})),ht},Zv=({error:e,command:t,escapedCommand:r,startTime:n,timedOut:s,isCanceled:o,isGracefullyCanceled:i,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:u,signal:l,signalDescription:f,stdio:p,all:d,ipcOutput:b,cwd:T,originalMessage:N,shortMessage:P})=>xf({shortMessage:P,originalMessage:N,command:t,escapedCommand:r,cwd:T,durationMs:Io(n),failed:!0,timedOut:s,isCanceled:o,isGracefullyCanceled:i,isTerminated:l!==void 0,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:u,signal:l,signalDescription:f,code:e.cause?.code,stdout:p[1],stderr:p[2],all:d,stdio:p,ipcOutput:b,pipedFrom:[]}),xf=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0)),Hv=(e,t)=>{let r=e===null?void 0:e,n=t===null?void 0:t,s=n===void 0?void 0:Dn(t);return{exitCode:r,signal:n,signalDescription:s}};var vf=e=>Number.isFinite(e)?e:0;function Yv(e){return{days:Math.trunc(e/864e5),hours:Math.trunc(e/36e5%24),minutes:Math.trunc(e/6e4%60),seconds:Math.trunc(e/1e3%60),milliseconds:Math.trunc(e%1e3),microseconds:Math.trunc(vf(e*1e3)%1e3),nanoseconds:Math.trunc(vf(e*1e6)%1e3)}}function Xv(e){return{days:e/86400000n,hours:e/3600000n%24n,minutes:e/60000n%60n,seconds:e/1000n%60n,milliseconds:e%1000n,microseconds:0n,nanoseconds:0n}}function ni(e){switch(typeof e){case"number":{if(Number.isFinite(e))return Yv(e);break}case"bigint":return Xv(e)}throw new TypeError("Expected a finite number or bigint")}var Kv=e=>e===0||e===0n,Jv=(e,t)=>t===1||t===1n?e:`${e}s`,Qv=1e-7,e_=24n*60n*60n*1000n;function si(e,t){let r=typeof e=="bigint";if(!r&&!Number.isFinite(e))throw new TypeError("Expected a finite number or bigint");t={...t};let n=e<0?"-":"";e=e<0?-e:e,t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.unitCount=1,t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);let s=[],o=(l,f)=>{let p=Math.floor(l*10**f+Qv);return(Math.round(p)/10**f).toFixed(f)},i=(l,f,p,d)=>{if(!((s.length===0||!t.colonNotation)&&Kv(l)&&!(t.colonNotation&&p==="m"))){if(d??=String(l),t.colonNotation){let b=d.includes(".")?d.split(".")[0].length:d.length,T=s.length>0?2:1;d="0".repeat(Math.max(0,T-b))+d}else d+=t.verbose?" "+Jv(f,l):p;s.push(d)}},a=ni(e),c=BigInt(a.days);if(t.hideYearAndDays?i(BigInt(c)*24n+BigInt(a.hours),"hour","h"):(t.hideYear?i(c,"day","d"):(i(c/365n,"year","y"),i(c%365n,"day","d")),i(Number(a.hours),"hour","h")),i(Number(a.minutes),"minute","m"),!t.hideSeconds)if(t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3){let l=Number(a.seconds),f=Number(a.milliseconds),p=Number(a.microseconds),d=Number(a.nanoseconds);if(i(l,"second","s"),t.formatSubMilliseconds)i(f,"millisecond","ms"),i(p,"microsecond","\xB5s"),i(d,"nanosecond","ns");else{let b=f+p/1e3+d/1e6,T=typeof t.millisecondsDecimalDigits=="number"?t.millisecondsDecimalDigits:0,N=b>=1?Math.round(b):Math.ceil(b),P=T?b.toFixed(T):N;i(Number.parseFloat(P),"millisecond","ms",P)}}else{let l=(r?Number(e%e_):e)/1e3%60,f=typeof t.secondsDecimalDigits=="number"?t.secondsDecimalDigits:1,p=o(l,f),d=t.keepDecimalsOnWholeSeconds?p:p.replace(/\.0+$/,"");i(Number.parseFloat(d),"second","s",d)}if(s.length===0)return n+"0"+(t.verbose?" milliseconds":"ms");let u=t.colonNotation?":":" ";return typeof t.unitCount=="number"&&(s=s.slice(0,Math.max(t.unitCount,1))),n+s.join(u)}var _f=(e,t)=>{e.failed&&je({type:"error",verboseMessage:e.shortMessage,verboseInfo:t,result:e})};var Ef=(e,t)=>{Zt(t)&&(_f(e,t),t_(e,t))},t_=(e,t)=>{let r=`(done in ${si(e.durationMs)})`;je({type:"duration",verboseMessage:r,verboseInfo:t,result:e})};var nr=(e,t,{reject:r})=>{if(Ef(e,t),e.failed&&r)throw e;return e};import{readFileSync as Kf}from"node:fs";var Rf=(e,t)=>St(e)?"asyncGenerator":Af(e)?"generator":ss(e)?"fileUrl":i_(e)?"filePath":u_(e)?"webStream":Pe(e,{checkOpen:!1})?"native":X(e)?"uint8Array":l_(e)?"asyncIterable":f_(e)?"iterable":ai(e)?kf({transform:e},t):o_(e)?r_(e,t):"native",r_=(e,t)=>Qo(e.transform,{checkOpen:!1})?n_(e,t):ai(e.transform)?kf(e,t):s_(e,t),n_=(e,t)=>(Cf(e,t,"Duplex stream"),"duplex"),kf=(e,t)=>(Cf(e,t,"web TransformStream"),"webTransform"),Cf=({final:e,binary:t,objectMode:r},n,s)=>{Tf(e,`${n}.final`,s),Tf(t,`${n}.binary`,s),oi(r,`${n}.objectMode`)},Tf=(e,t,r)=>{if(e!==void 0)throw new TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${r}.`)},s_=({transform:e,final:t,binary:r,objectMode:n},s)=>{if(e!==void 0&&!Of(e))throw new TypeError(`The \`${s}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(Qo(t,{checkOpen:!1}))throw new TypeError(`The \`${s}.final\` option must not be a Duplex stream.`);if(ai(t))throw new TypeError(`The \`${s}.final\` option must not be a web TransformStream.`);if(t!==void 0&&!Of(t))throw new TypeError(`The \`${s}.final\` option must be a generator.`);return oi(r,`${s}.binary`),oi(n,`${s}.objectMode`),St(e)||St(t)?"asyncGenerator":"generator"},oi=(e,t)=>{if(e!==void 0&&typeof e!="boolean")throw new TypeError(`The \`${t}\` option must use a boolean.`)},Of=e=>St(e)||Af(e),St=e=>Object.prototype.toString.call(e)==="[object AsyncGeneratorFunction]",Af=e=>Object.prototype.toString.call(e)==="[object GeneratorFunction]",o_=e=>z(e)&&(e.transform!==void 0||e.final!==void 0),ss=e=>Object.prototype.toString.call(e)==="[object URL]",If=e=>ss(e)&&e.protocol!=="file:",i_=e=>z(e)&&Object.keys(e).length>0&&Object.keys(e).every(t=>a_.has(t))&&ii(e.file),a_=new Set(["file","append"]),ii=e=>typeof e=="string",$f=(e,t)=>e==="native"&&typeof t=="string"&&!c_.has(t),c_=new Set(["ipc","ignore","inherit","overlapped","pipe"]),Df=e=>Object.prototype.toString.call(e)==="[object ReadableStream]",os=e=>Object.prototype.toString.call(e)==="[object WritableStream]",u_=e=>Df(e)||os(e),ai=e=>Df(e?.readable)&&os(e?.writable),l_=e=>Lf(e)&&typeof e[Symbol.asyncIterator]=="function",f_=e=>Lf(e)&&typeof e[Symbol.iterator]=="function",Lf=e=>typeof e=="object"&&e!==null,_e=new Set(["generator","asyncGenerator","duplex","webTransform"]),is=new Set(["fileUrl","filePath","fileNumber"]),ci=new Set(["fileUrl","filePath"]),Nf=new Set([...ci,"webStream","nodeStream"]),Pf=new Set(["webTransform","duplex"]),ct={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};var ui=(e,t,r,n)=>n==="output"?d_(e,t,r):p_(e,t,r),d_=(e,t,r)=>{let n=t!==0&&r[t-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:e??n}},p_=(e,t,r)=>{let n=t===0?e===!0:r[t-1].value.readableObjectMode,s=t!==r.length-1&&(e??n);return{writableObjectMode:n,readableObjectMode:s}},Mf=(e,t)=>{let r=e.findLast(({type:n})=>_e.has(n));return r===void 0?!1:t==="input"?r.value.writableObjectMode:r.value.readableObjectMode};var Ff=(e,t,r,n)=>[...e.filter(({type:s})=>!_e.has(s)),...m_(e,t,r,n)],m_=(e,t,r,{encoding:n})=>{let s=e.filter(({type:i})=>_e.has(i)),o=Array.from({length:s.length});for(let[i,a]of Object.entries(s))o[i]=h_({stdioItem:a,index:Number(i),newTransforms:o,optionName:t,direction:r,encoding:n});return w_(o,r)},h_=({stdioItem:e,stdioItem:{type:t},index:r,newTransforms:n,optionName:s,direction:o,encoding:i})=>t==="duplex"?g_({stdioItem:e,optionName:s}):t==="webTransform"?y_({stdioItem:e,index:r,newTransforms:n,direction:o}):b_({stdioItem:e,index:r,newTransforms:n,direction:o,encoding:i}),g_=({stdioItem:e,stdioItem:{value:{transform:t,transform:{writableObjectMode:r,readableObjectMode:n},objectMode:s=n}},optionName:o})=>{if(s&&!n)throw new TypeError(`The \`${o}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!s&&n)throw new TypeError(`The \`${o}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...e,value:{transform:t,writableObjectMode:r,readableObjectMode:n}}},y_=({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:n,direction:s})=>{let{transform:o,objectMode:i}=z(t)?t:{transform:t},{writableObjectMode:a,readableObjectMode:c}=ui(i,r,n,s);return{...e,value:{transform:o,writableObjectMode:a,readableObjectMode:c}}},b_=({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:n,direction:s,encoding:o})=>{let{transform:i,final:a,binary:c=!1,preserveNewlines:u=!1,objectMode:l}=z(t)?t:{transform:t},f=c||me.has(o),{writableObjectMode:p,readableObjectMode:d}=ui(l,r,n,s);return{...e,value:{transform:i,final:a,binary:f,preserveNewlines:u,writableObjectMode:p,readableObjectMode:d}}},w_=(e,t)=>t==="input"?e.reverse():e;import li from"node:process";var jf=(e,t,r)=>{let n=e.map(s=>S_(s,t));if(n.includes("input")&&n.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return n.find(Boolean)??__},S_=({type:e,value:t},r)=>x_[r]??Bf[e](t),x_=["input","output","output"],sr=()=>{},fi=()=>"input",Bf={generator:sr,asyncGenerator:sr,fileUrl:sr,filePath:sr,iterable:fi,asyncIterable:fi,uint8Array:fi,webStream:e=>os(e)?"output":"input",nodeStream(e){return wt(e,{checkOpen:!1})?Jo(e,{checkOpen:!1})?void 0:"input":"output"},webTransform:sr,duplex:sr,native(e){let t=v_(e);if(t!==void 0)return t;if(Pe(e,{checkOpen:!1}))return Bf.nodeStream(e)}},v_=e=>{if([0,li.stdin].includes(e))return"input";if([1,2,li.stdout,li.stderr].includes(e))return"output"},__="output";var Uf=(e,t)=>t&&!e.includes("ipc")?[...e,"ipc"]:e;var Gf=({stdio:e,ipc:t,buffer:r,...n},s,o)=>{let i=E_(e,n).map((a,c)=>qf(a,c));return o?O_(i,r,s):Uf(i,t)},E_=(e,t)=>{if(e===void 0)return ve.map(n=>t[n]);if(T_(t))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${ve.map(n=>`\`${n}\``).join(", ")}`);if(typeof e=="string")return[e,e,e];if(!Array.isArray(e))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);let r=Math.max(e.length,ve.length);return Array.from({length:r},(n,s)=>e[s])},T_=e=>ve.some(t=>e[t]!==void 0),qf=(e,t)=>Array.isArray(e)?e.map(r=>qf(r,t)):e??(t>=ve.length?"ignore":"pipe"),O_=(e,t,r)=>e.map((n,s)=>!t[s]&&s!==0&&!Ht(r,s)&&R_(n)?"ignore":n),R_=e=>e==="pipe"||Array.isArray(e)&&e.every(t=>t==="pipe");import{readFileSync as k_}from"node:fs";import C_ from"node:tty";var zf=({stdioItem:e,stdioItem:{type:t},isStdioArray:r,fdNumber:n,direction:s,isSync:o})=>!r||t!=="native"?e:o?A_({stdioItem:e,fdNumber:n,direction:s}):D_({stdioItem:e,fdNumber:n}),A_=({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:n,direction:s})=>{let o=I_({value:t,optionName:r,fdNumber:n,direction:s});if(o!==void 0)return o;if(Pe(t,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e},I_=({value:e,optionName:t,fdNumber:r,direction:n})=>{let s=$_(e,r);if(s!==void 0){if(n==="output")return{type:"fileNumber",value:s,optionName:t};if(C_.isatty(s))throw new TypeError(`The \`${t}: ${Pn(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:Ye(k_(s)),optionName:t}}},$_=(e,t)=>{if(e==="inherit")return t;if(typeof e=="number")return e;let r=bn.indexOf(e);if(r!==-1)return r},D_=({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:n})=>t==="inherit"?{type:"nodeStream",value:Vf(n,t,r),optionName:r}:typeof t=="number"?{type:"nodeStream",value:Vf(t,t,r),optionName:r}:Pe(t,{checkOpen:!1})?{type:"nodeStream",value:t,optionName:r}:e,Vf=(e,t,r)=>{let n=bn[e];if(n===void 0)throw new TypeError(`The \`${r}: ${t}\` option is invalid: no such standard stream.`);return n};var Wf=({input:e,inputFile:t},r)=>r===0?[...L_(e),...P_(t)]:[],L_=e=>e===void 0?[]:[{type:N_(e),value:e,optionName:"input"}],N_=e=>{if(wt(e,{checkOpen:!1}))return"nodeStream";if(typeof e=="string")return"string";if(X(e))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},P_=e=>e===void 0?[]:[{...M_(e),optionName:"inputFile"}],M_=e=>{if(ss(e))return{type:"fileUrl",value:e};if(ii(e))return{type:"filePath",value:{file:e}};throw new Error("The `inputFile` option must be a file path string or a file URL.")};var Zf=e=>e.filter((t,r)=>e.every((n,s)=>t.value!==n.value||r>=s||t.type==="generator"||t.type==="asyncGenerator")),Hf=({stdioItem:{type:e,value:t,optionName:r},direction:n,fileDescriptors:s,isSync:o})=>{let i=F_(s,e);if(i.length!==0){if(o){j_({otherStdioItems:i,type:e,value:t,optionName:r,direction:n});return}if(Nf.has(e))return Yf({otherStdioItems:i,type:e,value:t,optionName:r,direction:n});Pf.has(e)&&U_({otherStdioItems:i,type:e,value:t,optionName:r})}},F_=(e,t)=>e.flatMap(({direction:r,stdioItems:n})=>n.filter(s=>s.type===t).map(s=>({...s,direction:r}))),j_=({otherStdioItems:e,type:t,value:r,optionName:n,direction:s})=>{ci.has(t)&&Yf({otherStdioItems:e,type:t,value:r,optionName:n,direction:s})},Yf=({otherStdioItems:e,type:t,value:r,optionName:n,direction:s})=>{let o=e.filter(a=>B_(a,r));if(o.length===0)return;let i=o.find(a=>a.direction!==s);return Xf(i,n,t),s==="output"?o[0].stream:void 0},B_=({type:e,value:t},r)=>e==="filePath"?t.file===r.file:e==="fileUrl"?t.href===r.href:t===r,U_=({otherStdioItems:e,type:t,value:r,optionName:n})=>{let s=e.find(({value:{transform:o}})=>o===r.transform);Xf(s,n,t)},Xf=(e,t,r)=>{if(e!==void 0)throw new TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${ct[r]} that is the same.`)};var as=(e,t,r,n)=>{let o=Gf(t,r,n).map((a,c)=>G_({stdioOption:a,fdNumber:c,options:t,isSync:n})),i=X_({initialFileDescriptors:o,addProperties:e,options:t,isSync:n});return t.stdio=i.map(({stdioItems:a})=>Q_(a)),i},G_=({stdioOption:e,fdNumber:t,options:r,isSync:n})=>{let s=wn(t),{stdioItems:o,isStdioArray:i}=q_({stdioOption:e,fdNumber:t,options:r,optionName:s}),a=jf(o,t,s),c=o.map(f=>zf({stdioItem:f,isStdioArray:i,fdNumber:t,direction:a,isSync:n})),u=Ff(c,s,a,r),l=Mf(u,a);return Y_(u,l),{direction:a,objectMode:l,stdioItems:u}},q_=({stdioOption:e,fdNumber:t,options:r,optionName:n})=>{let o=[...(Array.isArray(e)?e:[e]).map(c=>V_(c,n)),...Wf(r,t)],i=Zf(o),a=i.length>1;return z_(i,a,n),Z_(i),{stdioItems:i,isStdioArray:a}},V_=(e,t)=>({type:Rf(e,t),value:e,optionName:t}),z_=(e,t,r)=>{if(e.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(t){for(let{value:n,optionName:s}of e)if(W_.has(n))throw new Error(`The \`${s}\` option must not include \`${n}\`.`)}},W_=new Set(["ignore","ipc"]),Z_=e=>{for(let t of e)H_(t)},H_=({type:e,value:t,optionName:r})=>{if(If(t))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme.
49
+ For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if($f(e,t))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},Y_=(e,t)=>{if(!t)return;let r=e.find(({type:n})=>is.has(n));if(r!==void 0)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},X_=({initialFileDescriptors:e,addProperties:t,options:r,isSync:n})=>{let s=[];try{for(let o of e)s.push(K_({fileDescriptor:o,fileDescriptors:s,addProperties:t,options:r,isSync:n}));return s}catch(o){throw di(s),o}},K_=({fileDescriptor:{direction:e,objectMode:t,stdioItems:r},fileDescriptors:n,addProperties:s,options:o,isSync:i})=>{let a=r.map(c=>J_({stdioItem:c,addProperties:s,direction:e,options:o,fileDescriptors:n,isSync:i}));return{direction:e,objectMode:t,stdioItems:a}},J_=({stdioItem:e,addProperties:t,direction:r,options:n,fileDescriptors:s,isSync:o})=>{let i=Hf({stdioItem:e,direction:r,fileDescriptors:s,isSync:o});return i!==void 0?{...e,stream:i}:{...e,...t[r][e.type](e,n)}},di=e=>{for(let{stdioItems:t}of e)for(let{stream:r}of t)r!==void 0&&!De(r)&&r.destroy()},Q_=e=>{if(e.length>1)return e.some(({value:n})=>n==="overlapped")?"overlapped":"pipe";let[{type:t,value:r}]=e;return t==="native"?r:"pipe"};var Qf=(e,t)=>as(tE,e,t,!0),qe=({type:e,optionName:t})=>{ed(t,ct[e])},eE=({optionName:e,value:t})=>((t==="ipc"||t==="overlapped")&&ed(e,`"${t}"`),{}),ed=(e,t)=>{throw new TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},Jf={generator(){},asyncGenerator:qe,webStream:qe,nodeStream:qe,webTransform:qe,duplex:qe,asyncIterable:qe,native:eE},tE={input:{...Jf,fileUrl:({value:e})=>({contents:[Ye(Kf(e))]}),filePath:({value:{file:e}})=>({contents:[Ye(Kf(e))]}),fileNumber:qe,iterable:({value:e})=>({contents:[...e]}),string:({value:e})=>({contents:[e]}),uint8Array:({value:e})=>({contents:[e]})},output:{...Jf,fileUrl:({value:e})=>({path:e}),filePath:({value:{file:e,append:t}})=>({path:e,append:t}),fileNumber:({value:e})=>({path:e}),iterable:qe,string:qe,uint8Array:qe}};var Je=(e,{stripFinalNewline:t},r)=>pi(t,r)&&e!==void 0&&!Array.isArray(e)?er(e):e,pi=(e,t)=>t==="all"?e[1]||e[2]:e[t];import{Transform as vE,getDefaultHighWaterMark as fd}from"node:stream";var cs=(e,t,r,n)=>e||r?void 0:rd(t,n),hi=(e,t,r)=>r?e.flatMap(n=>td(n,t)):td(e,t),td=(e,t)=>{let{transform:r,final:n}=rd(t,{});return[...r(e),...n()]},rd=(e,t)=>(t.previousChunks="",{transform:rE.bind(void 0,t,e),final:sE.bind(void 0,t)}),rE=function*(e,t,r){if(typeof r!="string"){yield r;return}let{previousChunks:n}=e,s=-1;for(let o=0;o<r.length;o+=1)if(r[o]===`
50
+ `){let i=nE(r,o,t,e),a=r.slice(s+1,o+1-i);n.length>0&&(a=mi(n,a),n=""),yield a,s=o}s!==r.length-1&&(n=mi(n,r.slice(s+1))),e.previousChunks=n},nE=(e,t,r,n)=>r?0:(n.isWindowsNewline=t!==0&&e[t-1]==="\r",n.isWindowsNewline?2:1),sE=function*({previousChunks:e}){e.length>0&&(yield e)},nd=({binary:e,preserveNewlines:t,readableObjectMode:r,state:n})=>e||t||r?void 0:{transform:oE.bind(void 0,n)},oE=function*({isWindowsNewline:e=!1},t){let{unixNewline:r,windowsNewline:n,LF:s,concatBytes:o}=typeof t=="string"?iE:cE;if(t.at(-1)===s){yield t;return}yield o(t,e?n:r)},mi=(e,t)=>`${e}${t}`,iE={windowsNewline:`\r
51
+ `,unixNewline:`
52
+ `,LF:`
53
+ `,concatBytes:mi},aE=(e,t)=>{let r=new Uint8Array(e.length+t.length);return r.set(e,0),r.set(t,e.length),r},cE={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:aE};import{Buffer as uE}from"node:buffer";var sd=(e,t)=>e?void 0:lE.bind(void 0,t),lE=function*(e,t){if(typeof t!="string"&&!X(t)&&!uE.isBuffer(t))throw new TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},od=(e,t)=>e?fE.bind(void 0,t):dE.bind(void 0,t),fE=function*(e,t){id(e,t),yield t},dE=function*(e,t){if(id(e,t),typeof t!="string"&&!X(t))throw new TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},id=(e,t)=>{if(t==null)throw new TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.
54
+ Instead, \`yield\` should either be called with a value, or not be called at all. For example:
55
+ if (condition) { yield value; }`)};import{Buffer as pE}from"node:buffer";import{StringDecoder as mE}from"node:string_decoder";var us=(e,t,r)=>{if(r)return;if(e)return{transform:hE.bind(void 0,new TextEncoder)};let n=new mE(t);return{transform:gE.bind(void 0,n),final:yE.bind(void 0,n)}},hE=function*(e,t){pE.isBuffer(t)?yield Ye(t):typeof t=="string"?yield e.encode(t):yield t},gE=function*(e,t){yield X(t)?e.write(t):t},yE=function*(e){let t=e.end();t!==""&&(yield t)};import{callbackify as ad}from"node:util";var gi=ad(async(e,t,r,n)=>{t.currentIterable=e(...r);try{for await(let s of t.currentIterable)n.push(s)}finally{delete t.currentIterable}}),ls=async function*(e,t,r){if(r===t.length){yield e;return}let{transform:n=wE}=t[r];for await(let s of n(e))yield*ls(s,t,r+1)},cd=async function*(e){for(let[t,{final:r}]of Object.entries(e))yield*bE(r,Number(t),e)},bE=async function*(e,t,r){if(e!==void 0)for await(let n of e())yield*ls(n,r,t+1)},ud=ad(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),wE=function*(e){yield e};var yi=(e,t,r,n)=>{try{for(let s of e(...t))r.push(s);n()}catch(s){n(s)}},ld=(e,t)=>[...t.flatMap(r=>[...xt(r,e,0)]),...Pr(e)],xt=function*(e,t,r){if(r===t.length){yield e;return}let{transform:n=xE}=t[r];for(let s of n(e))yield*xt(s,t,r+1)},Pr=function*(e){for(let[t,{final:r}]of Object.entries(e))yield*SE(r,Number(t),e)},SE=function*(e,t,r){if(e!==void 0)for(let n of e())yield*xt(n,r,t+1)},xE=function*(e){yield e};var bi=({value:e,value:{transform:t,final:r,writableObjectMode:n,readableObjectMode:s},optionName:o},{encoding:i})=>{let a={},c=dd(e,i,o),u=St(t),l=St(r),f=u?gi.bind(void 0,ls,a):yi.bind(void 0,xt),p=u||l?gi.bind(void 0,cd,a):yi.bind(void 0,Pr),d=u||l?ud.bind(void 0,a):void 0;return{stream:new vE({writableObjectMode:n,writableHighWaterMark:fd(n),readableObjectMode:s,readableHighWaterMark:fd(s),transform(T,N,P){f([T,c,0],this,P)},flush(T){p([c],this,T)},destroy:d})}},fs=(e,t,r,n)=>{let s=t.filter(({type:i})=>i==="generator"),o=n?s.reverse():s;for(let{value:i,optionName:a}of o){let c=dd(i,r,a);e=ld(c,e)}return e},dd=({transform:e,final:t,binary:r,writableObjectMode:n,readableObjectMode:s,preserveNewlines:o},i,a)=>{let c={};return[{transform:sd(n,a)},us(r,i,n),cs(r,o,n,c),{transform:e,final:t},{transform:od(s,a)},nd({binary:r,preserveNewlines:o,readableObjectMode:s,state:c})].filter(Boolean)};var pd=(e,t)=>{for(let r of _E(e))EE(e,r,t)},_E=e=>new Set(Object.entries(e).filter(([,{direction:t}])=>t==="input").map(([t])=>Number(t))),EE=(e,t,r)=>{let{stdioItems:n}=e[t],s=n.filter(({contents:a})=>a!==void 0);if(s.length===0)return;if(t!==0){let[{type:a,optionName:c}]=s;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${ct[a]} with synchronous methods.`)}let i=s.map(({contents:a})=>a).map(a=>TE(a,n));r.input=Or(i)},TE=(e,t)=>{let r=fs(e,t,"utf8",!0);return OE(r),Or(r)},OE=e=>{let t=e.find(r=>typeof r!="string"&&!X(r));if(t!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${t}.`)};import{writeFileSync as AE,appendFileSync as IE}from"node:fs";var ds=({stdioItems:e,encoding:t,verboseInfo:r,fdNumber:n})=>n!=="all"&&Ht(r,n)&&!me.has(t)&&RE(n)&&(e.some(({type:s,value:o})=>s==="native"&&kE.has(o))||e.every(({type:s})=>_e.has(s))),RE=e=>e===1||e===2,kE=new Set(["pipe","overlapped"]),md=async(e,t,r,n)=>{for await(let s of e)CE(t)||gd(s,r,n)},hd=(e,t,r)=>{for(let n of e)gd(n,t,r)},CE=e=>e._readableState.pipes.length>0,gd=(e,t,r)=>{let n=Tn(e);je({type:"output",verboseMessage:n,fdNumber:t,verboseInfo:r})};var yd=({fileDescriptors:e,syncResult:{output:t},options:r,isMaxBuffer:n,verboseInfo:s})=>{if(t===null)return{output:Array.from({length:3})};let o={},i=new Set([]);return{output:t.map((c,u)=>$E({result:c,fileDescriptors:e,fdNumber:u,state:o,outputFiles:i,isMaxBuffer:n,verboseInfo:s},r)),...o}},$E=({result:e,fileDescriptors:t,fdNumber:r,state:n,outputFiles:s,isMaxBuffer:o,verboseInfo:i},{buffer:a,encoding:c,lines:u,stripFinalNewline:l,maxBuffer:f})=>{if(e===null)return;let p=bf(e,o,f),d=Ye(p),{stdioItems:b,objectMode:T}=t[r],N=DE([d],b,c,n),{serializedResult:P,finalResult:U=P}=LE({chunks:N,objectMode:T,encoding:c,lines:u,stripFinalNewline:l,fdNumber:r});NE({serializedResult:P,fdNumber:r,state:n,verboseInfo:i,encoding:c,stdioItems:b,objectMode:T});let H=a[r]?U:void 0;try{return n.error===void 0&&PE(P,b,s),H}catch(Y){return n.error=Y,H}},DE=(e,t,r,n)=>{try{return fs(e,t,r,!1)}catch(s){return n.error=s,e}},LE=({chunks:e,objectMode:t,encoding:r,lines:n,stripFinalNewline:s,fdNumber:o})=>{if(t)return{serializedResult:e};if(r==="buffer")return{serializedResult:Or(e)};let i=Ic(e,r);return n[o]?{serializedResult:i,finalResult:hi(i,!s[o],t)}:{serializedResult:i}},NE=({serializedResult:e,fdNumber:t,state:r,verboseInfo:n,encoding:s,stdioItems:o,objectMode:i})=>{if(!ds({stdioItems:o,encoding:s,verboseInfo:n,fdNumber:t}))return;let a=hi(e,!1,i);try{hd(a,t,n)}catch(c){r.error??=c}},PE=(e,t,r)=>{for(let{path:n,append:s}of t.filter(({type:o})=>is.has(o))){let o=typeof n=="string"?n:n.toString();s||r.has(o)?IE(n,e):(r.add(o),AE(n,e))}};var bd=([,e,t],r)=>{if(r.all)return e===void 0?t:t===void 0?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,Je(t,r,"all")]:Array.isArray(t)?[Je(e,r,"all"),...t]:X(e)&&X(t)?Eo([e,t]):`${e}${t}`};import{once as wi}from"node:events";var wd=async(e,t)=>{let[r,n]=await ME(e);return t.isForcefullyTerminated??=!1,[r,n]},ME=async e=>{let[t,r]=await Promise.allSettled([wi(e,"spawn"),wi(e,"exit")]);return t.status==="rejected"?[]:r.status==="rejected"?Sd(e):r.value},Sd=async e=>{try{return await wi(e,"exit")}catch{return Sd(e)}},xd=async e=>{let[t,r]=await e;if(!FE(t,r)&&Si(t,r))throw new Le;return[t,r]},FE=(e,t)=>e===void 0&&t===void 0,Si=(e,t)=>e!==0||t!==null;var vd=({error:e,status:t,signal:r,output:n},{maxBuffer:s})=>{let o=jE(e,t,r),i=o?.code==="ETIMEDOUT",a=yf(o,n,s);return{resultError:o,exitCode:t,signal:r,timedOut:i,isMaxBuffer:a}},jE=(e,t,r)=>e!==void 0?e:Si(t,r)?new Le:void 0;var _d=(e,t,r)=>{let{file:n,commandArguments:s,command:o,escapedCommand:i,startTime:a,verboseInfo:c,options:u,fileDescriptors:l}=UE(e,t,r),f=VE({file:n,commandArguments:s,options:u,command:o,escapedCommand:i,verboseInfo:c,fileDescriptors:l,startTime:a});return nr(f,c,u)},UE=(e,t,r)=>{let{command:n,escapedCommand:s,startTime:o,verboseInfo:i}=Rn(e,t,r),a=GE(r),{file:c,commandArguments:u,options:l}=Hn(e,t,a);qE(l);let f=Qf(l,i);return{file:c,commandArguments:u,command:n,escapedCommand:s,startTime:o,verboseInfo:i,options:l,fileDescriptors:f}},GE=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,qE=({ipc:e,ipcInput:t,detached:r,cancelSignal:n})=>{t&&ps("ipcInput"),e&&ps("ipc: true"),r&&ps("detached: true"),n&&ps("cancelSignal")},ps=e=>{throw new TypeError(`The "${e}" option cannot be used with synchronous methods.`)},VE=({file:e,commandArguments:t,options:r,command:n,escapedCommand:s,verboseInfo:o,fileDescriptors:i,startTime:a})=>{let c=zE({file:e,commandArguments:t,options:r,command:n,escapedCommand:s,fileDescriptors:i,startTime:a});if(c.failed)return c;let{resultError:u,exitCode:l,signal:f,timedOut:p,isMaxBuffer:d}=vd(c,r),{output:b,error:T=u}=yd({fileDescriptors:i,syncResult:c,options:r,isMaxBuffer:d,verboseInfo:o}),N=b.map((U,H)=>Je(U,r,H)),P=Je(bd(b,r),r,"all");return ZE({error:T,exitCode:l,signal:f,timedOut:p,isMaxBuffer:d,stdio:N,all:P,options:r,command:n,escapedCommand:s,startTime:a})},zE=({file:e,commandArguments:t,options:r,command:n,escapedCommand:s,fileDescriptors:o,startTime:i})=>{try{pd(o,r);let a=WE(r);return BE(e,t,a)}catch(a){return rr({error:a,command:n,escapedCommand:s,fileDescriptors:o,options:r,startTime:i,isSync:!0})}},WE=({encoding:e,maxBuffer:t,...r})=>({...r,encoding:"buffer",maxBuffer:rs(t)}),ZE=({error:e,exitCode:t,signal:r,timedOut:n,isMaxBuffer:s,stdio:o,all:i,options:a,command:c,escapedCommand:u,startTime:l})=>e===void 0?ns({command:c,escapedCommand:u,stdio:o,all:i,ipcOutput:[],options:a,startTime:l}):Nr({error:e,command:c,escapedCommand:u,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:s,isForcefullyTerminated:!1,exitCode:t,signal:r,stdio:o,all:i,ipcOutput:[],options:a,startTime:l,isSync:!0});import{setMaxListeners as LT}from"node:events";import{spawn as NT}from"node:child_process";import kd from"node:process";import{once as xi,on as HE}from"node:events";var Ed=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},{reference:s=!0,filter:o}={})=>(Kt({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:Gn(e)}),YE({anyProcess:e,channel:t,isSubprocess:r,filter:o,reference:s})),YE=async({anyProcess:e,channel:t,isSubprocess:r,filter:n,reference:s})=>{Fn(t,s);let o=at(e,t,r),i=new AbortController;try{return await Promise.race([XE(o,n,i),KE(o,r,i),JE(o,r,i)])}catch(a){throw Jt(e),a}finally{i.abort(),jn(t,s)}},XE=async(e,t,{signal:r})=>{if(t===void 0){let[n]=await xi(e,"message",{signal:r});return n}for await(let[n]of HE(e,"message",{signal:r}))if(t(n))return n},KE=async(e,t,{signal:r})=>{await xi(e,"disconnect",{signal:r}),ul(t)},JE=async(e,t,{signal:r})=>{let[n]=await xi(e,"strict:error",{signal:r});throw Nn(n,t)};import{once as Od,on as QE}from"node:events";var Rd=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},{reference:s=!0}={})=>vi({anyProcess:e,channel:t,isSubprocess:r,ipc:n,shouldAwait:!r,reference:s}),vi=({anyProcess:e,channel:t,isSubprocess:r,ipc:n,shouldAwait:s,reference:o})=>{Kt({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:Gn(e)}),Fn(t,o);let i=at(e,t,r),a=new AbortController,c={};return e0(e,i,a),t0({ipcEmitter:i,isSubprocess:r,controller:a,state:c}),r0({anyProcess:e,channel:t,ipcEmitter:i,isSubprocess:r,shouldAwait:s,controller:a,state:c,reference:o})},e0=async(e,t,r)=>{try{await Od(t,"disconnect",{signal:r.signal}),r.abort()}catch{}},t0=async({ipcEmitter:e,isSubprocess:t,controller:r,state:n})=>{try{let[s]=await Od(e,"strict:error",{signal:r.signal});n.error=Nn(s,t),r.abort()}catch{}},r0=async function*({anyProcess:e,channel:t,ipcEmitter:r,isSubprocess:n,shouldAwait:s,controller:o,state:i,reference:a}){try{for await(let[c]of QE(r,"message",{signal:o.signal}))Td(i),yield c}catch{Td(i)}finally{o.abort(),jn(t,a),n||Jt(e),s&&await e}},Td=({error:e})=>{if(e)throw e};var Cd=(e,{ipc:t})=>{Object.assign(e,Id(e,!1,t))},Ad=()=>{let e=kd,t=!0,r=kd.channel!==void 0;return{...Id(e,t,r),getCancelSignal:Pl.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r})}},Id=(e,t,r)=>({sendMessage:Wn.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getOneMessage:Ed.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getEachMessage:Rd.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r})});import{ChildProcess as n0}from"node:child_process";import{PassThrough as s0,Readable as o0,Writable as i0,Duplex as a0}from"node:stream";var $d=({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:s,startTime:o,verboseInfo:i})=>{di(n);let a=new n0;c0(a,n),Object.assign(a,{readable:u0,writable:l0,duplex:f0});let c=rr({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:s,startTime:o,isSync:!1}),u=d0(c,i,s);return{subprocess:a,promise:u}},c0=(e,t)=>{let r=Mr(),n=Mr(),s=Mr(),o=Array.from({length:t.length-3},Mr),i=Mr(),a=[r,n,s,...o];Object.assign(e,{stdin:r,stdout:n,stderr:s,all:i,stdio:a})},Mr=()=>{let e=new s0;return e.end(),e},u0=()=>new o0({read(){}}),l0=()=>new i0({write(){}}),f0=()=>new a0({read(){},write(){}}),d0=async(e,t,r)=>nr(e,t,r);import{createReadStream as Dd,createWriteStream as Ld}from"node:fs";import{Buffer as p0}from"node:buffer";import{Readable as Fr,Writable as m0,Duplex as h0}from"node:stream";var Pd=(e,t)=>as(g0,e,t,!1),jr=({type:e,optionName:t})=>{throw new TypeError(`The \`${t}\` option cannot be ${ct[e]}.`)},Nd={fileNumber:jr,generator:bi,asyncGenerator:bi,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:r}}){let n=t||r;return{stream:h0.fromWeb(e,{objectMode:n})}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},g0={input:{...Nd,fileUrl:({value:e})=>({stream:Dd(e)}),filePath:({value:{file:e}})=>({stream:Dd(e)}),webStream:({value:e})=>({stream:Fr.fromWeb(e)}),iterable:({value:e})=>({stream:Fr.from(e)}),asyncIterable:({value:e})=>({stream:Fr.from(e)}),string:({value:e})=>({stream:Fr.from(e)}),uint8Array:({value:e})=>({stream:Fr.from(p0.from(e))})},output:{...Nd,fileUrl:({value:e})=>({stream:Ld(e)}),filePath:({value:{file:e,append:t}})=>({stream:Ld(e,t?{flags:"a"}:{})}),webStream:({value:e})=>({stream:m0.fromWeb(e)}),iterable:jr,asyncIterable:jr,string:jr,uint8Array:jr}};import{on as y0,once as Md}from"node:events";import{PassThrough as b0,getDefaultHighWaterMark as w0}from"node:stream";import{finished as Bd}from"node:stream/promises";function vt(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(let s of e)Ei(s);let t=e.some(({readableObjectMode:s})=>s),r=S0(e,t),n=new _i({objectMode:t,writableHighWaterMark:r,readableHighWaterMark:r});for(let s of e)n.add(s);return n}var S0=(e,t)=>{if(e.length===0)return w0(t);let r=e.filter(({readableObjectMode:n})=>n===t).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},_i=class extends b0{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#o=Symbol("unpipe");#s=new WeakMap;add(t){if(Ei(t),this.#t.has(t))return;this.#t.add(t),this.#n??=x0(this,this.#t,this.#o);let r=E0({passThroughStream:this,stream:t,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#n,unpipeEvent:this.#o});this.#s.set(t,r),t.pipe(this,{end:!1})}async remove(t){if(Ei(t),!this.#t.has(t))return!1;let r=this.#s.get(t);return r===void 0?!1:(this.#s.delete(t),t.unpipe(this),await r,!0)}},x0=async(e,t,r)=>{ms(e,Fd);let n=new AbortController;try{await Promise.race([v0(e,n),_0(e,t,r,n)])}finally{n.abort(),ms(e,-Fd)}},v0=async(e,{signal:t})=>{try{await Bd(e,{signal:t,cleanup:!0})}catch(r){throw Ud(e,r),r}},_0=async(e,t,r,{signal:n})=>{for await(let[s]of y0(e,"unpipe",{signal:n}))t.has(s)&&s.emit(r)},Ei=e=>{if(typeof e?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},E0=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:s,onFinished:o,unpipeEvent:i})=>{ms(e,jd);let a=new AbortController;try{await Promise.race([T0(o,t,a),O0({passThroughStream:e,stream:t,streams:r,ended:n,aborted:s,controller:a}),R0({stream:t,streams:r,ended:n,aborted:s,unpipeEvent:i,controller:a})])}finally{a.abort(),ms(e,-jd)}r.size>0&&r.size===n.size+s.size&&(n.size===0&&s.size>0?Ti(e):k0(e))},T0=async(e,t,{signal:r})=>{try{await e,r.aborted||Ti(t)}catch(n){r.aborted||Ud(t,n)}},O0=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:s,controller:{signal:o}})=>{try{await Bd(t,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(t)&&n.add(t)}catch(i){if(o.aborted||!r.has(t))return;Gd(i)?s.add(t):qd(e,i)}},R0=async({stream:e,streams:t,ended:r,aborted:n,unpipeEvent:s,controller:{signal:o}})=>{if(await Md(e,s,{signal:o}),!e.readable)return Md(o,"abort",{signal:o});t.delete(e),r.delete(e),n.delete(e)},k0=e=>{e.writable&&e.end()},Ud=(e,t)=>{Gd(t)?Ti(e):qd(e,t)},Gd=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",Ti=e=>{(e.readable||e.writable)&&e.destroy()},qd=(e,t)=>{e.destroyed||(e.once("error",C0),e.destroy(t))},C0=()=>{},ms=(e,t)=>{let r=e.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&e.setMaxListeners(r+t)},Fd=2,jd=1;import{finished as Vd}from"node:stream/promises";var or=(e,t)=>{e.pipe(t),A0(e,t),I0(e,t)},A0=async(e,t)=>{if(!(De(e)||De(t))){try{await Vd(e,{cleanup:!0,readable:!0,writable:!1})}catch{}Oi(t)}},Oi=e=>{e.writable&&e.end()},I0=async(e,t)=>{if(!(De(e)||De(t))){try{await Vd(t,{cleanup:!0,readable:!1,writable:!0})}catch{}Ri(e)}},Ri=e=>{e.readable&&e.destroy()};var zd=(e,t,r)=>{let n=new Map;for(let[s,{stdioItems:o,direction:i}]of Object.entries(t)){for(let{stream:a}of o.filter(({type:c})=>_e.has(c)))$0(e,a,i,s);for(let{stream:a}of o.filter(({type:c})=>!_e.has(c)))L0({subprocess:e,stream:a,direction:i,fdNumber:s,pipeGroups:n,controller:r})}for(let[s,o]of n.entries()){let i=o.length===1?o[0]:vt(o);or(i,s)}},$0=(e,t,r,n)=>{r==="output"?or(e.stdio[n],t):or(t,e.stdio[n]);let s=D0[n];s!==void 0&&(e[s]=t),e.stdio[n]=t},D0=["stdin","stdout","stderr"],L0=({subprocess:e,stream:t,direction:r,fdNumber:n,pipeGroups:s,controller:o})=>{if(t===void 0)return;N0(t,o);let[i,a]=r==="output"?[t,e.stdio[n]]:[e.stdio[n],t],c=s.get(i)??[];s.set(i,[...c,a])},N0=(e,{signal:t})=>{De(e)&&bt(e,P0,t)},P0=2;import{addAbortListener as j0}from"node:events";var _t=[];_t.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&_t.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&_t.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var hs=e=>!!e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function",ki=Symbol.for("signal-exit emitter"),Ci=globalThis,M0=Object.defineProperty.bind(Object),Ai=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Ci[ki])return Ci[ki];M0(Ci,ki,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,r){this.listeners[t].push(r)}removeListener(t,r){let n=this.listeners[t],s=n.indexOf(r);s!==-1&&(s===0&&n.length===1?n.length=0:n.splice(s,1))}emit(t,r,n){if(this.emitted[t])return!1;this.emitted[t]=!0;let s=!1;for(let o of this.listeners[t])s=o(r,n)===!0||s;return t==="exit"&&(s=this.emit("afterExit",r,n)||s),s}},gs=class{},F0=e=>({onExit(t,r){return e.onExit(t,r)},load(){return e.load()},unload(){return e.unload()}}),Ii=class extends gs{onExit(){return()=>{}}load(){}unload(){}},$i=class extends gs{#t=Di.platform==="win32"?"SIGINT":"SIGHUP";#r=new Ai;#e;#n;#o;#s={};#i=!1;constructor(t){super(),this.#e=t,this.#s={};for(let r of _t)this.#s[r]=()=>{let n=this.#e.listeners(r),{count:s}=this.#r,o=t;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(s+=o.__signal_exit_emitter__.count),n.length===s){this.unload();let i=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;i||t.kill(t.pid,a)}};this.#o=t.reallyExit,this.#n=t.emit}onExit(t,r){if(!hs(this.#e))return()=>{};this.#i===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,t),()=>{this.#r.removeListener(n,t),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#i){this.#i=!0,this.#r.count+=1;for(let t of _t)try{let r=this.#s[t];r&&this.#e.on(t,r)}catch{}this.#e.emit=(t,...r)=>this.#c(t,...r),this.#e.reallyExit=t=>this.#a(t)}}unload(){this.#i&&(this.#i=!1,_t.forEach(t=>{let r=this.#s[t];if(!r)throw new Error("Listener not defined for signal: "+t);try{this.#e.removeListener(t,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#o,this.#r.count-=1)}#a(t){return hs(this.#e)?(this.#e.exitCode=t||0,this.#r.emit("exit",this.#e.exitCode,null),this.#o.call(this.#e,this.#e.exitCode)):0}#c(t,...r){let n=this.#n;if(t==="exit"&&hs(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let s=n.call(this.#e,t,...r);return this.#r.emit("exit",this.#e.exitCode,null),s}else return n.call(this.#e,t,...r)}},Di=globalThis.process,{onExit:Wd,load:QB,unload:eU}=F0(hs(Di)?new $i(Di):new Ii);var Zd=(e,{cleanup:t,detached:r},{signal:n})=>{if(!t||r)return;let s=Wd(()=>{e.kill()});j0(n,()=>{s()})};var Yd=({source:e,sourcePromise:t,boundOptions:r,createNested:n},...s)=>{let o=On(),{destination:i,destinationStream:a,destinationError:c,from:u,unpipeSignal:l}=B0(r,n,s),{sourceStream:f,sourceError:p}=G0(e,u),{options:d,fileDescriptors:b}=Ue.get(e);return{sourcePromise:t,sourceStream:f,sourceOptions:d,sourceError:p,destination:i,destinationStream:a,destinationError:c,unpipeSignal:l,fileDescriptors:b,startTime:o}},B0=(e,t,r)=>{try{let{destination:n,pipeOptions:{from:s,to:o,unpipeSignal:i}={}}=U0(e,t,...r),a=Mn(n,o);return{destination:n,destinationStream:a,from:s,unpipeSignal:i}}catch(n){return{destinationError:n}}},U0=(e,t,r,...n)=>{if(Array.isArray(r))return{destination:t(Hd,e)(r,...n),pipeOptions:e};if(typeof r=="string"||r instanceof URL||vo(r)){if(Object.keys(e).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[s,o,i]=gn(r,...n);return{destination:t(Hd)(s,o,i),pipeOptions:i}}if(Ue.has(r)){if(Object.keys(e).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},Hd=({options:e})=>({options:{...e,stdin:"pipe",piped:!0}}),G0=(e,t)=>{try{return{sourceStream:Qt(e,t)}}catch(r){return{sourceError:r}}};var Kd=({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n,fileDescriptors:s,sourceOptions:o,startTime:i})=>{let a=q0({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n});if(a!==void 0)throw Li({error:a,fileDescriptors:s,sourceOptions:o,startTime:i})},q0=({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n})=>{if(t!==void 0&&n!==void 0)return n;if(n!==void 0)return Ri(e),n;if(t!==void 0)return Oi(r),t},Li=({error:e,fileDescriptors:t,sourceOptions:r,startTime:n})=>rr({error:e,command:Xd,escapedCommand:Xd,fileDescriptors:t,options:r,startTime:n,isSync:!1}),Xd="source.pipe(destination)";var Jd=async e=>{let[{status:t,reason:r,value:n=r},{status:s,reason:o,value:i=o}]=await e;if(i.pipedFrom.includes(n)||i.pipedFrom.push(n),s==="rejected")throw i;if(t==="rejected")throw n;return i};import{finished as V0}from"node:stream/promises";var Qd=(e,t,r)=>{let n=ys.has(t)?W0(e,t):z0(e,t);return bt(e,H0,r.signal),bt(t,Y0,r.signal),Z0(t),n},z0=(e,t)=>{let r=vt([e]);return or(r,t),ys.set(t,r),r},W0=(e,t)=>{let r=ys.get(t);return r.add(e),r},Z0=async e=>{try{await V0(e,{cleanup:!0,readable:!1,writable:!0})}catch{}ys.delete(e)},ys=new WeakMap,H0=2,Y0=1;import{aborted as X0}from"node:util";var ep=(e,t)=>e===void 0?[]:[K0(e,t)],K0=async(e,{sourceStream:t,mergedStream:r,fileDescriptors:n,sourceOptions:s,startTime:o})=>{await X0(e,t),await r.remove(t);let i=new Error("Pipe canceled by `unpipeSignal` option.");throw Li({error:i,fileDescriptors:n,sourceOptions:s,startTime:o})};var bs=(e,...t)=>{if(z(t[0]))return bs.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});let{destination:r,...n}=Yd(e,...t),s=J0({...n,destination:r});return s.pipe=bs.bind(void 0,{...e,source:r,sourcePromise:s,boundOptions:{}}),s},J0=async({sourcePromise:e,sourceStream:t,sourceOptions:r,sourceError:n,destination:s,destinationStream:o,destinationError:i,unpipeSignal:a,fileDescriptors:c,startTime:u})=>{let l=Q0(e,s);Kd({sourceStream:t,sourceError:n,destinationStream:o,destinationError:i,fileDescriptors:c,sourceOptions:r,startTime:u});let f=new AbortController;try{let p=Qd(t,o,f);return await Promise.race([Jd(l),...ep(a,{sourceStream:t,mergedStream:p,sourceOptions:r,fileDescriptors:c,startTime:u})])}finally{f.abort()}},Q0=(e,t)=>Promise.allSettled([e,t]);import{setImmediate as iT}from"node:timers/promises";import{on as eT}from"node:events";import{getDefaultHighWaterMark as tT}from"node:stream";var ws=({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:n,encoding:s,preserveNewlines:o})=>{let i=new AbortController;return rT(t,i),rp({stream:e,controller:i,binary:r,shouldEncode:!e.readableObjectMode&&n,encoding:s,shouldSplit:!e.readableObjectMode,preserveNewlines:o})},rT=async(e,t)=>{try{await e}catch{}finally{t.abort()}},Ni=({stream:e,onStreamEnd:t,lines:r,encoding:n,stripFinalNewline:s,allMixed:o})=>{let i=new AbortController;nT(t,i,e);let a=e.readableObjectMode&&!o;return rp({stream:e,controller:i,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!s})},nT=async(e,t,r)=>{try{await e}catch{r.destroy()}finally{t.abort()}},rp=({stream:e,controller:t,binary:r,shouldEncode:n,encoding:s,shouldSplit:o,preserveNewlines:i})=>{let a=eT(e,"data",{signal:t.signal,highWaterMark:tp,highWatermark:tp});return sT({onStdoutChunk:a,controller:t,binary:r,shouldEncode:n,encoding:s,shouldSplit:o,preserveNewlines:i})},Pi=tT(!0),tp=Pi,sT=async function*({onStdoutChunk:e,controller:t,binary:r,shouldEncode:n,encoding:s,shouldSplit:o,preserveNewlines:i}){let a=oT({binary:r,shouldEncode:n,encoding:s,shouldSplit:o,preserveNewlines:i});try{for await(let[c]of e)yield*xt(c,a,0)}catch(c){if(!t.signal.aborted)throw c}finally{yield*Pr(a)}},oT=({binary:e,shouldEncode:t,encoding:r,shouldSplit:n,preserveNewlines:s})=>[us(e,r,!t),cs(e,s,!n,{})].filter(Boolean);var np=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,buffer:s,maxBuffer:o,lines:i,allMixed:a,stripFinalNewline:c,verboseInfo:u,streamInfo:l})=>{let f=aT({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,allMixed:a,verboseInfo:u,streamInfo:l});if(!s){await Promise.all([cT(e),f]);return}let p=pi(c,r),d=Ni({stream:e,onStreamEnd:t,lines:i,encoding:n,stripFinalNewline:p,allMixed:a}),[b]=await Promise.all([uT({stream:e,iterable:d,fdNumber:r,encoding:n,maxBuffer:o,lines:i}),f]);return b},aT=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,allMixed:s,verboseInfo:o,streamInfo:{fileDescriptors:i}})=>{if(!ds({stdioItems:i[r]?.stdioItems,encoding:n,verboseInfo:o,fdNumber:r}))return;let a=Ni({stream:e,onStreamEnd:t,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:s});await md(a,e,r,o)},cT=async e=>{await iT(),e.readableFlowing===null&&e.resume()},uT=async({stream:e,stream:{readableObjectMode:t},iterable:r,fdNumber:n,encoding:s,maxBuffer:o,lines:i})=>{try{return t||i?await Jn(r,{maxBuffer:o}):s==="buffer"?new Uint8Array(await Qn(r,{maxBuffer:o})):await ts(r,{maxBuffer:o})}catch(a){return sp(mf({error:a,stream:e,readableObjectMode:t,lines:i,encoding:s,fdNumber:n}))}},Mi=async e=>{try{return await e}catch(t){return sp(t)}},sp=({bufferedData:e})=>Cc(e)?new Uint8Array(e):e;import{finished as lT}from"node:stream/promises";var Br=async(e,t,r,{isSameDirection:n,stopOnExit:s=!1}={})=>{let o=fT(e,r),i=new AbortController;try{await Promise.race([...s?[r.exitPromise]:[],lT(e,{cleanup:!0,signal:i.signal})])}catch(a){o.stdinCleanedUp||mT(a,t,r,n)}finally{i.abort()}},fT=(e,{originalStreams:[t],subprocess:r})=>{let n={stdinCleanedUp:!1};return e===t&&dT(e,r,n),n},dT=(e,t,r)=>{let{_destroy:n}=e;e._destroy=(...s)=>{pT(t,r),n.call(e,...s)}},pT=({exitCode:e,signalCode:t},r)=>{(e!==null||t!==null)&&(r.stdinCleanedUp=!0)},mT=(e,t,r,n)=>{if(!hT(e,t,r,n))throw e},hT=(e,t,r,n=!0)=>r.propagating?op(e)||Ss(e):(r.propagating=!0,Fi(r,t)===n?op(e):Ss(e)),Fi=({fileDescriptors:e},t)=>t!=="all"&&e[t].direction==="input",Ss=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",op=e=>e?.code==="EPIPE";var ip=({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:s,stripFinalNewline:o,verboseInfo:i,streamInfo:a})=>e.stdio.map((c,u)=>ji({stream:c,fdNumber:u,encoding:t,buffer:r[u],maxBuffer:n[u],lines:s[u],allMixed:!1,stripFinalNewline:o,verboseInfo:i,streamInfo:a})),ji=async({stream:e,fdNumber:t,encoding:r,buffer:n,maxBuffer:s,lines:o,allMixed:i,stripFinalNewline:a,verboseInfo:c,streamInfo:u})=>{if(!e)return;let l=Br(e,t,u);if(Fi(u,t)){await l;return}let[f]=await Promise.all([np({stream:e,onStreamEnd:l,fdNumber:t,encoding:r,buffer:n,maxBuffer:s,lines:o,allMixed:i,stripFinalNewline:a,verboseInfo:c,streamInfo:u}),l]);return f};var ap=({stdout:e,stderr:t},{all:r})=>r&&(e||t)?vt([e,t].filter(Boolean)):void 0,cp=({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:s,stripFinalNewline:o,verboseInfo:i,streamInfo:a})=>ji({...gT(e,r),fdNumber:"all",encoding:t,maxBuffer:n[1]+n[2],lines:s[1]||s[2],allMixed:yT(e),stripFinalNewline:o,verboseInfo:i,streamInfo:a}),gT=({stdout:e,stderr:t,all:r},[,n,s])=>{let o=n||s;return o?n?s?{stream:r,buffer:o}:{stream:e,buffer:o}:{stream:t,buffer:o}:{stream:r,buffer:o}},yT=({all:e,stdout:t,stderr:r})=>e&&t&&r&&t.readableObjectMode!==r.readableObjectMode;import{once as bT}from"node:events";var up=e=>Ht(e,"ipc"),lp=(e,t)=>{let r=Tn(e);je({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:t})};var fp=async({subprocess:e,buffer:t,maxBuffer:r,ipc:n,ipcOutput:s,verboseInfo:o})=>{if(!n)return s;let i=up(o),a=Xe(t,"ipc"),c=Xe(r,"ipc");for await(let u of vi({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(hf(e,s,c),s.push(u)),i&&lp(u,o);return s},dp=async(e,t)=>(await Promise.allSettled([e]),t);var pp=async({subprocess:e,options:{encoding:t,buffer:r,maxBuffer:n,lines:s,timeoutDuration:o,cancelSignal:i,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:u,ipc:l,ipcInput:f},context:p,verboseInfo:d,fileDescriptors:b,originalStreams:T,onInternalError:N,controller:P})=>{let U=wd(e,p),H={originalStreams:T,fileDescriptors:b,subprocess:e,exitPromise:U,propagating:!1},Y=ip({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:s,stripFinalNewline:u,verboseInfo:d,streamInfo:H}),Se=cp({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:s,stripFinalNewline:u,verboseInfo:d,streamInfo:H}),ae=[],Ae=fp({subprocess:e,buffer:r,maxBuffer:n,ipc:l,ipcOutput:ae,verboseInfo:d}),Ie=wT(T,e,H),xe=ST(b,H);try{return await Promise.race([Promise.all([{},xd(U),Promise.all(Y),Se,Ae,Wl(e,f),...Ie,...xe]),N,xT(e,P),...Ul(e,o,p,P),...cl({subprocess:e,cancelSignal:i,gracefulCancel:a,context:p,controller:P}),...jl({subprocess:e,cancelSignal:i,gracefulCancel:a,forceKillAfterDelay:c,context:p,controller:P})])}catch(Er){return p.terminationReason??="other",Promise.all([{error:Er},U,Promise.all(Y.map(ht=>Mi(ht))),Mi(Se),dp(Ae,ae),Promise.allSettled(Ie),Promise.allSettled(xe)])}},wT=(e,t,r)=>e.map((n,s)=>n===t.stdio[s]?void 0:Br(n,s,r)),ST=(e,t)=>e.flatMap(({stdioItems:r},n)=>r.filter(({value:s,stream:o=s})=>Pe(o,{checkOpen:!1})&&!De(o)).map(({type:s,value:o,stream:i=o})=>Br(i,n,t,{isSameDirection:_e.has(s),stopOnExit:s==="native"}))),xT=async(e,{signal:t})=>{let[r]=await bT(e,"error",{signal:t});throw r};var mp=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),Ur=(e,t,r)=>{let n=e[r];n.has(t)||n.set(t,[]);let s=n.get(t),o=Be();return s.push(o),{resolve:o.resolve.bind(o),promises:s}},ir=async({resolve:e,promises:t},r)=>{e();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...t])]);return!n};import{Readable as vT}from"node:stream";import{callbackify as _T}from"node:util";import{finished as hp}from"node:stream/promises";var Bi=async e=>{if(e!==void 0)try{await Ui(e)}catch{}},gp=async e=>{if(e!==void 0)try{await Gi(e)}catch{}},Ui=async e=>{await hp(e,{cleanup:!0,readable:!1,writable:!0})},Gi=async e=>{await hp(e,{cleanup:!0,readable:!0,writable:!1})},xs=async(e,t)=>{if(await e,t)throw t},vs=(e,t,r)=>{r&&!Ss(r)?e.destroy(r):t&&e.destroy()};var yp=({subprocess:e,concurrentStreams:t,encoding:r},{from:n,binary:s=!0,preserveNewlines:o=!0}={})=>{let i=s||me.has(r),{subprocessStdout:a,waitReadableDestroy:c}=qi(e,n,t),{readableEncoding:u,readableObjectMode:l,readableHighWaterMark:f}=Vi(a,i),{read:p,onStdoutDataDone:d}=zi({subprocessStdout:a,subprocess:e,binary:i,encoding:r,preserveNewlines:o}),b=new vT({read:p,destroy:_T(Zi.bind(void 0,{subprocessStdout:a,subprocess:e,waitReadableDestroy:c})),highWaterMark:f,objectMode:l,encoding:u});return Wi({subprocessStdout:a,onStdoutDataDone:d,readable:b,subprocess:e}),b},qi=(e,t,r)=>{let n=Qt(e,t),s=Ur(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:s}},Vi=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r},n)=>n?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:Pi},zi=({subprocessStdout:e,subprocess:t,binary:r,encoding:n,preserveNewlines:s})=>{let o=Be(),i=ws({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:s});return{read(){ET(this,i,o)},onStdoutDataDone:o}},ET=async(e,t,r)=>{try{let{value:n,done:s}=await t.next();s?r.resolve():e.push(n)}catch{}},Wi=async({subprocessStdout:e,onStdoutDataDone:t,readable:r,subprocess:n,subprocessStdin:s})=>{try{await Gi(e),await n,await Bi(s),await t,r.readable&&r.push(null)}catch(o){await Bi(s),bp(r,o)}},Zi=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:r},n)=>{await ir(r,t)&&(bp(e,n),await xs(t,n))},bp=(e,t)=>{vs(e,e.readable,t)};import{Writable as TT}from"node:stream";import{callbackify as wp}from"node:util";var Sp=({subprocess:e,concurrentStreams:t},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:s,waitWritableDestroy:o}=Hi(e,r,t),i=new TT({...Yi(n,e,s),destroy:wp(Ki.bind(void 0,{subprocessStdin:n,subprocess:e,waitWritableFinal:s,waitWritableDestroy:o})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return Xi(n,i),i},Hi=(e,t,r)=>{let n=Mn(e,t),s=Ur(r,n,"writableFinal"),o=Ur(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:s,waitWritableDestroy:o}},Yi=(e,t,r)=>({write:OT.bind(void 0,e),final:wp(RT.bind(void 0,e,t,r))}),OT=(e,t,r,n)=>{e.write(t,r)?n():e.once("drain",n)},RT=async(e,t,r)=>{await ir(r,t)&&(e.writable&&e.end(),await t)},Xi=async(e,t,r)=>{try{await Ui(e),t.writable&&t.end()}catch(n){await gp(r),xp(t,n)}},Ki=async({subprocessStdin:e,subprocess:t,waitWritableFinal:r,waitWritableDestroy:n},s)=>{await ir(r,t),await ir(n,t)&&(xp(e,s),await xs(t,s))},xp=(e,t)=>{vs(e,e.writable,t)};import{Duplex as kT}from"node:stream";import{callbackify as CT}from"node:util";var vp=({subprocess:e,concurrentStreams:t,encoding:r},{from:n,to:s,binary:o=!0,preserveNewlines:i=!0}={})=>{let a=o||me.has(r),{subprocessStdout:c,waitReadableDestroy:u}=qi(e,n,t),{subprocessStdin:l,waitWritableFinal:f,waitWritableDestroy:p}=Hi(e,s,t),{readableEncoding:d,readableObjectMode:b,readableHighWaterMark:T}=Vi(c,a),{read:N,onStdoutDataDone:P}=zi({subprocessStdout:c,subprocess:e,binary:a,encoding:r,preserveNewlines:i}),U=new kT({read:N,...Yi(l,e,f),destroy:CT(AT.bind(void 0,{subprocessStdout:c,subprocessStdin:l,subprocess:e,waitReadableDestroy:u,waitWritableFinal:f,waitWritableDestroy:p})),readableHighWaterMark:T,writableHighWaterMark:l.writableHighWaterMark,readableObjectMode:b,writableObjectMode:l.writableObjectMode,encoding:d});return Wi({subprocessStdout:c,onStdoutDataDone:P,readable:U,subprocess:e,subprocessStdin:l}),Xi(l,U,c),U},AT=async({subprocessStdout:e,subprocessStdin:t,subprocess:r,waitReadableDestroy:n,waitWritableFinal:s,waitWritableDestroy:o},i)=>{await Promise.all([Zi({subprocessStdout:e,subprocess:r,waitReadableDestroy:n},i),Ki({subprocessStdin:t,subprocess:r,waitWritableFinal:s,waitWritableDestroy:o},i)])};var Ji=(e,t,{from:r,binary:n=!1,preserveNewlines:s=!1}={})=>{let o=n||me.has(t),i=Qt(e,r),a=ws({subprocessStdout:i,subprocess:e,binary:o,shouldEncode:!0,encoding:t,preserveNewlines:s});return IT(a,i,e)},IT=async function*(e,t,r){try{yield*e}finally{t.readable&&t.destroy(),await r}};var _p=(e,{encoding:t})=>{let r=mp();e.readable=yp.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.writable=Sp.bind(void 0,{subprocess:e,concurrentStreams:r}),e.duplex=vp.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.iterable=Ji.bind(void 0,e,t),e[Symbol.asyncIterator]=Ji.bind(void 0,e,t,{})};var Ep=(e,t)=>{for(let[r,n]of DT){let s=n.value.bind(t);Reflect.defineProperty(e,r,{...n,value:s})}},$T=(async()=>{})().constructor.prototype,DT=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor($T,e)]);var Tp=(e,t,r,n)=>{let{file:s,commandArguments:o,command:i,escapedCommand:a,startTime:c,verboseInfo:u,options:l,fileDescriptors:f}=PT(e,t,r),{subprocess:p,promise:d}=FT({file:s,commandArguments:o,options:l,startTime:c,verboseInfo:u,command:i,escapedCommand:a,fileDescriptors:f});return p.pipe=bs.bind(void 0,{source:p,sourcePromise:d,boundOptions:{},createNested:n}),Ep(p,d),Ue.set(p,{options:l,fileDescriptors:f}),p},PT=(e,t,r)=>{let{command:n,escapedCommand:s,startTime:o,verboseInfo:i}=Rn(e,t,r),{file:a,commandArguments:c,options:u}=Hn(e,t,r),l=MT(u),f=Pd(l,i);return{file:a,commandArguments:c,command:n,escapedCommand:s,startTime:o,verboseInfo:i,options:l,fileDescriptors:f}},MT=({timeout:e,signal:t,...r})=>{if(t!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:e}},FT=({file:e,commandArguments:t,options:r,startTime:n,verboseInfo:s,command:o,escapedCommand:i,fileDescriptors:a})=>{let c;try{c=NT(e,t,r)}catch(b){return $d({error:b,command:o,escapedCommand:i,fileDescriptors:a,options:r,startTime:n,verboseInfo:s})}let u=new AbortController;LT(Number.POSITIVE_INFINITY,u.signal);let l=[...c.stdio];zd(c,a,u),Zd(c,r,u);let f={},p=Be();c.kill=il.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:p,context:f,controller:u}),c.all=ap(c,r),_p(c,r),Cd(c,r);let d=jT({subprocess:c,options:r,startTime:n,verboseInfo:s,fileDescriptors:a,originalStreams:l,command:o,escapedCommand:i,context:f,onInternalError:p,controller:u});return{subprocess:c,promise:d}},jT=async({subprocess:e,options:t,startTime:r,verboseInfo:n,fileDescriptors:s,originalStreams:o,command:i,escapedCommand:a,context:c,onInternalError:u,controller:l})=>{let[f,[p,d],b,T,N]=await pp({subprocess:e,options:t,context:c,verboseInfo:n,fileDescriptors:s,originalStreams:o,onInternalError:u,controller:l});l.abort(),u.resolve();let P=b.map((Y,Se)=>Je(Y,t,Se)),U=Je(T,t,"all"),H=BT({errorInfo:f,exitCode:p,signal:d,stdio:P,all:U,ipcOutput:N,context:c,options:t,command:i,escapedCommand:a,startTime:r});return nr(H,n,t)},BT=({errorInfo:e,exitCode:t,signal:r,stdio:n,all:s,ipcOutput:o,context:i,options:a,command:c,escapedCommand:u,startTime:l})=>"error"in e?Nr({error:e.error,command:c,escapedCommand:u,timedOut:i.terminationReason==="timeout",isCanceled:i.terminationReason==="cancel"||i.terminationReason==="gracefulCancel",isGracefullyCanceled:i.terminationReason==="gracefulCancel",isMaxBuffer:e.error instanceof Ge,isForcefullyTerminated:i.isForcefullyTerminated,exitCode:t,signal:r,stdio:n,all:s,ipcOutput:o,options:a,startTime:l,isSync:!1}):ns({command:c,escapedCommand:u,stdio:n,all:s,ipcOutput:o,options:a,startTime:l});var _s=(e,t)=>{let r=Object.fromEntries(Object.entries(t).map(([n,s])=>[n,UT(n,e[n],s)]));return{...e,...r}},UT=(e,t,r)=>GT.has(e)&&z(t)&&z(r)?{...t,...r}:r,GT=new Set(["env",...ko]);var ut=(e,t,r,n)=>{let s=(i,a,c)=>ut(i,a,r,c),o=(...i)=>qT({mapArguments:e,deepOptions:r,boundOptions:t,setBoundExeca:n,createNested:s},...i);return n!==void 0&&n(o,s,t),o},qT=({mapArguments:e,deepOptions:t={},boundOptions:r={},setBoundExeca:n,createNested:s},o,...i)=>{if(z(o))return s(e,_s(r,o),n);let{file:a,commandArguments:c,options:u,isSync:l}=VT({mapArguments:e,firstArgument:o,nextArguments:i,deepOptions:t,boundOptions:r});return l?_d(a,c,u):Tp(a,c,u,s)},VT=({mapArguments:e,firstArgument:t,nextArguments:r,deepOptions:n,boundOptions:s})=>{let o=Nc(t)?Pc(t,r):[t,...r],[i,a,c]=gn(...o),u=_s(_s(n,s),c),{file:l=i,commandArguments:f=a,options:p=u,isSync:d=!1}=e({file:i,commandArguments:a,options:u});return{file:l,commandArguments:f,options:p,isSync:d}};var Op=({file:e,commandArguments:t})=>kp(e,t),Rp=({file:e,commandArguments:t})=>({...kp(e,t),isSync:!0}),kp=(e,t)=>{if(t.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${e} ${t}.`);let[r,...n]=zT(e);return{file:r,commandArguments:n}},zT=e=>{if(typeof e!="string")throw new TypeError(`The command must be a string: ${String(e)}.`);let t=e.trim();if(t==="")return[];let r=[];for(let n of t.split(WT)){let s=r.at(-1);s&&s.endsWith("\\")?r[r.length-1]=`${s.slice(0,-1)} ${n}`:r.push(n)}return r},WT=/ +/g;var Cp=(e,t,r)=>{e.sync=t(ZT,r),e.s=e.sync},Ap=({options:e})=>Ip(e),ZT=({options:e})=>({...Ip(e),isSync:!0}),Ip=e=>({options:{...HT(e),...e}}),HT=({input:e,inputFile:t,stdio:r})=>e===void 0&&t===void 0&&r===void 0?{stdin:"inherit"}:{},$p={preferLocal:!0};var G9=ut(()=>({})),q9=ut(()=>({isSync:!0})),V9=ut(Op),z9=ut(Rp),Dp=ut(ql),W9=ut(Ap,{},$p,Cp),{sendMessage:Z9,getOneMessage:H9,getEachMessage:Y9,getCancelSignal:X9}=Ad();var yo=gt(Eh(),1);import{readdirSync as q$}from"fs";import{createRequire as V$}from"module";import{dirname as z$,resolve as Sc}from"path";var M;(function(e){e.assertEqual=s=>s;function t(s){}e.assertIs=t;function r(s){throw new Error}e.assertNever=r,e.arrayToEnum=s=>{let o={};for(let i of s)o[i]=i;return o},e.getValidEnumValues=s=>{let o=e.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),i={};for(let a of o)i[a]=s[a];return e.objectValues(i)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let o=[];for(let i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},e.find=(s,o)=>{for(let i of s)if(o(i))return i},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function n(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(M||(M={}));var ba;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(ba||(ba={}));var S=M.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),et=e=>{switch(typeof e){case"undefined":return S.undefined;case"string":return S.string;case"number":return isNaN(e)?S.nan:S.number;case"boolean":return S.boolean;case"function":return S.function;case"bigint":return S.bigint;case"symbol":return S.symbol;case"object":return Array.isArray(e)?S.array:e===null?S.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?S.promise:typeof Map<"u"&&e instanceof Map?S.map:typeof Set<"u"&&e instanceof Set?S.set:typeof Date<"u"&&e instanceof Date?S.date:S.object;default:return S.unknown}},m=M.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Vk=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),he=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(o){return o.message},n={_errors:[]},s=o=>{for(let i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let a=n,c=0;for(;c<i.path.length;){let u=i.path[c];c===i.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(i))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return s(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,M.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let s of this.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(t(s))):n.push(t(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};he.create=e=>new he(e);var fr=(e,t)=>{let r;switch(e.code){case m.invalid_type:e.received===S.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case m.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,M.jsonStringifyReplacer)}`;break;case m.unrecognized_keys:r=`Unrecognized key(s) in object: ${M.joinValues(e.keys,", ")}`;break;case m.invalid_union:r="Invalid input";break;case m.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${M.joinValues(e.options)}`;break;case m.invalid_enum_value:r=`Invalid enum value. Expected ${M.joinValues(e.options)}, received '${e.received}'`;break;case m.invalid_arguments:r="Invalid function arguments";break;case m.invalid_return_type:r="Invalid function return type";break;case m.invalid_date:r="Invalid date";break;case m.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:M.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case m.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case m.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case m.custom:r="Invalid input";break;case m.invalid_intersection_types:r="Intersection results could not be merged";break;case m.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case m.not_finite:r="Number must be finite";break;default:r=t.defaultError,M.assertNever(e)}return{message:r}},Rh=fr;function zk(e){Rh=e}function Ns(){return Rh}var Ps=e=>{let{data:t,path:r,errorMaps:n,issueData:s}=e,o=[...r,...s.path||[]],i={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let a="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)a=u(i,{data:t,defaultError:a}).message;return{...s,path:o,message:a}},Wk=[];function y(e,t){let r=Ns(),n=Ps({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===fr?void 0:fr].filter(s=>!!s)});e.common.issues.push(n)}var ee=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let s of r){if(s.status==="aborted")return k;s.status==="dirty"&&t.dirty(),n.push(s.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let s of r){let o=await s.key,i=await s.value;n.push({key:o,value:i})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let s of r){let{key:o,value:i}=s;if(o.status==="aborted"||i.status==="aborted")return k;o.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(n[o.value]=i.value)}return{status:t.value,value:n}}},k=Object.freeze({status:"aborted"}),lr=e=>({status:"dirty",value:e}),oe=e=>({status:"valid",value:e}),wa=e=>e.status==="aborted",Sa=e=>e.status==="dirty",Tt=e=>e.status==="valid",Kr=e=>typeof Promise<"u"&&e instanceof Promise;function Ms(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)}function kh(e,t,r,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(e,r):s?s.value=r:t.set(e,r),r}var _;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(_||(_={}));var Yr,Xr,Re=class{constructor(t,r,n,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Th=(e,t)=>{if(Tt(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new he(e.common.issues);return this._error=r,this._error}}};function $(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:s}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(i,a)=>{var c,u;let{message:l}=e;return i.code==="invalid_enum_value"?{message:l??a.defaultError}:typeof a.data>"u"?{message:(c=l??n)!==null&&c!==void 0?c:a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:(u=l??r)!==null&&u!==void 0?u:a.defaultError}},description:s}}var D=class{get description(){return this._def.description}_getType(t){return et(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:et(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ee,ctx:{common:t.parent.common,data:t.data,parsedType:et(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(Kr(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var n;let s={common:{issues:[],async:(n=r?.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:et(t)},o=this._parseSync({data:t,path:s.path,parent:s});return Th(s,o)}"~validate"(t){var r,n;let s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:et(t)};if(!this["~standard"].async)try{let o=this._parseSync({data:t,path:[],parent:s});return Tt(o)?{value:o.value}:{issues:s.common.issues}}catch(o){!((n=(r=o?.message)===null||r===void 0?void 0:r.toLowerCase())===null||n===void 0)&&n.includes("encountered")&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:s}).then(o=>Tt(o)?{value:o.value}:{issues:s.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:et(t)},s=this._parse({data:t,path:n.path,parent:n}),o=await(Kr(s)?s:Promise.resolve(s));return Th(n,o)}refine(t,r){let n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,o)=>{let i=t(s),a=()=>o.addIssue({code:m.custom,...n(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(t,r){return this._refinement((n,s)=>t(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(t){return new ge({schema:this,typeName:R.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Oe.create(this,this._def)}nullable(){return We.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return rt.create(this)}promise(){return dt.create(this,this._def)}or(t){return $t.create([this,t],this._def)}and(t){return Dt.create(this,t,this._def)}transform(t){return new ge({...$(this._def),schema:this,typeName:R.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Ft({...$(this._def),innerType:this,defaultValue:r,typeName:R.ZodDefault})}brand(){return new Jr({typeName:R.ZodBranded,type:this,...$(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new jt({...$(this._def),innerType:this,catchValue:r,typeName:R.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Qr.create(this,t)}readonly(){return Bt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Zk=/^c[^\s-]{8,}$/i,Hk=/^[0-9a-z]+$/,Yk=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Xk=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Kk=/^[a-z0-9_-]{21}$/i,Jk=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Qk=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,eC=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,tC="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",ya,rC=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,nC=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,sC=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,oC=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,iC=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,aC=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ch="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",cC=new RegExp(`^${Ch}$`);function Ah(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function uC(e){return new RegExp(`^${Ah(e)}$`)}function Ih(e){let t=`${Ch}T${Ah(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function lC(e,t){return!!((t==="v4"||!t)&&rC.test(e)||(t==="v6"||!t)&&sC.test(e))}function fC(e,t){if(!Jk.test(e))return!1;try{let[r]=e.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||!s.typ||!s.alg||t&&s.alg!==t)}catch{return!1}}function dC(e,t){return!!((t==="v4"||!t)&&nC.test(e)||(t==="v6"||!t)&&oC.test(e))}var lt=class e extends D{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==S.string){let o=this._getOrReturnCtx(t);return y(o,{code:m.invalid_type,expected:S.string,received:o.parsedType}),k}let n=new ee,s;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(s=this._getOrReturnCtx(t,s),y(s,{code:m.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")t.data.length>o.value&&(s=this._getOrReturnCtx(t,s),y(s,{code:m.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let i=t.data.length>o.value,a=t.data.length<o.value;(i||a)&&(s=this._getOrReturnCtx(t,s),i?y(s,{code:m.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&y(s,{code:m.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")eC.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"email",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")ya||(ya=new RegExp(tC,"u")),ya.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"emoji",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")Xk.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"uuid",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")Kk.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"nanoid",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")Zk.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"cuid",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")Hk.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"cuid2",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")Yk.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"ulid",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),y(s,{validation:"url",code:m.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"regex",code:m.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(s=this._getOrReturnCtx(t,s),y(s,{code:m.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(s=this._getOrReturnCtx(t,s),y(s,{code:m.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(s=this._getOrReturnCtx(t,s),y(s,{code:m.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?Ih(o).test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{code:m.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?cC.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{code:m.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?uC(o).test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{code:m.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?Qk.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"duration",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?lC(t.data,o.version)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"ip",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?fC(t.data,o.alg)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"jwt",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?dC(t.data,o.version)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"cidr",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?iC.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"base64",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?aC.test(t.data)||(s=this._getOrReturnCtx(t,s),y(s,{validation:"base64url",code:m.invalid_string,message:o.message}),n.dirty()):M.assertNever(o);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(s=>t.test(s),{validation:r,code:m.invalid_string,..._.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",..._.errToObj(t)})}url(t){return this._addCheck({kind:"url",..._.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",..._.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",..._.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",..._.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",..._.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",..._.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",..._.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",..._.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",..._.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",..._.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",..._.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",..._.errToObj(t)})}datetime(t){var r,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:(r=t?.offset)!==null&&r!==void 0?r:!1,local:(n=t?.local)!==null&&n!==void 0?n:!1,..._.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,..._.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",..._.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,..._.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,..._.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,..._.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,..._.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,..._.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,..._.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,..._.errToObj(r)})}nonempty(t){return this.min(1,_.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};lt.create=e=>{var t;return new lt({checks:[],typeName:R.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...$(e)})};function pC(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,o=parseInt(e.toFixed(s).replace(".","")),i=parseInt(t.toFixed(s).replace(".",""));return o%i/Math.pow(10,s)}var Ot=class e extends D{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==S.number){let o=this._getOrReturnCtx(t);return y(o,{code:m.invalid_type,expected:S.number,received:o.parsedType}),k}let n,s=new ee;for(let o of this._def.checks)o.kind==="int"?M.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),y(n,{code:m.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),y(n,{code:m.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),y(n,{code:m.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?pC(t.data,o.value)!==0&&(n=this._getOrReturnCtx(t,n),y(n,{code:m.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),y(n,{code:m.not_finite,message:o.message}),s.dirty()):M.assertNever(o);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,_.toString(r))}gt(t,r){return this.setLimit("min",t,!1,_.toString(r))}lte(t,r){return this.setLimit("max",t,!0,_.toString(r))}lt(t,r){return this.setLimit("max",t,!1,_.toString(r))}setLimit(t,r,n,s){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:_.toString(s)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:_.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:_.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:_.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:_.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:_.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:_.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:_.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:_.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:_.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&M.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};Ot.create=e=>new Ot({checks:[],typeName:R.ZodNumber,coerce:e?.coerce||!1,...$(e)});var Rt=class e extends D{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==S.bigint)return this._getInvalidInput(t);let n,s=new ee;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),y(n,{code:m.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),y(n,{code:m.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),y(n,{code:m.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):M.assertNever(o);return{status:s.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return y(r,{code:m.invalid_type,expected:S.bigint,received:r.parsedType}),k}gte(t,r){return this.setLimit("min",t,!0,_.toString(r))}gt(t,r){return this.setLimit("min",t,!1,_.toString(r))}lte(t,r){return this.setLimit("max",t,!0,_.toString(r))}lt(t,r){return this.setLimit("max",t,!1,_.toString(r))}setLimit(t,r,n,s){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:_.toString(s)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:_.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:_.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:_.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:_.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:_.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Rt.create=e=>{var t;return new Rt({checks:[],typeName:R.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...$(e)})};var kt=class extends D{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==S.boolean){let n=this._getOrReturnCtx(t);return y(n,{code:m.invalid_type,expected:S.boolean,received:n.parsedType}),k}return oe(t.data)}};kt.create=e=>new kt({typeName:R.ZodBoolean,coerce:e?.coerce||!1,...$(e)});var Ct=class e extends D{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==S.date){let o=this._getOrReturnCtx(t);return y(o,{code:m.invalid_type,expected:S.date,received:o.parsedType}),k}if(isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return y(o,{code:m.invalid_date}),k}let n=new ee,s;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(s=this._getOrReturnCtx(t,s),y(s,{code:m.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(s=this._getOrReturnCtx(t,s),y(s,{code:m.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):M.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:_.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:_.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};Ct.create=e=>new Ct({checks:[],coerce:e?.coerce||!1,typeName:R.ZodDate,...$(e)});var dr=class extends D{_parse(t){if(this._getType(t)!==S.symbol){let n=this._getOrReturnCtx(t);return y(n,{code:m.invalid_type,expected:S.symbol,received:n.parsedType}),k}return oe(t.data)}};dr.create=e=>new dr({typeName:R.ZodSymbol,...$(e)});var At=class extends D{_parse(t){if(this._getType(t)!==S.undefined){let n=this._getOrReturnCtx(t);return y(n,{code:m.invalid_type,expected:S.undefined,received:n.parsedType}),k}return oe(t.data)}};At.create=e=>new At({typeName:R.ZodUndefined,...$(e)});var It=class extends D{_parse(t){if(this._getType(t)!==S.null){let n=this._getOrReturnCtx(t);return y(n,{code:m.invalid_type,expected:S.null,received:n.parsedType}),k}return oe(t.data)}};It.create=e=>new It({typeName:R.ZodNull,...$(e)});var ft=class extends D{constructor(){super(...arguments),this._any=!0}_parse(t){return oe(t.data)}};ft.create=e=>new ft({typeName:R.ZodAny,...$(e)});var tt=class extends D{constructor(){super(...arguments),this._unknown=!0}_parse(t){return oe(t.data)}};tt.create=e=>new tt({typeName:R.ZodUnknown,...$(e)});var Me=class extends D{_parse(t){let r=this._getOrReturnCtx(t);return y(r,{code:m.invalid_type,expected:S.never,received:r.parsedType}),k}};Me.create=e=>new Me({typeName:R.ZodNever,...$(e)});var pr=class extends D{_parse(t){if(this._getType(t)!==S.undefined){let n=this._getOrReturnCtx(t);return y(n,{code:m.invalid_type,expected:S.void,received:n.parsedType}),k}return oe(t.data)}};pr.create=e=>new pr({typeName:R.ZodVoid,...$(e)});var rt=class e extends D{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),s=this._def;if(r.parsedType!==S.array)return y(r,{code:m.invalid_type,expected:S.array,received:r.parsedType}),k;if(s.exactLength!==null){let i=r.data.length>s.exactLength.value,a=r.data.length<s.exactLength.value;(i||a)&&(y(r,{code:i?m.too_big:m.too_small,minimum:a?s.exactLength.value:void 0,maximum:i?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(y(r,{code:m.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(y(r,{code:m.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,a)=>s.type._parseAsync(new Re(r,i,r.path,a)))).then(i=>ee.mergeArray(n,i));let o=[...r.data].map((i,a)=>s.type._parseSync(new Re(r,i,r.path,a)));return ee.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:_.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:_.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:_.toString(r)}})}nonempty(t){return this.min(1,t)}};rt.create=(e,t)=>new rt({type:e,minLength:null,maxLength:null,exactLength:null,typeName:R.ZodArray,...$(t)});function ur(e){if(e instanceof ue){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Oe.create(ur(n))}return new ue({...e._def,shape:()=>t})}else return e instanceof rt?new rt({...e._def,type:ur(e.element)}):e instanceof Oe?Oe.create(ur(e.unwrap())):e instanceof We?We.create(ur(e.unwrap())):e instanceof ze?ze.create(e.items.map(t=>ur(t))):e}var ue=class e extends D{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=M.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==S.object){let u=this._getOrReturnCtx(t);return y(u,{code:m.invalid_type,expected:S.object,received:u.parsedType}),k}let{status:n,ctx:s}=this._processInputParams(t),{shape:o,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof Me&&this._def.unknownKeys==="strip"))for(let u in s.data)i.includes(u)||a.push(u);let c=[];for(let u of i){let l=o[u],f=s.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Re(s,f,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof Me){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of a)c.push({key:{status:"valid",value:l},value:{status:"valid",value:s.data[l]}});else if(u==="strict")a.length>0&&(y(s,{code:m.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let l of a){let f=s.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Re(s,f,s.path,l)),alwaysSet:l in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of c){let f=await l.key,p=await l.value;u.push({key:f,value:p,alwaysSet:l.alwaysSet})}return u}).then(u=>ee.mergeObjectSync(n,u)):ee.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return _.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var s,o,i,a;let c=(i=(o=(s=this._def).errorMap)===null||o===void 0?void 0:o.call(s,r,n).message)!==null&&i!==void 0?i:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=_.errToObj(t).message)!==null&&a!==void 0?a:c}:{message:c}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:R.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};return M.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new e({...this._def,shape:()=>r})}omit(t){let r={};return M.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new e({...this._def,shape:()=>r})}deepPartial(){return ur(this)}partial(t){let r={};return M.objectKeys(this.shape).forEach(n=>{let s=this.shape[n];t&&!t[n]?r[n]=s:r[n]=s.optional()}),new e({...this._def,shape:()=>r})}required(t){let r={};return M.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof Oe;)o=o._def.innerType;r[n]=o}}),new e({...this._def,shape:()=>r})}keyof(){return $h(M.objectKeys(this.shape))}};ue.create=(e,t)=>new ue({shape:()=>e,unknownKeys:"strip",catchall:Me.create(),typeName:R.ZodObject,...$(t)});ue.strictCreate=(e,t)=>new ue({shape:()=>e,unknownKeys:"strict",catchall:Me.create(),typeName:R.ZodObject,...$(t)});ue.lazycreate=(e,t)=>new ue({shape:e,unknownKeys:"strip",catchall:Me.create(),typeName:R.ZodObject,...$(t)});var $t=class extends D{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function s(o){for(let a of o)if(a.result.status==="valid")return a.result;for(let a of o)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let i=o.map(a=>new he(a.ctx.common.issues));return y(r,{code:m.invalid_union,unionErrors:i}),k}if(r.common.async)return Promise.all(n.map(async o=>{let i={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(s);{let o,i=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},l=c._parseSync({data:r.data,path:r.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!o&&(o={result:l,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let a=i.map(c=>new he(c));return y(r,{code:m.invalid_union,unionErrors:a}),k}}get options(){return this._def.options}};$t.create=(e,t)=>new $t({options:e,typeName:R.ZodUnion,...$(t)});var Qe=e=>e instanceof Lt?Qe(e.schema):e instanceof ge?Qe(e.innerType()):e instanceof Nt?[e.value]:e instanceof Pt?e.options:e instanceof Mt?M.objectValues(e.enum):e instanceof Ft?Qe(e._def.innerType):e instanceof At?[void 0]:e instanceof It?[null]:e instanceof Oe?[void 0,...Qe(e.unwrap())]:e instanceof We?[null,...Qe(e.unwrap())]:e instanceof Jr||e instanceof Bt?Qe(e.unwrap()):e instanceof jt?Qe(e._def.innerType):[],Fs=class e extends D{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==S.object)return y(r,{code:m.invalid_type,expected:S.object,received:r.parsedType}),k;let n=this.discriminator,s=r.data[n],o=this.optionsMap.get(s);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(y(r,{code:m.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),k)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let s=new Map;for(let o of r){let i=Qe(o.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let a of i){if(s.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);s.set(a,o)}}return new e({typeName:R.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:s,...$(n)})}};function xa(e,t){let r=et(e),n=et(t);if(e===t)return{valid:!0,data:e};if(r===S.object&&n===S.object){let s=M.objectKeys(t),o=M.objectKeys(e).filter(a=>s.indexOf(a)!==-1),i={...e,...t};for(let a of o){let c=xa(e[a],t[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(r===S.array&&n===S.array){if(e.length!==t.length)return{valid:!1};let s=[];for(let o=0;o<e.length;o++){let i=e[o],a=t[o],c=xa(i,a);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return r===S.date&&n===S.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Dt=class extends D{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),s=(o,i)=>{if(wa(o)||wa(i))return k;let a=xa(o.value,i.value);return a.valid?((Sa(o)||Sa(i))&&r.dirty(),{status:r.value,value:a.data}):(y(n,{code:m.invalid_intersection_types}),k)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,i])=>s(o,i)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Dt.create=(e,t,r)=>new Dt({left:e,right:t,typeName:R.ZodIntersection,...$(r)});var ze=class e extends D{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==S.array)return y(n,{code:m.invalid_type,expected:S.array,received:n.parsedType}),k;if(n.data.length<this._def.items.length)return y(n,{code:m.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),k;!this._def.rest&&n.data.length>this._def.items.length&&(y(n,{code:m.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((i,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new Re(n,i,n.path,a)):null}).filter(i=>!!i);return n.common.async?Promise.all(o).then(i=>ee.mergeArray(r,i)):ee.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};ze.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ze({items:e,typeName:R.ZodTuple,rest:null,...$(t)})};var js=class e extends D{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==S.object)return y(n,{code:m.invalid_type,expected:S.object,received:n.parsedType}),k;let s=[],o=this._def.keyType,i=this._def.valueType;for(let a in n.data)s.push({key:o._parse(new Re(n,a,n.path,a)),value:i._parse(new Re(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?ee.mergeObjectAsync(r,s):ee.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof D?new e({keyType:t,valueType:r,typeName:R.ZodRecord,...$(n)}):new e({keyType:lt.create(),valueType:t,typeName:R.ZodRecord,...$(r)})}},mr=class extends D{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==S.map)return y(n,{code:m.invalid_type,expected:S.map,received:n.parsedType}),k;let s=this._def.keyType,o=this._def.valueType,i=[...n.data.entries()].map(([a,c],u)=>({key:s._parse(new Re(n,a,n.path,[u,"key"])),value:o._parse(new Re(n,c,n.path,[u,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of i){let u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return k;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of i){let u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return k;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}}}};mr.create=(e,t,r)=>new mr({valueType:t,keyType:e,typeName:R.ZodMap,...$(r)});var hr=class e extends D{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==S.set)return y(n,{code:m.invalid_type,expected:S.set,received:n.parsedType}),k;let s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(y(n,{code:m.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(y(n,{code:m.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());let o=this._def.valueType;function i(c){let u=new Set;for(let l of c){if(l.status==="aborted")return k;l.status==="dirty"&&r.dirty(),u.add(l.value)}return{status:r.value,value:u}}let a=[...n.data.values()].map((c,u)=>o._parse(new Re(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>i(c)):i(a)}min(t,r){return new e({...this._def,minSize:{value:t,message:_.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:_.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};hr.create=(e,t)=>new hr({valueType:e,minSize:null,maxSize:null,typeName:R.ZodSet,...$(t)});var Bs=class e extends D{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==S.function)return y(r,{code:m.invalid_type,expected:S.function,received:r.parsedType}),k;function n(a,c){return Ps({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ns(),fr].filter(u=>!!u),issueData:{code:m.invalid_arguments,argumentsError:c}})}function s(a,c){return Ps({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ns(),fr].filter(u=>!!u),issueData:{code:m.invalid_return_type,returnTypeError:c}})}let o={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof dt){let a=this;return oe(async function(...c){let u=new he([]),l=await a._def.args.parseAsync(c,o).catch(d=>{throw u.addIssue(n(c,d)),u}),f=await Reflect.apply(i,this,l);return await a._def.returns._def.type.parseAsync(f,o).catch(d=>{throw u.addIssue(s(f,d)),u})})}else{let a=this;return oe(function(...c){let u=a._def.args.safeParse(c,o);if(!u.success)throw new he([n(c,u.error)]);let l=Reflect.apply(i,this,u.data),f=a._def.returns.safeParse(l,o);if(!f.success)throw new he([s(l,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:ze.create(t).rest(tt.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||ze.create([]).rest(tt.create()),returns:r||tt.create(),typeName:R.ZodFunction,...$(n)})}},Lt=class extends D{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Lt.create=(e,t)=>new Lt({getter:e,typeName:R.ZodLazy,...$(t)});var Nt=class extends D{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return y(r,{received:r.data,code:m.invalid_literal,expected:this._def.value}),k}return{status:"valid",value:t.data}}get value(){return this._def.value}};Nt.create=(e,t)=>new Nt({value:e,typeName:R.ZodLiteral,...$(t)});function $h(e,t){return new Pt({values:e,typeName:R.ZodEnum,...$(t)})}var Pt=class e extends D{constructor(){super(...arguments),Yr.set(this,void 0)}_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return y(r,{expected:M.joinValues(n),received:r.parsedType,code:m.invalid_type}),k}if(Ms(this,Yr,"f")||kh(this,Yr,new Set(this._def.values),"f"),!Ms(this,Yr,"f").has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return y(r,{received:r.data,code:m.invalid_enum_value,options:n}),k}return oe(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};Yr=new WeakMap;Pt.create=$h;var Mt=class extends D{constructor(){super(...arguments),Xr.set(this,void 0)}_parse(t){let r=M.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==S.string&&n.parsedType!==S.number){let s=M.objectValues(r);return y(n,{expected:M.joinValues(s),received:n.parsedType,code:m.invalid_type}),k}if(Ms(this,Xr,"f")||kh(this,Xr,new Set(M.getValidEnumValues(this._def.values)),"f"),!Ms(this,Xr,"f").has(t.data)){let s=M.objectValues(r);return y(n,{received:n.data,code:m.invalid_enum_value,options:s}),k}return oe(t.data)}get enum(){return this._def.values}};Xr=new WeakMap;Mt.create=(e,t)=>new Mt({values:e,typeName:R.ZodNativeEnum,...$(t)});var dt=class extends D{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==S.promise&&r.common.async===!1)return y(r,{code:m.invalid_type,expected:S.promise,received:r.parsedType}),k;let n=r.parsedType===S.promise?r.data:Promise.resolve(r.data);return oe(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}};dt.create=(e,t)=>new dt({type:e,typeName:R.ZodPromise,...$(t)});var ge=class extends D{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===R.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),s=this._def.effect||null,o={addIssue:i=>{y(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){let i=s.transform(n.data,o);if(n.common.async)return Promise.resolve(i).then(async a=>{if(r.value==="aborted")return k;let c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?k:c.status==="dirty"||r.value==="dirty"?lr(c.value):c});{if(r.value==="aborted")return k;let a=this._def.schema._parseSync({data:i,path:n.path,parent:n});return a.status==="aborted"?k:a.status==="dirty"||r.value==="dirty"?lr(a.value):a}}if(s.type==="refinement"){let i=a=>{let c=s.refinement(a,o);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?k:(a.status==="dirty"&&r.dirty(),i(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?k:(a.status==="dirty"&&r.dirty(),i(a.value).then(()=>({status:r.value,value:a.value}))))}if(s.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Tt(i))return i;let a=s.transform(i.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>Tt(i)?Promise.resolve(s.transform(i.value,o)).then(a=>({status:r.value,value:a})):i);M.assertNever(s)}};ge.create=(e,t,r)=>new ge({schema:e,typeName:R.ZodEffects,effect:t,...$(r)});ge.createWithPreprocess=(e,t,r)=>new ge({schema:t,effect:{type:"preprocess",transform:e},typeName:R.ZodEffects,...$(r)});var Oe=class extends D{_parse(t){return this._getType(t)===S.undefined?oe(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Oe.create=(e,t)=>new Oe({innerType:e,typeName:R.ZodOptional,...$(t)});var We=class extends D{_parse(t){return this._getType(t)===S.null?oe(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};We.create=(e,t)=>new We({innerType:e,typeName:R.ZodNullable,...$(t)});var Ft=class extends D{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===S.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Ft.create=(e,t)=>new Ft({innerType:e,typeName:R.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...$(t)});var jt=class extends D{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Kr(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new he(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new he(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};jt.create=(e,t)=>new jt({innerType:e,typeName:R.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...$(t)});var gr=class extends D{_parse(t){if(this._getType(t)!==S.nan){let n=this._getOrReturnCtx(t);return y(n,{code:m.invalid_type,expected:S.nan,received:n.parsedType}),k}return{status:"valid",value:t.data}}};gr.create=e=>new gr({typeName:R.ZodNaN,...$(e)});var mC=Symbol("zod_brand"),Jr=class extends D{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Qr=class e extends D{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?k:o.status==="dirty"?(r.dirty(),lr(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?k:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:R.ZodPipeline})}},Bt=class extends D{_parse(t){let r=this._def.innerType._parse(t),n=s=>(Tt(s)&&(s.value=Object.freeze(s.value)),s);return Kr(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}};Bt.create=(e,t)=>new Bt({innerType:e,typeName:R.ZodReadonly,...$(t)});function Dh(e,t={},r){return e?ft.create().superRefine((n,s)=>{var o,i;if(!e(n)){let a=typeof t=="function"?t(n):typeof t=="string"?{message:t}:t,c=(i=(o=a.fatal)!==null&&o!==void 0?o:r)!==null&&i!==void 0?i:!0,u=typeof a=="string"?{message:a}:a;s.addIssue({code:"custom",...u,fatal:c})}}):ft.create()}var hC={object:ue.lazycreate},R;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(R||(R={}));var gC=(e,t={message:`Input not instance of ${e.name}`})=>Dh(r=>r instanceof e,t),Lh=lt.create,Nh=Ot.create,yC=gr.create,bC=Rt.create,Ph=kt.create,wC=Ct.create,SC=dr.create,xC=At.create,vC=It.create,_C=ft.create,EC=tt.create,TC=Me.create,OC=pr.create,RC=rt.create,kC=ue.create,CC=ue.strictCreate,AC=$t.create,IC=Fs.create,$C=Dt.create,DC=ze.create,LC=js.create,NC=mr.create,PC=hr.create,MC=Bs.create,FC=Lt.create,jC=Nt.create,BC=Pt.create,UC=Mt.create,GC=dt.create,Oh=ge.create,qC=Oe.create,VC=We.create,zC=ge.createWithPreprocess,WC=Qr.create,ZC=()=>Lh().optional(),HC=()=>Nh().optional(),YC=()=>Ph().optional(),XC={string:e=>lt.create({...e,coerce:!0}),number:e=>Ot.create({...e,coerce:!0}),boolean:e=>kt.create({...e,coerce:!0}),bigint:e=>Rt.create({...e,coerce:!0}),date:e=>Ct.create({...e,coerce:!0})},KC=k,nt=Object.freeze({__proto__:null,defaultErrorMap:fr,setErrorMap:zk,getErrorMap:Ns,makeIssue:Ps,EMPTY_PATH:Wk,addIssueToContext:y,ParseStatus:ee,INVALID:k,DIRTY:lr,OK:oe,isAborted:wa,isDirty:Sa,isValid:Tt,isAsync:Kr,get util(){return M},get objectUtil(){return ba},ZodParsedType:S,getParsedType:et,ZodType:D,datetimeRegex:Ih,ZodString:lt,ZodNumber:Ot,ZodBigInt:Rt,ZodBoolean:kt,ZodDate:Ct,ZodSymbol:dr,ZodUndefined:At,ZodNull:It,ZodAny:ft,ZodUnknown:tt,ZodNever:Me,ZodVoid:pr,ZodArray:rt,ZodObject:ue,ZodUnion:$t,ZodDiscriminatedUnion:Fs,ZodIntersection:Dt,ZodTuple:ze,ZodRecord:js,ZodMap:mr,ZodSet:hr,ZodFunction:Bs,ZodLazy:Lt,ZodLiteral:Nt,ZodEnum:Pt,ZodNativeEnum:Mt,ZodPromise:dt,ZodEffects:ge,ZodTransformer:ge,ZodOptional:Oe,ZodNullable:We,ZodDefault:Ft,ZodCatch:jt,ZodNaN:gr,BRAND:mC,ZodBranded:Jr,ZodPipeline:Qr,ZodReadonly:Bt,custom:Dh,Schema:D,ZodSchema:D,late:hC,get ZodFirstPartyTypeKind(){return R},coerce:XC,any:_C,array:RC,bigint:bC,boolean:Ph,date:wC,discriminatedUnion:IC,effect:Oh,enum:BC,function:MC,instanceof:gC,intersection:$C,lazy:FC,literal:jC,map:NC,nan:yC,nativeEnum:UC,never:TC,null:vC,nullable:VC,number:Nh,object:kC,oboolean:YC,onumber:HC,optional:qC,ostring:ZC,pipeline:WC,preprocess:zC,promise:GC,record:LC,set:PC,strictObject:CC,string:Lh,symbol:SC,transformer:Oh,tuple:DC,undefined:xC,union:AC,unknown:EC,void:OC,NEVER:KC,ZodIssueCode:m,quotelessJson:Vk,ZodError:he});var Mh=nt.object({list:nt.boolean().optional(),log:nt.boolean().optional(),track:nt.boolean(),reporter:nt.boolean().optional(),parser:nt.enum(["babel","babylon","flow","ts","tsx"]).optional(),extensions:nt.string().optional(),ignoreConfig:nt.string().optional()});var oo=gt(Xh(),1),to=gt(Ta(),1),sb=gt(Ra(),1),xr=gt(Ra(),1);import{spawn as hI}from"child_process";import{EventEmitter as I$}from"node:events";var no=Object.defineProperty,kA=Object.defineProperties,CA=Object.getOwnPropertyDescriptor,AA=Object.getOwnPropertyDescriptors,Za=Object.getOwnPropertyNames,Kh=Object.getOwnPropertySymbols,Ag=Object.prototype.hasOwnProperty,IA=Object.prototype.propertyIsEnumerable,Jh=(e,t,r)=>t in e?no(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ce=(e,t)=>{for(var r in t||(t={}))Ag.call(t,r)&&Jh(e,r,t[r]);if(Kh)for(var r of Kh(t))IA.call(t,r)&&Jh(e,r,t[r]);return e},rn=(e,t)=>kA(e,AA(t)),g=(e,t)=>function(){return e&&(t=(0,e[Za(e)[0]])(e=0)),t},$A=(e,t)=>function(){return t||(0,e[Za(e)[0]])((t={exports:{}}).exports,t),t.exports},Z=(e,t)=>{for(var r in t)no(e,r,{get:t[r],enumerable:!0})},DA=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Za(t))!Ag.call(e,s)&&s!==r&&no(e,s,{get:()=>t[s],enumerable:!(n=CA(t,s))||n.enumerable});return e},q=e=>DA(no({},"__esModule",{value:!0}),e),tn=(e,t,r)=>new Promise((n,s)=>{var o=c=>{try{a(r.next(c))}catch(u){s(u)}},i=c=>{try{a(r.throw(c))}catch(u){s(u)}},a=c=>c.done?n(c.value):Promise.resolve(c.value).then(o,i);a((r=r.apply(e,t)).next())});function LA(...e){let t=new String(e);return so.set(t,e),t}function Qs(e){return e instanceof String&&so.has(e)}function Qh(e){return so.get(e)||[]}var so,an=g({"src/lib/args/pathspec.ts"(){"use strict";so=new WeakMap}}),ot,mt=g({"src/lib/errors/git-error.ts"(){"use strict";ot=class extends Error{constructor(e,t){super(t),this.task=e,Object.setPrototypeOf(this,new.target.prototype)}}}}),cn,_r=g({"src/lib/errors/git-response-error.ts"(){"use strict";mt(),cn=class extends ot{constructor(e,t){super(void 0,t||String(e)),this.git=e}}}}),Ig,$g=g({"src/lib/errors/task-configuration-error.ts"(){"use strict";mt(),Ig=class extends ot{constructor(e){super(void 0,e)}}}});function Dg(e){return typeof e=="function"?e:zt}function Lg(e){return typeof e=="function"&&e!==zt}function Ng(e,t){let r=e.indexOf(t);return r<=0?[e,""]:[e.substr(0,r),e.substr(r+1)]}function Pg(e,t=0){return Mg(e)&&e.length>t?e[t]:void 0}function Vt(e,t=0){if(Mg(e)&&e.length>t)return e[e.length-1-t]}function Mg(e){return!!(e&&typeof e.length=="number")}function un(e="",t=!0,r=`
56
+ `){return e.split(r).reduce((n,s)=>{let o=t?s.trim():s;return o&&n.push(o),n},[])}function Ha(e,t){return un(e,!0).map(r=>t(r))}function Ya(e){return(0,oo.exists)(e,oo.FOLDER)}function F(e,t){return Array.isArray(e)?e.includes(t)||e.push(t):e.add(t),t}function Fg(e,t){return Array.isArray(e)&&!e.includes(t)&&e.push(t),e}function io(e,t){if(Array.isArray(e)){let r=e.indexOf(t);r>=0&&e.splice(r,1)}else e.delete(t);return t}function Ze(e){return Array.isArray(e)?e:[e]}function jg(e){return e.replace(/[\s-]+(.)/g,(t,r)=>r.toUpperCase())}function Bg(e){return Ze(e).map(String)}function B(e,t=0){if(e==null)return t;let r=parseInt(e,10);return isNaN(r)?t:r}function nn(e,t){let r=[];for(let n=0,s=e.length;n<s;n++)r.push(t,e[n]);return r}function sn(e){return(Array.isArray(e)?Buffer.concat(e):e).toString("utf-8")}function Ug(e,t){return Object.assign({},...t.map(r=>r in e?{[r]:e[r]}:{}))}function La(e=0){return new Promise(t=>setTimeout(t,e))}function Na(e){if(e!==!1)return e}var vr,zt,ln,ao=g({"src/lib/utils/util.ts"(){"use strict";vr="\0",zt=()=>{},ln=Object.prototype.toString.call.bind(Object.prototype.toString)}});function He(e,t,r){return t(e)?e:arguments.length>2?r:void 0}function Xa(e,t){let r=Qs(e)?"string":typeof e;return/number|string|boolean/.test(r)&&(!t||!t.includes(r))}function Ka(e){return!!e&&ln(e)==="[object Object]"}function Gg(e){return typeof e=="function"}var fn,te,qg,eo,Ja,Vg=g({"src/lib/utils/argument-filters.ts"(){"use strict";ao(),an(),fn=e=>Array.isArray(e),te=e=>typeof e=="string",qg=e=>Array.isArray(e)&&e.every(te),eo=e=>te(e)||Array.isArray(e)&&e.every(te),Ja=e=>e==null||"number|boolean|function".includes(typeof e)?!1:Array.isArray(e)||typeof e=="string"||typeof e.length=="number"}}),Pa,NA=g({"src/lib/utils/exit-codes.ts"(){"use strict";Pa=(e=>(e[e.SUCCESS=0]="SUCCESS",e[e.ERROR=1]="ERROR",e[e.NOT_FOUND=-2]="NOT_FOUND",e[e.UNCLEAN=128]="UNCLEAN",e))(Pa||{})}}),on,PA=g({"src/lib/utils/git-output-streams.ts"(){"use strict";on=class{constructor(e,t){this.stdOut=e,this.stdErr=t}asStrings(){return new on(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}}),I,pt,MA=g({"src/lib/utils/line-parser.ts"(){"use strict";I=class{constructor(e,t){this.matches=[],this.parse=(r,n)=>(this.resetMatches(),this._regExp.every((s,o)=>this.addMatch(s,o,r(o)))?this.useMatches(n,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(e)?e:[e],t&&(this.useMatches=t)}useMatches(e,t){throw new Error("LineParser:useMatches not implemented")}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(e,t,r){let n=r&&e.exec(r);return n&&this.pushMatch(t,n),!!n}pushMatch(e,t){this.matches.push(...t.slice(1))}},pt=class extends I{addMatch(e,t,r){return/^remote:\s/.test(String(r))&&super.addMatch(e,t,r)}pushMatch(e,t){(e>0||t.length>1)&&super.pushMatch(e,t)}}}});function zg(...e){let t=process.cwd(),r=Object.assign(Ce({baseDir:t},Wg),...e.filter(n=>typeof n=="object"&&n));return r.baseDir=r.baseDir||t,r.trimmed=r.trimmed===!0,r}var Wg,FA=g({"src/lib/utils/simple-git-options.ts"(){"use strict";Wg={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function Qa(e,t=[]){return Ka(e)?Object.keys(e).reduce((r,n)=>{let s=e[n];return Qs(s)?r.push(s):Xa(s,["boolean"])?r.push(n+"="+s):r.push(n),r},t):t}function le(e,t=0,r=!1){let n=[];for(let s=0,o=t<0?e.length:t;s<o;s++)"string|number".includes(typeof e[s])&&n.push(String(e[s]));return Qa(ec(e),n),r||n.push(...jA(e)),n}function jA(e){let t=typeof Vt(e)=="function";return He(Vt(e,t?1:0),fn,[])}function ec(e){let t=Gg(Vt(e));return He(Vt(e,t?1:0),Ka)}function V(e,t=!0){let r=Dg(Vt(e));return t||Lg(r)?r:void 0}var BA=g({"src/lib/utils/task-options.ts"(){"use strict";Vg(),ao(),an()}});function Ma(e,t){return e(t.stdOut,t.stdErr)}function de(e,t,r,n=!0){return Ze(r).forEach(s=>{for(let o=un(s,n),i=0,a=o.length;i<a;i++){let c=(u=0)=>{if(!(i+u>=a))return o[i+u]};t.some(({parse:u})=>u(c,e))}}),e}var UA=g({"src/lib/utils/task-parser.ts"(){"use strict";ao()}}),Zg={};Z(Zg,{ExitCodes:()=>Pa,GitOutputStreams:()=>on,LineParser:()=>I,NOOP:()=>zt,NULL:()=>vr,RemoteLineParser:()=>pt,append:()=>F,appendTaskOptions:()=>Qa,asArray:()=>Ze,asCamelCase:()=>jg,asFunction:()=>Dg,asNumber:()=>B,asStringArray:()=>Bg,bufferToString:()=>sn,callTaskParser:()=>Ma,createInstanceConfig:()=>zg,delay:()=>La,filterArray:()=>fn,filterFunction:()=>Gg,filterHasLength:()=>Ja,filterPlainObject:()=>Ka,filterPrimitives:()=>Xa,filterString:()=>te,filterStringArray:()=>qg,filterStringOrStringArray:()=>eo,filterType:()=>He,first:()=>Pg,folderExists:()=>Ya,forEachLineWithContent:()=>Ha,getTrailingOptions:()=>le,including:()=>Fg,isUserFunction:()=>Lg,last:()=>Vt,objectToString:()=>ln,orVoid:()=>Na,parseStringResponse:()=>de,pick:()=>Ug,prefixedArray:()=>nn,remove:()=>io,splitOn:()=>Ng,toLinesWithContent:()=>un,trailingFunctionArgument:()=>V,trailingOptionsArgument:()=>ec});var C=g({"src/lib/utils/index.ts"(){"use strict";Vg(),NA(),PA(),MA(),FA(),BA(),UA(),ao()}}),Hg={};Z(Hg,{CheckRepoActions:()=>Fa,checkIsBareRepoTask:()=>Xg,checkIsRepoRootTask:()=>Yg,checkIsRepoTask:()=>GA});function GA(e){switch(e){case"bare":return Xg();case"root":return Yg()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:co,parser:tc}}function Yg(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:co,parser(t){return/^\.(git)?$/.test(t.trim())}}}function Xg(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:co,parser:tc}}function qA(e){return/(Not a git repository|Kein Git-Repository)/i.test(String(e))}var Fa,co,tc,Kg=g({"src/lib/tasks/check-is-repo.ts"(){"use strict";C(),Fa=(e=>(e.BARE="bare",e.IN_TREE="tree",e.IS_REPO_ROOT="root",e))(Fa||{}),co=({exitCode:e},t,r,n)=>{if(e===128&&qA(t))return r(Buffer.from("false"));n(t)},tc=e=>e.trim()==="true"}});function VA(e,t){let r=new Jg(e),n=e?ey:Qg;return un(t).forEach(s=>{let o=s.replace(n,"");r.paths.push(o),(ty.test(o)?r.folders:r.files).push(o)}),r}var Jg,Qg,ey,ty,zA=g({"src/lib/responses/CleanSummary.ts"(){"use strict";C(),Jg=class{constructor(e){this.dryRun=e,this.paths=[],this.files=[],this.folders=[]}},Qg=/^[a-z]+\s*/i,ey=/^[a-z]+\s+[a-z]+\s*/i,ty=/\/$/}}),ja={};Z(ja,{EMPTY_COMMANDS:()=>uo,adhocExecTask:()=>ry,configurationErrorTask:()=>fe,isBufferTask:()=>sy,isEmptyTask:()=>oy,straightThroughBufferTask:()=>ny,straightThroughStringTask:()=>ie});function ry(e){return{commands:uo,format:"empty",parser:e}}function fe(e){return{commands:uo,format:"empty",parser(){throw typeof e=="string"?new Ig(e):e}}}function ie(e,t=!1){return{commands:e,format:"utf-8",parser(r){return t?String(r).trim():r}}}function ny(e){return{commands:e,format:"buffer",parser(t){return t}}}function sy(e){return e.format==="buffer"}function oy(e){return e.format==="empty"||!e.commands.length}var uo,W=g({"src/lib/tasks/task.ts"(){"use strict";$g(),uo=[]}}),iy={};Z(iy,{CONFIG_ERROR_INTERACTIVE_MODE:()=>rc,CONFIG_ERROR_MODE_REQUIRED:()=>nc,CONFIG_ERROR_UNKNOWN_OPTION:()=>sc,CleanOptions:()=>Ys,cleanTask:()=>ay,cleanWithOptionsTask:()=>WA,isCleanOptionsArray:()=>ZA});function WA(e,t){let{cleanMode:r,options:n,valid:s}=HA(e);return r?s.options?(n.push(...t),n.some(KA)?fe(rc):ay(r,n)):fe(sc+JSON.stringify(e)):fe(nc)}function ay(e,t){return{commands:["clean",`-${e}`,...t],format:"utf-8",parser(n){return VA(e==="n",n)}}}function ZA(e){return Array.isArray(e)&&e.every(t=>oc.has(t))}function HA(e){let t,r=[],n={cleanMode:!1,options:!0};return e.replace(/[^a-z]i/g,"").split("").forEach(s=>{YA(s)?(t=s,n.cleanMode=!0):n.options=n.options&&XA(r[r.length]=`-${s}`)}),{cleanMode:t,options:r,valid:n}}function YA(e){return e==="f"||e==="n"}function XA(e){return/^-[a-z]$/i.test(e)&&oc.has(e.charAt(1))}function KA(e){return/^-[^\-]/.test(e)?e.indexOf("i")>0:e==="--interactive"}var rc,nc,sc,Ys,oc,cy=g({"src/lib/tasks/clean.ts"(){"use strict";zA(),C(),W(),rc="Git clean interactive mode is not supported",nc='Git clean mode parameter ("n" or "f") is required',sc="Git clean unknown option found in: ",Ys=(e=>(e.DRY_RUN="n",e.FORCE="f",e.IGNORED_INCLUDED="x",e.IGNORED_ONLY="X",e.EXCLUDING="e",e.QUIET="q",e.RECURSIVE="d",e))(Ys||{}),oc=new Set(["i",...Bg(Object.values(Ys))])}});function JA(e){let t=new ly;for(let r of uy(e))t.addValue(r.file,String(r.key),r.value);return t}function QA(e,t){let r=null,n=[],s=new Map;for(let o of uy(e,t))o.key===t&&(n.push(r=o.value),s.has(o.file)||s.set(o.file,[]),s.get(o.file).push(r));return{key:t,paths:Array.from(s.keys()),scopes:s,value:r,values:n}}function eI(e){return e.replace(/^(file):/,"")}function*uy(e,t=null){let r=e.split("\0");for(let n=0,s=r.length-1;n<s;){let o=eI(r[n++]),i=r[n++],a=t;if(i.includes(`
57
+ `)){let c=Ng(i,`
58
+ `);a=c[0],i=c[1]}yield{file:o,key:a,value:i}}}var ly,tI=g({"src/lib/responses/ConfigList.ts"(){"use strict";C(),ly=class{constructor(){this.files=[],this.values=Object.create(null)}get all(){return this._all||(this._all=this.files.reduce((e,t)=>Object.assign(e,this.values[t]),{})),this._all}addFile(e){if(!(e in this.values)){let t=Vt(this.files);this.values[e]=t?Object.create(this.values[t]):{},this.files.push(e)}return this.values[e]}addValue(e,t,r){let n=this.addFile(e);n.hasOwnProperty(t)?Array.isArray(n[t])?n[t].push(r):n[t]=[n[t],r]:n[t]=r,this._all=void 0}}}});function ka(e,t){return typeof e=="string"&&Ba.hasOwnProperty(e)?e:t}function rI(e,t,r,n){let s=["config",`--${n}`];return r&&s.push("--add"),s.push(e,t),{commands:s,format:"utf-8",parser(o){return o}}}function nI(e,t){let r=["config","--null","--show-origin","--get-all",e];return t&&r.splice(1,0,`--${t}`),{commands:r,format:"utf-8",parser(n){return QA(n,e)}}}function sI(e){let t=["config","--list","--show-origin","--null"];return e&&t.push(`--${e}`),{commands:t,format:"utf-8",parser(r){return JA(r)}}}function oI(){return{addConfig(e,t,...r){return this._runTask(rI(e,t,r[0]===!0,ka(r[1],"local")),V(arguments))},getConfig(e,t){return this._runTask(nI(e,ka(t,void 0)),V(arguments))},listConfig(...e){return this._runTask(sI(ka(e[0],void 0)),V(arguments))}}}var Ba,fy=g({"src/lib/tasks/config.ts"(){"use strict";tI(),C(),Ba=(e=>(e.system="system",e.global="global",e.local="local",e.worktree="worktree",e))(Ba||{})}});function iI(e){return dy.has(e)}var Ca,dy,py=g({"src/lib/tasks/diff-name-status.ts"(){"use strict";Ca=(e=>(e.ADDED="A",e.COPIED="C",e.DELETED="D",e.MODIFIED="M",e.RENAMED="R",e.CHANGED="T",e.UNMERGED="U",e.UNKNOWN="X",e.BROKEN="B",e))(Ca||{}),dy=new Set(Object.values(Ca))}});function aI(...e){return new hy().param(...e)}function cI(e){let t=new Set,r={};return Ha(e,n=>{let[s,o,i]=n.split(vr);t.add(s),(r[s]=r[s]||[]).push({line:B(o),path:s,preview:i})}),{paths:t,results:r}}function uI(){return{grep(e){let t=V(arguments),r=le(arguments);for(let s of my)if(r.includes(s))return this._runTask(fe(`git.grep: use of "${s}" is not supported.`),t);typeof e=="string"&&(e=aI().param(e));let n=["grep","--null","-n","--full-name",...r,...e];return this._runTask({commands:n,format:"utf-8",parser(s){return cI(s)}},t)}}}var my,en,eg,hy,gy=g({"src/lib/tasks/grep.ts"(){"use strict";C(),W(),my=["-h"],en=Symbol("grepQuery"),hy=class{constructor(){this[eg]=[]}*[(eg=en,Symbol.iterator)](){for(let e of this[en])yield e}and(...e){return e.length&&this[en].push("--and","(",...nn(e,"-e"),")"),this}param(...e){return this[en].push(...nn(e,"-e")),this}}}}),yy={};Z(yy,{ResetMode:()=>Xs,getResetMode:()=>fI,resetTask:()=>lI});function lI(e,t){let r=["reset"];return by(e)&&r.push(`--${e}`),r.push(...t),ie(r)}function fI(e){if(by(e))return e;switch(typeof e){case"string":case"undefined":return"soft"}}function by(e){return wy.includes(e)}var Xs,wy,Sy=g({"src/lib/tasks/reset.ts"(){"use strict";W(),Xs=(e=>(e.MIXED="mixed",e.SOFT="soft",e.HARD="hard",e.MERGE="merge",e.KEEP="keep",e))(Xs||{}),wy=Array.from(Object.values(Xs))}});function dI(){return(0,to.default)("simple-git")}function tg(e,t,r){return!t||!String(t).replace(/\s*/,"")?r?(n,...s)=>{e(n,...s),r(n,...s)}:e:(n,...s)=>{e(`%s ${n}`,t,...s),r&&r(n,...s)}}function pI(e,t,{namespace:r}){if(typeof e=="string")return e;let n=t&&t.namespace||"";return n.startsWith(r)?n.substr(r.length+1):n||r}function ic(e,t,r,n=dI()){let s=e&&`[${e}]`||"",o=[],i=typeof t=="string"?n.extend(t):t,a=pI(He(t,te),i,n);return u(r);function c(l,f){return F(o,ic(e,a.replace(/^[^:]+/,l),f,n))}function u(l){let f=l&&`[${l}]`||"",p=i&&tg(i,f)||zt,d=tg(n,`${s} ${f}`,p);return Object.assign(i?p:d,{label:e,sibling:c,info:d,step:u})}}var xy=g({"src/lib/git-logger.ts"(){"use strict";C(),to.default.formatters.L=e=>String(Ja(e)?e.length:"-"),to.default.formatters.B=e=>Buffer.isBuffer(e)?e.toString("utf8"):ln(e)}}),Zs,Ua,mI=g({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";mt(),xy(),Zs=class{constructor(e="GitExecutor"){this.logLabel=e,this._queue=new Map}withProgress(e){return this._queue.get(e)}createProgress(e){let t=Zs.getName(e.commands[0]),r=ic(this.logLabel,t);return{task:e,logger:r,name:t}}push(e){let t=this.createProgress(e);return t.logger("Adding task to the queue, commands = %o",e.commands),this._queue.set(e,t),t}fatal(e){for(let[t,{logger:r}]of Array.from(this._queue.entries()))t===e.task?(r.info("Failed %o",e),r("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):r.info("A fatal exception occurred in a previous task, the queue has been purged: %o",e.message),this.complete(t);if(this._queue.size!==0)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(e){this.withProgress(e)&&this._queue.delete(e)}attempt(e){let t=this.withProgress(e);if(!t)throw new ot(void 0,"TasksPendingQueue: attempt called for an unknown task");return t.logger("Starting task"),t}static getName(e="empty"){return`task:${e}:${++Zs.counter}`}},Ua=Zs,Ua.counter=0}});function qt(e,t){return{method:Pg(e.commands)||"",commands:t}}function gI(e,t){return r=>{t("[ERROR] child process exception %o",r),e.push(Buffer.from(String(r.stack),"ascii"))}}function rg(e,t,r,n){return s=>{r("%s received %L bytes",t,s),n("%B",s),e.push(s)}}var Ga,yI=g({"src/lib/runners/git-executor-chain.ts"(){"use strict";mt(),W(),C(),mI(),Ga=class{constructor(e,t,r){this._executor=e,this._scheduler=t,this._plugins=r,this._chain=Promise.resolve(),this._queue=new Ua}get cwd(){return this._cwd||this._executor.cwd}set cwd(e){this._cwd=e}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(e){return this._queue.push(e),this._chain=this._chain.then(()=>this.attemptTask(e))}attemptTask(e){return tn(this,null,function*(){let t=yield this._scheduler.next(),r=()=>this._queue.complete(e);try{let{logger:n}=this._queue.attempt(e);return yield oy(e)?this.attemptEmptyTask(e,n):this.attemptRemoteTask(e,n)}catch(n){throw this.onFatalException(e,n)}finally{r(),t()}})}onFatalException(e,t){let r=t instanceof ot?Object.assign(t,{task:e}):new ot(e,t&&String(t));return this._chain=Promise.resolve(),this._queue.fatal(r),r}attemptRemoteTask(e,t){return tn(this,null,function*(){let r=this._plugins.exec("spawn.binary","",qt(e,e.commands)),n=this._plugins.exec("spawn.args",[...e.commands],qt(e,e.commands)),s=yield this.gitResponse(e,r,n,this.outputHandler,t.step("SPAWN")),o=yield this.handleTaskData(e,n,s,t.step("HANDLE"));return t("passing response to task's parser as a %s",e.format),sy(e)?Ma(e.parser,o):Ma(e.parser,o.asStrings())})}attemptEmptyTask(e,t){return tn(this,null,function*(){return t("empty task bypassing child process to call to task's parser"),e.parser(this)})}handleTaskData(e,t,r,n){let{exitCode:s,rejection:o,stdOut:i,stdErr:a}=r;return new Promise((c,u)=>{n("Preparing to handle process response exitCode=%d stdOut=",s);let{error:l}=this._plugins.exec("task.error",{error:o},Ce(Ce({},qt(e,t)),r));if(l&&e.onError)return n.info("exitCode=%s handling with custom error handler"),e.onError(r,l,f=>{n.info("custom error handler treated as success"),n("custom error returned a %s",ln(f)),c(new on(Array.isArray(f)?Buffer.concat(f):f,Buffer.concat(a)))},u);if(l)return n.info("handling as error: exitCode=%s stdErr=%s rejection=%o",s,a.length,o),u(l);n.info("retrieving task output complete"),c(new on(Buffer.concat(i),Buffer.concat(a)))})}gitResponse(e,t,r,n,s){return tn(this,null,function*(){let o=s.sibling("output"),i=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},qt(e,e.commands));return new Promise(a=>{let c=[],u=[];s.info("%s %o",t,r),s("%O",i);let l=this._beforeSpawn(e,r);if(l)return a({stdOut:c,stdErr:u,exitCode:9901,rejection:l});this._plugins.exec("spawn.before",void 0,rn(Ce({},qt(e,r)),{kill(p){l=p||l}}));let f=hI(t,r,i);f.stdout.on("data",rg(c,"stdOut",s,o.step("stdOut"))),f.stderr.on("data",rg(u,"stdErr",s,o.step("stdErr"))),f.on("error",gI(u,s)),n&&(s("Passing child process stdOut/stdErr to custom outputHandler"),n(t,f.stdout,f.stderr,[...r])),this._plugins.exec("spawn.after",void 0,rn(Ce({},qt(e,r)),{spawned:f,close(p,d){a({stdOut:c,stdErr:u,exitCode:p,rejection:l||d})},kill(p){f.killed||(l=p,f.kill("SIGINT"))}}))})})}_beforeSpawn(e,t){let r;return this._plugins.exec("spawn.before",void 0,rn(Ce({},qt(e,t)),{kill(n){r=n||r}})),r}}}}),vy={};Z(vy,{GitExecutor:()=>_y});var _y,bI=g({"src/lib/runners/git-executor.ts"(){"use strict";yI(),_y=class{constructor(e,t,r){this.cwd=e,this._scheduler=t,this._plugins=r,this._chain=new Ga(this,this._scheduler,this._plugins)}chain(){return new Ga(this,this._scheduler,this._plugins)}push(e){return this._chain.push(e)}}}});function wI(e,t,r=zt){let n=o=>{r(null,o)},s=o=>{o?.task===e&&r(o instanceof cn?SI(o):o,void 0)};t.then(n,s)}function SI(e){let t=n=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${n} should be GitResponseError.git.${n}, this will no longer be available in version 3`),t=zt};return Object.create(e,Object.getOwnPropertyNames(e.git).reduce(r,{}));function r(n,s){return s in e||(n[s]={enumerable:!1,configurable:!1,get(){return t(s),e.git[s]}}),n}}var xI=g({"src/lib/task-callback.ts"(){"use strict";_r(),C()}});function ng(e,t){return ry(r=>{if(!Ya(e))throw new Error(`Git.cwd: cannot change to non-directory "${e}"`);return(t||r).cwd=e})}var vI=g({"src/lib/tasks/change-working-directory.ts"(){"use strict";C(),W()}});function Aa(e){let t=["checkout",...e];return t[1]==="-b"&&t.includes("-B")&&(t[1]=io(t,"-B")),ie(t)}function _I(){return{checkout(){return this._runTask(Aa(le(arguments,1)),V(arguments))},checkoutBranch(e,t){return this._runTask(Aa(["-b",e,t,...le(arguments)]),V(arguments))},checkoutLocalBranch(e){return this._runTask(Aa(["-b",e,...le(arguments)]),V(arguments))}}}var EI=g({"src/lib/tasks/checkout.ts"(){"use strict";C(),W()}});function TI(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function OI(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(e){return de(TI(),[Ey],e)}})}}}var Ey,RI=g({"src/lib/tasks/count-objects.ts"(){"use strict";C(),Ey=new I(/([a-z-]+): (\d+)$/,(e,[t,r])=>{let n=jg(t);e.hasOwnProperty(n)&&(e[n]=B(r))})}});function kI(e){return de({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},Ty,e)}var Ty,CI=g({"src/lib/parsers/parse-commit.ts"(){"use strict";C(),Ty=[new I(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(e,[t,r,n])=>{e.branch=t,e.commit=n,e.root=!!r}),new I(/\s*Author:\s(.+)/i,(e,[t])=>{let r=t.split("<"),n=r.pop();!n||!n.includes("@")||(e.author={email:n.substr(0,n.length-1),name:r.join("<").trim()})}),new I(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(e,[t,r,n])=>{e.summary.changes=parseInt(t,10)||0,e.summary.insertions=parseInt(r,10)||0,e.summary.deletions=parseInt(n,10)||0}),new I(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(e,[t,r,n])=>{e.summary.changes=parseInt(t,10)||0;let s=parseInt(r,10)||0;n==="-"?e.summary.deletions=s:n==="+"&&(e.summary.insertions=s)})]}});function AI(e,t,r){return{commands:["-c","core.abbrev=40","commit",...nn(e,"-m"),...t,...r],format:"utf-8",parser:kI}}function II(){return{commit(t,...r){let n=V(arguments),s=e(t)||AI(Ze(t),Ze(He(r[0],eo,[])),[...He(r[1],fn,[]),...le(arguments,0,!0)]);return this._runTask(s,n)}};function e(t){return!eo(t)&&fe("git.commit: requires the commit message to be supplied as a string/string[]")}}var $I=g({"src/lib/tasks/commit.ts"(){"use strict";CI(),C(),W()}});function DI(){return{firstCommit(){return this._runTask(ie(["rev-list","--max-parents=0","HEAD"],!0),V(arguments))}}}var LI=g({"src/lib/tasks/first-commit.ts"(){"use strict";C(),W()}});function NI(e,t){let r=["hash-object",e];return t&&r.push("-w"),ie(r,!0)}var PI=g({"src/lib/tasks/hash-object.ts"(){"use strict";W()}});function MI(e,t,r){let n=String(r).trim(),s;if(s=Oy.exec(n))return new Ks(e,t,!1,s[1]);if(s=Ry.exec(n))return new Ks(e,t,!0,s[1]);let o="",i=n.split(" ");for(;i.length;)if(i.shift()==="in"){o=i.join(" ");break}return new Ks(e,t,/^re/i.test(n),o)}var Ks,Oy,Ry,FI=g({"src/lib/responses/InitSummary.ts"(){"use strict";Ks=class{constructor(e,t,r,n){this.bare=e,this.path=t,this.existing=r,this.gitDir=n}},Oy=/^Init.+ repository in (.+)$/,Ry=/^Rein.+ in (.+)$/}});function jI(e){return e.includes(ac)}function BI(e=!1,t,r){let n=["init",...r];return e&&!jI(n)&&n.splice(1,0,ac),{commands:n,format:"utf-8",parser(s){return MI(n.includes("--bare"),t,s)}}}var ac,UI=g({"src/lib/tasks/init.ts"(){"use strict";FI(),ac="--bare"}});function cc(e){for(let t=0;t<e.length;t++){let r=uc.exec(e[t]);if(r)return`--${r[1]}`}return""}function GI(e){return uc.test(e)}var uc,dn=g({"src/lib/args/log-format.ts"(){"use strict";uc=/^--(stat|numstat|name-only|name-status)(=|$)/}}),ky,qI=g({"src/lib/responses/DiffSummary.ts"(){"use strict";ky=class{constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});function Cy(e=""){let t=Ay[e];return r=>de(new ky,t,r,!1)}var Ia,sg,og,ig,Ay,Iy=g({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";dn(),qI(),py(),C(),Ia=[new I(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(e,[t,r,n=""])=>{e.files.push({file:t.trim(),changes:B(r),insertions:n.replace(/[^+]/g,"").length,deletions:n.replace(/[^-]/g,"").length,binary:!1})}),new I(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(e,[t,r,n])=>{e.files.push({file:t.trim(),before:B(r),after:B(n),binary:!0})}),new I(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(e,[t,r])=>{let n=/(\d+) i/.exec(r),s=/(\d+) d/.exec(r);e.changed=B(t),e.insertions=B(n?.[1]),e.deletions=B(s?.[1])})],sg=[new I(/(\d+)\t(\d+)\t(.+)$/,(e,[t,r,n])=>{let s=B(t),o=B(r);e.changed++,e.insertions+=s,e.deletions+=o,e.files.push({file:n,changes:s+o,insertions:s,deletions:o,binary:!1})}),new I(/-\t-\t(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,after:0,before:0,binary:!0})})],og=[new I(/(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,changes:0,insertions:0,deletions:0,binary:!1})})],ig=[new I(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(e,[t,r,n,s,o])=>{e.changed++,e.files.push({file:o??n,changes:0,insertions:0,deletions:0,binary:!1,status:Na(iI(t)&&t),from:Na(!!o&&n!==o&&n),similarity:B(r)})})],Ay={"":Ia,"--stat":Ia,"--numstat":sg,"--name-status":ig,"--name-only":og}}});function VI(e,t){return t.reduce((r,n,s)=>(r[n]=e[s]||"",r),Object.create({diff:null}))}function $y(e=dc,t=Dy,r=""){let n=Cy(r);return function(s){let o=un(s.trim(),!1,lc).map(function(i){let a=i.split(fc),c=VI(a[0].split(e),t);return a.length>1&&a[1].trim()&&(c.diff=n(a[1])),c});return{all:o,latest:o.length&&o[0]||null,total:o.length}}}var lc,fc,dc,Dy,Ly=g({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";C(),Iy(),dn(),lc="\xF2\xF2\xF2\xF2\xF2\xF2 ",fc=" \xF2\xF2",dc=" \xF2 ",Dy=["hash","date","message","refs","author_name","author_email"]}}),Ny={};Z(Ny,{diffSummaryTask:()=>zI,validateLogFormatConfig:()=>lo});function zI(e){let t=cc(e),r=["diff"];return t===""&&(t="--stat",r.push("--stat=4096")),r.push(...e),lo(r)||{commands:r,format:"utf-8",parser:Cy(t)}}function lo(e){let t=e.filter(GI);if(t.length>1)return fe(`Summary flags are mutually exclusive - pick one of ${t.join(",")}`);if(t.length&&e.includes("-z"))return fe(`Summary flag ${t} parsing is not compatible with null termination option '-z'`)}var pc=g({"src/lib/tasks/diff.ts"(){"use strict";dn(),Iy(),W()}});function WI(e,t){let r=[],n=[];return Object.keys(e).forEach(s=>{r.push(s),n.push(String(e[s]))}),[r,n.join(t)]}function ZI(e){return Object.keys(e).reduce((t,r)=>(r in qa||(t[r]=e[r]),t),{})}function Py(e={},t=[]){let r=He(e.splitter,te,dc),n=!Xa(e.format)&&e.format?e.format:{hash:"%H",date:e.strictDate===!1?"%ai":"%aI",message:"%s",refs:"%D",body:e.multiLine?"%B":"%b",author_name:e.mailMap!==!1?"%aN":"%an",author_email:e.mailMap!==!1?"%aE":"%ae"},[s,o]=WI(n,r),i=[],a=[`--pretty=format:${lc}${o}${fc}`,...t],c=e.n||e["max-count"]||e.maxCount;if(c&&a.push(`--max-count=${c}`),e.from||e.to){let u=e.symmetric!==!1?"...":"..";i.push(`${e.from||""}${u}${e.to||""}`)}return te(e.file)&&a.push("--follow",LA(e.file)),Qa(ZI(e),a),{fields:s,splitter:r,commands:[...a,...i]}}function HI(e,t,r){let n=$y(e,t,cc(r));return{commands:["log",...r],format:"utf-8",parser:n}}function YI(){return{log(...r){let n=V(arguments),s=Py(ec(arguments),He(arguments[0],fn)),o=t(...r)||lo(s.commands)||e(s);return this._runTask(o,n)}};function e(r){return HI(r.splitter,r.fields,r.commands)}function t(r,n){return te(r)&&te(n)&&fe("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}var qa,My=g({"src/lib/tasks/log.ts"(){"use strict";dn(),an(),Ly(),C(),W(),pc(),qa=(e=>(e[e["--pretty"]=0]="--pretty",e[e["max-count"]=1]="max-count",e[e.maxCount=2]="maxCount",e[e.n=3]="n",e[e.file=4]="file",e[e.format=5]="format",e[e.from=6]="from",e[e.to=7]="to",e[e.splitter=8]="splitter",e[e.symmetric=9]="symmetric",e[e.mailMap=10]="mailMap",e[e.multiLine=11]="multiLine",e[e.strictDate=12]="strictDate",e))(qa||{})}}),Js,Fy,XI=g({"src/lib/responses/MergeSummary.ts"(){"use strict";Js=class{constructor(e,t=null,r){this.reason=e,this.file=t,this.meta=r}toString(){return`${this.file}:${this.reason}`}},Fy=class{constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(", ")}`:"OK"}}}}),Va,jy,KI=g({"src/lib/responses/PullSummary.ts"(){"use strict";Va=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},jy=class{constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function $a(e){return e.objects=e.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function ag(e){let t=/^\s*(\d+)/.exec(e),r=/delta (\d+)/i.exec(e);return{count:B(t&&t[1]||"0"),delta:B(r&&r[1]||"0")}}var By,JI=g({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";C(),By=[new pt(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(e,[t,r])=>{let n=t.toLowerCase(),s=$a(e.remoteMessages);Object.assign(s,{[n]:B(r)})}),new pt(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(e,[t,r])=>{let n=t.toLowerCase(),s=$a(e.remoteMessages);Object.assign(s,{[n]:B(r)})}),new pt(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(e,[t,r,n])=>{let s=$a(e.remoteMessages);s.total=ag(t),s.reused=ag(r),s.packReused=B(n)})]}});function Uy(e,t){return de({remoteMessages:new qy},Gy,t)}var Gy,qy,Vy=g({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";C(),JI(),Gy=[new pt(/^remote:\s*(.+)$/,(e,[t])=>(e.remoteMessages.all.push(t.trim()),!1)),...By,new pt([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(e,[t])=>{e.remoteMessages.pullRequestUrl=t}),new pt([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(e,[t,r,n])=>{e.remoteMessages.vulnerabilities={count:B(t),summary:r,url:n}})],qy=class{constructor(){this.all=[]}}}});function QI(e,t){let r=de(new jy,zy,[e,t]);return r.message&&r}var cg,ug,lg,fg,zy,dg,mc,Wy=g({"src/lib/parsers/parse-pull.ts"(){"use strict";KI(),C(),Vy(),cg=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,ug=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,lg=/^(create|delete) mode \d+ (.+)/,fg=[new I(cg,(e,[t,r,n])=>{e.files.push(t),r&&(e.insertions[t]=r.length),n&&(e.deletions[t]=n.length)}),new I(ug,(e,[t,,r,,n])=>r!==void 0||n!==void 0?(e.summary.changes=+t||0,e.summary.insertions=+r||0,e.summary.deletions=+n||0,!0):!1),new I(lg,(e,[t,r])=>{F(e.files,r),F(t==="create"?e.created:e.deleted,r)})],zy=[new I(/^from\s(.+)$/i,(e,[t])=>void(e.remote=t)),new I(/^fatal:\s(.+)$/,(e,[t])=>void(e.message=t)),new I(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(e,[t,r,n,s])=>{e.branch.local=n,e.hash.local=t,e.branch.remote=s,e.hash.remote=r})],dg=(e,t)=>de(new Va,fg,[e,t]),mc=(e,t)=>Object.assign(new Va,dg(e,t),Uy(e,t))}}),pg,Zy,mg,e1=g({"src/lib/parsers/parse-merge.ts"(){"use strict";XI(),C(),Wy(),pg=[new I(/^Auto-merging\s+(.+)$/,(e,[t])=>{e.merges.push(t)}),new I(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(e,[t,r])=>{e.conflicts.push(new Js(t,r))}),new I(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(e,[t,r,n])=>{e.conflicts.push(new Js(t,r,{deleteRef:n}))}),new I(/^CONFLICT\s+\((.+)\):/,(e,[t])=>{e.conflicts.push(new Js(t,null))}),new I(/^Automatic merge failed;\s+(.+)$/,(e,[t])=>{e.result=t})],Zy=(e,t)=>Object.assign(mg(e,t),mc(e,t)),mg=e=>de(new Fy,pg,e)}});function hg(e){return e.length?{commands:["merge",...e],format:"utf-8",parser(t,r){let n=Zy(t,r);if(n.failed)throw new cn(n);return n}}:fe("Git.merge requires at least one option")}var t1=g({"src/lib/tasks/merge.ts"(){"use strict";_r(),e1(),W()}});function r1(e,t,r){let n=r.includes("deleted"),s=r.includes("tag")||/^refs\/tags/.test(e),o=!r.includes("new");return{deleted:n,tag:s,branch:!s,new:!o,alreadyUpdated:o,local:e,remote:t}}var gg,Hy,yg,n1=g({"src/lib/parsers/parse-push.ts"(){"use strict";C(),Vy(),gg=[new I(/^Pushing to (.+)$/,(e,[t])=>{e.repo=t}),new I(/^updating local tracking ref '(.+)'/,(e,[t])=>{e.ref=rn(Ce({},e.ref||{}),{local:t})}),new I(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(e,[t,r,n])=>{e.pushed.push(r1(t,r,n))}),new I(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(e,[t,r,n])=>{e.branch=rn(Ce({},e.branch||{}),{local:t,remote:r,remoteName:n})}),new I(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(e,[t,r,n,s])=>{e.update={head:{local:t,remote:r},hash:{from:n,to:s}}})],Hy=(e,t)=>{let r=yg(e,t),n=Uy(e,t);return Ce(Ce({},r),n)},yg=(e,t)=>de({pushed:[]},gg,[e,t])}}),Yy={};Z(Yy,{pushTagsTask:()=>s1,pushTask:()=>hc});function s1(e={},t){return F(t,"--tags"),hc(e,t)}function hc(e={},t){let r=["push",...t];return e.branch&&r.splice(1,0,e.branch),e.remote&&r.splice(1,0,e.remote),io(r,"-v"),F(r,"--verbose"),F(r,"--porcelain"),{commands:r,format:"utf-8",parser:Hy}}var Xy=g({"src/lib/tasks/push.ts"(){"use strict";n1(),C()}});function o1(){return{showBuffer(){let e=["show",...le(arguments,1)];return e.includes("--binary")||e.splice(1,0,"--binary"),this._runTask(ny(e),V(arguments))},show(){let e=["show",...le(arguments,1)];return this._runTask(ie(e),V(arguments))}}}var i1=g({"src/lib/tasks/show.ts"(){"use strict";C(),W()}}),bg,Ky,a1=g({"src/lib/responses/FileStatusSummary.ts"(){"use strict";bg=/^(.+)\0(.+)$/,Ky=class{constructor(e,t,r){if(this.path=e,this.index=t,this.working_dir=r,t==="R"||r==="R"){let n=bg.exec(e)||[null,e,e];this.from=n[2]||"",this.path=n[1]||""}}}}});function wg(e){let[t,r]=e.split(vr);return{from:r||t,to:t}}function we(e,t,r){return[`${e}${t}`,r]}function Da(e,...t){return t.map(r=>we(e,r,(n,s)=>F(n.conflicted,s)))}function c1(e,t){let r=t.trim();switch(" "){case r.charAt(2):return n(r.charAt(0),r.charAt(1),r.substr(3));case r.charAt(1):return n(" ",r.charAt(0),r.substr(2));default:return}function n(s,o,i){let a=`${s}${o}`,c=Jy.get(a);c&&c(e,i),a!=="##"&&a!=="!!"&&e.files.push(new Ky(i,s,o))}}var Sg,Jy,Qy,u1=g({"src/lib/responses/StatusSummary.ts"(){"use strict";C(),a1(),Sg=class{constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},Jy=new Map([we(" ","A",(e,t)=>F(e.created,t)),we(" ","D",(e,t)=>F(e.deleted,t)),we(" ","M",(e,t)=>F(e.modified,t)),we("A"," ",(e,t)=>F(e.created,t)&&F(e.staged,t)),we("A","M",(e,t)=>F(e.created,t)&&F(e.staged,t)&&F(e.modified,t)),we("D"," ",(e,t)=>F(e.deleted,t)&&F(e.staged,t)),we("M"," ",(e,t)=>F(e.modified,t)&&F(e.staged,t)),we("M","M",(e,t)=>F(e.modified,t)&&F(e.staged,t)),we("R"," ",(e,t)=>{F(e.renamed,wg(t))}),we("R","M",(e,t)=>{let r=wg(t);F(e.renamed,r),F(e.modified,r.to)}),we("!","!",(e,t)=>{F(e.ignored=e.ignored||[],t)}),we("?","?",(e,t)=>F(e.not_added,t)),...Da("A","A","U"),...Da("D","D","U"),...Da("U","A","D","U"),["##",(e,t)=>{let r=/ahead (\d+)/,n=/behind (\d+)/,s=/^(.+?(?=(?:\.{3}|\s|$)))/,o=/\.{3}(\S*)/,i=/\son\s([\S]+)$/,a;a=r.exec(t),e.ahead=a&&+a[1]||0,a=n.exec(t),e.behind=a&&+a[1]||0,a=s.exec(t),e.current=a&&a[1],a=o.exec(t),e.tracking=a&&a[1],a=i.exec(t),e.current=a&&a[1]||e.current,e.detached=/\(no branch\)/.test(t)}]]),Qy=function(e){let t=e.split(vr),r=new Sg;for(let n=0,s=t.length;n<s;){let o=t[n++].trim();o&&(o.charAt(0)==="R"&&(o+=vr+(t[n++]||"")),c1(r,o))}return r}}});function l1(e){return{format:"utf-8",commands:["status","--porcelain","-b","-u","--null",...e.filter(r=>!eb.includes(r))],parser(r){return Qy(r)}}}var eb,f1=g({"src/lib/tasks/status.ts"(){"use strict";u1(),eb=["--null","-z"]}});function ro(e=0,t=0,r=0,n="",s=!0){return Object.defineProperty({major:e,minor:t,patch:r,agent:n,installed:s},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function d1(){return ro(0,0,0,"",!1)}function p1(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:m1,onError(e,t,r,n){if(e.exitCode===-2)return r(Buffer.from(gc));n(t)}})}}}function m1(e){return e===gc?d1():de(ro(0,0,0,e),tb,e)}var gc,tb,h1=g({"src/lib/tasks/version.ts"(){"use strict";C(),gc="installed=false",tb=[new I(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(e,[t,r,n,s=""])=>{Object.assign(e,ro(B(t),B(r),B(n),s))}),new I(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(e,[t,r,n,s=""])=>{Object.assign(e,ro(B(t),B(r),n,s))})]}}),rb={};Z(rb,{SimpleGitApi:()=>za});var za,g1=g({"src/lib/simple-git-api.ts"(){"use strict";xI(),vI(),EI(),RI(),$I(),fy(),LI(),gy(),PI(),UI(),My(),t1(),Xy(),i1(),f1(),W(),h1(),C(),za=class{constructor(e){this._executor=e}_runTask(e,t){let r=this._executor.chain(),n=r.push(e);return t&&wI(e,n,t),Object.create(this,{then:{value:n.then.bind(n)},catch:{value:n.catch.bind(n)},_executor:{value:r}})}add(e){return this._runTask(ie(["add",...Ze(e)]),V(arguments))}cwd(e){let t=V(arguments);return typeof e=="string"?this._runTask(ng(e,this._executor),t):typeof e?.path=="string"?this._runTask(ng(e.path,e.root&&this._executor||void 0),t):this._runTask(fe("Git.cwd: workingDirectory must be supplied as a string"),t)}hashObject(e,t){return this._runTask(NI(e,t===!0),V(arguments))}init(e){return this._runTask(BI(e===!0,this._executor.cwd,le(arguments)),V(arguments))}merge(){return this._runTask(hg(le(arguments)),V(arguments))}mergeFromTo(e,t){return te(e)&&te(t)?this._runTask(hg([e,t,...le(arguments)]),V(arguments,!1)):this._runTask(fe("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(e){return this._executor.outputHandler=e,this}push(){let e=hc({remote:He(arguments[0],te),branch:He(arguments[1],te)},le(arguments));return this._runTask(e,V(arguments))}stash(){return this._runTask(ie(["stash",...le(arguments)]),V(arguments))}status(){return this._runTask(l1(le(arguments)),V(arguments))}},Object.assign(za.prototype,_I(),II(),oI(),OI(),DI(),uI(),YI(),o1(),p1())}}),nb={};Z(nb,{Scheduler:()=>ob});var xg,ob,y1=g({"src/lib/runners/scheduler.ts"(){"use strict";C(),xy(),xg=(()=>{let e=0;return()=>{e++;let{promise:t,done:r}=(0,sb.createDeferred)();return{promise:t,done:r,id:e}}})(),ob=class{constructor(e=2){this.concurrency=e,this.logger=ic("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",e)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger("Schedule attempt ignored, pending=%s running=%s concurrency=%s",this.pending.length,this.running.length,this.concurrency);return}let e=F(this.running,this.pending.shift());this.logger("Attempting id=%s",e.id),e.done(()=>{this.logger("Completing id=",e.id),io(this.running,e),this.schedule()})}next(){let{promise:e,id:t}=F(this.pending,xg());return this.logger("Scheduling id=%s",t),this.schedule(),e}}}}),ib={};Z(ib,{applyPatchTask:()=>b1});function b1(e,t){return ie(["apply",...t,...e])}var w1=g({"src/lib/tasks/apply-patch.ts"(){"use strict";W()}});function S1(e,t){return{branch:e,hash:t,success:!0}}function x1(e){return{branch:e,hash:null,success:!1}}var ab,v1=g({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";ab=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function cb(e,t){return t===1&&Wa.test(e)}var vg,Wa,_g,fo,_1=g({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";v1(),C(),vg=/(\S+)\s+\(\S+\s([^)]+)\)/,Wa=/^error[^']+'([^']+)'/m,_g=[new I(vg,(e,[t,r])=>{let n=S1(t,r);e.all.push(n),e.branches[t]=n}),new I(Wa,(e,[t])=>{let r=x1(t);e.errors.push(r),e.all.push(r),e.branches[t]=r})],fo=(e,t)=>de(new ab,_g,[e,t])}}),ub,E1=g({"src/lib/responses/BranchSummary.ts"(){"use strict";ub=class{constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(e,t,r,n,s){e==="*"&&(this.detached=t,this.current=r),this.all.push(r),this.branches[r]={current:e==="*",linkedWorkTree:e==="+",name:r,commit:n,label:s}}}}});function Eg(e){return e?e.charAt(0):""}function lb(e){return de(new ub,fb,e)}var fb,T1=g({"src/lib/parsers/parse-branch.ts"(){"use strict";E1(),C(),fb=[new I(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(e,[t,r,n,s])=>{e.push(Eg(t),!0,r,n,s)}),new I(new RegExp("^([*+]\\s)?(\\S+)\\s+([a-z0-9]+)\\s?(.*)$","s"),(e,[t,r,n,s])=>{e.push(Eg(t),!1,r,n,s)})]}}),db={};Z(db,{branchLocalTask:()=>R1,branchTask:()=>O1,containsDeleteBranchCommand:()=>pb,deleteBranchTask:()=>C1,deleteBranchesTask:()=>k1});function pb(e){let t=["-d","-D","--delete"];return e.some(r=>t.includes(r))}function O1(e){let t=pb(e),r=["branch",...e];return r.length===1&&r.push("-a"),r.includes("-v")||r.splice(1,0,"-v"),{format:"utf-8",commands:r,parser(n,s){return t?fo(n,s).all[0]:lb(n)}}}function R1(){return{format:"utf-8",commands:["branch","-v"],parser:lb}}function k1(e,t=!1){return{format:"utf-8",commands:["branch","-v",t?"-D":"-d",...e],parser(r,n){return fo(r,n)},onError({exitCode:r,stdOut:n},s,o,i){if(!cb(String(s),r))return i(s);o(n)}}}function C1(e,t=!1){let r={format:"utf-8",commands:["branch","-v",t?"-D":"-d",e],parser(n,s){return fo(n,s).branches[e]},onError({exitCode:n,stdErr:s,stdOut:o},i,a,c){if(!cb(String(i),n))return c(i);throw new cn(r.parser(sn(o),sn(s)),String(i))}};return r}var A1=g({"src/lib/tasks/branch.ts"(){"use strict";_r(),_1(),T1(),C()}}),mb,I1=g({"src/lib/responses/CheckIgnore.ts"(){"use strict";mb=e=>e.split(/\n/g).map(t=>t.trim()).filter(t=>!!t)}}),hb={};Z(hb,{checkIgnoreTask:()=>$1});function $1(e){return{commands:["check-ignore",...e],format:"utf-8",parser:mb}}var D1=g({"src/lib/tasks/check-ignore.ts"(){"use strict";I1()}}),gb={};Z(gb,{cloneMirrorTask:()=>N1,cloneTask:()=>yb});function L1(e){return/^--upload-pack(=|$)/.test(e)}function yb(e,t,r){let n=["clone",...r];return te(e)&&n.push(e),te(t)&&n.push(t),n.find(L1)?fe("git.fetch: potential exploit argument blocked."):ie(n)}function N1(e,t,r){return F(r,"--mirror"),yb(e,t,r)}var P1=g({"src/lib/tasks/clone.ts"(){"use strict";W(),C()}});function M1(e,t){return de({raw:e,remote:null,branches:[],tags:[],updated:[],deleted:[]},bb,[e,t])}var bb,F1=g({"src/lib/parsers/parse-fetch.ts"(){"use strict";C(),bb=[new I(/From (.+)$/,(e,[t])=>{e.remote=t}),new I(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(e,[t,r])=>{e.branches.push({name:t,tracking:r})}),new I(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(e,[t,r])=>{e.tags.push({name:t,tracking:r})}),new I(/- \[deleted]\s+\S+\s*-> (.+)$/,(e,[t])=>{e.deleted.push({tracking:t})}),new I(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(e,[t,r,n,s])=>{e.updated.push({name:n,tracking:s,to:r,from:t})})]}}),wb={};Z(wb,{fetchTask:()=>B1});function j1(e){return/^--upload-pack(=|$)/.test(e)}function B1(e,t,r){let n=["fetch",...r];return e&&t&&n.push(e,t),n.find(j1)?fe("git.fetch: potential exploit argument blocked."):{commands:n,format:"utf-8",parser:M1}}var U1=g({"src/lib/tasks/fetch.ts"(){"use strict";F1(),W()}});function G1(e){return de({moves:[]},Sb,e)}var Sb,q1=g({"src/lib/parsers/parse-move.ts"(){"use strict";C(),Sb=[new I(/^Renaming (.+) to (.+)$/,(e,[t,r])=>{e.moves.push({from:t,to:r})})]}}),xb={};Z(xb,{moveTask:()=>V1});function V1(e,t){return{commands:["mv","-v",...Ze(e),t],format:"utf-8",parser:G1}}var z1=g({"src/lib/tasks/move.ts"(){"use strict";q1(),C()}}),vb={};Z(vb,{pullTask:()=>W1});function W1(e,t,r){let n=["pull",...r];return e&&t&&n.splice(1,0,e,t),{commands:n,format:"utf-8",parser(s,o){return mc(s,o)},onError(s,o,i,a){let c=QI(sn(s.stdOut),sn(s.stdErr));if(c)return a(new cn(c));a(o)}}}var Z1=g({"src/lib/tasks/pull.ts"(){"use strict";_r(),Wy(),C()}});function H1(e){let t={};return _b(e,([r])=>t[r]={name:r}),Object.values(t)}function Y1(e){let t={};return _b(e,([r,n,s])=>{t.hasOwnProperty(r)||(t[r]={name:r,refs:{fetch:"",push:""}}),s&&n&&(t[r].refs[s.replace(/[^a-z]/g,"")]=n)}),Object.values(t)}function _b(e,t){Ha(e,r=>t(r.split(/\s+/)))}var X1=g({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";C()}}),Eb={};Z(Eb,{addRemoteTask:()=>K1,getRemotesTask:()=>J1,listRemotesTask:()=>Q1,remoteTask:()=>e$,removeRemoteTask:()=>t$});function K1(e,t,r){return ie(["remote","add",...r,e,t])}function J1(e){let t=["remote"];return e&&t.push("-v"),{commands:t,format:"utf-8",parser:e?Y1:H1}}function Q1(e){let t=[...e];return t[0]!=="ls-remote"&&t.unshift("ls-remote"),ie(t)}function e$(e){let t=[...e];return t[0]!=="remote"&&t.unshift("remote"),ie(t)}function t$(e){return ie(["remote","remove",e])}var r$=g({"src/lib/tasks/remote.ts"(){"use strict";X1(),W()}}),Tb={};Z(Tb,{stashListTask:()=>n$});function n$(e={},t){let r=Py(e),n=["stash","list",...r.commands,...t],s=$y(r.splitter,r.fields,cc(n));return lo(n)||{commands:n,format:"utf-8",parser:s}}var s$=g({"src/lib/tasks/stash-list.ts"(){"use strict";dn(),Ly(),pc(),My()}}),Ob={};Z(Ob,{addSubModuleTask:()=>o$,initSubModuleTask:()=>i$,subModuleTask:()=>po,updateSubModuleTask:()=>a$});function o$(e,t){return po(["add",e,t])}function i$(e){return po(["init",...e])}function po(e){let t=[...e];return t[0]!=="submodule"&&t.unshift("submodule"),ie(t)}function a$(e){return po(["update",...e])}var c$=g({"src/lib/tasks/sub-module.ts"(){"use strict";W()}});function u$(e,t){let r=isNaN(e),n=isNaN(t);return r!==n?r?1:-1:r?Rb(e,t):0}function Rb(e,t){return e===t?0:e>t?1:-1}function l$(e){return e.trim()}function Hs(e){return typeof e=="string"&&parseInt(e.replace(/^\D+/g,""),10)||0}var Tg,kb,f$=g({"src/lib/responses/TagList.ts"(){"use strict";Tg=class{constructor(e,t){this.all=e,this.latest=t}},kb=function(e,t=!1){let r=e.split(`
59
+ `).map(l$).filter(Boolean);t||r.sort(function(s,o){let i=s.split("."),a=o.split(".");if(i.length===1||a.length===1)return u$(Hs(i[0]),Hs(a[0]));for(let c=0,u=Math.max(i.length,a.length);c<u;c++){let l=Rb(Hs(i[c]),Hs(a[c]));if(l)return l}return 0});let n=t?r[0]:[...r].reverse().find(s=>s.indexOf(".")>=0);return new Tg(r,n)}}}),Cb={};Z(Cb,{addAnnotatedTagTask:()=>m$,addTagTask:()=>p$,tagListTask:()=>d$});function d$(e=[]){let t=e.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...e],parser(r){return kb(r,t)}}}function p$(e){return{format:"utf-8",commands:["tag",e],parser(){return{name:e}}}}function m$(e,t){return{format:"utf-8",commands:["tag","-a","-m",t,e],parser(){return{name:e}}}}var h$=g({"src/lib/tasks/tag.ts"(){"use strict";f$()}}),g$=$A({"src/git.js"(e,t){"use strict";var{GitExecutor:r}=(bI(),q(vy)),{SimpleGitApi:n}=(g1(),q(rb)),{Scheduler:s}=(y1(),q(nb)),{configurationErrorTask:o}=(W(),q(ja)),{asArray:i,filterArray:a,filterPrimitives:c,filterString:u,filterStringOrStringArray:l,filterType:f,getTrailingOptions:p,trailingFunctionArgument:d,trailingOptionsArgument:b}=(C(),q(Zg)),{applyPatchTask:T}=(w1(),q(ib)),{branchTask:N,branchLocalTask:P,deleteBranchesTask:U,deleteBranchTask:H}=(A1(),q(db)),{checkIgnoreTask:Y}=(D1(),q(hb)),{checkIsRepoTask:Se}=(Kg(),q(Hg)),{cloneTask:ae,cloneMirrorTask:Ae}=(P1(),q(gb)),{cleanWithOptionsTask:Ie,isCleanOptionsArray:xe}=(cy(),q(iy)),{diffSummaryTask:Er}=(pc(),q(Ny)),{fetchTask:ht}=(U1(),q(wb)),{moveTask:Gb}=(z1(),q(xb)),{pullTask:qb}=(Z1(),q(vb)),{pushTagsTask:Vb}=(Xy(),q(Yy)),{addRemoteTask:zb,getRemotesTask:Wb,listRemotesTask:Zb,remoteTask:Hb,removeRemoteTask:Yb}=(r$(),q(Eb)),{getResetMode:Xb,resetTask:Kb}=(Sy(),q(yy)),{stashListTask:Jb}=(s$(),q(Tb)),{addSubModuleTask:Qb,initSubModuleTask:ew,subModuleTask:tw,updateSubModuleTask:rw}=(c$(),q(Ob)),{addAnnotatedTagTask:nw,addTagTask:sw,tagListTask:ow}=(h$(),q(Cb)),{straightThroughBufferTask:iw,straightThroughStringTask:Fe}=(W(),q(ja));function O(h,E){this._plugins=E,this._executor=new r(h.baseDir,new s(h.maxConcurrentProcesses),E),this._trimmed=h.trimmed}(O.prototype=Object.create(n.prototype)).constructor=O,O.prototype.customBinary=function(h){return this._plugins.reconfigure("binary",h),this},O.prototype.env=function(h,E){return arguments.length===1&&typeof h=="object"?this._executor.env=h:(this._executor.env=this._executor.env||{})[h]=E,this},O.prototype.stashList=function(h){return this._runTask(Jb(b(arguments)||{},a(h)&&h||[]),d(arguments))};function xc(h,E,j,re){return typeof j!="string"?o(`git.${h}() requires a string 'repoPath'`):E(j,f(re,u),p(arguments))}O.prototype.clone=function(){return this._runTask(xc("clone",ae,...arguments),d(arguments))},O.prototype.mirror=function(){return this._runTask(xc("mirror",Ae,...arguments),d(arguments))},O.prototype.mv=function(h,E){return this._runTask(Gb(h,E),d(arguments))},O.prototype.checkoutLatestTag=function(h){var E=this;return this.pull(function(){E.tags(function(j,re){E.checkout(re.latest,h)})})},O.prototype.pull=function(h,E,j,re){return this._runTask(qb(f(h,u),f(E,u),p(arguments)),d(arguments))},O.prototype.fetch=function(h,E){return this._runTask(ht(f(h,u),f(E,u),p(arguments)),d(arguments))},O.prototype.silent=function(h){return console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3"),this},O.prototype.tags=function(h,E){return this._runTask(ow(p(arguments)),d(arguments))},O.prototype.rebase=function(){return this._runTask(Fe(["rebase",...p(arguments)]),d(arguments))},O.prototype.reset=function(h){return this._runTask(Kb(Xb(h),p(arguments)),d(arguments))},O.prototype.revert=function(h){let E=d(arguments);return typeof h!="string"?this._runTask(o("Commit must be a string"),E):this._runTask(Fe(["revert",...p(arguments,0,!0),h]),E)},O.prototype.addTag=function(h){let E=typeof h=="string"?sw(h):o("Git.addTag requires a tag name");return this._runTask(E,d(arguments))},O.prototype.addAnnotatedTag=function(h,E){return this._runTask(nw(h,E),d(arguments))},O.prototype.deleteLocalBranch=function(h,E,j){return this._runTask(H(h,typeof E=="boolean"?E:!1),d(arguments))},O.prototype.deleteLocalBranches=function(h,E,j){return this._runTask(U(h,typeof E=="boolean"?E:!1),d(arguments))},O.prototype.branch=function(h,E){return this._runTask(N(p(arguments)),d(arguments))},O.prototype.branchLocal=function(h){return this._runTask(P(),d(arguments))},O.prototype.raw=function(h){let E=!Array.isArray(h),j=[].slice.call(E?arguments:h,0);for(let $e=0;$e<j.length&&E;$e++)if(!c(j[$e])){j.splice($e,j.length-$e);break}j.push(...p(arguments,0,!0));var re=d(arguments);return j.length?this._runTask(Fe(j,this._trimmed),re):this._runTask(o("Raw: must supply one or more command to execute"),re)},O.prototype.submoduleAdd=function(h,E,j){return this._runTask(Qb(h,E),d(arguments))},O.prototype.submoduleUpdate=function(h,E){return this._runTask(rw(p(arguments,!0)),d(arguments))},O.prototype.submoduleInit=function(h,E){return this._runTask(ew(p(arguments,!0)),d(arguments))},O.prototype.subModule=function(h,E){return this._runTask(tw(p(arguments)),d(arguments))},O.prototype.listRemote=function(){return this._runTask(Zb(p(arguments)),d(arguments))},O.prototype.addRemote=function(h,E,j){return this._runTask(zb(h,E,p(arguments)),d(arguments))},O.prototype.removeRemote=function(h,E){return this._runTask(Yb(h),d(arguments))},O.prototype.getRemotes=function(h,E){return this._runTask(Wb(h===!0),d(arguments))},O.prototype.remote=function(h,E){return this._runTask(Hb(p(arguments)),d(arguments))},O.prototype.tag=function(h,E){let j=p(arguments);return j[0]!=="tag"&&j.unshift("tag"),this._runTask(Fe(j),d(arguments))},O.prototype.updateServerInfo=function(h){return this._runTask(Fe(["update-server-info"]),d(arguments))},O.prototype.pushTags=function(h,E){let j=Vb({remote:f(h,u)},p(arguments));return this._runTask(j,d(arguments))},O.prototype.rm=function(h){return this._runTask(Fe(["rm","-f",...i(h)]),d(arguments))},O.prototype.rmKeepLocal=function(h){return this._runTask(Fe(["rm","--cached",...i(h)]),d(arguments))},O.prototype.catFile=function(h,E){return this._catFile("utf-8",arguments)},O.prototype.binaryCatFile=function(){return this._catFile("buffer",arguments)},O.prototype._catFile=function(h,E){var j=d(E),re=["cat-file"],$e=E[0];if(typeof $e=="string")return this._runTask(o("Git.catFile: options must be supplied as an array of strings"),j);Array.isArray($e)&&re.push.apply(re,$e);let bo=h==="buffer"?iw(re):Fe(re);return this._runTask(bo,j)},O.prototype.diff=function(h,E){let j=u(h)?o("git.diff: supplying options as a single string is no longer supported, switch to an array of strings"):Fe(["diff",...p(arguments)]);return this._runTask(j,d(arguments))},O.prototype.diffSummary=function(){return this._runTask(Er(p(arguments,1)),d(arguments))},O.prototype.applyPatch=function(h){let E=l(h)?T(i(h),p([].slice.call(arguments,1))):o("git.applyPatch requires one or more string patches as the first argument");return this._runTask(E,d(arguments))},O.prototype.revparse=function(){let h=["rev-parse",...p(arguments,!0)];return this._runTask(Fe(h,!0),d(arguments))},O.prototype.clean=function(h,E,j){let re=xe(h),$e=re&&h.join("")||f(h,u)||"",bo=p([].slice.call(arguments,re?1:0));return this._runTask(Ie($e,bo),d(arguments))},O.prototype.exec=function(h){let E={commands:[],format:"utf-8",parser(){typeof h=="function"&&h()}};return this._runTask(E)},O.prototype.clearQueue=function(){return this},O.prototype.checkIgnore=function(h,E){return this._runTask(Y(i(f(h,l,[]))),d(arguments))},O.prototype.checkIsRepo=function(h,E){return this._runTask(Se(f(h,u)),d(arguments))},t.exports=O}});an();mt();var y$=class extends ot{constructor(e,t){super(void 0,t),this.config=e}};mt();mt();var st=class extends ot{constructor(e,t,r){super(e,r),this.task=e,this.plugin=t,Object.setPrototypeOf(this,new.target.prototype)}};_r();$g();Kg();cy();fy();py();gy();Sy();function b$(e){return e?[{type:"spawn.before",action(n,s){e.aborted&&s.kill(new st(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(n,s){function o(){s.kill(new st(void 0,"abort","Abort signal received"))}e.addEventListener("abort",o),s.spawned.on("close",()=>e.removeEventListener("abort",o))}}]:void 0}function w$(e){return typeof e=="string"&&e.trim().toLowerCase()==="-c"}function S$(e,t){if(w$(e)&&/^\s*protocol(.[a-z]+)?.allow/.test(t))throw new st(void 0,"unsafe","Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol")}function x$(e,t){if(/^\s*--(upload|receive)-pack/.test(e))throw new st(void 0,"unsafe","Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack");if(t==="clone"&&/^\s*-u\b/.test(e))throw new st(void 0,"unsafe","Use of clone with option -u is not permitted without enabling allowUnsafePack");if(t==="push"&&/^\s*--exec\b/.test(e))throw new st(void 0,"unsafe","Use of push with option --exec is not permitted without enabling allowUnsafePack")}function v$({allowUnsafeProtocolOverride:e=!1,allowUnsafePack:t=!1}={}){return{type:"spawn.args",action(r,n){return r.forEach((s,o)=>{let i=o<r.length?r[o+1]:"";e||S$(s,i),t||x$(s,n.method)}),r}}}C();function _$(e){let t=nn(e,"-c");return{type:"spawn.args",action(r){return[...t,...r]}}}C();var Og=(0,xr.deferred)().promise;function E$({onClose:e=!0,onExit:t=50}={}){function r(){let s=-1,o={close:(0,xr.deferred)(),closeTimeout:(0,xr.deferred)(),exit:(0,xr.deferred)(),exitTimeout:(0,xr.deferred)()},i=Promise.race([e===!1?Og:o.closeTimeout.promise,t===!1?Og:o.exitTimeout.promise]);return n(e,o.close,o.closeTimeout),n(t,o.exit,o.exitTimeout),{close(a){s=a,o.close.done()},exit(a){s=a,o.exit.done()},get exitCode(){return s},result:i}}function n(s,o,i){s!==!1&&(s===!0?o.promise:o.promise.then(()=>La(s))).then(i.done)}return{type:"spawn.after",action(s,o){return tn(this,arguments,function*(i,{spawned:a,close:c}){var u,l;let f=r(),p=!0,d=()=>void(p=!1);(u=a.stdout)==null||u.on("data",d),(l=a.stderr)==null||l.on("data",d),a.on("error",d),a.on("close",b=>f.close(b)),a.on("exit",b=>f.exit(b));try{yield f.result,p&&(yield La(50)),c(f.exitCode)}catch(b){c(f.exitCode,b)}})}}}C();var T$="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",Rg="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function O$(e){return!e||!/^([a-z]:)?([a-z0-9/.\\_-]+)$/i.test(e)}function kg(e,t){if(e.length<1||e.length>2)throw new st(void 0,"binary",T$);if(e.some(O$))if(t)console.warn(Rg);else throw new st(void 0,"binary",Rg);let[n,s]=e;return{binary:n,prefix:s}}function R$(e,t=["git"],r=!1){let n=kg(Ze(t),r);e.on("binary",s=>{n=kg(Ze(s),r)}),e.append("spawn.binary",()=>n.binary),e.append("spawn.args",s=>n.prefix?[n.prefix,...s]:s)}mt();function k$(e){return!!(e.exitCode&&e.stdErr.length)}function C$(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function A$(e=!1,t=k$,r=C$){return(n,s)=>!e&&n||!t(s)?n:r(s)}function Cg(e){return{type:"task.error",action(t,r){let n=e(t.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});return Buffer.isBuffer(n)?{error:new ot(void 0,n.toString("utf-8"))}:{error:n}}}}C();var $$=class{constructor(){this.plugins=new Set,this.events=new I$}on(e,t){this.events.on(e,t)}reconfigure(e,t){this.events.emit(e,t)}append(e,t){let r=F(this.plugins,{type:e,action:t});return()=>this.plugins.delete(r)}add(e){let t=[];return Ze(e).forEach(r=>r&&this.plugins.add(F(t,r))),()=>{t.forEach(r=>this.plugins.delete(r))}}exec(e,t,r){let n=t,s=Object.freeze(Object.create(r));for(let o of this.plugins)o.type===e&&(n=o.action(n,s));return n}};C();function D$(e){let t="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(o,i){return r.includes(i.method)?Fg(o,t):o}},{type:"spawn.after",action(o,i){var a;i.commands.includes(t)&&((a=i.spawned.stderr)==null||a.on("data",c=>{let u=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(c.toString("utf8"));u&&e({method:i.method,stage:L$(u[1]),progress:B(u[2]),processed:B(u[3]),total:B(u[4])})}))}}]}function L$(e){return String(e.toLowerCase().split(" ",1))||"unknown"}C();function N$(e){let t=Ug(e,["uid","gid"]);return{type:"spawn.options",action(r){return Ce(Ce({},t),r)}}}function P$({block:e,stdErr:t=!0,stdOut:r=!0}){if(e>0)return{type:"spawn.after",action(n,s){var o,i;let a;function c(){a&&clearTimeout(a),a=setTimeout(l,e)}function u(){var f,p;(f=s.spawned.stdout)==null||f.off("data",c),(p=s.spawned.stderr)==null||p.off("data",c),s.spawned.off("exit",u),s.spawned.off("close",u),a&&clearTimeout(a)}function l(){u(),s.kill(new st(void 0,"timeout","block timeout reached"))}r&&((o=s.spawned.stdout)==null||o.on("data",c)),t&&((i=s.spawned.stderr)==null||i.on("data",c)),s.spawned.on("exit",u),s.spawned.on("close",u),c()}}}an();function M$(){return{type:"spawn.args",action(e){let t=[],r;function n(s){(r=r||[]).push(...s)}for(let s=0;s<e.length;s++){let o=e[s];if(Qs(o)){n(Qh(o));continue}if(o==="--"){n(e.slice(s+1).flatMap(i=>Qs(i)&&Qh(i)||i));break}t.push(o)}return r?[...t,"--",...r.map(String)]:t}}}C();var F$=g$();function j$(e,t){var r;let n=new $$,s=zg(e&&(typeof e=="string"?{baseDir:e}:e)||{},t);if(!Ya(s.baseDir))throw new y$(s,"Cannot use simple-git on a directory that does not exist");return Array.isArray(s.config)&&n.add(_$(s.config)),n.add(v$(s.unsafe)),n.add(M$()),n.add(E$(s.completion)),s.abort&&n.add(b$(s.abort)),s.progress&&n.add(D$(s.progress)),s.timeout&&n.add(P$(s.timeout)),s.spawnOptions&&n.add(N$(s.spawnOptions)),n.add(Cg(A$(!0))),s.errors&&n.add(Cg(s.errors)),R$(n,s.binary,(r=s.unsafe)==null?void 0:r.allowUnsafeCustomBinary),new F$(s,n)}_r();var Ab=j$;async function Ib(){let e=Ab();try{let{current:t}=await e.branchLocal(),r=(await e.getRemotes(!0)).map(({name:o,refs:{fetch:i}})=>({name:o,url:i})),n=r.find(({name:o})=>o==="origin")??r[0];return{possibleRepositoryName:n?n.url.split("/").slice(-2).join("/").replace(/\.git$/,""):(await e.revparse(["--show-toplevel"])).split("/").pop(),branch:t,remotes:r}}catch{return null}}var Nb=gt(Lb(),1),bc=Nb.default.bold("@seed-design/codemod"),Pb=e=>({event:t,properties:r})=>console.log(bc,t,r,e);var Mb=Sc(z$(import.meta.filename),"transforms"),Fb=Rc(),jb=V$(import.meta.url),go=jb("../package.json"),Bb=await Ib(),Ub=Pb({...Bb});W$();Fb.version(go.version).help().command("[transformName] [...paths]","\uCF54\uB4DC \uBCC0\uD658 (codemod)").option("-l, --list","\uC0AC\uC6A9 \uAC00\uB2A5\uD55C transform \uBAA9\uB85D\uC744 \uBCF4\uC5EC\uC918\uC694").option("--log","\uB85C\uADF8\uB97C \uD30C\uC77C\uB85C \uC800\uC7A5\uD574\uC694").option("--no-track","\uC0AC\uC6A9 \uD1B5\uACC4\uB97C \uC218\uC9D1\uD558\uC9C0 \uC54A\uC544\uC694").option("-p, --parser <parser>","jscodeshift\uAC00 \uC0AC\uC6A9\uD560 \uD30C\uC11C\uB97C \uC9C0\uC815\uD574\uC694 (babel|babylon|flow|ts|tsx)",{default:"tsx"}).option("--reporter","\uBCC0\uD658 \uACB0\uACFC\uB97C \uD30C\uC77C\uB85C \uC800\uC7A5\uD574\uC694").option("--extensions <extensions>","\uBCC0\uD658\uD560 \uD30C\uC77C \uD655\uC7A5\uC790").option("--ignore-config <ignoreConfig>","Ignore config").example(" $ npx @seed-design/codemod migrate-icons src/ui").action(async(e,t,r)=>{let n=Mh.parse(r);n.track&&Ub?.({event:"\uC2E4\uD589",properties:{transformName:e,paths:t}});let s=H$();n.list&&(wc(s),process.exit(0)),e||(console.error("transform \uC774\uB984\uC744 \uC785\uB825\uD574\uC8FC\uC138\uC694"),wc(s),process.exit(1)),s.includes(e)||(console.error(`\uC774\uB984\uC774 ${e}\uC778 transform\uC774 \uC5C6\uC5B4\uC694`),wc(s),process.exit(1)),t.length===0&&(console.error("\uD30C\uC77C \uACBD\uB85C\uB97C \uC785\uB825\uD574\uC8FC\uC138\uC694"),process.exit(1));let o=Sc(Mb,e,"index.mjs");console.log(bc,`${t.join(", ")}\uC5D0 ${e} transform\uC744 \uC2E4\uD589\uD574\uC694.`),await Z$(o,t,n)});Fb.parse();function W$(){(0,yo.satisfies)(process.versions.node,go.engines.node)===!1&&(console.error(`Node.js \uBC84\uC804 \uC694\uAD6C\uC0AC\uD56D\uC744 \uB9CC\uC871\uC2DC\uD0A4\uC9C0 \uC54A\uC544\uC694: "${go.engines.node}"
3
60
  Node.js \uBC84\uC804\uC744 \uC5C5\uADF8\uB808\uC774\uB4DC\uD574\uC8FC\uC138\uC694.
4
61
  \uD604\uC7AC \uBC84\uC804: ${process.versions.node}
5
62
 
6
- $ nvm install ${S(c.engines.node)}`),process.exit(1))}async function N(o,e,n){let{log:s,parser:i,extensions:r,ignoreConfig:a,reporter:m,track:f}=n,k=u.resolve("jscodeshift/bin/jscodeshift"),g=e.map(w=>d(process.cwd(),w)).join(" ");f&&j?.({event:"transform \uC2E4\uD589",properties:{transformPath:o,fixedPathsCombined:g,options:n}}),await P({stdout:"inherit",env:{LOG:`${s}`,TRACK:`${f}`,GIT_INFO:JSON.stringify(y)}})`
7
- ${k} ${g}
8
- -t ${o}
9
- --parser=${i}
63
+ $ nvm install ${(0,yo.minVersion)(go.engines.node)}`),process.exit(1))}async function Z$(e,t,r){let{log:n,parser:s,extensions:o,ignoreConfig:i,reporter:a,track:c}=r,u=jb.resolve("jscodeshift/bin/jscodeshift"),f=t.map(p=>Sc(process.cwd(),p)).join(" ");c&&Ub?.({event:"transform \uC2E4\uD589",properties:{transformPath:e,fixedPathsCombined:f,options:r}}),await Dp({stdout:"inherit",env:{LOG:`${n}`,TRACK:`${c}`,GIT_INFO:JSON.stringify(Bb)}})`
64
+ ${u} ${f}
65
+ -t ${e}
66
+ --parser=${s}
10
67
  --ignore-pattern=**/*.d.ts
11
- ${m?`--reporter=${m}`:""}
12
- ${r?`--extensions=${r}`:""}
13
- ${a?`--ignore-config=${a}`:""}`}function A(){return G(v)}function l(o){console.log(`
68
+ ${a?`--reporter=${a}`:""}
69
+ ${o?`--extensions=${o}`:""}
70
+ ${i?`--ignore-config=${i}`:""}`}function H$(){return q$(Mb)}function wc(e){console.log(`
14
71
  \uC0AC\uC6A9 \uAC00\uB2A5\uD55C transform \uBAA9\uB85D:
15
- `,o.join(`
72
+ `,e.join(`
16
73
  `))}