eazy-git 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/git.js +25 -3
- package/dist/index.js +174 -77
- package/dist/install.js +54 -49
- package/dist/run.js +3 -3
- package/package.json +1 -2
package/dist/index.js
CHANGED
|
@@ -1,78 +1,174 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var He=Object.create;var Uu=Object.defineProperty;var Ze=Object.getOwnPropertyDescriptor;var Qe=Object.getOwnPropertyNames;var Xe=Object.getPrototypeOf,uD=Object.prototype.hasOwnProperty;var Yu=(D,e)=>()=>(e||D((e={exports:{}}).exports,e),e.exports);var eD=(D,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Qe(e))!uD.call(D,s)&&s!==t&&Uu(D,s,{get:()=>e[s],enumerable:!(r=Ze(e,s))||r.enumerable});return D};var su=(D,e,t)=>(t=D!=null?He(Xe(D)):{},eD(e||!D||!D.__esModule?Uu(t,"default",{value:D,enumerable:!0}):t,D));var Au=Yu((wt,zu)=>{"use strict";var $u="\x1B",d=`${$u}[`,DD="\x07",vu={to(D,e){return e?`${d}${e+1};${D+1}H`:`${d}${D+1}G`},move(D,e){let t="";return D<0?t+=`${d}${-D}D`:D>0&&(t+=`${d}${D}C`),e<0?t+=`${d}${-e}A`:e>0&&(t+=`${d}${e}B`),t},up:(D=1)=>`${d}${D}A`,down:(D=1)=>`${d}${D}B`,forward:(D=1)=>`${d}${D}C`,backward:(D=1)=>`${d}${D}D`,nextLine:(D=1)=>`${d}E`.repeat(D),prevLine:(D=1)=>`${d}F`.repeat(D),left:`${d}G`,hide:`${d}?25l`,show:`${d}?25h`,save:`${$u}7`,restore:`${$u}8`},tD={up:(D=1)=>`${d}S`.repeat(D),down:(D=1)=>`${d}T`.repeat(D)},rD={screen:`${d}2J`,up:(D=1)=>`${d}1J`.repeat(D),down:(D=1)=>`${d}J`.repeat(D),line:`${d}2K`,lineEnd:`${d}K`,lineStart:`${d}1K`,lines(D){let e="";for(let t=0;t<D;t++)e+=this.line+(t<D-1?vu.up():"");return D&&(e+=vu.left),e}};zu.exports={cursor:vu,scroll:tD,erase:rD,beep:DD}});var xu=Yu((Tt,yu)=>{var ou=process||{},Ku=ou.argv||[],iu=ou.env||{},sD=!(iu.NO_COLOR||Ku.includes("--no-color"))&&(!!iu.FORCE_COLOR||Ku.includes("--color")||ou.platform==="win32"||(ou.stdout||{}).isTTY&&iu.TERM!=="dumb"||!!iu.CI),iD=(D,e,t=D)=>r=>{let s=""+r,o=s.indexOf(e,D.length);return~o?D+oD(s,e,t,o)+e:D+s+e},oD=(D,e,t,r)=>{let s="",o=0;do s+=D.substring(o,r)+t,o=r+e.length,r=D.indexOf(e,o);while(~r);return s+D.substring(o)},Ju=(D=sD)=>{let e=D?iD:()=>String;return{isColorSupported:D,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};yu.exports=Ju();yu.exports.createColors=Ju});import{stripVTControlCharacters as Mu}from"node:util";var x=su(Au(),1),oe=su(xu(),1);import{stdin as se,stdout as ie}from"node:process";import*as L from"node:readline";import Hu from"node:readline";import{Writable as nD}from"node:stream";function aD({onlyFirst:D=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(e,D?void 0:"g")}var lD=aD();function ne(D){if(typeof D!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(lD,"")}function ae(D){return D&&D.__esModule&&Object.prototype.hasOwnProperty.call(D,"default")?D.default:D}var le={exports:{}};(function(D){var e={};D.exports=e,e.eastAsianWidth=function(r){var s=r.charCodeAt(0),o=r.length==2?r.charCodeAt(1):0,u=s;return 55296<=s&&s<=56319&&56320<=o&&o<=57343&&(s&=1023,o&=1023,u=s<<10|o,u+=65536),u==12288||65281<=u&&u<=65376||65504<=u&&u<=65510?"F":u==8361||65377<=u&&u<=65470||65474<=u&&u<=65479||65482<=u&&u<=65487||65490<=u&&u<=65495||65498<=u&&u<=65500||65512<=u&&u<=65518?"H":4352<=u&&u<=4447||4515<=u&&u<=4519||4602<=u&&u<=4607||9001<=u&&u<=9002||11904<=u&&u<=11929||11931<=u&&u<=12019||12032<=u&&u<=12245||12272<=u&&u<=12283||12289<=u&&u<=12350||12353<=u&&u<=12438||12441<=u&&u<=12543||12549<=u&&u<=12589||12593<=u&&u<=12686||12688<=u&&u<=12730||12736<=u&&u<=12771||12784<=u&&u<=12830||12832<=u&&u<=12871||12880<=u&&u<=13054||13056<=u&&u<=19903||19968<=u&&u<=42124||42128<=u&&u<=42182||43360<=u&&u<=43388||44032<=u&&u<=55203||55216<=u&&u<=55238||55243<=u&&u<=55291||63744<=u&&u<=64255||65040<=u&&u<=65049||65072<=u&&u<=65106||65108<=u&&u<=65126||65128<=u&&u<=65131||110592<=u&&u<=110593||127488<=u&&u<=127490||127504<=u&&u<=127546||127552<=u&&u<=127560||127568<=u&&u<=127569||131072<=u&&u<=194367||177984<=u&&u<=196605||196608<=u&&u<=262141?"W":32<=u&&u<=126||162<=u&&u<=163||165<=u&&u<=166||u==172||u==175||10214<=u&&u<=10221||10629<=u&&u<=10630?"Na":u==161||u==164||167<=u&&u<=168||u==170||173<=u&&u<=174||176<=u&&u<=180||182<=u&&u<=186||188<=u&&u<=191||u==198||u==208||215<=u&&u<=216||222<=u&&u<=225||u==230||232<=u&&u<=234||236<=u&&u<=237||u==240||242<=u&&u<=243||247<=u&&u<=250||u==252||u==254||u==257||u==273||u==275||u==283||294<=u&&u<=295||u==299||305<=u&&u<=307||u==312||319<=u&&u<=322||u==324||328<=u&&u<=331||u==333||338<=u&&u<=339||358<=u&&u<=359||u==363||u==462||u==464||u==466||u==468||u==470||u==472||u==474||u==476||u==593||u==609||u==708||u==711||713<=u&&u<=715||u==717||u==720||728<=u&&u<=731||u==733||u==735||768<=u&&u<=879||913<=u&&u<=929||931<=u&&u<=937||945<=u&&u<=961||963<=u&&u<=969||u==1025||1040<=u&&u<=1103||u==1105||u==8208||8211<=u&&u<=8214||8216<=u&&u<=8217||8220<=u&&u<=8221||8224<=u&&u<=8226||8228<=u&&u<=8231||u==8240||8242<=u&&u<=8243||u==8245||u==8251||u==8254||u==8308||u==8319||8321<=u&&u<=8324||u==8364||u==8451||u==8453||u==8457||u==8467||u==8470||8481<=u&&u<=8482||u==8486||u==8491||8531<=u&&u<=8532||8539<=u&&u<=8542||8544<=u&&u<=8555||8560<=u&&u<=8569||u==8585||8592<=u&&u<=8601||8632<=u&&u<=8633||u==8658||u==8660||u==8679||u==8704||8706<=u&&u<=8707||8711<=u&&u<=8712||u==8715||u==8719||u==8721||u==8725||u==8730||8733<=u&&u<=8736||u==8739||u==8741||8743<=u&&u<=8748||u==8750||8756<=u&&u<=8759||8764<=u&&u<=8765||u==8776||u==8780||u==8786||8800<=u&&u<=8801||8804<=u&&u<=8807||8810<=u&&u<=8811||8814<=u&&u<=8815||8834<=u&&u<=8835||8838<=u&&u<=8839||u==8853||u==8857||u==8869||u==8895||u==8978||9312<=u&&u<=9449||9451<=u&&u<=9547||9552<=u&&u<=9587||9600<=u&&u<=9615||9618<=u&&u<=9621||9632<=u&&u<=9633||9635<=u&&u<=9641||9650<=u&&u<=9651||9654<=u&&u<=9655||9660<=u&&u<=9661||9664<=u&&u<=9665||9670<=u&&u<=9672||u==9675||9678<=u&&u<=9681||9698<=u&&u<=9701||u==9711||9733<=u&&u<=9734||u==9737||9742<=u&&u<=9743||9748<=u&&u<=9749||u==9756||u==9758||u==9792||u==9794||9824<=u&&u<=9825||9827<=u&&u<=9829||9831<=u&&u<=9834||9836<=u&&u<=9837||u==9839||9886<=u&&u<=9887||9918<=u&&u<=9919||9924<=u&&u<=9933||9935<=u&&u<=9953||u==9955||9960<=u&&u<=9983||u==10045||u==10071||10102<=u&&u<=10111||11093<=u&&u<=11097||12872<=u&&u<=12879||57344<=u&&u<=63743||65024<=u&&u<=65039||u==65533||127232<=u&&u<=127242||127248<=u&&u<=127277||127280<=u&&u<=127337||127344<=u&&u<=127386||917760<=u&&u<=917999||983040<=u&&u<=1048573||1048576<=u&&u<=1114109?"A":"N"},e.characterLength=function(r){var s=this.eastAsianWidth(r);return s=="F"||s=="W"||s=="A"?2:1};function t(r){return r.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(r){for(var s=t(r),o=0,u=0;u<s.length;u++)o=o+this.characterLength(s[u]);return o},e.slice=function(r,s,o){textLen=e.length(r),s=s||0,o=o||1,s<0&&(s=textLen+s),o<0&&(o=textLen+o);for(var u="",n=0,F=t(r),h=0;h<F.length;h++){var g=F[h],c=e.length(g);if(n>=s-(c==2?1:0))if(n+c<=o)u+=g;else break;n+=c}return u}})(le);var cD=le.exports,FD=ae(cD),hD=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},CD=ae(hD);function X(D,e={}){if(typeof D!="string"||D.length===0||(e={ambiguousIsNarrow:!0,...e},D=ne(D),D.length===0))return 0;D=D.replace(CD()," ");let t=e.ambiguousIsNarrow?1:2,r=0;for(let s of D){let o=s.codePointAt(0);if(!(o<=31||o>=127&&o<=159||o>=768&&o<=879))switch(FD.eastAsianWidth(s)){case"F":case"W":r+=2;break;case"A":r+=t;break;default:r+=1}}return r}var wu=10,Zu=(D=0)=>e=>`\x1B[${e+D}m`,Qu=(D=0)=>e=>`\x1B[${38+D};5;${e}m`,Xu=(D=0)=>(e,t,r)=>`\x1B[${38+D};2;${e};${t};${r}m`,m={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(m.modifier);var mD=Object.keys(m.color),pD=Object.keys(m.bgColor);[...mD,...pD];function ED(){let D=new Map;for(let[e,t]of Object.entries(m)){for(let[r,s]of Object.entries(t))m[r]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},t[r]=m[r],D.set(s[0],s[1]);Object.defineProperty(m,e,{value:t,enumerable:!1})}return Object.defineProperty(m,"codes",{value:D,enumerable:!1}),m.color.close="\x1B[39m",m.bgColor.close="\x1B[49m",m.color.ansi=Zu(),m.color.ansi256=Qu(),m.color.ansi16m=Xu(),m.bgColor.ansi=Zu(wu),m.bgColor.ansi256=Qu(wu),m.bgColor.ansi16m=Xu(wu),Object.defineProperties(m,{rgbToAnsi256:{value:(e,t,r)=>e===t&&t===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value:e=>{let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[r]=t;r.length===3&&(r=[...r].map(o=>o+o).join(""));let s=Number.parseInt(r,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:e=>m.rgbToAnsi256(...m.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,r,s;if(e>=232)t=((e-232)*10+8)/255,r=t,s=t;else{e-=16;let n=e%36;t=Math.floor(e/36)/5,r=Math.floor(n/6)/5,s=n%6/5}let o=Math.max(t,r,s)*2;if(o===0)return 30;let u=30+(Math.round(s)<<2|Math.round(r)<<1|Math.round(t));return o===2&&(u+=60),u},enumerable:!1},rgbToAnsi:{value:(e,t,r)=>m.ansi256ToAnsi(m.rgbToAnsi256(e,t,r)),enumerable:!1},hexToAnsi:{value:e=>m.ansi256ToAnsi(m.hexToAnsi256(e)),enumerable:!1}}),m}var dD=ED(),hu=new Set(["\x1B","\x9B"]),gD=39,ku="\x07",ce="[",fD="]",Fe="m",Ru=`${fD}8;;`,ue=D=>`${hu.values().next().value}${ce}${D}${Fe}`,ee=D=>`${hu.values().next().value}${Ru}${D}${ku}`,bD=D=>D.split(" ").map(e=>X(e)),Tu=(D,e,t)=>{let r=[...e],s=!1,o=!1,u=X(ne(D[D.length-1]));for(let[n,F]of r.entries()){let h=X(F);if(u+h<=t?D[D.length-1]+=F:(D.push(F),u=0),hu.has(F)&&(s=!0,o=r.slice(n+1).join("").startsWith(Ru)),s){o?F===ku&&(s=!1,o=!1):F===Fe&&(s=!1);continue}u+=h,u===t&&n<r.length-1&&(D.push(""),u=0)}!u&&D[D.length-1].length>0&&D.length>1&&(D[D.length-2]+=D.pop())},BD=D=>{let e=D.split(" "),t=e.length;for(;t>0&&!(X(e[t-1])>0);)t--;return t===e.length?D:e.slice(0,t).join(" ")+e.slice(t).join("")},$D=(D,e,t={})=>{if(t.trim!==!1&&D.trim()==="")return"";let r="",s,o,u=bD(D),n=[""];for(let[h,g]of D.split(" ").entries()){t.trim!==!1&&(n[n.length-1]=n[n.length-1].trimStart());let c=X(n[n.length-1]);if(h!==0&&(c>=e&&(t.wordWrap===!1||t.trim===!1)&&(n.push(""),c=0),(c>0||t.trim===!1)&&(n[n.length-1]+=" ",c++)),t.hard&&u[h]>e){let y=e-c,j=1+Math.floor((u[h]-y-1)/e);Math.floor((u[h]-1)/e)<j&&n.push(""),Tu(n,g,e);continue}if(c+u[h]>e&&c>0&&u[h]>0){if(t.wordWrap===!1&&c<e){Tu(n,g,e);continue}n.push("")}if(c+u[h]>e&&t.wordWrap===!1){Tu(n,g,e);continue}n[n.length-1]+=g}t.trim!==!1&&(n=n.map(h=>BD(h)));let F=[...n.join(`
|
|
3
|
-
`)
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
`).split(`
|
|
7
|
-
`).
|
|
8
|
-
`)
|
|
9
|
-
`),r=e.split(`
|
|
10
|
-
`)
|
|
11
|
-
`),
|
|
12
|
-
`)
|
|
13
|
-
`);this.output.write(
|
|
14
|
-
`).
|
|
15
|
-
`)
|
|
16
|
-
${
|
|
17
|
-
|
|
18
|
-
${i.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
${i.
|
|
22
|
-
${i.
|
|
23
|
-
`
|
|
24
|
-
${
|
|
25
|
-
|
|
26
|
-
${
|
|
27
|
-
${i.
|
|
28
|
-
|
|
29
|
-
${
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
`
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
`)
|
|
40
|
-
|
|
41
|
-
${
|
|
42
|
-
${
|
|
43
|
-
`}
|
|
44
|
-
${
|
|
45
|
-
${
|
|
46
|
-
|
|
47
|
-
${
|
|
48
|
-
|
|
49
|
-
`
|
|
50
|
-
|
|
51
|
-
${
|
|
52
|
-
|
|
53
|
-
${
|
|
54
|
-
|
|
2
|
+
var hr=Object.create;var rt=Object.defineProperty;var dr=Object.getOwnPropertyDescriptor;var mr=Object.getOwnPropertyNames;var pr=Object.getPrototypeOf,gr=Object.prototype.hasOwnProperty;var be=(e,t)=>()=>(e&&(t=e(e=0)),t);var fr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),$r=(e,t)=>{for(var s in t)rt(e,s,{get:t[s],enumerable:!0})},yr=(e,t,s,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of mr(t))!gr.call(e,i)&&i!==s&&rt(e,i,{get:()=>t[i],enumerable:!(r=dr(t,i))||r.enumerable});return e};var Gt=(e,t,s)=>(s=e!=null?hr(pr(e)):{},yr(t||!e||!e.__esModule?rt(s,"default",{value:e,enumerable:!0}):s,e));var jt,Wt,qt,Ht=be(()=>{jt=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let s=0;for(e.lastIndex=0;e.test(t);)s+=1;return t.length-s}})(),Wt=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,qt=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141});var vr,br,Kt,wr,zt,Cr,Ir,Sr,Jt,Yt,Qt=be(()=>{Ht();vr=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,br=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Kt=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu,wr=/\t{1,1000}/y,zt=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu,Cr=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Ir=/\p{M}+/gu,Sr={limit:1/0,ellipsis:""},Jt=(e,t={},s={})=>{let r=t.limit??1/0,i=t.ellipsis??"",o=t?.ellipsisWidth??(i?Jt(i,Sr,s).width:0),a=0,u=s.controlWidth??0,c=s.tabWidth??8,l=s.emojiWidth??2,d=2,g=s.regularWidth??1,p=s.wideWidth??d,y=[[Cr,g],[vr,a],[br,u],[wr,c],[zt,l],[Kt,p]],m=0,b=0,$=e.length,v=0,C=!1,T=$,R=Math.max(0,r-o),x=0,P=0,M=0,k=0;e:for(;;){if(P>x||b>=$&&b>m){let N=e.slice(x,P)||e.slice(m,b);v=0;for(let W of N.replaceAll(Ir,"")){let w=W.codePointAt(0)||0;if(Wt(w)?k=d:qt(w)?k=p:k=g,M+k>R&&(T=Math.min(T,Math.max(x,m)+v)),M+k>r){C=!0;break e}v+=W.length,M+=k}x=P=0}if(b>=$)break e;for(let N=0,W=y.length;N<W;N++){let[w,B]=y[N];if(w.lastIndex=b,w.test(e)){if(v=w===Kt?jt(e.slice(b,w.lastIndex)):w===zt?1:w.lastIndex-b,k=v*B,M+k>R&&(T=Math.min(T,b+Math.floor((R-M)/B))),M+k>r){C=!0;break e}M+=k,x=m,P=b,b=m=w.lastIndex;continue e}}b+=1}return{width:C?R:M,index:C?T:$,truncated:C,ellipsed:C&&r>=o}},Yt=Jt});var Er,xr,j,it=be(()=>{Qt();Er={limit:1/0,ellipsis:"",ellipsisWidth:0},xr=(e,t={})=>Yt(e,Er,t).width,j=xr});function se(e,t,s){return String(e).normalize().split(Fr).map(r=>Ar(r,t,s)).join(`
|
|
3
|
+
`)}var Be,ss,Tr,ot,rs,Rr,is,at,Xt,Zt,es,ts,nt,_r,Ar,Fr,ct=be(()=>{it();Be="\x1B",ss="\x9B",Tr=39,ot="\x07",rs="[",Rr="]",is="m",at=`${Rr}8;;`,Xt=new RegExp(`(?:\\${rs}(?<code>\\d+)m|\\${at}(?<uri>.*)${ot})`,"y"),Zt=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},es=e=>`${Be}${rs}${e}${is}`,ts=e=>`${Be}${at}${e}${ot}`,nt=(e,t,s)=>{let r=t[Symbol.iterator](),i=!1,o=!1,a=e.at(-1),u=a===void 0?0:j(a),c=r.next(),l=r.next(),d=0;for(;!c.done;){let g=c.value,p=j(g);u+p<=s?e[e.length-1]+=g:(e.push(g),u=0),(g===Be||g===ss)&&(i=!0,o=t.startsWith(at,d+1)),i?o?g===ot&&(i=!1,o=!1):g===is&&(i=!1):(u+=p,u===s&&!l.done&&(e.push(""),u=0)),c=l,l=r.next(),d+=g.length}a=e.at(-1),!u&&a!==void 0&&a.length&&e.length>1&&(e[e.length-2]+=e.pop())},_r=e=>{let t=e.split(" "),s=t.length;for(;s&&!j(t[s-1]);)s--;return s===t.length?e:t.slice(0,s).join(" ")+t.slice(s).join("")},Ar=(e,t,s={})=>{if(s.trim!==!1&&e.trim()==="")return"";let r="",i,o,a=e.split(" "),u=[""],c=0;for(let g=0;g<a.length;g++){let p=a[g];if(s.trim!==!1){let m=u.at(-1)??"",b=m.trimStart();m.length!==b.length&&(u[u.length-1]=b,c=j(b))}g!==0&&(c>=t&&(s.wordWrap===!1||s.trim===!1)&&(u.push(""),c=0),(c||s.trim===!1)&&(u[u.length-1]+=" ",c++));let y=j(p);if(s.hard&&y>t){let m=t-c,b=1+Math.floor((y-m-1)/t);Math.floor((y-1)/t)<b&&u.push(""),nt(u,p,t),c=j(u.at(-1)??"");continue}if(c+y>t&&c&&y){if(s.wordWrap===!1&&c<t){nt(u,p,t),c=j(u.at(-1)??"");continue}u.push(""),c=0}if(c+y>t&&s.wordWrap===!1){nt(u,p,t),c=j(u.at(-1)??"");continue}u[u.length-1]+=p,c+=y}s.trim!==!1&&(u=u.map(g=>_r(g)));let l=u.join(`
|
|
4
|
+
`),d=!1;for(let g=0;g<l.length;g++){let p=l[g];if(r+=p,d)d=!1;else if(d=p>="\uD800"&&p<="\uDBFF",d)continue;if(p===Be||p===ss){Xt.lastIndex=g+1;let m=Xt.exec(l)?.groups;if(m?.code!==void 0){let b=Number.parseFloat(m.code);i=b===Tr?void 0:b}else m?.uri!==void 0&&(o=m.uri.length===0?void 0:m.uri)}if(l[g+1]===`
|
|
5
|
+
`){o&&(r+=ts(""));let y=i?Zt(i):void 0;i&&y&&(r+=es(y))}else p===`
|
|
6
|
+
`&&(i&&Zt(i)&&(r+=es(i)),o&&(r+=ts(o)))}return r},Fr=/\r?\n/});var ht=fr((mn,ns)=>{"use strict";var ut="\x1B",D=`${ut}[`,Mr="\x07",lt={to(e,t){return t?`${D}${t+1};${e+1}H`:`${D}${e+1}G`},move(e,t){let s="";return e<0?s+=`${D}${-e}D`:e>0&&(s+=`${D}${e}C`),t<0?s+=`${D}${-t}A`:t>0&&(s+=`${D}${t}B`),s},up:(e=1)=>`${D}${e}A`,down:(e=1)=>`${D}${e}B`,forward:(e=1)=>`${D}${e}C`,backward:(e=1)=>`${D}${e}D`,nextLine:(e=1)=>`${D}E`.repeat(e),prevLine:(e=1)=>`${D}F`.repeat(e),left:`${D}G`,hide:`${D}?25l`,show:`${D}?25h`,save:`${ut}7`,restore:`${ut}8`},Or={up:(e=1)=>`${D}S`.repeat(e),down:(e=1)=>`${D}T`.repeat(e)},Br={screen:`${D}2J`,up:(e=1)=>`${D}1J`.repeat(e),down:(e=1)=>`${D}J`.repeat(e),line:`${D}2K`,lineEnd:`${D}K`,lineStart:`${D}1K`,lines(e){let t="";for(let s=0;s<e;s++)t+=this.line+(s<e-1?lt.up():"");return e&&(t+=lt.left),t}};ns.exports={cursor:lt,scroll:Or,erase:Br,beep:Mr}});import{styleText as we}from"node:util";import{stdout as gt,stdin as us}from"node:process";import*as oe from"node:readline";import kr from"node:readline";import{ReadStream as os}from"node:tty";function ne(e,t,s){if(!s.some(a=>!a.disabled))return e;let r=e+t,i=Math.max(s.length-1,0),o=r<0?i:r>i?0:r;return s[o].disabled?ne(o,t<0?-1:1,s):o}function ke(e,t,s,r){let i=r.split(`
|
|
7
|
+
`),o=0,a=e;for(let c of i){if(a<=c.length)break;a-=c.length+1,o++}for(o=Math.max(0,Math.min(i.length-1,o+s)),a=Math.min(a,i[o].length)+t;a<0&&o>0;)o--,a+=i[o].length+1;for(;a>i[o].length&&o<i.length-1;)a-=i[o].length+1,o++;a=Math.max(0,Math.min(i[o].length,a));let u=0;for(let c=0;c<o;c++)u+=i[c].length+1;return u+a}function ls(e){if(e.aliases!==void 0){let t=e.aliases;for(let s in t){if(!Object.hasOwn(t,s))continue;let r=t[s];I.actions.has(r)&&(I.aliases.has(s)||I.aliases.set(s,r))}}if(e.messages!==void 0){let t=e.messages;t.cancel!==void 0&&(I.messages.cancel=t.cancel),t.error!==void 0&&(I.messages.error=t.error)}if(e.withGuide!==void 0&&(I.withGuide=e.withGuide!==!1),e.date!==void 0){let t=e.date;t.monthNames!==void 0&&(I.date.monthNames=[...t.monthNames]),t.messages!==void 0&&(t.messages.required!==void 0&&(I.date.messages.required=t.messages.required),t.messages.invalidMonth!==void 0&&(I.date.messages.invalidMonth=t.messages.invalidMonth),t.messages.invalidDay!==void 0&&(I.date.messages.invalidDay=t.messages.invalidDay),t.messages.afterMin!==void 0&&(I.date.messages.afterMin=t.messages.afterMin),t.messages.beforeMax!==void 0&&(I.date.messages.beforeMax=t.messages.beforeMax))}}function ft(e,t){if(typeof e=="string")return I.aliases.get(e)===t;for(let s of e)if(s!==void 0&&ft(s,t))return!0;return!1}function Nr(e,t){if(e===t)return;let s=e.split(`
|
|
8
|
+
`),r=t.split(`
|
|
9
|
+
`),i=Math.max(s.length,r.length),o=[];for(let a=0;a<i;a++)s[a]!==r[a]&&o.push(a);return{lines:o,numLinesBefore:s.length,numLinesAfter:r.length,numLines:i}}function Ce(e){return e===mt}function Pe(e,t){let s=e;s.isTTY&&s.setRawMode(t)}function hs({input:e=us,output:t=gt,overwrite:s=!0,hideCursor:r=!0}={}){let i=oe.createInterface({input:e,output:t,prompt:"",tabSize:1});oe.emitKeypressEvents(e,i),e instanceof os&&e.isTTY&&e.setRawMode(!0);let o=(a,{name:u,sequence:c})=>{let l=String(a);if(ft([l,u,c],"cancel")){r&&t.write(z.cursor.show),process.exit(0);return}if(!s)return;oe.moveCursor(t,u==="return"?0:-1,u==="return"?-1:0,()=>{oe.clearLine(t,1,()=>{e.once("keypress",o)})})};return r&&t.write(z.cursor.hide),e.once("keypress",o),()=>{e.off("keypress",o),r&&t.write(z.cursor.show),e instanceof os&&e.isTTY&&!Dr&&e.setRawMode(!1),i.terminal=!1,i.close()}}function G(e,t,s,r=s,i=s,o){let a=le(e??gt);return se(t,a-s.length,{hard:!0,trim:!1}).split(`
|
|
10
|
+
`).map((u,c,l)=>{let d=o?o(u,c):u;return c===0?`${r}${d}`:c===l.length-1?`${i}${d}`:`${s}${d}`}).join(`
|
|
11
|
+
`)}function Vr(e,t){if(e===void 0||t.length===0)return 0;let s=t.findIndex(r=>r.value===e);return s!==-1?s:0}function Ur(e,t){return(t.label??String(t.value)).toLowerCase().includes(e.toLowerCase())}function Gr(e,t){if(t)return e?t:t[0]}function as(e){return[...e].map(t=>jr[t])}function Wr(e){let t=new Intl.DateTimeFormat(e,{year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(new Date(2e3,0,15)),s=[],r="/";for(let i of t)i.type==="literal"?r=i.value.trim()||i.value:(i.type==="year"||i.type==="month"||i.type==="day")&&s.push({type:i.type,len:i.type==="year"?4:2});return{segments:s,separator:r}}function dt(e){return Number.parseInt((e||"0").replace(/_/g,"0"),10)||0}function Le(e){return{year:dt(e.year),month:dt(e.month),day:dt(e.day)}}function pt(e,t){return new Date(e||2001,t||1,0).getDate()}function ds(e){let{year:t,month:s,day:r}=Le(e);if(!t||t<0||t>9999||!s||s<1||s>12||!r||r<1)return;let i=new Date(Date.UTC(t,s-1,r));if(!(i.getUTCFullYear()!==t||i.getUTCMonth()!==s-1||i.getUTCDate()!==r))return{year:t,month:s,day:r}}function cs(e){let t=ds(e);return t?new Date(Date.UTC(t.year,t.month-1,t.day)):void 0}function qr(e,t,s,r){let i=s?{year:s.getUTCFullYear(),month:s.getUTCMonth()+1,day:s.getUTCDate()}:null,o=r?{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate()}:null;return e==="year"?{min:i?.year??1,max:o?.year??9999}:e==="month"?{min:i&&t.year===i.year?i.month:1,max:o&&t.year===o.year?o.month:12}:{min:i&&t.year===i.year&&t.month===i.month?i.day:1,max:o&&t.year===o.year&&t.month===o.month?o.day:pt(t.year,t.month)}}var z,Pr,Lr,I,Dr,mt,le,$t,ie,yt,Ne,jr,De,Ve,Ue,ms,Ge,je,We,qe,vt=be(()=>{ct();z=Gt(ht(),1);Pr=["up","down","left","right","space","enter","cancel"],Lr=["January","February","March","April","May","June","July","August","September","October","November","December"],I={actions:new Set(Pr),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0,date:{monthNames:[...Lr],messages:{required:"Please enter a valid date",invalidMonth:"There are only 12 months in a year",invalidDay:(e,t)=>`There are only ${e} days in ${t}`,afterMin:e=>`Date must be on or after ${e.toISOString().slice(0,10)}`,beforeMax:e=>`Date must be on or before ${e.toISOString().slice(0,10)}`}}};Dr=globalThis.process.platform.startsWith("win"),mt=Symbol("clack:cancel");le=e=>"columns"in e&&typeof e.columns=="number"?e.columns:80,$t=e=>"rows"in e&&typeof e.rows=="number"?e.rows:20;ie=class{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";constructor(e,t=!0){let{input:s=us,output:r=gt,render:i,signal:o,...a}=e;this.opts=a,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=i.bind(this),this._track=t,this._abortSignal=o,this.input=s,this.output=r}unsubscribe(){this._subscribers.clear()}setSubscriber(e,t){let s=this._subscribers.get(e)??[];s.push(t),this._subscribers.set(e,s)}on(e,t){this.setSubscriber(e,{cb:t})}once(e,t){this.setSubscriber(e,{cb:t,once:!0})}emit(e,...t){let s=this._subscribers.get(e)??[],r=[];for(let i of s)i.cb(...t),i.once&&r.push(()=>s.splice(s.indexOf(i),1));for(let i of r)i()}prompt(){return new Promise(e=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(mt);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=kr.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on("keypress",this.onKeypress),Pe(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(z.cursor.show),this.output.off("resize",this.render),Pe(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(z.cursor.show),this.output.off("resize",this.render),Pe(this.input,!1),e(mt)})})}_isActionKey(e,t){return e===" "}_shouldSubmit(e,t){return!0}_setValue(e){this.value=e,this.emit("value",this.value)}_setUserInput(e,t){this.userInput=e??"",this.emit("userInput",this.userInput),t&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:"u"}),this._setUserInput("")}onKeypress(e,t){if(this._track&&t.name!=="return"&&(t.name&&this._isActionKey(e,t)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state==="error"&&(this.state="active"),t?.name&&(!this._track&&I.aliases.has(t.name)&&this.emit("cursor",I.aliases.get(t.name)),I.actions.has(t.name)&&this.emit("cursor",t.name)),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),this.emit("key",e?.toLowerCase(),t),t?.name==="return"&&this._shouldSubmit(e,t)){if(this.opts.validate){let s=this.opts.validate(this.value);s&&(this.error=s instanceof Error?s.message:s,this.state="error",this.rl?.write(this.userInput))}this.state!=="error"&&(this.state="submit")}ft([e,t?.name,t?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
|
|
12
|
+
`),Pe(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=se(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
|
|
13
|
+
`).length-1;this.output.write(z.cursor.move(-999,e*-1))}render(){let e=se(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(z.cursor.hide);else{let t=Nr(this._prevFrame,e),s=$t(this.output);if(this.restoreCursor(),t){let r=Math.max(0,t.numLinesAfter-s),i=Math.max(0,t.numLinesBefore-s),o=t.lines.find(a=>a>=r);if(o===void 0){this._prevFrame=e;return}if(t.lines.length===1){this.output.write(z.cursor.move(0,o-i)),this.output.write(z.erase.lines(1));let a=e.split(`
|
|
14
|
+
`);this.output.write(a[o]),this._prevFrame=e,this.output.write(z.cursor.move(0,a.length-o-1));return}else if(t.lines.length>1){if(r<i)o=r;else{let u=o-i;u>0&&this.output.write(z.cursor.move(0,u))}this.output.write(z.erase.down());let a=e.split(`
|
|
15
|
+
`).slice(o);this.output.write(a.join(`
|
|
16
|
+
`)),this._prevFrame=e;return}}this.output.write(z.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}};yt=class extends ie{filteredOptions;multiple;isNavigating=!1;selectedValues=[];focusedValue;#t=0;#i="";#e;#n;#a;get cursor(){return this.#t}get userInputWithCursor(){if(!this.userInput)return we(["inverse","hidden"],"_");if(this._cursor>=this.userInput.length)return`${this.userInput}\u2588`;let e=this.userInput.slice(0,this._cursor),[t,...s]=this.userInput.slice(this._cursor);return`${e}${we("inverse",t)}${s.join("")}`}get options(){return typeof this.#n=="function"?this.#n():this.#n}constructor(e){super(e),this.#n=e.options,this.#a=e.placeholder;let t=this.options;this.filteredOptions=[...t],this.multiple=e.multiple===!0,this.#e=typeof e.options=="function"?e.filter:e.filter??Ur;let s;if(e.initialValue&&Array.isArray(e.initialValue)?this.multiple?s=e.initialValue:s=e.initialValue.slice(0,1):!this.multiple&&this.options.length>0&&(s=[this.options[0].value]),s)for(let r of s){let i=t.findIndex(o=>o.value===r);i!==-1&&(this.toggleSelected(r),this.#t=i)}this.focusedValue=this.options[this.#t]?.value,this.on("key",(r,i)=>this.#s(r,i)),this.on("userInput",r=>this.#r(r))}_isActionKey(e,t){return e===" "||this.multiple&&this.isNavigating&&t.name==="space"&&e!==void 0&&e!==""}#s(e,t){let s=t.name==="up",r=t.name==="down",i=t.name==="return",o=this.userInput===""||this.userInput===" ",a=this.#a,u=this.options,c=a!==void 0&&a!==""&&u.some(l=>!l.disabled&&(this.#e?this.#e(a,l):!0));if(t.name==="tab"&&o&&c){this.userInput===" "&&this._clearUserInput(),this._setUserInput(a,!0),this.isNavigating=!1;return}s||r?(this.#t=ne(this.#t,s?-1:1,this.filteredOptions),this.focusedValue=this.filteredOptions[this.#t]?.value,this.multiple||(this.selectedValues=[this.focusedValue]),this.isNavigating=!0):i?this.value=Gr(this.multiple,this.selectedValues):this.multiple?this.focusedValue!==void 0&&(t.name==="tab"||this.isNavigating&&t.name==="space")?this.toggleSelected(this.focusedValue):this.isNavigating=!1:(this.focusedValue&&(this.selectedValues=[this.focusedValue]),this.isNavigating=!1)}deselectAll(){this.selectedValues=[]}toggleSelected(e){this.filteredOptions.length!==0&&(this.multiple?this.selectedValues.includes(e)?this.selectedValues=this.selectedValues.filter(t=>t!==e):this.selectedValues=[...this.selectedValues,e]:this.selectedValues=[e])}#r(e){if(e!==this.#i){this.#i=e;let t=this.options;e&&this.#e?this.filteredOptions=t.filter(i=>this.#e?.(e,i)):this.filteredOptions=[...t];let s=Vr(this.focusedValue,this.filteredOptions);this.#t=ne(s,0,this.filteredOptions);let r=this.filteredOptions[this.#t];r&&!r.disabled?this.focusedValue=r.value:this.focusedValue=void 0,this.multiple||(this.focusedValue!==void 0?this.toggleSelected(this.focusedValue):this.deselectAll())}}},Ne=class extends ie{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(t){super(t,!1),this.value=!!t.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",s=>{this.output.write(z.cursor.move(0,-1)),this.value=s,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}},jr={Y:{type:"year",len:4},M:{type:"month",len:2},D:{type:"day",len:2}};De=class extends ie{#t;#i;#e;#n;#a;#s={segmentIndex:0,positionInSegment:0};#r=!0;#o=null;inlineError="";get segmentCursor(){return{...this.#s}}get segmentValues(){return{...this.#e}}get segments(){return this.#t}get separator(){return this.#i}get formattedValue(){return this.#h(this.#e)}#h(t){return this.#t.map(s=>t[s.type]).join(this.#i)}#c(){this._setUserInput(this.#h(this.#e)),this._setValue(cs(this.#e)??void 0)}constructor(t){let s=t.format?{segments:as(t.format),separator:t.separator??"/"}:Wr(t.locale),r=t.separator??s.separator,i=t.format?as(t.format):s.segments,o=t.initialValue??t.defaultValue,a=o?{year:String(o.getUTCFullYear()).padStart(4,"0"),month:String(o.getUTCMonth()+1).padStart(2,"0"),day:String(o.getUTCDate()).padStart(2,"0")}:{year:"____",month:"__",day:"__"},u=i.map(c=>a[c.type]).join(r);super({...t,initialUserInput:u},!1),this.#t=i,this.#i=r,this.#e=a,this.#n=t.minDate,this.#a=t.maxDate,this.#c(),this.on("cursor",c=>this.#p(c)),this.on("key",(c,l)=>this.#g(c,l)),this.on("finalize",()=>this.#f(t))}#u(){let t=Math.max(0,Math.min(this.#s.segmentIndex,this.#t.length-1)),s=this.#t[t];if(s)return this.#s.positionInSegment=Math.max(0,Math.min(this.#s.positionInSegment,s.len-1)),{segment:s,index:t}}#l(t){this.inlineError="",this.#o=null;let s=this.#u();s&&(this.#s.segmentIndex=Math.max(0,Math.min(this.#t.length-1,s.index+t)),this.#s.positionInSegment=0,this.#r=!0)}#d(t){let s=this.#u();if(!s)return;let{segment:r}=s,i=this.#e[r.type],o=!i||i.replace(/_/g,"")==="",a=Number.parseInt((i||"0").replace(/_/g,"0"),10)||0,u=qr(r.type,Le(this.#e),this.#n,this.#a),c;o?c=t===1?u.min:u.max:c=Math.max(Math.min(u.max,a+t),u.min),this.#e={...this.#e,[r.type]:c.toString().padStart(r.len,"0")},this.#r=!0,this.#o=null,this.#c()}#p(t){if(t)switch(t){case"right":return this.#l(1);case"left":return this.#l(-1);case"up":return this.#d(1);case"down":return this.#d(-1)}}#g(t,s){if(s?.name==="backspace"||s?.sequence==="\x7F"||s?.sequence==="\b"||t==="\x7F"||t==="\b"){this.inlineError="";let r=this.#u();if(!r)return;if(!this.#e[r.segment.type].replace(/_/g,"")){this.#l(-1);return}this.#e[r.segment.type]="_".repeat(r.segment.len),this.#r=!0,this.#s.positionInSegment=0,this.#c();return}if(s?.name==="tab"){this.inlineError="";let r=this.#u();if(!r)return;let i=s.shift?-1:1,o=r.index+i;o>=0&&o<this.#t.length&&(this.#s.segmentIndex=o,this.#s.positionInSegment=0,this.#r=!0);return}if(t&&/^[0-9]$/.test(t)){let r=this.#u();if(!r)return;let{segment:i}=r,o=!this.#e[i.type].replace(/_/g,"");if(this.#r&&this.#o!==null&&!o){let y=this.#o+t,m={...this.#e,[i.type]:y},b=this.#m(m,i);if(b){this.inlineError=b,this.#o=null,this.#r=!1;return}this.inlineError="",this.#e[i.type]=y,this.#o=null,this.#r=!1,this.#c(),r.index<this.#t.length-1&&(this.#s.segmentIndex=r.index+1,this.#s.positionInSegment=0,this.#r=!0);return}this.#r&&!o&&(this.#e[i.type]="_".repeat(i.len),this.#s.positionInSegment=0),this.#r=!1,this.#o=null;let a=this.#e[i.type],u=a.indexOf("_"),c=u>=0?u:Math.min(this.#s.positionInSegment,i.len-1);if(c<0||c>=i.len)return;let l=a.slice(0,c)+t+a.slice(c+1),d=!1;if(c===0&&a==="__"&&(i.type==="month"||i.type==="day")){let y=Number.parseInt(t,10);l=`0${t}`,d=y<=(i.type==="month"?1:2)}if(i.type==="year"&&(l=(a.replace(/_/g,"")+t).padStart(i.len,"_")),!l.includes("_")){let y={...this.#e,[i.type]:l},m=this.#m(y,i);if(m){this.inlineError=m;return}}this.inlineError="",this.#e[i.type]=l;let g=l.includes("_")?void 0:ds(this.#e);if(g){let{year:y,month:m}=g,b=pt(y,m);this.#e={year:String(Math.max(0,Math.min(9999,y))).padStart(4,"0"),month:String(Math.max(1,Math.min(12,m))).padStart(2,"0"),day:String(Math.max(1,Math.min(b,g.day))).padStart(2,"0")}}this.#c();let p=l.indexOf("_");d?(this.#r=!0,this.#o=t):p>=0?this.#s.positionInSegment=p:u>=0&&r.index<this.#t.length-1?(this.#s.segmentIndex=r.index+1,this.#s.positionInSegment=0,this.#r=!0):this.#s.positionInSegment=Math.min(c+1,i.len-1)}}#m(t,s){let{month:r,day:i}=Le(t);if(s.type==="month"&&(r<0||r>12))return I.date.messages.invalidMonth;if(s.type==="day"&&(i<0||i>31))return I.date.messages.invalidDay(31,"any month")}#f(t){let{year:s,month:r,day:i}=Le(this.#e);if(s&&r&&i){let o=pt(s,r);this.#e={...this.#e,day:String(Math.min(i,o)).padStart(2,"0")}}this.value=cs(this.#e)??t.defaultValue??void 0}},Ve=class extends ie{options;cursor=0;#t;getGroupItems(t){return this.options.filter(s=>s.group===t)}isGroupSelected(t){let s=this.getGroupItems(t),r=this.value;return r===void 0?!1:s.every(i=>r.includes(i.value))}toggleValue(){let t=this.options[this.cursor];if(this.value===void 0&&(this.value=[]),t.group===!0){let s=t.value,r=this.getGroupItems(s);this.isGroupSelected(s)?this.value=this.value.filter(i=>r.findIndex(o=>o.value===i)===-1):this.value=[...this.value,...r.map(i=>i.value)],this.value=Array.from(new Set(this.value))}else{let s=this.value.includes(t.value);this.value=s?this.value.filter(r=>r!==t.value):[...this.value,t.value]}}constructor(t){super(t,!1);let{options:s}=t;this.#t=t.selectableGroups!==!1,this.options=Object.entries(s).flatMap(([r,i])=>[{value:r,group:!0,label:r},...i.map(o=>({...o,group:r}))]),this.value=[...t.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:r})=>r===t.cursorAt),this.#t?0:1),this.on("cursor",r=>{switch(r){case"left":case"up":{this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;let i=this.options[this.cursor]?.group===!0;!this.#t&&i&&(this.cursor=this.cursor===0?this.options.length-1:this.cursor-1);break}case"down":case"right":{this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;let i=this.options[this.cursor]?.group===!0;!this.#t&&i&&(this.cursor=this.cursor===this.options.length-1?0:this.cursor+1);break}case"space":this.toggleValue();break}})}},Ue=class extends ie{#t=!1;#i;focused="editor";get userInputWithCursor(){if(this.state==="submit")return this.userInput;let t=this.userInput;if(this.cursor>=t.length)return`${t}\u2588`;let s=t.slice(0,this.cursor),r=t[this.cursor],i=t.slice(this.cursor+1);return r===`
|
|
17
|
+
`?`${s}\u2588
|
|
18
|
+
${i}`:`${s}${we("inverse",r)}${i}`}get cursor(){return this._cursor}#e(t){if(this.userInput.length===0){this._setUserInput(t);return}this._setUserInput(this.userInput.slice(0,this.cursor)+t+this.userInput.slice(this.cursor))}#n(t){let s=this.value??"";switch(t){case"up":this._cursor=ke(this._cursor,0,-1,s);return;case"down":this._cursor=ke(this._cursor,0,1,s);return;case"left":this._cursor=ke(this._cursor,-1,0,s);return;case"right":this._cursor=ke(this._cursor,1,0,s);return}}_shouldSubmit(t,s){if(this.#i)return this.focused==="submit"?!0:(this.#e(`
|
|
19
|
+
`),this._cursor++,!1);let r=this.#t;return this.#t=!0,r?(this.userInput[this.cursor-1]===`
|
|
20
|
+
`&&(this._setUserInput(this.userInput.slice(0,this.cursor-1)+this.userInput.slice(this.cursor)),this._cursor--),!0):(this.#e(`
|
|
21
|
+
`),this._cursor++,!1)}constructor(t){super(t,!1),this.#i=t.showSubmit??!1,this.on("key",(s,r)=>{if(r?.name&&I.actions.has(r.name)){this.#n(r.name);return}if(s===" "&&this.#i){this.focused=this.focused==="editor"?"submit":"editor";return}if(r?.name!=="return"){if(this.#t=!1,r?.name==="backspace"&&this.cursor>0){this._setUserInput(this.userInput.slice(0,this.cursor-1)+this.userInput.slice(this.cursor)),this._cursor--;return}if(r?.name==="delete"&&this.cursor<this.userInput.length){this._setUserInput(this.userInput.slice(0,this.cursor)+this.userInput.slice(this.cursor+1));return}s&&(this.#i&&this.focused==="submit"&&(this.focused="editor"),this.#e(s??""),this._cursor++)}}),this.on("userInput",s=>{this._setValue(s)}),this.on("finalize",()=>{this.value||(this.value=t.defaultValue),this.value===void 0&&(this.value="")})}},ms=class extends ie{options;cursor=0;get _value(){return this.options[this.cursor].value}get _enabledOptions(){return this.options.filter(e=>e.disabled!==!0)}toggleAll(){let e=this._enabledOptions,t=this.value!==void 0&&this.value.length===e.length;this.value=t?[]:e.map(s=>s.value)}toggleInvert(){let e=this.value;if(!e)return;let t=this._enabledOptions.filter(s=>!e.includes(s.value));this.value=t.map(s=>s.value)}toggleValue(){this.value===void 0&&(this.value=[]);let e=this.value.includes(this._value);this.value=e?this.value.filter(t=>t!==this._value):[...this.value,this._value]}constructor(e){super(e,!1),this.options=e.options,this.value=[...e.initialValues??[]];let t=Math.max(this.options.findIndex(({value:s})=>s===e.cursorAt),0);this.cursor=this.options[t].disabled?ne(t,1,this.options):t,this.on("key",s=>{s==="a"&&this.toggleAll(),s==="i"&&this.toggleInvert()}),this.on("cursor",s=>{switch(s){case"left":case"up":this.cursor=ne(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=ne(this.cursor,1,this.options);break;case"space":this.toggleValue();break}})}},Ge=class extends ie{_mask="\u2022";get cursor(){return this._cursor}get masked(){return this.userInput.replaceAll(/./g,this._mask)}get userInputWithCursor(){if(this.state==="submit"||this.state==="cancel")return this.masked;let t=this.userInput;if(this.cursor>=t.length)return`${this.masked}${we(["inverse","hidden"],"_")}`;let s=this.masked,r=s.slice(0,this.cursor),i=s.slice(this.cursor);return`${r}${we("inverse",i[0])}${i.slice(1)}`}clear(){this._clearUserInput()}constructor({mask:t,...s}){super(s),this._mask=t??"\u2022",this.on("userInput",r=>{this._setValue(r)})}},je=class extends ie{options;cursor=0;get _selectedValue(){return this.options[this.cursor]}changeValue(){this.value=this._selectedValue.value}constructor(t){super(t,!1),this.options=t.options;let s=this.options.findIndex(({value:i})=>i===t.initialValue),r=s===-1?0:s;this.cursor=this.options[r].disabled?ne(r,1,this.options):r,this.changeValue(),this.on("cursor",i=>{switch(i){case"left":case"up":this.cursor=ne(this.cursor,-1,this.options);break;case"down":case"right":this.cursor=ne(this.cursor,1,this.options);break}this.changeValue()})}},We=class extends ie{options;cursor=0;constructor(t){super(t,!1),this.options=t.options;let s=t.caseSensitive===!0,r=this.options.map(({value:[i]})=>s?i:i?.toLowerCase());this.cursor=Math.max(r.indexOf(t.initialValue),0),this.on("key",(i,o)=>{if(!i)return;let a=s&&o.shift?i.toUpperCase():i;if(!r.includes(a))return;let u=this.options.find(({value:[c]})=>s?c===a:c?.toLowerCase()===i);u&&(this.value=u.value,this.state="submit",this.emit("submit"))})}},qe=class extends ie{get userInputWithCursor(){if(this.state==="submit")return this.userInput;let t=this.userInput;if(this.cursor>=t.length)return`${this.userInput}\u2588`;let s=t.slice(0,this.cursor),[r,...i]=t.slice(this.cursor);return`${s}${we("inverse",r)}${i.join("")}`}get cursor(){return this._cursor}constructor(t){super({...t,initialUserInput:t.initialUserInput??t.initialValue}),this.on("userInput",s=>{this._setValue(s)}),this.on("finalize",()=>{this.value||(this.value=t.defaultValue),this.value===void 0&&(this.value="")})}}});var As={};$r(As,{S_BAR:()=>f,S_BAR_END:()=>V,S_BAR_END_RIGHT:()=>Ss,S_BAR_H:()=>Je,S_BAR_START:()=>St,S_BAR_START_RIGHT:()=>Is,S_CHECKBOX_ACTIVE:()=>ze,S_CHECKBOX_INACTIVE:()=>Se,S_CHECKBOX_SELECTED:()=>de,S_CONNECT_LEFT:()=>xs,S_CORNER_BOTTOM_LEFT:()=>Tt,S_CORNER_BOTTOM_RIGHT:()=>xt,S_CORNER_TOP_LEFT:()=>Ts,S_CORNER_TOP_RIGHT:()=>Et,S_ERROR:()=>Ft,S_INFO:()=>Rt,S_PASSWORD_MASK:()=>Es,S_RADIO_ACTIVE:()=>Ae,S_RADIO_INACTIVE:()=>me,S_STEP_ACTIVE:()=>Cs,S_STEP_CANCEL:()=>Ct,S_STEP_ERROR:()=>It,S_STEP_SUBMIT:()=>pe,S_SUCCESS:()=>_t,S_WARN:()=>At,autocomplete:()=>_s,autocompleteMultiselect:()=>Qr,box:()=>ti,cancel:()=>Fe,confirm:()=>ce,date:()=>si,group:()=>oi,groupMultiselect:()=>ai,intro:()=>Ot,isCI:()=>wt,isCancel:()=>Ce,isTTY:()=>ws,limitOptions:()=>ae,log:()=>E,multiline:()=>ci,multiselect:()=>kt,note:()=>ge,outro:()=>Bt,password:()=>hi,path:()=>di,progress:()=>pi,select:()=>K,selectKey:()=>gi,settings:()=>I,spinner:()=>fe,stream:()=>he,symbol:()=>J,symbolBar:()=>Mt,taskLog:()=>yi,tasks:()=>fi,text:()=>ue,unicode:()=>Ke,unicodeOr:()=>A,updateSettings:()=>ls});import{styleText as n,stripVTControlCharacters as bt}from"node:util";import Q from"node:process";import{existsSync as Hr,lstatSync as ps,readdirSync as Kr}from"node:fs";import{dirname as gs,join as zr}from"node:path";function Jr(){return Q.platform!=="win32"?Q.env.TERM!=="linux":!!Q.env.CI||!!Q.env.WT_SESSION||!!Q.env.TERMINUS_SUBLIME||Q.env.ConEmuTask==="{cmd::Cmder}"||Q.env.TERM_PROGRAM==="Terminus-Sublime"||Q.env.TERM_PROGRAM==="vscode"||Q.env.TERM==="xterm-256color"||Q.env.TERM==="alacritty"||Q.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}function $s(e){return e.label??String(e.value??"")}function Rs(e,t){if(!e)return!0;let s=(t.label??String(t.value??"")).toLowerCase(),r=(t.hint??"").toLowerCase(),i=String(t.value).toLowerCase(),o=e.toLowerCase();return s.includes(o)||r.includes(o)||i.includes(o)}function Yr(e,t){let s=[];for(let r of t)e.includes(r.value)&&s.push(r);return s}function ys(e,t,s,r){let i=s,o=s;return r==="center"?i=Math.floor((t-e)/2):r==="right"&&(i=t-e-s),o=t-i-e,[i,o]}function ri(e,t){let s=e.segmentValues,r=e.segmentCursor;if(t==="submit"||t==="cancel")return e.formattedValue;let i=n("gray",e.separator);return e.segments.map((o,a)=>{let u=a===r.segmentIndex&&!["submit","cancel"].includes(t),c=ni[o.type];return ii(s[o.type],{isActive:u,label:c})}).join(i)}function ii(e,t){let s=!e||e.replace(/_/g,"")==="";return t.isActive?n("inverse",s?t.label:e.replace(/_/g," ")):s?n("dim",t.label):e.replace(/_/g,n("dim"," "))}function pi({style:e="heavy",max:t=100,size:s=40,...r}={}){let i=fe(r),o=0,a="",u=Math.max(1,t),c=Math.max(1,s),l=y=>{switch(y){case"initial":case"active":return m=>n("magenta",m);case"error":case"cancel":return m=>n("red",m);case"submit":return m=>n("green",m);default:return m=>n("magenta",m)}},d=(y,m)=>{let b=Math.floor(o/u*c);return`${l(y)(vs[e].repeat(b))}${n("dim",vs[e].repeat(c-b))} ${m}`},g=(y="")=>{a=y,i.start(d("initial",y))},p=(y=1,m)=>{o=Math.min(u,y+o),i.message(d("active",m??a)),a=m??a};return{start:g,stop:i.stop,cancel:i.cancel,error:i.error,clear:i.clear,advance:p,isCancelled:i.isCancelled,message:y=>p(0,y)}}var Ie,Ke,wt,ws,A,Cs,Ct,It,pe,St,f,V,Is,Ss,Ae,me,ze,de,Se,Es,Je,Et,xs,xt,Tt,Ts,Rt,_t,At,Ft,J,Mt,fs,ae,_s,Qr,Xr,Zr,ei,ti,ce,si,ni,oi,ai,E,Fe,Ot,Bt,ci,_e,kt,ui,li,ge,hi,di,mi,fe,vs,He,K,gi,bs,he,fi,$i,yi,ue,X=be(()=>{vt();vt();ct();it();Ie=Gt(ht(),1);Ke=Jr(),wt=()=>process.env.CI==="true",ws=e=>e.isTTY===!0,A=(e,t)=>Ke?e:t,Cs=A("\u25C6","*"),Ct=A("\u25A0","x"),It=A("\u25B2","x"),pe=A("\u25C7","o"),St=A("\u250C","T"),f=A("\u2502","|"),V=A("\u2514","\u2014"),Is=A("\u2510","T"),Ss=A("\u2518","\u2014"),Ae=A("\u25CF",">"),me=A("\u25CB"," "),ze=A("\u25FB","[\u2022]"),de=A("\u25FC","[+]"),Se=A("\u25FB","[ ]"),Es=A("\u25AA","\u2022"),Je=A("\u2500","-"),Et=A("\u256E","+"),xs=A("\u251C","+"),xt=A("\u256F","+"),Tt=A("\u2570","+"),Ts=A("\u256D","+"),Rt=A("\u25CF","\u2022"),_t=A("\u25C6","*"),At=A("\u25B2","!"),Ft=A("\u25A0","x"),J=e=>{switch(e){case"initial":case"active":return n("cyan",Cs);case"cancel":return n("red",Ct);case"error":return n("yellow",It);case"submit":return n("green",pe)}},Mt=e=>{switch(e){case"initial":case"active":return n("cyan",f);case"cancel":return n("red",f);case"error":return n("yellow",f);case"submit":return n("green",f)}},fs=(e,t,s,r,i,o=!1)=>{let a=t,u=0;if(o)for(let c=r-1;c>=s&&(a-=e[c].length,u++,!(a<=i));c--);else for(let c=s;c<r&&(a-=e[c].length,u++,!(a<=i));c++);return{lineCount:a,removals:u}},ae=({cursor:e,options:t,style:s,output:r=process.stdout,maxItems:i=Number.POSITIVE_INFINITY,columnPadding:o=0,rowPadding:a=4})=>{let u=le(r)-o,c=$t(r),l=n("dim","..."),d=Math.max(c-a,0),g=Math.max(Math.min(i,d),5),p=0;e>=g-3&&(p=Math.max(Math.min(e-g+3,t.length-g),0));let y=g<t.length&&p>0,m=g<t.length&&p+g<t.length,b=Math.min(p+g,t.length),$=[],v=0;y&&v++,m&&v++;let C=p+(y?1:0),T=b-(m?1:0);for(let x=C;x<T;x++){let P=se(s(t[x],x===e),u,{hard:!0,trim:!1}).split(`
|
|
22
|
+
`);$.push(P),v+=P.length}if(v>d){let x=0,P=0,M=v,k=e-C,N=d,W=()=>fs($,M,0,k,N),w=()=>fs($,M,k+1,$.length,N,!0);y?({lineCount:M,removals:x}=W(),M>N&&(m||(N-=1),{lineCount:M,removals:P}=w())):(m||(N-=1),{lineCount:M,removals:P}=w(),M>N&&(N-=1,{lineCount:M,removals:x}=W())),x>0&&(y=!0,$.splice(0,x)),P>0&&(m=!0,$.splice($.length-P,P))}let R=[];y&&R.push(l);for(let x of $)for(let P of x)R.push(P);return m&&R.push(l),R};_s=e=>new yt({options:e.options,initialValue:e.initialValue?[e.initialValue]:void 0,initialUserInput:e.initialUserInput,placeholder:e.placeholder,filter:e.filter??((t,s)=>Rs(t,s)),signal:e.signal,input:e.input,output:e.output,validate:e.validate,render(){let t=e.withGuide??I.withGuide,s=t?[`${n("gray",f)}`,`${J(this.state)} ${e.message}`]:[`${J(this.state)} ${e.message}`],r=this.userInput,i=this.options,o=e.placeholder,a=r===""&&o!==void 0,u=(c,l)=>{let d=$s(c),g=c.hint&&c.value===this.focusedValue?n("dim",` (${c.hint})`):"";switch(l){case"active":return`${n("green",Ae)} ${d}${g}`;case"inactive":return`${n("dim",me)} ${n("dim",d)}`;case"disabled":return`${n("gray",me)} ${n(["strikethrough","gray"],d)}`}};switch(this.state){case"submit":{let c=Yr(this.selectedValues,i),l=c.length>0?` ${n("dim",c.map($s).join(", "))}`:"",d=t?n("gray",f):"";return`${s.join(`
|
|
23
|
+
`)}
|
|
24
|
+
${d}${l}`}case"cancel":{let c=r?` ${n(["strikethrough","dim"],r)}`:"",l=t?n("gray",f):"";return`${s.join(`
|
|
25
|
+
`)}
|
|
26
|
+
${l}${c}`}default:{let c=this.state==="error"?"yellow":"cyan",l=t?`${n(c,f)} `:"",d=t?n(c,V):"",g="";if(this.isNavigating||a){let C=a?o:r;g=C!==""?` ${n("dim",C)}`:""}else g=` ${this.userInputWithCursor}`;let p=this.filteredOptions.length!==i.length?n("dim",` (${this.filteredOptions.length} match${this.filteredOptions.length===1?"":"es"})`):"",y=this.filteredOptions.length===0&&r?[`${l}${n("yellow","No matches found")}`]:[],m=this.state==="error"?[`${l}${n("yellow",this.error)}`]:[];t&&s.push(`${l.trimEnd()}`),s.push(`${l}${n("dim","Search:")}${g}${p}`,...y,...m);let b=[`${n("dim","\u2191/\u2193")} to select`,`${n("dim","Enter:")} confirm`,`${n("dim","Type:")} to search`],$=[`${l}${b.join(" \u2022 ")}`,d],v=this.filteredOptions.length===0?[]:ae({cursor:this.cursor,options:this.filteredOptions,columnPadding:t?3:0,rowPadding:s.length+$.length,style:(C,T)=>u(C,C.disabled?"disabled":T?"active":"inactive"),maxItems:e.maxItems,output:e.output});return[...s,...v.map(C=>`${l}${C}`),...$].join(`
|
|
27
|
+
`)}}}}).prompt(),Qr=e=>{let t=(r,i,o,a)=>{let u=o.includes(r.value),c=r.label??String(r.value??""),l=r.hint&&a!==void 0&&r.value===a?n("dim",` (${r.hint})`):"",d=u?n("green",de):n("dim",Se);return r.disabled?`${n("gray",Se)} ${n(["strikethrough","gray"],c)}`:i?`${d} ${c}${l}`:`${d} ${n("dim",c)}`},s=new yt({options:e.options,multiple:!0,placeholder:e.placeholder,filter:e.filter??((r,i)=>Rs(r,i)),validate:()=>{if(e.required&&s.selectedValues.length===0)return"Please select at least one item"},initialValue:e.initialValues,signal:e.signal,input:e.input,output:e.output,render(){let r=e.withGuide??I.withGuide,i=`${r?`${n("gray",f)}
|
|
28
|
+
`:""}${J(this.state)} ${e.message}
|
|
29
|
+
`,o=this.userInput,a=e.placeholder,u=o===""&&a!==void 0,c=this.isNavigating||u?n("dim",u?a:o):this.userInputWithCursor,l=this.options,d=this.filteredOptions.length!==l.length?n("dim",` (${this.filteredOptions.length} match${this.filteredOptions.length===1?"":"es"})`):"";switch(this.state){case"submit":return`${i}${r?`${n("gray",f)} `:""}${n("dim",`${this.selectedValues.length} items selected`)}`;case"cancel":return`${i}${r?`${n("gray",f)} `:""}${n(["strikethrough","dim"],o)}`;default:{let g=this.state==="error"?"yellow":"cyan",p=r?`${n(g,f)} `:"",y=r?n(g,V):"",m=[`${n("dim","\u2191/\u2193")} to navigate`,`${n("dim",this.isNavigating?"Space/Tab:":"Tab:")} select`,`${n("dim","Enter:")} confirm`,`${n("dim","Type:")} to search`],b=this.filteredOptions.length===0&&o?[`${p}${n("yellow","No matches found")}`]:[],$=this.state==="error"?[`${p}${n("yellow",this.error)}`]:[],v=[...`${i}${r?n(g,f):""}`.split(`
|
|
30
|
+
`),`${p}${n("dim","Search:")} ${c}${d}`,...b,...$],C=[`${p}${m.join(" \u2022 ")}`,y],T=ae({cursor:this.cursor,options:this.filteredOptions,style:(R,x)=>t(R,x,this.selectedValues,this.focusedValue),maxItems:e.maxItems,output:e.output,rowPadding:v.length+C.length});return[...v,...T.map(R=>`${p}${R}`),...C].join(`
|
|
31
|
+
`)}}}});return s.prompt()},Xr=[Ts,Et,Tt,xt],Zr=[St,Is,V,Ss];ei=e=>e,ti=(e="",t="",s)=>{let r=s?.output??process.stdout,i=le(r),o=2,a=s?.titlePadding??1,u=s?.contentPadding??2,c=s?.width===void 0||s.width==="auto"?1:Math.min(1,s.width),l=s?.withGuide??I.withGuide?`${f} `:"",d=s?.formatBorder??ei,g=(s?.rounded?Xr:Zr).map(d),p=d(Je),y=d(f),m=j(l),b=j(t),$=i-m,v=Math.floor(i*c)-m;if(s?.width==="auto"){let N=e.split(`
|
|
32
|
+
`),W=b+a*2;for(let B of N){let H=j(B)+u*2;H>W&&(W=H)}let w=W+o;w<v&&(v=w)}v%2!==0&&(v<$?v++:v--);let C=v-o,T=C-a*2,R=b>T?`${t.slice(0,T-3)}...`:t,[x,P]=ys(j(R),C,a,s?.titleAlign),M=se(e,C-u*2,{hard:!0,trim:!1});r.write(`${l}${g[0]}${p.repeat(x)}${R}${p.repeat(P)}${g[1]}
|
|
33
|
+
`);let k=M.split(`
|
|
34
|
+
`);for(let N of k){let[W,w]=ys(j(N),C,u,s?.contentAlign);r.write(`${l}${y}${" ".repeat(W)}${N}${" ".repeat(w)}${y}
|
|
35
|
+
`)}r.write(`${l}${g[2]}${p.repeat(C)}${g[3]}
|
|
36
|
+
`)},ce=e=>{let t=e.active??"Yes",s=e.inactive??"No";return new Ne({active:t,inactive:s,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue??!0,render(){let r=e.withGuide??I.withGuide,i=`${J(this.state)} `,o=r?`${n("gray",f)} `:"",a=G(e.output,e.message,o,i),u=`${r?`${n("gray",f)}
|
|
37
|
+
`:""}${a}
|
|
38
|
+
`,c=this.value?t:s;switch(this.state){case"submit":{let l=r?`${n("gray",f)} `:"";return`${u}${l}${n("dim",c)}`}case"cancel":{let l=r?`${n("gray",f)} `:"";return`${u}${l}${n(["strikethrough","dim"],c)}${r?`
|
|
39
|
+
${n("gray",f)}`:""}`}default:{let l=r?`${n("cyan",f)} `:"",d=r?n("cyan",V):"";return`${u}${l}${this.value?`${n("green",Ae)} ${t}`:`${n("dim",me)} ${n("dim",t)}`}${e.vertical?r?`
|
|
40
|
+
${n("cyan",f)} `:`
|
|
41
|
+
`:` ${n("dim","/")} `}${this.value?`${n("dim",me)} ${n("dim",s)}`:`${n("green",Ae)} ${s}`}
|
|
42
|
+
${d}
|
|
43
|
+
`}}}}).prompt()},si=e=>{let t=e.validate;return new De({...e,validate(s){if(s===void 0)return e.defaultValue!==void 0?void 0:t?t(s):I.date.messages.required;let r=i=>i.toISOString().slice(0,10);if(e.minDate&&r(s)<r(e.minDate))return I.date.messages.afterMin(e.minDate);if(e.maxDate&&r(s)>r(e.maxDate))return I.date.messages.beforeMax(e.maxDate);if(t)return t(s)},render(){let s=(e?.withGuide??I.withGuide)!==!1,r=`${`${s?`${n("gray",f)}
|
|
44
|
+
`:""}${J(this.state)} `}${e.message}
|
|
45
|
+
`,i=this.state!=="initial"?this.state:"active",o=ri(this,i),a=this.value instanceof Date?this.formattedValue:"";switch(this.state){case"error":{let u=this.error?` ${n("yellow",this.error)}`:"",c=s?`${n("yellow",f)} `:"",l=s?n("yellow",V):"";return`${r.trim()}
|
|
46
|
+
${c}${o}
|
|
47
|
+
${l}${u}
|
|
48
|
+
`}case"submit":{let u=a?` ${n("dim",a)}`:"",c=s?n("gray",f):"";return`${r}${c}${u}`}case"cancel":{let u=a?` ${n(["strikethrough","dim"],a)}`:"",c=s?n("gray",f):"";return`${r}${c}${u}${a.trim()?`
|
|
49
|
+
${c}`:""}`}default:{let u=s?`${n("cyan",f)} `:"",c=s?n("cyan",V):"",l=s?`${n("cyan",f)} `:"",d=this.inlineError?`
|
|
50
|
+
${l}${n("yellow",this.inlineError)}`:"";return`${r}${u}${o}${d}
|
|
51
|
+
${c}
|
|
52
|
+
`}}}}).prompt()};ni={year:"yyyy",month:"mm",day:"dd"},oi=async(e,t)=>{let s={},r=Object.keys(e);for(let i of r){let o=e[i],a=await o({results:s})?.catch(u=>{throw u});if(typeof t?.onCancel=="function"&&Ce(a)){s[i]="canceled",t.onCancel({results:s});continue}s[i]=a}return s},ai=e=>{let{selectableGroups:t=!0,groupSpacing:s=0}=e,r=(o,a,u=[])=>{let c=o.label??String(o.value),l=typeof o.group=="string",d=l&&(u[u.indexOf(o)+1]??{group:!0}),g=l&&d&&d.group===!0,p="",y="";l&&(t?(p=g?`${V} `:`${f} `,y=g?" ":`${f} `):p=" ");let m="";if(s>0&&!l&&(m=`
|
|
53
|
+
`.repeat(s)),a==="active")return G(e.output,`${c}${o.hint?` ${n("dim",`(${o.hint})`)}`:""}`,`${m}${n("dim",p)} `,`${m}${n("dim",p)}${n("cyan",ze)} `,`${m}${n("dim",y)} `);if(a==="group-active")return G(e.output,c,`${m}${p} `,`${m}${p}${n("cyan",ze)} `,`${m}${y} `,$=>n("dim",$));if(a==="group-active-selected")return G(e.output,c,`${m}${p} `,`${m}${p}${n("green",de)} `,`${m}${y} `,$=>n("dim",$));if(a==="selected"){let $=l||t?n("green",de):"";return G(e.output,`${c}${o.hint?` (${o.hint})`:""}`,`${m}${n("dim",p)} `,`${m}${n("dim",p)}${$} `,`${m}${n("dim",y)} `,v=>n("dim",v))}if(a==="cancelled")return`${n(["strikethrough","dim"],c)}`;if(a==="active-selected")return G(e.output,`${c}${o.hint?` ${n("dim",`(${o.hint})`)}`:""}`,`${m}${n("dim",p)} `,`${m}${n("dim",p)}${n("green",de)} `,`${m}${n("dim",y)} `);if(a==="submitted")return`${n("dim",c)}`;let b=l||t?n("dim",Se):"";return G(e.output,c,`${m}${n("dim",p)} `,`${m}${n("dim",p)}${b} `,`${m}${n("dim",y)} `,$=>n("dim",$))},i=e.required??!0;return new Ve({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValues:e.initialValues,required:i,cursorAt:e.cursorAt,selectableGroups:t,validate(o){if(i&&(o===void 0||o.length===0))return`Please select at least one option.
|
|
54
|
+
${n("reset",n("dim",`Press ${n(["gray","bgWhite","inverse"]," space ")} to select, ${n("gray",n(["bgWhite","inverse"]," enter "))} to submit`))}`},render(){let o=e.withGuide??I.withGuide,a=`${o?`${n("gray",f)}
|
|
55
|
+
`:""}${J(this.state)} ${e.message}
|
|
56
|
+
`,u=this.value??[],c=(l,d)=>{let g=this.options,p=u.includes(l.value)||l.group===!0&&this.isGroupSelected(`${l.value}`);return!d&&typeof l.group=="string"&&this.options[this.cursor].value===l.group?r(l,p?"group-active-selected":"group-active",g):d&&p?r(l,"active-selected",g):p?r(l,"selected",g):r(l,d?"active":"inactive",g)};switch(this.state){case"submit":{let l=this.options.filter(({value:g})=>u.includes(g)).map(g=>r(g,"submitted")),d=l.length===0?"":` ${l.join(n("dim",", "))}`;return`${a}${o?n("gray",f):""}${d}`}case"cancel":{let l=this.options.filter(({value:d})=>u.includes(d)).map(d=>r(d,"cancelled")).join(n("dim",", "));return`${a}${o?`${n("gray",f)} `:""}${l.trim()?`${l}${o?`
|
|
57
|
+
${n("gray",f)}`:""}`:""}`}case"error":{let l=o?`${n("yellow",f)} `:"",d=this.error.split(`
|
|
58
|
+
`).map((m,b)=>b===0?`${o?`${n("yellow",V)} `:""}${n("yellow",m)}`:` ${m}`).join(`
|
|
59
|
+
`),g=a.split(`
|
|
60
|
+
`).length,p=d.split(`
|
|
61
|
+
`).length+1,y=ae({output:e.output,options:this.options,cursor:this.cursor,maxItems:e.maxItems,columnPadding:l.length,rowPadding:g+p,style:c}).join(`
|
|
62
|
+
${l}`);return`${a}${l}${y}
|
|
63
|
+
${d}
|
|
64
|
+
`}default:{let l=o?`${n("cyan",f)} `:"",d=a.split(`
|
|
65
|
+
`).length,g=(o?1:0)+1,p=ae({output:e.output,options:this.options,cursor:this.cursor,maxItems:e.maxItems,columnPadding:l.length,rowPadding:d+g,style:c}).join(`
|
|
66
|
+
${l}`);return`${a}${l}${p}
|
|
67
|
+
${o?n("cyan",V):""}
|
|
68
|
+
`}}}}).prompt()},E={message:(e=[],{symbol:t=n("gray",f),secondarySymbol:s=n("gray",f),output:r=process.stdout,spacing:i=1,withGuide:o}={})=>{let a=[],u=o??I.withGuide,c=u?s:"",l=u?`${t} `:"",d=u?`${s} `:"";for(let p=0;p<i;p++)a.push(c);let g=Array.isArray(e)?e:e.split(`
|
|
69
|
+
`);if(g.length>0){let[p,...y]=g;p.length>0?a.push(`${l}${p}`):a.push(u?t:"");for(let m of y)m.length>0?a.push(`${d}${m}`):a.push(u?s:"")}r.write(`${a.join(`
|
|
70
|
+
`)}
|
|
71
|
+
`)},info:(e,t)=>{E.message(e,{...t,symbol:n("blue",Rt)})},success:(e,t)=>{E.message(e,{...t,symbol:n("green",_t)})},step:(e,t)=>{E.message(e,{...t,symbol:n("green",pe)})},warn:(e,t)=>{E.message(e,{...t,symbol:n("yellow",At)})},warning:(e,t)=>{E.warn(e,t)},error:(e,t)=>{E.message(e,{...t,symbol:n("red",Ft)})}},Fe=(e="",t)=>{let s=t?.output??process.stdout,r=t?.withGuide??I.withGuide?`${n("gray",V)} `:"";s.write(`${r}${n("red",e)}
|
|
55
72
|
|
|
56
|
-
`)},
|
|
57
|
-
`)},
|
|
58
|
-
${
|
|
73
|
+
`)},Ot=(e="",t)=>{let s=t?.output??process.stdout,r=t?.withGuide??I.withGuide?`${n("gray",St)} `:"";s.write(`${r}${e}
|
|
74
|
+
`)},Bt=(e="",t)=>{let s=t?.output??process.stdout,r=t?.withGuide??I.withGuide?`${n("gray",f)}
|
|
75
|
+
${n("gray",V)} `:"";s.write(`${r}${e}
|
|
59
76
|
|
|
60
|
-
`)},
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
`)
|
|
66
|
-
|
|
67
|
-
`)
|
|
68
|
-
`)
|
|
77
|
+
`)},ci=e=>new Ue({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,showSubmit:e.showSubmit,output:e.output,signal:e.signal,input:e.input,render(){let t=e?.withGuide??I.withGuide,s=`${`${t?`${n("gray",f)}
|
|
78
|
+
`:""}${J(this.state)} `}${e.message}
|
|
79
|
+
`,r=e.placeholder?n("inverse",e.placeholder[0])+n("dim",e.placeholder.slice(1)):n(["inverse","hidden"],"_"),i=this.userInput?this.userInputWithCursor:r,o=this.value??"",a=e.showSubmit?`
|
|
80
|
+
${n(this.focused==="submit"?"cyan":"dim","[ submit ]")}`:"";switch(this.state){case"error":{let u=`${n("yellow",f)} `,c=t?G(e.output,i,u,void 0):i,l=n("yellow",V);return`${s}${c}
|
|
81
|
+
${l} ${n("yellow",this.error)}${a}
|
|
82
|
+
`}case"submit":{let u=`${n("gray",f)} `,c=t?G(e.output,o,u,void 0,void 0,l=>n("dim",l)):o?n("dim",o):"";return`${s}${c}`}case"cancel":{let u=`${n("gray",f)} `,c=t?G(e.output,o,u,void 0,void 0,l=>n(["strikethrough","dim"],l)):o?n(["strikethrough","dim"],o):"";return`${s}${c}`}default:{let u=t?`${n("cyan",f)} `:"",c=t?n("cyan",V):"",l=t?G(e.output,i,u):i;return`${s}${l}
|
|
83
|
+
${c}${a}
|
|
84
|
+
`}}}}).prompt(),_e=(e,t)=>e.split(`
|
|
85
|
+
`).map(s=>t(s)).join(`
|
|
86
|
+
`),kt=e=>{let t=(r,i)=>{let o=r.label??String(r.value);return i==="disabled"?`${n("gray",Se)} ${_e(o,a=>n(["strikethrough","gray"],a))}${r.hint?` ${n("dim",`(${r.hint??"disabled"})`)}`:""}`:i==="active"?`${n("cyan",ze)} ${o}${r.hint?` ${n("dim",`(${r.hint})`)}`:""}`:i==="selected"?`${n("green",de)} ${_e(o,a=>n("dim",a))}${r.hint?` ${n("dim",`(${r.hint})`)}`:""}`:i==="cancelled"?`${_e(o,a=>n(["strikethrough","dim"],a))}`:i==="active-selected"?`${n("green",de)} ${o}${r.hint?` ${n("dim",`(${r.hint})`)}`:""}`:i==="submitted"?`${_e(o,a=>n("dim",a))}`:`${n("dim",Se)} ${_e(o,a=>n("dim",a))}`},s=e.required??!0;return new ms({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValues:e.initialValues,required:s,cursorAt:e.cursorAt,validate(r){if(s&&(r===void 0||r.length===0))return`Please select at least one option.
|
|
87
|
+
${n("reset",n("dim",`Press ${n(["gray","bgWhite","inverse"]," space ")} to select, ${n("gray",n("bgWhite",n("inverse"," enter ")))} to submit`))}`},render(){let r=e.withGuide??I.withGuide,i=G(e.output,e.message,r?`${Mt(this.state)} `:"",`${J(this.state)} `),o=`${r?`${n("gray",f)}
|
|
88
|
+
`:""}${i}
|
|
89
|
+
`,a=this.value??[],u=(c,l)=>{if(c.disabled)return t(c,"disabled");let d=a.includes(c.value);return l&&d?t(c,"active-selected"):d?t(c,"selected"):t(c,l?"active":"inactive")};switch(this.state){case"submit":{let c=this.options.filter(({value:d})=>a.includes(d)).map(d=>t(d,"submitted")).join(n("dim",", "))||n("dim","none"),l=G(e.output,c,r?`${n("gray",f)} `:"");return`${o}${l}`}case"cancel":{let c=this.options.filter(({value:d})=>a.includes(d)).map(d=>t(d,"cancelled")).join(n("dim",", "));if(c.trim()==="")return`${o}${n("gray",f)}`;let l=G(e.output,c,r?`${n("gray",f)} `:"");return`${o}${l}${r?`
|
|
90
|
+
${n("gray",f)}`:""}`}case"error":{let c=r?`${n("yellow",f)} `:"",l=this.error.split(`
|
|
91
|
+
`).map((p,y)=>y===0?`${r?`${n("yellow",V)} `:""}${n("yellow",p)}`:` ${p}`).join(`
|
|
92
|
+
`),d=o.split(`
|
|
93
|
+
`).length,g=l.split(`
|
|
94
|
+
`).length+1;return`${o}${c}${ae({output:e.output,options:this.options,cursor:this.cursor,maxItems:e.maxItems,columnPadding:c.length,rowPadding:d+g,style:u}).join(`
|
|
95
|
+
${c}`)}
|
|
96
|
+
${l}
|
|
97
|
+
`}default:{let c=r?`${n("cyan",f)} `:"",l=o.split(`
|
|
98
|
+
`).length,d=r?2:1;return`${o}${c}${ae({output:e.output,options:this.options,cursor:this.cursor,maxItems:e.maxItems,columnPadding:c.length,rowPadding:l+d,style:u}).join(`
|
|
99
|
+
${c}`)}
|
|
100
|
+
${r?n("cyan",V):""}
|
|
101
|
+
`}}}}).prompt()},ui=e=>n("dim",e),li=(e,t,s)=>{let r={hard:!0,trim:!1},i=se(e,t,r).split(`
|
|
102
|
+
`),o=i.reduce((c,l)=>Math.max(j(l),c),0),a=i.map(s).reduce((c,l)=>Math.max(j(l),c),0),u=t-(a-o);return se(e,u,r)},ge=(e="",t="",s)=>{let r=s?.output??Q.stdout,i=s?.withGuide??I.withGuide,o=s?.format??ui,a=["",...li(e,le(r)-6,o).split(`
|
|
103
|
+
`).map(o),""],u=j(t),c=Math.max(a.reduce((p,y)=>{let m=j(y);return m>p?m:p},0),u)+2,l=a.map(p=>`${n("gray",f)} ${p}${" ".repeat(c-j(p))}${n("gray",f)}`).join(`
|
|
104
|
+
`),d=i?`${n("gray",f)}
|
|
105
|
+
`:"",g=i?xs:Tt;r.write(`${d}${n("green",pe)} ${n("reset",t)} ${n("gray",Je.repeat(Math.max(c-u-1,1))+Et)}
|
|
106
|
+
${l}
|
|
107
|
+
${n("gray",g+Je.repeat(c+2)+xt)}
|
|
108
|
+
`)},hi=e=>new Ge({validate:e.validate,mask:e.mask??Es,signal:e.signal,input:e.input,output:e.output,render(){let t=e.withGuide??I.withGuide,s=`${t?`${n("gray",f)}
|
|
109
|
+
`:""}${J(this.state)} ${e.message}
|
|
110
|
+
`,r=this.userInputWithCursor,i=this.masked;switch(this.state){case"error":{let o=t?`${n("yellow",f)} `:"",a=t?`${n("yellow",V)} `:"",u=i??"";return e.clearOnError&&this.clear(),`${s.trim()}
|
|
111
|
+
${o}${u}
|
|
112
|
+
${a}${n("yellow",this.error)}
|
|
113
|
+
`}case"submit":{let o=t?`${n("gray",f)} `:"",a=i?n("dim",i):"";return`${s}${o}${a}`}case"cancel":{let o=t?`${n("gray",f)} `:"",a=i?n(["strikethrough","dim"],i):"";return`${s}${o}${a}${i&&t?`
|
|
114
|
+
${n("gray",f)}`:""}`}default:{let o=t?`${n("cyan",f)} `:"",a=t?n("cyan",V):"";return`${s}${o}${r}
|
|
115
|
+
${a}
|
|
116
|
+
`}}}}).prompt(),di=e=>{let t=e.validate;return _s({...e,initialUserInput:e.initialValue??e.root??process.cwd(),maxItems:5,validate(s){if(!Array.isArray(s)){if(!s)return"Please select a path";if(t)return t(s)}},options(){let s=this.userInput;if(s==="")return[];try{let r;Hr(s)?ps(s).isDirectory()&&(!e.directory||s.endsWith("/"))?r=s:r=gs(s):r=gs(s);let i=s.length>1&&s.endsWith("/")?s.slice(0,-1):s;return Kr(r).map(o=>{let a=zr(r,o),u=ps(a);return{name:o,path:a,isDirectory:u.isDirectory()}}).filter(({path:o,isDirectory:a})=>o.startsWith(i)&&(a||!e.directory)).map(o=>({value:o.path}))}catch{return[]}}})},mi=e=>n("magenta",e),fe=({indicator:e="dots",onCancel:t,output:s=process.stdout,cancelMessage:r,errorMessage:i,frames:o=Ke?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],delay:a=Ke?80:120,signal:u,...c}={})=>{let l=wt(),d,g,p=!1,y=!1,m="",b,$=performance.now(),v=le(s),C=c?.styleFrame??mi,T=S=>{let _=S>1?i??I.messages.error:r??I.messages.cancel;y=S===1,p&&(H(_,S),y&&typeof t=="function"&&t())},R=()=>T(2),x=()=>T(1),P=()=>{process.on("uncaughtExceptionMonitor",R),process.on("unhandledRejection",R),process.on("SIGINT",x),process.on("SIGTERM",x),process.on("exit",T),u&&u.addEventListener("abort",x)},M=()=>{process.removeListener("uncaughtExceptionMonitor",R),process.removeListener("unhandledRejection",R),process.removeListener("SIGINT",x),process.removeListener("SIGTERM",x),process.removeListener("exit",T),u&&u.removeEventListener("abort",x)},k=()=>{if(b===void 0)return;l&&s.write(`
|
|
117
|
+
`);let S=se(b,v,{hard:!0,trim:!1}).split(`
|
|
118
|
+
`);S.length>1&&s.write(Ie.cursor.up(S.length-1)),s.write(Ie.cursor.to(0)),s.write(Ie.erase.down())},N=S=>S.replace(/\.+$/,""),W=S=>{let _=(performance.now()-S)/1e3,q=Math.floor(_/60),te=Math.floor(_%60);return q>0?`[${q}m ${te}s]`:`[${te}s]`},w=c.withGuide??I.withGuide,B=(S="")=>{p=!0,d=hs({output:s}),m=N(S),$=performance.now(),w&&s.write(`${n("gray",f)}
|
|
119
|
+
`);let _=0,q=0;P(),g=setInterval(()=>{if(l&&m===b)return;k(),b=m;let te=C(o[_]),ve;if(l)ve=`${te} ${m}...`;else if(e==="timer")ve=`${te} ${m} ${W($)}`;else{let lr=".".repeat(Math.floor(q)).slice(0,3);ve=`${te} ${m}${lr}`}let ur=se(ve,v,{hard:!0,trim:!1});s.write(ur),_=_+1<o.length?_+1:0,q=q<4?q+.125:0},a)},H=(S="",_=0,q=!1)=>{if(!p)return;p=!1,clearInterval(g),k();let te=_===0?n("green",pe):_===1?n("red",Ct):n("red",It);m=S??m,q||(e==="timer"?s.write(`${te} ${m} ${W($)}
|
|
120
|
+
`):s.write(`${te} ${m}
|
|
121
|
+
`)),M(),d()};return{start:B,stop:(S="")=>H(S,0),message:(S="")=>{m=N(S??m)},cancel:(S="")=>H(S,1),error:(S="")=>H(S,2),clear:()=>H("",0,!0),get isCancelled(){return y}}},vs={light:A("\u2500","-"),heavy:A("\u2501","="),block:A("\u2588","#")};He=(e,t)=>e.includes(`
|
|
122
|
+
`)?e.split(`
|
|
123
|
+
`).map(s=>t(s)).join(`
|
|
124
|
+
`):t(e),K=e=>{let t=(s,r)=>{let i=s.label??String(s.value);switch(r){case"disabled":return`${n("gray",me)} ${He(i,o=>n("gray",o))}${s.hint?` ${n("dim",`(${s.hint??"disabled"})`)}`:""}`;case"selected":return`${He(i,o=>n("dim",o))}`;case"active":return`${n("green",Ae)} ${i}${s.hint?` ${n("dim",`(${s.hint})`)}`:""}`;case"cancelled":return`${He(i,o=>n(["strikethrough","dim"],o))}`;default:return`${n("dim",me)} ${He(i,o=>n("dim",o))}`}};return new je({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,render(){let s=e.withGuide??I.withGuide,r=`${J(this.state)} `,i=`${Mt(this.state)} `,o=G(e.output,e.message,i,r),a=`${s?`${n("gray",f)}
|
|
125
|
+
`:""}${o}
|
|
126
|
+
`;switch(this.state){case"submit":{let u=s?`${n("gray",f)} `:"",c=G(e.output,t(this.options[this.cursor],"selected"),u);return`${a}${c}`}case"cancel":{let u=s?`${n("gray",f)} `:"",c=G(e.output,t(this.options[this.cursor],"cancelled"),u);return`${a}${c}${s?`
|
|
127
|
+
${n("gray",f)}`:""}`}default:{let u=s?`${n("cyan",f)} `:"",c=s?n("cyan",V):"",l=a.split(`
|
|
128
|
+
`).length,d=s?2:1;return`${a}${u}${ae({output:e.output,cursor:this.cursor,options:this.options,maxItems:e.maxItems,columnPadding:u.length,rowPadding:l+d,style:(g,p)=>t(g,g.disabled?"disabled":p?"active":"inactive")}).join(`
|
|
129
|
+
${u}`)}
|
|
130
|
+
${c}
|
|
131
|
+
`}}}}).prompt()},gi=e=>{let t=(s,r="inactive")=>{let i=s.label??String(s.value);return r==="selected"?`${n("dim",i)}`:r==="cancelled"?`${n(["strikethrough","dim"],i)}`:r==="active"?`${n(["bgCyan","gray"],` ${s.value} `)} ${i}${s.hint?` ${n("dim",`(${s.hint})`)}`:""}`:`${n(["gray","bgWhite","inverse"],` ${s.value} `)} ${i}${s.hint?` ${n("dim",`(${s.hint})`)}`:""}`};return new We({options:e.options,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue,caseSensitive:e.caseSensitive,render(){let s=e.withGuide??I.withGuide,r=`${s?`${n("gray",f)}
|
|
132
|
+
`:""}${J(this.state)} ${e.message}
|
|
133
|
+
`;switch(this.state){case"submit":{let i=s?`${n("gray",f)} `:"",o=this.options.find(u=>u.value===this.value)??e.options[0],a=G(e.output,t(o,"selected"),i);return`${r}${a}`}case"cancel":{let i=s?`${n("gray",f)} `:"",o=G(e.output,t(this.options[0],"cancelled"),i);return`${r}${o}${s?`
|
|
134
|
+
${n("gray",f)}`:""}`}default:{let i=s?`${n("cyan",f)} `:"",o=s?n("cyan",V):"",a=this.options.map((u,c)=>G(e.output,t(u,c===this.cursor?"active":"inactive"),i)).join(`
|
|
135
|
+
`);return`${r}${a}
|
|
136
|
+
${o}
|
|
137
|
+
`}}}}).prompt()},bs=`${n("gray",f)} `,he={message:async(e,{symbol:t=n("gray",f)}={})=>{process.stdout.write(`${n("gray",f)}
|
|
138
|
+
${t} `);let s=3;for await(let r of e){r=r.replace(/\n/g,`
|
|
139
|
+
${bs}`),r.includes(`
|
|
140
|
+
`)&&(s=3+bt(r.slice(r.lastIndexOf(`
|
|
141
|
+
`))).length);let i=bt(r).length;s+i<process.stdout.columns?(s+=i,process.stdout.write(r)):(process.stdout.write(`
|
|
142
|
+
${bs}${r.trimStart()}`),s=3+bt(r.trimStart()).length)}process.stdout.write(`
|
|
143
|
+
`)},info:e=>he.message(e,{symbol:n("blue",Rt)}),success:e=>he.message(e,{symbol:n("green",_t)}),step:e=>he.message(e,{symbol:n("green",pe)}),warn:e=>he.message(e,{symbol:n("yellow",At)}),warning:e=>he.warn(e),error:e=>he.message(e,{symbol:n("red",Ft)})},fi=async(e,t)=>{for(let s of e){if(s.enabled===!1)continue;let r=fe(t);r.start(s.title);let i=await s.task(r.message);r.stop(i||s.title)}},$i=e=>e.replace(/\x1b\[(?:\d+;)*\d*[ABCDEFGHfJKSTsu]|\x1b\[(s|u)/g,""),yi=e=>{let t=e.output??process.stdout,s=le(t),r=n("gray",f),i=e.spacing??1,o=3,a=e.retainLog===!0,u=!wt()&&ws(t);t.write(`${r}
|
|
144
|
+
`),t.write(`${n("green",pe)} ${e.title}
|
|
145
|
+
`);for(let $=0;$<i;$++)t.write(`${r}
|
|
146
|
+
`);let c=[{value:"",full:""}],l=!1,d=$=>{if(c.length===0)return;let v=0;$&&(v+=i+2);for(let C of c){let{value:T,result:R}=C,x=R?.message??T;if(x.length===0)continue;R===void 0&&C.header!==void 0&&C.header!==""&&(x+=`
|
|
147
|
+
${C.header}`);let P=x.split(`
|
|
148
|
+
`).reduce((M,k)=>k===""?M+1:M+Math.ceil((k.length+o)/s),0);v+=P}v>0&&(v+=1,t.write(Ie.erase.lines(v)))},g=($,v,C)=>{let T=C?`${$.full}
|
|
149
|
+
${$.value}`:$.value;$.header!==void 0&&$.header!==""&&E.message($.header.split(`
|
|
150
|
+
`).map(R=>n("bold",R)),{output:t,secondarySymbol:r,symbol:r,spacing:0}),E.message(T.split(`
|
|
151
|
+
`).map(R=>n("dim",R)),{output:t,secondarySymbol:r,symbol:r,spacing:v??i})},p=()=>{for(let $ of c){let{header:v,value:C,full:T}=$;(v===void 0||v.length===0)&&C.length===0||g($,void 0,a===!0&&T.length>0)}},y=($,v,C)=>{if(d(!1),(C?.raw!==!0||!l)&&$.value!==""&&($.value+=`
|
|
152
|
+
`),$.value+=$i(v),l=C?.raw===!0,e.limit!==void 0){let T=$.value.split(`
|
|
153
|
+
`),R=T.length-e.limit;if(R>0){let x=T.splice(0,R);a&&($.full+=($.full===""?"":`
|
|
154
|
+
`)+x.join(`
|
|
155
|
+
`))}$.value=T.join(`
|
|
156
|
+
`)}u&&m()},m=()=>{for(let $ of c)$.result?$.result.status==="error"?E.error($.result.message,{output:t,secondarySymbol:r,spacing:0}):E.success($.result.message,{output:t,secondarySymbol:r,spacing:0}):$.value!==""&&g($,0)},b=($,v)=>{d(!1),$.result=v,u&&m()};return{message($,v){y(c[0],$,v)},group($){let v={header:$,value:"",full:""};return c.push(v),{message(C,T){y(v,C,T)},error(C){b(v,{status:"error",message:C})},success(C){b(v,{status:"success",message:C})}}},error($,v){d(!0),E.error($,{output:t,secondarySymbol:r,spacing:1}),v?.showLog!==!1&&p(),c.splice(1,c.length-1),c[0].value="",c[0].full=""},success($,v){d(!0),E.success($,{output:t,secondarySymbol:r,spacing:1}),v?.showLog===!0&&p(),c.splice(1,c.length-1),c[0].value="",c[0].full=""}}},ue=e=>new qe({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,output:e.output,signal:e.signal,input:e.input,render(){let t=e?.withGuide??I.withGuide,s=`${`${t?`${n("gray",f)}
|
|
157
|
+
`:""}${J(this.state)} `}${e.message}
|
|
158
|
+
`,r=e.placeholder?n("inverse",e.placeholder[0])+n("dim",e.placeholder.slice(1)):n(["inverse","hidden"],"_"),i=this.userInput?this.userInputWithCursor:r,o=this.value??"";switch(this.state){case"error":{let a=this.error?` ${n("yellow",this.error)}`:"",u=t?`${n("yellow",f)} `:"",c=t?n("yellow",V):"";return`${s.trim()}
|
|
159
|
+
${u}${i}
|
|
160
|
+
${c}${a}
|
|
161
|
+
`}case"submit":{let a=o?` ${n("dim",o)}`:"",u=t?n("gray",f):"";return`${s}${u}${a}`}case"cancel":{let a=o?` ${n(["strikethrough","dim"],o)}`:"",u=t?n("gray",f):"";return`${s}${u}${a}${o.trim()?`
|
|
162
|
+
${u}`:""}`}default:{let a=t?`${n("cyan",f)} `:"",u=t?n("cyan",V):"";return`${s}${a}${i}
|
|
163
|
+
${u}
|
|
164
|
+
`}}}}).prompt()});X();X();import{spawnSync as Zs}from"child_process";X();X();import{existsSync as Ms,readFileSync as vi,writeFileSync as bi,mkdirSync as wi}from"fs";import Ci from"os";import Os from"path";var Pt=Os.join(Ci.homedir(),".eazy-git"),Lt=Os.join(Pt,"config.json"),Fs={language:"es",defaultBaseBranch:"release",aiProvider:"claude"};function Y(){try{if(Ms(Lt)){let e=vi(Lt,"utf-8");return{...Fs,...JSON.parse(e)}}}catch{}return{...Fs}}function Ye(e){let s={...Y(),...e};return Ms(Pt)||wi(Pt,{recursive:!0}),bi(Lt,JSON.stringify(s,null,2)),s}var Bs={welcome:"Bienvenido a",subtitle:"tu CLI de confianza para gestionar ramas en GIT",operationCompleted:"Operacion completada!",operationCancelled:"Operacion cancelada. Saliendo...",unknownCommand:"Comando desconocido",errorExecuting:"Error al ejecutar el comando",version:"eazy-git version",whatToDo:"Que deseas hacer?",addChanges:"Agregar cambios a una rama",createOriginal:"Crear rama original",createTemporal:"Crear rama temporal",notGitRepo:"Este directorio no es un repositorio git",gitNotInstalled:"git no esta instalado en el sistema",currentBranch:"Branch actual",filesChanged:"Archivos con cambios",noChangesPending:"No hay cambios pendientes. Deseas continuar de todas formas?",updatingRefs:"Actualizando referencias remotas...",refsUpdated:"Referencias actualizadas",fetchFailed:"No se pudo hacer fetch (continuando...)",baseBranch:"Desde que branch base quieres crear la rama?",baseBranchRequired:"El branch base es requerido",ticketId:"Cual es el identificador del ticket? (ej: DPW-0000)",ticketRequired:"El ticket es requerido",changeType:"Que tipo de cambio es?",branchExistsLocal:e=>`La rama "${e}" ya existe localmente. Que deseas hacer?`,switchToIt:"Cambiarme a ella y continuar",cancel:"Cancelar",cancelledOp:"Operacion cancelada.",creatingBranch:(e,t)=>`Creando rama ${e} desde origin/${t}...`,branchCreated:e=>`Rama ${e} creada`,errorCreatingBranch:e=>`Error al crear la rama: ${e}`,noFilesToStage:"No hay archivos para stagear.",selectFiles:"Cuales archivos quieres incluir en el commit?",stagedFiles:"Archivos en stage",stagedCorrect:"Los archivos en stage son correctos?",aiProvider:"Con que IA quieres generar la sugerencia de commit?",generatingCommit:e=>`Generando sugerencia de commit con ${e}...`,aiSuggestionFailed:e=>`No se pudo obtener sugerencia de ${e}. Escribe el mensaje manualmente.`,writeCommitMsg:"Escribe el mensaje de commit:",commitMsgRequired:"El mensaje es requerido",suggestionOf:e=>`Sugerencia de ${e}`,useThisCommit:"Este mensaje de commit te parece bien?",yesUseIt:"Si, usar este",modify:"Modificar",commitSuccess:"Commit realizado correctamente",hookBlocked:"El pre-commit hook bloqueo el commit. Que deseas hacer?",retryHook:"Ya lo corregi, agrega los cambios y vuelve a intentarlo",skipHook:"Saltar el hook (--no-verify)",commitNoHooks:"Commit realizado (sin hooks)",pushToRemote:"Deseas subir la rama al repositorio remoto?",pushSuccess:"Push realizado",pushForceQuestion:"La rama ya existe en el remoto con historial diferente. Deseas forzar el push? (git push -f)",pushForceSuccess:"Push forzado realizado",pushForceError:e=>`Error en el push forzado: ${e}`,pushError:e=>`Error en el push: ${e}`,summaryTitle:"Resumen",summaryBranch:"Rama",summaryFrom:"Desde",summaryCommit:"Commit",summaryFiles:e=>`${e} archivos commiteados`,summaryPush:"Push",summaryPR:"Crear PR",statusModified:"modificado",statusAdded:"agregado",statusDeleted:"eliminado",statusRenamed:"renombrado",statusUntracked:"sin rastrear",commitTypes:{fix:"fix \u2014 correccion de bug",feat:"feat \u2014 nueva funcionalidad",refactor:"refactor \u2014 mejora sin cambio funcional",chore:"chore \u2014 mantenimiento, dependencias",docs:"docs \u2014 documentacion",test:"test \u2014 pruebas",ci:"ci \u2014 integracion continua",perf:"perf \u2014 rendimiento",style:"style \u2014 formato, sin cambio de logica"},selectBranchType:"Selecciona el tipo de rama:",branchFix:"Fix",branchImprovement:"Mejora",branchFeature:"Feature",branchRefactor:"Refactor",creatingOriginalBranch:"Creando rama original...",branchCreatedAndPushed:e=>`Rama "${e}" creada y pusheada correctamente!`,branchCreatedSuccess:e=>`Rama "${e}" creada correctamente!`,mergeBranchQuestion:"A que rama deseas hacer merge?",developDEV:"develop (DEV)",releaseUAT:"release (UAT)",temporalBranchCreated:"Rama temporal creada correctamente",temporalBranchMerged:"Rama temporal mergeada correctamente",conflictsDetected:"Conflictos detectados. Resolvelos manualmente!",branchPushedToRemote:"Rama pusheada al repositorio remoto",removeTemporalBranch:"Deseas eliminar la rama temporal?",temporalBranchDeleted:"Rama temporal eliminada correctamente",errorCreatingTemporal:"Error creando la rama temporal",enterJiraCode:"Ingresa el codigo del ticket JIRA:",jiraRequired:"El codigo JIRA es requerido!",jiraInvalidFormat:"El codigo JIRA debe tener el formato DPW-0000",fetchingRemote:"Obteniendo cambios remotos...",pullingChanges:"Aplicando cambios en tu rama...",pullError:e=>`Error: ${e}`,pushingChanges:"Subiendo cambios al remoto...",pushedSuccess:"Cambios subidos correctamente!",pushedForceSuccess:"Cambios subidos (forzado) correctamente!",pushQuickError:e=>`Error: ${e}`,provideCommitMsg:"Proporciona un mensaje de commit",stagingChanges:"Stageando cambios...",creatingCommit:"Creando commit...",commitCreated:"Commit creado correctamente!",commitError:e=>`Error: ${e}`,switchingPrevBranch:"Cambiando a la rama anterior...",switchedTo:e=>`Cambiado a rama ${e} correctamente!`,checkoutError:e=>`Error: ${e}`,fetchingLatest:"Obteniendo ultimos cambios...",mergingWith:e=>`Mergeando con ${e}...`,pushingMerged:"Subiendo cambios mergeados...",mergeCompleted:"Merge completado correctamente!",mergeError:e=>`Error: ${e}`,removingLastCommit:"Eliminando ultimo commit...",removeLastConfirm:"Esto eliminara el ultimo commit (los cambios se mantienen en staging). Continuar?",lastCommitRemoved:"Ultimo commit eliminado correctamente!",removeLastError:e=>`Error: ${e}`,logError:e=>`Error: ${e}`,settingUpConfig:"Configurando tu entorno",configSaved:"Configuracion guardada",missingConfigValues:"Faltan valores de configuracion requeridos.",errorWritingConfig:"Error escribiendo archivo de configuracion:",currentConfig:"Configuracion actual",useThisConfig:"Deseas usar esta configuracion?",installingDeps:"Instalando dependencias...",depsInstalled:"Todas las dependencias fueron instaladas",authFailed:"Autenticacion fallida",unexpectedError:"Ocurrio un error inesperado",enterEndpoint:"Ingresa la URL del endpoint:",urlRequired:"La URL es requerida!",urlMustBeHttp:"La URL debe usar protocolo HTTP/HTTPS",urlMustHaveHost:"La URL debe incluir un hostname",urlInvalid:"Ingresa una URL valida",enterApiKey:"Ingresa tu apikey:",apiKeyRequired:"El API key es requerido!",enterRegistryName:"Ingresa el nombre del registro NPM (sin caracteres especiales):",registryNameRequired:"El nombre del registro es requerido!",registryNameLettersOnly:"El nombre del registro debe contener solo letras",enterRegistryURL:"Ingresa la URL del registro NPM (sin http/https):",registryURLRequired:"La URL del registro es requerida!",registryURLStartWithName:"La URL debe empezar con un nombre, evita caracteres especiales",registryURLNoProtocol:"La URL no debe incluir protocolo 'http/https' y debe empezar con una letra",registryURLNoSlash:"La URL no debe empezar con '/' y debe empezar con una letra o numero",registryURLNoWWW:"La URL no debe empezar con 'www' y debe empezar con una letra o numero",languageSelect:"Selecciona el idioma de la interfaz:",languageChanged:e=>`Idioma cambiado a: ${e}`,configMenu:"Que deseas configurar?",configLanguage:"Idioma de la interfaz",configDefaultBranch:"Rama base por defecto",configAIProvider:"Proveedor de IA por defecto",configView:"Ver configuracion actual",defaultBranchSet:e=>`Rama base por defecto: ${e}`,aiProviderSet:e=>`Proveedor de IA por defecto: ${e}`};var ks={welcome:"Welcome to",subtitle:"your trusted CLI for GIT branch management",operationCompleted:"Operation completed!",operationCancelled:"Operation cancelled. Exiting...",unknownCommand:"Unknown command",errorExecuting:"Error executing command",version:"eazy-git version",whatToDo:"What would you like to do?",addChanges:"Add Changes to Branch",createOriginal:"Create Original Branch",createTemporal:"Create Temporal Branch",notGitRepo:"This directory is not a git repository",gitNotInstalled:"git is not installed on the system",currentBranch:"Current branch",filesChanged:"Files with changes",noChangesPending:"No pending changes. Do you want to continue anyway?",updatingRefs:"Updating remote references...",refsUpdated:"References updated",fetchFailed:"Could not fetch (continuing...)",baseBranch:"From which base branch do you want to create the branch?",baseBranchRequired:"Base branch is required",ticketId:"What is the ticket identifier? (e.g.: DPW-0000)",ticketRequired:"Ticket is required",changeType:"What type of change is this?",branchExistsLocal:e=>`Branch "${e}" already exists locally. What would you like to do?`,switchToIt:"Switch to it and continue",cancel:"Cancel",cancelledOp:"Operation cancelled.",creatingBranch:(e,t)=>`Creating branch ${e} from origin/${t}...`,branchCreated:e=>`Branch ${e} created`,errorCreatingBranch:e=>`Error creating branch: ${e}`,noFilesToStage:"No files to stage.",selectFiles:"Which files do you want to include in the commit?",stagedFiles:"Staged files",stagedCorrect:"Are the staged files correct?",aiProvider:"Which AI do you want to use for the commit suggestion?",generatingCommit:e=>`Generating commit suggestion with ${e}...`,aiSuggestionFailed:e=>`Could not get suggestion from ${e}. Write the message manually.`,writeCommitMsg:"Write the commit message:",commitMsgRequired:"Message is required",suggestionOf:e=>`${e} suggestion`,useThisCommit:"Does this commit message look good?",yesUseIt:"Yes, use it",modify:"Modify",commitSuccess:"Commit created successfully",hookBlocked:"The pre-commit hook blocked the commit. What would you like to do?",retryHook:"I fixed it, re-stage and retry",skipHook:"Skip the hook (--no-verify)",commitNoHooks:"Commit created (without hooks)",pushToRemote:"Do you want to push the branch to the remote repository?",pushSuccess:"Push completed",pushForceQuestion:"The branch already exists on remote with different history. Force push? (git push -f)",pushForceSuccess:"Force push completed",pushForceError:e=>`Error in force push: ${e}`,pushError:e=>`Error in push: ${e}`,summaryTitle:"Summary",summaryBranch:"Branch",summaryFrom:"From",summaryCommit:"Commit",summaryFiles:e=>`${e} files committed`,summaryPush:"Push",summaryPR:"Create PR",statusModified:"modified",statusAdded:"added",statusDeleted:"deleted",statusRenamed:"renamed",statusUntracked:"untracked",commitTypes:{fix:"fix - bug fix",feat:"feat - new feature",refactor:"refactor - improvement without functional change",chore:"chore - maintenance, dependencies",docs:"docs - documentation",test:"test - testing",ci:"ci - continuous integration",perf:"perf - performance",style:"style - formatting, no logic change"},selectBranchType:"Select the branch type:",branchFix:"Fix",branchImprovement:"Improvement",branchFeature:"Feature",branchRefactor:"Refactor",creatingOriginalBranch:"Creating original branch...",branchCreatedAndPushed:e=>`Branch "${e}" created and pushed successfully!`,branchCreatedSuccess:e=>`Branch "${e}" created successfully!`,mergeBranchQuestion:"Which branch do you want to merge into?",developDEV:"develop (DEV)",releaseUAT:"release (UAT)",temporalBranchCreated:"Temporal branch created successfully",temporalBranchMerged:"Temporal branch merged successfully",conflictsDetected:"Conflicts detected. Please resolve them manually!",branchPushedToRemote:"Branch pushed to remote repository",removeTemporalBranch:"Do you want to remove the temporal branch?",temporalBranchDeleted:"Temporal branch deleted successfully",errorCreatingTemporal:"Error creating the temporal branch",enterJiraCode:"Enter the JIRA ticket code:",jiraRequired:"JIRA code is required!",jiraInvalidFormat:"JIRA code must have the format DPW-0000",fetchingRemote:"Fetching remote changes...",pullingChanges:"Pulling changes into your branch...",pullError:e=>`Error: ${e}`,pushingChanges:"Pushing changes to remote...",pushedSuccess:"Changes pushed successfully!",pushedForceSuccess:"Changes pushed (force) successfully!",pushQuickError:e=>`Error: ${e}`,provideCommitMsg:"Please provide a commit message",stagingChanges:"Staging changes...",creatingCommit:"Creating commit...",commitCreated:"Commit created successfully!",commitError:e=>`Error: ${e}`,switchingPrevBranch:"Switching to previous branch...",switchedTo:e=>`Successfully switched to ${e} branch!`,checkoutError:e=>`Error: ${e}`,fetchingLatest:"Fetching latest changes...",mergingWith:e=>`Merging with ${e}...`,pushingMerged:"Pushing merged changes...",mergeCompleted:"Merge completed successfully!",mergeError:e=>`Error: ${e}`,removingLastCommit:"Removing last commit...",removeLastConfirm:"This will remove the last commit (changes will remain in staging). Continue?",lastCommitRemoved:"Last commit removed successfully!",removeLastError:e=>`Error: ${e}`,logError:e=>`Error: ${e}`,settingUpConfig:"Setting up your configuration",configSaved:"Configuration saved",missingConfigValues:"Missing required configuration values.",errorWritingConfig:"Error writing configuration file:",currentConfig:"Current configuration",useThisConfig:"Would you like to use this configuration?",installingDeps:"Installing dependencies...",depsInstalled:"All dependencies were installed",authFailed:"Authentication failed",unexpectedError:"An unexpected error occurred",enterEndpoint:"Enter your endpoint URL:",urlRequired:"URL is required!",urlMustBeHttp:"URL must use HTTP/HTTPS protocol",urlMustHaveHost:"URL must include a hostname",urlInvalid:"Please enter a valid URL",enterApiKey:"Enter your apikey:",apiKeyRequired:"API key is required!",enterRegistryName:"Enter your NPM registry name (without special characters):",registryNameRequired:"Registry name is required!",registryNameLettersOnly:"Registry name must contain only letters",enterRegistryURL:"Enter your NPM registry URL (without http/https):",registryURLRequired:"Registry URL is required!",registryURLStartWithName:"URL must start with a name only, avoid special characters",registryURLNoProtocol:"URL must not include 'http/https' protocol and must start with a letter",registryURLNoSlash:"URL must not start with '/' and must begin with a letter or number",registryURLNoWWW:"URL must not start with 'www' and must begin with a letter or number",languageSelect:"Select the interface language:",languageChanged:e=>`Language changed to: ${e}`,configMenu:"What would you like to configure?",configLanguage:"Interface language",configDefaultBranch:"Default base branch",configAIProvider:"Default AI provider",configView:"View current configuration",defaultBranchSet:e=>`Default base branch: ${e}`,aiProviderSet:e=>`Default AI provider: ${e}`};var Qe={es:Bs,en:ks};function h(e,...t){let r=Y().language||"es",o=(Qe[r]||Qe.es)[e];return typeof o=="function"?o(...t):o||e}function Ps(){let t=Y().language||"es";return(Qe[t]||Qe.es).commitTypes}function Ls(){return[{value:"es",label:"Espanol"},{value:"en",label:"English"}]}function F(e){if(Ce(e))return Fe(h("operationCancelled")),process.exit(0)}var Ns=(e=0)=>t=>`\x1B[${t+e}m`,Ds=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,Vs=(e=0)=>(t,s,r)=>`\x1B[${38+e};2;${t};${s};${r}m`,L={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},Wn=Object.keys(L.modifier),Ii=Object.keys(L.color),Si=Object.keys(L.bgColor),qn=[...Ii,...Si];function Ei(){let e=new Map;for(let[t,s]of Object.entries(L)){for(let[r,i]of Object.entries(s))L[r]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},s[r]=L[r],e.set(i[0],i[1]);Object.defineProperty(L,t,{value:s,enumerable:!1})}return Object.defineProperty(L,"codes",{value:e,enumerable:!1}),L.color.close="\x1B[39m",L.bgColor.close="\x1B[49m",L.color.ansi=Ns(),L.color.ansi256=Ds(),L.color.ansi16m=Vs(),L.bgColor.ansi=Ns(10),L.bgColor.ansi256=Ds(10),L.bgColor.ansi16m=Vs(10),Object.defineProperties(L,{rgbToAnsi256:{value(t,s,r){return t===s&&s===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(s/255*5)+Math.round(r/255*5)},enumerable:!1},hexToRgb:{value(t){let s=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!s)return[0,0,0];let[r]=s;r.length===3&&(r=[...r].map(o=>o+o).join(""));let i=Number.parseInt(r,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:t=>L.rgbToAnsi256(...L.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let s,r,i;if(t>=232)s=((t-232)*10+8)/255,r=s,i=s;else{t-=16;let u=t%36;s=Math.floor(t/36)/5,r=Math.floor(u/6)/5,i=u%6/5}let o=Math.max(s,r,i)*2;if(o===0)return 30;let a=30+(Math.round(i)<<2|Math.round(r)<<1|Math.round(s));return o===2&&(a+=60),a},enumerable:!1},rgbToAnsi:{value:(t,s,r)=>L.ansi256ToAnsi(L.rgbToAnsi256(t,s,r)),enumerable:!1},hexToAnsi:{value:t=>L.ansi256ToAnsi(L.hexToAnsi256(t)),enumerable:!1}}),L}var xi=Ei(),re=xi;import Nt from"node:process";import Ti from"node:os";import Us from"node:tty";function Z(e,t=globalThis.Deno?globalThis.Deno.args:Nt.argv){let s=e.startsWith("-")?"":e.length===1?"-":"--",r=t.indexOf(s+e),i=t.indexOf("--");return r!==-1&&(i===-1||r<i)}var{env:U}=Nt,Xe;Z("no-color")||Z("no-colors")||Z("color=false")||Z("color=never")?Xe=0:(Z("color")||Z("colors")||Z("color=true")||Z("color=always"))&&(Xe=1);function Ri(){if("FORCE_COLOR"in U)return U.FORCE_COLOR==="true"?1:U.FORCE_COLOR==="false"?0:U.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(U.FORCE_COLOR,10),3)}function _i(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Ai(e,{streamIsTTY:t,sniffFlags:s=!0}={}){let r=Ri();r!==void 0&&(Xe=r);let i=s?Xe:r;if(i===0)return 0;if(s){if(Z("color=16m")||Z("color=full")||Z("color=truecolor"))return 3;if(Z("color=256"))return 2}if("TF_BUILD"in U&&"AGENT_NAME"in U)return 1;if(e&&!t&&i===void 0)return 0;let o=i||0;if(U.TERM==="dumb")return o;if(Nt.platform==="win32"){let a=Ti.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in U)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(a=>a in U)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(a=>a in U)||U.CI_NAME==="codeship"?1:o;if("TEAMCITY_VERSION"in U)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(U.TEAMCITY_VERSION)?1:0;if(U.COLORTERM==="truecolor"||U.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in U){let a=Number.parseInt((U.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(U.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(U.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(U.TERM)||"COLORTERM"in U?1:o}function Gs(e,t={}){let s=Ai(e,{streamIsTTY:e&&e.isTTY,...t});return _i(s)}var Fi={stdout:Gs({isTTY:Us.isatty(1)}),stderr:Gs({isTTY:Us.isatty(2)})},js=Fi;function Ws(e,t,s){let r=e.indexOf(t);if(r===-1)return e;let i=t.length,o=0,a="";do a+=e.slice(o,r)+t+s,o=r+i,r=e.indexOf(t,o);while(r!==-1);return a+=e.slice(o),a}function qs(e,t,s,r){let i=0,o="";do{let a=e[r-1]==="\r";o+=e.slice(i,a?r-1:r)+t+(a?`\r
|
|
69
165
|
`:`
|
|
70
|
-
`)+
|
|
71
|
-
`,
|
|
72
|
-
`);return o!==-1&&(
|
|
73
|
-
`):[]}var
|
|
166
|
+
`)+s,i=r+1,r=e.indexOf(`
|
|
167
|
+
`,i)}while(r!==-1);return o+=e.slice(i),o}var{stdout:Hs,stderr:Ks}=js,Dt=Symbol("GENERATOR"),Ee=Symbol("STYLER"),Me=Symbol("IS_EMPTY"),zs=["ansi","ansi","ansi256","ansi16m"],xe=Object.create(null),Mi=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let s=Hs?Hs.level:0;e.level=t.level===void 0?s:t.level};var Oi=e=>{let t=(...s)=>s.join(" ");return Mi(t,e),Object.setPrototypeOf(t,Oe.prototype),t};function Oe(e){return Oi(e)}Object.setPrototypeOf(Oe.prototype,Function.prototype);for(let[e,t]of Object.entries(re))xe[e]={get(){let s=Ze(this,Ut(t.open,t.close,this[Ee]),this[Me]);return Object.defineProperty(this,e,{value:s}),s}};xe.visible={get(){let e=Ze(this,this[Ee],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var Vt=(e,t,s,...r)=>e==="rgb"?t==="ansi16m"?re[s].ansi16m(...r):t==="ansi256"?re[s].ansi256(re.rgbToAnsi256(...r)):re[s].ansi(re.rgbToAnsi(...r)):e==="hex"?Vt("rgb",t,s,...re.hexToRgb(...r)):re[s][e](...r),Bi=["rgb","hex","ansi256"];for(let e of Bi){xe[e]={get(){let{level:s}=this;return function(...r){let i=Ut(Vt(e,zs[s],"color",...r),re.color.close,this[Ee]);return Ze(this,i,this[Me])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);xe[t]={get(){let{level:s}=this;return function(...r){let i=Ut(Vt(e,zs[s],"bgColor",...r),re.bgColor.close,this[Ee]);return Ze(this,i,this[Me])}}}}var ki=Object.defineProperties(()=>{},{...xe,level:{enumerable:!0,get(){return this[Dt].level},set(e){this[Dt].level=e}}}),Ut=(e,t,s)=>{let r,i;return s===void 0?(r=e,i=t):(r=s.openAll+e,i=t+s.closeAll),{open:e,close:t,openAll:r,closeAll:i,parent:s}},Ze=(e,t,s)=>{let r=(...i)=>Pi(r,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(r,ki),r[Dt]=e,r[Ee]=t,r[Me]=s,r},Pi=(e,t)=>{if(e.level<=0||!t)return e[Me]?"":t;let s=e[Ee];if(s===void 0)return t;let{openAll:r,closeAll:i}=s;if(t.includes("\x1B"))for(;s!==void 0;)t=Ws(t,s.close,s.open),s=s.parent;let o=t.indexOf(`
|
|
168
|
+
`);return o!==-1&&(t=qs(t,i,r,o)),r+t+i};Object.defineProperties(Oe.prototype,xe);var Li=Oe(),to=Oe({level:Ks?Ks.level:0});var $e=Li;var Te={primary:"#57d7c4",secondary:"#199288",muted:"#9ca3af",success:"#06D6A0",error:"#EF4444",warning:"#F59E0B"},O={primary:e=>$e.hex(Te.primary)(e),secondary:e=>$e.hex(Te.secondary)(e),muted:e=>$e.hex(Te.muted)(e),success:e=>$e.hex(Te.success)(e),error:e=>$e.hex(Te.error)(e),warning:e=>$e.hex(Te.warning)(e)};var Ni=async()=>{let e=await K({message:O.secondary(h("selectBranchType")),options:[{value:"fix",label:h("branchFix")},{value:"improvement",label:h("branchImprovement")},{value:"feature",label:h("branchFeature")},{value:"refactor",label:h("branchRefactor")}]});return F(e),e},Js=Ni;X();var Di=e=>/^[A-Z]{3}-\d{4}$/.test(e),Ys=Di;var Vi=async()=>{let e=await ue({message:O.secondary(h("enterJiraCode")),placeholder:"DPW-0000",initialValue:"",validate(t){if(!t?.trim())return h("jiraRequired");if(!Ys(t))return h("jiraInvalidFormat")}});return F(e),e},Qs=Vi;var Ui=async()=>{let e=await Js(),t=await Qs();return`${e}/${t}`},Xs=Ui;var Gi=async()=>{let e=Y(),t=await Xs(),s=fe();try{s.start(h("creatingOriginalBranch")),Zs("git",["checkout","-b",t,`origin/${e.defaultBaseBranch}`],{stdio:"inherit"}),Zs("git",["push","origin",t],{stdio:"inherit"}),s.stop(h("branchCreatedAndPushed",t)),E.success(h("branchCreatedSuccess",t))}catch(r){s.stop(""),E.error(h("errorCreatingBranch",r.message))}},er=Gi;X();import{spawnSync as Re}from"child_process";X();var ji=async()=>{let e=await K({message:O.secondary(h("mergeBranchQuestion")),options:[{value:"develop",label:h("developDEV")},{value:"release",label:h("releaseUAT")}],required:!0,initialValue:"develop"});return F(e),e},tr=ji;import{execSync as Wi}from"child_process";var qi=()=>Wi("git rev-parse --abbrev-ref HEAD").toString().trim(),sr=qi;var Hi=async()=>{try{let e=await tr(),t=sr(),s=`${t}-${e}`;if(Re("git",["checkout","-b",s,`origin/${e}`],{stdio:"inherit"}),E.success(h("temporalBranchCreated")),Re("git",["merge",`origin/${t}`],{stdio:"inherit"}),E.success(h("temporalBranchMerged")),Re("git",["status","--porcelain"],{encoding:"utf-8"}).stdout.includes("UU")){E.warn(h("conflictsDetected"));return}Re("git",["push","origin",s],{stdio:"inherit"}),E.info(h("branchPushedToRemote"));let i=await ce({message:h("removeTemporalBranch")});F(i),i&&(Re("git",["checkout",t],{stdio:"inherit"}),Re("git",["branch","-D",s],{stdio:"inherit"}),E.info(h("temporalBranchDeleted")))}catch(e){E.error(`${h("errorCreatingTemporal")}: ${e.message}`)}},rr=Hi;X();import{execSync as ye,spawnSync as ee,spawn as Ki}from"child_process";function ir(e){let t=e.slice(3).trim();return t.includes(" -> ")?t.split(" -> ")[1].trim():t}function nr(){let e=ye("git status --short",{encoding:"utf-8"}).trim();return e?e.split(`
|
|
169
|
+
`):[]}var zi=async()=>{let e=Y(),t=Ps(),s=Object.entries(t).map(([w,B])=>({value:w,label:B})),r={M:h("statusModified"),A:h("statusAdded"),D:h("statusDeleted"),R:h("statusRenamed"),"??":h("statusUntracked")},i=ye("git rev-parse --abbrev-ref HEAD",{encoding:"utf-8"}).trim(),o=nr();if(E.info(`${h("currentBranch")}: ${i}`),E.info(`${h("filesChanged")}: ${o.length}`),o.length===0){let w=await ce({message:h("noChangesPending")});if(F(w),!w)return}let a=fe();a.start(h("updatingRefs"));try{ye("git fetch --quiet"),a.stop(h("refsUpdated"))}catch{a.stop(h("fetchFailed"))}let u=await ue({message:O.secondary(h("baseBranch")),placeholder:e.defaultBaseBranch,initialValue:e.defaultBaseBranch,validate:w=>w?.trim()?void 0:h("baseBranchRequired")});F(u);let c=await ue({message:O.secondary(h("ticketId")),placeholder:"DPW-0000",validate:w=>w?.trim()?void 0:h("ticketRequired")});F(c);let l=await K({message:O.secondary(h("changeType")),options:s});F(l);let d=`${l}/${c}`;if(ee("git",["branch","--list",d],{encoding:"utf-8"}).stdout.trim()){let w=await K({message:O.secondary(h("branchExistsLocal",d)),options:[{value:"checkout",label:h("switchToIt")},{value:"cancel",label:h("cancel")}]});if(F(w),w==="cancel"){E.warn(h("cancelledOp"));return}ee("git",["checkout",d],{stdio:"inherit"})}else try{a.start(h("creatingBranch",d,u)),ee("git",["checkout","-b",d,`origin/${u}`],{stdio:"pipe"}),a.stop(h("branchCreated",d))}catch(w){a.stop(""),E.error(h("errorCreatingBranch",w.message));return}let p=!1;for(;!p;){let w=nr();if(w.length===0){E.warn(h("noFilesToStage"));return}let B=await kt({message:O.secondary(h("selectFiles")),options:w.map(_=>{let q=_.slice(0,2).trim(),te=ir(_),ve=r[q]??q;return{value:_,label:te,hint:ve}}),required:!0});F(B),ee("git",["restore","--staged","."],{encoding:"utf-8"});for(let _ of B){let q=ir(_);ee("git",["add",q],{encoding:"utf-8"})}let H=ye("git status --short",{encoding:"utf-8"}).trim();ge(H,h("stagedFiles"));let S=await ce({message:h("stagedCorrect")});F(S),p=S,p||ee("git",["restore","--staged","."],{encoding:"utf-8"})}let y=ye("git diff --cached",{encoding:"utf-8"}),m=`Analiza el siguiente git diff y sugiere UN SOLO mensaje de commit en formato convencional.
|
|
74
170
|
|
|
75
|
-
Formato requerido: ${
|
|
171
|
+
Formato requerido: ${l}(${c}): descripcion en ingles
|
|
76
172
|
Reglas:
|
|
77
173
|
- Maximo 72 caracteres en total
|
|
78
174
|
- Verbo en presente ("add", "fix", "update", NO "added", "fixed")
|
|
@@ -81,10 +177,11 @@ Reglas:
|
|
|
81
177
|
- Responde UNICAMENTE con el mensaje de commit, sin explicaciones, sin comillas, sin markdown
|
|
82
178
|
|
|
83
179
|
Git diff:
|
|
84
|
-
${
|
|
85
|
-
`).filter(Boolean).length,
|
|
86
|
-
`),"
|
|
87
|
-
|
|
180
|
+
${y}`,b=await K({message:O.secondary(h("aiProvider")),options:[{value:"claude",label:"Claude"},{value:"opencode",label:"Opencode"}],initialValue:e.aiProvider});F(b);let $={claude:{binary:"claude",args:["-p",m],label:"Claude"},opencode:{binary:"opencode",args:["run",m],label:"Opencode"}},{binary:v,args:C,label:T}=$[b];a.start(h("generatingCommit",T));let R=await new Promise(w=>{let B="",H="",S=Ki(v,C,{stdio:["ignore","pipe","pipe"]});S.stdout.on("data",_=>{B+=_}),S.stderr.on("data",_=>{H+=_}),S.on("close",_=>w({status:_,stdout:B,stderr:H,error:null})),S.on("error",_=>w({status:1,stdout:"",stderr:"",error:_}))});a.stop("");let x;if(R.error||R.status!==0){E.warn(h("aiSuggestionFailed",T));let w=await ue({message:O.secondary(h("writeCommitMsg")),initialValue:`${l}(${c}): `,validate:B=>B?.trim()?void 0:h("commitMsgRequired")});F(w),x=w}else{let w=R.stdout.trim();ge(w,h("suggestionOf",T));let B=await K({message:O.secondary(h("useThisCommit")),options:[{value:"yes",label:h("yesUseIt")},{value:"modify",label:h("modify")}]});if(F(B),B==="yes")x=w;else{let H=await ue({message:O.secondary(h("writeCommitMsg")),initialValue:w,validate:S=>S?.trim()?void 0:h("commitMsgRequired")});F(H),x=H}}let P=!1;for(;!P;)if(ee("git",["commit","-m",x],{stdio:"inherit"}).status===0)E.success(h("commitSuccess")),P=!0;else{let B=await K({message:O.secondary(h("hookBlocked")),options:[{value:"retry",label:h("retryHook")},{value:"noverify",label:h("skipHook")},{value:"cancel",label:h("cancel")}]});if(F(B),B==="cancel")return;B==="noverify"&&(ee("git",["commit","--no-verify","-m",x],{stdio:"inherit"}),E.success(h("commitNoHooks")),P=!0),B==="retry"&&ee("git",["add","-u"],{stdio:"inherit"})}let M=await ce({message:h("pushToRemote")});F(M);let k="";if(M){let w=(S=!1)=>{ee("git",S?["push","-f","origin",d]:["push","-u","origin",d],{stdio:"inherit"})},B=()=>{let S=ye("git remote get-url origin",{encoding:"utf-8"}).trim(),_=S.match(/[:/]([^/]+\/[^/]+?)(\.git)?$/),q=_?_[1]:"";return S.includes("github.com")?`https://github.com/${q}/compare/${d}?expand=1`:S.includes("bitbucket.org")?`https://bitbucket.org/${q}/pull-requests/new?source=${d}`:S.includes("gitlab.com")?`https://gitlab.com/${q}/-/merge_requests/new?merge_request[source_branch]=${d}`:""};if(ee("git",["push","-u","origin",d],{stdio:"inherit"}).status===0)E.success(h("pushSuccess")),k=B();else{let S=await ce({message:h("pushForceQuestion")});F(S),S&&(ee("git",["push","-f","origin",d],{stdio:"inherit"}).status===0?(E.success(h("pushForceSuccess")),k=B()):E.error(h("pushForceError","push failed")))}}let N=ye('git diff --name-only HEAD~1 HEAD 2>/dev/null || git show --name-only --format="" HEAD',{encoding:"utf-8"}).trim().split(`
|
|
181
|
+
`).filter(Boolean).length,W=[`${h("summaryBranch")}: ${d}`,`${h("summaryFrom")}: origin/${u}`,`${h("summaryCommit")}: ${x}`,`${h("summaryFiles",N)}`,...M&&k?[`${h("summaryPush")}: origin/${d}`,`${h("summaryPR")}: ${k}`]:[]];ge(W.join(`
|
|
182
|
+
`),h("summaryTitle"))},or=zi;X();async function et(){let e=await K({message:O.secondary(h("configMenu")),options:[{value:"language",label:h("configLanguage")},{value:"defaultBranch",label:h("configDefaultBranch")},{value:"aiProvider",label:h("configAIProvider")},{value:"view",label:h("configView")}]});if(F(e),e==="language"){let t=await K({message:O.secondary(h("languageSelect")),options:Ls(),initialValue:Y().language});F(t),Ye({language:t}),E.success(h("languageChanged",t))}if(e==="defaultBranch"){let{text:t}=await Promise.resolve().then(()=>(X(),As)),s=await t({message:O.secondary(h("baseBranch")),initialValue:Y().defaultBaseBranch,validate:r=>r?.trim()?void 0:h("baseBranchRequired")});F(s),Ye({defaultBaseBranch:s}),E.success(h("defaultBranchSet",s))}if(e==="aiProvider"){let t=await K({message:O.secondary(h("aiProvider")),options:[{value:"claude",label:"Claude"},{value:"opencode",label:"Opencode"}],initialValue:Y().aiProvider});F(t),Ye({aiProvider:t}),E.success(h("aiProviderSet",t))}if(e==="view"){let t=Y(),s=Object.entries(t).map(([r,i])=>` ${r}: ${i}`).join(`
|
|
183
|
+
`);ge(s,O.secondary(h("currentConfig")))}}import{readFileSync as Ji}from"fs";import{fileURLToPath as Yi}from"url";import{dirname as Qi,resolve as Xi}from"path";var Zi=()=>{let e=Yi(import.meta.url),t=Qi(e);return JSON.parse(Ji(Xi(t,"../package.json"),"utf8"))?.version},ar=Zi;X();import{existsSync as en}from"fs";import{join as tn}from"path";import{execSync as sn}from"child_process";var rn=()=>{try{sn("git --version",{stdio:"ignore"})}catch{E.error(h("gitNotInstalled")),process.exit(1)}let e=tn(process.cwd(),".git");en(e)||(E.error(h("notGitRepo")),process.exit(1))},cr=rn;var st=process.argv.slice(2);(st.includes("-v")||st.includes("--version"))&&(console.log(`${h("version")}: ${ar()}`),process.exit(0));(st.includes("config")||st.includes("--config"))&&(await et(),process.exit(0));cr();Ot(O.primary(`
|
|
184
|
+
${h("welcome")}
|
|
88
185
|
|
|
89
186
|
.-------------------------------------------------------------------------------.
|
|
90
187
|
| \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588|
|
|
@@ -96,6 +193,6 @@ ${h}`,c=await S({message:"Con que IA quieres generar la sugerencia de commit?",o
|
|
|
96
193
|
| \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2591\u2591\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588 |
|
|
97
194
|
|\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 \u2591\u2591\u2591\u2591\u2591 |
|
|
98
195
|
'-------------------------------------------------------------------------------'
|
|
99
|
-
|
|
100
|
-
${
|
|
101
|
-
`));var
|
|
196
|
+
|
|
197
|
+
${O.muted(h("subtitle"))}
|
|
198
|
+
`));var tt=await K({message:O.secondary(h("whatToDo")),options:[{value:"ACB",label:h("addChanges")},{value:"CRO",label:h("createOriginal")},{value:"CRT",label:h("createTemporal")},{value:"CFG",label:h("configMenu")}],required:!0,initialValue:"ACB"});tt==="ACB"?await or():tt==="CRO"?await er():tt==="CRT"?await rr():tt==="CFG"?await et():(Fe(h("operationCancelled")),process.exit(0));Bt(O.success(h("operationCompleted")));
|