UNPKG

@putout/babel

Version:
1,433 lines (1,423 loc) 1.35 MB
var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name); var __typeError = (msg) => { throw TypeError(msg); }; var __pow = Math.pow; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); var __await = function(promise, isYieldStar) { this[0] = promise; this[1] = isYieldStar; }; var __yieldStar = (value) => { var obj = value[__knownSymbol("asyncIterator")], isAwait = false, method, it = {}; if (obj == null) { obj = value[__knownSymbol("iterator")](); method = (k) => it[k] = (x) => obj[k](x); } else { obj = obj.call(value); method = (k) => it[k] = (v) => { if (isAwait) { isAwait = false; if (k === "throw") throw v; return v; } isAwait = true; return { done: false, value: new __await(new Promise((resolve4) => { var x = obj[k](v); if (!(x instanceof Object)) __typeError("Object expected"); resolve4(x); }), 1) }; }; } return it[__knownSymbol("iterator")] = () => it, method("next"), "throw" in obj ? method("throw") : it.throw = (x) => { throw x; }, "return" in obj && method("return"), it; }; // node_modules/picocolors/picocolors.js var require_picocolors = __commonJS({ "node_modules/picocolors/picocolors.js"(exports2, module2) { var p = process || {}; var argv = p.argv || []; var env = p.env || {}; var isColorSupported2 = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI); var formatter = (open, close, replace = open) => (input) => { let string = "" + input, index2 = string.indexOf(close, open.length); return ~index2 ? open + replaceClose(string, close, replace, index2) + close : open + string + close; }; var replaceClose = (string, close, replace, index2) => { let result = "", cursor = 0; do { result += string.substring(cursor, index2) + replace; cursor = index2 + close.length; index2 = string.indexOf(close, cursor); } while (~index2); return result + string.substring(cursor); }; var createColors2 = (enabled = isColorSupported2) => { let f = enabled ? formatter : () => String; return { isColorSupported: enabled, reset: f("\x1B[0m", "\x1B[0m"), bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"), dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"), italic: f("\x1B[3m", "\x1B[23m"), underline: f("\x1B[4m", "\x1B[24m"), inverse: f("\x1B[7m", "\x1B[27m"), hidden: f("\x1B[8m", "\x1B[28m"), strikethrough: f("\x1B[9m", "\x1B[29m"), black: f("\x1B[30m", "\x1B[39m"), red: f("\x1B[31m", "\x1B[39m"), green: f("\x1B[32m", "\x1B[39m"), yellow: f("\x1B[33m", "\x1B[39m"), blue: f("\x1B[34m", "\x1B[39m"), magenta: f("\x1B[35m", "\x1B[39m"), cyan: f("\x1B[36m", "\x1B[39m"), white: f("\x1B[37m", "\x1B[39m"), gray: f("\x1B[90m", "\x1B[39m"), bgBlack: f("\x1B[40m", "\x1B[49m"), bgRed: f("\x1B[41m", "\x1B[49m"), bgGreen: f("\x1B[42m", "\x1B[49m"), bgYellow: f("\x1B[43m", "\x1B[49m"), bgBlue: f("\x1B[44m", "\x1B[49m"), bgMagenta: f("\x1B[45m", "\x1B[49m"), bgCyan: f("\x1B[46m", "\x1B[49m"), bgWhite: f("\x1B[47m", "\x1B[49m"), blackBright: f("\x1B[90m", "\x1B[39m"), redBright: f("\x1B[91m", "\x1B[39m"), greenBright: f("\x1B[92m", "\x1B[39m"), yellowBright: f("\x1B[93m", "\x1B[39m"), blueBright: f("\x1B[94m", "\x1B[39m"), magentaBright: f("\x1B[95m", "\x1B[39m"), cyanBright: f("\x1B[96m", "\x1B[39m"), whiteBright: f("\x1B[97m", "\x1B[39m"), bgBlackBright: f("\x1B[100m", "\x1B[49m"), bgRedBright: f("\x1B[101m", "\x1B[49m"), bgGreenBright: f("\x1B[102m", "\x1B[49m"), bgYellowBright: f("\x1B[103m", "\x1B[49m"), bgBlueBright: f("\x1B[104m", "\x1B[49m"), bgMagentaBright: f("\x1B[105m", "\x1B[49m"), bgCyanBright: f("\x1B[106m", "\x1B[49m"), bgWhiteBright: f("\x1B[107m", "\x1B[49m") }; }; module2.exports = createColors2(); module2.exports.createColors = createColors2; } }); // node_modules/@babel/code-frame/node_modules/js-tokens/index.js var require_js_tokens = __commonJS({ "node_modules/@babel/code-frame/node_modules/js-tokens/index.js"(exports2, module2) { var Identifier2; var JSXIdentifier2; var JSXPunctuator; var JSXString; var JSXText2; var KeywordsWithExpressionAfter; var KeywordsWithNoLineTerminatorAfter; var LineTerminatorSequence; var MultiLineComment; var Newline; var NumericLiteral3; var Punctuator; var RegularExpressionLiteral; var SingleLineComment; var StringLiteral3; var Template; var TokensNotPrecedingObjectLiteral; var TokensPrecedingExpression; var WhiteSpace; var jsTokens2; RegularExpressionLiteral = /\/(?![*\/])(?:\[(?:[^\]\\\n\r\u2028\u2029]+|\\.)*\]|[^\/\\\n\r\u2028\u2029]+|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/yu; Punctuator = /--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y; Identifier2 = /(\x23?)(?=[$_\p{ID_Start}\\])(?:[$_\u200C\u200D\p{ID_Continue}]+|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+/yu; StringLiteral3 = /(['"])(?:[^'"\\\n\r]+|(?!\1)['"]|\\(?:\r\n|[^]))*(\1)?/y; NumericLiteral3 = /(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[oO][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*)n?|0n|[1-9](?:_?\d)*n|(?:(?:0(?!\d)|0\d*[89]\d*|[1-9](?:_?\d)*)(?:\.(?:\d(?:_?\d)*)?)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|0[0-7]+/y; Template = /[`}](?:[^`\\$]+|\\[^]|\$(?!\{))*(`|\$\{)?/y; WhiteSpace = /[\t\v\f\ufeff\p{Zs}]+/yu; LineTerminatorSequence = /\r?\n|[\r\u2028\u2029]/y; MultiLineComment = /\/\*(?:[^*]+|\*(?!\/))*(\*\/)?/y; SingleLineComment = /\/\/.*/y; JSXPunctuator = /[<>.:={}]|\/(?![\/*])/y; JSXIdentifier2 = /[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}-]*/yu; JSXString = /(['"])(?:[^'"]+|(?!\1)['"])*(\1)?/y; JSXText2 = /[^<>{}]+/y; TokensPrecedingExpression = /^(?:[\/+-]|\.{3}|\?(?:InterpolationIn(?:JSX|Template)|NoLineTerminatorHere|NonExpressionParenEnd|UnaryIncDec))?$|[{}([,;<>=*%&|^!~?:]$/; TokensNotPrecedingObjectLiteral = /^(?:=>|[;\]){}]|else|\?(?:NoLineTerminatorHere|NonExpressionParenEnd))?$/; KeywordsWithExpressionAfter = /^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/; KeywordsWithNoLineTerminatorAfter = /^(?:return|throw|yield)$/; Newline = RegExp(LineTerminatorSequence.source); module2.exports = jsTokens2 = function* (input, { jsx: jsx2 = false } = {}) { var braces, firstCodePoint, isExpression4, lastIndex, lastSignificantToken, length, match, mode, nextLastIndex, nextLastSignificantToken, parenNesting, postfixIncDec, punctuator, stack; ({ length } = input); lastIndex = 0; lastSignificantToken = ""; stack = [ { tag: "JS" } ]; braces = []; parenNesting = 0; postfixIncDec = false; while (lastIndex < length) { mode = stack[stack.length - 1]; switch (mode.tag) { case "JS": case "JSNonExpressionParen": case "InterpolationInTemplate": case "InterpolationInJSX": if (input[lastIndex] === "/" && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken))) { RegularExpressionLiteral.lastIndex = lastIndex; if (match = RegularExpressionLiteral.exec(input)) { lastIndex = RegularExpressionLiteral.lastIndex; lastSignificantToken = match[0]; postfixIncDec = true; yield { type: "RegularExpressionLiteral", value: match[0], closed: match[1] !== void 0 && match[1] !== "\\" }; continue; } } Punctuator.lastIndex = lastIndex; if (match = Punctuator.exec(input)) { punctuator = match[0]; nextLastIndex = Punctuator.lastIndex; nextLastSignificantToken = punctuator; switch (punctuator) { case "(": if (lastSignificantToken === "?NonExpressionParenKeyword") { stack.push({ tag: "JSNonExpressionParen", nesting: parenNesting }); } parenNesting++; postfixIncDec = false; break; case ")": parenNesting--; postfixIncDec = true; if (mode.tag === "JSNonExpressionParen" && parenNesting === mode.nesting) { stack.pop(); nextLastSignificantToken = "?NonExpressionParenEnd"; postfixIncDec = false; } break; case "{": Punctuator.lastIndex = 0; isExpression4 = !TokensNotPrecedingObjectLiteral.test(lastSignificantToken) && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken)); braces.push(isExpression4); postfixIncDec = false; break; case "}": switch (mode.tag) { case "InterpolationInTemplate": if (braces.length === mode.nesting) { Template.lastIndex = lastIndex; match = Template.exec(input); lastIndex = Template.lastIndex; lastSignificantToken = match[0]; if (match[1] === "${") { lastSignificantToken = "?InterpolationInTemplate"; postfixIncDec = false; yield { type: "TemplateMiddle", value: match[0] }; } else { stack.pop(); postfixIncDec = true; yield { type: "TemplateTail", value: match[0], closed: match[1] === "`" }; } continue; } break; case "InterpolationInJSX": if (braces.length === mode.nesting) { stack.pop(); lastIndex += 1; lastSignificantToken = "}"; yield { type: "JSXPunctuator", value: "}" }; continue; } } postfixIncDec = braces.pop(); nextLastSignificantToken = postfixIncDec ? "?ExpressionBraceEnd" : "}"; break; case "]": postfixIncDec = true; break; case "++": case "--": nextLastSignificantToken = postfixIncDec ? "?PostfixIncDec" : "?UnaryIncDec"; break; case "<": if (jsx2 && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken))) { stack.push({ tag: "JSXTag" }); lastIndex += 1; lastSignificantToken = "<"; yield { type: "JSXPunctuator", value: punctuator }; continue; } postfixIncDec = false; break; default: postfixIncDec = false; } lastIndex = nextLastIndex; lastSignificantToken = nextLastSignificantToken; yield { type: "Punctuator", value: punctuator }; continue; } Identifier2.lastIndex = lastIndex; if (match = Identifier2.exec(input)) { lastIndex = Identifier2.lastIndex; nextLastSignificantToken = match[0]; switch (match[0]) { case "for": case "if": case "while": case "with": if (lastSignificantToken !== "." && lastSignificantToken !== "?.") { nextLastSignificantToken = "?NonExpressionParenKeyword"; } } lastSignificantToken = nextLastSignificantToken; postfixIncDec = !KeywordsWithExpressionAfter.test(match[0]); yield { type: match[1] === "#" ? "PrivateIdentifier" : "IdentifierName", value: match[0] }; continue; } StringLiteral3.lastIndex = lastIndex; if (match = StringLiteral3.exec(input)) { lastIndex = StringLiteral3.lastIndex; lastSignificantToken = match[0]; postfixIncDec = true; yield { type: "StringLiteral", value: match[0], closed: match[2] !== void 0 }; continue; } NumericLiteral3.lastIndex = lastIndex; if (match = NumericLiteral3.exec(input)) { lastIndex = NumericLiteral3.lastIndex; lastSignificantToken = match[0]; postfixIncDec = true; yield { type: "NumericLiteral", value: match[0] }; continue; } Template.lastIndex = lastIndex; if (match = Template.exec(input)) { lastIndex = Template.lastIndex; lastSignificantToken = match[0]; if (match[1] === "${") { lastSignificantToken = "?InterpolationInTemplate"; stack.push({ tag: "InterpolationInTemplate", nesting: braces.length }); postfixIncDec = false; yield { type: "TemplateHead", value: match[0] }; } else { postfixIncDec = true; yield { type: "NoSubstitutionTemplate", value: match[0], closed: match[1] === "`" }; } continue; } break; case "JSXTag": case "JSXTagEnd": JSXPunctuator.lastIndex = lastIndex; if (match = JSXPunctuator.exec(input)) { lastIndex = JSXPunctuator.lastIndex; nextLastSignificantToken = match[0]; switch (match[0]) { case "<": stack.push({ tag: "JSXTag" }); break; case ">": stack.pop(); if (lastSignificantToken === "/" || mode.tag === "JSXTagEnd") { nextLastSignificantToken = "?JSX"; postfixIncDec = true; } else { stack.push({ tag: "JSXChildren" }); } break; case "{": stack.push({ tag: "InterpolationInJSX", nesting: braces.length }); nextLastSignificantToken = "?InterpolationInJSX"; postfixIncDec = false; break; case "/": if (lastSignificantToken === "<") { stack.pop(); if (stack[stack.length - 1].tag === "JSXChildren") { stack.pop(); } stack.push({ tag: "JSXTagEnd" }); } } lastSignificantToken = nextLastSignificantToken; yield { type: "JSXPunctuator", value: match[0] }; continue; } JSXIdentifier2.lastIndex = lastIndex; if (match = JSXIdentifier2.exec(input)) { lastIndex = JSXIdentifier2.lastIndex; lastSignificantToken = match[0]; yield { type: "JSXIdentifier", value: match[0] }; continue; } JSXString.lastIndex = lastIndex; if (match = JSXString.exec(input)) { lastIndex = JSXString.lastIndex; lastSignificantToken = match[0]; yield { type: "JSXString", value: match[0], closed: match[2] !== void 0 }; continue; } break; case "JSXChildren": JSXText2.lastIndex = lastIndex; if (match = JSXText2.exec(input)) { lastIndex = JSXText2.lastIndex; lastSignificantToken = match[0]; yield { type: "JSXText", value: match[0] }; continue; } switch (input[lastIndex]) { case "<": stack.push({ tag: "JSXTag" }); lastIndex++; lastSignificantToken = "<"; yield { type: "JSXPunctuator", value: "<" }; continue; case "{": stack.push({ tag: "InterpolationInJSX", nesting: braces.length }); lastIndex++; lastSignificantToken = "?InterpolationInJSX"; postfixIncDec = false; yield { type: "JSXPunctuator", value: "{" }; continue; } } WhiteSpace.lastIndex = lastIndex; if (match = WhiteSpace.exec(input)) { lastIndex = WhiteSpace.lastIndex; yield { type: "WhiteSpace", value: match[0] }; continue; } LineTerminatorSequence.lastIndex = lastIndex; if (match = LineTerminatorSequence.exec(input)) { lastIndex = LineTerminatorSequence.lastIndex; postfixIncDec = false; if (KeywordsWithNoLineTerminatorAfter.test(lastSignificantToken)) { lastSignificantToken = "?NoLineTerminatorHere"; } yield { type: "LineTerminatorSequence", value: match[0] }; continue; } MultiLineComment.lastIndex = lastIndex; if (match = MultiLineComment.exec(input)) { lastIndex = MultiLineComment.lastIndex; if (Newline.test(match[0])) { postfixIncDec = false; if (KeywordsWithNoLineTerminatorAfter.test(lastSignificantToken)) { lastSignificantToken = "?NoLineTerminatorHere"; } } yield { type: "MultiLineComment", value: match[0], closed: match[1] !== void 0 }; continue; } SingleLineComment.lastIndex = lastIndex; if (match = SingleLineComment.exec(input)) { lastIndex = SingleLineComment.lastIndex; postfixIncDec = false; yield { type: "SingleLineComment", value: match[0] }; continue; } firstCodePoint = String.fromCodePoint(input.codePointAt(lastIndex)); lastIndex += firstCodePoint.length; lastSignificantToken = firstCodePoint; postfixIncDec = false; yield { type: mode.tag.startsWith("JSX") ? "JSXInvalid" : "Invalid", value: firstCodePoint }; } return void 0; }; } }); // node_modules/jsesc/jsesc.js var require_jsesc = __commonJS({ "node_modules/jsesc/jsesc.js"(exports2, module2) { "use strict"; var object = {}; var hasOwnProperty = object.hasOwnProperty; var forOwn = (object2, callback) => { for (const key in object2) { if (hasOwnProperty.call(object2, key)) { callback(key, object2[key]); } } }; var extend = (destination, source) => { if (!source) { return destination; } forOwn(source, (key, value) => { destination[key] = value; }); return destination; }; var forEach = (array, callback) => { const length = array.length; let index2 = -1; while (++index2 < length) { callback(array[index2]); } }; var fourHexEscape = (hex) => { return "\\u" + ("0000" + hex).slice(-4); }; var hexadecimal = (code2, lowercase) => { let hexadecimal2 = code2.toString(16); if (lowercase) return hexadecimal2; return hexadecimal2.toUpperCase(); }; var toString = object.toString; var isArray = Array.isArray; var isBuffer = (value) => { return typeof Buffer === "function" && Buffer.isBuffer(value); }; var isObject = (value) => { return toString.call(value) == "[object Object]"; }; var isString = (value) => { return typeof value == "string" || toString.call(value) == "[object String]"; }; var isNumber2 = (value) => { return typeof value == "number" || toString.call(value) == "[object Number]"; }; var isBigInt = (value) => { return typeof value == "bigint"; }; var isFunction5 = (value) => { return typeof value == "function"; }; var isMap = (value) => { return toString.call(value) == "[object Map]"; }; var isSet = (value) => { return toString.call(value) == "[object Set]"; }; var singleEscapes = { "\\": "\\\\", "\b": "\\b", "\f": "\\f", "\n": "\\n", "\r": "\\r", " ": "\\t" // `\v` is omitted intentionally, because in IE < 9, '\v' == 'v'. // '\v': '\\x0B' }; var regexSingleEscape = /[\\\b\f\n\r\t]/; var regexDigit = /[0-9]/; var regexWhitespace = /[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/; var escapeEverythingRegex = /([\uD800-\uDBFF][\uDC00-\uDFFF])|([\uD800-\uDFFF])|(['"`])|[^]/g; var escapeNonAsciiRegex = /([\uD800-\uDBFF][\uDC00-\uDFFF])|([\uD800-\uDFFF])|(['"`])|[^ !#-&\(-\[\]-_a-~]/g; var jsesc2 = (argument, options) => { const increaseIndentation = () => { oldIndent = indent; ++options.indentLevel; indent = options.indent.repeat(options.indentLevel); }; const defaults = { "escapeEverything": false, "minimal": false, "isScriptContext": false, "quotes": "single", "wrap": false, "es6": false, "json": false, "compact": true, "lowercaseHex": false, "numbers": "decimal", "indent": " ", "indentLevel": 0, "__inline1__": false, "__inline2__": false }; const json = options && options.json; if (json) { defaults.quotes = "double"; defaults.wrap = true; } options = extend(defaults, options); if (options.quotes != "single" && options.quotes != "double" && options.quotes != "backtick") { options.quotes = "single"; } const quote = options.quotes == "double" ? '"' : options.quotes == "backtick" ? "`" : "'"; const compact = options.compact; const lowercaseHex = options.lowercaseHex; let indent = options.indent.repeat(options.indentLevel); let oldIndent = ""; const inline1 = options.__inline1__; const inline2 = options.__inline2__; const newLine = compact ? "" : "\n"; let result; let isEmpty = true; const useBinNumbers = options.numbers == "binary"; const useOctNumbers = options.numbers == "octal"; const useDecNumbers = options.numbers == "decimal"; const useHexNumbers = options.numbers == "hexadecimal"; if (json && argument && isFunction5(argument.toJSON)) { argument = argument.toJSON(); } if (!isString(argument)) { if (isMap(argument)) { if (argument.size == 0) { return "new Map()"; } if (!compact) { options.__inline1__ = true; options.__inline2__ = false; } return "new Map(" + jsesc2(Array.from(argument), options) + ")"; } if (isSet(argument)) { if (argument.size == 0) { return "new Set()"; } return "new Set(" + jsesc2(Array.from(argument), options) + ")"; } if (isBuffer(argument)) { if (argument.length == 0) { return "Buffer.from([])"; } return "Buffer.from(" + jsesc2(Array.from(argument), options) + ")"; } if (isArray(argument)) { result = []; options.wrap = true; if (inline1) { options.__inline1__ = false; options.__inline2__ = true; } if (!inline2) { increaseIndentation(); } forEach(argument, (value) => { isEmpty = false; if (inline2) { options.__inline2__ = false; } result.push( (compact || inline2 ? "" : indent) + jsesc2(value, options) ); }); if (isEmpty) { return "[]"; } if (inline2) { return "[" + result.join(", ") + "]"; } return "[" + newLine + result.join("," + newLine) + newLine + (compact ? "" : oldIndent) + "]"; } else if (isNumber2(argument) || isBigInt(argument)) { if (json) { return JSON.stringify(Number(argument)); } let result2; if (useDecNumbers) { result2 = String(argument); } else if (useHexNumbers) { let hexadecimal2 = argument.toString(16); if (!lowercaseHex) { hexadecimal2 = hexadecimal2.toUpperCase(); } result2 = "0x" + hexadecimal2; } else if (useBinNumbers) { result2 = "0b" + argument.toString(2); } else if (useOctNumbers) { result2 = "0o" + argument.toString(8); } if (isBigInt(argument)) { return result2 + "n"; } return result2; } else if (isBigInt(argument)) { if (json) { return JSON.stringify(Number(argument)); } return argument + "n"; } else if (!isObject(argument)) { if (json) { return JSON.stringify(argument) || "null"; } return String(argument); } else { result = []; options.wrap = true; increaseIndentation(); forOwn(argument, (key, value) => { isEmpty = false; result.push( (compact ? "" : indent) + jsesc2(key, options) + ":" + (compact ? "" : " ") + jsesc2(value, options) ); }); if (isEmpty) { return "{}"; } return "{" + newLine + result.join("," + newLine) + newLine + (compact ? "" : oldIndent) + "}"; } } const regex = options.escapeEverything ? escapeEverythingRegex : escapeNonAsciiRegex; result = argument.replace(regex, (char, pair, lone, quoteChar, index2, string) => { if (pair) { if (options.minimal) return pair; const first = pair.charCodeAt(0); const second = pair.charCodeAt(1); if (options.es6) { const codePoint = (first - 55296) * 1024 + second - 56320 + 65536; const hex2 = hexadecimal(codePoint, lowercaseHex); return "\\u{" + hex2 + "}"; } return fourHexEscape(hexadecimal(first, lowercaseHex)) + fourHexEscape(hexadecimal(second, lowercaseHex)); } if (lone) { return fourHexEscape(hexadecimal(lone.charCodeAt(0), lowercaseHex)); } if (char == "\0" && !json && !regexDigit.test(string.charAt(index2 + 1))) { return "\\0"; } if (quoteChar) { if (quoteChar == quote || options.escapeEverything) { return "\\" + quoteChar; } return quoteChar; } if (regexSingleEscape.test(char)) { return singleEscapes[char]; } if (options.minimal && !regexWhitespace.test(char)) { return char; } const hex = hexadecimal(char.charCodeAt(0), lowercaseHex); if (json || hex.length > 2) { return fourHexEscape(hex); } return "\\x" + ("00" + hex).slice(-2); }); if (quote == "`") { result = result.replace(/\$\{/g, "\\${"); } if (options.isScriptContext) { result = result.replace(/<\/(script|style)/gi, "<\\/$1").replace(/<!--/g, json ? "\\u003C!--" : "\\x3C!--"); } if (options.wrap) { result = quote + result + quote; } return result; }; jsesc2.version = "3.0.2"; module2.exports = jsesc2; } }); // node_modules/ms/index.js var require_ms = __commonJS({ "node_modules/ms/index.js"(exports2, module2) { var s = 1e3; var m = s * 60; var h = m * 60; var d = h * 24; var w = d * 7; var y = d * 365.25; module2.exports = function(val, options) { options = options || {}; var type = typeof val; if (type === "string" && val.length > 0) { return parse2(val); } else if (type === "number" && isFinite(val)) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error( "val is not a non-empty string or a valid number. val=" + JSON.stringify(val) ); }; function parse2(str) { str = String(str); if (str.length > 100) { return; } var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( str ); if (!match) { return; } var n2 = parseFloat(match[1]); var type = (match[2] || "ms").toLowerCase(); switch (type) { case "years": case "year": case "yrs": case "yr": case "y": return n2 * y; case "weeks": case "week": case "w": return n2 * w; case "days": case "day": case "d": return n2 * d; case "hours": case "hour": case "hrs": case "hr": case "h": return n2 * h; case "minutes": case "minute": case "mins": case "min": case "m": return n2 * m; case "seconds": case "second": case "secs": case "sec": case "s": return n2 * s; case "milliseconds": case "millisecond": case "msecs": case "msec": case "ms": return n2; default: return void 0; } } function fmtShort(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return Math.round(ms / d) + "d"; } if (msAbs >= h) { return Math.round(ms / h) + "h"; } if (msAbs >= m) { return Math.round(ms / m) + "m"; } if (msAbs >= s) { return Math.round(ms / s) + "s"; } return ms + "ms"; } function fmtLong(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return plural(ms, msAbs, d, "day"); } if (msAbs >= h) { return plural(ms, msAbs, h, "hour"); } if (msAbs >= m) { return plural(ms, msAbs, m, "minute"); } if (msAbs >= s) { return plural(ms, msAbs, s, "second"); } return ms + " ms"; } function plural(ms, msAbs, n2, name) { var isPlural = msAbs >= n2 * 1.5; return Math.round(ms / n2) + " " + name + (isPlural ? "s" : ""); } } }); // node_modules/debug/src/common.js var require_common = __commonJS({ "node_modules/debug/src/common.js"(exports2, module2) { function setup2(env) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = require_ms(); createDebug.destroy = destroy; Object.keys(env).forEach((key) => { createDebug[key] = env[key]; }); createDebug.names = []; createDebug.skips = []; createDebug.formatters = {}; function selectColor(namespace) { let hash = 0; for (let i = 0; i < namespace.length; i++) { hash = (hash << 5) - hash + namespace.charCodeAt(i); hash |= 0; } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } createDebug.selectColor = selectColor; function createDebug(namespace) { let prevTime; let enableOverride = null; let namespacesCache; let enabledCache; function debug2(...args) { if (!debug2.enabled) { return; } const self = debug2; const curr = Number(/* @__PURE__ */ new Date()); const ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; args[0] = createDebug.coerce(args[0]); if (typeof args[0] !== "string") { args.unshift("%O"); } let index2 = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { if (match === "%%") { return "%"; } index2++; const formatter = createDebug.formatters[format]; if (typeof formatter === "function") { const val = args[index2]; match = formatter.call(self, val); args.splice(index2, 1); index2--; } return match; }); createDebug.formatArgs.call(self, args); const logFn = self.log || createDebug.log; logFn.apply(self, args); } debug2.namespace = namespace; debug2.useColors = createDebug.useColors(); debug2.color = createDebug.selectColor(namespace); debug2.extend = extend; debug2.destroy = createDebug.destroy; Object.defineProperty(debug2, "enabled", { enumerable: true, configurable: false, get: () => { if (enableOverride !== null) { return enableOverride; } if (namespacesCache !== createDebug.namespaces) { namespacesCache = createDebug.namespaces; enabledCache = createDebug.enabled(namespace); } return enabledCache; }, set: (v) => { enableOverride = v; } }); if (typeof createDebug.init === "function") { createDebug.init(debug2); } return debug2; } function extend(namespace, delimiter) { const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); newDebug.log = this.log; return newDebug; } function enable(namespaces) { createDebug.save(namespaces); createDebug.namespaces = namespaces; createDebug.names = []; createDebug.skips = []; const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(" ", ",").split(",").filter(Boolean); for (const ns of split) { if (ns[0] === "-") { createDebug.skips.push(ns.slice(1)); } else { createDebug.names.push(ns); } } } function matchesTemplate(search, template) { let searchIndex = 0; let templateIndex = 0; let starIndex = -1; let matchIndex = 0; while (searchIndex < search.length) { if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) { if (template[templateIndex] === "*") { starIndex = templateIndex; matchIndex = searchIndex; templateIndex++; } else { searchIndex++; templateIndex++; } } else if (starIndex !== -1) { templateIndex = starIndex + 1; matchIndex++; searchIndex = matchIndex; } else { return false; } } while (templateIndex < template.length && template[templateIndex] === "*") { templateIndex++; } return templateIndex === template.length; } function disable() { const namespaces = [ ...createDebug.names, ...createDebug.skips.map((namespace) => "-" + namespace) ].join(","); createDebug.enable(""); return namespaces; } function enabled(name) { for (const skip2 of createDebug.skips) { if (matchesTemplate(name, skip2)) { return false; } } for (const ns of createDebug.names) { if (matchesTemplate(name, ns)) { return true; } } return false; } function coerce(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } function destroy() { console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); } createDebug.enable(createDebug.load()); return createDebug; } module2.exports = setup2; } }); // node_modules/debug/src/browser.js var require_browser = __commonJS({ "node_modules/debug/src/browser.js"(exports2, module2) { exports2.formatArgs = formatArgs; exports2.save = save; exports2.load = load; exports2.useColors = useColors; exports2.storage = localstorage(); exports2.destroy = /* @__PURE__ */ (() => { let warned = false; return () => { if (!warned) { warned = true; console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); } }; })(); exports2.colors = [ "#0000CC", "#0000FF", "#0033CC", "#0033FF", "#0066CC", "#0066FF", "#0099CC", "#0099FF", "#00CC00", "#00CC33", "#00CC66", "#00CC99", "#00CCCC", "#00CCFF", "#3300CC", "#3300FF", "#3333CC", "#3333FF", "#3366CC", "#3366FF", "#3399CC", "#3399FF", "#33CC00", "#33CC33", "#33CC66", "#33CC99", "#33CCCC", "#33CCFF", "#6600CC", "#6600FF", "#6633CC", "#6633FF", "#66CC00", "#66CC33", "#9900CC", "#9900FF", "#9933CC", "#9933FF", "#99CC00", "#99CC33", "#CC0000", "#CC0033", "#CC0066", "#CC0099", "#CC00CC", "#CC00FF", "#CC3300", "#CC3333", "#CC3366", "#CC3399", "#CC33CC", "#CC33FF", "#CC6600", "#CC6633", "#CC9900", "#CC9933", "#CCCC00", "#CCCC33", "#FF0000", "#FF0033", "#FF0066", "#FF0099", "#FF00CC", "#FF00FF", "#FF3300", "#FF3333", "#FF3366", "#FF3399", "#FF33CC", "#FF33FF", "#FF6600", "#FF6633", "#FF9900", "#FF9933", "#FFCC00", "#FFCC33" ]; function useColors() { if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) { return true; } if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } let m; return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); } function formatArgs(args) { args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff); if (!this.useColors) { return; } const c = "color: " + this.color; args.splice(1, 0, c, "color: inherit"); let index2 = 0; let lastC = 0; args[0].replace(/%[a-zA-Z%]/g, (match) => { if (match === "%%") { return; } index2++; if (match === "%c") { lastC = index2; } }); args.splice(lastC, 0, c); } exports2.log = console.debug || console.log || (() => { }); function save(namespaces) { try { if (namespaces) { exports2.storage.setItem("debug", namespaces); } else { exports2.storage.removeItem("debug"); } } catch (error) { } } function load() { let r; try { r = exports2.storage.getItem("debug"); } catch (error) { } if (!r && typeof process !== "undefined" && "env" in process) { r = process.env.DEBUG; } return r; } function localstorage() { try { return localStorage; } catch (error) { } } module2.exports = require_common()(exports2); var { formatters } = module2.exports; formatters.j = function(v) { try { return JSON.stringify(v); } catch (error) { return "[UnexpectedJSONParseError]: " + error.message; } }; } }); // node_modules/has-flag/index.js var require_has_flag = __commonJS({ "node_modules/has-flag/index.js"(exports2, module2) { "use strict"; module2.exports = (flag, argv = process.argv) => { const prefix2 = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--"; const position = argv.indexOf(prefix2 + flag); const terminatorPosition = argv.indexOf("--"); return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); }; } }); // node_modules/supports-color/index.js var require_supports_color = __commonJS({ "node_modules/supports-color/index.js"(exports2, module2) { "use strict"; var os = require("os"); var tty = require("tty"); var hasFlag = require_has_flag(); var { env } = process; var forceColor; if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) { forceColor = 0; } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { forceColor = 1; } if ("FORCE_COLOR" in env) { if (env.FORCE_COLOR === "true") { forceColor = 1; } else if (env.FORCE_COLOR === "false") { forceColor = 0; } else { forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3); } } function translateLevel(level) { if (level === 0) { return false; } return { level, hasBasic: true, has256: level >= 2, has16m: level >= 3 }; } function supportsColor(haveStream, streamIsTTY) { if (forceColor === 0) { return 0; } if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { return 3; } if (hasFlag("color=256")) { return 2; } if (haveStream && !streamIsTTY && forceColor === void 0) { return 0; } const min = forceColor || 0; if (env.TERM === "dumb") { return min; } if (process.platform === "win32") { const osRelease = os.release().split("."); if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { return Number(osRelease[2]) >= 14931 ? 3 : 2; } return 1; } if ("CI" in env) { if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") { return 1; } return min; } if ("TEAMCITY_VERSION" in env) { return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; } if (env.COLORTERM === "truecolor") { return 3; } if ("TERM_PROGRAM" in env) { const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); switch (env.TERM_PROGRAM) { case "iTerm.app": return version >= 3 ? 3 : 2; case "Apple_Terminal": return 2; } } if (/-256(color)?$/i.test(env.TERM)) { return 2; } if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { return 1; } if ("COLORTERM" in env) { return 1; } return min; } function getSupportLevel(stream) { const level = supportsColor(stream, stream && stream.isTTY); return translateLevel(level); } module2.exports = { supportsColor: getSupportLevel, stdout: translateLevel(supportsColor(true, tty.isatty(1))), stderr: translateLevel(supportsColor(true, tty.isatty(2))) }; } }); // node_modules/debug/src/node.js var require_node = __commonJS({ "node_modules/debug/src/node.js"(exports2, module2) { var tty = require("tty"); var util = require("util"); exports2.init = init; exports2.log = log; exports2.formatArgs = formatArgs; exports2.save = save; exports2.load = load; exports2.useColors = useColors; exports2.destroy = util.deprecate( () => { }, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`." ); exports2.colors = [6, 2, 3, 4, 5, 1]; try { const supportsColor = require_supports_color(); if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { exports2.colors = [ 20, 21, 26, 27,