yata-fetch 2.2.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +67 -0
- package/package.json +2 -1
- package/.editorconfig +0 -10
- package/.github/workflows/publish.yaml +0 -34
- package/.github/workflows/test.yaml +0 -43
- package/.prettierignore +0 -15
- package/.prettierrc +0 -9
- package/.tool-versions +0 -2
- package/eslint.config.js +0 -26
- package/src/cli.ts +0 -48
- package/src/log.ts +0 -22
- package/src/vite-env.d.ts +0 -1
- package/src/yata.ts +0 -153
- package/test/fixtures/yata.json +0 -9
- package/test/unit/yata.spec.js +0 -111
- package/tsconfig.json +0 -21
- package/vite.config.js +0 -15
package/dist/cli.cjs
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,i=(e,t)=>()=>(e&&(t=e(e=0)),t),a=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),o=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},s=(i,a,o,s)=>{if(a&&typeof a==`object`||typeof a==`function`)for(var c=n(a),l=0,u=c.length,d;l<u;l++)d=c[l],!r.call(i,d)&&d!==o&&e(i,d,{get:(e=>a[e]).bind(null,d),enumerable:!(s=t(a,d))||s.enumerable});return i},c=t=>r.call(t,`module.exports`)?t[`module.exports`]:s(e({},`__esModule`,{value:!0}),t);function l(e,t){let n;switch(e){case`red`:n=`\x1B[31m`;break;case`green`:n=`\x1B[32m`;break;case`yellow`:n=`\x1B[33m`;break;default:n=`\x1B[37m`}return console.log(`${n}%s\x1b[0m`,t)}var u=a(((e,t)=>{t.exports={}})),d=u(),f=u(),p=u(),m={config:null,defaultConfigPath:`./yata.json`,configPath:``,token:``,project:``,locales:[],format:`yml`,root:!1,outputPath:`translations`,stripEmpty:!1,apiHost:``,getConfigPath(e){return e?this.configPath=e:this.configPath=this.defaultConfigPath,this.configPath},validateConfig(e,t,n,r,i,a,o){if(e)this.token=e;else throw Error("No `token` in ENV");if(t)this.project=t;else throw Error("No `project` in config file");if(!Array.isArray(n)||n.length===0)throw Error("No `locales` in config file");return this.locales=n,r&&typeof r==`string`&&(this.format=r),i&&typeof i==`boolean`&&(this.root=i),a&&typeof a==`string`&&(this.outputPath=a),o&&typeof o==`boolean`&&(this.stripEmpty=o),!0},normalizeLocale(e){if(!e)return;let t=e.replace(`-`,`_`).split(`_`),n=[];return n.push(t[0].toLowerCase()),t[1]&&n.push(t[1].toUpperCase()),n.join(`_`)},downloadTranslation(e){let t=this.normalizeLocale(e);if(!t)throw Error(`No locale passed to download function`);p.existsSync(this.outputPath)||p.mkdirSync(this.outputPath);let n=`${t}.${this.format}`,r=f.join(process.cwd(),`${this.outputPath}/${n}`),i=`${this.apiHost}/api/v1/project/${this.project}/${e}/${this.format}?apiToken=${this.token}&root=${this.root}&strip_empty=${this.stripEmpty}`,a;p.existsSync(r)&&(a=p.readFileSync(r));let o=p.createWriteStream(r);return new Promise((t,n)=>{d.get(i,i=>{let{statusCode:s}=i;if(s!==200)return n(`Request Failed.\nStatus Code: ${s}`);i.pipe(o),o.on(`finish`,()=>{let n=p.readFileSync(r);a&&a.equals(n)?l(`yellow`,`Generating "${e}" translation. Skipped.`):l(`green`,`Generating "${e}" translation. Done.`),t(!0)})}).on(`error`,e=>{e instanceof Error?l(`red`,e.message):typeof e==`string`&&l(`red`,e)})})}},h=o({all:()=>$t,allLimit:()=>en,allSeries:()=>tn,any:()=>bn,anyLimit:()=>xn,anySeries:()=>Sn,apply:()=>g,applyEach:()=>jt,applyEachSeries:()=>Nt,asyncify:()=>b,auto:()=>z,autoInject:()=>le,cargo:()=>U,cargoQueue:()=>ue,compose:()=>K,concat:()=>Ut,concatLimit:()=>Ht,concatSeries:()=>Wt,constant:()=>me,default:()=>Dn,detect:()=>Gt,detectLimit:()=>Kt,detectSeries:()=>qt,dir:()=>Jt,doDuring:()=>Yt,doUntil:()=>be,doWhilst:()=>Yt,during:()=>Tn,each:()=>Xt,eachLimit:()=>Zt,eachOf:()=>Z,eachOfLimit:()=>kt,eachOfSeries:()=>Q,eachSeries:()=>Qt,ensureAsync:()=>Te,every:()=>$t,everyLimit:()=>en,everySeries:()=>tn,filter:()=>nn,filterLimit:()=>rn,filterSeries:()=>an,find:()=>Gt,findLimit:()=>Kt,findSeries:()=>qt,flatMap:()=>Ut,flatMapLimit:()=>Ht,flatMapSeries:()=>Wt,foldl:()=>Bt,foldr:()=>Ze,forEach:()=>Xt,forEachLimit:()=>Zt,forEachOf:()=>Z,forEachOfLimit:()=>kt,forEachOfSeries:()=>Q,forEachSeries:()=>Qt,forever:()=>on,groupBy:()=>Le,groupByLimit:()=>sn,groupBySeries:()=>Re,inject:()=>Bt,log:()=>cn,map:()=>At,mapLimit:()=>Vt,mapSeries:()=>Mt,mapValues:()=>Be,mapValuesLimit:()=>ln,mapValuesSeries:()=>Ve,memoize:()=>He,nextTick:()=>dn,parallel:()=>Ue,parallelLimit:()=>We,priorityQueue:()=>Ye,queue:()=>Ge,race:()=>mn,reduce:()=>Bt,reduceRight:()=>Ze,reflect:()=>Qe,reflectAll:()=>$e,reject:()=>hn,rejectLimit:()=>gn,rejectSeries:()=>_n,retry:()=>at,retryable:()=>st,select:()=>nn,selectLimit:()=>rn,selectSeries:()=>an,seq:()=>G,series:()=>ct,setImmediate:()=>Y,some:()=>bn,someLimit:()=>xn,someSeries:()=>Sn,sortBy:()=>Cn,timeout:()=>pt,times:()=>gt,timesLimit:()=>ht,timesSeries:()=>_t,transform:()=>vt,tryEach:()=>wn,unmemoize:()=>bt,until:()=>St,waterfall:()=>En,whilst:()=>Tn,wrapSync:()=>b});function g(e,...t){return(...n)=>e(...t,...n)}function _(e){return function(...t){var n=t.pop();return e.call(this,t,n)}}function v(e){setTimeout(e,0)}function y(e){return(t,...n)=>e(()=>t(...n))}function b(e){return S(e)?function(...t){let n=t.pop();return ee(e.apply(this,t),n)}:_(function(t,n){var r;try{r=e.apply(this,t)}catch(e){return n(e)}if(r&&typeof r.then==`function`)return ee(r,n);n(null,r)})}function ee(e,t){return e.then(e=>{x(t,null,e)},e=>{x(t,e&&(e instanceof Error||e.message)?e:Error(e))})}function x(e,t,n){try{e(t,n)}catch(e){Y(e=>{throw e},e)}}function S(e){return e[Symbol.toStringTag]===`AsyncFunction`}function C(e){return e[Symbol.toStringTag]===`AsyncGenerator`}function w(e){return typeof e[Symbol.asyncIterator]==`function`}function T(e){if(typeof e!=`function`)throw Error(`expected a function`);return S(e)?b(e):e}function E(e,t){if(t||=e.length,!t)throw Error(`arity is undefined`);function n(...n){return typeof n[t-1]==`function`?e.apply(this,n):new Promise((r,i)=>{n[t-1]=(e,...t)=>{if(e)return i(e);r(t.length>1?t:t[0])},e.apply(this,n)})}return n}function D(e){return function(t,...n){return E(function(r){var i=this;return e(t,(e,t)=>{T(e).apply(i,n.concat(t))},r)})}}function O(e,t,n,r){t||=[];var i=[],a=0,o=T(n);return e(t,(e,t,n)=>{var r=a++;o(e,(e,t)=>{i[r]=t,n(e)})},e=>{r(e,i)})}function k(e){return e&&typeof e.length==`number`&&e.length>=0&&e.length%1==0}function A(e){function t(...t){if(e!==null){var n=e;e=null,n.apply(this,t)}}return Object.assign(t,e),t}function te(e){return e[Symbol.iterator]&&e[Symbol.iterator]()}function j(e){var t=-1,n=e.length;return function(){return++t<n?{value:e[t],key:t}:null}}function ne(e){var t=-1;return function(){var n=e.next();return n.done?null:(t++,{value:n.value,key:t})}}function M(e){var t=e?Object.keys(e):[],n=-1,r=t.length;return function i(){var a=t[++n];return a===`__proto__`?i():n<r?{value:e[a],key:a}:null}}function N(e){if(k(e))return j(e);var t=te(e);return t?ne(t):M(e)}function P(e){return function(...t){if(e===null)throw Error(`Callback was already called.`);var n=e;e=null,n.apply(this,t)}}function F(e,t,n,r){let i=!1,a=!1,o=!1,s=0,c=0;function l(){s>=t||o||i||(o=!0,e.next().then(({value:e,done:t})=>{if(!(a||i)){if(o=!1,t){i=!0,s<=0&&r(null);return}s++,n(e,c,u),c++,l()}}).catch(d))}function u(e,t){if(--s,!a){if(e)return d(e);if(e===!1){i=!0,a=!0;return}if(t===Ot||i&&s<=0)return i=!0,r(null);l()}}function d(e){a||(o=!1,i=!0,r(e))}l()}function re(e,t,n,r){return X(t)(e,T(n),r)}function ie(e,t,n){n=A(n);var r=0,i=0,{length:a}=e,o=!1;a===0&&n(null);function s(e,t){e===!1&&(o=!0),o!==!0&&(e?n(e):(++i===a||t===Ot)&&n(null))}for(;r<a;r++)t(e[r],r,P(s))}function ae(e,t,n){return kt(e,1/0,t,n)}function oe(e,t,n){return(k(e)?ie:ae)(e,T(t),n)}function I(e,t,n){return O(Z,e,t,n)}function L(e,t,n){return kt(e,1,t,n)}function R(e,t,n){return O(Q,e,t,n)}function se(){let e,t;function n(n,...r){if(n)return t(n);e(r.length>1?r:r[0])}return n[Pt]=new Promise((n,r)=>{e=n,t=r}),n}function z(e,t,n){typeof t!=`number`&&(n=t,t=null),n=A(n||se());var r=Object.keys(e).length;if(!r)return n(null);t||=r;var i={},a=0,o=!1,s=!1,c=Object.create(null),l=[],u=[],d={};Object.keys(e).forEach(t=>{var n=e[t];if(!Array.isArray(n)){f(t,[n]),u.push(t);return}var r=n.slice(0,n.length-1),i=r.length;if(i===0){f(t,n),u.push(t);return}d[t]=i,r.forEach(a=>{if(!e[a])throw Error("async.auto task `"+t+"` has a non-existent dependency `"+a+"` in "+r.join(`, `));m(a,()=>{i--,i===0&&f(t,n)})})}),_(),p();function f(e,t){l.push(()=>g(e,t))}function p(){if(!o){if(l.length===0&&a===0)return n(null,i);for(;l.length&&a<t;)l.shift()()}}function m(e,t){var n=c[e];n||=c[e]=[],n.push(t)}function h(e){(c[e]||[]).forEach(e=>e()),p()}function g(e,t){if(!s){var r=P((t,...r)=>{if(a--,t===!1){o=!0;return}if(r.length<2&&([r]=r),t){var l={};if(Object.keys(i).forEach(e=>{l[e]=i[e]}),l[e]=r,s=!0,c=Object.create(null),o)return;n(t,l)}else i[e]=r,h(e)});a++;var l=T(t[t.length-1]);t.length>1?l(i,r):l(r)}}function _(){for(var e,t=0;u.length;)e=u.pop(),t++,v(e).forEach(e=>{--d[e]===0&&u.push(e)});if(t!==r)throw Error(`async.auto cannot execute tasks due to a recursive dependency`)}function v(t){var n=[];return Object.keys(e).forEach(r=>{let i=e[r];Array.isArray(i)&&i.indexOf(t)>=0&&n.push(r)}),n}return n[Pt]}function B(e){let t=``,n=0,r=e.indexOf(`*/`);for(;n<e.length;)if(e[n]===`/`&&e[n+1]===`/`){let t=e.indexOf(`
|
|
2
|
+
`,n);n=t===-1?e.length:t}else if(r!==-1&&e[n]===`/`&&e[n+1]===`*`){let i=e.indexOf(`*/`,n);i===-1?(t+=e[n],n++):(n=i+2,r=e.indexOf(`*/`,n))}else t+=e[n],n++;return t}function ce(e){let t=B(e.toString()),n=t.match(Ft);if(n||=t.match(It),!n)throw Error(`could not parse args in autoInject
|
|
3
|
+
Source:
|
|
4
|
+
`+t);let[,r]=n;return r.replace(/\s/g,``).split(Lt).map(e=>e.replace(Rt,``).trim())}function le(e,t){var n={};return Object.keys(e).forEach(t=>{var r=e[t],i,a=S(r),o=!a&&r.length===1||a&&r.length===0;if(Array.isArray(r))i=[...r],r=i.pop(),n[t]=i.concat(i.length>0?s:r);else if(o)n[t]=r;else{if(i=ce(r),r.length===0&&!a&&i.length===0)throw Error(`autoInject task functions require explicit parameters.`);a||i.pop(),n[t]=i.concat(s)}function s(e,t){var n=i.map(t=>e[t]);n.push(t),T(r)(...n)}}),z(n,t)}function V(e,t){e.length=1,e.head=e.tail=t}function H(e,t,n){if(t==null)t=1;else if(t===0)throw RangeError(`Concurrency must not be zero`);var r=T(e),i=0,a=[];let o={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function s(e,t){o[e].push(t)}function c(e,t){let n=(...r)=>{l(e,n),t(...r)};o[e].push(n)}function l(e,t){if(!e)return Object.keys(o).forEach(e=>o[e]=[]);if(!t)return o[e]=[];o[e]=o[e].filter(e=>e!==t)}function u(e,...t){o[e].forEach(e=>e(...t))}var d=!1;function f(e,t,n,r){if(r!=null&&typeof r!=`function`)throw Error(`task callback must be a function`);_.started=!0;var i,a;function o(e,...t){if(e)return n?a(e):i();if(t.length<=1)return i(t[0]);i(t)}var s=_._createTaskItem(e,n?o:r||o);if(t?_._tasks.unshift(s):_._tasks.push(s),d||(d=!0,Y(()=>{d=!1,_.process()})),n||!r)return new Promise((e,t)=>{i=e,a=t})}function p(e){return function(t,...n){--i;for(var r=0,o=e.length;r<o;r++){var s=e[r],c=a.indexOf(s);c===0?a.shift():c>0&&a.splice(c,1),s.callback(t,...n),t!=null&&u(`error`,t,s.data)}i<=_.concurrency-_.buffer&&u(`unsaturated`),_.idle()&&u(`drain`),_.process()}}function m(e){return e.length===0&&_.idle()?(Y(()=>u(`drain`)),!0):!1}let h=e=>t=>{if(!t)return new Promise((t,n)=>{c(e,(e,r)=>{if(e)return n(e);t(r)})});l(e),s(e,t)};var g=!1,_={_tasks:new zt,_createTaskItem(e,t){return{data:e,callback:t}},*[Symbol.iterator](){yield*_._tasks[Symbol.iterator]()},concurrency:t,payload:n,buffer:t/4,started:!1,paused:!1,push(e,t){return Array.isArray(e)?m(e)?void 0:e.map(e=>f(e,!1,!1,t)):f(e,!1,!1,t)},pushAsync(e,t){return Array.isArray(e)?m(e)?void 0:e.map(e=>f(e,!1,!0,t)):f(e,!1,!0,t)},kill(){l(),_._tasks.empty()},unshift(e,t){return Array.isArray(e)?m(e)?void 0:e.map(e=>f(e,!0,!1,t)):f(e,!0,!1,t)},unshiftAsync(e,t){return Array.isArray(e)?m(e)?void 0:e.map(e=>f(e,!0,!0,t)):f(e,!0,!0,t)},remove(e){_._tasks.remove(e)},process(){if(!g){for(g=!0;!_.paused&&i<_.concurrency&&_._tasks.length;){var e=[],t=[],n=_._tasks.length;_.payload&&(n=Math.min(n,_.payload));for(var o=0;o<n;o++){var s=_._tasks.shift();e.push(s),a.push(s),t.push(s.data)}i+=1,_._tasks.length===0&&u(`empty`),i===_.concurrency&&u(`saturated`),r(t,P(p(e)))}g=!1}},length(){return _._tasks.length},running(){return i},workersList(){return a},idle(){return _._tasks.length+i===0},pause(){_.paused=!0},resume(){_.paused!==!1&&(_.paused=!1,Y(_.process))}};return Object.defineProperties(_,{saturated:{writable:!1,value:h(`saturated`)},unsaturated:{writable:!1,value:h(`unsaturated`)},empty:{writable:!1,value:h(`empty`)},drain:{writable:!1,value:h(`drain`)},error:{writable:!1,value:h(`error`)}}),_}function U(e,t){return H(e,1,t)}function ue(e,t,n){return H(e,t,n)}function W(e,t,n,r){r=A(r);var i=T(n);return Q(e,(e,n,r)=>{i(t,e,(e,n)=>{t=n,r(e)})},e=>r(e,t))}function G(...e){var t=e.map(T);return function(...e){var n=this,r=e[e.length-1];return typeof r==`function`?e.pop():r=se(),Bt(t,e,(e,t,r)=>{t.apply(n,e.concat((e,...t)=>{r(e,t)}))},(e,t)=>r(e,...t)),r[Pt]}}function K(...e){return G(...e.reverse())}function de(e,t,n,r){return O(X(t),e,n,r)}function q(e,t,n,r){var i=T(n);return Vt(e,t,(e,t)=>{i(e,(e,...n)=>e?t(e):t(e,n))},(e,t)=>{for(var n=[],i=0;i<t.length;i++)t[i]&&(n=n.concat(...t[i]));return r(e,n)})}function fe(e,t,n){return Ht(e,1/0,t,n)}function pe(e,t,n){return Ht(e,1,t,n)}function me(...e){return function(...t){return t.pop()(null,...e)}}function J(e,t){return(n,r,i,a)=>{var o=!1,s;let c=T(i);n(r,(n,r,i)=>{c(n,(r,a)=>{if(r||r===!1)return i(r);if(e(a)&&!s)return o=!0,s=t(!0,n),i(null,Ot);i()})},e=>{if(e)return a(e);a(null,o?s:t(!1))})}}function he(e,t,n){return J(e=>e,(e,t)=>t)(Z,e,t,n)}function ge(e,t,n,r){return J(e=>e,(e,t)=>t)(X(t),e,n,r)}function _e(e,t,n){return J(e=>e,(e,t)=>t)(X(1),e,t,n)}function ve(e){return(t,...n)=>T(t)(...n,(t,...n)=>{typeof console==`object`&&(t?console.error&&console.error(t):console[e]&&n.forEach(t=>console[e](t)))})}function ye(e,t,n){n=P(n);var r=T(e),i=T(t),a;function o(e,...t){if(e)return n(e);e!==!1&&(a=t,i(...t,s))}function s(e,t){if(e)return n(e);if(e!==!1){if(!t)return n(null,...a);r(o)}}return s(null,!0)}function be(e,t,n){let r=T(t);return Yt(e,(...e)=>{let t=e.pop();r(...e,(e,n)=>t(e,!n))},n)}function xe(e){return(t,n,r)=>e(t,r)}function Se(e,t,n){return Z(e,xe(T(t)),n)}function Ce(e,t,n,r){return X(t)(e,xe(T(n)),r)}function we(e,t,n){return Zt(e,1,t,n)}function Te(e){return S(e)?e:function(...t){var n=t.pop(),r=!0;t.push((...e)=>{r?Y(()=>n(...e)):n(...e)}),e.apply(this,t),r=!1}}function Ee(e,t,n){return J(e=>!e,e=>!e)(Z,e,t,n)}function De(e,t,n,r){return J(e=>!e,e=>!e)(X(t),e,n,r)}function Oe(e,t,n){return J(e=>!e,e=>!e)(Q,e,t,n)}function ke(e,t,n,r){var i=Array(t.length);e(t,(e,t,r)=>{n(e,(e,n)=>{i[t]=!!n,r(e)})},e=>{if(e)return r(e);for(var n=[],a=0;a<t.length;a++)i[a]&&n.push(t[a]);r(null,n)})}function Ae(e,t,n,r){var i=[];e(t,(e,t,r)=>{n(e,(n,a)=>{if(n)return r(n);a&&i.push({index:t,value:e}),r(n)})},e=>{if(e)return r(e);r(null,i.sort((e,t)=>e.index-t.index).map(e=>e.value))})}function je(e,t,n,r){return(k(t)?ke:Ae)(e,t,T(n),r)}function Me(e,t,n){return je(Z,e,t,n)}function Ne(e,t,n,r){return je(X(t),e,n,r)}function Pe(e,t,n){return je(Q,e,t,n)}function Fe(e,t){var n=P(t),r=T(Te(e));function i(e){if(e)return n(e);e!==!1&&r(i)}return i()}function Ie(e,t,n,r){var i=T(n);return Vt(e,t,(e,t)=>{i(e,(n,r)=>n?t(n):t(n,{key:r,val:e}))},(e,t)=>{for(var n={},{hasOwnProperty:i}=Object.prototype,a=0;a<t.length;a++)if(t[a]){var{key:o}=t[a],{val:s}=t[a];i.call(n,o)?n[o].push(s):n[o]=[s]}return r(e,n)})}function Le(e,t,n){return sn(e,1/0,t,n)}function Re(e,t,n){return sn(e,1,t,n)}function ze(e,t,n,r){r=A(r);var i={},a=T(n);return X(t)(e,(e,t,n)=>{a(e,t,(e,r)=>{if(e)return n(e);i[t]=r,n(e)})},e=>r(e,i))}function Be(e,t,n){return ln(e,1/0,t,n)}function Ve(e,t,n){return ln(e,1,t,n)}function He(e,t=e=>e){var n=Object.create(null),r=Object.create(null),i=T(e),a=_((e,a)=>{var o=t(...e);o in n?Y(()=>a(null,...n[o])):o in r?r[o].push(a):(r[o]=[a],i(...e,(e,...t)=>{e||(n[o]=t);var i=r[o];delete r[o];for(var a=0,s=i.length;a<s;a++)i[a](e,...t)}))});return a.memo=n,a.unmemoized=e,a}function Ue(e,t){return fn(Z,e,t)}function We(e,t,n){return fn(X(t),e,n)}function Ge(e,t){var n=T(e);return H((e,t)=>{n(e[0],t)},t,1)}function Ke(e){return(e<<1)+1}function qe(e){return(e+1>>1)-1}function Je(e,t){return e.priority===t.priority?e.pushCount<t.pushCount:e.priority<t.priority}function Ye(e,t){var n=Ge(e,t),{push:r,pushAsync:i}=n;n._tasks=new pn,n._createTaskItem=({data:e,priority:t},n)=>({data:e,priority:t,callback:n});function a(e,t){return Array.isArray(e)?e.map(e=>({data:e,priority:t})):{data:e,priority:t}}return n.push=function(e,t=0,n){return r(a(e,t),n)},n.pushAsync=function(e,t=0,n){return i(a(e,t),n)},delete n.unshift,delete n.unshiftAsync,n}function Xe(e,t){if(t=A(t),!Array.isArray(e))return t(TypeError(`First argument to race must be an array of functions`));if(!e.length)return t();for(var n=0,r=e.length;n<r;n++)T(e[n])(t)}function Ze(e,t,n,r){return Bt([...e].reverse(),t,n,r)}function Qe(e){var t=T(e);return _(function(e,n){return e.push((e,...t)=>{let r={};if(e&&(r.error=e),t.length>0){var i=t;t.length<=1&&([i]=t),r.value=i}n(null,r)}),t.apply(this,e)})}function $e(e){var t;return Array.isArray(e)?t=e.map(Qe):(t={},Object.keys(e).forEach(n=>{t[n]=Qe.call(this,e[n])})),t}function et(e,t,n,r){let i=T(n);return je(e,t,(e,t)=>{i(e,(e,n)=>{t(e,!n)})},r)}function tt(e,t,n){return et(Z,e,t,n)}function nt(e,t,n,r){return et(X(t),e,n,r)}function rt(e,t,n){return et(Q,e,t,n)}function it(e){return function(){return e}}function at(e,t,n){var r={times:vn,intervalFunc:it(yn)};if(arguments.length<3&&typeof e==`function`?(n=t||se(),t=e):(ot(r,e),n||=se()),typeof t!=`function`)throw Error(`Invalid arguments for async.retry`);var i=T(t),a=1;function o(){i((e,...t)=>{e!==!1&&(e&&a++<r.times&&(typeof r.errorFilter!=`function`||r.errorFilter(e))?setTimeout(o,r.intervalFunc(a-1)):n(e,...t))})}return o(),n[Pt]}function ot(e,t){if(typeof t==`object`)e.times=+t.times||vn,e.intervalFunc=typeof t.interval==`function`?t.interval:it(+t.interval||yn),e.errorFilter=t.errorFilter;else if(typeof t==`number`||typeof t==`string`)e.times=+t||vn;else throw Error(`Invalid arguments for async.retry`)}function st(e,t){t||(t=e,e=null);let n=e&&e.arity||t.length;S(t)&&(n+=1);var r=T(t);return _((t,i)=>{(t.length<n-1||i==null)&&(t.push(i),i=se());function a(e){r(...t,e)}return e?at(e,a,i):at(a,i),i[Pt]})}function ct(e,t){return fn(Q,e,t)}function lt(e,t,n){return J(Boolean,e=>e)(Z,e,t,n)}function ut(e,t,n,r){return J(Boolean,e=>e)(X(t),e,n,r)}function dt(e,t,n){return J(Boolean,e=>e)(Q,e,t,n)}function ft(e,t,n){var r=T(t);return At(e,(e,t)=>{r(e,(n,r)=>{if(n)return t(n);t(n,{value:e,criteria:r})})},(e,t)=>{if(e)return n(e);n(null,t.sort(i).map(e=>e.value))});function i(e,t){var n=e.criteria,r=t.criteria;return n<r?-1:+(n>r)}}function pt(e,t,n){var r=T(e);return _((i,a)=>{var o=!1,s;function c(){var t=e.name||`anonymous`,r=Error(`Callback function "`+t+`" timed out.`);r.code=`ETIMEDOUT`,n&&(r.info=n),o=!0,a(r)}i.push((...e)=>{o||(a(...e),clearTimeout(s))}),s=setTimeout(c,t),r(...i)})}function mt(e){for(var t=Array(e);e--;)t[e]=e;return t}function ht(e,t,n,r){var i=T(n);return Vt(mt(e),t,i,r)}function gt(e,t,n){return ht(e,1/0,t,n)}function _t(e,t,n){return ht(e,1,t,n)}function vt(e,t,n,r){arguments.length<=3&&typeof t==`function`&&(r=n,n=t,t=Array.isArray(e)?[]:{}),r=A(r||se());var i=T(n);return Z(e,(e,n,r)=>{i(t,e,n,r)},e=>r(e,t)),r[Pt]}function yt(e,t){var n=null,r;return Qt(e,(e,t)=>{T(e)((e,...i)=>{if(e===!1)return t(e);i.length<2?[r]=i:r=i,n=e,t(e?null:{})})},()=>t(n,r))}function bt(e){return(...t)=>(e.unmemoized||e)(...t)}function xt(e,t,n){n=P(n);var r=T(t),i=T(e),a=[];function o(e,...t){if(e)return n(e);a=t,e!==!1&&i(s)}function s(e,t){if(e)return n(e);if(e!==!1){if(!t)return n(null,...a);r(o)}}return i(s)}function St(e,t,n){let r=T(e);return Tn(e=>r((t,n)=>e(t,!n)),t,n)}function Ct(e,t){if(t=A(t),!Array.isArray(e))return t(Error(`First argument to waterfall must be an array of functions`));if(!e.length)return t();var n=0;function r(t){T(e[n++])(...t,P(i))}function i(i,...a){if(i!==!1){if(i||n===e.length)return t(i,...a);r(a)}}r([])}var wt,Tt,Et,Dt,Y,Ot,X,kt,Z,At,jt,Q,Mt,Nt,Pt,Ft,It,Lt,Rt,zt,Bt,Vt,Ht,Ut,Wt,Gt,Kt,qt,Jt,Yt,Xt,Zt,Qt,$t,en,tn,nn,rn,an,on,sn,cn,ln,un,dn,fn,pn,mn,hn,gn,_n,vn,yn,bn,xn,Sn,Cn,wn,Tn,En,Dn,On=i((()=>{wt=typeof queueMicrotask==`function`&&queueMicrotask,Tt=typeof setImmediate==`function`&&setImmediate,Et=typeof process==`object`&&typeof process.nextTick==`function`,Dt=wt?queueMicrotask:Tt?setImmediate:Et?process.nextTick:v,Y=y(Dt),Ot={},X=e=>(t,n,r)=>{if(r=A(r),e<=0)throw RangeError(`concurrency limit cannot be less than 1`);if(!t)return r(null);if(C(t))return F(t,e,n,r);if(w(t))return F(t[Symbol.asyncIterator](),e,n,r);var i=N(t),a=!1,o=!1,s=0,c=!1;function l(e,t){if(!o)if(--s,e)a=!0,r(e);else if(e===!1)a=!0,o=!0;else if(t===Ot||a&&s<=0)return a=!0,r(null);else c||u()}function u(){for(c=!0;s<e&&!a;){var t=i();if(t===null){a=!0,s<=0&&r(null);return}s+=1,n(t.value,t.key,P(l))}c=!1}u()},kt=E(re,4),Z=E(oe,3),At=E(I,3),jt=D(At),Q=E(L,3),Mt=E(R,3),Nt=D(Mt),Pt=Symbol(`promiseCallback`),Ft=/^(?:async\s)?(?:function)?\s*(?:\w+\s*)?\(([^)]+)\)(?:\s*{)/,It=/^(?:async\s)?\s*(?:\(\s*)?((?:[^)=\s]\s*)*)(?:\)\s*)?=>/,Lt=/,/,Rt=/(=.+)?(\s*)$/,zt=class{constructor(){this.head=this.tail=null,this.length=0}removeLink(e){return e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev,e.prev=e.next=null,--this.length,e}empty(){for(;this.head;)this.shift();return this}insertAfter(e,t){t.prev=e,t.next=e.next,e.next?e.next.prev=t:this.tail=t,e.next=t,this.length+=1}insertBefore(e,t){t.prev=e.prev,t.next=e,e.prev?e.prev.next=t:this.head=t,e.prev=t,this.length+=1}unshift(e){this.head?this.insertBefore(this.head,e):V(this,e)}push(e){this.tail?this.insertAfter(this.tail,e):V(this,e)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){for(var e=this.head;e;)yield e.data,e=e.next}remove(e){for(var t=this.head;t;){var{next:n}=t;e(t)&&this.removeLink(t),t=n}return this}},Bt=E(W,4),Vt=E(de,4),Ht=E(q,4),Ut=E(fe,3),Wt=E(pe,3),Gt=E(he,3),Kt=E(ge,4),qt=E(_e,3),Jt=ve(`dir`),Yt=E(ye,3),Xt=E(Se,3),Zt=E(Ce,4),Qt=E(we,3),$t=E(Ee,3),en=E(De,4),tn=E(Oe,3),nn=E(Me,3),rn=E(Ne,4),an=E(Pe,3),on=E(Fe,2),sn=E(Ie,4),cn=ve(`log`),ln=E(ze,4),un=Et?process.nextTick:Tt?setImmediate:v,dn=y(un),fn=E((e,t,n)=>{var r=k(t)?[]:{};e(t,(e,t,n)=>{T(e)((e,...i)=>{i.length<2&&([i]=i),r[t]=i,n(e)})},e=>n(e,r))},3),pn=class{constructor(){this.heap=[],this.pushCount=-(2**53-1)}get length(){return this.heap.length}empty(){return this.heap=[],this}percUp(e){let t;for(;e>0&&Je(this.heap[e],this.heap[t=qe(e)]);){let n=this.heap[e];this.heap[e]=this.heap[t],this.heap[t]=n,e=t}}percDown(e){let t;for(;(t=Ke(e))<this.heap.length&&(t+1<this.heap.length&&Je(this.heap[t+1],this.heap[t])&&(t+=1),!Je(this.heap[e],this.heap[t]));){let n=this.heap[e];this.heap[e]=this.heap[t],this.heap[t]=n,e=t}}push(e){e.pushCount=++this.pushCount,this.heap.push(e),this.percUp(this.heap.length-1)}unshift(e){return this.heap.push(e)}shift(){let[e]=this.heap;return this.heap[0]=this.heap[this.heap.length-1],this.heap.pop(),this.percDown(0),e}toArray(){return[...this]}*[Symbol.iterator](){for(let e=0;e<this.heap.length;e++)yield this.heap[e].data}remove(e){let t=0;for(let n=0;n<this.heap.length;n++)e(this.heap[n])||(this.heap[t]=this.heap[n],t++);this.heap.splice(t);for(let e=qe(this.heap.length-1);e>=0;e--)this.percDown(e);return this}},mn=E(Xe,2),hn=E(tt,3),gn=E(nt,4),_n=E(rt,3),vn=5,yn=0,bn=E(lt,3),xn=E(ut,4),Sn=E(dt,3),Cn=E(ft,3),wn=E(yt),Tn=E(xt,3),En=E(Ct),Dn={apply:g,applyEach:jt,applyEachSeries:Nt,asyncify:b,auto:z,autoInject:le,cargo:U,cargoQueue:ue,compose:K,concat:Ut,concatLimit:Ht,concatSeries:Wt,constant:me,detect:Gt,detectLimit:Kt,detectSeries:qt,dir:Jt,doUntil:be,doWhilst:Yt,each:Xt,eachLimit:Zt,eachOf:Z,eachOfLimit:kt,eachOfSeries:Q,eachSeries:Qt,ensureAsync:Te,every:$t,everyLimit:en,everySeries:tn,filter:nn,filterLimit:rn,filterSeries:an,forever:on,groupBy:Le,groupByLimit:sn,groupBySeries:Re,log:cn,map:At,mapLimit:Vt,mapSeries:Mt,mapValues:Be,mapValuesLimit:ln,mapValuesSeries:Ve,memoize:He,nextTick:dn,parallel:Ue,parallelLimit:We,priorityQueue:Ye,queue:Ge,race:mn,reduce:Bt,reduceRight:Ze,reflect:Qe,reflectAll:$e,reject:hn,rejectLimit:gn,rejectSeries:_n,retry:at,retryable:st,seq:G,series:ct,setImmediate:Y,some:bn,someLimit:xn,someSeries:Sn,sortBy:Cn,timeout:pt,times:gt,timesLimit:ht,timesSeries:_t,transform:vt,tryEach:wn,unmemoize:bt,until:St,waterfall:En,whilst:Tn,all:$t,allLimit:en,allSeries:tn,any:bn,anyLimit:xn,anySeries:Sn,find:Gt,findLimit:Kt,findSeries:qt,flatMap:Ut,flatMapLimit:Ht,flatMapSeries:Wt,forEach:Xt,forEachSeries:Qt,forEachLimit:Zt,forEachOf:Z,forEachOfSeries:Q,forEachOfLimit:kt,inject:Bt,foldl:Bt,foldr:Ze,select:nn,selectLimit:rn,selectSeries:an,wrapSync:b,during:Tn,doDuring:Yt}})),kn=a(((e,t)=>{var{hasOwnProperty:n}=Object.prototype,r=typeof process<`u`&&process.platform===`win32`?`\r
|
|
5
|
+
`:`
|
|
6
|
+
`,i=(e,t)=>{let n=[],o=``;typeof t==`string`?t={section:t,whitespace:!1}:(t||=Object.create(null),t.whitespace=t.whitespace===!0);let s=t.whitespace?` = `:`=`;for(let t of Object.keys(e)){let i=e[t];if(i&&Array.isArray(i))for(let e of i)o+=c(t+`[]`)+s+c(e)+`
|
|
7
|
+
`;else i&&typeof i==`object`?n.push(t):o+=c(t)+s+c(i)+r}t.section&&o.length&&(o=`[`+c(t.section)+`]`+r+o);for(let s of n){let n=a(s).join(`\\.`),c=(t.section?t.section+`.`:``)+n,{whitespace:l}=t,u=i(e[s],{section:c,whitespace:l});o.length&&u.length&&(o+=r),o+=u}return o},a=e=>e.replace(/\1/g,`LITERAL\\1LITERAL`).replace(/\\\./g,``).split(/\./).map(e=>e.replace(/\1/g,`\\.`).replace(/\2LITERAL\\1LITERAL\2/g,``)),o=e=>{let t=Object.create(null),r=t,i=null,o=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,s=e.split(/[\r\n]+/g);for(let e of s){if(!e||e.match(/^\s*[;#]/))continue;let a=e.match(o);if(!a)continue;if(a[1]!==void 0){if(i=l(a[1]),i===`__proto__`){r=Object.create(null);continue}r=t[i]=t[i]||Object.create(null);continue}let s=l(a[2]),c=s.length>2&&s.slice(-2)===`[]`,u=c?s.slice(0,-2):s;if(u===`__proto__`)continue;let d=a[3]?l(a[4]):!0,f=d===`true`||d===`false`||d===`null`?JSON.parse(d):d;c&&(n.call(r,u)?Array.isArray(r[u])||(r[u]=[r[u]]):r[u]=[]),Array.isArray(r[u])?r[u].push(f):r[u]=f}let c=[];for(let e of Object.keys(t)){if(!n.call(t,e)||typeof t[e]!=`object`||Array.isArray(t[e]))continue;let r=a(e),i=t,o=r.pop(),s=o.replace(/\\\./g,`.`);for(let e of r)e!==`__proto__`&&((!n.call(i,e)||typeof i[e]!=`object`)&&(i[e]=Object.create(null)),i=i[e]);i===t&&s===o||(i[s]=t[e],c.push(e))}for(let e of c)delete t[e];return t},s=e=>e.charAt(0)===`"`&&e.slice(-1)===`"`||e.charAt(0)===`'`&&e.slice(-1)===`'`,c=e=>typeof e!=`string`||e.match(/[=\r\n]/)||e.match(/^\[/)||e.length>1&&s(e)||e!==e.trim()?JSON.stringify(e):e.replace(/;/g,`\\;`).replace(/#/g,`\\#`),l=(e,t)=>{if(e=(e||``).trim(),s(e)){e.charAt(0)===`'`&&(e=e.substr(1,e.length-2));try{e=JSON.parse(e)}catch{}}else{let t=!1,n=``;for(let r=0,i=e.length;r<i;r++){let i=e.charAt(r);if(t)`\\;#`.indexOf(i)===-1?n+=`\\`+i:n+=i,t=!1;else if(`;#`.indexOf(i)!==-1)break;else i===`\\`?t=!0:n+=i}return t&&(n+=`\\`),n.trim()}return e};t.exports={parse:o,decode:o,stringify:i,encode:i,safe:c,unsafe:l}})),An=a((e=>{var t=kn(),n=e;n.json={stringify:function(e,t,n){return JSON.stringify(e,t||null,n||2)},parse:JSON.parse},n.ini=t})),jn=a((e=>{var t=Mn(),n=e.Memory=function(e){e||={},this.type=`memory`,this.store={},this.mtimes={},this.readOnly=!1,this.loadFrom=e.loadFrom||null,this.logicalSeparator=e.logicalSeparator||`:`,this.parseValues=e.parseValues||!1,this.loadFrom&&(this.store=t.loadFilesSync(this.loadFrom))};n.prototype.get=function(e){for(var n=this.store,r=t.path(e,this.logicalSeparator);r.length>0;){if(e=r.shift(),n&&typeof n!=`string`&&Object.hasOwnProperty.call(n,e)){n=n[e];continue}return}return n},n.prototype.set=function(e,n){if(this.readOnly)return!1;var r=this.store,i=t.path(e,this.logicalSeparator);if(i.length===0)return!n||typeof n!=`object`?!1:(this.reset(),this.store=n,!0);for(this.mtimes[e]=Date.now();i.length>1;)e=i.shift(),(!r[e]||typeof r[e]!=`object`||!Object.hasOwnProperty.call(r,e))&&(r[e]={}),r=r[e];return e=i.shift(),this.parseValues&&(n=t.parseValues.call(t,n)),r[e]=n,!0},n.prototype.clear=function(e){if(this.readOnly)return!1;var n=this.store,r=n,i=t.path(e,this.logicalSeparator);delete this.mtimes[e];for(var a=0;a<i.length-1;a++){if(e=i[a],r=n[e],typeof r!=`function`&&typeof r!=`object`)return!1;n=r}return e=i[a],delete n[e],!0},n.prototype.merge=function(e,n){if(this.readOnly)return!1;if(typeof n!=`object`||Array.isArray(n)||n===null)return this.set(e,n);var r=this,i=this.store,a=t.path(e,this.logicalSeparator),o=e;for(this.mtimes[e]=Date.now();a.length>1;)e=a.shift(),i[e]||(i[e]={}),i=i[e];return e=a.shift(),typeof i[e]!=`object`||Array.isArray(i[e])?(i[e]=n,!0):Object.keys(n).every(function(e){return r.merge(t.keyed(r.logicalSeparator,o,e),n[e])})},n.prototype.reset=function(){return this.readOnly?!1:(this.mtimes={},this.store={},!0)},n.prototype.loadSync=function(){return this.store||{}}})),Mn=a((e=>{var t=u(),n=(On(),c(h)),r=An(),i=jn().Memory,a=e;a.path=function(e,t){return t||=`:`,e==null?[]:e.split(t)},a.key=function(){return Array.prototype.slice.call(arguments).join(`:`)},a.keyed=function(){return Array.prototype.slice.call(arguments,1).join(arguments[0])},a.loadFiles=function(e,i){if(!e)return i(null,{});var o=Array.isArray(e)?{files:e}:e;o.format=o.format||r.json;function s(e,n){t.readFile(e,function(e,t){return e?n(e):n(null,o.format.parse(t.toString()))})}n.map(o.files,s,function(e,t){return e?i(e):i(null,a.merge(t))})},a.loadFilesSync=function(e){if(e){var n=Array.isArray(e)?{files:e}:e;return n.format=n.format||r.json,a.merge(n.files.map(function(e){return n.format.parse(t.readFileSync(e,`utf8`))}))}},a.merge=function(e){var t=new i;return e.forEach(function(e){Object.keys(e).forEach(function(n){t.merge(n,e[n])})}),t.store},a.capitalize=function(e){return e&&e[0].toUpperCase()+e.slice(1)},a.parseValues=function(e){var t=e;try{t=JSON.parse(e)}catch{e===`undefined`&&(t=void 0)}return t},a.transform=function(e,t){return Object.keys(e).map(function(n){var r={key:n,value:e[n]},i=t.call(null,r);if(!i)return null;if(i.key)return i;var a=Error(`Transform function passed to store returned an invalid format: `+JSON.stringify(i));throw a.name=`RuntimeError`,a}).filter(function(e){return e!==null}).reduce(function(e,t){return e[t.key]=t.value,e},{})}})),Nn=a((e=>{var t=(On(),c(h)),n=Mn(),r=e.Provider=function(e){e||={},this.stores={},this.sources=[],this.init(e)};[`argv`,`env`].forEach(function(e){r.prototype[e]=function(){var t=[e].concat(Array.prototype.slice.call(arguments));return this.add.apply(this,t)}}),r.prototype.file=function(e,t){return arguments.length==1?(t=typeof e==`string`?{file:e}:e,e=`file`):t=typeof t==`string`?{file:t}:t,t.type=`file`,this.add(e,t)},[`defaults`,`overrides`].forEach(function(e){r.prototype[e]=function(t){return t||={},t.type||=`literal`,this.add(e,t)}}),r.prototype.use=function(e,t){t||={};function n(e){return Object.keys(t).every(function(n){return t[n]===e[n]})}var r=this.stores[e],i=r&&!n(r);return(!r||i)&&(i&&this.remove(e),this.add(e,t)),this},r.prototype.add=function(e,t,r){t||={};var i=t.type||e;if(!yr()[n.capitalize(i)])throw Error(`Cannot add store with unknown type: `+i);return this.stores[e]=this.create(i,t,r),this.stores[e].loadSync&&this.stores[e].loadSync(),this},r.prototype.remove=function(e){return delete this.stores[e],this},r.prototype.create=function(e,t,r){return new(yr())[n.capitalize(e.toLowerCase())](t,r)},r.prototype.init=function(e){var t=this;e.type?this.add(e.type,e):e.store?this.add(e.store.name||e.store.type,e.store):e.stores&&Object.keys(e.stores).forEach(function(n){var r=e.stores[n];t.add(r.name||n||r.type,r)}),e.source?this.sources.push(this.create(e.source.type||e.source.name,e.source)):e.sources&&Object.keys(e.sources).forEach(function(n){var r=e.sources[n];t.sources.push(t.create(r.type||r.name||n,r))})},r.prototype.get=function(e,r){if(typeof e==`function`&&(r=e,e=null),!r)return this._execute(`get`,1,e,r);var i=0,a=Object.keys(this.stores),o=this,s,c=[];t.whilst(function(e){e(null,s===void 0&&i<a.length)},function(t){var n=o.stores[a[i]];if(i++,n.get.length>=2)return n.get(e,function(e,n){if(e)return t(e);s=n,s&&typeof s==`object`&&!Array.isArray(s)&&(c.push(s),s=void 0),t()});s=n.get(e),s&&typeof s==`object`&&!Array.isArray(s)&&(c.push(s),s=void 0),t()},function(e){return!e&&c.length&&(s=n.merge(c.reverse())),e?r(e):r(null,s)})},r.prototype.any=function(e,n){if(Array.isArray(e)||(e=Array.prototype.slice.call(arguments),n=e.length>0&&typeof e[e.length-1]==`function`?e.pop():null),!n){for(var r,i=0;i<e.length;++i)if(r=this._execute(`get`,1,e[i],n),r)return r;return null}var a=0,o,s=this;t.whilst(function(t){t(null,!o&&a<e.length)},function(t){var n=e[a];a++,s.get(n,function(e,n){e?t(e):(o=n,t())})},function(e){return e?n(e):n(null,o)})},r.prototype.set=function(e,t,n){return this._execute(`set`,2,e,t,n)},r.prototype.required=function(e){if(!Array.isArray(e))throw Error(`Incorrect parameter, array expected`);var t=[];if(e.forEach(function(e){this.get(e)===void 0&&t.push(e)},this),t.length)throw Error(`Missing required keys: `+t.join(`, `));return!0},r.prototype.reset=function(e){return this._execute(`reset`,0,e)},r.prototype.clear=function(e,t){return this._execute(`clear`,1,e,t)},r.prototype.merge=function(){var e=this,n=Array.prototype.slice.call(arguments),r=typeof n[n.length-1]==`function`&&n.pop(),a=n.pop(),o=n.pop();function s(t,n){return e._execute(`merge`,2,t,a[t],n)}return o?this._execute(`merge`,2,o,a,r):Array.isArray(a)||typeof a!=`object`?i(Error(`Cannot merge non-Object into top-level.`),r):t.forEach(Object.keys(a),s,r||function(){})},r.prototype.load=function(e){var r=this;function i(){var e=Object.keys(r.stores);return e.reverse(),e.map(function(e){return r.stores[e]})}function a(e){if(!e.loadSync)throw Error(`nconf store `+e.type+` has no loadSync() method`);return e.loadSync()}function o(e,t){return!e.load&&!e.loadSync?t(Error(`nconf store `+e.type+` has no load() method`)):e.loadSync?t(null,e.loadSync()):e.load(t)}function s(e,r){if(!r)return n.merge(e.map(a));t.map(e,o,function(e,t){return e?r(e):r(null,n.merge(t))})}function c(e){e&&typeof e==`object`&&r.use(`sources`,{type:`literal`,store:e})}function l(){var t=r.sources.splice(0);if(t.reverse(),!e)return c(s(t)),s(i());s(t,function(t,n){return t?e(t):(c(n),s(i(),e))})}return r.sources.length?l():s(i(),e)},r.prototype.save=function(e,r){!r&&typeof e==`function`&&(r=e,e=null);var i=this,a=Object.keys(this.stores);function o(e,t){var n=i.stores[t];if(n.saveSync){var r=n.saveSync();typeof r==`object`&&r&&e.push(r)}return e}function s(t,n,r){var a=i.stores[n];if(a.save)return a.save(e,function(e,n){if(e)return r(e);typeof n==`object`&&n&&t.push(n),r(null,t)});a.saveSync&&t.push(a.saveSync()),r(null,t)}if(!r)return n.merge(a.reduce(o,[]));t.reduce(a,[],s,function(e,t){return e?r(e):r(null,n.merge(t))})},r.prototype._execute=function(e,r){var i=Array.prototype.slice.call(arguments,2),a=typeof i[i.length-1]==`function`&&i.pop(),o=[`set`,`clear`,`merge`,`reset`].indexOf(e)!==-1,s=this,c,l=[],u=Object.keys(this.stores);function d(t,n){var a=s.stores[t];return o&&a.readOnly?n():a[e].length>r?a[e].apply(a,i.concat(n)):n(null,a[e].apply(a,i))}return a?t.forEach(u,d,function(e){return e?a(e):a()}):(u.forEach(function(t){if(c===void 0){var n=s.stores[t];if(o&&n.readOnly)return;c=n[e].apply(n,i),c&&e===`get`&&typeof c==`object`&&!Array.isArray(c)&&(l.push(c),c=void 0)}}),l.length&&(c=n.merge(l.reverse())),c)};function i(e,t){if(t)return t(e);throw e}})),Pn=o({author:()=>Rn,contributors:()=>zn,default:()=>qn,dependencies:()=>Hn,description:()=>In,devDependencies:()=>Un,engines:()=>Kn,keywords:()=>Vn,license:()=>`MIT`,main:()=>Wn,name:()=>Fn,repository:()=>Bn,scripts:()=>Gn,version:()=>Ln}),Fn,In,Ln,Rn,zn,Bn,Vn,Hn,Un,Wn,Gn,Kn,qn,Jn=i((()=>{Fn=`nconf`,In=`Hierarchical node.js configuration with files, environment variables, command-line arguments, and atomic object merging.`,Ln=`0.13.0`,Rn=`Charlie Robbins <charlie.robbins@gmail.com>`,zn=[`Matt Hamann <matthew.hamann@gmail.com>`,`Maciej Małecki <me@mmalecki.com>`,`Jarrett Cruger <jcrugzz@gmail.com>`,`Adrien Becchis`],Bn={type:`git`,url:`http://github.com/flatiron/nconf.git`},Vn=[`configuration`,`key value store`,`plugabble`],Hn={async:`^3.0.0`,ini:`^2.0.0`,"secure-keys":`^1.0.0`,yargs:`^16.1.1`},Un={"@release-it/conventional-changelog":`^7.0.2`,coveralls:`^3.1.0`,eslint:`^7.0.0`,"nconf-yaml":`^1.0.2`,nyc:`^15.1.0`,"release-it":`^16.2.1`,vows:`^0.8.3`},Wn=`./lib/nconf`,Gn={test:`vows test/*-test.js test/**/*-test.js --spec`,cover:`nyc --reporter=lcov npm test`,coveralls:`cat coverage/lcov.info | coveralls`,lint:`eslint .`,release:`release-it`},Kn={node:`>= 0.4.0`},qn={name:Fn,description:In,version:Ln,author:Rn,contributors:zn,repository:Bn,keywords:Vn,dependencies:Hn,devDependencies:Un,main:Wn,scripts:Gn,engines:Kn,license:`MIT`}})),Yn=a(((e,t)=>{var n=u(),r=u(),i=u(),a,o=class{constructor(e){e||={},this.directory=e.directory||`./locales`,this.updateFiles=typeof e.updateFiles==`boolean`?e.updateFiles:!0,this.locale=e.locale||`en`,this.fallbackToLanguage=typeof e.fallbackToLanguage==`boolean`?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!=`string`)return this._taggedLiteral(arguments[0],...arguments);let t=e.shift(),n=function(){};return typeof e[e.length-1]==`function`&&(n=e.pop()),n||=function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]=t,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),a.format.apply(a.format,[this.cache[this.locale][t]||t].concat(e))}__n(){let e=Array.prototype.slice.call(arguments),t=e.shift(),n=e.shift(),r=e.shift(),i=function(){};typeof e[e.length-1]==`function`&&(i=e.pop()),this.cache[this.locale]||this._readLocaleFile();let o=r===1?t:n;this.cache[this.locale][t]&&(o=this.cache[this.locale][t][r===1?`one`:`other`]),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]={one:t,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:i})):i();let s=[o];return~o.indexOf(`%d`)&&s.push(r),a.format.apply(a.format,s.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this.cache[this.locale][t]=e[t])}_taggedLiteral(e,...t){let n=``;return e.forEach(function(e,r){let i=t[r+1];n+=e,i!==void 0&&(n+=`%s`)}),this.__.apply(this,[n].concat([].slice.call(t,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let e=this,t=this.writeQueue[0],n=t.directory,r=t.locale,i=t.cb,o=this._resolveLocaleFile(n,r),s=JSON.stringify(this.cache[r],null,2);a.fs.writeFile(o,s,`utf-8`,function(t){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),i(t)})}_readLocaleFile(){let e={},t=this._resolveLocaleFile(this.directory,this.locale);try{a.fs.readFileSync&&(e=JSON.parse(a.fs.readFileSync(t,`utf-8`)))}catch(n){if(n instanceof SyntaxError&&(n.message=`syntax error in `+t),n.code===`ENOENT`)e={};else throw n}this.cache[this.locale]=e}_resolveLocaleFile(e,t){let n=a.resolve(e,`./`,t+`.json`);if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~t.lastIndexOf(`_`)){let r=a.resolve(e,`./`,t.split(`_`)[0]+`.json`);this._fileExistsSync(r)&&(n=r)}return n}_fileExistsSync(e){return a.exists(e)}};function s(e,t){a=t;let n=new o(e);return{__:n.__.bind(n),__n:n.__n.bind(n),setLocale:n.setLocale.bind(n),getLocale:n.getLocale.bind(n),updateLocale:n.updateLocale.bind(n),locale:n.locale}}var c={fs:{readFileSync:n.readFileSync,writeFile:n.writeFile},format:r.format,resolve:i.resolve,exists:e=>{try{return n.statSync(e).isFile()}catch{return!1}}};t.exports=e=>s(e,c)})),Xn=a(((e,t)=>{var n=u(),r=u(),i=u();function a(e){if(e!==e.toLowerCase()&&e!==e.toUpperCase()||(e=e.toLowerCase()),e.indexOf(`-`)===-1&&e.indexOf(`_`)===-1)return e;{let t=``,n=!1,r=e.match(/^-+/);for(let i=r?r[0].length:0;i<e.length;i++){let r=e.charAt(i);n&&(n=!1,r=r.toUpperCase()),i!==0&&(r===`-`||r===`_`)?n=!0:r!==`-`&&r!==`_`&&(t+=r)}return t}}function o(e,t){let n=e.toLowerCase();t||=`-`;let r=``;for(let i=0;i<e.length;i++){let a=n.charAt(i),o=e.charAt(i);a!==o&&i>0?r+=`${t}${n.charAt(i)}`:r+=o}return r}function s(e){return e==null?!1:typeof e==`number`||/^0x[0-9a-f]+$/i.test(e)?!0:/^0[^.]/.test(e)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function c(e){if(Array.isArray(e))return e.map(e=>typeof e==`string`?e:e+``);e=e.trim();let t=0,n=null,r=null,i=null,a=[];for(let o=0;o<e.length;o++){if(n=r,r=e.charAt(o),r===` `&&!i){n!==` `&&t++;continue}r===i?i=null:(r===`'`||r===`"`)&&!i&&(i=r),a[t]||(a[t]=``),a[t]+=r}return a}var l;(function(e){e.BOOLEAN=`boolean`,e.STRING=`string`,e.NUMBER=`number`,e.ARRAY=`array`})(l||={});var d,f=class{constructor(e){d=e}parse(e,t){let n=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},t),r=c(e),i=p(Object.assign(Object.create(null),n.alias)),u=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":`no-`,"parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),f=Object.assign(Object.create(null),n.default),g=n.configObjects||[],_=n.envPrefix,v=u[`populate--`],y=v?`--`:`_`,b=Object.create(null),ee=Object.create(null),x=n.__||d.format,S={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},C=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,w=RegExp(`^--`+u[`negation-prefix`]+`(.+)`);[].concat(n.array||[]).filter(Boolean).forEach(function(e){let t=typeof e==`object`?e.key:e,n=Object.keys(e).map(function(e){return{boolean:`bools`,string:`strings`,number:`numbers`}[e]}).filter(Boolean).pop();n&&(S[n][t]=!0),S.arrays[t]=!0,S.keys.push(t)}),[].concat(n.boolean||[]).filter(Boolean).forEach(function(e){S.bools[e]=!0,S.keys.push(e)}),[].concat(n.string||[]).filter(Boolean).forEach(function(e){S.strings[e]=!0,S.keys.push(e)}),[].concat(n.number||[]).filter(Boolean).forEach(function(e){S.numbers[e]=!0,S.keys.push(e)}),[].concat(n.count||[]).filter(Boolean).forEach(function(e){S.counts[e]=!0,S.keys.push(e)}),[].concat(n.normalize||[]).filter(Boolean).forEach(function(e){S.normalize[e]=!0,S.keys.push(e)}),typeof n.narg==`object`&&Object.entries(n.narg).forEach(([e,t])=>{typeof t==`number`&&(S.nargs[e]=t,S.keys.push(e))}),typeof n.coerce==`object`&&Object.entries(n.coerce).forEach(([e,t])=>{typeof t==`function`&&(S.coercions[e]=t,S.keys.push(e))}),n.config!==void 0&&(Array.isArray(n.config)||typeof n.config==`string`?[].concat(n.config).filter(Boolean).forEach(function(e){S.configs[e]=!0}):typeof n.config==`object`&&Object.entries(n.config).forEach(([e,t])=>{(typeof t==`boolean`||typeof t==`function`)&&(S.configs[e]=t)})),se(n.key,i,n.default,S.arrays),Object.keys(f).forEach(function(e){(S.aliases[e]||[]).forEach(function(t){f[t]=f[e]})});let T=null;K();let E=[],D=Object.assign(Object.create(null),{_:[]}),O={};for(let e=0;e<r.length;e++){let t=r[e],n=t.replace(/^-{3,}/,`---`),i,a,o,s,c,l;if(t!==`--`&&V(t))k(t);else if(n.match(/---+(=|$)/)){k(t);continue}else if(t.match(/^--.+=/)||!u[`short-option-groups`]&&t.match(/^-.+=/))s=t.match(/^--?([^=]+)=([\s\S]*)$/),s!==null&&Array.isArray(s)&&s.length>=3&&(z(s[1],S.arrays)?e=te(e,s[1],r,s[2]):z(s[1],S.nargs)===!1?j(s[1],s[2]):e=A(e,s[1],r,s[2]));else if(t.match(w)&&u[`boolean-negation`])s=t.match(w),s!==null&&Array.isArray(s)&&s.length>=2&&(a=s[1],j(a,z(a,S.arrays)?[!1]:!1));else if(t.match(/^--.+/)||!u[`short-option-groups`]&&t.match(/^-[^-]+/))s=t.match(/^--?(.+)/),s!==null&&Array.isArray(s)&&s.length>=2&&(a=s[1],z(a,S.arrays)?e=te(e,a,r):z(a,S.nargs)===!1?(c=r[e+1],c!==void 0&&(!c.match(/^-/)||c.match(C))&&!z(a,S.bools)&&!z(a,S.counts)||/^(true|false)$/.test(c)?(j(a,c),e++):j(a,U(a))):e=A(e,a,r));else if(t.match(/^-.\..+=/))s=t.match(/^-([^=]+)=([\s\S]*)$/),s!==null&&Array.isArray(s)&&s.length>=3&&j(s[1],s[2]);else if(t.match(/^-.\..+/)&&!t.match(C))c=r[e+1],s=t.match(/^-(.\..+)/),s!==null&&Array.isArray(s)&&s.length>=2&&(a=s[1],c!==void 0&&!c.match(/^-/)&&!z(a,S.bools)&&!z(a,S.counts)?(j(a,c),e++):j(a,U(a)));else if(t.match(/^-[^-]+/)&&!t.match(C)){o=t.slice(1,-1).split(``),i=!1;for(let n=0;n<o.length;n++){if(c=t.slice(n+2),o[n+1]&&o[n+1]===`=`){l=t.slice(n+3),a=o[n],z(a,S.arrays)?e=te(e,a,r,l):z(a,S.nargs)===!1?j(a,l):e=A(e,a,r,l),i=!0;break}if(c===`-`){j(o[n],c);continue}if(/[A-Za-z]/.test(o[n])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(c)&&z(c,S.bools)===!1){j(o[n],c),i=!0;break}if(o[n+1]&&o[n+1].match(/\W/)){j(o[n],c),i=!0;break}else j(o[n],U(o[n]))}a=t.slice(-1)[0],!i&&a!==`-`&&(z(a,S.arrays)?e=te(e,a,r):z(a,S.nargs)===!1?(c=r[e+1],c!==void 0&&(!/^(-|--)[^-]/.test(c)||c.match(C))&&!z(a,S.bools)&&!z(a,S.counts)||/^(true|false)$/.test(c)?(j(a,c),e++):j(a,U(a))):e=A(e,a,r))}else if(t.match(/^-[0-9]$/)&&t.match(C)&&z(t.slice(1),S.bools))a=t.slice(1),j(a,U(a));else if(t===`--`){E=r.slice(e+1);break}else if(u[`halt-at-non-option`]){E=r.slice(e);break}else k(t)}ie(D,!0),ie(D,!1),P(D),re(),I(D,S.aliases,f,!0),ae(D),u[`set-placeholder-key`]&&oe(D),Object.keys(S.counts).forEach(function(e){L(D,e.split(`.`))||j(e,0)}),v&&E.length&&(D[y]=[]),E.forEach(function(e){D[y].push(e)}),u[`camel-case-expansion`]&&u[`strip-dashed`]&&Object.keys(D).filter(e=>e!==`--`&&e.includes(`-`)).forEach(e=>{delete D[e]}),u[`strip-aliased`]&&[].concat(...Object.keys(i).map(e=>i[e])).forEach(e=>{u[`camel-case-expansion`]&&e.includes(`-`)&&delete D[e.split(`.`).map(e=>a(e)).join(`.`)],delete D[e]});function k(e){let t=N(`_`,e);(typeof t==`string`||typeof t==`number`)&&D._.push(t)}function A(e,t,n,r){let i,a=z(t,S.nargs);if(a=typeof a!=`number`||isNaN(a)?1:a,a===0)return G(r)||(T=Error(x(`Argument unexpected for: %s`,t))),j(t,U(t)),e;let o=+!G(r);if(u[`nargs-eats-options`])n.length-(e+1)+o<a&&(T=Error(x(`Not enough arguments following: %s`,t))),o=a;else{for(i=e+1;i<n.length&&(!n[i].match(/^-[^0-9]/)||n[i].match(C)||V(n[i]));i++)o++;o<a&&(T=Error(x(`Not enough arguments following: %s`,t)))}let s=Math.min(o,a);for(!G(r)&&s>0&&(j(t,r),s--),i=e+1;i<s+e+1;i++)j(t,n[i]);return e+s}function te(e,t,n,r){let i=[],a=r||n[e+1],o=z(t,S.nargs);if(z(t,S.bools)&&!/^(true|false)$/.test(a))i.push(!0);else if(G(a)||G(r)&&/^-/.test(a)&&!C.test(a)&&!V(a)){if(f[t]!==void 0){let e=f[t];i=Array.isArray(e)?e:[e]}}else{G(r)||i.push(M(t,r));for(let r=e+1;r<n.length&&!(!u[`greedy-arrays`]&&i.length>0||o&&typeof o==`number`&&i.length>=o||(a=n[r],/^-/.test(a)&&!C.test(a)&&!V(a)));r++)e=r,i.push(M(t,a))}return typeof o==`number`&&(o&&i.length<o||isNaN(o)&&i.length===0)&&(T=Error(x(`Not enough arguments following: %s`,t))),j(t,i),e}function j(e,t){/-/.test(e)&&u[`camel-case-expansion`]&&ne(e,e.split(`.`).map(function(e){return a(e)}).join(`.`));let n=M(e,t),r=e.split(`.`);R(D,r,n),S.aliases[e]&&S.aliases[e].forEach(function(e){R(D,e.split(`.`),n)}),r.length>1&&u[`dot-notation`]&&(S.aliases[r[0]]||[]).forEach(function(t){let i=t.split(`.`),a=[].concat(r);a.shift(),i=i.concat(a),(S.aliases[e]||[]).includes(i.join(`.`))||R(D,i,n)}),z(e,S.normalize)&&!z(e,S.arrays)&&[e].concat(S.aliases[e]||[]).forEach(function(e){Object.defineProperty(O,e,{enumerable:!0,get(){return t},set(e){t=typeof e==`string`?d.normalize(e):e}})})}function ne(e,t){S.aliases[e]&&S.aliases[e].length||(S.aliases[e]=[t],b[t]=!0),S.aliases[t]&&S.aliases[t].length||ne(t,e)}function M(e,t){typeof t==`string`&&(t[0]===`'`||t[0]===`"`)&&t[t.length-1]===t[0]&&(t=t.substring(1,t.length-1)),(z(e,S.bools)||z(e,S.counts))&&typeof t==`string`&&(t=t===`true`);let n=Array.isArray(t)?t.map(function(t){return N(e,t)}):N(e,t);return z(e,S.counts)&&(G(n)||typeof n==`boolean`)&&(n=m()),z(e,S.normalize)&&z(e,S.arrays)&&(n=Array.isArray(t)?t.map(e=>d.normalize(e)):d.normalize(t)),n}function N(e,t){return!u[`parse-positional-numbers`]&&e===`_`||!z(e,S.strings)&&!z(e,S.bools)&&!Array.isArray(t)&&(s(t)&&u[`parse-numbers`]&&Number.isSafeInteger(Math.floor(parseFloat(`${t}`)))||!G(t)&&z(e,S.numbers))&&(t=Number(t)),t}function P(e){let t=Object.create(null);I(t,S.aliases,f),Object.keys(S.configs).forEach(function(n){let r=e[n]||t[n];if(r)try{let e=null,t=d.resolve(d.cwd(),r),i=S.configs[n];if(typeof i==`function`){try{e=i(t)}catch(t){e=t}if(e instanceof Error){T=e;return}}else e=d.require(t);F(e)}catch(t){t.name===`PermissionDenied`?T=t:e[n]&&(T=Error(x(`Invalid JSON config file: %s`,r)))}})}function F(e,t){Object.keys(e).forEach(function(n){let r=e[n],i=t?t+`.`+n:n;typeof r==`object`&&r&&!Array.isArray(r)&&u[`dot-notation`]?F(r,i):(!L(D,i.split(`.`))||z(i,S.arrays)&&u[`combine-arrays`])&&j(i,r)})}function re(){g!==void 0&&g.forEach(function(e){F(e)})}function ie(e,t){if(_===void 0)return;let n=typeof _==`string`?_:``,r=d.env();Object.keys(r).forEach(function(i){if(n===``||i.lastIndexOf(n,0)===0){let o=i.split(`__`).map(function(e,t){return t===0&&(e=e.substring(n.length)),a(e)});(t&&S.configs[o.join(`.`)]||!t)&&!L(e,o)&&j(o.join(`.`),r[i])}})}function ae(e){let t,n=new Set;Object.keys(e).forEach(function(r){if(!n.has(r)&&(t=z(r,S.coercions),typeof t==`function`))try{let i=N(r,t(e[r]));[].concat(S.aliases[r]||[],r).forEach(t=>{n.add(t),e[t]=i})}catch(e){T=e}})}function oe(e){return S.keys.forEach(t=>{~t.indexOf(`.`)||e[t]===void 0&&(e[t]=void 0)}),e}function I(e,t,n,r=!1){Object.keys(n).forEach(function(i){L(e,i.split(`.`))||(R(e,i.split(`.`),n[i]),r&&(ee[i]=!0),(t[i]||[]).forEach(function(t){L(e,t.split(`.`))||R(e,t.split(`.`),n[i])}))})}function L(e,t){let n=e;u[`dot-notation`]||(t=[t.join(`.`)]),t.slice(0,-1).forEach(function(e){n=n[e]||{}});let r=t[t.length-1];return typeof n==`object`?r in n:!1}function R(e,t,n){let r=e;u[`dot-notation`]||(t=[t.join(`.`)]),t.slice(0,-1).forEach(function(e){e=h(e),typeof r==`object`&&r[e]===void 0&&(r[e]={}),typeof r[e]!=`object`||Array.isArray(r[e])?(Array.isArray(r[e])?r[e].push({}):r[e]=[r[e],{}],r=r[e][r[e].length-1]):r=r[e]});let i=h(t[t.length-1]),a=z(t.join(`.`),S.arrays),o=Array.isArray(n),s=u[`duplicate-arguments-array`];!s&&z(i,S.nargs)&&(s=!0,(!G(r[i])&&S.nargs[i]===1||Array.isArray(r[i])&&r[i].length===S.nargs[i])&&(r[i]=void 0)),n===m()?r[i]=m(r[i]):Array.isArray(r[i])?s&&a&&o?r[i]=u[`flatten-duplicate-arrays`]?r[i].concat(n):(Array.isArray(r[i][0])?r[i]:[r[i]]).concat([n]):!s&&!!a==!!o?r[i]=n:r[i]=r[i].concat([n]):r[i]===void 0&&a?r[i]=o?n:[n]:s&&!(r[i]===void 0||z(i,S.counts)||z(i,S.bools))?r[i]=[r[i],n]:r[i]=n}function se(...e){e.forEach(function(e){Object.keys(e||{}).forEach(function(e){S.aliases[e]||(S.aliases[e]=[].concat(i[e]||[]),S.aliases[e].concat(e).forEach(function(t){if(/-/.test(t)&&u[`camel-case-expansion`]){let n=a(t);n!==e&&S.aliases[e].indexOf(n)===-1&&(S.aliases[e].push(n),b[n]=!0)}}),S.aliases[e].concat(e).forEach(function(t){if(t.length>1&&/[A-Z]/.test(t)&&u[`camel-case-expansion`]){let n=o(t,`-`);n!==e&&S.aliases[e].indexOf(n)===-1&&(S.aliases[e].push(n),b[n]=!0)}}),S.aliases[e].forEach(function(t){S.aliases[t]=[e].concat(S.aliases[e].filter(function(e){return t!==e}))}))})})}function z(e,t){let n=[].concat(S.aliases[e]||[],e),r=Object.keys(t),i=n.find(e=>r.includes(e));return i?t[i]:!1}function B(e){let t=Object.keys(S);return[].concat(t.map(e=>S[e])).some(function(t){return Array.isArray(t)?t.includes(e):t[e]})}function ce(e,...t){return[].concat(...t).some(function(t){let n=e.match(t);return n&&B(n[1])})}function le(e){if(e.match(C)||!e.match(/^-[^-]+/))return!1;let t=!0,n,r=e.slice(1).split(``);for(let i=0;i<r.length;i++){if(n=e.slice(i+2),!B(r[i])){t=!1;break}if(r[i+1]&&r[i+1]===`=`||n===`-`||/[A-Za-z]/.test(r[i])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(n)||r[i+1]&&r[i+1].match(/\W/))break}return t}function V(e){return u[`unknown-options-as-args`]&&H(e)}function H(e){return e=e.replace(/^-{3,}/,`--`),e.match(C)||le(e)?!1:!ce(e,/^-+([^=]+?)=[\s\S]*$/,w,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function U(e){return!z(e,S.bools)&&!z(e,S.counts)&&`${e}`in f?f[e]:ue(W(e))}function ue(e){return{[l.BOOLEAN]:!0,[l.STRING]:``,[l.NUMBER]:void 0,[l.ARRAY]:[]}[e]}function W(e){let t=l.BOOLEAN;return z(e,S.strings)?t=l.STRING:z(e,S.numbers)?t=l.NUMBER:z(e,S.bools)?t=l.BOOLEAN:z(e,S.arrays)&&(t=l.ARRAY),t}function G(e){return e===void 0}function K(){Object.keys(S.counts).find(e=>z(e,S.arrays)?(T=Error(x(`Invalid configuration: %s, opts.count excludes opts.array.`,e)),!0):z(e,S.nargs)?(T=Error(x(`Invalid configuration: %s, opts.count excludes opts.narg.`,e)),!0):!1)}return{aliases:Object.assign({},S.aliases),argv:Object.assign(O,D),configuration:u,defaulted:Object.assign({},ee),error:T,newAliases:Object.assign({},b)}}};function p(e){let t=[],n=Object.create(null),r=!0;for(Object.keys(e).forEach(function(n){t.push([].concat(e[n],n))});r;){r=!1;for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++)if(t[e].filter(function(e){return t[n].indexOf(e)!==-1}).length){t[e]=t[e].concat(t[n]),t.splice(n,1),r=!0;break}}return t.forEach(function(e){e=e.filter(function(e,t,n){return n.indexOf(e)===t});let t=e.pop();t!==void 0&&typeof t==`string`&&(n[t]=e)}),n}function m(e){return e===void 0?1:e+1}function h(e){return e===`__proto__`?`___proto___`:e}var g=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):10;if(process&&process.version&&Number(process.version.match(/v([^.]+)/)[1])<g)throw Error(`yargs parser supports a minimum Node.js version of ${g}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var _=process?process.env:{},v=new f({cwd:process.cwd,env:()=>_,format:n.format,normalize:i.normalize,resolve:i.resolve,require:e=>{if(typeof require<`u`)return require(e);if(e.match(/\.json$/))return r.readFileSync(e,`utf8`);throw Error(`only .json config files are supported in ESM`)}}),y=function(e,t){return v.parse(e.slice(),t).argv};y.detailed=function(e,t){return v.parse(e.slice(),t)},y.camelCase=a,y.decamelize=o,y.looksLikeNumber=s,t.exports=y})),Zn=a(((e,t)=>{t.exports=({onlyFirst:e=!1}={})=>{let t=[`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)`,`(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))`].join(`|`);return new RegExp(t,e?void 0:`g`)}})),Qn=a(((e,t)=>{var n=Zn();t.exports=e=>typeof e==`string`?e.replace(n(),``):e})),$n=a(((e,t)=>{var n=e=>Number.isNaN(e)?!1:e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141);t.exports=n,t.exports.default=n})),er=a(((e,t)=>{t.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}})),tr=a(((e,t)=>{var n=Qn(),r=$n(),i=er(),a=e=>{if(typeof e!=`string`||e.length===0||(e=n(e),e.length===0))return 0;e=e.replace(i(),` `);let t=0;for(let n=0;n<e.length;n++){let i=e.codePointAt(n);i<=31||i>=127&&i<=159||i>=768&&i<=879||(i>65535&&n++,t+=r(i)?2:1)}return t};t.exports=a,t.exports.default=a})),nr=a(((e,t)=>{t.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]}})),rr=a(((e,t)=>{var n=nr(),r={};for(let e of Object.keys(n))r[n[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`]}};t.exports=i;for(let e of Object.keys(i)){if(!(`channels`in i[e]))throw Error(`missing channels property: `+e);if(!(`labels`in i[e]))throw Error(`missing channel labels property: `+e);if(i[e].labels.length!==i[e].channels)throw 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,i=Math.min(t,n,r),a=Math.max(t,n,r),o=a-i,s,c;a===i?s=0:t===a?s=(n-r)/o:n===a?s=2+(r-t)/o:r===a&&(s=4+(t-n)/o),s=Math.min(s*60,360),s<0&&(s+=360);let l=(i+a)/2;return c=a===i?0:l<=.5?o/(a+i):o/(2-a-i),[s,c*100,l*100]},i.rgb.hsv=function(e){let t,n,r,i,a,o=e[0]/255,s=e[1]/255,c=e[2]/255,l=Math.max(o,s,c),u=l-Math.min(o,s,c),d=function(e){return(l-e)/6/u+1/2};return u===0?(i=0,a=0):(a=u/l,t=d(o),n=d(s),r=d(c),o===l?i=r-n:s===l?i=1/3+t-r:c===l&&(i=2/3+n-t),i<0?i+=1:i>1&&--i),[i*360,a*100,l*100]},i.rgb.hwb=function(e){let t=e[0],n=e[1],r=e[2],a=i.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)),[a,o*100,r*100]},i.rgb.cmyk=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(1-t,1-n,1-r),a=(1-t-i)/(1-i)||0,o=(1-n-i)/(1-i)||0,s=(1-r-i)/(1-i)||0;return[a*100,o*100,s*100,i*100]};function a(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=r[e];if(t)return t;let i=1/0,o;for(let t of Object.keys(n)){let r=n[t],s=a(e,r);s<i&&(i=s,o=t)}return o},i.keyword.rgb=function(e){return n[e]},i.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;let i=t*.4124+n*.3576+r*.1805,a=t*.2126+n*.7152+r*.0722,o=t*.0193+n*.1192+r*.9505;return[i*100,a*100,o*100]},i.rgb.lab=function(e){let t=i.rgb.xyz(e),n=t[0],r=t[1],a=t[2];return n/=95.047,r/=100,a/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,a=a>.008856?a**(1/3):7.787*a+16/116,[116*r-16,500*(n-r),200*(r-a)]},i.hsl.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,i,a,o;if(n===0)return o=r*255,[o,o,o];i=r<.5?r*(1+n):r+n-r*n;let s=2*r-i,c=[0,0,0];for(let e=0;e<3;e++)a=t+1/3*-(e-1),a<0&&a++,a>1&&a--,o=6*a<1?s+(i-s)*6*a:2*a<1?i:3*a<2?s+(i-s)*(2/3-a)*6:s,c[e]=o*255;return c},i.hsl.hsv=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=n,a=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,i*=a<=1?a:2-a;let o=(r+n)/2;return[t,(r===0?2*i/(a+i):2*n/(r+n))*100,o*100]},i.hsv.rgb=function(e){let t=e[0]/60,n=e[1]/100,r=e[2]/100,i=Math.floor(t)%6,a=t-Math.floor(t),o=255*r*(1-n),s=255*r*(1-n*a),c=255*r*(1-n*(1-a));switch(r*=255,i){case 0:return[r,c,o];case 1:return[s,r,o];case 2:return[o,r,c];case 3:return[o,s,r];case 4:return[c,o,r];case 5:return[r,o,s]}},i.hsv.hsl=function(e){let t=e[0],n=e[1]/100,r=e[2]/100,i=Math.max(r,.01),a,o;o=(2-n)*r;let s=(2-n)*i;return a=n*i,a/=s<=1?s:2-s,a||=0,o/=2,[t,a*100,o*100]},i.hwb.rgb=function(e){let t=e[0]/360,n=e[1]/100,r=e[2]/100,i=n+r,a;i>1&&(n/=i,r/=i);let o=Math.floor(6*t),s=1-r;a=6*t-o,o&1&&(a=1-a);let c=n+a*(s-n),l,u,d;switch(o){default:case 6:case 0:l=s,u=c,d=n;break;case 1:l=c,u=s,d=n;break;case 2:l=n,u=s,d=c;break;case 3:l=n,u=c,d=s;break;case 4:l=c,u=n,d=s;break;case 5:l=s,u=n,d=c;break}return[l*255,u*255,d*255]},i.cmyk.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100,a=1-Math.min(1,t*(1-i)+i),o=1-Math.min(1,n*(1-i)+i),s=1-Math.min(1,r*(1-i)+i);return[a*255,o*255,s*255]},i.xyz.rgb=function(e){let t=e[0]/100,n=e[1]/100,r=e[2]/100,i,a,o;return i=t*3.2406+n*-1.5372+r*-.4986,a=t*-.9689+n*1.8758+r*.0415,o=t*.0557+n*-.204+r*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[i*255,a*255,o*255]},i.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];return 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,[116*n-16,500*(t-n),200*(n-r)]},i.lab.xyz=function(e){let t=e[0],n=e[1],r=e[2],i,a,o;a=(t+16)/116,i=n/500+a,o=a-r/200;let s=a**3,c=i**3,l=o**3;return a=s>.008856?s:(a-16/116)/7.787,i=c>.008856?c:(i-16/116)/7.787,o=l>.008856?l:(o-16/116)/7.787,i*=95.047,a*=100,o*=108.883,[i,a,o]},i.lab.lch=function(e){let t=e[0],n=e[1],r=e[2],i;return i=Math.atan2(r,n)*360/2/Math.PI,i<0&&(i+=360),[t,Math.sqrt(n*n+r*r),i]},i.lch.lab=function(e){let t=e[0],n=e[1],r=e[2]/360*2*Math.PI;return[t,n*Math.cos(r),n*Math.sin(r)]},i.rgb.ansi16=function(e,t=null){let[n,r,a]=e,o=t===null?i.rgb.hsv(e)[2]:t;if(o=Math.round(o/50),o===0)return 30;let s=30+(Math.round(a/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return o===2&&(s+=60),s},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;return[(t&1)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},i.ansi256.rgb=function(e){if(e>=232){let t=(e-232)*10+8;return[t,t,t]}e-=16;let t;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},i.rgb.hex=function(e){let t=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return`000000`.substring(t.length)+t},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(e=>e+e).join(``));let r=parseInt(n,16);return[r>>16&255,r>>8&255,r&255]},i.rgb.hcg=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.max(Math.max(t,n),r),a=Math.min(Math.min(t,n),r),o=i-a,s,c;return s=o<1?a/(1-o):0,c=o<=0?0:i===t?(n-r)/o%6:i===n?2+(r-t)/o:4+(t-n)/o,c/=6,c%=1,[c*360,o*100,s*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),i=0;return r<1&&(i=(n-.5*r)/(1-r)),[e[0],r*100,i*100]},i.hsv.hcg=function(e){let t=e[1]/100,n=e[2]/100,r=t*n,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],r*100,i*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 i=[0,0,0],a=t%1*6,o=a%1,s=1-o,c=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=o,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]=o;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return c=(1-n)*r,[(n*i[0]+c)*255,(n*i[1]+c)*255,(n*i[2]+c)*255]},i.hcg.hsv=function(e){let t=e[1]/100,n=t+e[2]/100*(1-t),r=0;return n>0&&(r=t/n),[e[0],r*100,n*100]},i.hcg.hsl=function(e){let t=e[1]/100,n=e[2]/100*(1-t)+.5*t,r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],r*100,n*100]},i.hcg.hwb=function(e){let t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],(n-t)*100,(1-n)*100]},i.hwb.hcg=function(e){let t=e[1]/100,n=1-e[2]/100,r=n-t,i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],r*100,i*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,n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return`000000`.substring(n.length)+n},i.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}})),ir=a(((e,t)=>{var n=rr();function r(){let e={},t=Object.keys(n);for(let n=t.length,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}function i(e){let t=r(),i=[e];for(t[e].distance=0;i.length;){let e=i.pop(),r=Object.keys(n[e]);for(let n=r.length,a=0;a<n;a++){let n=r[a],o=t[n];o.distance===-1&&(o.distance=t[e].distance+1,o.parent=e,i.unshift(n))}}return t}function a(e,t){return function(n){return t(e(n))}}function o(e,t){let r=[t[e].parent,e],i=n[t[e].parent][e],o=t[e].parent;for(;t[o].parent;)r.unshift(t[o].parent),i=a(n[t[o].parent][o],i),o=t[o].parent;return i.conversion=r,i}t.exports=function(e){let t=i(e),n={},r=Object.keys(t);for(let e=r.length,i=0;i<e;i++){let e=r[i];t[e].parent!==null&&(n[e]=o(e,t))}return n}})),ar=a(((e,t)=>{var n=rr(),r=ir(),i={},a=Object.keys(n);function o(e){let t=function(...t){let n=t[0];return n==null?n:(n.length>1&&(t=n),e(t))};return`conversion`in e&&(t.conversion=e.conversion),t}function s(e){let t=function(...t){let n=t[0];if(n==null)return n;n.length>1&&(t=n);let r=e(t);if(typeof r==`object`)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}a.forEach(e=>{i[e]={},Object.defineProperty(i[e],`channels`,{value:n[e].channels}),Object.defineProperty(i[e],`labels`,{value:n[e].labels});let t=r(e);Object.keys(t).forEach(n=>{let r=t[n];i[e][n]=s(r),i[e][n].raw=o(r)})}),t.exports=i})),or=a(((e,t)=>{var n=(e,t)=>(...n)=>`\u001B[${e(...n)+t}m`,r=(e,t)=>(...n)=>{let r=e(...n);return`\u001B[${38+t};5;${r}m`},i=(e,t)=>(...n)=>{let r=e(...n);return`\u001B[${38+t};2;${r[0]};${r[1]};${r[2]}m`},a=e=>e,o=(e,t,n)=>[e,t,n],s=(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})},c,l=(e,t,n,r)=>{c===void 0&&(c=ar());let i=r?10:0,a={};for(let[r,o]of Object.entries(c)){let s=r===`ansi16`?`ansi`:r;r===t?a[s]=e(n,i):typeof o==`object`&&(a[s]=e(o[t],i))}return a};function u(){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[n,i]of Object.entries(r))t[n]={open:`\u001B[${i[0]}m`,close:`\u001B[${i[1]}m`},r[n]=t[n],e.set(i[0],i[1]);Object.defineProperty(t,n,{value:r,enumerable:!1})}return Object.defineProperty(t,`codes`,{value:e,enumerable:!1}),t.color.close=`\x1B[39m`,t.bgColor.close=`\x1B[49m`,s(t.color,`ansi`,()=>l(n,`ansi16`,a,!1)),s(t.color,`ansi256`,()=>l(r,`ansi256`,a,!1)),s(t.color,`ansi16m`,()=>l(i,`rgb`,o,!1)),s(t.bgColor,`ansi`,()=>l(n,`ansi16`,a,!0)),s(t.bgColor,`ansi256`,()=>l(r,`ansi256`,a,!0)),s(t.bgColor,`ansi16m`,()=>l(i,`rgb`,o,!0)),t}Object.defineProperty(t,`exports`,{enumerable:!0,get:u})})),sr=a(((e,t)=>{var n=tr(),r=Qn(),i=or(),a=new Set([`\x1B`,``]),o=39,s=`\x07`,c=`[`,l=`]`,u=`m`,d=`${l}8;;`,f=e=>`${a.values().next().value}${c}${e}${u}`,p=e=>`${a.values().next().value}${d}${e}${s}`,m=e=>e.split(` `).map(e=>n(e)),h=(e,t,i)=>{let o=[...t],c=!1,l=!1,f=n(r(e[e.length-1]));for(let[t,r]of o.entries()){let p=n(r);if(f+p<=i?e[e.length-1]+=r:(e.push(r),f=0),a.has(r)&&(c=!0,l=o.slice(t+1).join(``).startsWith(d)),c){l?r===s&&(c=!1,l=!1):r===u&&(c=!1);continue}f+=p,f===i&&t<o.length-1&&(e.push(``),f=0)}!f&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},g=e=>{let t=e.split(` `),r=t.length;for(;r>0&&!(n(t[r-1])>0);)r--;return r===t.length?e:t.slice(0,r).join(` `)+t.slice(r).join(``)},_=(e,t,r={})=>{if(r.trim!==!1&&e.trim()===``)return``;let l=``,u,_,v=m(e),y=[``];for(let[i,a]of e.split(` `).entries()){r.trim!==!1&&(y[y.length-1]=y[y.length-1].trimStart());let e=n(y[y.length-1]);if(i!==0&&(e>=t&&(r.wordWrap===!1||r.trim===!1)&&(y.push(``),e=0),(e>0||r.trim===!1)&&(y[y.length-1]+=` `,e++)),r.hard&&v[i]>t){let n=t-e,r=1+Math.floor((v[i]-n-1)/t);Math.floor((v[i]-1)/t)<r&&y.push(``),h(y,a,t);continue}if(e+v[i]>t&&e>0&&v[i]>0){if(r.wordWrap===!1&&e<t){h(y,a,t);continue}y.push(``)}if(e+v[i]>t&&r.wordWrap===!1){h(y,a,t);continue}y[y.length-1]+=a}r.trim!==!1&&(y=y.map(g));let b=[...y.join(`
|
|
8
|
+
`)];for(let[e,t]of b.entries()){if(l+=t,a.has(t)){let{groups:t}=RegExp(`(?:\\${c}(?<code>\\d+)m|\\${d}(?<uri>.*)${s})`).exec(b.slice(e).join(``))||{groups:{}};if(t.code!==void 0){let e=Number.parseFloat(t.code);u=e===o?void 0:e}else t.uri!==void 0&&(_=t.uri.length===0?void 0:t.uri)}let n=i.codes.get(Number(u));b[e+1]===`
|
|
9
|
+
`?(_&&(l+=p(``)),u&&n&&(l+=f(n))):t===`
|
|
10
|
+
`&&(u&&n&&(l+=f(u)),_&&(l+=p(_)))}return l};t.exports=(e,t,n)=>String(e).normalize().replace(/\r\n/g,`
|
|
11
|
+
`).split(`
|
|
12
|
+
`).map(e=>_(e,t,n)).join(`
|
|
13
|
+
`)})),cr=a(((e,t)=>{var n={right:d,center:f},r=0,i=1,a=2,o=3,s=class{constructor(e){this.width=e.width,this.wrap=e.wrap??!0,this.rows=[]}span(...e){let t=this.div(...e);t.span=!0}resetOutput(){this.rows=[]}div(...e){if(e.length===0&&this.div(``),this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]==`string`)return this.applyLayoutDSL(e[0]);let t=e.map(e=>typeof e==`string`?this.colFromString(e):e);return this.rows.push(t),t}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]==`string`&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){let t=e.split(`
|
|
14
|
+
`).map(e=>e.split(` `)),n=0;return t.forEach(e=>{e.length>1&&p.stringWidth(e[0])>n&&(n=Math.min(Math.floor(this.width*.5),p.stringWidth(e[0])))}),t.forEach(e=>{this.div(...e.map((t,r)=>({text:t.trim(),padding:this.measurePadding(t),width:r===0&&e.length>1?n:void 0})))}),this.rows[this.rows.length-1]}colFromString(e){return{text:e,padding:this.measurePadding(e)}}measurePadding(e){let t=p.stripAnsi(e);return[0,t.match(/\s*$/)[0].length,0,t.match(/^\s*/)[0].length]}toString(){let e=[];return this.rows.forEach(t=>{this.rowToString(t,e)}),e.filter(e=>!e.hidden).map(e=>e.text).join(`
|
|
15
|
+
`)}rowToString(e,t){return this.rasterize(e).forEach((r,a)=>{let s=``;r.forEach((r,l)=>{let{width:u}=e[l],d=this.negatePadding(e[l]),f=r;if(d>p.stringWidth(r)&&(f+=` `.repeat(d-p.stringWidth(r))),e[l].align&&e[l].align!==`left`&&this.wrap){let t=n[e[l].align];f=t(f,d),p.stringWidth(f)<d&&(f+=` `.repeat((u||0)-p.stringWidth(f)-1))}let m=e[l].padding||[0,0,0,0];m[o]&&(s+=` `.repeat(m[o])),s+=c(e[l],f,`| `),s+=f,s+=c(e[l],f,` |`),m[i]&&(s+=` `.repeat(m[i])),a===0&&t.length>0&&(s=this.renderInline(s,t[t.length-1]))}),t.push({text:s.replace(/ +$/,``),span:e.span})}),t}renderInline(e,t){let n=e.match(/^ */),r=n?n[0].length:0,i=t.text,a=p.stringWidth(i.trimRight());return t.span?this.wrap?r<a?e:(t.hidden=!0,i.trimRight()+` `.repeat(r-a)+e.trimLeft()):(t.hidden=!0,i+e):e}rasterize(e){let t=[],n=this.columnWidths(e),i;return e.forEach((e,o)=>{e.width=n[o],i=this.wrap?p.wrap(e.text,this.negatePadding(e),{hard:!0}).split(`
|
|
16
|
+
`):e.text.split(`
|
|
17
|
+
`),e.border&&(i.unshift(`.`+`-`.repeat(this.negatePadding(e)+2)+`.`),i.push(`'`+`-`.repeat(this.negatePadding(e)+2)+`'`)),e.padding&&(i.unshift(...Array(e.padding[r]||0).fill(``)),i.push(...Array(e.padding[a]||0).fill(``))),i.forEach((e,n)=>{t[n]||t.push([]);let r=t[n];for(let e=0;e<o;e++)r[e]===void 0&&r.push(``);r.push(e)})}),t}negatePadding(e){let t=e.width||0;return e.padding&&(t-=(e.padding[o]||0)+(e.padding[i]||0)),e.border&&(t-=4),t}columnWidths(e){if(!this.wrap)return e.map(e=>e.width||p.stringWidth(e.text));let t=e.length,n=this.width,r=e.map(e=>{if(e.width)return t--,n-=e.width,e.width}),i=t?Math.floor(n/t):0;return r.map((t,n)=>t===void 0?Math.max(i,l(e[n])):t)}};function c(e,t,n){return e.border?/[.']-+[.']/.test(t)?``:t.trim().length===0?` `:n:``}function l(e){let t=e.padding||[],n=1+(t[o]||0)+(t[i]||0);return e.border?n+4:n}function u(){return typeof process==`object`&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function d(e,t){e=e.trim();let n=p.stringWidth(e);return n<t?` `.repeat(t-n)+e:e}function f(e,t){e=e.trim();let n=p.stringWidth(e);return n>=t?e:` `.repeat(t-n>>1)+e}var p;function m(e,t){return p=t,new s({width:e?.width||u(),wrap:e?.wrap})}var h=tr(),g=Qn(),_=sr();function v(e){return m(e,{stringWidth:h,stripAnsi:g,wrap:_})}t.exports=v})),lr=a(((e,t)=>{var{dirname:n,resolve:r}=u(),{readdirSync:i,statSync:a}=u();t.exports=function(e,t){let o=r(`.`,e),s;for(a(o).isDirectory()||(o=n(o));;){if(s=t(o,i(o)),s)return r(o,s);if(o=n(s=o),s===o)break}}})),ur=a(((e,t)=>{t.exports=function(e){if(e===void 0&&(e=2),e>=Error.stackTraceLimit)throw TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `"+e+"` and Error.stackTraceLimit was: `"+Error.stackTraceLimit+"`");var t=Error.prepareStackTrace;Error.prepareStackTrace=function(e,t){return t};var n=Error().stack;if(Error.prepareStackTrace=t,typeof n==`object`&&n)return n[e]?n[e].getFileName():void 0}})),dr=a(((e,t)=>{var n=u(),r=u().join,i=u().resolve,a=u().dirname,o={extensions:[`js`,`json`,`coffee`],recurse:!0,rename:function(e){return e},visit:function(e){return e}};function s(e,t,n){return RegExp(`\\.(`+n.extensions.join(`|`)+`)$`,`i`).test(t)&&!(n.include&&n.include instanceof RegExp&&!n.include.test(e))&&!(n.include&&typeof n.include==`function`&&!n.include(e,t))&&!(n.exclude&&n.exclude instanceof RegExp&&n.exclude.test(e))&&!(n.exclude&&typeof n.exclude==`function`&&n.exclude(e,t))}function c(e,t,l){var u={};for(var d in t&&!l&&typeof t!=`string`&&(l=t,t=null),l||={},o)l[d]===void 0&&(l[d]=o[d]);return t=t?i(a(e.filename),t):a(e.filename),n.readdirSync(t).forEach(function(i){var a=r(t,i),o,d,f;n.statSync(a).isDirectory()&&l.recurse?(o=c(e,a,l),Object.keys(o).length&&(u[l.rename(i,a,i)]=o)):a!==e.filename&&s(a,i,l)&&(d=i.substring(0,i.lastIndexOf(`.`)),f=e.require(a),u[l.rename(d,a,i)]=l.visit(f,a,i)||f)}),u}t.exports=c,t.exports.defaults=o})),fr=a(((e,t)=>{var n=u(),r=class e extends Error{constructor(t){super(t||`yargs error`),this.name=`YError`,Error.captureStackTrace(this,e)}},i=[],a;function o(e,t,n,r){a=r;let u={};if(Object.prototype.hasOwnProperty.call(e,`extends`)){if(typeof e.extends!=`string`)return u;let r=/\.json|\..*rc$/.test(e.extends),l=null;if(r)l=c(t,e.extends);else try{l=require.resolve(e.extends)}catch{return e}s(l),i.push(l),u=r?JSON.parse(a.readFileSync(l,`utf8`)):require(e.extends),delete e.extends,u=o(u,a.path.dirname(l),n,a)}return i=[],n?l(u,e):Object.assign({},u,e)}function s(e){if(i.indexOf(e)>-1)throw new r(`Circular extended configurations: '${e}'.`)}function c(e,t){return a.path.resolve(e,t)}function l(e,t){let n={};function r(e){return e&&typeof e==`object`&&!Array.isArray(e)}Object.assign(n,e);for(let i of Object.keys(t))r(t[i])&&r(n[i])?n[i]=l(e[i],t[i]):n[i]=t[i];return n}function d(e){let t=e.replace(/\s{2,}/g,` `).split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,r=t.shift();if(!r)throw Error(`No command found in: ${e}`);let i={cmd:r.replace(n,``),demanded:[],optional:[]};return t.forEach((e,r)=>{let a=!1;e=e.replace(/\s/g,``),/\.+[\]>]/.test(e)&&r===t.length-1&&(a=!0),/^\[/.test(e)?i.optional.push({cmd:e.replace(n,``).split(`|`),variadic:a}):i.demanded.push({cmd:e.replace(n,``).split(`|`),variadic:a})}),i}var f=[`first`,`second`,`third`,`fourth`,`fifth`,`sixth`];function p(e,t,n){function i(){return typeof e==`object`?[{demanded:[],optional:[]},e,t]:[d(`cmd ${e}`),t,n]}try{let e=0,[t,n,a]=i(),o=[].slice.call(n);for(;o.length&&o[o.length-1]===void 0;)o.pop();let s=a||o.length;if(s<t.demanded.length)throw new r(`Not enough arguments provided. Expected ${t.demanded.length} but received ${o.length}.`);let c=t.demanded.length+t.optional.length;if(s>c)throw new r(`Too many arguments provided. Expected max ${c} but received ${s}.`);t.demanded.forEach(t=>{let n=m(o.shift());t.cmd.filter(e=>e===n||e===`*`).length===0&&h(n,t.cmd,e),e+=1}),t.optional.forEach(t=>{if(o.length===0)return;let n=m(o.shift());t.cmd.filter(e=>e===n||e===`*`).length===0&&h(n,t.cmd,e),e+=1})}catch(e){console.warn(e.stack)}}function m(e){return Array.isArray(e)?`array`:e===null?`null`:typeof e}function h(e,t,n){throw new r(`Invalid ${f[n]||`manyith`} argument. Expected ${t.join(` or `)} but received ${e}.`)}function g(e){return!!e&&!!e.then&&typeof e.then==`function`}function _(e,t,n,r){n.assert.notStrictEqual(e,t,r)}function v(e,t){t.assert.strictEqual(typeof e,`string`)}function y(e){return Object.keys(e)}function b(e={},t=()=>!0){let n={};return y(e).forEach(r=>{t(r,e[r])&&(n[r]=e[r])}),n}function ee(e,t){return function(n,r=!1){if(p(`<array|function> [boolean]`,[n,r],arguments.length),Array.isArray(n)){for(let e=0;e<n.length;e++){if(typeof n[e]!=`function`)throw Error(`middleware must be a function`);n[e].applyBeforeValidation=r}Array.prototype.push.apply(e,n)}else typeof n==`function`&&(n.applyBeforeValidation=r,e.push(n));return t}}function x(e){return e?e.map(e=>(e.applyBeforeValidation=!1,e)):[]}function S(e,t,n,r){let i=Error(`middleware cannot return a promise when applyBeforeValidation is true`);return n.reduce((e,n)=>{if(n.applyBeforeValidation!==r)return e;if(g(e))return e.then(e=>Promise.all([e,n(e,t)])).then(([e,t])=>Object.assign(e,t));{let a=n(e,t);if(r&&g(a))throw i;return g(a)?a.then(t=>Object.assign(e,t)):Object.assign(e,a)}},e)}function C(){return+!w()}function w(){return T()&&!process.defaultApp}function T(){return!!process.versions.electron}function E(e){return e.slice(C()+1)}function D(){return process.argv[C()]}var O=Object.freeze({__proto__:null,hideBin:E,getProcessArgvBin:D});function k(e){if(typeof require>`u`)return null;for(let t=0,n=Object.keys(require.cache),r;t<n.length;t++)if(r=require.cache[n[t]],r.exports===e)return r;return null}var A=/(^\*)|(^\$0)/;function te(e,t,n,r=[],i){let a={},o={},s={},c;a.addHandler=function(e,n,r,i,u,p){let m=[],h=x(u);if(i||=(()=>{}),Array.isArray(e))if(ne(e))[e,...m]=e;else for(let t of e)a.addHandler(t);else if(P(e)){let t=Array.isArray(e.command)||typeof e.command==`string`?e.command:l(e);e.aliases&&(t=[].concat(t,e.aliases)),a.addHandler(t,f(e),e.builder,e.handler,e.middlewares,e.deprecated);return}else if(j(r)){a.addHandler([e].concat(m),n,r.builder,r.handler,r.middlewares,r.deprecated);return}if(typeof e==`string`){let a=d(e);m=m.map(e=>d(e).cmd);let l=!1,u=[a.cmd].concat(m).filter(e=>A.test(e)?(l=!0,!1):!0);u.length===0&&l&&u.push(`$0`),l&&(a.cmd=u[0],m=u.slice(1),e=e.replace(A,a.cmd)),m.forEach(e=>{s[e]=a.cmd}),n!==!1&&t.command(e,n,l,m,p),o[a.cmd]={original:e,description:n,handler:i,builder:r||{},middlewares:h,deprecated:p,demanded:a.demanded,optional:a.optional},l&&(c=o[a.cmd])}},a.addDirectory=function(e,t,n,r,o){o||={},typeof o.recurse!=`boolean`&&(o.recurse=!1),Array.isArray(o.extensions)||(o.extensions=[`js`]);let s=typeof o.visit==`function`?o.visit:e=>e;o.visit=function(e,n,r){let i=s(e,n,r);if(i){if(~t.files.indexOf(n))return i;t.files.push(n),a.addHandler(i)}return i},i.requireDirectory({require:n,filename:r},e,o)};function l(e){let t=k(e);if(!t)throw Error(`No command name given for module: ${i.inspect(e)}`);return u(t.filename)}function u(e){return i.path.basename(e,i.path.extname(e))}function f({describe:e,description:t,desc:n}){for(let r of[e,t,n]){if(typeof r==`string`||r===!1)return r;_(r,!0,i)}return!1}a.getCommands=()=>Object.keys(o).concat(Object.keys(s)),a.getCommandHandlers=()=>o,a.hasDefaultCommand=()=>!!c,a.runCommand=function(e,t,n,i){let a=n.aliases,l=o[e]||o[s[e]]||c,u=t.getContext(),d=u.files.length,f=u.commands.slice(),_=n.argv,v={};e&&(u.commands.push(e),u.fullCommands.push(l.original));let y=l.builder;if(M(y)){let e=y(t.reset(n.aliases)),r=W(e)?e:t;p(r)&&r.getUsageInstance().usage(m(f,l),l.description),_=r._parseArgs(null,null,!0,i),a=r.parsed.aliases}else if(N(y)){let e=t.reset(n.aliases);p(e)&&e.getUsageInstance().usage(m(f,l),l.description),Object.keys(l.builder).forEach(t=>{e.option(t,y[t])}),_=e._parseArgs(null,null,!0,i),a=e.parsed.aliases}t._hasOutput()||(v=h(l,_,u));let b=r.slice(0).concat(l.middlewares);if(S(_,t,b,!0),t._hasOutput()||t._runValidation(_,a,v,t.parsed.error,!e),l.handler&&!t._hasOutput()){t._setHasOutput();let e=!!t.getOptions().configuration[`populate--`];t._postProcess(_,e),_=S(_,t,b,!1);let n;n=g(_)?_.then(e=>l.handler(e)):l.handler(_);let r=t.getHandlerFinishCommand();g(n)?(t.getUsageInstance().cacheHelpMessage(),n.then(e=>{r&&r(e)}).catch(e=>{try{t.getUsageInstance().fail(null,e)}catch{}}).then(()=>{t.getUsageInstance().clearCachedHelpMessage()})):r&&r(n)}return e&&(u.commands.pop(),u.fullCommands.pop()),d=u.files.length-d,d>0&&u.files.splice(d*-1,d),_};function p(e){return!e.getUsageInstance().getUsageDisabled()&&e.getUsageInstance().getUsage().length===0}function m(e,t){let n=A.test(t.original)?t.original.replace(A,``).trim():t.original,r=e.filter(e=>!A.test(e));return r.push(n),`$0 ${r.join(` `)}`}a.runDefaultBuilderOn=function(e){if(_(c,void 0,i),p(e)){let t=A.test(c.original)?c.original:c.original.replace(/^[^[\]<>]*/,`$0 `);e.getUsageInstance().usage(t,c.description)}let t=c.builder;M(t)?t(e):j(t)||Object.keys(t).forEach(n=>{e.option(n,t[n])})};function h(e,t,r){t._=t._.slice(r.commands.length);let i=e.demanded.slice(0),o=e.optional.slice(0),s={};for(n.positionalCount(i.length,t._.length);i.length;)v(i.shift(),t,s);for(;o.length;)v(o.shift(),t,s);return t._=r.commands.concat(t._.map(e=>``+e)),y(t,s,a.cmdToParseOptions(e.original)),s}function v(e,t,n){let r=e.cmd[0];e.variadic?n[r]=t._.splice(0).map(String):t._.length&&(n[r]=[String(t._.shift())])}function y(t,n,r){let a=Object.assign({},e.getOptions());a.default=Object.assign(r.default,a.default);for(let e of Object.keys(r.alias))a.alias[e]=(a.alias[e]||[]).concat(r.alias[e]);a.array=a.array.concat(r.array),a.config={};let o=[];if(Object.keys(n).forEach(e=>{n[e].map(t=>{a.configuration[`unknown-options-as-args`]&&(a.key[e]=!0),o.push(`--${e}`),o.push(t)})}),!o.length)return;let s=Object.assign({},a.configuration,{"populate--":!0}),c=i.Parser.detailed(o,Object.assign({},a,{configuration:s}));if(c.error)e.getUsageInstance().fail(c.error.message,c.error);else{let e=Object.keys(n);Object.keys(n).forEach(t=>{e.push(...c.aliases[t])}),Object.keys(c.argv).forEach(r=>{e.indexOf(r)!==-1&&(n[r]||(n[r]=c.argv[r]),t[r]=c.argv[r])})}}a.cmdToParseOptions=function(e){let t={array:[],default:{},alias:{},demand:{}},n=d(e);return n.demanded.forEach(e=>{let[n,...r]=e.cmd;e.variadic&&(t.array.push(n),t.default[n]=[]),t.alias[n]=r,t.demand[n]=!0}),n.optional.forEach(e=>{let[n,...r]=e.cmd;e.variadic&&(t.array.push(n),t.default[n]=[]),t.alias[n]=r}),t},a.reset=()=>(o={},s={},c=void 0,a);let b=[];return a.freeze=()=>{b.push({handlers:o,aliasMap:s,defaultCommand:c})},a.unfreeze=()=>{let e=b.pop();_(e,void 0,i),{handlers:o,aliasMap:s,defaultCommand:c}=e},a}function j(e){return typeof e==`object`&&!!e.builder&&typeof e.handler==`function`}function ne(e){return!!e.every(e=>typeof e==`string`)}function M(e){return typeof e==`function`}function N(e){return typeof e==`object`}function P(e){return typeof e==`object`&&!Array.isArray(e)}function F(e){typeof process>`u`||[process.stdout,process.stderr].forEach(t=>{let n=t;n._handle&&n.isTTY&&typeof n._handle.setBlocking==`function`&&n._handle.setBlocking(e)})}function re(e,t,n){let i=t.__,a={},o=[];a.failFn=function(e){o.push(e)};let s=null,c=!0;a.showHelpOnFail=function(e=!0,t){function n(){return typeof e==`string`?[!0,e]:[e,t]}let[r,i]=n();return s=i,c=r,a};let l=!1;a.fail=function(t,n){let i=e._getLoggerInstance();if(o.length)for(let e=o.length-1;e>=0;--e)o[e](t,n,a);else{if(e.getExitProcess()&&F(!0),l||(l=!0,c&&(e.showHelp(`error`),i.error()),(t||n)&&i.error(t||n),s&&((t||n)&&i.error(``),i.error(s))),n||=new r(t),e.getExitProcess())return e.exit(1);if(e._hasParseCallback())return e.exit(1,n);throw n}};let u=[],d=!1;a.usage=(e,t)=>e===null?(d=!0,u=[],a):(d=!1,u.push([e,t||``]),a),a.getUsage=()=>u,a.getUsageDisabled=()=>d,a.getPositionalGroupName=()=>i(`Positionals:`);let f=[];a.example=(e,t)=>{f.push([e,t||``])};let p=[];a.command=function(e,t,n,r,i=!1){n&&(p=p.map(e=>(e[2]=!1,e))),p.push([e,t||``,n,r,i])},a.getCommands=()=>p;let m={};a.describe=function(e,t){Array.isArray(e)?e.forEach(e=>{a.describe(e,t)}):typeof e==`object`?Object.keys(e).forEach(t=>{a.describe(t,e[t])}):m[e]=t},a.getDescriptions=()=>m;let h=[];a.epilog=e=>{h.push(e)};let g=!1,v;a.wrap=e=>{g=!0,v=e};function y(){return g||=(v=D(),!0),v}let ee=`__yargsString__:`;a.deferY18nLookup=e=>ee+e,a.help=function(){if(C)return C;S();let t=e.customScriptName?e.$0:n.path.basename(e.$0),r=e.getDemandedOptions(),o=e.getDemandedCommands(),s=e.getDeprecatedOptions(),c=e.getGroups(),l=e.getOptions(),g=[];g=g.concat(Object.keys(m)),g=g.concat(Object.keys(r)),g=g.concat(Object.keys(o)),g=g.concat(Object.keys(l.default)),g=g.filter(T),g=Object.keys(g.reduce((e,t)=>(t!==`_`&&(e[t]=!0),e),{}));let _=y(),v=n.cliui({width:_,wrap:!!_});if(!d){if(u.length)u.forEach(e=>{v.div(`${e[0].replace(/\$0/g,t)}`),e[1]&&v.div({text:`${e[1]}`,padding:[1,0,0,0]})}),v.div();else if(p.length){let e=null;e=o._?`${t} <${i(`command`)}>\n`:`${t} [${i(`command`)}]\n`,v.div(`${e}`)}}if(p.length){v.div(i(`Commands:`));let n=e.getContext(),r=n.commands.length?`${n.commands.join(` `)} `:``;e.getParserConfiguration()[`sort-commands`]===!0&&(p=p.sort((e,t)=>e[0].localeCompare(t[0]))),p.forEach(e=>{let n=`${t} ${r}${e[0].replace(/^\$0 ?/,``)}`;v.span({text:n,padding:[0,2,0,2],width:x(p,_,`${t}${r}`)+4},{text:e[1]});let a=[];e[2]&&a.push(`[${i(`default`)}]`),e[3]&&e[3].length&&a.push(`[${i(`aliases:`)} ${e[3].join(`, `)}]`),e[4]&&(typeof e[4]==`string`?a.push(`[${i(`deprecated: %s`,e[4])}]`):a.push(`[${i(`deprecated`)}]`)),a.length?v.div({text:a.join(` `),padding:[0,0,0,2],align:`right`}):v.div()}),v.div()}let b=(Object.keys(l.alias)||[]).concat(Object.keys(e.parsed.newAliases)||[]);g=g.filter(t=>!e.parsed.newAliases[t]&&b.every(e=>(l.alias[e]||[]).indexOf(t)===-1));let D=i(`Options:`);c[D]||(c[D]=[]),w(g,l.alias,c,D);let O=e=>/^--/.test(I(e)),k=Object.keys(c).filter(e=>c[e].length>0).map(e=>({groupName:e,normalizedKeys:c[e].filter(T).map(e=>{if(~b.indexOf(e))return e;for(let t=0,n;(n=b[t])!==void 0;t++)if(~(l.alias[n]||[]).indexOf(e))return n;return e})})).filter(({normalizedKeys:e})=>e.length>0).map(({groupName:e,normalizedKeys:t})=>({groupName:e,normalizedKeys:t,switches:t.reduce((t,n)=>(t[n]=[n].concat(l.alias[n]||[]).map(t=>e===a.getPositionalGroupName()?t:(/^[0-9]$/.test(t)?~l.boolean.indexOf(n)?`-`:`--`:t.length>1?`--`:`-`)+t).sort((e,t)=>O(e)===O(t)?0:O(e)?1:-1).join(`, `),t),{})}));if(k.filter(({groupName:e})=>e!==a.getPositionalGroupName()).some(({normalizedKeys:e,switches:t})=>!e.every(e=>O(t[e])))&&k.filter(({groupName:e})=>e!==a.getPositionalGroupName()).forEach(({normalizedKeys:e,switches:t})=>{e.forEach(e=>{O(t[e])&&(t[e]=ae(t[e],4))})}),k.forEach(({groupName:e,normalizedKeys:t,switches:n})=>{v.div(e),t.forEach(e=>{let t=n[e],o=m[e]||``,c=null;~o.lastIndexOf(ee)&&(o=i(o.substring(16))),~l.boolean.indexOf(e)&&(c=`[${i(`boolean`)}]`),~l.count.indexOf(e)&&(c=`[${i(`count`)}]`),~l.string.indexOf(e)&&(c=`[${i(`string`)}]`),~l.normalize.indexOf(e)&&(c=`[${i(`string`)}]`),~l.array.indexOf(e)&&(c=`[${i(`array`)}]`),~l.number.indexOf(e)&&(c=`[${i(`number`)}]`);let u=[e in s?(e=>typeof e==`string`?`[${i(`deprecated: %s`,e)}]`:`[${i(`deprecated`)}]`)(s[e]):null,c,e in r?`[${i(`required`)}]`:null,l.choices&&l.choices[e]?`[${i(`choices:`)} ${a.stringifiedValues(l.choices[e])}]`:null,E(l.default[e],l.defaultDescription[e])].filter(Boolean).join(` `);v.span({text:I(t),padding:[0,2,0,2+oe(t)],width:x(n,_)+4},o),u?v.div({text:u,padding:[0,0,0,2],align:`right`}):v.div()}),v.div()}),f.length&&(v.div(i(`Examples:`)),f.forEach(e=>{e[0]=e[0].replace(/\$0/g,t)}),f.forEach(e=>{e[1]===``?v.div({text:e[0],padding:[0,2,0,2]}):v.div({text:e[0],padding:[0,2,0,2],width:x(f,_)+4},{text:e[1]})}),v.div()),h.length>0){let e=h.map(e=>e.replace(/\$0/g,t)).join(`
|
|
18
|
+
`);v.div(`${e}\n`)}return v.toString().replace(/\s*$/,``)};function x(e,t,r){let i=0;return Array.isArray(e)||(e=Object.values(e).map(e=>[e])),e.forEach(e=>{i=Math.max(n.stringWidth(r?`${r} ${I(e[0])}`:I(e[0]))+oe(e[0]),i)}),t&&(i=Math.min(i,parseInt((t*.5).toString(),10))),i}function S(){let t=e.getDemandedOptions(),n=e.getOptions();(Object.keys(n.alias)||[]).forEach(r=>{n.alias[r].forEach(i=>{m[i]&&a.describe(r,m[i]),i in t&&e.demandOption(r,t[i]),~n.boolean.indexOf(i)&&e.boolean(r),~n.count.indexOf(i)&&e.count(r),~n.string.indexOf(i)&&e.string(r),~n.normalize.indexOf(i)&&e.normalize(r),~n.array.indexOf(i)&&e.array(r),~n.number.indexOf(i)&&e.number(r)})})}let C;a.cacheHelpMessage=function(){C=this.help()},a.clearCachedHelpMessage=function(){C=void 0};function w(e,t,n,r){let i=[],a=null;return Object.keys(n).forEach(e=>{i=i.concat(n[e])}),e.forEach(e=>{a=[e].concat(t[e]),a.some(e=>i.indexOf(e)!==-1)||n[r].push(e)}),i}function T(t){return e.getOptions().hiddenOptions.indexOf(t)<0||e.parsed.argv[e.getOptions().showHiddenOpt]}a.showHelp=t=>{let n=e._getLoggerInstance();t||=`error`,(typeof t==`function`?t:n[t])(a.help())},a.functionDescription=e=>[`(`,e.name?n.Parser.decamelize(e.name,`-`):i(`generated-value`),`)`].join(``),a.stringifiedValues=function(e,t){let n=``,r=t||`, `,i=[].concat(e);return!e||!i.length||i.forEach(e=>{n.length&&(n+=r),n+=JSON.stringify(e)}),n};function E(e,t){let n=`[${i(`default:`)} `;if(e===void 0&&!t)return null;if(t)n+=t;else switch(typeof e){case`string`:n+=`"${e}"`;break;case`object`:n+=JSON.stringify(e);break;default:n+=e}return`${n}]`}function D(){return n.process.stdColumns?Math.min(80,n.process.stdColumns):80}let O=null;a.version=e=>{O=e},a.showVersion=()=>{e._getLoggerInstance().log(O)},a.reset=function(e){return s=null,l=!1,u=[],d=!1,h=[],f=[],p=[],m=b(m,t=>!e[t]),a};let k=[];return a.freeze=function(){k.push({failMessage:s,failureOutput:l,usages:u,usageDisabled:d,epilogs:h,examples:f,commands:p,descriptions:m})},a.unfreeze=function(){let e=k.pop();_(e,void 0,n),{failMessage:s,failureOutput:l,usages:u,usageDisabled:d,epilogs:h,examples:f,commands:p,descriptions:m}=e},a}function ie(e){return typeof e==`object`}function ae(e,t){return ie(e)?{text:e.text,indentation:e.indentation+t}:{text:e,indentation:t}}function oe(e){return ie(e)?e.indentation:0}function I(e){return ie(e)?e.text:e}var L=`###-begin-{{app_name}}-completions-###
|
|
19
|
+
#
|
|
20
|
+
# yargs command completion script
|
|
21
|
+
#
|
|
22
|
+
# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc
|
|
23
|
+
# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.
|
|
24
|
+
#
|
|
25
|
+
_yargs_completions()
|
|
26
|
+
{
|
|
27
|
+
local cur_word args type_list
|
|
28
|
+
|
|
29
|
+
cur_word="\${COMP_WORDS[COMP_CWORD]}"
|
|
30
|
+
args=("\${COMP_WORDS[@]}")
|
|
31
|
+
|
|
32
|
+
# ask yargs to generate completions.
|
|
33
|
+
type_list=$({{app_path}} --get-yargs-completions "\${args[@]}")
|
|
34
|
+
|
|
35
|
+
COMPREPLY=( $(compgen -W "\${type_list}" -- \${cur_word}) )
|
|
36
|
+
|
|
37
|
+
# if no match was found, fall back to filename completion
|
|
38
|
+
if [ \${#COMPREPLY[@]} -eq 0 ]; then
|
|
39
|
+
COMPREPLY=()
|
|
40
|
+
fi
|
|
41
|
+
|
|
42
|
+
return 0
|
|
43
|
+
}
|
|
44
|
+
complete -o default -F _yargs_completions {{app_name}}
|
|
45
|
+
###-end-{{app_name}}-completions-###
|
|
46
|
+
`,R=`###-begin-{{app_name}}-completions-###
|
|
47
|
+
#
|
|
48
|
+
# yargs command completion script
|
|
49
|
+
#
|
|
50
|
+
# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc
|
|
51
|
+
# or {{app_path}} {{completion_command}} >> ~/.zsh_profile on OSX.
|
|
52
|
+
#
|
|
53
|
+
_{{app_name}}_yargs_completions()
|
|
54
|
+
{
|
|
55
|
+
local reply
|
|
56
|
+
local si=$IFS
|
|
57
|
+
IFS=$'
|
|
58
|
+
' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "\${words[@]}"))
|
|
59
|
+
IFS=$si
|
|
60
|
+
_describe 'values' reply
|
|
61
|
+
}
|
|
62
|
+
compdef _{{app_name}}_yargs_completions {{app_name}}
|
|
63
|
+
###-end-{{app_name}}-completions-###
|
|
64
|
+
`;function se(e,t,n,r){let i={completionKey:`get-yargs-completions`},a;i.setParsed=function(e){a=e.aliases};let o=r.getEnv(`SHELL`)&&r.getEnv(`SHELL`).indexOf(`zsh`)!==-1||r.getEnv(`ZSH_NAME`)&&r.getEnv(`ZSH_NAME`).indexOf(`zsh`)!==-1;i.getCompletion=function(i,c){let l=[],u=i.length?i[i.length-1]:``,f=e.parse(i,!0),p=e.getContext().commands;function m(e){if(_(s,null,r),z(s)){let t=s(u,e);return g(t)?t.then(e=>{r.process.nextTick(()=>{c(e)})}).catch(e=>{r.process.nextTick(()=>{throw e})}):c(t)}else return s(u,e,e=>{c(e)})}if(s)return g(f)?f.then(m):m(f);let h=n.getCommandHandlers();for(let t=0,n=i.length;t<n;++t)if(h[i[t]]&&h[i[t]].builder){let n=h[i[t]].builder;if(M(n)){let t=e.reset();return n(t),t.argv}}if(!u.match(/^-/)&&p[p.length-1]!==u&&t.getCommands().forEach(e=>{let t=d(e[0]).cmd;if(i.indexOf(t)===-1)if(!o)l.push(t);else{let n=e[1]||``;l.push(t.replace(/:/g,`\\:`)+`:`+n)}}),u.match(/^-/)||u===``&&l.length===0){let n=t.getDescriptions(),r=e.getOptions();Object.keys(r.key).forEach(e=>{let t=!!r.configuration[`boolean-negation`]&&r.boolean.includes(e),s=[e].concat(a[e]||[]);t&&(s=s.concat(s.map(e=>`no-${e}`)));function c(e){if(s.every(e=>i.indexOf(`--${e}`)===-1)){let t=!(e=>/^--/.test(e))(u)&&(e=>/^[^0-9]$/.test(e))(e)?`-`:`--`;if(!o)l.push(t+e);else{let r=n[e]||``;l.push(t+`${e.replace(/:/g,`\\:`)}:${r.replace(`__yargsString__:`,``)}`)}}}c(e),t&&r.default[e]&&c(`no-${e}`)})}c(l)},i.generateCompletionScript=function(e,t){let n=o?R:L,i=r.path.basename(e);return e.match(/\.js$/)&&(e=`./${e}`),n=n.replace(/{{app_name}}/g,i),n=n.replace(/{{completion_command}}/g,t),n.replace(/{{app_path}}/g,e)};let s=null;return i.registerFunction=e=>{s=e},i}function z(e){return e.length<3}function B(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;let n=[],r;for(r=0;r<=t.length;r++)n[r]=[r];let i;for(i=0;i<=e.length;i++)n[0][i]=i;for(r=1;r<=t.length;r++)for(i=1;i<=e.length;i++)t.charAt(r-1)===e.charAt(i-1)?n[r][i]=n[r-1][i-1]:n[r][i]=Math.min(n[r-1][i-1]+1,Math.min(n[r][i-1]+1,n[r-1][i]+1));return n[t.length][e.length]}var ce=[`$0`,`--`,`_`];function le(e,t,n,r){let i=n.__,a=n.__n,o={};o.nonOptionCount=function(n){let r=e.getDemandedCommands(),i=n._.length+(n[`--`]?n[`--`].length:0)-e.getContext().commands.length;r._&&(i<r._.min||i>r._.max)&&(i<r._.min?r._.minMsg===void 0?t.fail(a(`Not enough non-option arguments: got %s, need at least %s`,`Not enough non-option arguments: got %s, need at least %s`,i,i.toString(),r._.min.toString())):t.fail(r._.minMsg?r._.minMsg.replace(/\$0/g,i.toString()).replace(/\$1/,r._.min.toString()):null):i>r._.max&&(r._.maxMsg===void 0?t.fail(a(`Too many non-option arguments: got %s, maximum of %s`,`Too many non-option arguments: got %s, maximum of %s`,i,i.toString(),r._.max.toString())):t.fail(r._.maxMsg?r._.maxMsg.replace(/\$0/g,i.toString()).replace(/\$1/,r._.max.toString()):null)))},o.positionalCount=function(e,n){n<e&&t.fail(a(`Not enough non-option arguments: got %s, need at least %s`,`Not enough non-option arguments: got %s, need at least %s`,n,n+``,e+``))},o.requiredArguments=function(n){let r=e.getDemandedOptions(),i=null;for(let e of Object.keys(r))(!Object.prototype.hasOwnProperty.call(n,e)||n[e]===void 0)&&(i||={},i[e]=r[e]);if(i){let e=[];for(let t of Object.keys(i)){let n=i[t];n&&e.indexOf(n)<0&&e.push(n)}let n=e.length?`\n${e.join(`
|
|
65
|
+
`)}`:``;t.fail(a(`Missing required argument: %s`,`Missing required arguments: %s`,Object.keys(i).length,Object.keys(i).join(`, `)+n))}},o.unknownArguments=function(n,r,i,s,c=!0){let l=e.getCommandInstance().getCommands(),u=[],d=e.getContext();Object.keys(n).forEach(t=>{ce.indexOf(t)===-1&&!Object.prototype.hasOwnProperty.call(i,t)&&!Object.prototype.hasOwnProperty.call(e._getParseContext(),t)&&!o.isValidAndSomeAliasIsNotNew(t,r)&&u.push(t)}),c&&(d.commands.length>0||l.length>0||s)&&n._.slice(d.commands.length).forEach(e=>{l.indexOf(``+e)===-1&&u.push(``+e)}),u.length>0&&t.fail(a(`Unknown argument: %s`,`Unknown arguments: %s`,u.length,u.join(`, `)))},o.unknownCommands=function(n){let r=e.getCommandInstance().getCommands(),i=[],o=e.getContext();return(o.commands.length>0||r.length>0)&&n._.slice(o.commands.length).forEach(e=>{r.indexOf(``+e)===-1&&i.push(``+e)}),i.length>0?(t.fail(a(`Unknown command: %s`,`Unknown commands: %s`,i.length,i.join(`, `))),!0):!1},o.isValidAndSomeAliasIsNotNew=function(t,n){if(!Object.prototype.hasOwnProperty.call(n,t))return!1;let r=e.parsed.newAliases;for(let e of[t,...n[t]])if(!Object.prototype.hasOwnProperty.call(r,e)||!r[t])return!0;return!1},o.limitedChoices=function(n){let r=e.getOptions(),a={};if(!Object.keys(r.choices).length)return;Object.keys(n).forEach(e=>{ce.indexOf(e)===-1&&Object.prototype.hasOwnProperty.call(r.choices,e)&&[].concat(n[e]).forEach(t=>{r.choices[e].indexOf(t)===-1&&t!==void 0&&(a[e]=(a[e]||[]).concat(t))})});let o=Object.keys(a);if(!o.length)return;let s=i(`Invalid values:`);o.forEach(e=>{s+=`\n ${i(`Argument: %s, Given: %s, Choices: %s`,e,t.stringifiedValues(a[e]),t.stringifiedValues(r.choices[e]))}`}),t.fail(s)};let s=[];o.check=function(e,t){s.push({func:e,global:t})},o.customChecks=function(e,n){for(let r=0,a;(a=s[r])!==void 0;r++){let r=a.func,o=null;try{o=r(e,n)}catch(e){t.fail(e.message?e.message:e,e);continue}o?(typeof o==`string`||o instanceof Error)&&t.fail(o.toString(),o):t.fail(i(`Argument check failed: %s`,r.toString()))}};let c={};o.implies=function(t,n){p(`<string|object> [array|number|string]`,[t,n],arguments.length),typeof t==`object`?Object.keys(t).forEach(e=>{o.implies(e,t[e])}):(e.global(t),c[t]||(c[t]=[]),Array.isArray(n)?n.forEach(e=>o.implies(t,e)):(_(n,void 0,r),c[t].push(n)))},o.getImplied=function(){return c};function l(e,t){let n=Number(t);return t=isNaN(n)?t:n,typeof t==`number`?t=e._.length>=t:t.match(/^--no-.+/)?(t=t.match(/^--no-(.+)/)[1],t=!e[t]):t=e[t],t}o.implications=function(e){let n=[];if(Object.keys(c).forEach(t=>{let r=t;(c[t]||[]).forEach(t=>{let i=r,a=t;i=l(e,i),t=l(e,t),i&&!t&&n.push(` ${r} -> ${a}`)})}),n.length){let e=`${i(`Implications failed:`)}\n`;n.forEach(t=>{e+=t}),t.fail(e)}};let u={};o.conflicts=function(t,n){p(`<string|object> [array|string]`,[t,n],arguments.length),typeof t==`object`?Object.keys(t).forEach(e=>{o.conflicts(e,t[e])}):(e.global(t),u[t]||(u[t]=[]),Array.isArray(n)?n.forEach(e=>o.conflicts(t,e)):u[t].push(n))},o.getConflicting=()=>u,o.conflicting=function(e){Object.keys(e).forEach(n=>{u[n]&&u[n].forEach(r=>{r&&e[n]!==void 0&&e[r]!==void 0&&t.fail(i(`Arguments %s and %s are mutually exclusive`,n,r))})})},o.recommendCommands=function(e,n){n=n.sort((e,t)=>t.length-e.length);let r=null,a=1/0;for(let t=0,i;(i=n[t])!==void 0;t++){let t=B(e,i);t<=3&&t<a&&(a=t,r=i)}r&&t.fail(i(`Did you mean %s?`,r))},o.reset=function(e){return c=b(c,t=>!e[t]),u=b(u,t=>!e[t]),s=s.filter(e=>e.global),o};let d=[];return o.freeze=function(){d.push({implied:c,checks:s,conflicting:u})},o.unfreeze=function(){let e=d.pop();_(e,void 0,r),{implied:c,checks:s,conflicting:u}=e},o}var V;function H(e){return V=e,U}function U(e=[],t=V.process.cwd(),n){let i={},a,s=null,c={},l=[],u=``,d={},f,m,h=null,x=V.y18n;i.middleware=ee(l,i),i.scriptName=function(e){return i.customScriptName=!0,i.$0=e,i};let S;S=/\b(node|iojs|electron)(\.exe)?$/.test(V.process.argv()[0])?V.process.argv().slice(1,2):V.process.argv().slice(0,1),i.$0=S.map(e=>{let n=ue(t,e);return e.match(/^(\/|([a-zA-Z]:)?\\)/)&&n.length<e.length?n:e}).join(` `).trim(),V.getEnv(`_`)&&V.getProcessArgvBin()===V.getEnv(`_`)&&(i.$0=V.getEnv(`_`).replace(`${V.path.dirname(V.process.execPath())}/`,``));let C={resets:-1,commands:[],fullCommands:[],files:[]};i.getContext=()=>C;let w=!1,T=null;i.exit=(e,t)=>{w=!0,T=t,q&&V.process.exit(e)};let E=null;i.completion=function(e,t,n){return p(`[string] [string|boolean|function] [function]`,[e,t,n],arguments.length),typeof t==`function`&&(n=t,t=void 0),E=e||E||`completion`,!t&&t!==!1&&(t=`generate completion script`),i.command(E,t),n&&s.registerFunction(n),i};let D;i.resetOptions=i.reset=function(e={}){C.resets++,D||={};let t={};t.local=D.local?D.local:[],t.configObjects=D.configObjects?D.configObjects:[];let n={};return t.local.forEach(t=>{n[t]=!0,(e[t]||[]).forEach(e=>{n[e]=!0})}),Object.assign(d,Object.keys(c).reduce((e,t)=>{let r=c[t].filter(e=>!(e in n));return r.length>0&&(e[t]=r),e},{})),c={},[`array`,`boolean`,`string`,`skipValidation`,`count`,`normalize`,`number`,`hiddenOptions`].forEach(e=>{t[e]=(D[e]||[]).filter(e=>!n[e])}),[`narg`,`key`,`alias`,`default`,`defaultDescription`,`config`,`choices`,`demandedOptions`,`demandedCommands`,`coerce`,`deprecatedOptions`].forEach(e=>{t[e]=b(D[e],e=>!n[e])}),t.envPrefix=D.envPrefix,D=t,f=f?f.reset(n):re(i,x,V),m=m?m.reset(n):le(i,f,x,V),a=a?a.reset():te(i,f,m,l,V),s||=se(i,f,a,V),E=null,u=``,T=null,w=!1,i.parsed=!1,i},i.resetOptions();let O=[];function k(){O.push({options:D,configObjects:D.configObjects.slice(0),exitProcess:q,groups:c,strict:B,strictCommands:ce,strictOptions:H,completionCommand:E,output:u,exitError:T,hasOutput:w,parsed:i.parsed,parseFn:R,parseContext:z,handlerFinishCommand:h}),f.freeze(),m.freeze(),a.freeze()}function A(){let e=O.pop();_(e,void 0,V);let t;({options:D,configObjects:t,exitProcess:q,groups:c,output:u,exitError:T,hasOutput:w,parsed:i.parsed,strict:B,strictCommands:ce,strictOptions:H,completionCommand:E,parseFn:R,parseContext:z,handlerFinishCommand:h}=e),D.configObjects=t,f.unfreeze(),m.unfreeze(),a.unfreeze()}i.boolean=function(e){return p(`<array|string>`,[e],arguments.length),j(`boolean`,e),i},i.array=function(e){return p(`<array|string>`,[e],arguments.length),j(`array`,e),i},i.number=function(e){return p(`<array|string>`,[e],arguments.length),j(`number`,e),i},i.normalize=function(e){return p(`<array|string>`,[e],arguments.length),j(`normalize`,e),i},i.count=function(e){return p(`<array|string>`,[e],arguments.length),j(`count`,e),i},i.string=function(e){return p(`<array|string>`,[e],arguments.length),j(`string`,e),i},i.requiresArg=function(e){return p(`<array|string|object> [number]`,[e],arguments.length),typeof e==`string`&&D.narg[e]||N(i.requiresArg,`narg`,e,NaN),i},i.skipValidation=function(e){return p(`<array|string>`,[e],arguments.length),j(`skipValidation`,e),i};function j(e,t){t=[].concat(t),t.forEach(t=>{t=ae(t),D[e].push(t)})}i.nargs=function(e,t){return p(`<string|object|array> [number]`,[e,t],arguments.length),N(i.nargs,`narg`,e,t),i},i.choices=function(e,t){return p(`<object|string|array> [string|array]`,[e,t],arguments.length),P(i.choices,`choices`,e,t),i},i.alias=function(e,t){return p(`<object|string|array> [string|array]`,[e,t],arguments.length),P(i.alias,`alias`,e,t),i},i.default=i.defaults=function(e,t,n){return p(`<object|string|array> [*] [string]`,[e,t,n],arguments.length),n&&(v(e,V),D.defaultDescription[e]=n),typeof t==`function`&&(v(e,V),D.defaultDescription[e]||(D.defaultDescription[e]=f.functionDescription(t)),t=t.call()),N(i.default,`default`,e,t),i},i.describe=function(e,t){return p(`<object|string|array> [string]`,[e,t],arguments.length),ne(e,!0),f.describe(e,t),i};function ne(e,t){return N(ne,`key`,e,t),i}function M(e,t){return p(`<object|string|array> [string]`,[e,t],arguments.length),N(i.demandOption,`demandedOptions`,e,t),i}i.demandOption=M,i.coerce=function(e,t){return p(`<object|string|array> [function]`,[e,t],arguments.length),N(i.coerce,`coerce`,e,t),i};function N(e,t,n,r){ie(e,t,n,r,(e,t,n)=>{D[e][t]=n})}function P(e,t,n,r){ie(e,t,n,r,(e,t,n)=>{D[e][t]=(D[e][t]||[]).concat(n)})}function ie(e,t,n,r,i){if(Array.isArray(n))n.forEach(t=>{e(t,r)});else if((e=>typeof e==`object`)(n))for(let t of y(n))e(t,n[t]);else i(t,ae(n),r)}function ae(e){return e===`__proto__`?`___proto___`:e}function oe(e){y(D).forEach(t=>{if((e=>e===`configObjects`)(t))return;let n=D[t];Array.isArray(n)?~n.indexOf(e)&&n.splice(n.indexOf(e),1):typeof n==`object`&&delete n[e]}),delete f.getDescriptions()[e]}i.config=function(e=`config`,n,r){return p(`[object|string] [string|function] [function]`,[e,n,r],arguments.length),typeof e==`object`&&!Array.isArray(e)?(e=o(e,t,i.getParserConfiguration()[`deep-merge-config`]||!1,V),D.configObjects=(D.configObjects||[]).concat(e),i):(typeof n==`function`&&(r=n,n=void 0),i.describe(e,n||f.deferY18nLookup(`Path to JSON config file`)),(Array.isArray(e)?e:[e]).forEach(e=>{D.config[e]=r||!0}),i)},i.example=function(e,t){return p(`<string|array> [string]`,[e,t],arguments.length),Array.isArray(e)?e.forEach(e=>i.example(...e)):f.example(e,t),i},i.command=function(e,t,n,r,o,s){return p(`<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]`,[e,t,n,r,o,s],arguments.length),a.addHandler(e,t,n,r,o,s),i},i.commandDir=function(e,t){p(`<string> [object]`,[e,t],arguments.length);let r=n||V.require;return a.addDirectory(e,i.getContext(),r,V.getCallerFile(),t),i},i.demand=i.required=i.require=function(e,t,n){return Array.isArray(t)?(t.forEach(e=>{_(n,!0,V),M(e,n)}),t=1/0):typeof t!=`number`&&(n=t,t=1/0),typeof e==`number`?(_(n,!0,V),i.demandCommand(e,t,n,n)):Array.isArray(e)?e.forEach(e=>{_(n,!0,V),M(e,n)}):typeof n==`string`?M(e,n):(n===!0||n===void 0)&&M(e),i},i.demandCommand=function(e=1,t,n,r){return p(`[number] [number|string] [string|null|undefined] [string|null|undefined]`,[e,t,n,r],arguments.length),typeof t!=`number`&&(n=t,t=1/0),i.global(`_`,!1),D.demandedCommands._={min:e,max:t,minMsg:n,maxMsg:r},i},i.getDemandedOptions=()=>(p([],0),D.demandedOptions),i.getDemandedCommands=()=>(p([],0),D.demandedCommands),i.deprecateOption=function(e,t){return p(`<string> [string|boolean]`,[e,t],arguments.length),D.deprecatedOptions[e]=t,i},i.getDeprecatedOptions=()=>(p([],0),D.deprecatedOptions),i.implies=function(e,t){return p(`<string|object> [number|string|array]`,[e,t],arguments.length),m.implies(e,t),i},i.conflicts=function(e,t){return p(`<string|object> [string|array]`,[e,t],arguments.length),m.conflicts(e,t),i},i.usage=function(e,t,n,a){if(p(`<string|null|undefined> [string|boolean] [function|object] [function]`,[e,t,n,a],arguments.length),t!==void 0){if(_(e,null,V),(e||``).match(/^\$0( |$)/))return i.command(e,t,n,a);throw new r(`.usage() description must start with $0 if being used as alias for .command()`)}else return f.usage(e),i},i.epilogue=i.epilog=function(e){return p(`<string>`,[e],arguments.length),f.epilog(e),i},i.fail=function(e){return p(`<function>`,[e],arguments.length),f.failFn(e),i},i.onFinishCommand=function(e){return p(`<function>`,[e],arguments.length),h=e,i},i.getHandlerFinishCommand=()=>h,i.check=function(e,t){return p(`<function> [boolean]`,[e,t],arguments.length),m.check(e,t!==!1),i},i.global=function(e,t){return p(`<string|array> [boolean]`,[e,t],arguments.length),e=[].concat(e),t===!1?e.forEach(e=>{D.local.indexOf(e)===-1&&D.local.push(e)}):D.local=D.local.filter(t=>e.indexOf(t)===-1),i},i.pkgConf=function(e,n){p(`<string> [string]`,[e,n],arguments.length);let r=null,a=L(n||t);return a[e]&&typeof a[e]==`object`&&(r=o(a[e],n||t,i.getParserConfiguration()[`deep-merge-config`]||!1,V),D.configObjects=(D.configObjects||[]).concat(r)),i};let I={};function L(e){let t=e||`*`;if(I[t])return I[t];let n={};try{let t=e||V.mainFilename;!e&&V.path.extname(t)&&(t=V.path.dirname(t));let r=V.findUp(t,(e,t)=>{if(t.includes(`package.json`))return`package.json`});_(r,void 0,V),n=JSON.parse(V.readFileSync(r,`utf8`))}catch{}return I[t]=n||{},I[t]}let R=null,z=null;i.parse=function(t,n,r){if(p(`[string|array] [function|boolean|object] [function]`,[t,n,r],arguments.length),k(),t===void 0){let t=i._parseArgs(e),n=i.parsed;return A(),i.parsed=n,t}typeof n==`object`&&(z=n,n=r),typeof n==`function`&&(R=n,n=!1),n||(e=t),R&&(q=!1);let a=i._parseArgs(t,!!n);return s.setParsed(i.parsed),R&&R(T,a,u),A(),a},i._getParseContext=()=>z||{},i._hasParseCallback=()=>!!R,i.option=i.options=function(e,t){if(p(`<string|object> [object]`,[e,t],arguments.length),typeof e==`object`)Object.keys(e).forEach(t=>{i.options(t,e[t])});else{typeof t!=`object`&&(t={}),D.key[e]=!0,t.alias&&i.alias(e,t.alias);let n=t.deprecate||t.deprecated;n&&i.deprecateOption(e,n);let r=t.demand||t.required||t.require;r&&i.demand(e,r),t.demandOption&&i.demandOption(e,typeof t.demandOption==`string`?t.demandOption:void 0),t.conflicts&&i.conflicts(e,t.conflicts),`default`in t&&i.default(e,t.default),t.implies!==void 0&&i.implies(e,t.implies),t.nargs!==void 0&&i.nargs(e,t.nargs),t.config&&i.config(e,t.configParser),t.normalize&&i.normalize(e),t.choices&&i.choices(e,t.choices),t.coerce&&i.coerce(e,t.coerce),t.group&&i.group(e,t.group),(t.boolean||t.type===`boolean`)&&(i.boolean(e),t.alias&&i.boolean(t.alias)),(t.array||t.type===`array`)&&(i.array(e),t.alias&&i.array(t.alias)),(t.number||t.type===`number`)&&(i.number(e),t.alias&&i.number(t.alias)),(t.string||t.type===`string`)&&(i.string(e),t.alias&&i.string(t.alias)),(t.count||t.type===`count`)&&i.count(e),typeof t.global==`boolean`&&i.global(e,t.global),t.defaultDescription&&(D.defaultDescription[e]=t.defaultDescription),t.skipValidation&&i.skipValidation(e);let a=t.describe||t.description||t.desc;i.describe(e,a),t.hidden&&i.hide(e),t.requiresArg&&i.requiresArg(e)}return i},i.getOptions=()=>D,i.positional=function(e,t){if(p(`<string> <object>`,[e,t],arguments.length),C.resets===0)throw new r(`.positional() can only be called in a command's builder function`);let n=[`default`,`defaultDescription`,`implies`,`normalize`,`choices`,`conflicts`,`coerce`,`type`,`describe`,`desc`,`description`,`alias`];t=b(t,(e,t)=>{let r=n.indexOf(e)!==-1;return e===`type`&&[`string`,`number`,`boolean`].indexOf(t)===-1&&(r=!1),r});let o=C.fullCommands[C.fullCommands.length-1],s=o?a.cmdToParseOptions(o):{array:[],alias:{},default:{},demand:{}};return y(s).forEach(n=>{let r=s[n];Array.isArray(r)?r.indexOf(e)!==-1&&(t[n]=!0):r[e]&&!(n in t)&&(t[n]=r[e])}),i.group(e,f.getPositionalGroupName()),i.option(e,t)},i.group=function(e,t){p(`<string|array> <string>`,[e,t],arguments.length);let n=d[t]||c[t];d[t]&&delete d[t];let r={};return c[t]=(n||[]).concat(e).filter(e=>r[e]?!1:r[e]=!0),i},i.getGroups=()=>Object.assign({},c,d),i.env=function(e){return p(`[string|boolean]`,[e],arguments.length),e===!1?delete D.envPrefix:D.envPrefix=e||``,i},i.wrap=function(e){return p(`<number|null|undefined>`,[e],arguments.length),f.wrap(e),i};let B=!1;i.strict=function(e){return p(`[boolean]`,[e],arguments.length),B=e!==!1,i},i.getStrict=()=>B;let ce=!1;i.strictCommands=function(e){return p(`[boolean]`,[e],arguments.length),ce=e!==!1,i},i.getStrictCommands=()=>ce;let H=!1;i.strictOptions=function(e){return p(`[boolean]`,[e],arguments.length),H=e!==!1,i},i.getStrictOptions=()=>H;let U={};i.parserConfiguration=function(e){return p(`<object>`,[e],arguments.length),U=e,i},i.getParserConfiguration=()=>U,i.showHelp=function(t){return p(`[string|function]`,[t],arguments.length),i.parsed||i._parseArgs(e),a.hasDefaultCommand()&&(C.resets++,a.runDefaultBuilderOn(i)),f.showHelp(t),i};let W=null;i.version=function(e,t,n){let r=`version`;if(p(`[boolean|string] [string] [string]`,[e,t,n],arguments.length),W&&=(oe(W),f.version(void 0),null),arguments.length===0)n=G(),e=r;else if(arguments.length===1){if(e===!1)return i;n=e,e=r}else arguments.length===2&&(n=t,t=void 0);return W=typeof e==`string`?e:r,t||=f.deferY18nLookup(`Show version number`),f.version(n||void 0),i.boolean(W),i.describe(W,t),i};function G(){return L().version||`unknown`}let K=null;i.addHelpOpt=i.help=function(e,t){return p(`[string|boolean] [string]`,[e,t],arguments.length),K&&=(oe(K),null),arguments.length===1&&e===!1?i:(K=typeof e==`string`?e:`help`,i.boolean(K),i.describe(K,t||f.deferY18nLookup(`Show help`)),i)};let de=`show-hidden`;D.showHiddenOpt=de,i.addShowHiddenOpt=i.showHidden=function(e,t){if(p(`[string|boolean] [string]`,[e,t],arguments.length),arguments.length===1&&e===!1)return i;let n=typeof e==`string`?e:de;return i.boolean(n),i.describe(n,t||f.deferY18nLookup(`Show hidden options`)),D.showHiddenOpt=n,i},i.hide=function(e){return p(`<string>`,[e],arguments.length),D.hiddenOptions.push(e),i},i.showHelpOnFail=function(e,t){return p(`[boolean|string] [string]`,[e,t],arguments.length),f.showHelpOnFail(e,t),i};let q=!0;i.exitProcess=function(e=!0){return p(`[boolean]`,[e],arguments.length),q=e,i},i.getExitProcess=()=>q,i.showCompletionScript=function(e,t){return p(`[string] [string]`,[e,t],arguments.length),e||=i.$0,pe.log(s.generateCompletionScript(e,t||E||`completion`)),i},i.getCompletion=function(e,t){p(`<array> <function>`,[e,t],arguments.length),s.getCompletion(e,t)},i.locale=function(e){return p(`[string]`,[e],arguments.length),e?(fe=!1,x.setLocale(e),i):(J(),x.getLocale())},i.updateStrings=i.updateLocale=function(e){return p(`<object>`,[e],arguments.length),fe=!1,x.updateLocale(e),i};let fe=!0;i.detectLocale=function(e){return p(`<boolean>`,[e],arguments.length),fe=e,i},i.getDetectLocale=()=>fe;let pe={log(...e){i._hasParseCallback()||console.log(...e),w=!0,u.length&&(u+=`
|
|
66
|
+
`),u+=e.join(` `)},error(...e){i._hasParseCallback()||console.error(...e),w=!0,u.length&&(u+=`
|
|
67
|
+
`),u+=e.join(` `)}};i._getLoggerInstance=()=>pe,i._hasOutput=()=>w,i._setHasOutput=()=>{w=!0};let me;i.recommendCommands=function(e=!0){return p(`[boolean]`,[e],arguments.length),me=e,i},i.getUsageInstance=()=>f,i.getValidationInstance=()=>m,i.getCommandInstance=()=>a,i.terminalWidth=()=>(p([],0),V.process.stdColumns),Object.defineProperty(i,`argv`,{get:()=>i._parseArgs(e),enumerable:!0}),i._parseArgs=function(t,n,o,c){let l=!!o;t||=e,D.__=x.__,D.configuration=i.getParserConfiguration();let u=!!D.configuration[`populate--`],d=Object.assign({},D.configuration,{"populate--":!0}),p=V.Parser.detailed(t,Object.assign({},D,{configuration:Object.assign({"parse-positional-numbers":!1},d)})),h=p.argv;z&&(h=Object.assign({},h,z));let g=p.aliases;h.$0=i.$0,i.parsed=p;try{if(J(),n)return i._postProcess(h,u,o);K&&~[K].concat(g[K]||[]).filter(e=>e.length>1).indexOf(``+h._[h._.length-1])&&(h._.pop(),h[K]=!0);let e=a.getCommands(),d=s.completionKey in h,_=h[K]||d,v=_&&(e.length>1||e[0]!==`$0`);if(h._.length){if(e.length){let t;for(let n=c||0,r;h._[n]!==void 0;n++)if(r=String(h._[n]),~e.indexOf(r)&&r!==E){let e=a.runCommand(r,i,p,n+1);return i._postProcess(e,u)}else if(!t&&r!==E){t=r;break}if(a.hasDefaultCommand()&&!v){let e=a.runCommand(null,i,p);return i._postProcess(e,u)}me&&t&&!_&&m.recommendCommands(t,e)}E&&~h._.indexOf(E)&&!d&&(q&&F(!0),i.showCompletionScript(),i.exit(0))}else if(a.hasDefaultCommand()&&!v){let e=a.runCommand(null,i,p);return i._postProcess(e,u)}if(d){q&&F(!0),t=[].concat(t);let e=t.slice(t.indexOf(`--${s.completionKey}`)+1);return s.getCompletion(e,e=>{(e||[]).forEach(e=>{pe.log(e)}),i.exit(0)}),i._postProcess(h,!u,o)}if(w||Object.keys(h).forEach(e=>{e===K&&h[e]?(q&&F(!0),l=!0,i.showHelp(`log`),i.exit(0)):e===W&&h[e]&&(q&&F(!0),l=!0,f.showVersion(),i.exit(0))}),!l&&D.skipValidation.length>0&&(l=Object.keys(h).some(e=>D.skipValidation.indexOf(e)>=0&&h[e]===!0)),!l){if(p.error)throw new r(p.error.message);d||i._runValidation(h,g,{},p.error)}}catch(e){if(e instanceof r)f.fail(e.message,e);else throw e}return i._postProcess(h,u,o)},i._postProcess=function(e,t,n=!1){return g(e)||n?e:(t||(e=i._copyDoubleDash(e)),(i.getParserConfiguration()[`parse-positional-numbers`]||i.getParserConfiguration()[`parse-positional-numbers`]===void 0)&&(e=i._parsePositionalNumbers(e)),e)},i._copyDoubleDash=function(e){if(!e._||!e[`--`])return e;e._.push.apply(e._,e[`--`]);try{delete e[`--`]}catch{}return e},i._parsePositionalNumbers=function(e){let t=e[`--`]?e[`--`]:e._;for(let e=0,n;(n=t[e])!==void 0;e++)V.Parser.looksLikeNumber(n)&&Number.isSafeInteger(Math.floor(parseFloat(`${n}`)))&&(t[e]=Number(n));return e},i._runValidation=function(e,t,n,i,a=!1){if(i)throw new r(i.message);m.nonOptionCount(e),m.requiredArguments(e);let o=!1;ce&&(o=m.unknownCommands(e)),B&&!o?m.unknownArguments(e,t,n,a):H&&m.unknownArguments(e,t,{},!1,!1),m.customChecks(e,t),m.limitedChoices(e),m.implications(e),m.conflicting(e)};function J(){if(!fe)return;let e=V.getEnv(`LC_ALL`)||V.getEnv(`LC_MESSAGES`)||V.getEnv(`LANG`)||V.getEnv(`LANGUAGE`)||`en_US`;i.locale(e.replace(/[.:].*/,``))}return i.help(),i.version(),i}var ue=(e,t)=>V.path.relative(e,t);function W(e){return!!e&&typeof e._parseArgs==`function`}var{readFileSync:G}=u(),{inspect:K}=u(),{resolve:de}=u(),q=Yn(),fe=Xn(),pe={assert:{notStrictEqual:n.notStrictEqual,strictEqual:n.strictEqual},cliui:cr(),findUp:lr(),getEnv:e=>process.env[e],getCallerFile:ur(),getProcessArgvBin:D,inspect:K,mainFilename:(require==null?void 0:require.main)?.filename??process.cwd(),Parser:fe,path:u(),process:{argv:()=>process.argv,cwd:process.cwd,execPath:()=>process.execPath,exit:e=>{process.exit(e)},nextTick:process.nextTick,stdColumns:process.stdout.columns===void 0?null:process.stdout.columns},readFileSync:G,require,requireDirectory:dr(),stringWidth:tr(),y18n:q({directory:de(__dirname,`../locales`),updateFiles:!1})},me=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):10;if(process&&process.version&&Number(process.version.match(/v([^.]+)/)[1])<me)throw Error(`yargs supports a minimum Node.js version of ${me}. Read our version support policy: https://github.com/yargs/yargs#supported-nodejs-versions`);var J=Xn();t.exports={applyExtends:o,cjsPlatformShim:pe,Yargs:H(pe),argsert:p,globalMiddlewareFactory:ee,isPromise:g,objFilter:b,parseCommand:d,Parser:J,processArgv:O,rebase:ue,YError:r}})),pr=a(((e,t)=>{var{Yargs:n,processArgv:r}=fr();i(r.hideBin(process.argv)),t.exports=i;function i(e,t){let r=n(e,t,require);return a(r),r}function a(e){Object.keys(e).forEach(t=>{t===`argv`?i.__defineGetter__(t,e.__lookupGetter__(t)):typeof e[t]==`function`?i[t]=e[t].bind(e):(i.__defineGetter__(`$0`,()=>e.$0),i.__defineGetter__(`parsed`,()=>e.parsed))})}})),mr=a((e=>{var t=u(),n=Mn(),r=jn().Memory,i=e.Argv=function(e,t){r.call(this,e),e||={},this.type=`argv`,this.readOnly=!0,this.options=e,this.usage=t,typeof e.parseValues==`boolean`?(this.parseValues=e.parseValues,delete e.parseValues):this.parseValues=!1,typeof e.transform==`function`?(this.transform=e.transform,delete e.transform):this.transform=!1,typeof e.separator==`string`||e.separator instanceof RegExp?(this.separator=e.separator,delete e.separator):this.separator=``};t.inherits(i,r),i.prototype.loadSync=function(){return this.loadArgv(),this.store},i.prototype.loadArgv=function(){var e=this,t=a(this.options)?this.options:typeof this.options==`object`?pr()(process.argv.slice(2)).options(this.options):pr()(process.argv.slice(2)),r;if(typeof this.usage==`string`&&t.usage(this.usage),r=t.argv,r)return this.transform&&(r=n.transform(r,this.transform)),this.readOnly=!1,Object.keys(r).forEach(function(t){var i=r[t];i!==void 0&&(e.parseValues&&(i=n.parseValues(i)),e.separator?e.set(n.key.apply(n,t.split(e.separator)),i):e.set(t,i))}),this.showHelp=t.showHelp,this.help=t.help,this.readOnly=!0,this.store};function a(e){return(typeof e==`function`||typeof e==`object`)&&`argv`in e}})),hr=a((e=>{var t=u(),n=Mn(),r=jn().Memory,i=e.Env=function(e){r.call(this,e),e||={},this.type=`env`,this.readOnly=e.readOnly===void 0?!0:e.readOnly,this.whitelist=e.whitelist||[],this.separator=e.separator||``,this.lowerCase=e.lowerCase||!1,this.parseValues=e.parseValues||!1,this.transform=e.transform||!1,{}.toString.call(e.match)===`[object RegExp]`&&typeof e!=`string`&&(this.match=e.match),e instanceof Array&&(this.whitelist=e),(typeof e==`string`||e instanceof RegExp)&&(this.separator=e)};t.inherits(i,r),i.prototype.loadSync=function(){return this.loadEnv(),this.store},i.prototype.loadEnv=function(){var e=this,t=process.env;return this.prefix&&(t={},Object.keys(process.env).forEach(function(n){n.indexOf(e.prefix)===0&&(t[n.replace(e.prefix,``)]=process.env[n])})),this.lowerCase&&(t={},Object.keys(process.env).forEach(function(e){t[e.toLowerCase()]=process.env[e]})),this.transform&&(t=n.transform(t,this.transform)),this.readOnly=!1,Object.keys(t).filter(function(t){return e.match&&e.whitelist.length?t.match(e.match)||e.whitelist.indexOf(t)!==-1:e.match?t.match(e.match):!e.whitelist.length||e.whitelist.indexOf(t)!==-1}).forEach(function(r){var i=t[r];e.parseValues&&(i=n.parseValues(i)),e.separator?e.set(n.key.apply(n,r.split(e.separator)),i):e.set(r,i)}),this.readOnly=!0,this.store}})),gr=a(((e,t)=>{var n=u(),r={stringify:function(e,t,n){return JSON.stringify(e,t||null,n||2)},parse:JSON.parse};t.exports=i;function i(e){if(e||={},this.secret=typeof e==`string`?e:e.secret,this.format=e.format||r,this.alg=e.alg||`aes-256-ctr`,!this.secret)throw Error(`Secret is a required option`)}i.prototype.encrypt=function(e,t){var n=this;return Object.keys(e).reduce(function(t,r){var i=n.format.stringify(e[r]);return t[r]={alg:n.alg,value:a(i,{alg:n.alg,secret:n.secret,encs:{input:`utf8`,output:`hex`}})},t},{})},i.prototype.decrypt=function(e,t){var n=this;return Object.keys(e).reduce(function(t,r){var i=a(e[r].value,{alg:e[r].alg||n.alg,secret:n.secret,encs:{input:`hex`,output:`utf8`}});return t[r]=n.format.parse(i),t},{})};function a(e,t){var r=t.encs,i=n.createCipher(t.alg,t.secret);return i.update(e,r.input,r.output)+i.final(r.output)}})),_r=a((e=>{var t=u(),n=u(),r=u(),i=gr(),a=An(),o=jn().Memory,s=t.exists||n.exists,c=t.existsSync||n.existsSync,l=e.File=function(e){if(!e||!e.file)throw Error("Missing required option `file`");if(o.call(this,e),this.type=`file`,this.file=e.file,this.dir=e.dir||process.cwd(),this.format=e.format||a.json,this.secure=e.secure,this.spacing=e.json_spacing||e.spacing||2,this.secure){if(this.secure=Buffer.isBuffer(this.secure)||typeof this.secure==`string`?{secret:this.secure.toString()}:this.secure,this.secure.alg=this.secure.alg||`aes-256-ctr`,this.secure.secretPath&&(this.secure.secret=t.readFileSync(this.secure.secretPath,`utf8`)),!this.secure.secret)throw Error(`secure.secret option is required`);this.keys=new i({secret:this.secure.secret,alg:this.secure.alg,format:this.format})}e.search&&this.search(this.dir)};r.inherits(l,o),l.prototype.save=function(e,t){this.saveToFile(this.file,e,t)},l.prototype.saveToFile=function(e,n,r){r||(r=n,n=this.format),t.writeFile(e,this.stringify(n),r)},l.prototype.saveSync=function(){return t.writeFileSync(this.file,this.stringify()),this.store},l.prototype.load=function(e){var n=this;s(n.file,function(r){if(!r)return e(null,{});t.readFile(n.file,function(t,r){if(t)return e(t);try{var i=r.toString();i.charAt(0)===``&&(i=i.substr(1)),n.store=n.parse(i)}catch(t){return e(Error(`Error parsing your configuration file: [`+n.file+`]: `+t.message))}e(null,n.store)})})},l.prototype.loadSync=function(){if(!c(this.file))return this.store={},this.store;try{var e=t.readFileSync(this.file,`utf8`);e.charAt(0)===``&&(e=e.substr(1)),this.store=this.parse(e)}catch(e){throw Error(`Error parsing your configuration file: [`+this.file+`]: `+e.message)}return this.store},l.prototype.stringify=function(e){var t=this.store;return e||=this.format,this.secure&&(t=this.keys.encrypt(t)),e.stringify(t,null,this.spacing)},l.prototype.parse=function(e){var t=this.format.parse(e);return this.secure?this.keys.decrypt(t):t},l.prototype.search=function(e){var r=!0,i,a,o;if(e||=process.cwd(),this.file[0]===`/`)try{o=t.statSync(t.realpathSync(this.file)),o.isFile()&&(i=this.file,r=!1)}catch{}if(r&&e)try{r=t.statSync(t.realpathSync(e)).isDirectory()}catch{return!1}for(;r;)try{o=t.statSync(t.realpathSync(i=n.join(e,this.file))),r=o.isDirectory()}catch{if(a=e,e=n.dirname(e),a===e){try{o=t.statSync(t.realpathSync(i=n.join(this.dir,this.file))),o.isDirectory()&&(i=void 0)}catch{}r=!1}}return this.file=i||this.file,i}})),vr=a((e=>{var t=u(),n=jn().Memory,r=e.Literal=function(e){n.call(this,e),e||={},this.type=`literal`,this.readOnly=!0,this.store=e.store||e};t.inherits(r,n),r.prototype.loadSync=function(){return this.store}})),yr=a(((e,t)=>{var n=Mn(),r=Nn().Provider,i=t.exports=new r;i.version=(Jn(),c(Pn).default).version,i.__defineGetter__(`Argv`,function(){return mr().Argv}),i.__defineGetter__(`Env`,function(){return hr().Env}),i.__defineGetter__(`File`,function(){return _r().File}),i.__defineGetter__(`Literal`,function(){return vr().Literal}),i.__defineGetter__(`Memory`,function(){return jn().Memory}),i.key=n.key,i.path=n.path,i.loadFiles=n.loadFiles,i.loadFilesSync=n.loadFilesSync,i.formats=An(),i.Provider=r})),$=yr();async function br(){$.argv(),$.env(),$.file({file:m.getConfigPath($.get(`config`))}),m.apiHost=$.get(`YATA_API_HOST`)||`https://api.yatapp.net`;try{if(m.validateConfig($.get($.get(`token`)),$.get(`project`),$.get(`locales`),$.get(`format`),$.get(`root`),$.get(`outputPath`),$.get(`strip_empty`)))if($.get(`locale`))await m.downloadTranslation($.get(`locale`));else for(let e of m.locales)await m.downloadTranslation(e)}catch(e){e instanceof Error?l(`red`,e.message):typeof e==`string`&&l(`red`,e)}}module.exports=br;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yata-fetch",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"packageManager": "pnpm@10.4.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Adds CLI interface for importing translation files from Yata",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"type": "git",
|
|
19
19
|
"url": "git://github.com/dzbo/yata-fetch.git"
|
|
20
20
|
},
|
|
21
|
+
"files": ["dist", "bin"],
|
|
21
22
|
"bin": "./bin/yata-fetch.js",
|
|
22
23
|
"scripts": {
|
|
23
24
|
"build": "vite build",
|
package/.editorconfig
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
name: Publish to NPM
|
|
2
|
-
on:
|
|
3
|
-
push:
|
|
4
|
-
branches:
|
|
5
|
-
- master
|
|
6
|
-
|
|
7
|
-
jobs:
|
|
8
|
-
release:
|
|
9
|
-
runs-on: ubuntu-latest
|
|
10
|
-
steps:
|
|
11
|
-
- name: Checkout
|
|
12
|
-
uses: actions/checkout@v3
|
|
13
|
-
- name: Setup Node
|
|
14
|
-
uses: actions/setup-node@v3
|
|
15
|
-
with:
|
|
16
|
-
node-version: '25.5.0'
|
|
17
|
-
registry-url: 'https://registry.npmjs.org'
|
|
18
|
-
- name: Setup pnpm
|
|
19
|
-
uses: pnpm/action-setup@v4
|
|
20
|
-
- name: Install
|
|
21
|
-
run: pnpm install
|
|
22
|
-
- name: Build 🔧
|
|
23
|
-
run: pnpm build
|
|
24
|
-
- name: Configure npm
|
|
25
|
-
run: |
|
|
26
|
-
cat << EOF > "$HOME/.npmrc"
|
|
27
|
-
//registry.npmjs.org/:_authToken=$NPM_TOKEN
|
|
28
|
-
EOF
|
|
29
|
-
env:
|
|
30
|
-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
31
|
-
- name: Publish 📦
|
|
32
|
-
run: npm publish
|
|
33
|
-
env:
|
|
34
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
name: Test
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
pull_request:
|
|
5
|
-
branches:
|
|
6
|
-
- '*'
|
|
7
|
-
push:
|
|
8
|
-
branches:
|
|
9
|
-
- master
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
build-lint-test:
|
|
13
|
-
runs-on: ubuntu-latest
|
|
14
|
-
|
|
15
|
-
steps:
|
|
16
|
-
- name: Checkout
|
|
17
|
-
uses: actions/checkout@v3
|
|
18
|
-
|
|
19
|
-
- name: Setup Node
|
|
20
|
-
uses: actions/setup-node@v3
|
|
21
|
-
with:
|
|
22
|
-
node-version: '25.5.0'
|
|
23
|
-
|
|
24
|
-
- name: Setup pnpm
|
|
25
|
-
uses: pnpm/action-setup@v4
|
|
26
|
-
|
|
27
|
-
- name: Install
|
|
28
|
-
run: pnpm install
|
|
29
|
-
|
|
30
|
-
- name: Lint Scripts
|
|
31
|
-
run: pnpm lint:eslint
|
|
32
|
-
|
|
33
|
-
- name: Lint Format
|
|
34
|
-
run: pnpm lint:fmt
|
|
35
|
-
|
|
36
|
-
- name: Lint Types
|
|
37
|
-
run: pnpm lint:ts
|
|
38
|
-
|
|
39
|
-
- name: Unit Test
|
|
40
|
-
run: pnpm test
|
|
41
|
-
|
|
42
|
-
- name: Build
|
|
43
|
-
run: pnpm build
|
package/.prettierignore
DELETED
package/.prettierrc
DELETED
package/.tool-versions
DELETED
package/eslint.config.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import eslint from '@eslint/js'
|
|
2
|
-
import tseslint from 'typescript-eslint'
|
|
3
|
-
import globals from 'globals'
|
|
4
|
-
|
|
5
|
-
export default tseslint.config(
|
|
6
|
-
eslint.configs.recommended,
|
|
7
|
-
...tseslint.configs.recommended,
|
|
8
|
-
{
|
|
9
|
-
languageOptions: {
|
|
10
|
-
globals: {
|
|
11
|
-
...globals.browser,
|
|
12
|
-
...globals.node,
|
|
13
|
-
},
|
|
14
|
-
parserOptions: {
|
|
15
|
-
ecmaVersion: 'latest',
|
|
16
|
-
sourceType: 'module',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
rules: {
|
|
20
|
-
'@typescript-eslint/no-require-imports': 'off',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
ignores: ['dist/**', 'node_modules/**'],
|
|
25
|
-
}
|
|
26
|
-
)
|
package/src/cli.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { IFileOptions } from 'nconf'
|
|
2
|
-
import yata from './yata'
|
|
3
|
-
import log from './log'
|
|
4
|
-
|
|
5
|
-
const nconf = require('nconf')
|
|
6
|
-
|
|
7
|
-
export default async function () {
|
|
8
|
-
// read argv for potential custom config path
|
|
9
|
-
nconf.argv()
|
|
10
|
-
|
|
11
|
-
// read ENV for token
|
|
12
|
-
nconf.env()
|
|
13
|
-
|
|
14
|
-
// load config path
|
|
15
|
-
nconf.file({ file: yata.getConfigPath(nconf.get('config')) } as IFileOptions)
|
|
16
|
-
|
|
17
|
-
// setup API host
|
|
18
|
-
yata.apiHost = nconf.get('YATA_API_HOST') || 'https://api.yatapp.net'
|
|
19
|
-
|
|
20
|
-
try {
|
|
21
|
-
if (
|
|
22
|
-
yata.validateConfig(
|
|
23
|
-
nconf.get(nconf.get('token')),
|
|
24
|
-
nconf.get('project'),
|
|
25
|
-
nconf.get('locales'),
|
|
26
|
-
nconf.get('format'),
|
|
27
|
-
nconf.get('root'),
|
|
28
|
-
nconf.get('outputPath'),
|
|
29
|
-
nconf.get('strip_empty')
|
|
30
|
-
)
|
|
31
|
-
) {
|
|
32
|
-
// if passed locale explicit download just one
|
|
33
|
-
if (nconf.get('locale')) {
|
|
34
|
-
await yata.downloadTranslation(nconf.get('locale'))
|
|
35
|
-
} else {
|
|
36
|
-
for (const locale of yata.locales) {
|
|
37
|
-
await yata.downloadTranslation(locale)
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
} catch (error) {
|
|
42
|
-
if (error instanceof Error) {
|
|
43
|
-
log('red', error.message)
|
|
44
|
-
} else if (typeof error === 'string') {
|
|
45
|
-
log('red', error)
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
package/src/log.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
type Color = 'red' | 'green' | 'yellow'
|
|
2
|
-
|
|
3
|
-
export default function (color: Color, message: string) {
|
|
4
|
-
let code
|
|
5
|
-
|
|
6
|
-
switch (color) {
|
|
7
|
-
case 'red':
|
|
8
|
-
code = '\x1b[31m'
|
|
9
|
-
break
|
|
10
|
-
case 'green':
|
|
11
|
-
code = '\x1b[32m'
|
|
12
|
-
break
|
|
13
|
-
case 'yellow':
|
|
14
|
-
code = '\x1b[33m'
|
|
15
|
-
break
|
|
16
|
-
|
|
17
|
-
default:
|
|
18
|
-
code = '\x1b[37m' // white
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return console.log(`${code}%s\x1b[0m`, message)
|
|
22
|
-
}
|
package/src/vite-env.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|
package/src/yata.ts
DELETED
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import log from './log'
|
|
2
|
-
|
|
3
|
-
import { IncomingMessage } from 'http'
|
|
4
|
-
const https = require('https')
|
|
5
|
-
const path = require('path')
|
|
6
|
-
const fs = require('fs')
|
|
7
|
-
|
|
8
|
-
type Locale = string
|
|
9
|
-
type Format = 'yml' | 'json'
|
|
10
|
-
|
|
11
|
-
export default {
|
|
12
|
-
config: null,
|
|
13
|
-
defaultConfigPath: './yata.json',
|
|
14
|
-
configPath: '',
|
|
15
|
-
token: '',
|
|
16
|
-
project: '',
|
|
17
|
-
locales: [] as string[],
|
|
18
|
-
format: 'yml',
|
|
19
|
-
root: false,
|
|
20
|
-
outputPath: 'translations',
|
|
21
|
-
stripEmpty: false,
|
|
22
|
-
apiHost: '',
|
|
23
|
-
|
|
24
|
-
getConfigPath(configPath: string) {
|
|
25
|
-
if (configPath) {
|
|
26
|
-
this.configPath = configPath
|
|
27
|
-
} else {
|
|
28
|
-
this.configPath = this.defaultConfigPath
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return this.configPath
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
validateConfig(
|
|
35
|
-
token?: string,
|
|
36
|
-
project?: string,
|
|
37
|
-
locales?: Locale[],
|
|
38
|
-
format?: Format,
|
|
39
|
-
root?: boolean,
|
|
40
|
-
outputPath?: string,
|
|
41
|
-
stripEmpty?: boolean
|
|
42
|
-
) {
|
|
43
|
-
if (!token) {
|
|
44
|
-
throw new Error('No `token` in ENV')
|
|
45
|
-
} else {
|
|
46
|
-
this.token = token
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (!project) {
|
|
50
|
-
throw new Error('No `project` in config file')
|
|
51
|
-
} else {
|
|
52
|
-
this.project = project
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (!Array.isArray(locales) || locales.length === 0) {
|
|
56
|
-
throw new Error('No `locales` in config file')
|
|
57
|
-
} else {
|
|
58
|
-
this.locales = locales
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if (format && typeof format === 'string') {
|
|
62
|
-
this.format = format
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
if (root && typeof root === 'boolean') {
|
|
66
|
-
this.root = root
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
if (outputPath && typeof outputPath === 'string') {
|
|
70
|
-
this.outputPath = outputPath
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
if (stripEmpty && typeof stripEmpty === 'boolean') {
|
|
74
|
-
this.stripEmpty = stripEmpty
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
return true
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
normalizeLocale(locale: Locale) {
|
|
81
|
-
if (!locale) {
|
|
82
|
-
return
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
const localeSegments = locale.replace('-', '_').split('_')
|
|
86
|
-
const newLocale = []
|
|
87
|
-
newLocale.push(localeSegments[0].toLowerCase())
|
|
88
|
-
|
|
89
|
-
// two segment locale
|
|
90
|
-
if (localeSegments[1]) {
|
|
91
|
-
newLocale.push(localeSegments[1].toUpperCase())
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return newLocale.join('_')
|
|
95
|
-
},
|
|
96
|
-
|
|
97
|
-
downloadTranslation(locale: Locale) {
|
|
98
|
-
const normalizedLocale = this.normalizeLocale(locale)
|
|
99
|
-
|
|
100
|
-
if (!normalizedLocale) {
|
|
101
|
-
throw new Error('No locale passed to download function')
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// if output folder doesn't exist we create it
|
|
105
|
-
if (!fs.existsSync(this.outputPath)) {
|
|
106
|
-
fs.mkdirSync(this.outputPath)
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
const fileName = `${normalizedLocale}.${this.format}`
|
|
110
|
-
const filePath = path.join(process.cwd(), `${this.outputPath}/${fileName}`)
|
|
111
|
-
const url = `${this.apiHost}/api/v1/project/${this.project}/${locale}/${this.format}?apiToken=${this.token}&root=${this.root}&strip_empty=${this.stripEmpty}`
|
|
112
|
-
|
|
113
|
-
let bufferFile: Buffer
|
|
114
|
-
|
|
115
|
-
// if file exist we grab it's size
|
|
116
|
-
if (fs.existsSync(filePath)) {
|
|
117
|
-
bufferFile = fs.readFileSync(filePath)
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
// we start stream
|
|
121
|
-
const file = fs.createWriteStream(filePath)
|
|
122
|
-
|
|
123
|
-
return new Promise((resolve, reject) => {
|
|
124
|
-
https
|
|
125
|
-
.get(url, (response: IncomingMessage) => {
|
|
126
|
-
const { statusCode } = response
|
|
127
|
-
|
|
128
|
-
if (statusCode !== 200) {
|
|
129
|
-
return reject(`Request Failed.\nStatus Code: ${statusCode}`)
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
response.pipe(file)
|
|
133
|
-
file.on('finish', () => {
|
|
134
|
-
const newBufferFile = fs.readFileSync(filePath)
|
|
135
|
-
|
|
136
|
-
if (bufferFile && bufferFile.equals(newBufferFile)) {
|
|
137
|
-
log('yellow', `Generating "${locale}" translation. Skipped.`)
|
|
138
|
-
} else {
|
|
139
|
-
log('green', `Generating "${locale}" translation. Done.`)
|
|
140
|
-
}
|
|
141
|
-
resolve(true)
|
|
142
|
-
})
|
|
143
|
-
})
|
|
144
|
-
.on('error', (error: Error) => {
|
|
145
|
-
if (error instanceof Error) {
|
|
146
|
-
log('red', error.message)
|
|
147
|
-
} else if (typeof error === 'string') {
|
|
148
|
-
log('red', error)
|
|
149
|
-
}
|
|
150
|
-
})
|
|
151
|
-
})
|
|
152
|
-
},
|
|
153
|
-
}
|
package/test/fixtures/yata.json
DELETED
package/test/unit/yata.spec.js
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { expect, it, describe } from 'vitest'
|
|
2
|
-
import yata from '../../src/yata'
|
|
3
|
-
|
|
4
|
-
describe('yata library', function () {
|
|
5
|
-
describe('getConfigPath function', function () {
|
|
6
|
-
it('return default config path', function () {
|
|
7
|
-
expect(yata.getConfigPath()).to.equal('./yata.json')
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
it('return custom config path', function () {
|
|
11
|
-
expect(yata.getConfigPath('./custom-yata.json')).to.equal(
|
|
12
|
-
'./custom-yata.json'
|
|
13
|
-
)
|
|
14
|
-
})
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
describe('validateConfig function', function () {
|
|
18
|
-
it('return exception if no token in ENV', function () {
|
|
19
|
-
expect(() => {
|
|
20
|
-
yata.validateConfig()
|
|
21
|
-
}).to.throw('token')
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
it('return exception if no project', function () {
|
|
25
|
-
expect(() => {
|
|
26
|
-
yata.validateConfig('token')
|
|
27
|
-
}).to.throw('project')
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
it('return exception if empty locales', function () {
|
|
31
|
-
expect(() => {
|
|
32
|
-
yata.validateConfig('token', 'project', [])
|
|
33
|
-
}).to.throw('locales')
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
it('return exception if no locales', function () {
|
|
37
|
-
expect(() => {
|
|
38
|
-
yata.validateConfig('token', 'project')
|
|
39
|
-
}).to.throw('locales')
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
it('return exception if locales as string', function () {
|
|
43
|
-
expect(() => {
|
|
44
|
-
yata.validateConfig('token', 'project', 'pl_PL')
|
|
45
|
-
}).to.throw('locales')
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
it('passes validaiton when using only required params', function () {
|
|
49
|
-
const validation = yata.validateConfig('token', 'project', ['pl_PL'])
|
|
50
|
-
|
|
51
|
-
expect(validation).to.be.true
|
|
52
|
-
expect(yata.format).to.equal('yml')
|
|
53
|
-
expect(yata.root).to.be.false
|
|
54
|
-
expect(yata.stripEmpty).to.be.false
|
|
55
|
-
expect(yata.outputPath).to.be.equal('translations')
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
it('passes validaiton when passing all params', function () {
|
|
59
|
-
const validation = yata.validateConfig(
|
|
60
|
-
'token',
|
|
61
|
-
'project',
|
|
62
|
-
['pl_PL'],
|
|
63
|
-
'json',
|
|
64
|
-
true,
|
|
65
|
-
'locales',
|
|
66
|
-
true
|
|
67
|
-
)
|
|
68
|
-
|
|
69
|
-
expect(validation).to.be.true
|
|
70
|
-
expect(yata.token).to.equal('token')
|
|
71
|
-
expect(yata.project).to.equal('project')
|
|
72
|
-
expect(yata.locales).to.deep.equal(['pl_PL'])
|
|
73
|
-
expect(yata.format).to.equal('json')
|
|
74
|
-
expect(yata.root).to.be.true
|
|
75
|
-
expect(yata.stripEmpty).to.be.true
|
|
76
|
-
expect(yata.outputPath).to.be.equal('locales')
|
|
77
|
-
})
|
|
78
|
-
})
|
|
79
|
-
|
|
80
|
-
describe('downloadTranslation function', function () {
|
|
81
|
-
it('throw exception if no locale', function () {
|
|
82
|
-
expect(() => yata.downloadTranslation()).to.throw('locale')
|
|
83
|
-
})
|
|
84
|
-
})
|
|
85
|
-
|
|
86
|
-
describe('normalizeLocale function', function () {
|
|
87
|
-
it('work with undefined value', function () {
|
|
88
|
-
expect(() => yata.normalizeLocale()).to.not.throw()
|
|
89
|
-
})
|
|
90
|
-
|
|
91
|
-
it('work with null value', function () {
|
|
92
|
-
expect(() => yata.normalizeLocale(null)).to.not.throw()
|
|
93
|
-
})
|
|
94
|
-
|
|
95
|
-
it('work with empty string value', function () {
|
|
96
|
-
expect(yata.normalizeLocale('')).to.equal()
|
|
97
|
-
})
|
|
98
|
-
|
|
99
|
-
it('work ISO notation', function () {
|
|
100
|
-
expect(yata.normalizeLocale('en-us')).to.equal('en_US')
|
|
101
|
-
})
|
|
102
|
-
|
|
103
|
-
it('work with simple notation', function () {
|
|
104
|
-
expect(yata.normalizeLocale('EN')).to.equal('en')
|
|
105
|
-
})
|
|
106
|
-
|
|
107
|
-
it('work with already correct version', function () {
|
|
108
|
-
expect(yata.normalizeLocale('en_US')).to.equal('en_US')
|
|
109
|
-
})
|
|
110
|
-
})
|
|
111
|
-
})
|
package/tsconfig.json
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ESNext",
|
|
4
|
-
"useDefineForClassFields": true,
|
|
5
|
-
"module": "ESNext",
|
|
6
|
-
"lib": ["ESNext", "DOM"],
|
|
7
|
-
"moduleResolution": "bundler",
|
|
8
|
-
"strict": true,
|
|
9
|
-
"sourceMap": true,
|
|
10
|
-
"resolveJsonModule": true,
|
|
11
|
-
"isolatedModules": true,
|
|
12
|
-
"esModuleInterop": true,
|
|
13
|
-
"noEmit": true,
|
|
14
|
-
"noUnusedLocals": true,
|
|
15
|
-
"noUnusedParameters": true,
|
|
16
|
-
"noImplicitReturns": true,
|
|
17
|
-
"skipLibCheck": true,
|
|
18
|
-
"types": ["node"]
|
|
19
|
-
},
|
|
20
|
-
"include": ["src"]
|
|
21
|
-
}
|
package/vite.config.js
DELETED