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Content":["/**\n * Minified by jsDelivr using Terser v5.37.0.\n * Original file: /npm/ifopt@1.6.1/ifopt.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","require('nativejs-proto-extensions');\n\nlet ifopt = {\n\n    // @TODO: Make arg validation of functions\n\n    /**\n     * @var {Boolean} colorize   Indicating to not use color in log ouputs.\n     */\n    colorize: true,\n\n    /**\n     * @var {Object} colors   Default Color of ifopt.\n     */\n    colors: {\n        Restore: \"[xlb]\",\n        Reset: \"\\x1b[0m\",\n        Bright: \"\\x1b[1m\",\n        Dim: \"\\x1b[2m\",\n        Underscore: \"\\x1b[4m\",\n        Blink: \"\\x1b[5m\",\n        Reverse: \"\\x1b[7m\",\n        Hidden: \"\\x1b[8m\",\n        fg: {\n            Black: \"\\x1b[30m\",\n            Red: \"\\x1b[31m\",\n            Green: \"\\x1b[32m\",\n            Yellow: \"\\x1b[33m\",\n            Blue: \"\\x1b[34m\",\n            Magenta: \"\\x1b[35m\",\n            Cyan: \"\\x1b[36m\",\n            White: \"\\x1b[37m\",\n            Crimson: \"\\x1b[38m\",\n            Success: \"\\x1b[32m\",\n            Error: \"\\x1b[31m\",\n            Info: \"\\x1b[36m\",\n            Warning: \"\\x1b[33m\",\n            Debug: \"\\x1b[38;5;208m\"\n        },\n        bg: {\n            Black: \"\\x1b[40m\",\n            Red: \"\\x1b[41m\",\n            Green: \"\\x1b[42m\",\n            Yellow: \"\\x1b[43m\",\n            Blue: \"\\x1b[44m\",\n            Magenta: \"\\x1b[45m\",\n            Cyan: \"\\x1b[46m\",\n            White: \"\\x1b[47m\",\n            Crimson: \"\\x1b[48m\",\n            Success: \"\\x1b[42m\",\n            Error: \"\\x1b[41m\",\n            Info: \"\\x1b[46m\",\n            Warning: \"\\x1b[43m\",\n            Debug: \"\\x1b[38;5;208m\"\n        }\n    },\n\n    /**\n     * @var {String} separator   Default separator for arguments.\n     */\n    separator: \",\",\n\n    /**\n     * @var {String} shortopt   Memorized short options.\n     */\n    shortopt: \"\",\n\n    /**\n     * @var {Array} longopt   Memorized list of long options.\n     */\n    longopt: [],\n\n    /**\n     * @var {Array} implicits   Memorized list of property name of implicit\n     *                          arguments.\n     */\n    implicits: [],\n\n    /**\n     * @var {Object} implicitRefs   Memorized of object reference to bridge\n     *                              value of implicit arguments.\n     */\n    implicitRefs: null,\n\n    /**\n     * @var {Object} levels   Logging levels\n     */\n    levels: {\n\n    },\n\n    /**\n     * @var {Object} smartLogging   Log level rule to manage display.\n     */\n    smartLogging: {\n\n    },\n\n    /**\n     * @var {boolean} selfDebug   To display debug message of ifopt.\n     */\n    selfDebug: false,\n\n    /**\n     * Set options to parse without parsing them.\n     *\n     * @param {String} sopt          Short Options\n     * @param {Array}  lopt          Long Options\n     * @param {Array}  implicitNames (Optional) Name of property as implicit\n     *                               argument\n     * @param {Object} implicitRefs  (Optional) Object reference to brigde with\n     *                               caller\n     *\n     * @return {boolean}\n     */\n    setOpts: function (\n        sopt,\n        lopt,\n        implicitNames = [],\n        implicitRefs = {}\n    ) {\n        ifopt.setShortOpt(sopt);\n        ifopt.setLongOpt(lopt);\n        ifopt.setImplicitOpt(implicitNames, implicitRefs);\n\n        return true;\n    },\n\n    /**\n     * Set the short options for the instance.\n     *\n     * @param {String} sopt  Provided short options string.\n     *\n     * @return {boolean}\n     */\n    setShortOpt: function (sopt) {\n        ifopt.shortopt = sopt;\n\n        return true;\n    },\n\n    /**\n     * Set the long options for the instance.\n     *\n     * @param {Array} lopt   Provided long options list.\n     *\n     * @return {boolean}\n     */\n    setLongOpt: function (lopt) {\n        ifopt.longopt = lopt;\n\n        return true;\n    },\n\n    /**\n     * Set the implicit argument of the program (name and ref object).\n     *\n     * @param {Array} implicitNames   Name of properties of ref object.\n     * @param {Object} implicitRefs   Object Reference.\n     *\n     * @return {boolean}\n     */\n    setImplicitOpt: function (implicitNames, implicitRefs) {\n        ifopt.implicits = implicitNames;\n        ifopt.implicitRefs = implicitRefs;\n\n        return true;\n    },\n\n    /**\n     * Set the separator to split an option.\n     *\n     * @param {String} sep  The separator char.\n     *\n     * @return {boolean}\n     */\n    setSeparator: function (sep) {\n        ifopt.separator = sep;\n\n        return true;\n    },\n\n    /**\n     * Get the current color object configuration.\n     *\n     * @return {Object|{fg: {Red: string, Cyan: string, White: string, Yellow: string, Blue: string, Magenta: string, Black: string, Crimson: string, Green: string}, Reverse: string, bg: {Red: string, Cyan: string, White: string, Yellow: string, Blue: string, Magenta: string, Black: string, Crimson: string, Green: string}, Blink: string, Dim: string, Hidden: string, Underscore: string, Reset: string, Bright: string}}\n     */\n    getColors: function () {\n        return ifopt.colors;\n    },\n\n    /**\n     * Return the color string for specified path\n     *\n     * @param colorPty   Path of the color in property ifopt.colors.\n     *\n     * @return {*}\n     */\n    getColor: function (colorPty) {\n        return ifopt.colors.getValueForPath(colorPty);\n    },\n\n    /**\n     * Set the new object colors configuration.\n     * Use getColors first, perform modification and update with this method.\n     *\n     * @param {Object|{fg: {Red: string, Cyan: string, White: string, Yellow: string, Blue: string, Magenta: string, Black: string, Crimson: string, Green: string}, Reverse: string, bg: {Red: string, Cyan: string, White: string, Yellow: string, Blue: string, Magenta: string, Black: string, Crimson: string, Green: string}, Blink: string, Dim: string, Hidden: string, Underscore: string, Reset: string, Bright: string}} colors\n     */\n    setColors: function (colors) {\n        ifopt.colors = colors;\n    },\n\n    /**\n     * Set/Update a color specifying its property path\n     *\n     * @param {String} colorPty  The object property path (fg.Yellow)\n     * @param {String} color     Bash Color Instruction\n     *\n     * @return {boolean}\n     */\n    setColor: function (colorPty, color) {\n        let newColor = ifopt.colors;\n        let newColorRef = newColor;\n\n        colorPty = colorPty.split(\".\");\n\n        for (let i = 0; i < colorPty.length; i++) {\n            let pty = colorPty[i];\n\n            if (i === (colorPty.length - 1)) {\n                newColorRef[pty] = color;\n            } else{\n                if (!newColorRef[pty]) {\n                    newColorRef[pty] = {};\n                }\n                newColorRef = newColorRef[pty];\n            }\n        }\n\n        Object.assign(ifopt.colors, newColor);\n\n        return true;\n    },\n\n    /**\n     * Neutralize colors controls to blank.\n     * If called without parameter, the defined colors for ifopt\n     * instance are neutralize. You can passe your colors object definition\n     * (copy from ifopt one using getColors()).\n     *\n     * @param {Object} colors   Colors object definition (optional)\n     *\n     * @return {*}\n     */\n    removeColor: function (colors = ifopt.colors) {\n        let removed = Object.assign({}, colors);\n\n        for (let pty in removed) {\n            if (removed.hasOwnProperty(pty)) {\n                if (typeof removed[pty] === 'string') {\n                    removed[pty] = '';\n                }\n                if (removed[pty] instanceof Object) {\n                    removed[pty] = ifopt.removeColor(removed[pty]);\n                }\n            }\n        }\n\n        return removed;\n    },\n\n    /**\n     * Set log message will not use colors.\n     *\n     * @return {boolean}\n     */\n    noColor: function () {\n        ifopt.colorize = false;\n        return true;\n    },\n\n    /**\n     * Set if log message use colors.\n     * If called without parameters, meaning true, use colors.\n     *\n     * @param  {boolean} usage   Use color (or not (false))\n     *\n     * @return {boolean}\n     */\n    useColor: function (usage = true) {\n        ifopt.colorize = (usage);\n        return true;\n    },\n\n    /**\n     * Traiter les arguments passé au programme\n     *\n     * @param shortopt     Définition des options courtes.\n     * @param longopt      Définition des options longues.\n     * @param implicits    Définition des paramètre implicite.\n     * @param implicitRefs Objet de référence pour passer les valeurs.\n     *\n     * @returns {{}}    Options parsées.\n     */\n    getopt: function (shortopt, longopt, implicits, implicitRefs) {\n        shortopt = shortopt || ifopt.shortopt;\n        longopt = longopt || ifopt.longopt;\n        implicits = implicits || ifopt.implicits;\n        implicitRefs = implicitRefs || ifopt.implicitRefs;\n\n        ifopt.shortopt = shortopt;\n        ifopt.longopt = longopt;\n        ifopt.implicits = implicits;\n        ifopt.implicitRefs = implicitRefs;\n\n        ifopt.checkShortopt(shortopt);\n\n        let processedArg = 0;\n        let implicitArg = 1;\n        let procOptions = {};  // .optarg, .opt, .optval\n        let runWithoutError = true;\n\n        process.argv.forEach(function(arg) {\n            processedArg++;\n\n            // Skip Interpreter (node.exe) and it self (mdmerge.js)\n            if (processedArg < 3) return;\n\n\n            // Check if it is a explicit argument (longopt).\n            if (/^--/.test(arg)) {\n                let splitOpt = arg.match(/^--([a-zA-Z0-9._-]+)=?(.*)/);\n                if (!splitOpt) return;\n                let opt = splitOpt[1];\n                let optVal = splitOpt[2];\n\n                for(let i = 0; i < longopt.length; i++) {\n                    let lgOpt = longopt[i].match(/([a-zA-Z0-9._-]+)(:*)/);\n                    let lgOptName = lgOpt[1];\n                    let lgOptConfig = lgOpt[2];\n\n                    if (opt === lgOptName) {\n                        if (lgOptConfig === ':' && !optVal) {\n                            ifopt.log(`Option %s require a value`, 1, [opt]);\n                            runWithoutError = false;\n                        }\n\n                        if (procOptions[opt]) {\n                            procOptions = ifopt.appendOption(procOptions, arg, opt, optVal);\n                        } else {\n                            procOptions[opt] = ifopt.createOption(arg, opt, optVal);\n                        }\n                    }\n                }\n            }\n\n            // Check if it is a explicit argument (shortopt).\n            else if (/^-/.test(arg)) {\n                let opt = arg.substr(1, 1);\n                let optIdx = shortopt.indexOf(opt);\n                let optVal = arg.match(/^-(.+)=(.*)/);\n                if (optVal) optVal = optVal[2];\n\n                if (optIdx < 0 ) return;\n\n                let nextOptChar1 = shortopt.substr(optIdx +1, 1);\n                let nextOptChar2 = shortopt.substr(optIdx +2, 1);\n\n                if (nextOptChar1 === ':' && nextOptChar2 !== ':' && !optVal) {\n                    ifopt.log(`Option %s require a value`, 1, [opt]);\n                    runWithoutError = false;\n                }\n\n                if (procOptions[opt]) {\n                    procOptions = ifopt.appendOption(procOptions, arg, opt, optVal);\n                } else {\n                    procOptions[opt] = ifopt.createOption(arg, opt, optVal);\n                }\n            }\n\n            // This is an implicit argument.\n            else {\n                // Check if there is an implicit argument\n                if (implicits[implicitArg - 1]) {\n                    let implicitPty = implicits[implicitArg - 1];\n\n                    implicitRefs[implicitPty] = arg;\n                }\n\n                implicitArg++;\n            }\n        });\n\n        if (runWithoutError) {\n            return procOptions;\n        } else {\n            process.exit();\n        }\n    },\n\n    // @TODO validation de la chaine shortopt pour limiter les doublons\n    checkShortopt: function() {\n\n    },\n\n    /**\n     *  Créer une option parsée pour utilisation ultérieure.\n     *\n     * @param optarg    Option d'origine passée en argument.\n     * @param opt       Option isolée.\n     * @param optval    Valeur de l'option.\n     *\n     * @returns {{optarg: *, opt: *, optval: *}}\n     */\n    createOption: function (optarg, opt, optval) {\n        return {\n            \"arg\": optarg,\n            \"opt\": opt,\n            \"val\": optval\n        };\n    },\n\n    /**\n     * Afficher un message dans le stream.\n     *\n     * @param message         Message à afficher.\n     * @param level           Niveau de message. 0=OK,1=KO,2=WARN.\n     * @param args            Arguments which will replace placeholder in message.\n     * @param ignoreSmartLog  Ignore smartLog rules.\n     *\n     * @return {number}\n     */\n    log: function (message = '', level = 0, args = [], ignoreSmartLog = false){\n        let lvlConf = ifopt.levels[level];\n        let display = true;\n        let colors = (ifopt.colorize) ? ifopt.colors : ifopt.removeColor();\n\n        // Replace Placeholders.\n        let argi = 0;\n        args.map(function (arg) {\n            argi++;\n            arg = colors.fg.Yellow + arg + colors.Reset;\n            arg = arg.split(colors.Restore).join(colors.fg.Yellow);\n\n            if (/%[1-9]+\\$s/.test(message)) {\n                let regexp = new RegExp(`%${argi}\\\\$s`);\n                message = message.replace(regexp, arg)\n            } else {\n                message = message.replace(/%s/, arg);\n            }\n        });\n\n        // Check \"smartLogin\"\n        for (let group in ifopt.smartLogging) {\n            if (group === 'getValueForPath') continue;\n            let enabled = ifopt.smartLogging[group].enabled;\n            let levels  = ifopt.smartLogging[group].levels;\n\n            if (levels.lastIndexOf(level) >= 0) {\n                display = enabled;\n                break;\n            }\n        }\n\n        if (display || ignoreSmartLog) {\n            console.log(\n                \"[ \" +\n                lvlConf.color +\n                lvlConf.name +\n                colors.Reset +\n                \" ] : \" +\n                message.split(colors.Restore).join(colors.Reset)\n            );\n        }\n\n        return lvlConf.return;\n    },\n\n    /**\n     * Create logging level for STDx. Will display specified name and color.\n     *\n     * @param {number} level     Level number (must be unique)\n     * @param {string} name      Display logging name.\n     * @param {string} color     Path to the color of ifopt.colors (check ifopt.getColors())\n     * @param {number} lreturn   Return code for the logging level\n     *\n     * @return {boolean}\n     */\n    createLogLevel: function (level, name, color = 'Reset', lreturn = 0) {\n        // Check if level does not exist.\n        if (ifopt.levels.hasOwnProperty(level)) {\n            let levelName = ifopt.getValueForPath(`levels.${level}.name`);\n            ifopt.log(\"Log level %s already exist (name: %s). Logging level will be overwrited.\", 2, [level, levelName]);\n        }\n\n        ifopt.levels[level] = {\n            name: name,\n            color: ifopt.colors.getValueForPath(color),\n            return: lreturn\n        };\n\n        return true;\n    },\n\n    /**\n     * Set display behavior for log() function using group, enabling boolean\n     * for specified levels\n     *\n     * @param groupName     Levels groupname to handle them\n     * @param groupEnabled  If false, levels will not display when calling log()\n     * @param levels        Levels of the group\n     *\n     * @return {boolean}\n     */\n    setLogLevel: function (groupName, groupEnabled = false, levels = []) {\n        if (!(typeof groupName === 'string')) {\n            ifopt.log(\n                \"%s is not string\",\n                1,\n                [\"setLogLevel() groupName\"]\n            );\n            return false;\n        }\n\n        if (ifopt.selfDebug) {\n            ifopt.log(\"groupName : %s\", 4, [groupName])\n            ifopt.log(\"groupEnabled '%s'(%s) => %s\", 4, [\n                groupEnabled, typeof groupEnabled, !!(groupEnabled)\n            ]);\n        }\n\n        groupEnabled = !!(groupEnabled);\n\n        levels = (typeof levels !== 'object') ? [levels] : levels;\n\n        if (ifopt.selfDebug) {\n            ifopt.log(\"levels :\", 4);\n            console.log(levels);\n        }\n\n        if (ifopt.smartLogging[groupName]){\n            ifopt.smartLogging[groupName].enabled = groupEnabled;\n            if (levels.length > 0) {\n                ifopt.smartLogging[groupName].levels = levels;\n            }\n        } else {\n            ifopt.smartLogging[groupName] = {\n                enabled: groupEnabled,\n                levels: levels\n            };\n        }\n\n        if (ifopt.selfDebug) {\n            ifopt.log(\"smartLogging :\", 4);\n            console.dir(ifopt.smartLogging, {depth: null})\n        }\n\n        return true;\n    },\n\n    /**\n     * Aggregate value under a option when user use multiple times the same options.\n     *\n     * @param {Object}  optstack\n     * @param {String}  optagr     Entered option (short or long)\n     * @param {String}  opt        Option Name\n     * @param {String}  optval     Option Value\n     *\n     * @returns {Array}  Return aggregated value for the option.\n     */\n    appendOption: function (optstack, optagr, opt, optval) {\n        if (!(optstack[opt].val instanceof Array)) {\n            optstack[opt].val = [optstack[opt].val];\n        }\n\n        optstack[opt].val.push(optval);\n\n        return optstack;\n    },\n\n    /**\n     * Check the option/list of options are provided in the command line.\n     *\n     * @param {String|Array} opts  Option/List of options\n     * @param {String}       op    or|and operator telling if all option are require\n     *                             or at least one.\n     * @returns {boolean}\n     */\n    isOption: function (opts, op = \"or\") {\n        opts = !(opts instanceof Array) ? [].push(opts) : opts;\n\n        let returnOp = (op.toLowerCase() !== 'or');\n        let OPTS = ifopt.getopt();\n\n        for (let i = 0; i < opts.length; i++) {\n            let opt = opts[i];\n\n            if (OPTS[opt]) {\n                if (op.toLowerCase() === 'or') {\n                    return true;\n                }\n            } else {\n                if (op.toLowerCase() === 'and') {\n                    return false;\n                }\n            }\n        }\n\n        return returnOp;\n    },\n\n    /**\n     * Get all values under a unique list for provided options.\n     *\n     * @param {Array}  opts   List of options names.\n     *\n     * @returns {Array} List of values.\n     */\n    getOptsValues: function (opts) {\n        let outputArray = [];\n\n        for (let i in opts) {\n            let opt = opts[i];\n\n            if (ifopt.isOption([opt])) {\n                outputArray = ifopt.optToArray(ifopt.getopt(), opt, outputArray);\n            }\n        }\n\n        return outputArray;\n    },\n\n    /**\n     * Return the value of the first options specified in the array.\n     *\n     * @param {String|Array} opts  Options to get value\n     *\n     * @return {[*]|boolean} The returned value or false if not found.\n     */\n    getOptValue: function (opts) {\n        let options = ifopt.getopt();\n\n        if (!(opts instanceof Array)) {\n            opts = [opts]\n        }\n\n        for (let i = 0; i < opts.length; i++) {\n            if (options[opts[i]]) {\n                return options[opts[i]].val;\n            }\n        }\n\n        return false;\n    },\n\n    /**\n     * Aggregate values of specified options to list of value (merge shortopt and longopt)\n     *\n     * @param {Array}  optpool       Program options data.\n     * @param {String} name          Name of this option (short or long).\n     * @param {Array}  outputArray   Existing data list to aggregate in.\n     *\n     * @returns {Array}  List of values.\n     */\n    optToArray: function (optpool, name, outputArray) {\n        if (optpool[name]) {\n            if (optpool[name].val instanceof Array) {\n                outputArray = outputArray.concat(optpool[name].val);\n            } else {\n                outputArray = outputArray.concat([optpool[name].val])\n            }\n        }\n\n        return outputArray;\n    }\n\n};\n\n/**\n * Initialization\n */\n// Set own logging levels\nifopt.createLogLevel(0, 'SUCCESS', 'fg.Success', 0);\nifopt.createLogLevel(1, 'ERROR', 'fg.Error', 1);\nifopt.createLogLevel(2, 'WARNING', 'fg.Warning', 0);\nifopt.createLogLevel(3, 'INFO', 'fg.Info', 0);\nifopt.createLogLevel(4, 'DEBUG', 'fg.Debug', 0);\n\nmodule.exports = ifopt;"]}