@r5n/sisyphus 0.3.19 → 0.3.21
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/cli.js +52 -52
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,101 +1,101 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
var ao=Object.create;var{getPrototypeOf:co,defineProperty:Vn,getOwnPropertyNames:lo}=Object;var mo=Object.prototype.hasOwnProperty;var F=(r,o,t)=>{t=r!=null?ao(co(r)):{};let e=o||!r||!r.__esModule?Vn(t,"default",{value:r,enumerable:!0}):t;for(let s of lo(r))if(!mo.call(e,s))Vn(e,s,{get:()=>r[s],enumerable:!0});return e};var Fn=(r,o)=>()=>(o||r((o={exports:{}}).exports,o),o.exports);var go=import.meta.require;var vn=Fn((Wt,Dn)=>{var Sn={to(r,o){if(!o)return`\x1B[${r+1}G`;return`\x1B[${o+1};${r+1}H`},move(r,o){let t="";if(r<0)t+=`\x1B[${-r}D`;else if(r>0)t+=`\x1B[${r}C`;if(o<0)t+=`\x1B[${-o}A`;else if(o>0)t+=`\x1B[${o}B`;return t},up:(r=1)=>`\x1B[${r}A`,down:(r=1)=>`\x1B[${r}B`,forward:(r=1)=>`\x1B[${r}C`,backward:(r=1)=>`\x1B[${r}D`,nextLine:(r=1)=>"\x1B[E".repeat(r),prevLine:(r=1)=>"\x1B[F".repeat(r),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},po={up:(r=1)=>"\x1B[S".repeat(r),down:(r=1)=>"\x1B[T".repeat(r)},ho={screen:"\x1B[2J",up:(r=1)=>"\x1B[1J".repeat(r),down:(r=1)=>"\x1B[J".repeat(r),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(r){let o="";for(let t=0;t<r;t++)o+=this.line+(t<r-1?Sn.up():"");if(r)o+=Sn.left;return o}};Dn.exports={cursor:Sn,scroll:po,erase:ho,beep:"\x07"}});var On=Fn((Zt,En)=>{var tn=process||{},nr=tn.argv||[],on=tn.env||{},bo=!(!!on.NO_COLOR||nr.includes("--no-color"))&&(!!on.FORCE_COLOR||nr.includes("--color")||tn.platform==="win32"||(tn.stdout||{}).isTTY&&on.TERM!=="dumb"||!!on.CI),fo=(r,o,t=r)=>(e)=>{let s=""+e,i=s.indexOf(o,r.length);return~i?r+yo(s,o,t,i)+o:r+s+o},yo=(r,o,t,e)=>{let s="",i=0;do s+=r.substring(i,e)+t,i=e+o.length,e=r.indexOf(o,i);while(~e);return s+r.substring(i)},rr=(r=bo)=>{let o=r?fo:()=>String;return{isColorSupported:r,reset:o("\x1B[0m","\x1B[0m"),bold:o("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:o("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:o("\x1B[3m","\x1B[23m"),underline:o("\x1B[4m","\x1B[24m"),inverse:o("\x1B[7m","\x1B[27m"),hidden:o("\x1B[8m","\x1B[28m"),strikethrough:o("\x1B[9m","\x1B[29m"),black:o("\x1B[30m","\x1B[39m"),red:o("\x1B[31m","\x1B[39m"),green:o("\x1B[32m","\x1B[39m"),yellow:o("\x1B[33m","\x1B[39m"),blue:o("\x1B[34m","\x1B[39m"),magenta:o("\x1B[35m","\x1B[39m"),cyan:o("\x1B[36m","\x1B[39m"),white:o("\x1B[37m","\x1B[39m"),gray:o("\x1B[90m","\x1B[39m"),bgBlack:o("\x1B[40m","\x1B[49m"),bgRed:o("\x1B[41m","\x1B[49m"),bgGreen:o("\x1B[42m","\x1B[49m"),bgYellow:o("\x1B[43m","\x1B[49m"),bgBlue:o("\x1B[44m","\x1B[49m"),bgMagenta:o("\x1B[45m","\x1B[49m"),bgCyan:o("\x1B[46m","\x1B[49m"),bgWhite:o("\x1B[47m","\x1B[49m"),blackBright:o("\x1B[90m","\x1B[39m"),redBright:o("\x1B[91m","\x1B[39m"),greenBright:o("\x1B[92m","\x1B[39m"),yellowBright:o("\x1B[93m","\x1B[39m"),blueBright:o("\x1B[94m","\x1B[39m"),magentaBright:o("\x1B[95m","\x1B[39m"),cyanBright:o("\x1B[96m","\x1B[39m"),whiteBright:o("\x1B[97m","\x1B[39m"),bgBlackBright:o("\x1B[100m","\x1B[49m"),bgRedBright:o("\x1B[101m","\x1B[49m"),bgGreenBright:o("\x1B[102m","\x1B[49m"),bgYellowBright:o("\x1B[103m","\x1B[49m"),bgBlueBright:o("\x1B[104m","\x1B[49m"),bgMagentaBright:o("\x1B[105m","\x1B[49m"),bgCyanBright:o("\x1B[106m","\x1B[49m"),bgWhiteBright:o("\x1B[107m","\x1B[49m")}};En.exports=rr();En.exports.createColors=rr});import{stripVTControlCharacters as Gn}from"util";var I=F(vn(),1),pr=F(On(),1);import{stdin as mr,stdout as gr}from"process";import*as H from"readline";import or from"readline";import{Writable as $o}from"stream";function xo({onlyFirst:r=!1}={}){let o=["[\\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(o,r?void 0:"g")}var wo=xo();function hr(r){if(typeof r!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof r}\``);return r.replace(wo,"")}function br(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var fr={exports:{}};(function(r){var o={};r.exports=o,o.eastAsianWidth=function(e){var s=e.charCodeAt(0),i=e.length==2?e.charCodeAt(1):0,n=s;return 55296<=s&&s<=56319&&56320<=i&&i<=57343&&(s&=1023,i&=1023,n=s<<10|i,n+=65536),n==12288||65281<=n&&n<=65376||65504<=n&&n<=65510?"F":n==8361||65377<=n&&n<=65470||65474<=n&&n<=65479||65482<=n&&n<=65487||65490<=n&&n<=65495||65498<=n&&n<=65500||65512<=n&&n<=65518?"H":4352<=n&&n<=4447||4515<=n&&n<=4519||4602<=n&&n<=4607||9001<=n&&n<=9002||11904<=n&&n<=11929||11931<=n&&n<=12019||12032<=n&&n<=12245||12272<=n&&n<=12283||12289<=n&&n<=12350||12353<=n&&n<=12438||12441<=n&&n<=12543||12549<=n&&n<=12589||12593<=n&&n<=12686||12688<=n&&n<=12730||12736<=n&&n<=12771||12784<=n&&n<=12830||12832<=n&&n<=12871||12880<=n&&n<=13054||13056<=n&&n<=19903||19968<=n&&n<=42124||42128<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||55216<=n&&n<=55238||55243<=n&&n<=55291||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65106||65108<=n&&n<=65126||65128<=n&&n<=65131||110592<=n&&n<=110593||127488<=n&&n<=127490||127504<=n&&n<=127546||127552<=n&&n<=127560||127568<=n&&n<=127569||131072<=n&&n<=194367||177984<=n&&n<=196605||196608<=n&&n<=262141?"W":32<=n&&n<=126||162<=n&&n<=163||165<=n&&n<=166||n==172||n==175||10214<=n&&n<=10221||10629<=n&&n<=10630?"Na":n==161||n==164||167<=n&&n<=168||n==170||173<=n&&n<=174||176<=n&&n<=180||182<=n&&n<=186||188<=n&&n<=191||n==198||n==208||215<=n&&n<=216||222<=n&&n<=225||n==230||232<=n&&n<=234||236<=n&&n<=237||n==240||242<=n&&n<=243||247<=n&&n<=250||n==252||n==254||n==257||n==273||n==275||n==283||294<=n&&n<=295||n==299||305<=n&&n<=307||n==312||319<=n&&n<=322||n==324||328<=n&&n<=331||n==333||338<=n&&n<=339||358<=n&&n<=359||n==363||n==462||n==464||n==466||n==468||n==470||n==472||n==474||n==476||n==593||n==609||n==708||n==711||713<=n&&n<=715||n==717||n==720||728<=n&&n<=731||n==733||n==735||768<=n&&n<=879||913<=n&&n<=929||931<=n&&n<=937||945<=n&&n<=961||963<=n&&n<=969||n==1025||1040<=n&&n<=1103||n==1105||n==8208||8211<=n&&n<=8214||8216<=n&&n<=8217||8220<=n&&n<=8221||8224<=n&&n<=8226||8228<=n&&n<=8231||n==8240||8242<=n&&n<=8243||n==8245||n==8251||n==8254||n==8308||n==8319||8321<=n&&n<=8324||n==8364||n==8451||n==8453||n==8457||n==8467||n==8470||8481<=n&&n<=8482||n==8486||n==8491||8531<=n&&n<=8532||8539<=n&&n<=8542||8544<=n&&n<=8555||8560<=n&&n<=8569||n==8585||8592<=n&&n<=8601||8632<=n&&n<=8633||n==8658||n==8660||n==8679||n==8704||8706<=n&&n<=8707||8711<=n&&n<=8712||n==8715||n==8719||n==8721||n==8725||n==8730||8733<=n&&n<=8736||n==8739||n==8741||8743<=n&&n<=8748||n==8750||8756<=n&&n<=8759||8764<=n&&n<=8765||n==8776||n==8780||n==8786||8800<=n&&n<=8801||8804<=n&&n<=8807||8810<=n&&n<=8811||8814<=n&&n<=8815||8834<=n&&n<=8835||8838<=n&&n<=8839||n==8853||n==8857||n==8869||n==8895||n==8978||9312<=n&&n<=9449||9451<=n&&n<=9547||9552<=n&&n<=9587||9600<=n&&n<=9615||9618<=n&&n<=9621||9632<=n&&n<=9633||9635<=n&&n<=9641||9650<=n&&n<=9651||9654<=n&&n<=9655||9660<=n&&n<=9661||9664<=n&&n<=9665||9670<=n&&n<=9672||n==9675||9678<=n&&n<=9681||9698<=n&&n<=9701||n==9711||9733<=n&&n<=9734||n==9737||9742<=n&&n<=9743||9748<=n&&n<=9749||n==9756||n==9758||n==9792||n==9794||9824<=n&&n<=9825||9827<=n&&n<=9829||9831<=n&&n<=9834||9836<=n&&n<=9837||n==9839||9886<=n&&n<=9887||9918<=n&&n<=9919||9924<=n&&n<=9933||9935<=n&&n<=9953||n==9955||9960<=n&&n<=9983||n==10045||n==10071||10102<=n&&n<=10111||11093<=n&&n<=11097||12872<=n&&n<=12879||57344<=n&&n<=63743||65024<=n&&n<=65039||n==65533||127232<=n&&n<=127242||127248<=n&&n<=127277||127280<=n&&n<=127337||127344<=n&&n<=127386||917760<=n&&n<=917999||983040<=n&&n<=1048573||1048576<=n&&n<=1114109?"A":"N"},o.characterLength=function(e){var s=this.eastAsianWidth(e);return s=="F"||s=="W"||s=="A"?2:1};function t(e){return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}o.length=function(e){for(var s=t(e),i=0,n=0;n<s.length;n++)i=i+this.characterLength(s[n]);return i},o.slice=function(e,s,i){textLen=o.length(e),s=s||0,i=i||1,s<0&&(s=textLen+s),i<0&&(i=textLen+i);for(var n="",c=0,l=t(e),g=0;g<l.length;g++){var p=l[g],h=o.length(p);if(c>=s-(h==2?1:0))if(c+h<=i)n+=p;else break;c+=h}return n}})(fr);var So=fr.exports,vo=br(So),Eo=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},Oo=br(Eo);function D(r,o={}){if(typeof r!="string"||r.length===0||(o={ambiguousIsNarrow:!0,...o},r=hr(r),r.length===0))return 0;r=r.replace(Oo()," ");let t=o.ambiguousIsNarrow?1:2,e=0;for(let s of r){let i=s.codePointAt(0);if(i<=31||i>=127&&i<=159||i>=768&&i<=879)continue;switch(vo.eastAsianWidth(s)){case"F":case"W":e+=2;break;case"A":e+=t;break;default:e+=1}}return e}var un=10,tr=(r=0)=>(o)=>`\x1B[${o+r}m`,er=(r=0)=>(o)=>`\x1B[${38+r};5;${o}m`,sr=(r=0)=>(o,t,e)=>`\x1B[${38+r};2;${o};${t};${e}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(_.modifier);var uo=Object.keys(_.color),_o=Object.keys(_.bgColor);[...uo];function Ro(){let r=new Map;for(let[o,t]of Object.entries(_)){for(let[e,s]of Object.entries(t))_[e]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},t[e]=_[e],r.set(s[0],s[1]);Object.defineProperty(_,o,{value:t,enumerable:!1})}return Object.defineProperty(_,"codes",{value:r,enumerable:!1}),_.color.close="\x1B[39m",_.bgColor.close="\x1B[49m",_.color.ansi=tr(),_.color.ansi256=er(),_.color.ansi16m=sr(),_.bgColor.ansi=tr(un),_.bgColor.ansi256=er(un),_.bgColor.ansi16m=sr(un),Object.defineProperties(_,{rgbToAnsi256:{value:(o,t,e)=>o===t&&t===e?o<8?16:o>248?231:Math.round((o-8)/247*24)+232:16+36*Math.round(o/255*5)+6*Math.round(t/255*5)+Math.round(e/255*5),enumerable:!1},hexToRgb:{value:(o)=>{let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(o.toString(16));if(!t)return[0,0,0];let[e]=t;e.length===3&&(e=[...e].map((i)=>i+i).join(""));let s=Number.parseInt(e,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:(o)=>_.rgbToAnsi256(..._.hexToRgb(o)),enumerable:!1},ansi256ToAnsi:{value:(o)=>{if(o<8)return 30+o;if(o<16)return 90+(o-8);let t,e,s;if(o>=232)t=((o-232)*10+8)/255,e=t,s=t;else{o-=16;let c=o%36;t=Math.floor(o/36)/5,e=Math.floor(c/6)/5,s=c%6/5}let i=Math.max(t,e,s)*2;if(i===0)return 30;let n=30+(Math.round(s)<<2|Math.round(e)<<1|Math.round(t));return i===2&&(n+=60),n},enumerable:!1},rgbToAnsi:{value:(o,t,e)=>_.ansi256ToAnsi(_.rgbToAnsi256(o,t,e)),enumerable:!1},hexToAnsi:{value:(o)=>_.ansi256ToAnsi(_.hexToAnsi256(o)),enumerable:!1}}),_}var ko=Ro(),an=new Set(["\x1B","\x9B"]),Io=39,kn="\x07",dr="[",No="]",yr="m",In=`${No}8;;`,ir=(r)=>`${an.values().next().value}${dr}${r}${yr}`,ar=(r)=>`${an.values().next().value}${In}${r}${kn}`,Ao=(r)=>r.split(" ").map((o)=>D(o)),_n=(r,o,t)=>{let e=[...o],s=!1,i=!1,n=D(hr(r[r.length-1]));for(let[c,l]of e.entries()){let g=D(l);if(n+g<=t?r[r.length-1]+=l:(r.push(l),n=0),an.has(l)&&(s=!0,i=e.slice(c+1).join("").startsWith(In)),s){i?l===kn&&(s=!1,i=!1):l===yr&&(s=!1);continue}n+=g,n===t&&c<e.length-1&&(r.push(""),n=0)}!n&&r[r.length-1].length>0&&r.length>1&&(r[r.length-2]+=r.pop())},Co=(r)=>{let o=r.split(" "),t=o.length;for(;t>0&&!(D(o[t-1])>0);)t--;return t===o.length?r:o.slice(0,t).join(" ")+o.slice(t).join("")},Go=(r,o,t={})=>{if(t.trim!==!1&&r.trim()==="")return"";let e="",s,i,n=Ao(r),c=[""];for(let[g,p]of r.split(" ").entries()){t.trim!==!1&&(c[c.length-1]=c[c.length-1].trimStart());let h=D(c[c.length-1]);if(g!==0&&(h>=o&&(t.wordWrap===!1||t.trim===!1)&&(c.push(""),h=0),(h>0||t.trim===!1)&&(c[c.length-1]+=" ",h++)),t.hard&&n[g]>o){let f=o-h,d=1+Math.floor((n[g]-f-1)/o);Math.floor((n[g]-1)/o)<d&&c.push(""),_n(c,p,o);continue}if(h+n[g]>o&&h>0&&n[g]>0){if(t.wordWrap===!1&&h<o){_n(c,p,o);continue}c.push("")}if(h+n[g]>o&&t.wordWrap===!1){_n(c,p,o);continue}c[c.length-1]+=p}t.trim!==!1&&(c=c.map((g)=>Co(g)));let l=[...c.join(`
|
|
3
|
-
`)];for(let[g,p]of l.entries()){if(e+=p,an.has(p)){let{groups:f}=new RegExp(`(?:\\${
|
|
4
|
-
`?(i&&(e+=
|
|
5
|
-
`&&(s&&h&&(e+=
|
|
2
|
+
var ao=Object.create;var{getPrototypeOf:co,defineProperty:Fn,getOwnPropertyNames:lo}=Object;var mo=Object.prototype.hasOwnProperty;var F=(r,o,t)=>{t=r!=null?ao(co(r)):{};let e=o||!r||!r.__esModule?Fn(t,"default",{value:r,enumerable:!0}):t;for(let s of lo(r))if(!mo.call(e,s))Fn(e,s,{get:()=>r[s],enumerable:!0});return e};var Dn=(r,o)=>()=>(o||r((o={exports:{}}).exports,o),o.exports);var go=import.meta.require;var En=Dn((Wt,nr)=>{var vn={to(r,o){if(!o)return`\x1B[${r+1}G`;return`\x1B[${o+1};${r+1}H`},move(r,o){let t="";if(r<0)t+=`\x1B[${-r}D`;else if(r>0)t+=`\x1B[${r}C`;if(o<0)t+=`\x1B[${-o}A`;else if(o>0)t+=`\x1B[${o}B`;return t},up:(r=1)=>`\x1B[${r}A`,down:(r=1)=>`\x1B[${r}B`,forward:(r=1)=>`\x1B[${r}C`,backward:(r=1)=>`\x1B[${r}D`,nextLine:(r=1)=>"\x1B[E".repeat(r),prevLine:(r=1)=>"\x1B[F".repeat(r),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},po={up:(r=1)=>"\x1B[S".repeat(r),down:(r=1)=>"\x1B[T".repeat(r)},ho={screen:"\x1B[2J",up:(r=1)=>"\x1B[1J".repeat(r),down:(r=1)=>"\x1B[J".repeat(r),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(r){let o="";for(let t=0;t<r;t++)o+=this.line+(t<r-1?vn.up():"");if(r)o+=vn.left;return o}};nr.exports={cursor:vn,scroll:po,erase:ho,beep:"\x07"}});var un=Dn((Zt,On)=>{var tn=process||{},rr=tn.argv||[],on=tn.env||{},bo=!(!!on.NO_COLOR||rr.includes("--no-color"))&&(!!on.FORCE_COLOR||rr.includes("--color")||tn.platform==="win32"||(tn.stdout||{}).isTTY&&on.TERM!=="dumb"||!!on.CI),fo=(r,o,t=r)=>(e)=>{let s=""+e,i=s.indexOf(o,r.length);return~i?r+yo(s,o,t,i)+o:r+s+o},yo=(r,o,t,e)=>{let s="",i=0;do s+=r.substring(i,e)+t,i=e+o.length,e=r.indexOf(o,i);while(~e);return s+r.substring(i)},or=(r=bo)=>{let o=r?fo:()=>String;return{isColorSupported:r,reset:o("\x1B[0m","\x1B[0m"),bold:o("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:o("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:o("\x1B[3m","\x1B[23m"),underline:o("\x1B[4m","\x1B[24m"),inverse:o("\x1B[7m","\x1B[27m"),hidden:o("\x1B[8m","\x1B[28m"),strikethrough:o("\x1B[9m","\x1B[29m"),black:o("\x1B[30m","\x1B[39m"),red:o("\x1B[31m","\x1B[39m"),green:o("\x1B[32m","\x1B[39m"),yellow:o("\x1B[33m","\x1B[39m"),blue:o("\x1B[34m","\x1B[39m"),magenta:o("\x1B[35m","\x1B[39m"),cyan:o("\x1B[36m","\x1B[39m"),white:o("\x1B[37m","\x1B[39m"),gray:o("\x1B[90m","\x1B[39m"),bgBlack:o("\x1B[40m","\x1B[49m"),bgRed:o("\x1B[41m","\x1B[49m"),bgGreen:o("\x1B[42m","\x1B[49m"),bgYellow:o("\x1B[43m","\x1B[49m"),bgBlue:o("\x1B[44m","\x1B[49m"),bgMagenta:o("\x1B[45m","\x1B[49m"),bgCyan:o("\x1B[46m","\x1B[49m"),bgWhite:o("\x1B[47m","\x1B[49m"),blackBright:o("\x1B[90m","\x1B[39m"),redBright:o("\x1B[91m","\x1B[39m"),greenBright:o("\x1B[92m","\x1B[39m"),yellowBright:o("\x1B[93m","\x1B[39m"),blueBright:o("\x1B[94m","\x1B[39m"),magentaBright:o("\x1B[95m","\x1B[39m"),cyanBright:o("\x1B[96m","\x1B[39m"),whiteBright:o("\x1B[97m","\x1B[39m"),bgBlackBright:o("\x1B[100m","\x1B[49m"),bgRedBright:o("\x1B[101m","\x1B[49m"),bgGreenBright:o("\x1B[102m","\x1B[49m"),bgYellowBright:o("\x1B[103m","\x1B[49m"),bgBlueBright:o("\x1B[104m","\x1B[49m"),bgMagentaBright:o("\x1B[105m","\x1B[49m"),bgCyanBright:o("\x1B[106m","\x1B[49m"),bgWhiteBright:o("\x1B[107m","\x1B[49m")}};On.exports=or();On.exports.createColors=or});import{stripVTControlCharacters as Pn}from"util";var I=F(En(),1),hr=F(un(),1);import{stdin as gr,stdout as pr}from"process";import*as H from"readline";import tr from"readline";import{Writable as $o}from"stream";function xo({onlyFirst:r=!1}={}){let o=["[\\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(o,r?void 0:"g")}var wo=xo();function br(r){if(typeof r!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof r}\``);return r.replace(wo,"")}function fr(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var dr={exports:{}};(function(r){var o={};r.exports=o,o.eastAsianWidth=function(e){var s=e.charCodeAt(0),i=e.length==2?e.charCodeAt(1):0,n=s;return 55296<=s&&s<=56319&&56320<=i&&i<=57343&&(s&=1023,i&=1023,n=s<<10|i,n+=65536),n==12288||65281<=n&&n<=65376||65504<=n&&n<=65510?"F":n==8361||65377<=n&&n<=65470||65474<=n&&n<=65479||65482<=n&&n<=65487||65490<=n&&n<=65495||65498<=n&&n<=65500||65512<=n&&n<=65518?"H":4352<=n&&n<=4447||4515<=n&&n<=4519||4602<=n&&n<=4607||9001<=n&&n<=9002||11904<=n&&n<=11929||11931<=n&&n<=12019||12032<=n&&n<=12245||12272<=n&&n<=12283||12289<=n&&n<=12350||12353<=n&&n<=12438||12441<=n&&n<=12543||12549<=n&&n<=12589||12593<=n&&n<=12686||12688<=n&&n<=12730||12736<=n&&n<=12771||12784<=n&&n<=12830||12832<=n&&n<=12871||12880<=n&&n<=13054||13056<=n&&n<=19903||19968<=n&&n<=42124||42128<=n&&n<=42182||43360<=n&&n<=43388||44032<=n&&n<=55203||55216<=n&&n<=55238||55243<=n&&n<=55291||63744<=n&&n<=64255||65040<=n&&n<=65049||65072<=n&&n<=65106||65108<=n&&n<=65126||65128<=n&&n<=65131||110592<=n&&n<=110593||127488<=n&&n<=127490||127504<=n&&n<=127546||127552<=n&&n<=127560||127568<=n&&n<=127569||131072<=n&&n<=194367||177984<=n&&n<=196605||196608<=n&&n<=262141?"W":32<=n&&n<=126||162<=n&&n<=163||165<=n&&n<=166||n==172||n==175||10214<=n&&n<=10221||10629<=n&&n<=10630?"Na":n==161||n==164||167<=n&&n<=168||n==170||173<=n&&n<=174||176<=n&&n<=180||182<=n&&n<=186||188<=n&&n<=191||n==198||n==208||215<=n&&n<=216||222<=n&&n<=225||n==230||232<=n&&n<=234||236<=n&&n<=237||n==240||242<=n&&n<=243||247<=n&&n<=250||n==252||n==254||n==257||n==273||n==275||n==283||294<=n&&n<=295||n==299||305<=n&&n<=307||n==312||319<=n&&n<=322||n==324||328<=n&&n<=331||n==333||338<=n&&n<=339||358<=n&&n<=359||n==363||n==462||n==464||n==466||n==468||n==470||n==472||n==474||n==476||n==593||n==609||n==708||n==711||713<=n&&n<=715||n==717||n==720||728<=n&&n<=731||n==733||n==735||768<=n&&n<=879||913<=n&&n<=929||931<=n&&n<=937||945<=n&&n<=961||963<=n&&n<=969||n==1025||1040<=n&&n<=1103||n==1105||n==8208||8211<=n&&n<=8214||8216<=n&&n<=8217||8220<=n&&n<=8221||8224<=n&&n<=8226||8228<=n&&n<=8231||n==8240||8242<=n&&n<=8243||n==8245||n==8251||n==8254||n==8308||n==8319||8321<=n&&n<=8324||n==8364||n==8451||n==8453||n==8457||n==8467||n==8470||8481<=n&&n<=8482||n==8486||n==8491||8531<=n&&n<=8532||8539<=n&&n<=8542||8544<=n&&n<=8555||8560<=n&&n<=8569||n==8585||8592<=n&&n<=8601||8632<=n&&n<=8633||n==8658||n==8660||n==8679||n==8704||8706<=n&&n<=8707||8711<=n&&n<=8712||n==8715||n==8719||n==8721||n==8725||n==8730||8733<=n&&n<=8736||n==8739||n==8741||8743<=n&&n<=8748||n==8750||8756<=n&&n<=8759||8764<=n&&n<=8765||n==8776||n==8780||n==8786||8800<=n&&n<=8801||8804<=n&&n<=8807||8810<=n&&n<=8811||8814<=n&&n<=8815||8834<=n&&n<=8835||8838<=n&&n<=8839||n==8853||n==8857||n==8869||n==8895||n==8978||9312<=n&&n<=9449||9451<=n&&n<=9547||9552<=n&&n<=9587||9600<=n&&n<=9615||9618<=n&&n<=9621||9632<=n&&n<=9633||9635<=n&&n<=9641||9650<=n&&n<=9651||9654<=n&&n<=9655||9660<=n&&n<=9661||9664<=n&&n<=9665||9670<=n&&n<=9672||n==9675||9678<=n&&n<=9681||9698<=n&&n<=9701||n==9711||9733<=n&&n<=9734||n==9737||9742<=n&&n<=9743||9748<=n&&n<=9749||n==9756||n==9758||n==9792||n==9794||9824<=n&&n<=9825||9827<=n&&n<=9829||9831<=n&&n<=9834||9836<=n&&n<=9837||n==9839||9886<=n&&n<=9887||9918<=n&&n<=9919||9924<=n&&n<=9933||9935<=n&&n<=9953||n==9955||9960<=n&&n<=9983||n==10045||n==10071||10102<=n&&n<=10111||11093<=n&&n<=11097||12872<=n&&n<=12879||57344<=n&&n<=63743||65024<=n&&n<=65039||n==65533||127232<=n&&n<=127242||127248<=n&&n<=127277||127280<=n&&n<=127337||127344<=n&&n<=127386||917760<=n&&n<=917999||983040<=n&&n<=1048573||1048576<=n&&n<=1114109?"A":"N"},o.characterLength=function(e){var s=this.eastAsianWidth(e);return s=="F"||s=="W"||s=="A"?2:1};function t(e){return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}o.length=function(e){for(var s=t(e),i=0,n=0;n<s.length;n++)i=i+this.characterLength(s[n]);return i},o.slice=function(e,s,i){textLen=o.length(e),s=s||0,i=i||1,s<0&&(s=textLen+s),i<0&&(i=textLen+i);for(var n="",c=0,l=t(e),g=0;g<l.length;g++){var p=l[g],h=o.length(p);if(c>=s-(h==2?1:0))if(c+h<=i)n+=p;else break;c+=h}return n}})(dr);var So=dr.exports,vo=fr(So),Eo=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},Oo=fr(Eo);function D(r,o={}){if(typeof r!="string"||r.length===0||(o={ambiguousIsNarrow:!0,...o},r=br(r),r.length===0))return 0;r=r.replace(Oo()," ");let t=o.ambiguousIsNarrow?1:2,e=0;for(let s of r){let i=s.codePointAt(0);if(i<=31||i>=127&&i<=159||i>=768&&i<=879)continue;switch(vo.eastAsianWidth(s)){case"F":case"W":e+=2;break;case"A":e+=t;break;default:e+=1}}return e}var _n=10,er=(r=0)=>(o)=>`\x1B[${o+r}m`,sr=(r=0)=>(o)=>`\x1B[${38+r};5;${o}m`,ir=(r=0)=>(o,t,e)=>`\x1B[${38+r};2;${o};${t};${e}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(_.modifier);var uo=Object.keys(_.color),_o=Object.keys(_.bgColor);[...uo];function Ro(){let r=new Map;for(let[o,t]of Object.entries(_)){for(let[e,s]of Object.entries(t))_[e]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},t[e]=_[e],r.set(s[0],s[1]);Object.defineProperty(_,o,{value:t,enumerable:!1})}return Object.defineProperty(_,"codes",{value:r,enumerable:!1}),_.color.close="\x1B[39m",_.bgColor.close="\x1B[49m",_.color.ansi=er(),_.color.ansi256=sr(),_.color.ansi16m=ir(),_.bgColor.ansi=er(_n),_.bgColor.ansi256=sr(_n),_.bgColor.ansi16m=ir(_n),Object.defineProperties(_,{rgbToAnsi256:{value:(o,t,e)=>o===t&&t===e?o<8?16:o>248?231:Math.round((o-8)/247*24)+232:16+36*Math.round(o/255*5)+6*Math.round(t/255*5)+Math.round(e/255*5),enumerable:!1},hexToRgb:{value:(o)=>{let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(o.toString(16));if(!t)return[0,0,0];let[e]=t;e.length===3&&(e=[...e].map((i)=>i+i).join(""));let s=Number.parseInt(e,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:(o)=>_.rgbToAnsi256(..._.hexToRgb(o)),enumerable:!1},ansi256ToAnsi:{value:(o)=>{if(o<8)return 30+o;if(o<16)return 90+(o-8);let t,e,s;if(o>=232)t=((o-232)*10+8)/255,e=t,s=t;else{o-=16;let c=o%36;t=Math.floor(o/36)/5,e=Math.floor(c/6)/5,s=c%6/5}let i=Math.max(t,e,s)*2;if(i===0)return 30;let n=30+(Math.round(s)<<2|Math.round(e)<<1|Math.round(t));return i===2&&(n+=60),n},enumerable:!1},rgbToAnsi:{value:(o,t,e)=>_.ansi256ToAnsi(_.rgbToAnsi256(o,t,e)),enumerable:!1},hexToAnsi:{value:(o)=>_.ansi256ToAnsi(_.hexToAnsi256(o)),enumerable:!1}}),_}var ko=Ro(),an=new Set(["\x1B","\x9B"]),Io=39,In="\x07",yr="[",No="]",$r="m",Nn=`${No}8;;`,ar=(r)=>`${an.values().next().value}${yr}${r}${$r}`,cr=(r)=>`${an.values().next().value}${Nn}${r}${In}`,Ao=(r)=>r.split(" ").map((o)=>D(o)),Rn=(r,o,t)=>{let e=[...o],s=!1,i=!1,n=D(br(r[r.length-1]));for(let[c,l]of e.entries()){let g=D(l);if(n+g<=t?r[r.length-1]+=l:(r.push(l),n=0),an.has(l)&&(s=!0,i=e.slice(c+1).join("").startsWith(Nn)),s){i?l===In&&(s=!1,i=!1):l===$r&&(s=!1);continue}n+=g,n===t&&c<e.length-1&&(r.push(""),n=0)}!n&&r[r.length-1].length>0&&r.length>1&&(r[r.length-2]+=r.pop())},Co=(r)=>{let o=r.split(" "),t=o.length;for(;t>0&&!(D(o[t-1])>0);)t--;return t===o.length?r:o.slice(0,t).join(" ")+o.slice(t).join("")},Go=(r,o,t={})=>{if(t.trim!==!1&&r.trim()==="")return"";let e="",s,i,n=Ao(r),c=[""];for(let[g,p]of r.split(" ").entries()){t.trim!==!1&&(c[c.length-1]=c[c.length-1].trimStart());let h=D(c[c.length-1]);if(g!==0&&(h>=o&&(t.wordWrap===!1||t.trim===!1)&&(c.push(""),h=0),(h>0||t.trim===!1)&&(c[c.length-1]+=" ",h++)),t.hard&&n[g]>o){let f=o-h,d=1+Math.floor((n[g]-f-1)/o);Math.floor((n[g]-1)/o)<d&&c.push(""),Rn(c,p,o);continue}if(h+n[g]>o&&h>0&&n[g]>0){if(t.wordWrap===!1&&h<o){Rn(c,p,o);continue}c.push("")}if(h+n[g]>o&&t.wordWrap===!1){Rn(c,p,o);continue}c[c.length-1]+=p}t.trim!==!1&&(c=c.map((g)=>Co(g)));let l=[...c.join(`
|
|
3
|
+
`)];for(let[g,p]of l.entries()){if(e+=p,an.has(p)){let{groups:f}=new RegExp(`(?:\\${yr}(?<code>\\d+)m|\\${Nn}(?<uri>.*)${In})`).exec(l.slice(g).join(""))||{groups:{}};if(f.code!==void 0){let d=Number.parseFloat(f.code);s=d===Io?void 0:d}else f.uri!==void 0&&(i=f.uri.length===0?void 0:f.uri)}let h=ko.codes.get(Number(s));l[g+1]===`
|
|
4
|
+
`?(i&&(e+=cr("")),s&&h&&(e+=ar(h))):p===`
|
|
5
|
+
`&&(s&&h&&(e+=ar(s)),i&&(e+=cr(i)))}return e};function lr(r,o,t){return String(r).normalize().replace(/\r\n/g,`
|
|
6
6
|
`).split(`
|
|
7
7
|
`).map((e)=>Go(e,o,t)).join(`
|
|
8
|
-
`)}var Po=["up","down","left","right","space","enter","cancel"],sn={actions:new Set(Po),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};function
|
|
8
|
+
`)}var Po=["up","down","left","right","space","enter","cancel"],sn={actions:new Set(Po),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};function An(r,o){if(typeof r=="string")return sn.aliases.get(r)===o;for(let t of r)if(t!==void 0&&An(t,o))return!0;return!1}function Mo(r,o){if(r===o)return;let t=r.split(`
|
|
9
9
|
`),e=o.split(`
|
|
10
|
-
`),s=[];for(let i=0;i<Math.max(t.length,e.length);i++)t[i]!==e[i]&&s.push(i);return s}var jo=globalThis.process.platform.startsWith("win"),
|
|
11
|
-
`),en(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let r=
|
|
12
|
-
`).length-1;this.output.write(I.cursor.move(-999,r*-1))}render(){let r=
|
|
10
|
+
`),s=[];for(let i=0;i<Math.max(t.length,e.length);i++)t[i]!==e[i]&&s.push(i);return s}var jo=globalThis.process.platform.startsWith("win"),kn=Symbol("clack:cancel");function U(r){return r===kn}function en(r,o){let t=r;t.isTTY&&t.setRawMode(o)}function xr({input:r=gr,output:o=pr,overwrite:t=!0,hideCursor:e=!0}={}){let s=H.createInterface({input:r,output:o,prompt:"",tabSize:1});H.emitKeypressEvents(r,s),r.isTTY&&r.setRawMode(!0);let i=(n,{name:c,sequence:l})=>{let g=String(n);if(An([g,c,l],"cancel")){e&&o.write(I.cursor.show),process.exit(0);return}if(!t)return;H.moveCursor(o,c==="return"?0:-1,c==="return"?-1:0,()=>{H.clearLine(o,1,()=>{r.once("keypress",i)})})};return e&&o.write(I.cursor.hide),r.once("keypress",i),()=>{r.off("keypress",i),e&&o.write(I.cursor.show),r.isTTY&&!jo&&r.setRawMode(!1),s.terminal=!1,s.close()}}var Bo=Object.defineProperty,Uo=(r,o,t)=>(o in r)?Bo(r,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[o]=t,N=(r,o,t)=>(Uo(r,typeof o!="symbol"?o+"":o,t),t);class cn{constructor(r,o=!0){N(this,"input"),N(this,"output"),N(this,"_abortSignal"),N(this,"rl"),N(this,"opts"),N(this,"_render"),N(this,"_track",!1),N(this,"_prevFrame",""),N(this,"_subscribers",new Map),N(this,"_cursor",0),N(this,"state","initial"),N(this,"error",""),N(this,"value");let{input:t=gr,output:e=pr,render:s,signal:i,...n}=r;this.opts=n,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=s.bind(this),this._track=o,this._abortSignal=i,this.input=t,this.output=e}unsubscribe(){this._subscribers.clear()}setSubscriber(r,o){let t=this._subscribers.get(r)??[];t.push(o),this._subscribers.set(r,t)}on(r,o){this.setSubscriber(r,{cb:o})}once(r,o){this.setSubscriber(r,{cb:o,once:!0})}emit(r,...o){let t=this._subscribers.get(r)??[],e=[];for(let s of t)s.cb(...o),s.once&&e.push(()=>t.splice(t.indexOf(s),1));for(let s of e)s()}prompt(){return new Promise((r,o)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),r(kn);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let t=new $o;t._write=(e,s,i)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),i()},this.input.pipe(t),this.rl=tr.createInterface({input:this.input,output:t,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),tr.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),en(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(I.cursor.show),this.output.off("resize",this.render),en(this.input,!1),r(this.value)}),this.once("cancel",()=>{this.output.write(I.cursor.show),this.output.off("resize",this.render),en(this.input,!1),r(kn)})})}onKeypress(r,o){if(this.state==="error"&&(this.state="active"),o?.name&&(!this._track&&sn.aliases.has(o.name)&&this.emit("cursor",sn.aliases.get(o.name)),sn.actions.has(o.name)&&this.emit("cursor",o.name)),r&&(r.toLowerCase()==="y"||r.toLowerCase()==="n")&&this.emit("confirm",r.toLowerCase()==="y"),r==="\t"&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),r&&this.emit("key",r.toLowerCase()),o?.name==="return"){if(this.opts.validate){let t=this.opts.validate(this.value);t&&(this.error=t instanceof Error?t.message:t,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}An([r,o?.name,o?.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(`
|
|
11
|
+
`),en(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let r=lr(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
12
|
+
`).length-1;this.output.write(I.cursor.move(-999,r*-1))}render(){let r=lr(this._render(this)??"",process.stdout.columns,{hard:!0});if(r!==this._prevFrame){if(this.state==="initial")this.output.write(I.cursor.hide);else{let o=Mo(this._prevFrame,r);if(this.restoreCursor(),o&&o?.length===1){let t=o[0];this.output.write(I.cursor.move(0,t)),this.output.write(I.erase.lines(1));let e=r.split(`
|
|
13
13
|
`);this.output.write(e[t]),this._prevFrame=r,this.output.write(I.cursor.move(0,e.length-t-1));return}if(o&&o?.length>1){let t=o[0];this.output.write(I.cursor.move(0,t)),this.output.write(I.erase.down());let e=r.split(`
|
|
14
14
|
`).slice(t);this.output.write(e.join(`
|
|
15
|
-
`)),this._prevFrame=r;return}this.output.write(I.erase.down())}this.output.write(r),this.state==="initial"&&(this.state="active"),this._prevFrame=r}}}class
|
|
16
|
-
${
|
|
15
|
+
`)),this._prevFrame=r;return}this.output.write(I.erase.down())}this.output.write(r),this.state==="initial"&&(this.state="active"),this._prevFrame=r}}}class Cn extends cn{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(r){super(r,!1),this.value=!!r.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",(o)=>{this.output.write(I.cursor.move(0,-1)),this.value=o,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}var To;To=new WeakMap;var Ho=Object.defineProperty,qo=(r,o,t)=>(o in r)?Ho(r,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[o]=t,mr=(r,o,t)=>(qo(r,typeof o!="symbol"?o+"":o,t),t),wr=class extends cn{constructor(r){super(r,!1),mr(this,"options"),mr(this,"cursor",0),this.options=r.options,this.value=[...r.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:o})=>o===r.cursorAt),0),this.on("key",(o)=>{o==="a"&&this.toggleAll()}),this.on("cursor",(o)=>{switch(o){case"left":case"up":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;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){let r=this.value.length===this.options.length;this.value=r?[]:this.options.map((o)=>o.value)}toggleValue(){let r=this.value.includes(this._value);this.value=r?this.value.filter((o)=>o!==this._value):[...this.value,this._value]}};class Gn extends cn{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let r=this.value.slice(0,this.cursor),[o,...t]=this.value.slice(this.cursor);return`${r}${hr.default.inverse(o)}${t.join("")}`}get cursor(){return this._cursor}constructor(r){super(r),this.on("finalize",()=>{this.value||(this.value=r.defaultValue)})}}var m=F(un(),1),ln=F(En(),1);import P from"process";function zo(){return P.platform!=="win32"?P.env.TERM!=="linux":!!P.env.CI||!!P.env.WT_SESSION||!!P.env.TERMINUS_SUBLIME||P.env.ConEmuTask==="{cmd::Cmder}"||P.env.TERM_PROGRAM==="Terminus-Sublime"||P.env.TERM_PROGRAM==="vscode"||P.env.TERM==="xterm-256color"||P.env.TERM==="alacritty"||P.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Mn=zo(),R=(r,o)=>Mn?r:o,Lo=R("\u25C6","*"),_r=R("\u25A0","x"),Rr=R("\u25B2","x"),mn=R("\u25C7","o"),le=R("\u250C","T"),v=R("\u2502","|"),X=R("\u2514","\u2014"),Sr=R("\u25CF",">"),vr=R("\u25CB"," "),Ko=R("\u25FB","[\u2022]"),Er=R("\u25FC","[+]"),Jo=R("\u25FB","[ ]"),me=R("\u25AA","\u2022"),Or=R("\u2500","-"),Yo=R("\u256E","+"),Xo=R("\u251C","+"),Wo=R("\u256F","+"),Zo=R("\u25CF","\u2022"),Qo=R("\u25C6","*"),Vo=R("\u25B2","!"),Fo=R("\u25A0","x"),jn=(r)=>{switch(r){case"initial":case"active":return m.default.cyan(Lo);case"cancel":return m.default.red(_r);case"error":return m.default.yellow(Rr);case"submit":return m.default.green(mn)}},ur=(r)=>{let{cursor:o,options:t,style:e}=r,s=r.maxItems??Number.POSITIVE_INFINITY,i=Math.max(process.stdout.rows-4,0),n=Math.min(i,Math.max(s,5)),c=0;o>=c+n-3?c=Math.max(Math.min(o-n+3,t.length-n),0):o<c+2&&(c=Math.max(o-2,0));let l=n<t.length&&c>0,g=n<t.length&&c+n<t.length;return t.slice(c,c+n).map((p,h,f)=>{let d=h===0&&l,b=h===f.length-1&&g;return d||b?m.default.dim("..."):e(p,h+c===o)})},q=(r)=>new Gn({validate:r.validate,placeholder:r.placeholder,defaultValue:r.defaultValue,initialValue:r.initialValue,render(){let o=`${m.default.gray(v)}
|
|
16
|
+
${jn(this.state)} ${r.message}
|
|
17
17
|
`,t=r.placeholder?m.default.inverse(r.placeholder[0])+m.default.dim(r.placeholder.slice(1)):m.default.inverse(m.default.hidden("_")),e=this.value?this.valueWithCursor:t;switch(this.state){case"error":return`${o.trim()}
|
|
18
18
|
${m.default.yellow(v)} ${e}
|
|
19
19
|
${m.default.yellow(X)} ${m.default.yellow(this.error)}
|
|
20
20
|
`;case"submit":return`${o}${m.default.gray(v)} ${m.default.dim(this.value||r.placeholder)}`;case"cancel":return`${o}${m.default.gray(v)} ${m.default.strikethrough(m.default.dim(this.value??""))}${this.value?.trim()?`
|
|
21
21
|
${m.default.gray(v)}`:""}`;default:return`${o}${m.default.cyan(v)} ${e}
|
|
22
22
|
${m.default.cyan(X)}
|
|
23
|
-
`}}}).prompt();var M=(r)=>{let o=r.active??"Yes",t=r.inactive??"No";return new
|
|
24
|
-
${
|
|
23
|
+
`}}}).prompt();var M=(r)=>{let o=r.active??"Yes",t=r.inactive??"No";return new Cn({active:o,inactive:t,initialValue:r.initialValue??!0,render(){let e=`${m.default.gray(v)}
|
|
24
|
+
${jn(this.state)} ${r.message}
|
|
25
25
|
`,s=this.value?o:t;switch(this.state){case"submit":return`${e}${m.default.gray(v)} ${m.default.dim(s)}`;case"cancel":return`${e}${m.default.gray(v)} ${m.default.strikethrough(m.default.dim(s))}
|
|
26
|
-
${m.default.gray(v)}`;default:return`${e}${m.default.cyan(v)} ${this.value?`${m.default.green(
|
|
26
|
+
${m.default.gray(v)}`;default:return`${e}${m.default.cyan(v)} ${this.value?`${m.default.green(Sr)} ${o}`:`${m.default.dim(vr)} ${m.default.dim(o)}`} ${m.default.dim("/")} ${this.value?`${m.default.dim(vr)} ${m.default.dim(t)}`:`${m.default.green(Sr)} ${t}`}
|
|
27
27
|
${m.default.cyan(X)}
|
|
28
|
-
`}}}).prompt()};var
|
|
28
|
+
`}}}).prompt()};var kr=(r)=>{let o=(t,e)=>{let s=t.label??String(t.value);return e==="active"?`${m.default.cyan(Ko)} ${s} ${t.hint?m.default.dim(`(${t.hint})`):""}`:e==="selected"?`${m.default.green(Er)} ${m.default.dim(s)} ${t.hint?m.default.dim(`(${t.hint})`):""}`:e==="cancelled"?`${m.default.strikethrough(m.default.dim(s))}`:e==="active-selected"?`${m.default.green(Er)} ${s} ${t.hint?m.default.dim(`(${t.hint})`):""}`:e==="submitted"?`${m.default.dim(s)}`:`${m.default.dim(Jo)} ${m.default.dim(s)}`};return new wr({options:r.options,initialValues:r.initialValues,required:r.required??!0,cursorAt:r.cursorAt,validate(t){if(this.required&&t.length===0)return`Please select at least one option.
|
|
29
29
|
${m.default.reset(m.default.dim(`Press ${m.default.gray(m.default.bgWhite(m.default.inverse(" space ")))} to select, ${m.default.gray(m.default.bgWhite(m.default.inverse(" enter ")))} to submit`))}`},render(){let t=`${m.default.gray(v)}
|
|
30
|
-
${
|
|
30
|
+
${jn(this.state)} ${r.message}
|
|
31
31
|
`,e=(s,i)=>{let n=this.value.includes(s.value);return i&&n?o(s,"active-selected"):n?o(s,"selected"):o(s,i?"active":"inactive")};switch(this.state){case"submit":return`${t}${m.default.gray(v)} ${this.options.filter(({value:s})=>this.value.includes(s)).map((s)=>o(s,"submitted")).join(m.default.dim(", "))||m.default.dim("none")}`;case"cancel":{let s=this.options.filter(({value:i})=>this.value.includes(i)).map((i)=>o(i,"cancelled")).join(m.default.dim(", "));return`${t}${m.default.gray(v)} ${s.trim()?`${s}
|
|
32
32
|
${m.default.gray(v)}`:""}`}case"error":{let s=this.error.split(`
|
|
33
33
|
`).map((i,n)=>n===0?`${m.default.yellow(X)} ${m.default.yellow(i)}`:` ${i}`).join(`
|
|
34
|
-
`);return`${t+m.default.yellow(v)} ${
|
|
34
|
+
`);return`${t+m.default.yellow(v)} ${ur({options:this.options,cursor:this.cursor,maxItems:r.maxItems,style:e}).join(`
|
|
35
35
|
${m.default.yellow(v)} `)}
|
|
36
36
|
${s}
|
|
37
|
-
`}default:return`${t}${m.default.cyan(v)} ${
|
|
37
|
+
`}default:return`${t}${m.default.cyan(v)} ${ur({options:this.options,cursor:this.cursor,maxItems:r.maxItems,style:e}).join(`
|
|
38
38
|
${m.default.cyan(v)} `)}
|
|
39
39
|
${m.default.cyan(X)}
|
|
40
40
|
`}}}).prompt()};var k=(r="",o="")=>{let t=`
|
|
41
41
|
${r}
|
|
42
42
|
`.split(`
|
|
43
|
-
`),e=
|
|
43
|
+
`),e=Pn(o).length,s=Math.max(t.reduce((n,c)=>{let l=Pn(c);return l.length>n?l.length:n},0),e)+2,i=t.map((n)=>`${m.default.gray(v)} ${m.default.dim(n)}${" ".repeat(s-Pn(n).length)}${m.default.gray(v)}`).join(`
|
|
44
44
|
`);process.stdout.write(`${m.default.gray(v)}
|
|
45
|
-
${m.default.green(mn)} ${m.default.reset(o)} ${m.default.gray(
|
|
45
|
+
${m.default.green(mn)} ${m.default.reset(o)} ${m.default.gray(Or.repeat(Math.max(s-e-1,1))+Yo)}
|
|
46
46
|
${i}
|
|
47
|
-
${m.default.gray(Xo+
|
|
48
|
-
`)},
|
|
47
|
+
${m.default.gray(Xo+Or.repeat(s+2)+Wo)}
|
|
48
|
+
`)},Ir=(r="")=>{process.stdout.write(`${m.default.gray(X)} ${m.default.red(r)}
|
|
49
49
|
|
|
50
50
|
`)};var $={message:(r="",{symbol:o=m.default.gray(v)}={})=>{let t=[`${m.default.gray(v)}`];if(r){let[e,...s]=r.split(`
|
|
51
51
|
`);t.push(`${o} ${e}`,...s.map((i)=>`${m.default.gray(v)} ${i}`))}process.stdout.write(`${t.join(`
|
|
52
52
|
`)}
|
|
53
|
-
`)},info:(r)=>{$.message(r,{symbol:m.default.blue(Zo)})},success:(r)=>{$.message(r,{symbol:m.default.green(Qo)})},step:(r)=>{$.message(r,{symbol:m.default.green(mn)})},warn:(r)=>{$.message(r,{symbol:m.default.yellow(Vo)})},warning:(r)=>{$.warn(r)},error:(r)=>{$.message(r,{symbol:m.default.red(Fo)})}},ge=`${m.default.gray(v)} `;var
|
|
53
|
+
`)},info:(r)=>{$.message(r,{symbol:m.default.blue(Zo)})},success:(r)=>{$.message(r,{symbol:m.default.green(Qo)})},step:(r)=>{$.message(r,{symbol:m.default.green(mn)})},warn:(r)=>{$.message(r,{symbol:m.default.yellow(Vo)})},warning:(r)=>{$.warn(r)},error:(r)=>{$.message(r,{symbol:m.default.red(Fo)})}},ge=`${m.default.gray(v)} `;var Nr=({indicator:r="dots"}={})=>{let o=Mn?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],t=Mn?80:120,e=process.env.CI==="true",s,i,n=!1,c="",l,g=performance.now(),p=(w)=>{let O=w>1?"Something went wrong":"Canceled";n&&C(O,w)},h=()=>p(2),f=()=>p(1),d=()=>{process.on("uncaughtExceptionMonitor",h),process.on("unhandledRejection",h),process.on("SIGINT",f),process.on("SIGTERM",f),process.on("exit",p)},b=()=>{process.removeListener("uncaughtExceptionMonitor",h),process.removeListener("unhandledRejection",h),process.removeListener("SIGINT",f),process.removeListener("SIGTERM",f),process.removeListener("exit",p)},y=()=>{if(l===void 0)return;e&&process.stdout.write(`
|
|
54
54
|
`);let w=l.split(`
|
|
55
|
-
`);process.stdout.write(ln.cursor.move(-999,w.length-1)),process.stdout.write(ln.erase.down(w.length))},E=(w)=>w.replace(/\.+$/,""),u=(w)=>{let O=(performance.now()-w)/1000,S=Math.floor(O/60),G=Math.floor(O%60);return S>0?`[${S}m ${G}s]`:`[${G}s]`},x=(w="")=>{n=!0,s
|
|
56
|
-
`);let O=0,S=0;d(),i=setInterval(()=>{if(e&&c===l)return;y(),l=c;let G=m.default.magenta(o[O]);if(e)process.stdout.write(`${G} ${c}...`);else if(r==="timer")process.stdout.write(`${G} ${c} ${u(g)}`);else{let j=".".repeat(Math.floor(S)).slice(0,3);process.stdout.write(`${G} ${c}${j}`)}O=O+1<o.length?O+1:0,S=S<o.length?S+0.125:0},t)},C=(w="",O=0)=>{n=!1,clearInterval(i),y();let S=O===0?m.default.green(mn):O===1?m.default.red(
|
|
55
|
+
`);process.stdout.write(ln.cursor.move(-999,w.length-1)),process.stdout.write(ln.erase.down(w.length))},E=(w)=>w.replace(/\.+$/,""),u=(w)=>{let O=(performance.now()-w)/1000,S=Math.floor(O/60),G=Math.floor(O%60);return S>0?`[${S}m ${G}s]`:`[${G}s]`},x=(w="")=>{n=!0,s=xr(),c=E(w),g=performance.now(),process.stdout.write(`${m.default.gray(v)}
|
|
56
|
+
`);let O=0,S=0;d(),i=setInterval(()=>{if(e&&c===l)return;y(),l=c;let G=m.default.magenta(o[O]);if(e)process.stdout.write(`${G} ${c}...`);else if(r==="timer")process.stdout.write(`${G} ${c} ${u(g)}`);else{let j=".".repeat(Math.floor(S)).slice(0,3);process.stdout.write(`${G} ${c}${j}`)}O=O+1<o.length?O+1:0,S=S<o.length?S+0.125:0},t)},C=(w="",O=0)=>{n=!1,clearInterval(i),y();let S=O===0?m.default.green(mn):O===1?m.default.red(_r):m.default.red(Rr);c=E(w??c),r==="timer"?process.stdout.write(`${S} ${c} ${u(g)}
|
|
57
57
|
`):process.stdout.write(`${S} ${c}
|
|
58
|
-
`),b(),s()};return{start:x,stop:C,message:(w="")=>{c=E(w??c)}}},
|
|
58
|
+
`),b(),s()};return{start:x,stop:C,message:(w="")=>{c=E(w??c)}}},Bn=async(r,o)=>{let t={},e=Object.keys(r);for(let s of e){let i=r[s],n=await i({results:t})?.catch((c)=>{throw c});if(typeof o?.onCancel=="function"&&U(n)){t[s]="canceled",o.onCancel({results:t});continue}t[s]=n}return t};var Do=!process.env.NO_COLOR&&(process.env.FORCE_COLOR||process.stdout.isTTY),nt=["blue","cyan","gray","green","magenta","red","white","yellow"],rt=["bold","dim","italic","underline","reset"],Cr={bold:"\x1B[1m",dim:"\x1B[2m",italic:"\x1B[3m",reset:"\x1B[0m",underline:"\x1B[4m"},ot={"\x1B[30m":"\x1B[90m","\x1B[31m":"\x1B[91m","\x1B[32m":"\x1B[92m","\x1B[33m":"\x1B[93m","\x1B[34m":"\x1B[94m","\x1B[35m":"\x1B[95m","\x1B[36m":"\x1B[96m","\x1B[37m":"\x1B[97m"};function Un(r){return(o)=>Do?`${r}${o}${Cr.reset}`:o}function Ar({bright:r=!1,color:o}){let t=Bun.color(o,"ansi");if(!t)return"";return r?ot[t]||t:t}var tt=nt.reduce((r,o)=>{return r[o]=Un(Ar({color:o})),r[`${o}Bright`]=Un(Ar({bright:!0,color:o})),r},{}),et=rt.reduce((r,o)=>{return r[o]=Un(Cr[o]),r},{}),a={...tt,...et};var Tn=({prefix:r="",level:o=process.env.DEBUG?0:1}={})=>{function t(...c){if(o<=0){let l=c.join(" ");console.log(gn({level:a.dim("DEBUG"),message:l,prefix:r}))}}function e(...c){if(o<=1){let l=c.join(" ");console.info(gn({level:a.cyan("INFO "),message:l,prefix:r}))}}function s(...c){if(o<=2){let l=c.join(" ");console.warn(gn({level:a.yellow("WARN "),message:l,prefix:r}))}}function i(...c){if(o<=3){let l=c.join(" ");console.error(gn({level:a.red("ERROR"),message:l,prefix:r}))}}function n(c){return Tn({level:o,prefix:`${r}:${c}`})}return{child:n,debug:t,error:i,info:e,warn:s}},Hn=Tn();function gn({prefix:r,level:o,message:t}){let e=new Date().toISOString().split("T")[1]?.split(".")[0]||"",s=r?`[${r}] `:"";return`${a.dim(e||"")} ${o} ${s}${t}`}var st={"core.auth.failed":"Authentication failed","core.auth.invalid_token":"Token is invalid or expired","core.fs.cannot_read":"Cannot read file","core.fs.cannot_write":"Cannot write to file","core.fs.directory_not_found":"Directory not found","core.fs.file_not_found":"File not found","core.git.dirty_working_dir":"Working directory has uncommitted changes","core.git.no_commits":"No commits found","core.git.not_repository":"Not a git repository","core.git.operation_failed":"Git operation failed","core.invalid_argument":"Invalid argument","core.invalid_config":"Invalid configuration","core.network.request_failed":"Network request failed","core.operation_cancelled":"Operation cancelled","core.operation_failed":"Operation failed","core.permission_denied":"Permission denied","hydra.config.invalid_format":"Invalid configuration format","hydra.config.missing_required":"Missing required configuration","hydra.config.not_found":"Configuration file not found","hydra.runner.creation_failed":"Runner creation failed","hydra.runner.not_found":"Runner not found","hydra.runner.removal_failed":"Runner removal failed","hydra.token.decryption_failed":"Token decryption failed","hydra.token.encryption_failed":"Token encryption failed","sisyphus.publish.failed":"Publishing failed","sisyphus.release.no_changes":"No changes to release","sisyphus.stone.invalid":"Invalid stone format","sisyphus.stone.not_found":"No stones found","sisyphus.version.conflict":"Version conflict detected","sisyphus.version.invalid_format":"Invalid version format"};function Gr(r,o){let t=st[r]||"Unknown error";return o?`${t}: ${o}`:t}class qn extends Error{code;context;constructor(r,o,t){let e=r.includes(".")&&!r.includes(" ")?Gr(r,t):r;super(e);this.code=o;this.context=t;this.name="CLIError"}}function Pr(r={}){let{errorPrefix:o="\u2717"}=r;return function t(e){if(U(e))console.log(a.gray("Operation cancelled")),process.exit(0);if(e instanceof qn){if(console.error(a.red(`${o} ${e.message}`)),e.code)console.error(a.dim(` Error code: ${e.code}`))}else if(e instanceof Error)console.error(a.red(`${o} ${e.message}`));else console.error(a.red(`${o} An unexpected error occurred`)),console.error(e);process.exit(1)}}var T=new Uint32Array(65536),it=(r,o)=>{let t=r.length,e=o.length,s=1<<t-1,i=-1,n=0,c=t,l=t;while(l--)T[r.charCodeAt(l)]|=1<<l;for(l=0;l<e;l++){let g=T[o.charCodeAt(l)],p=g|n;if(g|=(g&i)+i^i,n|=~(g|i),i&=g,n&s)c++;if(i&s)c--;n=n<<1|1,i=i<<1|~(p|n),n&=p}l=t;while(l--)T[r.charCodeAt(l)]=0;return c},at=(r,o)=>{let t=o.length,e=r.length,s=[],i=[],n=Math.ceil(t/32),c=Math.ceil(e/32);for(let b=0;b<n;b++)i[b]=-1,s[b]=0;let l=0;for(;l<c-1;l++){let b=0,y=-1,E=l*32,u=Math.min(32,e)+E;for(let x=E;x<u;x++)T[r.charCodeAt(x)]|=1<<x;for(let x=0;x<t;x++){let C=T[o.charCodeAt(x)],w=i[x/32|0]>>>x&1,O=s[x/32|0]>>>x&1,S=C|b,G=((C|O)&y)+y^y|C|O,j=b|~(G|y),Y=y&G;if(j>>>31^w)i[x/32|0]^=1<<x;if(Y>>>31^O)s[x/32|0]^=1<<x;j=j<<1|w,Y=Y<<1|O,y=Y|~(S|j),b=j&S}for(let x=E;x<u;x++)T[r.charCodeAt(x)]=0}let g=0,p=-1,h=l*32,f=Math.min(32,e-h)+h;for(let b=h;b<f;b++)T[r.charCodeAt(b)]|=1<<b;let d=e;for(let b=0;b<t;b++){let y=T[o.charCodeAt(b)],E=i[b/32|0]>>>b&1,u=s[b/32|0]>>>b&1,x=y|g,C=((y|u)&p)+p^p|y|u,w=g|~(C|p),O=p&C;if(d+=w>>>e-1&1,d-=O>>>e-1&1,w>>>31^E)i[b/32|0]^=1<<b;if(O>>>31^u)s[b/32|0]^=1<<b;w=w<<1|E,O=O<<1|u,p=O|~(x|w),g=w&x}for(let b=h;b<f;b++)T[r.charCodeAt(b)]=0;return d},Mr=(r,o)=>{if(r.length<o.length){let t=o;o=r,r=t}if(o.length===0)return r.length;if(r.length<=32)return it(r,o);return at(r,o)};function jr(r,o,t=3){return o.map((i)=>({distance:Mr(r.toLowerCase(),i.toLowerCase()),option:i})).filter(({distance:i})=>i<=Math.max(3,r.length/2)).sort((i,n)=>i.distance-n.distance).slice(0,t).map(({option:i})=>i)}function Br(r,o){return o[r.toLowerCase()]||null}async function zn(r,o={}){let{fallback:t,logLevel:e="warn",message:s="Operation failed gracefully"}=o;try{return await r()}catch(i){let n=i instanceof Error?i.message:String(i);if(console[e](`${s}: ${n}`),t)try{await t()}catch(c){console.error(`Fallback also failed: ${c instanceof Error?c.message:String(c)}`)}return}}var ct={backoffMultiplier:2,initialDelay:1000,maxAttempts:3,maxDelay:30000,onRetry:(r,o)=>{Hn.warn(`Retry attempt ${r}: ${o.message}`)},retryableErrors:["ECONNREFUSED","ECONNRESET","ETIMEDOUT","ENOTFOUND","rate limit","429","503","502","504","npm ERR!","EPUBLISHCONFLICT"]};async function Ur(r,o={}){let t={...ct,...o},e=new Error("Operation failed");for(let s=1;s<=t.maxAttempts;s++)try{return await r()}catch(i){if(e=i instanceof Error?i:new Error(String(i)),!t.retryableErrors.some((l)=>e.message.toLowerCase().includes(l.toLowerCase()))||s===t.maxAttempts)throw e;t.onRetry(s,e);let c=Math.min(t.initialDelay*t.backoffMultiplier**(s-1),t.maxDelay);await new Promise((l)=>setTimeout(l,c))}throw e}var W=(r)=>{return r.map=(o)=>W((t)=>o(r(t))),r.or=(o)=>W((t)=>{try{return r(t)}catch(e){return o(t)}}),r},Ln=()=>"bad banditype"();var Kn=(r)=>W((o)=>typeof o===typeof r?o:Ln()),z=()=>Kn("");var Tr=()=>Kn(!0);var pn=()=>Kn();var Hr=(r)=>W((o)=>o instanceof r?o:Ln());var K=(r)=>Hr(Object).map((o)=>{let t={};for(let e in r){let s=r[e](o[e]);s!==void 0&&(t[e]=s)}return t});var hn=(r)=>Hr(Array).map((o)=>o.map(r));function Jn(r,o){return W((t)=>{try{return r(t)}catch{try{return o(t)}catch{throw new Error("No matching schema in union")}}})}function Z(r,o){return(t)=>{if(t===void 0)return o;return r(t)}}function qr(r){return{parse(o){try{return r(o)}catch(t){throw new Error(t instanceof Error?t.message:"Validation failed")}},safeParse(o){try{return{data:r(o),success:!0}}catch(t){return{error:t instanceof Error?t:new Error("Validation failed"),success:!1}}},validator:r}}function Yn(){return Jn(pn(),z())}function lt(){return Jn(pn(),Tr())}function Xn(r){return Z(z(),r)}function bn(r){return Z(Yn(),r)}function L(r){return Z(lt(),r)}function fn(r){return Jn(pn(),r)}var zr=Pr({errorPrefix:"\u2717"});var{$:dn}=globalThis.Bun;var mt=K({commit:z(),date:z()}),gt=K({author:bn("r5n-bot"),email:Yn(),message:bn("release(:tada:): <last-stone-message>")}),pt=K({commitAndPush:L(!1),github:L(!1),npm:L(!1),tags:L(!1)}),ht=K({generate:L(!0),root:L(!1)}),Wn=qr(K({$schema:Xn("https://raw.githubusercontent.com/r5n-labs/clis/refs/heads/develop/packages/cli/sisyphus/schema.json"),changelog:fn(ht),commit:fn(gt),configPath:bn(".sisyphus"),ignore:Z(hn(z()),[]),lastStone:mt,release:fn(pt),single:L(!1),stones:Z(hn(z()),[]),tag:Xn("latest")}));var Kr="***",Zn=["dependency","patch","minor","major","snapshot"],Q={dependency:"\uD83D\uDCE6",patch:"\uD83D\uDC1B",minor:"\u2728",major:"\uD83D\uDEA8",snapshot:"\uD83D\uDCF8"};function Jr({stream:r=process.stdout}={}){return Boolean(r?.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}function nn(r){if(typeof r==="function")r();else Ir(r||"Operation cancelled by user");process.exit(0)}function Yr(r){return r}async function A({overwrite:r,tag:o,dryRun:t,silent:e,configPath:s=".sisyphus",...i}={}){let n=`./${s}/config.json`,l=await Bun.file(n).exists(),g=l&&r,p=Bun.spawnSync(["git","rev-parse","HEAD"]).stdout.toString().trim();if(p.length===0)throw new Error("Couldn't find git repository. Have you initialized git repository?");let h;if(l)try{let b=await Bun.file(".sisyphus/config.json").json(),y=Wn.safeParse(b);if(!y.success)throw console.log(b,y),y.error instanceof Error?new Error(`Invalid configuration file: ${y.error.message}`):y.error;h=y.data}catch(b){if(b instanceof Error)throw new Error(`Invalid configuration file: ${b.message}`);throw new Error("Failed to parse configuration file")}else h=Wn.parse({$schema:"https://raw.githubusercontent.com/r5n-labs/clis/refs/heads/develop/packages/cli/sisyphus/schema.json",ignore:[],lastStone:{commit:p,date:new Date().toISOString().split(".")[0]||""},stones:[],tag:o||"latest"});let f={...h,...i},d=`${JSON.stringify(f,null,2)}
|
|
59
59
|
`;if(t){if(!e)console.info(`${a.bold(a.yellow("[dry-run]"))}
|
|
60
60
|
${a.italic(".sisyphus/config.json")}:
|
|
61
|
-
${d}`);return{...h,...i}}if(g)try{await dn`rm -rf ${s}`.quiet()}catch{}if(l&&!r)return f;return await dn`mkdir -p ${s}`.quiet(),await Bun.write(n,d),f}async function
|
|
61
|
+
${d}`);return{...h,...i}}if(g)try{await dn`rm -rf ${s}`.quiet()}catch{}if(l&&!r)return f;return await dn`mkdir -p ${s}`.quiet(),await Bun.write(n,d),f}async function Xr({dryRun:r,silent:o,configPath:t,...e}){let s=await A({configPath:t}),i=`./${t||s.configPath||".sisyphus"}/config.json`,n=`${JSON.stringify({...s,...e},null,2)}
|
|
62
62
|
`;if(r){if(!o)console.info(`${a.bold(a.yellow("[dry-run]"))}
|
|
63
63
|
${a.italic(i)} would be updated to
|
|
64
64
|
${n}`);return}await Bun.write(i,n),k(`${a.green("Sisyphus config updated!")}`)}function yn({name:r,version:o,bump:t,tag:e}){return`${r}@${o} => ${a.green(B({bump:t,tag:e,version:o}))} ${Q[t]}`}function bt({baseVersion:r,bump:o}){let[t="0",e="0",s="0"]=r.split(".");switch(o){case"major":return`${Number.parseInt(t,10)+1}.0.0`;case"minor":return`${t}.${Number.parseInt(e,10)+1}.0`;case"dependency":case"patch":return`${t}.${e}.${Number.parseInt(s,10)+1}`;default:return`${t}.${e}.${s}`}}function B({version:r="",bump:o,tag:t}){let[e="0.0.0",s=""]=r.split("-"),[i="",n="0"]=s.split(".");if(o==="snapshot"){let c=new Date().toISOString().replace(/[.ZT:-]/g,"").slice(0,14);return`0.0.0-${t||"nightly"}-${c}`}if(t&&!o){let c=t===i?Number.parseInt(n,10)+1:1;return`${e}-${t}.${c}`}if(t||o==="dependency"&&i){let c=t===i?Number.parseInt(n,10)+1:1;return`${e}-${t||i}.${c}`}return bt({baseVersion:e,bump:o})}async function $n({dryRun:r,silent:o,configPath:t,testModeEnabled:e}={}){let s=e,i=await A({configPath:t,dryRun:r,silent:o}),n=s&&t?`${t}/stones`:`./${t||i.configPath||".sisyphus"}/stones`;try{let l=(await dn`ls ${n} 2>/dev/null || true`.quiet()).stdout.toString().trim();if(!l)return[];return l.split(`
|
|
65
65
|
`).filter(Boolean).map((p)=>p.replace(".md",""))}catch(c){if(!r)await dn`mkdir -p ${n}`.quiet();return[]}}async function J({filter:r,single:o}={}){let t=process.cwd(),e=await Bun.file("package.json").json();if(o)return dt(e);let s=e?.workspaces||[];if(s.length===0)throw new Error(`Seems like package.json doesn't have \`workspaces\` field or it's empty. Are you sure you are in the root of the workspace? (cwd: ${t})
|
|
66
66
|
|
|
67
|
-
If you want to run Sisyphus in single-mode/root package, use --single flag or set \`"single": true\` in .sisyphus/config.json.`);let i=await ft({cwd:t,workspaces:s}),n=Object.keys(i);return{packageNames:r?n.filter((c)=>c.includes(r)):n,packages:i}}async function ft({workspaces:r,cwd:o}){let t={},e={};for(let s of r){let i=new Bun.Glob(`${s}/package.json`).scanSync({cwd:o});for(let n of i){let{name:c,version:l,dependencies:g={},devDependencies:p={}}=await Bun.file(n).json(),f=Object.entries({...g,...p}).map(([d,b])=>b.startsWith("workspace")?d:"").filter(Boolean);for(let d of f)if(e[d]||=[],!e[d].includes(c))e[d].push(c);t[c]={bump:"dependency",dependencyOf:[],file:n,name:c,version:l}}}for(let[s,i]of Object.entries(e))if(t[s])t[s].dependencyOf=i;return t}function dt({name:r,version:o}){return{packageNames:[r],packages:{[r]:{bump:"dependency",dependencyOf:[],file:"package.json",name:r,version:o||"0.0.0"}}}}import{parseArgs as Nt}from"util";var{$:V}=globalThis.Bun;async function
|
|
67
|
+
If you want to run Sisyphus in single-mode/root package, use --single flag or set \`"single": true\` in .sisyphus/config.json.`);let i=await ft({cwd:t,workspaces:s}),n=Object.keys(i);return{packageNames:r?n.filter((c)=>c.includes(r)):n,packages:i}}async function ft({workspaces:r,cwd:o}){let t={},e={};for(let s of r){let i=new Bun.Glob(`${s}/package.json`).scanSync({cwd:o});for(let n of i){let{name:c,version:l,dependencies:g={},devDependencies:p={}}=await Bun.file(n).json(),f=Object.entries({...g,...p}).map(([d,b])=>b.startsWith("workspace")?d:"").filter(Boolean);for(let d of f)if(e[d]||=[],!e[d].includes(c))e[d].push(c);t[c]={bump:"dependency",dependencyOf:[],file:n,name:c,version:l}}}for(let[s,i]of Object.entries(e))if(t[s])t[s].dependencyOf=i;return t}function dt({name:r,version:o}){return{packageNames:[r],packages:{[r]:{bump:"dependency",dependencyOf:[],file:"package.json",name:r,version:o||"0.0.0"}}}}import{parseArgs as Nt}from"util";var{$:V}=globalThis.Bun;async function Zr({changelogRoot:r,commit:o,dryRun:t=!1,stones:e}){let s=[""],{lastStone:{commit:i=""}}=await A(),n=yt({stones:e});for(let[c,{bump:l,path:g,changelog:p}]of n.entries()){let h=[...p,Wr({commit:o,lastCommit:i})],f=await Bun.file(g).exists(),[d,...b]=f?(await Bun.file(g).text()).split(`
|
|
68
68
|
`):[`# ${c}`],y=[d,...h,...b];if(t)$.info(`${a.bold(a.yellow("[dry-run]"))}
|
|
69
69
|
${y.join(`
|
|
70
|
-
`)}`);else if(!await
|
|
70
|
+
`)}`);else if(!await zn(async()=>{return $.step(`Writing changelog to ${g}`),await Bun.write(g,`${y.join(`
|
|
71
71
|
`).trimEnd()}
|
|
72
72
|
`),!0},{logLevel:"error",message:`Failed to write changelog to ${g}`}))continue;let[E="",,,u=""]=p;if(!s.includes(u))s.unshift(u);s.push(`### ${Q[l]} ${c}@${E.slice(7)}`)}if(r){let c=Bun.file("CHANGELOG.md"),l=await c.exists(),[g,...p]=l?(await c.text()).split(`
|
|
73
|
-
`):["# Changelog"],h=[g,"",...s,...p,
|
|
73
|
+
`):["# Changelog"],h=[g,"",...s,...p,Wr({commit:o,lastCommit:i,root:!0})];if(t)$.info(`${a.bold(a.yellow("[dry-run]"))}
|
|
74
74
|
Root changelog:
|
|
75
75
|
${h.join(`
|
|
76
|
-
`)}`);else await
|
|
77
|
-
`))},{logLevel:"error",message:"Failed to write root changelog"})}}function yt({stones:r}){let o=new Map;for(let{tag:t,packages:e,message:s}of r)for(let{file:i,name:n,version:c,bump:l}of e){let g=B({bump:l,tag:t,version:c}),{bump:p,path:h,changelog:f}=o.get(n)??{bump:l,changelog:[],path:i.replace("package.json","CHANGELOG.md")},[d="",,,b=""]=f,y=[d.replace("### ","")||"0.0.0",g].sort(Bun.semver.order)[1];o.set(n,{bump:p,changelog:[`### ${Q[l]} ${y}`,"",f.length>0?"__Stones:__":"__Stone:__",`_${s}${b?`, ${b.replace(/_/g,"")}_`:"_"}`],path:h})}return o}var
|
|
78
|
-
`).map((n)=>{if(n.length===0)return;let[c="",l="",g=""]=n.split(
|
|
76
|
+
`)}`);else await zn(async()=>{$.step(`Writing root changelog to ${c.name}`),await Bun.write(c,h.join(`
|
|
77
|
+
`))},{logLevel:"error",message:"Failed to write root changelog"})}}function yt({stones:r}){let o=new Map;for(let{tag:t,packages:e,message:s}of r)for(let{file:i,name:n,version:c,bump:l}of e){let g=B({bump:l,tag:t,version:c}),{bump:p,path:h,changelog:f}=o.get(n)??{bump:l,changelog:[],path:i.replace("package.json","CHANGELOG.md")},[d="",,,b=""]=f,y=[d.replace("### ","")||"0.0.0",g].sort(Bun.semver.order)[1];o.set(n,{bump:p,changelog:[`### ${Q[l]} ${y}`,"",f.length>0?"__Stones:__":"__Stone:__",`_${s}${b?`, ${b.replace(/_/g,"")}_`:"_"}`],path:h})}return o}var Qn="#@!";function Wr({root:r,lastCommit:o,commit:t}){let e=(()=>{try{return Bun.spawnSync(["git","remote","get-url","origin"]).stdout.toString().trim().split(":")[1]?.replaceAll(".git","")||""}catch{return""}})(),i=(()=>{try{return Bun.spawnSync(["git","log",`--pretty=format:%H${Qn}%s${Qn}%cn`,`${o}..${t}`]).stdout.toString()}catch{return console.warn("Could not get git commit history"),""}})().split(`
|
|
78
|
+
`).map((n)=>{if(n.length===0)return;let[c="",l="",g=""]=n.split(Qn);return`- ${e?`[${c.slice(0,7)} ${l}](https://github.com/${e}/commit/${c})`:l} (by [@${g}](https://github.com/${g}))`}).filter(Boolean);return i.length>0?`
|
|
79
79
|
<details><summary>${i.length} ${r?"Commits in this release":"Commits since last stone"}:</summary>
|
|
80
80
|
${i.join(`
|
|
81
81
|
`)}
|
|
82
|
-
</details>`:""}var $t=/github\.com[:/]([^/]+)\/([^/]+)/;async function xt(){if(process.env.GITHUB_REPOSITORY){let[r,o]=process.env.GITHUB_REPOSITORY.split("/");return{owner:r,repo:o}}try{let r=await Bun.file("package.json").json(),o=r.repository?.url||r.repository;if(typeof o==="string"){let t=o.replace("git+","").replace(".git","").replace("git@github.com:","https://github.com/"),[,e,s]=t.match($t)||[];return{owner:e,repo:s}}}catch{}throw new Error("Could not determine GitHub repository. Please set GITHUB_REPOSITORY environment variable or ensure package.json has a valid repository URL.")}async function
|
|
82
|
+
</details>`:""}var $t=/github\.com[:/]([^/]+)\/([^/]+)/;async function xt(){if(process.env.GITHUB_REPOSITORY){let[r,o]=process.env.GITHUB_REPOSITORY.split("/");return{owner:r,repo:o}}try{let r=await Bun.file("package.json").json(),o=r.repository?.url||r.repository;if(typeof o==="string"){let t=o.replace("git+","").replace(".git","").replace("git@github.com:","https://github.com/"),[,e,s]=t.match($t)||[];return{owner:e,repo:s}}}catch{}throw new Error("Could not determine GitHub repository. Please set GITHUB_REPOSITORY environment variable or ensure package.json has a valid repository URL.")}async function Qr({token:r,tag:o,name:t,body:e}){let{owner:s,repo:i}=await xt();if(!(s&&i))throw new Error("Could not determine GitHub repository. Please set GITHUB_REPOSITORY environment variable or ensure package.json has a valid repository URL.");let n=`https://api.github.com/repos/${s}/${i}/releases`;try{let c=await fetch(n,{body:JSON.stringify({body:`${t}
|
|
83
83
|
|
|
84
|
-
${e||""}`,draft:!1,name:t,prerelease:o.includes("-"),tag_name:o}),headers:{Accept:"application/vnd.github.v3+json",Authorization:`Bearer ${r}`,"Content-Type":"application/json"},method:"POST"});if(!c.ok){let l=await c.text();throw new Error(`GitHub API returned ${c.status}: ${l}`)}return c.json()}catch(c){if(c instanceof Error)throw new Error(`Failed to create GitHub release: ${c.message}`);throw c}}async function
|
|
84
|
+
${e||""}`,draft:!1,name:t,prerelease:o.includes("-"),tag_name:o}),headers:{Accept:"application/vnd.github.v3+json",Authorization:`Bearer ${r}`,"Content-Type":"application/json"},method:"POST"});if(!c.ok){let l=await c.text();throw new Error(`GitHub API returned ${c.status}: ${l}`)}return c.json()}catch(c){if(c instanceof Error)throw new Error(`Failed to create GitHub release: ${c.message}`);throw c}}async function Vr({dryRun:r,github:o,githubToken:t,packages:e,rootTag:s,withTags:i}){if(r){$.info("Skipping git operations in dry run mode");return}if(wt(i,e),St(s),o)await vt({githubToken:t,packages:e,rootTag:s,withTags:i})}function wt(r,o){if(!r)return;for(let{name:t,version:e}of Object.values(o)){let s=`${t}@${e}`,{exitCode:i,stderr:n}=Bun.spawnSync(["git","tag",s,"-m",`Release ${s}`,"-f"]);if(i!==0)$.error(`Failed to create git tag ${s}: ${n?n.toString():"Unknown error"}`)}}function St(r){if(!r)return;let o=Bun.spawnSync(["git","tag",r,"-m","Release","-f"]);if(o.exitCode!==0)$.error(`Failed to create root tag ${r}: ${o.stderr?Buffer.from(o.stderr).toString():"Unknown error"}`)}async function vt({githubToken:r,packages:o,rootTag:t,withTags:e}){let s=r||process.env.GITHUB_TOKEN;if(!s)return k(a.reset(a.bold(`${a.redBright("No Github token found.")}
|
|
85
85
|
Please provide one by using ${a.cyanBright("--githubToken")} flag or by setting ${a.green("GITHUB_TOKEN")} environment variable.`)));try{await Et(s,e,o),await Ot(s,t,o)}catch(i){return $.error(`Failed to create GitHub release:
|
|
86
|
-
${i instanceof Error?i.message:i}`),k(a.reset(a.bold(a.redBright("Failed to create GitHub release. Check your token and permissions."))))}}async function Et(r,o,t){if(!o)return;for(let e of Object.values(t)){let s=`${e.name}@${e.version}`;await
|
|
87
|
-
`);await
|
|
88
|
-
${e}`,name:`Release ${o}`,tag:o,token:r}),k(a.green(`\u2713 Created GitHub root release ${o}`))}var{$:ut}=globalThis.Bun;async function
|
|
89
|
-
Please provide one by using ${a.cyanBright("--npmToken")} flag or by setting one of ${a.green("NPM_CONFIG_TOKEN")} or ${a.green("NPM_TOKEN")} environment variables.`)));await _t({dryRun:o,packages:r,token:e})}async function _t({packages:r,dryRun:o,token:t}){let e=await Rt();for(let{name:s,version:i,tag:n,file:c}of Object.values(r)){let l=
|
|
90
|
-
Error during build step. If you don't have a build step, you can ignore this message.`)}}function It({dryRun:r,tag:o,otp:t}){return["npm","publish","--access","public"].concat(o?["--tag",o]:[]).concat(r?["--dry-run"]:[]).concat(t?["--otp",t]:[])}function At(){let{values:r}=Nt({allowPositionals:!0,args:Bun.argv,options:{changelog:{short:"c",type:"boolean"},changelogRoot:{short:"r",type:"boolean"},dryRun:{default:!1,short:"d",type:"boolean"},github:{short:"g",type:"boolean"},githubToken:{type:"string"},npm:{short:"n",type:"boolean"},npmToken:{type:"string"},rootTag:{type:"string"},withTags:{short:"t",type:"boolean"}},strict:!0});return r}async function
|
|
91
|
-
${a.reset(`Run ${a.green("bunx @r5n/sisyphus")}${a.yellow(" version")} and create some first.`)}`)));if(typeof t==="boolean"?t:p.changelog?.generate)await
|
|
86
|
+
${i instanceof Error?i.message:i}`),k(a.reset(a.bold(a.redBright("Failed to create GitHub release. Check your token and permissions."))))}}async function Et(r,o,t){if(!o)return;for(let e of Object.values(t)){let s=`${e.name}@${e.version}`;await Qr({body:`Release of ${e.name} version ${e.version}`,name:`Release ${s}`,tag:s,token:r}),k(a.green(`\u2713 Created GitHub release for ${s}`))}}async function Ot(r,o,t){if(!o)return;let e=Object.values(t).map((s)=>`- ${s.name}@${s.version}`).join(`
|
|
87
|
+
`);await Qr({body:`Packages included:
|
|
88
|
+
${e}`,name:`Release ${o}`,tag:o,token:r}),k(a.green(`\u2713 Created GitHub root release ${o}`))}var{$:ut}=globalThis.Bun;async function Fr({packages:r,dryRun:o,npmToken:t}){let e=t||process.env.NPM_CONFIG_TOKEN||process.env.NPM_TOKEN;if(!(e||o))return k(a.reset(a.bold(`${a.redBright("No NPM token found.")}
|
|
89
|
+
Please provide one by using ${a.cyanBright("--npmToken")} flag or by setting one of ${a.green("NPM_CONFIG_TOKEN")} or ${a.green("NPM_TOKEN")} environment variables.`)));await _t({dryRun:o,packages:r,token:e})}async function _t({packages:r,dryRun:o,token:t}){let e=await Rt();for(let{name:s,version:i,tag:n,file:c}of Object.values(r)){let l=Nr();l.start(`${o?a.yellow("[dry-run]: Test "):""}Publishing ${a.magenta(s)}@${a.cyanBright(i)}...`),await kt({cwd:c.replace("package.json","")});let g=await(async()=>{try{let p=It({dryRun:o,otp:e,tag:n});return await Ur(async()=>{let{stdout:h,exitCode:f}=Bun.spawnSync(p,{cwd:c.replace("package.json",""),env:{...process.env,NPM_CONFIG_TOKEN:t,NPM_TOKEN:t},stderr:"inherit"});if(f!==0)throw new Error(`npm publish failed with exit code ${f}`);return h},{onRetry:(h,f)=>{l.stop(),l.start(`${o?a.yellow("[dry-run]: Test "):""}Retrying publish ${a.magenta(s)}@${a.cyanBright(i)} (attempt ${h})...`)}}),`${a.green("Successfully published")} ${a.magenta(s)}@${a.cyanBright(i)}`}catch(p){return $.error(p instanceof Error?p.message:String(p)),`${a.bold(`${a.redBright("Failed")} ${a.magenta(s)}@${a.cyanBright(i)}`)}`}})();l.stop(`${o?a.yellow("[dry-run]: Test "):""}${g}`)}}async function Rt(){if(!Jr())return"";let r=await q({message:"Provide your NPM one-time password"});return U(r)?"":r}async function kt({cwd:r}){try{let o=await ut`cd ${r} && bun run build`.quiet();if(o.exitCode!==0)throw new Error(`Build failed with exit code ${o.exitCode}`)}catch(o){try{if(!(await Bun.file(`${r}/package.json`).json()).scripts?.build)return}catch{}$.warn(`${o instanceof Error?o.message:String(o)}:
|
|
90
|
+
Error during build step. If you don't have a build step, you can ignore this message.`)}}function It({dryRun:r,tag:o,otp:t}){return["npm","publish","--access","public"].concat(o?["--tag",o]:[]).concat(r?["--dry-run"]:[]).concat(t?["--otp",t]:[])}function At(){let{values:r}=Nt({allowPositionals:!0,args:Bun.argv,options:{changelog:{short:"c",type:"boolean"},changelogRoot:{short:"r",type:"boolean"},dryRun:{default:!1,short:"d",type:"boolean"},github:{short:"g",type:"boolean"},githubToken:{type:"string"},npm:{short:"n",type:"boolean"},npmToken:{type:"string"},rootTag:{type:"string"},withTags:{short:"t",type:"boolean"}},strict:!0});return r}async function Dr(){let r=At(),{dryRun:o,changelog:t,changelogRoot:e,github:s,githubToken:i,npm:n,npmToken:c,rootTag:l,withTags:g}=r,p=await A(),h=Bun.spawnSync(["git","rev-parse","HEAD"]).stdout.toString().trim(),f=await(async()=>{try{return await Vn()}catch{return[]}})();if(f.length===0)return k(a.reset(a.bold(`${a.redBright("No stones found.")}
|
|
91
|
+
${a.reset(`Run ${a.green("bunx @r5n/sisyphus")}${a.yellow(" version")} and create some first.`)}`)));if(typeof t==="boolean"?t:p.changelog?.generate)await Zr({changelogRoot:typeof e==="boolean"?e:p.changelog?.root,commit:h,dryRun:o,stones:f});let d=await Ct({dryRun:o,stones:f});if(console.error(p.release),p.release?.commitAndPush){let y=p.commit?.message?p.commit.message.replace("{message}",f.map((E)=>E.message).join(", ")):`release(:tada:): ${f.map((E)=>E.message).join(", ")}`;await V`git config user.name "r5n-labs"`.quiet(),await V`git config user.email "sisyphus@r5n.dev"`.quiet(),await V`git commit --all -m "${y}"`.quiet(),await V`git push`.quiet()}if(typeof n==="boolean"?n:p.release?.npm)await Fr({dryRun:o,npmToken:c,packages:d});let b=new Date().toISOString().split(".")[0]||"";if(await Vr({dryRun:o,github:typeof s==="boolean"?s:p.release?.github,githubToken:i,packages:d,rootTag:l,withTags:typeof g==="boolean"?g:p.release?.tags}),await Xr({dryRun:o,lastStone:{commit:h,date:b},stones:[]}),!o)await V`rm -rf .sisyphus/stones`.quiet()}async function Vn({dryRun:r,silent:o,configPath:t,testModeEnabled:e}={}){let s=e,i=await $n({configPath:t,dryRun:r,silent:o}),{packages:n}=await J({single:s}),c=t||".sisyphus";if(s&&i.length===0&&t)try{let g=`${t}/stones`,h=(await V`ls ${g} 2>/dev/null || true`.quiet()).stdout.toString().trim(),f=h?h.split(`
|
|
92
92
|
`).filter(Boolean).map((d)=>d.replace(".md","")):[];if(f.length>0)return $.info(`Found ${f.length} stones in test environment`),[{message:"Test stone config",name:f[0],packages:[{bump:"major",file:`${t}/workspace/packages/test-pkg/package.json`,name:"@test/pkg",version:"1.0.0"}],tag:"latest"}]}catch(g){$.error(`Test directory read error: ${g}`)}let l=[];for(let g of i)try{let h=(await Bun.file(`${c}/stones/${g}.md`).text()).split(`
|
|
93
93
|
`),[f]=h,d=f?.replace(/^#+\s*/,"")||"",b=h.findIndex((S)=>S.includes("|")&&S.includes(":---:"));if(b===-1){$.error(`Failed to parse stone ${g} - could not find table format`);continue}let y=h[b-1],E=h[b+1];if(!y||!E){$.error(`Failed to parse stone ${g} - invalid table structure`);continue}let u=y.split("|").map((S)=>S.trim()).filter(Boolean),x=E.split("|").map((S)=>S.trim()).filter(Boolean),C=[];for(let S=0;S<u.length;S++){let G=u[S],j=x[S];if(j){let Y=j.split(",").map((rn)=>rn.trim());for(let rn of Y)if(n[rn])C.push({...n[rn],bump:G})}}let w=h.find((S)=>S.trim().startsWith("_")&&S.trim().endsWith("_")),O=w?w.replace(/_/g,"").trim():"";l.push({message:d.trim(),name:g,packages:C,tag:O})}catch(p){$.error(`Error processing stone ${g}
|
|
94
|
-
${p instanceof Error?p.message:String(p)}`)}return l}async function Ct({stones:r,dryRun:o=!1}){let t=[],e={};for(let{tag:i,packages:n,message:c}of r){t.push(c);for(let l of n){e[l.name]||=l;let g=e[l.name]||l;if(i)g.tag=i;g.bump=
|
|
94
|
+
${p instanceof Error?p.message:String(p)}`)}return l}async function Ct({stones:r,dryRun:o=!1}){let t=[],e={};for(let{tag:i,packages:n,message:c}of r){t.push(c);for(let l of n){e[l.name]||=l;let g=e[l.name]||l;if(i)g.tag=i;g.bump=Zn.indexOf(l.bump)>Zn.indexOf(g.bump)?l.bump:g.bump,e[l.name]=g}}let s=Object.values(e).reduce((i,n)=>{return i[n.name]={...n,version:n.tag?B({tag:n.tag,version:B({bump:n.bump,version:n.version})}):B({bump:n.bump,version:n.version})},i},{});if(o)$.info(`${a.bold(a.yellow("[dry-run]"))}
|
|
95
95
|
Config for next release:
|
|
96
96
|
Stones: ${t.join(", ")}
|
|
97
97
|
${JSON.stringify(s,null,2)}`);else{let i={};for(let[n,c]of Object.entries(s))try{let l=await Bun.file(c.file).json();i[n]={...c,version:l.version}}catch(l){$.error(`Could not read current version for ${n}: ${l}`)}for(let{version:n,file:c}of Object.values(s)){let l=await Bun.file(c).json();l.version=n,await Bun.write(c,`${JSON.stringify(l,null,2)}
|
|
98
|
-
`)}}return s}async function
|
|
98
|
+
`)}}return s}async function no(){let r=await import("util").then((f)=>f.parseArgs),{values:o}=r({allowPositionals:!0,args:Bun.argv,options:{debug:{type:"boolean"},json:{type:"boolean"}},strict:!1}),{json:t=!1,debug:e=!1}=o,s=Boolean(t);await A({dryRun:!0,silent:s});let{packages:i,packageNames:n}=await J(),{packages:c,packageNames:[l=""]}=await J({single:!0}),g=await Vn({dryRun:!0,silent:s});if(e)console.log("DEBUG: Stone configs:",JSON.stringify(g,null,2)),console.log("DEBUG: Packages:",JSON.stringify(i,null,2));if(s){let f={packages:n.map((d)=>({name:d,version:i[d]?.version})),root:{name:l,version:c[l]?.version},stones:g.map((d)=>({message:d.message,name:d.name,packages:d.packages.map((b)=>({bump:b.bump,name:b.name,newVersion:B({bump:b.bump,tag:d.tag,version:b.version}),version:b.version})),tag:d.tag}))};console.log(JSON.stringify(f,null,2));return}let p=g.length>0?`${a.bold(a.green("Stones:"))}
|
|
99
99
|
${g.map((f)=>`${a.yellow("\u2192")} ${a.bold("Stone:")} ${a.magenta(f.name)}
|
|
100
100
|
${a.bold("Packages:")}
|
|
101
101
|
${f.packages.map((d)=>` ${Q[d.bump]} ${a.cyan(d.name)}@${a.green(B({bump:d.bump,tag:f.tag,version:d.version}))} ${a.dim(`(${d.bump})`)}`).join(`
|
|
@@ -106,7 +106,7 @@ ${a.bold(a.green("Packages:"))}
|
|
|
106
106
|
${n.map((f)=>{let d=i[f]?.version?`@${i[f]?.version}`:"";return` ${a.yellow("\u2022")} ${a.cyan(f)}${a.dim(d)}`}).join(`
|
|
107
107
|
`)}
|
|
108
108
|
|
|
109
|
-
${p}`),k(a.reset(a.green("Sisyphus check complete.")))}var
|
|
109
|
+
${p}`),k(a.reset(a.green("Sisyphus check complete.")))}var xn="0.3.21";var ro={check:`
|
|
110
110
|
sisyphus check - Check current state and pending changes
|
|
111
111
|
|
|
112
112
|
USAGE
|
|
@@ -175,10 +175,10 @@ EXAMPLES
|
|
|
175
175
|
|
|
176
176
|
# Preview version changes
|
|
177
177
|
sisyphus version --dry-run
|
|
178
|
-
`};function
|
|
178
|
+
`};function wn(r){if(r&&ro[r]){let t=ro[r].split(`
|
|
179
179
|
`).map((e)=>{if(e.startsWith("sisyphus"))return a.bold(e);if(e==="USAGE"||e==="OPTIONS"||e==="EXAMPLES")return a.bold(e);if(e.startsWith(" -")){let s=e.match(/^(\s+-\w,\s--\w+)\s+(.+)$/);if(s){let[,i="",n=""]=s,c=n.replace("(required)",a.red("(required)")).replace(/\(default: ([^)]+)\)/g,(l,g)=>a.dim(`(default: ${g})`)).replace(/\[boolean\]/g,a.cyan("[boolean]")).replace(/\[string\]/g,a.green("[string]")).replace(/\[number\]/g,a.magenta("[number]"));return` ${a.yellow(i.padEnd(20))} ${c}`}}if(e.startsWith(" # "))return a.dim(e);if(e.startsWith(" sisyphus"))return` ${a.cyan(e.trim())}`;return e}).join(`
|
|
180
180
|
`);console.log(t);return}console.log(`
|
|
181
|
-
${a.bold(
|
|
181
|
+
${a.bold(`Sisyphus@${xn} - The rock-solid versioning system`)}
|
|
182
182
|
|
|
183
183
|
${a.dim("USAGE")}
|
|
184
184
|
sisyphus <command> [options]
|
|
@@ -209,24 +209,24 @@ ${a.dim("EXAMPLES")}
|
|
|
209
209
|
|
|
210
210
|
|
|
211
211
|
${a.dim("Learn more at https://github.com/r5n-labs/clis")}
|
|
212
|
-
`)}import{parseArgs as Mt}from"util";
|
|
212
|
+
`)}import{parseArgs as Mt}from"util";async function oo({single:r,tag:o,ignore:t}){let e=await Bn({commitAndPush:()=>M({active:"Yes, commit and push the release",inactive:"Skip commit",initialValue:!1,message:"Should `roll` command commit and push the release?"}),commitConfig:()=>M({active:"Yes, configure commit",inactive:"Skip commit config",initialValue:!1,message:"Configure commit for release? Default commit message is `release(:tada:): <last-stone-message>`"}),commitAuthor:({results:{commitConfig:s}})=>s?q({message:"Commit author",placeholder:"r5n-bot"}):void 0,commitEmail:({results:{commitConfig:s}})=>s?q({message:"Commit author email",placeholder:"r5n-bot@users.noreply.github.com"}):void 0,commitMessage:({results:{commitConfig:s}})=>s?q({message:"Commit message",placeholder:"release(\uD83C\uDF89): <last-stone-message>"}):void 0,generateChangelog:()=>M({active:"Yes, Generate changelog",inactive:"Skip changelog",initialValue:!0,message:"Generate changelog for release?"}),releaseOnGitHub:()=>M({active:"Yes, create a GitHub release",inactive:"Skip GitHub release",initialValue:!1,message:"Create a release on GitHub when releasing packages?"}),releaseOnNPM:()=>M({active:"Yes, publish packages to NPM",inactive:"Skip NPM release",initialValue:!1,message:"Publish packages to NPM when releasing packages?"}),releaseTags:()=>M({active:"Yes, create tags for the release",inactive:"Skip tags",initialValue:!1,message:"Create tags for the release?"}),rootChangelog:({results:{generateChangelog:s}})=>s?M({active:"Yes, generate combined changelog",inactive:"Skip root changelog",initialValue:!0,message:"Generate combined changelog for monorepo?"}):void 0,single:()=>M({active:"Yes, setup for root package",inactive:"No, setup for monorepo workspace packages",initialValue:r,message:"Setup Sisyphus for only root package?"}),tag:()=>q({initialValue:o,message:"Tag used when versioning packages. Leave `latest` if you are not sure or want to release packages with latest tag.",placeholder:"latest"})},{onCancel:()=>nn()});return{commitAndPush:!!e.commitAndPush,commitAuthor:e.commitAuthor||"",commitConfig:!!e.commitConfig,commitEmail:e.commitEmail||"",commitMessage:e.commitMessage||"",generateChangelog:e.generateChangelog,releaseOnGitHub:!!e.releaseOnGitHub,releaseOnNPM:!!e.releaseOnNPM,releaseTags:!!e.releaseTags,rootChangelog:!!e.rootChangelog,single:e.single,tag:e.tag}}async function to({bump:r,packages:o,packageNames:t,tag:e}){let s=Pt({packageNames:t,packages:o,tag:e}),i=`
|
|
213
213
|
- ${a.dim(a.italic(`Press ${a.underline(a.bold(a.whiteBright("a")))} to select/unselect all, ${a.underline(a.bold(a.whiteBright("SPACE")))} to select/unselect, ${a.underline(a.bold(a.whiteBright("ARROWS")))} to move, ${a.underline(a.bold(a.whiteBright("ENTER")))} to confirm`))}
|
|
214
|
-
`,n=r?[r]:["major","minor","patch"];$.info(i);let{message:c,majorPackages:l,minorPackages:g,patchPackages:p}=await
|
|
214
|
+
`,n=r?[r]:["major","minor","patch"];$.info(i);let{message:c,majorPackages:l,minorPackages:g,patchPackages:p}=await Bn({majorPackages:()=>n.includes("major")?s({bump:"major"}):void 0,minorPackages:({results:{majorPackages:h}})=>n.includes("minor")?s({bump:"minor",filterPackages:h||[]}):void 0,patchPackages:({results:{majorPackages:h,minorPackages:f}})=>n.includes("patch")?s({bump:"patch",filterPackages:(h||[]).concat(f||[])}):void 0,message:()=>q({message:`Name of the stone. ${a.dim(a.italic("Default prefix or message can be configured in config."))}`,placeholder:"New feature"})},{onCancel:()=>nn()});return{majorPackages:l||[],message:c,minorPackages:g||[],patchPackages:p||[]}}function Pt({packageNames:r,tag:o,packages:t}){return({bump:e,filterPackages:s=[]})=>{let i=r.filter((c)=>!s?.includes(c)).map((c)=>({label:yn({bump:e,name:c,tag:o,version:t[c]?.version||"0.0.0"}),value:c})),n={major:a.red,minor:a.yellow,patch:a.green};return i.length>0?kr({initialValues:void 0,message:`Select packages for ${a.bold(n[e](e))} bump.`,options:i,required:!1}):void 0}}async function eo(){let{values:{nonInteractive:r,overwrite:o,tag:t,single:e,ignore:s}}=Mt({allowPositionals:!0,args:Bun.argv,options:{ignore:{default:[],multiple:!0,short:"i",type:"string"},nonInteractive:{default:!1,short:"n",type:"boolean"},overwrite:{default:!1,short:"o",type:"boolean"},single:{default:!1,short:"s",type:"boolean"},tag:{default:"latest",short:"t",type:"string"}},strict:!0});if(r)await A({ignore:s,overwrite:o,single:e,tag:t});else{let{commitAndPush:i,commitAuthor:n,commitConfig:c,commitEmail:l,commitMessage:g,generateChangelog:p,releaseOnGitHub:h,releaseOnNPM:f,releaseTags:d,rootChangelog:b,single:y,tag:E}=await oo({ignore:s,single:e,tag:t}),u={ignore:s,single:y,tag:E};if(c)u.commit={author:n,email:l,message:g};if(h||f||i)u.release={commitAndPush:i,github:h,npm:f,tags:d};if(p)u.changelog={generate:p,root:b};await A({overwrite:o,...u})}k(`${a.magenta(`${a.bold("Sisyphus ")}${a.underline(a.italic(`v${xn}`))}`)}${a.green(" is setup to roll stones.")}
|
|
215
215
|
|
|
216
216
|
You can now start by creating a new stone by running ${a.reset(a.green("bunx @r5n/sisyphus"))}${a.blue(" version")}
|
|
217
217
|
and following the prompts.
|
|
218
218
|
|
|
219
219
|
After you finished, you can release it by running ${a.reset(a.green("bunx @r5n/sisyphus"))}${a.blue(" roll")}
|
|
220
|
-
`)}import{parseArgs as Tt}from"util";import{randomUUID as jt}from"crypto";var Bt=["major","minor","patch","dependency","snapshot"];function Ut({message:r,tag:o,packages:t}){let e=t.reduce((i,n)=>{return i[n.bump]=i[n.bump]||[],i[n.bump].push(n.name),i},{}),s=Bt.filter((i)=>e[i]?.length>0);return[`### ${r}`,o?`_${o}_`:"",
|
|
220
|
+
`)}import{parseArgs as Tt}from"util";import{randomUUID as jt}from"crypto";var Bt=["major","minor","patch","dependency","snapshot"];function Ut({message:r,tag:o,packages:t}){let e=t.reduce((i,n)=>{return i[n.bump]=i[n.bump]||[],i[n.bump].push(n.name),i},{}),s=Bt.filter((i)=>e[i]?.length>0);return[`### ${r}`,o?`_${o}_`:"",Kr,"",`| ${s.join(" | ")} |`,`| ${s.map(()=>":---:").join(" | ")} |`,`| ${s.map((i)=>e[i]?.join(", ")||"").join(" | ")} |`,""]}async function so({majorPackages:r,message:o,minorPackages:t,packages:e,patchPackages:s,tag:i,configPath:n}){let l=`${`${(await $n({configPath:n})).length+1}`.padStart(4,"0")}-${jt().slice(0,8)}`,g=[...r,...t,...s],p=g.flatMap((b)=>e[b]?.dependencyOf||[]),f=[{packages:r,type:"major"},{packages:t,type:"minor"},{packages:s,type:"patch"},{packages:p.filter((b)=>!g.includes(b)),type:"dependency"}].flatMap(({packages:b,type:y})=>b.map((E)=>{let u=e[E];if(!u)throw new Error(`Package ${E} not found`);return{...u,bump:y,tag:i}})).filter(Boolean),d=Ut({message:o,packages:f,tag:i});return{packages:f,stoneContent:d,stoneName:l}}function Ht(){let{values:r}=Tt({allowPositionals:!0,args:Bun.argv,options:{bump:{default:"",short:"b",type:"string"},dryRun:{default:!1,short:"d",type:"boolean"},filter:{default:"",short:"f",type:"string"},snapshot:{default:!1,short:"s",type:"boolean"},tag:{default:"",short:"t",type:"string"},yes:{default:!1,short:"y",type:"boolean"}},strict:!0});return r}function qt(r){let{snapshot:o,bump:t}=r;if(o&&t)throw new Error(`Cannot use both ${a.cyanBright("--snapshot")} and ${a.cyanBright("--bump")} options, pick one.`)}async function zt(){let r=await M({active:"Yes, continue",inactive:"No, cancel",message:"Are you sure you want to create a new stone?"});if(!r||U(r))throw new Error("Operation cancelled by user")}async function Lt(r,o,t){await Bun.write(`.sisyphus/stones/${r}.md`,o.join(`
|
|
221
221
|
`)),await Bun.write(".sisyphus/config.json",`${JSON.stringify(t,null,2)}
|
|
222
|
-
`)}async function io(){try{let r=Ht();qt(r);let{dryRun:o}=
|
|
222
|
+
`)}async function io(){try{let r=Ht();qt(r);let{dryRun:o}=Yr(r),{packages:t,packageNames:e}=await J({filter:r.filter}),{message:s,majorPackages:i,minorPackages:n,patchPackages:c}=await to({bump:r.bump,packageNames:e,packages:t,tag:r.tag}),{packages:l,stoneContent:g,stoneName:p}=await so({majorPackages:i,message:s,minorPackages:n,packages:t,patchPackages:c,tag:r.tag});if($.step([`${r.dryRun?a.bold(a.yellow(`[dry-run]
|
|
223
223
|
`)):""}${a.italic("Changes preview:")}
|
|
224
224
|
`,`${a.italic("Stone: ")}${a.bold(s)}`,...l.map(yn)].join(`
|
|
225
225
|
`)),o){$.info(`${a.bold(a.yellow("[dry-run]"))}
|
|
226
226
|
Stone file preview:
|
|
227
227
|
${g.join(`
|
|
228
228
|
`)}`);return}if(!r.yes)await zt();let h=await A();h.stones.push(p),await Lt(p,g,h),k(`Now you can run ${a.green("bunx @r5n/sisyphus roll")} to release packages
|
|
229
|
-
or create another stone with ${a.green("bunx @r5n/sisyphus version")}`,`${a.bold("Stone ")}${a.italic(`${p}.md`)} ${a.green("created!")}`)}catch(r){nn(r instanceof Error?r.message:String(r))}}var
|
|
230
|
-
`))}if(!
|
|
229
|
+
or create another stone with ${a.green("bunx @r5n/sisyphus version")}`,`${a.bold("Stone ")}${a.italic(`${p}.md`)} ${a.green("created!")}`)}catch(r){nn(r instanceof Error?r.message:String(r))}}var Sn=["init","check","version","roll","help"],Kt={c:"check",cheack:"check",chekc:"check",h:"help",i:"init",initialise:"init",inti:"init",intialize:"init",publish:"roll",r:"roll",relase:"release",release:"roll",rool:"roll",state:"check",status:"check",v:"version",ver:"version",verison:"version"};async function Jt(){try{let[,,r,...o]=process.argv;if(!r||r==="--help"||r==="-h"){wn();return}let t=r;if(!Sn.includes(r)){let e=Br(r,Kt);if(e&&Sn.includes(e))t=e,console.log(a.yellow(`Assuming you meant '${e}'
|
|
230
|
+
`))}if(!Sn.includes(t)){console.error(a.red(`Unknown command: ${r}`));let e=jr(r,Sn);if(e.length>0){console.error(`
|
|
231
231
|
Did you mean one of these?`);for(let s of e)console.error(` ${a.cyan(s)}`)}console.error(a.dim(`
|
|
232
|
-
Run 'sisyphus --help' for usage information`)),process.exit(1)}if(o.includes("--help")||o.includes("-h")){
|
|
232
|
+
Run 'sisyphus --help' for usage information`)),process.exit(1)}if(o.includes("--help")||o.includes("-h")){wn(t);return}switch(t){case"init":await eo();break;case"check":await no();break;case"version":await io();break;case"roll":await Dr();break;case"help":{let e=o[0];wn(e);break}default:throw new Error(`Unknown command: ${t}`)}}catch(r){zr(r)}}await Jt();
|
package/package.json
CHANGED