mytools-tasks 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"","sourceRoot":"","sources":["file:///Users/daviddiaz/Code/Private/my-tools/apps/tasks/index.ts"],"names":[],"mappings":""}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ (()=>{var t={5197:(t,r,i)=>{"use strict";function __export(t){for(var i in t)if(!r.hasOwnProperty(i))r[i]=t[i]}Object.defineProperty(r,"__esModule",{value:true});__export(i(9640))},9640:function(t,r,i){"use strict";var o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:true});const a=i(358);const u=o(i(783));const l=u.default("@kwsites/file-exists");function check(t,r,i){l(`checking %s`,t);try{const o=a.statSync(t);if(o.isFile()&&r){l(`[OK] path represents a file`);return true}if(o.isDirectory()&&i){l(`[OK] path represents a directory`);return true}l(`[FAIL] path represents something other than a file or directory`);return false}catch(t){if(t.code==="ENOENT"){l(`[FAIL] path is not accessible: %o`,t);return false}l(`[FATAL] %o`,t);throw t}}function exists(t,i=r.READABLE){return check(t,(i&r.FILE)>0,(i&r.FOLDER)>0)}r.exists=exists;r.FILE=1;r.FOLDER=2;r.READABLE=r.FILE+r.FOLDER},4710:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r.createDeferred=r.deferred=void 0;function deferred(){let t;let r;let i="pending";const o=new Promise(((i,o)=>{t=i;r=o}));return{promise:o,done(r){if(i==="pending"){i="resolved";t(r)}},fail(t){if(i==="pending"){i="rejected";r(t)}},get fulfilled(){return i!=="pending"},get status(){return i}}}r.deferred=deferred;r.createDeferred=deferred;r["default"]=deferred},1845:(t,r,i)=>{r.formatArgs=formatArgs;r.save=save;r.load=load;r.useColors=useColors;r.storage=localstorage();r.destroy=(()=>{let t=false;return()=>{if(!t){t=true;console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}}})();r.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 useColors(){if(typeof window!=="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)){return true}if(typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)){return false}return typeof document!=="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!=="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function formatArgs(r){r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff);if(!this.useColors){return}const i="color: "+this.color;r.splice(1,0,i,"color: inherit");let o=0;let a=0;r[0].replace(/%[a-zA-Z%]/g,(t=>{if(t==="%%"){return}o++;if(t==="%c"){a=o}}));r.splice(a,0,i)}r.log=console.debug||console.log||(()=>{});function save(t){try{if(t){r.storage.setItem("debug",t)}else{r.storage.removeItem("debug")}}catch(t){}}function load(){let t;try{t=r.storage.getItem("debug")}catch(t){}if(!t&&typeof process!=="undefined"&&"env"in process){t=process.env.DEBUG}return t}function localstorage(){try{return localStorage}catch(t){}}t.exports=i(3183)(r);const{formatters:o}=t.exports;o.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},3183:(t,r,i)=>{function setup(t){createDebug.debug=createDebug;createDebug.default=createDebug;createDebug.coerce=coerce;createDebug.disable=disable;createDebug.enable=enable;createDebug.enabled=enabled;createDebug.humanize=i(6257);createDebug.destroy=destroy;Object.keys(t).forEach((r=>{createDebug[r]=t[r]}));createDebug.names=[];createDebug.skips=[];createDebug.formatters={};function selectColor(t){let r=0;for(let i=0;i<t.length;i++){r=(r<<5)-r+t.charCodeAt(i);r|=0}return createDebug.colors[Math.abs(r)%createDebug.colors.length]}createDebug.selectColor=selectColor;function createDebug(t){let r;let i=null;let o;let a;function debug(...t){if(!debug.enabled){return}const i=debug;const o=Number(new Date);const a=o-(r||o);i.diff=a;i.prev=r;i.curr=o;r=o;t[0]=createDebug.coerce(t[0]);if(typeof t[0]!=="string"){t.unshift("%O")}let u=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,((r,o)=>{if(r==="%%"){return"%"}u++;const a=createDebug.formatters[o];if(typeof a==="function"){const o=t[u];r=a.call(i,o);t.splice(u,1);u--}return r}));createDebug.formatArgs.call(i,t);const l=i.log||createDebug.log;l.apply(i,t)}debug.namespace=t;debug.useColors=createDebug.useColors();debug.color=createDebug.selectColor(t);debug.extend=extend;debug.destroy=createDebug.destroy;Object.defineProperty(debug,"enabled",{enumerable:true,configurable:false,get:()=>{if(i!==null){return i}if(o!==createDebug.namespaces){o=createDebug.namespaces;a=createDebug.enabled(t)}return a},set:t=>{i=t}});if(typeof createDebug.init==="function"){createDebug.init(debug)}return debug}function extend(t,r){const i=createDebug(this.namespace+(typeof r==="undefined"?":":r)+t);i.log=this.log;return i}function enable(t){createDebug.save(t);createDebug.namespaces=t;createDebug.names=[];createDebug.skips=[];let r;const i=(typeof t==="string"?t:"").split(/[\s,]+/);const o=i.length;for(r=0;r<o;r++){if(!i[r]){continue}t=i[r].replace(/\*/g,".*?");if(t[0]==="-"){createDebug.skips.push(new RegExp("^"+t.slice(1)+"$"))}else{createDebug.names.push(new RegExp("^"+t+"$"))}}}function disable(){const t=[...createDebug.names.map(toNamespace),...createDebug.skips.map(toNamespace).map((t=>"-"+t))].join(",");createDebug.enable("");return t}function enabled(t){if(t[t.length-1]==="*"){return true}let r;let i;for(r=0,i=createDebug.skips.length;r<i;r++){if(createDebug.skips[r].test(t)){return false}}for(r=0,i=createDebug.names.length;r<i;r++){if(createDebug.names[r].test(t)){return true}}return false}function toNamespace(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}function coerce(t){if(t instanceof Error){return t.stack||t.message}return t}function destroy(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}createDebug.enable(createDebug.load());return createDebug}t.exports=setup},783:(t,r,i)=>{if(typeof process==="undefined"||process.type==="renderer"||process.browser===true||process.__nwjs){t.exports=i(1845)}else{t.exports=i(6223)}},6223:(t,r,i)=>{const o=i(6224);const a=i(3837);r.init=init;r.log=log;r.formatArgs=formatArgs;r.save=save;r.load=load;r.useColors=useColors;r.destroy=a.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");r.colors=[6,2,3,4,5,1];try{const t=i(1371);if(t&&(t.stderr||t).level>=2){r.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(t){}r.inspectOpts=Object.keys(process.env).filter((t=>/^debug_/i.test(t))).reduce(((t,r)=>{const i=r.substring(6).toLowerCase().replace(/_([a-z])/g,((t,r)=>r.toUpperCase()));let o=process.env[r];if(/^(yes|on|true|enabled)$/i.test(o)){o=true}else if(/^(no|off|false|disabled)$/i.test(o)){o=false}else if(o==="null"){o=null}else{o=Number(o)}t[i]=o;return t}),{});function useColors(){return"colors"in r.inspectOpts?Boolean(r.inspectOpts.colors):o.isatty(process.stderr.fd)}function formatArgs(r){const{namespace:i,useColors:o}=this;if(o){const o=this.color;const a="[3"+(o<8?o:"8;5;"+o);const u=` ${a};1m${i} `;r[0]=u+r[0].split("\n").join("\n"+u);r.push(a+"m+"+t.exports.humanize(this.diff)+"")}else{r[0]=getDate()+i+" "+r[0]}}function getDate(){if(r.inspectOpts.hideDate){return""}return(new Date).toISOString()+" "}function log(...t){return process.stderr.write(a.format(...t)+"\n")}function save(t){if(t){process.env.DEBUG=t}else{delete process.env.DEBUG}}function load(){return process.env.DEBUG}function init(t){t.inspectOpts={};const i=Object.keys(r.inspectOpts);for(let o=0;o<i.length;o++){t.inspectOpts[i[o]]=r.inspectOpts[i[o]]}}t.exports=i(3183)(r);const{formatters:u}=t.exports;u.o=function(t){this.inspectOpts.colors=this.useColors;return a.inspect(t,this.inspectOpts).split("\n").map((t=>t.trim())).join(" ")};u.O=function(t){this.inspectOpts.colors=this.useColors;return a.inspect(t,this.inspectOpts)}},9912:t=>{"use strict";t.exports=(t,r)=>{r=r||process.argv;const i=t.startsWith("-")?"":t.length===1?"-":"--";const o=r.indexOf(i+t);const a=r.indexOf("--");return o!==-1&&(a===-1?true:o<a)}},5178:t=>{"use strict";const{FORCE_COLOR:r,NODE_DISABLE_COLORS:i,TERM:o}=process.env;const a={enabled:!i&&o!=="dumb"&&r!=="0",reset:init(0,0),bold:init(1,22),dim:init(2,22),italic:init(3,23),underline:init(4,24),inverse:init(7,27),hidden:init(8,28),strikethrough:init(9,29),black:init(30,39),red:init(31,39),green:init(32,39),yellow:init(33,39),blue:init(34,39),magenta:init(35,39),cyan:init(36,39),white:init(37,39),gray:init(90,39),grey:init(90,39),bgBlack:init(40,49),bgRed:init(41,49),bgGreen:init(42,49),bgYellow:init(43,49),bgBlue:init(44,49),bgMagenta:init(45,49),bgCyan:init(46,49),bgWhite:init(47,49)};function run(t,r){let i=0,o,a="",u="";for(;i<t.length;i++){o=t[i];a+=o.open;u+=o.close;if(r.includes(o.close)){r=r.replace(o.rgx,o.close+o.open)}}return a+r+u}function chain(t,r){let i={has:t,keys:r};i.reset=a.reset.bind(i);i.bold=a.bold.bind(i);i.dim=a.dim.bind(i);i.italic=a.italic.bind(i);i.underline=a.underline.bind(i);i.inverse=a.inverse.bind(i);i.hidden=a.hidden.bind(i);i.strikethrough=a.strikethrough.bind(i);i.black=a.black.bind(i);i.red=a.red.bind(i);i.green=a.green.bind(i);i.yellow=a.yellow.bind(i);i.blue=a.blue.bind(i);i.magenta=a.magenta.bind(i);i.cyan=a.cyan.bind(i);i.white=a.white.bind(i);i.gray=a.gray.bind(i);i.grey=a.grey.bind(i);i.bgBlack=a.bgBlack.bind(i);i.bgRed=a.bgRed.bind(i);i.bgGreen=a.bgGreen.bind(i);i.bgYellow=a.bgYellow.bind(i);i.bgBlue=a.bgBlue.bind(i);i.bgMagenta=a.bgMagenta.bind(i);i.bgCyan=a.bgCyan.bind(i);i.bgWhite=a.bgWhite.bind(i);return i}function init(t,r){let i={open:`[${t}m`,close:`[${r}m`,rgx:new RegExp(`\\x1b\\[${r}m`,"g")};return function(r){if(this!==void 0&&this.has!==void 0){this.has.includes(t)||(this.has.push(t),this.keys.push(i));return r===void 0?this:a.enabled?run(this.keys,r+""):r+""}return r===void 0?chain([t],[i]):a.enabled?run([i],r+""):r+""}}t.exports=a},6257:t=>{var r=1e3;var i=r*60;var o=i*60;var a=o*24;var u=a*7;var l=a*365.25;t.exports=function(t,r){r=r||{};var i=typeof t;if(i==="string"&&t.length>0){return parse(t)}else if(i==="number"&&isFinite(t)){return r.long?fmtLong(t):fmtShort(t)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function parse(t){t=String(t);if(t.length>100){return}var c=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!c){return}var h=parseFloat(c[1]);var d=(c[2]||"ms").toLowerCase();switch(d){case"years":case"year":case"yrs":case"yr":case"y":return h*l;case"weeks":case"week":case"w":return h*u;case"days":case"day":case"d":return h*a;case"hours":case"hour":case"hrs":case"hr":case"h":return h*o;case"minutes":case"minute":case"mins":case"min":case"m":return h*i;case"seconds":case"second":case"secs":case"sec":case"s":return h*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return h;default:return undefined}}function fmtShort(t){var u=Math.abs(t);if(u>=a){return Math.round(t/a)+"d"}if(u>=o){return Math.round(t/o)+"h"}if(u>=i){return Math.round(t/i)+"m"}if(u>=r){return Math.round(t/r)+"s"}return t+"ms"}function fmtLong(t){var u=Math.abs(t);if(u>=a){return plural(t,u,a,"day")}if(u>=o){return plural(t,u,o,"hour")}if(u>=i){return plural(t,u,i,"minute")}if(u>=r){return plural(t,u,r,"second")}return t+" ms"}function plural(t,r,i,o){var a=r>=i*1.5;return Math.round(t/i)+" "+o+(a?"s":"")}},8578:t=>{"use strict";class DatePart{constructor({token:t,date:r,parts:i,locales:o}){this.token=t;this.date=r||new Date;this.parts=i||[this];this.locales=o||{}}up(){}down(){}next(){const t=this.parts.indexOf(this);return this.parts.find(((r,i)=>i>t&&r instanceof DatePart))}setTo(t){}prev(){let t=[].concat(this.parts).reverse();const r=t.indexOf(this);return t.find(((t,i)=>i>r&&t instanceof DatePart))}toString(){return String(this.date)}}t.exports=DatePart},519:(t,r,i)=>{"use strict";const o=i(8578);const pos=t=>{t=t%10;return t===1?"st":t===2?"nd":t===3?"rd":"th"};class Day extends o{constructor(t={}){super(t)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(t){this.date.setDate(parseInt(t.substr(-2)))}toString(){let t=this.date.getDate();let r=this.date.getDay();return this.token==="DD"?String(t).padStart(2,"0"):this.token==="Do"?t+pos(t):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:t}}t.exports=Day},9322:(t,r,i)=>{"use strict";const o=i(8578);class Hours extends o{constructor(t={}){super(t)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(t){this.date.setHours(parseInt(t.substr(-2)))}toString(){let t=this.date.getHours();if(/h/.test(this.token))t=t%12||12;return this.token.length>1?String(t).padStart(2,"0"):t}}t.exports=Hours},9083:(t,r,i)=>{"use strict";t.exports={DatePart:i(8578),Meridiem:i(4643),Day:i(519),Hours:i(9322),Milliseconds:i(1318),Minutes:i(5053),Month:i(5662),Seconds:i(1614),Year:i(3537)}},4643:(t,r,i)=>{"use strict";const o=i(8578);class Meridiem extends o{constructor(t={}){super(t)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let t=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?t.toUpperCase():t}}t.exports=Meridiem},1318:(t,r,i)=>{"use strict";const o=i(8578);class Milliseconds extends o{constructor(t={}){super(t)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(t){this.date.setMilliseconds(parseInt(t.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}t.exports=Milliseconds},5053:(t,r,i)=>{"use strict";const o=i(8578);class Minutes extends o{constructor(t={}){super(t)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(t){this.date.setMinutes(parseInt(t.substr(-2)))}toString(){let t=this.date.getMinutes();return this.token.length>1?String(t).padStart(2,"0"):t}}t.exports=Minutes},5662:(t,r,i)=>{"use strict";const o=i(8578);class Month extends o{constructor(t={}){super(t)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(t){t=parseInt(t.substr(-2))-1;this.date.setMonth(t<0?0:t)}toString(){let t=this.date.getMonth();let r=this.token.length;return r===2?String(t+1).padStart(2,"0"):r===3?this.locales.monthsShort[t]:r===4?this.locales.months[t]:String(t+1)}}t.exports=Month},1614:(t,r,i)=>{"use strict";const o=i(8578);class Seconds extends o{constructor(t={}){super(t)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(t){this.date.setSeconds(parseInt(t.substr(-2)))}toString(){let t=this.date.getSeconds();return this.token.length>1?String(t).padStart(2,"0"):t}}t.exports=Seconds},3537:(t,r,i)=>{"use strict";const o=i(8578);class Year extends o{constructor(t={}){super(t)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(t){this.date.setFullYear(t.substr(-4))}toString(){let t=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?t.substr(-2):t}}t.exports=Year},6807:(t,r,i)=>{"use strict";function asyncGeneratorStep(t,r,i,o,a,u,l){try{var c=t[u](l);var h=c.value}catch(t){i(t);return}if(c.done){r(h)}else{Promise.resolve(h).then(o,a)}}function _asyncToGenerator(t){return function(){var r=this,i=arguments;return new Promise((function(o,a){var u=t.apply(r,i);function _next(t){asyncGeneratorStep(u,o,a,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(u,o,a,_next,_throw,"throw",t)}_next(undefined)}))}}const o=i(5178);const a=i(9886);const u=i(2907),l=u.erase,c=u.cursor;const h=i(6591),d=h.style,p=h.clear,g=h.figures,m=h.wrap,b=h.entriesToDisplay;const getVal=(t,r)=>t[r]&&(t[r].value||t[r].title||t[r]);const getTitle=(t,r)=>t[r]&&(t[r].title||t[r].value||t[r]);const getIndex=(t,r)=>{const i=t.findIndex((t=>t.value===r||t.title===r));return i>-1?i:undefined};class AutocompletePrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.suggest=t.suggest;this.choices=t.choices;this.initial=typeof t.initial==="number"?t.initial:getIndex(t.choices,t.initial);this.select=this.initial||t.cursor||0;this.i18n={noMatches:t.noMatches||"no matches found"};this.fallback=t.fallback||this.initial;this.clearFirst=t.clearFirst||false;this.suggestions=[];this.input="";this.limit=t.limit||10;this.cursor=0;this.transform=d.render(t.style);this.scale=this.transform.scale;this.render=this.render.bind(this);this.complete=this.complete.bind(this);this.clear=p("",this.out.columns);this.complete(this.render);this.render()}set fallback(t){this._fb=Number.isSafeInteger(parseInt(t))?parseInt(t):t}get fallback(){let t;if(typeof this._fb==="number")t=this.choices[this._fb];else if(typeof this._fb==="string")t={title:this._fb};return t||this._fb||{title:this.i18n.noMatches}}moveSelect(t){this.select=t;if(this.suggestions.length>0)this.value=getVal(this.suggestions,t);else this.value=this.fallback.value;this.fire()}complete(t){var r=this;return _asyncToGenerator((function*(){const i=r.completing=r.suggest(r.input,r.choices);const o=yield i;if(r.completing!==i)return;r.suggestions=o.map(((t,r,i)=>({title:getTitle(i,r),value:getVal(i,r),description:t.description})));r.completing=false;const a=Math.max(o.length-1,0);r.moveSelect(Math.min(a,r.select));t&&t()}))()}reset(){this.input="";this.complete((()=>{this.moveSelect(this.initial!==void 0?this.initial:0);this.render()}));this.render()}exit(){if(this.clearFirst&&this.input.length>0){this.reset()}else{this.done=this.exited=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}}abort(){this.done=this.aborted=true;this.exited=false;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=this.exited=false;this.fire();this.render();this.out.write("\n");this.close()}_(t,r){let i=this.input.slice(0,this.cursor);let o=this.input.slice(this.cursor);this.input=`${i}${t}${o}`;this.cursor=i.length+1;this.complete(this.render);this.render()}delete(){if(this.cursor===0)return this.bell();let t=this.input.slice(0,this.cursor-1);let r=this.input.slice(this.cursor);this.input=`${t}${r}`;this.complete(this.render);this.cursor=this.cursor-1;this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let t=this.input.slice(0,this.cursor);let r=this.input.slice(this.cursor+1);this.input=`${t}${r}`;this.complete(this.render);this.render()}first(){this.moveSelect(0);this.render()}last(){this.moveSelect(this.suggestions.length-1);this.render()}up(){if(this.select===0){this.moveSelect(this.suggestions.length-1)}else{this.moveSelect(this.select-1)}this.render()}down(){if(this.select===this.suggestions.length-1){this.moveSelect(0)}else{this.moveSelect(this.select+1)}this.render()}next(){if(this.select===this.suggestions.length-1){this.moveSelect(0)}else this.moveSelect(this.select+1);this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1));this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0));this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1;this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1;this.render()}renderOption(t,r,i,a){let u;let l=i?g.arrowUp:a?g.arrowDown:" ";let c=r?o.cyan().underline(t.title):t.title;l=(r?o.cyan(g.pointer)+" ":" ")+l;if(t.description){u=` - ${t.description}`;if(l.length+c.length+u.length>=this.out.columns||t.description.split(/\r?\n/).length>1){u="\n"+m(t.description,{margin:3,width:this.out.columns})}}return l+" "+c+o.gray(u||"")}render(){if(this.closed)return;if(this.firstRender)this.out.write(c.hide);else this.out.write(p(this.outputText,this.out.columns));super.render();let t=b(this.select,this.choices.length,this.limit),r=t.startIndex,i=t.endIndex;this.outputText=[d.symbol(this.done,this.aborted,this.exited),o.bold(this.msg),d.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" ");if(!this.done){const t=this.suggestions.slice(r,i).map(((t,o)=>this.renderOption(t,this.select===o+r,o===0&&r>0,o+r===i-1&&i<this.choices.length))).join("\n");this.outputText+=`\n`+(t||o.gray(this.fallback.title))}this.out.write(l.line+c.to(0)+this.outputText)}}t.exports=AutocompletePrompt},3930:(t,r,i)=>{"use strict";const o=i(5178);const a=i(2907),u=a.cursor;const l=i(6240);const c=i(6591),h=c.clear,d=c.style,p=c.figures;class AutocompleteMultiselectPrompt extends l{constructor(t={}){t.overrideRender=true;super(t);this.inputValue="";this.clear=h("",this.out.columns);this.filteredOptions=this.value;this.render()}last(){this.cursor=this.filteredOptions.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length;this.render()}up(){if(this.cursor===0){this.cursor=this.filteredOptions.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.filteredOptions.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.filteredOptions[this.cursor].selected=false;this.render()}right(){if(this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=true;this.render()}delete(){if(this.inputValue.length){this.inputValue=this.inputValue.substr(0,this.inputValue.length-1);this.updateFilteredOptions()}}updateFilteredOptions(){const t=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((t=>{if(this.inputValue){if(typeof t.title==="string"){if(t.title.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}if(typeof t.value==="string"){if(t.value.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}return false}return true}));const r=this.filteredOptions.findIndex((r=>r===t));this.cursor=r<0?0:r;this.render()}handleSpaceToggle(){const t=this.filteredOptions[this.cursor];if(t.selected){t.selected=false;this.render()}else if(t.disabled||this.value.filter((t=>t.selected)).length>=this.maxChoices){return this.bell()}else{t.selected=true;this.render()}}handleInputChange(t){this.inputValue=this.inputValue+t;this.updateFilteredOptions()}_(t,r){if(t===" "){this.handleSpaceToggle()}else{this.handleInputChange(t)}}renderInstructions(){if(this.instructions===undefined||this.instructions){if(typeof this.instructions==="string"){return this.instructions}return`\nInstructions:\n ${p.arrowUp}/${p.arrowDown}: Highlight option\n ${p.arrowLeft}/${p.arrowRight}/[space]: Toggle selection\n [a,b,c]/delete: Filter choices\n enter/return: Complete answer\n`}return""}renderCurrentInput(){return`\nFiltered results for: ${this.inputValue?this.inputValue:o.gray("Enter something to filter")}\n`}renderOption(t,r,i){let a;if(r.disabled)a=t===i?o.gray().underline(r.title):o.strikethrough().gray(r.title);else a=t===i?o.cyan().underline(r.title):r.title;return(r.selected?o.green(p.radioOn):p.radioOff)+" "+a}renderDoneOrInstructions(){if(this.done){return this.value.filter((t=>t.selected)).map((t=>t.title)).join(", ")}const t=[o.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];if(this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled){t.push(o.yellow(this.warn))}return t.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(u.hide);super.render();let t=[d.symbol(this.done,this.aborted),o.bold(this.msg),d.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){t+=o.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}t+=this.renderOptions(this.filteredOptions);this.out.write(this.clear+t);this.clear=h(t,this.out.columns)}}t.exports=AutocompleteMultiselectPrompt},6018:(t,r,i)=>{"use strict";const o=i(5178);const a=i(9886);const u=i(6591),l=u.style,c=u.clear;const h=i(2907),d=h.erase,p=h.cursor;class ConfirmPrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.value=t.initial;this.initialValue=!!t.initial;this.yesMsg=t.yes||"yes";this.yesOption=t.yesOption||"(Y/n)";this.noMsg=t.no||"no";this.noOption=t.noOption||"(y/N)";this.render()}reset(){this.value=this.initialValue;this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.value=this.value||false;this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}_(t,r){if(t.toLowerCase()==="y"){this.value=true;return this.submit()}if(t.toLowerCase()==="n"){this.value=false;return this.submit()}return this.bell()}render(){if(this.closed)return;if(this.firstRender)this.out.write(p.hide);else this.out.write(c(this.outputText,this.out.columns));super.render();this.outputText=[l.symbol(this.done,this.aborted),o.bold(this.msg),l.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:o.gray(this.initialValue?this.yesOption:this.noOption)].join(" ");this.out.write(d.line+p.to(0)+this.outputText)}}t.exports=ConfirmPrompt},6030:(t,r,i)=>{"use strict";function asyncGeneratorStep(t,r,i,o,a,u,l){try{var c=t[u](l);var h=c.value}catch(t){i(t);return}if(c.done){r(h)}else{Promise.resolve(h).then(o,a)}}function _asyncToGenerator(t){return function(){var r=this,i=arguments;return new Promise((function(o,a){var u=t.apply(r,i);function _next(t){asyncGeneratorStep(u,o,a,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(u,o,a,_next,_throw,"throw",t)}_next(undefined)}))}}const o=i(5178);const a=i(9886);const u=i(6591),l=u.style,c=u.clear,h=u.figures;const d=i(2907),p=d.erase,g=d.cursor;const m=i(9083),b=m.DatePart,v=m.Meridiem,y=m.Day,w=m.Hours,k=m.Milliseconds,T=m.Minutes,x=m.Month,S=m.Seconds,C=m.Year;const O=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g;const _={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new y(t),3:t=>new x(t),4:t=>new C(t),5:t=>new v(t),6:t=>new w(t),7:t=>new T(t),8:t=>new S(t),9:t=>new k(t)};const P={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class DatePrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.cursor=0;this.typed="";this.locales=Object.assign(P,t.locales);this._date=t.initial||new Date;this.errorMsg=t.error||"Please Enter A Valid Value";this.validator=t.validate||(()=>true);this.mask=t.mask||"YYYY-MM-DD HH:mm:ss";this.clear=c("",this.out.columns);this.render()}get value(){return this.date}get date(){return this._date}set date(t){if(t)this._date.setTime(t.getTime())}set mask(t){let r;this.parts=[];while(r=O.exec(t)){let t=r.shift();let i=r.findIndex((t=>t!=null));this.parts.push(i in _?_[i]({token:r[i]||t,date:this.date,parts:this.parts,locales:this.locales}):r[i]||t)}let i=this.parts.reduce(((t,r)=>{if(typeof r==="string"&&typeof t[t.length-1]==="string")t[t.length-1]+=r;else t.push(r);return t}),[]);this.parts.splice(0);this.parts.push(...i);this.reset()}moveCursor(t){this.typed="";this.cursor=t;this.fire()}reset(){this.moveCursor(this.parts.findIndex((t=>t instanceof b)));this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write("\n");this.close()}validate(){var t=this;return _asyncToGenerator((function*(){let r=yield t.validator(t.value);if(typeof r==="string"){t.errorMsg=r;r=false}t.error=!r}))()}submit(){var t=this;return _asyncToGenerator((function*(){yield t.validate();if(t.error){t.color="red";t.fire();t.render();return}t.done=true;t.aborted=false;t.fire();t.render();t.out.write("\n");t.close()}))()}up(){this.typed="";this.parts[this.cursor].up();this.render()}down(){this.typed="";this.parts[this.cursor].down();this.render()}left(){let t=this.parts[this.cursor].prev();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t));this.render()}right(){let t=this.parts[this.cursor].next();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t));this.render()}next(){let t=this.parts[this.cursor].next();this.moveCursor(t?this.parts.indexOf(t):this.parts.findIndex((t=>t instanceof b)));this.render()}_(t){if(/\d/.test(t)){this.typed+=t;this.parts[this.cursor].setTo(this.typed);this.render()}}render(){if(this.closed)return;if(this.firstRender)this.out.write(g.hide);else this.out.write(c(this.outputText,this.out.columns));super.render();this.outputText=[l.symbol(this.done,this.aborted),o.bold(this.msg),l.delimiter(false),this.parts.reduce(((t,r,i)=>t.concat(i===this.cursor&&!this.done?o.cyan().underline(r.toString()):r)),[]).join("")].join(" ");if(this.error){this.outputText+=this.errorMsg.split("\n").reduce(((t,r,i)=>t+`\n${i?` `:h.pointerSmall} ${o.red().italic(r)}`),``)}this.out.write(p.line+g.to(0)+this.outputText)}}t.exports=DatePrompt},9598:(t,r,i)=>{"use strict";t.exports={TextPrompt:i(3484),SelectPrompt:i(2754),TogglePrompt:i(4894),DatePrompt:i(6030),NumberPrompt:i(9829),MultiselectPrompt:i(6240),AutocompletePrompt:i(6807),AutocompleteMultiselectPrompt:i(3930),ConfirmPrompt:i(6018)}},6240:(t,r,i)=>{"use strict";const o=i(5178);const a=i(2907),u=a.cursor;const l=i(9886);const c=i(6591),h=c.clear,d=c.figures,p=c.style,g=c.wrap,m=c.entriesToDisplay;class MultiselectPrompt extends l{constructor(t={}){super(t);this.msg=t.message;this.cursor=t.cursor||0;this.scrollIndex=t.cursor||0;this.hint=t.hint||"";this.warn=t.warn||"- This option is disabled -";this.minSelected=t.min;this.showMinError=false;this.maxChoices=t.max;this.instructions=t.instructions;this.optionsPerPage=t.optionsPerPage||10;this.value=t.choices.map(((t,r)=>{if(typeof t==="string")t={title:t,value:r};return{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(t.value===undefined?r:t.value),selected:t&&t.selected,disabled:t&&t.disabled}}));this.clear=h("",this.out.columns);if(!t.overrideRender){this.render()}}reset(){this.value.map((t=>!t.selected));this.cursor=0;this.fire();this.render()}selected(){return this.value.filter((t=>t.selected))}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){const t=this.value.filter((t=>t.selected));if(this.minSelected&&t.length<this.minSelected){this.showMinError=true;this.render()}else{this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}}first(){this.cursor=0;this.render()}last(){this.cursor=this.value.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.value.length;this.render()}up(){if(this.cursor===0){this.cursor=this.value.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.value.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.value[this.cursor].selected=false;this.render()}right(){if(this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=true;this.render()}handleSpaceToggle(){const t=this.value[this.cursor];if(t.selected){t.selected=false;this.render()}else if(t.disabled||this.value.filter((t=>t.selected)).length>=this.maxChoices){return this.bell()}else{t.selected=true;this.render()}}toggleAll(){if(this.maxChoices!==undefined||this.value[this.cursor].disabled){return this.bell()}const t=!this.value[this.cursor].selected;this.value.filter((t=>!t.disabled)).forEach((r=>r.selected=t));this.render()}_(t,r){if(t===" "){this.handleSpaceToggle()}else if(t==="a"){this.toggleAll()}else{return this.bell()}}renderInstructions(){if(this.instructions===undefined||this.instructions){if(typeof this.instructions==="string"){return this.instructions}return"\nInstructions:\n"+` ${d.arrowUp}/${d.arrowDown}: Highlight option\n`+` ${d.arrowLeft}/${d.arrowRight}/[space]: Toggle selection\n`+(this.maxChoices===undefined?` a: Toggle all\n`:"")+` enter/return: Complete answer`}return""}renderOption(t,r,i,a){const u=(r.selected?o.green(d.radioOn):d.radioOff)+" "+a+" ";let l,c;if(r.disabled){l=t===i?o.gray().underline(r.title):o.strikethrough().gray(r.title)}else{l=t===i?o.cyan().underline(r.title):r.title;if(t===i&&r.description){c=` - ${r.description}`;if(u.length+l.length+c.length>=this.out.columns||r.description.split(/\r?\n/).length>1){c="\n"+g(r.description,{margin:u.length,width:this.out.columns})}}}return u+l+o.gray(c||"")}paginateOptions(t){if(t.length===0){return o.red("No matches for this query.")}let r=m(this.cursor,t.length,this.optionsPerPage),i=r.startIndex,a=r.endIndex;let u,l=[];for(let r=i;r<a;r++){if(r===i&&i>0){u=d.arrowUp}else if(r===a-1&&a<t.length){u=d.arrowDown}else{u=" "}l.push(this.renderOption(this.cursor,t[r],r,u))}return"\n"+l.join("\n")}renderOptions(t){if(!this.done){return this.paginateOptions(t)}return""}renderDoneOrInstructions(){if(this.done){return this.value.filter((t=>t.selected)).map((t=>t.title)).join(", ")}const t=[o.gray(this.hint),this.renderInstructions()];if(this.value[this.cursor].disabled){t.push(o.yellow(this.warn))}return t.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(u.hide);super.render();let t=[p.symbol(this.done,this.aborted),o.bold(this.msg),p.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){t+=o.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}t+=this.renderOptions(this.value);this.out.write(this.clear+t);this.clear=h(t,this.out.columns)}}t.exports=MultiselectPrompt},9829:(t,r,i)=>{"use strict";function asyncGeneratorStep(t,r,i,o,a,u,l){try{var c=t[u](l);var h=c.value}catch(t){i(t);return}if(c.done){r(h)}else{Promise.resolve(h).then(o,a)}}function _asyncToGenerator(t){return function(){var r=this,i=arguments;return new Promise((function(o,a){var u=t.apply(r,i);function _next(t){asyncGeneratorStep(u,o,a,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(u,o,a,_next,_throw,"throw",t)}_next(undefined)}))}}const o=i(5178);const a=i(9886);const u=i(2907),l=u.cursor,c=u.erase;const h=i(6591),d=h.style,p=h.figures,g=h.clear,m=h.lines;const b=/[0-9]/;const isDef=t=>t!==undefined;const round=(t,r)=>{let i=Math.pow(10,r);return Math.round(t*i)/i};class NumberPrompt extends a{constructor(t={}){super(t);this.transform=d.render(t.style);this.msg=t.message;this.initial=isDef(t.initial)?t.initial:"";this.float=!!t.float;this.round=t.round||2;this.inc=t.increment||1;this.min=isDef(t.min)?t.min:-Infinity;this.max=isDef(t.max)?t.max:Infinity;this.errorMsg=t.error||`Please Enter A Valid Value`;this.validator=t.validate||(()=>true);this.color=`cyan`;this.value=``;this.typed=``;this.lastHit=0;this.render()}set value(t){if(!t&&t!==0){this.placeholder=true;this.rendered=o.gray(this.transform.render(`${this.initial}`));this._value=``}else{this.placeholder=false;this.rendered=this.transform.render(`${round(t,this.round)}`);this._value=round(t,this.round)}this.fire()}get value(){return this._value}parse(t){return this.float?parseFloat(t):parseInt(t)}valid(t){return t===`-`||t===`.`&&this.float||b.test(t)}reset(){this.typed=``;this.value=``;this.fire();this.render()}exit(){this.abort()}abort(){let t=this.value;this.value=t!==``?t:this.initial;this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write(`\n`);this.close()}validate(){var t=this;return _asyncToGenerator((function*(){let r=yield t.validator(t.value);if(typeof r===`string`){t.errorMsg=r;r=false}t.error=!r}))()}submit(){var t=this;return _asyncToGenerator((function*(){yield t.validate();if(t.error){t.color=`red`;t.fire();t.render();return}let r=t.value;t.value=r!==``?r:t.initial;t.done=true;t.aborted=false;t.error=false;t.fire();t.render();t.out.write(`\n`);t.close()}))()}up(){this.typed=``;if(this.value===""){this.value=this.min-this.inc}if(this.value>=this.max)return this.bell();this.value+=this.inc;this.color=`cyan`;this.fire();this.render()}down(){this.typed=``;if(this.value===""){this.value=this.min+this.inc}if(this.value<=this.min)return this.bell();this.value-=this.inc;this.color=`cyan`;this.fire();this.render()}delete(){let t=this.value.toString();if(t.length===0)return this.bell();this.value=this.parse(t=t.slice(0,-1))||``;if(this.value!==""&&this.value<this.min){this.value=this.min}this.color=`cyan`;this.fire();this.render()}next(){this.value=this.initial;this.fire();this.render()}_(t,r){if(!this.valid(t))return this.bell();const i=Date.now();if(i-this.lastHit>1e3)this.typed=``;this.typed+=t;this.lastHit=i;this.color=`cyan`;if(t===`.`)return this.fire();this.value=Math.min(this.parse(this.typed),this.max);if(this.value>this.max)this.value=this.max;if(this.value<this.min)this.value=this.min;this.fire();this.render()}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(l.down(m(this.outputError,this.out.columns)-1)+g(this.outputError,this.out.columns));this.out.write(g(this.outputText,this.out.columns))}super.render();this.outputError="";this.outputText=[d.symbol(this.done,this.aborted),o.bold(this.msg),d.delimiter(this.done),!this.done||!this.done&&!this.placeholder?o[this.color]().underline(this.rendered):this.rendered].join(` `);if(this.error){this.outputError+=this.errorMsg.split(`\n`).reduce(((t,r,i)=>t+`\n${i?` `:p.pointerSmall} ${o.red().italic(r)}`),``)}this.out.write(c.line+l.to(0)+this.outputText+l.save+this.outputError+l.restore)}}t.exports=NumberPrompt},9886:(t,r,i)=>{"use strict";const o=i(4521);const a=i(6591),u=a.action;const l=i(2361);const c=i(2907),h=c.beep,d=c.cursor;const p=i(5178);class Prompt extends l{constructor(t={}){super();this.firstRender=true;this.in=t.stdin||process.stdin;this.out=t.stdout||process.stdout;this.onRender=(t.onRender||(()=>void 0)).bind(this);const r=o.createInterface({input:this.in,escapeCodeTimeout:50});o.emitKeypressEvents(this.in,r);if(this.in.isTTY)this.in.setRawMode(true);const i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1;const keypress=(t,r)=>{let o=u(r,i);if(o===false){this._&&this._(t,r)}else if(typeof this[o]==="function"){this[o](r)}else{this.bell()}};this.close=()=>{this.out.write(d.show);this.in.removeListener("keypress",keypress);if(this.in.isTTY)this.in.setRawMode(false);r.close();this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value);this.closed=true};this.in.on("keypress",keypress)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(h)}render(){this.onRender(p);if(this.firstRender)this.firstRender=false}}t.exports=Prompt},2754:(t,r,i)=>{"use strict";const o=i(5178);const a=i(9886);const u=i(6591),l=u.style,c=u.clear,h=u.figures,d=u.wrap,p=u.entriesToDisplay;const g=i(2907),m=g.cursor;class SelectPrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.hint=t.hint||"- Use arrow-keys. Return to submit.";this.warn=t.warn||"- This option is disabled";this.cursor=t.initial||0;this.choices=t.choices.map(((t,r)=>{if(typeof t==="string")t={title:t,value:r};return{title:t&&(t.title||t.value||t),value:t&&(t.value===undefined?r:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled}}));this.optionsPerPage=t.optionsPerPage||10;this.value=(this.choices[this.cursor]||{}).value;this.clear=c("",this.out.columns);this.render()}moveCursor(t){this.cursor=t;this.value=this.choices[t].value;this.fire()}reset(){this.moveCursor(0);this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){if(!this.selection.disabled){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}else this.bell()}first(){this.moveCursor(0);this.render()}last(){this.moveCursor(this.choices.length-1);this.render()}up(){if(this.cursor===0){this.moveCursor(this.choices.length-1)}else{this.moveCursor(this.cursor-1)}this.render()}down(){if(this.cursor===this.choices.length-1){this.moveCursor(0)}else{this.moveCursor(this.cursor+1)}this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length);this.render()}_(t,r){if(t===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;if(this.firstRender)this.out.write(m.hide);else this.out.write(c(this.outputText,this.out.columns));super.render();let t=p(this.cursor,this.choices.length,this.optionsPerPage),r=t.startIndex,i=t.endIndex;this.outputText=[l.symbol(this.done,this.aborted),o.bold(this.msg),l.delimiter(false),this.done?this.selection.title:this.selection.disabled?o.yellow(this.warn):o.gray(this.hint)].join(" ");if(!this.done){this.outputText+="\n";for(let t=r;t<i;t++){let a,u,l="",c=this.choices[t];if(t===r&&r>0){u=h.arrowUp}else if(t===i-1&&i<this.choices.length){u=h.arrowDown}else{u=" "}if(c.disabled){a=this.cursor===t?o.gray().underline(c.title):o.strikethrough().gray(c.title);u=(this.cursor===t?o.bold().gray(h.pointer)+" ":" ")+u}else{a=this.cursor===t?o.cyan().underline(c.title):c.title;u=(this.cursor===t?o.cyan(h.pointer)+" ":" ")+u;if(c.description&&this.cursor===t){l=` - ${c.description}`;if(u.length+a.length+l.length>=this.out.columns||c.description.split(/\r?\n/).length>1){l="\n"+d(c.description,{margin:3,width:this.out.columns})}}}this.outputText+=`${u} ${a}${o.gray(l)}\n`}}this.out.write(this.outputText)}}t.exports=SelectPrompt},3484:(t,r,i)=>{"use strict";function asyncGeneratorStep(t,r,i,o,a,u,l){try{var c=t[u](l);var h=c.value}catch(t){i(t);return}if(c.done){r(h)}else{Promise.resolve(h).then(o,a)}}function _asyncToGenerator(t){return function(){var r=this,i=arguments;return new Promise((function(o,a){var u=t.apply(r,i);function _next(t){asyncGeneratorStep(u,o,a,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(u,o,a,_next,_throw,"throw",t)}_next(undefined)}))}}const o=i(5178);const a=i(9886);const u=i(2907),l=u.erase,c=u.cursor;const h=i(6591),d=h.style,p=h.clear,g=h.lines,m=h.figures;class TextPrompt extends a{constructor(t={}){super(t);this.transform=d.render(t.style);this.scale=this.transform.scale;this.msg=t.message;this.initial=t.initial||``;this.validator=t.validate||(()=>true);this.value=``;this.errorMsg=t.error||`Please Enter A Valid Value`;this.cursor=Number(!!this.initial);this.cursorOffset=0;this.clear=p(``,this.out.columns);this.render()}set value(t){if(!t&&this.initial){this.placeholder=true;this.rendered=o.gray(this.transform.render(this.initial))}else{this.placeholder=false;this.rendered=this.transform.render(t)}this._value=t;this.fire()}get value(){return this._value}reset(){this.value=``;this.cursor=Number(!!this.initial);this.cursorOffset=0;this.fire();this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial;this.done=this.aborted=true;this.error=false;this.red=false;this.fire();this.render();this.out.write("\n");this.close()}validate(){var t=this;return _asyncToGenerator((function*(){let r=yield t.validator(t.value);if(typeof r===`string`){t.errorMsg=r;r=false}t.error=!r}))()}submit(){var t=this;return _asyncToGenerator((function*(){t.value=t.value||t.initial;t.cursorOffset=0;t.cursor=t.rendered.length;yield t.validate();if(t.error){t.red=true;t.fire();t.render();return}t.done=true;t.aborted=false;t.fire();t.render();t.out.write("\n");t.close()}))()}next(){if(!this.placeholder)return this.bell();this.value=this.initial;this.cursor=this.rendered.length;this.fire();this.render()}moveCursor(t){if(this.placeholder)return;this.cursor=this.cursor+t;this.cursorOffset+=t}_(t,r){let i=this.value.slice(0,this.cursor);let o=this.value.slice(this.cursor);this.value=`${i}${t}${o}`;this.red=false;this.cursor=this.placeholder?0:i.length+1;this.render()}delete(){if(this.isCursorAtStart())return this.bell();let t=this.value.slice(0,this.cursor-1);let r=this.value.slice(this.cursor);this.value=`${t}${r}`;this.red=false;if(this.isCursorAtStart()){this.cursorOffset=0}else{this.cursorOffset++;this.moveCursor(-1)}this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let t=this.value.slice(0,this.cursor);let r=this.value.slice(this.cursor+1);this.value=`${t}${r}`;this.red=false;if(this.isCursorAtEnd()){this.cursorOffset=0}else{this.cursorOffset++}this.render()}first(){this.cursor=0;this.render()}last(){this.cursor=this.value.length;this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1);this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1);this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(c.down(g(this.outputError,this.out.columns)-1)+p(this.outputError,this.out.columns));this.out.write(p(this.outputText,this.out.columns))}super.render();this.outputError="";this.outputText=[d.symbol(this.done,this.aborted),o.bold(this.msg),d.delimiter(this.done),this.red?o.red(this.rendered):this.rendered].join(` `);if(this.error){this.outputError+=this.errorMsg.split(`\n`).reduce(((t,r,i)=>t+`\n${i?" ":m.pointerSmall} ${o.red().italic(r)}`),``)}this.out.write(l.line+c.to(0)+this.outputText+c.save+this.outputError+c.restore+c.move(this.cursorOffset,0))}}t.exports=TextPrompt},4894:(t,r,i)=>{"use strict";const o=i(5178);const a=i(9886);const u=i(6591),l=u.style,c=u.clear;const h=i(2907),d=h.cursor,p=h.erase;class TogglePrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.value=!!t.initial;this.active=t.active||"on";this.inactive=t.inactive||"off";this.initialValue=this.value;this.render()}reset(){this.value=this.initialValue;this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}deactivate(){if(this.value===false)return this.bell();this.value=false;this.render()}activate(){if(this.value===true)return this.bell();this.value=true;this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value;this.fire();this.render()}_(t,r){if(t===" "){this.value=!this.value}else if(t==="1"){this.value=true}else if(t==="0"){this.value=false}else return this.bell();this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(d.hide);else this.out.write(c(this.outputText,this.out.columns));super.render();this.outputText=[l.symbol(this.done,this.aborted),o.bold(this.msg),l.delimiter(this.done),this.value?this.inactive:o.cyan().underline(this.inactive),o.gray("/"),this.value?o.cyan().underline(this.active):this.active].join(" ");this.out.write(p.line+d.to(0)+this.outputText)}}t.exports=TogglePrompt},4395:(t,r,i)=>{"use strict";function ownKeys(t,r){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);if(r){o=o.filter((function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))}i.push.apply(i,o)}return i}function _objectSpread(t){for(var r=1;r<arguments.length;r++){var i=arguments[r]!=null?arguments[r]:{};if(r%2){ownKeys(Object(i),true).forEach((function(r){_defineProperty(t,r,i[r])}))}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(t,Object.getOwnPropertyDescriptors(i))}else{ownKeys(Object(i)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(i,r))}))}}return t}function _defineProperty(t,r,i){if(r in t){Object.defineProperty(t,r,{value:i,enumerable:true,configurable:true,writable:true})}else{t[r]=i}return t}function _createForOfIteratorHelper(t,r){var i=typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=_unsupportedIterableToArray(t))||r&&t&&typeof t.length==="number"){if(i)t=i;var o=0;var a=function F(){};return{s:a,n:function n(){if(o>=t.length)return{done:true};return{done:false,value:t[o++]}},e:function e(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u=true,l=false,c;return{s:function s(){i=i.call(t)},n:function n(){var t=i.next();u=t.done;return t},e:function e(t){l=true;c=t},f:function f(){try{if(!u&&i.return!=null)i.return()}finally{if(l)throw c}}}}function _unsupportedIterableToArray(t,r){if(!t)return;if(typeof t==="string")return _arrayLikeToArray(t,r);var i=Object.prototype.toString.call(t).slice(8,-1);if(i==="Object"&&t.constructor)i=t.constructor.name;if(i==="Map"||i==="Set")return Array.from(t);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return _arrayLikeToArray(t,r)}function _arrayLikeToArray(t,r){if(r==null||r>t.length)r=t.length;for(var i=0,o=new Array(r);i<r;i++)o[i]=t[i];return o}function asyncGeneratorStep(t,r,i,o,a,u,l){try{var c=t[u](l);var h=c.value}catch(t){i(t);return}if(c.done){r(h)}else{Promise.resolve(h).then(o,a)}}function _asyncToGenerator(t){return function(){var r=this,i=arguments;return new Promise((function(o,a){var u=t.apply(r,i);function _next(t){asyncGeneratorStep(u,o,a,_next,_throw,"next",t)}function _throw(t){asyncGeneratorStep(u,o,a,_next,_throw,"throw",t)}_next(undefined)}))}}const o=i(6102);const a=["suggest","format","onState","validate","onRender","type"];const noop=()=>{};function prompt(){return _prompt.apply(this,arguments)}function _prompt(){_prompt=_asyncToGenerator((function*(t=[],{onSubmit:r=noop,onCancel:i=noop}={}){const u={};const l=prompt._override||{};t=[].concat(t);let c,h,d,p,g,m;const b=function(){var t=_asyncToGenerator((function*(t,r,i=false){if(!i&&t.validate&&t.validate(r)!==true){return}return t.format?yield t.format(r,u):r}));return function getFormattedAnswer(r,i){return t.apply(this,arguments)}}();var v=_createForOfIteratorHelper(t),y;try{for(v.s();!(y=v.n()).done;){h=y.value;var w=h;p=w.name;g=w.type;if(typeof g==="function"){g=yield g(c,_objectSpread({},u),h);h["type"]=g}if(!g)continue;for(let t in h){if(a.includes(t))continue;let r=h[t];h[t]=typeof r==="function"?yield r(c,_objectSpread({},u),m):r}m=h;if(typeof h.message!=="string"){throw new Error("prompt message is required")}var k=h;p=k.name;g=k.type;if(o[g]===void 0){throw new Error(`prompt type (${g}) is not defined`)}if(l[h.name]!==undefined){c=yield b(h,l[h.name]);if(c!==undefined){u[p]=c;continue}}try{c=prompt._injected?getInjectedAnswer(prompt._injected,h.initial):yield o[g](h);u[p]=c=yield b(h,c,true);d=yield r(h,c,u)}catch(t){d=!(yield i(h,u))}if(d)return u}}catch(t){v.e(t)}finally{v.f()}return u}));return _prompt.apply(this,arguments)}function getInjectedAnswer(t,r){const i=t.shift();if(i instanceof Error){throw i}return i===undefined?r:i}function inject(t){prompt._injected=(prompt._injected||[]).concat(t)}function override(t){prompt._override=Object.assign({},t)}t.exports=Object.assign(prompt,{prompt:prompt,prompts:o,inject:inject,override:override})},6102:(t,r,i)=>{"use strict";const o=r;const a=i(9598);const noop=t=>t;function toPrompt(t,r,i={}){return new Promise(((o,u)=>{const l=new a[t](r);const c=i.onAbort||noop;const h=i.onSubmit||noop;const d=i.onExit||noop;l.on("state",r.onState||noop);l.on("submit",(t=>o(h(t))));l.on("exit",(t=>o(d(t))));l.on("abort",(t=>u(c(t))))}))}o.text=t=>toPrompt("TextPrompt",t);o.password=t=>{t.style="password";return o.text(t)};o.invisible=t=>{t.style="invisible";return o.text(t)};o.number=t=>toPrompt("NumberPrompt",t);o.date=t=>toPrompt("DatePrompt",t);o.confirm=t=>toPrompt("ConfirmPrompt",t);o.list=t=>{const r=t.separator||",";return toPrompt("TextPrompt",t,{onSubmit:t=>t.split(r).map((t=>t.trim()))})};o.toggle=t=>toPrompt("TogglePrompt",t);o.select=t=>toPrompt("SelectPrompt",t);o.multiselect=t=>{t.choices=[].concat(t.choices||[]);const toSelected=t=>t.filter((t=>t.selected)).map((t=>t.value));return toPrompt("MultiselectPrompt",t,{onAbort:toSelected,onSubmit:toSelected})};o.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);const toSelected=t=>t.filter((t=>t.selected)).map((t=>t.value));return toPrompt("AutocompleteMultiselectPrompt",t,{onAbort:toSelected,onSubmit:toSelected})};const byTitle=(t,r)=>Promise.resolve(r.filter((r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase())));o.autocomplete=t=>{t.suggest=t.suggest||byTitle;t.choices=[].concat(t.choices||[]);return toPrompt("AutocompletePrompt",t)}},4157:t=>{"use strict";t.exports=(t,r)=>{if(t.meta&&t.name!=="escape")return;if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c")return"abort";if(t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(r){if(t.name==="j")return"down";if(t.name==="k")return"up"}if(t.name==="return")return"submit";if(t.name==="enter")return"submit";if(t.name==="backspace")return"delete";if(t.name==="delete")return"deleteForward";if(t.name==="abort")return"abort";if(t.name==="escape")return"exit";if(t.name==="tab")return"next";if(t.name==="pagedown")return"nextPage";if(t.name==="pageup")return"prevPage";if(t.name==="home")return"home";if(t.name==="end")return"end";if(t.name==="up")return"up";if(t.name==="down")return"down";if(t.name==="right")return"right";if(t.name==="left")return"left";return false}},1186:(t,r,i)=>{"use strict";function _createForOfIteratorHelper(t,r){var i=typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=_unsupportedIterableToArray(t))||r&&t&&typeof t.length==="number"){if(i)t=i;var o=0;var a=function F(){};return{s:a,n:function n(){if(o>=t.length)return{done:true};return{done:false,value:t[o++]}},e:function e(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u=true,l=false,c;return{s:function s(){i=i.call(t)},n:function n(){var t=i.next();u=t.done;return t},e:function e(t){l=true;c=t},f:function f(){try{if(!u&&i.return!=null)i.return()}finally{if(l)throw c}}}}function _unsupportedIterableToArray(t,r){if(!t)return;if(typeof t==="string")return _arrayLikeToArray(t,r);var i=Object.prototype.toString.call(t).slice(8,-1);if(i==="Object"&&t.constructor)i=t.constructor.name;if(i==="Map"||i==="Set")return Array.from(t);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return _arrayLikeToArray(t,r)}function _arrayLikeToArray(t,r){if(r==null||r>t.length)r=t.length;for(var i=0,o=new Array(r);i<r;i++)o[i]=t[i];return o}const o=i(4479);const a=i(2907),u=a.erase,l=a.cursor;const width=t=>[...o(t)].length;t.exports=function(t,r){if(!r)return u.line+l.to(0);let i=0;const o=t.split(/\r?\n/);var a=_createForOfIteratorHelper(o),c;try{for(a.s();!(c=a.n()).done;){let t=c.value;i+=1+Math.floor(Math.max(width(t)-1,0)/r)}}catch(t){a.e(t)}finally{a.f()}return u.lines(i)}},8443:t=>{"use strict";t.exports=(t,r,i)=>{i=i||r;let o=Math.min(r-i,t-Math.floor(i/2));if(o<0)o=0;let a=Math.min(o+i,r);return{startIndex:o,endIndex:a}}},8666:t=>{"use strict";const r={arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",radioOn:"◉",radioOff:"◯",tick:"✔",cross:"✖",ellipsis:"…",pointerSmall:"›",line:"─",pointer:"❯"};const i={arrowUp:r.arrowUp,arrowDown:r.arrowDown,arrowLeft:r.arrowLeft,arrowRight:r.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"√",cross:"×",ellipsis:"...",pointerSmall:"»",line:"─",pointer:">"};const o=process.platform==="win32"?i:r;t.exports=o},6591:(t,r,i)=>{"use strict";t.exports={action:i(4157),clear:i(1186),style:i(1928),strip:i(4479),figures:i(8666),lines:i(4923),wrap:i(5438),entriesToDisplay:i(8443)}},4923:(t,r,i)=>{"use strict";const o=i(4479);t.exports=function(t,r){let i=String(o(t)||"").split(/\r?\n/);if(!r)return i.length;return i.map((t=>Math.ceil(t.length/r))).reduce(((t,r)=>t+r))}},4479:t=>{"use strict";t.exports=t=>{const r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|");const i=new RegExp(r,"g");return typeof t==="string"?t.replace(i,""):t}},1928:(t,r,i)=>{"use strict";const o=i(5178);const a=i(8666);const u=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"😃".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}});const render=t=>u[t]||u.default;const l=Object.freeze({aborted:o.red(a.cross),done:o.green(a.tick),exited:o.yellow(a.cross),default:o.cyan("?")});const symbol=(t,r,i)=>r?l.aborted:i?l.exited:t?l.done:l.default;const delimiter=t=>o.gray(t?a.ellipsis:a.pointerSmall);const item=(t,r)=>o.gray(t?r?a.pointerSmall:"+":a.line);t.exports={styles:u,render:render,symbols:l,symbol:symbol,delimiter:delimiter,item:item}},5438:t=>{"use strict";t.exports=(t,r={})=>{const i=Number.isSafeInteger(parseInt(r.margin))?new Array(parseInt(r.margin)).fill(" ").join(""):r.margin||"";const o=r.width;return(t||"").split(/\r?\n/g).map((t=>t.split(/\s+/g).reduce(((t,r)=>{if(r.length+i.length>=o||t[t.length-1].length+r.length+1<o)t[t.length-1]+=` ${r}`;else t.push(`${i}${r}`);return t}),[i]).join("\n"))).join("\n")}},3309:(t,r,i)=>{function isNodeLT(t){t=(Array.isArray(t)?t:t.split(".")).map(Number);let r=0,i=process.versions.node.split(".").map(Number);for(;r<t.length;r++){if(i[r]>t[r])return false;if(t[r]>i[r])return true}return false}t.exports=isNodeLT("8.6.0")?i(4395):i(8202)},9702:t=>{"use strict";class DatePart{constructor({token:t,date:r,parts:i,locales:o}){this.token=t;this.date=r||new Date;this.parts=i||[this];this.locales=o||{}}up(){}down(){}next(){const t=this.parts.indexOf(this);return this.parts.find(((r,i)=>i>t&&r instanceof DatePart))}setTo(t){}prev(){let t=[].concat(this.parts).reverse();const r=t.indexOf(this);return t.find(((t,i)=>i>r&&t instanceof DatePart))}toString(){return String(this.date)}}t.exports=DatePart},8879:(t,r,i)=>{"use strict";const o=i(9702);const pos=t=>{t=t%10;return t===1?"st":t===2?"nd":t===3?"rd":"th"};class Day extends o{constructor(t={}){super(t)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(t){this.date.setDate(parseInt(t.substr(-2)))}toString(){let t=this.date.getDate();let r=this.date.getDay();return this.token==="DD"?String(t).padStart(2,"0"):this.token==="Do"?t+pos(t):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:t}}t.exports=Day},3601:(t,r,i)=>{"use strict";const o=i(9702);class Hours extends o{constructor(t={}){super(t)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(t){this.date.setHours(parseInt(t.substr(-2)))}toString(){let t=this.date.getHours();if(/h/.test(this.token))t=t%12||12;return this.token.length>1?String(t).padStart(2,"0"):t}}t.exports=Hours},6616:(t,r,i)=>{"use strict";t.exports={DatePart:i(9702),Meridiem:i(8156),Day:i(8879),Hours:i(3601),Milliseconds:i(8126),Minutes:i(6732),Month:i(7035),Seconds:i(5206),Year:i(4383)}},8156:(t,r,i)=>{"use strict";const o=i(9702);class Meridiem extends o{constructor(t={}){super(t)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let t=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?t.toUpperCase():t}}t.exports=Meridiem},8126:(t,r,i)=>{"use strict";const o=i(9702);class Milliseconds extends o{constructor(t={}){super(t)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(t){this.date.setMilliseconds(parseInt(t.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}t.exports=Milliseconds},6732:(t,r,i)=>{"use strict";const o=i(9702);class Minutes extends o{constructor(t={}){super(t)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(t){this.date.setMinutes(parseInt(t.substr(-2)))}toString(){let t=this.date.getMinutes();return this.token.length>1?String(t).padStart(2,"0"):t}}t.exports=Minutes},7035:(t,r,i)=>{"use strict";const o=i(9702);class Month extends o{constructor(t={}){super(t)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(t){t=parseInt(t.substr(-2))-1;this.date.setMonth(t<0?0:t)}toString(){let t=this.date.getMonth();let r=this.token.length;return r===2?String(t+1).padStart(2,"0"):r===3?this.locales.monthsShort[t]:r===4?this.locales.months[t]:String(t+1)}}t.exports=Month},5206:(t,r,i)=>{"use strict";const o=i(9702);class Seconds extends o{constructor(t={}){super(t)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(t){this.date.setSeconds(parseInt(t.substr(-2)))}toString(){let t=this.date.getSeconds();return this.token.length>1?String(t).padStart(2,"0"):t}}t.exports=Seconds},4383:(t,r,i)=>{"use strict";const o=i(9702);class Year extends o{constructor(t={}){super(t)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(t){this.date.setFullYear(t.substr(-4))}toString(){let t=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?t.substr(-2):t}}t.exports=Year},3689:(t,r,i)=>{"use strict";const o=i(5178);const a=i(5410);const{erase:u,cursor:l}=i(2907);const{style:c,clear:h,figures:d,wrap:p,entriesToDisplay:g}=i(8665);const getVal=(t,r)=>t[r]&&(t[r].value||t[r].title||t[r]);const getTitle=(t,r)=>t[r]&&(t[r].title||t[r].value||t[r]);const getIndex=(t,r)=>{const i=t.findIndex((t=>t.value===r||t.title===r));return i>-1?i:undefined};class AutocompletePrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.suggest=t.suggest;this.choices=t.choices;this.initial=typeof t.initial==="number"?t.initial:getIndex(t.choices,t.initial);this.select=this.initial||t.cursor||0;this.i18n={noMatches:t.noMatches||"no matches found"};this.fallback=t.fallback||this.initial;this.clearFirst=t.clearFirst||false;this.suggestions=[];this.input="";this.limit=t.limit||10;this.cursor=0;this.transform=c.render(t.style);this.scale=this.transform.scale;this.render=this.render.bind(this);this.complete=this.complete.bind(this);this.clear=h("",this.out.columns);this.complete(this.render);this.render()}set fallback(t){this._fb=Number.isSafeInteger(parseInt(t))?parseInt(t):t}get fallback(){let t;if(typeof this._fb==="number")t=this.choices[this._fb];else if(typeof this._fb==="string")t={title:this._fb};return t||this._fb||{title:this.i18n.noMatches}}moveSelect(t){this.select=t;if(this.suggestions.length>0)this.value=getVal(this.suggestions,t);else this.value=this.fallback.value;this.fire()}async complete(t){const r=this.completing=this.suggest(this.input,this.choices);const i=await r;if(this.completing!==r)return;this.suggestions=i.map(((t,r,i)=>({title:getTitle(i,r),value:getVal(i,r),description:t.description})));this.completing=false;const o=Math.max(i.length-1,0);this.moveSelect(Math.min(o,this.select));t&&t()}reset(){this.input="";this.complete((()=>{this.moveSelect(this.initial!==void 0?this.initial:0);this.render()}));this.render()}exit(){if(this.clearFirst&&this.input.length>0){this.reset()}else{this.done=this.exited=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}}abort(){this.done=this.aborted=true;this.exited=false;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=this.exited=false;this.fire();this.render();this.out.write("\n");this.close()}_(t,r){let i=this.input.slice(0,this.cursor);let o=this.input.slice(this.cursor);this.input=`${i}${t}${o}`;this.cursor=i.length+1;this.complete(this.render);this.render()}delete(){if(this.cursor===0)return this.bell();let t=this.input.slice(0,this.cursor-1);let r=this.input.slice(this.cursor);this.input=`${t}${r}`;this.complete(this.render);this.cursor=this.cursor-1;this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let t=this.input.slice(0,this.cursor);let r=this.input.slice(this.cursor+1);this.input=`${t}${r}`;this.complete(this.render);this.render()}first(){this.moveSelect(0);this.render()}last(){this.moveSelect(this.suggestions.length-1);this.render()}up(){if(this.select===0){this.moveSelect(this.suggestions.length-1)}else{this.moveSelect(this.select-1)}this.render()}down(){if(this.select===this.suggestions.length-1){this.moveSelect(0)}else{this.moveSelect(this.select+1)}this.render()}next(){if(this.select===this.suggestions.length-1){this.moveSelect(0)}else this.moveSelect(this.select+1);this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1));this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0));this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1;this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1;this.render()}renderOption(t,r,i,a){let u;let l=i?d.arrowUp:a?d.arrowDown:" ";let c=r?o.cyan().underline(t.title):t.title;l=(r?o.cyan(d.pointer)+" ":" ")+l;if(t.description){u=` - ${t.description}`;if(l.length+c.length+u.length>=this.out.columns||t.description.split(/\r?\n/).length>1){u="\n"+p(t.description,{margin:3,width:this.out.columns})}}return l+" "+c+o.gray(u||"")}render(){if(this.closed)return;if(this.firstRender)this.out.write(l.hide);else this.out.write(h(this.outputText,this.out.columns));super.render();let{startIndex:t,endIndex:r}=g(this.select,this.choices.length,this.limit);this.outputText=[c.symbol(this.done,this.aborted,this.exited),o.bold(this.msg),c.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" ");if(!this.done){const i=this.suggestions.slice(t,r).map(((i,o)=>this.renderOption(i,this.select===o+t,o===0&&t>0,o+t===r-1&&r<this.choices.length))).join("\n");this.outputText+=`\n`+(i||o.gray(this.fallback.title))}this.out.write(u.line+l.to(0)+this.outputText)}}t.exports=AutocompletePrompt},7147:(t,r,i)=>{"use strict";const o=i(5178);const{cursor:a}=i(2907);const u=i(2486);const{clear:l,style:c,figures:h}=i(8665);class AutocompleteMultiselectPrompt extends u{constructor(t={}){t.overrideRender=true;super(t);this.inputValue="";this.clear=l("",this.out.columns);this.filteredOptions=this.value;this.render()}last(){this.cursor=this.filteredOptions.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length;this.render()}up(){if(this.cursor===0){this.cursor=this.filteredOptions.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.filteredOptions.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.filteredOptions[this.cursor].selected=false;this.render()}right(){if(this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=true;this.render()}delete(){if(this.inputValue.length){this.inputValue=this.inputValue.substr(0,this.inputValue.length-1);this.updateFilteredOptions()}}updateFilteredOptions(){const t=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((t=>{if(this.inputValue){if(typeof t.title==="string"){if(t.title.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}if(typeof t.value==="string"){if(t.value.toLowerCase().includes(this.inputValue.toLowerCase())){return true}}return false}return true}));const r=this.filteredOptions.findIndex((r=>r===t));this.cursor=r<0?0:r;this.render()}handleSpaceToggle(){const t=this.filteredOptions[this.cursor];if(t.selected){t.selected=false;this.render()}else if(t.disabled||this.value.filter((t=>t.selected)).length>=this.maxChoices){return this.bell()}else{t.selected=true;this.render()}}handleInputChange(t){this.inputValue=this.inputValue+t;this.updateFilteredOptions()}_(t,r){if(t===" "){this.handleSpaceToggle()}else{this.handleInputChange(t)}}renderInstructions(){if(this.instructions===undefined||this.instructions){if(typeof this.instructions==="string"){return this.instructions}return`\nInstructions:\n ${h.arrowUp}/${h.arrowDown}: Highlight option\n ${h.arrowLeft}/${h.arrowRight}/[space]: Toggle selection\n [a,b,c]/delete: Filter choices\n enter/return: Complete answer\n`}return""}renderCurrentInput(){return`\nFiltered results for: ${this.inputValue?this.inputValue:o.gray("Enter something to filter")}\n`}renderOption(t,r,i){let a;if(r.disabled)a=t===i?o.gray().underline(r.title):o.strikethrough().gray(r.title);else a=t===i?o.cyan().underline(r.title):r.title;return(r.selected?o.green(h.radioOn):h.radioOff)+" "+a}renderDoneOrInstructions(){if(this.done){return this.value.filter((t=>t.selected)).map((t=>t.title)).join(", ")}const t=[o.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];if(this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled){t.push(o.yellow(this.warn))}return t.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(a.hide);super.render();let t=[c.symbol(this.done,this.aborted),o.bold(this.msg),c.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){t+=o.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}t+=this.renderOptions(this.filteredOptions);this.out.write(this.clear+t);this.clear=l(t,this.out.columns)}}t.exports=AutocompleteMultiselectPrompt},7789:(t,r,i)=>{const o=i(5178);const a=i(5410);const{style:u,clear:l}=i(8665);const{erase:c,cursor:h}=i(2907);class ConfirmPrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.value=t.initial;this.initialValue=!!t.initial;this.yesMsg=t.yes||"yes";this.yesOption=t.yesOption||"(Y/n)";this.noMsg=t.no||"no";this.noOption=t.noOption||"(y/N)";this.render()}reset(){this.value=this.initialValue;this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.value=this.value||false;this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}_(t,r){if(t.toLowerCase()==="y"){this.value=true;return this.submit()}if(t.toLowerCase()==="n"){this.value=false;return this.submit()}return this.bell()}render(){if(this.closed)return;if(this.firstRender)this.out.write(h.hide);else this.out.write(l(this.outputText,this.out.columns));super.render();this.outputText=[u.symbol(this.done,this.aborted),o.bold(this.msg),u.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:o.gray(this.initialValue?this.yesOption:this.noOption)].join(" ");this.out.write(c.line+h.to(0)+this.outputText)}}t.exports=ConfirmPrompt},6540:(t,r,i)=>{"use strict";const o=i(5178);const a=i(5410);const{style:u,clear:l,figures:c}=i(8665);const{erase:h,cursor:d}=i(2907);const{DatePart:p,Meridiem:g,Day:m,Hours:b,Milliseconds:v,Minutes:y,Month:w,Seconds:k,Year:T}=i(6616);const x=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g;const S={1:({token:t})=>t.replace(/\\(.)/g,"$1"),2:t=>new m(t),3:t=>new w(t),4:t=>new T(t),5:t=>new g(t),6:t=>new b(t),7:t=>new y(t),8:t=>new k(t),9:t=>new v(t)};const C={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class DatePrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.cursor=0;this.typed="";this.locales=Object.assign(C,t.locales);this._date=t.initial||new Date;this.errorMsg=t.error||"Please Enter A Valid Value";this.validator=t.validate||(()=>true);this.mask=t.mask||"YYYY-MM-DD HH:mm:ss";this.clear=l("",this.out.columns);this.render()}get value(){return this.date}get date(){return this._date}set date(t){if(t)this._date.setTime(t.getTime())}set mask(t){let r;this.parts=[];while(r=x.exec(t)){let t=r.shift();let i=r.findIndex((t=>t!=null));this.parts.push(i in S?S[i]({token:r[i]||t,date:this.date,parts:this.parts,locales:this.locales}):r[i]||t)}let i=this.parts.reduce(((t,r)=>{if(typeof r==="string"&&typeof t[t.length-1]==="string")t[t.length-1]+=r;else t.push(r);return t}),[]);this.parts.splice(0);this.parts.push(...i);this.reset()}moveCursor(t){this.typed="";this.cursor=t;this.fire()}reset(){this.moveCursor(this.parts.findIndex((t=>t instanceof p)));this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write("\n");this.close()}async validate(){let t=await this.validator(this.value);if(typeof t==="string"){this.errorMsg=t;t=false}this.error=!t}async submit(){await this.validate();if(this.error){this.color="red";this.fire();this.render();return}this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}up(){this.typed="";this.parts[this.cursor].up();this.render()}down(){this.typed="";this.parts[this.cursor].down();this.render()}left(){let t=this.parts[this.cursor].prev();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t));this.render()}right(){let t=this.parts[this.cursor].next();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t));this.render()}next(){let t=this.parts[this.cursor].next();this.moveCursor(t?this.parts.indexOf(t):this.parts.findIndex((t=>t instanceof p)));this.render()}_(t){if(/\d/.test(t)){this.typed+=t;this.parts[this.cursor].setTo(this.typed);this.render()}}render(){if(this.closed)return;if(this.firstRender)this.out.write(d.hide);else this.out.write(l(this.outputText,this.out.columns));super.render();this.outputText=[u.symbol(this.done,this.aborted),o.bold(this.msg),u.delimiter(false),this.parts.reduce(((t,r,i)=>t.concat(i===this.cursor&&!this.done?o.cyan().underline(r.toString()):r)),[]).join("")].join(" ");if(this.error){this.outputText+=this.errorMsg.split("\n").reduce(((t,r,i)=>t+`\n${i?` `:c.pointerSmall} ${o.red().italic(r)}`),``)}this.out.write(h.line+d.to(0)+this.outputText)}}t.exports=DatePrompt},443:(t,r,i)=>{"use strict";t.exports={TextPrompt:i(3380),SelectPrompt:i(5893),TogglePrompt:i(4137),DatePrompt:i(6540),NumberPrompt:i(4869),MultiselectPrompt:i(2486),AutocompletePrompt:i(3689),AutocompleteMultiselectPrompt:i(7147),ConfirmPrompt:i(7789)}},2486:(t,r,i)=>{"use strict";const o=i(5178);const{cursor:a}=i(2907);const u=i(5410);const{clear:l,figures:c,style:h,wrap:d,entriesToDisplay:p}=i(8665);class MultiselectPrompt extends u{constructor(t={}){super(t);this.msg=t.message;this.cursor=t.cursor||0;this.scrollIndex=t.cursor||0;this.hint=t.hint||"";this.warn=t.warn||"- This option is disabled -";this.minSelected=t.min;this.showMinError=false;this.maxChoices=t.max;this.instructions=t.instructions;this.optionsPerPage=t.optionsPerPage||10;this.value=t.choices.map(((t,r)=>{if(typeof t==="string")t={title:t,value:r};return{title:t&&(t.title||t.value||t),description:t&&t.description,value:t&&(t.value===undefined?r:t.value),selected:t&&t.selected,disabled:t&&t.disabled}}));this.clear=l("",this.out.columns);if(!t.overrideRender){this.render()}}reset(){this.value.map((t=>!t.selected));this.cursor=0;this.fire();this.render()}selected(){return this.value.filter((t=>t.selected))}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){const t=this.value.filter((t=>t.selected));if(this.minSelected&&t.length<this.minSelected){this.showMinError=true;this.render()}else{this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}}first(){this.cursor=0;this.render()}last(){this.cursor=this.value.length-1;this.render()}next(){this.cursor=(this.cursor+1)%this.value.length;this.render()}up(){if(this.cursor===0){this.cursor=this.value.length-1}else{this.cursor--}this.render()}down(){if(this.cursor===this.value.length-1){this.cursor=0}else{this.cursor++}this.render()}left(){this.value[this.cursor].selected=false;this.render()}right(){if(this.value.filter((t=>t.selected)).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=true;this.render()}handleSpaceToggle(){const t=this.value[this.cursor];if(t.selected){t.selected=false;this.render()}else if(t.disabled||this.value.filter((t=>t.selected)).length>=this.maxChoices){return this.bell()}else{t.selected=true;this.render()}}toggleAll(){if(this.maxChoices!==undefined||this.value[this.cursor].disabled){return this.bell()}const t=!this.value[this.cursor].selected;this.value.filter((t=>!t.disabled)).forEach((r=>r.selected=t));this.render()}_(t,r){if(t===" "){this.handleSpaceToggle()}else if(t==="a"){this.toggleAll()}else{return this.bell()}}renderInstructions(){if(this.instructions===undefined||this.instructions){if(typeof this.instructions==="string"){return this.instructions}return"\nInstructions:\n"+` ${c.arrowUp}/${c.arrowDown}: Highlight option\n`+` ${c.arrowLeft}/${c.arrowRight}/[space]: Toggle selection\n`+(this.maxChoices===undefined?` a: Toggle all\n`:"")+` enter/return: Complete answer`}return""}renderOption(t,r,i,a){const u=(r.selected?o.green(c.radioOn):c.radioOff)+" "+a+" ";let l,h;if(r.disabled){l=t===i?o.gray().underline(r.title):o.strikethrough().gray(r.title)}else{l=t===i?o.cyan().underline(r.title):r.title;if(t===i&&r.description){h=` - ${r.description}`;if(u.length+l.length+h.length>=this.out.columns||r.description.split(/\r?\n/).length>1){h="\n"+d(r.description,{margin:u.length,width:this.out.columns})}}}return u+l+o.gray(h||"")}paginateOptions(t){if(t.length===0){return o.red("No matches for this query.")}let{startIndex:r,endIndex:i}=p(this.cursor,t.length,this.optionsPerPage);let a,u=[];for(let o=r;o<i;o++){if(o===r&&r>0){a=c.arrowUp}else if(o===i-1&&i<t.length){a=c.arrowDown}else{a=" "}u.push(this.renderOption(this.cursor,t[o],o,a))}return"\n"+u.join("\n")}renderOptions(t){if(!this.done){return this.paginateOptions(t)}return""}renderDoneOrInstructions(){if(this.done){return this.value.filter((t=>t.selected)).map((t=>t.title)).join(", ")}const t=[o.gray(this.hint),this.renderInstructions()];if(this.value[this.cursor].disabled){t.push(o.yellow(this.warn))}return t.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(a.hide);super.render();let t=[h.symbol(this.done,this.aborted),o.bold(this.msg),h.delimiter(false),this.renderDoneOrInstructions()].join(" ");if(this.showMinError){t+=o.red(`You must select a minimum of ${this.minSelected} choices.`);this.showMinError=false}t+=this.renderOptions(this.value);this.out.write(this.clear+t);this.clear=l(t,this.out.columns)}}t.exports=MultiselectPrompt},4869:(t,r,i)=>{const o=i(5178);const a=i(5410);const{cursor:u,erase:l}=i(2907);const{style:c,figures:h,clear:d,lines:p}=i(8665);const g=/[0-9]/;const isDef=t=>t!==undefined;const round=(t,r)=>{let i=Math.pow(10,r);return Math.round(t*i)/i};class NumberPrompt extends a{constructor(t={}){super(t);this.transform=c.render(t.style);this.msg=t.message;this.initial=isDef(t.initial)?t.initial:"";this.float=!!t.float;this.round=t.round||2;this.inc=t.increment||1;this.min=isDef(t.min)?t.min:-Infinity;this.max=isDef(t.max)?t.max:Infinity;this.errorMsg=t.error||`Please Enter A Valid Value`;this.validator=t.validate||(()=>true);this.color=`cyan`;this.value=``;this.typed=``;this.lastHit=0;this.render()}set value(t){if(!t&&t!==0){this.placeholder=true;this.rendered=o.gray(this.transform.render(`${this.initial}`));this._value=``}else{this.placeholder=false;this.rendered=this.transform.render(`${round(t,this.round)}`);this._value=round(t,this.round)}this.fire()}get value(){return this._value}parse(t){return this.float?parseFloat(t):parseInt(t)}valid(t){return t===`-`||t===`.`&&this.float||g.test(t)}reset(){this.typed=``;this.value=``;this.fire();this.render()}exit(){this.abort()}abort(){let t=this.value;this.value=t!==``?t:this.initial;this.done=this.aborted=true;this.error=false;this.fire();this.render();this.out.write(`\n`);this.close()}async validate(){let t=await this.validator(this.value);if(typeof t===`string`){this.errorMsg=t;t=false}this.error=!t}async submit(){await this.validate();if(this.error){this.color=`red`;this.fire();this.render();return}let t=this.value;this.value=t!==``?t:this.initial;this.done=true;this.aborted=false;this.error=false;this.fire();this.render();this.out.write(`\n`);this.close()}up(){this.typed=``;if(this.value===""){this.value=this.min-this.inc}if(this.value>=this.max)return this.bell();this.value+=this.inc;this.color=`cyan`;this.fire();this.render()}down(){this.typed=``;if(this.value===""){this.value=this.min+this.inc}if(this.value<=this.min)return this.bell();this.value-=this.inc;this.color=`cyan`;this.fire();this.render()}delete(){let t=this.value.toString();if(t.length===0)return this.bell();this.value=this.parse(t=t.slice(0,-1))||``;if(this.value!==""&&this.value<this.min){this.value=this.min}this.color=`cyan`;this.fire();this.render()}next(){this.value=this.initial;this.fire();this.render()}_(t,r){if(!this.valid(t))return this.bell();const i=Date.now();if(i-this.lastHit>1e3)this.typed=``;this.typed+=t;this.lastHit=i;this.color=`cyan`;if(t===`.`)return this.fire();this.value=Math.min(this.parse(this.typed),this.max);if(this.value>this.max)this.value=this.max;if(this.value<this.min)this.value=this.min;this.fire();this.render()}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(u.down(p(this.outputError,this.out.columns)-1)+d(this.outputError,this.out.columns));this.out.write(d(this.outputText,this.out.columns))}super.render();this.outputError="";this.outputText=[c.symbol(this.done,this.aborted),o.bold(this.msg),c.delimiter(this.done),!this.done||!this.done&&!this.placeholder?o[this.color]().underline(this.rendered):this.rendered].join(` `);if(this.error){this.outputError+=this.errorMsg.split(`\n`).reduce(((t,r,i)=>t+`\n${i?` `:h.pointerSmall} ${o.red().italic(r)}`),``)}this.out.write(l.line+u.to(0)+this.outputText+u.save+this.outputError+u.restore)}}t.exports=NumberPrompt},5410:(t,r,i)=>{"use strict";const o=i(4521);const{action:a}=i(8665);const u=i(2361);const{beep:l,cursor:c}=i(2907);const h=i(5178);class Prompt extends u{constructor(t={}){super();this.firstRender=true;this.in=t.stdin||process.stdin;this.out=t.stdout||process.stdout;this.onRender=(t.onRender||(()=>void 0)).bind(this);const r=o.createInterface({input:this.in,escapeCodeTimeout:50});o.emitKeypressEvents(this.in,r);if(this.in.isTTY)this.in.setRawMode(true);const i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1;const keypress=(t,r)=>{let o=a(r,i);if(o===false){this._&&this._(t,r)}else if(typeof this[o]==="function"){this[o](r)}else{this.bell()}};this.close=()=>{this.out.write(c.show);this.in.removeListener("keypress",keypress);if(this.in.isTTY)this.in.setRawMode(false);r.close();this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value);this.closed=true};this.in.on("keypress",keypress)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(l)}render(){this.onRender(h);if(this.firstRender)this.firstRender=false}}t.exports=Prompt},5893:(t,r,i)=>{"use strict";const o=i(5178);const a=i(5410);const{style:u,clear:l,figures:c,wrap:h,entriesToDisplay:d}=i(8665);const{cursor:p}=i(2907);class SelectPrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.hint=t.hint||"- Use arrow-keys. Return to submit.";this.warn=t.warn||"- This option is disabled";this.cursor=t.initial||0;this.choices=t.choices.map(((t,r)=>{if(typeof t==="string")t={title:t,value:r};return{title:t&&(t.title||t.value||t),value:t&&(t.value===undefined?r:t.value),description:t&&t.description,selected:t&&t.selected,disabled:t&&t.disabled}}));this.optionsPerPage=t.optionsPerPage||10;this.value=(this.choices[this.cursor]||{}).value;this.clear=l("",this.out.columns);this.render()}moveCursor(t){this.cursor=t;this.value=this.choices[t].value;this.fire()}reset(){this.moveCursor(0);this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){if(!this.selection.disabled){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}else this.bell()}first(){this.moveCursor(0);this.render()}last(){this.moveCursor(this.choices.length-1);this.render()}up(){if(this.cursor===0){this.moveCursor(this.choices.length-1)}else{this.moveCursor(this.cursor-1)}this.render()}down(){if(this.cursor===this.choices.length-1){this.moveCursor(0)}else{this.moveCursor(this.cursor+1)}this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length);this.render()}_(t,r){if(t===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;if(this.firstRender)this.out.write(p.hide);else this.out.write(l(this.outputText,this.out.columns));super.render();let{startIndex:t,endIndex:r}=d(this.cursor,this.choices.length,this.optionsPerPage);this.outputText=[u.symbol(this.done,this.aborted),o.bold(this.msg),u.delimiter(false),this.done?this.selection.title:this.selection.disabled?o.yellow(this.warn):o.gray(this.hint)].join(" ");if(!this.done){this.outputText+="\n";for(let i=t;i<r;i++){let a,u,l="",d=this.choices[i];if(i===t&&t>0){u=c.arrowUp}else if(i===r-1&&r<this.choices.length){u=c.arrowDown}else{u=" "}if(d.disabled){a=this.cursor===i?o.gray().underline(d.title):o.strikethrough().gray(d.title);u=(this.cursor===i?o.bold().gray(c.pointer)+" ":" ")+u}else{a=this.cursor===i?o.cyan().underline(d.title):d.title;u=(this.cursor===i?o.cyan(c.pointer)+" ":" ")+u;if(d.description&&this.cursor===i){l=` - ${d.description}`;if(u.length+a.length+l.length>=this.out.columns||d.description.split(/\r?\n/).length>1){l="\n"+h(d.description,{margin:3,width:this.out.columns})}}}this.outputText+=`${u} ${a}${o.gray(l)}\n`}}this.out.write(this.outputText)}}t.exports=SelectPrompt},3380:(t,r,i)=>{const o=i(5178);const a=i(5410);const{erase:u,cursor:l}=i(2907);const{style:c,clear:h,lines:d,figures:p}=i(8665);class TextPrompt extends a{constructor(t={}){super(t);this.transform=c.render(t.style);this.scale=this.transform.scale;this.msg=t.message;this.initial=t.initial||``;this.validator=t.validate||(()=>true);this.value=``;this.errorMsg=t.error||`Please Enter A Valid Value`;this.cursor=Number(!!this.initial);this.cursorOffset=0;this.clear=h(``,this.out.columns);this.render()}set value(t){if(!t&&this.initial){this.placeholder=true;this.rendered=o.gray(this.transform.render(this.initial))}else{this.placeholder=false;this.rendered=this.transform.render(t)}this._value=t;this.fire()}get value(){return this._value}reset(){this.value=``;this.cursor=Number(!!this.initial);this.cursorOffset=0;this.fire();this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial;this.done=this.aborted=true;this.error=false;this.red=false;this.fire();this.render();this.out.write("\n");this.close()}async validate(){let t=await this.validator(this.value);if(typeof t===`string`){this.errorMsg=t;t=false}this.error=!t}async submit(){this.value=this.value||this.initial;this.cursorOffset=0;this.cursor=this.rendered.length;await this.validate();if(this.error){this.red=true;this.fire();this.render();return}this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial;this.cursor=this.rendered.length;this.fire();this.render()}moveCursor(t){if(this.placeholder)return;this.cursor=this.cursor+t;this.cursorOffset+=t}_(t,r){let i=this.value.slice(0,this.cursor);let o=this.value.slice(this.cursor);this.value=`${i}${t}${o}`;this.red=false;this.cursor=this.placeholder?0:i.length+1;this.render()}delete(){if(this.isCursorAtStart())return this.bell();let t=this.value.slice(0,this.cursor-1);let r=this.value.slice(this.cursor);this.value=`${t}${r}`;this.red=false;if(this.isCursorAtStart()){this.cursorOffset=0}else{this.cursorOffset++;this.moveCursor(-1)}this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let t=this.value.slice(0,this.cursor);let r=this.value.slice(this.cursor+1);this.value=`${t}${r}`;this.red=false;if(this.isCursorAtEnd()){this.cursorOffset=0}else{this.cursorOffset++}this.render()}first(){this.cursor=0;this.render()}last(){this.cursor=this.value.length;this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1);this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1);this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(l.down(d(this.outputError,this.out.columns)-1)+h(this.outputError,this.out.columns));this.out.write(h(this.outputText,this.out.columns))}super.render();this.outputError="";this.outputText=[c.symbol(this.done,this.aborted),o.bold(this.msg),c.delimiter(this.done),this.red?o.red(this.rendered):this.rendered].join(` `);if(this.error){this.outputError+=this.errorMsg.split(`\n`).reduce(((t,r,i)=>t+`\n${i?" ":p.pointerSmall} ${o.red().italic(r)}`),``)}this.out.write(u.line+l.to(0)+this.outputText+l.save+this.outputError+l.restore+l.move(this.cursorOffset,0))}}t.exports=TextPrompt},4137:(t,r,i)=>{const o=i(5178);const a=i(5410);const{style:u,clear:l}=i(8665);const{cursor:c,erase:h}=i(2907);class TogglePrompt extends a{constructor(t={}){super(t);this.msg=t.message;this.value=!!t.initial;this.active=t.active||"on";this.inactive=t.inactive||"off";this.initialValue=this.value;this.render()}reset(){this.value=this.initialValue;this.fire();this.render()}exit(){this.abort()}abort(){this.done=this.aborted=true;this.fire();this.render();this.out.write("\n");this.close()}submit(){this.done=true;this.aborted=false;this.fire();this.render();this.out.write("\n");this.close()}deactivate(){if(this.value===false)return this.bell();this.value=false;this.render()}activate(){if(this.value===true)return this.bell();this.value=true;this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value;this.fire();this.render()}_(t,r){if(t===" "){this.value=!this.value}else if(t==="1"){this.value=true}else if(t==="0"){this.value=false}else return this.bell();this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(c.hide);else this.out.write(l(this.outputText,this.out.columns));super.render();this.outputText=[u.symbol(this.done,this.aborted),o.bold(this.msg),u.delimiter(this.done),this.value?this.inactive:o.cyan().underline(this.inactive),o.gray("/"),this.value?o.cyan().underline(this.active):this.active].join(" ");this.out.write(h.line+c.to(0)+this.outputText)}}t.exports=TogglePrompt},8202:(t,r,i)=>{"use strict";const o=i(9236);const a=["suggest","format","onState","validate","onRender","type"];const noop=()=>{};async function prompt(t=[],{onSubmit:r=noop,onCancel:i=noop}={}){const u={};const l=prompt._override||{};t=[].concat(t);let c,h,d,p,g,m;const getFormattedAnswer=async(t,r,i=false)=>{if(!i&&t.validate&&t.validate(r)!==true){return}return t.format?await t.format(r,u):r};for(h of t){({name:p,type:g}=h);if(typeof g==="function"){g=await g(c,{...u},h);h["type"]=g}if(!g)continue;for(let t in h){if(a.includes(t))continue;let r=h[t];h[t]=typeof r==="function"?await r(c,{...u},m):r}m=h;if(typeof h.message!=="string"){throw new Error("prompt message is required")}({name:p,type:g}=h);if(o[g]===void 0){throw new Error(`prompt type (${g}) is not defined`)}if(l[h.name]!==undefined){c=await getFormattedAnswer(h,l[h.name]);if(c!==undefined){u[p]=c;continue}}try{c=prompt._injected?getInjectedAnswer(prompt._injected,h.initial):await o[g](h);u[p]=c=await getFormattedAnswer(h,c,true);d=await r(h,c,u)}catch(t){d=!await i(h,u)}if(d)return u}return u}function getInjectedAnswer(t,r){const i=t.shift();if(i instanceof Error){throw i}return i===undefined?r:i}function inject(t){prompt._injected=(prompt._injected||[]).concat(t)}function override(t){prompt._override=Object.assign({},t)}t.exports=Object.assign(prompt,{prompt:prompt,prompts:o,inject:inject,override:override})},9236:(t,r,i)=>{"use strict";const o=r;const a=i(443);const noop=t=>t;function toPrompt(t,r,i={}){return new Promise(((o,u)=>{const l=new a[t](r);const c=i.onAbort||noop;const h=i.onSubmit||noop;const d=i.onExit||noop;l.on("state",r.onState||noop);l.on("submit",(t=>o(h(t))));l.on("exit",(t=>o(d(t))));l.on("abort",(t=>u(c(t))))}))}o.text=t=>toPrompt("TextPrompt",t);o.password=t=>{t.style="password";return o.text(t)};o.invisible=t=>{t.style="invisible";return o.text(t)};o.number=t=>toPrompt("NumberPrompt",t);o.date=t=>toPrompt("DatePrompt",t);o.confirm=t=>toPrompt("ConfirmPrompt",t);o.list=t=>{const r=t.separator||",";return toPrompt("TextPrompt",t,{onSubmit:t=>t.split(r).map((t=>t.trim()))})};o.toggle=t=>toPrompt("TogglePrompt",t);o.select=t=>toPrompt("SelectPrompt",t);o.multiselect=t=>{t.choices=[].concat(t.choices||[]);const toSelected=t=>t.filter((t=>t.selected)).map((t=>t.value));return toPrompt("MultiselectPrompt",t,{onAbort:toSelected,onSubmit:toSelected})};o.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);const toSelected=t=>t.filter((t=>t.selected)).map((t=>t.value));return toPrompt("AutocompleteMultiselectPrompt",t,{onAbort:toSelected,onSubmit:toSelected})};const byTitle=(t,r)=>Promise.resolve(r.filter((r=>r.title.slice(0,t.length).toLowerCase()===t.toLowerCase())));o.autocomplete=t=>{t.suggest=t.suggest||byTitle;t.choices=[].concat(t.choices||[]);return toPrompt("AutocompletePrompt",t)}},2750:t=>{"use strict";t.exports=(t,r)=>{if(t.meta&&t.name!=="escape")return;if(t.ctrl){if(t.name==="a")return"first";if(t.name==="c")return"abort";if(t.name==="d")return"abort";if(t.name==="e")return"last";if(t.name==="g")return"reset"}if(r){if(t.name==="j")return"down";if(t.name==="k")return"up"}if(t.name==="return")return"submit";if(t.name==="enter")return"submit";if(t.name==="backspace")return"delete";if(t.name==="delete")return"deleteForward";if(t.name==="abort")return"abort";if(t.name==="escape")return"exit";if(t.name==="tab")return"next";if(t.name==="pagedown")return"nextPage";if(t.name==="pageup")return"prevPage";if(t.name==="home")return"home";if(t.name==="end")return"end";if(t.name==="up")return"up";if(t.name==="down")return"down";if(t.name==="right")return"right";if(t.name==="left")return"left";return false}},2699:(t,r,i)=>{"use strict";const o=i(404);const{erase:a,cursor:u}=i(2907);const width=t=>[...o(t)].length;t.exports=function(t,r){if(!r)return a.line+u.to(0);let i=0;const o=t.split(/\r?\n/);for(let t of o){i+=1+Math.floor(Math.max(width(t)-1,0)/r)}return a.lines(i)}},9019:t=>{"use strict";t.exports=(t,r,i)=>{i=i||r;let o=Math.min(r-i,t-Math.floor(i/2));if(o<0)o=0;let a=Math.min(o+i,r);return{startIndex:o,endIndex:a}}},775:t=>{"use strict";const r={arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",radioOn:"◉",radioOff:"◯",tick:"✔",cross:"✖",ellipsis:"…",pointerSmall:"›",line:"─",pointer:"❯"};const i={arrowUp:r.arrowUp,arrowDown:r.arrowDown,arrowLeft:r.arrowLeft,arrowRight:r.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"√",cross:"×",ellipsis:"...",pointerSmall:"»",line:"─",pointer:">"};const o=process.platform==="win32"?i:r;t.exports=o},8665:(t,r,i)=>{"use strict";t.exports={action:i(2750),clear:i(2699),style:i(3033),strip:i(404),figures:i(775),lines:i(1265),wrap:i(9621),entriesToDisplay:i(9019)}},1265:(t,r,i)=>{"use strict";const o=i(404);t.exports=function(t,r){let i=String(o(t)||"").split(/\r?\n/);if(!r)return i.length;return i.map((t=>Math.ceil(t.length/r))).reduce(((t,r)=>t+r))}},404:t=>{"use strict";t.exports=t=>{const r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|");const i=new RegExp(r,"g");return typeof t==="string"?t.replace(i,""):t}},3033:(t,r,i)=>{"use strict";const o=i(5178);const a=i(775);const u=Object.freeze({password:{scale:1,render:t=>"*".repeat(t.length)},emoji:{scale:2,render:t=>"😃".repeat(t.length)},invisible:{scale:0,render:t=>""},default:{scale:1,render:t=>`${t}`}});const render=t=>u[t]||u.default;const l=Object.freeze({aborted:o.red(a.cross),done:o.green(a.tick),exited:o.yellow(a.cross),default:o.cyan("?")});const symbol=(t,r,i)=>r?l.aborted:i?l.exited:t?l.done:l.default;const delimiter=t=>o.gray(t?a.ellipsis:a.pointerSmall);const item=(t,r)=>o.gray(t?r?a.pointerSmall:"+":a.line);t.exports={styles:u,render:render,symbols:l,symbol:symbol,delimiter:delimiter,item:item}},9621:t=>{"use strict";t.exports=(t,r={})=>{const i=Number.isSafeInteger(parseInt(r.margin))?new Array(parseInt(r.margin)).fill(" ").join(""):r.margin||"";const o=r.width;return(t||"").split(/\r?\n/g).map((t=>t.split(/\s+/g).reduce(((t,r)=>{if(r.length+i.length>=o||t[t.length-1].length+r.length+1<o)t[t.length-1]+=` ${r}`;else t.push(`${i}${r}`);return t}),[i]).join("\n"))).join("\n")}},1409:(t,r,i)=>{var o=Object.create;var a=Object.defineProperty;var u=Object.defineProperties;var l=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyDescriptors;var h=Object.getOwnPropertyNames;var d=Object.getOwnPropertySymbols;var p=Object.getPrototypeOf;var g=Object.prototype.hasOwnProperty;var m=Object.prototype.propertyIsEnumerable;var __defNormalProp=(t,r,i)=>r in t?a(t,r,{enumerable:true,configurable:true,writable:true,value:i}):t[r]=i;var __spreadValues=(t,r)=>{for(var i in r||(r={}))if(g.call(r,i))__defNormalProp(t,i,r[i]);if(d)for(var i of d(r)){if(m.call(r,i))__defNormalProp(t,i,r[i])}return t};var __spreadProps=(t,r)=>u(t,c(r));var __markAsModule=t=>a(t,"__esModule",{value:true});var __esm=(t,r)=>function __init(){return t&&(r=(0,t[h(t)[0]])(t=0)),r};var __commonJS=(t,r)=>function __require(){return r||(0,t[h(t)[0]])((r={exports:{}}).exports,r),r.exports};var __export=(t,r)=>{for(var i in r)a(t,i,{get:r[i],enumerable:true})};var __reExport=(t,r,i,o)=>{if(r&&typeof r==="object"||typeof r==="function"){for(let u of h(r))if(!g.call(t,u)&&(i||u!=="default"))a(t,u,{get:()=>r[u],enumerable:!(o=l(r,u))||o.enumerable})}return t};var __toESM=(t,r)=>__reExport(__markAsModule(a(t!=null?o(p(t)):{},"default",!r&&t&&t.__esModule?{get:()=>t.default,enumerable:true}:{value:t,enumerable:true})),t);var b=(t=>(r,i)=>t&&t.get(r)||(i=__reExport(__markAsModule({}),r,1),t&&t.set(r,i),i))(typeof WeakMap!=="undefined"?new WeakMap:0);var __async=(t,r,i)=>new Promise(((o,a)=>{var fulfilled=t=>{try{step(i.next(t))}catch(t){a(t)}};var rejected=t=>{try{step(i.throw(t))}catch(t){a(t)}};var step=t=>t.done?o(t.value):Promise.resolve(t.value).then(fulfilled,rejected);step((i=i.apply(t,r)).next())}));var v;var y=__esm({"src/lib/errors/git-error.ts"(){v=class extends Error{constructor(t,r){super(r);this.task=t;Object.setPrototypeOf(this,new.target.prototype)}}}});var w;var k=__esm({"src/lib/errors/git-response-error.ts"(){y();w=class extends v{constructor(t,r){super(void 0,r||String(t));this.git=t}}}});function pathspec(...t){const r=new String(t);T.set(r,t);return r}function isPathSpec(t){return t instanceof String&&T.has(t)}function toPaths(t){return T.get(t)||[]}var T;var x=__esm({"src/lib/args/pathspec.ts"(){T=new WeakMap}});var S;var C=__esm({"src/lib/errors/git-construct-error.ts"(){y();S=class extends v{constructor(t,r){super(void 0,r);this.config=t}}}});var O;var _=__esm({"src/lib/errors/git-plugin-error.ts"(){y();O=class extends v{constructor(t,r,i){super(t,i);this.task=t;this.plugin=r;Object.setPrototypeOf(this,new.target.prototype)}}}});var P;var M=__esm({"src/lib/errors/task-configuration-error.ts"(){y();P=class extends v{constructor(t){super(void 0,t)}}}});function asFunction(t){return typeof t==="function"?t:R}function isUserFunction(t){return typeof t==="function"&&t!==R}function splitOn(t,r){const i=t.indexOf(r);if(i<=0){return[t,""]}return[t.substr(0,i),t.substr(i+1)]}function first(t,r=0){return isArrayLike(t)&&t.length>r?t[r]:void 0}function last(t,r=0){if(isArrayLike(t)&&t.length>r){return t[t.length-1-r]}}function isArrayLike(t){return!!(t&&typeof t.length==="number")}function toLinesWithContent(t="",r=true,i="\n"){return t.split(i).reduce(((t,i)=>{const o=r?i.trim():i;if(o){t.push(o)}return t}),[])}function forEachLineWithContent(t,r){return toLinesWithContent(t,true).map((t=>r(t)))}function folderExists(t){return(0,E.exists)(t,E.FOLDER)}function append(t,r){if(Array.isArray(t)){if(!t.includes(r)){t.push(r)}}else{t.add(r)}return r}function including(t,r){if(Array.isArray(t)&&!t.includes(r)){t.push(r)}return t}function remove(t,r){if(Array.isArray(t)){const i=t.indexOf(r);if(i>=0){t.splice(i,1)}}else{t.delete(r)}return r}function asArray(t){return Array.isArray(t)?t:[t]}function asStringArray(t){return asArray(t).map(String)}function asNumber(t,r=0){if(t==null){return r}const i=parseInt(t,10);return isNaN(i)?r:i}function prefixedArray(t,r){const i=[];for(let o=0,a=t.length;o<a;o++){i.push(r,t[o])}return i}function bufferToString(t){return(Array.isArray(t)?Buffer.concat(t):t).toString("utf-8")}function pick(t,r){return Object.assign({},...r.map((r=>r in t?{[r]:t[r]}:{})))}function delay(t=0){return new Promise((r=>setTimeout(r,t)))}var E,A,R,D;var $=__esm({"src/lib/utils/util.ts"(){E=i(5197);A="\0";R=()=>{};D=Object.prototype.toString.call.bind(Object.prototype.toString)}});function filterType(t,r,i){if(r(t)){return t}return arguments.length>2?i:void 0}function filterPrimitives(t,r){const i=isPathSpec(t)?"string":typeof t;return/number|string|boolean/.test(i)&&(!r||!r.includes(i))}function filterPlainObject(t){return!!t&&D(t)==="[object Object]"}function filterFunction(t){return typeof t==="function"}var I,j,L,G,N;var B=__esm({"src/lib/utils/argument-filters.ts"(){$();x();I=t=>Array.isArray(t);j=t=>typeof t==="string";L=t=>Array.isArray(t)&&t.every(j);G=t=>j(t)||Array.isArray(t)&&t.every(j);N=t=>{if(t==null||"number|boolean|function".includes(typeof t)){return false}return Array.isArray(t)||typeof t==="string"||typeof t.length==="number"}}});var U;var H=__esm({"src/lib/utils/exit-codes.ts"(){U=(t=>{t[t["SUCCESS"]=0]="SUCCESS";t[t["ERROR"]=1]="ERROR";t[t["NOT_FOUND"]=-2]="NOT_FOUND";t[t["UNCLEAN"]=128]="UNCLEAN";return t})(U||{})}});var V;var Y=__esm({"src/lib/utils/git-output-streams.ts"(){V=class{constructor(t,r){this.stdOut=t;this.stdErr=r}asStrings(){return new V(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}});var q,W;var z=__esm({"src/lib/utils/line-parser.ts"(){q=class{constructor(t,r){this.matches=[];this.parse=(t,r)=>{this.resetMatches();if(!this._regExp.every(((r,i)=>this.addMatch(r,i,t(i))))){return false}return this.useMatches(r,this.prepareMatches())!==false};this._regExp=Array.isArray(t)?t:[t];if(r){this.useMatches=r}}useMatches(t,r){throw new Error(`LineParser:useMatches not implemented`)}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(t,r,i){const o=i&&t.exec(i);if(o){this.pushMatch(r,o)}return!!o}pushMatch(t,r){this.matches.push(...r.slice(1))}};W=class extends q{addMatch(t,r,i){return/^remote:\s/.test(String(i))&&super.addMatch(t,r,i)}pushMatch(t,r){if(t>0||r.length>1){super.pushMatch(t,r)}}}}});function createInstanceConfig(...t){const r=process.cwd();const i=Object.assign(__spreadValues({baseDir:r},J),...t.filter((t=>typeof t==="object"&&t)));i.baseDir=i.baseDir||r;i.trimmed=i.trimmed===true;return i}var J;var K=__esm({"src/lib/utils/simple-git-options.ts"(){J={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:false}}});function appendTaskOptions(t,r=[]){if(!filterPlainObject(t)){return r}return Object.keys(t).reduce(((r,i)=>{const o=t[i];if(isPathSpec(o)){r.push(o)}else if(filterPrimitives(o,["boolean"])){r.push(i+"="+o)}else{r.push(i)}return r}),r)}function getTrailingOptions(t,r=0,i=false){const o=[];for(let i=0,a=r<0?t.length:r;i<a;i++){if("string|number".includes(typeof t[i])){o.push(String(t[i]))}}appendTaskOptions(trailingOptionsArgument(t),o);if(!i){o.push(...trailingArrayArgument(t))}return o}function trailingArrayArgument(t){const r=typeof last(t)==="function";return filterType(last(t,r?1:0),I,[])}function trailingOptionsArgument(t){const r=filterFunction(last(t));return filterType(last(t,r?1:0),filterPlainObject)}function trailingFunctionArgument(t,r=true){const i=asFunction(last(t));return r||isUserFunction(i)?i:void 0}var Q=__esm({"src/lib/utils/task-options.ts"(){B();$();x()}});function callTaskParser(t,r){return t(r.stdOut,r.stdErr)}function parseStringResponse(t,r,i,o=true){asArray(i).forEach((i=>{for(let a=toLinesWithContent(i,o),u=0,l=a.length;u<l;u++){const line=(t=0)=>{if(u+t>=l){return}return a[u+t]};r.some((({parse:r})=>r(line,t)))}}));return t}var Z=__esm({"src/lib/utils/task-parser.ts"(){$()}});var X={};__export(X,{ExitCodes:()=>U,GitOutputStreams:()=>V,LineParser:()=>q,NOOP:()=>R,NULL:()=>A,RemoteLineParser:()=>W,append:()=>append,appendTaskOptions:()=>appendTaskOptions,asArray:()=>asArray,asFunction:()=>asFunction,asNumber:()=>asNumber,asStringArray:()=>asStringArray,bufferToString:()=>bufferToString,callTaskParser:()=>callTaskParser,createInstanceConfig:()=>createInstanceConfig,delay:()=>delay,filterArray:()=>I,filterFunction:()=>filterFunction,filterHasLength:()=>N,filterPlainObject:()=>filterPlainObject,filterPrimitives:()=>filterPrimitives,filterString:()=>j,filterStringArray:()=>L,filterStringOrStringArray:()=>G,filterType:()=>filterType,first:()=>first,folderExists:()=>folderExists,forEachLineWithContent:()=>forEachLineWithContent,getTrailingOptions:()=>getTrailingOptions,including:()=>including,isUserFunction:()=>isUserFunction,last:()=>last,objectToString:()=>D,parseStringResponse:()=>parseStringResponse,pick:()=>pick,prefixedArray:()=>prefixedArray,remove:()=>remove,splitOn:()=>splitOn,toLinesWithContent:()=>toLinesWithContent,trailingFunctionArgument:()=>trailingFunctionArgument,trailingOptionsArgument:()=>trailingOptionsArgument});var tt=__esm({"src/lib/utils/index.ts"(){B();H();Y();z();K();Q();Z();$()}});var et={};__export(et,{CheckRepoActions:()=>rt,checkIsBareRepoTask:()=>checkIsBareRepoTask,checkIsRepoRootTask:()=>checkIsRepoRootTask,checkIsRepoTask:()=>checkIsRepoTask});function checkIsRepoTask(t){switch(t){case"bare":return checkIsBareRepoTask();case"root":return checkIsRepoRootTask()}const r=["rev-parse","--is-inside-work-tree"];return{commands:r,format:"utf-8",onError:st,parser:it}}function checkIsRepoRootTask(){const t=["rev-parse","--git-dir"];return{commands:t,format:"utf-8",onError:st,parser(t){return/^\.(git)?$/.test(t.trim())}}}function checkIsBareRepoTask(){const t=["rev-parse","--is-bare-repository"];return{commands:t,format:"utf-8",onError:st,parser:it}}function isNotRepoMessage(t){return/(Not a git repository|Kein Git-Repository)/i.test(String(t))}var rt,st,it;var nt=__esm({"src/lib/tasks/check-is-repo.ts"(){tt();rt=(t=>{t["BARE"]="bare";t["IN_TREE"]="tree";t["IS_REPO_ROOT"]="root";return t})(rt||{});st=({exitCode:t},r,i,o)=>{if(t===128&&isNotRepoMessage(r)){return i(Buffer.from("false"))}o(r)};it=t=>t.trim()==="true"}});function cleanSummaryParser(t,r){const i=new ot(t);const o=t?ut:at;toLinesWithContent(r).forEach((t=>{const r=t.replace(o,"");i.paths.push(r);(lt.test(r)?i.folders:i.files).push(r)}));return i}var ot,at,ut,lt;var ct=__esm({"src/lib/responses/CleanSummary.ts"(){tt();ot=class{constructor(t){this.dryRun=t;this.paths=[];this.files=[];this.folders=[]}};at=/^[a-z]+\s*/i;ut=/^[a-z]+\s+[a-z]+\s*/i;lt=/\/$/}});var ht={};__export(ht,{EMPTY_COMMANDS:()=>dt,adhocExecTask:()=>adhocExecTask,configurationErrorTask:()=>configurationErrorTask,isBufferTask:()=>isBufferTask,isEmptyTask:()=>isEmptyTask,straightThroughBufferTask:()=>straightThroughBufferTask,straightThroughStringTask:()=>straightThroughStringTask});function adhocExecTask(t){return{commands:dt,format:"empty",parser:t}}function configurationErrorTask(t){return{commands:dt,format:"empty",parser(){throw typeof t==="string"?new P(t):t}}}function straightThroughStringTask(t,r=false){return{commands:t,format:"utf-8",parser(t){return r?String(t).trim():t}}}function straightThroughBufferTask(t){return{commands:t,format:"buffer",parser(t){return t}}}function isBufferTask(t){return t.format==="buffer"}function isEmptyTask(t){return t.format==="empty"||!t.commands.length}var dt;var pt=__esm({"src/lib/tasks/task.ts"(){M();dt=[]}});var ft={};__export(ft,{CONFIG_ERROR_INTERACTIVE_MODE:()=>gt,CONFIG_ERROR_MODE_REQUIRED:()=>mt,CONFIG_ERROR_UNKNOWN_OPTION:()=>bt,CleanOptions:()=>vt,cleanTask:()=>cleanTask,cleanWithOptionsTask:()=>cleanWithOptionsTask,isCleanOptionsArray:()=>isCleanOptionsArray});function cleanWithOptionsTask(t,r){const{cleanMode:i,options:o,valid:a}=getCleanOptions(t);if(!i){return configurationErrorTask(mt)}if(!a.options){return configurationErrorTask(bt+JSON.stringify(t))}o.push(...r);if(o.some(isInteractiveMode)){return configurationErrorTask(gt)}return cleanTask(i,o)}function cleanTask(t,r){const i=["clean",`-${t}`,...r];return{commands:i,format:"utf-8",parser(r){return cleanSummaryParser(t==="n",r)}}}function isCleanOptionsArray(t){return Array.isArray(t)&&t.every((t=>yt.has(t)))}function getCleanOptions(t){let r;let i=[];let o={cleanMode:false,options:true};t.replace(/[^a-z]i/g,"").split("").forEach((t=>{if(isCleanMode(t)){r=t;o.cleanMode=true}else{o.options=o.options&&isKnownOption(i[i.length]=`-${t}`)}}));return{cleanMode:r,options:i,valid:o}}function isCleanMode(t){return t==="f"||t==="n"}function isKnownOption(t){return/^-[a-z]$/i.test(t)&&yt.has(t.charAt(1))}function isInteractiveMode(t){if(/^-[^\-]/.test(t)){return t.indexOf("i")>0}return t==="--interactive"}var gt,mt,bt,vt,yt;var wt=__esm({"src/lib/tasks/clean.ts"(){ct();tt();pt();gt="Git clean interactive mode is not supported";mt='Git clean mode parameter ("n" or "f") is required';bt="Git clean unknown option found in: ";vt=(t=>{t["DRY_RUN"]="n";t["FORCE"]="f";t["IGNORED_INCLUDED"]="x";t["IGNORED_ONLY"]="X";t["EXCLUDING"]="e";t["QUIET"]="q";t["RECURSIVE"]="d";return t})(vt||{});yt=new Set(["i",...asStringArray(Object.values(vt))])}});function configListParser(t){const r=new kt;for(const i of configParser(t)){r.addValue(i.file,String(i.key),i.value)}return r}function configGetParser(t,r){let i=null;const o=[];const a=new Map;for(const u of configParser(t,r)){if(u.key!==r){continue}o.push(i=u.value);if(!a.has(u.file)){a.set(u.file,[])}a.get(u.file).push(i)}return{key:r,paths:Array.from(a.keys()),scopes:a,value:i,values:o}}function configFilePath(t){return t.replace(/^(file):/,"")}function*configParser(t,r=null){const i=t.split("\0");for(let t=0,o=i.length-1;t<o;){const o=configFilePath(i[t++]);let a=i[t++];let u=r;if(a.includes("\n")){const t=splitOn(a,"\n");u=t[0];a=t[1]}yield{file:o,key:u,value:a}}}var kt;var Tt=__esm({"src/lib/responses/ConfigList.ts"(){tt();kt=class{constructor(){this.files=[];this.values=Object.create(null)}get all(){if(!this._all){this._all=this.files.reduce(((t,r)=>Object.assign(t,this.values[r])),{})}return this._all}addFile(t){if(!(t in this.values)){const r=last(this.files);this.values[t]=r?Object.create(this.values[r]):{};this.files.push(t)}return this.values[t]}addValue(t,r,i){const o=this.addFile(t);if(!o.hasOwnProperty(r)){o[r]=i}else if(Array.isArray(o[r])){o[r].push(i)}else{o[r]=[o[r],i]}this._all=void 0}}}});function asConfigScope(t,r){if(typeof t==="string"&&xt.hasOwnProperty(t)){return t}return r}function addConfigTask(t,r,i,o){const a=["config",`--${o}`];if(i){a.push("--add")}a.push(t,r);return{commands:a,format:"utf-8",parser(t){return t}}}function getConfigTask(t,r){const i=["config","--null","--show-origin","--get-all",t];if(r){i.splice(1,0,`--${r}`)}return{commands:i,format:"utf-8",parser(r){return configGetParser(r,t)}}}function listConfigTask(t){const r=["config","--list","--show-origin","--null"];if(t){r.push(`--${t}`)}return{commands:r,format:"utf-8",parser(t){return configListParser(t)}}}function config_default(){return{addConfig(t,r,...i){return this._runTask(addConfigTask(t,r,i[0]===true,asConfigScope(i[1],"local")),trailingFunctionArgument(arguments))},getConfig(t,r){return this._runTask(getConfigTask(t,asConfigScope(r,void 0)),trailingFunctionArgument(arguments))},listConfig(...t){return this._runTask(listConfigTask(asConfigScope(t[0],void 0)),trailingFunctionArgument(arguments))}}}var xt;var St=__esm({"src/lib/tasks/config.ts"(){Tt();tt();xt=(t=>{t["system"]="system";t["global"]="global";t["local"]="local";t["worktree"]="worktree";return t})(xt||{})}});function grepQueryBuilder(...t){return(new Pt).param(...t)}function parseGrep(t){const r=new Set;const i={};forEachLineWithContent(t,(t=>{const[o,a,u]=t.split(A);r.add(o);(i[o]=i[o]||[]).push({line:asNumber(a),path:o,preview:u})}));return{paths:r,results:i}}function grep_default(){return{grep(t){const r=trailingFunctionArgument(arguments);const i=getTrailingOptions(arguments);for(const t of Ct){if(i.includes(t)){return this._runTask(configurationErrorTask(`git.grep: use of "${t}" is not supported.`),r)}}if(typeof t==="string"){t=grepQueryBuilder().param(t)}const o=["grep","--null","-n","--full-name",...i,...t];return this._runTask({commands:o,format:"utf-8",parser(t){return parseGrep(t)}},r)}}}var Ct,Ot,_t,Pt;var Mt=__esm({"src/lib/tasks/grep.ts"(){tt();pt();Ct=["-h"];Ot=Symbol("grepQuery");Pt=class{constructor(){this[_t]=[]}*[(_t=Ot,Symbol.iterator)](){for(const t of this[Ot]){yield t}}and(...t){t.length&&this[Ot].push("--and","(",...prefixedArray(t,"-e"),")");return this}param(...t){this[Ot].push(...prefixedArray(t,"-e"));return this}}}});var Et={};__export(Et,{ResetMode:()=>At,getResetMode:()=>getResetMode,resetTask:()=>resetTask});function resetTask(t,r){const i=["reset"];if(isValidResetMode(t)){i.push(`--${t}`)}i.push(...r);return straightThroughStringTask(i)}function getResetMode(t){if(isValidResetMode(t)){return t}switch(typeof t){case"string":case"undefined":return"soft"}return}function isValidResetMode(t){return Rt.includes(t)}var At,Rt;var Dt=__esm({"src/lib/tasks/reset.ts"(){pt();At=(t=>{t["MIXED"]="mixed";t["SOFT"]="soft";t["HARD"]="hard";t["MERGE"]="merge";t["KEEP"]="keep";return t})(At||{});Rt=Array.from(Object.values(At))}});var Ft={};__export(Ft,{CheckRepoActions:()=>rt,CleanOptions:()=>vt,GitConfigScope:()=>xt,GitConstructError:()=>S,GitError:()=>v,GitPluginError:()=>O,GitResponseError:()=>w,ResetMode:()=>At,TaskConfigurationError:()=>P,grepQueryBuilder:()=>grepQueryBuilder,pathspec:()=>pathspec});var $t=__esm({"src/lib/api.ts"(){x();C();y();_();k();M();nt();wt();St();Mt();Dt()}});function abortPlugin(t){if(!t){return}const r={type:"spawn.after",action(r,i){function kill(){i.kill(new O(void 0,"abort","Abort signal received"))}t.addEventListener("abort",kill);i.spawned.on("close",(()=>t.removeEventListener("abort",kill)))}};const i={type:"spawn.before",action(r,i){if(t.aborted){i.kill(new O(void 0,"abort","Abort already signaled"))}}};return[i,r]}var It=__esm({"src/lib/plugins/abort-plugin.ts"(){_()}});function isConfigSwitch(t){return typeof t==="string"&&t.trim().toLowerCase()==="-c"}function preventProtocolOverride(t,r){if(!isConfigSwitch(t)){return}if(!/^\s*protocol(.[a-z]+)?.allow/.test(r)){return}throw new O(void 0,"unsafe","Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol")}function preventUploadPack(t,r){if(/^\s*--(upload|receive)-pack/.test(t)){throw new O(void 0,"unsafe",`Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack`)}if(r==="clone"&&/^\s*-u\b/.test(t)){throw new O(void 0,"unsafe",`Use of clone with option -u is not permitted without enabling allowUnsafePack`)}if(r==="push"&&/^\s*--exec\b/.test(t)){throw new O(void 0,"unsafe",`Use of push with option --exec is not permitted without enabling allowUnsafePack`)}}function blockUnsafeOperationsPlugin({allowUnsafeProtocolOverride:t=false,allowUnsafePack:r=false}={}){return{type:"spawn.args",action(i,o){i.forEach(((a,u)=>{const l=u<i.length?i[u+1]:"";t||preventProtocolOverride(a,l);r||preventUploadPack(a,o.method)}));return i}}}var jt=__esm({"src/lib/plugins/block-unsafe-operations-plugin.ts"(){_()}});function commandConfigPrefixingPlugin(t){const r=prefixedArray(t,"-c");return{type:"spawn.args",action(t){return[...r,...t]}}}var Lt=__esm({"src/lib/plugins/command-config-prefixing-plugin.ts"(){tt()}});function completionDetectionPlugin({onClose:t=true,onExit:r=50}={}){function createEvents(){let i=-1;const o={close:(0,Gt.deferred)(),closeTimeout:(0,Gt.deferred)(),exit:(0,Gt.deferred)(),exitTimeout:(0,Gt.deferred)()};const a=Promise.race([t===false?Nt:o.closeTimeout.promise,r===false?Nt:o.exitTimeout.promise]);configureTimeout(t,o.close,o.closeTimeout);configureTimeout(r,o.exit,o.exitTimeout);return{close(t){i=t;o.close.done()},exit(t){i=t;o.exit.done()},get exitCode(){return i},result:a}}function configureTimeout(t,r,i){if(t===false){return}(t===true?r.promise:r.promise.then((()=>delay(t)))).then(i.done)}return{type:"spawn.after",action(t,r){return __async(this,arguments,(function*(t,{spawned:r,close:i}){var o,a;const u=createEvents();let l=true;let quickClose=()=>void(l=false);(o=r.stdout)==null?void 0:o.on("data",quickClose);(a=r.stderr)==null?void 0:a.on("data",quickClose);r.on("error",quickClose);r.on("close",(t=>u.close(t)));r.on("exit",(t=>u.exit(t)));try{yield u.result;if(l){yield delay(50)}i(u.exitCode)}catch(t){i(u.exitCode,t)}}))}}}var Gt,Nt;var Bt=__esm({"src/lib/plugins/completion-detection.plugin.ts"(){Gt=i(4710);tt();Nt=(0,Gt.deferred)().promise}});function isTaskError(t){return!!(t.exitCode&&t.stdErr.length)}function getErrorMessage(t){return Buffer.concat([...t.stdOut,...t.stdErr])}function errorDetectionHandler(t=false,r=isTaskError,i=getErrorMessage){return(o,a)=>{if(!t&&o||!r(a)){return o}return i(a)}}function errorDetectionPlugin(t){return{type:"task.error",action(r,i){const o=t(r.error,{stdErr:i.stdErr,stdOut:i.stdOut,exitCode:i.exitCode});if(Buffer.isBuffer(o)){return{error:new v(void 0,o.toString("utf-8"))}}return{error:o}}}}var Ut=__esm({"src/lib/plugins/error-detection.plugin.ts"(){y()}});var Ht;var Vt=__esm({"src/lib/plugins/plugin-store.ts"(){tt();Ht=class{constructor(){this.plugins=new Set}add(t){const r=[];asArray(t).forEach((t=>t&&this.plugins.add(append(r,t))));return()=>{r.forEach((t=>this.plugins.delete(t)))}}exec(t,r,i){let o=r;const a=Object.freeze(Object.create(i));for(const r of this.plugins){if(r.type===t){o=r.action(o,a)}}return o}}}});function progressMonitorPlugin(t){const r="--progress";const i=["checkout","clone","fetch","pull","push"];const o={type:"spawn.after",action(i,o){var a;if(!o.commands.includes(r)){return}(a=o.spawned.stderr)==null?void 0:a.on("data",(r=>{const i=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(r.toString("utf8"));if(!i){return}t({method:o.method,stage:progressEventStage(i[1]),progress:asNumber(i[2]),processed:asNumber(i[3]),total:asNumber(i[4])})}))}};const a={type:"spawn.args",action(t,o){if(!i.includes(o.method)){return t}return including(t,r)}};return[a,o]}function progressEventStage(t){return String(t.toLowerCase().split(" ",1))||"unknown"}var Yt=__esm({"src/lib/plugins/progress-monitor-plugin.ts"(){tt()}});var qt=__esm({"src/lib/plugins/simple-git-plugin.ts"(){}});function spawnOptionsPlugin(t){const r=pick(t,["uid","gid"]);return{type:"spawn.options",action(t){return __spreadValues(__spreadValues({},r),t)}}}var Wt=__esm({"src/lib/plugins/spawn-options-plugin.ts"(){tt()}});function timeoutPlugin({block:t,stdErr:r=true,stdOut:i=true}){if(t>0){return{type:"spawn.after",action(o,a){var u,l;let c;function wait(){c&&clearTimeout(c);c=setTimeout(kill,t)}function stop(){var t,r;(t=a.spawned.stdout)==null?void 0:t.off("data",wait);(r=a.spawned.stderr)==null?void 0:r.off("data",wait);a.spawned.off("exit",stop);a.spawned.off("close",stop);c&&clearTimeout(c)}function kill(){stop();a.kill(new O(void 0,"timeout",`block timeout reached`))}i&&((u=a.spawned.stdout)==null?void 0:u.on("data",wait));r&&((l=a.spawned.stderr)==null?void 0:l.on("data",wait));a.spawned.on("exit",stop);a.spawned.on("close",stop);wait()}}}}var zt=__esm({"src/lib/plugins/timout-plugin.ts"(){_()}});var Jt=__esm({"src/lib/plugins/index.ts"(){It();jt();Lt();Bt();Ut();Vt();Yt();qt();Wt();zt()}});function suffixPathsPlugin(){return{type:"spawn.args",action(t){const r=[];let i;function append2(t){(i=i||[]).push(...t)}for(let i=0;i<t.length;i++){const o=t[i];if(isPathSpec(o)){append2(toPaths(o));continue}if(o==="--"){append2(t.slice(i+1).flatMap((t=>isPathSpec(t)&&toPaths(t)||t)));break}r.push(o)}return!i?r:[...r,"--",...i.map(String)]}}}var Kt=__esm({"src/lib/plugins/suffix-paths.plugin.ts"(){x()}});function createLog(){return(0,Qt.default)("simple-git")}function prefixedLogger(t,r,i){if(!r||!String(r).replace(/\s*/,"")){return!i?t:(r,...o)=>{t(r,...o);i(r,...o)}}return(o,...a)=>{t(`%s ${o}`,r,...a);if(i){i(o,...a)}}}function childLoggerName(t,r,{namespace:i}){if(typeof t==="string"){return t}const o=r&&r.namespace||"";if(o.startsWith(i)){return o.substr(i.length+1)}return o||i}function createLogger(t,r,i,o=createLog()){const a=t&&`[${t}]`||"";const u=[];const l=typeof r==="string"?o.extend(r):r;const c=childLoggerName(filterType(r,j),l,o);return step(i);function sibling(r,i){return append(u,createLogger(t,c.replace(/^[^:]+/,r),i,o))}function step(r){const i=r&&`[${r}]`||"";const u=l&&prefixedLogger(l,i)||R;const c=prefixedLogger(o,`${a} ${i}`,u);return Object.assign(l?u:c,{label:t,sibling:sibling,info:c,step:step})}}var Qt;var Zt=__esm({"src/lib/git-logger.ts"(){Qt=__toESM(i(783));tt();Qt.default.formatters.L=t=>String(N(t)?t.length:"-");Qt.default.formatters.B=t=>{if(Buffer.isBuffer(t)){return t.toString("utf8")}return D(t)}}});var Xt,te;var ee=__esm({"src/lib/runners/tasks-pending-queue.ts"(){y();Zt();Xt=class{constructor(t="GitExecutor"){this.logLabel=t;this._queue=new Map}withProgress(t){return this._queue.get(t)}createProgress(t){const r=Xt.getName(t.commands[0]);const i=createLogger(this.logLabel,r);return{task:t,logger:i,name:r}}push(t){const r=this.createProgress(t);r.logger("Adding task to the queue, commands = %o",t.commands);this._queue.set(t,r);return r}fatal(t){for(const[r,{logger:i}]of Array.from(this._queue.entries())){if(r===t.task){i.info(`Failed %o`,t);i(`Fatal exception, any as-yet un-started tasks run through this executor will not be attempted`)}else{i.info(`A fatal exception occurred in a previous task, the queue has been purged: %o`,t.message)}this.complete(r)}if(this._queue.size!==0){throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}}complete(t){const r=this.withProgress(t);if(r){this._queue.delete(t)}}attempt(t){const r=this.withProgress(t);if(!r){throw new v(void 0,"TasksPendingQueue: attempt called for an unknown task")}r.logger("Starting task");return r}static getName(t="empty"){return`task:${t}:${++Xt.counter}`}};te=Xt;te.counter=0}});function pluginContext(t,r){return{method:first(t.commands)||"",commands:r}}function onErrorReceived(t,r){return i=>{r(`[ERROR] child process exception %o`,i);t.push(Buffer.from(String(i.stack),"ascii"))}}function onDataReceived(t,r,i,o){return a=>{i(`%s received %L bytes`,r,a);o(`%B`,a);t.push(a)}}var re,se;var ie=__esm({"src/lib/runners/git-executor-chain.ts"(){re=i(2081);y();pt();tt();ee();se=class{constructor(t,r,i){this._executor=t;this._scheduler=r;this._plugins=i;this._chain=Promise.resolve();this._queue=new te}get binary(){return this._executor.binary}get cwd(){return this._cwd||this._executor.cwd}set cwd(t){this._cwd=t}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(t){this._queue.push(t);return this._chain=this._chain.then((()=>this.attemptTask(t)))}attemptTask(t){return __async(this,null,(function*(){const r=yield this._scheduler.next();const onQueueComplete=()=>this._queue.complete(t);try{const{logger:i}=this._queue.attempt(t);return yield isEmptyTask(t)?this.attemptEmptyTask(t,i):this.attemptRemoteTask(t,i)}catch(r){throw this.onFatalException(t,r)}finally{onQueueComplete();r()}}))}onFatalException(t,r){const i=r instanceof v?Object.assign(r,{task:t}):new v(t,r&&String(r));this._chain=Promise.resolve();this._queue.fatal(i);return i}attemptRemoteTask(t,r){return __async(this,null,(function*(){const i=this._plugins.exec("spawn.args",[...t.commands],pluginContext(t,t.commands));const o=yield this.gitResponse(t,this.binary,i,this.outputHandler,r.step("SPAWN"));const a=yield this.handleTaskData(t,i,o,r.step("HANDLE"));r(`passing response to task's parser as a %s`,t.format);if(isBufferTask(t)){return callTaskParser(t.parser,a)}return callTaskParser(t.parser,a.asStrings())}))}attemptEmptyTask(t,r){return __async(this,null,(function*(){r(`empty task bypassing child process to call to task's parser`);return t.parser(this)}))}handleTaskData(t,r,i,o){const{exitCode:a,rejection:u,stdOut:l,stdErr:c}=i;return new Promise(((h,d)=>{o(`Preparing to handle process response exitCode=%d stdOut=`,a);const{error:p}=this._plugins.exec("task.error",{error:u},__spreadValues(__spreadValues({},pluginContext(t,r)),i));if(p&&t.onError){o.info(`exitCode=%s handling with custom error handler`);return t.onError(i,p,(t=>{o.info(`custom error handler treated as success`);o(`custom error returned a %s`,D(t));h(new V(Array.isArray(t)?Buffer.concat(t):t,Buffer.concat(c)))}),d)}if(p){o.info(`handling as error: exitCode=%s stdErr=%s rejection=%o`,a,c.length,u);return d(p)}o.info(`retrieving task output complete`);h(new V(Buffer.concat(l),Buffer.concat(c)))}))}gitResponse(t,r,i,o,a){return __async(this,null,(function*(){const u=a.sibling("output");const l=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:true},pluginContext(t,t.commands));return new Promise((c=>{const h=[];const d=[];a.info(`%s %o`,r,i);a("%O",l);let p=this._beforeSpawn(t,i);if(p){return c({stdOut:h,stdErr:d,exitCode:9901,rejection:p})}this._plugins.exec("spawn.before",void 0,__spreadProps(__spreadValues({},pluginContext(t,i)),{kill(t){p=t||p}}));const g=(0,re.spawn)(r,i,l);g.stdout.on("data",onDataReceived(h,"stdOut",a,u.step("stdOut")));g.stderr.on("data",onDataReceived(d,"stdErr",a,u.step("stdErr")));g.on("error",onErrorReceived(d,a));if(o){a(`Passing child process stdOut/stdErr to custom outputHandler`);o(r,g.stdout,g.stderr,[...i])}this._plugins.exec("spawn.after",void 0,__spreadProps(__spreadValues({},pluginContext(t,i)),{spawned:g,close(t,r){c({stdOut:h,stdErr:d,exitCode:t,rejection:p||r})},kill(t){if(g.killed){return}p=t;g.kill("SIGINT")}}))}))}))}_beforeSpawn(t,r){let i;this._plugins.exec("spawn.before",void 0,__spreadProps(__spreadValues({},pluginContext(t,r)),{kill(t){i=t||i}}));return i}}}});var ne={};__export(ne,{GitExecutor:()=>oe});var oe;var ae=__esm({"src/lib/runners/git-executor.ts"(){ie();oe=class{constructor(t="git",r,i,o){this.binary=t;this.cwd=r;this._scheduler=i;this._plugins=o;this._chain=new se(this,this._scheduler,this._plugins)}chain(){return new se(this,this._scheduler,this._plugins)}push(t){return this._chain.push(t)}}}});function taskCallback(t,r,i=R){const onSuccess=t=>{i(null,t)};const onError2=r=>{if((r==null?void 0:r.task)===t){i(r instanceof w?addDeprecationNoticeToError(r):r,void 0)}};r.then(onSuccess,onError2)}function addDeprecationNoticeToError(t){let log=t=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${t} should be GitResponseError.git.${t}, this will no longer be available in version 3`);log=R};return Object.create(t,Object.getOwnPropertyNames(t.git).reduce(descriptorReducer,{}));function descriptorReducer(r,i){if(i in t){return r}r[i]={enumerable:false,configurable:false,get(){log(i);return t.git[i]}};return r}}var ue=__esm({"src/lib/task-callback.ts"(){k();tt()}});function changeWorkingDirectoryTask(t,r){return adhocExecTask((i=>{if(!folderExists(t)){throw new Error(`Git.cwd: cannot change to non-directory "${t}"`)}return(r||i).cwd=t}))}var le=__esm({"src/lib/tasks/change-working-directory.ts"(){tt();pt()}});function checkoutTask(t){const r=["checkout",...t];if(r[1]==="-b"&&r.includes("-B")){r[1]=remove(r,"-B")}return straightThroughStringTask(r)}function checkout_default(){return{checkout(){return this._runTask(checkoutTask(getTrailingOptions(arguments,1)),trailingFunctionArgument(arguments))},checkoutBranch(t,r){return this._runTask(checkoutTask(["-b",t,r,...getTrailingOptions(arguments)]),trailingFunctionArgument(arguments))},checkoutLocalBranch(t){return this._runTask(checkoutTask(["-b",t,...getTrailingOptions(arguments)]),trailingFunctionArgument(arguments))}}}var ce=__esm({"src/lib/tasks/checkout.ts"(){tt();pt()}});function parseCommitResult(t){const r={author:null,branch:"",commit:"",root:false,summary:{changes:0,insertions:0,deletions:0}};return parseStringResponse(r,he,t)}var he;var de=__esm({"src/lib/parsers/parse-commit.ts"(){tt();he=[new q(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,((t,[r,i,o])=>{t.branch=r;t.commit=o;t.root=!!i})),new q(/\s*Author:\s(.+)/i,((t,[r])=>{const i=r.split("<");const o=i.pop();if(!o||!o.includes("@")){return}t.author={email:o.substr(0,o.length-1),name:i.join("<").trim()}})),new q(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,((t,[r,i,o])=>{t.summary.changes=parseInt(r,10)||0;t.summary.insertions=parseInt(i,10)||0;t.summary.deletions=parseInt(o,10)||0})),new q(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,((t,[r,i,o])=>{t.summary.changes=parseInt(r,10)||0;const a=parseInt(i,10)||0;if(o==="-"){t.summary.deletions=a}else if(o==="+"){t.summary.insertions=a}}))]}});function commitTask(t,r,i){const o=["-c","core.abbrev=40","commit",...prefixedArray(t,"-m"),...r,...i];return{commands:o,format:"utf-8",parser:parseCommitResult}}function commit_default(){return{commit(t,...r){const i=trailingFunctionArgument(arguments);const o=rejectDeprecatedSignatures(t)||commitTask(asArray(t),asArray(filterType(r[0],G,[])),[...filterType(r[1],I,[]),...getTrailingOptions(arguments,0,true)]);return this._runTask(o,i)}};function rejectDeprecatedSignatures(t){return!G(t)&&configurationErrorTask(`git.commit: requires the commit message to be supplied as a string/string[]`)}}var pe=__esm({"src/lib/tasks/commit.ts"(){de();tt();pt()}});function hashObjectTask(t,r){const i=["hash-object",t];if(r){i.push("-w")}return straightThroughStringTask(i,true)}var fe=__esm({"src/lib/tasks/hash-object.ts"(){pt()}});function parseInit(t,r,i){const o=String(i).trim();let a;if(a=me.exec(o)){return new ge(t,r,false,a[1])}if(a=be.exec(o)){return new ge(t,r,true,a[1])}let u="";const l=o.split(" ");while(l.length){const t=l.shift();if(t==="in"){u=l.join(" ");break}}return new ge(t,r,/^re/i.test(o),u)}var ge,me,be;var ve=__esm({"src/lib/responses/InitSummary.ts"(){ge=class{constructor(t,r,i,o){this.bare=t;this.path=r;this.existing=i;this.gitDir=o}};me=/^Init.+ repository in (.+)$/;be=/^Rein.+ in (.+)$/}});function hasBareCommand(t){return t.includes(ye)}function initTask(t=false,r,i){const o=["init",...i];if(t&&!hasBareCommand(o)){o.splice(1,0,ye)}return{commands:o,format:"utf-8",parser(t){return parseInit(o.includes("--bare"),r,t)}}}var ye;var we=__esm({"src/lib/tasks/init.ts"(){ve();ye="--bare"}});function logFormatFromCommand(t){for(let r=0;r<t.length;r++){const i=ke.exec(t[r]);if(i){return`--${i[1]}`}}return""}function isLogFormat(t){return ke.test(t)}var ke;var Te=__esm({"src/lib/args/log-format.ts"(){ke=/^--(stat|numstat|name-only|name-status)(=|$)/}});var xe;var Se=__esm({"src/lib/responses/DiffSummary.ts"(){xe=class{constructor(){this.changed=0;this.deletions=0;this.insertions=0;this.files=[]}}}});function getDiffParser(t=""){const r=Me[t];return t=>parseStringResponse(new xe,r,t,false)}var Ce,Oe,_e,Pe,Me;var Ee=__esm({"src/lib/parsers/parse-diff-summary.ts"(){Te();Se();tt();Ce=[new q(/(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,((t,[r,i,o=""])=>{t.files.push({file:r.trim(),changes:asNumber(i),insertions:o.replace(/[^+]/g,"").length,deletions:o.replace(/[^-]/g,"").length,binary:false})})),new q(/(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,((t,[r,i,o])=>{t.files.push({file:r.trim(),before:asNumber(i),after:asNumber(o),binary:true})})),new q(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,((t,[r,i])=>{const o=/(\d+) i/.exec(i);const a=/(\d+) d/.exec(i);t.changed=asNumber(r);t.insertions=asNumber(o==null?void 0:o[1]);t.deletions=asNumber(a==null?void 0:a[1])}))];Oe=[new q(/(\d+)\t(\d+)\t(.+)$/,((t,[r,i,o])=>{const a=asNumber(r);const u=asNumber(i);t.changed++;t.insertions+=a;t.deletions+=u;t.files.push({file:o,changes:a+u,insertions:a,deletions:u,binary:false})})),new q(/-\t-\t(.+)$/,((t,[r])=>{t.changed++;t.files.push({file:r,after:0,before:0,binary:true})}))];_e=[new q(/(.+)$/,((t,[r])=>{t.changed++;t.files.push({file:r,changes:0,insertions:0,deletions:0,binary:false})}))];Pe=[new q(/([ACDMRTUXB])\s*(.+)$/,((t,[r,i])=>{t.changed++;t.files.push({file:i,changes:0,insertions:0,deletions:0,binary:false})}))];Me={[""]:Ce,["--stat"]:Ce,["--numstat"]:Oe,["--name-status"]:Pe,["--name-only"]:_e}}});function lineBuilder(t,r){return r.reduce(((r,i,o)=>{r[i]=t[o]||"";return r}),Object.create({diff:null}))}function createListLogSummaryParser(t=De,r=Fe,i=""){const o=getDiffParser(i);return function(i){const a=toLinesWithContent(i,true,Ae).map((function(i){const a=i.trim().split(Re);const u=lineBuilder(a[0].trim().split(t),r);if(a.length>1&&!!a[1].trim()){u.diff=o(a[1])}return u}));return{all:a,latest:a.length&&a[0]||null,total:a.length}}}var Ae,Re,De,Fe;var $e=__esm({"src/lib/parsers/parse-list-log-summary.ts"(){tt();Ee();Te();Ae="òòòòòò ";Re=" òò";De=" ò ";Fe=["hash","date","message","refs","author_name","author_email"]}});var Ie={};__export(Ie,{diffSummaryTask:()=>diffSummaryTask,validateLogFormatConfig:()=>validateLogFormatConfig});function diffSummaryTask(t){let r=logFormatFromCommand(t);const i=["diff"];if(r===""){r="--stat";i.push("--stat=4096")}i.push(...t);return validateLogFormatConfig(i)||{commands:i,format:"utf-8",parser:getDiffParser(r)}}function validateLogFormatConfig(t){const r=t.filter(isLogFormat);if(r.length>1){return configurationErrorTask(`Summary flags are mutually exclusive - pick one of ${r.join(",")}`)}if(r.length&&t.includes("-z")){return configurationErrorTask(`Summary flag ${r} parsing is not compatible with null termination option '-z'`)}}var je=__esm({"src/lib/tasks/diff.ts"(){Te();Ee();pt()}});function prettyFormat(t,r){const i=[];const o=[];Object.keys(t).forEach((r=>{i.push(r);o.push(String(t[r]))}));return[i,o.join(r)]}function userOptions(t){return Object.keys(t).reduce(((r,i)=>{if(!(i in Le)){r[i]=t[i]}return r}),{})}function parseLogOptions(t={},r=[]){const i=filterType(t.splitter,j,De);const o=!filterPrimitives(t.format)&&t.format?t.format:{hash:"%H",date:t.strictDate===false?"%ai":"%aI",message:"%s",refs:"%D",body:t.multiLine?"%B":"%b",author_name:t.mailMap!==false?"%aN":"%an",author_email:t.mailMap!==false?"%aE":"%ae"};const[a,u]=prettyFormat(o,i);const l=[];const c=[`--pretty=format:${Ae}${u}${Re}`,...r];const h=t.n||t["max-count"]||t.maxCount;if(h){c.push(`--max-count=${h}`)}if(t.from||t.to){const r=t.symmetric!==false?"...":"..";l.push(`${t.from||""}${r}${t.to||""}`)}if(j(t.file)){l.push("--follow",t.file)}appendTaskOptions(userOptions(t),c);return{fields:a,splitter:i,commands:[...c,...l]}}function logTask(t,r,i){const o=createListLogSummaryParser(t,r,logFormatFromCommand(i));return{commands:["log",...i],format:"utf-8",parser:o}}function log_default(){return{log(...t){const r=trailingFunctionArgument(arguments);const i=parseLogOptions(trailingOptionsArgument(arguments),filterType(arguments[0],I));const o=rejectDeprecatedSignatures(...t)||validateLogFormatConfig(i.commands)||createLogTask(i);return this._runTask(o,r)}};function createLogTask(t){return logTask(t.splitter,t.fields,t.commands)}function rejectDeprecatedSignatures(t,r){return j(t)&&j(r)&&configurationErrorTask(`git.log(string, string) should be replaced with git.log({ from: string, to: string })`)}}var Le;var Ge=__esm({"src/lib/tasks/log.ts"(){Te();$e();tt();pt();je();Le=(t=>{t[t["--pretty"]=0]="--pretty";t[t["max-count"]=1]="max-count";t[t["maxCount"]=2]="maxCount";t[t["n"]=3]="n";t[t["file"]=4]="file";t[t["format"]=5]="format";t[t["from"]=6]="from";t[t["to"]=7]="to";t[t["splitter"]=8]="splitter";t[t["symmetric"]=9]="symmetric";t[t["mailMap"]=10]="mailMap";t[t["multiLine"]=11]="multiLine";t[t["strictDate"]=12]="strictDate";return t})(Le||{})}});var Ne,Be;var Ue=__esm({"src/lib/responses/MergeSummary.ts"(){Ne=class{constructor(t,r=null,i){this.reason=t;this.file=r;this.meta=i}toString(){return`${this.file}:${this.reason}`}};Be=class{constructor(){this.conflicts=[];this.merges=[];this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){if(this.conflicts.length){return`CONFLICTS: ${this.conflicts.join(", ")}`}return"OK"}}}});var He,Ve;var Ye=__esm({"src/lib/responses/PullSummary.ts"(){He=class{constructor(){this.remoteMessages={all:[]};this.created=[];this.deleted=[];this.files=[];this.deletions={};this.insertions={};this.summary={changes:0,deletions:0,insertions:0}}};Ve=class{constructor(){this.remote="";this.hash={local:"",remote:""};this.branch={local:"",remote:""};this.message=""}toString(){return this.message}}}});function objectEnumerationResult(t){return t.objects=t.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function asObjectCount(t){const r=/^\s*(\d+)/.exec(t);const i=/delta (\d+)/i.exec(t);return{count:asNumber(r&&r[1]||"0"),delta:asNumber(i&&i[1]||"0")}}var qe;var We=__esm({"src/lib/parsers/parse-remote-objects.ts"(){tt();qe=[new W(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,((t,[r,i])=>{const o=r.toLowerCase();const a=objectEnumerationResult(t.remoteMessages);Object.assign(a,{[o]:asNumber(i)})})),new W(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,((t,[r,i])=>{const o=r.toLowerCase();const a=objectEnumerationResult(t.remoteMessages);Object.assign(a,{[o]:asNumber(i)})})),new W(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,((t,[r,i,o])=>{const a=objectEnumerationResult(t.remoteMessages);a.total=asObjectCount(r);a.reused=asObjectCount(i);a.packReused=asNumber(o)}))]}});function parseRemoteMessages(t,r){return parseStringResponse({remoteMessages:new Je},ze,r)}var ze,Je;var Ke=__esm({"src/lib/parsers/parse-remote-messages.ts"(){tt();We();ze=[new W(/^remote:\s*(.+)$/,((t,[r])=>{t.remoteMessages.all.push(r.trim());return false})),...qe,new W([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],((t,[r])=>{t.remoteMessages.pullRequestUrl=r})),new W([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],((t,[r,i,o])=>{t.remoteMessages.vulnerabilities={count:asNumber(r),summary:i,url:o}}))];Je=class{constructor(){this.all=[]}}}});function parsePullErrorResult(t,r){const i=parseStringResponse(new Ve,er,[t,r]);return i.message&&i}var Qe,Ze,Xe,tr,er,rr,sr;var ir=__esm({"src/lib/parsers/parse-pull.ts"(){Ye();tt();Ke();Qe=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/;Ze=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/;Xe=/^(create|delete) mode \d+ (.+)/;tr=[new q(Qe,((t,[r,i,o])=>{t.files.push(r);if(i){t.insertions[r]=i.length}if(o){t.deletions[r]=o.length}})),new q(Ze,((t,[r,,i,,o])=>{if(i!==void 0||o!==void 0){t.summary.changes=+r||0;t.summary.insertions=+i||0;t.summary.deletions=+o||0;return true}return false})),new q(Xe,((t,[r,i])=>{append(t.files,i);append(r==="create"?t.created:t.deleted,i)}))];er=[new q(/^from\s(.+)$/i,((t,[r])=>void(t.remote=r))),new q(/^fatal:\s(.+)$/,((t,[r])=>void(t.message=r))),new q(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,((t,[r,i,o,a])=>{t.branch.local=o;t.hash.local=r;t.branch.remote=a;t.hash.remote=i}))];rr=(t,r)=>parseStringResponse(new He,tr,[t,r]);sr=(t,r)=>Object.assign(new He,rr(t,r),parseRemoteMessages(t,r))}});var nr,or,ar;var ur=__esm({"src/lib/parsers/parse-merge.ts"(){Ue();tt();ir();nr=[new q(/^Auto-merging\s+(.+)$/,((t,[r])=>{t.merges.push(r)})),new q(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,((t,[r,i])=>{t.conflicts.push(new Ne(r,i))})),new q(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,((t,[r,i,o])=>{t.conflicts.push(new Ne(r,i,{deleteRef:o}))})),new q(/^CONFLICT\s+\((.+)\):/,((t,[r])=>{t.conflicts.push(new Ne(r,null))})),new q(/^Automatic merge failed;\s+(.+)$/,((t,[r])=>{t.result=r}))];or=(t,r)=>Object.assign(ar(t,r),sr(t,r));ar=t=>parseStringResponse(new Be,nr,t)}});function mergeTask(t){if(!t.length){return configurationErrorTask("Git.merge requires at least one option")}return{commands:["merge",...t],format:"utf-8",parser(t,r){const i=or(t,r);if(i.failed){throw new w(i)}return i}}}var lr=__esm({"src/lib/tasks/merge.ts"(){k();ur();pt()}});function pushResultPushedItem(t,r,i){const o=i.includes("deleted");const a=i.includes("tag")||/^refs\/tags/.test(t);const u=!i.includes("new");return{deleted:o,tag:a,branch:!a,new:!u,alreadyUpdated:u,local:t,remote:r}}var cr,hr,dr;var pr=__esm({"src/lib/parsers/parse-push.ts"(){tt();Ke();cr=[new q(/^Pushing to (.+)$/,((t,[r])=>{t.repo=r})),new q(/^updating local tracking ref '(.+)'/,((t,[r])=>{t.ref=__spreadProps(__spreadValues({},t.ref||{}),{local:r})})),new q(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,((t,[r,i,o])=>{t.pushed.push(pushResultPushedItem(r,i,o))})),new q(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,((t,[r,i,o])=>{t.branch=__spreadProps(__spreadValues({},t.branch||{}),{local:r,remote:i,remoteName:o})})),new q(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,((t,[r,i,o,a])=>{t.update={head:{local:r,remote:i},hash:{from:o,to:a}}}))];hr=(t,r)=>{const i=dr(t,r);const o=parseRemoteMessages(t,r);return __spreadValues(__spreadValues({},i),o)};dr=(t,r)=>parseStringResponse({pushed:[]},cr,[t,r])}});var fr={};__export(fr,{pushTagsTask:()=>pushTagsTask,pushTask:()=>pushTask});function pushTagsTask(t={},r){append(r,"--tags");return pushTask(t,r)}function pushTask(t={},r){const i=["push",...r];if(t.branch){i.splice(1,0,t.branch)}if(t.remote){i.splice(1,0,t.remote)}remove(i,"-v");append(i,"--verbose");append(i,"--porcelain");return{commands:i,format:"utf-8",parser:hr}}var gr=__esm({"src/lib/tasks/push.ts"(){pr();tt()}});function show_default(){return{showBuffer(){const t=["show",...getTrailingOptions(arguments,1)];if(!t.includes("--binary")){t.splice(1,0,"--binary")}return this._runTask(straightThroughBufferTask(t),trailingFunctionArgument(arguments))},show(){const t=["show",...getTrailingOptions(arguments,1)];return this._runTask(straightThroughStringTask(t),trailingFunctionArgument(arguments))}}}var mr=__esm({"src/lib/tasks/show.ts"(){tt();pt()}});var br,vr;var yr=__esm({"src/lib/responses/FileStatusSummary.ts"(){br=/^(.+) -> (.+)$/;vr=class{constructor(t,r,i){this.path=t;this.index=r;this.working_dir=i;if(r+i==="R"){const r=br.exec(t)||[null,t,t];this.from=r[1]||"";this.path=r[2]||""}}}}});function renamedFile(t){const[r,i]=t.split(A);return{from:i||r,to:r}}function parser2(t,r,i){return[`${t}${r}`,i]}function conflicts(t,...r){return r.map((r=>parser2(t,r,((t,r)=>append(t.conflicted,r)))))}function splitLine(t,r){const i=r.trim();switch(" "){case i.charAt(2):return data(i.charAt(0),i.charAt(1),i.substr(3));case i.charAt(1):return data(" ",i.charAt(0),i.substr(2));default:return}function data(r,i,o){const a=`${r}${i}`;const u=kr.get(a);if(u){u(t,o)}if(a!=="##"&&a!=="!!"){t.files.push(new vr(o.replace(/\0.+$/,""),r,i))}}}var wr,kr,Tr;var xr=__esm({"src/lib/responses/StatusSummary.ts"(){tt();yr();wr=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=false;this.isClean=()=>!this.files.length}};kr=new Map([parser2(" ","A",((t,r)=>append(t.created,r))),parser2(" ","D",((t,r)=>append(t.deleted,r))),parser2(" ","M",((t,r)=>append(t.modified,r))),parser2("A"," ",((t,r)=>append(t.created,r)&&append(t.staged,r))),parser2("A","M",((t,r)=>append(t.created,r)&&append(t.staged,r)&&append(t.modified,r))),parser2("D"," ",((t,r)=>append(t.deleted,r)&&append(t.staged,r))),parser2("M"," ",((t,r)=>append(t.modified,r)&&append(t.staged,r))),parser2("M","M",((t,r)=>append(t.modified,r)&&append(t.staged,r))),parser2("R"," ",((t,r)=>{append(t.renamed,renamedFile(r))})),parser2("R","M",((t,r)=>{const i=renamedFile(r);append(t.renamed,i);append(t.modified,i.to)})),parser2("!","!",((t,r)=>{append(t.ignored=t.ignored||[],r)})),parser2("?","?",((t,r)=>append(t.not_added,r))),...conflicts("A","A","U"),...conflicts("D","D","U"),...conflicts("U","A","D","U"),["##",(t,r)=>{const i=/ahead (\d+)/;const o=/behind (\d+)/;const a=/^(.+?(?=(?:\.{3}|\s|$)))/;const u=/\.{3}(\S*)/;const l=/\son\s([\S]+)$/;let c;c=i.exec(r);t.ahead=c&&+c[1]||0;c=o.exec(r);t.behind=c&&+c[1]||0;c=a.exec(r);t.current=c&&c[1];c=u.exec(r);t.tracking=c&&c[1];c=l.exec(r);t.current=c&&c[1]||t.current;t.detached=/\(no branch\)/.test(r)}]]);Tr=function(t){const r=t.split(A);const i=new wr;for(let t=0,o=r.length;t<o;){let o=r[t++].trim();if(!o){continue}if(o.charAt(0)==="R"){o+=A+(r[t++]||"")}splitLine(i,o)}return i}}});function statusTask(t){const r=["status","--porcelain","-b","-u","--null",...t.filter((t=>!Sr.includes(t)))];return{format:"utf-8",commands:r,parser(t){return Tr(t)}}}var Sr;var Cr=__esm({"src/lib/tasks/status.ts"(){xr();Sr=["--null","-z"]}});function versionResponse(t=0,r=0,i=0,o="",a=true){return Object.defineProperty({major:t,minor:r,patch:i,agent:o,installed:a},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:false,enumerable:false})}function notInstalledResponse(){return versionResponse(0,0,0,"",false)}function version_default(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:versionParser,onError(t,r,i,o){if(t.exitCode===-2){return i(Buffer.from(Or))}o(r)}})}}}function versionParser(t){if(t===Or){return notInstalledResponse()}return parseStringResponse(versionResponse(0,0,0,t),_r,t)}var Or,_r;var Pr=__esm({"src/lib/tasks/version.ts"(){tt();Or="installed=false";_r=[new q(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,((t,[r,i,o,a=""])=>{Object.assign(t,versionResponse(asNumber(r),asNumber(i),asNumber(o),a))})),new q(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,((t,[r,i,o,a=""])=>{Object.assign(t,versionResponse(asNumber(r),asNumber(i),o,a))}))]}});var Mr={};__export(Mr,{SimpleGitApi:()=>Er});var Er;var Ar=__esm({"src/lib/simple-git-api.ts"(){ue();le();ce();pe();St();Mt();fe();we();Ge();lr();gr();mr();Cr();pt();Pr();tt();Er=class{constructor(t){this._executor=t}_runTask(t,r){const i=this._executor.chain();const o=i.push(t);if(r){taskCallback(t,o,r)}return Object.create(this,{then:{value:o.then.bind(o)},catch:{value:o.catch.bind(o)},_executor:{value:i}})}add(t){return this._runTask(straightThroughStringTask(["add",...asArray(t)]),trailingFunctionArgument(arguments))}cwd(t){const r=trailingFunctionArgument(arguments);if(typeof t==="string"){return this._runTask(changeWorkingDirectoryTask(t,this._executor),r)}if(typeof(t==null?void 0:t.path)==="string"){return this._runTask(changeWorkingDirectoryTask(t.path,t.root&&this._executor||void 0),r)}return this._runTask(configurationErrorTask("Git.cwd: workingDirectory must be supplied as a string"),r)}hashObject(t,r){return this._runTask(hashObjectTask(t,r===true),trailingFunctionArgument(arguments))}init(t){return this._runTask(initTask(t===true,this._executor.cwd,getTrailingOptions(arguments)),trailingFunctionArgument(arguments))}merge(){return this._runTask(mergeTask(getTrailingOptions(arguments)),trailingFunctionArgument(arguments))}mergeFromTo(t,r){if(!(j(t)&&j(r))){return this._runTask(configurationErrorTask(`Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings`))}return this._runTask(mergeTask([t,r,...getTrailingOptions(arguments)]),trailingFunctionArgument(arguments,false))}outputHandler(t){this._executor.outputHandler=t;return this}push(){const t=pushTask({remote:filterType(arguments[0],j),branch:filterType(arguments[1],j)},getTrailingOptions(arguments));return this._runTask(t,trailingFunctionArgument(arguments))}stash(){return this._runTask(straightThroughStringTask(["stash",...getTrailingOptions(arguments)]),trailingFunctionArgument(arguments))}status(){return this._runTask(statusTask(getTrailingOptions(arguments)),trailingFunctionArgument(arguments))}};Object.assign(Er.prototype,checkout_default(),commit_default(),config_default(),grep_default(),log_default(),show_default(),version_default())}});var Rr={};__export(Rr,{Scheduler:()=>$r});var Dr,Fr,$r;var Ir=__esm({"src/lib/runners/scheduler.ts"(){tt();Dr=i(4710);Zt();Fr=(()=>{let t=0;return()=>{t++;const{promise:r,done:i}=(0,Dr.createDeferred)();return{promise:r,done:i,id:t}}})();$r=class{constructor(t=2){this.concurrency=t;this.logger=createLogger("","scheduler");this.pending=[];this.running=[];this.logger(`Constructed, concurrency=%s`,t)}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}const t=append(this.running,this.pending.shift());this.logger(`Attempting id=%s`,t.id);t.done((()=>{this.logger(`Completing id=`,t.id);remove(this.running,t);this.schedule()}))}next(){const{promise:t,id:r}=append(this.pending,Fr());this.logger(`Scheduling id=%s`,r);this.schedule();return t}}}});var jr={};__export(jr,{applyPatchTask:()=>applyPatchTask});function applyPatchTask(t,r){return straightThroughStringTask(["apply",...r,...t])}var Lr=__esm({"src/lib/tasks/apply-patch.ts"(){pt()}});function branchDeletionSuccess(t,r){return{branch:t,hash:r,success:true}}function branchDeletionFailure(t){return{branch:t,hash:null,success:false}}var Gr;var Nr=__esm({"src/lib/responses/BranchDeleteSummary.ts"(){Gr=class{constructor(){this.all=[];this.branches={};this.errors=[]}get success(){return!this.errors.length}}}});function hasBranchDeletionError(t,r){return r===1&&Ur.test(t)}var Br,Ur,Hr,Vr;var Yr=__esm({"src/lib/parsers/parse-branch-delete.ts"(){Nr();tt();Br=/(\S+)\s+\(\S+\s([^)]+)\)/;Ur=/^error[^']+'([^']+)'/m;Hr=[new q(Br,((t,[r,i])=>{const o=branchDeletionSuccess(r,i);t.all.push(o);t.branches[r]=o})),new q(Ur,((t,[r])=>{const i=branchDeletionFailure(r);t.errors.push(i);t.all.push(i);t.branches[r]=i}))];Vr=(t,r)=>parseStringResponse(new Gr,Hr,[t,r])}});var qr;var Wr=__esm({"src/lib/responses/BranchSummary.ts"(){qr=class{constructor(){this.all=[];this.branches={};this.current="";this.detached=false}push(t,r,i,o,a){if(t==="*"){this.detached=r;this.current=i}this.all.push(i);this.branches[i]={current:t==="*",linkedWorkTree:t==="+",name:i,commit:o,label:a}}}}});function branchStatus(t){return t?t.charAt(0):""}function parseBranchSummary(t){return parseStringResponse(new qr,zr,t)}var zr;var Jr=__esm({"src/lib/parsers/parse-branch.ts"(){Wr();tt();zr=[new q(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,((t,[r,i,o,a])=>{t.push(branchStatus(r),true,i,o,a)})),new q(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,((t,[r,i,o,a])=>{t.push(branchStatus(r),false,i,o,a)}))]}});var Kr={};__export(Kr,{branchLocalTask:()=>branchLocalTask,branchTask:()=>branchTask,containsDeleteBranchCommand:()=>containsDeleteBranchCommand,deleteBranchTask:()=>deleteBranchTask,deleteBranchesTask:()=>deleteBranchesTask});function containsDeleteBranchCommand(t){const r=["-d","-D","--delete"];return t.some((t=>r.includes(t)))}function branchTask(t){const r=containsDeleteBranchCommand(t);const i=["branch",...t];if(i.length===1){i.push("-a")}if(!i.includes("-v")){i.splice(1,0,"-v")}return{format:"utf-8",commands:i,parser(t,i){if(r){return Vr(t,i).all[0]}return parseBranchSummary(t)}}}function branchLocalTask(){const t=parseBranchSummary;return{format:"utf-8",commands:["branch","-v"],parser:t}}function deleteBranchesTask(t,r=false){return{format:"utf-8",commands:["branch","-v",r?"-D":"-d",...t],parser(t,r){return Vr(t,r)},onError({exitCode:t,stdOut:r},i,o,a){if(!hasBranchDeletionError(String(i),t)){return a(i)}o(r)}}}function deleteBranchTask(t,r=false){const i={format:"utf-8",commands:["branch","-v",r?"-D":"-d",t],parser(r,i){return Vr(r,i).branches[t]},onError({exitCode:t,stdErr:r,stdOut:o},a,u,l){if(!hasBranchDeletionError(String(a),t)){return l(a)}throw new w(i.parser(bufferToString(o),bufferToString(r)),String(a))}};return i}var Qr=__esm({"src/lib/tasks/branch.ts"(){k();Yr();Jr();tt()}});var Zr;var Xr=__esm({"src/lib/responses/CheckIgnore.ts"(){Zr=t=>t.split(/\n/g).map((t=>t.trim())).filter((t=>!!t))}});var ts={};__export(ts,{checkIgnoreTask:()=>checkIgnoreTask});function checkIgnoreTask(t){return{commands:["check-ignore",...t],format:"utf-8",parser:Zr}}var es=__esm({"src/lib/tasks/check-ignore.ts"(){Xr()}});var rs={};__export(rs,{cloneMirrorTask:()=>cloneMirrorTask,cloneTask:()=>cloneTask});function disallowedCommand(t){return/^--upload-pack(=|$)/.test(t)}function cloneTask(t,r,i){const o=["clone",...i];j(t)&&o.push(t);j(r)&&o.push(r);const a=o.find(disallowedCommand);if(a){return configurationErrorTask(`git.fetch: potential exploit argument blocked.`)}return straightThroughStringTask(o)}function cloneMirrorTask(t,r,i){append(i,"--mirror");return cloneTask(t,r,i)}var ss=__esm({"src/lib/tasks/clone.ts"(){pt();tt()}});function parseFetchResult(t,r){const i={raw:t,remote:null,branches:[],tags:[],updated:[],deleted:[]};return parseStringResponse(i,is,[t,r])}var is;var ns=__esm({"src/lib/parsers/parse-fetch.ts"(){tt();is=[new q(/From (.+)$/,((t,[r])=>{t.remote=r})),new q(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,((t,[r,i])=>{t.branches.push({name:r,tracking:i})})),new q(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,((t,[r,i])=>{t.tags.push({name:r,tracking:i})})),new q(/- \[deleted]\s+\S+\s*-> (.+)$/,((t,[r])=>{t.deleted.push({tracking:r})})),new q(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,((t,[r,i,o,a])=>{t.updated.push({name:o,tracking:a,to:i,from:r})}))]}});var os={};__export(os,{fetchTask:()=>fetchTask});function disallowedCommand2(t){return/^--upload-pack(=|$)/.test(t)}function fetchTask(t,r,i){const o=["fetch",...i];if(t&&r){o.push(t,r)}const a=o.find(disallowedCommand2);if(a){return configurationErrorTask(`git.fetch: potential exploit argument blocked.`)}return{commands:o,format:"utf-8",parser:parseFetchResult}}var as=__esm({"src/lib/tasks/fetch.ts"(){ns();pt()}});function parseMoveResult(t){return parseStringResponse({moves:[]},us,t)}var us;var ls=__esm({"src/lib/parsers/parse-move.ts"(){tt();us=[new q(/^Renaming (.+) to (.+)$/,((t,[r,i])=>{t.moves.push({from:r,to:i})}))]}});var cs={};__export(cs,{moveTask:()=>moveTask});function moveTask(t,r){return{commands:["mv","-v",...asArray(t),r],format:"utf-8",parser:parseMoveResult}}var hs=__esm({"src/lib/tasks/move.ts"(){ls();tt()}});var ds={};__export(ds,{pullTask:()=>pullTask});function pullTask(t,r,i){const o=["pull",...i];if(t&&r){o.splice(1,0,t,r)}return{commands:o,format:"utf-8",parser(t,r){return sr(t,r)},onError(t,r,i,o){const a=parsePullErrorResult(bufferToString(t.stdOut),bufferToString(t.stdErr));if(a){return o(new w(a))}o(r)}}}var ps=__esm({"src/lib/tasks/pull.ts"(){k();ir();tt()}});function parseGetRemotes(t){const r={};forEach(t,(([t])=>r[t]={name:t}));return Object.values(r)}function parseGetRemotesVerbose(t){const r={};forEach(t,(([t,i,o])=>{if(!r.hasOwnProperty(t)){r[t]={name:t,refs:{fetch:"",push:""}}}if(o&&i){r[t].refs[o.replace(/[^a-z]/g,"")]=i}}));return Object.values(r)}function forEach(t,r){forEachLineWithContent(t,(t=>r(t.split(/\s+/))))}var fs=__esm({"src/lib/responses/GetRemoteSummary.ts"(){tt()}});var gs={};__export(gs,{addRemoteTask:()=>addRemoteTask,getRemotesTask:()=>getRemotesTask,listRemotesTask:()=>listRemotesTask,remoteTask:()=>remoteTask,removeRemoteTask:()=>removeRemoteTask});function addRemoteTask(t,r,i=[]){return straightThroughStringTask(["remote","add",...i,t,r])}function getRemotesTask(t){const r=["remote"];if(t){r.push("-v")}return{commands:r,format:"utf-8",parser:t?parseGetRemotesVerbose:parseGetRemotes}}function listRemotesTask(t=[]){const r=[...t];if(r[0]!=="ls-remote"){r.unshift("ls-remote")}return straightThroughStringTask(r)}function remoteTask(t=[]){const r=[...t];if(r[0]!=="remote"){r.unshift("remote")}return straightThroughStringTask(r)}function removeRemoteTask(t){return straightThroughStringTask(["remote","remove",t])}var ms=__esm({"src/lib/tasks/remote.ts"(){fs();pt()}});var bs={};__export(bs,{stashListTask:()=>stashListTask});function stashListTask(t={},r){const i=parseLogOptions(t);const o=["stash","list",...i.commands,...r];const a=createListLogSummaryParser(i.splitter,i.fields,logFormatFromCommand(o));return validateLogFormatConfig(o)||{commands:o,format:"utf-8",parser:a}}var vs=__esm({"src/lib/tasks/stash-list.ts"(){Te();$e();je();Ge()}});var ys={};__export(ys,{addSubModuleTask:()=>addSubModuleTask,initSubModuleTask:()=>initSubModuleTask,subModuleTask:()=>subModuleTask,updateSubModuleTask:()=>updateSubModuleTask});function addSubModuleTask(t,r){return subModuleTask(["add",t,r])}function initSubModuleTask(t){return subModuleTask(["init",...t])}function subModuleTask(t){const r=[...t];if(r[0]!=="submodule"){r.unshift("submodule")}return straightThroughStringTask(r)}function updateSubModuleTask(t){return subModuleTask(["update",...t])}var ws=__esm({"src/lib/tasks/sub-module.ts"(){pt()}});function singleSorted(t,r){const i=isNaN(t);const o=isNaN(r);if(i!==o){return i?1:-1}return i?sorted(t,r):0}function sorted(t,r){return t===r?0:t>r?1:-1}function trimmed(t){return t.trim()}function toNumber(t){if(typeof t==="string"){return parseInt(t.replace(/^\D+/g,""),10)||0}return 0}var ks,Ts;var xs=__esm({"src/lib/responses/TagList.ts"(){ks=class{constructor(t,r){this.all=t;this.latest=r}};Ts=function(t,r=false){const i=t.split("\n").map(trimmed).filter(Boolean);if(!r){i.sort((function(t,r){const i=t.split(".");const o=r.split(".");if(i.length===1||o.length===1){return singleSorted(toNumber(i[0]),toNumber(o[0]))}for(let t=0,r=Math.max(i.length,o.length);t<r;t++){const r=sorted(toNumber(i[t]),toNumber(o[t]));if(r){return r}}return 0}))}const o=r?i[0]:[...i].reverse().find((t=>t.indexOf(".")>=0));return new ks(i,o)}}});var Ss={};__export(Ss,{addAnnotatedTagTask:()=>addAnnotatedTagTask,addTagTask:()=>addTagTask,tagListTask:()=>tagListTask});function tagListTask(t=[]){const r=t.some((t=>/^--sort=/.test(t)));return{format:"utf-8",commands:["tag","-l",...t],parser(t){return Ts(t,r)}}}function addTagTask(t){return{format:"utf-8",commands:["tag",t],parser(){return{name:t}}}}function addAnnotatedTagTask(t,r){return{format:"utf-8",commands:["tag","-a","-m",r,t],parser(){return{name:t}}}}var Cs=__esm({"src/lib/tasks/tag.ts"(){xs()}});var Os=__commonJS({"src/git.js"(t,r){var{GitExecutor:i}=(ae(),b(ne));var{SimpleGitApi:o}=(Ar(),b(Mr));var{Scheduler:a}=(Ir(),b(Rr));var{configurationErrorTask:u}=(pt(),b(ht));var{asArray:l,filterArray:c,filterPrimitives:h,filterString:d,filterStringOrStringArray:p,filterType:g,getTrailingOptions:m,trailingFunctionArgument:v,trailingOptionsArgument:y}=(tt(),b(X));var{applyPatchTask:w}=(Lr(),b(jr));var{branchTask:k,branchLocalTask:T,deleteBranchesTask:x,deleteBranchTask:S}=(Qr(),b(Kr));var{checkIgnoreTask:C}=(es(),b(ts));var{checkIsRepoTask:O}=(nt(),b(et));var{cloneTask:_,cloneMirrorTask:P}=(ss(),b(rs));var{cleanWithOptionsTask:M,isCleanOptionsArray:E}=(wt(),b(ft));var{diffSummaryTask:A}=(je(),b(Ie));var{fetchTask:R}=(as(),b(os));var{moveTask:D}=(hs(),b(cs));var{pullTask:$}=(ps(),b(ds));var{pushTagsTask:I}=(gr(),b(fr));var{addRemoteTask:j,getRemotesTask:L,listRemotesTask:G,remoteTask:N,removeRemoteTask:B}=(ms(),b(gs));var{getResetMode:U,resetTask:H}=(Dt(),b(Et));var{stashListTask:V}=(vs(),b(bs));var{addSubModuleTask:Y,initSubModuleTask:q,subModuleTask:W,updateSubModuleTask:z}=(ws(),b(ys));var{addAnnotatedTagTask:J,addTagTask:K,tagListTask:Q}=(Cs(),b(Ss));var{straightThroughBufferTask:Z,straightThroughStringTask:rt}=(pt(),b(ht));function Git2(t,r){this._executor=new i(t.binary,t.baseDir,new a(t.maxConcurrentProcesses),r);this._trimmed=t.trimmed}(Git2.prototype=Object.create(o.prototype)).constructor=Git2;Git2.prototype.customBinary=function(t){this._executor.binary=t;return this};Git2.prototype.env=function(t,r){if(arguments.length===1&&typeof t==="object"){this._executor.env=t}else{(this._executor.env=this._executor.env||{})[t]=r}return this};Git2.prototype.stashList=function(t){return this._runTask(V(y(arguments)||{},c(t)&&t||[]),v(arguments))};function createCloneTask(t,r,i,o){if(typeof i!=="string"){return u(`git.${t}() requires a string 'repoPath'`)}return r(i,g(o,d),m(arguments))}Git2.prototype.clone=function(){return this._runTask(createCloneTask("clone",_,...arguments),v(arguments))};Git2.prototype.mirror=function(){return this._runTask(createCloneTask("mirror",P,...arguments),v(arguments))};Git2.prototype.mv=function(t,r){return this._runTask(D(t,r),v(arguments))};Git2.prototype.checkoutLatestTag=function(t){var r=this;return this.pull((function(){r.tags((function(i,o){r.checkout(o.latest,t)}))}))};Git2.prototype.pull=function(t,r,i,o){return this._runTask($(g(t,d),g(r,d),m(arguments)),v(arguments))};Git2.prototype.fetch=function(t,r){return this._runTask(R(g(t,d),g(r,d),m(arguments)),v(arguments))};Git2.prototype.silent=function(t){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");return this};Git2.prototype.tags=function(t,r){return this._runTask(Q(m(arguments)),v(arguments))};Git2.prototype.rebase=function(){return this._runTask(rt(["rebase",...m(arguments)]),v(arguments))};Git2.prototype.reset=function(t){return this._runTask(H(U(t),m(arguments)),v(arguments))};Git2.prototype.revert=function(t){const r=v(arguments);if(typeof t!=="string"){return this._runTask(u("Commit must be a string"),r)}return this._runTask(rt(["revert",...m(arguments,0,true),t]),r)};Git2.prototype.addTag=function(t){const r=typeof t==="string"?K(t):u("Git.addTag requires a tag name");return this._runTask(r,v(arguments))};Git2.prototype.addAnnotatedTag=function(t,r){return this._runTask(J(t,r),v(arguments))};Git2.prototype.deleteLocalBranch=function(t,r,i){return this._runTask(S(t,typeof r==="boolean"?r:false),v(arguments))};Git2.prototype.deleteLocalBranches=function(t,r,i){return this._runTask(x(t,typeof r==="boolean"?r:false),v(arguments))};Git2.prototype.branch=function(t,r){return this._runTask(k(m(arguments)),v(arguments))};Git2.prototype.branchLocal=function(t){return this._runTask(T(),v(arguments))};Git2.prototype.raw=function(t){const r=!Array.isArray(t);const i=[].slice.call(r?arguments:t,0);for(let t=0;t<i.length&&r;t++){if(!h(i[t])){i.splice(t,i.length-t);break}}i.push(...m(arguments,0,true));var o=v(arguments);if(!i.length){return this._runTask(u("Raw: must supply one or more command to execute"),o)}return this._runTask(rt(i,this._trimmed),o)};Git2.prototype.submoduleAdd=function(t,r,i){return this._runTask(Y(t,r),v(arguments))};Git2.prototype.submoduleUpdate=function(t,r){return this._runTask(z(m(arguments,true)),v(arguments))};Git2.prototype.submoduleInit=function(t,r){return this._runTask(q(m(arguments,true)),v(arguments))};Git2.prototype.subModule=function(t,r){return this._runTask(W(m(arguments)),v(arguments))};Git2.prototype.listRemote=function(){return this._runTask(G(m(arguments)),v(arguments))};Git2.prototype.addRemote=function(t,r,i){return this._runTask(j(t,r,m(arguments)),v(arguments))};Git2.prototype.removeRemote=function(t,r){return this._runTask(B(t),v(arguments))};Git2.prototype.getRemotes=function(t,r){return this._runTask(L(t===true),v(arguments))};Git2.prototype.remote=function(t,r){return this._runTask(N(m(arguments)),v(arguments))};Git2.prototype.tag=function(t,r){const i=m(arguments);if(i[0]!=="tag"){i.unshift("tag")}return this._runTask(rt(i),v(arguments))};Git2.prototype.updateServerInfo=function(t){return this._runTask(rt(["update-server-info"]),v(arguments))};Git2.prototype.pushTags=function(t,r){const i=I({remote:g(t,d)},m(arguments));return this._runTask(i,v(arguments))};Git2.prototype.rm=function(t){return this._runTask(rt(["rm","-f",...l(t)]),v(arguments))};Git2.prototype.rmKeepLocal=function(t){return this._runTask(rt(["rm","--cached",...l(t)]),v(arguments))};Git2.prototype.catFile=function(t,r){return this._catFile("utf-8",arguments)};Git2.prototype.binaryCatFile=function(){return this._catFile("buffer",arguments)};Git2.prototype._catFile=function(t,r){var i=v(r);var o=["cat-file"];var a=r[0];if(typeof a==="string"){return this._runTask(u("Git.catFile: options must be supplied as an array of strings"),i)}if(Array.isArray(a)){o.push.apply(o,a)}const l=t==="buffer"?Z(o):rt(o);return this._runTask(l,i)};Git2.prototype.diff=function(t,r){const i=d(t)?u("git.diff: supplying options as a single string is no longer supported, switch to an array of strings"):rt(["diff",...m(arguments)]);return this._runTask(i,v(arguments))};Git2.prototype.diffSummary=function(){return this._runTask(A(m(arguments,1)),v(arguments))};Git2.prototype.applyPatch=function(t){const r=!p(t)?u(`git.applyPatch requires one or more string patches as the first argument`):w(l(t),m([].slice.call(arguments,1)));return this._runTask(r,v(arguments))};Git2.prototype.revparse=function(){const t=["rev-parse",...m(arguments,true)];return this._runTask(rt(t,true),v(arguments))};Git2.prototype.clean=function(t,r,i){const o=E(t);const a=o&&t.join("")||g(t,d)||"";const u=m([].slice.call(arguments,o?1:0));return this._runTask(M(a,u),v(arguments))};Git2.prototype.exec=function(t){const r={commands:[],format:"utf-8",parser(){if(typeof t==="function"){t()}}};return this._runTask(r)};Git2.prototype.clearQueue=function(){return this};Git2.prototype.checkIgnore=function(t,r){return this._runTask(C(l(g(t,p,[]))),v(arguments))};Git2.prototype.checkIsRepo=function(t,r){return this._runTask(O(g(t,d)),v(arguments))};r.exports=Git2}});var _s={};__export(_s,{esModuleFactory:()=>esModuleFactory,gitExportFactory:()=>gitExportFactory,gitInstanceFactory:()=>gitInstanceFactory});function esModuleFactory(t){return Object.defineProperties(t,{__esModule:{value:true},default:{value:t}})}function gitExportFactory(t){return Object.assign(t.bind(null),Ft)}function gitInstanceFactory(t,r){const i=new Ht;const o=createInstanceConfig(t&&(typeof t==="string"?{baseDir:t}:t)||{},r);if(!folderExists(o.baseDir)){throw new S(o,`Cannot use simple-git on a directory that does not exist`)}if(Array.isArray(o.config)){i.add(commandConfigPrefixingPlugin(o.config))}i.add(blockUnsafeOperationsPlugin(o.unsafe));i.add(suffixPathsPlugin());i.add(completionDetectionPlugin(o.completion));o.abort&&i.add(abortPlugin(o.abort));o.progress&&i.add(progressMonitorPlugin(o.progress));o.timeout&&i.add(timeoutPlugin(o.timeout));o.spawnOptions&&i.add(spawnOptionsPlugin(o.spawnOptions));i.add(errorDetectionPlugin(errorDetectionHandler(true)));o.errors&&i.add(errorDetectionPlugin(o.errors));return new Ps(o,i)}var Ps;var Ms=__esm({"src/lib/git-factory.ts"(){$t();Jt();Kt();tt();Ps=Os()}});var Es={};__export(Es,{gitP:()=>gitP});function gitP(...t){let r;let i=Promise.resolve();try{r=gitInstanceFactory(...t)}catch(t){i=Promise.reject(t)}function builderReturn(){return o}function chainReturn(){return i}const o=[...As,...Rs].reduce(((t,i)=>{const o=Rs.includes(i);const a=o?asyncWrapper(i,r):syncWrapper(i,r,t);const u=o?chainReturn:builderReturn;Object.defineProperty(t,i,{enumerable:false,configurable:false,value:r?a:u});return t}),{});return o;function asyncWrapper(t,r){return function(...o){if(typeof o[o.length]==="function"){throw new TypeError("Promise interface requires that handlers are not supplied inline, trailing function not allowed in call to "+t)}return i.then((function(){return new Promise((function(i,a){const callback=(t,r)=>{if(t){return a(toError(t))}i(r)};o.push(callback);r[t].apply(r,o)}))}))}}function syncWrapper(t,r,i){return(...o)=>{r[t](...o);return i}}}function toError(t){if(t instanceof Error){return t}if(typeof t==="string"){return new Error(t)}return new w(t)}var As,Rs;var Ds=__esm({"src/lib/runners/promise-wrapped.ts"(){k();Ms();As=["customBinary","env","outputHandler","silent"];Rs=["add","addAnnotatedTag","addConfig","addRemote","addTag","applyPatch","binaryCatFile","branch","branchLocal","catFile","checkIgnore","checkIsRepo","checkout","checkoutBranch","checkoutLatestTag","checkoutLocalBranch","clean","clone","commit","cwd","deleteLocalBranch","deleteLocalBranches","diff","diffSummary","exec","fetch","getRemotes","init","listConfig","listRemote","log","merge","mergeFromTo","mirror","mv","pull","push","pushTags","raw","rebase","remote","removeRemote","reset","revert","revparse","rm","rmKeepLocal","show","stash","stashList","status","subModule","submoduleAdd","submoduleInit","submoduleUpdate","tag","tags","updateServerInfo"]}});var{gitP:Fs}=(Ds(),b(Es));var{esModuleFactory:$s,gitInstanceFactory:Is,gitExportFactory:js}=(Ms(),b(_s));var Ls=$s(js(Is));t.exports=Object.assign(Ls,{gitP:Fs,simpleGit:Ls})},2907:t=>{"use strict";const r="";const i=`${r}[`;const o="";const a={to(t,r){if(!r)return`${i}${t+1}G`;return`${i}${r+1};${t+1}H`},move(t,r){let o="";if(t<0)o+=`${i}${-t}D`;else if(t>0)o+=`${i}${t}C`;if(r<0)o+=`${i}${-r}A`;else if(r>0)o+=`${i}${r}B`;return o},up:(t=1)=>`${i}${t}A`,down:(t=1)=>`${i}${t}B`,forward:(t=1)=>`${i}${t}C`,backward:(t=1)=>`${i}${t}D`,nextLine:(t=1)=>`${i}E`.repeat(t),prevLine:(t=1)=>`${i}F`.repeat(t),left:`${i}G`,hide:`${i}?25l`,show:`${i}?25h`,save:`${r}7`,restore:`${r}8`};const u={up:(t=1)=>`${i}S`.repeat(t),down:(t=1)=>`${i}T`.repeat(t)};const l={screen:`${i}2J`,up:(t=1)=>`${i}1J`.repeat(t),down:(t=1)=>`${i}J`.repeat(t),line:`${i}2K`,lineEnd:`${i}K`,lineStart:`${i}1K`,lines(t){let r="";for(let i=0;i<t;i++)r+=this.line+(i<t-1?a.up():"");if(t)r+=a.left;return r}};t.exports={cursor:a,scroll:u,erase:l,beep:o}},1371:(t,r,i)=>{"use strict";const o=i(2037);const a=i(9912);const u=process.env;let l;if(a("no-color")||a("no-colors")||a("color=false")){l=false}else if(a("color")||a("colors")||a("color=true")||a("color=always")){l=true}if("FORCE_COLOR"in u){l=u.FORCE_COLOR.length===0||parseInt(u.FORCE_COLOR,10)!==0}function translateLevel(t){if(t===0){return false}return{level:t,hasBasic:true,has256:t>=2,has16m:t>=3}}function supportsColor(t){if(l===false){return 0}if(a("color=16m")||a("color=full")||a("color=truecolor")){return 3}if(a("color=256")){return 2}if(t&&!t.isTTY&&l!==true){return 0}const r=l?1:0;if(process.platform==="win32"){const t=o.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586){return Number(t[2])>=14931?3:2}return 1}if("CI"in u){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((t=>t in u))||u.CI_NAME==="codeship"){return 1}return r}if("TEAMCITY_VERSION"in u){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(u.TEAMCITY_VERSION)?1:0}if(u.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in u){const t=parseInt((u.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(u.TERM_PROGRAM){case"iTerm.app":return t>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(u.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(u.TERM)){return 1}if("COLORTERM"in u){return 1}if(u.TERM==="dumb"){return r}return r}function getSupportLevel(t){const r=supportsColor(t);return translateLevel(r)}t.exports={supportsColor:getSupportLevel,stdout:getSupportLevel(process.stdout),stderr:getSupportLevel(process.stderr)}},4074:function(t,r,i){"use strict";var o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:true});const a=o(i(3309));const u=i(1409);const handleSigTerm=()=>process.exit(0);process.on("SIGINT",handleSigTerm);process.on("SIGTERM",handleSigTerm);async function createBranch(){const t=await(0,u.simpleGit)().fetch();console.log(t)}async function run(){const{task:t}=await(0,a.default)({type:"select",name:"task",message:"What do you want to do?",choices:[{title:"Create branch",description:"",value:"Create branch"}],initial:0});if(t==="Create branch")await createBranch()}run().then((()=>{console.log("ok");process.exit()})).catch((()=>{console.log("Aborting");process.exit(1)}))},2081:t=>{"use strict";t.exports=require("child_process")},2361:t=>{"use strict";t.exports=require("events")},358:t=>{"use strict";t.exports=require("fs")},2037:t=>{"use strict";t.exports=require("os")},4521:t=>{"use strict";t.exports=require("readline")},6224:t=>{"use strict";t.exports=require("tty")},3837:t=>{"use strict";t.exports=require("util")}};var r={};function __nccwpck_require__(i){var o=r[i];if(o!==undefined){return o.exports}var a=r[i]={exports:{}};var u=true;try{t[i].call(a.exports,a,a.exports,__nccwpck_require__);u=false}finally{if(u)delete r[i]}return a.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var i=__nccwpck_require__(4074);module.exports=i})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mytools-tasks",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "bin": {
5
5
  "tasks": "./dist/index.js"
6
6
  },