openapi-to-ts
Version:
Generate TypeScript types from OpenAPI 3.0 specs.
1 lines • 66.1 kB
JavaScript
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("fs")),n=e(require("http")),r=e(require("https")),i=e(require("os")),o=e(require("tty")),a=e(require("path"));const s=e=>`/**\n * ${e.trim().replace("\n+$","").replace(/\n/g,"\n * ")}\n */\n`,l=()=>s("This file was auto-generated by openapi-to-ts. Do not change it manually!")+"\n",c=e=>e.properties||e.allOf||e.anyOf||e.oneOf||e.items?"INTERFACE":"TYPE",u=e=>new Promise((n,r)=>{t.readFile(e,{encoding:"utf-8"},(t,i)=>{t&&r("Cannot load the file located at: "+e),n(i)})}),p=e=>e?e.slice(e.lastIndexOf("/")+1):"",f=e=>void 0===e?"":e[0].toLocaleUpperCase()+e.slice(1),h=e=>{if(void 0===e)return"";const t=e.toString().trim();if(""===t)return"";if(1===t.length)return t.toLocaleUpperCase();const n=t.match(/[a-zA-Z0-9]+/g);return n?n.map(e=>f(e)).join(""):t},d=e=>e?h(p(e)):"",g=(e,t)=>new Promise(async(i,o)=>{let a=n;0===e.toString().indexOf("https")&&(a=r);let s={};t&&(s={headers:{Authorization:"token "+t}}),a.get(e,s,e=>{e.setEncoding("utf-8");let n="";e.on("data",e=>{n+=e}),e.on("end",()=>{if(200!==e.statusCode){let n=`There was an HTTP error fetching your specification file: ${e.statusCode} ${e.statusMessage}.\n`;t&&(n+="Either the file does not exist, or your personal access token is wrong."),o(n)}else i(n)})}).on("error",()=>{o("Cannot load the file located at: "+e)})}),m=e=>{if(e)return e.$ref?"ref":Array.isArray(e.allOf)?"allOf":Array.isArray(e.anyOf)?"anyOf":Array.isArray(e.oneOf)?"oneOf":Array.isArray(e.enum)?"enum":"array"===e.type||e.items?"array":"string"===e.type?"string":["number","integer"].includes(e.type)?"number":"boolean"===e.type?"boolean":"object"},b=e=>void 0!==e.$ref,y=e=>{const t=m(e),n=["any"];switch(t){case"ref":return[d(e.$ref)];case"allOf":{const t=e.allOf;return t?t.map(e=>""+y(e)):n}case"anyOf":{const t=e.anyOf;return t?t.map(e=>""+y(e)):n}case"oneOf":{const t=e.oneOf;return t?t.map(e=>""+y(e)):n}case"enum":{const t=e.enum;return t?t.map(e=>`'${e}'`):n}case"array":return b(e)?[d(e.$ref)]:e.items?y(e.items):n;case"string":case"number":case"boolean":return[t]||n;case"object":default:return n}},v=e=>`Array<${e.join(" | ")}>`,w=e=>""+e.join(" & "),A=e=>""+e.join(" | "),k=(e,t)=>{switch(t){case"allOf":return w(e);case"anyOf":return w(e.map(e=>`Partial<${e}>`));case"oneOf":case"enum":return A(e);case"array":return v(e);case"ref":case"string":case"number":case"boolean":case"object":default:return""+e[0]||"any"}},x=e=>e?e.replace(/(?:^\w|[A-Z]|\b\w|\s+)/g,(function(e,t){return 0==+e?"":0===t?e.toLowerCase():e.toUpperCase()})):"",C=e=>{let t="";return t+=e.name,e.optional&&(t+="?"),t+=": ",t+=k(e.value,e.valueType),e.nullable&&(t+=" | null"),t+=";",t},O=e=>{let t="";return e.map(e=>{t+=" ",t+=C(e),t+="\n"}),t},j=e=>{let t="";return e.comment&&(t+=s(e.comment)),t+=`export interface ${h(e.name)} {\n`,t+=O(e.properties),t+="}",t},I=e=>{let t="";return e.comment&&(t+=s(e.comment)),t+=`export type ${h(e.name)} = `,t+=k(e.value,e.valueType),t+=";",t};function S(e,t,n){let r;const i=m(e);if(b(e)){const o=n||x(p(e.$ref));r={name:o,nullable:!1,optional:!(null==t?void 0:t.includes(o)),value:y(e),valueType:i||"string"}}else{const o=n||"[key: string]";r={name:o,nullable:e.nullable||!1,optional:!!n&&!(null==t?void 0:t.includes(o)),value:y(e),valueType:i||"string"}}return r}const E=e=>{const t=[];if(e.properties)for(const[n,r]of Object.entries(e.properties))t.push(S(r,e.required,n));return e.items&&(b(e.items)?t.push(S(e.items,e.required,null)):t.push(S(e.items,e.required,e.title||null))),(e.allOf||e.anyOf||e.oneOf)&&(e.allOf||e.anyOf||e.oneOf||[]).map(n=>{b(n)?t.push(S(n,e.required,null)):t.push(S(n,e.required,n.title||null))}),t},M=(e,t)=>({name:e,comment:t.description,properties:E(t)}),T=(e,t)=>{const n=m(t);return{name:e,comment:t.description,value:y(t),valueType:n||"string"}},F=e=>e.map(t=>Object.assign(Object.assign({},t),{name:"I"+t.name,properties:t.properties.map(t=>Object.assign(Object.assign({},t),{value:e.find(e=>t.value.includes(e.name))?t.value.map(e=>"I"+e):t.value}))}));function N(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var _={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]};const L={};for(const e of Object.keys(_))L[_[e]]=e;const R={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"]}};var P=R;for(const e of Object.keys(R)){if(!("channels"in R[e]))throw new Error("missing channels property: "+e);if(!("labels"in R[e]))throw new Error("missing channel labels property: "+e);if(R[e].labels.length!==R[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:n}=R[e];delete R[e].channels,delete R[e].labels,Object.defineProperty(R[e],"channels",{value:t}),Object.defineProperty(R[e],"labels",{value:n})}function $(e){const t=function(){const e={},t=Object.keys(P);for(let n=t.length,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}(),n=[e];for(t[e].distance=0;n.length;){const e=n.pop(),r=Object.keys(P[e]);for(let i=r.length,o=0;o<i;o++){const i=r[o],a=t[i];-1===a.distance&&(a.distance=t[e].distance+1,a.parent=e,n.unshift(i))}}return t}function B(e,t){return function(n){return t(e(n))}}function q(e,t){const n=[t[e].parent,e];let r=P[t[e].parent][e],i=t[e].parent;for(;t[i].parent;)n.unshift(t[i].parent),r=B(P[t[i].parent][i],r),i=t[i].parent;return r.conversion=n,r}R.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=o-i;let s,l;o===i?s=0:t===o?s=(n-r)/a:n===o?s=2+(r-t)/a:r===o&&(s=4+(t-n)/a),s=Math.min(60*s,360),s<0&&(s+=360);const c=(i+o)/2;return l=o===i?0:c<=.5?a/(o+i):a/(2-o-i),[s,100*l,100*c]},R.rgb.hsv=function(e){let t,n,r,i,o;const a=e[0]/255,s=e[1]/255,l=e[2]/255,c=Math.max(a,s,l),u=c-Math.min(a,s,l),p=function(e){return(c-e)/6/u+.5};return 0===u?(i=0,o=0):(o=u/c,t=p(a),n=p(s),r=p(l),a===c?i=r-n:s===c?i=1/3+t-r:l===c&&(i=2/3+n-t),i<0?i+=1:i>1&&(i-=1)),[360*i,100*o,100*c]},R.rgb.hwb=function(e){const t=e[0],n=e[1];let r=e[2];const i=R.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[i,100*o,100*r]},R.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(1-t,1-n,1-r);return[100*((1-t-i)/(1-i)||0),100*((1-n-i)/(1-i)||0),100*((1-r-i)/(1-i)||0),100*i]},R.rgb.keyword=function(e){const t=L[e];if(t)return t;let n,r=1/0;for(const t of Object.keys(_)){const a=(o=_[t],((i=e)[0]-o[0])**2+(i[1]-o[1])**2+(i[2]-o[2])**2);a<r&&(r=a,n=t)}var i,o;return n},R.keyword.rgb=function(e){return _[e]},R.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255;t=t>.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;return[100*(.4124*t+.3576*n+.1805*r),100*(.2126*t+.7152*n+.0722*r),100*(.0193*t+.1192*n+.9505*r)]},R.rgb.lab=function(e){const t=R.rgb.xyz(e);let n=t[0],r=t[1],i=t[2];n/=95.047,r/=100,i/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;return[116*r-16,500*(n-r),200*(r-i)]},R.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let i,o,a;if(0===n)return a=255*r,[a,a,a];i=r<.5?r*(1+n):r+n-r*n;const s=2*r-i,l=[0,0,0];for(let e=0;e<3;e++)o=t+1/3*-(e-1),o<0&&o++,o>1&&o--,a=6*o<1?s+6*(i-s)*o:2*o<1?i:3*o<2?s+(i-s)*(2/3-o)*6:s,l[e]=255*a;return l},R.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,i=n;const o=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=o<=1?o:2-o;return[t,100*(0===r?2*i/(o+i):2*n/(r+n)),100*((r+n)/2)]},R.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const i=Math.floor(t)%6,o=t-Math.floor(t),a=255*r*(1-n),s=255*r*(1-n*o),l=255*r*(1-n*(1-o));switch(r*=255,i){case 0:return[r,l,a];case 1:return[s,r,a];case 2:return[a,r,l];case 3:return[a,s,r];case 4:return[l,a,r];case 5:return[r,a,s]}},R.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,i=Math.max(r,.01);let o,a;a=(2-n)*r;const s=(2-n)*i;return o=n*i,o/=s<=1?s:2-s,o=o||0,a/=2,[t,100*o,100*a]},R.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const i=n+r;let o;i>1&&(n/=i,r/=i);const a=Math.floor(6*t),s=1-r;o=6*t-a,0!=(1&a)&&(o=1-o);const l=n+o*(s-n);let c,u,p;switch(a){default:case 6:case 0:c=s,u=l,p=n;break;case 1:c=l,u=s,p=n;break;case 2:c=n,u=s,p=l;break;case 3:c=n,u=l,p=s;break;case 4:c=l,u=n,p=s;break;case 5:c=s,u=n,p=l}return[255*c,255*u,255*p]},R.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100;return[255*(1-Math.min(1,t*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i))]},R.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let i,o,a;return i=3.2406*t+-1.5372*n+-.4986*r,o=-.9689*t+1.8758*n+.0415*r,a=.0557*t+-.204*n+1.057*r,i=i>.0031308?1.055*i**(1/2.4)-.055:12.92*i,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,a=a>.0031308?1.055*a**(1/2.4)-.055:12.92*a,i=Math.min(Math.max(0,i),1),o=Math.min(Math.max(0,o),1),a=Math.min(Math.max(0,a),1),[255*i,255*o,255*a]},R.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;return[116*n-16,500*(t-n),200*(n-r)]},R.lab.xyz=function(e){let t,n,r;n=(e[0]+16)/116,t=e[1]/500+n,r=n-e[2]/200;const i=n**3,o=t**3,a=r**3;return n=i>.008856?i:(n-16/116)/7.787,t=o>.008856?o:(t-16/116)/7.787,r=a>.008856?a:(r-16/116)/7.787,t*=95.047,n*=100,r*=108.883,[t,n,r]},R.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let i;i=360*Math.atan2(r,n)/2/Math.PI,i<0&&(i+=360);return[t,Math.sqrt(n*n+r*r),i]},R.lch.lab=function(e){const t=e[0],n=e[1],r=e[2]/360*2*Math.PI;return[t,n*Math.cos(r),n*Math.sin(r)]},R.rgb.ansi16=function(e,t=null){const[n,r,i]=e;let o=null===t?R.rgb.hsv(e)[2]:t;if(o=Math.round(o/50),0===o)return 30;let a=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return 2===o&&(a+=60),a},R.hsv.ansi16=function(e){return R.rgb.ansi16(R.hsv.rgb(e),e[2])},R.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];if(t===n&&n===r)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;return 16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},R.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=.5*(1+~~(e>50));return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},R.ansi256.rgb=function(e){if(e>=232){const t=10*(e-232)+8;return[t,t,t]}let t;e-=16;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},R.rgb.hex=function(e){const t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},R.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];3===t[0].length&&(n=n.split("").map(e=>e+e).join(""));const r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},R.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.max(Math.max(t,n),r),o=Math.min(Math.min(t,n),r),a=i-o;let s,l;return s=a<1?o/(1-a):0,l=a<=0?0:i===t?(n-r)/a%6:i===n?2+(r-t)/a:4+(t-n)/a,l/=6,l%=1,[360*l,100*a,100*s]},R.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let i=0;return r<1&&(i=(n-.5*r)/(1-r)),[e[0],100*r,100*i]},R.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=t*n;let i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},R.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;if(0===n)return[255*r,255*r,255*r];const i=[0,0,0],o=t%1*6,a=o%1,s=1-a;let l=0;switch(Math.floor(o)){case 0:i[0]=1,i[1]=a,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=a;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=a,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return l=(1-n)*r,[255*(n*i[0]+l),255*(n*i[1]+l),255*(n*i[2]+l)]},R.hcg.hsv=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);let r=0;return n>0&&(r=t/n),[e[0],100*r,100*n]},R.hcg.hsl=function(e){const t=e[1]/100,n=e[2]/100*(1-t)+.5*t;let r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],100*r,100*n]},R.hcg.hwb=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},R.hwb.hcg=function(e){const t=e[1]/100,n=1-e[2]/100,r=n-t;let i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},R.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},R.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},R.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},R.gray.hsl=function(e){return[0,0,e[0]]},R.gray.hsv=R.gray.hsl,R.gray.hwb=function(e){return[0,100,e[0]]},R.gray.cmyk=function(e){return[0,0,0,e[0]]},R.gray.lab=function(e){return[e[0],0,0]},R.gray.hex=function(e){const t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},R.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};const D={};Object.keys(P).forEach(e=>{D[e]={},Object.defineProperty(D[e],"channels",{value:P[e].channels}),Object.defineProperty(D[e],"labels",{value:P[e].labels});const t=function(e){const t=$(e),n={},r=Object.keys(t);for(let e=r.length,i=0;i<e;i++){const e=r[i];null!==t[e].parent&&(n[e]=q(e,t))}return n}(e);Object.keys(t).forEach(n=>{const r=t[n];D[e][n]=function(e){const t=function(...t){const n=t[0];if(null==n)return n;n.length>1&&(t=n);const r=e(t);if("object"==typeof r)for(let e=r.length,t=0;t<e;t++)r[t]=Math.round(r[t]);return r};return"conversion"in e&&(t.conversion=e.conversion),t}(r),D[e][n].raw=function(e){const t=function(...t){const n=t[0];return null==n?n:(n.length>1&&(t=n),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(r)})});var U=D,Y=function(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return N(null==t&&n.path)}},n.exports),n.exports}((function(e){const t=(e,t)=>(...n)=>`[${e(...n)+t}m`,n=(e,t)=>(...n)=>{const r=e(...n);return`[${38+t};5;${r}m`},r=(e,t)=>(...n)=>{const r=e(...n);return`[${38+t};2;${r[0]};${r[1]};${r[2]}m`},i=e=>e,o=(e,t,n)=>[e,t,n],a=(e,t,n)=>{Object.defineProperty(e,t,{get:()=>{const r=n();return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0}),r},enumerable:!0,configurable:!0})};let s;const l=(e,t,n,r)=>{void 0===s&&(s=U);const i=r?10:0,o={};for(const[r,a]of Object.entries(s)){const s="ansi16"===r?"ansi":r;r===t?o[s]=e(n,i):"object"==typeof a&&(o[s]=e(a[t],i))}return o};Object.defineProperty(e,"exports",{enumerable:!0,get:function(){const e=new Map,s={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]}};s.color.gray=s.color.blackBright,s.bgColor.bgGray=s.bgColor.bgBlackBright,s.color.grey=s.color.blackBright,s.bgColor.bgGrey=s.bgColor.bgBlackBright;for(const[t,n]of Object.entries(s)){for(const[t,r]of Object.entries(n))s[t]={open:`[${r[0]}m`,close:`[${r[1]}m`},n[t]=s[t],e.set(r[0],r[1]);Object.defineProperty(s,t,{value:n,enumerable:!1})}return Object.defineProperty(s,"codes",{value:e,enumerable:!1}),s.color.close="[39m",s.bgColor.close="[49m",a(s.color,"ansi",()=>l(t,"ansi16",i,!1)),a(s.color,"ansi256",()=>l(n,"ansi256",i,!1)),a(s.color,"ansi16m",()=>l(r,"rgb",o,!1)),a(s.bgColor,"ansi",()=>l(t,"ansi16",i,!0)),a(s.bgColor,"ansi256",()=>l(n,"ansi256",i,!0)),a(s.bgColor,"ansi16m",()=>l(r,"rgb",o,!0)),s}})})),G=(e,t=process.argv)=>{const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),i=t.indexOf("--");return-1!==r&&(-1===i||r<i)};const{env:W}=process;let z;function V(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function H(e,t){if(0===z)return 0;if(G("color=16m")||G("color=full")||G("color=truecolor"))return 3;if(G("color=256"))return 2;if(e&&!t&&void 0===z)return 0;const n=z||0;if("dumb"===W.TERM)return n;if("win32"===process.platform){const e=i.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in W)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in W)||"codeship"===W.CI_NAME?1:n;if("TEAMCITY_VERSION"in W)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(W.TEAMCITY_VERSION)?1:0;if("GITHUB_ACTIONS"in W)return 1;if("truecolor"===W.COLORTERM)return 3;if("TERM_PROGRAM"in W){const e=parseInt((W.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(W.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(W.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(W.TERM)||"COLORTERM"in W?1:n}G("no-color")||G("no-colors")||G("color=false")||G("color=never")?z=0:(G("color")||G("colors")||G("color=true")||G("color=always"))&&(z=1),"FORCE_COLOR"in W&&(z="true"===W.FORCE_COLOR?1:"false"===W.FORCE_COLOR?0:0===W.FORCE_COLOR.length?1:Math.min(parseInt(W.FORCE_COLOR,10),3));var K={supportsColor:function(e){return V(H(e,e&&e.isTTY))},stdout:V(H(!0,o.isatty(1))),stderr:V(H(!0,o.isatty(2)))};var Z={stringReplaceAll:(e,t,n)=>{let r=e.indexOf(t);if(-1===r)return e;const i=t.length;let o=0,a="";do{a+=e.substr(o,r-o)+t+n,o=r+i,r=e.indexOf(t,o)}while(-1!==r);return a+=e.substr(o),a},stringEncaseCRLFWithFirstIndex:(e,t,n,r)=>{let i=0,o="";do{const a="\r"===e[r-1];o+=e.substr(i,(a?r-1:r)-i)+t+(a?"\r\n":"\n")+n,i=r+1,r=e.indexOf("\n",i)}while(-1!==r);return o+=e.substr(i),o}};const J=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,Q=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,X=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,ee=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,te=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function ne(e){const t="u"===e[0],n="{"===e[1];return t&&!n&&5===e.length||"x"===e[0]&&3===e.length?String.fromCharCode(parseInt(e.slice(1),16)):t&&n?String.fromCodePoint(parseInt(e.slice(2,-1),16)):te.get(e)||e}function re(e,t){const n=[],r=t.trim().split(/\s*,\s*/g);let i;for(const t of r){const r=Number(t);if(Number.isNaN(r)){if(!(i=t.match(X)))throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`);n.push(i[2].replace(ee,(e,t,n)=>t?ne(t):n))}else n.push(r)}return n}function ie(e){Q.lastIndex=0;const t=[];let n;for(;null!==(n=Q.exec(e));){const e=n[1];if(n[2]){const r=re(e,n[2]);t.push([e].concat(r))}else t.push([e])}return t}function oe(e,t){const n={};for(const e of t)for(const t of e.styles)n[t[0]]=e.inverse?null:t.slice(1);let r=e;for(const[e,t]of Object.entries(n))if(Array.isArray(t)){if(!(e in r))throw new Error("Unknown Chalk style: "+e);r=t.length>0?r[e](...t):r[e]}return r}var ae=(e,t)=>{const n=[],r=[];let i=[];if(t.replace(J,(t,o,a,s,l,c)=>{if(o)i.push(ne(o));else if(s){const t=i.join("");i=[],r.push(0===n.length?t:oe(e,n)(t)),n.push({inverse:a,styles:ie(s)})}else if(l){if(0===n.length)throw new Error("Found extraneous } in Chalk template literal");r.push(oe(e,n)(i.join(""))),i=[],n.pop()}else i.push(c)}),r.push(i.join("")),n.length>0){const e=`Chalk template literal is missing ${n.length} closing bracket${1===n.length?"":"s"} (\`}\`)`;throw new Error(e)}return r.join("")};const{stdout:se,stderr:le}=K,{stringReplaceAll:ce,stringEncaseCRLFWithFirstIndex:ue}=Z,{isArray:pe}=Array,fe=["ansi","ansi","ansi256","ansi16m"],he=Object.create(null);class de{constructor(e){return ge(e)}}const ge=e=>{const t={};return((e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const n=se?se.level:0;e.level=void 0===t.level?n:t.level})(t,e),t.template=(...e)=>xe(t.template,...e),Object.setPrototypeOf(t,me.prototype),Object.setPrototypeOf(t.template,t),t.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},t.template.Instance=de,t.template};function me(e){return ge(e)}for(const[e,t]of Object.entries(Y))he[e]={get(){const n=we(this,ve(t.open,t.close,this._styler),this._isEmpty);return Object.defineProperty(this,e,{value:n}),n}};he.visible={get(){const e=we(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};const be=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const e of be)he[e]={get(){const{level:t}=this;return function(...n){const r=ve(Y.color[fe[t]][e](...n),Y.color.close,this._styler);return we(this,r,this._isEmpty)}}};for(const e of be){he["bg"+e[0].toUpperCase()+e.slice(1)]={get(){const{level:t}=this;return function(...n){const r=ve(Y.bgColor[fe[t]][e](...n),Y.bgColor.close,this._styler);return we(this,r,this._isEmpty)}}}}const ye=Object.defineProperties(()=>{},{...he,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),ve=(e,t,n)=>{let r,i;return void 0===n?(r=e,i=t):(r=n.openAll+e,i=t+n.closeAll),{open:e,close:t,openAll:r,closeAll:i,parent:n}},we=(e,t,n)=>{const r=(...e)=>pe(e[0])&&pe(e[0].raw)?Ae(r,xe(r,...e)):Ae(r,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(r,ye),r._generator=e,r._styler=t,r._isEmpty=n,r},Ae=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let n=e._styler;if(void 0===n)return t;const{openAll:r,closeAll:i}=n;if(-1!==t.indexOf(""))for(;void 0!==n;)t=ce(t,n.close,n.open),n=n.parent;const o=t.indexOf("\n");return-1!==o&&(t=ue(t,i,r,o)),r+t+i};let ke;const xe=(e,...t)=>{const[n]=t;if(!pe(n)||!pe(n.raw))return t.join(" ");const r=t.slice(1),i=[n.raw[0]];for(let e=1;e<n.length;e++)i.push(String(r[e-1]).replace(/[{}\\]/g,"\\$&"),String(n.raw[e]));return void 0===ke&&(ke=ae),ke(e,i.join(""))};Object.defineProperties(me.prototype,he);const Ce=me();Ce.supportsColor=se,Ce.stderr=me({level:le?le.level:0}),Ce.stderr.supportsColor=le;function Oe(e){return null==e}var je={isNothing:Oe,isObject:function(e){return"object"==typeof e&&null!==e},toArray:function(e){return Array.isArray(e)?e:Oe(e)?[]:[e]},repeat:function(e,t){var n,r="";for(n=0;n<t;n+=1)r+=e;return r},isNegativeZero:function(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e},extend:function(e,t){var n,r,i,o;if(t)for(n=0,r=(o=Object.keys(t)).length;n<r;n+=1)e[i=o[n]]=t[i];return e}};function Ie(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}Ie.prototype=Object.create(Error.prototype),Ie.prototype.constructor=Ie,Ie.prototype.toString=function(e){var t=this.name+": ";return t+=this.reason||"(unknown reason)",!e&&this.mark&&(t+=" "+this.mark.toString()),t};var Se=Ie;function Ee(e,t,n,r,i){this.name=e,this.buffer=t,this.position=n,this.line=r,this.column=i}Ee.prototype.getSnippet=function(e,t){var n,r,i,o,a;if(!this.buffer)return null;for(e=e||4,t=t||75,n="",r=this.position;r>0&&-1==="\0\r\n
\u2028\u2029".indexOf(this.buffer.charAt(r-1));)if(r-=1,this.position-r>t/2-1){n=" ... ",r+=5;break}for(i="",o=this.position;o<this.buffer.length&&-1==="\0\r\n
\u2028\u2029".indexOf(this.buffer.charAt(o));)if((o+=1)-this.position>t/2-1){i=" ... ",o-=5;break}return a=this.buffer.slice(r,o),je.repeat(" ",e)+n+a+i+"\n"+je.repeat(" ",e+this.position-r+n.length)+"^"},Ee.prototype.toString=function(e){var t,n="";return this.name&&(n+='in "'+this.name+'" '),n+="at line "+(this.line+1)+", column "+(this.column+1),e||(t=this.getSnippet())&&(n+=":\n"+t),n};var Me=Ee,Te=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],Fe=["scalar","sequence","mapping"];var Ne=function(e,t){if(t=t||{},Object.keys(t).forEach((function(t){if(-1===Te.indexOf(t))throw new Se('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=function(e){var t={};return null!==e&&Object.keys(e).forEach((function(n){e[n].forEach((function(e){t[String(e)]=n}))})),t}(t.styleAliases||null),-1===Fe.indexOf(this.kind))throw new Se('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')};function _e(e,t,n){var r=[];return e.include.forEach((function(e){n=_e(e,t,n)})),e[t].forEach((function(e){n.forEach((function(t,n){t.tag===e.tag&&t.kind===e.kind&&r.push(n)})),n.push(e)})),n.filter((function(e,t){return-1===r.indexOf(t)}))}function Le(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach((function(e){if(e.loadKind&&"scalar"!==e.loadKind)throw new Se("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")})),this.compiledImplicit=_e(this,"implicit",[]),this.compiledExplicit=_e(this,"explicit",[]),this.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{}};function r(e){n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(r);return n}(this.compiledImplicit,this.compiledExplicit)}Le.DEFAULT=null,Le.create=function(){var e,t;switch(arguments.length){case 1:e=Le.DEFAULT,t=arguments[0];break;case 2:e=arguments[0],t=arguments[1];break;default:throw new Se("Wrong number of arguments for Schema.create function")}if(e=je.toArray(e),t=je.toArray(t),!e.every((function(e){return e instanceof Le})))throw new Se("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!t.every((function(e){return e instanceof Ne})))throw new Se("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new Le({include:e,explicit:t})};var Re=Le,Pe=new Re({explicit:[new Ne("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}}),new Ne("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}}),new Ne("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})]});var $e=new Ne("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)},construct:function(){return null},predicate:function(e){return null===e},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"});var Be=new Ne("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function qe(e){return 48<=e&&e<=55}function De(e){return 48<=e&&e<=57}var Ue=new Ne("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,r=e.length,i=0,o=!1;if(!r)return!1;if("-"!==(t=e[i])&&"+"!==t||(t=e[++i]),"0"===t){if(i+1===r)return!0;if("b"===(t=e[++i])){for(i++;i<r;i++)if("_"!==(t=e[i])){if("0"!==t&&"1"!==t)return!1;o=!0}return o&&"_"!==t}if("x"===t){for(i++;i<r;i++)if("_"!==(t=e[i])){if(!(48<=(n=e.charCodeAt(i))&&n<=57||65<=n&&n<=70||97<=n&&n<=102))return!1;o=!0}return o&&"_"!==t}for(;i<r;i++)if("_"!==(t=e[i])){if(!qe(e.charCodeAt(i)))return!1;o=!0}return o&&"_"!==t}if("_"===t)return!1;for(;i<r;i++)if("_"!==(t=e[i])){if(":"===t)break;if(!De(e.charCodeAt(i)))return!1;o=!0}return!(!o||"_"===t)&&(":"!==t||/^(:[0-5]?[0-9])+$/.test(e.slice(i)))},construct:function(e){var t,n,r=e,i=1,o=[];return-1!==r.indexOf("_")&&(r=r.replace(/_/g,"")),"-"!==(t=r[0])&&"+"!==t||("-"===t&&(i=-1),t=(r=r.slice(1))[0]),"0"===r?0:"0"===t?"b"===r[1]?i*parseInt(r.slice(2),2):"x"===r[1]?i*parseInt(r,16):i*parseInt(r,8):-1!==r.indexOf(":")?(r.split(":").forEach((function(e){o.unshift(parseInt(e,10))})),r=0,n=1,o.forEach((function(e){r+=e*n,n*=60})),i*r):i*parseInt(r,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1==0&&!je.isNegativeZero(e)},represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0"+e.toString(8):"-0"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Ye=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var Ge=/^[-+]?[0-9]+e/;var We=new Re({include:[Pe],implicit:[$e,Be,Ue,new Ne("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!Ye.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n,r,i;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,i=[],"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:t.indexOf(":")>=0?(t.split(":").forEach((function(e){i.unshift(parseFloat(e,10))})),t=0,r=1,i.forEach((function(e){t+=e*r,r*=60})),n*t):n*parseFloat(t,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||je.isNegativeZero(e))},represent:function(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(je.isNegativeZero(e))return"-0.0";return n=e.toString(10),Ge.test(n)?n.replace("e",".e"):n},defaultStyle:"lowercase"})]}),ze=new Re({include:[We]}),Ve=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),He=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");var Ke=new Ne("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==Ve.exec(e)||null!==He.exec(e))},construct:function(e){var t,n,r,i,o,a,s,l,c=0,u=null;if(null===(t=Ve.exec(e))&&(t=He.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(o=+t[4],a=+t[5],s=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+="0";c=+c}return t[9]&&(u=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(u=-u)),l=new Date(Date.UTC(n,r,i,o,a,s,c)),u&&l.setTime(l.getTime()-u),l},instanceOf:Date,represent:function(e){return e.toISOString()}});var Ze,Je=new Ne("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}});try{Ze=N("buffer").Buffer}catch(e){}var Qe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";var Xe=new Ne("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,r=0,i=e.length,o=Qe;for(n=0;n<i;n++)if(!((t=o.indexOf(e.charAt(n)))>64)){if(t<0)return!1;r+=6}return r%8==0},construct:function(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,o=Qe,a=0,s=[];for(t=0;t<i;t++)t%4==0&&t&&(s.push(a>>16&255),s.push(a>>8&255),s.push(255&a)),a=a<<6|o.indexOf(r.charAt(t));return 0===(n=i%4*6)?(s.push(a>>16&255),s.push(a>>8&255),s.push(255&a)):18===n?(s.push(a>>10&255),s.push(a>>2&255)):12===n&&s.push(a>>4&255),Ze?Ze.from?Ze.from(s):new Ze(s):s},predicate:function(e){return Ze&&Ze.isBuffer(e)},represent:function(e){var t,n,r="",i=0,o=e.length,a=Qe;for(t=0;t<o;t++)t%3==0&&t&&(r+=a[i>>18&63],r+=a[i>>12&63],r+=a[i>>6&63],r+=a[63&i]),i=(i<<8)+e[t];return 0===(n=o%3)?(r+=a[i>>18&63],r+=a[i>>12&63],r+=a[i>>6&63],r+=a[63&i]):2===n?(r+=a[i>>10&63],r+=a[i>>4&63],r+=a[i<<2&63],r+=a[64]):1===n&&(r+=a[i>>2&63],r+=a[i<<4&63],r+=a[64],r+=a[64]),r}}),et=Object.prototype.hasOwnProperty,tt=Object.prototype.toString;var nt=new Ne("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,i,o,a=[],s=e;for(t=0,n=s.length;t<n;t+=1){if(r=s[t],o=!1,"[object Object]"!==tt.call(r))return!1;for(i in r)if(et.call(r,i)){if(o)return!1;o=!0}if(!o)return!1;if(-1!==a.indexOf(i))return!1;a.push(i)}return!0},construct:function(e){return null!==e?e:[]}}),rt=Object.prototype.toString;var it=new Ne("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(e){if(null===e)return!0;var t,n,r,i,o,a=e;for(o=new Array(a.length),t=0,n=a.length;t<n;t+=1){if(r=a[t],"[object Object]"!==rt.call(r))return!1;if(1!==(i=Object.keys(r)).length)return!1;o[t]=[i[0],r[i[0]]]}return!0},construct:function(e){if(null===e)return[];var t,n,r,i,o,a=e;for(o=new Array(a.length),t=0,n=a.length;t<n;t+=1)r=a[t],i=Object.keys(r),o[t]=[i[0],r[i[0]]];return o}}),ot=Object.prototype.hasOwnProperty;var at=new Re({include:[ze],implicit:[Ke,Je],explicit:[Xe,nt,it,new Ne("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(e){if(null===e)return!0;var t,n=e;for(t in n)if(ot.call(n,t)&&null!==n[t])return!1;return!0},construct:function(e){return null!==e?e:{}}})]});var st=new Ne("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:function(){return!0},construct:function(){},predicate:function(e){return void 0===e},represent:function(){return""}});var lt,ct=new Ne("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:function(e){if(null===e)return!1;if(0===e.length)return!1;var t=e,n=/\/([gim]*)$/.exec(e),r="";if("/"===t[0]){if(n&&(r=n[1]),r.length>3)return!1;if("/"!==t[t.length-r.length-1])return!1}return!0},construct:function(e){var t=e,n=/\/([gim]*)$/.exec(e),r="";return"/"===t[0]&&(n&&(r=n[1]),t=t.slice(1,t.length-r.length-1)),new RegExp(t,r)},predicate:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},represent:function(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}});try{lt=N("esprima")}catch(e){"undefined"!=typeof window&&(lt=window.esprima)}var ut=new Ne("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:function(e){if(null===e)return!1;try{var t="("+e+")",n=lt.parse(t,{range:!0});return"Program"===n.type&&1===n.body.length&&"ExpressionStatement"===n.body[0].type&&("ArrowFunctionExpression"===n.body[0].expression.type||"FunctionExpression"===n.body[0].expression.type)}catch(e){return!1}},construct:function(e){var t,n="("+e+")",r=lt.parse(n,{range:!0}),i=[];if("Program"!==r.type||1!==r.body.length||"ExpressionStatement"!==r.body[0].type||"ArrowFunctionExpression"!==r.body[0].expression.type&&"FunctionExpression"!==r.body[0].expression.type)throw new Error("Failed to resolve function");return r.body[0].expression.params.forEach((function(e){i.push(e.name)})),t=r.body[0].expression.body.range,"BlockStatement"===r.body[0].expression.body.type?new Function(i,n.slice(t[0]+1,t[1]-1)):new Function(i,"return "+n.slice(t[0],t[1]))},predicate:function(e){return"[object Function]"===Object.prototype.toString.call(e)},represent:function(e){return e.toString()}}),pt=Re.DEFAULT=new Re({include:[at],explicit:[st,ct,ut]}),ft=Object.prototype.hasOwnProperty,ht=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,dt=/[\x85\u2028\u2029]/,gt=/[,\[\]\{\}]/,mt=/^(?:!|!!|![a-z\-]+!)$/i,bt=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function yt(e){return Object.prototype.toString.call(e)}function vt(e){return 10===e||13===e}function wt(e){return 9===e||32===e}function At(e){return 9===e||32===e||10===e||13===e}function kt(e){return 44===e||91===e||93===e||123===e||125===e}function xt(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+10:-1}function Ct(e){return 48===e?"\0":97===e?"":98===e?"\b":116===e||9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"
":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function Ot(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}for(var jt=new Array(256),It=new Array(256),St=0;St<256;St++)jt[St]=Ct(St)?1:0,It[St]=Ct(St);function Et(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||pt,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function Mt(e,t){return new Se(t,new Me(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function Tt(e,t){throw Mt(e,t)}function Ft(e,t){e.onWarning&&e.onWarning.call(null,Mt(e,t))}var Nt={YAML:function(e,t,n){var r,i,o;null!==e.version&&Tt(e,"duplication of %YAML directive"),1!==n.length&&Tt(e,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&Tt(e,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),o=parseInt(r[2],10),1!==i&&Tt(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,1!==o&&2!==o&&Ft(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var r,i;2!==n.length&&Tt(e,"TAG directive accepts exactly two arguments"),r=n[0],i=n[1],mt.test(r)||Tt(e,"ill-formed tag handle (first argument) of the TAG directive"),ft.call(e.tagMap,r)&&Tt(e,'there is a previously declared suffix for "'+r+'" tag handle'),bt.test(i)||Tt(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagMap[r]=i}};function _t(e,t,n,r){var i,o,a,s;if(t<n){if(s=e.input.slice(t,n),r)for(i=0,o=s.length;i<o;i+=1)9===(a=s.charCodeAt(i))||32<=a&&a<=1114111||Tt(e,"expected valid JSON character");else ht.test(s)&&Tt(e,"the stream contains non-printable characters");e.result+=s}}function Lt(e,t,n,r){var i,o,a,s;for(je.isObject(n)||Tt(e,"cannot merge mappings; the provided source object is unacceptable"),a=0,s=(i=Object.keys(n)).length;a<s;a+=1)o=i[a],ft.call(t,o)||(t[o]=n[o],r[o]=!0)}function Rt(e,t,n,r,i,o,a,s){var l,c;if(Array.isArray(i))for(l=0,c=(i=Array.prototype.slice.call(i)).length;l<c;l+=1)Array.isArray(i[l])&&Tt(e,"nested arrays are not supported inside keys"),"object"==typeof i&&"[object Object]"===yt(i[l])&&(i[l]="[object Object]");if("object"==typeof i&&"[object Object]"===yt(i)&&(i="[object Object]"),i=String(i),null===t&&(t={}),"tag:yaml.org,2002:merge"===r)if(Array.isArray(o))for(l=0,c=o.length;l<c;l+=1)Lt(e,t,o[l],n);else Lt(e,t,o,n);else e.json||ft.call(n,i)||!ft.call(t,i)||(e.line=a||e.line,e.position=s||e.position,Tt(e,"duplicated mapping key")),t[i]=o,delete n[i];return t}function Pt(e){var t;10===(t=e.input.charCodeAt(e.position))?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):Tt(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function $t(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);0!==i;){for(;wt(i);)i=e.input.charCodeAt(++e.position);if(t&&35===i)do{i=e.input.charCodeAt(++e.position)}while(10!==i&&13!==i&&0!==i);if(!vt(i))break;for(Pt(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;32===i;)e.lineIndent++,i=e.input.charCodeAt(++e.position)}return-1!==n&&0!==r&&e.lineIndent<n&&Ft(e,"deficient indentation"),r}function Bt(e){var t,n=e.position;return!(45!==(t=e.input.charCodeAt(n))&&46!==t||t!==e.input.charCodeAt(n+1)||t!==e.input.charCodeAt(n+2)||(n+=3,0!==(t=e.input.charCodeAt(n))&&!At(t)))}function qt(e,t){1===t?e.result+=" ":t>1&&(e.result+=je.repeat("\n",t-1))}function Dt(e,t){var n,r,i=e.tag,o=e.anchor,a=[],s=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),r=e.input.charCodeAt(e.position);0!==r&&45===r&&At(e.input.charCodeAt(e.position+1));)if(s=!0,e.position++,$t(e,!0,-1)&&e.lineIndent<=t)a.push(null),r=e.input.charCodeAt(e.position);else if(n=e.line,Gt(e,t,3,!1,!0),a.push(e.result),$t(e,!0,-1),r=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==r)Tt(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break;return!!s&&(e.tag=i,e.anchor=o,e.kind="sequence",e.result=a,!0)}function Ut(e){var t,n,r,i,o=!1,a=!1;if(33!==(i=e.input.charCodeAt(e.position)))return!1;if(null!==e.tag&&Tt(e,"duplication of a tag property"),60===(i=e.input.charCodeAt(++e.position))?(o=!0,i=e.input.charCodeAt(++e.position)):33===i?(a=!0,n="!!",i=e.input.charCodeAt(++e.position)):n="!",t=e.position,o){do{i=e.input.charCodeAt(++e.position)}while(0!==i&&62!==i);e.position<e.length?(r=e.input.slice(t,e.position),i=e.input.charCodeAt(++e.position)):Tt(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==i&&!At(i);)33===i&&(a?Tt(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),mt.test(n)||Tt(e,"named tag handle cannot contain such characters"),a=!0,t=e.position+1)),i=e.input.charCodeAt(++e.position);r=e.input.slice(t,e.position),gt.test(r)&&Tt(e,"tag suffix cannot contain flow indicator characters")}return r&&!bt.test(r)&&Tt(e,"tag name cannot contain such characters: "+r),o?e.tag=r:ft.call(e.tagMap,n)?e.tag=e.tagMap[n]+r:"!"===n?e.tag="!"+r:"!!"===n?e.tag="tag:yaml.org,2002:"+r:Tt(e,'undeclared tag handle "'+n+'"'),!0}function Yt(e){var t,n;if(38!==(n=e.input.charCodeAt(e.position)))return!1;for(null!==e.anchor&&Tt(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!At(n)&&!kt(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&Tt(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Gt(e,t,n,r,i){var o,a,s,l,c,u,p,f,h=1,d=!1,g=!1;if(null!==e.listener&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=a=s=4===n||3===n,r&&$t(e,!0,-1)&&(d=!0,e.lineIndent>t?h=1:e.lineIndent===t?h=0:e.lineIndent<t&&(h=-1)),1===h)for(;Ut(e)||Yt(e);)$t(e,!0,-1)?(d=!0,s=o,e.lineIndent>t?h=1:e.lineIndent===t?h=0:e.lineIndent<t&&(h=-1)):s=!1;if(s&&(s=d||i),1!==h&&4!==n||(p=1===n||2===n?t:t+1,f=e.position-e.lineStart,1===h?s&&(Dt(e,f)||function(e,t,n){var r,i,o,a,s,l=e.tag,c=e.anchor,u={},p={},f=null,h=null,d=null,g=!1,m=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=u),s=e.input.charCodeAt(e.position);0!==s;){if(r=e.input.charCodeAt(e.position+1),o=e.line,a=e.position,63!==s&&58!==s||!At(r)){if(!Gt(e,n,2,!1,!0))break;if(e.line===o){for(s=e.input.charCodeAt(e.position);wt(s);)s=e.input.charCodeAt(++e.position);if(58===s)At(s=e.input.charCodeAt(++e.position))||Tt(e,"a whitespace character is expected after the key-value separator within a block mapping"),g&&(Rt(e,u,p,f,h,null),f=h=d=null),m=!0,g=!1,i=!1,f=e.tag,h=e.result;else{if(!m)return e.tag=l,e.anchor=c,!0;Tt(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!m)return e.tag=l,e.anchor=c,!0;Tt(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===s?(g&&(Rt(e,u,p,f,h,null),f=h=d=null),m=!0,g=!0,i=!0):g?(g=!1,i=!0):Tt(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,s=r;if((e.line===o||e.lineIndent>t)&&(Gt(e,t,4,!0,i)&&(g?h=e.result:d=e.result),g||(Rt(e,u,p,f,h,d,o,a),f=h=d=null),$t(e,!0,-1),s=e.input.charCodeAt(e.position)),e.lineIndent>t&&0!==s)Tt(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return g&&Rt(e,u,p,f,h,null),m&&(e.tag=l,e.anchor=c,e.kind="mapping",e.result=u),m}(e,f,p))||function(e,t){var n,r,i,o,a,s,l,c,u,p,f=!0,h=e.tag,d=e.anchor,g={};if(91===(p=e.input.charCodeAt(e.position)))i=93,s=!1,r=[];else{if(123!==p)return!1;i=125,s=!0,r={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=r),p=e.input.charCodeAt(++e.position);0!==p;){if($t(e,!0,t),(p=e.input.charCodeAt(e.position))===i)return e.position++,e.tag=h,e.anchor=d,e.kind=s?"mapping":"sequence",e.result=r,!0;f||Tt(e,"missed comma between flow collection entries"),u=null,o=a=!1,63===p&&At(e.input.charCodeAt(e.position+1))&&(o=a=!0,e.position++,$t(e,!0,t)),n=e.line,Gt(e,t,1,!1,!0),c=e.tag,l=e.result,$t(e,!0,t),p=e.input.charCodeAt(e.position),!a&&e.line!==n||58!==p||(o=!0,p=e.input.charCodeAt(++e.position),$t(e,!0,t),Gt(e,t,1,!1,!0),u=e.result),s?Rt(e,r,g,c,l,u):o?r.push(Rt(e,null,g,c,l,u)):r.push(l),$t(e,!0,t),44===(p=e.input.charCodeAt(e.position))?(f=!0,p=e.input.charCodeAt(++e.position)):f=!1}Tt(e,"unexpected end of the stream within a flow collection")}(e,p)?g=!0:(a&&function(e,t){var n,r,i,o,a,s=1,l=!1,c=!1,u=t,p=0,f=!1;if(124===(o=e.input.charCodeAt(e.position)))r=!1;else{if(62!==o)return!1;r=!0}for(e.kind="scalar",e.result="";0!==o;)if(43===(o=e.input.charCodeAt(++e.position))||45===o)1===s?s=43===o?3:2:Tt(e,"repeat of a chomping mode identifier");else{if(!((i=48<=(a=o)&&a<=57?a-48:-1)>=0))break;0===i?Tt(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?Tt(e,"repeat of an indentation width identifier"):(u=t+i-1,c=!0)}if(wt(o)){do{o=e.input.charCodeAt(++e.position)}while(wt(o));if(35===o)do{o=e.input.charCodeAt(++e.position)}while(!vt(o)&&0!==o)}for(;0!==o;){for(Pt(e),e.lineIndent=0,o=e.input.charCodeAt(e.position);(!c||e.lineIndent<u)&&32===o;)e.lineIndent++,o=e.input.charCodeAt(++e.position);if(!c&&e.lineIndent>u&&(u=e.lineIndent),vt(o))p++;else{if(e.lineIndent<u){3===s?e.result+=je.repeat("\n",l?1+p:p):1===s&&