From 9cfdcb923cd99d4af12ba53154aff88272cd95e3 Mon Sep 17 00:00:00 2001 From: Aleksey Korolev Date: Sun, 3 Apr 2022 20:25:04 +0300 Subject: [PATCH] bump: 0.1.0+sha.49bb92a8 --- dist/index.min.js | 92 +++++++++++++++++++++++++++++++++++++++++++++ package-lock.json | 2 +- package.json | 2 +- tools/copyright.txt | 2 +- 4 files changed, 95 insertions(+), 3 deletions(-) create mode 100644 dist/index.min.js diff --git a/dist/index.min.js b/dist/index.min.js new file mode 100644 index 0000000..0e1b006 --- /dev/null +++ b/dist/index.min.js @@ -0,0 +1,92 @@ +var Xc=Object.create;var ln=Object.defineProperty;var Qc=Object.getOwnPropertyDescriptor;var Jc=Object.getOwnPropertyNames,Or=Object.getOwnPropertySymbols,Zc=Object.getPrototypeOf,vr=Object.prototype.hasOwnProperty,tu=Object.prototype.propertyIsEnumerable;var Cr=(e,t,n)=>t in e?ln(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,je=(e,t)=>{for(var n in t||(t={}))vr.call(t,n)&&Cr(e,n,t[n]);if(Or)for(var n of Or(t))tu.call(t,n)&&Cr(e,n,t[n]);return e};var dt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Tr=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Jc(t))!vr.call(e,r)&&r!==n&&ln(e,r,{get:()=>t[r],enumerable:!(s=Qc(t,r))||s.enumerable});return e};var Me=(e,t,n)=>(n=e!=null?Xc(Zc(e)):{},Tr(t||!e||!e.__esModule?ln(n,"default",{value:e,enumerable:!0}):n,e)),eu=e=>Tr(ln({},"__esModule",{value:!0}),e);var fn=dt((Op,Ar)=>{var nu="2.0.0",su=Number.MAX_SAFE_INTEGER||9007199254740991,ru=16;Ar.exports={SEMVER_SPEC_VERSION:nu,MAX_LENGTH:256,MAX_SAFE_INTEGER:su,MAX_SAFE_COMPONENT_LENGTH:ru}});var es=dt((Cp,Sr)=>{var iu=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};Sr.exports=iu});var ss=dt((se,Ir)=>{var{MAX_SAFE_COMPONENT_LENGTH:ns}=fn(),ou=es();se=Ir.exports={};var au=se.re=[],R=se.src=[],P=se.t={},cu=0,z=(e,t,n)=>{let s=cu++;ou(s,t),P[e]=s,R[s]=t,au[s]=new RegExp(t,n?"g":void 0)};z("NUMERICIDENTIFIER","0|[1-9]\\d*");z("NUMERICIDENTIFIERLOOSE","[0-9]+");z("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*");z("MAINVERSION",`(${R[P.NUMERICIDENTIFIER]})\\.(${R[P.NUMERICIDENTIFIER]})\\.(${R[P.NUMERICIDENTIFIER]})`);z("MAINVERSIONLOOSE",`(${R[P.NUMERICIDENTIFIERLOOSE]})\\.(${R[P.NUMERICIDENTIFIERLOOSE]})\\.(${R[P.NUMERICIDENTIFIERLOOSE]})`);z("PRERELEASEIDENTIFIER",`(?:${R[P.NUMERICIDENTIFIER]}|${R[P.NONNUMERICIDENTIFIER]})`);z("PRERELEASEIDENTIFIERLOOSE",`(?:${R[P.NUMERICIDENTIFIERLOOSE]}|${R[P.NONNUMERICIDENTIFIER]})`);z("PRERELEASE",`(?:-(${R[P.PRERELEASEIDENTIFIER]}(?:\\.${R[P.PRERELEASEIDENTIFIER]})*))`);z("PRERELEASELOOSE",`(?:-?(${R[P.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${R[P.PRERELEASEIDENTIFIERLOOSE]})*))`);z("BUILDIDENTIFIER","[0-9A-Za-z-]+");z("BUILD",`(?:\\+(${R[P.BUILDIDENTIFIER]}(?:\\.${R[P.BUILDIDENTIFIER]})*))`);z("FULLPLAIN",`v?${R[P.MAINVERSION]}${R[P.PRERELEASE]}?${R[P.BUILD]}?`);z("FULL",`^${R[P.FULLPLAIN]}$`);z("LOOSEPLAIN",`[v=\\s]*${R[P.MAINVERSIONLOOSE]}${R[P.PRERELEASELOOSE]}?${R[P.BUILD]}?`);z("LOOSE",`^${R[P.LOOSEPLAIN]}$`);z("GTLT","((?:<|>)?=?)");z("XRANGEIDENTIFIERLOOSE",`${R[P.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);z("XRANGEIDENTIFIER",`${R[P.NUMERICIDENTIFIER]}|x|X|\\*`);z("XRANGEPLAIN",`[v=\\s]*(${R[P.XRANGEIDENTIFIER]})(?:\\.(${R[P.XRANGEIDENTIFIER]})(?:\\.(${R[P.XRANGEIDENTIFIER]})(?:${R[P.PRERELEASE]})?${R[P.BUILD]}?)?)?`);z("XRANGEPLAINLOOSE",`[v=\\s]*(${R[P.XRANGEIDENTIFIERLOOSE]})(?:\\.(${R[P.XRANGEIDENTIFIERLOOSE]})(?:\\.(${R[P.XRANGEIDENTIFIERLOOSE]})(?:${R[P.PRERELEASELOOSE]})?${R[P.BUILD]}?)?)?`);z("XRANGE",`^${R[P.GTLT]}\\s*${R[P.XRANGEPLAIN]}$`);z("XRANGELOOSE",`^${R[P.GTLT]}\\s*${R[P.XRANGEPLAINLOOSE]}$`);z("COERCE",`(^|[^\\d])(\\d{1,${ns}})(?:\\.(\\d{1,${ns}}))?(?:\\.(\\d{1,${ns}}))?(?:$|[^\\d])`);z("COERCERTL",R[P.COERCE],!0);z("LONETILDE","(?:~>?)");z("TILDETRIM",`(\\s*)${R[P.LONETILDE]}\\s+`,!0);se.tildeTrimReplace="$1~";z("TILDE",`^${R[P.LONETILDE]}${R[P.XRANGEPLAIN]}$`);z("TILDELOOSE",`^${R[P.LONETILDE]}${R[P.XRANGEPLAINLOOSE]}$`);z("LONECARET","(?:\\^)");z("CARETTRIM",`(\\s*)${R[P.LONECARET]}\\s+`,!0);se.caretTrimReplace="$1^";z("CARET",`^${R[P.LONECARET]}${R[P.XRANGEPLAIN]}$`);z("CARETLOOSE",`^${R[P.LONECARET]}${R[P.XRANGEPLAINLOOSE]}$`);z("COMPARATORLOOSE",`^${R[P.GTLT]}\\s*(${R[P.LOOSEPLAIN]})$|^$`);z("COMPARATOR",`^${R[P.GTLT]}\\s*(${R[P.FULLPLAIN]})$|^$`);z("COMPARATORTRIM",`(\\s*)${R[P.GTLT]}\\s*(${R[P.LOOSEPLAIN]}|${R[P.XRANGEPLAIN]})`,!0);se.comparatorTrimReplace="$1$2$3";z("HYPHENRANGE",`^\\s*(${R[P.XRANGEPLAIN]})\\s+-\\s+(${R[P.XRANGEPLAIN]})\\s*$`);z("HYPHENRANGELOOSE",`^\\s*(${R[P.XRANGEPLAINLOOSE]})\\s+-\\s+(${R[P.XRANGEPLAINLOOSE]})\\s*$`);z("STAR","(<|>)?=?\\s*\\*");z("GTE0","^\\s*>=\\s*0.0.0\\s*$");z("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")});var rs=dt((vp,xr)=>{var uu=["includePrerelease","loose","rtl"],lu=e=>e?typeof e!="object"?{loose:!0}:uu.filter(t=>e[t]).reduce((t,n)=>(t[n]=!0,t),{}):{};xr.exports=lu});var Mr=dt((Tp,jr)=>{var Rr=/^[0-9]+$/,Pr=(e,t)=>{let n=Rr.test(e),s=Rr.test(t);return n&&s&&(e=+e,t=+t),e===t?0:n&&!s?-1:s&&!n?1:ePr(t,e);jr.exports={compareIdentifiers:Pr,rcompareIdentifiers:fu}});var Fr=dt((Ap,Lr)=>{var hn=es(),{MAX_LENGTH:kr,MAX_SAFE_INTEGER:pn}=fn(),{re:Nr,t:$r}=ss(),hu=rs(),{compareIdentifiers:Ke}=Mr(),Mt=class{constructor(t,n){if(n=hu(n),t instanceof Mt){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid Version: ${t}`);if(t.length>kr)throw new TypeError(`version is longer than ${kr} characters`);hn("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let s=t.trim().match(n.loose?Nr[$r.LOOSE]:Nr[$r.FULL]);if(!s)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+s[1],this.minor=+s[2],this.patch=+s[3],this.major>pn||this.major<0)throw new TypeError("Invalid major version");if(this.minor>pn||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>pn||this.patch<0)throw new TypeError("Invalid patch version");s[4]?this.prerelease=s[4].split(".").map(r=>{if(/^[0-9]+$/.test(r)){let i=+r;if(i>=0&&i=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);s===-1&&this.prerelease.push(0)}n&&(this.prerelease[0]===n?isNaN(this.prerelease[1])&&(this.prerelease=[n,0]):this.prerelease=[n,0]);break;default:throw new Error(`invalid increment argument: ${t}`)}return this.format(),this.raw=this.version,this}};Lr.exports=Mt});var Wr=dt((Sp,Ur)=>{var{MAX_LENGTH:pu}=fn(),{re:Dr,t:Br}=ss(),Gr=Fr(),du=rs(),mu=(e,t)=>{if(t=du(t),e instanceof Gr)return e;if(typeof e!="string"||e.length>pu||!(t.loose?Dr[Br.LOOSE]:Dr[Br.FULL]).test(e))return null;try{return new Gr(e,t)}catch{return null}};Ur.exports=mu});var qr=dt((Ip,zr)=>{var gu=Wr(),bu=(e,t)=>{let n=gu(e,t);return n?n.version:null};zr.exports=bu});var to=dt((pm,Zi)=>{var Ge=1e3,Ue=Ge*60,We=Ue*60,Ie=We*24,Vu=Ie*7,Yu=Ie*365.25;Zi.exports=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return Ku(e);if(n==="number"&&isFinite(e))return t.long?Qu(e):Xu(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Ku(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 n=parseFloat(t[1]),s=(t[2]||"ms").toLowerCase();switch(s){case"years":case"year":case"yrs":case"yr":case"y":return n*Yu;case"weeks":case"week":case"w":return n*Vu;case"days":case"day":case"d":return n*Ie;case"hours":case"hour":case"hrs":case"hr":case"h":return n*We;case"minutes":case"minute":case"mins":case"min":case"m":return n*Ue;case"seconds":case"second":case"secs":case"sec":case"s":return n*Ge;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function Xu(e){var t=Math.abs(e);return t>=Ie?Math.round(e/Ie)+"d":t>=We?Math.round(e/We)+"h":t>=Ue?Math.round(e/Ue)+"m":t>=Ge?Math.round(e/Ge)+"s":e+"ms"}function Qu(e){var t=Math.abs(e);return t>=Ie?Pn(e,t,Ie,"day"):t>=We?Pn(e,t,We,"hour"):t>=Ue?Pn(e,t,Ue,"minute"):t>=Ge?Pn(e,t,Ge,"second"):e+" ms"}function Pn(e,t,n,s){var r=t>=n*1.5;return Math.round(e/n)+" "+s+(r?"s":"")}});var Ss=dt((dm,eo)=>{function Ju(e){n.debug=n,n.default=n,n.coerce=h,n.disable=i,n.enable=r,n.enabled=o,n.humanize=to(),n.destroy=_,Object.keys(e).forEach(d=>{n[d]=e[d]}),n.names=[],n.skips=[],n.formatters={};function t(d){let l=0;for(let m=0;m{if(Tt==="%%")return"%";W++;let Bt=n.formatters[wt];if(typeof Bt=="function"){let Gt=g[W];Tt=Bt.call(D,Gt),g.splice(W,1),W--}return Tt}),n.formatArgs.call(D,g),(D.log||n.log).apply(D,g)}return w.namespace=d,w.useColors=n.useColors(),w.color=n.selectColor(d),w.extend=s,w.destroy=n.destroy,Object.defineProperty(w,"enabled",{enumerable:!0,configurable:!1,get:()=>m!==null?m:(b!==n.namespaces&&(b=n.namespaces,T=n.enabled(d)),T),set:g=>{m=g}}),typeof n.init=="function"&&n.init(w),w}function s(d,l){let m=n(this.namespace+(typeof l>"u"?":":l)+d);return m.log=this.log,m}function r(d){n.save(d),n.namespaces=d,n.names=[],n.skips=[];let l,m=(typeof d=="string"?d:"").split(/[\s,]+/),b=m.length;for(l=0;l"-"+l)].join(",");return n.enable(""),d}function o(d){if(d[d.length-1]==="*")return!0;let l,m;for(l=0,m=n.skips.length;l{Rt.formatArgs=tl;Rt.save=el;Rt.load=nl;Rt.useColors=Zu;Rt.storage=sl();Rt.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`."))}})();Rt.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 Zu(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1: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&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function tl(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+jn.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let n=0,s=0;e[0].replace(/%[a-zA-Z%]/g,r=>{r!=="%%"&&(n++,r==="%c"&&(s=n))}),e.splice(s,0,t)}Rt.log=console.debug||console.log||(()=>{});function el(e){try{e?Rt.storage.setItem("debug",e):Rt.storage.removeItem("debug")}catch{}}function nl(){let e;try{e=Rt.storage.getItem("debug")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function sl(){try{return localStorage}catch{}}jn.exports=Ss()(Rt);var{formatters:rl}=jn.exports;rl.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var ro=dt((mm,so)=>{"use strict";so.exports=(e,t)=>{t=t||process.argv;let n=e.startsWith("-")?"":e.length===1?"-":"--",s=t.indexOf(n+e),r=t.indexOf("--");return s!==-1&&(r===-1?!0:s{"use strict";var il=require("os"),Ht=ro(),yt=process.env,ze;Ht("no-color")||Ht("no-colors")||Ht("color=false")?ze=!1:(Ht("color")||Ht("colors")||Ht("color=true")||Ht("color=always"))&&(ze=!0);"FORCE_COLOR"in yt&&(ze=yt.FORCE_COLOR.length===0||parseInt(yt.FORCE_COLOR,10)!==0);function ol(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function al(e){if(ze===!1)return 0;if(Ht("color=16m")||Ht("color=full")||Ht("color=truecolor"))return 3;if(Ht("color=256"))return 2;if(e&&!e.isTTY&&ze!==!0)return 0;let t=ze?1:0;if(process.platform==="win32"){let n=il.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in yt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(n=>n in yt)||yt.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in yt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(yt.TEAMCITY_VERSION)?1:0;if(yt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in yt){let n=parseInt((yt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(yt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(yt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(yt.TERM)||"COLORTERM"in yt?1:(yt.TERM==="dumb",t)}function Is(e){let t=al(e);return ol(t)}io.exports={supportsColor:Is,stdout:Is(process.stdout),stderr:Is(process.stderr)}});var co=dt((bt,kn)=>{var cl=require("tty"),Mn=require("util");bt.init=ml;bt.log=hl;bt.formatArgs=ll;bt.save=pl;bt.load=dl;bt.useColors=ul;bt.destroy=Mn.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");bt.colors=[6,2,3,4,5,1];try{let e=oo();e&&(e.stderr||e).level>=2&&(bt.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{}bt.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(r,i)=>i.toUpperCase()),s=process.env[t];return/^(yes|on|true|enabled)$/i.test(s)?s=!0:/^(no|off|false|disabled)$/i.test(s)?s=!1:s==="null"?s=null:s=Number(s),e[n]=s,e},{});function ul(){return"colors"in bt.inspectOpts?Boolean(bt.inspectOpts.colors):cl.isatty(process.stderr.fd)}function ll(e){let{namespace:t,useColors:n}=this;if(n){let s=this.color,r="\x1B[3"+(s<8?s:"8;5;"+s),i=` ${r};1m${t} \x1B[0m`;e[0]=i+e[0].split(` +`).join(` +`+i),e.push(r+"m+"+kn.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=fl()+t+" "+e[0]}function fl(){return bt.inspectOpts.hideDate?"":new Date().toISOString()+" "}function hl(...e){return process.stderr.write(Mn.format(...e)+` +`)}function pl(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function dl(){return process.env.DEBUG}function ml(e){e.inspectOpts={};let t=Object.keys(bt.inspectOpts);for(let n=0;nt.trim()).join(" ")};ao.O=function(e){return this.inspectOpts.colors=this.useColors,Mn.inspect(e,this.inspectOpts)}});var Rs=dt((bm,xs)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?xs.exports=no():xs.exports=co()});var uo=dt(Pt=>{"use strict";var gl=Pt&&Pt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Pt,"__esModule",{value:!0});var bl=require("fs"),yl=gl(Rs()),qe=yl.default("@kwsites/file-exists");function _l(e,t,n){qe("checking %s",e);try{let s=bl.statSync(e);return s.isFile()&&t?(qe("[OK] path represents a file"),!0):s.isDirectory()&&n?(qe("[OK] path represents a directory"),!0):(qe("[FAIL] path represents something other than a file or directory"),!1)}catch(s){if(s.code==="ENOENT")return qe("[FAIL] path is not accessible: %o",s),!1;throw qe("[FATAL] %o",s),s}}function El(e,t=Pt.READABLE){return _l(e,(t&Pt.FILE)>0,(t&Pt.FOLDER)>0)}Pt.exists=El;Pt.FILE=1;Pt.FOLDER=2;Pt.READABLE=Pt.FILE+Pt.FOLDER});var lo=dt(Nn=>{"use strict";function wl(e){for(var t in e)Nn.hasOwnProperty(t)||(Nn[t]=e[t])}Object.defineProperty(Nn,"__esModule",{value:!0});wl(uo())});var js=dt(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.createDeferred=xe.deferred=void 0;function Ps(){let e,t,n="pending";return{promise:new Promise((r,i)=>{e=r,t=i}),done(r){n==="pending"&&(n="resolved",e(r))},fail(r){n==="pending"&&(n="rejected",t(r))},get fulfilled(){return n!=="pending"},get status(){return n}}}xe.deferred=Ps;xe.createDeferred=Ps;xe.default=Ps});var Fc=dt(yr=>{yr.get=function(e,t,n){return(e=(t.split?t.split("."):t).reduce(function(s,r){return s&&s[r]},e))===void 0?n:e},yr.set=function(e,t,n,s){return!/^(__proto__|constructor|prototype)$/.test(t)&&((t=t.split?t.split("."):t.slice(0)).slice(0,-1).reduce(function(r,i){return r[i]=r[i]||{}},e)[t.pop()]=n),e}});var Ep={};module.exports=eu(Ep);var ts=require("fs/promises"),wr=Me(qr());var wn=require("assert");var yu={right:Cu,center:vu},_u=0,dn=1,Eu=2,mn=3,Vr=class{constructor(t){var n;this.width=t.width,this.wrap=(n=t.wrap)!==null&&n!==void 0?n:!0,this.rows=[]}span(...t){let n=this.div(...t);n.span=!0}resetOutput(){this.rows=[]}div(...t){if(t.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...t)&&typeof t[0]=="string")return this.applyLayoutDSL(t[0]);let n=t.map(s=>typeof s=="string"?this.colFromString(s):s);return this.rows.push(n),n}shouldApplyLayoutDSL(...t){return t.length===1&&typeof t[0]=="string"&&/[\t\n]/.test(t[0])}applyLayoutDSL(t){let n=t.split(` +`).map(r=>r.split(" ")),s=0;return n.forEach(r=>{r.length>1&&At.stringWidth(r[0])>s&&(s=Math.min(Math.floor(this.width*.5),At.stringWidth(r[0])))}),n.forEach(r=>{this.div(...r.map((i,o)=>({text:i.trim(),padding:this.measurePadding(i),width:o===0&&r.length>1?s:void 0})))}),this.rows[this.rows.length-1]}colFromString(t){return{text:t,padding:this.measurePadding(t)}}measurePadding(t){let n=At.stripAnsi(t);return[0,n.match(/\s*$/)[0].length,0,n.match(/^\s*/)[0].length]}toString(){let t=[];return this.rows.forEach(n=>{this.rowToString(n,t)}),t.filter(n=>!n.hidden).map(n=>n.text).join(` +`)}rowToString(t,n){return this.rasterize(t).forEach((s,r)=>{let i="";s.forEach((o,u)=>{let{width:h}=t[u],_=this.negatePadding(t[u]),d=o;_>At.stringWidth(o)&&(d+=" ".repeat(_-At.stringWidth(o))),t[u].align&&t[u].align!=="left"&&this.wrap&&(d=yu[t[u].align](d,_),At.stringWidth(d)<_&&(d+=" ".repeat((h||0)-At.stringWidth(d)-1)));let l=t[u].padding||[0,0,0,0];l[mn]&&(i+=" ".repeat(l[mn])),i+=Hr(t[u],d,"| "),i+=d,i+=Hr(t[u],d," |"),l[dn]&&(i+=" ".repeat(l[dn])),r===0&&n.length>0&&(i=this.renderInline(i,n[n.length-1]))}),n.push({text:i.replace(/ +$/,""),span:t.span})}),n}renderInline(t,n){let s=t.match(/^ */),r=s?s[0].length:0,i=n.text,o=At.stringWidth(i.trimRight());return n.span?this.wrap?r{i.width=s[o],this.wrap?r=At.wrap(i.text,this.negatePadding(i),{hard:!0}).split(` +`):r=i.text.split(` +`),i.border&&(r.unshift("."+"-".repeat(this.negatePadding(i)+2)+"."),r.push("'"+"-".repeat(this.negatePadding(i)+2)+"'")),i.padding&&(r.unshift(...new Array(i.padding[_u]||0).fill("")),r.push(...new Array(i.padding[Eu]||0).fill(""))),r.forEach((u,h)=>{n[h]||n.push([]);let _=n[h];for(let d=0;do.width||At.stringWidth(o.text));let n=t.length,s=this.width,r=t.map(o=>{if(o.width)return n--,s-=o.width,o.width}),i=n?Math.floor(s/n):0;return r.map((o,u)=>o===void 0?Math.max(i,wu(t[u])):o)}};function Hr(e,t,n){return e.border?/[.']-+[.']/.test(t)?"":t.trim().length!==0?n:" ":""}function wu(e){let t=e.padding||[],n=1+(t[mn]||0)+(t[dn]||0);return e.border?n+4:n}function Ou(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function Cu(e,t){e=e.trim();let n=At.stringWidth(e);return n=t?e:" ".repeat(t-n>>1)+e}var At;function Yr(e,t){return At=t,new Vr({width:(e==null?void 0:e.width)||Ou(),wrap:e==null?void 0:e.wrap})}var Kr=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function is(e){return e.replace(Kr,"")}function Xr(e,t){let[n,s]=e.match(Kr)||["",""];e=is(e);let r="";for(let i=0;i[...t].length,stripAnsi:is,wrap:Xr})}var ke=require("path"),gn=require("fs");function Qr(e,t){let n=(0,ke.resolve)(".",e),s;for((0,gn.statSync)(n).isDirectory()||(n=(0,ke.dirname)(n));;){if(s=t(n,(0,gn.readdirSync)(n)),s)return(0,ke.resolve)(n,s);if(n=(0,ke.dirname)(s=n),s===n)break}}var pi=require("util"),di=require("fs"),mi=require("url");var ei=require("util"),_n=require("path");function me(e){if(e!==e.toLowerCase()&&e!==e.toUpperCase()||(e=e.toLowerCase()),e.indexOf("-")===-1&&e.indexOf("_")===-1)return e;{let n="",s=!1,r=e.match(/^-+/);for(let i=r?r[0].length:0;i0?s+=`${t}${n.charAt(r)}`:s+=o}return s}function yn(e){return e==null?!1:typeof e=="number"||/^0x[0-9a-f]+$/i.test(e)?!0:/^0[^.]/.test(e)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function Jr(e){if(Array.isArray(e))return e.map(o=>typeof o!="string"?o+"":o);e=e.trim();let t=0,n=null,s=null,r=null,i=[];for(let o=0;o{typeof f=="number"&&(g.nargs[c]=f,g.keys.push(c))}),typeof s.coerce=="object"&&Object.entries(s.coerce).forEach(([c,f])=>{typeof f=="function"&&(g.coercions[c]=f,g.keys.push(c))}),typeof s.config<"u"&&(Array.isArray(s.config)||typeof s.config=="string"?[].concat(s.config).filter(Boolean).forEach(function(c){g.configs[c]=!0}):typeof s.config=="object"&&Object.entries(s.config).forEach(([c,f])=>{(typeof f=="boolean"||typeof f=="function")&&(g.configs[c]=f)})),te(s.key,o,s.default,g.arrays),Object.keys(h).forEach(function(c){(g.aliases[c]||[]).forEach(function(f){h[f]=h[c]})});let Y=null;de();let W=[],Q=Object.assign(Object.create(null),{_:[]}),Tt={};for(let c=0;c=3&&(L(v[1],g.arrays)?c=Gt(c,v[1],r,v[2]):L(v[1],g.nargs)!==!1?c=Bt(c,v[1],r,v[2]):J(v[1],v[2],!0));else if(f.match(U)&&u["boolean-negation"])v=f.match(U),v!==null&&Array.isArray(v)&&v.length>=2&&(p=v[1],J(p,L(p,g.arrays)?[!1]:!1));else if(f.match(/^--.+/)||!u["short-option-groups"]&&f.match(/^-[^-]+/))v=f.match(/^--?(.+)/),v!==null&&Array.isArray(v)&&v.length>=2&&(p=v[1],L(p,g.arrays)?c=Gt(c,p,r):L(p,g.nargs)!==!1?c=Bt(c,p,r):(N=r[c+1],N!==void 0&&(!N.match(/^-/)||N.match(D))&&!L(p,g.bools)&&!L(p,g.counts)||/^(true|false)$/.test(N)?(J(p,N),c++):J(p,rt(p))));else if(f.match(/^-.\..+=/))v=f.match(/^-([^=]+)=([\s\S]*)$/),v!==null&&Array.isArray(v)&&v.length>=3&&J(v[1],v[2]);else if(f.match(/^-.\..+/)&&!f.match(D))N=r[c+1],v=f.match(/^-(.\..+)/),v!==null&&Array.isArray(v)&&v.length>=2&&(p=v[1],N!==void 0&&!N.match(/^-/)&&!L(p,g.bools)&&!L(p,g.counts)?(J(p,N),c++):J(p,rt(p)));else if(f.match(/^-[^-]+/)&&!f.match(D)){S=f.slice(1,-1).split(""),y=!1;for(let Ot=0;Otc!=="--"&&c.includes("-")).forEach(c=>{delete Q[c]}),u["strip-aliased"]&&[].concat(...Object.keys(o).map(c=>o[c])).forEach(c=>{u["camel-case-expansion"]&&c.includes("-")&&delete Q[c.split(".").map(f=>me(f)).join(".")],delete Q[c]});function wt(c){let f=I("_",c);(typeof f=="string"||typeof f=="number")&&Q._.push(f)}function Bt(c,f,E,y){let p,S=L(f,g.nargs);if(S=typeof S!="number"||isNaN(S)?1:S,S===0)return A(y)||(Y=Error(w("Argument unexpected for: %s",f))),J(f,rt(f)),c;let v=A(y)?0:1;if(u["nargs-eats-options"])E.length-(c+1)+v0&&(J(f,y),N--),p=c+1;p0||v&&typeof v=="number"&&p.length>=v||(S=E[N],/^-/.test(S)&&!D.test(S)&&!st(S)));N++)c=N,p.push(O(f,S,i))}return typeof v=="number"&&(v&&p.length1&&u["dot-notation"]&&(g.aliases[p[0]]||[]).forEach(function(S){let v=S.split("."),N=[].concat(p);N.shift(),v=v.concat(N),(g.aliases[c]||[]).includes(v.join("."))||Wt(Q,v,y)}),L(c,g.normalize)&&!L(c,g.arrays)&&[c].concat(g.aliases[c]||[]).forEach(function(v){Object.defineProperty(Tt,v,{enumerable:!0,get(){return f},set(N){f=typeof N=="string"?ee.normalize(N):N}})})}function M(c,f){g.aliases[c]&&g.aliases[c].length||(g.aliases[c]=[f],b[f]=!0),g.aliases[f]&&g.aliases[f].length||M(f,c)}function O(c,f,E){E&&(f=Au(f)),(L(c,g.bools)||L(c,g.counts))&&typeof f=="string"&&(f=f==="true");let y=Array.isArray(f)?f.map(function(p){return I(c,p)}):I(c,f);return L(c,g.counts)&&(A(y)||typeof y=="boolean")&&(y=as()),L(c,g.normalize)&&L(c,g.arrays)&&(Array.isArray(f)?y=f.map(p=>ee.normalize(p)):y=ee.normalize(f)),y}function I(c,f){return!u["parse-positional-numbers"]&&c==="_"||!L(c,g.strings)&&!L(c,g.bools)&&!Array.isArray(f)&&(yn(f)&&u["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${f}`)))||!A(f)&&L(c,g.numbers))&&(f=Number(f)),f}function B(c){let f=Object.create(null);nt(f,g.aliases,h),Object.keys(g.configs).forEach(function(E){let y=c[E]||f[E];if(y)try{let p=null,S=ee.resolve(ee.cwd(),y),v=g.configs[E];if(typeof v=="function"){try{p=v(S)}catch(N){p=N}if(p instanceof Error){Y=p;return}}else p=ee.require(S);Z(p)}catch(p){p.name==="PermissionDenied"?Y=p:c[E]&&(Y=Error(w("Invalid JSON config file: %s",y)))}})}function Z(c,f){Object.keys(c).forEach(function(E){let y=c[E],p=f?f+"."+E:E;typeof y=="object"&&y!==null&&!Array.isArray(y)&&u["dot-notation"]?Z(y,p):(!Ut(Q,p.split("."))||L(p,g.arrays)&&u["combine-arrays"])&&J(p,y)})}function at(){typeof _<"u"&&_.forEach(function(c){Z(c)})}function V(c,f){if(typeof d>"u")return;let E=typeof d=="string"?d:"",y=ee.env();Object.keys(y).forEach(function(p){if(E===""||p.lastIndexOf(E,0)===0){let S=p.split("__").map(function(v,N){return N===0&&(v=v.substring(E.length)),me(v)});(f&&g.configs[S.join(".")]||!f)&&!Ut(c,S)&&J(S.join("."),y[p])}})}function ht(c){let f,E=new Set;Object.keys(c).forEach(function(y){if(!E.has(y)&&(f=L(y,g.coercions),typeof f=="function"))try{let p=I(y,f(c[y]));[].concat(g.aliases[y]||[],y).forEach(S=>{E.add(S),c[S]=p})}catch(p){Y=p}})}function Zt(c){return g.keys.forEach(f=>{~f.indexOf(".")||typeof c[f]>"u"&&(c[f]=void 0)}),c}function nt(c,f,E,y=!1){Object.keys(E).forEach(function(p){Ut(c,p.split("."))||(Wt(c,p.split("."),E[p]),y&&(T[p]=!0),(f[p]||[]).forEach(function(S){Ut(c,S.split("."))||Wt(c,S.split("."),E[p])}))})}function Ut(c,f){let E=c;u["dot-notation"]||(f=[f.join(".")]),f.slice(0,-1).forEach(function(p){E=E[p]||{}});let y=f[f.length-1];return typeof E!="object"?!1:y in E}function Wt(c,f,E){let y=c;u["dot-notation"]||(f=[f.join(".")]),f.slice(0,-1).forEach(function(mt){mt=Zr(mt),typeof y=="object"&&y[mt]===void 0&&(y[mt]={}),typeof y[mt]!="object"||Array.isArray(y[mt])?(Array.isArray(y[mt])?y[mt].push({}):y[mt]=[y[mt],{}],y=y[mt][y[mt].length-1]):y=y[mt]});let p=Zr(f[f.length-1]),S=L(f.join("."),g.arrays),v=Array.isArray(E),N=u["duplicate-arguments-array"];!N&&L(p,g.nargs)&&(N=!0,(!A(y[p])&&g.nargs[p]===1||Array.isArray(y[p])&&y[p].length===g.nargs[p])&&(y[p]=void 0)),E===as()?y[p]=as(y[p]):Array.isArray(y[p])?N&&S&&v?y[p]=u["flatten-duplicate-arrays"]?y[p].concat(E):(Array.isArray(y[p][0])?y[p]:[y[p]]).concat([E]):!N&&Boolean(S)===Boolean(v)?y[p]=E:y[p]=y[p].concat([E]):y[p]===void 0&&S?y[p]=v?E:[E]:N&&!(y[p]===void 0||L(p,g.counts)||L(p,g.bools))?y[p]=[y[p],E]:y[p]=E}function te(...c){c.forEach(function(f){Object.keys(f||{}).forEach(function(E){g.aliases[E]||(g.aliases[E]=[].concat(o[E]||[]),g.aliases[E].concat(E).forEach(function(y){if(/-/.test(y)&&u["camel-case-expansion"]){let p=me(y);p!==E&&g.aliases[E].indexOf(p)===-1&&(g.aliases[E].push(p),b[p]=!0)}}),g.aliases[E].concat(E).forEach(function(y){if(y.length>1&&/[A-Z]/.test(y)&&u["camel-case-expansion"]){let p=bn(y,"-");p!==E&&g.aliases[E].indexOf(p)===-1&&(g.aliases[E].push(p),b[p]=!0)}}),g.aliases[E].forEach(function(y){g.aliases[y]=[E].concat(g.aliases[E].filter(function(p){return y!==p}))}))})})}function L(c,f){let E=[].concat(g.aliases[c]||[],c),y=Object.keys(f),p=E.find(S=>y.includes(S));return p?f[p]:!1}function Ye(c){let f=Object.keys(g);return[].concat(f.map(y=>g[y])).some(function(y){return Array.isArray(y)?y.includes(c):y[c]})}function $(c,...f){return[].concat(...f).some(function(y){let p=c.match(y);return p&&Ye(p[1])})}function tt(c){if(c.match(D)||!c.match(/^-[^-]+/))return!1;let f=!0,E,y=c.slice(1).split("");for(let p=0;pL(c,g.arrays)?(Y=Error(w("Invalid configuration: %s, opts.count excludes opts.array.",c)),!0):L(c,g.nargs)?(Y=Error(w("Invalid configuration: %s, opts.count excludes opts.narg.",c)),!0):!1)}return{aliases:Object.assign({},g.aliases),argv:Object.assign(Tt,Q),configuration:u,defaulted:Object.assign({},T),error:Y,newAliases:Object.assign({},b)}}};function Tu(e){let t=[],n=Object.create(null),s=!0;for(Object.keys(e).forEach(function(r){t.push([].concat(e[r],r))});s;){s=!1;for(let r=0;rSu,format:ei.format,normalize:_n.normalize,resolve:_n.resolve,require:e=>{if(typeof require<"u")return require(e);if(e.match(/\.json$/))return JSON.parse((0,ni.readFileSync)(e,"utf8"));throw Error("only .json config files are supported in ESM")}}),Xe=function(t,n){return si.parse(t.slice(),n).argv};Xe.detailed=function(e,t){return si.parse(e.slice(),t)};Xe.camelCase=me;Xe.decamelize=bn;Xe.looksLikeNumber=yn;var us=Xe;var qt=require("path");function ri(){return Iu()?0:1}function Iu(){return xu()&&!process.defaultApp}function xu(){return!!process.versions.electron}function ls(e){return e.slice(ri()+1)}function ii(){return process.argv[ri()]}var et=class extends Error{constructor(t){super(t||"yargs error");this.name="YError",Error.captureStackTrace(this,et)}};var Ne=require("fs"),oi=require("util"),ai=require("path"),ci={fs:{readFileSync:Ne.readFileSync,writeFile:Ne.writeFile},format:oi.format,resolve:ai.resolve,exists:e=>{try{return(0,Ne.statSync)(e).isFile()}catch{return!1}}};var zt,ui=class{constructor(t){t=t||{},this.directory=t.directory||"./locales",this.updateFiles=typeof t.updateFiles=="boolean"?t.updateFiles:!0,this.locale=t.locale||"en",this.fallbackToLanguage=typeof t.fallbackToLanguage=="boolean"?t.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...t){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let n=t.shift(),s=function(){};return typeof t[t.length-1]=="function"&&(s=t.pop()),s=s||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][n]&&this.updateFiles?(this.cache[this.locale][n]=n,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s(),zt.format.apply(zt.format,[this.cache[this.locale][n]||n].concat(t))}__n(){let t=Array.prototype.slice.call(arguments),n=t.shift(),s=t.shift(),r=t.shift(),i=function(){};typeof t[t.length-1]=="function"&&(i=t.pop()),this.cache[this.locale]||this._readLocaleFile();let o=r===1?n:s;this.cache[this.locale][n]&&(o=this.cache[this.locale][n][r===1?"one":"other"]),!this.cache[this.locale][n]&&this.updateFiles?(this.cache[this.locale][n]={one:n,other:s},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:i})):i();let u=[o];return~o.indexOf("%d")&&u.push(r),zt.format.apply(zt.format,u.concat(t))}setLocale(t){this.locale=t}getLocale(){return this.locale}updateLocale(t){this.cache[this.locale]||this._readLocaleFile();for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&(this.cache[this.locale][n]=t[n])}_taggedLiteral(t,...n){let s="";return t.forEach(function(r,i){let o=n[i+1];s+=r,typeof o<"u"&&(s+="%s")}),this.__.apply(this,[s].concat([].slice.call(n,1)))}_enqueueWrite(t){this.writeQueue.push(t),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let t=this,n=this.writeQueue[0],s=n.directory,r=n.locale,i=n.cb,o=this._resolveLocaleFile(s,r),u=JSON.stringify(this.cache[r],null,2);zt.fs.writeFile(o,u,"utf-8",function(h){t.writeQueue.shift(),t.writeQueue.length>0&&t._processWriteQueue(),i(h)})}_readLocaleFile(){let t={},n=this._resolveLocaleFile(this.directory,this.locale);try{zt.fs.readFileSync&&(t=JSON.parse(zt.fs.readFileSync(n,"utf-8")))}catch(s){if(s instanceof SyntaxError&&(s.message="syntax error in "+n),s.code==="ENOENT")t={};else throw s}this.cache[this.locale]=t}_resolveLocaleFile(t,n){let s=zt.resolve(t,"./",n+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(s)&&~n.lastIndexOf("_")){let r=zt.resolve(t,"./",n.split("_")[0]+".json");this._fileExistsSync(r)&&(s=r)}return s}_fileExistsSync(t){return zt.exists(t)}};function li(e,t){zt=t;let n=new ui(e);return{__:n.__.bind(n),__n:n.__n.bind(n),setLocale:n.setLocale.bind(n),getLocale:n.getLocale.bind(n),updateLocale:n.updateLocale.bind(n),locale:n.locale}}var Ru=e=>li(e,ci),fi=Ru;var Mu={},Pu="require is not supported by ESM",hi="loading a directory of commands is not supported yet for ESM",En;try{En=(0,mi.fileURLToPath)(Mu.url)}catch{En=process.cwd()}var ju=En.split("node_modules")[0],fs={assert:{notStrictEqual:wn.notStrictEqual,strictEqual:wn.strictEqual},cliui:os,findUp:Qr,getEnv:e=>process.env[e],inspect:pi.inspect,getCallerFile:()=>{throw new et(hi)},getProcessArgvBin:ii,mainFilename:ju||process.cwd(),Parser:us,path:{basename:qt.basename,dirname:qt.dirname,extname:qt.extname,relative:qt.relative,resolve:qt.resolve},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(e,t)=>process.emitWarning(e,t),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:di.readFileSync,require:()=>{throw new et(Pu)},requireDirectory:()=>{throw new et(hi)},stringWidth:e=>[...e].length,y18n:fi({directory:(0,qt.resolve)(En,"../../../locales"),updateFiles:!1})};function Ct(e,t,n,s){n.assert.notStrictEqual(e,t,s)}function hs(e,t){t.assert.strictEqual(typeof e,"string")}function $e(e){return Object.keys(e)}function ot(e){return!!e&&!!e.then&&typeof e.then=="function"}function re(e){let n=e.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),s=/\.*[\][<>]/g,r=n.shift();if(!r)throw new Error(`No command found in: ${e}`);let i={cmd:r.replace(s,""),demanded:[],optional:[]};return n.forEach((o,u)=>{let h=!1;o=o.replace(/\s/g,""),/\.+[\]>]/.test(o)&&u===n.length-1&&(h=!0),/^\[/.test(o)?i.optional.push({cmd:o.replace(s,"").split("|"),variadic:h}):i.demanded.push({cmd:o.replace(s,"").split("|"),variadic:h})}),i}var ku=["first","second","third","fourth","fifth","sixth"];function x(e,t,n){function s(){return typeof e=="object"?[{demanded:[],optional:[]},e,t]:[re(`cmd ${e}`),t,n]}try{let r=0,[i,o,u]=s(),h=[].slice.call(o);for(;h.length&&h[h.length-1]===void 0;)h.pop();let _=u||h.length;if(_d)throw new et(`Too many arguments provided. Expected max ${d} but received ${_}.`);i.demanded.forEach(l=>{let m=h.shift(),b=gi(m);l.cmd.filter(w=>w===b||w==="*").length===0&&bi(b,l.cmd,r),r+=1}),i.optional.forEach(l=>{if(h.length===0)return;let m=h.shift(),b=gi(m);l.cmd.filter(w=>w===b||w==="*").length===0&&bi(b,l.cmd,r),r+=1})}catch(r){console.warn(r.stack)}}function gi(e){return Array.isArray(e)?"array":e===null?"null":typeof e}function bi(e,t,n){throw new et(`Invalid ${ku[n]||"manyith"} argument. Expected ${t.join(" or ")} but received ${e}.`)}var ps=class{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,n,s=!0,r=!1){if(x(" [boolean] [boolean] [boolean]",[t,n,s],arguments.length),Array.isArray(t)){for(let i=0;i{let i=[...s[n]||[],n];return r.option?!i.includes(r.option):!0}),t.option=n,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let t=this.frozens.pop();t!==void 0&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter(t=>t.global)}};function yi(e){return e?e.map(t=>(t.applyBeforeValidation=!1,t)):[]}function ge(e,t,n,s){return n.reduce((r,i)=>{if(i.applyBeforeValidation!==s)return r;if(i.mutates){if(i.applied)return r;i.applied=!0}if(ot(r))return r.then(o=>Promise.all([o,i(o,t)])).then(([o,u])=>Object.assign(o,u));{let o=i(r,t);return ot(o)?o.then(u=>Object.assign(r,u)):Object.assign(r,o)}},e)}function be(e,t,n=s=>{throw s}){try{let s=Nu(e)?e():e;return ot(s)?s.then(r=>t(r)):t(s)}catch(s){return n(s)}}function Nu(e){return typeof e=="function"}function ds(e){if(typeof require>"u")return null;for(let t=0,n=Object.keys(require.cache),s;to;r.visit=(o,u,h)=>{let _=i(o,u,h);if(_){if(this.requireCache.has(u))return _;this.requireCache.add(u),this.addHandler(_)}return _},this.shim.requireDirectory({require:n,filename:s},t,r)}addHandler(t,n,s,r,i,o){let u=[],h=yi(i);if(r=r||(()=>{}),Array.isArray(t))if($u(t))[t,...u]=t;else for(let _ of t)this.addHandler(_);else if(Fu(t)){let _=Array.isArray(t.command)||typeof t.command=="string"?t.command:this.moduleName(t);t.aliases&&(_=[].concat(_).concat(t.aliases)),this.addHandler(_,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated);return}else if(_i(s)){this.addHandler([t].concat(u),n,s.builder,s.handler,s.middlewares,s.deprecated);return}if(typeof t=="string"){let _=re(t);u=u.map(m=>re(m).cmd);let d=!1,l=[_.cmd].concat(u).filter(m=>Le.test(m)?(d=!0,!1):!0);l.length===0&&d&&l.push("$0"),d&&(_.cmd=l[0],u=l.slice(1),t=t.replace(Le,_.cmd)),u.forEach(m=>{this.aliasMap[m]=_.cmd}),n!==!1&&this.usage.command(t,n,d,u,o),this.handlers[_.cmd]={original:t,description:n,handler:r,builder:s||{},middlewares:h,deprecated:o,demanded:_.demanded,optional:_.optional},d&&(this.defaultCommand=this.handlers[_.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,n,s,r,i,o){let u=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,h=n.getInternalMethods().getContext(),_=h.commands.slice(),d=!t;t&&(h.commands.push(t),h.fullCommands.push(u.original));let l=this.applyBuilderUpdateUsageAndParse(d,u,n,s.aliases,_,r,i,o);return ot(l)?l.then(m=>this.applyMiddlewareAndGetResult(d,u,m.innerArgv,h,i,m.aliases,n)):this.applyMiddlewareAndGetResult(d,u,l.innerArgv,h,i,l.aliases,n)}applyBuilderUpdateUsageAndParse(t,n,s,r,i,o,u,h){let _=n.builder,d=s;if(On(_)){let l=_(s.getInternalMethods().reset(r),h);if(ot(l))return l.then(m=>(d=Oi(m)?m:s,this.parseAndUpdateUsage(t,n,d,i,o,u)))}else Lu(_)&&(d=s.getInternalMethods().reset(r),Object.keys(n.builder).forEach(l=>{d.option(l,_[l])}));return this.parseAndUpdateUsage(t,n,d,i,o,u)}parseAndUpdateUsage(t,n,s,r,i,o){t&&s.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(s)&&s.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(r,n),n.description);let u=s.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,i,o);return ot(u)?u.then(h=>({aliases:s.parsed.aliases,innerArgv:h})):{aliases:s.parsed.aliases,innerArgv:u}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&t.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(t,n){let s=Le.test(n.original)?n.original.replace(Le,"").trim():n.original,r=t.filter(i=>!Le.test(i));return r.push(s),`$0 ${r.join(" ")}`}applyMiddlewareAndGetResult(t,n,s,r,i,o,u){let h={};if(i)return s;u.getInternalMethods().getHasOutput()||(h=this.populatePositionals(n,s,r,u));let _=this.globalMiddleware.getMiddleware().slice(0).concat(n.middlewares);if(s=ge(s,u,_,!0),!u.getInternalMethods().getHasOutput()){let d=u.getInternalMethods().runValidation(o,h,u.parsed.error,t);s=be(s,l=>(d(l),l))}if(n.handler&&!u.getInternalMethods().getHasOutput()){u.getInternalMethods().setHasOutput();let d=!!u.getOptions().configuration["populate--"];u.getInternalMethods().postProcess(s,d,!1,!1),s=ge(s,u,_,!1),s=be(s,l=>{let m=n.handler(l);return ot(m)?m.then(()=>l):l}),t||u.getInternalMethods().getUsageInstance().cacheHelpMessage(),ot(s)&&!u.getInternalMethods().hasParseCallback()&&s.catch(l=>{try{u.getInternalMethods().getUsageInstance().fail(null,l)}catch{}})}return t||(r.commands.pop(),r.fullCommands.pop()),s}populatePositionals(t,n,s,r){n._=n._.slice(s.commands.length);let i=t.demanded.slice(0),o=t.optional.slice(0),u={};for(this.validation.positionalCount(i.length,n._.length);i.length;){let h=i.shift();this.populatePositional(h,n,u)}for(;o.length;){let h=o.shift();this.populatePositional(h,n,u)}return n._=s.commands.concat(n._.map(h=>""+h)),this.postProcessPositionals(n,u,this.cmdToParseOptions(t.original),r),u}populatePositional(t,n,s){let r=t.cmd[0];t.variadic?s[r]=n._.splice(0).map(String):n._.length&&(s[r]=[String(n._.shift())])}cmdToParseOptions(t){let n={array:[],default:{},alias:{},demand:{}},s=re(t);return s.demanded.forEach(r=>{let[i,...o]=r.cmd;r.variadic&&(n.array.push(i),n.default[i]=[]),n.alias[i]=o,n.demand[i]=!0}),s.optional.forEach(r=>{let[i,...o]=r.cmd;r.variadic&&(n.array.push(i),n.default[i]=[]),n.alias[i]=o}),n}postProcessPositionals(t,n,s,r){let i=Object.assign({},r.getOptions());i.default=Object.assign(s.default,i.default);for(let _ of Object.keys(s.alias))i.alias[_]=(i.alias[_]||[]).concat(s.alias[_]);i.array=i.array.concat(s.array),i.config={};let o=[];if(Object.keys(n).forEach(_=>{n[_].map(d=>{i.configuration["unknown-options-as-args"]&&(i.key[_]=!0),o.push(`--${_}`),o.push(d)})}),!o.length)return;let u=Object.assign({},i.configuration,{"populate--":!1}),h=this.shim.Parser.detailed(o,Object.assign({},i,{configuration:u}));if(h.error)r.getInternalMethods().getUsageInstance().fail(h.error.message,h.error);else{let _=Object.keys(n);Object.keys(n).forEach(l=>{_.push(...h.aliases[l])});let d=r.getOptions().default;Object.keys(h.argv).forEach(l=>{_.includes(l)&&(n[l]||(n[l]=h.argv[l]),!Object.prototype.hasOwnProperty.call(d,l)&&Object.prototype.hasOwnProperty.call(t,l)&&Object.prototype.hasOwnProperty.call(h.argv,l)&&(Array.isArray(t[l])||Array.isArray(h.argv[l]))?t[l]=[].concat(t[l],h.argv[l]):t[l]=h.argv[l])})}}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){let s=Le.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(s,this.defaultCommand.description)}let n=this.defaultCommand.builder;if(On(n))return n(t,!0);_i(n)||Object.keys(n).forEach(s=>{t.option(s,n[s])})}moduleName(t){let n=ds(t);if(!n)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);return this.commandFromFilename(n.filename)}commandFromFilename(t){return this.shim.path.basename(t,this.shim.path.extname(t))}extractDesc({describe:t,description:n,desc:s}){for(let r of[t,n,s]){if(typeof r=="string"||r===!1)return r;Ct(r,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let t=this.frozens.pop();Ct(t,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=t}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function wi(e,t,n,s){return new Ei(e,t,n,s)}function _i(e){return typeof e=="object"&&!!e.builder&&typeof e.handler=="function"}function $u(e){return e.every(t=>typeof t=="string")}function On(e){return typeof e=="function"}function Lu(e){return typeof e=="object"}function Fu(e){return typeof e=="object"&&!Array.isArray(e)}function ie(e={},t=()=>!0){let n={};return $e(e).forEach(s=>{t(s,e[s])&&(n[s]=e[s])}),n}function oe(e){typeof process>"u"||[process.stdout,process.stderr].forEach(t=>{let n=t;n._handle&&n.isTTY&&typeof n._handle.setBlocking=="function"&&n._handle.setBlocking(e)})}function Du(e){return typeof e=="boolean"}function vi(e,t){let n=t.y18n.__,s={},r=[];s.failFn=function(O){r.push(O)};let i=null,o=!0;s.showHelpOnFail=function(O=!0,I){function B(){return typeof O=="string"?[!0,O]:[O,I]}let[Z,at]=B();return i=at,o=Z,s};let u=!1;s.fail=function(O,I){let B=e.getInternalMethods().getLoggerInstance();if(r.length)for(let Z=r.length-1;Z>=0;--Z){let at=r[Z];if(Du(at)){if(I)throw I;if(O)throw Error(O)}else at(O,I,s)}else{if(e.getExitProcess()&&oe(!0),u||(u=!0,o&&(e.showHelp("error"),B.error()),(O||I)&&B.error(O||I),i&&((O||I)&&B.error(""),B.error(i))),I=I||new et(O),e.getExitProcess())return e.exit(1);if(e.getInternalMethods().hasParseCallback())return e.exit(1,I);throw I}};let h=[],_=!1;s.usage=(M,O)=>M===null?(_=!0,h=[],s):(_=!1,h.push([M,O||""]),s),s.getUsage=()=>h,s.getUsageDisabled=()=>_,s.getPositionalGroupName=()=>n("Positionals:");let d=[];s.example=(M,O)=>{d.push([M,O||""])};let l=[];s.command=function(O,I,B,Z,at=!1){B&&(l=l.map(V=>(V[2]=!1,V))),l.push([O,I||"",B,Z,at])},s.getCommands=()=>l;let m={};s.describe=function(O,I){Array.isArray(O)?O.forEach(B=>{s.describe(B,I)}):typeof O=="object"?Object.keys(O).forEach(B=>{s.describe(B,O[B])}):m[O]=I},s.getDescriptions=()=>m;let b=[];s.epilog=M=>{b.push(M)};let T=!1,w;s.wrap=M=>{T=!0,w=M};function g(){return T||(w=Bt(),T=!0),w}let D="__yargsString__:";s.deferY18nLookup=M=>D+M,s.help=function(){if(W)return W;Y();let O=e.customScriptName?e.$0:t.path.basename(e.$0),I=e.getDemandedOptions(),B=e.getDemandedCommands(),Z=e.getDeprecatedOptions(),at=e.getGroups(),V=e.getOptions(),ht=[];ht=ht.concat(Object.keys(m)),ht=ht.concat(Object.keys(I)),ht=ht.concat(Object.keys(B)),ht=ht.concat(Object.keys(V.default)),ht=ht.filter(Tt),ht=Object.keys(ht.reduce(($,tt)=>(tt!=="_"&&($[tt]=!0),$),{}));let Zt=g(),nt=t.cliui({width:Zt,wrap:!!Zt});if(!_){if(h.length)h.forEach($=>{nt.div({text:`${$[0].replace(/\$0/g,O)}`}),$[1]&&nt.div({text:`${$[1]}`,padding:[1,0,0,0]})}),nt.div();else if(l.length){let $=null;B._?$=`${O} <${n("command")}> +`:$=`${O} [${n("command")}] +`,nt.div(`${$}`)}}if(l.length>1||l.length===1&&!l[0][2]){nt.div(n("Commands:"));let $=e.getInternalMethods().getContext(),tt=$.commands.length?`${$.commands.join(" ")} `:"";e.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(l=l.sort((H,rt)=>H[0].localeCompare(rt[0])));let st=O?`${O} `:"";l.forEach(H=>{let rt=`${st}${tt}${H[0].replace(/^\$0 ?/,"")}`;nt.span({text:rt,padding:[0,2,0,2],width:U(l,Zt,`${O}${tt}`)+4},{text:H[1]});let ct=[];H[2]&&ct.push(`[${n("default")}]`),H[3]&&H[3].length&&ct.push(`[${n("aliases:")} ${H[3].join(", ")}]`),H[4]&&(typeof H[4]=="string"?ct.push(`[${n("deprecated: %s",H[4])}]`):ct.push(`[${n("deprecated")}]`)),ct.length?nt.div({text:ct.join(" "),padding:[0,0,0,2],align:"right"}):nt.div()}),nt.div()}let Ut=(Object.keys(V.alias)||[]).concat(Object.keys(e.parsed.newAliases)||[]);ht=ht.filter($=>!e.parsed.newAliases[$]&&Ut.every(tt=>(V.alias[tt]||[]).indexOf($)===-1));let Wt=n("Options:");at[Wt]||(at[Wt]=[]),Q(ht,V.alias,at,Wt);let te=$=>/^--/.test(Cn($)),L=Object.keys(at).filter($=>at[$].length>0).map($=>{let tt=at[$].filter(Tt).map(st=>{if(Ut.includes(st))return st;for(let H=0,rt;(rt=Ut[H])!==void 0;H++)if((V.alias[rt]||[]).includes(st))return rt;return st});return{groupName:$,normalizedKeys:tt}}).filter(({normalizedKeys:$})=>$.length>0).map(({groupName:$,normalizedKeys:tt})=>{let st=tt.reduce((H,rt)=>(H[rt]=[rt].concat(V.alias[rt]||[]).map(ct=>$===s.getPositionalGroupName()?ct:(/^[0-9]$/.test(ct)?V.boolean.includes(rt)?"-":"--":ct.length>1?"--":"-")+ct).sort((ct,it)=>te(ct)===te(it)?0:te(ct)?1:-1).join(", "),H),{});return{groupName:$,normalizedKeys:tt,switches:st}});if(L.filter(({groupName:$})=>$!==s.getPositionalGroupName()).some(({normalizedKeys:$,switches:tt})=>!$.every(st=>te(tt[st])))&&L.filter(({groupName:$})=>$!==s.getPositionalGroupName()).forEach(({normalizedKeys:$,switches:tt})=>{$.forEach(st=>{te(tt[st])&&(tt[st]=Bu(tt[st],4))})}),L.forEach(({groupName:$,normalizedKeys:tt,switches:st})=>{nt.div($),tt.forEach(H=>{let rt=st[H],ct=m[H]||"",it=null;ct.includes(D)&&(ct=n(ct.substring(D.length))),V.boolean.includes(H)&&(it=`[${n("boolean")}]`),V.count.includes(H)&&(it=`[${n("count")}]`),V.string.includes(H)&&(it=`[${n("string")}]`),V.normalize.includes(H)&&(it=`[${n("string")}]`),V.array.includes(H)&&(it=`[${n("array")}]`),V.number.includes(H)&&(it=`[${n("number")}]`);let A=c=>typeof c=="string"?`[${n("deprecated: %s",c)}]`:`[${n("deprecated")}]`,de=[H in Z?A(Z[H]):null,it,H in I?`[${n("required")}]`:null,V.choices&&V.choices[H]?`[${n("choices:")} ${s.stringifiedValues(V.choices[H])}]`:null,wt(V.default[H],V.defaultDescription[H])].filter(Boolean).join(" ");nt.span({text:Cn(rt),padding:[0,2,0,2+Ci(rt)],width:U(st,Zt)+4},ct),de?nt.div({text:de,padding:[0,0,0,2],align:"right"}):nt.div()}),nt.div()}),d.length&&(nt.div(n("Examples:")),d.forEach($=>{$[0]=$[0].replace(/\$0/g,O)}),d.forEach($=>{$[1]===""?nt.div({text:$[0],padding:[0,2,0,2]}):nt.div({text:$[0],padding:[0,2,0,2],width:U(d,Zt)+4},{text:$[1]})}),nt.div()),b.length>0){let $=b.map(tt=>tt.replace(/\$0/g,O)).join(` +`);nt.div(`${$} +`)}return nt.toString().replace(/\s*$/,"")};function U(M,O,I){let B=0;return Array.isArray(M)||(M=Object.values(M).map(Z=>[Z])),M.forEach(Z=>{B=Math.max(t.stringWidth(I?`${I} ${Cn(Z[0])}`:Cn(Z[0]))+Ci(Z[0]),B)}),O&&(B=Math.min(B,parseInt((O*.5).toString(),10))),B}function Y(){let M=e.getDemandedOptions(),O=e.getOptions();(Object.keys(O.alias)||[]).forEach(I=>{O.alias[I].forEach(B=>{m[B]&&s.describe(I,m[B]),B in M&&e.demandOption(I,M[B]),O.boolean.includes(B)&&e.boolean(I),O.count.includes(B)&&e.count(I),O.string.includes(B)&&e.string(I),O.normalize.includes(B)&&e.normalize(I),O.array.includes(B)&&e.array(I),O.number.includes(B)&&e.number(I)})})}let W;s.cacheHelpMessage=function(){W=this.help()},s.clearCachedHelpMessage=function(){W=void 0},s.hasCachedHelpMessage=function(){return!!W};function Q(M,O,I,B){let Z=[],at=null;return Object.keys(I).forEach(V=>{Z=Z.concat(I[V])}),M.forEach(V=>{at=[V].concat(O[V]),at.some(ht=>Z.indexOf(ht)!==-1)||I[B].push(V)}),Z}function Tt(M){return e.getOptions().hiddenOptions.indexOf(M)<0||e.parsed.argv[e.getOptions().showHiddenOpt]}s.showHelp=M=>{let O=e.getInternalMethods().getLoggerInstance();M||(M="error"),(typeof M=="function"?M:O[M])(s.help())},s.functionDescription=M=>{let O=M.name?t.Parser.decamelize(M.name,"-"):n("generated-value");return["(",O,")"].join("")},s.stringifiedValues=function(O,I){let B="",Z=I||", ",at=[].concat(O);return!O||!at.length||at.forEach(V=>{B.length&&(B+=Z),B+=JSON.stringify(V)}),B};function wt(M,O){let I=`[${n("default:")} `;if(M===void 0&&!O)return null;if(O)I+=O;else switch(typeof M){case"string":I+=`"${M}"`;break;case"object":I+=JSON.stringify(M);break;default:I+=M}return`${I}]`}function Bt(){return t.process.stdColumns?Math.min(80,t.process.stdColumns):80}let Gt=null;s.version=M=>{Gt=M},s.showVersion=M=>{let O=e.getInternalMethods().getLoggerInstance();M||(M="error"),(typeof M=="function"?M:O[M])(Gt)},s.reset=function(O){return i=null,u=!1,h=[],_=!1,b=[],d=[],l=[],m=ie(m,I=>!O[I]),s};let J=[];return s.freeze=function(){J.push({failMessage:i,failureOutput:u,usages:h,usageDisabled:_,epilogs:b,examples:d,commands:l,descriptions:m})},s.unfreeze=function(O=!1){let I=J.pop();!I||(O?(m=je(je({},I.descriptions),m),l=[...I.commands,...l],h=[...I.usages,...h],d=[...I.examples,...d],b=[...I.epilogs,...b]):{failMessage:i,failureOutput:u,usages:h,usageDisabled:_,epilogs:b,examples:d,commands:l,descriptions:m}=I)},s}function ms(e){return typeof e=="object"}function Bu(e,t){return ms(e)?{text:e.text,indentation:e.indentation+t}:{text:e,indentation:t}}function Ci(e){return ms(e)?e.indentation:0}function Cn(e){return ms(e)?e.text:e}var Ti=`###-begin-{{app_name}}-completions-### +# +# yargs command completion script +# +# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc +# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX. +# +_{{app_name}}_yargs_completions() +{ + local cur_word args type_list + + cur_word="\${COMP_WORDS[COMP_CWORD]}" + args=("\${COMP_WORDS[@]}") + + # ask yargs to generate completions. + type_list=$({{app_path}} --get-yargs-completions "\${args[@]}") + + COMPREPLY=( $(compgen -W "\${type_list}" -- \${cur_word}) ) + + # if no match was found, fall back to filename completion + if [ \${#COMPREPLY[@]} -eq 0 ]; then + COMPREPLY=() + fi + + return 0 +} +complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}} +###-end-{{app_name}}-completions-### +`,Ai=`#compdef {{app_name}} +###-begin-{{app_name}}-completions-### +# +# yargs command completion script +# +# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc +# or {{app_path}} {{completion_command}} >> ~/.zsh_profile on OSX. +# +_{{app_name}}_yargs_completions() +{ + local reply + local si=$IFS + IFS=$' +' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "\${words[@]}")) + IFS=$si + _describe 'values' reply +} +compdef _{{app_name}}_yargs_completions {{app_name}} +###-end-{{app_name}}-completions-### +`;var Si=class{constructor(t,n,s,r){var i,o,u;this.yargs=t,this.usage=n,this.command=s,this.shim=r,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(u=((i=this.shim.getEnv("SHELL"))===null||i===void 0?void 0:i.includes("zsh"))||((o=this.shim.getEnv("ZSH_NAME"))===null||o===void 0?void 0:o.includes("zsh")))!==null&&u!==void 0?u:!1}defaultCompletion(t,n,s,r){let i=this.command.getCommandHandlers();for(let u=0,h=t.length;u{let o=re(i[0]).cmd;if(n.indexOf(o)===-1)if(!this.zshShell)t.push(o);else{let u=i[1]||"";t.push(o.replace(/:/g,"\\:")+":"+u)}})}optionCompletions(t,n,s,r){if((r.match(/^-/)||r===""&&t.length===0)&&!this.previousArgHasChoices(n)){let i=this.yargs.getOptions(),o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(i.key).forEach(u=>{let h=!!i.configuration["boolean-negation"]&&i.boolean.includes(u);!o.includes(u)&&!this.argsContainKey(n,s,u,h)&&(this.completeOptionKey(u,t,r),h&&!!i.default[u]&&this.completeOptionKey(`no-${u}`,t,r))})}}choicesFromOptionsCompletions(t,n,s,r){if(this.previousArgHasChoices(n)){let i=this.getPreviousArgChoices(n);i&&i.length>0&&t.push(...i)}}choicesFromPositionalsCompletions(t,n,s,r){let i=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],o=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),u=s._.slice(o),h=i[u.length-1];if(!h)return;let _=this.yargs.getOptions().choices[h]||[];for(let d of _)d.startsWith(r)&&t.push(d)}getPreviousArgChoices(t){if(t.length<1)return;let n=t[t.length-1],s="";if(!n.startsWith("-")&&t.length>1&&(s=n,n=t[t.length-2]),!n.startsWith("-"))return;let r=n.replace(/^-+/,""),i=this.yargs.getOptions(),o=[r,...this.yargs.getAliases()[r]||[]],u;for(let h of o)if(Object.prototype.hasOwnProperty.call(i.key,h)&&Array.isArray(i.choices[h])){u=i.choices[h];break}if(u)return u.filter(h=>!s||h.startsWith(s))}previousArgHasChoices(t){let n=this.getPreviousArgChoices(t);return n!==void 0&&n.length>0}argsContainKey(t,n,s,r){if(t.indexOf(`--${s}`)!==-1||r&&t.indexOf(`--no-${s}`)!==-1)return!0;if(this.aliases){for(let i of this.aliases[s])if(n[i]!==void 0)return!0}return!1}completeOptionKey(t,n,s){let r=this.usage.getDescriptions(),i=h=>/^--/.test(h),o=h=>/^[^0-9]$/.test(h),u=!i(s)&&o(t)?"-":"--";if(!this.zshShell)n.push(u+t);else{let h=r[t]||"";n.push(u+`${t.replace(/:/g,"\\:")}:${h.replace("__yargsString__:","")}`)}}customCompletion(t,n,s,r){if(Ct(this.customCompletionFunction,null,this.shim),Uu(this.customCompletionFunction)){let i=this.customCompletionFunction(s,n);return ot(i)?i.then(o=>{this.shim.process.nextTick(()=>{r(null,o)})}).catch(o=>{this.shim.process.nextTick(()=>{r(o,void 0)})}):r(null,i)}else return Wu(this.customCompletionFunction)?this.customCompletionFunction(s,n,(i=r)=>this.defaultCompletion(t,n,s,i),i=>{r(null,i)}):this.customCompletionFunction(s,n,i=>{r(null,i)})}getCompletion(t,n){let s=t.length?t[t.length-1]:"",r=this.yargs.parse(t,!0),i=this.customCompletionFunction?o=>this.customCompletion(t,o,s,n):o=>this.defaultCompletion(t,o,s,n);return ot(r)?r.then(i):i(r)}generateCompletionScript(t,n){let s=this.zshShell?Ai:Ti,r=this.shim.path.basename(t);return t.match(/\.js$/)&&(t=`./${t}`),s=s.replace(/{{app_name}}/g,r),s=s.replace(/{{completion_command}}/g,n),s.replace(/{{app_path}}/g,t)}registerFunction(t){this.customCompletionFunction=t}setParsed(t){this.aliases=t.aliases}};function Ii(e,t,n,s){return new Si(e,t,n,s)}function Uu(e){return e.length<3}function Wu(e){return e.length>3}function xi(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;let n=[],s;for(s=0;s<=t.length;s++)n[s]=[s];let r;for(r=0;r<=e.length;r++)n[0][r]=r;for(s=1;s<=t.length;s++)for(r=1;r<=e.length;r++)t.charAt(s-1)===e.charAt(r-1)?n[s][r]=n[s-1][r-1]:s>1&&r>1&&t.charAt(s-2)===e.charAt(r-1)&&t.charAt(s-1)===e.charAt(r-2)?n[s][r]=n[s-2][r-2]+1:n[s][r]=Math.min(n[s-1][r-1]+1,Math.min(n[s][r-1]+1,n[s-1][r]+1));return n[t.length][e.length]}var Ri=["$0","--","_"];function Pi(e,t,n){let s=n.y18n.__,r=n.y18n.__n,i={};i.nonOptionCount=function(l){let m=e.getDemandedCommands(),T=l._.length+(l["--"]?l["--"].length:0)-e.getInternalMethods().getContext().commands.length;m._&&(Tm._.max)&&(Tm._.max&&(m._.maxMsg!==void 0?t.fail(m._.maxMsg?m._.maxMsg.replace(/\$0/g,T.toString()).replace(/\$1/,m._.max.toString()):null):t.fail(r("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",T,T.toString(),m._.max.toString()))))},i.positionalCount=function(l,m){m"u")&&(b=b||{},b[T]=m[T]);if(b){let T=[];for(let g of Object.keys(b)){let D=b[g];D&&T.indexOf(D)<0&&T.push(D)}let w=T.length?` +${T.join(` +`)}`:"";t.fail(r("Missing required argument: %s","Missing required arguments: %s",Object.keys(b).length,Object.keys(b).join(", ")+w))}},i.unknownArguments=function(l,m,b,T,w=!0){var g;let D=e.getInternalMethods().getCommandInstance().getCommands(),U=[],Y=e.getInternalMethods().getContext();if(Object.keys(l).forEach(W=>{!Ri.includes(W)&&!Object.prototype.hasOwnProperty.call(b,W)&&!Object.prototype.hasOwnProperty.call(e.getInternalMethods().getParseContext(),W)&&!i.isValidAndSomeAliasIsNotNew(W,m)&&U.push(W)}),w&&(Y.commands.length>0||D.length>0||T)&&l._.slice(Y.commands.length).forEach(W=>{D.includes(""+W)||U.push(""+W)}),w){let Q=((g=e.getDemandedCommands()._)===null||g===void 0?void 0:g.max)||0,Tt=Y.commands.length+Q;Tt{wt=String(wt),!Y.commands.includes(wt)&&!U.includes(wt)&&U.push(wt)})}U.length&&t.fail(r("Unknown argument: %s","Unknown arguments: %s",U.length,U.map(W=>W.trim()?W:`"${W}"`).join(", ")))},i.unknownCommands=function(l){let m=e.getInternalMethods().getCommandInstance().getCommands(),b=[],T=e.getInternalMethods().getContext();return(T.commands.length>0||m.length>0)&&l._.slice(T.commands.length).forEach(w=>{m.includes(""+w)||b.push(""+w)}),b.length>0?(t.fail(r("Unknown command: %s","Unknown commands: %s",b.length,b.join(", "))),!0):!1},i.isValidAndSomeAliasIsNotNew=function(l,m){if(!Object.prototype.hasOwnProperty.call(m,l))return!1;let b=e.parsed.newAliases;return[l,...m[l]].some(T=>!Object.prototype.hasOwnProperty.call(b,T)||!b[l])},i.limitedChoices=function(l){let m=e.getOptions(),b={};if(!Object.keys(m.choices).length)return;Object.keys(l).forEach(g=>{Ri.indexOf(g)===-1&&Object.prototype.hasOwnProperty.call(m.choices,g)&&[].concat(l[g]).forEach(D=>{m.choices[g].indexOf(D)===-1&&D!==void 0&&(b[g]=(b[g]||[]).concat(D))})});let T=Object.keys(b);if(!T.length)return;let w=s("Invalid values:");T.forEach(g=>{w+=` + ${s("Argument: %s, Given: %s, Choices: %s",g,t.stringifiedValues(b[g]),t.stringifiedValues(m.choices[g]))}`}),t.fail(w)};let o={};i.implies=function(l,m){x(" [array|number|string]",[l,m],arguments.length),typeof l=="object"?Object.keys(l).forEach(b=>{i.implies(b,l[b])}):(e.global(l),o[l]||(o[l]=[]),Array.isArray(m)?m.forEach(b=>i.implies(l,b)):(Ct(m,void 0,n),o[l].push(m)))},i.getImplied=function(){return o};function u(d,l){let m=Number(l);return l=isNaN(m)?l:m,typeof l=="number"?l=d._.length>=l:l.match(/^--no-.+/)?(l=l.match(/^--no-(.+)/)[1],l=!Object.prototype.hasOwnProperty.call(d,l)):l=Object.prototype.hasOwnProperty.call(d,l),l}i.implications=function(l){let m=[];if(Object.keys(o).forEach(b=>{let T=b;(o[b]||[]).forEach(w=>{let g=T,D=w;g=u(l,g),w=u(l,w),g&&!w&&m.push(` ${T} -> ${D}`)})}),m.length){let b=`${s("Implications failed:")} +`;m.forEach(T=>{b+=T}),t.fail(b)}};let h={};i.conflicts=function(l,m){x(" [array|string]",[l,m],arguments.length),typeof l=="object"?Object.keys(l).forEach(b=>{i.conflicts(b,l[b])}):(e.global(l),h[l]||(h[l]=[]),Array.isArray(m)?m.forEach(b=>i.conflicts(l,b)):h[l].push(m))},i.getConflicting=()=>h,i.conflicting=function(l){Object.keys(l).forEach(m=>{h[m]&&h[m].forEach(b=>{b&&l[m]!==void 0&&l[b]!==void 0&&t.fail(s("Arguments %s and %s are mutually exclusive",m,b))})}),e.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(h).forEach(m=>{h[m].forEach(b=>{b&&l[n.Parser.camelCase(m)]!==void 0&&l[n.Parser.camelCase(b)]!==void 0&&t.fail(s("Arguments %s and %s are mutually exclusive",m,b))})})},i.recommendCommands=function(l,m){m=m.sort((g,D)=>D.length-g.length);let T=null,w=1/0;for(let g=0,D;(D=m[g])!==void 0;g++){let U=xi(l,D);U<=3&&U!l[m]),h=ie(h,m=>!l[m]),i};let _=[];return i.freeze=function(){_.push({implied:o,conflicting:h})},i.unfreeze=function(){let l=_.pop();Ct(l,void 0,n),{implied:o,conflicting:h}=l},i}var gs=[],Qe;function Je(e,t,n,s){Qe=s;let r={};if(Object.prototype.hasOwnProperty.call(e,"extends")){if(typeof e.extends!="string")return r;let i=/\.json|\..*rc$/.test(e.extends),o=null;if(i)o=qu(t,e.extends);else try{o=require.resolve(e.extends)}catch{return e}zu(o),gs.push(o),r=i?JSON.parse(Qe.readFileSync(o,"utf8")):require(e.extends),delete e.extends,r=Je(r,Qe.path.dirname(o),n,Qe)}return gs=[],n?ji(r,e):Object.assign({},r,e)}function zu(e){if(gs.indexOf(e)>-1)throw new et(`Circular extended configurations: '${e}'.`)}function qu(e,t){return Qe.path.resolve(e,t)}function ji(e,t){let n={};function s(r){return r&&typeof r=="object"&&!Array.isArray(r)}Object.assign(n,e);for(let r of Object.keys(t))s(t[r])&&s(n[r])?n[r]=ji(e[r],t[r]):n[r]=t[r];return n}var j=function(e,t,n,s,r){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n},a=function(e,t,n,s){if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?s:n==="a"?s.call(e):s?s.value:t.get(e)},pt,ye,Ze,Nt,St,vn,ae,_e,Tn,$t,An,Lt,Xt,It,Ft,Fe,gt,k,Sn,In,xt,Ee,De,we,ce,xn,F,Oe,Ce,ve,G,Qt,lt;function Xi(e){return(t=[],n=e.process.cwd(),s)=>{let r=new Qi(t,n,s,e);return Object.defineProperty(r,"argv",{get:()=>r.parse(),enumerable:!0}),r.help(),r.version(),r}}var Mi=Symbol("copyDoubleDash"),ki=Symbol("copyDoubleDash"),bs=Symbol("deleteFromParserHintObject"),Ni=Symbol("emitWarning"),$i=Symbol("freeze"),Li=Symbol("getDollarZero"),Te=Symbol("getParserConfiguration"),ys=Symbol("guessLocale"),Fi=Symbol("guessVersion"),Di=Symbol("parsePositionalNumbers"),_s=Symbol("pkgUp"),ue=Symbol("populateParserHintArray"),Be=Symbol("populateParserHintSingleValueDictionary"),Es=Symbol("populateParserHintArrayDictionary"),ws=Symbol("populateParserHintDictionary"),Os=Symbol("sanitizeKey"),Cs=Symbol("setKey"),vs=Symbol("unfreeze"),Bi=Symbol("validateAsync"),Gi=Symbol("getCommandInstance"),Ui=Symbol("getContext"),Wi=Symbol("getHasOutput"),zi=Symbol("getLoggerInstance"),qi=Symbol("getParseContext"),Hi=Symbol("getUsageInstance"),Vi=Symbol("getValidationInstance"),Rn=Symbol("hasParseCallback"),Ae=Symbol("postProcess"),Yi=Symbol("rebase"),Ts=Symbol("reset"),tn=Symbol("runYargsParserAndExecuteCommands"),As=Symbol("runValidation"),Ki=Symbol("setHasOutput"),Se=Symbol("kTrackManuallySetKeys"),Qi=class{constructor(t=[],n,s,r){this.customScriptName=!1,this.parsed=!1,pt.set(this,void 0),ye.set(this,void 0),Ze.set(this,{commands:[],fullCommands:[]}),Nt.set(this,null),St.set(this,null),vn.set(this,"show-hidden"),ae.set(this,null),_e.set(this,!0),Tn.set(this,{}),$t.set(this,!0),An.set(this,[]),Lt.set(this,void 0),Xt.set(this,{}),It.set(this,!1),Ft.set(this,null),Fe.set(this,void 0),gt.set(this,""),k.set(this,void 0),Sn.set(this,void 0),In.set(this,{}),xt.set(this,null),Ee.set(this,null),De.set(this,{}),we.set(this,{}),ce.set(this,void 0),xn.set(this,!1),F.set(this,void 0),Oe.set(this,!1),Ce.set(this,!1),ve.set(this,!1),G.set(this,void 0),Qt.set(this,null),lt.set(this,void 0),j(this,F,r,"f"),j(this,ce,t,"f"),j(this,ye,n,"f"),j(this,Sn,s,"f"),j(this,Lt,new ps(this),"f"),this.$0=this[Li](),this[Ts](),j(this,pt,a(this,pt,"f"),"f"),j(this,G,a(this,G,"f"),"f"),j(this,lt,a(this,lt,"f"),"f"),j(this,k,a(this,k,"f"),"f"),a(this,k,"f").showHiddenOpt=a(this,vn,"f"),j(this,Fe,this[ki](),"f")}addHelpOpt(t,n){let s="help";return x("[string|boolean] [string]",[t,n],arguments.length),a(this,Ft,"f")&&(this[bs](a(this,Ft,"f")),j(this,Ft,null,"f")),t===!1&&n===void 0?this:(j(this,Ft,typeof t=="string"?t:s,"f"),this.boolean(a(this,Ft,"f")),this.describe(a(this,Ft,"f"),n||a(this,G,"f").deferY18nLookup("Show help")),this)}help(t,n){return this.addHelpOpt(t,n)}addShowHiddenOpt(t,n){if(x("[string|boolean] [string]",[t,n],arguments.length),t===!1&&n===void 0)return this;let s=typeof t=="string"?t:a(this,vn,"f");return this.boolean(s),this.describe(s,n||a(this,G,"f").deferY18nLookup("Show hidden options")),a(this,k,"f").showHiddenOpt=s,this}showHidden(t,n){return this.addShowHiddenOpt(t,n)}alias(t,n){return x(" [string|array]",[t,n],arguments.length),this[Es](this.alias.bind(this),"alias",t,n),this}array(t){return x("",[t],arguments.length),this[ue]("array",t),this[Se](t),this}boolean(t){return x("",[t],arguments.length),this[ue]("boolean",t),this[Se](t),this}check(t,n){return x(" [boolean]",[t,n],arguments.length),this.middleware((s,r)=>be(()=>t(s,r.getOptions()),i=>(i?(typeof i=="string"||i instanceof Error)&&a(this,G,"f").fail(i.toString(),i):a(this,G,"f").fail(a(this,F,"f").y18n.__("Argument check failed: %s",t.toString())),s),i=>(a(this,G,"f").fail(i.message?i.message:i.toString(),i),s)),!1,n),this}choices(t,n){return x(" [string|array]",[t,n],arguments.length),this[Es](this.choices.bind(this),"choices",t,n),this}coerce(t,n){if(x(" [function]",[t,n],arguments.length),Array.isArray(t)){if(!n)throw new et("coerce callback must be provided");for(let s of t)this.coerce(s,n);return this}else if(typeof t=="object"){for(let s of Object.keys(t))this.coerce(s,t[s]);return this}if(!n)throw new et("coerce callback must be provided");return a(this,k,"f").key[t]=!0,a(this,Lt,"f").addCoerceMiddleware((s,r)=>{let i;return be(()=>(i=r.getAliases(),n(s[t])),o=>{if(s[t]=o,i[t])for(let u of i[t])s[u]=o;return s},o=>{throw new et(o.message)})},t),this}conflicts(t,n){return x(" [string|array]",[t,n],arguments.length),a(this,lt,"f").conflicts(t,n),this}config(t="config",n,s){return x("[object|string] [string|function] [function]",[t,n,s],arguments.length),typeof t=="object"&&!Array.isArray(t)?(t=Je(t,a(this,ye,"f"),this[Te]()["deep-merge-config"]||!1,a(this,F,"f")),a(this,k,"f").configObjects=(a(this,k,"f").configObjects||[]).concat(t),this):(typeof n=="function"&&(s=n,n=void 0),this.describe(t,n||a(this,G,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach(r=>{a(this,k,"f").config[r]=s||!0}),this)}completion(t,n,s){return x("[string] [string|boolean|function] [function]",[t,n,s],arguments.length),typeof n=="function"&&(s=n,n=void 0),j(this,St,t||a(this,St,"f")||"completion","f"),!n&&n!==!1&&(n="generate completion script"),this.command(a(this,St,"f"),n),s&&a(this,Nt,"f").registerFunction(s),this}command(t,n,s,r,i,o){return x(" [string|boolean] [function|object] [function] [array] [boolean|string]",[t,n,s,r,i,o],arguments.length),a(this,pt,"f").addHandler(t,n,s,r,i,o),this}commands(t,n,s,r,i,o){return this.command(t,n,s,r,i,o)}commandDir(t,n){x(" [object]",[t,n],arguments.length);let s=a(this,Sn,"f")||a(this,F,"f").require;return a(this,pt,"f").addDirectory(t,s,a(this,F,"f").getCallerFile(),n),this}count(t){return x("",[t],arguments.length),this[ue]("count",t),this[Se](t),this}default(t,n,s){return x(" [*] [string]",[t,n,s],arguments.length),s&&(hs(t,a(this,F,"f")),a(this,k,"f").defaultDescription[t]=s),typeof n=="function"&&(hs(t,a(this,F,"f")),a(this,k,"f").defaultDescription[t]||(a(this,k,"f").defaultDescription[t]=a(this,G,"f").functionDescription(n)),n=n.call()),this[Be](this.default.bind(this),"default",t,n),this}defaults(t,n,s){return this.default(t,n,s)}demandCommand(t=1,n,s,r){return x("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,n,s,r],arguments.length),typeof n!="number"&&(s=n,n=1/0),this.global("_",!1),a(this,k,"f").demandedCommands._={min:t,max:n,minMsg:s,maxMsg:r},this}demand(t,n,s){return Array.isArray(n)?(n.forEach(r=>{Ct(s,!0,a(this,F,"f")),this.demandOption(r,s)}),n=1/0):typeof n!="number"&&(s=n,n=1/0),typeof t=="number"?(Ct(s,!0,a(this,F,"f")),this.demandCommand(t,n,s,s)):Array.isArray(t)?t.forEach(r=>{Ct(s,!0,a(this,F,"f")),this.demandOption(r,s)}):typeof s=="string"?this.demandOption(t,s):(s===!0||typeof s>"u")&&this.demandOption(t),this}demandOption(t,n){return x(" [string]",[t,n],arguments.length),this[Be](this.demandOption.bind(this),"demandedOptions",t,n),this}deprecateOption(t,n){return x(" [string|boolean]",[t,n],arguments.length),a(this,k,"f").deprecatedOptions[t]=n,this}describe(t,n){return x(" [string]",[t,n],arguments.length),this[Cs](t,!0),a(this,G,"f").describe(t,n),this}detectLocale(t){return x("",[t],arguments.length),j(this,_e,t,"f"),this}env(t){return x("[string|boolean]",[t],arguments.length),t===!1?delete a(this,k,"f").envPrefix:a(this,k,"f").envPrefix=t||"",this}epilogue(t){return x("",[t],arguments.length),a(this,G,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,n){return x(" [string]",[t,n],arguments.length),Array.isArray(t)?t.forEach(s=>this.example(...s)):a(this,G,"f").example(t,n),this}exit(t,n){j(this,It,!0,"f"),j(this,ae,n,"f"),a(this,$t,"f")&&a(this,F,"f").process.exit(t)}exitProcess(t=!0){return x("[boolean]",[t],arguments.length),j(this,$t,t,"f"),this}fail(t){if(x("",[t],arguments.length),typeof t=="boolean"&&t!==!1)throw new et("Invalid first argument. Expected function or boolean 'false'");return a(this,G,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,n){return x(" [function]",[t,n],arguments.length),n?a(this,Nt,"f").getCompletion(t,n):new Promise((s,r)=>{a(this,Nt,"f").getCompletion(t,(i,o)=>{i?r(i):s(o)})})}getDemandedOptions(){return x([],0),a(this,k,"f").demandedOptions}getDemandedCommands(){return x([],0),a(this,k,"f").demandedCommands}getDeprecatedOptions(){return x([],0),a(this,k,"f").deprecatedOptions}getDetectLocale(){return a(this,_e,"f")}getExitProcess(){return a(this,$t,"f")}getGroups(){return Object.assign({},a(this,Xt,"f"),a(this,we,"f"))}getHelp(){if(j(this,It,!0,"f"),!a(this,G,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[tn](a(this,ce,"f"),void 0,void 0,0,!0);if(ot(n))return n.then(()=>a(this,G,"f").help())}let t=a(this,pt,"f").runDefaultBuilderOn(this);if(ot(t))return t.then(()=>a(this,G,"f").help())}return Promise.resolve(a(this,G,"f").help())}getOptions(){return a(this,k,"f")}getStrict(){return a(this,Oe,"f")}getStrictCommands(){return a(this,Ce,"f")}getStrictOptions(){return a(this,ve,"f")}global(t,n){return x(" [boolean]",[t,n],arguments.length),t=[].concat(t),n!==!1?a(this,k,"f").local=a(this,k,"f").local.filter(s=>t.indexOf(s)===-1):t.forEach(s=>{a(this,k,"f").local.includes(s)||a(this,k,"f").local.push(s)}),this}group(t,n){x(" ",[t,n],arguments.length);let s=a(this,we,"f")[n]||a(this,Xt,"f")[n];a(this,we,"f")[n]&&delete a(this,we,"f")[n];let r={};return a(this,Xt,"f")[n]=(s||[]).concat(t).filter(i=>r[i]?!1:r[i]=!0),this}hide(t){return x("",[t],arguments.length),a(this,k,"f").hiddenOptions.push(t),this}implies(t,n){return x(" [number|string|array]",[t,n],arguments.length),a(this,lt,"f").implies(t,n),this}locale(t){return x("[string]",[t],arguments.length),t?(j(this,_e,!1,"f"),a(this,F,"f").y18n.setLocale(t),this):(this[ys](),a(this,F,"f").y18n.getLocale())}middleware(t,n,s){return a(this,Lt,"f").addMiddleware(t,!!n,s)}nargs(t,n){return x(" [number]",[t,n],arguments.length),this[Be](this.nargs.bind(this),"narg",t,n),this}normalize(t){return x("",[t],arguments.length),this[ue]("normalize",t),this}number(t){return x("",[t],arguments.length),this[ue]("number",t),this[Se](t),this}option(t,n){if(x(" [object]",[t,n],arguments.length),typeof t=="object")Object.keys(t).forEach(s=>{this.options(s,t[s])});else{typeof n!="object"&&(n={}),this[Se](t),a(this,Qt,"f")&&(t==="version"||(n==null?void 0:n.alias)==="version")&&this[Ni](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(` +`),void 0,"versionWarning"),a(this,k,"f").key[t]=!0,n.alias&&this.alias(t,n.alias);let s=n.deprecate||n.deprecated;s&&this.deprecateOption(t,s);let r=n.demand||n.required||n.require;r&&this.demand(t,r),n.demandOption&&this.demandOption(t,typeof n.demandOption=="string"?n.demandOption:void 0),n.conflicts&&this.conflicts(t,n.conflicts),"default"in n&&this.default(t,n.default),n.implies!==void 0&&this.implies(t,n.implies),n.nargs!==void 0&&this.nargs(t,n.nargs),n.config&&this.config(t,n.configParser),n.normalize&&this.normalize(t),n.choices&&this.choices(t,n.choices),n.coerce&&this.coerce(t,n.coerce),n.group&&this.group(t,n.group),(n.boolean||n.type==="boolean")&&(this.boolean(t),n.alias&&this.boolean(n.alias)),(n.array||n.type==="array")&&(this.array(t),n.alias&&this.array(n.alias)),(n.number||n.type==="number")&&(this.number(t),n.alias&&this.number(n.alias)),(n.string||n.type==="string")&&(this.string(t),n.alias&&this.string(n.alias)),(n.count||n.type==="count")&&this.count(t),typeof n.global=="boolean"&&this.global(t,n.global),n.defaultDescription&&(a(this,k,"f").defaultDescription[t]=n.defaultDescription),n.skipValidation&&this.skipValidation(t);let i=n.describe||n.description||n.desc;this.describe(t,i),n.hidden&&this.hide(t),n.requiresArg&&this.requiresArg(t)}return this}options(t,n){return this.option(t,n)}parse(t,n,s){x("[string|array] [function|boolean|object] [function]",[t,n,s],arguments.length),this[$i](),typeof t>"u"&&(t=a(this,ce,"f")),typeof n=="object"&&(j(this,Ee,n,"f"),n=s),typeof n=="function"&&(j(this,xt,n,"f"),n=!1),n||j(this,ce,t,"f"),a(this,xt,"f")&&j(this,$t,!1,"f");let r=this[tn](t,!!n),i=this.parsed;return a(this,Nt,"f").setParsed(this.parsed),ot(r)?r.then(o=>(a(this,xt,"f")&&a(this,xt,"f").call(this,a(this,ae,"f"),o,a(this,gt,"f")),o)).catch(o=>{throw a(this,xt,"f")&&a(this,xt,"f")(o,this.parsed.argv,a(this,gt,"f")),o}).finally(()=>{this[vs](),this.parsed=i}):(a(this,xt,"f")&&a(this,xt,"f").call(this,a(this,ae,"f"),r,a(this,gt,"f")),this[vs](),this.parsed=i,r)}parseAsync(t,n,s){let r=this.parse(t,n,s);return ot(r)?r:Promise.resolve(r)}parseSync(t,n,s){let r=this.parse(t,n,s);if(ot(r))throw new et(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return r}parserConfiguration(t){return x("",[t],arguments.length),j(this,In,t,"f"),this}pkgConf(t,n){x(" [string]",[t,n],arguments.length);let s=null,r=this[_s](n||a(this,ye,"f"));return r[t]&&typeof r[t]=="object"&&(s=Je(r[t],n||a(this,ye,"f"),this[Te]()["deep-merge-config"]||!1,a(this,F,"f")),a(this,k,"f").configObjects=(a(this,k,"f").configObjects||[]).concat(s)),this}positional(t,n){x(" ",[t,n],arguments.length);let s=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];n=ie(n,(o,u)=>o==="type"&&!["string","number","boolean"].includes(u)?!1:s.includes(o));let r=a(this,Ze,"f").fullCommands[a(this,Ze,"f").fullCommands.length-1],i=r?a(this,pt,"f").cmdToParseOptions(r):{array:[],alias:{},default:{},demand:{}};return $e(i).forEach(o=>{let u=i[o];Array.isArray(u)?u.indexOf(t)!==-1&&(n[o]=!0):u[t]&&!(o in n)&&(n[o]=u[t])}),this.group(t,a(this,G,"f").getPositionalGroupName()),this.option(t,n)}recommendCommands(t=!0){return x("[boolean]",[t],arguments.length),j(this,xn,t,"f"),this}required(t,n,s){return this.demand(t,n,s)}require(t,n,s){return this.demand(t,n,s)}requiresArg(t){return x(" [number]",[t],arguments.length),typeof t=="string"&&a(this,k,"f").narg[t]?this:(this[Be](this.requiresArg.bind(this),"narg",t,NaN),this)}showCompletionScript(t,n){return x("[string] [string]",[t,n],arguments.length),t=t||this.$0,a(this,Fe,"f").log(a(this,Nt,"f").generateCompletionScript(t,n||a(this,St,"f")||"completion")),this}showHelp(t){if(x("[string|function]",[t],arguments.length),j(this,It,!0,"f"),!a(this,G,"f").hasCachedHelpMessage()){if(!this.parsed){let s=this[tn](a(this,ce,"f"),void 0,void 0,0,!0);if(ot(s))return s.then(()=>{a(this,G,"f").showHelp(t)}),this}let n=a(this,pt,"f").runDefaultBuilderOn(this);if(ot(n))return n.then(()=>{a(this,G,"f").showHelp(t)}),this}return a(this,G,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,n){return x("[boolean|string] [string]",[t,n],arguments.length),a(this,G,"f").showHelpOnFail(t,n),this}showVersion(t){return x("[string|function]",[t],arguments.length),a(this,G,"f").showVersion(t),this}skipValidation(t){return x("",[t],arguments.length),this[ue]("skipValidation",t),this}strict(t){return x("[boolean]",[t],arguments.length),j(this,Oe,t!==!1,"f"),this}strictCommands(t){return x("[boolean]",[t],arguments.length),j(this,Ce,t!==!1,"f"),this}strictOptions(t){return x("[boolean]",[t],arguments.length),j(this,ve,t!==!1,"f"),this}string(t){return x("",[t],arguments.length),this[ue]("string",t),this[Se](t),this}terminalWidth(){return x([],0),a(this,F,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return x("",[t],arguments.length),j(this,_e,!1,"f"),a(this,F,"f").y18n.updateLocale(t),this}usage(t,n,s,r){if(x(" [string|boolean] [function|object] [function]",[t,n,s,r],arguments.length),n!==void 0){if(Ct(t,null,a(this,F,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,n,s,r);throw new et(".usage() description must start with $0 if being used as alias for .command()")}else return a(this,G,"f").usage(t),this}version(t,n,s){let r="version";if(x("[boolean|string] [string] [string]",[t,n,s],arguments.length),a(this,Qt,"f")&&(this[bs](a(this,Qt,"f")),a(this,G,"f").version(void 0),j(this,Qt,null,"f")),arguments.length===0)s=this[Fi](),t=r;else if(arguments.length===1){if(t===!1)return this;s=t,t=r}else arguments.length===2&&(s=n,n=void 0);return j(this,Qt,typeof t=="string"?t:r,"f"),n=n||a(this,G,"f").deferY18nLookup("Show version number"),a(this,G,"f").version(s||void 0),this.boolean(a(this,Qt,"f")),this.describe(a(this,Qt,"f"),n),this}wrap(t){return x("",[t],arguments.length),a(this,G,"f").wrap(t),this}[(pt=new WeakMap,ye=new WeakMap,Ze=new WeakMap,Nt=new WeakMap,St=new WeakMap,vn=new WeakMap,ae=new WeakMap,_e=new WeakMap,Tn=new WeakMap,$t=new WeakMap,An=new WeakMap,Lt=new WeakMap,Xt=new WeakMap,It=new WeakMap,Ft=new WeakMap,Fe=new WeakMap,gt=new WeakMap,k=new WeakMap,Sn=new WeakMap,In=new WeakMap,xt=new WeakMap,Ee=new WeakMap,De=new WeakMap,we=new WeakMap,ce=new WeakMap,xn=new WeakMap,F=new WeakMap,Oe=new WeakMap,Ce=new WeakMap,ve=new WeakMap,G=new WeakMap,Qt=new WeakMap,lt=new WeakMap,Mi)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch{}return t}[ki](){return{log:(...t)=>{this[Rn]()||console.log(...t),j(this,It,!0,"f"),a(this,gt,"f").length&&j(this,gt,a(this,gt,"f")+` +`,"f"),j(this,gt,a(this,gt,"f")+t.join(" "),"f")},error:(...t)=>{this[Rn]()||console.error(...t),j(this,It,!0,"f"),a(this,gt,"f").length&&j(this,gt,a(this,gt,"f")+` +`,"f"),j(this,gt,a(this,gt,"f")+t.join(" "),"f")}}}[bs](t){$e(a(this,k,"f")).forEach(n=>{if((r=>r==="configObjects")(n))return;let s=a(this,k,"f")[n];Array.isArray(s)?s.includes(t)&&s.splice(s.indexOf(t),1):typeof s=="object"&&delete s[t]}),delete a(this,G,"f").getDescriptions()[t]}[Ni](t,n,s){a(this,Tn,"f")[s]||(a(this,F,"f").process.emitWarning(t,n),a(this,Tn,"f")[s]=!0)}[$i](){a(this,An,"f").push({options:a(this,k,"f"),configObjects:a(this,k,"f").configObjects.slice(0),exitProcess:a(this,$t,"f"),groups:a(this,Xt,"f"),strict:a(this,Oe,"f"),strictCommands:a(this,Ce,"f"),strictOptions:a(this,ve,"f"),completionCommand:a(this,St,"f"),output:a(this,gt,"f"),exitError:a(this,ae,"f"),hasOutput:a(this,It,"f"),parsed:this.parsed,parseFn:a(this,xt,"f"),parseContext:a(this,Ee,"f")}),a(this,G,"f").freeze(),a(this,lt,"f").freeze(),a(this,pt,"f").freeze(),a(this,Lt,"f").freeze()}[Li](){let t="",n;return/\b(node|iojs|electron)(\.exe)?$/.test(a(this,F,"f").process.argv()[0])?n=a(this,F,"f").process.argv().slice(1,2):n=a(this,F,"f").process.argv().slice(0,1),t=n.map(s=>{let r=this[Yi](a(this,ye,"f"),s);return s.match(/^(\/|([a-zA-Z]:)?\\)/)&&r.length{if(u.includes("package.json"))return"package.json"});Ct(i,void 0,a(this,F,"f")),s=JSON.parse(a(this,F,"f").readFileSync(i,"utf8"))}catch{}return a(this,De,"f")[n]=s||{},a(this,De,"f")[n]}[ue](t,n){n=[].concat(n),n.forEach(s=>{s=this[Os](s),a(this,k,"f")[t].push(s)})}[Be](t,n,s,r){this[ws](t,n,s,r,(i,o,u)=>{a(this,k,"f")[i][o]=u})}[Es](t,n,s,r){this[ws](t,n,s,r,(i,o,u)=>{a(this,k,"f")[i][o]=(a(this,k,"f")[i][o]||[]).concat(u)})}[ws](t,n,s,r,i){if(Array.isArray(s))s.forEach(o=>{t(o,r)});else if((o=>typeof o=="object")(s))for(let o of $e(s))t(o,s[o]);else i(n,this[Os](s),r)}[Os](t){return t==="__proto__"?"___proto___":t}[Cs](t,n){return this[Be](this[Cs].bind(this),"key",t,n),this}[vs](){var t,n,s,r,i,o,u,h,_,d,l,m;let b=a(this,An,"f").pop();Ct(b,void 0,a(this,F,"f"));let T;t=this,n=this,s=this,r=this,i=this,o=this,u=this,h=this,_=this,d=this,l=this,m=this,{options:{set value(w){j(t,k,w,"f")}}.value,configObjects:T,exitProcess:{set value(w){j(n,$t,w,"f")}}.value,groups:{set value(w){j(s,Xt,w,"f")}}.value,output:{set value(w){j(r,gt,w,"f")}}.value,exitError:{set value(w){j(i,ae,w,"f")}}.value,hasOutput:{set value(w){j(o,It,w,"f")}}.value,parsed:this.parsed,strict:{set value(w){j(u,Oe,w,"f")}}.value,strictCommands:{set value(w){j(h,Ce,w,"f")}}.value,strictOptions:{set value(w){j(_,ve,w,"f")}}.value,completionCommand:{set value(w){j(d,St,w,"f")}}.value,parseFn:{set value(w){j(l,xt,w,"f")}}.value,parseContext:{set value(w){j(m,Ee,w,"f")}}.value}=b,a(this,k,"f").configObjects=T,a(this,G,"f").unfreeze(),a(this,lt,"f").unfreeze(),a(this,pt,"f").unfreeze(),a(this,Lt,"f").unfreeze()}[Bi](t,n){return be(n,s=>(t(s),s))}getInternalMethods(){return{getCommandInstance:this[Gi].bind(this),getContext:this[Ui].bind(this),getHasOutput:this[Wi].bind(this),getLoggerInstance:this[zi].bind(this),getParseContext:this[qi].bind(this),getParserConfiguration:this[Te].bind(this),getUsageInstance:this[Hi].bind(this),getValidationInstance:this[Vi].bind(this),hasParseCallback:this[Rn].bind(this),postProcess:this[Ae].bind(this),reset:this[Ts].bind(this),runValidation:this[As].bind(this),runYargsParserAndExecuteCommands:this[tn].bind(this),setHasOutput:this[Ki].bind(this)}}[Gi](){return a(this,pt,"f")}[Ui](){return a(this,Ze,"f")}[Wi](){return a(this,It,"f")}[zi](){return a(this,Fe,"f")}[qi](){return a(this,Ee,"f")||{}}[Hi](){return a(this,G,"f")}[Vi](){return a(this,lt,"f")}[Rn](){return!!a(this,xt,"f")}[Ae](t,n,s,r){return s||ot(t)||(n||(t=this[Mi](t)),(this[Te]()["parse-positional-numbers"]||this[Te]()["parse-positional-numbers"]===void 0)&&(t=this[Di](t)),r&&(t=ge(t,this,a(this,Lt,"f").getMiddleware(),!1))),t}[Ts](t={}){j(this,k,a(this,k,"f")||{},"f");let n={};n.local=a(this,k,"f").local||[],n.configObjects=a(this,k,"f").configObjects||[];let s={};n.local.forEach(o=>{s[o]=!0,(t[o]||[]).forEach(u=>{s[u]=!0})}),Object.assign(a(this,we,"f"),Object.keys(a(this,Xt,"f")).reduce((o,u)=>{let h=a(this,Xt,"f")[u].filter(_=>!(_ in s));return h.length>0&&(o[u]=h),o},{})),j(this,Xt,{},"f");let r=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],i=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return r.forEach(o=>{n[o]=(a(this,k,"f")[o]||[]).filter(u=>!s[u])}),i.forEach(o=>{n[o]=ie(a(this,k,"f")[o],u=>!s[u])}),n.envPrefix=a(this,k,"f").envPrefix,j(this,k,n,"f"),j(this,G,a(this,G,"f")?a(this,G,"f").reset(s):vi(this,a(this,F,"f")),"f"),j(this,lt,a(this,lt,"f")?a(this,lt,"f").reset(s):Pi(this,a(this,G,"f"),a(this,F,"f")),"f"),j(this,pt,a(this,pt,"f")?a(this,pt,"f").reset():wi(a(this,G,"f"),a(this,lt,"f"),a(this,Lt,"f"),a(this,F,"f")),"f"),a(this,Nt,"f")||j(this,Nt,Ii(this,a(this,G,"f"),a(this,pt,"f"),a(this,F,"f")),"f"),a(this,Lt,"f").reset(),j(this,St,null,"f"),j(this,gt,"","f"),j(this,ae,null,"f"),j(this,It,!1,"f"),this.parsed=!1,this}[Yi](t,n){return a(this,F,"f").path.relative(t,n)}[tn](t,n,s,r=0,i=!1){let o=!!s||i;t=t||a(this,ce,"f"),a(this,k,"f").__=a(this,F,"f").y18n.__,a(this,k,"f").configuration=this[Te]();let u=!!a(this,k,"f").configuration["populate--"],h=Object.assign({},a(this,k,"f").configuration,{"populate--":!0}),_=a(this,F,"f").Parser.detailed(t,Object.assign({},a(this,k,"f"),{configuration:je({"parse-positional-numbers":!1},h)})),d=Object.assign(_.argv,a(this,Ee,"f")),l,m=_.aliases,b=!1,T=!1;Object.keys(d).forEach(w=>{w===a(this,Ft,"f")&&d[w]?b=!0:w===a(this,Qt,"f")&&d[w]&&(T=!0)}),d.$0=this.$0,this.parsed=_,r===0&&a(this,G,"f").clearCachedHelpMessage();try{if(this[ys](),n)return this[Ae](d,u,!!s,!1);a(this,Ft,"f")&&[a(this,Ft,"f")].concat(m[a(this,Ft,"f")]||[]).filter(Y=>Y.length>1).includes(""+d._[d._.length-1])&&(d._.pop(),b=!0);let w=a(this,pt,"f").getCommands(),g=a(this,Nt,"f").completionKey in d,D=b||g||i;if(d._.length){if(w.length){let U;for(let Y=r||0,W;d._[Y]!==void 0;Y++)if(W=String(d._[Y]),w.includes(W)&&W!==a(this,St,"f")){let Q=a(this,pt,"f").runCommand(W,this,_,Y+1,i,b||T||i);return this[Ae](Q,u,!!s,!1)}else if(!U&&W!==a(this,St,"f")){U=W;break}!a(this,pt,"f").hasDefaultCommand()&&a(this,xn,"f")&&U&&!D&&a(this,lt,"f").recommendCommands(U,w)}a(this,St,"f")&&d._.includes(a(this,St,"f"))&&!g&&(a(this,$t,"f")&&oe(!0),this.showCompletionScript(),this.exit(0))}if(a(this,pt,"f").hasDefaultCommand()&&!D){let U=a(this,pt,"f").runCommand(null,this,_,0,i,b||T||i);return this[Ae](U,u,!!s,!1)}if(g){a(this,$t,"f")&&oe(!0),t=[].concat(t);let U=t.slice(t.indexOf(`--${a(this,Nt,"f").completionKey}`)+1);return a(this,Nt,"f").getCompletion(U,(Y,W)=>{if(Y)throw new et(Y.message);(W||[]).forEach(Q=>{a(this,Fe,"f").log(Q)}),this.exit(0)}),this[Ae](d,!u,!!s,!1)}if(a(this,It,"f")||(b?(a(this,$t,"f")&&oe(!0),o=!0,this.showHelp("log"),this.exit(0)):T&&(a(this,$t,"f")&&oe(!0),o=!0,a(this,G,"f").showVersion("log"),this.exit(0))),!o&&a(this,k,"f").skipValidation.length>0&&(o=Object.keys(d).some(U=>a(this,k,"f").skipValidation.indexOf(U)>=0&&d[U]===!0)),!o){if(_.error)throw new et(_.error.message);if(!g){let U=this[As](m,{},_.error);s||(l=ge(d,this,a(this,Lt,"f").getMiddleware(),!0)),l=this[Bi](U,l??d),ot(l)&&!s&&(l=l.then(()=>ge(d,this,a(this,Lt,"f").getMiddleware(),!1)))}}}catch(w){if(w instanceof et)a(this,G,"f").fail(w.message,w);else throw w}return this[Ae](l??d,u,!!s,!0)}[As](t,n,s,r){let i=je({},this.getDemandedOptions());return o=>{if(s)throw new et(s.message);a(this,lt,"f").nonOptionCount(o),a(this,lt,"f").requiredArguments(o,i);let u=!1;a(this,Ce,"f")&&(u=a(this,lt,"f").unknownCommands(o)),a(this,Oe,"f")&&!u?a(this,lt,"f").unknownArguments(o,t,n,!!r):a(this,ve,"f")&&a(this,lt,"f").unknownArguments(o,t,{},!1,!1),a(this,lt,"f").limitedChoices(o),a(this,lt,"f").implications(o),a(this,lt,"f").conflicting(o)}}[Ki](){j(this,It,!0,"f")}[Se](t){if(typeof t=="string")a(this,k,"f").key[t]=!0;else for(let n of t)a(this,k,"f").key[n]=!0}};function Oi(e){return!!e&&typeof e.getInternalMethods=="function"}var Hu=Xi(fs),Ji=Hu;var Hn=Me(lo(),1),zn=Me(Rs(),1),Sa=require("child_process"),ic=Me(js(),1),He=Me(js(),1),qn=Object.defineProperty,Ol=Object.defineProperties,Cl=Object.getOwnPropertyDescriptor,vl=Object.getOwnPropertyDescriptors,Xs=Object.getOwnPropertyNames,fo=Object.getOwnPropertySymbols,Fo=Object.prototype.hasOwnProperty,Tl=Object.prototype.propertyIsEnumerable,ho=(e,t,n)=>t in e?qn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Jt=(e,t)=>{for(var n in t||(t={}))Fo.call(t,n)&&ho(e,n,t[n]);if(fo)for(var n of fo(t))Tl.call(t,n)&&ho(e,n,t[n]);return e},$s=(e,t)=>Ol(e,vl(t)),Al=e=>qn(e,"__esModule",{value:!0}),C=(e,t)=>function(){return e&&(t=(0,e[Xs(e)[0]])(e=0)),t},Sl=(e,t)=>function(){return t||(0,e[Xs(e)[0]])((t={exports:{}}).exports,t),t.exports},ft=(e,t)=>{for(var n in t)qn(e,n,{get:t[n],enumerable:!0})},Il=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Xs(t))!Fo.call(e,r)&&(n||r!=="default")&&qn(e,r,{get:()=>t[r],enumerable:!(s=Cl(t,r))||s.enumerable});return e},ut=(e=>(t,n)=>e&&e.get(t)||(n=Il(Al({}),t,1),e&&e.set(t,n),n))(typeof WeakMap<"u"?new WeakMap:0),nn=(e,t,n)=>new Promise((s,r)=>{var i=h=>{try{u(n.next(h))}catch(_){r(_)}},o=h=>{try{u(n.throw(h))}catch(_){r(_)}},u=h=>h.done?s(h.value):Promise.resolve(h.value).then(i,o);u((n=n.apply(e,t)).next())}),ne,pe=C({"src/lib/errors/git-error.ts"(){ne=class extends Error{constructor(e,t){super(t);this.task=e,Object.setPrototypeOf(this,new.target.prototype)}}}}),on,Ve=C({"src/lib/errors/git-response-error.ts"(){pe(),on=class extends ne{constructor(e,t){super(void 0,t||String(e));this.git=e}}}}),Do,Bo=C({"src/lib/errors/task-configuration-error.ts"(){pe(),Do=class extends ne{constructor(e){super(void 0,e)}}}});function Go(e){return typeof e=="function"?e:Pe}function Uo(e){return typeof e=="function"&&e!==Pe}function Wo(e,t){let n=e.indexOf(t);return n<=0?[e,""]:[e.substr(0,n),e.substr(n+1)]}function zo(e,t=0){return qo(e)&&e.length>t?e[t]:void 0}function Re(e,t=0){if(qo(e)&&e.length>t)return e[e.length-1-t]}function qo(e){return!!(e&&typeof e.length=="number")}function an(e="",t=!0,n=` +`){return e.split(n).reduce((s,r)=>{let i=t?r.trim():r;return i&&s.push(i),s},[])}function Qs(e,t){return an(e,!0).map(n=>t(n))}function Js(e){return(0,Hn.exists)(e,Hn.FOLDER)}function K(e,t){return Array.isArray(e)?e.includes(t)||e.push(t):e.add(t),t}function Ho(e,t){return Array.isArray(e)&&!e.includes(t)&&e.push(t),e}function Zs(e,t){if(Array.isArray(e)){let n=e.indexOf(t);n>=0&&e.splice(n,1)}else e.delete(t);return t}function cn(e){return Array.isArray(e)?e:[e]}function Vo(e){return cn(e).map(String)}function Vt(e,t=0){if(e==null)return t;let n=parseInt(e,10);return isNaN(n)?t:n}function Wn(e,t){let n=[];for(let s=0,r=e.length;sn in e?{[n]:e[n]}:{}))}function Ls(e=0){return new Promise(t=>setTimeout(t,e))}var Vn,Pe,un,Yn=C({"src/lib/utils/util.ts"(){Vn="\0",Pe=()=>{},un=Object.prototype.toString.call.bind(Object.prototype.toString)}});function he(e,t,n){return t(e)?e:arguments.length>2?n:void 0}function tr(e,t){return/number|string|boolean/.test(typeof e)&&(!t||!t.includes(typeof e))}function er(e){return!!e&&un(e)==="[object Object]"}function Ko(e){return typeof e=="function"}var Kn,_t,Xo,Qo,nr,Jo=C({"src/lib/utils/argument-filters.ts"(){Yn(),Kn=e=>Array.isArray(e),_t=e=>typeof e=="string",Xo=e=>Array.isArray(e)&&e.every(_t),Qo=e=>_t(e)||Array.isArray(e)&&e.every(_t),nr=e=>e==null||"number|boolean|function".includes(typeof e)?!1:Array.isArray(e)||typeof e=="string"||typeof e.length=="number"}}),Fs,xl=C({"src/lib/utils/exit-codes.ts"(){Fs=(e=>(e[e.SUCCESS=0]="SUCCESS",e[e.ERROR=1]="ERROR",e[e.UNCLEAN=128]="UNCLEAN",e))(Fs||{})}}),rn,Rl=C({"src/lib/utils/git-output-streams.ts"(){rn=class{constructor(e,t){this.stdOut=e,this.stdErr=t}asStrings(){return new rn(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}}),X,fe,Pl=C({"src/lib/utils/line-parser.ts"(){X=class{constructor(e,t){this.matches=[],this.parse=(n,s)=>(this.resetMatches(),this._regExp.every((r,i)=>this.addMatch(r,i,n(i)))?this.useMatches(s,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,n){let s=n&&e.exec(n);return s&&this.pushMatch(t,s),!!s}pushMatch(e,t){this.matches.push(...t.slice(1))}},fe=class extends X{addMatch(e,t,n){return/^remote:\s/.test(String(n))&&super.addMatch(e,t,n)}pushMatch(e,t){(e>0||t.length>1)&&super.pushMatch(e,t)}}}});function Zo(...e){let t=process.cwd(),n=Object.assign(Jt({baseDir:t},ta),...e.filter(s=>typeof s=="object"&&s));return n.baseDir=n.baseDir||t,n}var ta,jl=C({"src/lib/utils/simple-git-options.ts"(){ta={binary:"git",maxConcurrentProcesses:5,config:[]}}});function sr(e,t=[]){return er(e)?Object.keys(e).reduce((n,s)=>{let r=e[s];return tr(r,["boolean"])?n.push(s+"="+r):n.push(s),n},t):t}function le(e,t=0,n=!1){let s=[];for(let r=0,i=t<0?e.length:t;r{for(let r=an(s),i=0,o=r.length;i{if(!(i+h>=o))return r[i+h]};t.some(({parse:h})=>h(u,e))}}),e}var Nl=C({"src/lib/utils/task-parser.ts"(){Yn()}}),ea={};ft(ea,{ExitCodes:()=>Fs,GitOutputStreams:()=>rn,LineParser:()=>X,NOOP:()=>Pe,NULL:()=>Vn,RemoteLineParser:()=>fe,append:()=>K,appendTaskOptions:()=>sr,asArray:()=>cn,asFunction:()=>Go,asNumber:()=>Vt,asStringArray:()=>Vo,bufferToString:()=>sn,callTaskParser:()=>Ds,createInstanceConfig:()=>Zo,delay:()=>Ls,filterArray:()=>Kn,filterFunction:()=>Ko,filterHasLength:()=>nr,filterPlainObject:()=>er,filterPrimitives:()=>tr,filterString:()=>_t,filterStringArray:()=>Xo,filterStringOrStringArray:()=>Qo,filterType:()=>he,first:()=>zo,folderExists:()=>Js,forEachLineWithContent:()=>Qs,getTrailingOptions:()=>le,including:()=>Ho,isUserFunction:()=>Uo,last:()=>Re,objectToString:()=>un,parseStringResponse:()=>Kt,pick:()=>Yo,prefixedArray:()=>Wn,remove:()=>Zs,splitOn:()=>Wo,toLinesWithContent:()=>an,trailingFunctionArgument:()=>vt,trailingOptionsArgument:()=>rr});var q=C({"src/lib/utils/index.ts"(){Jo(),xl(),Rl(),Pl(),jl(),kl(),Nl(),Yn()}}),na={};ft(na,{CheckRepoActions:()=>Bs,checkIsBareRepoTask:()=>ra,checkIsRepoRootTask:()=>sa,checkIsRepoTask:()=>$l});function $l(e){switch(e){case"bare":return ra();case"root":return sa()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:Xn,parser:ir}}function sa(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:Xn,parser(t){return/^\.(git)?$/.test(t.trim())}}}function ra(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:Xn,parser:ir}}function Ll(e){return/(Not a git repository|Kein Git-Repository)/i.test(String(e))}var Bs,Xn,ir,ia=C({"src/lib/tasks/check-is-repo.ts"(){q(),Bs=(e=>(e.BARE="bare",e.IN_TREE="tree",e.IS_REPO_ROOT="root",e))(Bs||{}),Xn=({exitCode:e},t,n,s)=>{if(e===128&&Ll(t))return n(Buffer.from("false"));s(t)},ir=e=>e.trim()==="true"}});function Fl(e,t){let n=new oa(e),s=e?ca:aa;return an(t).forEach(r=>{let i=r.replace(s,"");n.paths.push(i),(ua.test(i)?n.folders:n.files).push(i)}),n}var oa,aa,ca,ua,Dl=C({"src/lib/responses/CleanSummary.ts"(){q(),oa=class{constructor(e){this.dryRun=e,this.paths=[],this.files=[],this.folders=[]}},aa=/^[a-z]+\s*/i,ca=/^[a-z]+\s+[a-z]+\s*/i,ua=/\/$/}}),Gs={};ft(Gs,{EMPTY_COMMANDS:()=>Qn,adhocExecTask:()=>la,configurationErrorTask:()=>Yt,isBufferTask:()=>fa,isEmptyTask:()=>ha,straightThroughBufferTask:()=>Bl,straightThroughStringTask:()=>Dt});function la(e){return{commands:Qn,format:"empty",parser:e}}function Yt(e){return{commands:Qn,format:"empty",parser(){throw typeof e=="string"?new Do(e):e}}}function Dt(e,t=!1){return{commands:e,format:"utf-8",parser(n){return t?String(n).trim():n}}}function Bl(e){return{commands:e,format:"buffer",parser(t){return t}}}function fa(e){return e.format==="buffer"}function ha(e){return e.format==="empty"||!e.commands.length}var Qn,Et=C({"src/lib/tasks/task.ts"(){Bo(),Qn=[]}}),pa={};ft(pa,{CONFIG_ERROR_INTERACTIVE_MODE:()=>or,CONFIG_ERROR_MODE_REQUIRED:()=>ar,CONFIG_ERROR_UNKNOWN_OPTION:()=>cr,CleanOptions:()=>Dn,cleanTask:()=>da,cleanWithOptionsTask:()=>Gl,isCleanOptionsArray:()=>Ul});function Gl(e,t){let{cleanMode:n,options:s,valid:r}=Wl(e);return n?r.options?(s.push(...t),s.some(Hl)?Yt(or):da(n,s)):Yt(cr+JSON.stringify(e)):Yt(ar)}function da(e,t){return{commands:["clean",`-${e}`,...t],format:"utf-8",parser(s){return Fl(e==="n",s)}}}function Ul(e){return Array.isArray(e)&&e.every(t=>ur.has(t))}function Wl(e){let t,n=[],s={cleanMode:!1,options:!0};return e.replace(/[^a-z]i/g,"").split("").forEach(r=>{zl(r)?(t=r,s.cleanMode=!0):s.options=s.options&&ql(n[n.length]=`-${r}`)}),{cleanMode:t,options:n,valid:s}}function zl(e){return e==="f"||e==="n"}function ql(e){return/^-[a-z]$/i.test(e)&&ur.has(e.charAt(1))}function Hl(e){return/^-[^\-]/.test(e)?e.indexOf("i")>0:e==="--interactive"}var or,ar,cr,Dn,ur,ma=C({"src/lib/tasks/clean.ts"(){Dl(),q(),Et(),or="Git clean interactive mode is not supported",ar='Git clean mode parameter ("n" or "f") is required',cr="Git clean unknown option found in: ",Dn=(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))(Dn||{}),ur=new Set(["i",...Vo(Object.values(Dn))])}});function Vl(e){let t=new ba;for(let n of ga(e))t.addValue(n.file,String(n.key),n.value);return t}function Yl(e,t){let n=null,s=[],r=new Map;for(let i of ga(e,t))i.key===t&&(s.push(n=i.value),r.has(i.file)||r.set(i.file,[]),r.get(i.file).push(n));return{key:t,paths:Array.from(r.keys()),scopes:r,value:n,values:s}}function Kl(e){return e.replace(/^(file):/,"")}function*ga(e,t=null){let n=e.split("\0");for(let s=0,r=n.length-1;sObject.assign(e,this.values[t]),{})),this._all}addFile(e){if(!(e in this.values)){let t=Re(this.files);this.values[e]=t?Object.create(this.values[t]):{},this.files.push(e)}return this.values[e]}addValue(e,t,n){let s=this.addFile(e);s.hasOwnProperty(t)?Array.isArray(s[t])?s[t].push(n):s[t]=[s[t],n]:s[t]=n,this._all=void 0}}}});function Ms(e,t){return typeof e=="string"&&Us.hasOwnProperty(e)?e:t}function Ql(e,t,n,s){let r=["config",`--${s}`];return n&&r.push("--add"),r.push(e,t),{commands:r,format:"utf-8",parser(i){return i}}}function Jl(e,t){let n=["config","--null","--show-origin","--get-all",e];return t&&n.splice(1,0,`--${t}`),{commands:n,format:"utf-8",parser(s){return Yl(s,e)}}}function Zl(e){let t=["config","--list","--show-origin","--null"];return e&&t.push(`--${e}`),{commands:t,format:"utf-8",parser(n){return Vl(n)}}}function tf(){return{addConfig(e,t,...n){return this._runTask(Ql(e,t,n[0]===!0,Ms(n[1],"local")),vt(arguments))},getConfig(e,t){return this._runTask(Jl(e,Ms(t,void 0)),vt(arguments))},listConfig(...e){return this._runTask(Zl(Ms(e[0],void 0)),vt(arguments))}}}var Us,ya=C({"src/lib/tasks/config.ts"(){Xl(),q(),Us=(e=>(e.system="system",e.global="global",e.local="local",e.worktree="worktree",e))(Us||{})}});function ef(...e){return new Ea().param(...e)}function nf(e){let t=new Set,n={};return Qs(e,s=>{let[r,i,o]=s.split(Vn);t.add(r),(n[r]=n[r]||[]).push({line:Vt(i),path:r,preview:o})}),{paths:t,results:n}}function sf(){return{grep(e){let t=vt(arguments),n=le(arguments);for(let r of _a)if(n.includes(r))return this._runTask(Yt(`git.grep: use of "${r}" is not supported.`),t);typeof e=="string"&&(e=ef().param(e));let s=["grep","--null","-n","--full-name",...n,...e];return this._runTask({commands:s,format:"utf-8",parser(r){return nf(r)}},t)}}}var _a,en,po,Ea,wa=C({"src/lib/tasks/grep.ts"(){q(),Et(),_a=["-h"],en=Symbol("grepQuery"),Ea=class{constructor(){this[po]=[]}*[(po=en,Symbol.iterator)](){for(let e of this[en])yield e}and(...e){return e.length&&this[en].push("--and","(",...Wn(e,"-e"),")"),this}param(...e){return this[en].push(...Wn(e,"-e")),this}}}}),Oa={};ft(Oa,{ResetMode:()=>Bn,getResetMode:()=>of,resetTask:()=>rf});function rf(e,t){let n=["reset"];return Ca(e)&&n.push(`--${e}`),n.push(...t),Dt(n)}function of(e){if(Ca(e))return e;switch(typeof e){case"string":case"undefined":return"soft"}}function Ca(e){return va.includes(e)}var Bn,va,Ta=C({"src/lib/tasks/reset.ts"(){Et(),Bn=(e=>(e.MIXED="mixed",e.SOFT="soft",e.HARD="hard",e.MERGE="merge",e.KEEP="keep",e))(Bn||{}),va=Array.from(Object.values(Bn))}});function af(){return(0,zn.default)("simple-git")}function mo(e,t,n){return!t||!String(t).replace(/\s*/,"")?n?(s,...r)=>{e(s,...r),n(s,...r)}:e:(s,...r)=>{e(`%s ${s}`,t,...r),n&&n(s,...r)}}function cf(e,t,{namespace:n}){if(typeof e=="string")return e;let s=t&&t.namespace||"";return s.startsWith(n)?s.substr(n.length+1):s||n}function lr(e,t,n,s=af()){let r=e&&`[${e}]`||"",i=[],o=typeof t=="string"?s.extend(t):t,u=cf(he(t,_t),o,s);return _(n);function h(d,l){return K(i,lr(e,u.replace(/^[^:]+/,d),l,s))}function _(d){let l=d&&`[${d}]`||"",m=o&&mo(o,l)||Pe,b=mo(s,`${r} ${l}`,m);return Object.assign(o?m:b,{label:e,sibling:h,info:b,step:_})}}var Aa=C({"src/lib/git-logger.ts"(){q(),zn.default.formatters.L=e=>String(nr(e)?e.length:"-"),zn.default.formatters.B=e=>Buffer.isBuffer(e)?e.toString("utf8"):un(e)}}),$n,Ws,uf=C({"src/lib/runners/tasks-pending-queue.ts"(){pe(),Aa(),$n=class{constructor(e="GitExecutor"){this.logLabel=e,this._queue=new Map}withProgress(e){return this._queue.get(e)}createProgress(e){let t=$n.getName(e.commands[0]),n=lr(this.logLabel,t);return{task:e,logger:n,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:n}]of Array.from(this._queue.entries()))t===e.task?(n.info("Failed %o",e),n("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):n.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 ne(void 0,"TasksPendingQueue: attempt called for an unknown task");return t.logger("Starting task"),t}static getName(e="empty"){return`task:${e}:${++$n.counter}`}},Ws=$n,Ws.counter=0}});function Ln(e,t){return{method:zo(e.commands)||"",commands:t}}function lf(e,t){return n=>{t("[ERROR] child process exception %o",n),e.push(Buffer.from(String(n.stack),"ascii"))}}function go(e,t,n,s){return r=>{n("%s received %L bytes",t,r),s("%B",r),e.push(r)}}var zs,ff=C({"src/lib/runners/git-executor-chain.ts"(){pe(),Et(),q(),uf(),zs=class{constructor(e,t,n){this._executor=e,this._scheduler=t,this._plugins=n,this._chain=Promise.resolve(),this._queue=new Ws}get binary(){return this._executor.binary}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 nn(this,null,function*(){let t=yield this._scheduler.next(),n=()=>this._queue.complete(e);try{let{logger:s}=this._queue.attempt(e);return yield ha(e)?this.attemptEmptyTask(e,s):this.attemptRemoteTask(e,s)}catch(s){throw this.onFatalException(e,s)}finally{n(),t()}})}onFatalException(e,t){let n=t instanceof ne?Object.assign(t,{task:e}):new ne(e,t&&String(t));return this._chain=Promise.resolve(),this._queue.fatal(n),n}attemptRemoteTask(e,t){return nn(this,null,function*(){let n=this._plugins.exec("spawn.args",[...e.commands],Ln(e,e.commands)),s=yield this.gitResponse(e,this.binary,n,this.outputHandler,t.step("SPAWN")),r=yield this.handleTaskData(e,n,s,t.step("HANDLE"));return t("passing response to task's parser as a %s",e.format),fa(e)?Ds(e.parser,r):Ds(e.parser,r.asStrings())})}attemptEmptyTask(e,t){return nn(this,null,function*(){return t("empty task bypassing child process to call to task's parser"),e.parser(this)})}handleTaskData(e,t,n,s){let{exitCode:r,rejection:i,stdOut:o,stdErr:u}=n;return new Promise((h,_)=>{s("Preparing to handle process response exitCode=%d stdOut=",r);let{error:d}=this._plugins.exec("task.error",{error:i},Jt(Jt({},Ln(e,t)),n));if(d&&e.onError)return s.info("exitCode=%s handling with custom error handler"),e.onError(n,d,l=>{s.info("custom error handler treated as success"),s("custom error returned a %s",un(l)),h(new rn(Array.isArray(l)?Buffer.concat(l):l,Buffer.concat(u)))},_);if(d)return s.info("handling as error: exitCode=%s stdErr=%s rejection=%o",r,u.length,i),_(d);s.info("retrieving task output complete"),h(new rn(Buffer.concat(o),Buffer.concat(u)))})}gitResponse(e,t,n,s,r){return nn(this,null,function*(){let i=r.sibling("output"),o=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},Ln(e,e.commands));return new Promise(u=>{let h=[],_=[],d;r.info("%s %o",t,n),r("%O",o);let l=(0,Sa.spawn)(t,n,o);l.stdout.on("data",go(h,"stdOut",r,i.step("stdOut"))),l.stderr.on("data",go(_,"stdErr",r,i.step("stdErr"))),l.on("error",lf(_,r)),s&&(r("Passing child process stdOut/stdErr to custom outputHandler"),s(t,l.stdout,l.stderr,[...n])),this._plugins.exec("spawn.after",void 0,$s(Jt({},Ln(e,n)),{spawned:l,close(m,b){u({stdOut:h,stdErr:_,exitCode:m,rejection:d||b})},kill(m){l.killed||(d=m,l.kill("SIGINT"))}}))})})}}}}),Ia={};ft(Ia,{GitExecutor:()=>xa});var xa,hf=C({"src/lib/runners/git-executor.ts"(){ff(),xa=class{constructor(e="git",t,n,s){this.binary=e,this.cwd=t,this._scheduler=n,this._plugins=s,this._chain=new zs(this,this._scheduler,this._plugins)}chain(){return new zs(this,this._scheduler,this._plugins)}push(e){return this._chain.push(e)}}}});function pf(e,t,n=Pe){let s=i=>{n(null,i)},r=i=>{(i==null?void 0:i.task)===e&&n(i instanceof on?df(i):i,void 0)};t.then(s,r)}function df(e){let t=s=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${s} should be GitResponseError.git.${s}, this will no longer be available in version 3`),t=Pe};return Object.create(e,Object.getOwnPropertyNames(e.git).reduce(n,{}));function n(s,r){return r in e||(s[r]={enumerable:!1,configurable:!1,get(){return t(r),e.git[r]}}),s}}var mf=C({"src/lib/task-callback.ts"(){Ve(),q()}});function bo(e,t){return la(n=>{if(!Js(e))throw new Error(`Git.cwd: cannot change to non-directory "${e}"`);return(t||n).cwd=e})}var gf=C({"src/lib/tasks/change-working-directory.ts"(){q(),Et()}});function bf(e,t){let n=["hash-object",e];return t&&n.push("-w"),Dt(n,!0)}var yf=C({"src/lib/tasks/hash-object.ts"(){Et()}});function _f(e,t,n){let s=String(n).trim(),r;if(r=Ra.exec(s))return new Gn(e,t,!1,r[1]);if(r=Pa.exec(s))return new Gn(e,t,!0,r[1]);let i="",o=s.split(" ");for(;o.length;)if(o.shift()==="in"){i=o.join(" ");break}return new Gn(e,t,/^re/i.test(s),i)}var Gn,Ra,Pa,Ef=C({"src/lib/responses/InitSummary.ts"(){Gn=class{constructor(e,t,n,s){this.bare=e,this.path=t,this.existing=n,this.gitDir=s}},Ra=/^Init.+ repository in (.+)$/,Pa=/^Rein.+ in (.+)$/}});function wf(e){return e.includes(fr)}function Of(e=!1,t,n){let s=["init",...n];return e&&!wf(s)&&s.splice(1,0,fr),{commands:s,format:"utf-8",parser(r){return _f(s.includes("--bare"),t,r)}}}var fr,Cf=C({"src/lib/tasks/init.ts"(){Ef(),fr="--bare"}}),ja,vf=C({"src/lib/responses/DiffSummary.ts"(){ja=class{constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});function Ma(e){let t=e.trim().split(` +`),n=new ja;Tf(n,t.pop());for(let s=0,r=t.length;s ([0-9.]+) ([a-z]+)$/);return n?(t.push({file:n[1].trim(),before:+n[2],after:+n[3],binary:!0}),!0):!1}var qs,ka=C({"src/lib/parsers/parse-diff-summary.ts"(){vf(),qs={file(e,t){e.changed=t},deletion(e,t){e.deletions=t},insertion(e,t){e.insertions=t}}}});function xf(e,t){return t.reduce((n,s,r)=>(n[s]=e[r]||"",n),Object.create({diff:null}))}function Na(e=dr,t=$a){return function(n){let s=an(n,!0,hr).map(function(r){let i=r.trim().split(pr),o=xf(i[0].trim().split(e),t);return i.length>1&&!!i[1].trim()&&(o.diff=Ma(i[1])),o});return{all:s,latest:s.length&&s[0]||null,total:s.length}}}var hr,pr,dr,$a,La=C({"src/lib/parsers/parse-list-log-summary.ts"(){q(),ka(),hr="\xF2\xF2\xF2\xF2\xF2\xF2 ",pr=" \xF2\xF2",dr=" \xF2 ",$a=["hash","date","message","refs","author_name","author_email"]}});function Rf(e,t){let n=[],s=[];return Object.keys(e).forEach(r=>{n.push(r),s.push(String(e[r]))}),[n,s.join(t)]}function Pf(e){return Object.keys(e).reduce((t,n)=>(n in Hs||(t[n]=e[n]),t),{})}function Fa(e={},t=[]){let n=he(e.splitter,_t,dr),s=!tr(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"},[r,i]=Rf(s,n),o=[],u=[`--pretty=format:${hr}${i}${pr}`,...t],h=e.n||e["max-count"]||e.maxCount;if(h&&u.push(`--max-count=${h}`),e.from&&e.to){let _=e.symmetric!==!1?"...":"..";o.push(`${e.from}${_}${e.to}`)}return _t(e.file)&&o.push("--follow",e.file),sr(Pf(e),u),{fields:r,splitter:n,commands:[...u,...o]}}function jf(e,t,n){return{commands:["log",...n],format:"utf-8",parser:Na(e,t)}}function Mf(){return{log(...n){let s=vt(arguments),r=t(...n)||e(Fa(rr(arguments),he(arguments[0],Kn)));return this._runTask(r,s)}};function e(n){return jf(n.splitter,n.fields,n.commands)}function t(n,s){return _t(n)&&_t(s)&&Yt("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}var Hs,Da=C({"src/lib/tasks/log.ts"(){La(),q(),Et(),Hs=(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))(Hs||{})}}),Un,Ba,kf=C({"src/lib/responses/MergeSummary.ts"(){Un=class{constructor(e,t=null,n){this.reason=e,this.file=t,this.meta=n}toString(){return`${this.file}:${this.reason}`}},Ba=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"}}}}),Vs,Ga,Nf=C({"src/lib/responses/PullSummary.ts"(){Vs=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},Ga=class{constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function ks(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 yo(e){let t=/^\s*(\d+)/.exec(e),n=/delta (\d+)/i.exec(e);return{count:Vt(t&&t[1]||"0"),delta:Vt(n&&n[1]||"0")}}var Ua,$f=C({"src/lib/parsers/parse-remote-objects.ts"(){q(),Ua=[new fe(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(e,[t,n])=>{let s=t.toLowerCase(),r=ks(e.remoteMessages);Object.assign(r,{[s]:Vt(n)})}),new fe(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(e,[t,n])=>{let s=t.toLowerCase(),r=ks(e.remoteMessages);Object.assign(r,{[s]:Vt(n)})}),new fe(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(e,[t,n,s])=>{let r=ks(e.remoteMessages);r.total=yo(t),r.reused=yo(n),r.packReused=Vt(s)})]}});function Wa(e,t){return Kt({remoteMessages:new qa},za,t)}var za,qa,Ha=C({"src/lib/parsers/parse-remote-messages.ts"(){q(),$f(),za=[new fe(/^remote:\s*(.+)$/,(e,[t])=>(e.remoteMessages.all.push(t.trim()),!1)),...Ua,new fe([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(e,[t])=>{e.remoteMessages.pullRequestUrl=t}),new fe([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(e,[t,n,s])=>{e.remoteMessages.vulnerabilities={count:Vt(t),summary:n,url:s}})],qa=class{constructor(){this.all=[]}}}});function Lf(e,t){let n=Kt(new Ga,Va,e,t);return n.message&&n}var _o,Eo,wo,Oo,Va,Co,mr,Ya=C({"src/lib/parsers/parse-pull.ts"(){Nf(),q(),Ha(),_o=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,Eo=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,wo=/^(create|delete) mode \d+ (.+)/,Oo=[new X(_o,(e,[t,n,s])=>{e.files.push(t),n&&(e.insertions[t]=n.length),s&&(e.deletions[t]=s.length)}),new X(Eo,(e,[t,,n,,s])=>n!==void 0||s!==void 0?(e.summary.changes=+t||0,e.summary.insertions=+n||0,e.summary.deletions=+s||0,!0):!1),new X(wo,(e,[t,n])=>{K(e.files,n),K(t==="create"?e.created:e.deleted,n)})],Va=[new X(/^from\s(.+)$/i,(e,[t])=>void(e.remote=t)),new X(/^fatal:\s(.+)$/,(e,[t])=>void(e.message=t)),new X(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(e,[t,n,s,r])=>{e.branch.local=s,e.hash.local=t,e.branch.remote=r,e.hash.remote=n})],Co=(e,t)=>Kt(new Vs,Oo,e,t),mr=(e,t)=>Object.assign(new Vs,Co(e,t),Wa(e,t))}}),vo,Ka,To,Ff=C({"src/lib/parsers/parse-merge.ts"(){kf(),q(),Ya(),vo=[new X(/^Auto-merging\s+(.+)$/,(e,[t])=>{e.merges.push(t)}),new X(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(e,[t,n])=>{e.conflicts.push(new Un(t,n))}),new X(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(e,[t,n,s])=>{e.conflicts.push(new Un(t,n,{deleteRef:s}))}),new X(/^CONFLICT\s+\((.+)\):/,(e,[t])=>{e.conflicts.push(new Un(t,null))}),new X(/^Automatic merge failed;\s+(.+)$/,(e,[t])=>{e.result=t})],Ka=(e,t)=>Object.assign(To(e,t),mr(e,t)),To=e=>Kt(new Ba,vo,e)}});function Ao(e){return e.length?{commands:["merge",...e],format:"utf-8",parser(t,n){let s=Ka(t,n);if(s.failed)throw new on(s);return s}}:Yt("Git.merge requires at least one option")}var Df=C({"src/lib/tasks/merge.ts"(){Ve(),Ff(),Et()}});function Bf(e,t,n){let s=n.includes("deleted"),r=n.includes("tag")||/^refs\/tags/.test(e),i=!n.includes("new");return{deleted:s,tag:r,branch:!r,new:!i,alreadyUpdated:i,local:e,remote:t}}var So,Xa,Io,Gf=C({"src/lib/parsers/parse-push.ts"(){q(),Ha(),So=[new X(/^Pushing to (.+)$/,(e,[t])=>{e.repo=t}),new X(/^updating local tracking ref '(.+)'/,(e,[t])=>{e.ref=$s(Jt({},e.ref||{}),{local:t})}),new X(/^[*-=]\s+([^:]+):(\S+)\s+\[(.+)]$/,(e,[t,n,s])=>{e.pushed.push(Bf(t,n,s))}),new X(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(e,[t,n,s])=>{e.branch=$s(Jt({},e.branch||{}),{local:t,remote:n,remoteName:s})}),new X(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(e,[t,n,s,r])=>{e.update={head:{local:t,remote:n},hash:{from:s,to:r}}})],Xa=(e,t)=>{let n=Io(e,t),s=Wa(e,t);return Jt(Jt({},n),s)},Io=(e,t)=>Kt({pushed:[]},So,e,t)}}),Qa={};ft(Qa,{pushTagsTask:()=>Uf,pushTask:()=>gr});function Uf(e={},t){return K(t,"--tags"),gr(e,t)}function gr(e={},t){let n=["push",...t];return e.branch&&n.splice(1,0,e.branch),e.remote&&n.splice(1,0,e.remote),Zs(n,"-v"),K(n,"--verbose"),K(n,"--porcelain"),{commands:n,format:"utf-8",parser:Xa}}var Ja=C({"src/lib/tasks/push.ts"(){Gf(),q()}}),xo,Za,Wf=C({"src/lib/responses/FileStatusSummary.ts"(){xo=/^(.+) -> (.+)$/,Za=class{constructor(e,t,n){if(this.path=e,this.index=t,this.working_dir=n,t+n==="R"){let s=xo.exec(e)||[null,e,e];this.from=s[1]||"",this.path=s[2]||""}}}}});function Ro(e){let t=/^(.+) -> (.+)$/.exec(e);return t?{from:String(t[1]),to:String(t[2])}:{from:e,to:e}}function jt(e,t,n){return[`${e}${t}`,n]}function Ns(e,...t){return t.map(n=>jt(e,n,(s,r)=>K(s.conflicted,r)))}function zf(e,t){let n=t.trim();switch(" "){case n.charAt(2):return s(n.charAt(0),n.charAt(1),n.substr(3));case n.charAt(1):return s(" ",n.charAt(0),n.substr(2));default:return}function s(r,i,o){let u=`${r}${i}`,h=tc.get(u);h&&h(e,o),u!=="##"&&u!=="!!"&&e.files.push(new Za(o,r,i))}}var Po,tc,ec,qf=C({"src/lib/responses/StatusSummary.ts"(){q(),Wf(),Po=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}},tc=new Map([jt(" ","A",(e,t)=>K(e.created,t)),jt(" ","D",(e,t)=>K(e.deleted,t)),jt(" ","M",(e,t)=>K(e.modified,t)),jt("A"," ",(e,t)=>K(e.created,t)&&K(e.staged,t)),jt("A","M",(e,t)=>K(e.created,t)&&K(e.staged,t)&&K(e.modified,t)),jt("D"," ",(e,t)=>K(e.deleted,t)&&K(e.staged,t)),jt("M"," ",(e,t)=>K(e.modified,t)&&K(e.staged,t)),jt("M","M",(e,t)=>K(e.modified,t)&&K(e.staged,t)),jt("R"," ",(e,t)=>{K(e.renamed,Ro(t))}),jt("R","M",(e,t)=>{let n=Ro(t);K(e.renamed,n),K(e.modified,n.to)}),jt("!","!",(e,t)=>{K(e.ignored=e.ignored||[],t)}),jt("?","?",(e,t)=>K(e.not_added,t)),...Ns("A","A","U"),...Ns("D","D","U"),...Ns("U","A","D","U"),["##",(e,t)=>{let n=/ahead (\d+)/,s=/behind (\d+)/,r=/^(.+?(?=(?:\.{3}|\s|$)))/,i=/\.{3}(\S*)/,o=/\son\s([\S]+)$/,u;u=n.exec(t),e.ahead=u&&+u[1]||0,u=s.exec(t),e.behind=u&&+u[1]||0,u=r.exec(t),e.current=u&&u[1],u=i.exec(t),e.tracking=u&&u[1],u=o.exec(t),e.current=u&&u[1]||e.current,e.detached=/\(no branch\)/.test(t)}]]),ec=function(e){let t=e.trim().split(Vn),n=new Po;for(let s=0,r=t.length;s!nc.includes(n))];return{format:"utf-8",commands:t,parser(n){return ec(n)}}}var nc,Vf=C({"src/lib/tasks/status.ts"(){qf(),nc=["--null","-z"]}}),sc={};ft(sc,{SimpleGitApi:()=>Ys});var Ys,Yf=C({"src/lib/simple-git-api.ts"(){mf(),gf(),ya(),wa(),yf(),Cf(),Da(),Df(),Ja(),Vf(),Et(),q(),Ys=class{constructor(e){this._executor=e}_runTask(e,t){let n=this._executor.chain(),s=n.push(e);return t&&pf(e,s,t),Object.create(this,{then:{value:s.then.bind(s)},catch:{value:s.catch.bind(s)},_executor:{value:n}})}add(e){return this._runTask(Dt(["add",...cn(e)]),vt(arguments))}cwd(e){let t=vt(arguments);return typeof e=="string"?this._runTask(bo(e,this._executor),t):typeof(e==null?void 0:e.path)=="string"?this._runTask(bo(e.path,e.root&&this._executor||void 0),t):this._runTask(Yt("Git.cwd: workingDirectory must be supplied as a string"),t)}hashObject(e,t){return this._runTask(bf(e,t===!0),vt(arguments))}init(e){return this._runTask(Of(e===!0,this._executor.cwd,le(arguments)),vt(arguments))}merge(){return this._runTask(Ao(le(arguments)),vt(arguments))}mergeFromTo(e,t){return _t(e)&&_t(t)?this._runTask(Ao([e,t,...le(arguments)]),vt(arguments,!1)):this._runTask(Yt("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(e){return this._executor.outputHandler=e,this}push(){let e=gr({remote:he(arguments[0],_t),branch:he(arguments[1],_t)},le(arguments));return this._runTask(e,vt(arguments))}stash(){return this._runTask(Dt(["stash",...le(arguments)]),vt(arguments))}status(){return this._runTask(Hf(le(arguments)),vt(arguments))}},Object.assign(Ys.prototype,tf(),sf(),Mf())}}),rc={};ft(rc,{Scheduler:()=>oc});var jo,oc,Kf=C({"src/lib/runners/scheduler.ts"(){q(),Aa(),jo=(()=>{let e=0;return()=>{e++;let{promise:t,done:n}=(0,ic.createDeferred)();return{promise:t,done:n,id:e}}})(),oc=class{constructor(e=2){this.concurrency=e,this.logger=lr("","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=K(this.running,this.pending.shift());this.logger("Attempting id=%s",e.id),e.done(()=>{this.logger("Completing id=",e.id),Zs(this.running,e),this.schedule()})}next(){let{promise:e,id:t}=K(this.pending,jo());return this.logger("Scheduling id=%s",t),this.schedule(),e}}}}),ac={};ft(ac,{applyPatchTask:()=>Xf});function Xf(e,t){return Dt(["apply",...t,...e])}var Qf=C({"src/lib/tasks/apply-patch.ts"(){Et()}});function Jf(e,t){return{branch:e,hash:t,success:!0}}function Zf(e){return{branch:e,hash:null,success:!1}}var cc,th=C({"src/lib/responses/BranchDeleteSummary.ts"(){cc=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function uc(e,t){return t===1&&Ks.test(e)}var Mo,Ks,ko,Jn,eh=C({"src/lib/parsers/parse-branch-delete.ts"(){th(),q(),Mo=/(\S+)\s+\(\S+\s([^)]+)\)/,Ks=/^error[^']+'([^']+)'/m,ko=[new X(Mo,(e,[t,n])=>{let s=Jf(t,n);e.all.push(s),e.branches[t]=s}),new X(Ks,(e,[t])=>{let n=Zf(t);e.errors.push(n),e.all.push(n),e.branches[t]=n})],Jn=(e,t)=>Kt(new cc,ko,e,t)}}),lc,nh=C({"src/lib/responses/BranchSummary.ts"(){lc=class{constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(e,t,n,s,r){e&&(this.detached=t,this.current=n),this.all.push(n),this.branches[n]={current:e,name:n,commit:s,label:r}}}}});function fc(e){return Kt(new lc,hc,e)}var hc,sh=C({"src/lib/parsers/parse-branch.ts"(){nh(),q(),hc=[new X(/^(\*\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(e,[t,n,s,r])=>{e.push(!!t,!0,n,s,r)}),new X(/^(\*\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(e,[t,n,s,r])=>{e.push(!!t,!1,n,s,r)})]}}),pc={};ft(pc,{branchLocalTask:()=>ih,branchTask:()=>rh,containsDeleteBranchCommand:()=>dc,deleteBranchTask:()=>ah,deleteBranchesTask:()=>oh});function dc(e){let t=["-d","-D","--delete"];return e.some(n=>t.includes(n))}function rh(e){let t=dc(e),n=["branch",...e];return n.length===1&&n.push("-a"),n.includes("-v")||n.splice(1,0,"-v"),{format:"utf-8",commands:n,parser(s,r){return t?Jn(s,r).all[0]:fc(s)}}}function ih(){return{format:"utf-8",commands:["branch","-v"],parser:fc}}function oh(e,t=!1){return{format:"utf-8",commands:["branch","-v",t?"-D":"-d",...e],parser(n,s){return Jn(n,s)},onError({exitCode:n,stdOut:s},r,i,o){if(!uc(String(r),n))return o(r);i(s)}}}function ah(e,t=!1){let n={format:"utf-8",commands:["branch","-v",t?"-D":"-d",e],parser(s,r){return Jn(s,r).branches[e]},onError({exitCode:s,stdErr:r,stdOut:i},o,u,h){if(!uc(String(o),s))return h(o);throw new on(n.parser(sn(i),sn(r)),String(o))}};return n}var ch=C({"src/lib/tasks/branch.ts"(){Ve(),eh(),sh(),q()}}),mc,uh=C({"src/lib/responses/CheckIgnore.ts"(){mc=e=>e.split(/\n/g).map(t=>t.trim()).filter(t=>!!t)}}),gc={};ft(gc,{checkIgnoreTask:()=>lh});function lh(e){return{commands:["check-ignore",...e],format:"utf-8",parser:mc}}var fh=C({"src/lib/tasks/check-ignore.ts"(){uh()}}),bc={};ft(bc,{cloneMirrorTask:()=>ph,cloneTask:()=>yc});function hh(e){return/^--upload-pack(=|$)/.test(e)}function yc(e,t,n){let s=["clone",...n];return _t(e)&&s.push(e),_t(t)&&s.push(t),s.find(hh)?Yt("git.fetch: potential exploit argument blocked."):Dt(s)}function ph(e,t,n){return K(n,"--mirror"),yc(e,t,n)}var dh=C({"src/lib/tasks/clone.ts"(){Et(),q()}});function mh(e){return Kt({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},_c,e)}var _c,gh=C({"src/lib/parsers/parse-commit.ts"(){q(),_c=[new X(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(e,[t,n,s])=>{e.branch=t,e.commit=s,e.root=!!n}),new X(/\s*Author:\s(.+)/i,(e,[t])=>{let n=t.split("<"),s=n.pop();!s||!s.includes("@")||(e.author={email:s.substr(0,s.length-1),name:n.join("<").trim()})}),new X(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(e,[t,n,s])=>{e.summary.changes=parseInt(t,10)||0,e.summary.insertions=parseInt(n,10)||0,e.summary.deletions=parseInt(s,10)||0}),new X(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(e,[t,n,s])=>{e.summary.changes=parseInt(t,10)||0;let r=parseInt(n,10)||0;s==="-"?e.summary.deletions=r:s==="+"&&(e.summary.insertions=r)})]}}),Ec={};ft(Ec,{commitTask:()=>bh});function bh(e,t,n){let s=["commit"];return e.forEach(r=>s.push("-m",r)),s.push(...t,...n),{commands:s,format:"utf-8",parser:mh}}var yh=C({"src/lib/tasks/commit.ts"(){gh()}}),wc={};ft(wc,{diffSummaryTask:()=>_h});function _h(e){return{commands:["diff","--stat=4096",...e],format:"utf-8",parser(t){return Ma(t)}}}var Eh=C({"src/lib/tasks/diff.ts"(){ka()}});function wh(e,t){return Kt({raw:e,remote:null,branches:[],tags:[]},Oc,e,t)}var Oc,Oh=C({"src/lib/parsers/parse-fetch.ts"(){q(),Oc=[new X(/From (.+)$/,(e,[t])=>{e.remote=t}),new X(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(e,[t,n])=>{e.branches.push({name:t,tracking:n})}),new X(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(e,[t,n])=>{e.tags.push({name:t,tracking:n})})]}}),Cc={};ft(Cc,{fetchTask:()=>vh});function Ch(e){return/^--upload-pack(=|$)/.test(e)}function vh(e,t,n){let s=["fetch",...n];return e&&t&&s.push(e,t),s.find(Ch)?Yt("git.fetch: potential exploit argument blocked."):{commands:s,format:"utf-8",parser:wh}}var Th=C({"src/lib/tasks/fetch.ts"(){Oh(),Et()}});function Ah(e){return Kt({moves:[]},vc,e)}var vc,Sh=C({"src/lib/parsers/parse-move.ts"(){q(),vc=[new X(/^Renaming (.+) to (.+)$/,(e,[t,n])=>{e.moves.push({from:t,to:n})})]}}),Tc={};ft(Tc,{moveTask:()=>Ih});function Ih(e,t){return{commands:["mv","-v",...cn(e),t],format:"utf-8",parser:Ah}}var xh=C({"src/lib/tasks/move.ts"(){Sh(),q()}}),Ac={};ft(Ac,{pullTask:()=>Rh});function Rh(e,t,n){let s=["pull",...n];return e&&t&&s.splice(1,0,e,t),{commands:s,format:"utf-8",parser(r,i){return mr(r,i)},onError(r,i,o,u){let h=Lf(sn(r.stdOut),sn(r.stdErr));if(h)return u(new on(h));u(i)}}}var Ph=C({"src/lib/tasks/pull.ts"(){Ve(),Ya(),q()}});function jh(e){let t={};return Sc(e,([n])=>t[n]={name:n}),Object.values(t)}function Mh(e){let t={};return Sc(e,([n,s,r])=>{t.hasOwnProperty(n)||(t[n]={name:n,refs:{fetch:"",push:""}}),r&&s&&(t[n].refs[r.replace(/[^a-z]/g,"")]=s)}),Object.values(t)}function Sc(e,t){Qs(e,n=>t(n.split(/\s+/)))}var kh=C({"src/lib/responses/GetRemoteSummary.ts"(){q()}}),Ic={};ft(Ic,{addRemoteTask:()=>Nh,getRemotesTask:()=>$h,listRemotesTask:()=>Lh,remoteTask:()=>Fh,removeRemoteTask:()=>Dh});function Nh(e,t,n=[]){return Dt(["remote","add",...n,e,t])}function $h(e){let t=["remote"];return e&&t.push("-v"),{commands:t,format:"utf-8",parser:e?Mh:jh}}function Lh(e=[]){let t=[...e];return t[0]!=="ls-remote"&&t.unshift("ls-remote"),Dt(t)}function Fh(e=[]){let t=[...e];return t[0]!=="remote"&&t.unshift("remote"),Dt(t)}function Dh(e){return Dt(["remote","remove",e])}var Bh=C({"src/lib/tasks/remote.ts"(){kh(),Et()}}),xc={};ft(xc,{stashListTask:()=>Gh});function Gh(e={},t){let n=Fa(e),s=Na(n.splitter,n.fields);return{commands:["stash","list",...n.commands,...t],format:"utf-8",parser:s}}var Uh=C({"src/lib/tasks/stash-list.ts"(){La(),Da()}}),Rc={};ft(Rc,{addSubModuleTask:()=>Wh,initSubModuleTask:()=>zh,subModuleTask:()=>Zn,updateSubModuleTask:()=>qh});function Wh(e,t){return Zn(["add",e,t])}function zh(e){return Zn(["init",...e])}function Zn(e){let t=[...e];return t[0]!=="submodule"&&t.unshift("submodule"),Dt(t)}function qh(e){return Zn(["update",...e])}var Hh=C({"src/lib/tasks/sub-module.ts"(){Et()}});function Vh(e,t){let n=isNaN(e),s=isNaN(t);return n!==s?n?1:-1:n?Pc(e,t):0}function Pc(e,t){return e===t?0:e>t?1:-1}function Yh(e){return e.trim()}function Fn(e){return typeof e=="string"&&parseInt(e.replace(/^\D+/g,""),10)||0}var No,jc,Kh=C({"src/lib/responses/TagList.ts"(){No=class{constructor(e,t){this.all=e,this.latest=t}},jc=function(e,t=!1){let n=e.split(` +`).map(Yh).filter(Boolean);t||n.sort(function(r,i){let o=r.split("."),u=i.split(".");if(o.length===1||u.length===1)return Vh(Fn(o[0]),Fn(u[0]));for(let h=0,_=Math.max(o.length,u.length);h<_;h++){let d=Pc(Fn(o[h]),Fn(u[h]));if(d)return d}return 0});let s=t?n[0]:[...n].reverse().find(r=>r.indexOf(".")>=0);return new No(n,s)}}}),Mc={};ft(Mc,{addAnnotatedTagTask:()=>Jh,addTagTask:()=>Qh,tagListTask:()=>Xh});function Xh(e=[]){let t=e.some(n=>/^--sort=/.test(n));return{format:"utf-8",commands:["tag","-l",...e],parser(n){return jc(n,t)}}}function Qh(e){return{format:"utf-8",commands:["tag",e],parser(){return{name:e}}}}function Jh(e,t){return{format:"utf-8",commands:["tag","-a","-m",t,e],parser(){return{name:e}}}}var Zh=C({"src/lib/tasks/tag.ts"(){Kh()}}),tp=Sl({"src/git.js"(e,t){var{GitExecutor:n}=(hf(),ut(Ia)),{SimpleGitApi:s}=(Yf(),ut(sc)),{Scheduler:r}=(Kf(),ut(rc)),{configurationErrorTask:i}=(Et(),ut(Gs)),{asArray:o,filterArray:u,filterPrimitives:h,filterString:_,filterStringOrStringArray:d,filterType:l,getTrailingOptions:m,trailingFunctionArgument:b,trailingOptionsArgument:T}=(q(),ut(ea)),{applyPatchTask:w}=(Qf(),ut(ac)),{branchTask:g,branchLocalTask:D,deleteBranchesTask:U,deleteBranchTask:Y}=(ch(),ut(pc)),{checkIgnoreTask:W}=(fh(),ut(gc)),{checkIsRepoTask:Q}=(ia(),ut(na)),{cloneTask:Tt,cloneMirrorTask:wt}=(dh(),ut(bc)),{cleanWithOptionsTask:Bt,isCleanOptionsArray:Gt}=(ma(),ut(pa)),{commitTask:J}=(yh(),ut(Ec)),{diffSummaryTask:M}=(Eh(),ut(wc)),{fetchTask:O}=(Th(),ut(Cc)),{moveTask:I}=(xh(),ut(Tc)),{pullTask:B}=(Ph(),ut(Ac)),{pushTagsTask:Z}=(Ja(),ut(Qa)),{addRemoteTask:at,getRemotesTask:V,listRemotesTask:ht,remoteTask:Zt,removeRemoteTask:nt}=(Bh(),ut(Ic)),{getResetMode:Ut,resetTask:Wt}=(Ta(),ut(Oa)),{stashListTask:te}=(Uh(),ut(xc)),{addSubModuleTask:L,initSubModuleTask:Ye,subModuleTask:$,updateSubModuleTask:tt}=(Hh(),ut(Rc)),{addAnnotatedTagTask:st,addTagTask:H,tagListTask:rt}=(Zh(),ut(Mc)),{straightThroughBufferTask:ct,straightThroughStringTask:it}=(Et(),ut(Gs));function A(c,f){this._executor=new n(c.binary,c.baseDir,new r(c.maxConcurrentProcesses),f)}(A.prototype=Object.create(s.prototype)).constructor=A,A.prototype.customBinary=function(c){return this._executor.binary=c,this},A.prototype.env=function(c,f){return arguments.length===1&&typeof c=="object"?this._executor.env=c:(this._executor.env=this._executor.env||{})[c]=f,this},A.prototype.stashList=function(c){return this._runTask(te(T(arguments)||{},u(c)&&c||[]),b(arguments))};function de(c,f,E,y){return typeof E!="string"?i(`git.${c}() requires a string 'repoPath'`):f(E,l(y,_),m(arguments))}A.prototype.clone=function(){return this._runTask(de("clone",Tt,...arguments),b(arguments))},A.prototype.mirror=function(){return this._runTask(de("mirror",wt,...arguments),b(arguments))},A.prototype.mv=function(c,f){return this._runTask(I(c,f),b(arguments))},A.prototype.checkoutLatestTag=function(c){var f=this;return this.pull(function(){f.tags(function(E,y){f.checkout(y.latest,c)})})},A.prototype.commit=function(c,f,E,y){let p=b(arguments);return d(c)?this._runTask(J(o(c),o(l(f,d,[])),[...l(E,u,[]),...m(arguments,0,!0)]),p):this._runTask(i("git.commit: requires the commit message to be supplied as a string/string[]"),p)},A.prototype.pull=function(c,f,E,y){return this._runTask(B(l(c,_),l(f,_),m(arguments)),b(arguments))},A.prototype.fetch=function(c,f){return this._runTask(O(l(c,_),l(f,_),m(arguments)),b(arguments))},A.prototype.silent=function(c){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},A.prototype.tags=function(c,f){return this._runTask(rt(m(arguments)),b(arguments))},A.prototype.rebase=function(){return this._runTask(it(["rebase",...m(arguments)]),b(arguments))},A.prototype.reset=function(c){return this._runTask(Wt(Ut(c),m(arguments)),b(arguments))},A.prototype.revert=function(c){let f=b(arguments);return typeof c!="string"?this._runTask(i("Commit must be a string"),f):this._runTask(it(["revert",...m(arguments,0,!0),c]),f)},A.prototype.addTag=function(c){let f=typeof c=="string"?H(c):i("Git.addTag requires a tag name");return this._runTask(f,b(arguments))},A.prototype.addAnnotatedTag=function(c,f){return this._runTask(st(c,f),b(arguments))},A.prototype.checkout=function(){let c=["checkout",...m(arguments,!0)];return this._runTask(it(c),b(arguments))},A.prototype.checkoutBranch=function(c,f,E){return this.checkout(["-b",c,f],b(arguments))},A.prototype.checkoutLocalBranch=function(c,f){return this.checkout(["-b",c],b(arguments))},A.prototype.deleteLocalBranch=function(c,f,E){return this._runTask(Y(c,typeof f=="boolean"?f:!1),b(arguments))},A.prototype.deleteLocalBranches=function(c,f,E){return this._runTask(U(c,typeof f=="boolean"?f:!1),b(arguments))},A.prototype.branch=function(c,f){return this._runTask(g(m(arguments)),b(arguments))},A.prototype.branchLocal=function(c){return this._runTask(D(),b(arguments))},A.prototype.raw=function(c){let f=!Array.isArray(c),E=[].slice.call(f?arguments:c,0);for(let p=0;pLs(r))).then(o.done)}return{type:"spawn.after",action(r,i){return nn(this,arguments,function*(o,{spawned:u,close:h}){var _,d;let l=n(),m=!0,b=()=>void(m=!1);(_=u.stdout)==null||_.on("data",b),(d=u.stderr)==null||d.on("data",b),u.on("error",b),u.on("close",T=>l.close(T)),u.on("exit",T=>l.exit(T));try{yield l.result,m&&(yield Ls(50)),h(l.exitCode)}catch(T){h(l.exitCode,T)}})}}}pe();function ip(e){return!!(e.exitCode&&e.stdErr.length)}function op(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function ap(e=!1,t=ip,n=op){return(s,r)=>!e&&s||!t(r)?s:n(r)}function Lo(e){return{type:"task.error",action(t,n){let s=e(t.error,{stdErr:n.stdErr,stdOut:n.stdOut,exitCode:n.exitCode});return Buffer.isBuffer(s)?{error:new ne(void 0,s.toString("utf-8"))}:{error:s}}}}q();var cp=class{constructor(){this.plugins=new Set}add(e){let t=[];return cn(e).forEach(n=>n&&this.plugins.add(K(t,n))),()=>{t.forEach(n=>this.plugins.delete(n))}}exec(e,t,n){let s=t,r=Object.freeze(Object.create(n));for(let i of this.plugins)i.type===e&&(s=i.action(s,r));return s}};q();function up(e){let t="--progress",n=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(i,o){return n.includes(o.method)?Ho(i,t):i}},{type:"spawn.after",action(i,o){var u;!o.commands.includes(t)||(u=o.spawned.stderr)==null||u.on("data",h=>{let _=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(h.toString("utf8"));!_||e({method:o.method,stage:lp(_[1]),progress:Vt(_[2]),processed:Vt(_[3]),total:Vt(_[4])})})}}]}function lp(e){return String(e.toLowerCase().split(" ",1))||"unknown"}q();function fp(e){let t=Yo(e,["uid","gid"]);return{type:"spawn.options",action(n){return Jt(Jt({},t),n)}}}function hp({block:e}){if(e>0)return{type:"spawn.after",action(t,n){var s,r;let i;function o(){i&&clearTimeout(i),i=setTimeout(h,e)}function u(){var _,d;(_=n.spawned.stdout)==null||_.off("data",o),(d=n.spawned.stderr)==null||d.off("data",o),n.spawned.off("exit",u),n.spawned.off("close",u)}function h(){u(),n.kill(new np(void 0,"timeout","block timeout reached"))}(s=n.spawned.stdout)==null||s.on("data",o),(r=n.spawned.stderr)==null||r.on("data",o),n.spawned.on("exit",u),n.spawned.on("close",u),o()}}}q();var pp=tp();function dp(e,t){let n=new cp,s=Zo(e&&(typeof e=="string"?{baseDir:e}:e)||{},t);if(!Js(s.baseDir))throw new ep(s,"Cannot use simple-git on a directory that does not exist");return Array.isArray(s.config)&&n.add(sp(s.config)),n.add(rp(s.completion)),s.progress&&n.add(up(s.progress)),s.timeout&&n.add(hp(s.timeout)),s.spawnOptions&&n.add(fp(s.spawnOptions)),n.add(Lo(ap(!0))),s.errors&&n.add(Lo(s.errors)),new pp(s,n)}Ve();var kc=dp;var br=kc();async function Nc(){return await br.raw("rev-parse","HEAD")}async function $c(e){return(await br.raw(["log","--no-merges","--pretty=format:%B\u0700",e?`${e}..HEAD`:"HEAD"])).split("\u0700").map(n=>n.trim()).filter(n=>n.length>0)}async function Lc(e,t,n){await br.commit(`${t}: ${n}`,e)}var Bc=require("fs/promises"),Gc=Me(Fc());var mp=/^([a-z]+!?)(?:\(([\w-/]+)\))?: ([a-zA-Zа-яА-Я\d][^\n]+)(?:\n{2}(.+))?$/s;function _r(e){let[t,n=""]=e.match(/#(\d+)/)||[];return n}function gp(e){return e.replace(/^#.*$/gm,"")}function Dc(e){e=gp(e);let[,t=""]=e.match(/Merge (branch|remote\-tracking branch|pull request) /i)||[];if(t.length>0){let[,l=""]=e.match(/([^\s\/]+\/[^:]+:[^\s]+)/i)||[];return{commit:e,type:"merge",scope:"",message:`${t} from ${l}`,footer:"",isMerge:!0,isBreaking:!1,issueID:_r(e)}}let[n,s="",r="",i="",o=""]=e.match(mp)||[];if(s.length===0)throw new Error("commit is not a valid conventional commit");let u=s.endsWith("!")||o.startsWith("BREAKING CHANGE"),h=_r(i),_=_r(o);return{commit:e,type:s,scope:r,message:i,footer:o,isMerge:!1,isBreaking:u,issueID:h||_}}function Uc(e){let[t,n,s]=e.split(".");return[Number(t),Number(n),Number(s)]}async function Wc(e,t){let n=await(0,Bc.readFile)(e,"utf8"),s=JSON.parse(n),r=(0,Gc.get)(s,t,"");return typeof r=="string"?r:""}async function zc(e,t){let[n,s,r]=e,i=await $c(t),o=!1,u=!1,h=!1;for(let _ of i)try{let d=Dc(_);if(d.isBreaking){o=!0;break}if(d.type==="feat"){u=!0;break}d.type==="fix"&&(h=!0)}catch{}return o?[n+1,0,0]:u?[n,s+1,0]:h?[n,s,r+1]:[n,s,r]}var Er="semverity",qc={type:"string",describe:"initial version"},Hc={type:"string",alias:"f",describe:"file to grab version from",default:"package.json"},Vc={type:"string",describe:"dot-notated path to version in json object",default:"version"},bp={type:"array",alias:"o",describe:"files to patch version",default:["package.json","package-lock.json"]},yp={type:"string",describe:"commmit type to save"};async function Yc(e){let t;if(e.semver)t=(0,wr.default)(e.semver);else{let n=await Wc(e.from,e.fromPath);t=(0,wr.default)(n)}if(t===null)throw new Error("invalid semver passed");return{version:t,semver:Uc(t)}}async function Kc(e){let t=await Nc().catch(()=>{throw new Error("not enough commits to build version")}),n=await zc(e),s=`sha.${t.substring(0,8)}`;return`${n.join(".")}+${s}`}async function _p(e,t,n){let s=await(0,ts.readFile)(e,"utf8"),r=s.replaceAll(t,n);return await(0,ts.writeFile)(e,r),s!==r}Ji(ls(process.argv)).command("bump [semver]","bump version from git history",e=>e.usage(`Usage: ${Er} bump [options]`).positional("semver",qc).option("from",Hc).option("from-path",Vc),async e=>{let{semver:t}=await Yc(e),n=await Kc(t);process.stdout.write(n)}).command("patch [semver]","bump and patch files",e=>e.usage(`Usage: ${Er} patch [options]`).positional("semver",qc).option("from",Hc).option("from-path",Vc).option("files",bp).option("commit",yp),async e=>{let{semver:t,version:n}=await Yc(e),s=await Kc(t),r=0;for(let i of e.files)r+=await _p(i,n,s)?1:0;process.stdout.write(`${r} file(s) pathed to version ${s} +`),e.commit&&await Lc(e.files,e.commit,s)}).usage(`Usage: ${Er} `).demandCommand(1).parse(); +/** + * @fileoverview Main entrypoint for libraries using yargs-parser in Node.js + * CJS and ESM environments. + * + * @license + * Copyright (c) 2016, Contributors + * SPDX-License-Identifier: ISC + */ +/** + * @license + * Copyright (c) 2016, Contributors + * SPDX-License-Identifier: ISC + */ +/*! + * semverity v0.1.0+sha.49bb92a8 + * (c) 2021 Aleksey Korolev + * Released under the MIT License. + */ diff --git a/package-lock.json b/package-lock.json index 9f0cd68..44a1521 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "semverity", - "version": "0.0.0", + "version": "0.1.0+sha.49bb92a8", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index d94932c..3083641 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "semverity", - "version": "0.0.0", + "version": "0.1.0+sha.49bb92a8", "description": "semver bump from git and patch tool", "main": "dist/index.min.js", "files": [ diff --git a/tools/copyright.txt b/tools/copyright.txt index 9f89887..5234a6d 100644 --- a/tools/copyright.txt +++ b/tools/copyright.txt @@ -1,5 +1,5 @@ /*! - * semverity v0.0.0 + * semverity v0.1.0+sha.49bb92a8 * (c) 2021 Aleksey Korolev * Released under the MIT License. */