katoikia-app/web-ui/web-react/node_modules/.cache/babel-loader/51b916a0f19930a06f718bcf3b4...

1 line
13 KiB
JSON
Raw Normal View History

2022-07-06 04:15:11 +00:00
{"ast":null,"code":"'use strict';\n\nvar _createForOfIteratorHelper = require(\"/Users/paolasanchez/Desktop/Pry4/Katoikia/katoikia-app/web-ui/sakai-react/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/createForOfIteratorHelper\");\n\nvar TEMPLATE_REGEX = /(?:\\\\(u[a-f\\d]{4}|x[a-f\\d]{2}|.))|(?:\\{(~)?(\\w+(?:\\([^)]*\\))?(?:\\.\\w+(?:\\([^)]*\\))?)*)(?:[ \\t]|(?=\\r?\\n)))|(\\})|((?:.|[\\r\\n\\f])+?)/gi;\nvar STYLE_REGEX = /(?:^|\\.)(\\w+)(?:\\(([^)]*)\\))?/g;\nvar STRING_REGEX = /^(['\"])((?:\\\\.|(?!\\1)[^\\\\])*)\\1$/;\nvar ESCAPE_REGEX = /\\\\(u[a-f\\d]{4}|x[a-f\\d]{2}|.)|([^\\\\])/gi;\nvar ESCAPES = new Map([['n', '\\n'], ['r', '\\r'], ['t', '\\t'], ['b', '\\b'], ['f', '\\f'], ['v', '\\v'], ['0', '\\0'], ['\\\\', '\\\\'], ['e', \"\\x1B\"], ['a', \"\\x07\"]]);\n\nfunction unescape(c) {\n if (c[0] === 'u' && c.length === 5 || c[0] === 'x' && c.length === 3) {\n return String.fromCharCode(parseInt(c.slice(1), 16));\n }\n\n return ESCAPES.get(c) || c;\n}\n\nfunction parseArguments(name, args) {\n var results = [];\n var chunks = args.trim().split(/\\s*,\\s*/g);\n var matches;\n\n var _iterator = _createForOfIteratorHelper(chunks),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var chunk = _step.value;\n\n if (!isNaN(chunk)) {\n results.push(Number(chunk));\n } else if (matches = chunk.match(STRING_REGEX)) {\n results.push(matches[2].replace(ESCAPE_REGEX, function (m, escape, chr) {\n return escape ? unescape(escape) : chr;\n }));\n } else {\n throw new Error(\"Invalid Chalk template style argument: \".concat(chunk, \" (in style '\").concat(name, \"')\"));\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return results;\n}\n\nfunction parseStyle(style) {\n STYLE_REGEX.lastIndex = 0;\n var results = [];\n var matches;\n\n while ((matches = STYLE_REGEX.exec(style)) !== null) {\n var name = matches[1];\n\n if (matches[2]) {\n var args = parseArguments(name, matches[2]);\n results.push([name].concat(args));\n } else {\n results.push([name]);\n }\n }\n\n return results;\n}\n\nfunction buildStyle(chalk, styles) {\n var enabled = {};\n\n var _iterator2 = _createForOfIteratorHelper(styles),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var layer = _step2.value;\n\n var _iterator3 = _createForOfIteratorHelper(layer.styles),\n _step3;\n\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var style = _step3.value;\n enabled[style[0]] = layer.inverse ? null : style.slice(1);\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n var current = chalk;\n\n for (var _i = 0, _Object$keys = Object.keys(enabled); _i < _Object$keys.length; _i++) {\n var styleName = _Object$keys[_i];\n\n if (Array.isArray(enabled[styleName])) {\n if (!(styleName in current)) {\n throw new Error(\"Unknown Chalk style: \".concat(styleName));\n }\n\n if (enabled[styleName].length > 0) {\n current = current[styleName].apply(current, enabled[styleName]);\n } else {\n current = current[styleName];\n }\n }\n }\n\n return current;\n}\n\nmodule.exports = function (chalk, tmp) {\n var styles = [];\n var chunks = [];\n var chunk = []; // eslint-disable-next-line max-params\n\n tmp.replace(TEMPLATE_REGEX, function (m, escapeChar, inverse, style, close, chr) {\n if (escapeChar) {\n chunk.push(unescape(escapeChar));\n } else if (style) {\n var str = chunk.join('');\n chunk = [];\n chunks.push(styles.length === 0 ? str : buildStyle(chalk, styles)(str));\n styles.push({\n inverse: inverse,\n styles: parseStyle(style)\n });\n } else if (close) {\n if (styles.length === 0) {\n