buddy-bot
Version:
Automated & optimized dependency updates for JavaScript & TypeScript projects. Like Renovate & Dependabot.
54 lines • 223 kB
JavaScript
#!/usr/bin/env bun
// @bun
import{d as L,e as N1}from"../chunk-nntcrsvq.js";import"../chunk-50s6gscf.js";import"../chunk-pms917dv.js";import"../chunk-byfbb805.js";import"../chunk-wmz42t5c.js";import"../chunk-4331gqf2.js";import"../chunk-rjfbmp1q.js";import"../chunk-q3tv2y4q.js";import"../chunk-zmck1ahy.js";import{D as h,E as M,H as T}from"../chunk-jcxe2rnh.js";var x=M((pX,M$)=>{var{FORCE_COLOR:AH,NODE_DISABLE_COLORS:WH,TERM:MH}=process.env,C={enabled:!WH&&MH!=="dumb"&&AH!=="0",reset:S(0,0),bold:S(1,22),dim:S(2,22),italic:S(3,23),underline:S(4,24),inverse:S(7,27),hidden:S(8,28),strikethrough:S(9,29),black:S(30,39),red:S(31,39),green:S(32,39),yellow:S(33,39),blue:S(34,39),magenta:S(35,39),cyan:S(36,39),white:S(37,39),gray:S(90,39),grey:S(90,39),bgBlack:S(40,49),bgRed:S(41,49),bgGreen:S(42,49),bgYellow:S(43,49),bgBlue:S(44,49),bgMagenta:S(45,49),bgCyan:S(46,49),bgWhite:S(47,49)};function W$($,Y){let Z=0,H,Q="",X="";for(;Z<$.length;Z++)if(H=$[Z],Q+=H.open,X+=H.close,Y.includes(H.close))Y=Y.replace(H.rgx,H.close+H.open);return Q+Y+X}function DH($,Y){let Z={has:$,keys:Y};return Z.reset=C.reset.bind(Z),Z.bold=C.bold.bind(Z),Z.dim=C.dim.bind(Z),Z.italic=C.italic.bind(Z),Z.underline=C.underline.bind(Z),Z.inverse=C.inverse.bind(Z),Z.hidden=C.hidden.bind(Z),Z.strikethrough=C.strikethrough.bind(Z),Z.black=C.black.bind(Z),Z.red=C.red.bind(Z),Z.green=C.green.bind(Z),Z.yellow=C.yellow.bind(Z),Z.blue=C.blue.bind(Z),Z.magenta=C.magenta.bind(Z),Z.cyan=C.cyan.bind(Z),Z.white=C.white.bind(Z),Z.gray=C.gray.bind(Z),Z.grey=C.grey.bind(Z),Z.bgBlack=C.bgBlack.bind(Z),Z.bgRed=C.bgRed.bind(Z),Z.bgGreen=C.bgGreen.bind(Z),Z.bgYellow=C.bgYellow.bind(Z),Z.bgBlue=C.bgBlue.bind(Z),Z.bgMagenta=C.bgMagenta.bind(Z),Z.bgCyan=C.bgCyan.bind(Z),Z.bgWhite=C.bgWhite.bind(Z),Z}function S($,Y){let Z={open:`\x1B[${$}m`,close:`\x1B[${Y}m`,rgx:new RegExp(`\\x1b\\[${Y}m`,"g")};return function(H){if(this!==void 0&&this.has!==void 0)return this.has.includes($)||(this.has.push($),this.keys.push(Z)),H===void 0?this:C.enabled?W$(this.keys,H+""):H+"";return H===void 0?DH([$],[Z]):C.enabled?W$([Z],H+""):H+""}}M$.exports=C});var E$=M((iX,D$)=>{D$.exports=($,Y)=>{if($.meta&&$.name!=="escape")return;if($.ctrl){if($.name==="a")return"first";if($.name==="c")return"abort";if($.name==="d")return"abort";if($.name==="e")return"last";if($.name==="g")return"reset"}if(Y){if($.name==="j")return"down";if($.name==="k")return"up"}if($.name==="return")return"submit";if($.name==="enter")return"submit";if($.name==="backspace")return"delete";if($.name==="delete")return"deleteForward";if($.name==="abort")return"abort";if($.name==="escape")return"exit";if($.name==="tab")return"next";if($.name==="pagedown")return"nextPage";if($.name==="pageup")return"prevPage";if($.name==="home")return"home";if($.name==="end")return"end";if($.name==="up")return"up";if($.name==="down")return"down";if($.name==="right")return"right";if($.name==="left")return"left";return!1}});var n1=M((aX,R$)=>{R$.exports=($)=>{let Y=["[\\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("|"),Z=new RegExp(Y,"g");return typeof $==="string"?$.replace(Z,""):$}});var b=M((tX,O$)=>{var L0={to($,Y){if(!Y)return`\x1B[${$+1}G`;return`\x1B[${Y+1};${$+1}H`},move($,Y){let Z="";if($<0)Z+=`\x1B[${-$}D`;else if($>0)Z+=`\x1B[${$}C`;if(Y<0)Z+=`\x1B[${-Y}A`;else if(Y>0)Z+=`\x1B[${Y}B`;return Z},up:($=1)=>`\x1B[${$}A`,down:($=1)=>`\x1B[${$}B`,forward:($=1)=>`\x1B[${$}C`,backward:($=1)=>`\x1B[${$}D`,nextLine:($=1)=>"\x1B[E".repeat($),prevLine:($=1)=>"\x1B[F".repeat($),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},EH={up:($=1)=>"\x1B[S".repeat($),down:($=1)=>"\x1B[T".repeat($)},RH={screen:"\x1B[2J",up:($=1)=>"\x1B[1J".repeat($),down:($=1)=>"\x1B[J".repeat($),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines($){let Y="";for(let Z=0;Z<$;Z++)Y+=this.line+(Z<$-1?L0.up():"");if($)Y+=L0.left;return Y}};O$.exports={cursor:L0,scroll:EH,erase:RH,beep:"\x07"}});var q$=M((sX,L$)=>{function OH($,Y){var Z=typeof Symbol!=="undefined"&&$[Symbol.iterator]||$["@@iterator"];if(!Z){if(Array.isArray($)||(Z=NH($))||Y&&$&&typeof $.length==="number"){if(Z)$=Z;var H=0,Q=function J(){};return{s:Q,n:function J(){if(H>=$.length)return{done:!0};return{done:!1,value:$[H++]}},e:function J(K){throw K},f:Q}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var X=!0,z=!1,U;return{s:function J(){Z=Z.call($)},n:function J(){var K=Z.next();return X=K.done,K},e:function J(K){z=!0,U=K},f:function J(){try{if(!X&&Z.return!=null)Z.return()}finally{if(z)throw U}}}}function NH($,Y){if(!$)return;if(typeof $==="string")return N$($,Y);var Z=Object.prototype.toString.call($).slice(8,-1);if(Z==="Object"&&$.constructor)Z=$.constructor.name;if(Z==="Map"||Z==="Set")return Array.from($);if(Z==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Z))return N$($,Y)}function N$($,Y){if(Y==null||Y>$.length)Y=$.length;for(var Z=0,H=new Array(Y);Z<Y;Z++)H[Z]=$[Z];return H}var BH=n1(),F$=b(),B$=F$.erase,FH=F$.cursor,LH=($)=>[...BH($)].length;L$.exports=function($,Y){if(!Y)return B$.line+FH.to(0);let Z=0,H=$.split(/\r?\n/);var Q=OH(H),X;try{for(Q.s();!(X=Q.n()).done;){let z=X.value;Z+=1+Math.floor(Math.max(LH(z)-1,0)/Y)}}catch(z){Q.e(z)}finally{Q.f()}return B$.lines(Z)}});var q0=M((oX,V$)=>{var S1={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},qH={arrowUp:S1.arrowUp,arrowDown:S1.arrowDown,arrowLeft:S1.arrowLeft,arrowRight:S1.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},VH=process.platform==="win32"?qH:S1;V$.exports=VH});var C$=M((rX,I$)=>{var F1=x(),E1=q0(),V0=Object.freeze({password:{scale:1,render:($)=>"*".repeat($.length)},emoji:{scale:2,render:($)=>"\uD83D\uDE03".repeat($.length)},invisible:{scale:0,render:($)=>""},default:{scale:1,render:($)=>`${$}`}}),IH=($)=>V0[$]||V0.default,h1=Object.freeze({aborted:F1.red(E1.cross),done:F1.green(E1.tick),exited:F1.yellow(E1.cross),default:F1.cyan("?")}),CH=($,Y,Z)=>Y?h1.aborted:Z?h1.exited:$?h1.done:h1.default,TH=($)=>F1.gray($?E1.ellipsis:E1.pointerSmall),jH=($,Y)=>F1.gray($?Y?E1.pointerSmall:"+":E1.line);I$.exports={styles:V0,render:IH,symbols:h1,symbol:CH,delimiter:TH,item:jH}});var j$=M((eX,T$)=>{var SH=n1();T$.exports=function($,Y){let Z=String(SH($)||"").split(/\r?\n/);if(!Y)return Z.length;return Z.map((H)=>Math.ceil(H.length/Y)).reduce((H,Q)=>H+Q)}});var h$=M(($7,S$)=>{S$.exports=($,Y={})=>{let Z=Number.isSafeInteger(parseInt(Y.margin))?new Array(parseInt(Y.margin)).fill(" ").join(""):Y.margin||"",H=Y.width;return($||"").split(/\r?\n/g).map((Q)=>Q.split(/\s+/g).reduce((X,z)=>{if(z.length+Z.length>=H||X[X.length-1].length+z.length+1<H)X[X.length-1]+=` ${z}`;else X.push(`${Z}${z}`);return X},[Z]).join(`
`)).join(`
`)}});var w$=M((Y7,_$)=>{_$.exports=($,Y,Z)=>{Z=Z||Y;let H=Math.min(Y-Z,$-Math.floor(Z/2));if(H<0)H=0;let Q=Math.min(H+Z,Y);return{startIndex:H,endIndex:Q}}});var i=M((Z7,P$)=>{P$.exports={action:E$(),clear:q$(),style:C$(),strip:n1(),figures:q0(),lines:j$(),wrap:h$(),entriesToDisplay:w$()}});var Y1=M((H7,v$)=>{var x$=T("readline"),hH=i(),_H=hH.action,wH=T("events"),b$=b(),PH=b$.beep,xH=b$.cursor,bH=x();class k$ extends wH{constructor($={}){super();this.firstRender=!0,this.in=$.stdin||process.stdin,this.out=$.stdout||process.stdout,this.onRender=($.onRender||(()=>{return})).bind(this);let Y=x$.createInterface({input:this.in,escapeCodeTimeout:50});if(x$.emitKeypressEvents(this.in,Y),this.in.isTTY)this.in.setRawMode(!0);let Z=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,H=(Q,X)=>{let z=_H(X,Z);if(z===!1)this._&&this._(Q,X);else if(typeof this[z]==="function")this[z](X);else this.bell()};this.close=()=>{if(this.out.write(xH.show),this.in.removeListener("keypress",H),this.in.isTTY)this.in.setRawMode(!1);Y.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",H)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(PH)}render(){if(this.onRender(bH),this.firstRender)this.firstRender=!1}}v$.exports=k$});var c$=M((X7,m$)=>{function f$($,Y,Z,H,Q,X,z){try{var U=$[X](z),J=U.value}catch(K){Z(K);return}if(U.done)Y(J);else Promise.resolve(J).then(H,Q)}function d$($){return function(){var Y=this,Z=arguments;return new Promise(function(H,Q){var X=$.apply(Y,Z);function z(J){f$(X,H,Q,z,U,"next",J)}function U(J){f$(X,H,Q,z,U,"throw",J)}z(void 0)})}}var l1=x(),kH=Y1(),y$=b(),vH=y$.erase,_1=y$.cursor,p1=i(),I0=p1.style,C0=p1.clear,fH=p1.lines,dH=p1.figures;class u$ extends kH{constructor($={}){super($);this.transform=I0.render($.style),this.scale=this.transform.scale,this.msg=$.message,this.initial=$.initial||"",this.validator=$.validate||(()=>!0),this.value="",this.errorMsg=$.error||"Please Enter A Valid Value",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=C0("",this.out.columns),this.render()}set value($){if(!$&&this.initial)this.placeholder=!0,this.rendered=l1.gray(this.transform.render(this.initial));else this.placeholder=!1,this.rendered=this.transform.render($);this._value=$,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=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}validate(){var $=this;return d$(function*(){let Y=yield $.validator($.value);if(typeof Y==="string")$.errorMsg=Y,Y=!1;$.error=!Y})()}submit(){var $=this;return d$(function*(){if($.value=$.value||$.initial,$.cursorOffset=0,$.cursor=$.rendered.length,yield $.validate(),$.error){$.red=!0,$.fire(),$.render();return}$.done=!0,$.aborted=!1,$.fire(),$.render(),$.out.write(`
`),$.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor($){if(this.placeholder)return;this.cursor=this.cursor+$,this.cursorOffset+=$}_($,Y){let Z=this.value.slice(0,this.cursor),H=this.value.slice(this.cursor);this.value=`${Z}${$}${H}`,this.red=!1,this.cursor=this.placeholder?0:Z.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let $=this.value.slice(0,this.cursor-1),Y=this.value.slice(this.cursor);if(this.value=`${$}${Y}`,this.red=!1,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 $=this.value.slice(0,this.cursor),Y=this.value.slice(this.cursor+1);if(this.value=`${$}${Y}`,this.red=!1,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(_1.down(fH(this.outputError,this.out.columns)-1)+C0(this.outputError,this.out.columns));this.out.write(C0(this.outputText,this.out.columns))}if(super.render(),this.outputError="",this.outputText=[I0.symbol(this.done,this.aborted),l1.bold(this.msg),I0.delimiter(this.done),this.red?l1.red(this.rendered):this.rendered].join(" "),this.error)this.outputError+=this.errorMsg.split(`
`).reduce(($,Y,Z)=>$+`
${Z?" ":dH.pointerSmall} ${l1.red().italic(Y)}`,"");this.out.write(vH.line+_1.to(0)+this.outputText+_1.save+this.outputError+_1.restore+_1.move(this.cursorOffset,0))}}m$.exports=u$});var i$=M((Q7,p$)=>{var Z1=x(),yH=Y1(),w1=i(),g$=w1.style,n$=w1.clear,i1=w1.figures,uH=w1.wrap,mH=w1.entriesToDisplay,cH=b(),gH=cH.cursor;class l$ extends yH{constructor($={}){super($);this.msg=$.message,this.hint=$.hint||"- Use arrow-keys. Return to submit.",this.warn=$.warn||"- This option is disabled",this.cursor=$.initial||0,this.choices=$.choices.map((Y,Z)=>{if(typeof Y==="string")Y={title:Y,value:Z};return{title:Y&&(Y.title||Y.value||Y),value:Y&&(Y.value===void 0?Z:Y.value),description:Y&&Y.description,selected:Y&&Y.selected,disabled:Y&&Y.disabled}}),this.optionsPerPage=$.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=n$("",this.out.columns),this.render()}moveCursor($){this.cursor=$,this.value=this.choices[$].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){if(!this.selection.disabled)this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),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()}_($,Y){if($===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;if(this.firstRender)this.out.write(gH.hide);else this.out.write(n$(this.outputText,this.out.columns));super.render();let $=mH(this.cursor,this.choices.length,this.optionsPerPage),Y=$.startIndex,Z=$.endIndex;if(this.outputText=[g$.symbol(this.done,this.aborted),Z1.bold(this.msg),g$.delimiter(!1),this.done?this.selection.title:this.selection.disabled?Z1.yellow(this.warn):Z1.gray(this.hint)].join(" "),!this.done){this.outputText+=`
`;for(let H=Y;H<Z;H++){let Q,X,z="",U=this.choices[H];if(H===Y&&Y>0)X=i1.arrowUp;else if(H===Z-1&&Z<this.choices.length)X=i1.arrowDown;else X=" ";if(U.disabled)Q=this.cursor===H?Z1.gray().underline(U.title):Z1.strikethrough().gray(U.title),X=(this.cursor===H?Z1.bold().gray(i1.pointer)+" ":" ")+X;else if(Q=this.cursor===H?Z1.cyan().underline(U.title):U.title,X=(this.cursor===H?Z1.cyan(i1.pointer)+" ":" ")+X,U.description&&this.cursor===H){if(z=` - ${U.description}`,X.length+Q.length+z.length>=this.out.columns||U.description.split(/\r?\n/).length>1)z=`
`+uH(U.description,{margin:3,width:this.out.columns})}this.outputText+=`${X} ${Q}${Z1.gray(z)}
`}}this.out.write(this.outputText)}}p$.exports=l$});var $2=M((z7,e$)=>{var a1=x(),nH=Y1(),s$=i(),a$=s$.style,lH=s$.clear,o$=b(),t$=o$.cursor,pH=o$.erase;class r$ extends nH{constructor($={}){super($);this.msg=$.message,this.value=!!$.initial,this.active=$.active||"on",this.inactive=$.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=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,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()}_($,Y){if($===" ")this.value=!this.value;else if($==="1")this.value=!0;else if($==="0")this.value=!1;else return this.bell();this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(t$.hide);else this.out.write(lH(this.outputText,this.out.columns));super.render(),this.outputText=[a$.symbol(this.done,this.aborted),a1.bold(this.msg),a$.delimiter(this.done),this.value?this.inactive:a1.cyan().underline(this.inactive),a1.gray("/"),this.value?a1.cyan().underline(this.active):this.active].join(" "),this.out.write(pH.line+t$.to(0)+this.outputText)}}e$.exports=r$});var t=M((J7,Y2)=>{class t1{constructor({token:$,date:Y,parts:Z,locales:H}){this.token=$,this.date=Y||new Date,this.parts=Z||[this],this.locales=H||{}}up(){}down(){}next(){let $=this.parts.indexOf(this);return this.parts.find((Y,Z)=>Z>$&&Y instanceof t1)}setTo($){}prev(){let $=[].concat(this.parts).reverse(),Y=$.indexOf(this);return $.find((Z,H)=>H>Y&&Z instanceof t1)}toString(){return String(this.date)}}Y2.exports=t1});var X2=M((K7,H2)=>{var iH=t();class Z2 extends iH{constructor($={}){super($)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let $=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?$.toUpperCase():$}}H2.exports=Z2});var J2=M((U7,z2)=>{var aH=t(),tH=($)=>{return $=$%10,$===1?"st":$===2?"nd":$===3?"rd":"th"};class Q2 extends aH{constructor($={}){super($)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo($){this.date.setDate(parseInt($.substr(-2)))}toString(){let $=this.date.getDate(),Y=this.date.getDay();return this.token==="DD"?String($).padStart(2,"0"):this.token==="Do"?$+tH($):this.token==="d"?Y+1:this.token==="ddd"?this.locales.weekdaysShort[Y]:this.token==="dddd"?this.locales.weekdays[Y]:$}}z2.exports=Q2});var G2=M((G7,U2)=>{var sH=t();class K2 extends sH{constructor($={}){super($)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo($){this.date.setHours(parseInt($.substr(-2)))}toString(){let $=this.date.getHours();if(/h/.test(this.token))$=$%12||12;return this.token.length>1?String($).padStart(2,"0"):$}}U2.exports=K2});var M2=M((A7,W2)=>{var oH=t();class A2 extends oH{constructor($={}){super($)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo($){this.date.setMilliseconds(parseInt($.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}W2.exports=A2});var R2=M((W7,E2)=>{var rH=t();class D2 extends rH{constructor($={}){super($)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo($){this.date.setMinutes(parseInt($.substr(-2)))}toString(){let $=this.date.getMinutes();return this.token.length>1?String($).padStart(2,"0"):$}}E2.exports=D2});var B2=M((M7,N2)=>{var eH=t();class O2 extends eH{constructor($={}){super($)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo($){$=parseInt($.substr(-2))-1,this.date.setMonth($<0?0:$)}toString(){let $=this.date.getMonth(),Y=this.token.length;return Y===2?String($+1).padStart(2,"0"):Y===3?this.locales.monthsShort[$]:Y===4?this.locales.months[$]:String($+1)}}N2.exports=O2});var q2=M((D7,L2)=>{var $8=t();class F2 extends $8{constructor($={}){super($)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo($){this.date.setSeconds(parseInt($.substr(-2)))}toString(){let $=this.date.getSeconds();return this.token.length>1?String($).padStart(2,"0"):$}}L2.exports=F2});var C2=M((E7,I2)=>{var Y8=t();class V2 extends Y8{constructor($={}){super($)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo($){this.date.setFullYear($.substr(-4))}toString(){let $=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?$.substr(-2):$}}I2.exports=V2});var j2=M((R7,T2)=>{T2.exports={DatePart:t(),Meridiem:X2(),Day:J2(),Hours:G2(),Milliseconds:M2(),Minutes:R2(),Month:B2(),Seconds:q2(),Year:C2()}});var d2=M((O7,f2)=>{function S2($,Y,Z,H,Q,X,z){try{var U=$[X](z),J=U.value}catch(K){Z(K);return}if(U.done)Y(J);else Promise.resolve(J).then(H,Q)}function h2($){return function(){var Y=this,Z=arguments;return new Promise(function(H,Q){var X=$.apply(Y,Z);function z(J){S2(X,H,Q,z,U,"next",J)}function U(J){S2(X,H,Q,z,U,"throw",J)}z(void 0)})}}var T0=x(),Z8=Y1(),j0=i(),_2=j0.style,w2=j0.clear,H8=j0.figures,k2=b(),X8=k2.erase,P2=k2.cursor,H1=j2(),x2=H1.DatePart,Q8=H1.Meridiem,z8=H1.Day,J8=H1.Hours,K8=H1.Milliseconds,U8=H1.Minutes,G8=H1.Month,A8=H1.Seconds,W8=H1.Year,M8=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,b2={1:({token:$})=>$.replace(/\\(.)/g,"$1"),2:($)=>new z8($),3:($)=>new G8($),4:($)=>new W8($),5:($)=>new Q8($),6:($)=>new J8($),7:($)=>new U8($),8:($)=>new A8($),9:($)=>new K8($)},D8={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 v2 extends Z8{constructor($={}){super($);this.msg=$.message,this.cursor=0,this.typed="",this.locales=Object.assign(D8,$.locales),this._date=$.initial||new Date,this.errorMsg=$.error||"Please Enter A Valid Value",this.validator=$.validate||(()=>!0),this.mask=$.mask||"YYYY-MM-DD HH:mm:ss",this.clear=w2("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date($){if($)this._date.setTime($.getTime())}set mask($){let Y;this.parts=[];while(Y=M8.exec($)){let H=Y.shift(),Q=Y.findIndex((X)=>X!=null);this.parts.push(Q in b2?b2[Q]({token:Y[Q]||H,date:this.date,parts:this.parts,locales:this.locales}):Y[Q]||H)}let Z=this.parts.reduce((H,Q)=>{if(typeof Q==="string"&&typeof H[H.length-1]==="string")H[H.length-1]+=Q;else H.push(Q);return H},[]);this.parts.splice(0),this.parts.push(...Z),this.reset()}moveCursor($){this.typed="",this.cursor=$,this.fire()}reset(){this.moveCursor(this.parts.findIndex(($)=>$ instanceof x2)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}validate(){var $=this;return h2(function*(){let Y=yield $.validator($.value);if(typeof Y==="string")$.errorMsg=Y,Y=!1;$.error=!Y})()}submit(){var $=this;return h2(function*(){if(yield $.validate(),$.error){$.color="red",$.fire(),$.render();return}$.done=!0,$.aborted=!1,$.fire(),$.render(),$.out.write(`
`),$.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let $=this.parts[this.cursor].prev();if($==null)return this.bell();this.moveCursor(this.parts.indexOf($)),this.render()}right(){let $=this.parts[this.cursor].next();if($==null)return this.bell();this.moveCursor(this.parts.indexOf($)),this.render()}next(){let $=this.parts[this.cursor].next();this.moveCursor($?this.parts.indexOf($):this.parts.findIndex((Y)=>Y instanceof x2)),this.render()}_($){if(/\d/.test($))this.typed+=$,this.parts[this.cursor].setTo(this.typed),this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(P2.hide);else this.out.write(w2(this.outputText,this.out.columns));if(super.render(),this.outputText=[_2.symbol(this.done,this.aborted),T0.bold(this.msg),_2.delimiter(!1),this.parts.reduce(($,Y,Z)=>$.concat(Z===this.cursor&&!this.done?T0.cyan().underline(Y.toString()):Y),[]).join("")].join(" "),this.error)this.outputText+=this.errorMsg.split(`
`).reduce(($,Y,Z)=>$+`
${Z?" ":H8.pointerSmall} ${T0.red().italic(Y)}`,"");this.out.write(X8.line+P2.to(0)+this.outputText)}}f2.exports=v2});var p2=M((N7,l2)=>{function y2($,Y,Z,H,Q,X,z){try{var U=$[X](z),J=U.value}catch(K){Z(K);return}if(U.done)Y(J);else Promise.resolve(J).then(H,Q)}function u2($){return function(){var Y=this,Z=arguments;return new Promise(function(H,Q){var X=$.apply(Y,Z);function z(J){y2(X,H,Q,z,U,"next",J)}function U(J){y2(X,H,Q,z,U,"throw",J)}z(void 0)})}}var s1=x(),E8=Y1(),g2=b(),o1=g2.cursor,R8=g2.erase,r1=i(),S0=r1.style,O8=r1.figures,m2=r1.clear,N8=r1.lines,B8=/[0-9]/,h0=($)=>$!==void 0,c2=($,Y)=>{let Z=Math.pow(10,Y);return Math.round($*Z)/Z};class n2 extends E8{constructor($={}){super($);this.transform=S0.render($.style),this.msg=$.message,this.initial=h0($.initial)?$.initial:"",this.float=!!$.float,this.round=$.round||2,this.inc=$.increment||1,this.min=h0($.min)?$.min:-1/0,this.max=h0($.max)?$.max:1/0,this.errorMsg=$.error||"Please Enter A Valid Value",this.validator=$.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value($){if(!$&&$!==0)this.placeholder=!0,this.rendered=s1.gray(this.transform.render(`${this.initial}`)),this._value="";else this.placeholder=!1,this.rendered=this.transform.render(`${c2($,this.round)}`),this._value=c2($,this.round);this.fire()}get value(){return this._value}parse($){return this.float?parseFloat($):parseInt($)}valid($){return $==="-"||$==="."&&this.float||B8.test($)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let $=this.value;this.value=$!==""?$:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}validate(){var $=this;return u2(function*(){let Y=yield $.validator($.value);if(typeof Y==="string")$.errorMsg=Y,Y=!1;$.error=!Y})()}submit(){var $=this;return u2(function*(){if(yield $.validate(),$.error){$.color="red",$.fire(),$.render();return}let Y=$.value;$.value=Y!==""?Y:$.initial,$.done=!0,$.aborted=!1,$.error=!1,$.fire(),$.render(),$.out.write(`
`),$.close()})()}up(){if(this.typed="",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(){if(this.typed="",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 $=this.value.toString();if($.length===0)return this.bell();if(this.value=this.parse($=$.slice(0,-1))||"",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()}_($,Y){if(!this.valid($))return this.bell();let Z=Date.now();if(Z-this.lastHit>1000)this.typed="";if(this.typed+=$,this.lastHit=Z,this.color="cyan",$===".")return this.fire();if(this.value=Math.min(this.parse(this.typed),this.max),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(o1.down(N8(this.outputError,this.out.columns)-1)+m2(this.outputError,this.out.columns));this.out.write(m2(this.outputText,this.out.columns))}if(super.render(),this.outputError="",this.outputText=[S0.symbol(this.done,this.aborted),s1.bold(this.msg),S0.delimiter(this.done),!this.done||!this.done&&!this.placeholder?s1[this.color]().underline(this.rendered):this.rendered].join(" "),this.error)this.outputError+=this.errorMsg.split(`
`).reduce(($,Y,Z)=>$+`
${Z?" ":O8.pointerSmall} ${s1.red().italic(Y)}`,"");this.out.write(R8.line+o1.to(0)+this.outputText+o1.save+this.outputError+o1.restore)}}l2.exports=n2});var _0=M((B7,s2)=>{var s=x(),F8=b(),L8=F8.cursor,q8=Y1(),P1=i(),i2=P1.clear,G1=P1.figures,a2=P1.style,V8=P1.wrap,I8=P1.entriesToDisplay;class t2 extends q8{constructor($={}){super($);if(this.msg=$.message,this.cursor=$.cursor||0,this.scrollIndex=$.cursor||0,this.hint=$.hint||"",this.warn=$.warn||"- This option is disabled -",this.minSelected=$.min,this.showMinError=!1,this.maxChoices=$.max,this.instructions=$.instructions,this.optionsPerPage=$.optionsPerPage||10,this.value=$.choices.map((Y,Z)=>{if(typeof Y==="string")Y={title:Y,value:Z};return{title:Y&&(Y.title||Y.value||Y),description:Y&&Y.description,value:Y&&(Y.value===void 0?Z:Y.value),selected:Y&&Y.selected,disabled:Y&&Y.disabled}}),this.clear=i2("",this.out.columns),!$.overrideRender)this.render()}reset(){this.value.map(($)=>!$.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(($)=>$.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){let $=this.value.filter((Y)=>Y.selected);if(this.minSelected&&$.length<this.minSelected)this.showMinError=!0,this.render();else this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),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=!1,this.render()}right(){if(this.value.filter(($)=>$.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let $=this.value[this.cursor];if($.selected)$.selected=!1,this.render();else if($.disabled||this.value.filter((Y)=>Y.selected).length>=this.maxChoices)return this.bell();else $.selected=!0,this.render()}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let $=!this.value[this.cursor].selected;this.value.filter((Y)=>!Y.disabled).forEach((Y)=>Y.selected=$),this.render()}_($,Y){if($===" ")this.handleSpaceToggle();else if($==="a")this.toggleAll();else return this.bell()}renderInstructions(){if(this.instructions===void 0||this.instructions){if(typeof this.instructions==="string")return this.instructions;return`
Instructions:
${G1.arrowUp}/${G1.arrowDown}: Highlight option
${G1.arrowLeft}/${G1.arrowRight}/[space]: Toggle selection
`+(this.maxChoices===void 0?` a: Toggle all
`:"")+" enter/return: Complete answer"}return""}renderOption($,Y,Z,H){let Q=(Y.selected?s.green(G1.radioOn):G1.radioOff)+" "+H+" ",X,z;if(Y.disabled)X=$===Z?s.gray().underline(Y.title):s.strikethrough().gray(Y.title);else if(X=$===Z?s.cyan().underline(Y.title):Y.title,$===Z&&Y.description){if(z=` - ${Y.description}`,Q.length+X.length+z.length>=this.out.columns||Y.description.split(/\r?\n/).length>1)z=`
`+V8(Y.description,{margin:Q.length,width:this.out.columns})}return Q+X+s.gray(z||"")}paginateOptions($){if($.length===0)return s.red("No matches for this query.");let Y=I8(this.cursor,$.length,this.optionsPerPage),Z=Y.startIndex,H=Y.endIndex,Q,X=[];for(let z=Z;z<H;z++){if(z===Z&&Z>0)Q=G1.arrowUp;else if(z===H-1&&H<$.length)Q=G1.arrowDown;else Q=" ";X.push(this.renderOption(this.cursor,$[z],z,Q))}return`
`+X.join(`
`)}renderOptions($){if(!this.done)return this.paginateOptions($);return""}renderDoneOrInstructions(){if(this.done)return this.value.filter((Y)=>Y.selected).map((Y)=>Y.title).join(", ");let $=[s.gray(this.hint),this.renderInstructions()];if(this.value[this.cursor].disabled)$.push(s.yellow(this.warn));return $.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(L8.hide);super.render();let $=[a2.symbol(this.done,this.aborted),s.bold(this.msg),a2.delimiter(!1),this.renderDoneOrInstructions()].join(" ");if(this.showMinError)$+=s.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1;$+=this.renderOptions(this.value),this.out.write(this.clear+$),this.clear=i2($,this.out.columns)}}s2.exports=t2});var X9=M((F7,H9)=>{function o2($,Y,Z,H,Q,X,z){try{var U=$[X](z),J=U.value}catch(K){Z(K);return}if(U.done)Y(J);else Promise.resolve(J).then(H,Q)}function C8($){return function(){var Y=this,Z=arguments;return new Promise(function(H,Q){var X=$.apply(Y,Z);function z(J){o2(X,H,Q,z,U,"next",J)}function U(J){o2(X,H,Q,z,U,"throw",J)}z(void 0)})}}var x1=x(),T8=Y1(),Y9=b(),j8=Y9.erase,r2=Y9.cursor,b1=i(),w0=b1.style,e2=b1.clear,P0=b1.figures,S8=b1.wrap,h8=b1.entriesToDisplay,$9=($,Y)=>$[Y]&&($[Y].value||$[Y].title||$[Y]),_8=($,Y)=>$[Y]&&($[Y].title||$[Y].value||$[Y]),w8=($,Y)=>{let Z=$.findIndex((H)=>H.value===Y||H.title===Y);return Z>-1?Z:void 0};class Z9 extends T8{constructor($={}){super($);this.msg=$.message,this.suggest=$.suggest,this.choices=$.choices,this.initial=typeof $.initial==="number"?$.initial:w8($.choices,$.initial),this.select=this.initial||$.cursor||0,this.i18n={noMatches:$.noMatches||"no matches found"},this.fallback=$.fallback||this.initial,this.clearFirst=$.clearFirst||!1,this.suggestions=[],this.input="",this.limit=$.limit||10,this.cursor=0,this.transform=w0.render($.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=e2("",this.out.columns),this.complete(this.render),this.render()}set fallback($){this._fb=Number.isSafeInteger(parseInt($))?parseInt($):$}get fallback(){let $;if(typeof this._fb==="number")$=this.choices[this._fb];else if(typeof this._fb==="string")$={title:this._fb};return $||this._fb||{title:this.i18n.noMatches}}moveSelect($){if(this.select=$,this.suggestions.length>0)this.value=$9(this.suggestions,$);else this.value=this.fallback.value;this.fire()}complete($){var Y=this;return C8(function*(){let Z=Y.completing=Y.suggest(Y.input,Y.choices),H=yield Z;if(Y.completing!==Z)return;Y.suggestions=H.map((X,z,U)=>({title:_8(U,z),value:$9(U,z),description:X.description})),Y.completing=!1;let Q=Math.max(H.length-1,0);Y.moveSelect(Math.min(Q,Y.select)),$&&$()})()}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=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}_($,Y){let Z=this.input.slice(0,this.cursor),H=this.input.slice(this.cursor);this.input=`${Z}${$}${H}`,this.cursor=Z.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let $=this.input.slice(0,this.cursor-1),Y=this.input.slice(this.cursor);this.input=`${$}${Y}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let $=this.input.slice(0,this.cursor),Y=this.input.slice(this.cursor+1);this.input=`${$}${Y}`,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($,Y,Z,H){let Q,X=Z?P0.arrowUp:H?P0.arrowDown:" ",z=Y?x1.cyan().underline($.title):$.title;if(X=(Y?x1.cyan(P0.pointer)+" ":" ")+X,$.description){if(Q=` - ${$.description}`,X.length+z.length+Q.length>=this.out.columns||$.description.split(/\r?\n/).length>1)Q=`
`+S8($.description,{margin:3,width:this.out.columns})}return X+" "+z+x1.gray(Q||"")}render(){if(this.closed)return;if(this.firstRender)this.out.write(r2.hide);else this.out.write(e2(this.outputText,this.out.columns));super.render();let $=h8(this.select,this.choices.length,this.limit),Y=$.startIndex,Z=$.endIndex;if(this.outputText=[w0.symbol(this.done,this.aborted,this.exited),x1.bold(this.msg),w0.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let H=this.suggestions.slice(Y,Z).map((Q,X)=>this.renderOption(Q,this.select===X+Y,X===0&&Y>0,X+Y===Z-1&&Z<this.choices.length)).join(`
`);this.outputText+=`
`+(H||x1.gray(this.fallback.title))}this.out.write(j8.line+r2.to(0)+this.outputText)}}H9.exports=Z9});var U9=M((L7,K9)=>{var X1=x(),P8=b(),x8=P8.cursor,b8=_0(),x0=i(),Q9=x0.clear,z9=x0.style,L1=x0.figures;class J9 extends b8{constructor($={}){$.overrideRender=!0;super($);this.inputValue="",this.clear=Q9("",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=!1,this.render()}right(){if(this.value.filter(($)=>$.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){if(this.inputValue.length)this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions()}updateFilteredOptions(){let $=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((Z)=>{if(this.inputValue){if(typeof Z.title==="string"){if(Z.title.toLowerCase().includes(this.inputValue.toLowerCase()))return!0}if(typeof Z.value==="string"){if(Z.value.toLowerCase().includes(this.inputValue.toLowerCase()))return!0}return!1}return!0});let Y=this.filteredOptions.findIndex((Z)=>Z===$);this.cursor=Y<0?0:Y,this.render()}handleSpaceToggle(){let $=this.filteredOptions[this.cursor];if($.selected)$.selected=!1,this.render();else if($.disabled||this.value.filter((Y)=>Y.selected).length>=this.maxChoices)return this.bell();else $.selected=!0,this.render()}handleInputChange($){this.inputValue=this.inputValue+$,this.updateFilteredOptions()}_($,Y){if($===" ")this.handleSpaceToggle();else this.handleInputChange($)}renderInstructions(){if(this.instructions===void 0||this.instructions){if(typeof this.instructions==="string")return this.instructions;return`
Instructions:
${L1.arrowUp}/${L1.arrowDown}: Highlight option
${L1.arrowLeft}/${L1.arrowRight}/[space]: Toggle selection
[a,b,c]/delete: Filter choices
enter/return: Complete answer
`}return""}renderCurrentInput(){return`
Filtered results for: ${this.inputValue?this.inputValue:X1.gray("Enter something to filter")}
`}renderOption($,Y,Z){let H;if(Y.disabled)H=$===Z?X1.gray().underline(Y.title):X1.strikethrough().gray(Y.title);else H=$===Z?X1.cyan().underline(Y.title):Y.title;return(Y.selected?X1.green(L1.radioOn):L1.radioOff)+" "+H}renderDoneOrInstructions(){if(this.done)return this.value.filter((Y)=>Y.selected).map((Y)=>Y.title).join(", ");let $=[X1.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];if(this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled)$.push(X1.yellow(this.warn));return $.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(x8.hide);super.render();let $=[z9.symbol(this.done,this.aborted),X1.bold(this.msg),z9.delimiter(!1),this.renderDoneOrInstructions()].join(" ");if(this.showMinError)$+=X1.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1;$+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+$),this.clear=Q9($,this.out.columns)}}K9.exports=J9});var O9=M((q7,R9)=>{var G9=x(),k8=Y1(),M9=i(),A9=M9.style,v8=M9.clear,D9=b(),f8=D9.erase,W9=D9.cursor;class E9 extends k8{constructor($={}){super($);this.msg=$.message,this.value=$.initial,this.initialValue=!!$.initial,this.yesMsg=$.yes||"yes",this.yesOption=$.yesOption||"(Y/n)",this.noMsg=$.no||"no",this.noOption=$.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
`),this.close()}_($,Y){if($.toLowerCase()==="y")return this.value=!0,this.submit();if($.toLowerCase()==="n")return this.value=!1,this.submit();return this.bell()}render(){if(this.closed)return;if(this.firstRender)this.out.write(W9.hide);else this.out.write(v8(this.outputText,this.out.columns));super.render(),this.outputText=[A9.symbol(this.done,this.aborted),G9.bold(this.msg),A9.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:G9.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(f8.line+W9.to(0)+this.outputText)}}R9.exports=E9});var B9=M((V7,N9)=>{N9.exports={TextPrompt:c$(),SelectPrompt:i$(),TogglePrompt:$2(),DatePrompt:d2(),NumberPrompt:p2(),MultiselectPrompt:_0(),AutocompletePrompt:X9(),AutocompleteMultiselectPrompt:U9(),ConfirmPrompt:O9()}});var L9=M((F9)=>{var u=F9,d8=B9(),e1=($)=>$;function o($,Y,Z={}){return new Promise((H,Q)=>{let X=new d8[$](Y),z=Z.onAbort||e1,U=Z.onSubmit||e1,J=Z.onExit||e1;X.on("state",Y.onState||e1),X.on("submit",(K)=>H(U(K))),X.on("exit",(K)=>H(J(K))),X.on("abort",(K)=>Q(z(K)))})}u.text=($)=>o("TextPrompt",$);u.password=($)=>{return $.style="password",u.text($)};u.invisible=($)=>{return $.style="invisible",u.text($)};u.number=($)=>o("NumberPrompt",$);u.date=($)=>o("DatePrompt",$);u.confirm=($)=>o("ConfirmPrompt",$);u.list=($)=>{let Y=$.separator||",";return o("TextPrompt",$,{onSubmit:(Z)=>Z.split(Y).map((H)=>H.trim())})};u.toggle=($)=>o("TogglePrompt",$);u.select=($)=>o("SelectPrompt",$);u.multiselect=($)=>{$.choices=[].concat($.choices||[]);let Y=(Z)=>Z.filter((H)=>H.selected).map((H)=>H.value);return o("MultiselectPrompt",$,{onAbort:Y,onSubmit:Y})};u.autocompleteMultiselect=($)=>{$.choices=[].concat($.choices||[]);let Y=(Z)=>Z.filter((H)=>H.selected).map((H)=>H.value);return o("AutocompleteMultiselectPrompt",$,{onAbort:Y,onSubmit:Y})};var y8=($,Y)=>Promise.resolve(Y.filter((Z)=>Z.title.slice(0,$.length).toLowerCase()===$.toLowerCase()));u.autocomplete=($)=>{return $.suggest=$.suggest||y8,$.choices=[].concat($.choices||[]),o("AutocompletePrompt",$)}});var h9=M((C7,S9)=>{function q9($,Y){var Z=Object.keys($);if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols($);if(Y)H=H.filter(function(Q){return Object.getOwnPropertyDescriptor($,Q).enumerable});Z.push.apply(Z,H)}return Z}function V9($){for(var Y=1;Y<arguments.length;Y++){var Z=arguments[Y]!=null?arguments[Y]:{};if(Y%2)q9(Object(Z),!0).forEach(function(H){u8($,H,Z[H])});else if(Object.getOwnPropertyDescriptors)Object.defineProperties($,Object.getOwnPropertyDescriptors(Z));else q9(Object(Z)).forEach(function(H){Object.defineProperty($,H,Object.getOwnPropertyDescriptor(Z,H))})}return $}function u8($,Y,Z){if(Y in $)Object.defineProperty($,Y,{value:Z,enumerable:!0,configurable:!0,writable:!0});else $[Y]=Z;return $}function m8($,Y){var Z=typeof Symbol!=="undefined"&&$[Symbol.iterator]||$["@@iterator"];if(!Z){if(Array.isArray($)||(Z=c8($))||Y&&$&&typeof $.length==="number"){if(Z)$=Z;var H=0,Q=function J(){};return{s:Q,n:function J(){if(H>=$.length)return{done:!0};return{done:!1,value:$[H++]}},e:function J(K){throw K},f:Q}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var X=!0,z=!1,U;return{s:function J(){Z=Z.call($)},n:function J(){var K=Z.next();return X=K.done,K},e:function J(K){z=!0,U=K},f:function J(){try{if(!X&&Z.return!=null)Z.return()}finally{if(z)throw U}}}}function c8($,Y){if(!$)return;if(typeof $==="string")return I9($,Y);var Z=Object.prototype.toString.call($).slice(8,-1);if(Z==="Object"&&$.constructor)Z=$.constructor.name;if(Z==="Map"||Z==="Set")return Array.from($);if(Z==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Z))return I9($,Y)}function I9($,Y){if(Y==null||Y>$.length)Y=$.length;for(var Z=0,H=new Array(Y);Z<Y;Z++)H[Z]=$[Z];return H}function C9($,Y,Z,H,Q,X,z){try{var U=$[X](z),J=U.value}catch(K){Z(K);return}if(U.done)Y(J);else Promise.resolve(J).then(H,Q)}function T9($){return function(){var Y=this,Z=arguments;return new Promise(function(H,Q){var X=$.apply(Y,Z);function z(J){C9(X,H,Q,z,U,"next",J)}function U(J){C9(X,H,Q,z,U,"throw",J)}z(void 0)})}}var b0=L9(),g8=["suggest","format","onState","validate","onRender","type"],j9=()=>{};function A1(){return k0.apply(this,arguments)}function k0(){return k0=T9(function*($=[],{onSubmit:Y=j9,onCancel:Z=j9}={}){let H={},Q=A1._override||{};$=[].concat($);let X,z,U,J,K,G,A=function(){var V=T9(function*(F,N,I=!1){if(!I&&F.validate&&F.validate(N)!==!0)return;return F.format?yield F.format(N,H):N});return function F(N,I){return V.apply(this,arguments)}}();var W=m8($),E;try{for(W.s();!(E=W.n()).done;){z=E.value;var R=z;if(J=R.name,K=R.type,typeof K==="function")K=yield K(X,V9({},H),z),z.type=K;if(!K)continue;for(let V in z){if(g8.includes(V))continue;let F=z[V];z[V]=typeof F==="function"?yield F(X,V9({},H),G):F}if(G=z,typeof z.message!=="string")throw new Error("prompt message is required");var q=z;if(J=q.name,K=q.type,b0[K]===void 0)throw new Error(`prompt type (${K}) is not defined`);if(Q[z.name]!==void 0){if(X=yield A(z,Q[z.name]),X!==void 0){H[J]=X;continue}}try{X=A1._injected?n8(A1._injected,z.initial):yield b0[K](z),H[J]=X=yield A(z,X,!0),U=yield Y(z,X,H)}catch(V){U=!(yield Z(z,H))}if(U)return H}}catch(V){W.e(V)}finally{W.f()}return H}),k0.apply(this,arguments)}function n8($,Y){let Z=$.shift();if(Z instanceof Error)throw Z;return Z===void 0?Y:Z}function l8($){A1._injected=(A1._injected||[]).concat($)}function p8($){A1._override=Object.assign({},$)}S9.exports=Object.assign(A1,{prompt:A1,prompts:b0,inject:l8,override:p8})});var w9=M((T7,_9)=>{_9.exports=($,Y)=>{if($.meta&&$.name!=="escape")return;if($.ctrl){if($.name==="a")return"first";if($.name==="c")return"abort";if($.name==="d")return"abort";if($.name==="e")return"last";if($.name==="g")return"reset"}if(Y){if($.name==="j")return"down";if($.name==="k")return"up"}if($.name==="return")return"submit";if($.name==="enter")return"submit";if($.name==="backspace")return"delete";if($.name==="delete")return"deleteForward";if($.name==="abort")return"abort";if($.name==="escape")return"exit";if($.name==="tab")return"next";if($.name==="pagedown")return"nextPage";if($.name==="pageup")return"prevPage";if($.name==="home")return"home";if($.name==="end")return"end";if($.name==="up")return"up";if($.name==="down")return"down";if($.name==="right")return"right";if($.name==="left")return"left";return!1}});var $0=M((j7,P9)=>{P9.exports=($)=>{let Y=["[\\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("|"),Z=new RegExp(Y,"g");return typeof $==="string"?$.replace(Z,""):$}});var k9=M((S7,b9)=>{var i8=$0(),{erase:x9,cursor:a8}=b(),t8=($)=>[...i8($)].length;b9.exports=function($,Y){if(!Y)return x9.line+a8.to(0);let Z=0,H=$.split(/\r?\n/);for(let Q of H)Z+=1+Math.floor(Math.max(t8(Q)-1,0)/Y);return x9.lines(Z)}});var v0=M((h7,v9)=>{var k1={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},s8={arrowUp:k1.arrowUp,arrowDown:k1.arrowDown,arrowLeft:k1.arrowLeft,arrowRight:k1.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},o8=process.platform==="win32"?s8:k1;v9.exports=o8});var d9=M((_7,f9)=>{var q1=x(),R1=v0(),f0=Object.freeze({password:{scale:1,render:($)=>"*".repeat($.length)},emoji:{scale:2,render:($)=>"\uD83D\uDE03".repeat($.length)},invisible:{scale:0,render:($)=>""},default:{scale:1,render:($)=>`${$}`}}),r8=($)=>f0[$]||f0.default,v1=Object.freeze({aborted:q1.red(R1.cross),done:q1.green(R1.tick),exited:q1.yellow(R1.cross),default:q1.cyan("?")}),e8=($,Y,Z)=>Y?v1.aborted:Z?v1.exited:$?v1.done:v1.default,$5=($)=>q1.gray($?R1.ellipsis:R1.pointerSmall),Y5=($,Y)=>q1.gray($?Y?R1.pointerSmall:"+":R1.line);f9.exports={styles:f0,render:r8,symbols:v1,symbol:e8,delimiter:$5,item:Y5}});var u9=M((w7,y9)=>{var Z5=$0();y9.exports=function($,Y){let Z=String(Z5($)||"").split(/\r?\n/);if(!Y)return Z.length;return Z.map((H)=>Math.ceil(H.length/Y)).reduce((H,Q)=>H+Q)}});var c9=M((P7,m9)=>{m9.exports=($,Y={})=>{let Z=Number.isSafeInteger(parseInt(Y.margin))?new Array(parseInt(Y.margin)).fill(" ").join(""):Y.margin||"",H=Y.width;return($||"").split(/\r?\n/g).map((Q)=>Q.split(/\s+/g).reduce((X,z)=>{if(z.length+Z.length>=H||X[X.length-1].length+z.length+1<H)X[X.length-1]+=` ${z}`;else X.push(`${Z}${z}`);return X},[Z]).join(`
`)).join(`
`)}});var n9=M((x7,g9)=>{g9.exports=($,Y,Z)=>{Z=Z||Y;let H=Math.min(Y-Z,$-Math.floor(Z/2));if(H<0)H=0;let Q=Math.min(H+Z,Y);return{startIndex:H,endIndex:Q}}});var a=M((b7,l9)=>{l9.exports={action:w9(),clear:k9(),style:d9(),strip:$0(),figures:v0(),lines:u9(),wrap:c9(),entriesToDisplay:n9()}});var Q1=M((k7,a9)=>{var p9=T("readline"),{action:H5}=a(),X5=T("events"),{beep:Q5,cursor:z5}=b(),J5=x();class i9 extends X5{constructor($={}){super();this.firstRender=!0,this.in=$.stdin||process.stdin,this.out=$.stdout||process.stdout,this.onRender=($.onRender||(()=>{return})).bind(this);let Y=p9.createInt