@master4n/master-cli 2.1.6 → 2.1.7

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.
Files changed (2) hide show
  1. package/bin/index.js +1 -1
  2. package/package.json +1 -1
package/bin/index.js CHANGED
@@ -31,5 +31,5 @@ let C;!function(e){e.BOOLEAN="boolean",e.STRING="string",e.NUMBER="number",e.ARR
31
31
  * Copyright (c) 2016, Contributors
32
32
  * SPDX-License-Identifier: ISC
33
33
  */
34
- var U,W,J;const Q=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,G=null!==(W=null===(U=null===process||void 0===process?void 0:process.versions)||void 0===U?void 0:U.node)&&void 0!==W?W:null===(J=null===process||void 0===process?void 0:process.version)||void 0===J?void 0:J.slice(1);if(G){if(Number(G.match(/^([^.]+)/)[1])<Q)throw Error(`yargs parser supports a minimum Node.js version of ${Q}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`)}const V=process?process.env:{},Z=new class{constructor(e){C=e}parse(e,t){const 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),o=function(e){if(Array.isArray(e))return e.map((e=>"string"!=typeof e?e+"":e));e=e.trim();let t=0,n=null,o=null,r=null;const s=[];for(let i=0;i<e.length;i++)n=o,o=e.charAt(i)," "!==o||r?(o===r?r=null:"'"!==o&&'"'!==o||r||(r=o),s[t]||(s[t]=""),s[t]+=o):" "!==n&&t++;return s}(e),r="string"==typeof e,s=function(e){const t=[],n=Object.create(null);let o=!0;Object.keys(e).forEach((function(n){t.push([].concat(e[n],n))}));for(;o;){o=!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-1!==t[n].indexOf(e)})).length){t[e]=t[e].concat(t[n]),t.splice(n,1),o=!0;break}}}return t.forEach((function(e){const t=(e=e.filter((function(e,t,n){return n.indexOf(e)===t}))).pop();void 0!==t&&"string"==typeof t&&(n[t]=e)})),n}(Object.assign(Object.create(null),n.alias)),i=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),a=Object.assign(Object.create(null),n.default),c=n.configObjects||[],l=n.envPrefix,u=i["populate--"],p=u?"--":"_",f=Object.create(null),d=Object.create(null),m=n.__||C.format,h={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:[]},y=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,g=new RegExp("^--"+i["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach((function(e){const t="object"==typeof e?e.key:e,n=Object.keys(e).map((function(e){return{boolean:"bools",string:"strings",number:"numbers"}[e]})).filter(Boolean).pop();n&&(h[n][t]=!0),h.arrays[t]=!0,h.keys.push(t)})),[].concat(n.boolean||[]).filter(Boolean).forEach((function(e){h.bools[e]=!0,h.keys.push(e)})),[].concat(n.string||[]).filter(Boolean).forEach((function(e){h.strings[e]=!0,h.keys.push(e)})),[].concat(n.number||[]).filter(Boolean).forEach((function(e){h.numbers[e]=!0,h.keys.push(e)})),[].concat(n.count||[]).filter(Boolean).forEach((function(e){h.counts[e]=!0,h.keys.push(e)})),[].concat(n.normalize||[]).filter(Boolean).forEach((function(e){h.normalize[e]=!0,h.keys.push(e)})),"object"==typeof n.narg&&Object.entries(n.narg).forEach((([e,t])=>{"number"==typeof t&&(h.nargs[e]=t,h.keys.push(e))})),"object"==typeof n.coerce&&Object.entries(n.coerce).forEach((([e,t])=>{"function"==typeof t&&(h.coercions[e]=t,h.keys.push(e))})),void 0!==n.config&&(Array.isArray(n.config)||"string"==typeof n.config?[].concat(n.config).filter(Boolean).forEach((function(e){h.configs[e]=!0})):"object"==typeof n.config&&Object.entries(n.config).forEach((([e,t])=>{"boolean"!=typeof t&&"function"!=typeof t||(h.configs[e]=t)}))),function(...e){e.forEach((function(e){Object.keys(e||{}).forEach((function(e){h.aliases[e]||(h.aliases[e]=[].concat(s[e]||[]),h.aliases[e].concat(e).forEach((function(t){if(/-/.test(t)&&i["camel-case-expansion"]){const n=L(t);n!==e&&-1===h.aliases[e].indexOf(n)&&(h.aliases[e].push(n),f[n]=!0)}})),h.aliases[e].concat(e).forEach((function(t){if(t.length>1&&/[A-Z]/.test(t)&&i["camel-case-expansion"]){const n=q(t,"-");n!==e&&-1===h.aliases[e].indexOf(n)&&(h.aliases[e].push(n),f[n]=!0)}})),h.aliases[e].forEach((function(t){h.aliases[t]=[e].concat(h.aliases[e].filter((function(e){return t!==e})))})))}))}))}(n.key,s,n.default,h.arrays),Object.keys(a).forEach((function(e){(h.aliases[e]||[]).forEach((function(t){a[t]=a[e]}))}));let b=null;Object.keys(h.counts).find((e=>N(e,h.arrays)?(b=Error(m("Invalid configuration: %s, opts.count excludes opts.array.",e)),!0):!!N(e,h.nargs)&&(b=Error(m("Invalid configuration: %s, opts.count excludes opts.narg.",e)),!0)));let v=[];const w=Object.assign(Object.create(null),{_:[]}),S={};for(let e=0;e<o.length;e++){const t=o[e],n=t.replace(/^-{3,}/,"---");let r,s,a,c,l,u;if("--"!==t&&/^-/.test(t)&&F(t))x(t);else{if(n.match(/^---+(=|$)/)){x(t);continue}if(t.match(/^--.+=/)||!i["short-option-groups"]&&t.match(/^-.+=/))c=t.match(/^--?([^=]+)=([\s\S]*)$/),null!==c&&Array.isArray(c)&&c.length>=3&&(N(c[1],h.arrays)?e=$(e,c[1],o,c[2]):!1!==N(c[1],h.nargs)?e=j(e,c[1],o,c[2]):E(c[1],c[2],!0));else if(t.match(g)&&i["boolean-negation"])c=t.match(g),null!==c&&Array.isArray(c)&&c.length>=2&&(s=c[1],E(s,!!N(s,h.arrays)&&[!1]));else if(t.match(/^--.+/)||!i["short-option-groups"]&&t.match(/^-[^-]+/))c=t.match(/^--?(.+)/),null!==c&&Array.isArray(c)&&c.length>=2&&(s=c[1],N(s,h.arrays)?e=$(e,s,o):!1!==N(s,h.nargs)?e=j(e,s,o):(l=o[e+1],void 0===l||l.match(/^-/)&&!l.match(y)||N(s,h.bools)||N(s,h.counts)?/^(true|false)$/.test(l)?(E(s,l),e++):E(s,z(s)):(E(s,l),e++)));else if(t.match(/^-.\..+=/))c=t.match(/^-([^=]+)=([\s\S]*)$/),null!==c&&Array.isArray(c)&&c.length>=3&&E(c[1],c[2]);else if(t.match(/^-.\..+/)&&!t.match(y))l=o[e+1],c=t.match(/^-(.\..+)/),null!==c&&Array.isArray(c)&&c.length>=2&&(s=c[1],void 0===l||l.match(/^-/)||N(s,h.bools)||N(s,h.counts)?E(s,z(s)):(E(s,l),e++));else if(t.match(/^-[^-]+/)&&!t.match(y)){a=t.slice(1,-1).split(""),r=!1;for(let n=0;n<a.length;n++){if(l=t.slice(n+2),a[n+1]&&"="===a[n+1]){u=t.slice(n+3),s=a[n],N(s,h.arrays)?e=$(e,s,o,u):!1!==N(s,h.nargs)?e=j(e,s,o,u):E(s,u),r=!0;break}if("-"!==l){if(/[A-Za-z]/.test(a[n])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(l)&&!1===N(l,h.bools)){E(a[n],l),r=!0;break}if(a[n+1]&&a[n+1].match(/\W/)){E(a[n],l),r=!0;break}E(a[n],z(a[n]))}else E(a[n],l)}s=t.slice(-1)[0],r||"-"===s||(N(s,h.arrays)?e=$(e,s,o):!1!==N(s,h.nargs)?e=j(e,s,o):(l=o[e+1],void 0===l||/^(-|--)[^-]/.test(l)&&!l.match(y)||N(s,h.bools)||N(s,h.counts)?/^(true|false)$/.test(l)?(E(s,l),e++):E(s,z(s)):(E(s,l),e++)))}else if(t.match(/^-[0-9]$/)&&t.match(y)&&N(t.slice(1),h.bools))s=t.slice(1),E(s,z(s));else{if("--"===t){v=o.slice(e+1);break}if(i["halt-at-non-option"]){v=o.slice(e);break}x(t)}}}function x(e){const t=A("_",e);"string"!=typeof t&&"number"!=typeof t||w._.push(t)}function j(e,t,n,o){let r,s=N(t,h.nargs);if(s="number"!=typeof s||isNaN(s)?1:s,0===s)return U(o)||(b=Error(m("Argument unexpected for: %s",t))),E(t,z(t)),e;let a=U(o)?0:1;if(i["nargs-eats-options"])n.length-(e+1)+a<s&&(b=Error(m("Not enough arguments following: %s",t))),a=s;else{for(r=e+1;r<n.length&&(!n[r].match(/^-[^0-9]/)||n[r].match(y)||F(n[r]));r++)a++;a<s&&(b=Error(m("Not enough arguments following: %s",t)))}let c=Math.min(a,s);for(!U(o)&&c>0&&(E(t,o),c--),r=e+1;r<c+e+1;r++)E(t,n[r]);return e+c}function $(e,t,n,o){let s=[],c=o||n[e+1];const l=N(t,h.nargs);if(N(t,h.bools)&&!/^(true|false)$/.test(c))s.push(!0);else if(U(c)||U(o)&&/^-/.test(c)&&!y.test(c)&&!F(c)){if(void 0!==a[t]){const e=a[t];s=Array.isArray(e)?e:[e]}}else{U(o)||s.push(k(t,o,!0));for(let o=e+1;o<n.length&&!(!i["greedy-arrays"]&&s.length>0||l&&"number"==typeof l&&s.length>=l)&&(c=n[o],!/^-/.test(c)||y.test(c)||F(c));o++)e=o,s.push(k(t,c,r))}return"number"==typeof l&&(l&&s.length<l||isNaN(l)&&0===s.length)&&(b=Error(m("Not enough arguments following: %s",t))),E(t,s),e}function E(e,t,n=r){if(/-/.test(e)&&i["camel-case-expansion"]){const t=e.split(".").map((function(e){return L(e)})).join(".");O(e,t)}const o=k(e,t,n),s=e.split(".");if(_(w,s,o),h.aliases[e]&&h.aliases[e].forEach((function(e){const t=e.split(".");_(w,t,o)})),s.length>1&&i["dot-notation"]&&(h.aliases[s[0]]||[]).forEach((function(t){let n=t.split(".");const r=[].concat(s);r.shift(),n=n.concat(r),(h.aliases[e]||[]).includes(n.join("."))||_(w,n,o)})),N(e,h.normalize)&&!N(e,h.arrays)){[e].concat(h.aliases[e]||[]).forEach((function(e){Object.defineProperty(S,e,{enumerable:!0,get:()=>t,set(e){t="string"==typeof e?C.normalize(e):e}})}))}}function O(e,t){h.aliases[e]&&h.aliases[e].length||(h.aliases[e]=[t],f[t]=!0),h.aliases[t]&&h.aliases[t].length||O(t,e)}function k(e,t,n){n&&(t=function(e){return"string"!=typeof e||"'"!==e[0]&&'"'!==e[0]||e[e.length-1]!==e[0]?e:e.substring(1,e.length-1)}(t)),(N(e,h.bools)||N(e,h.counts))&&"string"==typeof t&&(t="true"===t);let o=Array.isArray(t)?t.map((function(t){return A(e,t)})):A(e,t);return N(e,h.counts)&&(U(o)||"boolean"==typeof o)&&(o=B()),N(e,h.normalize)&&N(e,h.arrays)&&(o=Array.isArray(t)?t.map((e=>C.normalize(e))):C.normalize(t)),o}function A(e,t){if(!i["parse-positional-numbers"]&&"_"===e)return t;if(!N(e,h.strings)&&!N(e,h.bools)&&!Array.isArray(t)){(H(t)&&i["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${t}`)))||!U(t)&&N(e,h.numbers))&&(t=Number(t))}return t}function M(e,t){Object.keys(e).forEach((function(n){const o=e[n],r=t?t+"."+n:n;"object"==typeof o&&null!==o&&!Array.isArray(o)&&i["dot-notation"]?M(o,r):(!T(w,r.split("."))||N(r,h.arrays)&&i["combine-arrays"])&&E(r,o)}))}function D(e,t){if(void 0===l)return;const n="string"==typeof l?l:"",o=C.env();Object.keys(o).forEach((function(r){if(""===n||0===r.lastIndexOf(n,0)){const s=r.split("__").map((function(e,t){return 0===t&&(e=e.substring(n.length)),L(e)}));(t&&h.configs[s.join(".")]||!t)&&!T(e,s)&&E(s.join("."),o[r])}}))}function Y(e,t,n,o=!1){Object.keys(n).forEach((function(r){T(e,r.split("."))||(_(e,r.split("."),n[r]),o&&(d[r]=!0),(t[r]||[]).forEach((function(t){T(e,t.split("."))||_(e,t.split("."),n[r])})))}))}function T(e,t){let n=e;i["dot-notation"]||(t=[t.join(".")]),t.slice(0,-1).forEach((function(e){n=n[e]||{}}));const o=t[t.length-1];return"object"==typeof n&&o in n}function _(e,t,n){let o=e;i["dot-notation"]||(t=[t.join(".")]),t.slice(0,-1).forEach((function(e){e=I(e),"object"==typeof o&&void 0===o[e]&&(o[e]={}),"object"!=typeof o[e]||Array.isArray(o[e])?(Array.isArray(o[e])?o[e].push({}):o[e]=[o[e],{}],o=o[e][o[e].length-1]):o=o[e]}));const r=I(t[t.length-1]),s=N(t.join("."),h.arrays),a=Array.isArray(n);let c=i["duplicate-arguments-array"];!c&&N(r,h.nargs)&&(c=!0,(!U(o[r])&&1===h.nargs[r]||Array.isArray(o[r])&&o[r].length===h.nargs[r])&&(o[r]=void 0)),n===B()?o[r]=B(o[r]):Array.isArray(o[r])?c&&s&&a?o[r]=i["flatten-duplicate-arrays"]?o[r].concat(n):(Array.isArray(o[r][0])?o[r]:[o[r]]).concat([n]):c||Boolean(s)!==Boolean(a)?o[r]=o[r].concat([n]):o[r]=n:void 0===o[r]&&s?o[r]=a?n:[n]:!c||void 0===o[r]||N(r,h.counts)||N(r,h.bools)?o[r]=n:o[r]=[o[r],n]}function N(e,t){const n=[].concat(h.aliases[e]||[],e),o=Object.keys(t),r=n.find((e=>o.includes(e)));return!!r&&t[r]}function R(e){const t=Object.keys(h);return[].concat(t.map((e=>h[e]))).some((function(t){return Array.isArray(t)?t.includes(e):t[e]}))}function F(e){return i["unknown-options-as-args"]&&function(e){if(e=e.replace(/^-{3,}/,"--"),e.match(y))return!1;if(function(e){if(e.match(y)||!e.match(/^-[^-]+/))return!1;let t,n=!0;const o=e.slice(1).split("");for(let r=0;r<o.length;r++){if(t=e.slice(r+2),!R(o[r])){n=!1;break}if(o[r+1]&&"="===o[r+1]||"-"===t||/[A-Za-z]/.test(o[r])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(t)||o[r+1]&&o[r+1].match(/\W/))break}return n}(e))return!1;return!function(e,...t){return[].concat(...t).some((function(t){const n=e.match(t);return n&&R(n[1])}))}(e,/^-+([^=]+?)=[\s\S]*$/,g,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}(e)}function z(e){return N(e,h.bools)||N(e,h.counts)||!(`${e}`in a)?function(e){return{[P.BOOLEAN]:!0,[P.STRING]:"",[P.NUMBER]:void 0,[P.ARRAY]:[]}[e]}(function(e){let t=P.BOOLEAN;N(e,h.strings)?t=P.STRING:N(e,h.numbers)?t=P.NUMBER:N(e,h.bools)?t=P.BOOLEAN:N(e,h.arrays)&&(t=P.ARRAY);return t}(e)):a[e]}function U(e){return void 0===e}return D(w,!0),D(w,!1),function(e){const t=Object.create(null);Y(t,h.aliases,a),Object.keys(h.configs).forEach((function(n){const o=e[n]||t[n];if(o)try{let e=null;const t=C.resolve(C.cwd(),o),r=h.configs[n];if("function"==typeof r){try{e=r(t)}catch(t){e=t}if(e instanceof Error)return void(b=e)}else e=C.require(t);M(e)}catch(t){"PermissionDenied"===t.name?b=t:e[n]&&(b=Error(m("Invalid JSON config file: %s",o)))}}))}(w),void 0!==c&&c.forEach((function(e){M(e)})),Y(w,h.aliases,a,!0),function(e){let t;const n=new Set;Object.keys(e).forEach((function(o){if(!n.has(o)&&(t=N(o,h.coercions),"function"==typeof t))try{const r=A(o,t(e[o]));[].concat(h.aliases[o]||[],o).forEach((t=>{n.add(t),e[t]=r}))}catch(e){b=e}}))}(w),i["set-placeholder-key"]&&function(e){h.keys.forEach((t=>{~t.indexOf(".")||void 0===e[t]&&(e[t]=void 0)}))}(w),Object.keys(h.counts).forEach((function(e){T(w,e.split("."))||E(e,0)})),u&&v.length&&(w[p]=[]),v.forEach((function(e){w[p].push(e)})),i["camel-case-expansion"]&&i["strip-dashed"]&&Object.keys(w).filter((e=>"--"!==e&&e.includes("-"))).forEach((e=>{delete w[e]})),i["strip-aliased"]&&[].concat(...Object.keys(s).map((e=>s[e]))).forEach((e=>{i["camel-case-expansion"]&&e.includes("-")&&delete w[e.split(".").map((e=>L(e))).join(".")],delete w[e]})),{aliases:Object.assign({},h.aliases),argv:Object.assign(S,w),configuration:i,defaulted:Object.assign({},d),error:b,newAliases:Object.assign({},f)}}}({cwd:process.cwd,env:()=>V,format:t,normalize:r,resolve:s,require:e=>{if("undefined"!=typeof require)return require(e);if(e.match(/\.json$/))return JSON.parse(p(e,"utf8"));throw Error("only .json config files are supported in ESM")}}),K=function(e,t){return Z.parse(e.slice(),t).argv};K.detailed=function(e,t){return Z.parse(e.slice(),t)},K.camelCase=L,K.decamelize=q,K.looksLikeNumber=H;new RegExp("(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");var X={fs:{readFileSync:p,writeFile:m},format:t,resolve:s,exists:e=>{try{return f(e).isFile()}catch(e){return!1}}};let ee;class te{constructor(e){e=e||{},this.directory=e.directory||"./locales",this.updateFiles="boolean"!=typeof e.updateFiles||e.updateFiles,this.locale=e.locale||"en",this.fallbackToLanguage="boolean"!=typeof e.fallbackToLanguage||e.fallbackToLanguage,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if("string"!=typeof arguments[0])return this._taggedLiteral(arguments[0],...arguments);const t=e.shift();let n=function(){};return"function"==typeof e[e.length-1]&&(n=e.pop()),n=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(),ee.format.apply(ee.format,[this.cache[this.locale][t]||t].concat(e))}__n(){const e=Array.prototype.slice.call(arguments),t=e.shift(),n=e.shift(),o=e.shift();let r=function(){};"function"==typeof e[e.length-1]&&(r=e.pop()),this.cache[this.locale]||this._readLocaleFile();let s=1===o?t:n;if(this.cache[this.locale][t]){s=this.cache[this.locale][t][1===o?"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:r})):r();const i=[s];return~s.indexOf("%d")&&i.push(o),ee.format.apply(ee.format,i.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(const 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,o){const r=t[o+1];n+=e,void 0!==r&&(n+="%s")})),this.__.apply(this,[n].concat([].slice.call(t,1)))}_enqueueWrite(e){this.writeQueue.push(e),1===this.writeQueue.length&&this._processWriteQueue()}_processWriteQueue(){const e=this,t=this.writeQueue[0],n=t.directory,o=t.locale,r=t.cb,s=this._resolveLocaleFile(n,o),i=JSON.stringify(this.cache[o],null,2);ee.fs.writeFile(s,i,"utf-8",(function(t){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),r(t)}))}_readLocaleFile(){let e={};const t=this._resolveLocaleFile(this.directory,this.locale);try{ee.fs.readFileSync&&(e=JSON.parse(ee.fs.readFileSync(t,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+t),"ENOENT"!==n.code)throw n;e={}}this.cache[this.locale]=e}_resolveLocaleFile(e,t){let n=ee.resolve(e,"./",t+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~t.lastIndexOf("_")){const o=ee.resolve(e,"./",t.split("_")[0]+".json");this._fileExistsSync(o)&&(n=o)}return n}_fileExistsSync(e){return ee.exists(e)}}let ne;try{ne=g(import.meta.url)}catch(e){ne=process.cwd()}ne.substring(0,ne.lastIndexOf("node_modules"))||process.cwd(),process.cwd,process.exit,process.nextTick,void 0!==process.stdout.columns&&process.stdout.columns,function(e,t){ee=t;const n=new te(e);n.__.bind(n),n.__n.bind(n),n.setLocale.bind(n),n.getLocale.bind(n),n.updateLocale.bind(n),n.locale}({directory:s(ne,"../../../locales"),updateFiles:!1},X);function oe(){return{info:e=>{return console.log(`${b.blue("INFO")} [${b.magenta(x().format("YYYY/MM/DDTHH:mm:ss.SSSSSS"))}] ${t=e,b.white(t)}\n`);var t},warn:e=>{return console.log(`${b.yellow("WARN")} [${b.magenta(x().format("YYYY/MM/DDTHH:mm:ss.SSSSSS"))}] ${t=e,b.white(t)}`);var t},error:e=>{return console.log(`${b.red("ERROR")} [${b.magenta(x().format("YYYY/MM/DDTHH:mm:ss.SSSSSS"))}] ${t=e,b.white(t)}`);var t},debug:e=>{return console.log(`${b.cyan("DEBUG")} [${b.magenta(x().format("YYYY/MM/DDTHH:mm:ss.SSSSSS"))}] ${t=e,b.white(t)}`);var t}}}function re(e){return{add:(t,n,o,r)=>{e.command({command:t,describe:n,builder:o,handler:r})}}}function se(e,t="INR",n="en-IN"){return new Intl.NumberFormat(n,{style:"currency",currency:t}).format(e)}function ie(e){return $(`npm show ${e} version`).toString().trim()}const ae=e=>b.green(e);!function(){const e=j.homedir(),t=o.join(e,".mfn","cache");if(!u.existsSync(t))try{u.existsSync(o.join(e,".mfn"))||u.mkdirSync(o.join(e,".mfn")),u.mkdirSync(t,{recursive:!0})}catch(e){}}(),await(async()=>{const e=await(t="M4N-CLI",new Promise(((e,n)=>{v(t,((t,o)=>{t?n(t):e(o)}))})));var t;const n=w(b.hex("#27A244").bold(e),{padding:1,margin:1,dimBorder:!0,borderStyle:"round",borderColor:"#C1C110"}),o=function(){const e=j.platform();return"win32"===e?process.env.USERNAME||"User":"darwin"===e||"linux"===e?process.env.USER||"User":""}();console.log(b.whiteBright.bold("-------------------------------------------------------\n")),console.log(n),o&&o.length>0?console.log(b.magenta(`\n\tWelcome ${o} to the Master4Novice CLI Tool!\n`)):console.log(b.blue("\n\tWelcome to the Master4Novice CLI Tool!\n")),console.log(b.yellow("\tUse this tool to reduce your effort.\n")),console.log(b.white("-------------------------------------------------------\n"))})();const ce=e(process.argv.slice(z()+1));const le=b.hex("#44bcd8").bold("mfn");var ue=ce.scriptName(le);const pe=oe(),fe=(e,t)=>{pe.info("Started creating subdirectories..."),t.forEach((t=>{const n=o.join(e,t);u.existsSync(n)?pe.warn("Subdirectory already exists..."):(u.mkdirSync(n,{recursive:!0}),pe.info(`Created subdirectory - /${t}`))}))},de="md",me="Make directory and its subdirectories",he=e=>{e.option("d",{alias:"directory",describe:"The root directory to create",type:"string",demandOption:!0}).option("s",{alias:"subdirectories",describe:"Subdirectories to create within the root directory",type:"array"})},ye=e=>{((e,t)=>{pe.info(`Current working directory: ${process.cwd()}`);const n=o.join(process.cwd(),e);u.existsSync(n)?(pe.warn("Root directory already exist"),t&&t.length>0&&fe(n,t)):(pe.info("Started creating root directory inside current working directory..."),u.mkdirSync(n,{recursive:!0}),pe.info(`Created root directory - /${e}`),t&&t.length>0&&fe(n,t))})(e.directory,e.subdirectories)},ge=oe();let be="",ve=20;let we="";function Se(e,t,n="",r=0){const s=O.readdirSync(e);s.forEach(((i,a)=>{if(t&&t.includes(i))return;const c=o.join(e,i),l=a===s.length-1,u=O.statSync(c).isDirectory();we+=`${n}${l?"└── ":"├── "}${i}`+"\n",u&&Se(c,t,`${n}${l?" ":"│ "}`,r+1)}))}function xe(e,t,n=0,r=new Array){const s=O.readdirSync(e);s.forEach(((i,a)=>{if(t&&t.includes(i))return;const c=o.join(e,i),l=a===s.length-1,u=O.statSync(c).isDirectory();let p="";r.forEach(((e,t)=>{p+=e?"\t".repeat(4):"│"+"\t".repeat(3)})),p+=l?"└── ":"├── ";if(be+=`<text style="white-space: pre;" x="${0*n}" y="${ve}">${`${p}${i}`}</text>`,ve+=20,u){const e=[...r,l];xe(c,t,n+1,e)}}))}function je(e,t,n,o){return Buffer.from(e)}const $e=async(e,t,n,r)=>{ge.info(`Processing current working directory: ${process.cwd()}`);const s=o.join(process.cwd()),i=o.basename(s);we+=i+"\n",Se(s,t),be+=`<text x="0" y="20">${i}</text>`,ve+=20,xe(s,t),be=`<svg xmlns="http://www.w3.org/2000/svg" width="${r}" height="${n}"><rect width="100%" height="100%" fill="white"/><g fill="black" font-family="monospace" font-size="12">`+be+"</g></svg>";const a=i+"."+e;switch(e){case"png":const e=je(be);await k(e).png().toFile(a),ge.info(`Tree structure created for ${i} in file ${a}.`);break;case"jpeg":const t=je(be);await k(t).jpeg().toFile(a),ge.info(`Tree structure created for ${i} in file ${a}.`);break;case"svg":O.outputFileSync(a,be),ge.info(`Tree structure created for ${i} in file ${a}.`);break;default:ge.info("Unsupported type...")}ge.debug(we)},Ee="cts",Oe="Create tree structure of current working directory and its contents",ke=e=>{e.option("t",{alias:"fileType",describe:"Tree structure will be saved in file type",type:"string",choices:["svg","png","jpeg"],demandOption:!0}).option("i",{alias:"ignore",describe:"Folder list to be ignored in tree structure",type:"array"}).option("l",{alias:"length",describe:"Length of the image",type:"number",default:250}).option("b",{alias:"breadth",describe:"Breadth of the image",type:"number",default:200})},Ae=e=>{$e(e.fileType,e.ignore,e.length,e.breadth)},Me=oe();async function De(e,t){if(t&&t.length>0){return await S.prompt([{type:"fuzzypath",name:"filePath",excludePath:e=>t.some((t=>e.includes(t))),excludeFilter:e=>"."==e,message:ae("Select a folder/file:"),itemType:"any",depthLimit:5,rootPath:e}])}return await S.prompt([{type:"fuzzypath",name:"filePath",excludeFilter:e=>"."==e,message:ae("Select a folder/file:"),itemType:"any",depthLimit:5,rootPath:e}])}async function Ye(){return await S.prompt([{type:"confirm",name:"exit",message:ae("Do you want to exit?"),default:!0}])}S.registerPrompt("fuzzypath",A);const Te="sc",_e="Search content of current working directory",Ne=e=>{e.option("i",{alias:"ignore",describe:"List of directory content to ignore",type:"array"})},Re=async e=>{let t=process.cwd();for(;;){const{filePath:n}=await De(t,e.ignore),o=O.statSync(n);o.isFile()?(Me.info("Selected content is file..."),Me.info(`${n}`)):o.isDirectory()&&(Me.info("Selected content is directory..."),t=n,process.chdir(t),Me.warn(`${process.cwd()}`));const{exit:r}=await Ye();if(r){Me.warn("Exiting navigation..."),o.isDirectory()&&(Me.info("Use below command to change directory"),Me.info(`cd ${t}`));break}}};const Fe="hra",ze="Calculate HRA exemption",Le=e=>{e.option("mb",{alias:"monthlyBasic",describe:"Monthly basic salary",type:"number",demandOption:!0}).option("mr",{alias:"monthlyRent",describe:"Monthly rent paid",type:"number",demandOption:!0}).option("hr",{alias:"hraReceived",describe:"Monthly HRA received from employer",type:"number",demandOption:!0}).option("im",{alias:"isMetro",describe:"Living in a metro city.",type:"boolean",choices:[!0,!1],default:!1})},qe=e=>{console.log("\nHRA exemption is calculated based on the following criteria:\n"),console.log("1. Actual HRA received from the employer."),console.log("2. 50% of salary (basic + DA) for those living in metro cities or 40% for non-metro cities."),console.log("3. Actual rent paid minus 10% of salary (basic + DA).\n");const t=function(e){const{monthlyBasic:t,monthlyRent:n,hraReceived:o,isMetro:r}=e,s=12*t,i=12*o,a=12*n-.1*s,c=(r?.5:.4)*s;return Math.min(i,a,c)}({monthlyBasic:e.monthlyBasic,monthlyRent:e.monthlyRent,hraReceived:e.hraReceived,isMetro:e.isMetro});console.log("\nCalculated HRA Exemption Details:\n"),console.table([{MonthlyBasic:se(e.monthlyBasic),MonthlyHRAReceived:se(e.hraReceived),MonthlyRent:se(e.monthlyRent),IsMetro:e.isMetro,HRAExemption:se(t)}]),console.log("\n")};const He="sr",Pe="Suggest optimal rent for maximizing HRA exemption",Ce=e=>{e.option("mb",{alias:"monthlyBasic",describe:"Monthly basic salary",type:"number",demandOption:!0}).option("hr",{alias:"hraReceived",describe:"Monthly HRA received from employer",type:"number",demandOption:!0}).option("im",{alias:"isMetro",describe:"Living in a metro city.",type:"boolean",choices:[!0,!1],default:!1})},Be=e=>{const t=(n=e.monthlyBasic,o=e.hraReceived,e.isMetro,(12*n*.1+12*o)/12);var n,o;console.log("\nSuggested Rent Details For Maximise HRA Exemption:\n"),console.table([{MonthlyBasic:se(e.monthlyBasic),MonthlyHRAReceived:se(e.hraReceived),IsMetro:e.isMetro,SuggestedMonthlyRent:se(t)}]),console.log("\n")},Ie=oe();const Ue="decode",We="Decode provided JWT token",Je=e=>{e.option("t",{alias:"token",describe:"JWT token to decode",type:"string",demandOption:!0})},Qe=e=>{const t=function(e){try{const t=e.split(".");if(3!==t.length)throw new Error("Invalid JWT structure");const n=t[1],o=Buffer.from(n,"base64").toString("utf-8");return JSON.parse(o)}catch(e){return Ie.error(`Error decoding JWT: ${e}`),null}}(e.token.replace(/^Bearer\s+/i,""));t&&(console.log("Decoded JWT Payload:\n"),console.log(b.cyanBright.bold("data:"),b.greenBright.bold(JSON.stringify(t,null,2))),console.log("\n"))};S.registerPrompt("date",D),S.registerPrompt("autocomplete",T);const Ge=oe(),Ve=M.tz.names(),Ze=["YYYY-MM-DD","MM-DD-YYYY","DD-MM-YYYY","MMMM Do YYYY, h:mm:ss a","dddd, MMMM Do YYYY","YYYY-MM-DD HH:mm:ss","MMM DD, YYYY","hh:mm A","HH:mm:ss","MMMM Do YYYY, h:mm:ss a z","ddd, hA","YYYY-MM-DD[T]HH:mm:ss.SSS[Z]","YYYY-MM-DD[T]HH:mm:ssZ"];async function Ke(){console.log("\n");const{dateTime:e}=await S.prompt({type:"date",name:"dateTime",message:ae("Choose a date to proceed"),clearable:!0});return Ge.info(`\nProvided date and time is: ${x(e).format("YYYY-MM-DD HH:mm:ss")}`),x(e)}async function Xe(){const{epochValue:e}=await async function(){return console.log("\n"),await S.prompt({type:"input",name:"epochValue",message:ae("Enter epoch time (seconds since Unix epoch):"),validate:function(e){return!(isNaN(e)||!x.unix(Number(e)).isValid())||"Please enter a valid epoch time in seconds."}})}(),t=x.unix(Number(e));Ge.info(`\nThe date and time for the epoch is: ${t.format("YYYY-MM-DD HH:mm:ss")}`)}async function et(){const e=await Ke();Ge.info(`\nEpoch value: ${e.unix()}`)}async function tt(){const e=(await Ke()).utc();Ge.info(`\nThe UTC date and time is: ${e.format("YYYY-MM-DD HH:mm:ss")} UTC`)}async function nt(){const e=await Ke(),t=await async function(){console.log("\n");const{timezone:e}=await S.prompt([{type:"autocomplete",name:"timezone",message:ae("Select a timezone:"),source:(e,t)=>(t=t||"",new Promise((e=>{e(Y.filter(t,Ve).map((e=>e.original)))})))}]);return e}(),n=e.tz(t);Ge.info(`\nThe date and time in ${t} is: ${n.format("YYYY-MM-DD HH:mm:ss")} ${t}`)}async function ot(){const e=await Ke(),t=await async function(){console.log("\n");const{format:e}=await S.prompt([{type:"autocomplete",name:"format",message:ae("Select a date format:"),source:(e,t)=>(t=t||"",new Promise((e=>{e(Y.filter(t,Ze).map((e=>e.original)))})))}]);return e}(),n=e.format(t);Ge.info(`\nThe date in the selected format (${t}) is: ${n}`)}const rt="date",st="Date conversion/operations",it=e=>e,at=async e=>{let t=!0,n=!1;do{console.log("\n");const{operation:e}=await S.prompt([{type:"rawlist",name:"operation",message:ae("What do you want to do?"),choices:[{name:"Convert epoch to human-readable date",value:"epochToDate"},{name:"Convert human-readable date to epoch",value:"dateToEpoch"},new S.Separator,{name:"Convert local datetime to UTC datetime",value:"localDateToUTC"},{name:"Convert local datetime to specific timezone datetime",value:"localDateToTimezone"},new S.Separator,{name:"Format date in string",value:"formatDate"},new S.Separator,{name:"Exit",value:"exit"}]}]);if("exit"===e)t=!1,n=!1;else switch(e){case"epochToDate":n=!0,Ge.info("Operation Epoch To Date\n"),await Xe();break;case"dateToEpoch":n=!0,Ge.info("Operation Date To Epoch\n"),await et();break;case"localDateToUTC":n=!0,Ge.info("Operation Local Date To UTC Date\n"),await tt();break;case"localDateToTimezone":n=!0,Ge.info("Operation Local Date To Timezone\n"),await nt();break;case"formatDate":n=!0,Ge.info("Operation Format Date\n"),await ot();break;default:Ge.warn("Invalid option selected.")}if(t&&!n){console.log("\n");const{repeat:e}=await S.prompt([{type:"confirm",name:"repeat",message:ae("Do you want to perform another operation?"),default:!1}]);t=e}}while(t);Ge.info("Exiting...\n")},ct="type Query {\n hello: String\n}\n",lt="const express = require('express');\nconst { ApolloServer } = require('@apollo/server');\nconst { expressMiddleware } = require('@apollo/server/express4');\nconst { readFileSync } = require('fs');\nconst { join } = require('path');\nconst cors = require('cors');\n \nconst getSchema = () => {\n const schemaPath = join(process.cwd(), `resources/schema.graphql`);\n return readFileSync(schemaPath, 'utf-8');\n};\n \nconst typeDefs = getSchema();\n \nconst resolvers = {\n Query: {\n hello: () => 'Hello world!',\n },\n};\n \nconst app = express();\n\nconst server = new ApolloServer({\n typeDefs,\n resolvers,\n});\n \nserver.start().then(() => {\n app.use('/graphql', cors(), express.json(), expressMiddleware(server));\n});\n \napp.listen(4000, () => {\n console.log('🚀 Server ready at http://localhost:4000/graphql');\n});\n",ut="import express from 'express';\nimport { ApolloServer } from '@apollo/server';\nimport { expressMiddleware } from '@apollo/server/express4';\nimport cors from 'cors';\nimport { readFileSync } from 'fs';\nimport { join } from 'path';\n\nconst getSchema = (): string => {\n const schemaPath = join(process.cwd(), `resources/schema.graphql`);\n return readFileSync(schemaPath, 'utf-8');\n};\n\nconst typeDefs = getSchema();\n\nconst resolvers = {\n Query: {\n hello: () => 'Hello world!',\n },\n};\n\nconst app = express();\n\nconst server = new ApolloServer({\n typeDefs,\n resolvers\n});\n\nawait server.start();\n\napp.use('/graphql', cors<cors.CorsRequest>(), express.json(), expressMiddleware(server));\n\napp.listen(4000, () => {\n console.log('🚀 Server ready at http://localhost:4000/graphql');\n});\n",pt=oe(),ft="create @apollo:express",dt="Create an Apollo GraphQL Express project",mt=e=>e,ht=async e=>{const{projectName:t,moduleType:n}=await async function(e){return await S.prompt(e)}([{type:"input",name:"projectName",message:ae("Enter the project name:"),validate:e=>e.trim().length>0||"Please enter a valid project name."},{type:"expand",name:"moduleType",message:ae("Choose module type:"),choices:[{key:"c",name:"CommonJS",value:"commonjs"},{key:"m",name:"ES Module",value:"module"}],default:0}]),r=x();console.log("\n");const s=_(b.green("@apollo:express")).start();console.log("\n"),console.log(b.green("Project initialization started.\n"));try{const e=o.join(process.cwd(),t);u.mkdirSync(e);let i=!1;"module"===n&&(i=!0),function(e,t,n){u.writeFileSync(o.join(e,"package.json"),JSON.stringify(function(e,t,n){const o={"@apollo/server":ie("@apollo/server"),cors:ie("cors"),express:ie("express"),graphql:ie("graphql")};let r={},s={};return"module"===e?(r={"@types/cors":ie("@types/cors"),"@types/express":ie("@types/express"),"@types/node":ie("@types/node"),rimraf:ie("rimraf"),typescript:ie("typescript")},s={name:t.basename(n),version:"1.0.0",main:"./dist/index.js",type:e,scripts:{clean:"rimraf ./dist",build:"npm run clean && tsc",start:"node ./dist/index.js"},dependencies:o,devDependencies:r}):s={name:t.basename(n),version:"1.0.0",main:"src/index.js",type:e,scripts:{start:"node src/index.js"},dependencies:o},s}(n,o,e),null,2)),u.writeFileSync(o.join(e,"README.md"),((e,t)=>"module"===t?`# ${e}\n\nA starter project using apollo graphql and express. It is configured to use the '${t}' system.\n\n## Getting Started\n\n### Prerequisites\n\n- Node.js installed on your machine.\n\n### Build the application\n\nTo build the application, run the following command:\n\n\`\`\`bash\nnpm run build\n\`\`\`\n\n### Running the Server\n\nTo start the server, run the following command:\n\n\`\`\`bash\nnpm run start\n\`\`\`\n\nThe server will be running on [http://localhost:4000/graphql](http://localhost:4000/graphql).\n`:`# ${e}\n\nA starter project using apollo graphql and express. It is configured to use the '${t}' system.\n\n## Getting Started\n\n### Prerequisites\n\n- Node.js installed on your machine.\n\n### Running the Server\n\nTo start the server, run the following command:\n\n\`\`\`bash\nnpm run start\n\`\`\`\n\nThe server will be running on [http://localhost:4000/graphql](http://localhost:4000/graphql).\n`)(o.basename(e),n));const r=o.join(e,"src");u.mkdirSync(r);const s=o.join(e,"resources");u.mkdirSync(s);const i=t?"index.ts":"index.js";(function(e,t,n){u.writeFileSync(o.join(t,"schema.graphql"),ct);const r=n?ut:lt;u.writeFileSync(e,r)})(o.join(r,i),s,t),t&&function(e){const t={compilerOptions:{target:"es2020",module:"esnext",types:["node"],lib:["es2020"],strict:!0,esModuleInterop:!0,skipLibCheck:!0,outDir:"dist",rootDir:"src",moduleResolution:"node"},include:["./src/**/*"],exclude:["node_modules","dist"]};u.writeFileSync(o.join(e,"tsconfig.json"),JSON.stringify(t,null,2))}(e)}(e,i,n),function(e,t){process.chdir(e),t.text="Installing dependencies...",$("npm install",{stdio:"inherit"})}(e,s);const a=x(),c=x.duration(a.diff(r));console.log(b.green(`\nProject ${o.basename(e)} created successfully.\n`));const l=b.dim(`(${c.asSeconds().toFixed(3)})`);s.succeed(`${b.green("@apollo:express")} ${l}`),console.log("\n")}catch(e){pt.error(`: ${e}`),s.fail("Failed to initialize project.")}};const yt=oe(),gt=e=>new Promise(((t,n)=>{const o="win32"===N()?`taskkill /PID ${e} /F`:`kill -9 ${e}`;E(o,((o,r,s)=>{if(o)return n(o);t(`Process ${e} killed successfully`)}))})),bt="kill",vt="Kill process running on specific ports",wt=e=>{e.option("p",{alias:"ports",describe:"List of port numbers",type:"array",demandOption:!0,coerce:e=>{if(!Array.isArray(e))throw new Error("Ports must be an array");for(const t of e)if(isNaN(Number(t)))throw new Error(`Invalid port number: ${t}`);return e.map(Number)}})},St=async e=>{try{const t=e.ports,n=await Promise.all(t.map((e=>(e=>new Promise((t=>{const n="win32"===N()?`netstat -ano | findstr :${e}`:`lsof -i :${e} | grep LISTEN`;E(n,((n,o,r)=>{if(n||!o)return yt.warn(`Port ${e} is not in use.\n`),void t(null);if("win32"===N()){const n=o.split("\n")[0],r=n?n.trim().split(/\s+/).pop():null;t(r?{port:e,pid:r}:null)}else{const n=o.split("\n")[0],r=n?n.trim().split(/\s+/)[1]:null;t(r?{port:e,pid:r}:null)}}))})))(e)))),o=n.filter((e=>null!==e));if(0===o.length)return void yt.info("\nNo processes found running on the specified ports\n");const r=o.map((e=>({name:`Port: ${e.port}, PID: ${e.pid}`,value:e.pid})));console.log("\n");const s=await S.prompt([{type:"checkbox",name:"pids",message:ae("Select the processes you want to kill:"),choices:r}]);console.log("\n");for(const e of s.pids){const t=await gt(e);yt.info(t)}}catch(e){yt.error(`${e}`)}},xt=oe();function jt(e,t){E(`npm view ${e} version`,((n,o,r)=>{if(n||r)return xt.error(`Error fetching version for ${e}: ${n?n.message:r}`),void t(null);t(o.trim())}))}const $t="update [package]",Et="Update the CLI or a specified package to the latest version",Ot=e=>{e.positional("package",{describe:"The name of the package to update",type:"string",default:"@master4n/master-cli"})},kt=async e=>{!async function(e){const t=_(),n=x();console.log("\n"),R()||(xt.error("This command must be run with admin or sudo privileges."),xt.info("Please try running the command again with `sudo`.\n"),process.exit(1)),t.start(b.green(`${e}`)),t.clear(),console.log("\n"),jt(e,(o=>{if(null!==o)try{t.succeed(b.green(`current version: ${o}`)),t.start(b.green("updating")),E(`npm install -g ${e}`,((r,s,i)=>{r?t.fail(b.red(`Error updating package: ${r.message}`)):i?xt.error(`Error output: ${i}\n`):(console.log(s),jt(e,(r=>{if(null===r)return;const s=x(),i=x.duration(s.diff(n)),a=b.dim(`(${i.asSeconds().toFixed(3)})`);t.clear(),t.succeed(`${b.green(`updated ${e}`)} ${a}`),console.log(`version: ${b.magenta(o)} -> ${b.green(r)}\n`)})))}))}catch(e){xt.error(`: ${e}`),t.fail("Failed to initialize project.")}else t.fail(b.red("Failed to fetch the current version."))}))}(e.package)};var At="@master4n/master-cli",Mt="2.1.6",Dt="Command Line Interface For Various Useful Operations",Yt="./bin/index.js",Tt="./bin/index.d.ts",_t="module",Nt={mfn:"./bin/index.js"},Rt={clean:"rimraf dist",build:"npm run clean && rollup --config"},Ft={type:"git",url:"git+https://github.com/Master4Novice/common.git"},zt=["cli","helper","module"],Lt="dwivna",qt={directory:"dist",access:"public"},Ht=[{name:"dwivna"}],Pt={"@types/fs-extra":"^11.0.4","@types/yargs":"^17.0.32",boxen:"^7.1.1",chalk:"^5.3.0",figlet:"^1.7.0","fs-extra":"^11.2.0",fuzzy:"^0.1.3",inquirer:"^9.2.23","inquirer-autocomplete-prompt":"^3.0.1","inquirer-date-prompt":"^3.0.0","inquirer-fuzzy-path":"^2.3.0","is-root":"^3.0.0",moment:"^2.30.1","moment-timezone":"^0.5.45",open:"^10.1.0",sharp:"^0.33.4","update-notifier":"^7.0.0",yargs:"^17.7.2"},Ct={"@types/figlet":"^1.5.8","@types/inquirer":"^9.0.7","@types/inquirer-fuzzy-path":"^2.3.9","@types/node":"^20.12.12","@types/update-notifier":"^6.0.8",ora:"^8.0.1"},Bt="2ef1d0cbf62f6f2742140d6e47cfb1ade721f180",It={name:At,version:Mt,description:Dt,main:Yt,types:Tt,type:_t,bin:Nt,scripts:Rt,repository:Ft,keywords:zt,author:Lt,license:"MIT",homepage:"",publishConfig:qt,contributors:Ht,dependencies:Pt,devDependencies:Ct,gitHead:Bt};F({pkg:Object.freeze({__proto__:null,author:Lt,bin:Nt,contributors:Ht,default:It,dependencies:Pt,description:Dt,devDependencies:Ct,gitHead:Bt,homepage:"",keywords:zt,license:"MIT",main:Yt,name:At,publishConfig:qt,repository:Ft,scripts:Rt,type:_t,types:Tt,version:Mt})}).notify(),re(ue).add($t,Et,Ot,kt),re(ue).add(rt,st,it,at),re(ue).add(Ue,We,Je,Qe),re(ue).add(ft,dt,mt,ht),re(ue).add(Te,_e,Ne,Re),re(ue).add(bt,vt,wt,St),re(ue).add(de,me,he,ye),re(ue).add(Ee,Oe,ke,Ae),re(ue).add(Fe,ze,Le,qe),re(ue).add(He,Pe,Ce,Be),ue.version().alias("version","v").help().alias("help","h").wrap(null).parse();
34
+ var U,W,J;const Q=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,G=null!==(W=null===(U=null===process||void 0===process?void 0:process.versions)||void 0===U?void 0:U.node)&&void 0!==W?W:null===(J=null===process||void 0===process?void 0:process.version)||void 0===J?void 0:J.slice(1);if(G){if(Number(G.match(/^([^.]+)/)[1])<Q)throw Error(`yargs parser supports a minimum Node.js version of ${Q}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`)}const V=process?process.env:{},Z=new class{constructor(e){C=e}parse(e,t){const 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),o=function(e){if(Array.isArray(e))return e.map((e=>"string"!=typeof e?e+"":e));e=e.trim();let t=0,n=null,o=null,r=null;const s=[];for(let i=0;i<e.length;i++)n=o,o=e.charAt(i)," "!==o||r?(o===r?r=null:"'"!==o&&'"'!==o||r||(r=o),s[t]||(s[t]=""),s[t]+=o):" "!==n&&t++;return s}(e),r="string"==typeof e,s=function(e){const t=[],n=Object.create(null);let o=!0;Object.keys(e).forEach((function(n){t.push([].concat(e[n],n))}));for(;o;){o=!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-1!==t[n].indexOf(e)})).length){t[e]=t[e].concat(t[n]),t.splice(n,1),o=!0;break}}}return t.forEach((function(e){const t=(e=e.filter((function(e,t,n){return n.indexOf(e)===t}))).pop();void 0!==t&&"string"==typeof t&&(n[t]=e)})),n}(Object.assign(Object.create(null),n.alias)),i=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),a=Object.assign(Object.create(null),n.default),c=n.configObjects||[],l=n.envPrefix,u=i["populate--"],p=u?"--":"_",f=Object.create(null),d=Object.create(null),m=n.__||C.format,h={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:[]},y=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,g=new RegExp("^--"+i["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach((function(e){const t="object"==typeof e?e.key:e,n=Object.keys(e).map((function(e){return{boolean:"bools",string:"strings",number:"numbers"}[e]})).filter(Boolean).pop();n&&(h[n][t]=!0),h.arrays[t]=!0,h.keys.push(t)})),[].concat(n.boolean||[]).filter(Boolean).forEach((function(e){h.bools[e]=!0,h.keys.push(e)})),[].concat(n.string||[]).filter(Boolean).forEach((function(e){h.strings[e]=!0,h.keys.push(e)})),[].concat(n.number||[]).filter(Boolean).forEach((function(e){h.numbers[e]=!0,h.keys.push(e)})),[].concat(n.count||[]).filter(Boolean).forEach((function(e){h.counts[e]=!0,h.keys.push(e)})),[].concat(n.normalize||[]).filter(Boolean).forEach((function(e){h.normalize[e]=!0,h.keys.push(e)})),"object"==typeof n.narg&&Object.entries(n.narg).forEach((([e,t])=>{"number"==typeof t&&(h.nargs[e]=t,h.keys.push(e))})),"object"==typeof n.coerce&&Object.entries(n.coerce).forEach((([e,t])=>{"function"==typeof t&&(h.coercions[e]=t,h.keys.push(e))})),void 0!==n.config&&(Array.isArray(n.config)||"string"==typeof n.config?[].concat(n.config).filter(Boolean).forEach((function(e){h.configs[e]=!0})):"object"==typeof n.config&&Object.entries(n.config).forEach((([e,t])=>{"boolean"!=typeof t&&"function"!=typeof t||(h.configs[e]=t)}))),function(...e){e.forEach((function(e){Object.keys(e||{}).forEach((function(e){h.aliases[e]||(h.aliases[e]=[].concat(s[e]||[]),h.aliases[e].concat(e).forEach((function(t){if(/-/.test(t)&&i["camel-case-expansion"]){const n=L(t);n!==e&&-1===h.aliases[e].indexOf(n)&&(h.aliases[e].push(n),f[n]=!0)}})),h.aliases[e].concat(e).forEach((function(t){if(t.length>1&&/[A-Z]/.test(t)&&i["camel-case-expansion"]){const n=q(t,"-");n!==e&&-1===h.aliases[e].indexOf(n)&&(h.aliases[e].push(n),f[n]=!0)}})),h.aliases[e].forEach((function(t){h.aliases[t]=[e].concat(h.aliases[e].filter((function(e){return t!==e})))})))}))}))}(n.key,s,n.default,h.arrays),Object.keys(a).forEach((function(e){(h.aliases[e]||[]).forEach((function(t){a[t]=a[e]}))}));let b=null;Object.keys(h.counts).find((e=>N(e,h.arrays)?(b=Error(m("Invalid configuration: %s, opts.count excludes opts.array.",e)),!0):!!N(e,h.nargs)&&(b=Error(m("Invalid configuration: %s, opts.count excludes opts.narg.",e)),!0)));let v=[];const w=Object.assign(Object.create(null),{_:[]}),S={};for(let e=0;e<o.length;e++){const t=o[e],n=t.replace(/^-{3,}/,"---");let r,s,a,c,l,u;if("--"!==t&&/^-/.test(t)&&F(t))x(t);else{if(n.match(/^---+(=|$)/)){x(t);continue}if(t.match(/^--.+=/)||!i["short-option-groups"]&&t.match(/^-.+=/))c=t.match(/^--?([^=]+)=([\s\S]*)$/),null!==c&&Array.isArray(c)&&c.length>=3&&(N(c[1],h.arrays)?e=$(e,c[1],o,c[2]):!1!==N(c[1],h.nargs)?e=j(e,c[1],o,c[2]):E(c[1],c[2],!0));else if(t.match(g)&&i["boolean-negation"])c=t.match(g),null!==c&&Array.isArray(c)&&c.length>=2&&(s=c[1],E(s,!!N(s,h.arrays)&&[!1]));else if(t.match(/^--.+/)||!i["short-option-groups"]&&t.match(/^-[^-]+/))c=t.match(/^--?(.+)/),null!==c&&Array.isArray(c)&&c.length>=2&&(s=c[1],N(s,h.arrays)?e=$(e,s,o):!1!==N(s,h.nargs)?e=j(e,s,o):(l=o[e+1],void 0===l||l.match(/^-/)&&!l.match(y)||N(s,h.bools)||N(s,h.counts)?/^(true|false)$/.test(l)?(E(s,l),e++):E(s,z(s)):(E(s,l),e++)));else if(t.match(/^-.\..+=/))c=t.match(/^-([^=]+)=([\s\S]*)$/),null!==c&&Array.isArray(c)&&c.length>=3&&E(c[1],c[2]);else if(t.match(/^-.\..+/)&&!t.match(y))l=o[e+1],c=t.match(/^-(.\..+)/),null!==c&&Array.isArray(c)&&c.length>=2&&(s=c[1],void 0===l||l.match(/^-/)||N(s,h.bools)||N(s,h.counts)?E(s,z(s)):(E(s,l),e++));else if(t.match(/^-[^-]+/)&&!t.match(y)){a=t.slice(1,-1).split(""),r=!1;for(let n=0;n<a.length;n++){if(l=t.slice(n+2),a[n+1]&&"="===a[n+1]){u=t.slice(n+3),s=a[n],N(s,h.arrays)?e=$(e,s,o,u):!1!==N(s,h.nargs)?e=j(e,s,o,u):E(s,u),r=!0;break}if("-"!==l){if(/[A-Za-z]/.test(a[n])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(l)&&!1===N(l,h.bools)){E(a[n],l),r=!0;break}if(a[n+1]&&a[n+1].match(/\W/)){E(a[n],l),r=!0;break}E(a[n],z(a[n]))}else E(a[n],l)}s=t.slice(-1)[0],r||"-"===s||(N(s,h.arrays)?e=$(e,s,o):!1!==N(s,h.nargs)?e=j(e,s,o):(l=o[e+1],void 0===l||/^(-|--)[^-]/.test(l)&&!l.match(y)||N(s,h.bools)||N(s,h.counts)?/^(true|false)$/.test(l)?(E(s,l),e++):E(s,z(s)):(E(s,l),e++)))}else if(t.match(/^-[0-9]$/)&&t.match(y)&&N(t.slice(1),h.bools))s=t.slice(1),E(s,z(s));else{if("--"===t){v=o.slice(e+1);break}if(i["halt-at-non-option"]){v=o.slice(e);break}x(t)}}}function x(e){const t=A("_",e);"string"!=typeof t&&"number"!=typeof t||w._.push(t)}function j(e,t,n,o){let r,s=N(t,h.nargs);if(s="number"!=typeof s||isNaN(s)?1:s,0===s)return U(o)||(b=Error(m("Argument unexpected for: %s",t))),E(t,z(t)),e;let a=U(o)?0:1;if(i["nargs-eats-options"])n.length-(e+1)+a<s&&(b=Error(m("Not enough arguments following: %s",t))),a=s;else{for(r=e+1;r<n.length&&(!n[r].match(/^-[^0-9]/)||n[r].match(y)||F(n[r]));r++)a++;a<s&&(b=Error(m("Not enough arguments following: %s",t)))}let c=Math.min(a,s);for(!U(o)&&c>0&&(E(t,o),c--),r=e+1;r<c+e+1;r++)E(t,n[r]);return e+c}function $(e,t,n,o){let s=[],c=o||n[e+1];const l=N(t,h.nargs);if(N(t,h.bools)&&!/^(true|false)$/.test(c))s.push(!0);else if(U(c)||U(o)&&/^-/.test(c)&&!y.test(c)&&!F(c)){if(void 0!==a[t]){const e=a[t];s=Array.isArray(e)?e:[e]}}else{U(o)||s.push(k(t,o,!0));for(let o=e+1;o<n.length&&!(!i["greedy-arrays"]&&s.length>0||l&&"number"==typeof l&&s.length>=l)&&(c=n[o],!/^-/.test(c)||y.test(c)||F(c));o++)e=o,s.push(k(t,c,r))}return"number"==typeof l&&(l&&s.length<l||isNaN(l)&&0===s.length)&&(b=Error(m("Not enough arguments following: %s",t))),E(t,s),e}function E(e,t,n=r){if(/-/.test(e)&&i["camel-case-expansion"]){const t=e.split(".").map((function(e){return L(e)})).join(".");O(e,t)}const o=k(e,t,n),s=e.split(".");if(_(w,s,o),h.aliases[e]&&h.aliases[e].forEach((function(e){const t=e.split(".");_(w,t,o)})),s.length>1&&i["dot-notation"]&&(h.aliases[s[0]]||[]).forEach((function(t){let n=t.split(".");const r=[].concat(s);r.shift(),n=n.concat(r),(h.aliases[e]||[]).includes(n.join("."))||_(w,n,o)})),N(e,h.normalize)&&!N(e,h.arrays)){[e].concat(h.aliases[e]||[]).forEach((function(e){Object.defineProperty(S,e,{enumerable:!0,get:()=>t,set(e){t="string"==typeof e?C.normalize(e):e}})}))}}function O(e,t){h.aliases[e]&&h.aliases[e].length||(h.aliases[e]=[t],f[t]=!0),h.aliases[t]&&h.aliases[t].length||O(t,e)}function k(e,t,n){n&&(t=function(e){return"string"!=typeof e||"'"!==e[0]&&'"'!==e[0]||e[e.length-1]!==e[0]?e:e.substring(1,e.length-1)}(t)),(N(e,h.bools)||N(e,h.counts))&&"string"==typeof t&&(t="true"===t);let o=Array.isArray(t)?t.map((function(t){return A(e,t)})):A(e,t);return N(e,h.counts)&&(U(o)||"boolean"==typeof o)&&(o=B()),N(e,h.normalize)&&N(e,h.arrays)&&(o=Array.isArray(t)?t.map((e=>C.normalize(e))):C.normalize(t)),o}function A(e,t){if(!i["parse-positional-numbers"]&&"_"===e)return t;if(!N(e,h.strings)&&!N(e,h.bools)&&!Array.isArray(t)){(H(t)&&i["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${t}`)))||!U(t)&&N(e,h.numbers))&&(t=Number(t))}return t}function M(e,t){Object.keys(e).forEach((function(n){const o=e[n],r=t?t+"."+n:n;"object"==typeof o&&null!==o&&!Array.isArray(o)&&i["dot-notation"]?M(o,r):(!T(w,r.split("."))||N(r,h.arrays)&&i["combine-arrays"])&&E(r,o)}))}function D(e,t){if(void 0===l)return;const n="string"==typeof l?l:"",o=C.env();Object.keys(o).forEach((function(r){if(""===n||0===r.lastIndexOf(n,0)){const s=r.split("__").map((function(e,t){return 0===t&&(e=e.substring(n.length)),L(e)}));(t&&h.configs[s.join(".")]||!t)&&!T(e,s)&&E(s.join("."),o[r])}}))}function Y(e,t,n,o=!1){Object.keys(n).forEach((function(r){T(e,r.split("."))||(_(e,r.split("."),n[r]),o&&(d[r]=!0),(t[r]||[]).forEach((function(t){T(e,t.split("."))||_(e,t.split("."),n[r])})))}))}function T(e,t){let n=e;i["dot-notation"]||(t=[t.join(".")]),t.slice(0,-1).forEach((function(e){n=n[e]||{}}));const o=t[t.length-1];return"object"==typeof n&&o in n}function _(e,t,n){let o=e;i["dot-notation"]||(t=[t.join(".")]),t.slice(0,-1).forEach((function(e){e=I(e),"object"==typeof o&&void 0===o[e]&&(o[e]={}),"object"!=typeof o[e]||Array.isArray(o[e])?(Array.isArray(o[e])?o[e].push({}):o[e]=[o[e],{}],o=o[e][o[e].length-1]):o=o[e]}));const r=I(t[t.length-1]),s=N(t.join("."),h.arrays),a=Array.isArray(n);let c=i["duplicate-arguments-array"];!c&&N(r,h.nargs)&&(c=!0,(!U(o[r])&&1===h.nargs[r]||Array.isArray(o[r])&&o[r].length===h.nargs[r])&&(o[r]=void 0)),n===B()?o[r]=B(o[r]):Array.isArray(o[r])?c&&s&&a?o[r]=i["flatten-duplicate-arrays"]?o[r].concat(n):(Array.isArray(o[r][0])?o[r]:[o[r]]).concat([n]):c||Boolean(s)!==Boolean(a)?o[r]=o[r].concat([n]):o[r]=n:void 0===o[r]&&s?o[r]=a?n:[n]:!c||void 0===o[r]||N(r,h.counts)||N(r,h.bools)?o[r]=n:o[r]=[o[r],n]}function N(e,t){const n=[].concat(h.aliases[e]||[],e),o=Object.keys(t),r=n.find((e=>o.includes(e)));return!!r&&t[r]}function R(e){const t=Object.keys(h);return[].concat(t.map((e=>h[e]))).some((function(t){return Array.isArray(t)?t.includes(e):t[e]}))}function F(e){return i["unknown-options-as-args"]&&function(e){if(e=e.replace(/^-{3,}/,"--"),e.match(y))return!1;if(function(e){if(e.match(y)||!e.match(/^-[^-]+/))return!1;let t,n=!0;const o=e.slice(1).split("");for(let r=0;r<o.length;r++){if(t=e.slice(r+2),!R(o[r])){n=!1;break}if(o[r+1]&&"="===o[r+1]||"-"===t||/[A-Za-z]/.test(o[r])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(t)||o[r+1]&&o[r+1].match(/\W/))break}return n}(e))return!1;return!function(e,...t){return[].concat(...t).some((function(t){const n=e.match(t);return n&&R(n[1])}))}(e,/^-+([^=]+?)=[\s\S]*$/,g,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}(e)}function z(e){return N(e,h.bools)||N(e,h.counts)||!(`${e}`in a)?function(e){return{[P.BOOLEAN]:!0,[P.STRING]:"",[P.NUMBER]:void 0,[P.ARRAY]:[]}[e]}(function(e){let t=P.BOOLEAN;N(e,h.strings)?t=P.STRING:N(e,h.numbers)?t=P.NUMBER:N(e,h.bools)?t=P.BOOLEAN:N(e,h.arrays)&&(t=P.ARRAY);return t}(e)):a[e]}function U(e){return void 0===e}return D(w,!0),D(w,!1),function(e){const t=Object.create(null);Y(t,h.aliases,a),Object.keys(h.configs).forEach((function(n){const o=e[n]||t[n];if(o)try{let e=null;const t=C.resolve(C.cwd(),o),r=h.configs[n];if("function"==typeof r){try{e=r(t)}catch(t){e=t}if(e instanceof Error)return void(b=e)}else e=C.require(t);M(e)}catch(t){"PermissionDenied"===t.name?b=t:e[n]&&(b=Error(m("Invalid JSON config file: %s",o)))}}))}(w),void 0!==c&&c.forEach((function(e){M(e)})),Y(w,h.aliases,a,!0),function(e){let t;const n=new Set;Object.keys(e).forEach((function(o){if(!n.has(o)&&(t=N(o,h.coercions),"function"==typeof t))try{const r=A(o,t(e[o]));[].concat(h.aliases[o]||[],o).forEach((t=>{n.add(t),e[t]=r}))}catch(e){b=e}}))}(w),i["set-placeholder-key"]&&function(e){h.keys.forEach((t=>{~t.indexOf(".")||void 0===e[t]&&(e[t]=void 0)}))}(w),Object.keys(h.counts).forEach((function(e){T(w,e.split("."))||E(e,0)})),u&&v.length&&(w[p]=[]),v.forEach((function(e){w[p].push(e)})),i["camel-case-expansion"]&&i["strip-dashed"]&&Object.keys(w).filter((e=>"--"!==e&&e.includes("-"))).forEach((e=>{delete w[e]})),i["strip-aliased"]&&[].concat(...Object.keys(s).map((e=>s[e]))).forEach((e=>{i["camel-case-expansion"]&&e.includes("-")&&delete w[e.split(".").map((e=>L(e))).join(".")],delete w[e]})),{aliases:Object.assign({},h.aliases),argv:Object.assign(S,w),configuration:i,defaulted:Object.assign({},d),error:b,newAliases:Object.assign({},f)}}}({cwd:process.cwd,env:()=>V,format:t,normalize:r,resolve:s,require:e=>{if("undefined"!=typeof require)return require(e);if(e.match(/\.json$/))return JSON.parse(p(e,"utf8"));throw Error("only .json config files are supported in ESM")}}),K=function(e,t){return Z.parse(e.slice(),t).argv};K.detailed=function(e,t){return Z.parse(e.slice(),t)},K.camelCase=L,K.decamelize=q,K.looksLikeNumber=H;new RegExp("(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");var X={fs:{readFileSync:p,writeFile:m},format:t,resolve:s,exists:e=>{try{return f(e).isFile()}catch(e){return!1}}};let ee;class te{constructor(e){e=e||{},this.directory=e.directory||"./locales",this.updateFiles="boolean"!=typeof e.updateFiles||e.updateFiles,this.locale=e.locale||"en",this.fallbackToLanguage="boolean"!=typeof e.fallbackToLanguage||e.fallbackToLanguage,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if("string"!=typeof arguments[0])return this._taggedLiteral(arguments[0],...arguments);const t=e.shift();let n=function(){};return"function"==typeof e[e.length-1]&&(n=e.pop()),n=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(),ee.format.apply(ee.format,[this.cache[this.locale][t]||t].concat(e))}__n(){const e=Array.prototype.slice.call(arguments),t=e.shift(),n=e.shift(),o=e.shift();let r=function(){};"function"==typeof e[e.length-1]&&(r=e.pop()),this.cache[this.locale]||this._readLocaleFile();let s=1===o?t:n;if(this.cache[this.locale][t]){s=this.cache[this.locale][t][1===o?"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:r})):r();const i=[s];return~s.indexOf("%d")&&i.push(o),ee.format.apply(ee.format,i.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(const 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,o){const r=t[o+1];n+=e,void 0!==r&&(n+="%s")})),this.__.apply(this,[n].concat([].slice.call(t,1)))}_enqueueWrite(e){this.writeQueue.push(e),1===this.writeQueue.length&&this._processWriteQueue()}_processWriteQueue(){const e=this,t=this.writeQueue[0],n=t.directory,o=t.locale,r=t.cb,s=this._resolveLocaleFile(n,o),i=JSON.stringify(this.cache[o],null,2);ee.fs.writeFile(s,i,"utf-8",(function(t){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),r(t)}))}_readLocaleFile(){let e={};const t=this._resolveLocaleFile(this.directory,this.locale);try{ee.fs.readFileSync&&(e=JSON.parse(ee.fs.readFileSync(t,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+t),"ENOENT"!==n.code)throw n;e={}}this.cache[this.locale]=e}_resolveLocaleFile(e,t){let n=ee.resolve(e,"./",t+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~t.lastIndexOf("_")){const o=ee.resolve(e,"./",t.split("_")[0]+".json");this._fileExistsSync(o)&&(n=o)}return n}_fileExistsSync(e){return ee.exists(e)}}let ne;try{ne=g(import.meta.url)}catch(e){ne=process.cwd()}ne.substring(0,ne.lastIndexOf("node_modules"))||process.cwd(),process.cwd,process.exit,process.nextTick,void 0!==process.stdout.columns&&process.stdout.columns,function(e,t){ee=t;const n=new te(e);n.__.bind(n),n.__n.bind(n),n.setLocale.bind(n),n.getLocale.bind(n),n.updateLocale.bind(n),n.locale}({directory:s(ne,"../../../locales"),updateFiles:!1},X);function oe(){return{info:e=>{return console.log(`${b.blue("INFO")} [${b.magenta(x().format("YYYY/MM/DDTHH:mm:ss.SSSSSS"))}] ${t=e,b.white(t)}\n`);var t},warn:e=>{return console.log(`${b.yellow("WARN")} [${b.magenta(x().format("YYYY/MM/DDTHH:mm:ss.SSSSSS"))}] ${t=e,b.white(t)}`);var t},error:e=>{return console.log(`${b.red("ERROR")} [${b.magenta(x().format("YYYY/MM/DDTHH:mm:ss.SSSSSS"))}] ${t=e,b.white(t)}`);var t},debug:e=>{return console.log(`${b.cyan("DEBUG")} [${b.magenta(x().format("YYYY/MM/DDTHH:mm:ss.SSSSSS"))}] ${t=e,b.white(t)}`);var t}}}function re(e){return{add:(t,n,o,r)=>{e.command({command:t,describe:n,builder:o,handler:r})}}}function se(e,t="INR",n="en-IN"){return new Intl.NumberFormat(n,{style:"currency",currency:t}).format(e)}function ie(e){return $(`npm show ${e} version`).toString().trim()}const ae=e=>b.green(e);!function(){const e=j.homedir(),t=o.join(e,".mfn","cache");if(!u.existsSync(t))try{u.existsSync(o.join(e,".mfn"))||u.mkdirSync(o.join(e,".mfn")),u.mkdirSync(t,{recursive:!0})}catch(e){}}(),await(async()=>{const e=await(t="M4N-CLI",new Promise(((e,n)=>{v(t,((t,o)=>{t?n(t):e(o)}))})));var t;const n=w(b.hex("#27A244").bold(e),{padding:1,margin:1,dimBorder:!0,borderStyle:"round",borderColor:"#C1C110"}),o=function(){const e=j.platform();return"win32"===e?process.env.USERNAME||"User":"darwin"===e||"linux"===e?process.env.USER||"User":""}();console.log(b.whiteBright.bold("-------------------------------------------------------\n")),console.log(n),o&&o.length>0?console.log(b.magenta(`\n\tWelcome ${o} to the Master4Novice CLI Tool!\n`)):console.log(b.blue("\n\tWelcome to the Master4Novice CLI Tool!\n")),console.log(b.yellow("\tUse this tool to reduce your effort.\n")),console.log(b.white("-------------------------------------------------------\n"))})();const ce=e(process.argv.slice(z()+1));const le=b.hex("#44bcd8").bold("mfn");var ue=ce.scriptName(le);const pe=oe(),fe=(e,t)=>{pe.info("Started creating subdirectories..."),t.forEach((t=>{const n=o.join(e,t);u.existsSync(n)?pe.warn("Subdirectory already exists..."):(u.mkdirSync(n,{recursive:!0}),pe.info(`Created subdirectory - /${t}`))}))},de="md",me="Make directory and its subdirectories",he=e=>{e.option("d",{alias:"directory",describe:"The root directory to create",type:"string",demandOption:!0}).option("s",{alias:"subdirectories",describe:"Subdirectories to create within the root directory",type:"array"})},ye=e=>{((e,t)=>{pe.info(`Current working directory: ${process.cwd()}`);const n=o.join(process.cwd(),e);u.existsSync(n)?(pe.warn("Root directory already exist"),t&&t.length>0&&fe(n,t)):(pe.info("Started creating root directory inside current working directory..."),u.mkdirSync(n,{recursive:!0}),pe.info(`Created root directory - /${e}`),t&&t.length>0&&fe(n,t))})(e.directory,e.subdirectories)},ge=oe();let be="",ve=20;let we="";function Se(e,t,n="",r=0){const s=O.readdirSync(e);s.forEach(((i,a)=>{if(t&&t.includes(i))return;const c=o.join(e,i),l=a===s.length-1,u=O.statSync(c).isDirectory();we+=`${n}${l?"└── ":"├── "}${i}`+"\n",u&&Se(c,t,`${n}${l?" ":"│ "}`,r+1)}))}function xe(e,t,n=0,r=new Array){const s=O.readdirSync(e);s.forEach(((i,a)=>{if(t&&t.includes(i))return;const c=o.join(e,i),l=a===s.length-1,u=O.statSync(c).isDirectory();let p="";r.forEach(((e,t)=>{p+=e?"\t".repeat(4):"│"+"\t".repeat(3)})),p+=l?"└── ":"├── ";if(be+=`<text style="white-space: pre;" x="${0*n}" y="${ve}">${`${p}${i}`}</text>`,ve+=20,u){const e=[...r,l];xe(c,t,n+1,e)}}))}function je(e,t,n,o){return Buffer.from(e)}const $e=async(e,t,n,r)=>{ge.info(`Processing current working directory: ${process.cwd()}`);const s=o.join(process.cwd()),i=o.basename(s);we+=i+"\n",Se(s,t),be+=`<text x="0" y="20">${i}</text>`,ve+=20,xe(s,t),be=`<svg xmlns="http://www.w3.org/2000/svg" width="${r}" height="${n}"><rect width="100%" height="100%" fill="white"/><g fill="black" font-family="monospace" font-size="12">`+be+"</g></svg>";const a=i+"."+e;switch(e){case"png":const e=je(be);await k(e).png().toFile(a),ge.info(`Tree structure created for ${i} in file ${a}.`);break;case"jpeg":const t=je(be);await k(t).jpeg().toFile(a),ge.info(`Tree structure created for ${i} in file ${a}.`);break;case"svg":O.outputFileSync(a,be),ge.info(`Tree structure created for ${i} in file ${a}.`);break;default:ge.info("Unsupported type...")}ge.debug(we)},Ee="cts",Oe="Create tree structure of current working directory and its contents",ke=e=>{e.option("t",{alias:"fileType",describe:"Tree structure will be saved in file type",type:"string",choices:["svg","png","jpeg"],demandOption:!0}).option("i",{alias:"ignore",describe:"Folder list to be ignored in tree structure",type:"array"}).option("l",{alias:"length",describe:"Length of the image",type:"number",default:250}).option("b",{alias:"breadth",describe:"Breadth of the image",type:"number",default:200})},Ae=e=>{$e(e.fileType,e.ignore,e.length,e.breadth)},Me=oe();async function De(e,t){if(t&&t.length>0){return await S.prompt([{type:"fuzzypath",name:"filePath",excludePath:e=>t.some((t=>e.includes(t))),excludeFilter:e=>"."==e,message:ae("Select a folder/file:"),itemType:"any",depthLimit:5,rootPath:e}])}return await S.prompt([{type:"fuzzypath",name:"filePath",excludeFilter:e=>"."==e,message:ae("Select a folder/file:"),itemType:"any",depthLimit:5,rootPath:e}])}async function Ye(){return await S.prompt([{type:"confirm",name:"exit",message:ae("Do you want to exit?"),default:!0}])}S.registerPrompt("fuzzypath",A);const Te="sc",_e="Search content of current working directory",Ne=e=>{e.option("i",{alias:"ignore",describe:"List of directory content to ignore",type:"array"})},Re=async e=>{let t=process.cwd();for(;;){const{filePath:n}=await De(t,e.ignore),o=O.statSync(n);o.isFile()?(Me.info("Selected content is file..."),Me.info(`${n}`)):o.isDirectory()&&(Me.info("Selected content is directory..."),t=n,process.chdir(t),Me.warn(`${process.cwd()}`));const{exit:r}=await Ye();if(r){Me.warn("Exiting navigation..."),o.isDirectory()&&(Me.info("Use below command to change directory"),Me.info(`cd ${t}`));break}}};const Fe="hra",ze="Calculate HRA exemption",Le=e=>{e.option("mb",{alias:"monthlyBasic",describe:"Monthly basic salary",type:"number",demandOption:!0}).option("mr",{alias:"monthlyRent",describe:"Monthly rent paid",type:"number",demandOption:!0}).option("hr",{alias:"hraReceived",describe:"Monthly HRA received from employer",type:"number",demandOption:!0}).option("im",{alias:"isMetro",describe:"Living in a metro city.",type:"boolean",choices:[!0,!1],default:!1})},qe=e=>{console.log("\nHRA exemption is calculated based on the following criteria:\n"),console.log("1. Actual HRA received from the employer."),console.log("2. 50% of salary (basic + DA) for those living in metro cities or 40% for non-metro cities."),console.log("3. Actual rent paid minus 10% of salary (basic + DA).\n");const t=function(e){const{monthlyBasic:t,monthlyRent:n,hraReceived:o,isMetro:r}=e,s=12*t,i=12*o,a=12*n-.1*s,c=(r?.5:.4)*s;return Math.min(i,a,c)}({monthlyBasic:e.monthlyBasic,monthlyRent:e.monthlyRent,hraReceived:e.hraReceived,isMetro:e.isMetro});console.log("\nCalculated HRA Exemption Details:\n"),console.table([{MonthlyBasic:se(e.monthlyBasic),MonthlyHRAReceived:se(e.hraReceived),MonthlyRent:se(e.monthlyRent),IsMetro:e.isMetro,HRAExemption:se(t)}]),console.log("\n")};const He="sr",Pe="Suggest optimal rent for maximizing HRA exemption",Ce=e=>{e.option("mb",{alias:"monthlyBasic",describe:"Monthly basic salary",type:"number",demandOption:!0}).option("hr",{alias:"hraReceived",describe:"Monthly HRA received from employer",type:"number",demandOption:!0}).option("im",{alias:"isMetro",describe:"Living in a metro city.",type:"boolean",choices:[!0,!1],default:!1})},Be=e=>{const t=(n=e.monthlyBasic,o=e.hraReceived,e.isMetro,(12*n*.1+12*o)/12);var n,o;console.log("\nSuggested Rent Details For Maximise HRA Exemption:\n"),console.table([{MonthlyBasic:se(e.monthlyBasic),MonthlyHRAReceived:se(e.hraReceived),IsMetro:e.isMetro,SuggestedMonthlyRent:se(t)}]),console.log("\n")},Ie=oe();const Ue="decode",We="Decode provided JWT token",Je=e=>{e.option("t",{alias:"token",describe:"JWT token to decode",type:"string",demandOption:!0})},Qe=e=>{const t=function(e){try{const t=e.split(".");if(3!==t.length)throw new Error("Invalid JWT structure");const n=t[1],o=Buffer.from(n,"base64").toString("utf-8");return JSON.parse(o)}catch(e){return Ie.error(`Error decoding JWT: ${e}`),null}}(e.token.replace(/^Bearer\s+/i,""));t&&(console.log("Decoded JWT Payload:\n"),console.log(b.cyanBright.bold("data:"),b.greenBright.bold(JSON.stringify(t,null,2))),console.log("\n"))};S.registerPrompt("date",D),S.registerPrompt("autocomplete",T);const Ge=oe(),Ve=M.tz.names(),Ze=["YYYY-MM-DD","MM-DD-YYYY","DD-MM-YYYY","MMMM Do YYYY, h:mm:ss a","dddd, MMMM Do YYYY","YYYY-MM-DD HH:mm:ss","MMM DD, YYYY","hh:mm A","HH:mm:ss","MMMM Do YYYY, h:mm:ss a z","ddd, hA","YYYY-MM-DD[T]HH:mm:ss.SSS[Z]","YYYY-MM-DD[T]HH:mm:ssZ"];async function Ke(){console.log("\n");const{dateTime:e}=await S.prompt({type:"date",name:"dateTime",message:ae("Choose a date to proceed"),clearable:!0});return Ge.info(`\nProvided date and time is: ${x(e).format("YYYY-MM-DD HH:mm:ss")}`),x(e)}async function Xe(){const{epochValue:e}=await async function(){return console.log("\n"),await S.prompt({type:"input",name:"epochValue",message:ae("Enter epoch time (seconds since Unix epoch):"),validate:function(e){return!(isNaN(e)||!x.unix(Number(e)).isValid())||"Please enter a valid epoch time in seconds."}})}(),t=x.unix(Number(e));Ge.info(`\nThe date and time for the epoch is: ${t.format("YYYY-MM-DD HH:mm:ss")}`)}async function et(){const e=await Ke();Ge.info(`\nEpoch value: ${e.unix()}`)}async function tt(){const e=(await Ke()).utc();Ge.info(`\nThe UTC date and time is: ${e.format("YYYY-MM-DD HH:mm:ss")} UTC`)}async function nt(){const e=await Ke(),t=await async function(){console.log("\n");const{timezone:e}=await S.prompt([{type:"autocomplete",name:"timezone",message:ae("Select a timezone:"),source:(e,t)=>(t=t||"",new Promise((e=>{e(Y.filter(t,Ve).map((e=>e.original)))})))}]);return e}(),n=e.tz(t);Ge.info(`\nThe date and time in ${t} is: ${n.format("YYYY-MM-DD HH:mm:ss")} ${t}`)}async function ot(){const e=await Ke(),t=await async function(){console.log("\n");const{format:e}=await S.prompt([{type:"autocomplete",name:"format",message:ae("Select a date format:"),source:(e,t)=>(t=t||"",new Promise((e=>{e(Y.filter(t,Ze).map((e=>e.original)))})))}]);return e}(),n=e.format(t);Ge.info(`\nThe date in the selected format (${t}) is: ${n}`)}const rt="date",st="Date conversion/operations",it=e=>e,at=async e=>{let t=!0,n=!1;do{console.log("\n");const{operation:e}=await S.prompt([{type:"rawlist",name:"operation",message:ae("What do you want to do?"),choices:[{name:"Convert epoch to human-readable date",value:"epochToDate"},{name:"Convert human-readable date to epoch",value:"dateToEpoch"},new S.Separator,{name:"Convert local datetime to UTC datetime",value:"localDateToUTC"},{name:"Convert local datetime to specific timezone datetime",value:"localDateToTimezone"},new S.Separator,{name:"Format date in string",value:"formatDate"},new S.Separator,{name:"Exit",value:"exit"}]}]);if("exit"===e)t=!1,n=!1;else switch(e){case"epochToDate":n=!0,Ge.info("Operation Epoch To Date\n"),await Xe();break;case"dateToEpoch":n=!0,Ge.info("Operation Date To Epoch\n"),await et();break;case"localDateToUTC":n=!0,Ge.info("Operation Local Date To UTC Date\n"),await tt();break;case"localDateToTimezone":n=!0,Ge.info("Operation Local Date To Timezone\n"),await nt();break;case"formatDate":n=!0,Ge.info("Operation Format Date\n"),await ot();break;default:Ge.warn("Invalid option selected.")}if(t&&!n){console.log("\n");const{repeat:e}=await S.prompt([{type:"confirm",name:"repeat",message:ae("Do you want to perform another operation?"),default:!1}]);t=e}}while(t);Ge.info("Exiting...\n")},ct="type Query {\n hello: String\n}\n",lt="const express = require('express');\nconst { ApolloServer } = require('@apollo/server');\nconst { expressMiddleware } = require('@apollo/server/express4');\nconst { readFileSync } = require('fs');\nconst { join } = require('path');\nconst cors = require('cors');\n \nconst getSchema = () => {\n const schemaPath = join(process.cwd(), `resources/schema.graphql`);\n return readFileSync(schemaPath, 'utf-8');\n};\n \nconst typeDefs = getSchema();\n \nconst resolvers = {\n Query: {\n hello: () => 'Hello world!',\n },\n};\n \nconst app = express();\n\nconst server = new ApolloServer({\n typeDefs,\n resolvers,\n});\n \nserver.start().then(() => {\n app.use('/graphql', cors(), express.json(), expressMiddleware(server));\n});\n \napp.listen(4000, () => {\n console.log('🚀 Server ready at http://localhost:4000/graphql');\n});\n",ut="import express from 'express';\nimport { ApolloServer } from '@apollo/server';\nimport { expressMiddleware } from '@apollo/server/express4';\nimport cors from 'cors';\nimport { readFileSync } from 'fs';\nimport { join } from 'path';\n\nconst getSchema = (): string => {\n const schemaPath = join(process.cwd(), `resources/schema.graphql`);\n return readFileSync(schemaPath, 'utf-8');\n};\n\nconst typeDefs = getSchema();\n\nconst resolvers = {\n Query: {\n hello: () => 'Hello world!',\n },\n};\n\nconst app = express();\n\nconst server = new ApolloServer({\n typeDefs,\n resolvers\n});\n\nawait server.start();\n\napp.use('/graphql', cors<cors.CorsRequest>(), express.json(), expressMiddleware(server));\n\napp.listen(4000, () => {\n console.log('🚀 Server ready at http://localhost:4000/graphql');\n});\n",pt=oe(),ft="create @apollo:express",dt="Create an Apollo GraphQL Express project",mt=e=>e,ht=async e=>{const{projectName:t,moduleType:n}=await async function(e){return await S.prompt(e)}([{type:"input",name:"projectName",message:ae("Enter the project name:"),validate:e=>e.trim().length>0||"Please enter a valid project name."},{type:"expand",name:"moduleType",message:ae("Choose module type:"),choices:[{key:"c",name:"CommonJS",value:"commonjs"},{key:"m",name:"ES Module",value:"module"}],default:0}]),r=x();console.log("\n");const s=_(b.green("@apollo:express")).start();console.log("\n"),console.log(b.green("Project initialization started.\n"));try{const e=o.join(process.cwd(),t);u.mkdirSync(e);let i=!1;"module"===n&&(i=!0),function(e,t,n){u.writeFileSync(o.join(e,"package.json"),JSON.stringify(function(e,t,n){const o={"@apollo/server":ie("@apollo/server"),cors:ie("cors"),express:ie("express"),graphql:ie("graphql")};let r={},s={};return"module"===e?(r={"@types/cors":ie("@types/cors"),"@types/express":ie("@types/express"),"@types/node":ie("@types/node"),rimraf:ie("rimraf"),typescript:ie("typescript")},s={name:t.basename(n),version:"1.0.0",main:"./dist/index.js",type:e,scripts:{clean:"rimraf ./dist",build:"npm run clean && tsc",start:"node ./dist/index.js"},dependencies:o,devDependencies:r}):s={name:t.basename(n),version:"1.0.0",main:"src/index.js",type:e,scripts:{start:"node src/index.js"},dependencies:o},s}(n,o,e),null,2)),u.writeFileSync(o.join(e,"README.md"),((e,t)=>"module"===t?`# ${e}\n\nA starter project using apollo graphql and express. It is configured to use the '${t}' system.\n\n## Getting Started\n\n### Prerequisites\n\n- Node.js installed on your machine.\n\n### Build the application\n\nTo build the application, run the following command:\n\n\`\`\`bash\nnpm run build\n\`\`\`\n\n### Running the Server\n\nTo start the server, run the following command:\n\n\`\`\`bash\nnpm run start\n\`\`\`\n\nThe server will be running on [http://localhost:4000/graphql](http://localhost:4000/graphql).\n`:`# ${e}\n\nA starter project using apollo graphql and express. It is configured to use the '${t}' system.\n\n## Getting Started\n\n### Prerequisites\n\n- Node.js installed on your machine.\n\n### Running the Server\n\nTo start the server, run the following command:\n\n\`\`\`bash\nnpm run start\n\`\`\`\n\nThe server will be running on [http://localhost:4000/graphql](http://localhost:4000/graphql).\n`)(o.basename(e),n));const r=o.join(e,"src");u.mkdirSync(r);const s=o.join(e,"resources");u.mkdirSync(s);const i=t?"index.ts":"index.js";(function(e,t,n){u.writeFileSync(o.join(t,"schema.graphql"),ct);const r=n?ut:lt;u.writeFileSync(e,r)})(o.join(r,i),s,t),t&&function(e){const t={compilerOptions:{target:"es2020",module:"esnext",types:["node"],lib:["es2020"],strict:!0,esModuleInterop:!0,skipLibCheck:!0,outDir:"dist",rootDir:"src",moduleResolution:"node"},include:["./src/**/*"],exclude:["node_modules","dist"]};u.writeFileSync(o.join(e,"tsconfig.json"),JSON.stringify(t,null,2))}(e)}(e,i,n),function(e,t){process.chdir(e),t.text="Installing dependencies...",$("npm install",{stdio:"inherit"})}(e,s);const a=x(),c=x.duration(a.diff(r));console.log(b.green(`\nProject ${o.basename(e)} created successfully.\n`));const l=b.dim(`(${c.asSeconds().toFixed(3)})`);s.succeed(`${b.green("@apollo:express")} ${l}`),console.log("\n")}catch(e){pt.error(`: ${e}`),s.fail("Failed to initialize project.")}};const yt=oe(),gt=e=>new Promise(((t,n)=>{const o="win32"===N()?`taskkill /PID ${e} /F`:`kill -9 ${e}`;E(o,((o,r,s)=>{if(o)return n(o);t(`Process ${e} killed successfully`)}))})),bt="kill",vt="Kill process running on specific ports",wt=e=>{e.option("p",{alias:"ports",describe:"List of port numbers",type:"array",demandOption:!0,coerce:e=>{if(!Array.isArray(e))throw new Error("Ports must be an array");for(const t of e)if(isNaN(Number(t)))throw new Error(`Invalid port number: ${t}`);return e.map(Number)}})},St=async e=>{try{const t=e.ports,n=await Promise.all(t.map((e=>(e=>new Promise((t=>{const n="win32"===N()?`netstat -ano | findstr :${e}`:`lsof -i :${e} | grep LISTEN`;E(n,((n,o,r)=>{if(n||!o)return yt.warn(`Port ${e} is not in use.\n`),void t(null);if("win32"===N()){const n=o.split("\n")[0],r=n?n.trim().split(/\s+/).pop():null;t(r?{port:e,pid:r}:null)}else{const n=o.split("\n")[0],r=n?n.trim().split(/\s+/)[1]:null;t(r?{port:e,pid:r}:null)}}))})))(e)))),o=n.filter((e=>null!==e));if(0===o.length)return void yt.info("\nNo processes found running on the specified ports\n");const r=o.map((e=>({name:`Port: ${e.port}, PID: ${e.pid}`,value:e.pid})));console.log("\n");const s=await S.prompt([{type:"checkbox",name:"pids",message:ae("Select the processes you want to kill:"),choices:r}]);console.log("\n");for(const e of s.pids){const t=await gt(e);yt.info(t)}}catch(e){yt.error(`${e}`)}},xt=oe();function jt(e,t){E(`npm view ${e} version`,((n,o,r)=>{if(n||r)return xt.error(`Error fetching version for ${e}: ${n?n.message:r}`),void t(null);t(o.trim())}))}const $t="update [package]",Et="Update the CLI or a specified package to the latest version",Ot=e=>{e.positional("package",{describe:"The name of the package to update",type:"string",default:"@master4n/master-cli"})},kt=async e=>{!async function(e){const t=_(),n=x();console.log("\n"),R()||(xt.error("This command must be run with admin or sudo privileges."),xt.info("Please try running the command again with `sudo`.\n"),process.exit(1)),t.start(b.green(`${e}`)),t.clear(),console.log("\n"),jt(e,(o=>{if(null!==o)try{t.succeed(b.green(`current version: ${o}`)),t.start(b.green("updating")),E(`npm install -g ${e}`,((r,s,i)=>{r?t.fail(b.red(`Error updating package: ${r.message}`)):i?xt.error(`Error output: ${i}\n`):(console.log(s),jt(e,(r=>{if(null===r)return;const s=x(),i=x.duration(s.diff(n)),a=b.dim(`(${i.asSeconds().toFixed(3)})`);t.clear(),t.succeed(`${b.green(`updated ${e}`)} ${a}`),console.log(`version: ${b.magenta(o)} -> ${b.green(r)}\n`)})))}))}catch(e){xt.error(`: ${e}`),t.fail("Failed to initialize project.")}else t.fail(b.red("Failed to fetch the current version."))}))}(e.package)};var At="@master4n/master-cli",Mt="2.1.7",Dt="Command Line Interface For Various Useful Operations",Yt="./bin/index.js",Tt="./bin/index.d.ts",_t="module",Nt={mfn:"./bin/index.js"},Rt={clean:"rimraf dist",build:"npm run clean && rollup --config"},Ft={type:"git",url:"git+https://github.com/Master4Novice/common.git"},zt=["cli","helper","module"],Lt="dwivna",qt={directory:"dist",access:"public"},Ht=[{name:"dwivna"}],Pt={"@types/fs-extra":"^11.0.4","@types/yargs":"^17.0.32",boxen:"^7.1.1",chalk:"^5.3.0",figlet:"^1.7.0","fs-extra":"^11.2.0",fuzzy:"^0.1.3",inquirer:"^9.2.23","inquirer-autocomplete-prompt":"^3.0.1","inquirer-date-prompt":"^3.0.0","inquirer-fuzzy-path":"^2.3.0","is-root":"^3.0.0",moment:"^2.30.1","moment-timezone":"^0.5.45",open:"^10.1.0",sharp:"^0.33.4","update-notifier":"^7.0.0",yargs:"^17.7.2"},Ct={"@types/figlet":"^1.5.8","@types/inquirer":"^9.0.7","@types/inquirer-fuzzy-path":"^2.3.9","@types/node":"^20.12.12","@types/update-notifier":"^6.0.8",ora:"^8.0.1"},Bt="2ef1d0cbf62f6f2742140d6e47cfb1ade721f180",It={name:At,version:Mt,description:Dt,main:Yt,types:Tt,type:_t,bin:Nt,scripts:Rt,repository:Ft,keywords:zt,author:Lt,license:"MIT",homepage:"",publishConfig:qt,contributors:Ht,dependencies:Pt,devDependencies:Ct,gitHead:Bt};F({pkg:Object.freeze({__proto__:null,author:Lt,bin:Nt,contributors:Ht,default:It,dependencies:Pt,description:Dt,devDependencies:Ct,gitHead:Bt,homepage:"",keywords:zt,license:"MIT",main:Yt,name:At,publishConfig:qt,repository:Ft,scripts:Rt,type:_t,types:Tt,version:Mt})}).notify(),re(ue).add($t,Et,Ot,kt),re(ue).add(rt,st,it,at),re(ue).add(Ue,We,Je,Qe),re(ue).add(ft,dt,mt,ht),re(ue).add(Te,_e,Ne,Re),re(ue).add(bt,vt,wt,St),re(ue).add(de,me,he,ye),re(ue).add(Ee,Oe,ke,Ae),re(ue).add(Fe,ze,Le,qe),re(ue).add(He,Pe,Ce,Be),ue.version().alias("version","v").help().alias("help","h").wrap(null).parse();
35
35
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@master4n/master-cli",
3
- "version": "2.1.6",
3
+ "version": "2.1.7",
4
4
  "description": "Command Line Interface For Various Useful Operations",
5
5
  "main": "./bin/index.js",
6
6
  "types": "./bin/index.d.ts",