diff --git a/index.js b/index.js index 1d75a37..fd8f716 100755 --- a/index.js +++ b/index.js @@ -1,8 +1,4 @@ #!/usr/bin/env node -var a2=Object.create;var Y=Object.defineProperty,l2=Object.defineProperties,c2=Object.getOwnPropertyDescriptor,i2=Object.getOwnPropertyDescriptors,u2=Object.getOwnPropertyNames,i0=Object.getOwnPropertySymbols,f2=Object.getPrototypeOf,u0=Object.prototype.hasOwnProperty,d2=Object.prototype.propertyIsEnumerable;var f0=(e,t,n)=>t in e?Y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,d0=(e,t)=>{for(var n in t||(t={}))u0.call(t,n)&&f0(e,n,t[n]);if(i0)for(var n of i0(t))d2.call(t,n)&&f0(e,n,t[n]);return e},h0=(e,t)=>l2(e,i2(t)),h2=e=>Y(e,"__esModule",{value:!0});var w=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var b2=(e,t,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of u2(t))!u0.call(e,r)&&r!=="default"&&Y(e,r,{get:()=>t[r],enumerable:!(n=c2(t,r))||n.enumerable});return e},B=e=>b2(h2(Y(e!=null?a2(f2(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var g0=w((J2,b0)=>{"use strict";b0.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var z=w((Z2,p0)=>{var L=g0(),x0={};for(let e of Object.keys(L))x0[L[e]]=e;var i={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};p0.exports=i;for(let e of Object.keys(i)){if(!("channels"in i[e]))throw new Error("missing channels property: "+e);if(!("labels"in i[e]))throw new Error("missing channel labels property: "+e);if(i[e].labels.length!==i[e].channels)throw new Error("channel and label counts mismatch: "+e);let{channels:t,labels:n}=i[e];delete i[e].channels,delete i[e].labels,Object.defineProperty(i[e],"channels",{value:t}),Object.defineProperty(i[e],"labels",{value:n})}i.rgb.hsl=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.min(t,n,r),s=Math.max(t,n,r),a=s-o,c,l;s===o?c=0:t===s?c=(n-r)/a:n===s?c=2+(r-t)/a:r===s&&(c=4+(t-n)/a),c=Math.min(c*60,360),c<0&&(c+=360);let u=(o+s)/2;return s===o?l=0:u<=.5?l=a/(s+o):l=a/(2-s-o),[c,l*100,u*100]};i.rgb.hsv=function(e){let t,n,r,o,s,a=e[0]/255,c=e[1]/255,l=e[2]/255,u=Math.max(a,c,l),h=u-Math.min(a,c,l),f=function(b){return(u-b)/6/h+1/2};return h===0?(o=0,s=0):(s=h/u,t=f(a),n=f(c),r=f(l),a===u?o=r-n:c===u?o=1/3+t-r:l===u&&(o=2/3+n-t),o<0?o+=1:o>1&&(o-=1)),[o*360,s*100,u*100]};i.rgb.hwb=function(e){let t=e[0],n=e[1],r=e[2],o=i.rgb.hsl(e)[0],s=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[o,s*100,r*100]};i.rgb.cmyk=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.min(1-t,1-n,1-r),s=(1-t-o)/(1-o)||0,a=(1-n-o)/(1-o)||0,c=(1-r-o)/(1-o)||0;return[s*100,a*100,c*100,o*100]};function g2(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}i.rgb.keyword=function(e){let t=x0[e];if(t)return t;let n=1/0,r;for(let o of Object.keys(L)){let s=L[o],a=g2(e,s);a.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;let o=t*.4124+n*.3576+r*.1805,s=t*.2126+n*.7152+r*.0722,a=t*.0193+n*.1192+r*.9505;return[o*100,s*100,a*100]};i.rgb.lab=function(e){let t=i.rgb.xyz(e),n=t[0],r=t[1],o=t[2];n/=95.047,r/=100,o/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,o=o>.008856?o**(1/3):7.787*o+16/116;let s=116*r-16,a=500*(n-r),c=200*(r-o);return[s,a,c]};i.hsl.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,o,s,a;if(n===0)return a=r*255,[a,a,a];r<.5?o=r*(1+n):o=r+n-r*n;let c=2*r-o,l=[0,0,0];for(let u=0;u<3;u++)s=t+1/3*-(u-1),s<0&&s++,s>1&&s--,6*s<1?a=c+(o-c)*6*s:2*s<1?a=o:3*s<2?a=c+(o-c)*(2/3-s)*6:a=c,l[u]=a*255;return l};i.hsl.hsv=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,o=n,s=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,o*=s<=1?s:2-s;let a=(r+n)/2,c=r===0?2*o/(s+o):2*n/(r+n);return[t,c*100,a*100]};i.hsv.rgb=function(e){let t=e[0]/60,n=e[1]/100,r=e[2]/100,o=Math.floor(t)%6,s=t-Math.floor(t),a=255*r*(1-n),c=255*r*(1-n*s),l=255*r*(1-n*(1-s));switch(r*=255,o){case 0:return[r,l,a];case 1:return[c,r,a];case 2:return[a,r,l];case 3:return[a,c,r];case 4:return[l,a,r];case 5:return[r,a,c]}};i.hsv.hsl=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,o=Math.max(r,.01),s,a;a=(2-n)*r;let c=(2-n)*o;return s=n*o,s/=c<=1?c:2-c,s=s||0,a/=2,[t,s*100,a*100]};i.hwb.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,o=n+r,s;o>1&&(n/=o,r/=o);let a=Math.floor(6*t),c=1-r;s=6*t-a,(a&1)!=0&&(s=1-s);let l=n+s*(c-n),u,h,f;switch(a){default:case 6:case 0:u=c,h=l,f=n;break;case 1:u=l,h=c,f=n;break;case 2:u=n,h=c,f=l;break;case 3:u=n,h=l,f=c;break;case 4:u=l,h=n,f=c;break;case 5:u=c,h=n,f=l;break}return[u*255,h*255,f*255]};i.cmyk.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,o=e[3]/100,s=1-Math.min(1,t*(1-o)+o),a=1-Math.min(1,n*(1-o)+o),c=1-Math.min(1,r*(1-o)+o);return[s*255,a*255,c*255]};i.xyz.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,o,s,a;return o=t*3.2406+n*-1.5372+r*-.4986,s=t*-.9689+n*1.8758+r*.0415,a=t*.0557+n*-.204+r*1.057,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),a=Math.min(Math.max(0,a),1),[o*255,s*255,a*255]};i.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;let o=116*n-16,s=500*(t-n),a=200*(n-r);return[o,s,a]};i.lab.xyz=function(e){let t=e[0],n=e[1],r=e[2],o,s,a;s=(t+16)/116,o=n/500+s,a=s-r/200;let c=s**3,l=o**3,u=a**3;return s=c>.008856?c:(s-16/116)/7.787,o=l>.008856?l:(o-16/116)/7.787,a=u>.008856?u:(a-16/116)/7.787,o*=95.047,s*=100,a*=108.883,[o,s,a]};i.lab.lch=function(e){let t=e[0],n=e[1],r=e[2],o;o=Math.atan2(r,n)*360/2/Math.PI,o<0&&(o+=360);let a=Math.sqrt(n*n+r*r);return[t,a,o]};i.lch.lab=function(e){let t=e[0],n=e[1],o=e[2]/360*2*Math.PI,s=n*Math.cos(o),a=n*Math.sin(o);return[t,s,a]};i.rgb.ansi16=function(e,t=null){let[n,r,o]=e,s=t===null?i.rgb.hsv(e)[2]:t;if(s=Math.round(s/50),s===0)return 30;let a=30+(Math.round(o/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return s===2&&(a+=60),a};i.hsv.ansi16=function(e){return i.rgb.ansi16(i.hsv.rgb(e),e[2])};i.rgb.ansi256=function(e){let t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)};i.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let n=(~~(e>50)+1)*.5,r=(t&1)*n*255,o=(t>>1&1)*n*255,s=(t>>2&1)*n*255;return[r,o,s]};i.ansi256.rgb=function(e){if(e>=232){let s=(e-232)*10+8;return[s,s,s]}e-=16;let t,n=Math.floor(e/36)/5*255,r=Math.floor((t=e%36)/6)/5*255,o=t%6/5*255;return[n,r,o]};i.rgb.hex=function(e){let n=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(n.length)+n};i.hex.rgb=function(e){let t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=n.split("").map(c=>c+c).join(""));let r=parseInt(n,16),o=r>>16&255,s=r>>8&255,a=r&255;return[o,s,a]};i.rgb.hcg=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.max(Math.max(t,n),r),s=Math.min(Math.min(t,n),r),a=o-s,c,l;return a<1?c=s/(1-a):c=0,a<=0?l=0:o===t?l=(n-r)/a%6:o===n?l=2+(r-t)/a:l=4+(t-n)/a,l/=6,l%=1,[l*360,a*100,c*100]};i.hsl.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n),o=0;return r<1&&(o=(n-.5*r)/(1-r)),[e[0],r*100,o*100]};i.hsv.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=t*n,o=0;return r<1&&(o=(n-r)/(1-r)),[e[0],r*100,o*100]};i.hcg.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];let o=[0,0,0],s=t%1*6,a=s%1,c=1-a,l=0;switch(Math.floor(s)){case 0:o[0]=1,o[1]=a,o[2]=0;break;case 1:o[0]=c,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=a;break;case 3:o[0]=0,o[1]=c,o[2]=1;break;case 4:o[0]=a,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=c}return l=(1-n)*r,[(n*o[0]+l)*255,(n*o[1]+l)*255,(n*o[2]+l)*255]};i.hcg.hsv=function(e){let t=e[1]/100,n=e[2]/100,r=t+n*(1-t),o=0;return r>0&&(o=t/r),[e[0],o*100,r*100]};i.hcg.hsl=function(e){let t=e[1]/100,r=e[2]/100*(1-t)+.5*t,o=0;return r>0&&r<.5?o=t/(2*r):r>=.5&&r<1&&(o=t/(2*(1-r))),[e[0],o*100,r*100]};i.hcg.hwb=function(e){let t=e[1]/100,n=e[2]/100,r=t+n*(1-t);return[e[0],(r-t)*100,(1-r)*100]};i.hwb.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=1-n,o=r-t,s=0;return o<1&&(s=(r-o)/(1-o)),[e[0],o*100,s*100]};i.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};i.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};i.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};i.gray.hsl=function(e){return[0,0,e[0]]};i.gray.hsv=i.gray.hsl;i.gray.hwb=function(e){return[0,100,e[0]]};i.gray.cmyk=function(e){return[0,0,0,e[0]]};i.gray.lab=function(e){return[e[0],0,0]};i.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r};i.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}});var m0=w((Q2,y0)=>{var D=z();function x2(){let e={},t=Object.keys(D);for(let n=t.length,r=0;r{var K=z(),v2=m0(),S={},k2=Object.keys(K);function w2(e){let t=function(...n){let r=n[0];return r==null?r:(r.length>1&&(n=r),e(n))};return"conversion"in e&&(t.conversion=e.conversion),t}function E2(e){let t=function(...n){let r=n[0];if(r==null)return r;r.length>1&&(n=r);let o=e(n);if(typeof o=="object")for(let s=o.length,a=0;a{S[e]={},Object.defineProperty(S[e],"channels",{value:K[e].channels}),Object.defineProperty(S[e],"labels",{value:K[e].labels});let t=v2(e);Object.keys(t).forEach(r=>{let o=t[r];S[e][r]=E2(o),S[e][r].raw=w2(o)})});v0.exports=S});var R0=w((te,M0)=>{"use strict";var w0=(e,t)=>(...n)=>`[${e(...n)+t}m`,E0=(e,t)=>(...n)=>{let r=e(...n);return`[${38+t};5;${r}m`},C0=(e,t)=>(...n)=>{let r=e(...n);return`[${38+t};2;${r[0]};${r[1]};${r[2]}m`},q=e=>e,O0=(e,t,n)=>[e,t,n],A=(e,t,n)=>{Object.defineProperty(e,t,{get:()=>{let r=n();return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0}),r},enumerable:!0,configurable:!0})},W,_=(e,t,n,r)=>{W===void 0&&(W=k0());let o=r?10:0,s={};for(let[a,c]of Object.entries(W)){let l=a==="ansi16"?"ansi":a;a===t?s[l]=e(n,o):typeof c=="object"&&(s[l]=e(c[t],o))}return s};function C2(){let e=new Map,t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],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],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],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.gray=t.color.blackBright,t.bgColor.bgGray=t.bgColor.bgBlackBright,t.color.grey=t.color.blackBright,t.bgColor.bgGrey=t.bgColor.bgBlackBright;for(let[n,r]of Object.entries(t)){for(let[o,s]of Object.entries(r))t[o]={open:`[${s[0]}m`,close:`[${s[1]}m`},r[o]=t[o],e.set(s[0],s[1]);Object.defineProperty(t,n,{value:r,enumerable:!1})}return Object.defineProperty(t,"codes",{value:e,enumerable:!1}),t.color.close="",t.bgColor.close="",A(t.color,"ansi",()=>_(w0,"ansi16",q,!1)),A(t.color,"ansi256",()=>_(E0,"ansi256",q,!1)),A(t.color,"ansi16m",()=>_(C0,"rgb",O0,!1)),A(t.bgColor,"ansi",()=>_(w0,"ansi16",q,!0)),A(t.bgColor,"ansi256",()=>_(E0,"ansi256",q,!0)),A(t.bgColor,"ansi16m",()=>_(C0,"rgb",O0,!0)),t}Object.defineProperty(M0,"exports",{enumerable:!0,get:C2})});var A0=w((ne,S0)=>{"use strict";S0.exports=(e,t=process.argv)=>{let n=e.startsWith("-")?"":e.length===1?"-":"--",r=t.indexOf(n+e),o=t.indexOf("--");return r!==-1&&(o===-1||r{"use strict";var O2=require("os"),_0=require("tty"),m=A0(),{env:x}=process,C;m("no-color")||m("no-colors")||m("color=false")||m("color=never")?C=0:(m("color")||m("colors")||m("color=true")||m("color=always"))&&(C=1);"FORCE_COLOR"in x&&(x.FORCE_COLOR==="true"?C=1:x.FORCE_COLOR==="false"?C=0:C=x.FORCE_COLOR.length===0?1:Math.min(parseInt(x.FORCE_COLOR,10),3));function X(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function J(e,t){if(C===0)return 0;if(m("color=16m")||m("color=full")||m("color=truecolor"))return 3;if(m("color=256"))return 2;if(e&&!t&&C===void 0)return 0;let n=C||0;if(x.TERM==="dumb")return n;if(process.platform==="win32"){let r=O2.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in x)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in x)||x.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in x)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(x.TEAMCITY_VERSION)?1:0;if(x.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in x){let r=parseInt((x.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(x.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(x.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(x.TERM)||"COLORTERM"in x?1:n}function M2(e){let t=J(e,e&&e.isTTY);return X(t)}T0.exports={supportsColor:M2,stdout:X(J(!0,_0.isatty(1))),stderr:X(J(!0,_0.isatty(2)))}});var j0=w((oe,L0)=>{"use strict";var R2=(e,t,n)=>{let r=e.indexOf(t);if(r===-1)return e;let o=t.length,s=0,a="";do a+=e.substr(s,r-s)+t+n,s=r+o,r=e.indexOf(t,s);while(r!==-1);return a+=e.substr(s),a},S2=(e,t,n,r)=>{let o=0,s="";do{let a=e[r-1]==="\r";s+=e.substr(o,(a?r-1:r)-o)+t+(a?`\r -`:` -`)+n,o=r+1,r=e.indexOf(` -`,o)}while(r!==-1);return s+=e.substr(o),s};L0.exports={stringReplaceAll:R2,stringEncaseCRLFWithFirstIndex:S2}});var $0=w((se,P0)=>{"use strict";var A2=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,I0=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,_2=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,T2=/\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.)|([^\\])/gi,B2=new Map([["n",` -`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a","\x07"]]);function F0(e){let t=e[0]==="u",n=e[1]==="{";return t&&!n&&e.length===5||e[0]==="x"&&e.length===3?String.fromCharCode(parseInt(e.slice(1),16)):t&&n?String.fromCodePoint(parseInt(e.slice(2,-1),16)):B2.get(e)||e}function L2(e,t){let n=[],r=t.trim().split(/\s*,\s*/g),o;for(let s of r){let a=Number(s);if(!Number.isNaN(a))n.push(a);else if(o=s.match(_2))n.push(o[2].replace(T2,(c,l,u)=>l?F0(l):u));else throw new Error(`Invalid Chalk template style argument: ${s} (in style '${e}')`)}return n}function j2(e){I0.lastIndex=0;let t=[],n;for(;(n=I0.exec(e))!==null;){let r=n[1];if(n[2]){let o=L2(r,n[2]);t.push([r].concat(o))}else t.push([r])}return t}function N0(e,t){let n={};for(let o of t)for(let s of o.styles)n[s[0]]=o.inverse?null:s.slice(1);let r=e;for(let[o,s]of Object.entries(n))if(!!Array.isArray(s)){if(!(o in r))throw new Error(`Unknown Chalk style: ${o}`);r=s.length>0?r[o](...s):r[o]}return r}P0.exports=(e,t)=>{let n=[],r=[],o=[];if(t.replace(A2,(s,a,c,l,u,h)=>{if(a)o.push(F0(a));else if(l){let f=o.join("");o=[],r.push(n.length===0?f:N0(e,n)(f)),n.push({inverse:c,styles:j2(l)})}else if(u){if(n.length===0)throw new Error("Found extraneous } in Chalk template literal");r.push(N0(e,n)(o.join(""))),o=[],n.pop()}else o.push(h)}),r.push(o.join("")),n.length>0){let s=`Chalk template literal is missing ${n.length} closing bracket${n.length===1?"":"s"} (\`}\`)`;throw new Error(s)}return r.join("")}});var n0=w((ae,U0)=>{"use strict";var j=R0(),{stdout:Z,stderr:Q}=B0(),{stringReplaceAll:I2,stringEncaseCRLFWithFirstIndex:F2}=j0(),Y0=["ansi","ansi","ansi256","ansi16m"],T=Object.create(null),N2=(e,t={})=>{if(t.level>3||t.level<0)throw new Error("The `level` option should be an integer from 0 to 3");let n=Z?Z.level:0;e.level=t.level===void 0?n:t.level},D0=class{constructor(t){return q0(t)}},q0=e=>{let t={};return N2(t,e),t.template=(...n)=>Y2(t.template,...n),Object.setPrototypeOf(t,H.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=D0,t.template};function H(e){return q0(e)}for(let[e,t]of Object.entries(j))T[e]={get(){let n=U(this,e0(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:n}),n}};T.visible={get(){let e=U(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};var H0=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let e of H0)T[e]={get(){let{level:t}=this;return function(...n){let r=e0(j.color[Y0[t]][e](...n),j.color.close,this._styler);return U(this,r,this._isEmpty)}}};for(let e of H0){let t="bg"+e[0].toUpperCase()+e.slice(1);T[t]={get(){let{level:n}=this;return function(...r){let o=e0(j.bgColor[Y0[n]][e](...r),j.bgColor.close,this._styler);return U(this,o,this._isEmpty)}}}}var P2=Object.defineProperties(()=>{},h0(d0({},T),{level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}})),e0=(e,t,n)=>{let r,o;return n===void 0?(r=e,o=t):(r=n.openAll+e,o=t+n.closeAll),{open:e,close:t,openAll:r,closeAll:o,parent:n}},U=(e,t,n)=>{let r=(...o)=>$2(r,o.length===1?""+o[0]:o.join(" "));return r.__proto__=P2,r._generator=e,r._styler=t,r._isEmpty=n,r},$2=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let n=e._styler;if(n===void 0)return t;let{openAll:r,closeAll:o}=n;if(t.indexOf("")!==-1)for(;n!==void 0;)t=I2(t,n.close,n.open),n=n.parent;let s=t.indexOf(` -`);return s!==-1&&(t=F2(t,o,r,s)),r+t+o},t0,Y2=(e,...t)=>{let[n]=t;if(!Array.isArray(n))return t.join(" ");let r=t.slice(1),o=[n.raw[0]];for(let s=1;s2100)return l;for(let f=1900;f<=2100;f++){let b=D2(f);if(s-=b,s<=0){l.year=f,s+=b;break}}a=Q0(l.year),c=s0(l.year);for(let f=0;f0&&f>=c&&(l.leap=f===c,l.month-=1);break}if(l.custom=Z0[h]||"",u){let f=u.slice(t*4,(t+1)*4);+f.slice(0,2)===n?l.solarTerms=r0[t*2]:+f.slice(2)===n&&(l.solarTerms=r0[t*2+1])}return l.festival=J0[`${t+1}.${n}`]||"",l.leap||(l.month===11&&l.day===a.pop()?(l.festival=F["12.30"],l.lunarFestival=F["12.30"]):(l.festival=F[`${l.month+1}.${l.day}`]||l.festival,l.lunarFestival=F[`${l.month+1}.${l.day}`]||"")),l.yearCN=a0(l.year),l.monthCN=(l.leap>0?"\u95F0":"")+G0[l.month]+"\u6708",l.day<11?l.dayCN=v[0]+v[l.day]:l.day<20?l.dayCN=v[10]+v[l.day-10]:l.day===20?l.dayCN=v[2]+v[10]:l.day<30?l.dayCN=v[20]+v[l.day-20]:l.day===30&&(l.dayCN=v[3]+v[10]),l.short=l.festival?l.festival:l.solarTerms?l.solarTerms:l.day===1?l.monthCN:l.dayCN,l}function D2(e){var t=Q0(e);return t.reduce((n,r)=>n+=r,0)}function s0(e){var t=V[e-1900];return t&15}function q2(e){var t=V[e-1900],n=s0(e);return n>0?t&983040?30:29:0}function Q0(e){var t=V[e-1900],n=s0(e),r=q2(e),o=[];for(let s=32768;s>8;s>>=1)o.push(t&s?30:29);return n>0&&o.splice(n,0,r),o}function a0(e){var t=(e-3)%10,n=(e-3)%12;return t=t===0?10:t,n=n===0?12:n,K0[t-1]+W0[n-1]+z0[(e-4)%12]+"\u5E74"}var H2=["\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"].map((e,t)=>(e="\u661F\u671F"+e,(t===0||t===6)&&(e=d.default.red(e))," "+e+" "+d.default.grey("|"))),P=d.default.grey("|"),fe=d.default.grey("|"+(" ".repeat(10)+"|").repeat(7));function e2(e="",t=" "){return d.default.grey(e+(t.repeat(10)+"|").repeat(7))}function t2(){var e=new Date;return[e.getFullYear(),e.getMonth()]}function n2(e,t){return new Date(e,t+1,0).getDate()}function r2(e,t,n){return new Date(e,t,n||1).getDay()}function U2({year:e,month:t,day:n},r){return r.year===e&&r.month===t&&r.day===n}function V2(){var e=new Date;return{year:e.getFullYear(),month:e.getMonth(),day:e.getDate()}}function G2(e,t){var n=n2(e,t-1),r=n2(e,t),o=1-r2(e,t),s=0,a=V2(),c=[],l,u,h,f;o<1&&(l=e,u=t-1,u<0&&(u=11,l--));for(let b=o;b<=r;b++){let k={day:b<1?n- -b:(b+"").padStart(2,"0")},R;if(b>0){let c0=r2(e,t,b);R=G(e,t,b),k.weekend=c0===0||c0===6,k.picked=!!U2({year:e,month:t,day:b},a),k.highlight=!!R.festival||!!R.solarTerms}else R=G(l,u,n+b),k.grey=1;k.lunar=R.short,k.custom=R.custom,c.push(k)}s=c.length%7,s=s>0?7-s:0,s>0&&(h=e,f=t+1,f>11&&(f=0,h++));for(let b=1;b<=s;b++){let k=G(h,f,b);c.push({day:(b+"").padStart(2,"0"),lunar:k.short,custom:k.custom,grey:1})}return c}function z2(e,t){var n=`${e}\u5E74${t+1}\u6708${" ".repeat(10)}${a0(e,t)}`;n=d.default.grey("| ")+d.default.cyan(n)+" ".repeat(71-n.length-2)+d.default.grey("|"),console.log(d.default.grey(" "+"_".repeat(76))),console.log(d.default.grey("|"+" ".repeat(76)+"|")),console.log(n),console.log(d.default.grey("|"+"_".repeat(76)+"|")),console.log(e2("|")),console.log(d.default.grey("|")+H2.join("")),console.log(e2("|","_"))}function K2(e,t){var n=G2(e,t),r=0;for(let o=0;o<3*Math.ceil(n.length/7)+1;o++){let s="";for(let a=0;a<7;a++){let c=n[r+a];if(!c)break;switch(a===0&&(s+=P),o%3){case 0:o===0?s+=d.default.grey(" ".repeat(10)+"|"):(s+=d.default.grey("-".repeat(a===6?10:11)+(a===6?"|":"")),a===6&&(r+=7));break;case 1:let l=" ";c.custom&&(c.custom==="\u73ED"?l=d.default.red(c.custom):l=d.default.green.dim(c.custom)),c.picked?s+=" "+d.default.bgBlue.whiteBright.bold(" "+c.day+" ")+l+P:(c.grey?c.day=d.default.grey(c.day):c.weekend?c.day=d.default.redBright.bold(c.day):c.day=d.default.whiteBright.bold(c.day),s+=" ".repeat(4)+c.day+" "+l+P);break;case 2:let u=5,h="",f=" ";c.lunar&&(u=(10-c.lunar.length*2)/2-2),u>=0?h=" ".repeat(u):f=f.slice(0,u),c.picked?s+=f+d.default.bgBlue.white.bold(h+c.lunar+h)+f+P:(c.lunar&&(c.lunar=c.highlight?d.default.cyan.dim(c.lunar):c.weekend?d.default.red.dim(c.lunar):d.default.grey(c.lunar)),s+=" ".repeat(u+2)+c.lunar+" ".repeat(u+2)+P);break}}console.log(s)}console.log("")}function M(e,t){z2(e,t),K2(e,t)}var s2="1.2.3",E=process.argv.slice(2),$=E.shift(),[y,p]=t2();function l0(e){for(let t=0;t<12;t++)M(e,t)}function g(...e){e[0]=e[0].padEnd(20," "),e.length>1&&e.splice(1,0," - "),console.log.apply(null,e)}function W2(){g("=".repeat(64)),g(`\u7EC8\u7AEF\u7248\u4E07\u5E74\u5386 v${s2}, \u4F5C\u8005: \u5B87\u5929`),g("=".repeat(64)),g("\u7528\u6CD5: cal [command] args..."),g("Commands:"),g(" -y {year}","\u6253\u5370\u6307\u5B9A\u5E74\u4EFD\u7684\u65E5\u5386"),g(" -m","\u6253\u5370\u6307\u5B9A\u6708\u4EFD\u7684\u65E5\u5386"),g(" -c","\u5BFC\u5165\u81EA\u5B9A\u4E49\u4F11\u5047\u65E5, \u5FC5\u987B\u662F\u6807\u51C6json\u683C\u5F0F, \u8BED\u6CD5\u770B\u4E0B\u9762\u7684\u793A\u4F8B"),g(" -h","\u67E5\u770B\u5E2E\u52A9\u6587\u6863"),g(" -v",`\u67E5\u770B\u7A0B\u5E8F\u7684\u7248\u672C -`),g("\u793A\u4F8B: "),g(" cal "+O.default.grey("# \u4E0D\u5E26\u53C2\u6570\u6253\u5370\u5F53\u524D\u5E74\u6708")),g(" cal -y "+O.default.grey("# -y \u4E0D\u63A5\u53C2\u6570, \u6253\u5370\u5F53\u524D\u5E74\u7684\u6240\u6709\u6708\u4EFD")),g(" cal -y 2000 "+O.default.grey("# \u6253\u5370\u6307\u5B9A\u5E74\u4EFD\u7684\u6240\u6709\u6708\u4EFD")),g(" cal -y 2021 5 "+O.default.grey("# \u6253\u5370\u6307\u5B9A\u5E74\u4EFD, \u6307\u5B9A\u6708\u4EFD")),g(" cal -y 2000 -m 3 "+O.default.grey("# \u540C\u4E0A")),g(" cal -m 5 "+O.default.grey("# \u6253\u5370\u5F53\u524D\u5E74\u4EFD\u7684 \u6307\u5B9A\u6708\u4EFD")),g(' cal -c {"2021.12.11":"\u73ED","2021.12.12":"\u4F11"} '+O.default.grey("# \u5BFC\u5165\u81EA\u5B9A\u4E49\u4F11\u5047\u65E5")),process.exit()}switch($){case"-y":switch(E.length){case 0:l0(y);break;case 1:case 2:y=+E.shift(),p=+E.shift(),y===y?p<13&&p>0?M(y,p-1):l0(y):console.log("-y \u53C2\u6570\u5F02\u5E38");break;case 3:$=E.shift(),p=+E.shift(),$==="-m"&&p<13&&p>0?M(y,p-1):console.log("-m \u53C2\u6570\u5F02\u5E38");break;default:console.log("-y \u53C2\u6570\u5F02\u5E38");break}break;case"-m":p=+E.shift(),p<13&&p>0?M(y,p-1):console.log("-m \u53C2\u6570\u5F02\u5E38");break;case"-v":g(s2);break;case"-h":W2();break;case"-c":let e=E.shift();if(e)try{JSON.parse(e),o2.default.writeFileSync(N,e),console.log("\u5BFC\u5165\u6210\u529F")}catch{console.log("\u9519\u8BEF\u7684json\u6570\u636E")}else console.log("\u5BFC\u5165\u7684\u6570\u636E\u4E3A\u7A7A");break;default:$?(y=+$,p=+E.shift(),y===y?p<13&&p>0?M(y,p-1):l0(y):console.log("\u53C2\u6570\u5F02\u5E38")):M(y,p);break}process.exit(); +var X0=Object.create;var l0=Object.defineProperty;var J0=Object.getOwnPropertyDescriptor;var Z0=Object.getOwnPropertyNames;var Q0=Object.getPrototypeOf,e2=Object.prototype.hasOwnProperty;var E=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var r2=(e,r,a,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of Z0(r))!e2.call(e,t)&&t!==a&&l0(e,t,{get:()=>r[t],enumerable:!(n=J0(r,t))||n.enumerable});return e};var Y=(e,r,a)=>(a=e!=null?X0(Q0(e)):{},r2(r||!e||!e.__esModule?l0(a,"default",{value:e,enumerable:!0}):a,e));var c0=E((F2,i0)=>{"use strict";var a2=/[|\\{}()[\]^$+*?.]/g;i0.exports=function(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(a2,"\\$&")}});var f0=E(($2,u0)=>{"use strict";u0.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var K=E((I2,p0)=>{var O=f0(),g0={};for(D in O)O.hasOwnProperty(D)&&(g0[O[D]]=D);var D,c=p0.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(y in c)if(c.hasOwnProperty(y)){if(!("channels"in c[y]))throw new Error("missing channels property: "+y);if(!("labels"in c[y]))throw new Error("missing channel labels property: "+y);if(c[y].labels.length!==c[y].channels)throw new Error("channel and label counts mismatch: "+y);v0=c[y].channels,h0=c[y].labels,delete c[y].channels,delete c[y].labels,Object.defineProperty(c[y],"channels",{value:v0}),Object.defineProperty(c[y],"labels",{value:h0})}var v0,h0,y;c.rgb.hsl=function(e){var r=e[0]/255,a=e[1]/255,n=e[2]/255,t=Math.min(r,a,n),s=Math.max(r,a,n),o=s-t,l,i,u;return s===t?l=0:r===s?l=(a-n)/o:a===s?l=2+(n-r)/o:n===s&&(l=4+(r-a)/o),l=Math.min(l*60,360),l<0&&(l+=360),u=(t+s)/2,s===t?i=0:u<=.5?i=o/(s+t):i=o/(2-s-t),[l,i*100,u*100]};c.rgb.hsv=function(e){var r,a,n,t,s,o=e[0]/255,l=e[1]/255,i=e[2]/255,u=Math.max(o,l,i),h=u-Math.min(o,l,i),f=function(g){return(u-g)/6/h+1/2};return h===0?t=s=0:(s=h/u,r=f(o),a=f(l),n=f(i),o===u?t=n-a:l===u?t=1/3+r-n:i===u&&(t=2/3+a-r),t<0?t+=1:t>1&&(t-=1)),[t*360,s*100,u*100]};c.rgb.hwb=function(e){var r=e[0],a=e[1],n=e[2],t=c.rgb.hsl(e)[0],s=1/255*Math.min(r,Math.min(a,n));return n=1-1/255*Math.max(r,Math.max(a,n)),[t,s*100,n*100]};c.rgb.cmyk=function(e){var r=e[0]/255,a=e[1]/255,n=e[2]/255,t,s,o,l;return l=Math.min(1-r,1-a,1-n),t=(1-r-l)/(1-l)||0,s=(1-a-l)/(1-l)||0,o=(1-n-l)/(1-l)||0,[t*100,s*100,o*100,l*100]};function t2(e,r){return Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2)+Math.pow(e[2]-r[2],2)}c.rgb.keyword=function(e){var r=g0[e];if(r)return r;var a=1/0,n;for(var t in O)if(O.hasOwnProperty(t)){var s=O[t],o=t2(e,s);o.04045?Math.pow((r+.055)/1.055,2.4):r/12.92,a=a>.04045?Math.pow((a+.055)/1.055,2.4):a/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92;var t=r*.4124+a*.3576+n*.1805,s=r*.2126+a*.7152+n*.0722,o=r*.0193+a*.1192+n*.9505;return[t*100,s*100,o*100]};c.rgb.lab=function(e){var r=c.rgb.xyz(e),a=r[0],n=r[1],t=r[2],s,o,l;return a/=95.047,n/=100,t/=108.883,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,s=116*n-16,o=500*(a-n),l=200*(n-t),[s,o,l]};c.hsl.rgb=function(e){var r=e[0]/360,a=e[1]/100,n=e[2]/100,t,s,o,l,i;if(a===0)return i=n*255,[i,i,i];n<.5?s=n*(1+a):s=n+a-n*a,t=2*n-s,l=[0,0,0];for(var u=0;u<3;u++)o=r+1/3*-(u-1),o<0&&o++,o>1&&o--,6*o<1?i=t+(s-t)*6*o:2*o<1?i=s:3*o<2?i=t+(s-t)*(2/3-o)*6:i=t,l[u]=i*255;return l};c.hsl.hsv=function(e){var r=e[0],a=e[1]/100,n=e[2]/100,t=a,s=Math.max(n,.01),o,l;return n*=2,a*=n<=1?n:2-n,t*=s<=1?s:2-s,l=(n+a)/2,o=n===0?2*t/(s+t):2*a/(n+a),[r,o*100,l*100]};c.hsv.rgb=function(e){var r=e[0]/60,a=e[1]/100,n=e[2]/100,t=Math.floor(r)%6,s=r-Math.floor(r),o=255*n*(1-a),l=255*n*(1-a*s),i=255*n*(1-a*(1-s));switch(n*=255,t){case 0:return[n,i,o];case 1:return[l,n,o];case 2:return[o,n,i];case 3:return[o,l,n];case 4:return[i,o,n];case 5:return[n,o,l]}};c.hsv.hsl=function(e){var r=e[0],a=e[1]/100,n=e[2]/100,t=Math.max(n,.01),s,o,l;return l=(2-a)*n,s=(2-a)*t,o=a*t,o/=s<=1?s:2-s,o=o||0,l/=2,[r,o*100,l*100]};c.hwb.rgb=function(e){var r=e[0]/360,a=e[1]/100,n=e[2]/100,t=a+n,s,o,l,i;t>1&&(a/=t,n/=t),s=Math.floor(6*r),o=1-n,l=6*r-s,(s&1)!==0&&(l=1-l),i=a+l*(o-a);var u,h,f;switch(s){default:case 6:case 0:u=o,h=i,f=a;break;case 1:u=i,h=o,f=a;break;case 2:u=a,h=o,f=i;break;case 3:u=a,h=i,f=o;break;case 4:u=i,h=a,f=o;break;case 5:u=o,h=a,f=i;break}return[u*255,h*255,f*255]};c.cmyk.rgb=function(e){var r=e[0]/100,a=e[1]/100,n=e[2]/100,t=e[3]/100,s,o,l;return s=1-Math.min(1,r*(1-t)+t),o=1-Math.min(1,a*(1-t)+t),l=1-Math.min(1,n*(1-t)+t),[s*255,o*255,l*255]};c.xyz.rgb=function(e){var r=e[0]/100,a=e[1]/100,n=e[2]/100,t,s,o;return t=r*3.2406+a*-1.5372+n*-.4986,s=r*-.9689+a*1.8758+n*.0415,o=r*.0557+a*-.204+n*1.057,t=t>.0031308?1.055*Math.pow(t,1/2.4)-.055:t*12.92,s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*12.92,t=Math.min(Math.max(0,t),1),s=Math.min(Math.max(0,s),1),o=Math.min(Math.max(0,o),1),[t*255,s*255,o*255]};c.xyz.lab=function(e){var r=e[0],a=e[1],n=e[2],t,s,o;return r/=95.047,a/=100,n/=108.883,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,t=116*a-16,s=500*(r-a),o=200*(a-n),[t,s,o]};c.lab.xyz=function(e){var r=e[0],a=e[1],n=e[2],t,s,o;s=(r+16)/116,t=a/500+s,o=s-n/200;var l=Math.pow(s,3),i=Math.pow(t,3),u=Math.pow(o,3);return s=l>.008856?l:(s-16/116)/7.787,t=i>.008856?i:(t-16/116)/7.787,o=u>.008856?u:(o-16/116)/7.787,t*=95.047,s*=100,o*=108.883,[t,s,o]};c.lab.lch=function(e){var r=e[0],a=e[1],n=e[2],t,s,o;return t=Math.atan2(n,a),s=t*360/2/Math.PI,s<0&&(s+=360),o=Math.sqrt(a*a+n*n),[r,o,s]};c.lch.lab=function(e){var r=e[0],a=e[1],n=e[2],t,s,o;return o=n/360*2*Math.PI,t=a*Math.cos(o),s=a*Math.sin(o),[r,t,s]};c.rgb.ansi16=function(e){var r=e[0],a=e[1],n=e[2],t=1 in arguments?arguments[1]:c.rgb.hsv(e)[2];if(t=Math.round(t/50),t===0)return 30;var s=30+(Math.round(n/255)<<2|Math.round(a/255)<<1|Math.round(r/255));return t===2&&(s+=60),s};c.hsv.ansi16=function(e){return c.rgb.ansi16(c.hsv.rgb(e),e[2])};c.rgb.ansi256=function(e){var r=e[0],a=e[1],n=e[2];if(r===a&&a===n)return r<8?16:r>248?231:Math.round((r-8)/247*24)+232;var t=16+36*Math.round(r/255*5)+6*Math.round(a/255*5)+Math.round(n/255*5);return t};c.ansi16.rgb=function(e){var r=e%10;if(r===0||r===7)return e>50&&(r+=3.5),r=r/10.5*255,[r,r,r];var a=(~~(e>50)+1)*.5,n=(r&1)*a*255,t=(r>>1&1)*a*255,s=(r>>2&1)*a*255;return[n,t,s]};c.ansi256.rgb=function(e){if(e>=232){var r=(e-232)*10+8;return[r,r,r]}e-=16;var a,n=Math.floor(e/36)/5*255,t=Math.floor((a=e%36)/6)/5*255,s=a%6/5*255;return[n,t,s]};c.rgb.hex=function(e){var r=((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255),a=r.toString(16).toUpperCase();return"000000".substring(a.length)+a};c.hex.rgb=function(e){var r=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!r)return[0,0,0];var a=r[0];r[0].length===3&&(a=a.split("").map(function(l){return l+l}).join(""));var n=parseInt(a,16),t=n>>16&255,s=n>>8&255,o=n&255;return[t,s,o]};c.rgb.hcg=function(e){var r=e[0]/255,a=e[1]/255,n=e[2]/255,t=Math.max(Math.max(r,a),n),s=Math.min(Math.min(r,a),n),o=t-s,l,i;return o<1?l=s/(1-o):l=0,o<=0?i=0:t===r?i=(a-n)/o%6:t===a?i=2+(n-r)/o:i=4+(r-a)/o+4,i/=6,i%=1,[i*360,o*100,l*100]};c.hsl.hcg=function(e){var r=e[1]/100,a=e[2]/100,n=1,t=0;return a<.5?n=2*r*a:n=2*r*(1-a),n<1&&(t=(a-.5*n)/(1-n)),[e[0],n*100,t*100]};c.hsv.hcg=function(e){var r=e[1]/100,a=e[2]/100,n=r*a,t=0;return n<1&&(t=(a-n)/(1-n)),[e[0],n*100,t*100]};c.hcg.rgb=function(e){var r=e[0]/360,a=e[1]/100,n=e[2]/100;if(a===0)return[n*255,n*255,n*255];var t=[0,0,0],s=r%1*6,o=s%1,l=1-o,i=0;switch(Math.floor(s)){case 0:t[0]=1,t[1]=o,t[2]=0;break;case 1:t[0]=l,t[1]=1,t[2]=0;break;case 2:t[0]=0,t[1]=1,t[2]=o;break;case 3:t[0]=0,t[1]=l,t[2]=1;break;case 4:t[0]=o,t[1]=0,t[2]=1;break;default:t[0]=1,t[1]=0,t[2]=l}return i=(1-a)*n,[(a*t[0]+i)*255,(a*t[1]+i)*255,(a*t[2]+i)*255]};c.hcg.hsv=function(e){var r=e[1]/100,a=e[2]/100,n=r+a*(1-r),t=0;return n>0&&(t=r/n),[e[0],t*100,n*100]};c.hcg.hsl=function(e){var r=e[1]/100,a=e[2]/100,n=a*(1-r)+.5*r,t=0;return n>0&&n<.5?t=r/(2*n):n>=.5&&n<1&&(t=r/(2*(1-n))),[e[0],t*100,n*100]};c.hcg.hwb=function(e){var r=e[1]/100,a=e[2]/100,n=r+a*(1-r);return[e[0],(n-r)*100,(1-n)*100]};c.hwb.hcg=function(e){var r=e[1]/100,a=e[2]/100,n=1-a,t=n-r,s=0;return t<1&&(s=(n-t)/(1-t)),[e[0],t*100,s*100]};c.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};c.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};c.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};c.gray.hsl=c.gray.hsv=function(e){return[0,0,e[0]]};c.gray.hwb=function(e){return[0,100,e[0]]};c.gray.cmyk=function(e){return[0,0,0,e[0]]};c.gray.lab=function(e){return[e[0],0,0]};c.gray.hex=function(e){var r=Math.round(e[0]/100*255)&255,a=(r<<16)+(r<<8)+r,n=a.toString(16).toUpperCase();return"000000".substring(n.length)+n};c.rgb.gray=function(e){var r=(e[0]+e[1]+e[2])/3;return[r/255*100]}});var b0=E((P2,d0)=>{var q=K();function n2(){for(var e={},r=Object.keys(q),a=r.length,n=0;n{var X=K(),i2=b0(),_={},c2=Object.keys(X);function u2(e){var r=function(a){return a==null?a:(arguments.length>1&&(a=Array.prototype.slice.call(arguments)),e(a))};return"conversion"in e&&(r.conversion=e.conversion),r}function f2(e){var r=function(a){if(a==null)return a;arguments.length>1&&(a=Array.prototype.slice.call(arguments));var n=e(a);if(typeof n=="object")for(var t=n.length,s=0;s{"use strict";var T=y0(),H=(e,r)=>function(){return`\x1B[${e.apply(T,arguments)+r}m`},G=(e,r)=>function(){let a=e.apply(T,arguments);return`\x1B[${38+r};5;${a}m`},V=(e,r)=>function(){let a=e.apply(T,arguments);return`\x1B[${38+r};2;${a[0]};${a[1]};${a[2]}m`};function v2(){let e=new Map,r={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],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],gray:[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],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};r.color.grey=r.color.gray;for(let t of Object.keys(r)){let s=r[t];for(let o of Object.keys(s)){let l=s[o];r[o]={open:`\x1B[${l[0]}m`,close:`\x1B[${l[1]}m`},s[o]=r[o],e.set(l[0],l[1])}Object.defineProperty(r,t,{value:s,enumerable:!1}),Object.defineProperty(r,"codes",{value:e,enumerable:!1})}let a=t=>t,n=(t,s,o)=>[t,s,o];r.color.close="\x1B[39m",r.bgColor.close="\x1B[49m",r.color.ansi={ansi:H(a,0)},r.color.ansi256={ansi256:G(a,0)},r.color.ansi16m={rgb:V(n,0)},r.bgColor.ansi={ansi:H(a,10)},r.bgColor.ansi256={ansi256:G(a,10)},r.bgColor.ansi16m={rgb:V(n,10)};for(let t of Object.keys(T)){if(typeof T[t]!="object")continue;let s=T[t];t==="ansi16"&&(t="ansi"),"ansi16"in s&&(r.color.ansi[t]=H(s.ansi16,0),r.bgColor.ansi[t]=H(s.ansi16,10)),"ansi256"in s&&(r.color.ansi256[t]=G(s.ansi256,0),r.bgColor.ansi256[t]=G(s.ansi256,10)),"rgb"in s&&(r.color.ansi16m[t]=V(s.rgb,0),r.bgColor.ansi16m[t]=V(s.rgb,10))}return r}Object.defineProperty(m0,"exports",{enumerable:!0,get:v2})});var M0=E((q2,k0)=>{"use strict";k0.exports=(e,r)=>{r=r||process.argv;let a=e.startsWith("-")?"":e.length===1?"-":"--",n=r.indexOf(a+e),t=r.indexOf("--");return n!==-1&&(t===-1?!0:n{"use strict";var h2=require("os"),w=M0(),x=process.env,L;w("no-color")||w("no-colors")||w("color=false")?L=!1:(w("color")||w("colors")||w("color=true")||w("color=always"))&&(L=!0);"FORCE_COLOR"in x&&(L=x.FORCE_COLOR.length===0||parseInt(x.FORCE_COLOR,10)!==0);function g2(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function p2(e){if(L===!1)return 0;if(w("color=16m")||w("color=full")||w("color=truecolor"))return 3;if(w("color=256"))return 2;if(e&&!e.isTTY&&L!==!0)return 0;let r=L?1:0;if(process.platform==="win32"){let a=h2.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in x)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(a=>a in x)||x.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in x)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(x.TEAMCITY_VERSION)?1:0;if(x.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in x){let a=parseInt((x.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(x.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(x.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(x.TERM)||"COLORTERM"in x?1:(x.TERM==="dumb",r)}function J(e){let r=p2(e);return g2(r)}E0.exports={supportsColor:J,stdout:J(process.stdout),stderr:J(process.stderr)}});var _0=E((G2,A0)=>{"use strict";var d2=/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,R0=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,b2=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,x2=/\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi,y2=new Map([["n",` +`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function S0(e){return e[0]==="u"&&e.length===5||e[0]==="x"&&e.length===3?String.fromCharCode(parseInt(e.slice(1),16)):y2.get(e)||e}function m2(e,r){let a=[],n=r.trim().split(/\s*,\s*/g),t;for(let s of n)if(!isNaN(s))a.push(Number(s));else if(t=s.match(b2))a.push(t[2].replace(x2,(o,l,i)=>l?S0(l):i));else throw new Error(`Invalid Chalk template style argument: ${s} (in style '${e}')`);return a}function w2(e){R0.lastIndex=0;let r=[],a;for(;(a=R0.exec(e))!==null;){let n=a[1];if(a[2]){let t=m2(n,a[2]);r.push([n].concat(t))}else r.push([n])}return r}function O0(e,r){let a={};for(let t of r)for(let s of t.styles)a[s[0]]=t.inverse?null:s.slice(1);let n=e;for(let t of Object.keys(a))if(Array.isArray(a[t])){if(!(t in n))throw new Error(`Unknown Chalk style: ${t}`);a[t].length>0?n=n[t].apply(n,a[t]):n=n[t]}return n}A0.exports=(e,r)=>{let a=[],n=[],t=[];if(r.replace(d2,(s,o,l,i,u,h)=>{if(o)t.push(S0(o));else if(i){let f=t.join("");t=[],n.push(a.length===0?f:O0(e,a)(f)),a.push({inverse:l,styles:w2(i)})}else if(u){if(a.length===0)throw new Error("Found extraneous } in Chalk template literal");n.push(O0(e,a)(t.join(""))),t=[],a.pop()}else t.push(h)}),n.push(t.join("")),a.length>0){let s=`Chalk template literal is missing ${a.length} closing bracket${a.length===1?"":"s"} (\`}\`)`;throw new Error(s)}return n.join("")}});var e0=E((V2,j)=>{"use strict";var Q=c0(),p=w0(),Z=C0().stdout,k2=_0(),L0=process.platform==="win32"&&!(process.env.TERM||"").toLowerCase().startsWith("xterm"),N0=["ansi","ansi","ansi256","ansi16m"],B0=new Set(["gray"]),N=Object.create(null);function T0(e,r){r=r||{};let a=Z?Z.level:0;e.level=r.level===void 0?a:r.level,e.enabled="enabled"in r?r.enabled:e.level>0}function B(e){if(!this||!(this instanceof B)||this.template){let r={};return T0(r,e),r.template=function(){let a=[].slice.call(arguments);return C2.apply(null,[r.template].concat(a))},Object.setPrototypeOf(r,B.prototype),Object.setPrototypeOf(r.template,r),r.template.constructor=B,r.template}T0(this,e)}L0&&(p.blue.open="\x1B[94m");for(let e of Object.keys(p))p[e].closeRe=new RegExp(Q(p[e].close),"g"),N[e]={get(){let r=p[e];return U.call(this,this._styles?this._styles.concat(r):[r],this._empty,e)}};N.visible={get(){return U.call(this,this._styles||[],!0,"visible")}};p.color.closeRe=new RegExp(Q(p.color.close),"g");for(let e of Object.keys(p.color.ansi))B0.has(e)||(N[e]={get(){let r=this.level;return function(){let n={open:p.color[N0[r]][e].apply(null,arguments),close:p.color.close,closeRe:p.color.closeRe};return U.call(this,this._styles?this._styles.concat(n):[n],this._empty,e)}}});p.bgColor.closeRe=new RegExp(Q(p.bgColor.close),"g");for(let e of Object.keys(p.bgColor.ansi)){if(B0.has(e))continue;let r="bg"+e[0].toUpperCase()+e.slice(1);N[r]={get(){let a=this.level;return function(){let t={open:p.bgColor[N0[a]][e].apply(null,arguments),close:p.bgColor.close,closeRe:p.bgColor.closeRe};return U.call(this,this._styles?this._styles.concat(t):[t],this._empty,e)}}}}var M2=Object.defineProperties(()=>{},N);function U(e,r,a){let n=function(){return E2.apply(n,arguments)};n._styles=e,n._empty=r;let t=this;return Object.defineProperty(n,"level",{enumerable:!0,get(){return t.level},set(s){t.level=s}}),Object.defineProperty(n,"enabled",{enumerable:!0,get(){return t.enabled},set(s){t.enabled=s}}),n.hasGrey=this.hasGrey||a==="gray"||a==="grey",n.__proto__=M2,n}function E2(){let e=arguments,r=e.length,a=String(arguments[0]);if(r===0)return"";if(r>1)for(let t=1;t2100)return i;for(let f=1900;f<=2100;f++){let g=R2(f);if(s-=g,s<=0){i.year=f,s+=g;break}}o=H0(i.year),l=t0(i.year);for(let f=0;f0&&f>=l&&(i.leap=f===l,i.month-=1);break}if(i.custom=q0[h]||"",u){let f=u.slice(r*4,(r+1)*4);+f.slice(0,2)===a?i.solarTerms=r0[r*2]:+f.slice(2)===a&&(i.solarTerms=r0[r*2+1])}return i.festival=D0[`${r+1}.${a}`]||"",i.leap||(i.month===11&&i.day===o.pop()?(i.festival=F["12.30"],i.lunarFestival=F["12.30"]):(i.festival=F[`${i.month+1}.${i.day}`]||i.festival,i.lunarFestival=F[`${i.month+1}.${i.day}`]||"")),i.yearCN=n0(i.year),i.monthCN=(i.leap>0?"\u95F0":"")+F0[i.month]+"\u6708",i.day<11?i.dayCN=k[0]+k[i.day]:i.day<20?i.dayCN=k[10]+k[i.day-10]:i.day===20?i.dayCN=k[2]+k[10]:i.day<30?i.dayCN=k[20]+k[i.day-20]:i.day===30&&(i.dayCN=k[3]+k[10]),i.short=i.festival?i.festival:i.solarTerms?i.solarTerms:i.day===1?i.monthCN:i.dayCN,i}function R2(e){var r=H0(e);return r.reduce((a,n)=>a+=n,0)}function t0(e){var r=z[e-1900];return r&15}function O2(e){var r=z[e-1900],a=t0(e);return a>0?r&983040?30:29:0}function H0(e){var r=z[e-1900],a=t0(e),n=O2(e),t=[];for(let s=32768;s>8;s>>=1)t.push(r&s?30:29);return a>0&&t.splice(a,0,n),t}function n0(e){var r=(e-3)%10,a=(e-3)%12;return r=r===0?10:r,a=a===0?12:a,I0[r-1]+P0[a-1]+$0[(e-4)%12]+"\u5E74"}var S2=["\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"].map((e,r)=>(e="\u661F\u671F"+e,(r===0||r===6)&&(e=v.default.red(e))," "+e+" "+v.default.grey("|"))),I=v.default.grey("|"),X2=v.default.grey("|"+(" ".repeat(10)+"|").repeat(7));function G0(e="",r=" "){return v.default.grey(e+(r.repeat(10)+"|").repeat(7))}function z0(){var e=new Date;return[e.getFullYear(),e.getMonth()]}function V0(e,r){return new Date(e,r+1,0).getDate()}function U0(e,r,a){return new Date(e,r,a||1).getDay()}function A2({year:e,month:r,day:a},n){return n.year===e&&n.month===r&&n.day===a}function _2(){var e=new Date;return{year:e.getFullYear(),month:e.getMonth(),day:e.getDate()}}function T2(e,r){var a=V0(e,r-1),n=V0(e,r),t=1-U0(e,r),s=0,o=_2(),l=[],i,u,h,f;t<1&&(i=e,u=r-1,u<0&&(u=11,i--));for(let g=t;g<=n;g++){let M={day:g<1?a- -g:(g+"").padStart(2,"0")},A;if(g>0){let o0=U0(e,r,g);A=W(e,r,g),M.weekend=o0===0||o0===6,M.picked=!!A2({year:e,month:r,day:g},o),M.highlight=!!A.festival||!!A.solarTerms}else A=W(i,u,a+g),M.grey=1;M.lunar=A.short,M.custom=A.custom,l.push(M)}s=l.length%7,s=s>0?7-s:0,s>0&&(h=e,f=r+1,f>11&&(f=0,h++));for(let g=1;g<=s;g++){let M=W(h,f,g);l.push({day:(g+"").padStart(2,"0"),lunar:M.short,custom:M.custom,grey:1})}return l}function L2(e,r){var a=`${e}\u5E74${r+1}\u6708${" ".repeat(10)}${n0(e,r)}`;a=v.default.grey("| ")+v.default.cyan(a)+" ".repeat(71-a.length-2)+v.default.grey("|"),console.log(v.default.grey(" "+"_".repeat(76))),console.log(v.default.grey("|"+" ".repeat(76)+"|")),console.log(a),console.log(v.default.grey("|"+"_".repeat(76)+"|")),console.log(G0("|")),console.log(v.default.grey("|")+S2.join("")),console.log(G0("|","_"))}function N2(e,r){var a=T2(e,r),n=0;for(let t=0;t<3*Math.ceil(a.length/7)+1;t++){let s="";for(let o=0;o<7;o++){let l=a[n+o];if(!l)break;switch(o===0&&(s+=I),t%3){case 0:t===0?s+=v.default.grey(" ".repeat(10)+"|"):(s+=v.default.grey("-".repeat(o===6?10:11)+(o===6?"|":"")),o===6&&(n+=7));break;case 1:let i=" ";l.custom&&(l.custom==="\u73ED"?i=v.default.red(l.custom):i=v.default.green.dim(l.custom)),l.picked?s+=" "+v.default.bgBlue.whiteBright.bold(" "+l.day+" ")+i+I:(l.grey?l.day=v.default.grey(l.day):l.weekend?l.day=v.default.redBright.bold(l.day):l.day=v.default.whiteBright.bold(l.day),s+=" ".repeat(4)+l.day+" "+i+I);break;case 2:let u=5,h="",f=" ";l.lunar&&(u=(10-l.lunar.length*2)/2-2),u>=0?h=" ".repeat(u):f=f.slice(0,u),l.picked?s+=f+v.default.bgBlue.white.bold(h+l.lunar+h)+f+I:(l.lunar&&(l.lunar=l.highlight?v.default.cyan.dim(l.lunar):l.weekend?v.default.red.dim(l.lunar):v.default.grey(l.lunar)),s+=" ".repeat(u+2)+l.lunar+" ".repeat(u+2)+I);break}}console.log(s)}console.log("")}function S(e,r){L2(e,r),N2(e,r)}var K0="1.2.4",C=process.argv.slice(2),P=C.shift(),[m,b]=z0();function s0(e){for(let r=0;r<12;r++)S(e,r)}function d(...e){e[0]=e[0].padEnd(20," "),e.length>1&&e.splice(1,0," - "),console.log.apply(null,e)}function B2(){d("=".repeat(64)),d(`\u7EC8\u7AEF\u7248\u4E07\u5E74\u5386 v${K0}, \u4F5C\u8005: \u5B87\u5929`),d("=".repeat(64)),d("\u7528\u6CD5: cal [command] args..."),d("Commands:"),d(" -y {year}","\u6253\u5370\u6307\u5B9A\u5E74\u4EFD\u7684\u65E5\u5386"),d(" -m","\u6253\u5370\u6307\u5B9A\u6708\u4EFD\u7684\u65E5\u5386"),d(" -c","\u5BFC\u5165\u81EA\u5B9A\u4E49\u4F11\u5047\u65E5, \u5FC5\u987B\u662F\u6807\u51C6json\u683C\u5F0F, \u8BED\u6CD5\u770B\u4E0B\u9762\u7684\u793A\u4F8B"),d(" -h","\u67E5\u770B\u5E2E\u52A9\u6587\u6863"),d(" -v",`\u67E5\u770B\u7A0B\u5E8F\u7684\u7248\u672C +`),d("\u793A\u4F8B: "),d(" cal "+R.default.grey("# \u4E0D\u5E26\u53C2\u6570\u6253\u5370\u5F53\u524D\u5E74\u6708")),d(" cal -y "+R.default.grey("# -y \u4E0D\u63A5\u53C2\u6570, \u6253\u5370\u5F53\u524D\u5E74\u7684\u6240\u6709\u6708\u4EFD")),d(" cal -y 2000 "+R.default.grey("# \u6253\u5370\u6307\u5B9A\u5E74\u4EFD\u7684\u6240\u6709\u6708\u4EFD")),d(" cal -y 2021 5 "+R.default.grey("# \u6253\u5370\u6307\u5B9A\u5E74\u4EFD, \u6307\u5B9A\u6708\u4EFD")),d(" cal -y 2000 -m 3 "+R.default.grey("# \u540C\u4E0A")),d(" cal -m 5 "+R.default.grey("# \u6253\u5370\u5F53\u524D\u5E74\u4EFD\u7684 \u6307\u5B9A\u6708\u4EFD")),d(' cal -c {"2021.12.11":"\u73ED","2021.12.12":"\u4F11"} '+R.default.grey("# \u5BFC\u5165\u81EA\u5B9A\u4E49\u4F11\u5047\u65E5")),process.exit()}switch(P){case"-y":switch(C.length){case 0:s0(m);break;case 1:case 2:m=+C.shift(),b=+C.shift(),m===m?b<13&&b>0?S(m,b-1):s0(m):console.log("-y \u53C2\u6570\u5F02\u5E38");break;case 3:P=C.shift(),b=+C.shift(),P==="-m"&&b<13&&b>0?S(m,b-1):console.log("-m \u53C2\u6570\u5F02\u5E38");break;default:console.log("-y \u53C2\u6570\u5F02\u5E38");break}break;case"-m":b=+C.shift(),b<13&&b>0?S(m,b-1):console.log("-m \u53C2\u6570\u5F02\u5E38");break;case"-v":d(K0);break;case"-h":B2();break;case"-c":let e=C.shift();if(e)try{JSON.parse(e),W0.default.writeFileSync($,e),console.log("\u5BFC\u5165\u6210\u529F")}catch{console.log("\u9519\u8BEF\u7684json\u6570\u636E")}else console.log("\u5BFC\u5165\u7684\u6570\u636E\u4E3A\u7A7A");break;default:P?(m=+P,b=+C.shift(),m===m?b<13&&b>0?S(m,b-1):s0(m):console.log("\u53C2\u6570\u5F02\u5E38")):S(m,b);break}process.exit(); diff --git a/package.json b/package.json index bba38d7..c0c849c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "bash-calendar", "description": "终端版万年历", - "version": "1.2.3", + "version": "1.2.4", "author": "yutent ", "bin": { "calendar": "index.js",